@vellumai/web 0.10.4-staging.1 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AnimatePresence-Dfn9OLfv.js → AnimatePresence-k-NoyzmC.js} +1 -1
- package/dist/assets/{BundleConfirmPage-cwBrFi1K.js → BundleConfirmPage-BcXA4t1n.js} +1 -1
- package/dist/assets/{Combination-DRz6Ez-m.js → Combination-4Qc3vrtW.js} +1 -1
- package/dist/assets/{QueryClientProvider-DgWA3A3c.js → QueryClientProvider-DKhXIxGb.js} +1 -1
- package/dist/assets/{about-page-6YWjIdZL.js → about-page-BQQ9OMS-.js} +1 -1
- package/dist/assets/{account-page-bNvk8mIC.js → account-page-cTyLtFgE.js} +1 -1
- package/dist/assets/{account-shell-B1geYjoc.js → account-shell-DLtzg6bW.js} +1 -1
- package/dist/assets/acp-run-detail-panel-DaNqQ4AU.js +5 -0
- package/dist/assets/{add-credits-modal-D-5W9e8w.js → add-credits-modal-p8hs2R5Q.js} +1 -1
- package/dist/assets/{advanced-page-CuerkFrp.js → advanced-page-CK4tCgvV.js} +1 -1
- package/dist/assets/ai-page-Bf5G1nk8.js +1 -0
- package/dist/assets/animated-avatar-BSEt2q64.js +1 -0
- package/dist/assets/{api-DXPKXkDj.js → api-Deex2etA.js} +1 -1
- package/dist/assets/{api-key-screen-QS5FdtlL.js → api-key-screen-BToN0-XM.js} +1 -1
- package/dist/assets/{app-info-oX9MaK2d.js → app-info-VB6EcPqh.js} +1 -1
- package/dist/assets/{archive-Ct5g6T4N.js → archive-BFILUl9x.js} +1 -1
- package/dist/assets/{archive-page-Bh0LTWRp.js → archive-page-CjnYMSCA.js} +1 -1
- package/dist/assets/arrow-left-CP-EhDNF.js +1 -0
- package/dist/assets/arrow-up-nBfZxfhi.js +1 -0
- package/dist/assets/assistant-api-D8xSkh-5.js +1 -0
- package/dist/assets/{assistant-feature-flag-store-Ceb6N94N.js → assistant-feature-flag-store-oe00IJMB.js} +1 -1
- package/dist/assets/assistant-identity-store-iWGqR8uz.js +1 -0
- package/dist/assets/{assistant-status-panel-DRHanMan.js → assistant-status-panel-CUEIZEyr.js} +1 -1
- package/dist/assets/{auth-store-BzL2lSd1.js → auth-store-B2Zo6DUE.js} +3 -3
- package/dist/assets/ban-BpBuRCKI.js +1 -0
- package/dist/assets/{bell-B-09xFrv.js → bell-DB1SrBre.js} +1 -1
- package/dist/assets/billing-page-Cjqv3hFX.js +3 -0
- package/dist/assets/{bookmark-B_4Mr1qd.js → bookmark-C3S-p0MQ.js} +1 -1
- package/dist/assets/{bookmarks-page-BvkvZ7uy.js → bookmarks-page-G8JL2TRr.js} +1 -1
- package/dist/assets/{brain-CamcLepK.js → brain-Bs6LnfHO.js} +1 -1
- package/dist/assets/{browser-CDQJAXkC.js → browser-B4y6LCLX.js} +2 -2
- package/dist/assets/{bug-BiiqXpDy.js → bug-DDcuQ3au.js} +1 -1
- package/dist/assets/{build-state-BIN8lPRx.js → build-state-CtsLvNgP.js} +1 -1
- package/dist/assets/{button-BvHa6F59.js → button-D7s2Q_uG.js} +1 -1
- package/dist/assets/{calendar-Ba3kkcG0.js → calendar-CpgH8CqM.js} +1 -1
- package/dist/assets/{capture-error-BaKOqBjF.js → capture-error-BG-GkiMq.js} +1 -1
- package/dist/assets/{card-D9_3ngHI.js → card-BibIM9x3.js} +1 -1
- package/dist/assets/chat-CdO26JJs.js +1 -0
- package/dist/assets/check-CW0KmV0o.js +1 -0
- package/dist/assets/check-D6WkI0gF.js +1 -0
- package/dist/assets/{checkbox-DNfwi5Hy.js → checkbox-BqCzUvXM.js} +1 -1
- package/dist/assets/chevron-left-DghyKSEE.js +1 -0
- package/dist/assets/chevron-right-B6vEpVY0.js +1 -0
- package/dist/assets/{chevron-up-CNrKWpd3.js → chevron-up-BRZN6p_l.js} +1 -1
- package/dist/assets/{circle-alert-BB_iJtM8.js → circle-alert-DvNg50UK.js} +1 -1
- package/dist/assets/circle-check-DzlJxj_M.js +1 -0
- package/dist/assets/{client-feature-flag-store-kWvb3vtZ.js → client-feature-flag-store-k_bI655l.js} +1 -1
- package/dist/assets/client-identity-B8CM527c.js +1 -0
- package/dist/assets/client.gen-DU1JkKSB.js +6 -0
- package/dist/assets/{cloud-off-DpkRXr7O.js → cloud-off-rAv4OHmv.js} +1 -1
- package/dist/assets/{cn-CFvi8Z0K.js → cn-DvW5mxZR.js} +1 -1
- package/dist/assets/code-aMX9iMYa.js +1 -0
- package/dist/assets/{command-palette-D1nNMvVX.js → command-palette-0moHjYai.js} +1 -1
- package/dist/assets/{command-palette-window-page-DrZt0RaG.js → command-palette-window-page-utfVpPv0.js} +1 -1
- package/dist/assets/{community-page-A8lshdka.js → community-page-BLtaVXOe.js} +1 -1
- package/dist/assets/{confirm-dialog-BtxNY4WU.js → confirm-dialog-CfOXCE1N.js} +1 -1
- package/dist/assets/{connect-page-CuSSRk9J.js → connect-page-Cu_qaH-z.js} +1 -1
- package/dist/assets/{consent-controls-CYj9WfJh.js → consent-controls-CwEkJRom.js} +1 -1
- package/dist/assets/{contacts-gateway-CHNyL-NU.js → contacts-gateway-B23m6emG.js} +1 -1
- package/dist/assets/contacts-page-route-Swz0yPYv.js +9 -0
- package/dist/assets/{conversation-list-fetchers-Bcp_Zesn.js → conversation-list-fetchers-B5KLYIZZ.js} +1 -1
- package/dist/assets/{conversation-store-6tz67quR.js → conversation-store-SjqDbOcn.js} +1 -1
- package/dist/assets/{cpu-PmmoD4_K.js → cpu-CiHv3fhs.js} +1 -1
- package/dist/assets/{credit-card-yPLmY1JU.js → credit-card-BKRB1ZIi.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-Dhgk9mkr.js → danger-zone-redirect-page-ChVePZyJ.js} +1 -1
- package/dist/assets/debug-page-CVw2bzGN.js +4 -0
- package/dist/assets/{deploy-dialogs-qdH6GTjP.js → deploy-dialogs-DYPOGbGL.js} +1 -1
- package/dist/assets/{detail-card-5TPdhuZN.js → detail-card-acc7KIet.js} +1 -1
- package/dist/assets/detail-shell-CoKg1S7U.js +3 -0
- package/dist/assets/{developer-page-BXl0qAXX.js → developer-page-nLBkSigq.js} +1 -1
- package/dist/assets/{devices-page-DaZR3FC4.js → devices-page-CFg1FAIT.js} +1 -1
- package/dist/assets/{diagnostics-D5xXiLo-.js → diagnostics-CGIesPpg.js} +1 -1
- package/dist/assets/{dictation-overlay-page-DOdZ_KIz.js → dictation-overlay-page-CIIcRSZr.js} +1 -1
- package/dist/assets/{dist-BkSUb6s0.js → dist-B0Gf-knw.js} +1 -1
- package/dist/assets/{dist-Ble8OyWO.js → dist-cApvLul2.js} +1 -1
- package/dist/assets/{document-viewer-page-XzPSoPVb.js → document-viewer-page-CNWyP82k.js} +1 -1
- package/dist/assets/{domain-field-BGp08c4L.js → domain-field-DYwuCpup.js} +1 -1
- package/dist/assets/{dropdown-SUNHYFiy.js → dropdown-CL8VmqrY.js} +1 -1
- package/dist/assets/earn-credits-modal-BkXk_l9a.js +1 -0
- package/dist/assets/{emails-page-BRnVsJnR.js → emails-page-C9mr_lzm.js} +1 -1
- package/dist/assets/{environment-store-B5EGAqzg.js → environment-store-DX2nQ26G.js} +1 -1
- package/dist/assets/esm-BPR7F84K.js +1 -0
- package/dist/assets/{esm-DQXfMjvW.js → esm-B_Dgz4mc.js} +2 -2
- package/dist/assets/esm-C7SZoG5u.js +2 -0
- package/dist/assets/esm-CMxBpGk-.js +2 -0
- package/dist/assets/esm-XqRGVrcj.js +2 -0
- package/dist/assets/esm-oLFwK0Kw.js +2 -0
- package/dist/assets/{external-link-h3UAe8eX.js → external-link-RJkZLlff.js} +1 -1
- package/dist/assets/{feature-flag-catalog-Br-v70vR.js → feature-flag-catalog-C7oM7PZ_.js} +1 -1
- package/dist/assets/{file-editor-Cy1TZHJJ.js → file-editor-BWfAnSsG.js} +1 -1
- package/dist/assets/{file-text-Bxj0xAst.js → file-text-ClqzuFsu.js} +1 -1
- package/dist/assets/funnel-CUPE93jb.js +1 -0
- package/dist/assets/general-page-Cx6tlYeL.js +1 -0
- package/dist/assets/{globe-D7wvOZaZ.js → globe-D3P5sSKJ.js} +1 -1
- package/dist/assets/{hard-drive-CO7i5o4z.js → hard-drive-CZEg1Cqc.js} +1 -1
- package/dist/assets/{hatching-screen-YvbZlnsV.js → hatching-screen-DbVpuOai.js} +1 -1
- package/dist/assets/home-page-route-CweAnlJn.js +1 -0
- package/dist/assets/{hosting-screen-CKlP38Z3.js → hosting-screen-DpWTAyj2.js} +1 -1
- package/dist/assets/identity-page-route-TiI1OQgN.js +1 -0
- package/dist/assets/index-0XgM92Lz.js +130 -0
- package/dist/assets/index-N8IeZea9.css +2 -0
- package/dist/assets/{info-CNTT4WCe.js → info-BGLlcyt6.js} +1 -1
- package/dist/assets/{info-B4DDA6uP.js → info-ciQS_i3y.js} +1 -1
- package/dist/assets/{input-BLN3wmw2.js → input-C8kfrq9r.js} +1 -1
- package/dist/assets/{inspect-page-AldHg0Dz.js → inspect-page-BWSvIJ2d.js} +9 -7
- package/dist/assets/install-s7InKiDi.js +1 -0
- package/dist/assets/integrations-page-CMYurvd3.js +1 -0
- package/dist/assets/intelligence-layout-B_UDPu0L.js +1 -0
- package/dist/assets/{keyboard-shortcuts-page-Capx1ICA.js → keyboard-shortcuts-page-E8rGDLiG.js} +1 -1
- package/dist/assets/{lib-Bexzcbsy.js → lib-BUVy-xYr.js} +1 -1
- package/dist/assets/{library-detail-page-DrgMdBPq.js → library-detail-page-BlrRC_ny.js} +1 -1
- package/dist/assets/{library-page-Catpu3p0.js → library-page-Dct5o6_9.js} +1 -1
- package/dist/assets/{link-2-DW8ruMGH.js → link-2-r_QPxX18.js} +1 -1
- package/dist/assets/{list-row-l7sxQ4Tj.js → list-row-Cw9JYESP.js} +1 -1
- package/dist/assets/loader-circle-BFRVtR3K.js +1 -0
- package/dist/assets/{local-mode-Cez1weue.js → local-mode-CvrNMtPF.js} +1 -1
- package/dist/assets/{log-in-Ci5ja9sN.js → log-in-CEw63CGU.js} +1 -1
- package/dist/assets/{login-flow-DeMU71_M.js → login-flow-BtdVqmTm.js} +1 -1
- package/dist/assets/{login-page-DkNb0F3s.js → login-page-sS8t_Aik.js} +1 -1
- package/dist/assets/{logout-page-POyojlS1.js → logout-page-BCcEjyS2.js} +1 -1
- package/dist/assets/{logs-layout-qJmOLDZF.js → logs-layout-Btvxnin8.js} +1 -1
- package/dist/assets/{memory-router-playground-page-DD6t0kqe.js → memory-router-playground-page-D5ruL9dQ.js} +1 -1
- package/dist/assets/{menu-_JM4udVm.js → menu-C_97pis4.js} +1 -1
- package/dist/assets/messages-B5v7xWiw.js +13 -0
- package/dist/assets/{status-badge-pill-CSitw8_5.js → metric-card-DqAVWY-G.js} +1 -1
- package/dist/assets/{minimize-2-DmC6-Woz.js → minimize-2-dKm10qRD.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-B4ol32hs.js → mobile-sidebar-drawer-BBHy-x2N.js} +1 -1
- package/dist/assets/{modal-CH2iwSBx.js → modal-D0Q3UWD0.js} +1 -1
- package/dist/assets/{monitor-B1YMXlZj.js → monitor-CXU19mVX.js} +1 -1
- package/dist/assets/{moon-DSWoApF5.js → moon-CKINz50a.js} +1 -1
- package/dist/assets/mutation-error-NiVTbM-q.js +1 -0
- package/dist/assets/{native-file-GuVJgNpB.js → native-file-Bm3eyig_.js} +2 -2
- package/dist/assets/{notice-BhqKj_VM.js → notice-CqRgVmeL.js} +1 -1
- package/dist/assets/{notifications-page-MRalDive.js → notifications-page-cOGpYgqy.js} +1 -1
- package/dist/assets/{oauth-complete-page-DGOyh2u6.js → oauth-complete-page-C2RjDFuA.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BPxKmr_f.js → oauth-popup-complete-page-Cwy2jqJN.js} +1 -1
- package/dist/assets/{page-shell-cu3KBmqd.js → page-shell-5T-Jxz7G.js} +1 -1
- package/dist/assets/{pairing-page-_ulPOW9r.js → pairing-page-DHF2ThH-.js} +1 -1
- package/dist/assets/{panel-item-DN2CyWOT.js → panel-item-nGTDevWP.js} +1 -1
- package/dist/assets/{password-reset-page-BfRXQpS_.js → password-reset-page-yn0MrnNq.js} +1 -1
- package/dist/assets/{pencil-DUMCM9m-.js → pencil-B90pDI55.js} +1 -1
- package/dist/assets/{platform-loopback-page-D3oAT6qE.js → platform-loopback-page-DSx9flbF.js} +1 -1
- package/dist/assets/plugin-detail-page-sX6m5HV3.js +1 -0
- package/dist/assets/plugins-page-_kqpdU-W.js +1 -0
- package/dist/assets/plugins-surface-KFX25A-q.js +1 -0
- package/dist/assets/{popover-BIr0nN9H.js → popover-CL-JL6vG.js} +1 -1
- package/dist/assets/prechat-route-D2HszqA0.js +1 -0
- package/dist/assets/{prefs-C6e8pdrA.js → prefs-OrKWJGM_.js} +1 -1
- package/dist/assets/{privacy-page-gc352kAN.js → privacy-page-BJfuoXgs.js} +1 -1
- package/dist/assets/privacy-screen-BGNcisJ2.js +1 -0
- package/dist/assets/{progress-bar-ATg2lhDh.js → progress-bar-DIFlWPPg.js} +1 -1
- package/dist/assets/{provider-callback-page-BtYwaMxL.js → provider-callback-page-LZHmOo01.js} +1 -1
- package/dist/assets/{provider-key-BKR2QTfR.js → provider-key-DIchy_Bc.js} +1 -1
- package/dist/assets/{provider-signup-page-80V_D9ad.js → provider-signup-page-D327vCgu.js} +1 -1
- package/dist/assets/{proxy-T76Q62qP.js → proxy-i05YF9w2.js} +1 -1
- package/dist/assets/{quick-input-page-B-7fTgJi.js → quick-input-page-DA2vqGas.js} +1 -1
- package/dist/assets/react-query.gen-CsMIK93J.js +1 -0
- package/dist/assets/{react-query.gen-breoeUVK.js → react-query.gen-DiTBi6eG.js} +1 -1
- package/dist/assets/{refresh-cw-kmptQnpX.js → refresh-cw-Dui3Ymsb.js} +1 -1
- package/dist/assets/repeat-nCGBxntG.js +1 -0
- package/dist/assets/{research-mock-page-DYPr-S2q.js → research-mock-page-DRkJQuq2.js} +1 -1
- package/dist/assets/research-onboarding-route-Dk-9KwG_.js +37 -0
- package/dist/assets/{resize-errors-ocHCHRPn.js → resize-errors-D1myE8D_.js} +1 -1
- package/dist/assets/{resolved-assistants-store-BrS8JBzC.js → resolved-assistants-store-Cp4J43BK.js} +1 -1
- package/dist/assets/{return-to-DlPFMVLx.js → return-to-D0TfUwsP.js} +1 -1
- package/dist/assets/{review-terms-screen-DFlSm1tM.js → review-terms-screen-Cmcw1D67.js} +1 -1
- package/dist/assets/routes-Cj4wRAOK.js +1 -0
- package/dist/assets/{save-DQyrotXP.js → save-BpAesNEP.js} +1 -1
- package/dist/assets/{schedules-DZspBZ61.js → schedules-B7I0imdw.js} +1 -1
- package/dist/assets/sdk.gen-BwKkHEki.js +1 -0
- package/dist/assets/{sdk.gen-DSjI3deY.js → sdk.gen-DmWuY0SL.js} +1 -1
- package/dist/assets/{select-assistant-screen-kcdnMYj7.js → select-assistant-screen-oJuFe0vU.js} +1 -1
- package/dist/assets/{setting-row-DB3q3lgL.js → setting-row-DodPe3yk.js} +1 -1
- package/dist/assets/settings-layout-B9Uu1igg.js +1 -0
- package/dist/assets/share-feedback-modal-DN1agJEb.js +1 -0
- package/dist/assets/{shortcut-keys-D4E8qQgS.js → shortcut-keys-vM6sNj7W.js} +1 -1
- package/dist/assets/{sidebar-tree-BCJVetMg.js → sidebar-tree-CHyPnNA0.js} +1 -1
- package/dist/assets/{signup-page-iM9szAKN.js → signup-page-BaIcYI50.js} +1 -1
- package/dist/assets/{signup-shell-GOG8-46O.js → signup-shell-DgwKMvn2.js} +1 -1
- package/dist/assets/skills-page-wOVBvBdB.js +1 -0
- package/dist/assets/{sound-manager-DwCzTycd.js → sound-manager-BnZ7SwXM.js} +1 -1
- package/dist/assets/{sounds-page-C3qbFW0l.js → sounds-page-ZCBq6ru9.js} +1 -1
- package/dist/assets/{sparkles-C8eL4LNF.js → sparkles-Bla177ar.js} +1 -1
- package/dist/assets/{src-Dr68ou95.js → src-mai-NajT.js} +1 -1
- package/dist/assets/{stat-square-zBHENXcL.js → stat-square-B0S3fO7O.js} +1 -1
- package/dist/assets/status-badge-pill-Bwe3k-op.js +1 -0
- package/dist/assets/{step-indicator-dots-D4A7eDFL.js → step-indicator-dots-DjUaEVje.js} +1 -1
- package/dist/assets/subagent-detail-panel-C_GwZcyl.js +4 -0
- package/dist/assets/{subagent-store-CFwN6f1W.js → subagent-store-BANqfUgA.js} +1 -1
- package/dist/assets/system-events-page-CQUZjHbp.js +1 -0
- package/dist/assets/{system-events-redirect-page-Bkigvq03.js → system-events-redirect-page-B6WgM0Vv.js} +1 -1
- package/dist/assets/{tag-64Evw5MO.js → tag-B_-QAvJF.js} +1 -1
- package/dist/assets/three-dot-indicator-DAKo-L_x.js +1 -0
- package/dist/assets/{tiptap-document-editor-D031y5O7.js → tiptap-document-editor-tDTTC-Je.js} +2 -2
- package/dist/assets/{toast-VJ6jFKB9.js → toast-2TW5tj1Y.js} +1 -1
- package/dist/assets/{toggle-zADptotB.js → toggle-X_kQW5my.js} +1 -1
- package/dist/assets/tool-detail-panel-DIk8Db76.js +2 -0
- package/dist/assets/{trace-page-CEyVWa_4.js → trace-page-TdKZ1dXH.js} +1 -1
- package/dist/assets/{triangle-alert-DqPPHRPD.js → triangle-alert-Bz1PpciW.js} +1 -1
- package/dist/assets/{triangle-alert-eaW8jtCr.js → triangle-alert-C3aHZq1F.js} +1 -1
- package/dist/assets/{typography-COqg6o2z.js → typography-BscuIPxA.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CM9JnbEO.js → upgrade-cancel-page-BVr06o5p.js} +1 -1
- package/dist/assets/{upgrade-success-page-BxrXUjiP.js → upgrade-success-page-CIBIIMbB.js} +1 -1
- package/dist/assets/{usage-page-DBmsLal7.js → usage-page-CcGNq6p_.js} +1 -1
- package/dist/assets/{use-active-assistant-id-jfqnc4T7.js → use-active-assistant-id-D4UJEQM5.js} +1 -1
- package/dist/assets/{use-bus-subscription-CKWguMzy.js → use-bus-subscription-CNRtVrPC.js} +1 -1
- package/dist/assets/use-is-org-ready-Dj2-PRLz.js +1 -0
- package/dist/assets/{use-onboarding-login-Cz1MgHw6.js → use-onboarding-login-CyEAqbC7.js} +1 -1
- package/dist/assets/{use-reduced-motion-DvKonyYy.js → use-reduced-motion-DmsjJfoE.js} +1 -1
- package/dist/assets/{useMutation-D3WkZnYg.js → useMutation-Lj4VunQV.js} +1 -1
- package/dist/assets/{useBaseQuery-BOw_gWPH.js → useQuery-B45lW1Kk.js} +1 -1
- package/dist/assets/{user-plus-CjFuXA3D.js → user-plus-COoYKnWs.js} +1 -1
- package/dist/assets/{utils-Lep-7jRg.js → utils-Bg9t-lBx.js} +1 -1
- package/dist/assets/viewer-store-BKkbfdPD.js +1 -0
- package/dist/assets/{voice-page-C3zxM20t.js → voice-page-BOFy-jR_.js} +1 -1
- package/dist/assets/weather-forecast-display-bZDWJOMu.js +1 -0
- package/dist/assets/{web-Cygkn0vs.js → web-BlDBGu36.js} +1 -1
- package/dist/assets/{web-CNtrY6ZR.js → web-BpH9TOnx.js} +1 -1
- package/dist/assets/{web-CtAf2vJC.js → web-CFYymSzw.js} +1 -1
- package/dist/assets/{web-C6Et8xNJ.js → web-CReVlJcu.js} +1 -1
- package/dist/assets/{web-CccL0uF5.js → web-CWJUzKI_.js} +1 -1
- package/dist/assets/{web-Broue3sZ.js → web-Cd-q_a1I.js} +1 -1
- package/dist/assets/{web-DuqCaaXx.js → web-Cly_79wU.js} +1 -1
- package/dist/assets/{welcome-screen-RBmiq3Lq.js → welcome-screen-Cka_lktU.js} +1 -1
- package/dist/assets/workflow-detail-panel-C_rq6yGi.js +1 -0
- package/dist/assets/workspace-page-4CJ_pIeB.js +1 -0
- package/dist/assets/x-C8bCmIhD.js +1 -0
- package/dist/assets/x-DxL-bCuT.js +1 -0
- package/dist/index.html +136 -135
- package/package.json +1 -1
- package/dist/assets/ai-page-CsqhZcSf.js +0 -1
- package/dist/assets/arrow-left-BPsKoNcb.js +0 -1
- package/dist/assets/arrow-up-CkZMv0kb.js +0 -1
- package/dist/assets/assistant-api-BdlaVxiH.js +0 -1
- package/dist/assets/assistant-identity-store-ESeBny_J.js +0 -1
- package/dist/assets/ban-BW0pQzvY.js +0 -1
- package/dist/assets/billing-page-CEArOabV.js +0 -3
- package/dist/assets/check-DwLoiFa9.js +0 -1
- package/dist/assets/check-DxBmXJus.js +0 -1
- package/dist/assets/chevron-left-CgekgptJ.js +0 -1
- package/dist/assets/chevron-right-DP15nqFC.js +0 -1
- package/dist/assets/circle-check-Cwv8JCfw.js +0 -1
- package/dist/assets/code-7vvpMPgo.js +0 -1
- package/dist/assets/contacts-page-route-qsIGsjpD.js +0 -9
- package/dist/assets/debug-page-Ddv9MlOm.js +0 -4
- package/dist/assets/earn-credits-modal-D7ioWvNh.js +0 -1
- package/dist/assets/esm-8Mv545sP.js +0 -2
- package/dist/assets/esm-B35SBKTx.js +0 -2
- package/dist/assets/esm-B9nLiq-2.js +0 -1
- package/dist/assets/esm-Dz9uwqjb.js +0 -2
- package/dist/assets/esm-TyKOKslC.js +0 -2
- package/dist/assets/funnel-events-Dz_DLI0Q.js +0 -1
- package/dist/assets/general-page-Dl7IYYSf.js +0 -1
- package/dist/assets/home-page-route-B7AJU1pr.js +0 -1
- package/dist/assets/identity-page-route-CZQEWoJK.js +0 -1
- package/dist/assets/index-3zpPFBeR.js +0 -132
- package/dist/assets/index-PRuqIn_u.css +0 -2
- package/dist/assets/install-D_GSceot.js +0 -1
- package/dist/assets/integrations-page-b3sE-PDS.js +0 -1
- package/dist/assets/intelligence-layout-CsM_YjdB.js +0 -1
- package/dist/assets/loader-circle-cYXxWP5B.js +0 -1
- package/dist/assets/messages-DCNfjhgv.js +0 -13
- package/dist/assets/mutation-error-B5AKP6aC.js +0 -1
- package/dist/assets/plugin-detail-page-ClMMTrti.js +0 -1
- package/dist/assets/plugins-page-y6Aom9qx.js +0 -1
- package/dist/assets/prechat-route-MTnUk6MK.js +0 -1
- package/dist/assets/privacy-screen-CQLPQPoM.js +0 -1
- package/dist/assets/react-query.gen-BeTpj_Sy.js +0 -1
- package/dist/assets/research-onboarding-route-yYstHFq4.js +0 -35
- package/dist/assets/risk-badge-CTIwePVV.js +0 -1
- package/dist/assets/routes-Dzl0kj5j.js +0 -1
- package/dist/assets/sdk.gen-CC1iYdd0.js +0 -6
- package/dist/assets/settings-layout-DV4y_-8a.js +0 -1
- package/dist/assets/share-feedback-modal-CNGNLLDP.js +0 -1
- package/dist/assets/skills-page-D3c3cuti.js +0 -1
- package/dist/assets/subagent-detail-panel-D3xm4yVF.js +0 -4
- package/dist/assets/system-events-page-CXlJ_J54.js +0 -1
- package/dist/assets/three-dot-indicator-DKd64wpF.js +0 -1
- package/dist/assets/tool-call-status-DNS6Y_vi.js +0 -1
- package/dist/assets/tool-detail-panel-Cq_SyoUG.js +0 -2
- package/dist/assets/use-is-org-ready-DLZpD311.js +0 -1
- package/dist/assets/use-plugin-drift-4-li_vW2.js +0 -1
- package/dist/assets/useInfiniteQuery-iPXlezAp.js +0 -1
- package/dist/assets/useQuery-cVuP8q1x.js +0 -1
- package/dist/assets/viewer-store-Dened07w.js +0 -1
- package/dist/assets/weather-forecast-display-DfsXEBSo.js +0 -1
- package/dist/assets/workflow-detail-panel-C2dD_hU2.js +0 -1
- package/dist/assets/workspace-page-lR8lzD2L.js +0 -1
- package/dist/assets/x-649kPSQS.js +0 -1
- package/dist/assets/x-Bn5tweDc.js +0 -1
- /package/dist/assets/{api-errors-B-g6gvNv.js → api-errors-DPruG7q9.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-DoxUXsZB.js → avatar-bundled-components-DUNo-SZc.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-Bzno7teV.js → avatar-svg-compositor-DMVZdMXC.js} +0 -0
- /package/dist/assets/{build.umd-C56vswwO.js → build.umd-BO4u00Aj.js} +0 -0
- /package/dist/assets/{client.gen-BnoNy2w0.js → client.gen-BHupOCJH.js} +0 -0
- /package/dist/assets/{composer-focus-BZr63Cvs.js → composer-focus-CpeV_gfi.js} +0 -0
- /package/dist/assets/{conversation-selection-BV7USWf2.js → conversation-selection-DA_7HozA.js} +0 -0
- /package/dist/assets/{create-selectors-BTyhO-eS.js → create-selectors-BE0_e_Ed.js} +0 -0
- /package/dist/assets/{createLucideIcon-6rJ6BdB7.js → createLucideIcon-Bjb-Kuq7.js} +0 -0
- /package/dist/assets/{createLucideIcon-D8roAprb.js → createLucideIcon-BlMXrA59.js} +0 -0
- /package/dist/assets/{definitions-CtVlh_R5.js → definitions-DiTBkL0Z.js} +0 -0
- /package/dist/assets/{dist-CzyDxYAs.js → dist-FMUOufe0.js} +0 -0
- /package/dist/assets/{edit-chat-session-BYvbyTwd.js → edit-chat-session-B8pCxoj8.js} +0 -0
- /package/dist/assets/{effective-timezone-DAkNzd21.js → effective-timezone-CND2iNaq.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-hHp74TCA.js → emoji-catalog-data-Bg0TbcxL.js} +0 -0
- /package/dist/assets/{event-bus-CBil9JQT.js → event-bus-B3E3w-q2.js} +0 -0
- /package/dist/assets/{format-HKnibeVj.js → format-9aopHqZI.js} +0 -0
- /package/dist/assets/{format-date-DyMQp2_m.js → format-date-C4llqVi6.js} +0 -0
- /package/dist/assets/{format-file-size-DOcXaUaE.js → format-file-size-CCd1QKOV.js} +0 -0
- /package/dist/assets/{haptics-CKwMH4eq.js → haptics-sqdfYVvS.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-XVa1Tm2F.js → impersonate-version-flag-v7MjXJjg.js} +0 -0
- /package/dist/assets/{infiniteQueryOptions-DTCCTa10.js → infiniteQueryOptions-C6p49ZmI.js} +0 -0
- /package/dist/assets/{is-electron-URCUw74P.js → is-electron-C_ZTVhv8.js} +0 -0
- /package/dist/assets/{jsx-runtime-B-mvcaJS.js → jsx-runtime-CVSDxk6A.js} +0 -0
- /package/dist/assets/{llm-dimension-Dx3xIzPP.js → llm-dimension-lLHLPAPE.js} +0 -0
- /package/dist/assets/{misc-CBD9JJCY.js → misc-Bm2e0rTa.js} +0 -0
- /package/dist/assets/{native-deep-link-DmJ7Ty6z.js → native-deep-link-DGAUYRAY.js} +0 -0
- /package/dist/assets/{pdf-DNWhOzmB.js → pdf-RkJbZQTD.js} +0 -0
- /package/dist/assets/{prechat-names-Bo5bdzfH.js → prechat-names-DqbiM_xi.js} +0 -0
- /package/dist/assets/{prechat-BuuzFtal.js → prechat-qvhqEHmK.js} +0 -0
- /package/dist/assets/{public-asset-BTisO-cB.js → public-asset-B78MSgNd.js} +0 -0
- /package/dist/assets/{queryOptions-DGyQTr3e.js → queryOptions-BtNi-_9H.js} +0 -0
- /package/dist/assets/{semver-DpADL11z.js → semver-ilCx6Qwk.js} +0 -0
- /package/dist/assets/{typed-storage-Chj38wph.js → typed-storage-CNJeje_7.js} +0 -0
- /package/dist/assets/{usage-window-dm_mRqGo.js → usage-window-CL2KEFPC.js} +0 -0
- /package/dist/assets/{use-is-mobile-BF5x8sr8.js → use-is-mobile-BGESxQUL.js} +0 -0
- /package/dist/assets/{workflow-status-B53qU9DS.js → workflow-status-PqQ1OqJN.js} +0 -0
- /package/dist/assets/{xterm-CQ7wuPsS.js → xterm-CRS9jN9Y.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-CamgTlEH.js → xterm-addon-fit-gN9udZ6n.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-BvHa6F59.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-B-mvcaJS.js";import{t as o}from"./useQuery-cVuP8q1x.js";import{t as s}from"./dropdown-SUNHYFiy.js";import"./src-Dr68ou95.js";import{t as c}from"./sparkles-C8eL4LNF.js";import{t as l}from"./triangle-alert-DqPPHRPD.js";import{tr as u}from"./sdk.gen-CC1iYdd0.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-BeTpj_Sy.js";import{t as p}from"./api-errors-B-g6gvNv.js";import{Ht as m,an as ae}from"./index-3zpPFBeR.js";import{t as h}from"./use-active-assistant-id-jfqnc4T7.js";import{i as g,t as _}from"./format-HKnibeVj.js";import{i as v,o as y,r as b}from"./llm-dimension-Dx3xIzPP.js";import{n as x}from"./usage-window-dm_mRqGo.js";import{n as oe,t as se}from"./schedules-DZspBZ61.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=a(),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:a,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=o({queryKey:ie({path:{assistant_id:e}}),queryFn:()=>se(e),staleTime:1e4}),g=(0,S.useCallback)(e=>{l({range:e})},[l]),_=o({...ee({path:{assistant_id:e},query:Ce({from:p.from,to:p.to,scheduleId:s})})}),v=o({queryKey:te({path:{assistant_id:e},query:W({from:p.from,to:p.to,groupBy:a,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:a,scheduleId:s}),signal:t,throwOnError:!0});return{groupBy:a,response:n}}catch(n){if(!Be(a,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??a,b=ze(y)?y:void 0,x=o({...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=o({...f({path:{assistant_id:e},query:we({from:p.from,to:p.to,granularity:m,tz:c,scheduleId:s})}),enabled:!b||x.isError}),w=o({...re({path:{assistant_id:e}}),enabled:y===`task`,staleTime:1/0}),T=o({...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===a&&y!==a&&(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-CL8VmqrY.js";import"./src-mai-NajT.js";import{t as c}from"./sparkles-Bla177ar.js";import{t as l}from"./triangle-alert-C3aHZq1F.js";import{tr as u}from"./sdk.gen-BwKkHEki.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-CsMIK93J.js";import{t as p}from"./api-errors-DPruG7q9.js";import{On as ae,dn as m}from"./index-0XgM92Lz.js";import{t as h}from"./use-active-assistant-id-D4UJEQM5.js";import{i as g,t as _}from"./format-9aopHqZI.js";import{i as v,o as y,r as b}from"./llm-dimension-lLHLPAPE.js";import{n as x}from"./usage-window-CL2KEFPC.js";import{n as oe,t as se}from"./schedules-B7I0imdw.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-jfqnc4T7.js → use-active-assistant-id-D4UJEQM5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./resolved-assistants-store-
|
|
1
|
+
import{n as e}from"./resolved-assistants-store-Cp4J43BK.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-B3E3w-q2.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{V as e,i as t}from"./auth-store-B2Zo6DUE.js";function n(){let n=e.use.currentOrganizationId();return!t()||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-CvrNMtPF.js";import{t as a}from"./is-electron-C_ZTVhv8.js";import{A as o,P as s}from"./auth-store-B2Zo6DUE.js";import{a as c}from"./routes-Cj4wRAOK.js";import{n as l,t as u}from"./build-state-CtsLvNgP.js";import{n as d}from"./login-flow-BtdVqmTm.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()&&s()){t(`${c.account.login}?returnTo=${encodeURIComponent(n)}`);return}let r=++v.current;_(null),h(!0);try{await o(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{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{c as n,l as r,u as i}from"./proxy-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{c as n,l as r,u as i}from"./proxy-i05YF9w2.js";var a=e(t(),1);function o(){!r.current&&n();let[e]=(0,a.useState)(i.current);return e}export{o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{N as n,O as r,S as i,c as a,g as o,k as s,n as c,o as l,r as u}from"./QueryClientProvider-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{N as n,O as r,S as i,c as a,g as o,k as s,n as c,o as l,r as u}from"./QueryClientProvider-DKhXIxGb.js";var d=class extends u{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||f(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=l({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),a.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function f(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var p=class extends n{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&o(t.mutationKey)!==o(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??f();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){a.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},m=e(t(),1);function h(e,t){let n=c(t),[r]=m.useState(()=>new p(n,e));m.useEffect(()=>{r.setOptions(e)},[r,e]);let o=m.useSyncExternalStore(m.useCallback(e=>r.subscribe(a.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=m.useCallback((e,t)=>{r.mutate(e,t).catch(i)},[r]);if(o.error&&s(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}export{d as n,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{A as n,D as r,E as i,M as a,N as o,O as s,S as c,a as l,c as u,i as d,j as f,k as p,l as m,m as h,n as g,o as _,r as v,u as y,v as b,w as x,y as S}from"./QueryClientProvider-DgWA3A3c.js";import{t as C}from"./jsx-runtime-B-mvcaJS.js";var w=class extends v{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=D(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=D(this.options);e.data!==void 0&&(this.setState(E(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=x(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>i(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>r(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=h(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=_({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof d&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof d){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...T(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...E(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),u.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function T(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function E(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var O=class extends o{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=m(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),A(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return j(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return j(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof i(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!s(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let a=this.hasListeners();a&&M(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),a&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||r(this.options.staleTime,this.#t)!==r(t.staleTime,this.#t))&&this.#g();let o=this.#_();a&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||o!==this.#p)&&this.#v(o)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return P(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#g(){this.#b();let e=r(this.options.staleTime,this.#t);if(b||this.#r.isStale||!S(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=a.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(b||i(this.options.enabled,this.#t)===!1||!S(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(a.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(a.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,a=this.#r,o=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},d=!1,f;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&A(e,t),o=i&&M(e,n,t,r);(a||o)&&(u={...u,...T(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:p,errorUpdatedAt:h,status:g}=u;f=u.data;let _=!1;if(t.placeholderData!==void 0&&f===void 0&&g===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,_=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(g=`success`,f=x(a?.data,e,t),d=!0)}if(t.select&&f!==void 0&&!_)if(a&&f===o?.data&&t.select===this.#c)f=this.#l;else try{this.#c=t.select,f=t.select(f),f=x(a?.data,f,t),this.#l=f,this.#s=null}catch(e){this.#s=e}this.#s&&(p=this.#s,f=this.#l,h=Date.now(),g=`error`);let v=u.fetchStatus===`fetching`,y=g===`pending`,b=g===`error`,S=y&&v,C=f!==void 0,w={status:g,fetchStatus:u.fetchStatus,isPending:y,isSuccess:g===`success`,isError:b,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!y,isLoadingError:b&&!C,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:b&&C,isStale:N(e,t),refetch:this.refetch,promise:this.#o,isEnabled:i(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=w.data!==void 0,r=w.status===`error`&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{i(this.#o=w.promise=m())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||w.data!==o.value)&&a();break;case`rejected`:(!r||w.error!==o.reason)&&a();break}}return w}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!s(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){u.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function k(e,t){return i(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function A(e,t){return k(e,t)||e.state.data!==void 0&&j(e,t,t.refetchOnMount)}function j(e,t,n){if(i(t.enabled,e)!==!1&&r(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&N(e,t)}return!1}function M(e,t,n,r){return(e!==t||i(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&N(e,n)}function N(e,t){return i(t.enabled,e)!==!1&&e.isStaleByTime(r(t.staleTime,e))}function P(e,t){return!s(e.getCurrentResult(),t)}C();var F=e(t(),1),I=F.createContext(!1),L=()=>F.useContext(I);I.Provider;function R(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z=F.createContext(R()),B=()=>F.useContext(z),V=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?p(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},H=e=>{F.useEffect(()=>{e.clearReset()},[e])},U=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||p(n,[e.error,r])),W=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},G=(e,t)=>e.isLoading&&e.isFetching&&!t,K=(e,t)=>e?.suspense&&t.isPending,q=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function J(e,t,n){let r=L(),i=B(),a=g(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,W(o),V(o,i,s),H(i);let l=!a.getQueryCache().get(o.queryHash),[d]=F.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(F.useSyncExternalStore(F.useCallback(e=>{let t=p?d.subscribe(u.batchCalls(e)):c;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),F.useEffect(()=>{d.setOptions(o)},[o,d]),K(o,f))throw q(o,d,i);if(U({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!b&&G(f,r)&&(l?q(o,d,i):s?.promise)?.catch(c).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}export{V as a,B as c,w as d,K as i,L as l,W as n,U as o,q as r,H as s,J as t,O as u};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{A as n,D as r,E as i,M as a,N as o,O as s,S as c,a as l,c as u,i as d,j as f,k as p,l as m,m as h,n as g,o as _,r as v,u as y,v as b,w as x,y as S}from"./QueryClientProvider-DKhXIxGb.js";import{t as C}from"./jsx-runtime-CVSDxk6A.js";var w=class extends v{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=D(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=D(this.options);e.data!==void 0&&(this.setState(E(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=x(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>i(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>r(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=h(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=_({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof d&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof d){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...T(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...E(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),u.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function T(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function E(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var O=class extends o{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=m(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),A(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return j(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return j(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof i(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!s(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let a=this.hasListeners();a&&M(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),a&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||r(this.options.staleTime,this.#t)!==r(t.staleTime,this.#t))&&this.#g();let o=this.#_();a&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||o!==this.#p)&&this.#v(o)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return P(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#g(){this.#b();let e=r(this.options.staleTime,this.#t);if(b||this.#r.isStale||!S(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=a.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(b||i(this.options.enabled,this.#t)===!1||!S(this.#p)||this.#p===0)&&(this.#f=a.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(a.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(a.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,a=this.#r,o=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},d=!1,f;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&A(e,t),o=i&&M(e,n,t,r);(a||o)&&(u={...u,...T(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:p,errorUpdatedAt:h,status:g}=u;f=u.data;let _=!1;if(t.placeholderData!==void 0&&f===void 0&&g===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,_=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(g=`success`,f=x(a?.data,e,t),d=!0)}if(t.select&&f!==void 0&&!_)if(a&&f===o?.data&&t.select===this.#c)f=this.#l;else try{this.#c=t.select,f=t.select(f),f=x(a?.data,f,t),this.#l=f,this.#s=null}catch(e){this.#s=e}this.#s&&(p=this.#s,f=this.#l,h=Date.now(),g=`error`);let v=u.fetchStatus===`fetching`,y=g===`pending`,b=g===`error`,S=y&&v,C=f!==void 0,w={status:g,fetchStatus:u.fetchStatus,isPending:y,isSuccess:g===`success`,isError:b,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:u.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!y,isLoadingError:b&&!C,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:b&&C,isStale:N(e,t),refetch:this.refetch,promise:this.#o,isEnabled:i(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=w.data!==void 0,r=w.status===`error`&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{i(this.#o=w.promise=m())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||w.data!==o.value)&&a();break;case`rejected`:(!r||w.error!==o.reason)&&a();break}}return w}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!s(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){u.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function k(e,t){return i(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function A(e,t){return k(e,t)||e.state.data!==void 0&&j(e,t,t.refetchOnMount)}function j(e,t,n){if(i(t.enabled,e)!==!1&&r(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&N(e,t)}return!1}function M(e,t,n,r){return(e!==t||i(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&N(e,n)}function N(e,t){return i(t.enabled,e)!==!1&&e.isStaleByTime(r(t.staleTime,e))}function P(e,t){return!s(e.getCurrentResult(),t)}C();var F=e(t(),1),I=F.createContext(!1),L=()=>F.useContext(I);I.Provider;function R(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z=F.createContext(R()),B=()=>F.useContext(z),V=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?p(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},H=e=>{F.useEffect(()=>{e.clearReset()},[e])},U=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||p(n,[e.error,r])),W=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},G=(e,t)=>e.isLoading&&e.isFetching&&!t,K=(e,t)=>e?.suspense&&t.isPending,q=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function J(e,t,n){let r=L(),i=B(),a=g(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,W(o),V(o,i,s),H(i);let l=!a.getQueryCache().get(o.queryHash),[d]=F.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(F.useSyncExternalStore(F.useCallback(e=>{let t=p?d.subscribe(u.batchCalls(e)):c;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),F.useEffect(()=>{d.setOptions(o)},[o,d]),K(o,f))throw q(o,d,i);if(U({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!b&&G(f,r)&&(l?q(o,d,i):s?.promise)?.catch(c).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function Y(e,t){return J(e,O,t)}export{K as a,H as c,O as d,w as f,q as i,B as l,J as n,V as o,W as r,U as s,Y as t,L as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-BlMXrA59.js";var t=e(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./assistant-identity-store-
|
|
1
|
+
import{t as e}from"./assistant-identity-store-iWGqR8uz.js";import{n as t,r as n,t as r}from"./semver-ilCx6Qwk.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./capture-error-BG-GkiMq.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-BwKkHEki.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`||n===`acp-run-detail`||n===`channel-setup`?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`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`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})},openAcpRunDetail:e=>{t({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:d(n(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{t({mainView:n().viewBeforeAcpRunDetail,activeAcpRunId:null})},openChannelSetup:e=>{t({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:d(n(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{t({mainView:n().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&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-
|
|
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-CL8VmqrY.js";import{t as l}from"./toggle-X_kQW5my.js";import{t as u}from"./info-ciQS_i3y.js";import{a as d}from"./routes-Cj4wRAOK.js";import{Bn as f,Fn as p,In as m,Jn as h,Ln as g,Mn as _,Nn as v,Pn as y,Rn as b,Vn as x,Yn as S,wa as C,zn as w}from"./index-0XgM92Lz.js";import{t as T}from"./detail-card-acc7KIet.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:y},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)(C,{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)(()=>S()),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]),p=(0,E.useCallback)(e=>{l(e),e===I?t(h):r(h,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:p,"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=_(),[t,i]=(0,E.useState)(()=>{let t=n(p,``);return t?w(t,{preserveFunction:e}):e?A.activator:{kind:`off`}}),[a,o]=(0,E.useState)(!1),[s,c]=(0,E.useState)([]),d=(0,E.useRef)(null),h=(0,E.useRef)(!1),S=(0,E.useMemo)(()=>e?[A,...k]:k,[e]),C=t.kind!==`off`,O=C&&!e,j=(0,E.useCallback)(e=>{i(e),r(p,f(e)),o(!1),c([])},[]),M=(0,E.useCallback)(()=>{o(!0),c([]),h.current=!1,requestAnimationFrame(()=>{d.current?.focus()})},[]),P=(0,E.useCallback)(()=>{o(!1),c([]),h.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`)?y.modifiers:x(t));return}if(t.includes(`function`)){j(y);return}h.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(h.current){h.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=C&&!S.some(e=>g(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:C,onChange:n=>{n?t.kind===`off`&&j(e?A.activator:v):j({kind:`off`})},label:`Enable Push to Talk`}),C&&(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:[S.map(e=>{let n=g(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?b(s):`Press any key…`,selected:!0,recording:!0,onClick:P}):(0,D.jsx)(z,{label:R?m(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};
|
|
@@ -0,0 +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-CKINz50a.js";import{t as i}from"./misc-Bm2e0rTa.js";import{G as a,J as o,K as s,Qr as c,ai as l,ca as u,ci as d,da as f,la as p,na as m,oa as h,q as g,sa as _,ua as v}from"./index-0XgM92Lz.js";var y=e(t(),1),b={"sun.max.fill":{icon:l,className:`text-orange-500`},"cloud.sun.fill":{icon:_,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:p,className:`text-blue-400`},"cloud.fill":{icon:h,className:`text-stone-400`},"cloud.rain.fill":{icon:u,className:`text-blue-400`},snowflake:{icon:d,className:`text-blue-300`},"cloud.bolt.fill":{icon:v,className:`text-orange-500`},"cloud.fog.fill":{icon:f,className:`text-stone-400`}},x={sunny:{icon:l,className:`text-orange-500`},clear:{icon:l,className:`text-orange-500`},"partly cloudy":{icon:_,className:`text-amber-400`},"mostly sunny":{icon:_,className:`text-amber-400`},cloudy:{icon:h,className:`text-stone-400`},overcast:{icon:h,className:`text-stone-400`},rainy:{icon:u,className:`text-blue-400`},rain:{icon:u,className:`text-blue-400`},drizzle:{icon:u,className:`text-blue-400`},snow:{icon:d,className:`text-blue-300`},snowy:{icon:d,className:`text-blue-300`},thunderstorm:{icon:v,className:`text-orange-500`},thunder:{icon:v,className:`text-orange-500`},foggy:{icon:f,className:`text-stone-400`},fog:{icon:f,className:`text-stone-400`},mist:{icon:f,className:`text-stone-400`},hazy:{icon:f,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:l,className:`text-orange-500`},"mostly cloudy":{icon:h,className:`text-stone-400`},breezy:{icon:c,className:`text-stone-400`},windy:{icon:c,className:`text-stone-400`},cool:{icon:h,className:`text-stone-400`},warm:{icon:l,className:`text-orange-500`},hot:{icon:l,className:`text-orange-500`},cold:{icon:d,className:`text-blue-300`},"cold snap":{icon:d,className:`text-blue-300`},"warm, mostly sunny":{icon:_,className:`text-amber-400`},"cooler, breezy":{icon:c,className:`text-stone-400`}},S={icon:h,className:`text-stone-400`};function C(e){let t=b[e];if(t)return t;let n=e.toLowerCase(),r=x[n];if(r)return r;for(let[e,t]of Object.entries(x))if(n.includes(e))return t;return S}function w(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function T(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=g(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=g(e.current),r=s(n?.temp)??s(e.currentTemp)??s(e.temperature)??s(e.temp),i=s(n?.feelsLike)??s(n?.feels_like)??s(n?.apparentTemperature)??s(e.feelsLike)??s(e.feels_like)??s(e.apparentTemperature),c=o(n?.condition)??o(e.condition),l=s(n?.humidity)??s(e.humidity),u=w(n?.wind??e.wind),d=s(n?.windSpeed)??s(n?.wind_speed)??s(e.windSpeed)??s(e.wind_speed)??u.speed,f=o(n?.windDirection)??o(n?.wind_direction)??o(e.windDirection)??o(e.wind_direction)??u.direction,p=g(e.units),m=o(p?.temperature)??o(n?.unit)??o(e.unit)??`F`,h=o(p?.speed)??o(e.windUnit)??o(e.wind_unit),_=a(e.hourly).map((e,t)=>({id:o(e.id)??String(t),time:o(e.time)??``,icon:o(e.icon)??o(e.condition)??`cloud.fill`,temp:s(e.tempC)??s(e.temp)??s(e.temperature),tempC:s(e.tempC)})),v=a([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:o(e.id)??String(t),day:o(e.day)??o(e.date),dayLabel:o(e.dayLabel)??o(e.date),icon:o(e.icon)??o(e.condition)??`cloud.fill`,low:s(e.low),high:s(e.high),lowC:s(e.lowC),highC:s(e.highC),precip:s(e.precip)??s(e.precipitation)??s(e.precipitationProbability),condition:o(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:c,humidity:l,windSpeed:d,windDirection:f,windUnit:h,unit:m,hourly:_.length>0?_:void 0,forecast:v.length>0?v:void 0}}function E(e){return e*9/5+32}function D(e){return(e-32)*5/9}function O(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=D(e)),!t&&n&&(r=E(e)),`${Math.round(r)}`}function k(e,t,n){return e.tempC===void 0?e.temp===void 0?null:O(e.temp,t,n):O(e.tempC,!1,n)}function A(e,t,n){return e.lowC===void 0?O(e.low,t,n):O(e.lowC,!1,n)}function j(e,t,n){return e.highC===void 0?O(e.high,t,n):O(e.highC,!1,n)}var M=n();function N({icon:e,size:t=20}){let{icon:n,className:r}=C(e);return(0,M.jsx)(n,{width:t,height:t,className:r})}function P({useFahrenheit:e,onToggle:t}){return(0,M.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:`°F`}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:`°C`})]})}function F({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=O(e.currentTemp,t,n),o=O(e.feelsLike,t,n),s=n?`F`:`C`,l=e.forecast?.[0],u=l?j(l,t,n):null,d=l?A(l,t,n):null,f=null;return e.windSpeed!==void 0&&(f=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(f=`${e.windDirection} ${f}`)),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,M.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,s]}),e.condition&&(0,M.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,M.jsx)(P,{useFahrenheit:n,onToggle:r})]}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[o!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,o,`°`]}),u!==null&&d!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,u,`° L:`,d,`°`]}),f&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(c,{width:12,height:12}),f]}),e.humidity!==void 0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(m,{width:12,height:12}),e.humidity,`%`]})]})]})}function I({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=k(e,t,n);return(0,M.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,M.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,M.jsx)(N,{icon:e.icon,size:18}),a!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function L({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:a,globalMax:o}=(0,y.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=A(e,n,r),f=j(e,n,r),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,r))-m)/(h-m)*100}return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:i(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,M.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,M.jsx)(N,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,M.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,M.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,M.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,M.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function R({templateData:e,fallback:t}){let n=(0,y.useMemo)(()=>T(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,y.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(F,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,M.jsx)(I,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,M.jsx)(L,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{R as WeatherForecastDisplay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./dist-
|
|
1
|
+
import{n as e,r as t}from"./dist-FMUOufe0.js";import{n}from"./definitions-DiTBkL0Z.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-FMUOufe0.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-FMUOufe0.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-FMUOufe0.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./dist-
|
|
1
|
+
import{n as e}from"./dist-FMUOufe0.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-FMUOufe0.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-FMUOufe0.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{t as e}from"./button-
|
|
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-CvrNMtPF.js";import{a as i}from"./routes-Cj4wRAOK.js";import{t as a}from"./use-onboarding-login-CyEAqbC7.js";import{Qt as o}from"./index-0XgM92Lz.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"./typography-BscuIPxA.js";import"./src-mai-NajT.js";import{t as a}from"./arrow-left-CP-EhDNF.js";import{n as o,r as s,t as c}from"./metric-card-DqAVWY-G.js";import{t as l}from"./ban-BpBuRCKI.js";import{t as u}from"./chevron-right-B6vEpVY0.js";import{t as d}from"./circle-check-DzlJxj_M.js";import{t as f}from"./triangle-alert-C3aHZq1F.js";import{t as p}from"./x-DxL-bCuT.js";import{n as m,r as h,t as g}from"./workflow-status-PqQ1OqJN.js";import{t as _}from"./proxy-i05YF9w2.js";import{t as v}from"./AnimatePresence-k-NoyzmC.js";import{t as y}from"./use-reduced-motion-DmsjJfoE.js";import{t as b}from"./three-dot-indicator-DAKo-L_x.js";import{Da as x,Zr as S,dt as C,ei as w,ft as T,lt as E,si as D}from"./index-0XgM92Lz.js";import{t as O}from"./status-badge-pill-Bwe3k-op.js";var k=e(t(),1),A=r();function j({onClick:e,ariaLabel:t}){return(0,A.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:[(0,A.jsx)(D,{className:`h-3 w-3`,fill:`currentColor`}),(0,A.jsx)(i,{variant:`label-small-default`,children:`Stop`})]})}function M({title:e,body:t,emptyText:n}){return(0,A.jsxs)(`div`,{className:`mb-5`,children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:e}),t?(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:t}):(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]})}function N({leaf:e}){let t=e.status===`running`?`Running…`:`No result summary`;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>o(Math.round(e)),label:`Output`})]}),(0,A.jsx)(M,{title:`Prompt`,body:e.promptSummary,emptyText:`No prompt summary`}),(0,A.jsx)(M,{title:`Result`,body:e.resultSummary,emptyText:t})]})}function P({status:e}){return(0,A.jsx)(O,{color:m(e),label:h(e)})}function F(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:return`var(--system-negative-strong)`;case`cancelled`:return`var(--content-secondary)`;default:return`var(--primary-base)`}}function I(e){switch(e){case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Running`}}function L({status:e}){return(0,A.jsx)(O,{color:F(e),label:I(e)})}function R({status:e}){let t=y(),n=`h-3.5 w-3.5 shrink-0`,r;return r=e===`running`?(0,A.jsx)(b,{className:`shrink-0`,dotSize:4,gap:2}):e===`completed`?(0,A.jsx)(d,{className:n,style:{color:`var(--system-positive-strong)`}}):e===`failed`?(0,A.jsx)(f,{className:n,style:{color:`var(--system-negative-strong)`}}):(0,A.jsx)(l,{className:n,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`}),(0,A.jsx)(v,{mode:`wait`,initial:!1,children:(0,A.jsx)(_.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t?{duration:0}:{duration:.15,ease:[.16,1,.3,1]},className:`flex shrink-0 items-center`,children:r},e)})}function z({runId:e,leaf:t,components:n,onSelect:r}){let a=t.label??`Subagent ${t.seq}`,o=t.promptSummary,s=E(`${e}:${t.seq}`);return(0,A.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Open ${a} details`,className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] px-2 py-1.5 text-left transition-colors hover:bg-[var(--surface-overlay)]`,children:(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(R,{status:t.status}),n?(0,A.jsx)(T,{components:n,bodyShapeId:s.bodyShape,eyeStyleId:s.eyeStyle,colorId:s.color,size:16}):(0,A.jsx)(`div`,{style:{width:16,height:16,flexShrink:0},"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-medium-default`,title:a,className:`max-w-[60%] shrink-0 truncate text-[var(--content-default)]`,children:a}),o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)] opacity-10`,children:`|`}),(0,A.jsx)(i,{variant:`body-medium-lighter`,title:o,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:o})]})]})})}function B({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let d=g(e.status),f=y(),m=e.label??e.runId,h=e.agentsSpawned||e.leaves.size,v=C(),b=[...e.leaves.values()].sort((e,t)=>e.seq-t.seq),[D,O]=(0,k.useState)(null),[M,F]=(0,k.useState)(e.runId);M!==e.runId&&(F(e.runId),O(null));let I=D==null?void 0:e.leaves.get(D),R=I?E(`${e.runId}:${I.seq}`):void 0,B=(0,k.useCallback)(()=>O(null),[]),V=I?I.label??`Subagent ${I.seq}`:``,H=I?V:m,U=d?`live`:`final`;return(0,k.useEffect)(()=>{l?.(e.runId)},[e.runId,U,l]),(0,A.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[I&&(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:B,title:m,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,children:m})}),(0,A.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,title:V,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:V})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[I&&(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(a,{}),onClick:B,"aria-label":`Back to subagents`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),I?v&&R?(0,A.jsx)(T,{components:v,bodyShapeId:R.bodyShape,eyeStyleId:R.eyeStyle,colorId:R.color,size:32}):(0,A.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}):(0,A.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] bg-[var(--surface-overlay)]`,children:(0,A.jsx)(S,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,A.jsx)(i,{variant:`title-medium`,title:H,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:H}),I?(0,A.jsx)(L,{status:I.status}):(0,A.jsx)(P,{status:e.status}),(0,A.jsx)(`span`,{className:`flex-1`}),d&&r&&(0,A.jsx)(j,{onClick:()=>r(e.runId),ariaLabel:`Stop workflow`}),(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,A.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:(0,A.jsx)(_.div,{initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:I?(0,A.jsx)(N,{leaf:I}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,A.jsx)(c,{icon:(0,A.jsx)(w,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:h,format:e=>o(Math.round(e)),label:`Agents`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Subagents`}),b.length===0?(0,A.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No subagents yet`}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1`,children:b.map(t=>(0,A.jsx)(z,{runId:e.runId,leaf:t,components:v,onSelect:()=>O(t.seq)},t.seq))})]})]})},I?String(I.seq):`list`)})]})}export{B as WorkflowDetailPanel};
|
|
@@ -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{n as l,t as u}from"./panel-item-nGTDevWP.js";import{t as d}from"./menu-C_97pis4.js";import{a as f}from"./src-mai-NajT.js";import{t as p}from"./confirm-dialog-CfOXCE1N.js";import{t as m}from"./input-C8kfrq9r.js";import{t as h}from"./modal-D0Q3UWD0.js";import{t as g}from"./createLucideIcon-BlMXrA59.js";import{t as _}from"./chevron-right-B6vEpVY0.js";import{t as v}from"./file-text-ClqzuFsu.js";import{t as y}from"./loader-circle-BFRVtR3K.js";import{t as b}from"./pencil-B90pDI55.js";import{t as x}from"./x-DxL-bCuT.js";import{cr as S,dr as C,fr as w,lr as T,mr as E,pr as D,ur as O}from"./sdk.gen-BwKkHEki.js";import{n as k}from"./use-is-mobile-BGESxQUL.js";import{n as A}from"./native-file-Bm3eyig_.js";import{$i as j,$r as M,B as N,Gi as P,Si as F,Xi as I,Yi as L,Zi as R,ea as ee,hi as te,ra as z,ri as B,xa as V,z as H}from"./index-0XgM92Lz.js";import{t as U}from"./use-active-assistant-id-D4UJEQM5.js";import{n as W,t as G}from"./mobile-sidebar-drawer-BBHy-x2N.js";import{i as K,n as ne,r as q,t as J}from"./file-editor-BWfAnSsG.js";import{t as Y}from"./format-file-size-CCd1QKOV.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`}]]),X=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`}]]),Z=e(t(),1);async function oe(e){let{data:t,error:n}=await T({path:{assistant_id:e.assistantId},query:{path:e.path,...e.showHidden?{showHidden:`true`}:{}},parseAs:`blob`,throwOnError:!1});if(n||!(t instanceof Blob))throw Error(`Failed to download file`);await A(t,e.filename)}function se(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function ce(e,t){return se(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function le(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function ue(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Q=s();function de(e){return c({queryFn:async()=>{let{data:t,error:n}=await O({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function fe({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=v;return n.startsWith(`image/`)?r=P:n.startsWith(`video/`)?r=M:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=I),(0,Q.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Q.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function pe({viewMode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Q.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function $({name:e,mimeType:t,size:n,rightContent:r}){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(fe,{mimeType:t}),(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:Y(n)})]}),r]})}function me({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await T({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function he({assistantId:e,path:t,name:r,mimeType:i,size:a,modifiedAt:o,showHidden:s}){let[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(!1),f=(0,Z.useCallback)(async()=>{d(!1),l(!0);try{await oe({assistantId:e,path:t,filename:r,showHidden:s})}catch{d(!0)}finally{l(!1)}},[e,t,r,s]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:r,mimeType:i,size:a}),(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Q.jsx)(I,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Q.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:r}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:i}),(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:Y(a,`Unknown size`)}),o&&(0,Q.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(o).toLocaleString()]})]}),(0,Q.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:c?(0,Q.jsx)(y,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(z,{"aria-hidden":!0}),onClick:f,disabled:c,"aria-label":`Download ${r}`,className:`mt-4`,children:c?`Downloading…`:`Download`}),u&&(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default`,style:{color:`var(--system-error)`},children:`Download failed. Try again.`})]})})]})}function ge({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...de({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),v(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Z.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),v(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),v(null)},w=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await E({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),v(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),T=S!==x,D=(0,Z.useCallback)(()=>{t&&T&&!w.isPending&&w.mutate({path:t,content:S})},[t,T,w,S]);if(!t)return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Q.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Q.jsx)(ae,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,k=p.name??t.split(`/`).pop()??t,A=N(k,O),j=ce(k,O),M=p.content!=null&&!A&&!j,P=t?ue(t):!0,F=b&&(0,Q.jsx)(ne,{isDirty:T,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,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,rightContent:(0,Q.jsx)(pe,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(H,{content:e})}):b?(0,Q.jsx)(q,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}if(j&&p.content!=null){let e=b?S:p.content,n=le(e);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,rightContent:(0,Q.jsx)(pe,{viewMode:s,onChange:e=>{b&&C(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:s===`preview`?n:e,downloadContent:e,fileName:k,mimeType:O,showEdit:!P&&s===`source`,isEditing:b,onToggleEdit:()=>b?C():g(t)}),s===`preview`?(0,Q.jsx)(K,{content:n,readOnly:!0,whiteSpace:`pre`}):b?(0,Q.jsx)(q,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}return M?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,size:p.size}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:b?S:p.content??``,fileName:k,mimeType:O,showEdit:!P,isEditing:b,onToggleEdit:()=>b?C():g(t)}),b?(0,Q.jsx)(q,{value:S,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content??``,readOnly:P,onStartEdit:()=>g(t)})]}),F]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:k,mimeType:O,size:p.size}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Q.jsx)(me,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Q.jsx)(he,{assistantId:e,path:t,name:k,mimeType:O,size:p.size,modifiedAt:p.modifiedAt,showHidden:r})}function _e(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function ve(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await D({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function ye(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await D({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function be({entry:e}){return e.type===`directory`?(0,Q.jsx)(L,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Q.jsx)(P,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Q.jsx)(M,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(v,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function xe({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:u,onRequestRename:d,onRequestCreate:p,depth:m}){let h=e.path??``,g=e.name??``,v=e.type===`directory`,y=n.has(h),x=r===h,S=g.startsWith(`.`),C=!ue(h),w=v&&(y||s.length>0),{data:T}=a({...ve({path:{assistant_id:t},query:{path:h,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),E=(0,Z.useMemo)(()=>_e(T?.entries??[],o),[T?.entries,o]),D=s===``||g.toLowerCase().includes(s);if(s!==``&&!v&&!D)return null;let O=(0,Q.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,Q.jsx)(V,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(_,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Q.jsx)(be,{entry:e}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g}),e.size!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:Y(e.size)})]});return(0,Q.jsxs)(`div`,{children:[C?(0,Q.jsxs)(f.Root,{children:[(0,Q.jsx)(f.Trigger,{children:O}),(0,Q.jsxs)(f.Content,{children:[v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(R,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`file`,parentPath:h}),children:`New File`}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>p({kind:`folder`,parentPath:h}),children:`New Folder`}),(0,Q.jsx)(f.Separator,{})]}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(B,{className:`h-3.5 w-3.5`}),onSelect:()=>u({path:h,name:g,isDirectory:v}),children:`Delete`}),(0,Q.jsx)(f.Item,{leftIcon:(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:h,name:g,isDirectory:v}),children:`Rename`})]})]}):O,v&&w&&E.length>0&&(0,Q.jsx)(`div`,{children:E.map(e=>(0,Q.jsx)(xe,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:u,onRequestRename:d,onRequestCreate:p,depth:m+1},e.path))})]})}function Se({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Z.useRef)(null),[d,f]=(0,Z.useState)(a??``),p=d.trim(),g=p.length>0&&(/[/\\]/.test(p)||p===`.`||p===`..`),_=p.length>0&&!g&&!c;return(0,Q.jsx)(h.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Q.jsx)(h.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),_&&s(p)},children:[(0,Q.jsx)(h.Header,{children:(0,Q.jsx)(h.Title,{children:e})}),(0,Q.jsx)(h.Body,{children:(0,Q.jsx)(m,{ref:u,label:`Name`,value:d,onChange:e=>f(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,Q.jsxs)(h.Footer,{children:[(0,Q.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Q.jsx)(n,{type:`submit`,variant:`primary`,disabled:!_,children:c?i:r})]})]})})})}function Ce({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:d,onToggleShowHidden:f,onChangeSortMode:h,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,b]=(0,Z.useState)(``),T=y.trim().toLowerCase(),[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(null),[M,N]=(0,Z.useState)(null),P=(0,Z.useCallback)(()=>{A(null),N(null)},[]),{data:F,isLoading:I}=a(ve({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),L=(0,Z.useMemo)(()=>_e(F?.entries??[],c),[F?.entries,c]),R=(0,Z.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),z=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await ye(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await E({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await C({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`?d(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 ye(e,r,t.newName,i);let{error:o,response:s}=await w({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,Z.useCallback)(e=>{N(null),A({type:`create`,...e})},[]),H=(0,Z.useCallback)(e=>{N(null),A({type:`rename`,path:e.path,name:e.name})},[]),[U,W]=(0,Z.useState)(null),G=o({mutationFn:async t=>{let{error:n,response:r}=await S({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{W(null),R(),g(e.path)}}),K=(0,Z.useCallback)(e=>{G.reset(),W(e)},[G]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Q.jsx)(ie,{"aria-hidden":!0}):(0,Q.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,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Q.jsx)(j,{"aria-hidden":!0}):(0,Q.jsx)(ee,{"aria-hidden":!0}),onClick:f,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(we,{open:D,onOpenChange:O,onSelectKind:e=>{O(!1),V({kind:e,parentPath:``})}})]})]}),(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(m,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Search files`,leftIcon:(0,Q.jsx)(te,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(x,{"aria-hidden":!0}),onClick:()=>b(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:I?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):L.length?L.map(n=>(0,Q.jsx)(xe,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:T,onToggleExpand:l,onSelectPath:d,onRequestDelete:K,onRequestRename:H,onRequestCreate:V,depth:0},n.path)):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),k?.type===`create`&&(0,Q.jsx)(Se,{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,Q.jsx)(Se,{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,Q.jsx)(p,{open:U!==null,title:U?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Q.jsx)(`span`,{style:{color:`var(--content-default)`},children:U?.name}),U?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,G.error&&(0,Q.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:G.error.message})]}),confirmLabel:G.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:G.isPending,onConfirm:()=>{U&&G.mutate(U)},onCancel:()=>W(null)})]})}function we({open:e,onOpenChange:t,onSelectKind:r}){return k()?(0,Q.jsxs)(l.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(l.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(F,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(l.Content,{children:[(0,Q.jsx)(l.Header,{className:`sr-only`,children:(0,Q.jsx)(l.Title,{children:`Create new`})}),(0,Q.jsxs)(l.Body,{className:`pt-0`,children:[(0,Q.jsx)(u,{icon:R,label:`New File`,onSelect:()=>r(`file`)}),(0,Q.jsx)(u,{icon:X,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Q.jsxs)(d.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(d.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(F,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(d.Content,{align:`end`,sideOffset:4,children:[(0,Q.jsx)(d.Item,{leftIcon:(0,Q.jsx)(R,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Q.jsx)(d.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function Te(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Ee({assistantId:e}){let[t,n]=r(),[i,a]=(0,Z.useState)(()=>{let e=t.get(`file`);return e?Te(e):new Set}),[o,s]=(0,Z.useState)(()=>t.get(`file`)),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Z.useState)(`preview`);(0,Z.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Z.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Z.useState)(!1),v=(0,Z.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Z.useState)(null),x=(0,Z.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,Z.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,Z.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Q.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Q.jsx)(W,{onClick:()=>_(!0)})}),(0,Q.jsx)(G,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Q.jsx)(Ce,{...w})}),(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Q.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(Ce,{...w})}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(ge,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function De(){return(0,Q.jsx)(Ee,{assistantId:U()})}export{De as WorkspacePage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-BlMXrA59.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|