@vellumai/web 0.10.2-dev.202606250318.5e7cfb0 → 0.10.2
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/{BundleConfirmPage-BtzL80Qk.js → BundleConfirmPage-B1RL5CT5.js} +1 -1
- package/dist/assets/{Combination-4Qc3vrtW.js → Combination-CDqVzelh.js} +1 -1
- package/dist/assets/about-page-B-yNJBih.js +1 -0
- package/dist/assets/{account-page-D33dplvt.js → account-page-CHiDb1yX.js} +1 -1
- package/dist/assets/{account-shell-DwNlgySJ.js → account-shell-BBL0HqTX.js} +1 -1
- package/dist/assets/{add-credits-modal-JV9bRykb.js → add-credits-modal-GSsxaybq.js} +1 -1
- package/dist/assets/{advanced-page-8ixlbCWp.js → advanced-page-9dJbjOiT.js} +1 -1
- package/dist/assets/ai-page-Du6k7XV_.js +1 -0
- package/dist/assets/{api-2kc3MHRz.js → api-CjVG_nMi.js} +1 -1
- package/dist/assets/{api-key-screen-BpRHt4Lt.js → api-key-screen-BBajxzG8.js} +1 -1
- package/dist/assets/archive-page-DDar_tND.js +1 -0
- package/dist/assets/assistant-api-BX_B1xSC.js +1 -0
- package/dist/assets/{assistant-feature-flag-store-JvmVqyKj.js → assistant-feature-flag-store-BD9zTDcP.js} +1 -1
- package/dist/assets/{assistant-identity-store-CKjnoLSp.js → assistant-identity-store-DaDnhbxy.js} +1 -1
- package/dist/assets/{assistant-status-panel-uT89KhYE.js → assistant-status-panel-CFhkAfJY.js} +1 -1
- package/dist/assets/auth-store-CbVvQiBR.js +7 -0
- package/dist/assets/billing-page-BByuYpJa.js +3 -0
- package/dist/assets/{bookmarks-page-CWQD9IL4.js → bookmarks-page-DyjSZPPW.js} +1 -1
- package/dist/assets/build-state-CMpEWWjf.js +1 -0
- package/dist/assets/cable-C0pEWbc5.js +1 -0
- package/dist/assets/{capture-error-Hr1Yo2kx.js → capture-error-AoUURkgi.js} +1 -1
- package/dist/assets/{checkbox-BqCzUvXM.js → checkbox-ChtGq7OI.js} +1 -1
- package/dist/assets/{client-feature-flag-store-CtxCu0Fm.js → client-feature-flag-store-DjN8fxHA.js} +1 -1
- package/dist/assets/client.gen-0CkwJ2Ya.js +6 -0
- package/dist/assets/{command-palette-CwwGq47h.js → command-palette-DJgHXop1.js} +1 -1
- package/dist/assets/command-palette-window-page-CSaRzD87.js +1 -0
- package/dist/assets/community-page-BuuYKT7i.js +1 -0
- package/dist/assets/{confirm-dialog-CfOXCE1N.js → confirm-dialog-SpCsmAdG.js} +1 -1
- package/dist/assets/{connect-page-BQzNnPDo.js → connect-page-B0Pym3dJ.js} +1 -1
- package/dist/assets/{consent-controls-Do5c-TEL.js → consent-controls-o06cSwWt.js} +1 -1
- package/dist/assets/{contacts-gateway-BUGZkpwV.js → contacts-gateway-11r4y5pQ.js} +1 -1
- package/dist/assets/contacts-page-route-YQf7Dxxo.js +1 -0
- package/dist/assets/conversation-queries-DF1Lujnm.js +1 -0
- package/dist/assets/{danger-zone-redirect-page-CyYcO_Bc.js → danger-zone-redirect-page-iCmRnyei.js} +1 -1
- package/dist/assets/debug-page-CXi6rNhS.js +2 -0
- package/dist/assets/{deploy-dialogs-CashIumn.js → deploy-dialogs-DygUf1og.js} +1 -1
- package/dist/assets/{detail-card-C5Y8BJ-M.js → detail-card-QPVpO5cj.js} +1 -1
- package/dist/assets/{developer-page-DL-fI0TO.js → developer-page-C5desNav.js} +1 -1
- package/dist/assets/devices-page-mF5RECdQ.js +1 -0
- package/dist/assets/dictation-overlay-page-DL5K7HYW.js +1 -0
- package/dist/assets/{dist-B0Gf-knw.js → dist-cZPU9ZZL.js} +1 -1
- package/dist/assets/document-viewer-page-C2oFS1wI.js +1 -0
- package/dist/assets/dollar-sign-D_XmiHA-.js +1 -0
- package/dist/assets/dropdown-yOV5eJnU.js +1 -0
- package/dist/assets/earn-credits-modal-DsuqrJTY.js +1 -0
- package/dist/assets/{emails-page-DG9jcRgR.js → emails-page-Duy9jhr6.js} +1 -1
- package/dist/assets/{esm-DLfKHBEV.js → esm-B9FuN3Io.js} +2 -2
- package/dist/assets/esm-BIUrrGWd.js +2 -0
- package/dist/assets/esm-BT7uz_mC.js +2 -0
- package/dist/assets/esm-BU45yXtJ.js +2 -0
- package/dist/assets/esm-D51SsTmc.js +2 -0
- package/dist/assets/esm-KT7CwnAY.js +1 -0
- package/dist/assets/feature-flag-catalog-RZLmDa1F.js +1 -0
- package/dist/assets/file-editor-n2sYGdD-.js +1 -0
- package/dist/assets/general-page-BSdbq26O.js +1 -0
- package/dist/assets/google-logo-DNkI-jCf.js +1 -0
- package/dist/assets/hatching-screen-BRgjqSLd.js +1 -0
- package/dist/assets/home-page-route-CV_mh2wJ.js +1 -0
- package/dist/assets/hosting-screen--kBc2JgZ.js +1 -0
- package/dist/assets/identity-page-route-CDcFNfWw.js +1 -0
- package/dist/assets/index-BvIwFdLE.css +2 -0
- package/dist/assets/index-Cx6vyW7T.js +155 -0
- package/dist/assets/inspect-page-D03CXXMs.js +7 -0
- package/dist/assets/install-JGbHHiCV.js +1 -0
- package/dist/assets/integrations-page-BFPmyQdR.js +1 -0
- package/dist/assets/{intelligence-layout-DMzihErM.js → intelligence-layout-DgkmPrJl.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-fVu9o-yV.js → keyboard-shortcuts-page-waVolRQN.js} +1 -1
- package/dist/assets/{library-detail-page-DP0yxH0U.js → library-detail-page-eMzOqx_B.js} +1 -1
- package/dist/assets/library-page-BwoQ9K34.js +1 -0
- package/dist/assets/{local-mode-CvrNMtPF.js → local-mode-BD2zqd9I.js} +3 -3
- package/dist/assets/{login-flow-BwciK6K2.js → login-flow-DVsR7fEC.js} +1 -1
- package/dist/assets/login-page-DYLjbG5w.js +1 -0
- package/dist/assets/{logout-page-C40-avfZ.js → logout-page-DRRS14hP.js} +1 -1
- package/dist/assets/{logs-layout-DZg-AWem.js → logs-layout-CSvew4_d.js} +1 -1
- package/dist/assets/mcp-page-CUehr_wQ.js +1 -0
- package/dist/assets/{memory-router-playground-page-Cm012A6P.js → memory-router-playground-page-A2zlGskJ.js} +1 -1
- package/dist/assets/menu-CdoNX1qx.js +1 -0
- package/dist/assets/{metric-card-CWmHKgJ1.js → metric-card-CgO1F06f.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-DZh7gvAM.js → mobile-sidebar-drawer-R6nyuXZ1.js} +1 -1
- package/dist/assets/{modal-D0Q3UWD0.js → modal-CHuPOsJJ.js} +1 -1
- package/dist/assets/mutation-error-BjiE6W0q.js +1 -0
- package/dist/assets/{native-file-CiaHiLEO.js → native-file-LJQTmnKy.js} +2 -2
- package/dist/assets/{notice-CqRgVmeL.js → notice-CynJKEow.js} +1 -1
- package/dist/assets/notifications-page-DcIQm_jh.js +1 -0
- package/dist/assets/{oauth-complete-page-B1kWw2Og.js → oauth-complete-page-BJudfLeY.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-DDq7jGu3.js → oauth-popup-complete-page-HRhzTWe_.js} +1 -1
- package/dist/assets/{page-shell-Cjnz9wcY.js → page-shell-W5IMIXQq.js} +1 -1
- package/dist/assets/{pairing-page-9gPAG9Bp.js → pairing-page-DS3k_UyF.js} +1 -1
- package/dist/assets/panel-item-BLQE_l-g.js +1 -0
- package/dist/assets/{password-reset-page-0JJf9uQW.js → password-reset-page-CDvLTa8S.js} +1 -1
- package/dist/assets/{platform-loopback-page-VubtH5VQ.js → platform-loopback-page-CKI-92-q.js} +1 -1
- package/dist/assets/plugin-detail-page-THfWbuJx.js +1 -0
- package/dist/assets/{plugins-page-BZU8D9K8.js → plugins-page-BxfKs2Np.js} +1 -1
- package/dist/assets/{popover-CL-JL6vG.js → popover-BsF65jZY.js} +1 -1
- package/dist/assets/prechat-route-uavNUOzg.js +1 -0
- package/dist/assets/{prefs-BZXZwawX.js → prefs-DP4g-Qgi.js} +1 -1
- package/dist/assets/privacy-page-Vq50i0Wv.js +1 -0
- package/dist/assets/privacy-screen-1ITDKJ6D.js +1 -0
- package/dist/assets/{provider-callback-page-DvABuAK6.js → provider-callback-page-tWLMyImI.js} +1 -1
- package/dist/assets/{provider-key-CQHnRygW.js → provider-key-g87caUSW.js} +1 -1
- package/dist/assets/{provider-signup-page-D1frFoUo.js → provider-signup-page-CBPV-1Ih.js} +1 -1
- package/dist/assets/proxy-l3iqYpig.js +1 -0
- package/dist/assets/{quick-input-page-DM-2Bywe.js → quick-input-page-CEPPTVs7.js} +1 -1
- package/dist/assets/react-query.gen-4ZMhZ-fj.js +1 -0
- package/dist/assets/{react-query.gen-rp6Krcco.js → react-query.gen-CRARj4mG.js} +1 -1
- package/dist/assets/{research-mock-page-BkfWYYvv.js → research-mock-page-Dln6TeKV.js} +1 -1
- package/dist/assets/research-onboarding-route-HWXEnr-H.js +30 -0
- package/dist/assets/{resize-errors-DnJEbHn4.js → resize-errors-CXz-pd2h.js} +1 -1
- package/dist/assets/{resolved-assistants-store-Cp4J43BK.js → resolved-assistants-store-DLNFVaZL.js} +1 -1
- package/dist/assets/return-to-DxTXKF-C.js +1 -0
- package/dist/assets/{review-terms-screen-CU2ewaCh.js → review-terms-screen-DuORfqOE.js} +1 -1
- package/dist/assets/{schedules-BrM_F49t.js → schedules-MF0cMAPX.js} +1 -1
- package/dist/assets/{sdk.gen-D-_js_oC.js → sdk.gen-0RzHFsEa.js} +1 -1
- package/dist/assets/sdk.gen-DtKkd6hs.js +1 -0
- package/dist/assets/select-assistant-screen-C2pCQCeh.js +1 -0
- package/dist/assets/{setting-row-zXvvnio2.js → setting-row-BHlMSre_.js} +1 -1
- package/dist/assets/settings-layout-Co57Zw8f.js +1 -0
- package/dist/assets/share-feedback-modal-C4yo471J.js +1 -0
- package/dist/assets/{sidebar-tree-DqbWGjtc.js → sidebar-tree-D0lNnpA6.js} +1 -1
- package/dist/assets/signup-page-P4juei29.js +1 -0
- package/dist/assets/{signup-shell-BXHsln7h.js → signup-shell-CEJE1QSw.js} +1 -1
- package/dist/assets/skill-row-DDoJmniT.js +1 -0
- package/dist/assets/skills-page-KI_k-igb.js +1 -0
- package/dist/assets/{sound-manager-CzslfzDO.js → sound-manager-RQj5g2kL.js} +1 -1
- package/dist/assets/{sounds-page-DUqhtO8H.js → sounds-page-DFXhvf_o.js} +1 -1
- package/dist/assets/{src-CK6bncSg.js → src-BJj2O5XB.js} +39 -39
- package/dist/assets/{step-indicator-dots-GevsigEl.js → step-indicator-dots-Bx_0xTIr.js} +1 -1
- package/dist/assets/subagent-detail-panel-eXMmoVu4.js +4 -0
- package/dist/assets/subagent-status-DOJQZKTk.js +1 -0
- package/dist/assets/{system-events-page-qmixkQCI.js → system-events-page-BJJteZri.js} +1 -1
- package/dist/assets/{system-events-redirect-page-CE7VT7tY.js → system-events-redirect-page-CheSz42h.js} +1 -1
- package/dist/assets/{tag-B_-QAvJF.js → tag-CE_o2aao.js} +1 -1
- package/dist/assets/{tiptap-document-editor-BxjVeJVY.js → tiptap-document-editor-C8FlNAsc.js} +1 -1
- package/dist/assets/{toast-2TW5tj1Y.js → toast-CxaZ5f1d.js} +1 -1
- package/dist/assets/tool-detail-panel-DgVn-kKw.js +2 -0
- package/dist/assets/trace-page-CZICq31J.js +1 -0
- package/dist/assets/{upgrade-cancel-page-B2zxTHF3.js → upgrade-cancel-page-BQJOrigy.js} +1 -1
- package/dist/assets/{upgrade-success-page-CG6kLAG_.js → upgrade-success-page-BPRZMLDu.js} +1 -1
- package/dist/assets/{usage-page-CBNfUQ73.js → usage-page-DU36h2RZ.js} +1 -1
- package/dist/assets/{use-active-assistant-id-Dyfjqq4l.js → use-active-assistant-id-BlwRimQH.js} +1 -1
- package/dist/assets/{use-bus-subscription-BbiZXm1u.js → use-bus-subscription-D-1qIPnj.js} +1 -1
- package/dist/assets/use-is-org-ready-CRkh60tU.js +1 -0
- package/dist/assets/{use-onboarding-login-CyxtWkbT.js → use-onboarding-login-BZ4ismb6.js} +1 -1
- package/dist/assets/{use-plugin-drift-BozvaLNX.js → use-plugin-drift-C3gz_rng.js} +1 -1
- package/dist/assets/{use-reduced-motion-ChB7nOGe.js → use-reduced-motion-DgX4o6QR.js} +1 -1
- package/dist/assets/{utils-IBnUZTqY.js → utils-DugRzWBW.js} +1 -1
- package/dist/assets/{viewer-store-Dead64xY.js → viewer-store-9Ag85lFC.js} +1 -1
- package/dist/assets/{voice-page-Bb2WNf7q.js → voice-page-DB2h9uqJ.js} +1 -1
- package/dist/assets/{weather-forecast-display-BhdnLeQO.js → weather-forecast-display-DoCG5fqI.js} +1 -1
- package/dist/assets/{web-Dd6cS3PL.js → web-B4ULoQq5.js} +1 -1
- package/dist/assets/{web-DfbsgY66.js → web-ByMNu3A_.js} +1 -1
- package/dist/assets/{web-DbJBgRfO.js → web-CUTiBnsF.js} +1 -1
- package/dist/assets/{web-Dy2Asku5.js → web-CvCsdCeT.js} +1 -1
- package/dist/assets/{web-vUgUvidH.js → web-CyTCBnAZ.js} +1 -1
- package/dist/assets/{web-DU1iYtUx.js → web-DTFLfPeG.js} +1 -1
- package/dist/assets/{web-Drsd2-VM.js → web-DuA0h7oK.js} +1 -1
- package/dist/assets/{welcome-screen-BW3r0TgV.js → welcome-screen-z3RULgvo.js} +1 -1
- package/dist/assets/workflow-detail-panel-uiydoHie.js +1 -0
- package/dist/assets/workspace-page-9B98Z90n.js +1 -0
- package/dist/index.html +102 -112
- package/package.json +1 -1
- package/dist/assets/AnimatePresence-CgXwEO42.js +0 -9
- package/dist/assets/about-page-TvZeB1h8.js +0 -1
- package/dist/assets/ai-page-CGbDX-B6.js +0 -1
- package/dist/assets/app-info-DENEBxVU.js +0 -1
- package/dist/assets/archive-page-CzonAJC7.js +0 -1
- package/dist/assets/assistant-api-DROTS3Y9.js +0 -1
- package/dist/assets/auth-store-oJs_d4fj.js +0 -7
- package/dist/assets/billing-page-UyY01h_-.js +0 -3
- package/dist/assets/brain-Bs6LnfHO.js +0 -1
- package/dist/assets/browser-CcFF_rkO.js +0 -2
- package/dist/assets/build-state-FmoCmv9I.js +0 -1
- package/dist/assets/check-D6WkI0gF.js +0 -1
- package/dist/assets/command-palette-window-page-BSbqaBai.js +0 -1
- package/dist/assets/community-page-9po3ZChS.js +0 -1
- package/dist/assets/contacts-page-route-Bt_HKZmG.js +0 -9
- package/dist/assets/conversation-list-fetchers-UPVZq_6O.js +0 -1
- package/dist/assets/debug-page-Bftf5PaV.js +0 -2
- package/dist/assets/devices-page-CEV_io5z.js +0 -1
- package/dist/assets/diagnostics-BEB4VPwC.js +0 -1
- package/dist/assets/dictation-overlay-page-CRMcpxKx.js +0 -1
- package/dist/assets/document-viewer-page-JNmadcmx.js +0 -1
- package/dist/assets/dropdown-CL8VmqrY.js +0 -1
- package/dist/assets/earn-credits-modal-CoTxub53.js +0 -1
- package/dist/assets/esm-5gU3bjzq.js +0 -2
- package/dist/assets/esm-BCyLKT7G.js +0 -2
- package/dist/assets/esm-DjoRMdid.js +0 -2
- package/dist/assets/esm-THPAbEDt.js +0 -1
- package/dist/assets/esm-hCttZxWP.js +0 -2
- package/dist/assets/feature-flag-catalog-Cr353pcn.js +0 -1
- package/dist/assets/file-editor-BdxfXSj6.js +0 -1
- package/dist/assets/file-text-CmK9LY1p.js +0 -1
- package/dist/assets/general-page-CWqTFVxM.js +0 -1
- package/dist/assets/hatching-screen-CayA9Vsx.js +0 -1
- package/dist/assets/home-page-route-laqREkAr.js +0 -1
- package/dist/assets/hosting-screen-DJpdv7M5.js +0 -1
- package/dist/assets/identity-page-route-Cmu3jHD3.js +0 -1
- package/dist/assets/index-B52_AvAi.js +0 -132
- package/dist/assets/index-CopBy7jJ.css +0 -2
- package/dist/assets/inspect-page-BEwMECUP.js +0 -7
- package/dist/assets/install-DQhnhtoH.js +0 -1
- package/dist/assets/integrations-page-d5DqM7om.js +0 -1
- package/dist/assets/library-page-BCkENeDl.js +0 -1
- package/dist/assets/list-row-Cw9JYESP.js +0 -1
- package/dist/assets/login-page-B5CkEj5Q.js +0 -1
- package/dist/assets/menu-C_97pis4.js +0 -1
- package/dist/assets/messages-DHDZ32NT.js +0 -13
- package/dist/assets/monitor-D2okHi8o.js +0 -1
- package/dist/assets/mutation-error-CAcai9_z.js +0 -1
- package/dist/assets/notifications-page-CMTpDQzF.js +0 -1
- package/dist/assets/panel-item-nGTDevWP.js +0 -1
- package/dist/assets/plugin-detail-page-C0psVffK.js +0 -1
- package/dist/assets/prechat-B28Vzu55.js +0 -1
- package/dist/assets/prechat-route-B7Vm4Fu2.js +0 -1
- package/dist/assets/privacy-page-Cc2mPB0h.js +0 -1
- package/dist/assets/privacy-screen-BAr2D23N.js +0 -1
- package/dist/assets/proxy-DmIh4F51.js +0 -1
- package/dist/assets/react-query.gen-CQLyoqYk.js +0 -1
- package/dist/assets/research-onboarding-route-Cm6mHD6K.js +0 -36
- package/dist/assets/return-to-ByvaXBKr.js +0 -1
- package/dist/assets/risk-badge-6lK01djG.js +0 -1
- package/dist/assets/sdk.gen-1aYqVbMj.js +0 -6
- package/dist/assets/select-assistant-screen-Dbm7kkaQ.js +0 -1
- package/dist/assets/settings-layout-CXVDa9KM.js +0 -1
- package/dist/assets/share-feedback-modal-CSoSZKjm.js +0 -1
- package/dist/assets/signup-page-nqQCQjvy.js +0 -1
- package/dist/assets/skills-page-DJdy4T79.js +0 -1
- package/dist/assets/subagent-detail-panel-D8Q1FKeS.js +0 -4
- package/dist/assets/subagent-store-BLHGkTJR.js +0 -3
- package/dist/assets/tool-call-status-DTV5jmaU.js +0 -1
- package/dist/assets/tool-detail-panel-DzjYj94Q.js +0 -2
- package/dist/assets/trace-page-Dm5wvHA1.js +0 -1
- package/dist/assets/use-is-org-ready-Cca4wJgu.js +0 -1
- package/dist/assets/user-plus-C0OyQU83.js +0 -1
- package/dist/assets/workflow-detail-panel-BmAI3B0U.js +0 -1
- package/dist/assets/workflow-status-DmbjJPT4.js +0 -1
- package/dist/assets/workspace-page-CNdY5o6o.js +0 -1
- /package/dist/assets/{api-errors-CveHbhgb.js → api-errors-D3EsNrwn.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-DQodAnJD.js → avatar-bundled-components-f4-fradg.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-CEmN7KGI.js → avatar-svg-compositor-DMT4wmUm.js} +0 -0
- /package/dist/assets/{bookmark-C3S-p0MQ.js → bookmark-C8arQ3wm.js} +0 -0
- /package/dist/assets/{bug-DDcuQ3au.js → bug-BuL3O3_2.js} +0 -0
- /package/dist/assets/{build.umd-BrOC7S1V.js → build.umd-CPG-O6Se.js} +0 -0
- /package/dist/assets/{calendar-CpgH8CqM.js → calendar-BCNBN7PC.js} +0 -0
- /package/dist/assets/{chevron-left-DghyKSEE.js → chevron-left-o_oJAd6A.js} +0 -0
- /package/dist/assets/{chevron-right-B6vEpVY0.js → chevron-right-BNHlGCTg.js} +0 -0
- /package/dist/assets/{chevron-up-BRZN6p_l.js → chevron-up-BnW-hcOL.js} +0 -0
- /package/dist/assets/{circle-alert-DvNg50UK.js → circle-alert-bz1ccYRI.js} +0 -0
- /package/dist/assets/{circle-check-DzlJxj_M.js → circle-check-DBzb54Kz.js} +0 -0
- /package/dist/assets/{client.gen-Cs6pCK0s.js → client.gen-DzaL5PKF.js} +0 -0
- /package/dist/assets/{cloud-off-rAv4OHmv.js → cloud-off-BWmMU3G-.js} +0 -0
- /package/dist/assets/{code-aMX9iMYa.js → code-Bju_p7d-.js} +0 -0
- /package/dist/assets/{composer-focus-Bp1AiP29.js → composer-focus-D-P0cGAF.js} +0 -0
- /package/dist/assets/{conversation-selection-CtKjA5Ni.js → conversation-selection-CrdMTnwx.js} +0 -0
- /package/dist/assets/{conversation-store-DK-7gFAt.js → conversation-store-I2d3A6Tv.js} +0 -0
- /package/dist/assets/{cpu-CiHv3fhs.js → cpu-DpzMm9_m.js} +0 -0
- /package/dist/assets/{credit-card-BKRB1ZIi.js → credit-card-CN7yFHhB.js} +0 -0
- /package/dist/assets/{definitions-BVEXXekp.js → definitions-B4RRVbRh.js} +0 -0
- /package/dist/assets/{dist-BTp54SIT.js → dist-3i_EPbLt.js} +0 -0
- /package/dist/assets/{dist-cApvLul2.js → dist-BQHdyjQ3.js} +0 -0
- /package/dist/assets/{domain-field-DYwuCpup.js → domain-field-ChoXVdlk.js} +0 -0
- /package/dist/assets/{edit-chat-session-DJpqkkos.js → edit-chat-session-DXSCprPw.js} +0 -0
- /package/dist/assets/{effective-timezone-DrYGH2Lb.js → effective-timezone-DBaPUyaX.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-D9cXGKYH.js → emoji-catalog-data-C0EjtsOi.js} +0 -0
- /package/dist/assets/{environment-store-DXSuX0CL.js → environment-store-DoO5ZqXZ.js} +0 -0
- /package/dist/assets/{event-bus-Dl7-I4aL.js → event-bus-CFhOgvB8.js} +0 -0
- /package/dist/assets/{external-link-DPAtkBJ2.js → external-link-DAovIsxF.js} +0 -0
- /package/dist/assets/{format-0qTDTDhA.js → format-B2A6k4bb.js} +0 -0
- /package/dist/assets/{format-date-C-eCaBOj.js → format-date-Cx9GZ7-D.js} +0 -0
- /package/dist/assets/{format-file-size-Cnq-CdFe.js → format-file-size-Br1LCKQi.js} +0 -0
- /package/dist/assets/{globe-DYF_lSGm.js → globe-CfKniRIP.js} +0 -0
- /package/dist/assets/{haptics-CXHZxyAg.js → haptics-BCTVEX6s.js} +0 -0
- /package/dist/assets/{hard-drive-D7_5VMhi.js → hard-drive-DggmyfjR.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-n-4oNLiO.js → impersonate-version-flag-BksY65Mo.js} +0 -0
- /package/dist/assets/{info-_OtUK1cX.js → info-DXbzDupm.js} +0 -0
- /package/dist/assets/{input-C8kfrq9r.js → input-Ch7OC6ME.js} +0 -0
- /package/dist/assets/{lib-CqoczjxJ.js → lib-BVvJNDCQ.js} +0 -0
- /package/dist/assets/{link-2-CaszbD7P.js → link-2-Dmka5LJV.js} +0 -0
- /package/dist/assets/{llm-dimension-Db-cwepb.js → llm-dimension-ovOt_D6t.js} +0 -0
- /package/dist/assets/{loader-circle-IIzBGiwm.js → loader-circle-Cw1KvvLK.js} +0 -0
- /package/dist/assets/{log-in-2iOsufxq.js → log-in-CUDpYpYW.js} +0 -0
- /package/dist/assets/{minimize-2-JE_UHZlJ.js → minimize-2-CPmn1RIm.js} +0 -0
- /package/dist/assets/{misc-BN2o2MEB.js → misc-Dm72afTZ.js} +0 -0
- /package/dist/assets/{moon-CK8MXzOo.js → moon-Be4Pgk5X.js} +0 -0
- /package/dist/assets/{native-deep-link-BYNI6pkW.js → native-deep-link-CYaeyOfj.js} +0 -0
- /package/dist/assets/{pdf-BJGZkYgE.js → pdf-DhvXjkis.js} +0 -0
- /package/dist/assets/{pencil-DbB9rxpY.js → pencil-Dm2eFMe3.js} +0 -0
- /package/dist/assets/{prechat-names-De-dVGbT.js → prechat-names-CkLrL-Jh.js} +0 -0
- /package/dist/assets/{progress-bar-DIFlWPPg.js → progress-bar-DFH5aT1D.js} +0 -0
- /package/dist/assets/{public-asset-Fx_laYnf.js → public-asset-CH9GPeL_.js} +0 -0
- /package/dist/assets/{reduced-motion-DYlLlcUm.js → reduced-motion-8QnGN6lg.js} +0 -0
- /package/dist/assets/{refresh-cw-Bf6LV0kG.js → refresh-cw-YXbpNg95.js} +0 -0
- /package/dist/assets/{routes-DVqkwUEe.js → routes-B9xcBuuC.js} +0 -0
- /package/dist/assets/{save-DEBQ_gbb.js → save-CQ2-kSlv.js} +0 -0
- /package/dist/assets/{semver-yC_Iq9co.js → semver-aan9RUyA.js} +0 -0
- /package/dist/assets/{sparkles-BICoewVE.js → sparkles-C8hCShdb.js} +0 -0
- /package/dist/assets/{stat-square-B0S3fO7O.js → stat-square-CraPxMcl.js} +0 -0
- /package/dist/assets/{toggle-X_kQW5my.js → toggle-95p73HGd.js} +0 -0
- /package/dist/assets/{triangle-alert-DKOyShqD.js → triangle-alert-AqQQTwUZ.js} +0 -0
- /package/dist/assets/{triangle-alert-Bz1PpciW.js → triangle-alert-DnZC45c-.js} +0 -0
- /package/dist/assets/{typed-storage-Dctd_K9F.js → typed-storage-qVehRaS3.js} +0 -0
- /package/dist/assets/{usage-window-FKG0JDAT.js → usage-window-DbWHZkbr.js} +0 -0
- /package/dist/assets/{use-is-mobile-Cy10kl9u.js → use-is-mobile-D_0cze0t.js} +0 -0
- /package/dist/assets/{x-KVxA2ZL0.js → x-BeVbiDS2.js} +0 -0
- /package/dist/assets/{x-C8bCmIhD.js → x-DE8JhiDZ.js} +0 -0
- /package/dist/assets/{xterm-7Iq3jX3h.js → xterm-B74sC241.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-XFgHFTPw.js → xterm-addon-fit-By7PlC-c.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-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.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-BscuIPxA.js";import{t as l}from"./card-BibIM9x3.js";import{t as u}from"./notice-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.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-BscuIPxA.js";import{t as l}from"./card-BibIM9x3.js";import{t as u}from"./notice-CynJKEow.js";import{t as d}from"./circle-alert-bz1ccYRI.js";import{t as f}from"./circle-check-DBzb54Kz.js";import{t as p}from"./loader-circle-Cw1KvvLK.js";import{a as m}from"./routes-B9xcBuuC.js";import{et as h,tt as g}from"./react-query.gen-CRARj4mG.js";import{Jt as _,Kt as v,qt as y,x as b}from"./index-Cx6vyW7T.js";var x=e(t(),1),S=s(),C=1e3,w=1e4,T=2500;function E(){let e=_({platformHostedOnly:!0}),t=v(),s=y(),c=e===`full`&&t,d=r(),f=a(),[p,E]=(0,x.useState)(!1);(0,x.useEffect)(()=>{f.invalidateQueries({queryKey:g()})},[f]);let{data:j,isError:M}=o({...h(),enabled:c,refetchInterval:e=>e.state.data?.plan_id===`pro`||p?!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(()=>{d(m.settings.billing,{replace:!0})},T);return()=>clearTimeout(e)},[F,d]);let I=()=>d(m.settings.billing,{replace:!0});return e===`gated`?(0,S.jsx)(i,{replace:!0,to:m.settings.general}):e===`disabled`?(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsx)(b,{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)(u,{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,{}):p?(0,S.jsx)(k,{}):(0,S.jsx)(D,{}),(F||P||p)&&(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)(p,{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)(f,{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)(u,{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)(d,{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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./dropdown-CL8VmqrY.js";import"./src-CK6bncSg.js";import{t as c}from"./sparkles-BICoewVE.js";import{t as l}from"./triangle-alert-DKOyShqD.js";import{tr as u}from"./sdk.gen-1aYqVbMj.js";import{Dt as d,Et as f,Ot as ee,Tt as te,c as ne,d as re,ut as ie}from"./react-query.gen-CQLyoqYk.js";import{t as p}from"./api-errors-CveHbhgb.js";import{Wt as m,cn as ae}from"./index-B52_AvAi.js";import{t as h}from"./use-active-assistant-id-Dyfjqq4l.js";import{i as g,t as _}from"./format-0qTDTDhA.js";import{i as v,o as y,r as b}from"./llm-dimension-Db-cwepb.js";import{n as x}from"./usage-window-FKG0JDAT.js";import{n as oe,t as se}from"./schedules-BrM_F49t.js";var S=e(t(),1);function ce(e){if(!e)return{};let t={};for(let n of e.callSites)!n.id||!n.displayName||(t[n.id]={id:n.id,displayName:n.displayName,description:n.description,domain:n.domain});return t}function C(e,t,n){if(e===`task`){let e=t.groupKey;return e?n.callSites?.[e]?.displayName??t.group:t.group}if(e===`profile`){let e=t.groupKey;return e?n.profiles?.[e]?.displayName??t.group:t.group||`Default / Unset`}return t.group}function le(e,t,n){return!e||e.length===0?[]:e.map(e=>{let r=C(t,e,n);return r===e.group?e:{...e,group:r}})}var w=6,T=`value:`,E=`null:`;function D(e,t=`schedule`){return e===null?`${E}${v(t)?y(t):t}`:`${T}${e}`}function O(e){return[...e].sort((e,t)=>{if(e.date!==t.date)return e.date<t.date?-1:1;let n=j(e.bucketId),r=j(t.bucketId);return n===r?e.bucketId===t.bucketId?0:e.bucketId<t.bucketId?-1:1:n-r})}function ue(e){return e.map(e=>({bucketId:e.bucketId,date:e.date,displayLabel:e.displayLabel,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,groups:{}}))}function de(e,t,n){return t!==`task`&&t!==`profile`?[...e]:e.map(e=>{let r=!1,i={};for(let[a,o]of Object.entries(e.groups)){let e=C(t,A(o),n);e===o.group?i[a]=o:(r=!0,i[a]={...o,group:e})}return r?{...e,groups:i}:e})}function k(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.groups)){let n=t.get(e);t.set(e,{label:n?.label??r.group,totalEstimatedCostUsd:(n?.totalEstimatedCostUsd??0)+r.totalEstimatedCostUsd})}let n=Array.from(t.entries()).sort(([e,t],[n,r])=>t.totalEstimatedCostUsd===r.totalEstimatedCostUsd?t.label===r.label?e===n?0:e<n?-1:1:t.label<r.label?-1:1:r.totalEstimatedCostUsd-t.totalEstimatedCostUsd).map(([e,t],n)=>({seriesKey:e,label:t.label,totalEstimatedCostUsd:t.totalEstimatedCostUsd,colorIndex:n}));return{items:n,visibleItems:n.slice(0,w)}}function A(e){return{group:e.group,groupId:e.groupKey,groupKey:e.groupKey,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheCreationTokens:0,totalCacheReadTokens:0,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,turnCount:null}}function j(e){let t=e.lastIndexOf(`|`);if(t<0)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)?n:0}var M=o(),N=140,P=40,F=28,fe=2,pe=2,me=1e-6,I=12,L=220,R=56,he=[40,80,60,100,50,70,30],ge=[18,24,28,35,42,50,64,78,92,106,118,96,84,74,68,80,88,72,56,48,40,34,26,20],z=[`var(--usage-trend-stack-positive, var(--system-positive-strong, #10b981))`,`var(--usage-trend-stack-info, var(--system-info-strong, #3b82f6))`,`var(--usage-trend-stack-mid, var(--system-mid-strong, #f59e0b))`,`var(--usage-trend-stack-secondary, var(--content-secondary, #6b7280))`,`var(--usage-trend-stack-negative, var(--system-negative-strong, #f87171))`,`var(--usage-trend-stack-tertiary, var(--content-tertiary, #9ca3af))`];function B(e){return z[e%z.length]}function V(e){return e.displayLabel?e.displayLabel:e.date}function _e(e,t){let n=e+I,r=t+I;return n+L>window.innerWidth&&(n=e-L-I),r+R>window.innerHeight&&(r=t-R-I),{x:n,y:r}}function ve({buckets:e,isHourly:t,legendItems:n}){let[r,i]=(0,S.useState)(null),a=(0,S.useMemo)(()=>O(e),[e]),o=(0,S.useMemo)(()=>k(e),[e]),s=n??o.items,c=n??o.visibleItems,l=(0,S.useMemo)(()=>a.reduce((e,t)=>Math.max(e,t.totalEstimatedCostUsd),0),[a]),u=(0,S.useCallback)((e,t)=>{let n=_e(e.clientX,e.clientY);i({...t,x:n.x,y:n.y})},[]),d=(0,S.useCallback)(()=>i(null),[]);if(a.length===0){let e=(0,M.jsx)(Se,{title:t?`No hourly data`:`No daily data`,subtitle:`No usage recorded in this time range`});return c.length===0?e:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,(0,M.jsx)(H,{items:c})]})}let f=t?F:P;return(0,M.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:a.map(e=>{let t=l>0?e.totalEstimatedCostUsd/l:0,r=Math.max(fe,N*t);return(0,M.jsx)(`div`,{className:`flex items-end`,style:{width:`${f}px`,minWidth:`${f}px`,height:`${r}px`,opacity:e.totalEstimatedCostUsd>0?1:.3},title:`${V(e)}: ${_(e.totalEstimatedCostUsd)}`,"data-usage-series-bar":e.bucketId,children:(0,M.jsx)(be,{bucket:e,height:r,legendItems:s,hasLegendOverride:n!=null,onSegmentHover:u,onSegmentLeave:d})},e.bucketId)})}),(0,M.jsx)(`div`,{className:`flex items-start gap-2`,children:a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,style:{width:`${f}px`,minWidth:`${f}px`},children:[(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-secondary)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`},children:V(e)})]},e.bucketId))}),c.length>0?(0,M.jsx)(H,{items:c}):null]}),r?(0,M.jsx)(xe,{tooltip:r}):null]})}function ye({isHourly:e}){let t=e?ge:he,n=e?F:P;return(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:t.map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:`${n}px`,height:`${e}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}},t))})}function be({bucket:e,height:t,legendItems:n,hasLegendOverride:r,onSegmentHover:i,onSegmentLeave:a}){let o=Object.keys(e.groups).length>0,s=n.filter(e=>(e.state??`active`)===`active`).flatMap(t=>{let n=e.groups[t.seriesKey];return!n||n.totalEstimatedCostUsd<=0?[]:[{item:t,value:n}]});if(s.length===0&&!o&&!r){let n={label:`Total`,bucketLabel:V(e),cost:_(e.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{className:`w-full rounded-sm`,title:`${n.label}: ${n.cost}`,onMouseEnter:e=>i(e,n),onMouseMove:e=>i(e,n),onMouseLeave:a,style:{height:`${t}px`,background:B(0)},"data-usage-series-segment-label":n.label,"data-usage-fallback-segment":`true`})}return s.length===0?null:(0,M.jsx)(`div`,{className:`flex w-full flex-col-reverse overflow-hidden rounded-sm`,style:{height:`${t}px`},"data-usage-series-stack":e.bucketId,children:s.map(({item:n,value:r})=>{let o={label:n.label,bucketLabel:V(e),cost:_(r.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{title:`${o.label}: ${o.cost}`,onMouseEnter:e=>i(e,o),onMouseMove:e=>i(e,o),onMouseLeave:a,style:{height:`${Math.max(pe,t*r.totalEstimatedCostUsd/Math.max(e.totalEstimatedCostUsd,me))}px`,background:B(n.colorIndex)},"data-usage-series-segment":n.seriesKey,"data-usage-series-segment-label":n.label,"data-usage-series-color-index":n.colorIndex},n.seriesKey)})})}function xe({tooltip:e}){return(0,M.jsxs)(`div`,{className:`pointer-events-none fixed z-50 max-w-[220px] rounded-md border px-2 py-1 shadow-xl`,style:{left:`${e.x}px`,top:`${e.y}px`,background:`var(--surface-overlay, var(--surface-lift))`,borderColor:`var(--border-base)`},"aria-hidden":`true`,children:[(0,M.jsx)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-default)`},children:e.label}),(0,M.jsxs)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[e.bucketLabel,` · `,e.cost]})]})}function H({items:e}){return(0,M.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:e.map(e=>{let t=e.state??`active`,n=t===`inactive`;return(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,"data-usage-legend-state":t,children:[(0,M.jsx)(`span`,{className:`h-[7px] w-[7px] shrink-0 rounded-full`,style:{background:n?`var(--content-tertiary)`:B(e.colorIndex),opacity:n?.45:1},"aria-hidden":`true`,"data-usage-series-color-index":e.colorIndex}),(0,M.jsx)(`span`,{className:n?`truncate text-[10px] line-through`:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`,opacity:n?.65:1},children:e.label})]},e.seriesKey)})})}function Se({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,M.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,M.jsx)(`p`,{className:`mt-1 text-body-small-default`,children:t})]})}function U(e){return v(e)?y(e):e}function Ce(e){return G({from:e.from,to:e.to},e.scheduleId)}function we(e){return G({from:e.from,to:e.to,...e.granularity?{granularity:e.granularity}:{},...e.tz?{tz:e.tz}:{}},e.scheduleId)}function W(e){return G({from:e.from,to:e.to,groupBy:U(e.groupBy)},e.scheduleId)}function Te(e){return G({from:e.from,to:e.to,granularity:e.granularity,groupBy:U(e.groupBy),...e.tz?{tz:e.tz}:{}},e.scheduleId)}function G(e,t){return t?{...e,scheduleId:t}:e}function Ee(e){return[`${g(e.totalInputTokens)} direct`,`${g(e.totalCacheCreationTokens)} cache created`,`${g(e.totalCacheReadTokens)} cache read`,`${g(e.totalOutputTokens)} out`].join(` / `)}function K(e){return!Number.isFinite(e)||e===0?`0`:e>=1e6||e>=999950&&e<1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function De(e){return`${K(e.totalInputTokens+e.totalCacheCreationTokens+e.totalCacheReadTokens)} in / ${K(e.totalOutputTokens)} out`}var Oe=`task`,q=`model`,ke=new Set([400,404,422]),Ae=3,je=new Set([`today`,`yesterday`,`7d`,`30d`,`90d`,`all`]),Me=new Set([`actor`,`provider`,`model`,`conversation`,`task`,`profile`,`schedule`]),J={task:b.task,profile:b.profile,model:b.model,provider:`Provider`,actor:`Actor`,conversation:`Conversation`,schedule:`Schedule`},Ne=[{value:`task`,label:J.task},{value:`profile`,label:J.profile},{value:`model`,label:J.model},{value:`provider`,label:J.provider},{value:`schedule`,label:J.schedule},{value:`conversation`,label:J.conversation}];function Pe(e){let t=e.get(`range`),n=e.get(`groupBy`),r=Re(n)?n:Oe;return{range:Le(t)?t:`7d`,groupBy:r,scheduleId:r===`schedule`?Fe(e):void 0}}function Fe(e){let t=e.get(`scheduleId`);if(!(!t||t.trim().length===0))return t}function Ie(e,t){let n=new URLSearchParams(e);return t.range!==void 0&&n.set(`range`,t.range),t.groupBy!==void 0&&n.set(`groupBy`,t.groupBy),t.scheduleId!==void 0&&(t.scheduleId===null||t.scheduleId.trim().length===0?n.delete(`scheduleId`):n.set(`scheduleId`,t.scheduleId)),n.get(`groupBy`)!==`schedule`&&n.delete(`scheduleId`),n}function Le(e){return e!=null&&je.has(e)}function Re(e){return e!=null&&Me.has(e)}function ze(e){return e!==`conversation`}function Be(e,t){return e!==`task`&&e!==`profile`?!1:He(t)}function Ve(e,t){return!He(t)&&e<Ae}function He(e){return e instanceof p&&ke.has(e.status)}function Ue(e,t){let n=e===`hourly`?`Hourly Trend`:`Daily Trend`;return!t||t===`conversation`?n:`${n} by ${J[t]}`}function We({requestedGranularity:e,isLoading:t,buckets:n}){return e===`hourly`&&(t||!n||n.length===0||n.some(Ge))?`hourly`:`daily`}function Ge(e){return e.bucketId.includes(`|`)||Ke(e.date)}function Ke(e){return/^\d{4}-\d{2}-\d{2} ([01]\d|2[0-3]):00$/.test(e)}function qe(e,t,n=Date.now()){return x(e,t,n)}function Je(e){return e===`today`||e===`yesterday`?`hourly`:`daily`}function Ye({prompt:e,children:t,variant:i=`outlined`,size:a=`regular`,className:o}){let s=r(),l=(0,S.useCallback)(()=>{m(s,{prompt:e})},[s,e]);return(0,M.jsx)(n,{variant:i,size:a,leftIcon:(0,M.jsx)(c,{}),onClick:l,className:o,children:t})}var Xe=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}],Ze=300*1e3,Qe=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and explain the biggest cost contributors by call site, model, and profile.`,`Check my current llm.default, llm.callSites, and llm.profiles.`,`Give me a concise summary of what is driving cost and what you would optimize first.`,`Do not change config yet.`].join(` `),$e=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and current LLM config, then recommend the safest cost-optimization changes.`,`If changes are clearly safe, show me the exact config commands you would run and ask for confirmation before applying them.`].join(` `);function et({assistantId:e}){let[t,n]=i(),{range:r,groupBy:o,scheduleId:s}=(0,S.useMemo)(()=>Pe(t),[t]),c=ae(),l=(0,S.useCallback)(e=>{n(t=>Ie(t,e),{replace:!0})},[n]),p=(0,S.useMemo)(()=>qe(r,c),[r,c]),m=(0,S.useMemo)(()=>Je(r),[r]),h=a({queryKey:ie({path:{assistant_id:e}}),queryFn:()=>se(e),staleTime:1e4}),g=(0,S.useCallback)(e=>{l({range:e})},[l]),_=a({...ee({path:{assistant_id:e},query:Ce({from:p.from,to:p.to,scheduleId:s})})}),v=a({queryKey:te({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s})}),queryFn:async({signal:t})=>{try{let{data:n}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:o,response:n}}catch(n){if(!Be(o,n))throw n;let{data:r}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:q,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:q,response:r}}},retry:Ve}),y=v.data?.groupBy??o,b=ze(y)?y:void 0,x=a({...d({path:{assistant_id:e},query:Te({from:p.from,to:p.to,granularity:m,groupBy:b??`actor`,tz:c,scheduleId:s})}),enabled:!!b,retry:Ve}),C=a({...f({path:{assistant_id:e},query:we({from:p.from,to:p.to,granularity:m,tz:c,scheduleId:s})}),enabled:!b||x.isError}),w=a({...re({path:{assistant_id:e}}),enabled:y===`task`,staleTime:1/0}),T=a({...ne({path:{assistant_id:e}}),select:oe,enabled:y===`profile`,staleTime:Ze}),E=(0,S.useMemo)(()=>({callSites:ce(w.data),profiles:T.data??{}}),[w.data,T.data]),D=(0,S.useMemo)(()=>{let e=v.data;if(e)return le(e.response.breakdown,e.groupBy,E)},[v.data,E]),O=(0,S.useMemo)(()=>{if(!(!b||!x.data))return de(x.data.buckets,b,E)},[x.data,b,E]),k=(0,S.useMemo)(()=>{if(C.data)return ue(C.data.buckets)},[C.data]),A=(0,S.useMemo)(()=>b?x.error?k?{isLoading:!1,error:null,data:k,refetch:C.refetch}:{isLoading:C.isLoading||!k&&!C.error,error:C.error??x.error,data:void 0,refetch:C.error?C.refetch:x.refetch}:{isLoading:x.isLoading,error:x.error,data:O,refetch:x.refetch}:{isLoading:C.isLoading,error:C.error,data:k,refetch:C.refetch},[k,C.error,C.isLoading,C.refetch,O,b,x.error,x.isLoading,x.refetch]),j=We({requestedGranularity:m,isLoading:A.isLoading,buckets:A.data}),N=j===`hourly`,P=b&&x.error?void 0:y,F=(0,S.useMemo)(()=>{if(!(y!==`schedule`||!s))return tt(h.data,s)},[y,s,h.data]);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Usage`}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(it,{range:r,onChange:g})})]}),(0,M.jsx)(`section`,{"aria-label":`Totals`,children:(0,M.jsx)(X,{query:_,skeleton:(0,M.jsx)(ot,{}),render:e=>(0,M.jsx)(at,{totals:e})})}),(0,M.jsx)(Y,{title:`Inference Usage`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h4`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:Ue(j,P)}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(st,{value:y,onChange:e=>{e===o&&y!==o&&(v.refetch(),x.refetch()),l({groupBy:e,scheduleId:e===`schedule`?void 0:null})}})})]}),(0,M.jsx)(X,{query:A,skeleton:(0,M.jsx)(ye,{isHourly:N}),render:e=>(0,M.jsx)(ve,{buckets:e,isHourly:N,legendItems:F})})]})}),(0,M.jsx)(ct,{query:v,groups:D}),(0,M.jsx)(rt,{})]})}function tt(e,t){let n=e??[];return[...n.some(e=>e.id===t)?[]:[{id:t,label:nt(t)}],...n.map(e=>({id:e.id,label:e.name||e.id}))].map((e,n)=>({seriesKey:D(e.id,`schedule`),label:e.label,colorIndex:n,state:e.id===t?`active`:`inactive`}))}function nt(e){return`Unknown schedule (${e})`}function rt(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--border-base), transparent)`}}),(0,M.jsx)(Y,{title:`Cost assistant`,subtitle:`Review recent spend and tune model profile choices.`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md px-3 py-3 sm:flex-row sm:items-center`,children:[(0,M.jsx)(Ye,{prompt:Qe,children:`Analyze costs with assistant`}),(0,M.jsx)(Ye,{prompt:$e,variant:`ghost`,children:`Optimize settings`})]})})]})}function it({range:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,options:Xe.map(e=>({value:e.value,label:e.label}))})})}function Y({title:e,subtitle:t,children:n}){return(0,M.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-md border px-4 py-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`h3`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,M.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]}),n]})}function X({query:e,skeleton:t,render:n}){return e.isLoading?(0,M.jsx)(M.Fragment,{children:t}):e.error?(0,M.jsx)(ft,{message:e.error instanceof Error?e.error.message:`Failed to load usage.`,onRetry:()=>e.refetch()}):e.data?(0,M.jsx)(M.Fragment,{children:n(e.data)}):(0,M.jsx)(M.Fragment,{children:t})}function at({totals:e}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{style:{fontSize:`30px`,fontWeight:600,lineHeight:1,color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`Cost`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:g(e.eventCount)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`LLM Calls`})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,M.jsx)(Z,{label:`Direct Input Tokens`,value:g(e.totalInputTokens)}),(0,M.jsx)(Z,{label:`Output Tokens`,value:g(e.totalOutputTokens)}),(0,M.jsx)(Z,{label:`Cache Created`,value:g(e.totalCacheCreationTokens)}),(0,M.jsx)(Z,{label:`Cache Read`,value:g(e.totalCacheReadTokens)})]})]})}function Z({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-default)`},children:t}),(0,M.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})]})}function ot(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-hidden":`true`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:140,height:30}),(0,M.jsx)($,{width:90,height:12})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:60,height:16}),(0,M.jsx)($,{width:60,height:12})]})]}),(0,M.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)($,{width:`50%`,height:12}),(0,M.jsx)($,{width:`70%`,height:11})]},t))})]})}function st({value:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,menuAlign:`end`,menuMinWidth:196,options:Ne.map(e=>({value:e.value,label:e.label}))})})}function ct({query:e,groups:t}){let[n,r]=(0,S.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,M.jsx)(Y,{title:`Breakdown`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(Q,{label:`% of total`,active:n.has(`pct`),onClick:()=>i(`pct`)}),(0,M.jsx)(Q,{label:`Tokens`,active:n.has(`tokens`),onClick:()=>i(`tokens`)}),(0,M.jsx)(Q,{label:`Turns`,active:n.has(`turns`),onClick:()=>i(`turns`)})]}),(0,M.jsx)(X,{query:e,skeleton:(0,M.jsx)(ut,{}),render:e=>(0,M.jsx)(lt,{groups:t??e.response.breakdown,showPct:n.has(`pct`),showTokens:n.has(`tokens`),showTurns:n.has(`turns`)})})]})})}function Q({label:e,active:t,onClick:n}){return(0,M.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full border px-2.5 py-1 text-label-medium-default`,style:{borderColor:t?`var(--content-secondary)`:`var(--border-base)`,background:t?`color-mix(in srgb, var(--content-secondary) 15%, transparent)`:`transparent`,color:t?`var(--content-default)`:`var(--content-tertiary)`},children:e})}function lt({groups:e,showPct:t,showTokens:n,showTurns:r}){if(e.length===0)return(0,M.jsx)(dt,{title:`No breakdown data`,subtitle:`No usage recorded for this grouping`});let i=e.reduce((e,t)=>e+t.totalEstimatedCostUsd,0);return(0,M.jsx)(`div`,{className:`overflow-hidden rounded-md`,children:(0,M.jsxs)(`table`,{className:`w-full table-fixed`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:[(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:`Group`}),n?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`35%`},children:`Tokens`}):null,r?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`72px`},children:`Turns`}):null,t?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`64px`},children:`%`}):null,(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`100px`},children:`Cost`})]})}),(0,M.jsx)(`tbody`,{children:e.map((e,a)=>{let o=Ee(e),s=De(e),c=i>0?Math.round(e.totalEstimatedCostUsd/i*100):0;return(0,M.jsxs)(`tr`,{style:{borderTop:a===0?`none`:`1px solid var(--border-base)`},children:[(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-default)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-medium-lighter`,title:e.group,children:e.group})}),n?(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-secondary)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-small-default`,title:o,children:s})}):null,r?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.turnCount==null?`—`:e.turnCount.toLocaleString()})}):null,t?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsxs)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[c,`%`]})}):null,(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)})})]},e.groupKey??e.groupId??`${e.group}-${a}`)})})]})})}function ut(){return(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":`true`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)($,{width:100,height:14}),(0,M.jsx)($,{width:`60%`,height:12}),(0,M.jsx)($,{width:50,height:14})]},t))})}function $({width:e,height:t}){return(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:typeof e==`number`?`${e}px`:e,height:`${t}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}})}function dt({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-1 py-8 text-center`,children:[(0,M.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t})]})}function ft({message:e,onRetry:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(l,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-negative-strong, #f87171)`}}),(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:e})]}),t?(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`self-start rounded-md border px-3 py-1 text-body-small-default`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`,color:`var(--content-default)`},children:`Retry`}):null]})}function pt(){return(0,M.jsx)(et,{assistantId:h()})}export{pt as UsagePage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./dropdown-yOV5eJnU.js";import"./src-BJj2O5XB.js";import{t as c}from"./sparkles-C8hCShdb.js";import{t as l}from"./triangle-alert-AqQQTwUZ.js";import{er as u}from"./sdk.gen-DtKkd6hs.js";import{Dt as d,Et as f,Ot as ee,Tt as te,c as ne,d as re,ut as ie}from"./react-query.gen-4ZMhZ-fj.js";import{t as p}from"./api-errors-D3EsNrwn.js";import{Mt as m,Yt as ae}from"./index-Cx6vyW7T.js";import{t as h}from"./use-active-assistant-id-BlwRimQH.js";import{i as g,t as _}from"./format-B2A6k4bb.js";import{i as v,o as y,r as b}from"./llm-dimension-ovOt_D6t.js";import{n as x}from"./usage-window-DbWHZkbr.js";import{n as oe,t as se}from"./schedules-MF0cMAPX.js";var S=e(t(),1);function ce(e){if(!e)return{};let t={};for(let n of e.callSites)!n.id||!n.displayName||(t[n.id]={id:n.id,displayName:n.displayName,description:n.description,domain:n.domain});return t}function C(e,t,n){if(e===`task`){let e=t.groupKey;return e?n.callSites?.[e]?.displayName??t.group:t.group}if(e===`profile`){let e=t.groupKey;return e?n.profiles?.[e]?.displayName??t.group:t.group||`Default / Unset`}return t.group}function le(e,t,n){return!e||e.length===0?[]:e.map(e=>{let r=C(t,e,n);return r===e.group?e:{...e,group:r}})}var w=6,T=`value:`,E=`null:`;function D(e,t=`schedule`){return e===null?`${E}${v(t)?y(t):t}`:`${T}${e}`}function O(e){return[...e].sort((e,t)=>{if(e.date!==t.date)return e.date<t.date?-1:1;let n=j(e.bucketId),r=j(t.bucketId);return n===r?e.bucketId===t.bucketId?0:e.bucketId<t.bucketId?-1:1:n-r})}function ue(e){return e.map(e=>({bucketId:e.bucketId,date:e.date,displayLabel:e.displayLabel,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,groups:{}}))}function de(e,t,n){return t!==`task`&&t!==`profile`?[...e]:e.map(e=>{let r=!1,i={};for(let[a,o]of Object.entries(e.groups)){let e=C(t,A(o),n);e===o.group?i[a]=o:(r=!0,i[a]={...o,group:e})}return r?{...e,groups:i}:e})}function k(e){let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n.groups)){let n=t.get(e);t.set(e,{label:n?.label??r.group,totalEstimatedCostUsd:(n?.totalEstimatedCostUsd??0)+r.totalEstimatedCostUsd})}let n=Array.from(t.entries()).sort(([e,t],[n,r])=>t.totalEstimatedCostUsd===r.totalEstimatedCostUsd?t.label===r.label?e===n?0:e<n?-1:1:t.label<r.label?-1:1:r.totalEstimatedCostUsd-t.totalEstimatedCostUsd).map(([e,t],n)=>({seriesKey:e,label:t.label,totalEstimatedCostUsd:t.totalEstimatedCostUsd,colorIndex:n}));return{items:n,visibleItems:n.slice(0,w)}}function A(e){return{group:e.group,groupId:e.groupKey,groupKey:e.groupKey,totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheCreationTokens:0,totalCacheReadTokens:0,totalEstimatedCostUsd:e.totalEstimatedCostUsd,eventCount:e.eventCount,turnCount:null}}function j(e){let t=e.lastIndexOf(`|`);if(t<0)return 0;let n=Number(e.slice(t+1));return Number.isFinite(n)?n:0}var M=o(),N=140,P=40,F=28,fe=2,pe=2,me=1e-6,I=12,L=220,R=56,he=[40,80,60,100,50,70,30],ge=[18,24,28,35,42,50,64,78,92,106,118,96,84,74,68,80,88,72,56,48,40,34,26,20],z=[`var(--usage-trend-stack-positive, var(--system-positive-strong, #10b981))`,`var(--usage-trend-stack-info, var(--system-info-strong, #3b82f6))`,`var(--usage-trend-stack-mid, var(--system-mid-strong, #f59e0b))`,`var(--usage-trend-stack-secondary, var(--content-secondary, #6b7280))`,`var(--usage-trend-stack-negative, var(--system-negative-strong, #f87171))`,`var(--usage-trend-stack-tertiary, var(--content-tertiary, #9ca3af))`];function B(e){return z[e%z.length]}function V(e){return e.displayLabel?e.displayLabel:e.date}function _e(e,t){let n=e+I,r=t+I;return n+L>window.innerWidth&&(n=e-L-I),r+R>window.innerHeight&&(r=t-R-I),{x:n,y:r}}function ve({buckets:e,isHourly:t,legendItems:n}){let[r,i]=(0,S.useState)(null),a=(0,S.useMemo)(()=>O(e),[e]),o=(0,S.useMemo)(()=>k(e),[e]),s=n??o.items,c=n??o.visibleItems,l=(0,S.useMemo)(()=>a.reduce((e,t)=>Math.max(e,t.totalEstimatedCostUsd),0),[a]),u=(0,S.useCallback)((e,t)=>{let n=_e(e.clientX,e.clientY);i({...t,x:n.x,y:n.y})},[]),d=(0,S.useCallback)(()=>i(null),[]);if(a.length===0){let e=(0,M.jsx)(Se,{title:t?`No hourly data`:`No daily data`,subtitle:`No usage recorded in this time range`});return c.length===0?e:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,(0,M.jsx)(H,{items:c})]})}let f=t?F:P;return(0,M.jsxs)(`div`,{className:`overflow-x-auto`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:a.map(e=>{let t=l>0?e.totalEstimatedCostUsd/l:0,r=Math.max(fe,N*t);return(0,M.jsx)(`div`,{className:`flex items-end`,style:{width:`${f}px`,minWidth:`${f}px`,height:`${r}px`,opacity:e.totalEstimatedCostUsd>0?1:.3},title:`${V(e)}: ${_(e.totalEstimatedCostUsd)}`,"data-usage-series-bar":e.bucketId,children:(0,M.jsx)(be,{bucket:e,height:r,legendItems:s,hasLegendOverride:n!=null,onSegmentHover:u,onSegmentLeave:d})},e.bucketId)})}),(0,M.jsx)(`div`,{className:`flex items-start gap-2`,children:a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,style:{width:`${f}px`,minWidth:`${f}px`},children:[(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-secondary)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`},children:V(e)})]},e.bucketId))}),c.length>0?(0,M.jsx)(H,{items:c}):null]}),r?(0,M.jsx)(xe,{tooltip:r}):null]})}function ye({isHourly:e}){let t=e?ge:he,n=e?F:P;return(0,M.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:`${N}px`},"aria-hidden":`true`,children:t.map((e,t)=>(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:`${n}px`,height:`${e}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}},t))})}function be({bucket:e,height:t,legendItems:n,hasLegendOverride:r,onSegmentHover:i,onSegmentLeave:a}){let o=Object.keys(e.groups).length>0,s=n.filter(e=>(e.state??`active`)===`active`).flatMap(t=>{let n=e.groups[t.seriesKey];return!n||n.totalEstimatedCostUsd<=0?[]:[{item:t,value:n}]});if(s.length===0&&!o&&!r){let n={label:`Total`,bucketLabel:V(e),cost:_(e.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{className:`w-full rounded-sm`,title:`${n.label}: ${n.cost}`,onMouseEnter:e=>i(e,n),onMouseMove:e=>i(e,n),onMouseLeave:a,style:{height:`${t}px`,background:B(0)},"data-usage-series-segment-label":n.label,"data-usage-fallback-segment":`true`})}return s.length===0?null:(0,M.jsx)(`div`,{className:`flex w-full flex-col-reverse overflow-hidden rounded-sm`,style:{height:`${t}px`},"data-usage-series-stack":e.bucketId,children:s.map(({item:n,value:r})=>{let o={label:n.label,bucketLabel:V(e),cost:_(r.totalEstimatedCostUsd)};return(0,M.jsx)(`div`,{title:`${o.label}: ${o.cost}`,onMouseEnter:e=>i(e,o),onMouseMove:e=>i(e,o),onMouseLeave:a,style:{height:`${Math.max(pe,t*r.totalEstimatedCostUsd/Math.max(e.totalEstimatedCostUsd,me))}px`,background:B(n.colorIndex)},"data-usage-series-segment":n.seriesKey,"data-usage-series-segment-label":n.label,"data-usage-series-color-index":n.colorIndex},n.seriesKey)})})}function xe({tooltip:e}){return(0,M.jsxs)(`div`,{className:`pointer-events-none fixed z-50 max-w-[220px] rounded-md border px-2 py-1 shadow-xl`,style:{left:`${e.x}px`,top:`${e.y}px`,background:`var(--surface-overlay, var(--surface-lift))`,borderColor:`var(--border-base)`},"aria-hidden":`true`,children:[(0,M.jsx)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-default)`},children:e.label}),(0,M.jsxs)(`div`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[e.bucketLabel,` · `,e.cost]})]})}function H({items:e}){return(0,M.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 pt-1`,children:e.map(e=>{let t=e.state??`active`,n=t===`inactive`;return(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,"data-usage-legend-state":t,children:[(0,M.jsx)(`span`,{className:`h-[7px] w-[7px] shrink-0 rounded-full`,style:{background:n?`var(--content-tertiary)`:B(e.colorIndex),opacity:n?.45:1},"aria-hidden":`true`,"data-usage-series-color-index":e.colorIndex}),(0,M.jsx)(`span`,{className:n?`truncate text-[10px] line-through`:`truncate text-[10px]`,style:{color:`var(--content-tertiary)`,opacity:n?.65:1},children:e.label})]},e.seriesKey)})})}function Se({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-md py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,M.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,M.jsx)(`p`,{className:`mt-1 text-body-small-default`,children:t})]})}function U(e){return v(e)?y(e):e}function Ce(e){return G({from:e.from,to:e.to},e.scheduleId)}function we(e){return G({from:e.from,to:e.to,...e.granularity?{granularity:e.granularity}:{},...e.tz?{tz:e.tz}:{}},e.scheduleId)}function W(e){return G({from:e.from,to:e.to,groupBy:U(e.groupBy)},e.scheduleId)}function Te(e){return G({from:e.from,to:e.to,granularity:e.granularity,groupBy:U(e.groupBy),...e.tz?{tz:e.tz}:{}},e.scheduleId)}function G(e,t){return t?{...e,scheduleId:t}:e}function Ee(e){return[`${g(e.totalInputTokens)} direct`,`${g(e.totalCacheCreationTokens)} cache created`,`${g(e.totalCacheReadTokens)} cache read`,`${g(e.totalOutputTokens)} out`].join(` / `)}function K(e){return!Number.isFinite(e)||e===0?`0`:e>=1e6||e>=999950&&e<1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function De(e){return`${K(e.totalInputTokens+e.totalCacheCreationTokens+e.totalCacheReadTokens)} in / ${K(e.totalOutputTokens)} out`}var Oe=`task`,q=`model`,ke=new Set([400,404,422]),Ae=3,je=new Set([`today`,`yesterday`,`7d`,`30d`,`90d`,`all`]),Me=new Set([`actor`,`provider`,`model`,`conversation`,`task`,`profile`,`schedule`]),J={task:b.task,profile:b.profile,model:b.model,provider:`Provider`,actor:`Actor`,conversation:`Conversation`,schedule:`Schedule`},Ne=[{value:`task`,label:J.task},{value:`profile`,label:J.profile},{value:`model`,label:J.model},{value:`provider`,label:J.provider},{value:`schedule`,label:J.schedule},{value:`conversation`,label:J.conversation}];function Pe(e){let t=e.get(`range`),n=e.get(`groupBy`),r=Re(n)?n:Oe;return{range:Le(t)?t:`7d`,groupBy:r,scheduleId:r===`schedule`?Fe(e):void 0}}function Fe(e){let t=e.get(`scheduleId`);if(!(!t||t.trim().length===0))return t}function Ie(e,t){let n=new URLSearchParams(e);return t.range!==void 0&&n.set(`range`,t.range),t.groupBy!==void 0&&n.set(`groupBy`,t.groupBy),t.scheduleId!==void 0&&(t.scheduleId===null||t.scheduleId.trim().length===0?n.delete(`scheduleId`):n.set(`scheduleId`,t.scheduleId)),n.get(`groupBy`)!==`schedule`&&n.delete(`scheduleId`),n}function Le(e){return e!=null&&je.has(e)}function Re(e){return e!=null&&Me.has(e)}function ze(e){return e!==`conversation`}function Be(e,t){return e!==`task`&&e!==`profile`?!1:He(t)}function Ve(e,t){return!He(t)&&e<Ae}function He(e){return e instanceof p&&ke.has(e.status)}function Ue(e,t){let n=e===`hourly`?`Hourly Trend`:`Daily Trend`;return!t||t===`conversation`?n:`${n} by ${J[t]}`}function We({requestedGranularity:e,isLoading:t,buckets:n}){return e===`hourly`&&(t||!n||n.length===0||n.some(Ge))?`hourly`:`daily`}function Ge(e){return e.bucketId.includes(`|`)||Ke(e.date)}function Ke(e){return/^\d{4}-\d{2}-\d{2} ([01]\d|2[0-3]):00$/.test(e)}function qe(e,t,n=Date.now()){return x(e,t,n)}function Je(e){return e===`today`||e===`yesterday`?`hourly`:`daily`}function Ye({prompt:e,children:t,variant:i=`outlined`,size:a=`regular`,className:o}){let s=r(),l=(0,S.useCallback)(()=>{m(s,{prompt:e})},[s,e]);return(0,M.jsx)(n,{variant:i,size:a,leftIcon:(0,M.jsx)(c,{}),onClick:l,className:o,children:t})}var Xe=[{value:`today`,label:`Today`},{value:`yesterday`,label:`Yesterday`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}],Ze=300*1e3,Qe=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and explain the biggest cost contributors by call site, model, and profile.`,`Check my current llm.default, llm.callSites, and llm.profiles.`,`Give me a concise summary of what is driving cost and what you would optimize first.`,`Do not change config yet.`].join(` `),$e=[`Please load the llm-cost-optimizer skill.`,`Analyze my recent LLM usage and current LLM config, then recommend the safest cost-optimization changes.`,`If changes are clearly safe, show me the exact config commands you would run and ask for confirmation before applying them.`].join(` `);function et({assistantId:e}){let[t,n]=i(),{range:r,groupBy:o,scheduleId:s}=(0,S.useMemo)(()=>Pe(t),[t]),c=ae(),l=(0,S.useCallback)(e=>{n(t=>Ie(t,e),{replace:!0})},[n]),p=(0,S.useMemo)(()=>qe(r,c),[r,c]),m=(0,S.useMemo)(()=>Je(r),[r]),h=a({queryKey:ie({path:{assistant_id:e}}),queryFn:()=>se(e),staleTime:1e4}),g=(0,S.useCallback)(e=>{l({range:e})},[l]),_=a({...ee({path:{assistant_id:e},query:Ce({from:p.from,to:p.to,scheduleId:s})})}),v=a({queryKey:te({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s})}),queryFn:async({signal:t})=>{try{let{data:n}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:o,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:o,response:n}}catch(n){if(!Be(o,n))throw n;let{data:r}=await u({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:q,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:q,response:r}}},retry:Ve}),y=v.data?.groupBy??o,b=ze(y)?y:void 0,x=a({...d({path:{assistant_id:e},query:Te({from:p.from,to:p.to,granularity:m,groupBy:b??`actor`,tz:c,scheduleId:s})}),enabled:!!b,retry:Ve}),C=a({...f({path:{assistant_id:e},query:we({from:p.from,to:p.to,granularity:m,tz:c,scheduleId:s})}),enabled:!b||x.isError}),w=a({...re({path:{assistant_id:e}}),enabled:y===`task`,staleTime:1/0}),T=a({...ne({path:{assistant_id:e}}),select:oe,enabled:y===`profile`,staleTime:Ze}),E=(0,S.useMemo)(()=>({callSites:ce(w.data),profiles:T.data??{}}),[w.data,T.data]),D=(0,S.useMemo)(()=>{let e=v.data;if(e)return le(e.response.breakdown,e.groupBy,E)},[v.data,E]),O=(0,S.useMemo)(()=>{if(!(!b||!x.data))return de(x.data.buckets,b,E)},[x.data,b,E]),k=(0,S.useMemo)(()=>{if(C.data)return ue(C.data.buckets)},[C.data]),A=(0,S.useMemo)(()=>b?x.error?k?{isLoading:!1,error:null,data:k,refetch:C.refetch}:{isLoading:C.isLoading||!k&&!C.error,error:C.error??x.error,data:void 0,refetch:C.error?C.refetch:x.refetch}:{isLoading:x.isLoading,error:x.error,data:O,refetch:x.refetch}:{isLoading:C.isLoading,error:C.error,data:k,refetch:C.refetch},[k,C.error,C.isLoading,C.refetch,O,b,x.error,x.isLoading,x.refetch]),j=We({requestedGranularity:m,isLoading:A.isLoading,buckets:A.data}),N=j===`hourly`,P=b&&x.error?void 0:y,F=(0,S.useMemo)(()=>{if(!(y!==`schedule`||!s))return tt(h.data,s)},[y,s,h.data]);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Usage`}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(it,{range:r,onChange:g})})]}),(0,M.jsx)(`section`,{"aria-label":`Totals`,children:(0,M.jsx)(X,{query:_,skeleton:(0,M.jsx)(ot,{}),render:e=>(0,M.jsx)(at,{totals:e})})}),(0,M.jsx)(Y,{title:`Inference Usage`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,M.jsx)(`h4`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:Ue(j,P)}),(0,M.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:(0,M.jsx)(st,{value:y,onChange:e=>{e===o&&y!==o&&(v.refetch(),x.refetch()),l({groupBy:e,scheduleId:e===`schedule`?void 0:null})}})})]}),(0,M.jsx)(X,{query:A,skeleton:(0,M.jsx)(ye,{isHourly:N}),render:e=>(0,M.jsx)(ve,{buckets:e,isHourly:N,legendItems:F})})]})}),(0,M.jsx)(ct,{query:v,groups:D}),(0,M.jsx)(rt,{})]})}function tt(e,t){let n=e??[];return[...n.some(e=>e.id===t)?[]:[{id:t,label:nt(t)}],...n.map(e=>({id:e.id,label:e.name||e.id}))].map((e,n)=>({seriesKey:D(e.id,`schedule`),label:e.label,colorIndex:n,state:e.id===t?`active`:`inactive`}))}function nt(e){return`Unknown schedule (${e})`}function rt(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsx)(`div`,{className:`h-px w-full`,style:{background:`linear-gradient(to right, transparent, var(--border-base), transparent)`}}),(0,M.jsx)(Y,{title:`Cost assistant`,subtitle:`Review recent spend and tune model profile choices.`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md px-3 py-3 sm:flex-row sm:items-center`,children:[(0,M.jsx)(Ye,{prompt:Qe,children:`Analyze costs with assistant`}),(0,M.jsx)(Ye,{prompt:$e,variant:`ghost`,children:`Optimize settings`})]})})]})}function it({range:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,options:Xe.map(e=>({value:e.value,label:e.label}))})})}function Y({title:e,subtitle:t,children:n}){return(0,M.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-md border px-4 py-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`h3`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,M.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null]}),n]})}function X({query:e,skeleton:t,render:n}){return e.isLoading?(0,M.jsx)(M.Fragment,{children:t}):e.error?(0,M.jsx)(ft,{message:e.error instanceof Error?e.error.message:`Failed to load usage.`,onRetry:()=>e.refetch()}):e.data?(0,M.jsx)(M.Fragment,{children:n(e.data)}):(0,M.jsx)(M.Fragment,{children:t})}function at({totals:e}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{style:{fontSize:`30px`,fontWeight:600,lineHeight:1,color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`Cost`})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:g(e.eventCount)}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-secondary)`},children:`LLM Calls`})]})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,M.jsx)(Z,{label:`Direct Input Tokens`,value:g(e.totalInputTokens)}),(0,M.jsx)(Z,{label:`Output Tokens`,value:g(e.totalOutputTokens)}),(0,M.jsx)(Z,{label:`Cache Created`,value:g(e.totalCacheCreationTokens)}),(0,M.jsx)(Z,{label:`Cache Read`,value:g(e.totalCacheReadTokens)})]})]})}function Z({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-default)`},children:t}),(0,M.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})]})}function ot(){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-hidden":`true`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-4`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:140,height:30}),(0,M.jsx)($,{width:90,height:12})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)($,{width:60,height:16}),(0,M.jsx)($,{width:60,height:12})]})]}),(0,M.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md px-3 py-2`,style:{background:`color-mix(in srgb, var(--border-base) 15%, transparent)`},children:[(0,M.jsx)($,{width:`50%`,height:12}),(0,M.jsx)($,{width:`70%`,height:11})]},t))})]})}function st({value:e,onChange:t}){return(0,M.jsx)(`div`,{className:`flex items-center`,children:(0,M.jsx)(s,{value:e,onChange:t,menuAlign:`end`,menuMinWidth:196,options:Ne.map(e=>({value:e.value,label:e.label}))})})}function ct({query:e,groups:t}){let[n,r]=(0,S.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,M.jsx)(Y,{title:`Breakdown`,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(Q,{label:`% of total`,active:n.has(`pct`),onClick:()=>i(`pct`)}),(0,M.jsx)(Q,{label:`Tokens`,active:n.has(`tokens`),onClick:()=>i(`tokens`)}),(0,M.jsx)(Q,{label:`Turns`,active:n.has(`turns`),onClick:()=>i(`turns`)})]}),(0,M.jsx)(X,{query:e,skeleton:(0,M.jsx)(ut,{}),render:e=>(0,M.jsx)(lt,{groups:t??e.response.breakdown,showPct:n.has(`pct`),showTokens:n.has(`tokens`),showTurns:n.has(`turns`)})})]})})}function Q({label:e,active:t,onClick:n}){return(0,M.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full border px-2.5 py-1 text-label-medium-default`,style:{borderColor:t?`var(--content-secondary)`:`var(--border-base)`,background:t?`color-mix(in srgb, var(--content-secondary) 15%, transparent)`:`transparent`,color:t?`var(--content-default)`:`var(--content-tertiary)`},children:e})}function lt({groups:e,showPct:t,showTokens:n,showTurns:r}){if(e.length===0)return(0,M.jsx)(dt,{title:`No breakdown data`,subtitle:`No usage recorded for this grouping`});let i=e.reduce((e,t)=>e+t.totalEstimatedCostUsd,0);return(0,M.jsx)(`div`,{className:`overflow-hidden rounded-md`,children:(0,M.jsxs)(`table`,{className:`w-full table-fixed`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:[(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:`Group`}),n?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-left text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`35%`},children:`Tokens`}):null,r?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`72px`},children:`Turns`}):null,t?(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`64px`},children:`%`}):null,(0,M.jsx)(`th`,{className:`px-3 py-2.5 text-right text-label-medium-default`,style:{color:`var(--content-tertiary)`,width:`100px`},children:`Cost`})]})}),(0,M.jsx)(`tbody`,{children:e.map((e,a)=>{let o=Ee(e),s=De(e),c=i>0?Math.round(e.totalEstimatedCostUsd/i*100):0;return(0,M.jsxs)(`tr`,{style:{borderTop:a===0?`none`:`1px solid var(--border-base)`},children:[(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-default)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-medium-lighter`,title:e.group,children:e.group})}),n?(0,M.jsx)(`td`,{className:`min-w-0 px-3 py-2`,style:{color:`var(--content-secondary)`},children:(0,M.jsx)(`span`,{className:`block truncate text-body-small-default`,title:o,children:s})}):null,r?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.turnCount==null?`—`:e.turnCount.toLocaleString()})}):null,t?(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsxs)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[c,`%`]})}):null,(0,M.jsx)(`td`,{className:`whitespace-nowrap px-3 py-2 text-right`,children:(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:_(e.totalEstimatedCostUsd)})})]},e.groupKey??e.groupId??`${e.group}-${a}`)})})]})})}function ut(){return(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,"aria-hidden":`true`,children:Array.from({length:4}).map((e,t)=>(0,M.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,M.jsx)($,{width:100,height:14}),(0,M.jsx)($,{width:`60%`,height:12}),(0,M.jsx)($,{width:50,height:14})]},t))})}function $({width:e,height:t}){return(0,M.jsx)(`div`,{className:`rounded-sm`,style:{width:typeof e==`number`?`${e}px`:e,height:`${t}px`,background:`color-mix(in srgb, var(--border-base) 40%, transparent)`}})}function dt({title:e,subtitle:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-1 py-8 text-center`,children:[(0,M.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),(0,M.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t})]})}function ft({message:e,onRetry:t}){return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 py-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(l,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-negative-strong, #f87171)`}}),(0,M.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-default)`},children:e})]}),t?(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`self-start rounded-md border px-3 py-1 text-body-small-default`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`,color:`var(--content-default)`},children:`Retry`}):null]})}function pt(){return(0,M.jsx)(et,{assistantId:h()})}export{pt as UsagePage};
|
package/dist/assets/{use-active-assistant-id-Dyfjqq4l.js → use-active-assistant-id-BlwRimQH.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./resolved-assistants-store-
|
|
1
|
+
import{n as e}from"./resolved-assistants-store-DLNFVaZL.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./event-bus-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./event-bus-CFhOgvB8.js";var r=e(t(),1);function i(e,t){let i=(0,r.useRef)(t);(0,r.useLayoutEffect)(()=>{i.current=t}),(0,r.useEffect)(()=>n(e,e=>{i.current(e)}),[e])}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,l as t}from"./auth-store-CbVvQiBR.js";function n(){let n=t.use.currentOrganizationId();return!e()||n!=null}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{f as i}from"./local-mode-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,u as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{f as i}from"./local-mode-BD2zqd9I.js";import{t as a}from"./is-electron-C_ZTVhv8.js";import{L as o,N as s}from"./auth-store-CbVvQiBR.js";import{a as c}from"./routes-B9xcBuuC.js";import{n as l,t as u}from"./build-state-CMpEWWjf.js";import{n as d}from"./login-flow-DVsR7fEC.js";var f=e(t(),1);function p(e){let t=n(),p=r(),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(null),v=(0,f.useRef)(0);return{loading:m,error:g,login:async()=>{let n=e??l(u({sessionSettled:!0,isAuthenticated:!0}),p.pathname);if(i()&&o()){t(`${c.account.login}?returnTo=${encodeURIComponent(n)}`);return}let r=++v.current;_(null),h(!0);try{await s(d,`${c.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==v.current)return;_(`Something went wrong. Please try again.`),h(!1)}},cancel:()=>{v.current++,h(!1),_(null),a()&&window.vellum?.auth?.cancelOAuth()}}}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useQuery-B45lW1Kk.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{et as n}from"./react-query.gen-
|
|
1
|
+
import{t as e}from"./useQuery-B45lW1Kk.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{et as n}from"./react-query.gen-4ZMhZ-fj.js";var r=t();function i(){return(0,r.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-body-small-default`,style:{backgroundColor:`var(--surface-info, var(--surface-secondary))`,color:`var(--content-info, var(--primary-base, #60a5fa))`},children:`Update available`})}var a=300*1e3;function o({assistantId:t,name:r,enabled:i=!0}){return e({...n({path:{assistant_id:t,name:r}}),enabled:!!t&&!!r&&i,staleTime:a,retry:!1})}function s(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}export{o as n,i as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n,r,t as i}from"./reduced-motion-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n,r,t as i}from"./reduced-motion-8QnGN6lg.js";var a=e(t(),1);function o(){!n.current&&i();let[e]=(0,a.useState)(r.current);return e}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./assistant-identity-store-
|
|
1
|
+
import{t as e}from"./assistant-identity-store-DaDnhbxy.js";import{n as t,r as n,t as r}from"./semver-aan9RUyA.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-
|
|
1
|
+
import{t as e}from"./capture-error-AoUURkgi.js";import{n as t,t as n}from"./create-selectors-BE0_e_Ed.js";import{dt as r,n as i}from"./sdk.gen-DtKkd6hs.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===`workflow-detail`?e[t]:n}function f(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var p={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`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,ruleEditorRequestSeq:0},m=n(t()((t,n)=>({...p,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})},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`&&f(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditorForActiveTool:()=>{n().activeToolDetail&&t(e=>({ruleEditorRequestSeq:e.ruleEditorRequestSeq+1}))},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({...p})})));export{c as a,s as i,m as n,l as r,f as t};
|
|
@@ -1 +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-D7s2Q_uG.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-
|
|
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-D7s2Q_uG.js";import{t as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-yOV5eJnU.js";import{t as l}from"./toggle-95p73HGd.js";import{t as u}from"./info-DXbzDupm.js";import{a as d}from"./routes-B9xcBuuC.js";import{$t as f,Sn as p,an as m,cn as h,en as g,in as _,nn as v,oa as y,on as b,rn as x,sn as S,tn as C,xn as w}from"./index-Cx6vyW7T.js";import{t as T}from"./detail-card-QPVpO5cj.js";var E=e(i(),1),D=s(),O=`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`]}}],A={label:`Fn`,activator:C},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`}],M=`30`,N=`text-body-small-default text-[var(--content-tertiary)]`;function P(){return(0,D.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,D.jsx)(F,{}),(0,D.jsx)(L,{}),(0,D.jsx)(R,{}),(0,D.jsx)(B,{})]})}function F(){return(0,D.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,D.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 text-[var(--primary-base)]`}),(0,D.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Looking to configure Speech-to-Text or Text-to-Speech models?`}),(0,D.jsxs)(o,{to:d.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,D.jsx)(y,{className:`h-3 w-3`})]})]})}var I=``;function L(){let[e,n]=(0,E.useState)([]),[i,o]=(0,E.useState)(!1),[s,l]=(0,E.useState)(()=>p()),u=(0,E.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)}},[]),d=(0,E.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}u()},[u]);(0,E.useEffect)(()=>{u();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void u();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[u]);let f=(0,E.useMemo)(()=>[{value:I,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),m=(0,E.useCallback)(e=>{l(e),e===I?t(w):r(w,e)},[]);return(0,D.jsx)(T,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:f,value:f.some(e=>e.value===s)?s:I,onChange:m,"aria-label":`Microphone`})}),i&&(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,D.jsx)(a,{variant:`outlined`,onClick:d,children:`Allow Microphone Access`}),(0,D.jsx)(`span`,{className:N,children:`Grant microphone access to list your available input devices.`})]})]})})}function R(){let e=f(),[t,i]=(0,E.useState)(()=>{let t=n(v,``);return t?b(t,{preserveFunction:e}):e?A.activator:{kind:`off`}}),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)([]),d=(0,E.useRef)(null),p=(0,E.useRef)(!1),y=(0,E.useMemo)(()=>e?[A,...k]:k,[e]),w=t.kind!==`off`,O=w&&!e,j=(0,E.useCallback)(e=>{i(e),r(v,S(e)),o(!1),c([])},[]),M=(0,E.useCallback)(()=>{o(!0),c([]),p.current=!1,requestAnimationFrame(()=>{d.current?.focus()})},[]),P=(0,E.useCallback)(()=>{o(!1),c([]),p.current=!1},[]),F=(0,E.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]),I=(0,E.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){P();return}let t=F(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?C.modifiers:h(t));return}if(t.includes(`function`)){j(C);return}p.current=!0,j({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[P,F,j]),L=(0,E.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(p.current){p.current=!1,c([]);return}F(e).length===0&&s.length>0&&j({kind:`modifierOnly`,modifiers:s})}},[F,a,s,j]);(0,E.useEffect)(()=>{if(!a)return;let e=e=>{d.current&&!d.current.contains(e.target)&&P()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[P,a]);let R=w&&!y.some(e=>_(e.activator,t));return(0,D.jsx)(T,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(l,{checked:w,onChange:n=>{n?t.kind===`off`&&j(e?A.activator:g):j({kind:`off`})},label:`Enable Push to Talk`}),w&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:N,children:`Activation Key:`}),(0,D.jsxs)(`div`,{ref:d,tabIndex:a?0:-1,onKeyDown:a?I:void 0,onKeyUp:a?L:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[y.map(e=>{let n=_(e.activator,t);return(0,D.jsx)(z,{label:e.label,selected:n,onClick:()=>j(e.activator)},e.label)}),a?(0,D.jsx)(z,{label:s.length>0?m(s):`Press any key…`,selected:!0,recording:!0,onClick:P}):(0,D.jsx)(z,{label:R?x(t):`Custom`,selected:R,onClick:M})]}),O&&(0,D.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,D.jsx)(u,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,D.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 z({label:e,selected:t,recording:n=!1,onClick:r}){return(0,D.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,D.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,D.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function B(){let[e,t]=(0,E.useState)(()=>{let e=n(O,M);return j.find(t=>t.value===e)?.value??M});return(0,D.jsx)(T,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,D.jsx)(`div`,{className:`max-w-xs`,children:(0,D.jsx)(c,{options:j,value:e,onChange:(0,E.useCallback)(e=>{t(e),r(O,e)},[]),"aria-label":`Conversation timeout`})})})}export{P as VoicePage};
|
package/dist/assets/{weather-forecast-display-BhdnLeQO.js → weather-forecast-display-DoCG5fqI.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-CK8MXzOo.js";import{Br as i,G as a,Gi as o,Hi as s,Ii as c,K as l,Ki as u,Nr as d,U as f,Ui as p,Ur as m,Vi as h,W as g,Wi as _}from"./index-B52_AvAi.js";var v=e(t(),1),y={"sun.max.fill":{icon:i,className:`text-orange-500`},"cloud.sun.fill":{icon:s,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:_,className:`text-blue-400`},"cloud.fill":{icon:h,className:`text-stone-400`},"cloud.rain.fill":{icon:p,className:`text-blue-400`},snowflake:{icon:m,className:`text-blue-300`},"cloud.bolt.fill":{icon:o,className:`text-orange-500`},"cloud.fog.fill":{icon:u,className:`text-stone-400`}},b={sunny:{icon:i,className:`text-orange-500`},clear:{icon:i,className:`text-orange-500`},"partly cloudy":{icon:s,className:`text-amber-400`},"mostly sunny":{icon:s,className:`text-amber-400`},cloudy:{icon:h,className:`text-stone-400`},overcast:{icon:h,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:m,className:`text-blue-300`},snowy:{icon:m,className:`text-blue-300`},thunderstorm:{icon:o,className:`text-orange-500`},thunder:{icon:o,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:i,className:`text-orange-500`},"mostly cloudy":{icon:h,className:`text-stone-400`},breezy:{icon:d,className:`text-stone-400`},windy:{icon:d,className:`text-stone-400`},cool:{icon:h,className:`text-stone-400`},warm:{icon:i,className:`text-orange-500`},hot:{icon:i,className:`text-orange-500`},cold:{icon:m,className:`text-blue-300`},"cold snap":{icon:m,className:`text-blue-300`},"warm, mostly sunny":{icon:s,className:`text-amber-400`},"cooler, breezy":{icon:d,className:`text-stone-400`}},x={icon:h,className:`text-stone-400`};function S(e){let t=y[e];if(t)return t;let n=e.toLowerCase(),r=b[n];if(r)return r;for(let[e,t]of Object.entries(b))if(n.includes(e))return t;return x}function C(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 w(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=g(n?.temp)??g(e.currentTemp)??g(e.temperature)??g(e.temp),i=g(n?.feelsLike)??g(n?.feels_like)??g(n?.apparentTemperature)??g(e.feelsLike)??g(e.feels_like)??g(e.apparentTemperature),o=l(n?.condition)??l(e.condition),s=g(n?.humidity)??g(e.humidity),c=C(n?.wind??e.wind),u=g(n?.windSpeed)??g(n?.wind_speed)??g(e.windSpeed)??g(e.wind_speed)??c.speed,d=l(n?.windDirection)??l(n?.wind_direction)??l(e.windDirection)??l(e.wind_direction)??c.direction,p=a(e.units),m=l(p?.temperature)??l(n?.unit)??l(e.unit)??`F`,h=l(p?.speed)??l(e.windUnit)??l(e.wind_unit),_=f(e.hourly).map((e,t)=>({id:l(e.id)??String(t),time:l(e.time)??``,icon:l(e.icon)??l(e.condition)??`cloud.fill`,temp:g(e.tempC)??g(e.temp)??g(e.temperature),tempC:g(e.tempC)})),v=f([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:l(e.id)??String(t),day:l(e.day)??l(e.date),dayLabel:l(e.dayLabel)??l(e.date),icon:l(e.icon)??l(e.condition)??`cloud.fill`,low:g(e.low),high:g(e.high),lowC:g(e.lowC),highC:g(e.highC),precip:g(e.precip)??g(e.precipitation)??g(e.precipitationProbability),condition:l(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:o,humidity:s,windSpeed:u,windDirection:d,windUnit:h,unit:m,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function T(e){return e*9/5+32}function E(e){return(e-32)*5/9}function D(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=E(e)),!t&&n&&(r=T(e)),`${Math.round(r)}`}function O(e,t,n){return e.tempC===void 0?e.temp===void 0?null:D(e.temp,t,n):D(e.tempC,!1,n)}function k(e,t,n){return e.lowC===void 0?D(e.low,t,n):D(e.lowC,!1,n)}function A(e,t,n){return e.highC===void 0?D(e.high,t,n):D(e.highC,!1,n)}var j=n();function M({icon:e,size:t=20}){let{icon:n,className:r}=S(e);return(0,j.jsx)(n,{width:t,height:t,className:r})}function N({useFahrenheit:e,onToggle:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`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,j.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`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 P({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=D(e.currentTemp,t,n),o=D(e.feelsLike,t,n),s=n?`F`:`C`,l=e.forecast?.[0],u=l?A(l,t,n):null,f=l?k(l,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,j.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,s]}),e.condition&&(0,j.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,j.jsx)(N,{useFahrenheit:n,onToggle:r})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[o!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,o,`°`]}),u!==null&&f!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,u,`° L:`,f,`°`]}),p&&(0,j.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,j.jsx)(d,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,j.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,j.jsx)(c,{width:12,height:12}),e.humidity,`%`]})]})]})}function F({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=O(e,t,n);return(0,j.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,j.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,j.jsx)(M,{icon:e.icon,size:18}),a!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function I({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:i,globalMax:a}=(0,v.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]),o=a-i||1;return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,s)=>{let c=e.dayLabel??e.day??`Day ${s+1}`,l=c.toLowerCase()===`today`,u=k(e,n,r),d=A(e,n,r),f=e.precip,p=e.lowC??e.low??i,m=e.highC??e.high??a,h=(p-i)/o*100,g=(m-i)/o*100,_=Math.max(g-h,2),v=null;if(l&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;v=m===p?50:(Math.max(p,Math.min(m,r))-p)/(m-p)*100}return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-12 shrink-0 truncate text-body-small-default ${l?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`}`,children:c}),(0,j.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,j.jsx)(M,{icon:e.icon,size:16}),f!==void 0&&f>0&&(0,j.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(f),`%`]})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:u===null?`--`:`${u}°`}),(0,j.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,j.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${h}%`,width:`${_}%`}}),v!==null&&(0,j.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:`${h+v/100*_}%`}})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:d===null?`--`:`${d}°`})]},e.id??s)})})})}function L({templateData:e,fallback:t}){let n=(0,v.useMemo)(()=>w(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,v.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsx)(P,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,j.jsx)(F,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,j.jsx)(I,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{L 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-Be4Pgk5X.js";import{B as i,Dr as a,Fr as o,Gi as s,Hi as c,Ii as l,Ki as u,L as d,R as f,Rr as p,Ui as m,Vi as h,Wi as g,z as _}from"./index-Cx6vyW7T.js";var v=e(t(),1),y={"sun.max.fill":{icon:o,className:`text-orange-500`},"cloud.sun.fill":{icon:c,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:g,className:`text-blue-400`},"cloud.fill":{icon:h,className:`text-stone-400`},"cloud.rain.fill":{icon:m,className:`text-blue-400`},snowflake:{icon:p,className:`text-blue-300`},"cloud.bolt.fill":{icon:s,className:`text-orange-500`},"cloud.fog.fill":{icon:u,className:`text-stone-400`}},b={sunny:{icon:o,className:`text-orange-500`},clear:{icon:o,className:`text-orange-500`},"partly cloudy":{icon:c,className:`text-amber-400`},"mostly sunny":{icon:c,className:`text-amber-400`},cloudy:{icon:h,className:`text-stone-400`},overcast:{icon:h,className:`text-stone-400`},rainy:{icon:m,className:`text-blue-400`},rain:{icon:m,className:`text-blue-400`},drizzle:{icon:m,className:`text-blue-400`},snow:{icon:p,className:`text-blue-300`},snowy:{icon:p,className:`text-blue-300`},thunderstorm:{icon:s,className:`text-orange-500`},thunder:{icon:s,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:o,className:`text-orange-500`},"mostly cloudy":{icon:h,className:`text-stone-400`},breezy:{icon:a,className:`text-stone-400`},windy:{icon:a,className:`text-stone-400`},cool:{icon:h,className:`text-stone-400`},warm:{icon:o,className:`text-orange-500`},hot:{icon:o,className:`text-orange-500`},cold:{icon:p,className:`text-blue-300`},"cold snap":{icon:p,className:`text-blue-300`},"warm, mostly sunny":{icon:c,className:`text-amber-400`},"cooler, breezy":{icon:a,className:`text-stone-400`}},x={icon:h,className:`text-stone-400`};function S(e){let t=y[e];if(t)return t;let n=e.toLowerCase(),r=b[n];if(r)return r;for(let[e,t]of Object.entries(b))if(n.includes(e))return t;return x}function C(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 w(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=_(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=_(e.current),r=f(n?.temp)??f(e.currentTemp)??f(e.temperature)??f(e.temp),a=f(n?.feelsLike)??f(n?.feels_like)??f(n?.apparentTemperature)??f(e.feelsLike)??f(e.feels_like)??f(e.apparentTemperature),o=i(n?.condition)??i(e.condition),s=f(n?.humidity)??f(e.humidity),c=C(n?.wind??e.wind),l=f(n?.windSpeed)??f(n?.wind_speed)??f(e.windSpeed)??f(e.wind_speed)??c.speed,u=i(n?.windDirection)??i(n?.wind_direction)??i(e.windDirection)??i(e.wind_direction)??c.direction,p=_(e.units),m=i(p?.temperature)??i(n?.unit)??i(e.unit)??`F`,h=i(p?.speed)??i(e.windUnit)??i(e.wind_unit),g=d(e.hourly).map((e,t)=>({id:i(e.id)??String(t),time:i(e.time)??``,icon:i(e.icon)??i(e.condition)??`cloud.fill`,temp:f(e.tempC)??f(e.temp)??f(e.temperature),tempC:f(e.tempC)})),v=d([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:i(e.id)??String(t),day:i(e.day)??i(e.date),dayLabel:i(e.dayLabel)??i(e.date),icon:i(e.icon)??i(e.condition)??`cloud.fill`,low:f(e.low),high:f(e.high),lowC:f(e.lowC),highC:f(e.highC),precip:f(e.precip)??f(e.precipitation)??f(e.precipitationProbability),condition:i(e.condition)}));return{location:t,currentTemp:r,feelsLike:a,condition:o,humidity:s,windSpeed:l,windDirection:u,windUnit:h,unit:m,hourly:g.length>0?g:void 0,forecast:v.length>0?v:void 0}}function T(e){return e*9/5+32}function E(e){return(e-32)*5/9}function D(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=E(e)),!t&&n&&(r=T(e)),`${Math.round(r)}`}function O(e,t,n){return e.tempC===void 0?e.temp===void 0?null:D(e.temp,t,n):D(e.tempC,!1,n)}function k(e,t,n){return e.lowC===void 0?D(e.low,t,n):D(e.lowC,!1,n)}function A(e,t,n){return e.highC===void 0?D(e.high,t,n):D(e.highC,!1,n)}var j=n();function M({icon:e,size:t=20}){let{icon:n,className:r}=S(e);return(0,j.jsx)(n,{width:t,height:t,className:r})}function N({useFahrenheit:e,onToggle:t}){return(0,j.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:`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,j.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:`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 P({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,o=D(e.currentTemp,t,n),s=D(e.feelsLike,t,n),c=n?`F`:`C`,u=e.forecast?.[0],d=u?A(u,t,n):null,f=u?k(u,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),o!==null&&(0,j.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[o,`°`,c]}),e.condition&&(0,j.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,j.jsx)(N,{useFahrenheit:n,onToggle:r})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[s!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,s,`°`]}),d!==null&&f!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,d,`° L:`,f,`°`]}),p&&(0,j.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,j.jsx)(a,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,j.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,j.jsx)(l,{width:12,height:12}),e.humidity,`%`]})]})]})}function F({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=O(e,t,n);return(0,j.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,j.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,j.jsx)(M,{icon:e.icon,size:18}),a!==null&&(0,j.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function I({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:i,globalMax:a}=(0,v.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]),o=a-i||1;return(0,j.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,j.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,s)=>{let c=e.dayLabel??e.day??`Day ${s+1}`,l=c.toLowerCase()===`today`,u=k(e,n,r),d=A(e,n,r),f=e.precip,p=e.lowC??e.low??i,m=e.highC??e.high??a,h=(p-i)/o*100,g=(m-i)/o*100,_=Math.max(g-h,2),v=null;if(l&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;v=m===p?50:(Math.max(p,Math.min(m,r))-p)/(m-p)*100}return(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`w-12 shrink-0 truncate text-body-small-default ${l?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`}`,children:c}),(0,j.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,j.jsx)(M,{icon:e.icon,size:16}),f!==void 0&&f>0&&(0,j.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(f),`%`]})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:u===null?`--`:`${u}°`}),(0,j.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,j.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${h}%`,width:`${_}%`}}),v!==null&&(0,j.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:`${h+v/100*_}%`}})]}),(0,j.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:d===null?`--`:`${d}°`})]},e.id??s)})})})}function L({templateData:e,fallback:t}){let n=(0,v.useMemo)(()=>w(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,v.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,j.jsxs)(`div`,{className:`mt-3`,children:[(0,j.jsx)(P,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,j.jsx)(F,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,j.jsx)(I,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{L as WeatherForecastDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.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,r as t}from"./dist-
|
|
1
|
+
import{n as e,r as t}from"./dist-3i_EPbLt.js";import{n}from"./definitions-B4RRVbRh.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-3i_EPbLt.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-3i_EPbLt.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{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-3i_EPbLt.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-3i_EPbLt.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-3i_EPbLt.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{t as e}from"./button-D7s2Q_uG.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{l as r}from"./local-mode-
|
|
1
|
+
import{t as e}from"./button-D7s2Q_uG.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{l as r}from"./local-mode-BD2zqd9I.js";import{a as i}from"./routes-B9xcBuuC.js";import{t as a}from"./use-onboarding-login-BZ4ismb6.js";import{_t as o}from"./index-Cx6vyW7T.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-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./cn-DvW5mxZR.js";import{t as a}from"./typography-BscuIPxA.js";import"./src-BJj2O5XB.js";import{n as o,r as s,t as c}from"./metric-card-CgO1F06f.js";import{t as l}from"./ban-BpBuRCKI.js";import{t as u}from"./circle-check-DBzb54Kz.js";import{t as d}from"./loader-circle-Cw1KvvLK.js";import{t as f}from"./triangle-alert-AqQQTwUZ.js";import{t as p}from"./x-BeVbiDS2.js";import{Er as m,Ft as h,Nt as g,Pt as _,ca as v,kr as y}from"./index-Cx6vyW7T.js";var b=e(t(),1),x=r();function S({status:e}){let t=_(e);return(0,x.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-0.5 text-label-small-default`,style:{color:t,backgroundColor:`color-mix(in srgb, ${t} 15%, transparent)`},children:h(e)})}function C({status:e}){let t=`h-3.5 w-3.5 shrink-0`;switch(e){case`completed`:return(0,x.jsx)(u,{className:t,style:{color:`var(--system-positive-strong)`}});case`failed`:return(0,x.jsx)(f,{className:t,style:{color:`var(--system-negative-strong)`}});case`cancelled`:return(0,x.jsx)(l,{className:t,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`});default:return(0,x.jsx)(d,{className:`${t} animate-spin`,style:{color:`var(--primary-base)`}})}}function w({leaf:e}){let[t,n]=(0,b.useState)(!1),r=!!e.resultSummary,i=e.label??`Leaf ${e.seq}`;return(0,x.jsxs)(`div`,{className:`rounded-lg bg-[var(--surface-overlay)] px-4 py-3`,children:[(0,x.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 text-left disabled:cursor-default`,children:[(0,x.jsx)(C,{status:e.status}),(0,x.jsx)(a,{variant:`body-medium-default`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,children:i}),r&&(0,x.jsx)(a,{variant:`body-small-default`,className:`shrink-0 text-[var(--content-tertiary)]`,children:t?`Hide`:`Details`})]}),e.promptSummary&&(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`mt-1 whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:e.promptSummary}),r&&t&&(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`mt-2 whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:e.resultSummary})]})}function T({leaves:e}){let t=[...e.values()].sort((e,t)=>e.seq-t.seq);return t.length===0?(0,x.jsx)(a,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No agents yet`}):(0,x.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(e=>(0,x.jsx)(w,{leaf:e},e.seq))})}function E({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let u=g(e.status),d=e.label??e.runId,f=e.agentsSpawned||e.leaves.size,h=u?`live`:`final`;return(0,b.useEffect)(()=>{l?.(e.runId)},[e.runId,h,l]),(0,x.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[(0,x.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] px-5 py-4`,children:[(0,x.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[var(--surface-overlay)]`,children:(0,x.jsx)(m,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,x.jsx)(a,{variant:`title-medium`,title:d,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:d}),(0,x.jsx)(S,{status:e.status}),(0,x.jsx)(`span`,{className:`flex-1`}),u&&r&&(0,x.jsx)(`button`,{type:`button`,"aria-label":`Stop workflow`,onClick:()=>r(e.runId),className:`flex shrink-0 cursor-pointer items-center gap-1.5 rounded-lg bg-[var(--system-negative-strong)] px-3 py-1.5 text-white transition-colors hover:bg-[color-mix(in_srgb,var(--system-negative-strong)_85%,black)]`,children:(0,x.jsx)(a,{variant:`label-small-default`,className:`text-white`,children:`Stop`})}),(0,x.jsx)(n,{variant:`ghost`,iconOnly:(0,x.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0`})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:[(0,x.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,x.jsx)(c,{icon:(0,x.jsx)(v,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,x.jsx)(c,{icon:(0,x.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,x.jsx)(c,{icon:(0,x.jsx)(y,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:f,format:e=>o(Math.round(e)),label:`Agents`})]}),(e.phase||e.message)&&(0,x.jsxs)(`div`,{className:`mb-5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3`,children:[e.phase&&(0,x.jsx)(a,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e.phase}),e.message&&(0,x.jsx)(a,{variant:`body-small-default`,as:`p`,className:i(`whitespace-pre-wrap break-words text-[var(--content-secondary)]`,e.phase&&`mt-1`),children:e.message})]}),e.summary&&(0,x.jsxs)(`div`,{className:`mb-5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3`,children:[(0,x.jsx)(a,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:`Summary`}),(0,x.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.summary})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(a,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Agents`}),(0,x.jsx)(T,{leaves:e.leaves})]})]})]})}export{E as WorkflowDetailPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{h as r}from"./chunk-5KNZJZUH-DdS6bb-3.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"./menu-CdoNX1qx.js";import{a as u}from"./src-BJj2O5XB.js";import{t as d}from"./confirm-dialog-SpCsmAdG.js";import{t as f}from"./input-Ch7OC6ME.js";import{t as p}from"./modal-CHuPOsJJ.js";import{n as m,t as h}from"./panel-item-BLQE_l-g.js";import{t as g}from"./createLucideIcon-BlMXrA59.js";import{t as _}from"./chevron-right-BNHlGCTg.js";import{t as v}from"./loader-circle-Cw1KvvLK.js";import{t as y}from"./pencil-Dm2eFMe3.js";import{t as b}from"./x-BeVbiDS2.js";import{cr as x,dr as S,fr as C,lr as w,pr as T,sr as E,ur as D}from"./sdk.gen-DtKkd6hs.js";import{n as O}from"./use-is-mobile-D_0cze0t.js";import{$r as k,Ai as A,Kr as j,M,Ni as ee,Nr as N,Oi as P,Or as F,Pi as te,j as I,ji as L,ki as R,ta as z,wi as B}from"./index-Cx6vyW7T.js";import{t as V}from"./use-active-assistant-id-BlwRimQH.js";import{n as ne,t as H}from"./mobile-sidebar-drawer-R6nyuXZ1.js";import{i as U,n as W,r as G,t as K}from"./file-editor-n2sYGdD-.js";import{t as q}from"./format-file-size-Br1LCKQi.js";var re=g(`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`}]]),ie=g(`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`}]]),ae=g(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),J=g(`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`}]]),Y=e(t(),1);function oe(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function se(e,t){return oe(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function ce(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function X(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Z=s();function le(e){return c({queryFn:async()=>{let{data:t,error:n}=await w({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function ue({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=A;return n.startsWith(`image/`)?r=B:n.startsWith(`video/`)?r=F:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=R),(0,Z.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,Z.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function de({viewMode:e,onChange:t}){return(0,Z.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,Z.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 Q({name:e,mimeType:t,size:n,rightContent:r}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(ue,{mimeType:t}),(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:q(n)})]}),r]})}function fe({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await x({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,Y.useState)(null);return(0,Y.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function pe({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...le({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null);(0,Y.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)),y(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Y.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),y(e=>e!=null&&t(e.path)?null:e)},[d]);let b=h!=null&&h===t,x=p?.content??``,S=_?.path===t?_.content:x,C=()=>{g(null),y(null)},w=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await T({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),y(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=S!==x,D=(0,Y.useCallback)(()=>{t&&E&&!w.isPending&&w.mutate({path:t,content:S})},[t,E,w,S]);if(!t)return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Z.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Z.jsx)(ae,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(v,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,k=p.name??t.split(`/`).pop()??t,A=M(k,O),j=se(k,O),ee=p.content!=null&&!A&&!j,N=t?X(t):!0,P=b&&(0,Z.jsx)(W,{isDirty:E,isSaving:w.isPending,error:w.isError?`Save failed`:null,onSave:D,onDiscard:C});if(A&&p.content!=null){let e=b?S:p.content;return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,rightContent:(0,Z.jsx)(de,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:e,fileName:k,mimeType:O,showEdit:!N&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(I,{content:e})}):b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content,readOnly:N,onStartEdit:()=>g(t)})]}),P]})}if(j&&p.content!=null){let e=b?S:p.content,n=ce(e);return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,rightContent:(0,Z.jsx)(de,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:s===`preview`?n:e,downloadContent:e,fileName:k,mimeType:O,showEdit:!N&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Z.jsx)(U,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content,readOnly:N,onStartEdit:()=>g(t)})]}),P]})}return ee?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(K,{content:b?S:p.content??``,fileName:k,mimeType:O,showEdit:!N,isEditing:b,onToggleEdit:()=>b?C():g(t)}),b?(0,Z.jsx)(G,{value:S,onChange:e=>y({path:t,content:e}),onSave:D}):(0,Z.jsx)(U,{content:p.content??``,readOnly:N,onStartEdit:()=>g(t)})]}),P]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Z.jsx)(fe,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:k,mimeType:O,size:p.size}),(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Z.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,Z.jsx)(R,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Z.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:k}),(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:O}),(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:q(p.size,`Unknown size`)}),p.modifiedAt&&(0,Z.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(p.modifiedAt).toLocaleString()]})]})]})})]})}function me(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 he(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 C({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 $(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await C({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 ge({entry:e}){return e.type===`directory`?(0,Z.jsx)(P,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Z.jsx)(B,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Z.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(A,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function _e({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m}){let h=e.path??``,g=e.name??``,v=e.type===`directory`,b=n.has(h),x=r===h,S=g.startsWith(`.`),C=!X(h),w=v&&(b||s.length>0),{data:T}=a({...he({path:{assistant_id:t},query:{path:h,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),E=(0,Y.useMemo)(()=>me(T?.entries??[],o),[T?.entries,o]),D=s===``||g.toLowerCase().includes(s);if(s!==``&&!v&&!D)return null;let O=(0,Z.jsxs)(`button`,{onClick:()=>{v?c(h):l(h)},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:`${m*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?w?(0,Z.jsx)(z,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(_,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Z.jsx)(ge,{entry:e}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:q(e.size)})]});return(0,Z.jsxs)(`div`,{children:[C?(0,Z.jsxs)(u.Root,{children:[(0,Z.jsx)(u.Trigger,{children:O}),(0,Z.jsxs)(u.Content,{children:[v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(L,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`file`,parentPath:h}),children:`New File`}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(J,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`folder`,parentPath:h}),children:`New Folder`}),(0,Z.jsx)(u.Separator,{})]}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(N,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:v}),children:`Delete`}),(0,Z.jsx)(u.Item,{leftIcon:(0,Z.jsx)(y,{className:`h-3.5 w-3.5`}),onSelect:()=>f({path:h,name:g,isDirectory:v}),children:`Rename`})]})]}):O,v&&w&&E.length>0&&(0,Z.jsx)(`div`,{children:E.map(e=>(0,Z.jsx)(_e,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:f,onRequestCreate:p,depth:m+1},e.path))})]})}function ve({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Y.useRef)(null),[d,m]=(0,Y.useState)(a??``),h=d.trim(),g=h.length>0&&(/[/\\]/.test(h)||h===`.`||h===`..`),_=h.length>0&&!g&&!c;return(0,Z.jsx)(p.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Z.jsx)(p.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,Z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_&&s(h)},children:[(0,Z.jsx)(p.Header,{children:(0,Z.jsx)(p.Title,{children:e})}),(0,Z.jsx)(p.Body,{children:(0,Z.jsx)(f,{ref:u,label:`Name`,value:d,onChange:e=>m(e.target.value),placeholder:t,errorText:l??(g?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Z.jsxs)(p.Footer,{children:[(0,Z.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,disabled:!_,children:c?i:r})]})]})})})}function ye({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:p,onToggleShowHidden:m,onChangeSortMode:h,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,x]=(0,Y.useState)(``),C=y.trim().toLowerCase(),[w,O]=(0,Y.useState)(!1),[k,A]=(0,Y.useState)(null),[M,N]=(0,Y.useState)(null),P=(0,Y.useCallback)(()=>{A(null),N(null)},[]),{data:F,isLoading:I}=a(he({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),L=(0,Y.useMemo)(()=>me(F?.entries??[],c),[F?.entries,c]),R=(0,Y.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 $(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await T({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await D({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=>{P(),R(),e.parentPath&&u(e.parentPath),e.kind===`file`?p(e.path):u(e.path)},onError:e=>{N(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 $(e,r,t.newName,i);let{error:o,response:s}=await S({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})=>{P(),R(),_(e,t)},onError:e=>{N(e instanceof Error?e.message:`Failed to rename.`)}}),V=(0,Y.useCallback)(e=>{N(null),A({type:`create`,...e})},[]),ne=(0,Y.useCallback)(e=>{N(null),A({type:`rename`,path:e.path,name:e.name})},[]),[H,U]=(0,Y.useState)(null),W=o({mutationFn:async t=>{let{error:n,response:r}=await E({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=>{U(null),R(),g(e.path)}}),G=(0,Y.useCallback)(e=>{W.reset(),U(e)},[W]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Z.jsx)(ie,{"aria-hidden":!0}):(0,Z.jsx)(re,{"aria-hidden":!0}),onClick:()=>h(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,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Z.jsx)(ee,{"aria-hidden":!0}):(0,Z.jsx)(te,{"aria-hidden":!0}),onClick:m,"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,Z.jsx)(be,{open:w,onOpenChange:O,onSelectKind:e=>{O(!1),V({kind:e,parentPath:``})}})]})]}),(0,Z.jsx)(`div`,{className:`px-3 py-2`,children:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(f,{type:`text`,value:y,onChange:e=>x(e.target.value),placeholder:`Search files`,leftIcon:(0,Z.jsx)(j,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(b,{"aria-hidden":!0}),onClick:()=>x(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:I?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.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,Z.jsx)(_e,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:C,onToggleExpand:l,onSelectPath:p,onRequestDelete:G,onRequestRename:ne,onRequestCreate:V,depth:0},n.path)):(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),k?.type===`create`&&(0,Z.jsx)(ve,{title:k.kind===`file`?`New File`:`New Folder`,placeholder:k.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:P,onConfirm:e=>{N(null),z.mutate({kind:k.kind,parentPath:k.parentPath,name:e})},pending:z.isPending,error:M},`create-${k.kind}-${k.parentPath}`),k?.type===`rename`&&(0,Z.jsx)(ve,{title:`Rename`,placeholder:k.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:k.name,onCancel:P,onConfirm:e=>{if(e===k.name){P();return}N(null),B.mutate({oldPath:k.path,newName:e})},pending:B.isPending,error:M},`rename-${k.path}`),(0,Z.jsx)(d,{open:H!==null,title:H?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Z.jsx)(`span`,{style:{color:`var(--content-default)`},children:H?.name}),H?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,W.error&&(0,Z.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:W.error.message})]}),confirmLabel:W.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:W.isPending,onConfirm:()=>{H&&W.mutate(H)},onCancel:()=>U(null)})]})}function be({open:e,onOpenChange:t,onSelectKind:r}){return O()?(0,Z.jsxs)(m.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(m.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(k,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(m.Content,{children:[(0,Z.jsx)(m.Header,{className:`sr-only`,children:(0,Z.jsx)(m.Title,{children:`Create new`})}),(0,Z.jsxs)(m.Body,{className:`pt-0`,children:[(0,Z.jsx)(h,{icon:L,label:`New File`,onSelect:()=>r(`file`)}),(0,Z.jsx)(h,{icon:J,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Z.jsxs)(l.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(l.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(k,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(l.Content,{align:`end`,sideOffset:4,children:[(0,Z.jsx)(l.Item,{leftIcon:(0,Z.jsx)(L,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Z.jsx)(l.Item,{leftIcon:(0,Z.jsx)(J,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function xe(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 Se({assistantId:e}){let[t,n]=r(),[i,a]=(0,Y.useState)(()=>{let e=t.get(`file`);return e?xe(e):new Set}),[o,s]=(0,Y.useState)(()=>t.get(`file`)),[c,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Y.useState)(`preview`);(0,Y.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Y.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Y.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Y.useState)(!1),v=(0,Y.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Y.useState)(null),x=(0,Y.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,Y.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,Y.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,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Z.jsx)(ne,{onClick:()=>_(!0)})}),(0,Z.jsx)(H,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Z.jsx)(ye,{...w})}),(0,Z.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Z.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,Z.jsx)(ye,{...w})}),(0,Z.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,Z.jsx)(pe,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function Ce(){return(0,Z.jsx)(Se,{assistantId:V()})}export{Ce as WorkspacePage};
|