@vellumai/web 0.10.8 → 0.10.9-dev.202607152225.ec6fdbf
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-s1Z1HHWx.js → AnimatePresence-TZWSGjkI.js} +1 -1
- package/dist/assets/{BundleConfirmPage-C6bP7QB3.js → BundleConfirmPage-DgcqY17E.js} +1 -1
- package/dist/assets/{Combination-Cd_aWAsj.js → Combination-BJXmG5wD.js} +1 -1
- package/dist/assets/{a2a-invite-B9cylfIO.js → a2a-invite-hUo4WSAL.js} +1 -1
- package/dist/assets/{about-page-XGv9RAQu.js → about-page-BXF1KCN9.js} +1 -1
- package/dist/assets/account-page-BtKfeSgV.js +1 -0
- package/dist/assets/{account-shell-CdhP9l8T.js → account-shell-BVt4WGoT.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-B1-zyOUe.js → acp-run-detail-panel-dcYWtQOo.js} +4 -4
- package/dist/assets/activity-steps-panel-GH3dyhG2.js +1 -0
- package/dist/assets/{add-credits-modal-PP1PX8Qv.js → add-credits-modal-XShL7AQ5.js} +1 -1
- package/dist/assets/ai-page-P438M1mx.js +1 -0
- package/dist/assets/animated-avatar-Y-A_0vmk.js +1 -0
- package/dist/assets/{api-_7pKLlYA.js → api-BsCfy4XV.js} +1 -1
- package/dist/assets/{api-BsQZ81K5.js → api-Dj9Z-j-6.js} +1 -1
- package/dist/assets/{api-key-screen-DTSP_-Da.js → api-key-screen-D5mqS5uB.js} +1 -1
- package/dist/assets/app-types-CTJGOi24.js +1 -0
- package/dist/assets/archive-redirect-page-BzPbcTFb.js +1 -0
- package/dist/assets/arrow-left-C2re-gYj.js +1 -0
- package/dist/assets/{assistant-feature-flag-store-DA8Oj9Mf.js → assistant-feature-flag-store-eHqy0FOb.js} +1 -1
- package/dist/assets/assistant-identity-store-Bc4hbSCe.js +1 -0
- package/dist/assets/assistant-status-panel-Dnnejpmx.js +1 -0
- package/dist/assets/auth-store-Ce9wqr8c.js +2 -0
- package/dist/assets/background-task-detail-panel-Dr2O-AOO.js +1 -0
- package/dist/assets/ban-Ih5bAOHZ.js +1 -0
- package/dist/assets/{bell-BQLonLMp.js → bell-BbESwsZk.js} +1 -1
- package/dist/assets/billing-page-Cuir7xDL.js +3 -0
- package/dist/assets/{bookmark-CNrithFf.js → bookmark-Dzconbsv.js} +1 -1
- package/dist/assets/{bookmarks-page-CjcavZv8.js → bookmarks-page-IeNT-se-.js} +1 -1
- package/dist/assets/{brain-BLDXGaUy.js → brain-CMiHVWFK.js} +1 -1
- package/dist/assets/browser-CUdEL48R.js +2 -0
- package/dist/assets/{bug-BsuQ5ciQ.js → bug-YmXTm_XW.js} +1 -1
- package/dist/assets/{build-state-PUXrUU4W.js → build-state-Cc8lgfTd.js} +1 -1
- package/dist/assets/button-BQVYX8n_.js +1 -0
- package/dist/assets/{calendar-h-mv1itX.js → calendar-D0labpMU.js} +1 -1
- package/dist/assets/card-D8zyWtZh.js +1 -0
- package/dist/assets/channels-page-route-HVoMtCIE.js +9 -0
- package/dist/assets/chat-CPqIbgZQ.js +1 -0
- package/dist/assets/chat-markdown-message-DekUplzJ.js +2 -0
- package/dist/assets/check-wF3S-AV4.js +1 -0
- package/dist/assets/checkbox-m-fy9ift.js +1 -0
- package/dist/assets/{chevron-down-qD-re7AW.js → chevron-down-DpYf9Gwq.js} +1 -1
- package/dist/assets/chevron-left-B_RAz34t.js +1 -0
- package/dist/assets/chevron-right-jRymmL7S.js +1 -0
- package/dist/assets/{chevron-up-3jCod9LW.js → chevron-up-DHI-QRpz.js} +1 -1
- package/dist/assets/{chunk-5KNZJZUH-DdS6bb-3.js → chunk-5KNZJZUH-SU6Q_tDT.js} +1 -1
- package/dist/assets/{circle-alert-zOqdmf25.js → circle-alert-CTnM6GCb.js} +1 -1
- package/dist/assets/circle-check-DqvTjWle.js +1 -0
- package/dist/assets/{client-feature-flag-store-DkJl-g9A.js → client-feature-flag-store-BWSPRAZI.js} +1 -1
- package/dist/assets/{client-identity-CadrtY_b.js → client-identity-C1M6QeKU.js} +1 -1
- package/dist/assets/{clipboard-copy-DF6K1xc6.js → clipboard-copy-DbekAYi3.js} +1 -1
- package/dist/assets/{cloud-off-Db1nySkc.js → cloud-off-Cj66Ozsp.js} +1 -1
- package/dist/assets/code-D1zl7aOd.js +1 -0
- package/dist/assets/{command-palette-6o4m7BM9.js → command-palette-D0KUPO0z.js} +1 -1
- package/dist/assets/{command-palette-window-page-BsJlr5bh.js → command-palette-window-page-C7FWkvBe.js} +1 -1
- package/dist/assets/{community-page-CJA4JfuC.js → community-page-DdajiWNT.js} +1 -1
- package/dist/assets/{confirm-dialog-CSkhRFRk.js → confirm-dialog-kE8y7s20.js} +1 -1
- package/dist/assets/{connect-page-DZgU3jCf.js → connect-page-8DGIdo6r.js} +1 -1
- package/dist/assets/consent-Bg13wifR.js +1 -0
- package/dist/assets/{consent-controls-Cnr1DzCr.js → consent-controls-9HzLiDGE.js} +1 -1
- package/dist/assets/{contacts-gateway-CW5CipBv.js → contacts-gateway-DsqzGIxS.js} +1 -1
- package/dist/assets/contacts-page-route-DKRLyHc9.js +1 -0
- package/dist/assets/{conversation-list-fetchers-DS9vmqfD.js → conversation-list-fetchers-CQ_dcy46.js} +1 -1
- package/dist/assets/{cpu-BJuB2Khn.js → cpu-CEyjQpZz.js} +1 -1
- package/dist/assets/{credential-entry-page-9H2HOu88.js → credential-entry-page-Bz05OQ1l.js} +1 -1
- package/dist/assets/credentials-page-DQUaGcSk.js +1 -0
- package/dist/assets/{credit-card-BuyWdO9t.js → credit-card-BY-vD21O.js} +1 -1
- package/dist/assets/danger-zone-redirect-page-BObfZbXc.js +1 -0
- package/dist/assets/debug-page-CHEFIcwt.js +4 -0
- package/dist/assets/{deploy-dialogs-paL_zcvG.js → deploy-dialogs-CHO7qgXb.js} +1 -1
- package/dist/assets/detail-card-ft5Na6Jw.js +1 -0
- package/dist/assets/{detail-panel-stop-button-y7O3HqJj.js → detail-panel-stop-button-DFd5vXbh.js} +1 -1
- package/dist/assets/developer-page-D5TyzQhJ.js +1 -0
- package/dist/assets/device-settings-BBwtGKJb.js +1 -0
- package/dist/assets/devices-redirect-page-C1LQBzrn.js +1 -0
- package/dist/assets/{diagnostics-COsnZMe5.js → diagnostics-BbfP585e.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BkEBWrWm.js → dictation-overlay-page-DButFzu3.js} +1 -1
- package/dist/assets/{dist-CxHeCOEv.js → dist-Btg1osd6.js} +1 -1
- package/dist/assets/{dist-DqmYHxdg.js → dist-CxzJhU4a.js} +1 -1
- package/dist/assets/dist-Df9Kbc9v.js +1 -0
- package/dist/assets/{dist-HJ505Xnn.js → dist-URk13ITj.js} +1 -1
- package/dist/assets/document-viewer-page-ChwaY2Gu.js +1 -0
- package/dist/assets/{domain-field-C5a2iMot.js → domain-field-DKKi4dF-.js} +1 -1
- package/dist/assets/{download-CAuK-nZ6.js → download-B6XjnEzx.js} +1 -1
- package/dist/assets/dropdown-BxYrCXBS.js +1 -0
- package/dist/assets/edge-swipe-arbiter-store-CdpmheQU.js +1 -0
- package/dist/assets/effective-timezone-D6A5ISj1.js +1 -0
- package/dist/assets/{emails-page-7c9kVi_k.js → emails-page-DsPeayRI.js} +1 -1
- package/dist/assets/esm-BIBV_tQW.js +1 -0
- package/dist/assets/esm-BpVuRCaK.js +2 -0
- package/dist/assets/{esm-CT8NUp3h.js → esm-BtlRHesG.js} +2 -2
- package/dist/assets/esm-C0eM5us1.js +2 -0
- package/dist/assets/esm-Cjx6Josx.js +2 -0
- package/dist/assets/esm-_n61e_LE.js +2 -0
- package/dist/assets/esm-p7tDK3Q-.js +2 -0
- package/dist/assets/{external-link-Dqpx9nRm.js → external-link-Cczz6xJ4.js} +1 -1
- package/dist/assets/eye-C2rSrbD-.js +1 -0
- package/dist/assets/eye-off-BQ9J3pF2.js +1 -0
- package/dist/assets/feature-flag-catalog-CAYgyMOh.js +1 -0
- package/dist/assets/{file-DsyJLS2u.js → file-C8pjlmtk.js} +1 -1
- package/dist/assets/file-editor-BzlaskSf.js +1 -0
- package/dist/assets/file-markdown-wMH_OULm.js +2 -0
- package/dist/assets/{file-text-CYJz-GvF.js → file-text-DA128T4K.js} +1 -1
- package/dist/assets/folder-open-7DKBH5WB.js +1 -0
- package/dist/assets/general-page-DUGHbJWs.js +1 -0
- package/dist/assets/{globe-4qSOWE2N.js → globe-inD5tOKN.js} +1 -1
- package/dist/assets/haptics-CBEu5JKM.js +2 -0
- package/dist/assets/{hard-drive-rDxhoRUm.js → hard-drive-BXh9qCfi.js} +1 -1
- package/dist/assets/hatching-screen-BfL6mMQl.js +1 -0
- package/dist/assets/home-page-route-CRwgwG7m.js +1 -0
- package/dist/assets/{hosting-screen-BZLZular.js → hosting-screen-CiNC7D5K.js} +1 -1
- package/dist/assets/identity-page-route-CWHBHNdp.js +7 -0
- package/dist/assets/index-31nbLUeS.js +209 -0
- package/dist/assets/index-Bp6Atcow.css +2 -0
- package/dist/assets/{info-DsOyuMO9.js → info-DLFMsCl-.js} +1 -1
- package/dist/assets/ingest-B0ofnlye.js +1 -0
- package/dist/assets/input-6HVXMszw.js +1 -0
- package/dist/assets/inspect-page-CU5v4vjm.js +9 -0
- package/dist/assets/integrations-page-Bf9wNW1o.js +1 -0
- package/dist/assets/intelligence-layout-BnPHR15j.js +1 -0
- package/dist/assets/{key-round-CD3JWrs1.js → key-round-BggUE1Ns.js} +1 -1
- package/dist/assets/keyboard-shortcuts-redirect-page-ChK4kTis.js +1 -0
- package/dist/assets/latest-assistant-text-B12Sw3_u.js +24 -0
- package/dist/assets/library-detail-page-DBg_wsW2.js +1 -0
- package/dist/assets/library-page-BLEm33Z3.js +1 -0
- package/dist/assets/{link-2-4bMylQ5v.js → link-2-YnZe-oMg.js} +1 -1
- package/dist/assets/list-row-B9k-FoZv.js +1 -0
- package/dist/assets/loader-circle-C9QrtO3C.js +1 -0
- package/dist/assets/{local-mode-grqHUoNh.js → local-mode-Bskd5bsT.js} +1 -1
- package/dist/assets/{log-in--aqELu3z.js → log-in-Xv-AVlu8.js} +1 -1
- package/dist/assets/{login-flow-B6q00uIW.js → login-flow-CmlnYi0j.js} +1 -1
- package/dist/assets/login-page-CGHvLIez.js +1 -0
- package/dist/assets/{logout-page-BV0URcAd.js → logout-page-DuPCZ90A.js} +1 -1
- package/dist/assets/logs-layout-BRxIej3c.js +1 -0
- package/dist/assets/memory-page-route-pnpeSii_.js +1 -0
- package/dist/assets/{memory-router-playground-page-CQxX6mCn.js → memory-router-playground-page-LGFJw3s7.js} +1 -1
- package/dist/assets/menu-CLA56vz8.js +1 -0
- package/dist/assets/{messages-Bl6a3LUN.js → messages-DBgRkgBa.js} +2 -2
- package/dist/assets/{metric-card-DvXjHVCV.js → metric-card-C3DDH1u1.js} +1 -1
- package/dist/assets/mic-Dmvwrxe8.js +1 -0
- package/dist/assets/{middleware-pbPQ0upo.js → middleware-DL-IveDQ.js} +1 -1
- package/dist/assets/{minimize-2-Clnet2W7.js → minimize-2-B8VHIj-G.js} +1 -1
- package/dist/assets/{misc-BYQPh7vS.js → misc-CS-Pktrv.js} +1 -1
- package/dist/assets/mobile-sidebar-drawer-CfUSy_Ou.js +1 -0
- package/dist/assets/modal-bIQsMU63.js +1 -0
- package/dist/assets/{monitor-DfbL8_59.js → monitor-Cy7Q70-7.js} +1 -1
- package/dist/assets/{moon-B8qiwjrW.js → moon-jDX7sipq.js} +1 -1
- package/dist/assets/mutation-error-CFLGO21o.js +1 -0
- package/dist/assets/native-biometric-BvCjSInu.js +6 -0
- package/dist/assets/{native-file-DI99Emal.js → native-file-C6oXU5FE.js} +2 -2
- package/dist/assets/notice-BiZA71pR.js +1 -0
- package/dist/assets/notifications-page-clztNuMl.js +1 -0
- package/dist/assets/{oauth-complete-page-BlJm9tRJ.js → oauth-complete-page-BK-eCVgQ.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BqUopTat.js → oauth-popup-complete-page-Cs2egwq6.js} +1 -1
- package/dist/assets/onboarding-store-tqBxGvkR.js +1 -0
- package/dist/assets/page-shell-BvXbg7Db.js +1 -0
- package/dist/assets/{pairing-page-B5GrCx4C.js → pairing-page-BE4ph4ik.js} +1 -1
- package/dist/assets/panel-item-CfuwAm7q.js +1 -0
- package/dist/assets/password-reset-page-8SeFGA1l.js +1 -0
- package/dist/assets/{pencil-CUIr0IFo.js → pencil-BOTCmXXR.js} +1 -1
- package/dist/assets/personality-page-DncIme1O.js +1 -0
- package/dist/assets/platform-detection-BTuzpl34.js +1 -0
- package/dist/assets/platform-loopback-page-LBbH5z8z.js +1 -0
- package/dist/assets/{plugin-detail-page-Byuqbr1N.js → plugin-detail-page-CiUmOJx4.js} +1 -1
- package/dist/assets/plugins-page-DGpvzJ6A.js +1 -0
- package/dist/assets/plugins-surface-B2vYGNIS.js +1 -0
- package/dist/assets/plus-D54jrPDF.js +1 -0
- package/dist/assets/popover-rW459udD.js +1 -0
- package/dist/assets/prechat-route-Blw5oByr.js +1 -0
- package/dist/assets/prefs-BhGkdtWC.js +1 -0
- package/dist/assets/privacy-page-DtJ7Ta9Q.js +1 -0
- package/dist/assets/privacy-screen-DCmdN-F6.js +1 -0
- package/dist/assets/{usage-window-C6gWu5Qu.js → profile-metadata-CbcuGTHP.js} +1 -1
- package/dist/assets/progress-bar-Wa6qo8OT.js +1 -0
- package/dist/assets/provider-callback-page-DqiHRsf7.js +1 -0
- package/dist/assets/{provider-key-3AHnKoz9.js → provider-key-BIMvWJCe.js} +1 -1
- package/dist/assets/provider-signup-page-D5rIiZ2o.js +1 -0
- package/dist/assets/puzzle-0_oQwgsv.js +1 -0
- package/dist/assets/{quick-input-page-Cv_CzapK.js → quick-input-page-BEwEfXyk.js} +1 -1
- package/dist/assets/react-query.gen-DjmYXavs.js +1 -0
- package/dist/assets/react-query.gen-JxTd3SS8.js +1 -0
- package/dist/assets/{refresh-cw-DevIHL7J.js → refresh-cw-BkscUrbN.js} +1 -1
- package/dist/assets/{remote-gateway-session-CbBWrPZH.js → remote-gateway-session-CBKZhJak.js} +1 -1
- package/dist/assets/{repeat-C8Im6j--.js → repeat-BRYsTqh_.js} +1 -1
- package/dist/assets/research-mock-page-VikWGUam.js +1 -0
- package/dist/assets/research-onboarding-route-BiLio9x3.js +42 -0
- package/dist/assets/{resize-errors-DqIkO0UI.js → resize-errors-yH10K9Qq.js} +1 -1
- package/dist/assets/{resolved-assistants-store-BSZbT8Ju.js → resolved-assistants-store-DAzPZ1eV.js} +1 -1
- package/dist/assets/{return-to-BwxkOGDI.js → return-to-ugSGJ0dm.js} +1 -1
- package/dist/assets/review-terms-screen-DybxZzqn.js +1 -0
- package/dist/assets/risk-b98f7VDW.js +3 -0
- package/dist/assets/routes-Bzvx8bnp.js +1 -0
- package/dist/assets/schedules-oC-weaYP.js +1 -0
- package/dist/assets/{sdk.gen-BwnFjFcp.js → sdk.gen-CFgJ4K6f.js} +1 -1
- package/dist/assets/sdk.gen-Z7XkRg5O.js +1 -0
- package/dist/assets/security-redirect-page-GKy7eRUs.js +1 -0
- package/dist/assets/{select-assistant-screen-Br-PNDO1.js → select-assistant-screen-BFDxdgLn.js} +1 -1
- package/dist/assets/{setting-row-CUka7_L9.js → setting-row-f2idXB8B.js} +1 -1
- package/dist/assets/settings-divider-BPEDTMBU.js +1 -0
- package/dist/assets/settings-layout-BlQX4ZgU.js +1 -0
- package/dist/assets/share-feedback-modal-CsAJJ_oZ.js +1 -0
- package/dist/assets/shield-check-kgUZeU9b.js +1 -0
- package/dist/assets/{sidebar-tree-C1_LiBB9.js → sidebar-tree-Osepkg7m.js} +1 -1
- package/dist/assets/signup-page-CL3T-Z4a.js +1 -0
- package/dist/assets/{signup-shell-DufHA5do.js → signup-shell-C2c8tEWo.js} +1 -1
- package/dist/assets/site-favicon-Bf4BKQG1.js +1 -0
- package/dist/assets/skill-detail-page-B1AuSkFK.js +1 -0
- package/dist/assets/{skill-detail-panel-BGoRUWNU.js → skill-detail-panel-CeOWb3Bf.js} +1 -1
- package/dist/assets/{skills-AtSQBwXr.js → skills-ByKs3Zjf.js} +1 -1
- package/dist/assets/skills-page-HoaDTYTI.js +1 -0
- package/dist/assets/{sound-manager-6UbdgQrj.js → sound-manager-DUFvLLrG.js} +1 -1
- package/dist/assets/sounds-redirect-page-BE1uLXxt.js +1 -0
- package/dist/assets/{sparkles-PGiR5v1g.js → sparkles-BK3KXCjl.js} +1 -1
- package/dist/assets/{src-zsLiFPw3.js → src-A8hMQd90.js} +39 -39
- package/dist/assets/{subagent-detail-panel-BGuVa8-m.js → subagent-detail-panel-DQJPOafB.js} +2 -2
- package/dist/assets/{subagent-store-Bz4irJre.js → subagent-store-UK3sycHi.js} +1 -1
- package/dist/assets/system-events-page-f63DiHJ0.js +1 -0
- package/dist/assets/system-events-redirect-page-BxksRhif.js +1 -0
- package/dist/assets/tag-D0AE0-aA.js +1 -0
- package/dist/assets/theme-preferences-DW9WTu2f.js +1 -0
- package/dist/assets/theme-stage-page-Bo5V4ZDW.js +1 -0
- package/dist/assets/{tiptap-document-editor-C-eOEBR_.js → tiptap-document-editor-ChljO0fw.js} +2 -2
- package/dist/assets/toast-B5Hr1kIL.js +1 -0
- package/dist/assets/toggle-CWrJ2t4S.js +1 -0
- package/dist/assets/{tool-detail-panel-wAuQ7gi8.js → tool-detail-panel-_oXYE81O.js} +2 -2
- package/dist/assets/{triangle-alert-Z0Gq0IuB.js → triangle-alert-CnjNKhNx.js} +1 -1
- package/dist/assets/typography-Cqi8q9o7.js +1 -0
- package/dist/assets/{upgrade-cancel-page-BGgPmDmT.js → upgrade-cancel-page-C4sJ4IHi.js} +1 -1
- package/dist/assets/{upgrade-success-page-TJBopZ0Z.js → upgrade-success-page-v7UtvYeb.js} +1 -1
- package/dist/assets/usage-redirect-page-DlxixrFd.js +1 -0
- package/dist/assets/{use-active-assistant-id-BWXi63qg.js → use-active-assistant-id-KipCgPNT.js} +1 -1
- package/dist/assets/use-assistant-identity-details-BpbmaZva.js +1 -0
- package/dist/assets/{use-edge-swipe-back-B4XlZ1Iu.js → use-edge-swipe-back-DTpbr5KC.js} +1 -1
- package/dist/assets/use-invite-link-dialog-2FBB54DX.js +1 -0
- package/dist/assets/use-is-org-ready-MUDnKy3r.js +1 -0
- package/dist/assets/use-onboarding-login-_LAXettN.js +1 -0
- package/dist/assets/{use-reduced-motion-Cj0Z8KSf.js → use-reduced-motion-BPBlq9_a.js} +1 -1
- package/dist/assets/use-skill-actions-CrU5Sgk_.js +1 -0
- package/dist/assets/use-skill-categories-BhT4D6gt.js +1 -0
- package/dist/assets/{use-skill-detail-files-Dpp521cY.js → use-skill-detail-files-DNY3WFns.js} +1 -1
- package/dist/assets/{user-plus-DMh4_UTz.js → user-plus-KuzSTM_D.js} +1 -1
- package/dist/assets/{utils-xg2dl_KJ.js → utils-CNB1P-cO.js} +1 -1
- package/dist/assets/{viewer-store-B8-Qnbx9.js → viewer-store-CFywMdJp.js} +1 -1
- package/dist/assets/voice-page-otevqz9B.js +1 -0
- package/dist/assets/{weather-forecast-display-Bix8rpji.js → weather-forecast-display-CcKGlN7f.js} +1 -1
- package/dist/assets/{web-RhBklijR.js → web-BPvLuAGE.js} +1 -1
- package/dist/assets/{web-D8PpvYf_.js → web-BUVD1SEs.js} +1 -1
- package/dist/assets/{web-C1L-cpPj.js → web-Bf269a_Y.js} +1 -1
- package/dist/assets/{web-CJiP8Lg6.js → web-CELqsarU.js} +1 -1
- package/dist/assets/{web-O1LOb-o9.js → web-CFPJ_DoC.js} +1 -1
- package/dist/assets/{web-BD2N6zhd.js → web-DFW5YV0h.js} +1 -1
- package/dist/assets/{web-BaubW4Pp.js → web-DyY0a6OS.js} +1 -1
- package/dist/assets/{web-Duw5A2aP.js → web-KeVAvkzP.js} +1 -1
- package/dist/assets/{welcome-screen-CVI4Hjnt.js → welcome-screen-C8axlf6E.js} +1 -1
- package/dist/assets/workflow-detail-panel-DkqCKrOL.js +1 -0
- package/dist/assets/{workflow-store-B7ofewCi.js → workflow-store-k8Si-dKc.js} +1 -1
- package/dist/assets/workspace-page-CS0P8RFO.js +1 -0
- package/dist/assets/x-BYcSiJRX.js +1 -0
- package/dist/index.html +146 -142
- package/dist/skills/chat-complex-documents/assets/icon.svg +26 -0
- package/package.json +1 -1
- package/dist/assets/account-page-Dno1SeJN.js +0 -1
- package/dist/assets/activity-steps-panel-BGyfMCXK.js +0 -1
- package/dist/assets/advanced-page-vCbMVJsK.js +0 -1
- package/dist/assets/ai-page-BIYybKux.js +0 -1
- package/dist/assets/animated-avatar-Cqpzb8O4.js +0 -1
- package/dist/assets/archive-0aqysuyd.js +0 -1
- package/dist/assets/archive-page-RZ2VP63A.js +0 -1
- package/dist/assets/arrow-left-DI9551VI.js +0 -1
- package/dist/assets/assistant-identity-store-CX03CK8q.js +0 -1
- package/dist/assets/assistant-status-panel-BC0RTDls.js +0 -1
- package/dist/assets/auth-store-C09YAZEu.js +0 -2
- package/dist/assets/background-task-detail-panel-BfnsD-3B.js +0 -1
- package/dist/assets/ban-CVKGuUAQ.js +0 -1
- package/dist/assets/billing-page-1z_L2m6q.js +0 -3
- package/dist/assets/browser-C6a_nhhZ.js +0 -2
- package/dist/assets/button-amTXFI-2.js +0 -1
- package/dist/assets/card-Bv5O5juh.js +0 -1
- package/dist/assets/channels-page-route-WjNmd0sS.js +0 -9
- package/dist/assets/chat-B8mgARYR.js +0 -1
- package/dist/assets/chat-markdown-message-BnX6bhgs.js +0 -2
- package/dist/assets/check-DFNrQERi.js +0 -1
- package/dist/assets/checkbox-EdyezNqo.js +0 -1
- package/dist/assets/chevron-left-BMF1xNfR.js +0 -1
- package/dist/assets/chevron-right-DqqmezXC.js +0 -1
- package/dist/assets/circle-check-VSiny8yl.js +0 -1
- package/dist/assets/cn-C36Yvcac.js +0 -1
- package/dist/assets/code-Czx7d7SK.js +0 -1
- package/dist/assets/contacts-page-route-P0neH-PV.js +0 -1
- package/dist/assets/copy-Cn1FKrEp.js +0 -1
- package/dist/assets/credentials-page-MkKE_19-.js +0 -1
- package/dist/assets/danger-zone-redirect-page-BWg7rn8D.js +0 -1
- package/dist/assets/debug-page-B88f4aDU.js +0 -4
- package/dist/assets/detail-card-xKZlkbz5.js +0 -1
- package/dist/assets/developer-page-BFMS6pwU.js +0 -1
- package/dist/assets/devices-page-B3D5iLhD.js +0 -1
- package/dist/assets/dist-BItmZQO6.js +0 -1
- package/dist/assets/document-viewer-page-B631L6-3.js +0 -1
- package/dist/assets/dropdown-ByHOpeOU.js +0 -1
- package/dist/assets/earn-credits-modal-CFla-iKl.js +0 -1
- package/dist/assets/edge-swipe-arbiter-store-BeOhrE7M.js +0 -1
- package/dist/assets/effective-timezone-C4nukIC4.js +0 -1
- package/dist/assets/esm-B54gzHCZ.js +0 -1
- package/dist/assets/esm-Bzs_witt.js +0 -2
- package/dist/assets/esm-C5J59K0j.js +0 -2
- package/dist/assets/esm-DEu9JbAE.js +0 -2
- package/dist/assets/esm-DZkj1VLJ.js +0 -2
- package/dist/assets/esm-DtJz1M8R.js +0 -2
- package/dist/assets/feature-flag-catalog-GgSNKkqP.js +0 -1
- package/dist/assets/file-editor-sT7eHxsw.js +0 -1
- package/dist/assets/file-markdown-Bq97tNxs.js +0 -2
- package/dist/assets/general-page-D-Gr2lkW.js +0 -1
- package/dist/assets/haptics-lMERs7us.js +0 -2
- package/dist/assets/hatching-screen-BlwicgIz.js +0 -1
- package/dist/assets/home-page-route-D24x4A0S.js +0 -1
- package/dist/assets/identity-page-route-BwOJeenx.js +0 -1
- package/dist/assets/index-C9GrLGul.css +0 -2
- package/dist/assets/index-yu6nDHvG.js +0 -113
- package/dist/assets/input-CoUmPnRU.js +0 -1
- package/dist/assets/inspect-page-1RejwSP_.js +0 -9
- package/dist/assets/integrations-page-BV5BiHPD.js +0 -1
- package/dist/assets/intelligence-layout-iQFO8in_.js +0 -1
- package/dist/assets/keyboard-shortcuts-page-jt13JtxS.js +0 -1
- package/dist/assets/library-detail-page-BAGWt1Lw.js +0 -1
- package/dist/assets/library-page-CqeoBhDY.js +0 -1
- package/dist/assets/list-row-D5MFdbkH.js +0 -1
- package/dist/assets/llm-dimension-DyYwG3mU.js +0 -1
- package/dist/assets/loader-circle-Cz7opInR.js +0 -1
- package/dist/assets/login-page-BQVTWuQc.js +0 -1
- package/dist/assets/logs-layout-DO3yfZqD.js +0 -1
- package/dist/assets/menu-Dy5QbnTj.js +0 -1
- package/dist/assets/mobile-sidebar-drawer-Epbt6p-k.js +0 -1
- package/dist/assets/modal-D5nLWNN9.js +0 -1
- package/dist/assets/mutation-error-DYv0eJ_i.js +0 -1
- package/dist/assets/native-biometric-Czaf9IqI.js +0 -6
- package/dist/assets/notice-DkcNAP8O.js +0 -1
- package/dist/assets/notifications-page-CXaZpD3s.js +0 -1
- package/dist/assets/page-shell-BUGBKCmv.js +0 -1
- package/dist/assets/panel-item-CouW2A55.js +0 -1
- package/dist/assets/password-reset-page-BCk9Si73.js +0 -1
- package/dist/assets/platform-detection-BrxvFUiR.js +0 -1
- package/dist/assets/platform-loopback-page-MZdCPXRI.js +0 -1
- package/dist/assets/plugins-page-Ci0CoSAN.js +0 -1
- package/dist/assets/plugins-surface-z3RTZS4H.js +0 -1
- package/dist/assets/plus-DItfr5ux.js +0 -1
- package/dist/assets/popover-CFL4WZTr.js +0 -1
- package/dist/assets/prechat-route-9JFn-w_1.js +0 -1
- package/dist/assets/prefs-B1Y3q3c8.js +0 -1
- package/dist/assets/privacy-page-BTpvj9ZP.js +0 -1
- package/dist/assets/privacy-screen-CUbVcDf_.js +0 -1
- package/dist/assets/progress-bar-Ca8gmE3B.js +0 -1
- package/dist/assets/provider-callback-page-fB2tIyqL.js +0 -1
- package/dist/assets/provider-signup-page-C4Dn-wtJ.js +0 -1
- package/dist/assets/react-query.gen-C6wVk6Rw.js +0 -1
- package/dist/assets/react-query.gen-DPzPS206.js +0 -1
- package/dist/assets/research-mock-page-1T92rXz3.js +0 -1
- package/dist/assets/research-onboarding-route-CmWgwOFk.js +0 -63
- package/dist/assets/review-terms-screen-DrD4vywk.js +0 -1
- package/dist/assets/risk-Dopd25rc.js +0 -3
- package/dist/assets/routes-BbeIx_F9.js +0 -1
- package/dist/assets/save-aD5JFIZf.js +0 -1
- package/dist/assets/schedules-BfKi12EZ.js +0 -1
- package/dist/assets/sdk.gen-CmKfVpgB.js +0 -1
- package/dist/assets/security-page-BYI7twYM.js +0 -1
- package/dist/assets/settings-layout-lddMUg7A.js +0 -1
- package/dist/assets/share-feedback-modal-DSwfhMsV.js +0 -1
- package/dist/assets/shortcut-keys-B2EE-634.js +0 -1
- package/dist/assets/signup-page-D6hAK-Us.js +0 -1
- package/dist/assets/site-favicon-fQHLTT6F.js +0 -1
- package/dist/assets/skill-detail-page-BlfgTyFC.js +0 -1
- package/dist/assets/skill-icon-cNkD2w1X.js +0 -1
- package/dist/assets/skills-page-DeIiyhVc.js +0 -1
- package/dist/assets/sounds-page-BgLLJ-o9.js +0 -1
- package/dist/assets/stat-square-CTHnQ1jc.js +0 -1
- package/dist/assets/system-events-page-C1hXOYmg.js +0 -1
- package/dist/assets/system-events-redirect-page-DbaFKRXH.js +0 -1
- package/dist/assets/tag-CV4v7fRF.js +0 -1
- package/dist/assets/toast-xTp-xwYL.js +0 -1
- package/dist/assets/toggle-CDfguvUz.js +0 -1
- package/dist/assets/typography-D5f7kt80.js +0 -1
- package/dist/assets/usage-page-DLWFk2P0.js +0 -1
- package/dist/assets/use-bus-subscription-C3H3CmM_.js +0 -1
- package/dist/assets/use-invite-link-dialog-BdnW1BHj.js +0 -1
- package/dist/assets/use-is-org-ready-jhEM-4rY.js +0 -1
- package/dist/assets/use-onboarding-login-B-1jrjFL.js +0 -1
- package/dist/assets/use-skill-actions-BpVxiQZY.js +0 -1
- package/dist/assets/use-skill-categories-CCxtjMC_.js +0 -1
- package/dist/assets/voice-page-BoCTB8Jx.js +0 -1
- package/dist/assets/workflow-detail-panel-CwZH3tDl.js +0 -1
- package/dist/assets/workspace-page-CwIsXk1j.js +0 -1
- package/dist/assets/x-CkSVp1Ok.js +0 -1
- /package/dist/assets/{app-info-Clwt3pCt.js → app-info-AJ6nA0RS.js} +0 -0
- /package/dist/assets/{avatar-bundled-components--1Wyhs4r.js → avatar-bundled-components-DgzHRe6Z.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-CnDf9Ibf.js → avatar-svg-compositor-C_lXkZLZ.js} +0 -0
- /package/dist/assets/{browser-timezone-2SnmKDjM.js → browser-timezone-DjbAts-Z.js} +0 -0
- /package/dist/assets/{build.umd-CxdKgGWo.js → build.umd-CVjrbvyL.js} +0 -0
- /package/dist/assets/{bundle-mjs-BZt35okJ.js → bundle-mjs-CK9sN9wG.js} +0 -0
- /package/dist/assets/{by-tool-use-id-index-BokzI3ZP.js → by-tool-use-id-index-CBaMK-eh.js} +0 -0
- /package/dist/assets/{composer-focus-BZr63Cvs.js → composer-focus-CpeV_gfi.js} +0 -0
- /package/dist/assets/{conversation-selection-BBHkzcfy.js → conversation-selection-DYJPsAjJ.js} +0 -0
- /package/dist/assets/{conversation-store-BljZWolF.js → conversation-store-CnRrUeSu.js} +0 -0
- /package/dist/assets/{createLucideIcon-IRfcSUxS.js → createLucideIcon-Bjb-Kuq7.js} +0 -0
- /package/dist/assets/{definitions-CaYcW4Yq.js → definitions-BaillmRO.js} +0 -0
- /package/dist/assets/{definitions-DScTW2c-.js → definitions-Ce8XXjMI.js} +0 -0
- /package/dist/assets/{dist-DS5iJwBJ2.js → dist-DyRKd0bN2.js} +0 -0
- /package/dist/assets/{domains-D3QF404Q.js → domains-CIIVdIa8.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-BNtUmdK0.js} +0 -0
- /package/dist/assets/{environment-store-C0f32873.js → environment-store-R_3zZFKL.js} +0 -0
- /package/dist/assets/{format-date-CghpPTDc.js → format-date-Cda44k2J.js} +0 -0
- /package/dist/assets/{format-file-size-DzVEncaw.js → format-file-size-BSrdQr7P.js} +0 -0
- /package/dist/assets/{native-deep-link-CJGNy9bj.js → native-deep-link-CbHUZ2h_.js} +0 -0
- /package/dist/assets/{onboarding-step-layout-2XcmxqFN.js → onboarding-step-layout-BfSOxqy3.js} +0 -0
- /package/dist/assets/{optimistic-lifecycle-BvfDBY8o.js → optimistic-lifecycle-CR11Vyrt.js} +0 -0
- /package/dist/assets/{pdf-C3Qukw-J.js → pdf-BjgNZTii.js} +0 -0
- /package/dist/assets/{pointer-Cdz7NGHe.js → pointer-CzC_8USk.js} +0 -0
- /package/dist/assets/{prechat-P1y7ZM6C.js → prechat-Ddpjms85.js} +0 -0
- /package/dist/assets/{prechat-names-clVy5Mee.js → prechat-names-DEWE0LUf.js} +0 -0
- /package/dist/assets/{proxy-o6cPThl2.js → proxy-Cadlowdl.js} +0 -0
- /package/dist/assets/{public-asset-GKv5zCfZ.js → public-asset-Budc22a_.js} +0 -0
- /package/dist/assets/{research-onboarding-persistence-DnuHyFyB.js → research-onboarding-persistence-BmACYjeE.js} +0 -0
- /package/dist/assets/{sdk.gen-BhtkuoSl.js → sdk.gen-C9oZyNeN.js} +0 -0
- /package/dist/assets/{status-badge-pill-0N6rTEBg.js → status-badge-pill-DQHLgr0r.js} +0 -0
- /package/dist/assets/{step-indicator-dots-D03TmFKG.js → step-indicator-dots-iS_Q2OX6.js} +0 -0
- /package/dist/assets/{three-dot-indicator-DNuHHwtA.js → three-dot-indicator-ByrGmGYU.js} +0 -0
- /package/dist/assets/{typed-storage-5IU6qVWg.js → typed-storage-BRvgA7pX.js} +0 -0
- /package/dist/assets/{use-copy-to-clipboard-BCTXSMa-.js → use-copy-to-clipboard-CtO2o7KE.js} +0 -0
- /package/dist/assets/{workflow-status-ZrbiLW5D.js → workflow-status-4RYJ-tdh.js} +0 -0
- /package/dist/assets/{xterm-CBmd_y-b.js → xterm-ChjrCiYv.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-THPW0uy0.js → xterm-addon-fit-D_4nBxep.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./typography-Cqi8q9o7.js";import{t as s}from"./card-D8zyWtZh.js";import{t as c}from"./notice-BiZA71pR.js";import{n as l}from"./toast-B5Hr1kIL.js";import{c as u}from"./routes-Bzvx8bnp.js";import{D as d,Gr as f,Ur as p,Wr as m}from"./index-31nbLUeS.js";var h=e(t(),1),g=a();function _(){let e=f({platformHostedOnly:!0}),t=p(),a=m(),_=i();return(0,h.useEffect)(()=>{t&&(l.info(`Upgrade canceled. No changes to your plan.`,{id:`pro-upgrade-cancel`}),_(u.settings.billing,{replace:!0}))},[_,t]),e===`gated`?(0,g.jsx)(r,{replace:!0,to:u.settings.general}):e===`disabled`?(0,g.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,g.jsx)(d,{children:`Log in to the Vellum platform to manage billing and usage.`})}):!t&&!a?(0,g.jsxs)(`div`,{className:`max-w-4xl space-y-6`,children:[(0,g.jsx)(c,{tone:`warning`,children:`Billing isn't available for the current assistant state.`}),(0,g.jsx)(`div`,{className:`flex justify-end`,children:(0,g.jsx)(n,{variant:`primary`,onClick:()=>_(u.settings.billing,{replace:!0}),children:`Return to billing`})})]}):(0,g.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,g.jsxs)(s,{padding:`lg`,children:[(0,g.jsx)(o,{as:`h1`,variant:`title-large`,children:`Upgrade canceled`}),(0,g.jsx)(o,{as:`p`,variant:`body-medium-default`,className:`mt-2`,children:`Returning you to billing settings…`})]})})}export{_ as UpgradeCancelPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-Cqi8q9o7.js";import{t as l}from"./card-D8zyWtZh.js";import{t as u}from"./circle-alert-CTnM6GCb.js";import{t as d}from"./circle-check-DqvTjWle.js";import{t as f}from"./loader-circle-C9QrtO3C.js";import{t as p}from"./notice-BiZA71pR.js";import{c as m}from"./routes-Bzvx8bnp.js";import{at as h,it as g}from"./react-query.gen-DjmYXavs.js";import{D as _,Gr as v,Ur as y,Wr as b}from"./index-31nbLUeS.js";var x=e(t(),1),S=s(),C=1e3,w=1e4,T=2500;function E(){let e=v({platformHostedOnly:!0}),t=y(),s=b(),c=e===`full`&&t,u=i(),d=a(),[f,E]=(0,x.useState)(!1);(0,x.useEffect)(()=>{d.invalidateQueries({queryKey:h()})},[d]);let{data:j,isError:M}=o({...g(),enabled:c,refetchInterval:e=>e.state.data?.plan_id===`pro`||f?!1:C,refetchIntervalInBackground:!1}),N=c?j:void 0,P=c?M:!1;(0,x.useEffect)(()=>{if(!c)return;let e=setTimeout(()=>E(!0),w);return()=>clearTimeout(e)},[c]);let F=N?.plan_id===`pro`;(0,x.useEffect)(()=>{if(!F)return;let e=setTimeout(()=>{u(m.settings.billing,{replace:!0})},T);return()=>clearTimeout(e)},[F,u]);let I=()=>u(m.settings.billing,{replace:!0});return e===`gated`?(0,S.jsx)(r,{replace:!0,to:m.settings.general}):e===`disabled`?(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsx)(_,{children:`Log in to the Vellum platform to manage billing and usage.`})}):!c&&!s?(0,S.jsxs)(`div`,{className:`max-w-4xl space-y-6`,children:[(0,S.jsx)(p,{tone:`warning`,children:`We can't confirm your upgrade for the current assistant. Return to billing to retry.`}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(n,{variant:`primary`,"data-testid":`upgrade-success-go-to-billing`,onClick:I,children:`Go to billing`})})]}):(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsxs)(l,{padding:`lg`,children:[F?(0,S.jsx)(O,{}):P?(0,S.jsx)(A,{}):f?(0,S.jsx)(k,{}):(0,S.jsx)(D,{}),(F||P||f)&&(0,S.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,S.jsx)(n,{variant:F||P?`primary`:`outlined`,"data-testid":`upgrade-success-go-to-billing`,onClick:I,children:`Go to billing`})})]})})}function D(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(f,{className:`h-6 w-6 animate-spin text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Finalizing your upgrade…`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`Stripe is confirming your subscription. This usually takes a few seconds.`})]})}function O(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(d,{className:`h-8 w-8 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Welcome to Pro`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`Your Pro plan is active. You'll be redirected back to billing in a moment.`})]})}function k(){return(0,S.jsx)(p,{tone:`warning`,children:`We're processing your upgrade — refresh in a moment to see your new plan.`})}function A(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(u,{className:`h-8 w-8 text-[var(--system-negative-strong)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`We hit a problem checking your subscription. Your upgrade may still be processing — return to billing to refresh.`})]})}export{E as UpgradeSuccessPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as e,n as t}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{c as r}from"./routes-Bzvx8bnp.js";var i=n();function a(){let[n]=e(),a=new URLSearchParams(n);return a.set(`tab`,`usage`),(0,i.jsx)(t,{replace:!0,to:`${r.settings.billing}?${a.toString()}`})}export{a as UsageRedirectPage};
|
package/dist/assets/{use-active-assistant-id-BWXi63qg.js → use-active-assistant-id-KipCgPNT.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./resolved-assistants-store-
|
|
1
|
+
import{n as e}from"./resolved-assistants-store-DAzPZ1eV.js";function t(){let t=e.use.activeAssistantId();if(!t)throw Error(`useActiveAssistantId() called outside ActiveAssistantGate — either mount the route under <ActiveAssistantGate> or read the raw store via useResolvedAssistantsStore.use.activeAssistantId().`);return t}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r}from"./button-BQVYX8n_.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import"./src-A8hMQd90.js";import{Lr as o,Mr as s,V as c,_n as l,et as u,gn as d}from"./sdk.gen-CFgJ4K6f.js";import{n as f}from"./api-errors-CrWDzVca.js";import{r as p}from"./api-BsCfy4XV.js";import{t as m}from"./proxy-Cadlowdl.js";import{t as h}from"./use-reduced-motion-BPBlq9_a.js";import{dn as g,pn as _,un as v,yr as y}from"./index-31nbLUeS.js";import{i as b,r as x,t as S}from"./latest-assistant-text-B12Sw3_u.js";var C=e(n(),1),w=a(),T=.25,E=.46,D=.3,O=.85,ee=.4,k=14,A=8;function j({components:e,traits:t,stage:n,entrance:r=!1,entranceDelay:i=0}){let a=h(),{w:o,h:s}=n,[c,l]=(0,C.useState)({x:0,y:0});(0,C.useEffect)(()=>{if(a)return;let e=e=>{l({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[a]);let u=r&&!a,[d,f]=(0,C.useState)(!1),[p,_]=(0,C.useState)(!r);(0,C.useEffect)(()=>{if(a||!p)return;let e=!1,t,n=n=>{e||(f(!0),t=setTimeout(()=>{e||(f(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[a,p,r]);let y=(0,C.useMemo)(()=>{let n=e.eyeStyles.find(e=>e.id===t.eyeStyle);return n?{paths:n.paths,bbox:g(n.paths.map(e=>v(e.svgPath)))}:null},[e,t.eyeStyle]);if(!y||o===0||s===0)return null;let b=o*O,x=Math.min(Math.min(o,s)*D,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,j=(o-S)/2,M=s-(1-T)*x,N=ee*s-(M+x/2),P=(E-T)*x,F=y.bbox.x+y.bbox.w/2,I=y.bbox.y+y.bbox.h/2;return(0,w.jsx)(m.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:j,top:M,width:S,height:x,transformOrigin:`center`},initial:u?{y:N,scale:.35}:!1,animate:u?{y:[N,P,0],scale:[.35,1,1]}:{y:0,scale:1},transition:u?{duration:1,delay:i,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>_(!0),children:(0,w.jsx)(`div`,{style:{transform:`translate(${c.x*k}px, ${c.y*A}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,w.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:S,height:x,style:{overflow:`visible`,display:`block`},children:(0,w.jsx)(`g`,{style:{transform:d?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${F}px ${I}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,w.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})}var M=D*(1-T),N=`#17191C`,P=24,F=.2,I=96,L=160,R=(0,C.createContext)(null);function z(){let e=(0,C.useContext)(R);if(!e)throw Error(`useAssistantStage must be used inside <AssistantStage>`);return e}function B(e,t){return!e||!t?null:e.colors.find(e=>e.id===t.color)?.hex??null}function V({components:e,traits:t,customImageUrl:n,entrance:i=!1,children:a,className:o}){let{ref:s,size:c}=b(),l=B(e,t)??N,u=_(l),d=!!(e&&t),f=!d&&!!n,p=Math.round(Math.min(L,Math.max(I,Math.min(c.w,c.h)*F))),m=c.h-p-P,h=d?Math.round(M*Math.min(c.w,c.h))+16:f?p+P+16:24;return(0,w.jsxs)(`div`,{ref:s,className:r(`relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-[var(--border-base)]`,o),style:{backgroundColor:l,color:u.fg},children:[d&&e&&t&&(0,w.jsx)(j,{components:e,traits:t,stage:c,entrance:i}),f&&n&&(0,w.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2] overflow-hidden rounded-full ring-4 ring-white/25`,style:{left:(c.w-p)/2,top:m,width:p,height:p},children:(0,w.jsx)(`img`,{src:n,alt:``,className:`h-full w-full object-cover`,draggable:!1})}),(0,w.jsx)(R.Provider,{value:{stage:c,tone:u,bottomReserve:h},children:(0,w.jsx)(`div`,{className:`relative z-10 flex min-h-0 flex-1 flex-col`,children:a})})]})}var H=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`},{id:`playful-serious`,left:`Playful`,right:`Serious`},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`}],U=1500,W=12e4,G=e=>new Promise(t=>setTimeout(t,e));async function K({assistantId:e,content:n,title:r,context:i}){let a,o=!1;try{let t=await u({path:{assistant_id:e},body:{conversationType:`standard`,title:r},throwOnError:!1});if(a=t.data?.id,!t.response?.ok||!a)return!1;let i={conversationId:a,content:n,sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await l({path:{assistant_id:e},body:i,throwOnError:!1})).response?.ok)return!1;let s=Date.now()+W,c=``,f=0,p=!1;for(;Date.now()<s;){await G(U);let t=await d({path:{assistant_id:e},query:{conversationId:a},throwOnError:!1}),n=S(t.data?.messages??[]);if(n&&(f=n===c?f+1:0,c=n),t.data?.processing===!0&&(p=!0),x({processing:t.data?.processing,sawProcessing:p,hasReply:n.length>0,stableReads:f})){o=!0;break}}}catch(e){t(e,{context:i})}finally{if(a)try{await c({path:{assistant_id:e,id:a},throwOnError:!1})}catch(e){t(e,{context:`${i}_archive`})}}return o}var q=`data/personality-sliders.json`;function J(e){return[`personality-sliders`,e]}function Y(e){return typeof e!=`object`||!e||Array.isArray(e)?!1:Object.values(e).every(e=>typeof e==`number`)}function X(e){return Object.fromEntries(H.map(t=>[t.id,e[t.id]??50]))}async function Z(e){try{let{data:t,error:n,response:r}=await s({path:{assistant_id:e},query:{path:q},throwOnError:!1});if(f(r,n,`Failed to fetch personality sliders`),!r.ok||!t)return null;let i=JSON.parse(t.content);return Y(i)?i:null}catch{return null}}async function Q(e,t){try{let{error:n,response:r}=await o({path:{assistant_id:e},body:{path:q,content:JSON.stringify(t,null,2),encoding:`utf-8`},throwOnError:!1});return f(r,n,`Failed to save personality sliders`),r.ok}catch{return!1}}function $(e){return[`assistant-identity-details`,e]}function te(e){return i({queryKey:$(e),queryFn:async()=>{let[t,n]=await Promise.all([y(e),p(e).catch(()=>({ok:!1,status:0,error:{}}))]);return{identity:t,createdAt:n.ok?n.data.created:null}}})}export{J as a,H as c,z as d,Z as i,V as l,te as n,Q as o,X as r,K as s,$ as t,B as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./edge-swipe-arbiter-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./edge-swipe-arbiter-store-CdpmheQU.js";import{An as r,kn as i}from"./index-31nbLUeS.js";var a=e(t(),1),o=200,s=180,c=200,l=.25,u=50;function d(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function f({containerRef:e,onBack:t,enabled:f,navKey:p}){let m=(0,a.useRef)(t);(0,a.useLayoutEffect)(()=>{m.current=t},[t]);let h=(0,a.useRef)(!1),g=(0,a.useRef)(new Set),_=(0,a.useRef)(!1),v=n.use.registerBackOwner(),y=n.use.unregisterBackOwner();(0,a.useEffect)(()=>{if(f)return v(),y},[f,v,y]),(0,a.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&d(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform ${o}ms ease-out`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),d(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>d(e),o+u)},C=e=>{e.style.transition=`transform ${s}ms ease-in`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*l);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,m.current(),b(()=>{h.current&&(h.current=!1,d(e))},c*2)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,s+u)};r({enabled:f,onConfirm:()=>{let t=e.current;t&&(t.style.transition=`none`,t.style.willChange=`transform`)},onMove:(t,n)=>{let r=e.current;r&&x(r,i(t,n))},onCommit:()=>{let t=e.current;if(!t){m.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):d(n))}}),(0,a.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),d(t))};t.style.transition=`transform ${c}ms ease-out, opacity ${c}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,c+u);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),d(t)}},[p,e])}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-Cqi8q9o7.js";import{t as c}from"./check-wF3S-AV4.js";import{o as l}from"./list-row-B9k-FoZv.js";import{t as u}from"./link-2-YnZe-oMg.js";import{t as d}from"./loader-circle-C9QrtO3C.js";import{t as f}from"./input-6HVXMszw.js";import{t as p}from"./modal-bIQsMU63.js";import{$t as m,Zt as h,qt as g}from"./sdk.gen-CFgJ4K6f.js";import{G as _,K as v,U as y,W as b,o as x,s as ee,x as S}from"./react-query.gen-JxTd3SS8.js";import{n as C}from"./utils-CNB1P-cO.js";import{n as w,r as T,t as E}from"./api-errors-CrWDzVca.js";import{n as D}from"./sdk.gen-C9oZyNeN.js";import{t as O}from"./assistant-feature-flag-store-eHqy0FOb.js";import{Dt as k,Et as A,a as te,i as j,o as ne,or as M,s as re,sr as N}from"./index-31nbLUeS.js";import{t as P}from"./mutation-error-CFLGO21o.js";import{t as F}from"./a2a-invite-hUo4WSAL.js";function I(e){return e?.trim()||`your assistant`}var L=e(t(),1),R=o(),z=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],B=`trusted_contacts`,V=new Set([`platform`,`a2a`]),H=new Set([`vellum`,`whatsapp`]);function U(e){return H.has(e)}var W={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function G(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function K(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function q({open:e,assistantId:t,onClose:r}){let[i,o]=(0,L.useState)(!1),u=(0,L.useRef)(null),m=(0,L.useRef)(!1),h=a({...y({path:{assistant_id:t}})}),g=(0,L.useRef)(h.mutate);(0,L.useLayoutEffect)(()=>{g.current=h.mutate});let _=(0,L.useRef)(h.reset);(0,L.useLayoutEffect)(()=>{_.current=h.reset}),(0,L.useEffect)(()=>{e&&!m.current&&g.current({path:{assistant_id:t}}),m.current=e},[e,t]),(0,L.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let v=(0,L.useCallback)(()=>{_.current(),o(!1),u.current&&=(clearTimeout(u.current),null),r()},[r]),b=(0,L.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{o(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>o(!1),2e3)})},[]),x=h.isSuccess&&h.data.token?F({senderAssistantId:t,token:h.data.token}):``;return(0,R.jsx)(p.Root,{open:e,onOpenChange:e=>{e||v()},children:(0,R.jsxs)(p.Content,{size:`sm`,children:[(0,R.jsx)(p.Header,{children:(0,R.jsx)(p.Title,{children:`Share Connection Link`})}),(0,R.jsx)(p.Body,{children:h.isPending?(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,R.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):h.isError?(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,R.jsx)(n,{variant:`outlined`,onClick:()=>h.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):h.isSuccess?(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(f,{type:`text`,readOnly:!0,value:x,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>b(x),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,R.jsx)(c,{className:`h-4 w-4`}):(0,R.jsx)(l,{className:`h-4 w-4`})})]}),h.data.expiresAt!=null&&(0,R.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:K(h.data.expiresAt)})]}):null}),(0,R.jsx)(p.Footer,{children:(0,R.jsx)(n,{variant:`outlined`,onClick:v,children:`Done`})})]})})}function J({onClick:e}){return(0,R.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,R.jsx)(u,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function Y(e){return typeof e==`string`&&z.includes(e)}function X(e){return V.has(e)}function Z(e){return(e?.policies??[]).filter(e=>!X(e.channelType)&&!U(e.channelType)).map(e=>({...e,policy:Y(e.policy)?e.policy:`trusted_contacts`}))}async function ie(e,t,n,r){if(X(t))throw new E(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await D({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(w(o,a,`Failed to save channel policy.`),!o.ok)throw new E(o.status,T(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new E(500,`Gateway returned no policy in response.`);return i.policy}var ae=`0.10.0`;function Q(){return C(ae)}function oe(e){let t=r(),n=O.use.channelTrustFloors(),o=Q(),s=n&&o,c=(0,L.useMemo)(()=>({path:{assistant_id:e}}),[e]),l=(0,L.useMemo)(()=>N(c),[c]),u=i({...M(c),enabled:s,select:Z}),d=(0,L.useMemo)(()=>{let e={};for(let t of u.data??[])k(t.channelType)&&(e[t.channelType]=t.policy);return e},[u.data]),f=a({mutationFn:({channelKey:t,policy:n})=>ie(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:l}),onError:P(`Failed to save channel policy`)}),p=(0,L.useCallback)((e,t)=>{f.mutate({channelKey:e,policy:t})},[f]);return s?{policies:d,savingKey:f.isPending?f.variables?.channelKey??null:null,isLoading:u.isPending,isError:u.isError,onChange:p}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var $={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},se=15e3;function ce({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,L.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,L.useMemo)(()=>ee(o),[o]),c=i({...x(o),enabled:!!e,refetchInterval:se,select:e=>e.snapshots}),l=(0,L.useMemo)(()=>le(c.data??[]),[c.data]),u=l.some(e=>e.key===`slack`&&e.status===`ready`),d=i({...b(o),enabled:u,select:e=>e.threadMode}),f=oe(e),p=(0,L.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),y=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await g(n):t===`telegram`?await h(n):t===`phone`&&await m(n)},onSettled:(t,r,i)=>{p(),i===`slack`&&re(n,e)}}),S=te({assistantId:e}),C=ne({assistantId:e}),w=j({assistantId:e}),T=a({...v(),onSuccess:()=>{n.invalidateQueries({queryKey:_(o)})}}),E=S.mutateAsync,D=(0,L.useCallback)(async e=>{await E(e)},[E]),O=C.mutate,k=(0,L.useCallback)((e,t)=>{O({botToken:e,appToken:t})},[O]),A=T.mutate,M=(0,L.useCallback)(t=>{A({path:{assistant_id:e},body:{threadMode:t}})},[A,e]),N=w.mutateAsync,P=(0,L.useCallback)(async(e,t)=>{await N({accountSid:e,authToken:t})},[N]),F=(0,L.useCallback)(e=>{t&&t($[e])},[t]),I=y.mutate,R=(0,L.useCallback)(e=>{I(e)},[I]);return{channels:l,pendingChannelKey:y.isPending?y.variables??null:null,slackThreadMode:d.data,slackThreadModePending:T.isPending,channelPolicies:f.policies,policySavingKey:f.savingKey,policiesLoading:f.isLoading,policiesError:f.isError,onChannelPolicyChange:f.onChange,onSetup:t?F:void 0,onDisconnect:R,onSaveTelegramToken:D,onSaveSlackConfig:k,slackSaveStatus:C.status,slackSaveError:C.error?.message??null,onSlackThreadModeChange:M,onSaveTwilioCredentials:P}}function le(e){let t=new Map;for(let n of e)t.set(n.channel,n);return A.map(e=>{let n=t.get(e);return{key:e,status:ue(n),address:n?.channelHandle??void 0}})}function ue(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function de(e){let t=r(),[n,i]=(0,L.useState)(!1);return{isOpen:n,open:(0,L.useCallback)(()=>{i(!0)},[]),close:(0,L.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:S({path:{assistant_id:e}})})},[t,e])}}export{J as a,z as c,I as d,Z as i,W as l,ce as n,q as o,Q as r,B as s,de as t,G as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,i as t}from"./auth-store-Ce9wqr8c.js";function n(){let n=e.use.currentOrganizationId();return!t()||n!=null}export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{l as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{f as i}from"./native-biometric-BvCjSInu.js";import{c as a}from"./routes-Bzvx8bnp.js";import{n as o,t as s}from"./build-state-Cc8lgfTd.js";import{n as c}from"./login-flow-CmlnYi0j.js";var l=e(t(),1);function u(e){let t=n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=(0,l.useRef)(0);return{loading:u,error:f,login:async()=>{let n=e??o(s({sessionSettled:!0,isAuthenticated:!0}),t.pathname),r=++m.current;p(null),d(!0);try{await i(c,`${a.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==m.current)return;p(`Something went wrong. Please try again.`),d(!1)}},cancel:()=>{m.current++,d(!1),p(null),r()&&window.vellum?.auth?.cancelOAuth()}}}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{c as n,l as r,u as i}from"./proxy-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{c as n,l as r,u as i}from"./proxy-Cadlowdl.js";var a=e(t(),1);function o(){!r.current&&n();let[e]=(0,a.useState)(i.current);return e}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DKhXIxGb.js";import{t as r}from"./useMutation-Lj4VunQV.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./card-D8zyWtZh.js";import{t as o}from"./createLucideIcon-Bjb-Kuq7.js";import{t as s}from"./brain-CMiHVWFK.js";import{t as c}from"./globe-inD5tOKN.js";import{t as l}from"./loader-circle-C9QrtO3C.js";import{t as u}from"./puzzle-0_oQwgsv.js";import{t as d}from"./triangle-alert-CnjNKhNx.js";import"./src-A8hMQd90.js";import{t as f}from"./tag-D0AE0-aA.js";import{lr as p}from"./sdk.gen-CFgJ4K6f.js";import{an as m}from"./react-query.gen-JxTd3SS8.js";import{n as h,r as g,t as _}from"./api-errors-CrWDzVca.js";import{vi as v,xi as y}from"./index-31nbLUeS.js";import{t as b}from"./skills-ByKs3Zjf.js";var x=o(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),S=e(t(),1),C=i();function w({skill:e,className:t,fallback:n=`🧩`}){let[r,i]=(0,S.useState)(!1);return e.icon&&!r?(0,C.jsx)(`img`,{src:`/assistant/skills/${e.id}/${e.icon}`,alt:``,className:`${t} object-contain`,onError:()=>i(!0)}):(0,C.jsx)(`span`,{className:t,children:e.emoji??n})}var T={vellum:{label:`Vellum`,icon:x},clawhub:{label:`Clawhub`,icon:c},skillssh:{label:`skills.sh`,icon:y},custom:{label:`Custom`,icon:v},"assistant-memory":{label:`Assistant's Memory`,icon:s}};function E({origin:e}){let t=e in T?T[e]:{label:e.replace(/-/g,` `),icon:u};return(0,C.jsx)(f,{tone:`neutral`,leftIcon:(0,S.createElement)(t.icon),className:`capitalize`,children:t.label})}function D(e){return e.kind===`installed`||e.kind===`bundled`}function O(e){return e.kind===`catalog`}function k({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:r,children:i}){return(0,C.jsx)(a.Root,{children:(0,C.jsxs)(a.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,C.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,C.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,C.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r}),i]})})}function A(){return(0,C.jsx)(k,{icon:d,iconColor:`var(--system-danger)`,title:`Failed to load skills`,subtitle:`Something went wrong. Try refreshing the page.`})}function j(){return(0,C.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,C.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}async function M(e,t,n){let{data:r,error:i,response:a}=await p({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(h(a,i,`Failed to install skill.`),!a.ok)throw new _(a.status,g(i,a,`Failed to install skill.`));return r??{ok:!0}}function N(e,{onRemoved:t}={}){let i=n(),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(null),d=(0,S.useCallback)(()=>{b(i,e)},[e,i]),f=r({mutationFn:t=>M(e,t),onMutate:e=>o(e),onSettled:()=>{o(null),d()}}),p=m({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),h=(0,S.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),g=(0,S.useCallback)(e=>{u(e)},[]),_=(0,S.useCallback)(()=>{l&&(p.mutate({path:{assistant_id:e,id:l.id}}),u(null))},[e,l,p]),v=(0,S.useCallback)(()=>{u(null)},[]);return{handleInstall:h,handleRemove:g,isInstallingSkill:(0,S.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,S.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:_,cancelRemove:v}}export{O as a,w as c,k as i,x as l,j as n,D as o,A as r,E as s,N as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./button-BQVYX8n_.js";import{t}from"./useQuery-B45lW1Kk.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./createLucideIcon-Bjb-Kuq7.js";import{t as i}from"./calendar-D0labpMU.js";import{t as a}from"./code-D1zl7aOd.js";import{t as o}from"./globe-inD5tOKN.js";import{t as s}from"./link-2-YnZe-oMg.js";import{t as c}from"./mic-Dmvwrxe8.js";import"./src-A8hMQd90.js";import{xt as l}from"./react-query.gen-JxTd3SS8.js";import{Di as u,Gi as d,Qi as f,Ui as p,fi as m,ki as h,na as g}from"./index-31nbLUeS.js";var _=r(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),v={mail:d,calendar:i,"message-circle":p,globe:o,zap:m,code:a,mic:c,"shopping-cart":u,palette:r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),heart:g,settings:h,"link-2":s};function y(e){return v[e]}var b=n();function x({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o=`Skill categories`}){let s=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,b.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o,children:[(0,b.jsx)(S,{icon:f,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),s.map(r=>(0,b.jsx)(S,{icon:y(r.icon)??f,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function S({icon:t,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,b.jsxs)(e,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(t,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,b.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function C(e){return t({...l({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}export{_ as i,x as n,y as r,C as t};
|
package/dist/assets/{use-skill-detail-files-Dpp521cY.js → use-skill-detail-files-DNY3WFns.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{vt as a,yt as o}from"./react-query.gen-JxTd3SS8.js";import{c as s}from"./routes-Bzvx8bnp.js";import{t as c}from"./misc-CS-Pktrv.js";import{wa as l}from"./index-31nbLUeS.js";var u=i();function d({skill:e,className:t,onNavigate:r}){return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,u.jsxs)(n,{to:s.conversation(e.sourceConversationId),onClick:r,className:c(`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)] hover:underline`,t),children:[`Learned from this conversation`,(0,u.jsx)(l,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var f=e(t(),1);function p(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function m(e,t){let[n,i]=(0,f.useState)(null),s=r({...o({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,f.useMemo)(()=>s.data?.files??[],[s.data]),l=(0,f.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=p(c,n),d=r({...a({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:s.isLoading,isFilesPending:s.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{d as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./assistant-identity-store-
|
|
1
|
+
import{t as e}from"./assistant-identity-store-Bc4hbSCe.js";import{n as t,r as n,t as r}from"./semver-DIkpaM51.js";function i(e,t,n={}){return t(e.getState())?Promise.resolve():new Promise(r=>{let i,a=()=>{i!==void 0&&clearTimeout(i),o(),r()},o=e.subscribe(e=>{t(e)&&a()});n.timeoutMs!==void 0&&(i=setTimeout(a,n.timeoutMs))})}function a(t){return s(e.use.version(),t)}function o(t){let n=e.getState().version;return s(n,t)}function s(e,i){if(!e)return!1;let a=n(e),o=n(i);if(!a||!o)return!1;let s=r({...a,pre:null},{...o,pre:null});if(s!==0)return s>0;let c=a.pre!==null&&a.pre.startsWith(`dev`),l=o.pre!==null&&o.pre.startsWith(`dev`);return c&&l?t(a.pre,o.pre)>=0:c===l?!0:c}var c=5e3;function l(t=c){return i(e,e=>!!e.version,{timeoutMs:t})}export{i,a as n,l as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./capture-error-Dhiismgm.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{
|
|
1
|
+
import{t as e}from"./capture-error-Dhiismgm.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{bt as r,n as i}from"./sdk.gen-CFgJ4K6f.js";var a=new Map;function o(e,t){return`${e}::${t}`}function s(e,t){let n=o(e,t),r=a.get(n);return r??(r=i({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw a.delete(n),e}),a.set(n,r)),r}function c(e,t,n){a.set(o(e,t),Promise.resolve(n))}function l(e,t){a.delete(o(e,t))}function u(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function d(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`activity-steps`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`skill-detail`||n===`channel-setup`?e[t]:n}function f(e,t){return e.messageId!=null||t.messageId!=null?e.messageId===t.messageId&&e.groupIndex===t.groupIndex:e.toolCalls[0]?.id===t.toolCalls[0]?.id}function p(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var m={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentSurfaceId:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeActivitySteps:null,viewBeforeActivitySteps:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeSkillDetailId:null,viewBeforeSkillDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0,ruleEditorRequestToolCallId:null},h=n(t()((t,n)=>({...m,setMainView:e=>{n().mainView!==e&&t({mainView:e})},setIntelligenceTab:e=>{n().intelligenceTab!==e&&t({intelligenceTab:e})},openApp:e=>{t({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(r,a)=>{t({mainView:`app`,activeAppId:a,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await i({path:{assistant_id:r,id:a},throwOnError:!0});if(n().activeAppId!==a)return;t({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),c(r,e.appId,e.html)}catch(r){if(n().activeAppId!==a)return;u(r)||e(r,{context:`openApp`}),t({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{t({openedAppState:e})},handleAppLoadFailed:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{t({isAppMinimized:!n().isAppMinimized})},handleAppUnpinned:e=>{let t=n();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(n().closeApp(),!0)},enterAppEditing:()=>{t({mainView:`app-editing`})},exitAppEditing:()=>{t({mainView:`app`})},openSubagentDetail:e=>{t({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:d(n(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{t({mainView:n().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{t({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:d(n(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{t({mainView:n().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{t({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:d(n(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{t({mainView:n().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{t({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:d(n(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{t({mainView:n().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openSkillDetail:e=>{t({mainView:`skill-detail`,activeSkillDetailId:e,viewBeforeSkillDetail:d(n(),`viewBeforeSkillDetail`)})},closeSkillDetail:()=>{t({mainView:n().viewBeforeSkillDetail,activeSkillDetailId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:n().openSubagentDetail(t);return;case`workflow`:n().openWorkflowDetail(t);return;case`acp-run`:n().openAcpRunDetail(t);return;case`background-task`:n().openBackgroundTaskDetail(t);return;default:}},closeActiveDetail:()=>{switch(n().mainView){case`subagent-detail`:n().closeSubagentDetail();return;case`workflow-detail`:n().closeWorkflowDetail();return;case`acp-run-detail`:n().closeAcpRunDetail();return;case`background-task-detail`:n().closeBackgroundTaskDetail();return;default:return}},openChannelSetup:e=>{t({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:d(n(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{t({mainView:n().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&p(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditor:e=>{e&&t(t=>({ruleEditorRequestSeq:t.ruleEditorRequestSeq+1,ruleEditorRequestToolCallId:e}))},openActivitySteps:e=>{t({mainView:`activity-steps`,activeActivitySteps:e,viewBeforeActivitySteps:d(n(),`viewBeforeActivitySteps`)})},toggleActivitySteps:e=>{let t=n(),r=t.activeActivitySteps;t.mainView===`activity-steps`&&r!=null&&f(r,e)?n().closeActivitySteps():n().openActivitySteps(e)},closeActivitySteps:()=>{t({mainView:n().viewBeforeActivitySteps,activeActivitySteps:null})},openDocument:()=>{t({mainView:`document`,openedDocumentState:null,viewBeforeDocument:d(n(),`viewBeforeDocument`)})},loadDocument:async(e,i)=>{let a=d(n(),`viewBeforeDocument`);t({mainView:`document`,activeDocumentSurfaceId:i,openedDocumentState:null,viewBeforeDocument:a});try{let{data:o}=await r({path:{assistant_id:e,id:i},throwOnError:!0});if(n().activeDocumentSurfaceId!==i)return;if(!o){t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null});return}t({openedDocumentState:{surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``}})}catch{if(n().activeDocumentSurfaceId!==i)return;t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null})}},setLoadedDocument:e=>{t({openedDocumentState:e})},updateDocumentContent:(e,r,i)=>{let a=n();if(!a.openedDocumentState||a.openedDocumentState.surfaceId!==e)return;let o=a.openedDocumentState,s=i===`append`?o.content+r:r;t({openedDocumentState:{...o,content:s}})},handleDocumentLoadFailed:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},closeDocument:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},refreshAssets:()=>{t({assetsRefreshKey:n().assetsRefreshKey+1})},reset:()=>t({...m})})));export{s as a,l as i,p as n,c as o,h as r,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-BQVYX8n_.js";import{m as o,t as s}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.js";import{t as l}from"./useQuery-B45lW1Kk.js";import{t as u}from"./useMutation-Lj4VunQV.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-D8zyWtZh.js";import{r as p}from"./middleware-DL-IveDQ.js";import{t as m}from"./chevron-down-DpYf9Gwq.js";import{n as h}from"./list-row-B9k-FoZv.js";import{t as g}from"./info-DLFMsCl-.js";import{j as _,k as v}from"./src-A8hMQd90.js";import{t as y}from"./toggle-CWrJ2t4S.js";import{t as b}from"./dropdown-BxYrCXBS.js";import{At as x,Mt as S,Nt as ee,Ot as C}from"./react-query.gen-JxTd3SS8.js";import{c as w}from"./routes-Bzvx8bnp.js";import{a as T,i as E,n as D,r as te,t as O}from"./sound-manager-DUFvLLrG.js";import{Fi as k,Gn as A,Hn as j,Jn as ne,Kn as M,Un as N,Ut as P,Vn as F,Wn as I,Wt as L,Xn as re,Yn as ie,bi as ae,nr as R,qn as oe,rr as se}from"./index-31nbLUeS.js";import{t as ce}from"./use-active-assistant-id-KipCgPNT.js";import{t as z}from"./detail-card-ft5Na6Jw.js";var B=e(i(),1),V=d();function H({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,V.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,V.jsx)(y,{checked:n,disabled:r,onChange:i,label:e})]})}function U(){return(0,V.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function W({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:s}){let[c,l]=(0,B.useState)(!1),u=n.filter(e=>!t.sounds.includes(e.filename)),d=n.length>0&&u.length===0;return(0,V.jsxs)(`div`,{className:`py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:D[e]}),(0,V.jsx)(y,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${D[e]}`})]}),t.enabled&&(0,V.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:T(e)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,V.jsx)(k,{className:`h-3 w-3`})}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,V.jsx)(ae,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,V.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):d?(0,V.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,V.jsxs)(`div`,{className:`relative inline-block`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,V.jsx)(m,{className:`h-3 w-3`})]}),c&&(0,V.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>l(!1),children:u.map(e=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),l(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function le(){let e=c(),t=ce(),n=(0,B.useMemo)(()=>x({path:{assistant_id:t}}),[t]),r=(0,B.useMemo)(()=>C({path:{assistant_id:t}}),[t]),{data:i}=l(n),{data:a}=l(r),o=i??E(),s=a?.sounds??[],d=(0,B.useMemo)(()=>({path:{assistant_id:t}}),[t]),p=u({...ee(d),onMutate:async t=>{await e.cancelQueries({queryKey:n.queryKey});let r=e.getQueryData(n.queryKey);return S(e,d,t.body),{previous:r}},onError:(t,n,r)=>{r?.previous!==void 0&&S(e,d,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:n.queryKey})}}),m=(0,B.useCallback)(r=>{let i=r(e.getQueryData(n.queryKey)??E());p.mutate({path:{assistant_id:t},body:i})},[t,n.queryKey,e,p]),h=e=>{m(t=>({...t,globalEnabled:e}))},g=e=>{m(t=>({...t,volume:e}))},[_,v]=(0,B.useState)(null),y=_??o.volume,b=(e,t)=>{m(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},w=(e,t)=>{m(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},T=(e,t)=>{m(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},D=()=>{O().previewFallbackBlip(o.volume)},A=e=>{O().previewSound(e,o.volume)};return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(f,{children:[(0,V.jsx)(H,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:o.globalEnabled,onChange:h}),(0,V.jsx)(U,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,V.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:y,onChange:e=>v(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},className:`h-1 w-48 cursor-pointer`,disabled:!o.globalEnabled,"aria-label":`Sound effect volume`}),(0,V.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(y*100),`%`]})]}),(0,V.jsx)(U,{}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,V.jsxs)(`button`,{type:`button`,onClick:D,disabled:!o.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,V.jsx)(k,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,V.jsxs)(f,{children:[(0,V.jsxs)(`div`,{className:`pb-2`,children:[(0,V.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,V.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:te.map(e=>(0,V.jsx)(W,{event:e,eventConfig:o.events[e]??{enabled:!1,sounds:[]},availableSounds:s,globalEnabled:o.globalEnabled,onToggle:t=>b(e,t),onAddSound:t=>w(e,t),onRemoveSound:t=>T(e,t),onPreview:e=>A(e)},e))})]})]})}var ue=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],de=`We recommend keeping both off to start. It feels more like a real conversation.`;function fe(){return(0,V.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Recommended off`})}function pe({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,V.jsx)(fe,{}):null]}),t?(0,V.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,V.jsx)(y,{checked:r,onChange:i,"aria-label":e})]})}function me({showDescription:e=!1,showRecommendedBadge:t=!1}){let n=L.use.showUserTranscript(),r=L.use.showAssistantTranscript(),i=L.use.setShowUserTranscript(),a=L.use.setShowAssistantTranscript(),o={showUserTranscript:{checked:n,onChange:i},showAssistantTranscript:{checked:r,onChange:a}};return(0,V.jsx)(V.Fragment,{children:ue.map(n=>{let r=o[n.prefKey];return(0,V.jsx)(pe,{label:n.label,description:e?n.description:void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var G=`vellum:voice:conversationTimeoutSeconds`,K=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],q={label:`Fn`,activator:N},J=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],Y=`30`,X=`text-body-small-default text-[var(--content-tertiary)]`;function he(){let[e,t]=o(),n=e.get(`tab`)===`sounds`?`sounds`:`voice`;return(0,V.jsx)(`div`,{className:`space-y-6`,children:(0,V.jsxs)(h.Root,{value:n,onValueChange:n=>{let r=new URLSearchParams(e);n===`sounds`?r.set(`tab`,`sounds`):r.delete(`tab`),t(r,{replace:!0})},children:[(0,V.jsxs)(h.List,{children:[(0,V.jsx)(h.Trigger,{value:`voice`,children:`Voice`}),(0,V.jsx)(h.Trigger,{value:`sounds`,children:`Sounds`})]}),(0,V.jsx)(h.Panel,{value:`voice`,className:`pt-4`,children:(0,V.jsx)(ge,{})}),(0,V.jsx)(h.Panel,{value:`sounds`,className:`pt-4`,children:(0,V.jsx)(le,{})})]})})}function ge(){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,V.jsx)(Z,{}),(0,V.jsx)(ve,{}),(0,V.jsx)(ye,{}),(0,V.jsx)(be,{}),(0,V.jsx)(Se,{}),(0,V.jsx)(Ce,{}),(0,V.jsx)(_e,{})]})}function _e(){return(0,V.jsx)(z,{title:`Transcription`,subtitle:`Show live text of what you and the assistant say during a voice conversation.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(me,{showDescription:!0}),(0,V.jsx)(`p`,{className:`${X} pt-1`,children:de})]})})}function Z(){return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--field-bg)] px-3 py-2`,children:[(0,V.jsx)(g,{className:`h-3.5 w-3.5 shrink-0 text-[var(--primary-base)]`}),(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Looking to configure Speech-to-Text or Text-to-Speech models?`}),(0,V.jsxs)(s,{to:w.settings.ai,className:`inline-flex items-center gap-1 text-body-medium-lighter text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Go to Models & Services`,(0,V.jsx)(p,{className:`h-3 w-3`})]})]})}var Q=``;function ve(){let[e,n]=(0,B.useState)([]),[i,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(()=>se()),l=(0,B.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),n(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{n([]),o(!1)}},[]),u=(0,B.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,B.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,B.useMemo)(()=>[{value:Q,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),f=(0,B.useCallback)(e=>{c(e),e===Q?t(R):r(R,e)},[]);return(0,V.jsx)(z,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(b,{options:d,value:d.some(e=>e.value===s)?s:Q,onChange:f,"aria-label":`Microphone`})}),i&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(a,{variant:`outlined`,onClick:u,children:`Allow Microphone Access`}),(0,V.jsx)(`span`,{className:X,children:`Grant microphone access to list your available input devices.`})]})]})})}function ye(){let e=F(),[t,i]=(0,B.useState)(()=>{let t=n(I,``);return t?ne(t,{preserveFunction:e}):e?q.activator:{kind:`off`}}),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)([]),l=(0,B.useRef)(null),u=(0,B.useRef)(!1),d=(0,B.useMemo)(()=>e?[q,...K]:K,[e]),f=t.kind!==`off`,p=f&&!e,m=(0,B.useCallback)(e=>{i(e),r(I,ie(e)),o(!1),c([])},[]),h=(0,B.useCallback)(()=>{o(!0),c([]),u.current=!1,requestAnimationFrame(()=>{l.current?.focus()})},[]),_=(0,B.useCallback)(()=>{o(!1),c([]),u.current=!1},[]),v=(0,B.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),b=(0,B.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){_();return}let t=v(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?N.modifiers:re(t));return}if(t.includes(`function`)){m(N);return}u.current=!0,m({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[_,v,m]),x=(0,B.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(u.current){u.current=!1,c([]);return}v(e).length===0&&s.length>0&&m({kind:`modifierOnly`,modifiers:s})}},[v,a,s,m]);(0,B.useEffect)(()=>{if(!a)return;let e=e=>{l.current&&!l.current.contains(e.target)&&_()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[_,a]);let S=f&&!d.some(e=>M(e.activator,t));return(0,V.jsx)(z,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsx)(y,{checked:f,onChange:n=>{n?t.kind===`off`&&m(e?q.activator:j):m({kind:`off`})},label:`Enable Push to Talk`}),f&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(`span`,{className:X,children:`Activation Key:`}),(0,V.jsxs)(`div`,{ref:l,tabIndex:a?0:-1,onKeyDown:a?b:void 0,onKeyUp:a?x:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[d.map(e=>{let n=M(e.activator,t);return(0,V.jsx)($,{label:e.label,selected:n,onClick:()=>m(e.activator)},e.label)}),a?(0,V.jsx)($,{label:s.length>0?oe(s):`Press any key…`,selected:!0,recording:!0,onClick:_}):(0,V.jsx)($,{label:S?A(t):`Custom`,selected:S,onClick:h})]}),p&&(0,V.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,V.jsx)(g,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,V.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function $({label:e,selected:t,recording:n=!1,onClick:r}){return(0,V.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,V.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,V.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function be(){let[e,t]=(0,B.useState)(()=>{let e=n(G,Y);return J.find(t=>t.value===e)?.value??Y});return(0,V.jsx)(z,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(b,{options:J,value:e,onChange:(0,B.useCallback)(e=>{t(e),r(G,e)},[]),"aria-label":`Conversation timeout`})})})}var xe=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];function Se(){let e=L.use.pauseBeforeReplyMs(),t=L.use.setPauseBeforeReplyMs();return(0,V.jsx)(z,{title:`Pause before reply`,subtitle:`How long the assistant waits after you stop speaking before it replies. A longer pause lets you gather your thoughts mid-sentence without being cut off.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(v,{value:(e??1200)/1e3,onValueChange:e=>{typeof e==`number`&&t(Math.round(e*1e3))},min:500/1e3,max:P/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":`Pause before reply`})})})}function Ce(){let e=L.use.interruptSensitivity(),t=L.use.setInterruptSensitivity();return(0,V.jsx)(z,{title:`Interrupt sensitivity`,subtitle:`How easily talking over the assistant interrupts it. Lower it if the assistant cuts itself off on background noise or filler words; raise it to interrupt more quickly.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(_,{items:xe,value:e??`medium`,onChange:t,ariaLabel:`Interrupt sensitivity`})})})}export{he as VoicePage};
|
package/dist/assets/{weather-forecast-display-Bix8rpji.js → weather-forecast-display-CcKGlN7f.js}
RENAMED
|
@@ -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{t as r}from"./moon-B8qiwjrW.js";import{t as i}from"./misc-BYQPh7vS.js";import{Ci as a,G as o,J as s,K as c,_a as l,ba as u,bi as d,ga as f,ha as p,pa as m,pi as h,q as g,va as _,ya as v}from"./index-yu6nDHvG.js";var y=e(t(),1),b={"sun.max.fill":{icon:d,className:`text-orange-500`},"cloud.sun.fill":{icon:f,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:_,className:`text-blue-400`},"cloud.fill":{icon:p,className:`text-stone-400`},"cloud.rain.fill":{icon:l,className:`text-blue-400`},snowflake:{icon:a,className:`text-blue-300`},"cloud.bolt.fill":{icon:v,className:`text-orange-500`},"cloud.fog.fill":{icon:u,className:`text-stone-400`}},x={sunny:{icon:d,className:`text-orange-500`},clear:{icon:d,className:`text-orange-500`},"partly cloudy":{icon:f,className:`text-amber-400`},"mostly sunny":{icon:f,className:`text-amber-400`},cloudy:{icon:p,className:`text-stone-400`},overcast:{icon:p,className:`text-stone-400`},rainy:{icon:l,className:`text-blue-400`},rain:{icon:l,className:`text-blue-400`},drizzle:{icon:l,className:`text-blue-400`},snow:{icon:a,className:`text-blue-300`},snowy:{icon:a,className:`text-blue-300`},thunderstorm:{icon:v,className:`text-orange-500`},thunder:{icon:v,className:`text-orange-500`},foggy:{icon:u,className:`text-stone-400`},fog:{icon:u,className:`text-stone-400`},mist:{icon:u,className:`text-stone-400`},hazy:{icon:u,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:d,className:`text-orange-500`},"mostly cloudy":{icon:p,className:`text-stone-400`},breezy:{icon:h,className:`text-stone-400`},windy:{icon:h,className:`text-stone-400`},cool:{icon:p,className:`text-stone-400`},warm:{icon:d,className:`text-orange-500`},hot:{icon:d,className:`text-orange-500`},cold:{icon:a,className:`text-blue-300`},"cold snap":{icon:a,className:`text-blue-300`},"warm, mostly sunny":{icon:f,className:`text-amber-400`},"cooler, breezy":{icon:h,className:`text-stone-400`}},S={icon:p,className:`text-stone-400`};function C(e){let t=b[e];if(t)return t;let n=e.toLowerCase(),r=x[n];if(r)return r;for(let[e,t]of Object.entries(x))if(n.includes(e))return t;return S}function w(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function T(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=g(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=g(e.current),r=c(n?.temp)??c(e.currentTemp)??c(e.temperature)??c(e.temp),i=c(n?.feelsLike)??c(n?.feels_like)??c(n?.apparentTemperature)??c(e.feelsLike)??c(e.feels_like)??c(e.apparentTemperature),a=s(n?.condition)??s(e.condition),l=c(n?.humidity)??c(e.humidity),u=w(n?.wind??e.wind),d=c(n?.windSpeed)??c(n?.wind_speed)??c(e.windSpeed)??c(e.wind_speed)??u.speed,f=s(n?.windDirection)??s(n?.wind_direction)??s(e.windDirection)??s(e.wind_direction)??u.direction,p=g(e.units),m=s(p?.temperature)??s(n?.unit)??s(e.unit)??`F`,h=s(p?.speed)??s(e.windUnit)??s(e.wind_unit),_=o(e.hourly).map((e,t)=>({id:s(e.id)??String(t),time:s(e.time)??``,icon:s(e.icon)??s(e.condition)??`cloud.fill`,temp:c(e.tempC)??c(e.temp)??c(e.temperature),tempC:c(e.tempC)})),v=o([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:s(e.id)??String(t),day:s(e.day)??s(e.date),dayLabel:s(e.dayLabel)??s(e.date),icon:s(e.icon)??s(e.condition)??`cloud.fill`,low:c(e.low),high:c(e.high),lowC:c(e.lowC),highC:c(e.highC),precip:c(e.precip)??c(e.precipitation)??c(e.precipitationProbability),condition:s(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:a,humidity:l,windSpeed:d,windDirection:f,windUnit:h,unit:m,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function E(e){return e*9/5+32}function D(e){return(e-32)*5/9}function O(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=D(e)),!t&&n&&(r=E(e)),`${Math.round(r)}`}function k(e,t,n){return e.tempC===void 0?e.temp===void 0?null:O(e.temp,t,n):O(e.tempC,!1,n)}function A(e,t,n){return e.lowC===void 0?O(e.low,t,n):O(e.lowC,!1,n)}function j(e,t,n){return e.highC===void 0?O(e.high,t,n):O(e.highC,!1,n)}var M=n();function N({icon:e,size:t=20}){let{icon:n,className:r}=C(e);return(0,M.jsx)(n,{width:t,height:t,className:r})}function P({useFahrenheit:e,onToggle:t}){return(0,M.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:`°F`}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:`°C`})]})}function F({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=O(e.currentTemp,t,n),o=O(e.feelsLike,t,n),s=n?`F`:`C`,c=e.forecast?.[0],l=c?j(c,t,n):null,u=c?A(c,t,n):null,d=null;return e.windSpeed!==void 0&&(d=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(d=`${e.windDirection} ${d}`)),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,M.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,s]}),e.condition&&(0,M.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,M.jsx)(P,{useFahrenheit:n,onToggle:r})]}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[o!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,o,`°`]}),l!==null&&u!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,l,`° L:`,u,`°`]}),d&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(h,{width:12,height:12}),d]}),e.humidity!==void 0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(m,{width:12,height:12}),e.humidity,`%`]})]})]})}function I({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=k(e,t,n);return(0,M.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,M.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,M.jsx)(N,{icon:e.icon,size:18}),a!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function L({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:a,globalMax:o}=(0,y.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=A(e,n,r),f=j(e,n,r),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,r))-m)/(h-m)*100}return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:i(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,M.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,M.jsx)(N,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,M.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,M.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,M.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,M.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function R({templateData:e,fallback:t}){let n=(0,y.useMemo)(()=>T(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,y.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(F,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,M.jsx)(I,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,M.jsx)(L,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{R as WeatherForecastDisplay};
|
|
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{t as r}from"./moon-jDX7sipq.js";import{t as i}from"./misc-CS-Pktrv.js";import{G as a,K as o,Si as s,Ti as c,U as l,W as u,ca as d,da as f,fa as p,ha as m,hi as h,ma as g,pa as _,ua as v}from"./index-31nbLUeS.js";var y=e(t(),1),b={"sun.max.fill":{icon:s,className:`text-orange-500`},"cloud.sun.fill":{icon:f,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:_,className:`text-blue-400`},"cloud.fill":{icon:v,className:`text-stone-400`},"cloud.rain.fill":{icon:p,className:`text-blue-400`},snowflake:{icon:c,className:`text-blue-300`},"cloud.bolt.fill":{icon:g,className:`text-orange-500`},"cloud.fog.fill":{icon:m,className:`text-stone-400`}},x={sunny:{icon:s,className:`text-orange-500`},clear:{icon:s,className:`text-orange-500`},"partly cloudy":{icon:f,className:`text-amber-400`},"mostly sunny":{icon:f,className:`text-amber-400`},cloudy:{icon:v,className:`text-stone-400`},overcast:{icon:v,className:`text-stone-400`},rainy:{icon:p,className:`text-blue-400`},rain:{icon:p,className:`text-blue-400`},drizzle:{icon:p,className:`text-blue-400`},snow:{icon:c,className:`text-blue-300`},snowy:{icon:c,className:`text-blue-300`},thunderstorm:{icon:g,className:`text-orange-500`},thunder:{icon:g,className:`text-orange-500`},foggy:{icon:m,className:`text-stone-400`},fog:{icon:m,className:`text-stone-400`},mist:{icon:m,className:`text-stone-400`},hazy:{icon:m,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:s,className:`text-orange-500`},"mostly cloudy":{icon:v,className:`text-stone-400`},breezy:{icon:h,className:`text-stone-400`},windy:{icon:h,className:`text-stone-400`},cool:{icon:v,className:`text-stone-400`},warm:{icon:s,className:`text-orange-500`},hot:{icon:s,className:`text-orange-500`},cold:{icon:c,className:`text-blue-300`},"cold snap":{icon:c,className:`text-blue-300`},"warm, mostly sunny":{icon:f,className:`text-amber-400`},"cooler, breezy":{icon:h,className:`text-stone-400`}},S={icon:v,className:`text-stone-400`};function C(e){let t=b[e];if(t)return t;let n=e.toLowerCase(),r=x[n];if(r)return r;for(let[e,t]of Object.entries(x))if(n.includes(e))return t;return S}function w(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function T(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=a(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=a(e.current),r=u(n?.temp)??u(e.currentTemp)??u(e.temperature)??u(e.temp),i=u(n?.feelsLike)??u(n?.feels_like)??u(n?.apparentTemperature)??u(e.feelsLike)??u(e.feels_like)??u(e.apparentTemperature),s=o(n?.condition)??o(e.condition),c=u(n?.humidity)??u(e.humidity),d=w(n?.wind??e.wind),f=u(n?.windSpeed)??u(n?.wind_speed)??u(e.windSpeed)??u(e.wind_speed)??d.speed,p=o(n?.windDirection)??o(n?.wind_direction)??o(e.windDirection)??o(e.wind_direction)??d.direction,m=a(e.units),h=o(m?.temperature)??o(n?.unit)??o(e.unit)??`F`,g=o(m?.speed)??o(e.windUnit)??o(e.wind_unit),_=l(e.hourly).map((e,t)=>({id:o(e.id)??String(t),time:o(e.time)??``,icon:o(e.icon)??o(e.condition)??`cloud.fill`,temp:u(e.tempC)??u(e.temp)??u(e.temperature),tempC:u(e.tempC)})),v=l([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:o(e.id)??String(t),day:o(e.day)??o(e.date),dayLabel:o(e.dayLabel)??o(e.date),icon:o(e.icon)??o(e.condition)??`cloud.fill`,low:u(e.low),high:u(e.high),lowC:u(e.lowC),highC:u(e.highC),precip:u(e.precip)??u(e.precipitation)??u(e.precipitationProbability),condition:o(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:s,humidity:c,windSpeed:f,windDirection:p,windUnit:g,unit:h,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function E(e){return e*9/5+32}function D(e){return(e-32)*5/9}function O(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=D(e)),!t&&n&&(r=E(e)),`${Math.round(r)}`}function k(e,t,n){return e.tempC===void 0?e.temp===void 0?null:O(e.temp,t,n):O(e.tempC,!1,n)}function A(e,t,n){return e.lowC===void 0?O(e.low,t,n):O(e.lowC,!1,n)}function j(e,t,n){return e.highC===void 0?O(e.high,t,n):O(e.highC,!1,n)}var M=n();function N({icon:e,size:t=20}){let{icon:n,className:r}=C(e);return(0,M.jsx)(n,{width:t,height:t,className:r})}function P({useFahrenheit:e,onToggle:t}){return(0,M.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:`°F`}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:`°C`})]})}function F({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=O(e.currentTemp,t,n),o=O(e.feelsLike,t,n),s=n?`F`:`C`,c=e.forecast?.[0],l=c?j(c,t,n):null,u=c?A(c,t,n):null,f=null;return e.windSpeed!==void 0&&(f=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(f=`${e.windDirection} ${f}`)),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,M.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,s]}),e.condition&&(0,M.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,M.jsx)(P,{useFahrenheit:n,onToggle:r})]}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[o!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,o,`°`]}),l!==null&&u!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,l,`° L:`,u,`°`]}),f&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(h,{width:12,height:12}),f]}),e.humidity!==void 0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(d,{width:12,height:12}),e.humidity,`%`]})]})]})}function I({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=k(e,t,n);return(0,M.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,M.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,M.jsx)(N,{icon:e.icon,size:18}),a!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function L({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:a,globalMax:o}=(0,y.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=A(e,n,r),f=j(e,n,r),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,r))-m)/(h-m)*100}return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:i(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,M.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,M.jsx)(N,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,M.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,M.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,M.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,M.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function R({templateData:e,fallback:t}){let n=(0,y.useMemo)(()=>T(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,y.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(F,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,M.jsx)(I,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,M.jsx)(L,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{R as WeatherForecastDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";import{n as t,t as n}from"./definitions-Ce8XXjMI.js";var r=class extends e{constructor(){super(...arguments),this.selectionStarted=!1}async impact(e){let t=this.patternForImpact(e?.style);this.vibrateWithPattern(t)}async notification(e){let t=this.patternForNotification(e?.type);this.vibrateWithPattern(t)}async vibrate(e){let t=e?.duration||300;this.vibrateWithPattern([t])}async selectionStart(){this.selectionStarted=!0}async selectionChanged(){this.selectionStarted&&this.vibrateWithPattern([70])}async selectionEnd(){this.selectionStarted=!1}patternForImpact(e=n.Heavy){return e===n.Medium?[43]:e===n.Light?[20]:[61]}patternForNotification(e=t.Success){return e===t.Warning?[30,40,30,50,60]:e===t.Error?[27,45,50]:[35,65,21]}vibrateWithPattern(e){if(navigator.vibrate)navigator.vibrate(e);else throw this.unavailable(`Browser does not support the vibrate API`)}};export{r as HapticsWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./dist-
|
|
1
|
+
import{n as e,r as t}from"./dist-DyRKd0bN2.js";import{n}from"./definitions-BaillmRO.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-
|
|
1
|
+
import{t as e}from"./button-BQVYX8n_.js";import{u as t}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{u as r}from"./local-mode-Bskd5bsT.js";import{c as i}from"./routes-Bzvx8bnp.js";import{t as a}from"./use-onboarding-login-_LAXettN.js";import{nn as o}from"./index-31nbLUeS.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-Cqi8q9o7.js";import{t as a}from"./arrow-left-C2re-gYj.js";import{n as o,r as s,t as c}from"./metric-card-C3DDH1u1.js";import{t as l}from"./ban-Ih5bAOHZ.js";import{t as u}from"./chevron-right-jRymmL7S.js";import{t as d}from"./circle-check-DqvTjWle.js";import{t as f}from"./triangle-alert-CnjNKhNx.js";import{t as p}from"./x-BYcSiJRX.js";import"./src-A8hMQd90.js";import{n as m,r as h,t as g}from"./workflow-status-4RYJ-tdh.js";import{t as _}from"./proxy-Cadlowdl.js";import{t as v}from"./AnimatePresence-TZWSGjkI.js";import{t as y}from"./use-reduced-motion-BPBlq9_a.js";import{t as b}from"./three-dot-indicator-ByrGmGYU.js";import{$ as x,Ea as S,Z as C,_i as w,et as T,mi as E,wi as D}from"./index-31nbLUeS.js";import{t as O}from"./status-badge-pill-DQHLgr0r.js";var k=e(t(),1),A=r();function j({onClick:e,ariaLabel:t}){return(0,A.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:[(0,A.jsx)(D,{className:`h-3 w-3`,fill:`currentColor`}),(0,A.jsx)(i,{variant:`label-small-default`,children:`Stop`})]})}function M({title:e,body:t,emptyText:n}){return(0,A.jsxs)(`div`,{className:`mb-5`,children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:e}),t?(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:t}):(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]})}function N({leaf:e}){let t=e.status===`running`?`Running…`:`No result summary`;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(S,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>o(Math.round(e)),label:`Output`})]}),(0,A.jsx)(M,{title:`Prompt`,body:e.promptSummary,emptyText:`No prompt summary`}),(0,A.jsx)(M,{title:`Result`,body:e.resultSummary,emptyText:t})]})}function P({status:e}){return(0,A.jsx)(O,{color:m(e),label:h(e)})}function F(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:return`var(--system-negative-strong)`;case`cancelled`:return`var(--content-secondary)`;default:return`var(--primary-base)`}}function I(e){switch(e){case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Running`}}function L({status:e}){return(0,A.jsx)(O,{color:F(e),label:I(e)})}function R({status:e}){let t=y(),n=`h-3.5 w-3.5 shrink-0`,r;return r=e===`running`?(0,A.jsx)(b,{className:`shrink-0`,dotSize:4,gap:2}):e===`completed`?(0,A.jsx)(d,{className:n,style:{color:`var(--system-positive-strong)`}}):e===`failed`?(0,A.jsx)(f,{className:n,style:{color:`var(--system-negative-strong)`}}):(0,A.jsx)(l,{className:n,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`}),(0,A.jsx)(v,{mode:`wait`,initial:!1,children:(0,A.jsx)(_.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t?{duration:0}:{duration:.15,ease:[.16,1,.3,1]},className:`flex shrink-0 items-center`,children:r},e)})}function z({runId:e,leaf:t,components:n,onSelect:r}){let a=t.label??`Subagent ${t.seq}`,o=t.promptSummary,s=C(`${e}:${t.seq}`);return(0,A.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Open ${a} details`,className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] px-2 py-1.5 text-left transition-colors hover:bg-[var(--surface-overlay)]`,children:(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(R,{status:t.status}),n?(0,A.jsx)(T,{components:n,bodyShapeId:s.bodyShape,eyeStyleId:s.eyeStyle,colorId:s.color,size:16}):(0,A.jsx)(`div`,{style:{width:16,height:16,flexShrink:0},"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-medium-default`,title:a,className:`max-w-[60%] shrink-0 truncate text-[var(--content-default)]`,children:a}),o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)] opacity-10`,children:`|`}),(0,A.jsx)(i,{variant:`body-medium-lighter`,title:o,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:o})]})]})})}function B({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let d=g(e.status),f=y(),m=e.label??e.runId,h=e.agentsSpawned||e.leaves.size,v=x(),b=[...e.leaves.values()].sort((e,t)=>e.seq-t.seq),[D,O]=(0,k.useState)(null),[M,F]=(0,k.useState)(e.runId);M!==e.runId&&(F(e.runId),O(null));let I=D==null?void 0:e.leaves.get(D),R=I?C(`${e.runId}:${I.seq}`):void 0,B=(0,k.useCallback)(()=>O(null),[]),V=I?I.label??`Subagent ${I.seq}`:``,H=I?V:m,U=d?`live`:`final`;return(0,k.useEffect)(()=>{l?.(e.runId)},[e.runId,U,l]),(0,A.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[I&&(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:B,title:m,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,children:m})}),(0,A.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,title:V,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:V})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[I&&(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(a,{}),onClick:B,"aria-label":`Back to subagents`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),I?v&&R?(0,A.jsx)(T,{components:v,bodyShapeId:R.bodyShape,eyeStyleId:R.eyeStyle,colorId:R.color,size:32}):(0,A.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}):(0,A.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] bg-[var(--surface-overlay)]`,children:(0,A.jsx)(E,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,A.jsx)(i,{variant:`title-medium`,title:H,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:H}),I?(0,A.jsx)(L,{status:I.status}):(0,A.jsx)(P,{status:e.status}),(0,A.jsx)(`span`,{className:`flex-1`}),d&&r&&(0,A.jsx)(j,{onClick:()=>r(e.runId),ariaLabel:`Stop workflow`}),(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,A.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:(0,A.jsx)(_.div,{initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:I?(0,A.jsx)(N,{leaf:I}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(S,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,A.jsx)(c,{icon:(0,A.jsx)(w,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:h,format:e=>o(Math.round(e)),label:`Agents`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Subagents`}),b.length===0?(0,A.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No subagents yet`}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1`,children:b.map(t=>(0,A.jsx)(z,{runId:e.runId,leaf:t,components:v,onSelect:()=>O(t.seq)},t.seq))})]})]})},I?String(I.seq):`list`)})]})}export{B as WorkflowDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./capture-error-Dhiismgm.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{o as r}from"./api-
|
|
1
|
+
import{t as e}from"./capture-error-Dhiismgm.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{o as r}from"./api-Dj9Z-j-6.js";import{n as i}from"./resolved-assistants-store-DAzPZ1eV.js";import{Dr as a,Or as o,kr as s}from"./sdk.gen-CFgJ4K6f.js";import{t as c}from"./by-tool-use-id-index-CBaMK-eh.js";import{t as l}from"./workflow-status-4RYJ-tdh.js";async function u(t,n){try{let{data:i,response:a}=await s({path:{assistant_id:t,id:n},throwOnError:!1});if(!a||!a.ok||!i)return null;let o=r.safeParse(i);return o.success?o.data:(e(o.error,{context:`fetchWorkflowJournal`}),null)}catch(t){return e(t,{context:`fetchWorkflowJournal`}),null}}async function d(t,n){try{let{data:e,response:r}=await o({path:{assistant_id:t,id:n},throwOnError:!1});return r?.ok&&e?e:r?.status===404?`not_found`:null}catch(t){return e(t,{context:`fetchWorkflowRun`}),null}}var f={byId:{},orderedIds:[],byToolUseId:new Map,fetchedAt:new Map,hydratedRunIds:new Set,notFoundRunIds:new Set,hydrationFailedRunIds:new Set,generation:0};function p(e,t){return{runId:e,status:`running`,agentsSpawned:0,inputTokens:0,outputTokens:0,startedAt:t,leaves:new Map}}function m(e){let t=e;for(let[n,r]of e)r.status===`running`&&(t===e&&(t=new Map(e)),t.set(n,{...r,status:`cancelled`}));return t}function h(e,t){return`${t}:${l(e)?`live`:`final`}`}function g(e){return e===`failed`?`failed`:e===`running`?`running`:`completed`}function _(e){return e===`interrupted`?`running`:e}var v=n(t()((e,t)=>({...f,startRun:n=>{let{byId:r,orderedIds:i,byToolUseId:a}=t(),o=r[n.runId];if(o){let t=o.label??n.label,i=o.toolUseId??n.toolUseId,s=t!==o.label,l=i!==o.toolUseId;if(!s&&!l)return;let u={...o,label:t,toolUseId:i},d=l?c(a,n.toolUseId,n.runId):a;e({byId:{...r,[n.runId]:u},byToolUseId:d});return}let s={...p(n.runId,n.timestamp),label:n.label,toolUseId:n.toolUseId},l=c(a,n.toolUseId,n.runId);e({byId:{...r,[n.runId]:s},orderedIds:[...i,n.runId],byToolUseId:l})},applyProgress:n=>{let{byId:r,orderedIds:i}=t(),a=r[n.runId],o=a??p(n.runId,Date.now()),s={...o,status:_(o.status),phase:n.phase??o.phase,message:n.message??o.message,agentsSpawned:n.agentsSpawned??o.agentsSpawned,label:o.label??n.label};e({byId:{...r,[n.runId]:s},orderedIds:a?i:[...i,n.runId]})},leafStarted:n=>{let{byId:r,orderedIds:i}=t(),a=r[n.runId],o=a??p(n.runId,Date.now()),s=_(o.status),c=o.leaves.get(n.seq);if(c&&c.status!==`running`){s!==o.status&&e({byId:{...r,[n.runId]:{...o,status:s}}});return}let l={seq:n.seq,status:`running`,label:n.label??c?.label,promptSummary:n.promptSummary??c?.promptSummary},u=new Map(o.leaves).set(n.seq,l),d=Math.max(o.agentsSpawned,u.size);e({byId:{...r,[n.runId]:{...o,status:s,agentsSpawned:d,leaves:u}},orderedIds:a?i:[...i,n.runId]})},leafFinished:n=>{let{byId:r,orderedIds:i}=t(),a=r[n.runId],o=a??p(n.runId,Date.now()),s=o.leaves.get(n.seq),c={seq:n.seq,status:n.status,label:n.label??s?.label,promptSummary:s?.promptSummary,inputTokens:n.inputTokens??s?.inputTokens,outputTokens:n.outputTokens??s?.outputTokens,resultSummary:n.resultSummary??s?.resultSummary};if(s&&s.status===c.status&&s.label===c.label&&s.inputTokens===c.inputTokens&&s.outputTokens===c.outputTokens&&s.resultSummary===c.resultSummary)return;let l=new Map(o.leaves).set(n.seq,c),u=0,d=0;for(let e of l.values())u+=e.inputTokens??0,d+=e.outputTokens??0;e({byId:{...r,[n.runId]:{...o,inputTokens:Math.max(o.inputTokens,u),outputTokens:Math.max(o.outputTokens,d),leaves:l}},orderedIds:a?i:[...i,n.runId]})},completeRun:n=>{let{byId:r,orderedIds:i}=t(),a=r[n.runId],o=a??p(n.runId,Date.now()),s=l(n.status)?o.leaves:m(o.leaves),c={...o,status:n.status,agentsSpawned:n.agentsSpawned,inputTokens:n.inputTokens,outputTokens:n.outputTokens,summary:n.summary??o.summary,leaves:s};e({byId:{...r,[n.runId]:c},orderedIds:a?i:[...i,n.runId]})},backfillFromJournal:(n,r)=>{let{byId:i,orderedIds:a}=t(),o=i[n],s=o??p(n,Date.now()),c=!1,u=s.leaves;for(let e of r.leaves){let t=s.leaves.get(e.seq),n=g(e.status);if(!t){c||=(u=new Map(s.leaves),!0),u.set(e.seq,{seq:e.seq,status:n,label:e.label,promptSummary:e.promptSummary,resultSummary:e.resultSummary,inputTokens:e.inputTokens,outputTokens:e.outputTokens});continue}(t.status===`running`||t.status===`cancelled`)&&n!==`running`&&(c||=(u=new Map(s.leaves),!0),u.set(e.seq,{...t,status:n,label:t.label??e.label,promptSummary:t.promptSummary??e.promptSummary,resultSummary:t.resultSummary??e.resultSummary,inputTokens:t.inputTokens??e.inputTokens,outputTokens:t.outputTokens??e.outputTokens}))}let d=l(s.status)?r.status??s.status:s.status,f=l(s.status)&&!l(d)?m(u):u,h={...s,status:d,agentsSpawned:Math.max(s.agentsSpawned,r.agentsSpawned??s.agentsSpawned),inputTokens:Math.max(s.inputTokens,r.inputTokens??s.inputTokens),outputTokens:Math.max(s.outputTokens,r.outputTokens??s.outputTokens),phase:r.phase??s.phase,leaves:f};e({byId:{...i,[n]:h},orderedIds:o?a:[...a,n]})},fetchJournalIfNeeded:async(n,r)=>{let{byId:i,fetchedAt:a}=t(),o=i[r];if(!o)return;let s=h(o.status,r),c=a.get(s);if(c!==void 0&&c>=o.startedAt)return;let l=new Map(a);l.set(s,o.startedAt),e({fetchedAt:l});let d=t().generation,f=await u(n,r);if(!f){let n=new Map(t().fetchedAt);n.delete(s),e({fetchedAt:n});return}t().generation===d&&t().backfillFromJournal(r,f)},hydrateRunIfNeeded:async(n,r)=>{let{byId:i,hydratedRunIds:a}=t();if(i[r]||a.has(r))return;e({hydratedRunIds:new Set(a).add(r)});let o=t().generation,s=await d(n,r);if(t().generation===o){if(s===`not_found`){e({notFoundRunIds:new Set(t().notFoundRunIds).add(r)});return}if(s===null){let n=new Set(t().hydratedRunIds);n.delete(r),e({hydratedRunIds:n,hydrationFailedRunIds:new Set(t().hydrationFailedRunIds).add(r)});return}t().startRun({runId:r,label:s.name??void 0,timestamp:Date.now()}),l(s.status)?t().applyProgress({runId:r,agentsSpawned:s.agentsSpawned}):t().completeRun({runId:r,status:s.status,agentsSpawned:s.agentsSpawned,inputTokens:s.inputTokens,outputTokens:s.outputTokens}),await t().fetchJournalIfNeeded(n,r)}},abortRun:async e=>{let t=i.getState().activeAssistantId;if(t)try{await a({path:{assistant_id:t,id:e},throwOnError:!0})}catch{}},reset:()=>e({byId:{},orderedIds:[],byToolUseId:new Map,fetchedAt:new Map,hydratedRunIds:new Set,notFoundRunIds:new Set,hydrationFailedRunIds:new Set,generation:t().generation+1})})));export{v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{t as l}from"./createLucideIcon-Bjb-Kuq7.js";import{t as u}from"./chevron-down-DpYf9Gwq.js";import{t as d}from"./chevron-right-jRymmL7S.js";import{t as f}from"./menu-CLA56vz8.js";import{t as p}from"./download-B6XjnEzx.js";import{t as m}from"./eye-off-BQ9J3pF2.js";import{t as h}from"./eye-C2rSrbD-.js";import{t as g}from"./file-text-DA128T4K.js";import{t as _}from"./file-C8pjlmtk.js";import{t as v}from"./folder-open-7DKBH5WB.js";import{t as y}from"./loader-circle-C9QrtO3C.js";import{t as b}from"./pencil-BOTCmXXR.js";import{t as x}from"./plus-D54jrPDF.js";import{t as S}from"./x-BYcSiJRX.js";import{O as C}from"./src-A8hMQd90.js";import{t as w}from"./input-6HVXMszw.js";import{t as T}from"./modal-bIQsMU63.js";import{n as E,t as D}from"./panel-item-CfuwAm7q.js";import{t as O}from"./confirm-dialog-kE8y7s20.js";import{n as k,t as A}from"./file-markdown-wMH_OULm.js";import{Ar as j,Ir as M,Lr as ee,Mr as N,Nr as P,Pr as F,jr as I}from"./sdk.gen-CFgJ4K6f.js";import{n as L}from"./native-file-C6oXU5FE.js";import{Cr as R,aa as z,bi as B,gi as V,ia as H,ji as te,ta as U}from"./index-31nbLUeS.js";import{t as W}from"./use-active-assistant-id-KipCgPNT.js";import{n as G,t as ne}from"./mobile-sidebar-drawer-CfUSy_Ou.js";import{i as K,n as re,r as q,t as J}from"./file-editor-BzlaskSf.js";import{t as Y}from"./format-file-size-BSrdQr7P.js";var ie=l(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),ae=l(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),X=l(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Z=e(t(),1);async function oe(e){let{data:t,error:n}=await I({path:{assistant_id:e.assistantId},query:{path:e.path,...e.showHidden?{showHidden:`true`}:{}},parseAs:`blob`,throwOnError:!1});if(n||!(t instanceof Blob))throw Error(`Failed to download file`);await L(t,e.filename)}function se(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function ce(e,t){return se(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function le(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function ue(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Q=s();function de(e){return c({queryFn:async()=>{let{data:t,error:n}=await N({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function fe({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=g;return n.startsWith(`image/`)?r=U:n.startsWith(`video/`)?r=V:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=_),(0,Q.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Q.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function pe({viewMode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Q.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function $({name:e,mimeType:t,size:n,rightContent:r}){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(fe,{mimeType:t}),(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:Y(n)})]}),r]})}function me({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await I({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function he({assistantId:e,path:t,name:r,mimeType:i,size:a,modifiedAt:o,showHidden:s}){let[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(!1),f=(0,Z.useCallback)(async()=>{d(!1),l(!0);try{await oe({assistantId:e,path:t,filename:r,showHidden:s})}catch{d(!0)}finally{l(!1)}},[e,t,r,s]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:r,mimeType:i,size:a}),(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Q.jsx)(_,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Q.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:r}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:i}),(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:Y(a,`Unknown size`)}),o&&(0,Q.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(o).toLocaleString()]})]}),(0,Q.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:c?(0,Q.jsx)(y,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(p,{"aria-hidden":!0}),onClick:f,disabled:c,"aria-label":`Download ${r}`,className:`mt-4`,children:c?`Downloading…`:`Download`}),u&&(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default`,style:{color:`var(--system-error)`},children:`Download failed. Try again.`})]})})]})}function ge({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...de({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Z.useState)(null),[_,b]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),b(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Z.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),b(e=>e!=null&&t(e.path)?null:e)},[d]);let x=h!=null&&h===t,S=p?.content??``,C=_?.path===t?_.content:S,w=()=>{g(null),b(null)},T=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await ee({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),b(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=C!==S,D=(0,Z.useCallback)(()=>{t&&E&&!T.isPending&&T.mutate({path:t,content:C})},[t,E,T,C]);if(!t)return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Q.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Q.jsx)(v,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,j=p.name??t.split(`/`).pop()??t,M=k(j,O),N=ce(j,O),P=p.content!=null&&!M&&!N,F=t?ue(t):!0,I=x&&(0,Q.jsx)(re,{isDirty:E,isSaving:T.isPending,error:T.isError?`Save failed`:null,onSave:D,onDiscard:w});if(M&&p.content!=null){let e=x?C:p.content;return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,rightContent:(0,Q.jsx)(pe,{viewMode:s,onChange:e=>{x&&w(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:e,fileName:j,mimeType:O,showEdit:!F&&s===`source`,isEditing:x,onToggleEdit:()=>x?w():g(t)}),s===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(A,{content:e})}):x?(0,Q.jsx)(q,{value:C,onChange:e=>b({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content,readOnly:F,onStartEdit:()=>g(t)})]}),I]})}if(N&&p.content!=null){let e=x?C:p.content,n=le(e);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,rightContent:(0,Q.jsx)(pe,{viewMode:s,onChange:e=>{x&&w(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:s===`preview`?n:e,downloadContent:e,fileName:j,mimeType:O,showEdit:!F&&s===`source`,isEditing:x,onToggleEdit:()=>x?w():g(t)}),s===`preview`?(0,Q.jsx)(K,{content:n,readOnly:!0,whiteSpace:`pre`}):x?(0,Q.jsx)(q,{value:C,onChange:e=>b({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content,readOnly:F,onStartEdit:()=>g(t)})]}),I]})}return P?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,size:p.size}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:x?C:p.content??``,fileName:j,mimeType:O,showEdit:!F,isEditing:x,onToggleEdit:()=>x?w():g(t)}),x?(0,Q.jsx)(q,{value:C,onChange:e=>b({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content??``,readOnly:F,onStartEdit:()=>g(t)})]}),I]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,size:p.size}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Q.jsx)(me,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Q.jsx)(he,{assistantId:e,path:t,name:j,mimeType:O,size:p.size,modifiedAt:p.modifiedAt,showHidden:r})}function _e(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function ve(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await M({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function ye(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await M({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function be({entry:e}){return e.type===`directory`?(0,Q.jsx)(H,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Q.jsx)(U,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Q.jsx)(V,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(g,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function xe({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:f,onRequestRename:p,onRequestCreate:m,depth:h}){let g=e.path??``,_=e.name??``,v=e.type===`directory`,y=n.has(g),x=r===g,S=_.startsWith(`.`),w=!ue(g),T=v&&(y||s.length>0),{data:E}=a({...ve({path:{assistant_id:t},query:{path:g,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&T}),D=(0,Z.useMemo)(()=>_e(E?.entries??[],o),[E?.entries,o]),O=s===``||_.toLowerCase().includes(s);if(s!==``&&!v&&!O)return null;let k=(0,Q.jsxs)(`button`,{onClick:()=>{v?c(g):l(g)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${h*14+8}px`,paddingRight:`8px`,color:x?`var(--content-default)`:S?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:x?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:S&&!x?.7:1},children:[v?T?(0,Q.jsx)(u,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(d,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Q.jsx)(be,{entry:e}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:_}),e.size!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:Y(e.size)})]});return(0,Q.jsxs)(`div`,{children:[w?(0,Q.jsxs)(C.Root,{children:[(0,Q.jsx)(C.Trigger,{children:k}),(0,Q.jsxs)(C.Content,{children:[v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(C.Item,{leftIcon:(0,Q.jsx)(z,{className:`h-3.5 w-3.5`}),onSelect:()=>m({kind:`file`,parentPath:g}),children:`New File`}),(0,Q.jsx)(C.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>m({kind:`folder`,parentPath:g}),children:`New Folder`}),(0,Q.jsx)(C.Separator,{})]}),(0,Q.jsx)(C.Item,{leftIcon:(0,Q.jsx)(B,{className:`h-3.5 w-3.5`}),onSelect:()=>f({path:g,name:_,isDirectory:v}),children:`Delete`}),(0,Q.jsx)(C.Item,{leftIcon:(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),onSelect:()=>p({path:g,name:_,isDirectory:v}),children:`Rename`})]})]}):k,v&&T&&D.length>0&&(0,Q.jsx)(`div`,{children:D.map(e=>(0,Q.jsx)(xe,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:f,onRequestRename:p,onRequestCreate:m,depth:h+1},e.path))})]})}function Se({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Z.useRef)(null),[d,f]=(0,Z.useState)(a??``),p=d.trim(),m=p.length>0&&(/[/\\]/.test(p)||p===`.`||p===`..`),h=p.length>0&&!m&&!c;return(0,Q.jsx)(T.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Q.jsx)(T.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h&&s(p)},children:[(0,Q.jsx)(T.Header,{children:(0,Q.jsx)(T.Title,{children:e})}),(0,Q.jsx)(T.Body,{children:(0,Q.jsx)(w,{ref:u,label:`Name`,value:d,onChange:e=>f(e.target.value),placeholder:t,errorText:l??(m?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Q.jsxs)(T.Footer,{children:[(0,Q.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Q.jsx)(n,{type:`submit`,variant:`primary`,disabled:!h,children:c?i:r})]})]})})})}function Ce({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:d,onToggleShowHidden:f,onChangeSortMode:p,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,b]=(0,Z.useState)(``),x=y.trim().toLowerCase(),[C,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(null),[k,A]=(0,Z.useState)(null),M=(0,Z.useCallback)(()=>{D(null),A(null)},[]),{data:N,isLoading:I}=a(ve({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),L=(0,Z.useMemo)(()=>_e(N?.entries??[],c),[N?.entries,c]),R=(0,Z.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),z=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await ye(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await ee({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await P({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{M(),R(),e.parentPath&&u(e.parentPath),e.kind===`file`?d(e.path):u(e.path)},onError:e=>{A(e instanceof Error?e.message:`Failed to create.`)}}),B=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await ye(e,r,t.newName,i);let{error:o,response:s}=await F({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{M(),R(),_(e,t)},onError:e=>{A(e instanceof Error?e.message:`Failed to rename.`)}}),V=(0,Z.useCallback)(e=>{A(null),D({type:`create`,...e})},[]),H=(0,Z.useCallback)(e=>{A(null),D({type:`rename`,path:e.path,name:e.name})},[]),[U,W]=(0,Z.useState)(null),G=o({mutationFn:async t=>{let{error:n,response:r}=await j({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{W(null),R(),g(e.path)}}),ne=(0,Z.useCallback)(e=>{G.reset(),W(e)},[G]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Q.jsx)(ae,{"aria-hidden":!0}):(0,Q.jsx)(ie,{"aria-hidden":!0}),onClick:()=>p(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Q.jsx)(h,{"aria-hidden":!0}):(0,Q.jsx)(m,{"aria-hidden":!0}),onClick:f,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(we,{open:C,onOpenChange:T,onSelectKind:e=>{T(!1),V({kind:e,parentPath:``})}})]})]}),(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(w,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Search files`,leftIcon:(0,Q.jsx)(te,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(S,{"aria-hidden":!0}),onClick:()=>b(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:I?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):L.length?L.map(n=>(0,Q.jsx)(xe,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:x,onToggleExpand:l,onSelectPath:d,onRequestDelete:ne,onRequestRename:H,onRequestCreate:V,depth:0},n.path)):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),E?.type===`create`&&(0,Q.jsx)(Se,{title:E.kind===`file`?`New File`:`New Folder`,placeholder:E.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:M,onConfirm:e=>{A(null),z.mutate({kind:E.kind,parentPath:E.parentPath,name:e})},pending:z.isPending,error:k},`create-${E.kind}-${E.parentPath}`),E?.type===`rename`&&(0,Q.jsx)(Se,{title:`Rename`,placeholder:E.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:E.name,onCancel:M,onConfirm:e=>{if(e===E.name){M();return}A(null),B.mutate({oldPath:E.path,newName:e})},pending:B.isPending,error:k},`rename-${E.path}`),(0,Q.jsx)(O,{open:U!==null,title:U?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Q.jsx)(`span`,{style:{color:`var(--content-default)`},children:U?.name}),U?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,G.error&&(0,Q.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:G.error.message})]}),confirmLabel:G.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:G.isPending,onConfirm:()=>{U&&G.mutate(U)},onCancel:()=>W(null)})]})}function we({open:e,onOpenChange:t,onSelectKind:r}){return R()?(0,Q.jsxs)(E.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(E.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(x,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(E.Content,{children:[(0,Q.jsx)(E.Header,{className:`sr-only`,children:(0,Q.jsx)(E.Title,{children:`Create new`})}),(0,Q.jsxs)(E.Body,{className:`pt-0`,children:[(0,Q.jsx)(D,{icon:z,label:`New File`,onSelect:()=>r(`file`)}),(0,Q.jsx)(D,{icon:X,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Q.jsxs)(f.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(f.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(x,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(f.Content,{align:`end`,sideOffset:4,children:[(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(z,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function Te(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Ee({assistantId:e}){let[t,n]=r(),[i,a]=(0,Z.useState)(()=>{let e=t.get(`file`);return e?Te(e):new Set}),[o,s]=(0,Z.useState)(()=>t.get(`file`)),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Z.useState)(`preview`);(0,Z.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Z.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Z.useState)(!1),v=(0,Z.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Z.useState)(null),x=(0,Z.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,Z.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,Z.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Q.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Q.jsx)(G,{onClick:()=>_(!0)})}),(0,Q.jsx)(ne,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Q.jsx)(Ce,{...w})}),(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Q.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(Ce,{...w})}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(ge,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function De(){return(0,Q.jsx)(Ee,{assistantId:W()})}export{De as WorkspacePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|