decocms 3.31.0 → 3.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-A2M1Yk61.js → AlertCircle-B4gYnOPQ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CjvxrowT.js → ArrowUpRight-D0kjnBU3.js} +1 -1
- package/dist/client/assets/{Check-Cl07asRj.js → Check-Cy2gwr8C.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ck9u9W7w.js → CheckCircle-CNdjtGTh.js} +1 -1
- package/dist/client/assets/{ChevronDown-Ce3UdjOo.js → ChevronDown-3x5m66Bs.js} +1 -1
- package/dist/client/assets/{ChevronLeft-SeayBU0G.js → ChevronLeft-2_IuBsKu.js} +1 -1
- package/dist/client/assets/{ChevronRight-C8KzXj8H.js → ChevronRight-CeIr4WsE.js} +1 -1
- package/dist/client/assets/{ChevronUp-zA2iz0JQ.js → ChevronUp-Bh0YaH7H.js} +1 -1
- package/dist/client/assets/{Container-B3y5dlGc.js → Container-CYA7KoET.js} +1 -1
- package/dist/client/assets/{DotsVertical-_g_anHKb.js → DotsVertical-FCIPj2jh.js} +1 -1
- package/dist/client/assets/{Eye-lcuSJE4l.js → Eye-BEaX-nOW.js} +1 -1
- package/dist/client/assets/{FilterLines-EpjZnXUA.js → FilterLines-PIiHcomo.js} +1 -1
- package/dist/client/assets/{Globe01-CfZP4vCY.js → Globe01-DCcLGAPs.js} +1 -1
- package/dist/client/assets/{HardDrive-75MAycL-.js → HardDrive-DF3wR4Ey.js} +1 -1
- package/dist/client/assets/{Key01-DyeMqFvi.js → Key01-DOICf9Yf.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DwKLO_V_.js → LayoutLeft-XvA4efJR.js} +1 -1
- package/dist/client/assets/{LinkExternal01-r7kaLetr.js → LinkExternal01-kEaZ-3VP.js} +1 -1
- package/dist/client/assets/{Monitor01-C_pzVd4h.js → Monitor01-BQ2ab3I8.js} +1 -1
- package/dist/client/assets/{Palette-DdA_ILd6.js → Palette-BvgmCjcf.js} +1 -1
- package/dist/client/assets/{Play-CnkDDouZ.js → Play-CgnBFM99.js} +1 -1
- package/dist/client/assets/{Plus-Dx1SIiMT.js → Plus-CZoFo8m3.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-C3I3Y9Tu.js → RefreshCcw01-CoOu-1-t.js} +1 -1
- package/dist/client/assets/{SearchMd-DFhUmylG.js → SearchMd-Cd3g9OHi.js} +1 -1
- package/dist/client/assets/{Settings02-CWkfxXGQ.js → Settings02-h4KhooA8.js} +1 -1
- package/dist/client/assets/{Shield01-CbvWDrmE.js → Shield01-CxluyAom.js} +1 -1
- package/dist/client/assets/{Star01-DkpG4lGE.js → Star01-BQu9_hS7.js} +1 -1
- package/dist/client/assets/{Stars01-CJ8FecuG.js → Stars01-D3E_UsFP.js} +1 -1
- package/dist/client/assets/{Stars02-bH2-rrrk.js → Stars02-DQPSVMUP.js} +1 -1
- package/dist/client/assets/{Sun-CLmK6D64.js → Sun-CGlOqn-C.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CDVzg25U.js → SwitchHorizontal01-DruCuOB9.js} +1 -1
- package/dist/client/assets/{Tool01-Cm1sVqXs.js → Tool01-DXZCxrW7.js} +1 -1
- package/dist/client/assets/{Trash01-CA4jg9ww.js → Trash01-CdVc63JX.js} +1 -1
- package/dist/client/assets/{Upload01-BbVOBYlS.js → Upload01-hFtvGOKc.js} +1 -1
- package/dist/client/assets/{User01-CMz2xYx2.js → User01-DkghkjfJ.js} +1 -1
- package/dist/client/assets/{Users01-DBOuOgB6.js → Users01-DSIM6pEW.js} +1 -1
- package/dist/client/assets/{Users03-DIxLvYmx.js → Users03-cwi85RQL.js} +1 -1
- package/dist/client/assets/{X-8-D5pATw.js → X-CiRjfhfc.js} +1 -1
- package/dist/client/assets/{XCircle-D0Uf6feY.js → XCircle-m30sBtwe.js} +1 -1
- package/dist/client/assets/{XClose-Cnj8fI9u.js → XClose-DEtxBka1.js} +1 -1
- package/dist/client/assets/{Zap-mYMK3ZBL.js → Zap-BqoFLQhx.js} +1 -1
- package/dist/client/assets/{ZapSquare-qMfSZ8L9.js → ZapSquare-88gaWy0c.js} +1 -1
- package/dist/client/assets/{ZoomOut-aYAC7hBe.js → ZoomOut-OQ9XVMLx.js} +1 -1
- package/dist/client/assets/{access-gate-daLhvTar.js → access-gate-DADwk2R8.js} +1 -1
- package/dist/client/assets/{accordion-Cm248afD.js → accordion-67DY3M-J.js} +1 -1
- package/dist/client/assets/add-section-modal-CAjwD6Pd.js +1 -0
- package/dist/client/assets/agent-capabilities-f1C_QUMa.js +3 -0
- package/dist/client/assets/{agent-icon-cetEWq0Z.js → agent-icon-DRs2sxx6.js} +1 -1
- package/dist/client/assets/{agent-icons-CK-xDflz.js → agent-icons-4ZuoYvOM.js} +2 -2
- package/dist/client/assets/{agents-list-Da1iRt5l.js → agents-list-BawKTAIq.js} +1 -1
- package/dist/client/assets/{ai-providers-BJhgs18P.js → ai-providers-Cw6JIdBf.js} +1 -1
- package/dist/client/assets/{alert-BBTJrkK5.js → alert-DvSgp-Ux.js} +1 -1
- package/dist/client/assets/{alert-dialog-DokKbPq-.js → alert-dialog-CvpxH7Lf.js} +2 -2
- package/dist/client/assets/app-editor-DFjSiVlG.js +1 -0
- package/dist/client/assets/{auth-catchall-CVFro2W9.js → auth-catchall-DYNGMvE3.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bsctr1_-.js → auth-split-layout-NbrrlaWV.js} +1 -1
- package/dist/client/assets/{automation-list-row-D23Bvwkx.js → automation-list-row-DUFXJruv.js} +1 -1
- package/dist/client/assets/{automation-runs-BMMJyRtq.js → automation-runs-CAmeSsSa.js} +1 -1
- package/dist/client/assets/{automations-DoosX3yK.js → automations-CgeuUTLU.js} +1 -1
- package/dist/client/assets/{avatar-Bg8Fajzf.js → avatar-CWn5LER_.js} +1 -1
- package/dist/client/assets/{badge-CWyTrVve.js → badge-CIMelj9a.js} +1 -1
- package/dist/client/assets/{brand-context-D5dCbA6y.js → brand-context-H1clX-er.js} +1 -1
- package/dist/client/assets/{buckets-C3jVEHjb.js → buckets-CC7y0QTv.js} +1 -1
- package/dist/client/assets/{calendar-D2buY6we.js → calendar-YPBFp_E0.js} +1 -1
- package/dist/client/assets/{capability-load-error-Co02--jW.js → capability-load-error-mbutkBah.js} +1 -1
- package/dist/client/assets/{card-BVDRUeiB.js → card-CPe96wry.js} +1 -1
- package/dist/client/assets/{chat-context-CpxV-LEc.js → chat-context-BjxJIMHx.js} +1 -1
- package/dist/client/assets/{checkbox-C0OD5DTK.js → checkbox-CMfBi1P9.js} +1 -1
- package/dist/client/assets/{cli-auth-success-pLKti1nS.js → cli-auth-success-DYhb7-ie.js} +1 -1
- package/dist/client/assets/{collection-detail-Bx5cx6Tv.js → collection-detail-BxKQrABJ.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dpa_fFcT.js → collection-display-button-CT3gbaW0.js} +1 -1
- package/dist/client/assets/{collection-search-DHln9QoJ.js → collection-search-CR7VmYXP.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CTiIT2dF.js → collection-table-wrapper-8RUKrDnB.js} +1 -1
- package/dist/client/assets/{collection-tabs-BaiyS1az.js → collection-tabs-DyRPz2M0.js} +1 -1
- package/dist/client/assets/{collections-Deko--Yp.js → collections-D3ATOWCI.js} +1 -1
- package/dist/client/assets/{command-3qLn4P52.js → command-DwAn8s0z.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BoRQM4OA.js → connect-desktop-dialog-CUd_SkHU.js} +1 -1
- package/dist/client/assets/{connection-card-ZCt-smg_.js → connection-card-0Tyv2fap.js} +1 -1
- package/dist/client/assets/{connection-detail-DipDTh4H.js → connection-detail-Ci7FJpsv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B6JNJh-A.js → connection-form-helpers-Csat880R.js} +1 -1
- package/dist/client/assets/connections-CCuMprHu.js +1 -0
- package/dist/client/assets/decopilot-sse-pool-Qs-1EY0r.js +1 -0
- package/dist/client/assets/{dialog-BnOLdErK.js → dialog-BgALXZ6h.js} +1 -1
- package/dist/client/assets/{domain-settings-CwC_r-qt.js → domain-settings-AaPYLR4t.js} +1 -1
- package/dist/client/assets/{drawer-Be_zu0QX.js → drawer-DLAFbROZ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-mHDT-XH7.js → dropdown-menu-uYsl4z-0.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BGkekAkH.js → dynamic-plugin-layout-OZf-s4Vh.js} +1 -1
- package/dist/client/assets/{empty-state-CpfaS4oL.js → empty-state-CzSsahKD.js} +1 -1
- package/dist/client/assets/{empty-state-CeDRg4Pp.js → empty-state-DaQUj4WW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-bN8kltS6.js → extract-connection-data-8yLRil2N.js} +1 -1
- package/dist/client/assets/{features-4Hsf4UEQ.js → features-BUlOTs5u.js} +1 -1
- package/dist/client/assets/file-explorer-1z_jfh76.js +2 -0
- package/dist/client/assets/{file-type-icon-DHQvk0za.js → file-type-icon-BI-57QdR.js} +1 -1
- package/dist/client/assets/{files-Bp_B54JG.js → files-CXNJllw8.js} +1 -1
- package/dist/client/assets/{form-C_FOfVah.js → form-BSWyFOE3.js} +1 -1
- package/dist/client/assets/{general-Dwpcwhzc.js → general-D0FEa5ER.js} +1 -1
- package/dist/client/assets/{generate-id-CQZwmjfI.js → generate-id-Cx2Cl6ns.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Cd_kXw_v.js → github-repo-picker-DFc58L4T.js} +1 -1
- package/dist/client/assets/{header-tab-button-yQ_OLTia.js → header-tab-button-EU-XSa1F.js} +1 -1
- package/dist/client/assets/{hover-card-CHj7OURi.js → hover-card-B2Xe1JoR.js} +1 -1
- package/dist/client/assets/{image-field-D7PJzfsZ.js → image-field-D5MmzFT-.js} +1 -1
- package/dist/client/assets/index-8eGpjmNk.js +8 -0
- package/dist/client/assets/{index-bcXz_XDV.js → index-9-_G5hYz.js} +1 -1
- package/dist/client/assets/{index-DhrBeRkU.js → index-BHORPjEK.js} +1 -1
- package/dist/client/assets/{index-CXrzfY3D.js → index-BK9zbgCs.js} +1 -1
- package/dist/client/assets/{index-DHxOddsj.js → index-BPnG82q8.js} +3 -3
- package/dist/client/assets/index-B_KbH-mb.js +1 -0
- package/dist/client/assets/{index-CVroQ5fV.js → index-BpKJI7Dd.js} +1 -1
- package/dist/client/assets/{index-Cvm5sLsh.js → index-C0KuwIPp.js} +1 -1
- package/dist/client/assets/{index-D0AW3RJr.js → index-CUVr6lcg.js} +1 -1
- package/dist/client/assets/{index-DdL0ZJ74.js → index-CUWw06mX.js} +1 -1
- package/dist/client/assets/{index-Dw2PpfWw.js → index-CU_dpGl4.js} +1 -1
- package/dist/client/assets/{index-CR5thpY0.js → index-CYt0V3AS.js} +1 -1
- package/dist/client/assets/{index-C93oJ98C.js → index-DMmuIje2.js} +1 -1
- package/dist/client/assets/index-DaOT4XJB.js +1 -0
- package/dist/client/assets/{index-fYs9lCK5.js → index-Nndg_EdX.js} +19 -19
- package/dist/client/assets/{index-redirect-CNjnlL2S.js → index-redirect--1iDHaDV.js} +1 -1
- package/dist/client/assets/{input-C3YblD3D.js → input-Dp561wvu.js} +1 -1
- package/dist/client/assets/{integration-icon-DNnbE81S.js → integration-icon-CcFsasgm.js} +1 -1
- package/dist/client/assets/{label-g7a72jJD.js → label-BSaEPU5n.js} +1 -1
- package/dist/client/assets/{layout-Bac2NmXP.js → layout-DhLz9U2X.js} +1 -1
- package/dist/client/assets/{login-Dy8BMo_0.js → login-KELNaPBJ.js} +1 -1
- package/dist/client/assets/{members-DnAomETO.js → members-W8grzhWu.js} +1 -1
- package/dist/client/assets/monaco-editor-BR_tbU8a.js +9 -0
- package/dist/client/assets/{monitoring-stats-row-BXLdNMMZ.js → monitoring-stats-row-5K-iNny9.js} +1 -1
- package/dist/client/assets/{oauth-callback-1VcaC9dS.js → oauth-callback-8KL4StZE.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-MiK5yD8w.js → oauth-callback-ai-provider-N8VomC_I.js} +1 -1
- package/dist/client/assets/{onboarding-BGq8QKH-.js → onboarding-DtdxPB0K.js} +1 -1
- package/dist/client/assets/{org-install-DZd3jGKm.js → org-install-D5FbkY3j.js} +1 -1
- package/dist/client/assets/{org-layout-BsR_SirN.js → org-layout-KSFpSPTk.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DiqJAM1g.js → org-plugin-layout-DJo1Z-Pr.js} +1 -1
- package/dist/client/assets/{page-seo-form-D30yiy8Q.js → page-seo-form-DJY-iA3B.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BmGMfOzX.js +1 -0
- package/dist/client/assets/{pair-CV7DGW5V.js → pair-B6H2XHda.js} +6 -6
- package/dist/client/assets/{plugin-empty-state-rraryswS.js → plugin-empty-state-APGWpnYe.js} +1 -1
- package/dist/client/assets/{plugin-header-B1uUxTrr.js → plugin-header-CfyEfwUD.js} +1 -1
- package/dist/client/assets/{plugin-layout-DmiyMdB_.js → plugin-layout-Bu5dLcrn.js} +1 -1
- package/dist/client/assets/{popover-8cVh6gq0.js → popover-BYJBybY_.js} +1 -1
- package/dist/client/assets/{post-editor-C7P1dXNH.js → post-editor-CYVdmKp6.js} +2 -2
- package/dist/client/assets/{primitives-BsgolKyl.js → primitives-H10wZI-E.js} +1 -1
- package/dist/client/assets/{profile-D4w-Z3ol.js → profile-CRrSZ5vD.js} +1 -1
- package/dist/client/assets/project-app-view-Dy7VlptC.js +1 -0
- package/dist/client/assets/record-editor-BnPSQQYA.js +1 -0
- package/dist/client/assets/registry-CX-ET0zi.js +2 -0
- package/dist/client/assets/registry-layout-B7ptEXAi.js +27 -0
- package/dist/client/assets/{require-capability-skg99hPH.js → require-capability-C4c85-CT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cidb--Hk.js → required-auth-layout-BApuEUpI.js} +1 -1
- package/dist/client/assets/{reset-password-CNhRvj5g.js → reset-password-CAbJ7zW-.js} +1 -1
- package/dist/client/assets/{resizable-BT48Uzms.js → resizable-D7pt8dup.js} +1 -1
- package/dist/client/assets/roles-xJLawXZj.js +1 -0
- package/dist/client/assets/save-referenced-block-ShdGpmDs.js +1 -0
- package/dist/client/assets/{save-status-DsIS1sld.js → save-status-oczKxF1W.js} +1 -1
- package/dist/client/assets/{schema-form-oJE4kcAX.js → schema-form-974itnxa.js} +1 -1
- package/dist/client/assets/{scroll-area-D2NfEZKG.js → scroll-area-DuFY4R5d.js} +1 -1
- package/dist/client/assets/{search-input-wg0ktmKr.js → search-input-DACBbzIk.js} +1 -1
- package/dist/client/assets/{secrets-YPZEWZE9.js → secrets-DMWeEvqW.js} +1 -1
- package/dist/client/assets/{sections-editor-CDk8QiTt.js → sections-editor-DM97T9Hx.js} +2 -2
- package/dist/client/assets/{select-LvZkQCcv.js → select-gqSNOxQD.js} +1 -1
- package/dist/client/assets/{select-model-Bvdn_l3a.js → select-model-CbdvfMbD.js} +1 -1
- package/dist/client/assets/seo-editor-BNi1XNxf.js +1 -0
- package/dist/client/assets/{settings-layout-Cn8PAm-f.js → settings-layout-XPdklskX.js} +1 -1
- package/dist/client/assets/{settings-section-BiebCtcC.js → settings-section-BgPOTco2.js} +1 -1
- package/dist/client/assets/{sheet-4GES45T2.js → sheet-J-5zCitH.js} +1 -1
- package/dist/client/assets/{shell-controls-pFVNS2Vn.js → shell-controls-BB8JT3cu.js} +1 -1
- package/dist/client/assets/{shell-layout-DtkuyxW9.js → shell-layout-B1bpQmja.js} +1 -1
- package/dist/client/assets/shell-route-loading-BL818aqT.js +1 -0
- package/dist/client/assets/{sidebar-BY-0S2nV.js → sidebar-DpznaqAr.js} +1 -1
- package/dist/client/assets/{skeleton-B2rX4p4v.js → skeleton-BrZY2U4q.js} +1 -1
- package/dist/client/assets/{sortable.esm-C0tZpwHI.js → sortable.esm-DAdL_KCM.js} +1 -1
- package/dist/client/assets/{spinner-WtoCvpNX.js → spinner-DWj9d3Oy.js} +1 -1
- package/dist/client/assets/{sso-4MYeJHQK.js → sso-_Gw_BXbF.js} +1 -1
- package/dist/client/assets/{store-BTeo8TpT.js → store-C4geYRDc.js} +1 -1
- package/dist/client/assets/store-registry-WC9BumXE.js +2 -0
- package/dist/client/assets/{studio-tools-CH7dZ7HT.js → studio-tools-YbndxaJx.js} +1 -1
- package/dist/client/assets/{switch-BOtiDaPh.js → switch-CWe9x1dO.js} +1 -1
- package/dist/client/assets/{tab-id-DaQY5Du1.js → tab-id-Bc_4nZgl.js} +1 -1
- package/dist/client/assets/{table-kq85oeWE.js → table-MDhW4B8D.js} +1 -1
- package/dist/client/assets/{tabs-D_XRbq3N.js → tabs-9ZkZ5CXu.js} +1 -1
- package/dist/client/assets/{task-status-BlpPmTT-.js → task-status-BNkxxOv6.js} +1 -1
- package/dist/client/assets/{textarea-CxRmk2pV.js → textarea-CimG5sWW.js} +1 -1
- package/dist/client/assets/{toggle-group-B_ZhC8rH.js → toggle-group-BqOsII08.js} +1 -1
- package/dist/client/assets/{toolbar-BptUton3.js → toolbar-oWPvqwRC.js} +1 -1
- package/dist/client/assets/{tools-list-BXxC0BJ6.js → tools-list-C2in0sGo.js} +1 -1
- package/dist/client/assets/{tooltip-6OktDyzD.js → tooltip-BwiZr2GD.js} +1 -1
- package/dist/client/assets/{types-k3mlT_jb.js → types-BYtVTpDQ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Czs3LwMV.js → use-ai-providers-B4z2G4rP.js} +1 -1
- package/dist/client/assets/{use-automations-6FHnA6mT.js → use-automations-Cgz4YKs5.js} +1 -1
- package/dist/client/assets/{use-capability-B2GMKCxl.js → use-capability-CtdbYGMh.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DRfafiJJ.js → use-clock-tick-CPPdyWgW.js} +1 -1
- package/dist/client/assets/{use-collections-3gcbdMo5.js → use-collections-D52tQdGt.js} +1 -1
- package/dist/client/assets/{use-connection-Cygt3JAU.js → use-connection-DyyYYs8L.js} +1 -1
- package/dist/client/assets/{use-copy-BzO5OLbn.js → use-copy-BEZFUgho.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BJIgmNjf.js → use-create-virtual-mcp-w-CGYLKc.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-rTdfYQSA.js → use-debounced-autosave-7GLgaJXq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BwHDAibo.js → use-delete-connection-6bfkbwg3.js} +1 -1
- package/dist/client/assets/{use-file-configs-C_uUU82K.js → use-file-configs-fZ_0pNgv.js} +1 -1
- package/dist/client/assets/use-infinite-scroll-D2-BvjXC.js +1 -0
- package/dist/client/assets/{use-list-state-CAT0PD89.js → use-list-state-BiQdeo-3.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bbkq-Btq.js → use-mcp-client-iXdxenz3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C2IR7B-B.js → use-mcp-prompts-BZ3M88pO.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BiO0x3bS.js → use-mcp-tools-BFte_Z9f.js} +1 -1
- package/dist/client/assets/{use-members-Ct7TKvLy.js → use-members-lO5UPidt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-7jnPTeCV.js → use-navigate-to-agent-DIjWe8In.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DwSMx4xq.js → use-org-auth-client-CjM9gfPH.js} +1 -1
- package/dist/client/assets/{use-org-sso-HULZXLZY.js → use-org-sso-Sk1A6q8-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C24SP1RJ.js → use-organization-roles-C5mxX9Rk.js} +1 -1
- package/dist/client/assets/{use-organization-settings-6ykeD7wG.js → use-organization-settings-MrnwSgAR.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Cw0Uu9HN.js → use-registry-connections-CC-YLphz.js} +1 -1
- package/dist/client/assets/{use-secrets-Dn7Z2olr.js → use-secrets-CajEM27b.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BMl-h7wF.js → use-status-sounds-BwNN0Dt-.js} +1 -1
- package/dist/client/assets/{use-view-mode-DS8kaEq4.js → use-view-mode-B5-wFbmS.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C6pMpGrR.js → use-virtual-mcp-Cw_yVFMO.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DHhL-q8j.js +1 -0
- package/dist/client/assets/{useRouterState-Dnb9kW5z.js → useRouterState-IhZ1SxRm.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-oHftqcSU.js +1 -0
- package/dist/client/assets/{user-TO91q8is.js → user-CJUwgqvV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-X2TTOWIg.js → view-mode-toggle-CMrO4dTZ.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CuN8_Ws2.js → watch-sse-pool-BZQA3Ki3.js} +1 -1
- package/dist/client/assets/{workflow-Bof_Hi_L.js → workflow-CrJS-2vt.js} +1 -1
- package/dist/client/assets/workflow-detail-CBOkNhJP.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +387 -387
- package/dist/server/migrate.js +52 -52
- package/dist/server/server.js +265 -265
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BEtlbcy-.js +0 -1
- package/dist/client/assets/agent-capabilities-CFuGvMed.js +0 -3
- package/dist/client/assets/app-editor-DqK_iwlT.js +0 -1
- package/dist/client/assets/connections-DzNM9iR8.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-8baykh62.js +0 -1
- package/dist/client/assets/file-explorer-Bm3G3AJO.js +0 -2
- package/dist/client/assets/index-Bq-oI4jf.js +0 -8
- package/dist/client/assets/index-DeWy5Ckp.js +0 -1
- package/dist/client/assets/index-jA2TneF4.js +0 -1
- package/dist/client/assets/infiniteQueryObserver-Da-l1Mrb.js +0 -1
- package/dist/client/assets/monaco-editor-CVjkFUXK.js +0 -9
- package/dist/client/assets/page-seo-sheet-DHjVYqZY.js +0 -1
- package/dist/client/assets/project-app-view-MmHyDgpb.js +0 -1
- package/dist/client/assets/record-editor-LCb43Ehs.js +0 -1
- package/dist/client/assets/registry-DRQ1oW7y.js +0 -2
- package/dist/client/assets/registry-layout-C-3QWp3D.js +0 -27
- package/dist/client/assets/roles-9lGr_fMG.js +0 -1
- package/dist/client/assets/save-referenced-block-Uk3HPmEZ.js +0 -1
- package/dist/client/assets/seo-editor-CZ4NCpV7.js +0 -1
- package/dist/client/assets/shell-route-loading-B6fsTD_h.js +0 -1
- package/dist/client/assets/store-registry-B8aDVYEg.js +0 -2
- package/dist/client/assets/use-infinite-scroll-D7Lz32GP.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DnxNK7B2.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bdpr4GcQ.js +0 -1
- package/dist/client/assets/workflow-detail-xblJkXWm.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,H as at,I as ct,B as M,t as ne,G as rt,c as de,o as W,M as lt,J as dt,K as mt}from"./index-DHxOddsj.js";import{g as ut}from"./generate-id-CQZwmjfI.js";import{C as pt}from"./collection-display-button-Dpa_fFcT.js";import{S as ht}from"./search-input-wg0ktmKr.js";import{C as xt}from"./collection-tabs-BaiyS1az.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-ZCt-smg_.js";import{E as jt}from"./empty-state-CpfaS4oL.js";import{I as yt}from"./integration-icon-DNnbE81S.js";import{P as pe}from"./index-CVroQ5fV.js";import{u as Ct,D as vt}from"./use-delete-connection-BwHDAibo.js";import{u as Ce}from"./use-capability-B2GMKCxl.js";import{u as _t}from"./use-infinite-scroll-D7Lz32GP.js";import{u as bt}from"./use-list-state-CAT0PD89.js";import{g as Te,a as St,e as Nt}from"./extract-connection-data-bN8kltS6.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-DokKbPq-.js";import{C as Fe}from"./checkbox-C0OD5DTK.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-BnOLdErK.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-Be_zu0QX.js";import{u as Lt}from"./tooltip-6OktDyzD.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-mHDT-XH7.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as Se}from"./form-C_FOfVah.js";import{I as ie}from"./input-C3YblD3D.js";import{d as Ot,S as $t,a as zt,b as Et,c as re}from"./select-LvZkQCcv.js";import{T as Mt}from"./textarea-CxRmk2pV.js";import{b as Ge,u as Ft}from"./use-connection-Cygt3JAU.js";import{a as Vt}from"./use-virtual-mcp-C6pMpGrR.js";import{u as Bt}from"./studio-tools-CH7dZ7HT.js";import{S as Ut,a5 as Ht,u as Rt,r as Kt}from"./agent-icon-cetEWq0Z.js";import{n as ge}from"./Container-B3y5dlGc.js";import{i as Qe}from"./DotsVertical-_g_anHKb.js";import{s as Je}from"./Eye-lcuSJE4l.js";import{s as ye}from"./Star01-DkpG4lGE.js";import{s as Ye}from"./Plus-Dx1SIiMT.js";import{s as Ze}from"./Trash01-CA4jg9ww.js";import{s as et}from"./XClose-Cnj8fI9u.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-B6JNJh-A.js";import"./collections-Deko--Yp.js";import"./SwitchHorizontal01-CDVzg25U.js";import"./Check-Cl07asRj.js";import"./view-mode-toggle-X2TTOWIg.js";import"./badge-CWyTrVve.js";import"./SearchMd-DFhUmylG.js";import"./use-registry-connections-Cw0Uu9HN.js";import"./use-mcp-client-Bbkq-Btq.js";import"./use-organization-settings-6ykeD7wG.js";import"./useInfiniteQuery-DnxNK7B2.js";import"./infiniteQueryObserver-Da-l1Mrb.js";import"./card-BVDRUeiB.js";import"./sidebar-BY-0S2nV.js";import"./LayoutLeft-DwKLO_V_.js";import"./sheet-4GES45T2.js";import"./X-8-D5pATw.js";import"./use-view-mode-DS8kaEq4.js";import"./ChevronRight-C8KzXj8H.js";import"./label-g7a72jJD.js";import"./ChevronDown-Ce3UdjOo.js";import"./ChevronUp-zA2iz0JQ.js";import"./use-collections-3gcbdMo5.js";import"./AlertCircle-A2M1Yk61.js";import"./Tool01-Cm1sVqXs.js";import"./RefreshCcw01-C3I3Y9Tu.js";import"./XCircle-D0Uf6feY.js";import"./ArrowUpRight-CjvxrowT.js";import"./ZapSquare-qMfSZ8L9.js";import"./Users03-DIxLvYmx.js";import"./CheckCircle-Ck9u9W7w.js";import"./ChevronLeft-SeayBU0G.js";import"./ZoomOut-aYAC7hBe.js";import"./Globe01-CfZP4vCY.js";import"./FilterLines-EpjZnXUA.js";import"./Palette-DdA_ILd6.js";import"./HardDrive-75MAycL-.js";import"./Stars02-bH2-rrrk.js";import"./Key01-DyeMqFvi.js";import"./LinkExternal01-r7kaLetr.js";import"./Monitor01-C_pzVd4h.js";import"./Sun-CLmK6D64.js";import"./Play-CnkDDouZ.js";import"./Settings02-CWkfxXGQ.js";import"./Shield01-CbvWDrmE.js";import"./Stars01-CJ8FecuG.js";import"./Upload01-BbVOBYlS.js";import"./User01-CMz2xYx2.js";import"./Users01-DBOuOgB6.js";import"./Zap-mYMK3ZBL.js";function Jt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Yt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Yt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||St(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Ft(v),N=Ct(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Vt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await lt({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Jt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:l}=Ce("connections:manage"),h=bt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(zt,{})})}),t.jsxs(Et,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(kt,{open:z,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Pt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:S,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as o}from"./watch-sse-pool-CuN8_Ws2.js";const c=o;export{c as d};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-DHxOddsj.js";import{F as mt,l as pt}from"./index-DhrBeRkU.js";import{_ as ht,ar as xt,as as gt,at as ae,au as yt,H as $e}from"./agent-icon-cetEWq0Z.js";import{a as wt}from"./Tool01-Cm1sVqXs.js";import{s as jt}from"./XClose-Cnj8fI9u.js";import{S as bt}from"./scroll-area-D2NfEZKG.js";import{b as Re,T as Oe,a as ze}from"./tooltip-6OktDyzD.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-DokKbPq-.js";import{a as Et}from"./chat-context-CpxV-LEc.js";import{u as Pt}from"./shell-layout-DtkuyxW9.js";import{a7 as le,a8 as Ae,a9 as Tt}from"./index-fYs9lCK5.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-BnOLdErK.js";import{I as We}from"./input-C3YblD3D.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-B6fsTD_h.js";import{t as Vt}from"./ChevronDown-Ce3UdjOo.js";import{i as Bt}from"./ChevronRight-C8KzXj8H.js";import{i as Gt}from"./ZoomOut-aYAC7hBe.js";import{E as qt,q as Me,r as he,s as Qt,t as Ut,v as Ht,w as M,x as ce,g as xe,y as ge,z as Jt,A as Xt,B as ye,C as de,D as we,G as Yt,I as Zt}from"./header-tab-button-yQ_OLTia.js";import"./AlertCircle-A2M1Yk61.js";import"./SwitchHorizontal01-CDVzg25U.js";import"./RefreshCcw01-C3I3Y9Tu.js";import"./XCircle-D0Uf6feY.js";import"./ArrowUpRight-CjvxrowT.js";import"./ZapSquare-qMfSZ8L9.js";import"./Users03-DIxLvYmx.js";import"./CheckCircle-Ck9u9W7w.js";import"./Check-Cl07asRj.js";import"./ChevronLeft-SeayBU0G.js";import"./ChevronUp-zA2iz0JQ.js";import"./DotsVertical-_g_anHKb.js";import"./Container-B3y5dlGc.js";import"./Eye-lcuSJE4l.js";import"./Globe01-CfZP4vCY.js";import"./FilterLines-EpjZnXUA.js";import"./Star01-DkpG4lGE.js";import"./Palette-DdA_ILd6.js";import"./HardDrive-75MAycL-.js";import"./Stars02-bH2-rrrk.js";import"./Key01-DyeMqFvi.js";import"./LayoutLeft-DwKLO_V_.js";import"./LinkExternal01-r7kaLetr.js";import"./Monitor01-C_pzVd4h.js";import"./Sun-CLmK6D64.js";import"./Play-CnkDDouZ.js";import"./Plus-Dx1SIiMT.js";import"./SearchMd-DFhUmylG.js";import"./Settings02-CWkfxXGQ.js";import"./Shield01-CbvWDrmE.js";import"./Stars01-CJ8FecuG.js";import"./Trash01-CA4jg9ww.js";import"./Upload01-BbVOBYlS.js";import"./User01-CMz2xYx2.js";import"./Users01-DBOuOgB6.js";import"./X-8-D5pATw.js";import"./Zap-mYMK3ZBL.js";import"./select-LvZkQCcv.js";import"./tab-id-DaQY5Du1.js";import"./use-mcp-client-Bbkq-Btq.js";import"./watch-sse-pool-CuN8_Ws2.js";import"./decopilot-sse-pool-8baykh62.js";import"./studio-tools-CH7dZ7HT.js";import"./use-virtual-mcp-C6pMpGrR.js";import"./use-collections-3gcbdMo5.js";import"./use-ai-providers-Czs3LwMV.js";import"./use-organization-settings-6ykeD7wG.js";import"./avatar-Bg8Fajzf.js";import"./required-auth-layout-Cidb--Hk.js";import"./useRouterState-Dnb9kW5z.js";import"./use-org-sso-HULZXLZY.js";import"./agent-capabilities-CFuGvMed.js";import"./pair-CV7DGW5V.js";import"./use-clock-tick-DRfafiJJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BzO5OLbn.js";import"./file-type-icon-DHQvk0za.js";import"./content-blocks-o63cs2vh.js";import"./types-k3mlT_jb.js";import"./integration-icon-DNnbE81S.js";import"./use-navigate-to-agent-7jnPTeCV.js";import"./use-connection-Cygt3JAU.js";import"./use-mcp-prompts-C2IR7B-B.js";import"./form-C_FOfVah.js";import"./label-g7a72jJD.js";import"./spinner-WtoCvpNX.js";import"./drawer-Be_zu0QX.js";import"./collection-search-DHln9QoJ.js";import"./tabs-D_XRbq3N.js";import"./toggle-group-B_ZhC8rH.js";import"./connect-desktop-dialog-BoRQM4OA.js";import"./agent-icons-CK-xDflz.js";import"./checkbox-C0OD5DTK.js";import"./skeleton-B2rX4p4v.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BiebCtcC.js";import"./card-BVDRUeiB.js";import"./popover-8cVh6gq0.js";import"./command-3qLn4P52.js";import"./index-bcXz_XDV.js";import"./useInfiniteQuery-DnxNK7B2.js";import"./infiniteQueryObserver-Da-l1Mrb.js";import"./sortable.esm-C0tZpwHI.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-ZCt-smg_.js";import"./use-registry-connections-Cw0Uu9HN.js";import"./extract-connection-data-bN8kltS6.js";import"./generate-id-CQZwmjfI.js";import"./collections-Deko--Yp.js";import"./collection-tabs-BaiyS1az.js";import"./badge-CWyTrVve.js";import"./textarea-CxRmk2pV.js";import"./connection-form-helpers-B6JNJh-A.js";import"./use-infinite-scroll-D7Lz32GP.js";import"./useSuspenseInfiniteQuery-Bdpr4GcQ.js";import"./index-CXrzfY3D.js";import"./dropdown-menu-mHDT-XH7.js";import"./question-004-sINsf4GQ.js";import"./sidebar-BY-0S2nV.js";import"./sheet-4GES45T2.js";import"./use-status-sounds-BMl-h7wF.js";import"./empty-state-CpfaS4oL.js";import"./toolbar-BptUton3.js";import"./resizable-BT48Uzms.js";import"./use-mcp-tools-BiO0x3bS.js";import"./use-capability-B2GMKCxl.js";import"./user-TO91q8is.js";import"./tools-list-BXxC0BJ6.js";import"./switch-BOtiDaPh.js";import"./use-debounced-autosave-rTdfYQSA.js";import"./index-CVroQ5fV.js";import"./search-input-wg0ktmKr.js";import"./use-secrets-Dn7Z2olr.js";import"./github-repo-picker-Cd_kXw_v.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-Cm248afD.js";import"./view-mode-toggle-X2TTOWIg.js";import"./select-model-Bvdn_l3a.js";import"./use-automations-6FHnA6mT.js";import"./monaco-editor-CVjkFUXK.js";import"./automation-runs-BMMJyRtq.js";import"./table-kq85oeWE.js";import"./use-members-Ct7TKvLy.js";import"./use-org-auth-client-DwSMx4xq.js";import"./task-status-BlpPmTT-.js";import"./automation-list-row-D23Bvwkx.js";import"./use-create-virtual-mcp-BJIgmNjf.js";import"./index-D0AW3RJr.js";import"./hover-card-CHj7OURi.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,Y=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Xe(J)},children:"Delete"})]})]})})]})}export{Qi as FileExplorer};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as ss,d as rs,t as xt,E as ls}from"./index-DHxOddsj.js";import{S as os}from"./search-input-wg0ktmKr.js";import{P as Me}from"./index-CVroQ5fV.js";import{E as wt}from"./empty-state-CpfaS4oL.js";import{R as as}from"./require-capability-skg99hPH.js";import{B as rt}from"./badge-CWyTrVve.js";import{P as ct,a as dt,b as mt}from"./popover-8cVh6gq0.js";import{b as Ze,T as et,a as tt}from"./tooltip-6OktDyzD.js";import{i as ft}from"./Check-Cl07asRj.js";import{a as Xe}from"./Eye-lcuSJE4l.js";import{n as kt}from"./Globe01-CfZP4vCY.js";import{i as Pt}from"./FilterLines-EpjZnXUA.js";import{i as ns}from"./Key01-DyeMqFvi.js";import{i as is}from"./Play-CnkDDouZ.js";import{a9 as cs,aa as ds,R as ms,G as us}from"./agent-icon-cetEWq0Z.js";import{M as Tt}from"./monaco-editor-CVjkFUXK.js";import{u as xs}from"./use-members-Ct7TKvLy.js";import{u as Mt}from"./use-connection-Cygt3JAU.js";import{a as fs,u as ps,W as hs}from"./use-mcp-client-Bbkq-Btq.js";import{a as gs}from"./use-virtual-mcp-C6pMpGrR.js";import{n as Qe}from"./Container-B3y5dlGc.js";import{c as js}from"./SwitchHorizontal01-CDVzg25U.js";import{s as vs}from"./Plus-Dx1SIiMT.js";import{s as Ns}from"./Trash01-CA4jg9ww.js";import{I as Ge}from"./input-C3YblD3D.js";import{g as bs,b as _t,f as st,a as At,c as pt,d as ys,e as Dt,h as Vt,A as ws,T as Ss,i as Is,M as ht}from"./automation-runs-BMMJyRtq.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-LvZkQCcv.js";import{S as Cs}from"./scroll-area-D2NfEZKG.js";import{t as Ut}from"./ChevronDown-Ce3UdjOo.js";import{C as ks}from"./calendar-D2buY6we.js";import{T as Ts}from"./textarea-CxRmk2pV.js";import{C as Kt}from"./collection-tabs-BaiyS1az.js";import{S as Ms}from"./switch-BOtiDaPh.js";import{L as _s}from"./label-g7a72jJD.js";import{I as qe}from"./integration-icon-DNnbE81S.js";import{A as qt}from"./avatar-Bg8Fajzf.js";import{A as Ds,a as Ls,b as Fs}from"./alert-BBTJrkK5.js";import{C as Bt}from"./card-BVDRUeiB.js";import{K as ke}from"./monitoring-stats-row-BXLdNMMZ.js";import{u as Ht}from"./studio-tools-CH7dZ7HT.js";import{g as $s}from"./connection-slug-eyAPH6o3.js";import{u as Rs}from"./useSuspenseInfiniteQuery-Bdpr4GcQ.js";import{d as zs,S as Os,a as Es,b as Ps}from"./sheet-4GES45T2.js";import{T as De,a as ut,b as Jt,c as Gt,d as Qt,e as oe}from"./table-kq85oeWE.js";import{n as As}from"./ChevronUp-zA2iz0JQ.js";import{u as Vs}from"./use-infinite-scroll-D7Lz32GP.js";import{c as Us,b as Ks}from"./use-automations-6FHnA6mT.js";import"./SearchMd-DFhUmylG.js";import"./sidebar-BY-0S2nV.js";import"./LayoutLeft-DwKLO_V_.js";import"./use-capability-B2GMKCxl.js";import"./access-gate-daLhvTar.js";import"./capability-load-error-Co02--jW.js";import"./AlertCircle-A2M1Yk61.js";import"./Tool01-Cm1sVqXs.js";import"./RefreshCcw01-C3I3Y9Tu.js";import"./XCircle-D0Uf6feY.js";import"./ArrowUpRight-CjvxrowT.js";import"./ZapSquare-qMfSZ8L9.js";import"./Users03-DIxLvYmx.js";import"./CheckCircle-Ck9u9W7w.js";import"./ChevronLeft-SeayBU0G.js";import"./ChevronRight-C8KzXj8H.js";import"./DotsVertical-_g_anHKb.js";import"./ZoomOut-aYAC7hBe.js";import"./Star01-DkpG4lGE.js";import"./Palette-DdA_ILd6.js";import"./HardDrive-75MAycL-.js";import"./Stars02-bH2-rrrk.js";import"./LinkExternal01-r7kaLetr.js";import"./Monitor01-C_pzVd4h.js";import"./Sun-CLmK6D64.js";import"./Settings02-CWkfxXGQ.js";import"./Shield01-CbvWDrmE.js";import"./Stars01-CJ8FecuG.js";import"./Upload01-BbVOBYlS.js";import"./User01-CMz2xYx2.js";import"./Users01-DBOuOgB6.js";import"./XClose-Cnj8fI9u.js";import"./X-8-D5pATw.js";import"./Zap-mYMK3ZBL.js";import"./index-DhrBeRkU.js";import"./spinner-WtoCvpNX.js";import"./use-org-auth-client-DwSMx4xq.js";import"./use-collections-3gcbdMo5.js";import"./useInfiniteQuery-DnxNK7B2.js";import"./infiniteQueryObserver-Da-l1Mrb.js";import"./task-status-BlpPmTT-.js";import"./checkbox-C0OD5DTK.js";import"./command-3qLn4P52.js";import"./index-bcXz_XDV.js";import"./dialog-BnOLdErK.js";import"./pair-CV7DGW5V.js";import"./use-clock-tick-DRfafiJJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BzO5OLbn.js";import"./file-type-icon-DHQvk0za.js";import"./content-blocks-o63cs2vh.js";import"./types-k3mlT_jb.js";import"./chat-context-CpxV-LEc.js";import"./tab-id-DaQY5Du1.js";import"./watch-sse-pool-CuN8_Ws2.js";import"./decopilot-sse-pool-8baykh62.js";import"./use-ai-providers-Czs3LwMV.js";import"./use-organization-settings-6ykeD7wG.js";import"./shell-layout-DtkuyxW9.js";import"./required-auth-layout-Cidb--Hk.js";import"./useRouterState-Dnb9kW5z.js";import"./use-org-sso-HULZXLZY.js";import"./use-navigate-to-agent-7jnPTeCV.js";import"./use-mcp-prompts-C2IR7B-B.js";import"./form-C_FOfVah.js";import"./index-CR5thpY0.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
|
-
`)}function Lt(s){return s.trim()?s.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Ft(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
|
|
4
|
-
|
|
5
|
-
... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function $t(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function Hs(s){const e=le.c(116),{log:r}=s,[l,a]=K.useState(!1),[o,d]=K.useState(!1),i=bt(),{org:n}=Be(),c=Ft(r.input),u=Ft(r.output),j=Js;let v;e[0]!==r.input||e[1]!==r.output?(v=async se=>{const re=j(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(re),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(d(!0),setTimeout(()=>d(!1),2e3))}catch{Ce.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=v):v=e[2];const b=v;let x;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(x=se=>{const re=j(se==="input"?r.input:r.output),ie=new Blob([re],{type:"application/json"}),pe=URL.createObjectURL(ie),ye=document.createElement("a");ye.href=pe,ye.download=`${r.toolName}-${se}-${r.id}.json`,ye.click(),URL.revokeObjectURL(pe)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=x):x=e[7];const L=x;let p;e[8]!==r.connectionId||e[9]!==r.input||e[10]!==r.toolName||e[11]!==i||e[12]!==n.slug?(p=()=>{const se=crypto.randomUUID();sessionStorage.setItem(`replay-${se}`,JSON.stringify(r.input)),i({to:"/$org/settings/connections/$connectionId/$collectionName/$itemId",params:{org:n.slug,connectionId:r.connectionId,collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:se}})},e[8]=r.connectionId,e[9]=r.input,e[10]=r.toolName,e[11]=i,e[12]=n.slug,e[13]=p):p=e[13];const g=p,[m,k]=K.useState(!1);let S;e[14]!==r.requestId?(S=async()=>{try{await navigator.clipboard.writeText(r.requestId),k(!0),setTimeout(()=>k(!1),2e3)}catch{Ce.error("Failed to copy to clipboard")}},e[14]=r.requestId,e[15]=S):S=e[15];const h=S;let T;e[16]!==r.timestamp?(T=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[16]=r.timestamp,e[17]=T):T=e[17];const I=T,f="text-sm px-5 md:px-6 py-5 space-y-5";let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[18]=M):M=e[18];let y;e[19]!==I?(y=t.jsxs("div",{children:[M,t.jsx("div",{className:"text-sm text-foreground",children:I})]}),e[19]=I,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[21]=R):R=e[21];let C;e[22]!==r.durationMs?(C=t.jsxs("div",{children:[R,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[22]=r.durationMs,e[23]=C):C=e[23];let E;e[24]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[24]=E):E=e[24];let F;e[25]!==r.userName?(F=t.jsxs("div",{children:[E,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[25]=r.userName,e[26]=F):F=e[26];let H;e[27]!==r.virtualMcpName?(H=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[27]=r.virtualMcpName,e[28]=H):H=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[29]=A):A=e[29];let W;e[30]!==r.requestId?(W=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[30]=r.requestId,e[31]=W):W=e[31];let w;e[32]!==m?(w=m?t.jsx(ft,{size:12}):t.jsx(Xe,{size:12}),e[32]=m,e[33]=w):w=e[33];let _;e[34]!==h||e[35]!==w?(_=t.jsx(Z,{size:"icon",variant:"ghost",onClick:h,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:w}),e[34]=h,e[35]=w,e[36]=_):_=e[36];let $;e[37]!==W||e[38]!==_?($=t.jsxs("div",{children:[A,t.jsxs("div",{className:"flex items-center gap-1",children:[W,_]})]}),e[37]=W,e[38]=_,e[39]=$):$=e[39];let z;e[40]!==r.userAgent?(z=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[40]=r.userAgent,e[41]=z):z=e[41];let O;e[42]!==r.properties||e[43]!==i||e[44]!==n.slug?(O=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[re,ie]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[re,"=",ie]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const pe={key:re,operator:"eq",value:ie};i({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Le([pe])}})},children:[t.jsx(Pt,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${re}=${ie}`),Ce.success("Copied filter to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(re),Ce.success("Copied key to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(ns,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ie),Ce.success("Copied value to clipboard")}catch{Ce.error("Failed to copy to clipboard")}},children:[t.jsx(cs,{size:14,className:"mr-2"}),"Copy value"]})]})})]},re)})})]}),e[42]=r.properties,e[43]=i,e[44]=n.slug,e[45]=O):O=e[45];let V;e[46]!==C||e[47]!==F||e[48]!==H||e[49]!==$||e[50]!==z||e[51]!==O||e[52]!==y?(V=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[y,C,F,H,$,z,O]}),e[46]=C,e[47]=F,e[48]=H,e[49]=$,e[50]=z,e[51]=O,e[52]=y,e[53]=V):V=e[53];let q;e[54]!==r.errorMessage?(q=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[54]=r.errorMessage,e[55]=q):q=e[55];const J="space-y-4";let G;e[56]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[56]=G):G=e[56];const Q=c.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",$t(c.originalSize)," - truncated)"]});let U;e[57]!==Q?(U=t.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=Q,e[58]=U):U=e[58];let P;e[59]!==g||e[60]!==r.input?(P=r.input&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:g,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(is,{size:14})})}),t.jsx(tt,{children:"Replay tool call"})]}),e[59]=g,e[60]=r.input,e[61]=P):P=e[61];let N;e[62]!==L||e[63]!==c?(N=c.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>L("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(kt,{size:14})})}),t.jsx(tt,{children:"Download full input"})]}),e[62]=L,e[63]=c,e[64]=N):N=e[64];let D;e[65]!==b?(D=()=>b("input"),e[65]=b,e[66]=D):D=e[66];let B;e[67]!==l?(B=l?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[67]=l,e[68]=B):B=e[68];let ee;e[69]!==D||e[70]!==B?(ee=t.jsx(Z,{size:"icon",variant:"ghost",onClick:D,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:B}),e[69]=D,e[70]=B,e[71]=ee):ee=e[71];let X;e[72]!==P||e[73]!==N||e[74]!==ee?(X=t.jsxs("div",{className:"flex items-center gap-1",children:[P,N,ee]}),e[72]=P,e[73]=N,e[74]=ee,e[75]=X):X=e[75];let te;e[76]!==U||e[77]!==X?(te=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[U,X]}),e[76]=U,e[77]=X,e[78]=te):te=e[78];let Y;e[79]!==c?(Y=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Tt,{code:c.content,language:"json",height:"100%",readOnly:!0})}),e[79]=c,e[80]=Y):Y=e[80];let ae;e[81]!==te||e[82]!==Y?(ae=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[te,Y]})}),e[81]=te,e[82]=Y,e[83]=ae):ae=e[83];const _e="rounded-lg overflow-hidden border border-border",$e="flex items-center justify-between p-1 pl-4 border-b border-border",Se="flex items-center gap-2";let ne;e[84]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[84]=ne):ne=e[84];const he=u.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",$t(u.originalSize)," - truncated)"]});let ge;e[85]!==ne||e[86]!==he?(ge=t.jsxs("div",{className:Se,children:[ne,he]}),e[85]=ne,e[86]=he,e[87]=ge):ge=e[87];let je;e[88]!==L||e[89]!==u.isTruncated?(je=u.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>L("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(kt,{size:14})})}),t.jsx(tt,{children:"Download full output"})]}),e[88]=L,e[89]=u.isTruncated,e[90]=je):je=e[90];let ve;e[91]!==b?(ve=()=>b("output"),e[91]=b,e[92]=ve):ve=e[92];let Ne;e[93]!==o?(Ne=o?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[93]=o,e[94]=Ne):Ne=e[94];let de;e[95]!==ve||e[96]!==Ne?(de=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:Ne}),e[95]=ve,e[96]=Ne,e[97]=de):de=e[97];let be;e[98]!==je||e[99]!==de?(be=t.jsxs("div",{className:"flex items-center gap-1",children:[je,de]}),e[98]=je,e[99]=de,e[100]=be):be=e[100];let me;e[101]!==ge||e[102]!==be?(me=t.jsxs("div",{className:$e,children:[ge,be]}),e[101]=ge,e[102]=be,e[103]=me):me=e[103];let ue;e[104]!==u.content?(ue=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Tt,{code:u.content,language:"json",height:"100%",readOnly:!0})}),e[104]=u.content,e[105]=ue):ue=e[105];let xe;e[106]!==me||e[107]!==ue?(xe=t.jsx("div",{children:t.jsxs("div",{className:_e,children:[me,ue]})}),e[106]=me,e[107]=ue,e[108]=xe):xe=e[108];let fe;e[109]!==ae||e[110]!==xe?(fe=t.jsxs("div",{className:J,children:[ae,xe]}),e[109]=ae,e[110]=xe,e[111]=fe):fe=e[111];let Re;return e[112]!==V||e[113]!==q||e[114]!==fe?(Re=t.jsxs("div",{className:f,children:[V,q,fe]}),e[112]=V,e[113]=q,e[114]=fe,e[115]=Re):Re=e[115],Re}function Js(s){return JSON.stringify(s,null,2)}const Wt=/^now(?:-(\d+)([mhdwM]))?$/,Gs={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Xt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Wt);if(!r)return null;const l=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:l,unit:a}}function we(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const l=Xt(e);if(!l)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,o=new Date(a);if(l.offset===0||!l.unit)return{valid:!0,date:o};switch(l.unit){case"m":o.setMinutes(o.getMinutes()-l.offset);break;case"h":o.setHours(o.getHours()-l.offset);break;case"d":o.setDate(o.getDate()-l.offset);break;case"w":o.setDate(o.getDate()-l.offset*7);break;case"M":o.setMonth(o.getMonth()-l.offset);break}return{valid:!0,date:o}}function Qs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Yt(s){const e=s.trim();return Wt.test(e)}function Rt(s){const e=s.trim();if(e==="now")return"Now";const r=Xt(e);if(!r||!r.unit){const o=we(e);return o.valid&&o.date?Qs(o.date):e}const l=Gs[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${l}${a} ago`}const Zt=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Ws(s,e){const r=Zt.find(l=>l.from===s&&l.to===e);return r?r.label:`${Rt(s)} to ${Rt(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),o=String(s.getMinutes()).padStart(2,"0"),d=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${l} ${a}:${o}:${d}`}function Xs(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,l,a,o,d,i]=e,n=new Date(Number(r),Number(l)-1,Number(a),Number(o),Number(d),Number(i));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Yt(s))return s;const e=we(s);return e.valid&&e.date?Je(e.date):s}function zt({value:s,onChange:e,placeholder:r="now or now-2d",className:l,disabled:a,error:o}){const[d,i]=K.useState(!1),[n,c]=K.useState(()=>gt(s)),[u,j]=K.useState(),[v,b]=K.useState(!1),x=K.useRef(s);x.current!==s&&(x.current=s,v||c(gt(s)));const L=f=>{const M=f.target.value;c(M),j(void 0)},p=()=>{b(!0)},g=()=>{b(!1);const f=n.trim();if(Yt(f)){j(void 0),e(f);return}const M=Xs(f);if(M){j(void 0),e(M.toISOString()),c(Je(M));return}const y=we(f);if(y.valid&&y.date){j(void 0),e(f),c(Je(y.date));return}c(gt(s)),j(void 0)},m=f=>{if(f){const y=we(s).date||new Date;f.setHours(y.getHours()),f.setMinutes(y.getMinutes()),f.setSeconds(0),f.setMilliseconds(0);const R=f.toISOString();c(Je(f)),e(R),j(void 0)}i(!1)},k=f=>{const[M,y]=f.target.value.split(":").map(Number),C=we(s).date||new Date;C.setHours(M||0),C.setMinutes(y||0),C.setSeconds(0),C.setMilliseconds(0);const E=C.toISOString();c(Je(C)),e(E)},S=we(s),h=S.valid?S.date:new Date,T=h?`${String(h.getHours()).padStart(2,"0")}:${String(h.getMinutes()).padStart(2,"0")}`:"",I=o||u;return t.jsxs("div",{className:ce("flex gap-1",l),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Ge,{value:n,onChange:L,onFocus:p,onBlur:g,placeholder:r,disabled:a,className:ce("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:d,onOpenChange:i,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(ds,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(ks,{mode:"single",selected:h||void 0,onSelect:m,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Ge,{type:"time",value:T,onChange:k,className:"text-sm h-8"})]})]})]})]})}function Ys({value:s,onChange:e,className:r,disabled:l,quickRanges:a=Zt}){const[o,d]=K.useState(!1),[i,n]=K.useState(s.from),[c,u]=K.useState(s.to),[j,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),u(s.to));const x=m=>{b.current={from:m.from,to:m.to},n(m.from),u(m.to),d(!1),e({from:m.from,to:m.to})},L=()=>{const m=we(i),k=we(c);if(!m.valid||!m.date){v("Invalid 'From' date");return}if(!k.valid||!k.date){v("Invalid 'To' date");return}if(m.date>=k.date){v("'From' must be before 'To'");return}v(null),e({from:i,to:c}),d(!1)},p=m=>s.from===m.from&&s.to===m.to,g=Ws(s.from,s.to);return t.jsxs(ct,{open:o,onOpenChange:d,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:ce("gap-1.5 min-w-[160px] justify-between",r),disabled:l,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ms,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:g})]}),t.jsx(Ut,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:m=>m.preventDefault(),style:o?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(zt,{value:i,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(zt,{value:c,onChange:u,placeholder:"now"})]}),j&&t.jsx("p",{className:"text-xs text-destructive",children:j}),t.jsx(Z,{onClick:L,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(Cs,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(m=>{const k=p(m);return t.jsx("button",{type:"button",onClick:()=>x(m),className:ce("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",k&&"bg-accent text-accent-foreground font-medium"),children:m.label},m.value)})})})})]})})]})}const es="decopilot";async function ts(s,e){return await s.call("MONITORING_STATS",e)}function Zs(s,e){const r=le.c(12),{org:l}=Be(),a=Ht();let o,d,i;r[0]!==l.id||r[1]!==s?(i={...s,excludeConnectionIds:[es,...s.excludeConnectionIds??[]]},d=yt,o=it.monitoringStatsToolCalls(l.id,JSON.stringify(i)),r[0]=l.id,r[1]=s,r[2]=o,r[3]=d,r[4]=i):(o=r[2],d=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ts(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let c;return r[8]!==e||r[9]!==o||r[10]!==n?(c={queryKey:o,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=o,r[10]=n,r[11]=c):c=r[11],d(c)}function er(s,e){const r=le.c(12),{org:l}=Be(),a=Ht();let o,d,i;r[0]!==l.id||r[1]!==s?(i={...s,connectionIds:[es],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},d=yt,o=it.monitoringStatsLlm(l.id,JSON.stringify(i)),r[0]=l.id,r[1]=s,r[2]=o,r[3]=d,r[4]=i):(o=r[2],d=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ts(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let c;return r[8]!==e||r[9]!==o||r[10]!==n?(c={queryKey:o,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=o,r[10]=n,r[11]=c):c=r[11],d(c)}function Te(s){const e=le.c(20),{title:r,value:l,action:a,children:o,className:d}=s;let i;e[0]!==d?(i=ce("pt-4 px-4 pb-6 gap-8",d),e[0]=d,e[1]=i):i=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let c;e[4]!==l?(c=t.jsx("span",{className:"text-4xl font-normal",children:l}),e[4]=l,e[5]=c):c=e[5];let u;e[6]!==n||e[7]!==c?(u=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,c]}),e[6]=n,e[7]=c,e[8]=u):u=e[8];let j;e[9]!==a?(j=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=j):j=e[10];let v;e[11]!==u||e[12]!==j?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[u,j]}),e[11]=u,e[12]=j,e[13]=v):v=e[13];let b;e[14]!==o?(b=o&&t.jsx("div",{className:"flex flex-col gap-6",children:o}),e[14]=o,e[15]=b):b=e[15];let x;return e[16]!==i||e[17]!==v||e[18]!==b?(x=t.jsxs(Bt,{className:i,children:[v,b]}),e[16]=i,e[17]=v,e[18]=b,e[19]=x):x=e[19],x}function jt(s){const e=le.c(14),{metrics:r,connections:l,mode:a,total:o}=s,{org:d}=Be(),i=bt();let n,c,u;if(e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==d||e[5]!==o){u=Symbol.for("react.early_return_sentinel");e:{const v=l??[],b=new Map(r.map(sr));let x;e[9]!==a?(x=(p,g)=>{const m=Dt(p.metric,a);return Dt(g.metric,a)-m},e[9]=a,e[10]=x):x=e[10];const L=v.map(p=>({connection:p,metric:b.get(p.id)})).filter(tr).sort(x).slice(0,4);if(L.length===0){u=null;break e}n="flex flex-col",c=L.map((p,g)=>{const{connection:m,metric:k}=p,S=o>0?(k.calls/o*100).toFixed(1):"0.0",h=a==="errors"?`${k.errorRate.toFixed(1)}%`:`${S}%`,T=g===L.length-1;return t.jsxs("div",{className:ce("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!T&&"border-b border-border/50"),onClick:()=>i({to:"/$org/settings/connections/$appSlug",params:{org:d.slug,appSlug:$s(m)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:m.icon,name:m.title,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:m.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:h}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:ys(k,a)})]})]},m.id)})}e[0]=l,e[1]=r,e[2]=a,e[3]=i,e[4]=d,e[5]=o,e[6]=n,e[7]=c,e[8]=u}else n=e[6],c=e[7],u=e[8];if(u!==Symbol.for("react.early_return_sentinel"))return u;let j;return e[11]!==n||e[12]!==c?(j=t.jsx("div",{className:n,children:c}),e[11]=n,e[12]=c,e[13]=j):j=e[13],j}function tr(s){return s.metric}function sr(s){return[s.connectionId,s]}const Ot=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Et(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Ot[e%Ot.length]}function He(s){const e=le.c(21),{models:r,mode:l}=s,a=l===void 0?"calls":l;if(r.length===0)return null;let o;e[0]!==a?(o=x=>a==="tokens"?(x.inputTokens??0)+(x.outputTokens??0):a==="cost"?x.costUsd??0:x.calls,e[0]=a,e[1]=o):o=e[1];const d=o;let i;e[2]!==a?(i=x=>a==="cost"?At(x):a==="tokens"?st(x):x.toLocaleString(),e[2]=a,e[3]=i):i=e[3];const n=i;let c;e[4]!==d?(c=(x,L)=>x+d(L),e[4]=d,e[5]=c):c=e[5];const u=r.reduce(c,0);let j,v;if(e[6]!==n||e[7]!==r||e[8]!==u||e[9]!==d){let x;e[12]!==d?(x=(g,m)=>d(m)-d(g),e[12]=d,e[13]=x):x=e[13];const L=[...r].sort(x).slice(0,4);j="flex flex-col";let p;e[14]!==n||e[15]!==u||e[16]!==d?(p=(g,m,k)=>{const S=d(g),h=u>0?(S/u*100).toFixed(1):"0.0",T=m===k.length-1;return t.jsxs("div",{className:ce("flex items-center h-10 px-3",!T&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Et(g.toolName)} 18%, transparent)`},children:t.jsx(Qe,{size:14,style:{color:Et(g.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:g.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[h,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},g.toolName)},e[14]=n,e[15]=u,e[16]=d,e[17]=p):p=e[17],v=L.map(p),e[6]=n,e[7]=r,e[8]=u,e[9]=d,e[10]=j,e[11]=v}else j=e[10],v=e[11];let b;return e[18]!==j||e[19]!==v?(b=t.jsx("div",{className:j,children:v}),e[18]=j,e[19]=v,e[20]=b):b=e[20],b}function rr(s){const e=le.c(48),{displayDateRange:r,connectionIds:l,excludeConnectionIds:a,toolName:o,status:d,connections:i,isStreaming:n,streamingRefetchInterval:c,llmUserIds:u}=s,j=bs(r),v=n?c:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:x,isError:L}=Zs({interval:j,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:l.length>0?l:void 0,excludeConnectionIds:a,toolNames:o?[o]:void 0,status:d},b);let p;e[2]!==v?(p={refetchInterval:v},e[2]=v,e[3]=p):p=e[3];const{data:g,isError:m}=er({interval:j,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:u?.length?u:void 0},p),k=L||m,S=x?{totalCalls:x.totalCalls,totalErrors:x.totalErrors,avgDurationMs:x.avgDurationMs,p95DurationMs:x.p95DurationMs,data:_t(x.timeseries,r,j)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},h=g?{totalCalls:g.totalCalls,totalErrors:g.totalErrors,avgDurationMs:g.avgDurationMs,p95DurationMs:g.p95DurationMs,data:_t(g.timeseries,r,j)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let T;e[4]!==g?.topTools?(T=g?.topTools??[],e[4]=g?.topTools,e[5]=T):T=e[5];const I=T,f=g?.totalInputTokens??0,M=g?.totalOutputTokens??0,y=g?.totalTokens??0,R=g?.totalCostUsd??0;let C;e[6]!==x?.connectionBreakdown?(C=x?.connectionBreakdown??[],e[6]=x?.connectionBreakdown,e[7]=C):C=e[7];const E=C,[F,H]=K.useState("avg");let A;e[8]!==k?(A=k&&t.jsxs(Ds,{variant:"destructive",children:[t.jsx(ss,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Ls,{children:"Failed to load monitoring data"}),t.jsx(Fs,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=k,e[9]=A):A=e[9];let W;e[10]===Symbol.for("react.memo_cache_sentinel")?(W=_e=>H(_e),e[10]=W):W=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(lt,{className:"w-[120px]",children:t.jsx(ot,{})}),e[11]=w):w=e[11];let _;e[12]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs(at,{children:[t.jsx(Fe,{value:"avg",children:"Avg"}),t.jsx(Fe,{value:"p95",children:"P95"})]}),e[12]=_):_=e[12];let $;e[13]!==F?($=t.jsxs(nt,{value:F,onValueChange:W,children:[w,_]}),e[13]=F,e[14]=$):$=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=z):z=e[15];let O;e[16]!==I?(O=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=O):O=e[17];let V;e[18]!==y?(V=st(y),e[18]=y,e[19]=V):V=e[19];let q;e[20]!==f?(q=st(f),e[20]=f,e[21]=q):q=e[21];let J;e[22]!==M?(J=st(M),e[22]=M,e[23]=J):J=e[23];let G;e[24]!==q||e[25]!==J?(G=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",J," out"]}),e[24]=q,e[25]=J,e[26]=G):G=e[26];let Q;e[27]!==I?(Q=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=Q):Q=e[28];let U;e[29]!==R?(U=R>0?At(R):"—",e[29]=R,e[30]=U):U=e[30];let P;e[31]!==R?(P=R===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=R,e[32]=P):P=e[32];let N;e[33]!==I||e[34]!==R?(N=R>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=R,e[35]=N):N=e[35];let D;e[36]!==I?(D=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=D):D=e[37];const B=Te,ee="AI Errors",X=h.totalErrors.toLocaleString();let te;e[38]!==h.data?(te=t.jsx(ke,{data:h.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=h.data,e[39]=te):te=e[39];let Y;e[40]!==I||e[41]!==h.totalErrors?(Y=h.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=h.totalErrors,e[42]=Y):Y=e[42];let ae;return e[43]!==B||e[44]!==X||e[45]!==te||e[46]!==Y?(ae=t.jsxs(B,{title:ee,value:X,children:[te,Y]}),e[43]=B,e[44]=X,e[45]=te,e[46]=Y,e[47]=ae):ae=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[A,t.jsxs(Te,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(ke,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:E,connections:i,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(Te,{title:"Latency",value:pt(F==="avg"?S.avgDurationMs:S.p95DurationMs),action:$,children:[t.jsx(ke,{data:S.data,dataKey:F,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:E,connections:i,mode:"latency",total:S.totalCalls})]}),t.jsxs(Te,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(ke,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:E,connections:i,mode:"errors",total:S.totalErrors})]})]}),z,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(Te,{title:"AI Calls",value:h.totalCalls.toLocaleString(),children:[t.jsx(ke,{data:h.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),O]}),t.jsxs(Te,{title:"Tokens",value:V,action:G,children:[t.jsx(ke,{data:h.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),Q]}),t.jsxs(Te,{title:"Cost",value:U,action:P,children:[t.jsx(ke,{data:h.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(Te,{title:"AI Latency",value:pt(h.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",pt(h.p95DurationMs)]}),children:[t.jsx(ke,{data:h.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),D]}),ae]})]})}function Ke(s){const e=le.c(8),{className:r}=s;let l;e[0]!==r?(l=ce("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=Array.from({length:4}).map(lr),e[4]=d):d=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-6",children:[o,t.jsxs("div",{className:"flex flex-col",children:[d,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=i):i=e[5];let n;return e[6]!==l?(n=t.jsxs(Bt,{className:l,children:[a,i]}),e[6]=l,e[7]=n):n=e[7],n}function lr(s,e){return t.jsxs("div",{className:ce("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function or(){const s=le.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,l;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),l=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=l):(r=s[1],l=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,l,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function ar(s){const e=le.c(46),{log:r,connection:l,virtualMcpName:a,virtualMcpIcon:o,onClick:d,lastLogRef:i}=s;let n,c;if(e[0]!==r.timestamp){const F=new Date(r.timestamp);n=F.toLocaleDateString("en-US",{month:"short",day:"numeric"}),c=F.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=c}else n=e[1],c=e[2];const u=c,j=l?.icon||null,v=l?.title??r.connectionId;let b;e[3]!==j||e[4]!==v?(b=t.jsx(De,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:j,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=j,e[4]=v,e[5]=b):b=e[5];let x;e[6]!==r.toolName?(x=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=x):x=e[7];const L=l?.title??r.connectionId;let p;e[8]!==L?(p=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:L}),e[8]=L,e[9]=p):p=e[9];let g;e[10]!==x||e[11]!==p?(g=t.jsxs(De,{className:"min-w-0 pr-2 md:pr-4",children:[x,p]}),e[10]=x,e[11]=p,e[12]=g):g=e[12];let m;e[13]!==o||e[14]!==a?(m=t.jsx(De,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:o,name:a,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=o,e[14]=a,e[15]=m):m=e[15];let k;e[16]!==r.userImage||e[17]!==r.userName?(k=t.jsx(qt,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=k):k=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let h;e[21]!==k||e[22]!==S?(h=t.jsx(De,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,S]})}),e[21]=k,e[22]=S,e[23]=h):h=e[23];let T;e[24]!==n?(T=t.jsx("div",{children:n}),e[24]=n,e[25]=T):T=e[25];let I;e[26]!==u?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:u}),e[26]=u,e[27]=I):I=e[27];let f;e[28]!==T||e[29]!==I?(f=t.jsxs(De,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[T,I]}),e[28]=T,e[29]=I,e[30]=f):f=e[30];let M;e[31]!==r.durationMs?(M=t.jsxs(De,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=M):M=e[32];const y=r.isError?"destructive":"success",R=r.isError?"Error":"OK";let C;e[33]!==y||e[34]!==R?(C=t.jsx(De,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:y,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:R})})}),e[33]=y,e[34]=R,e[35]=C):C=e[35];let E;return e[36]!==i||e[37]!==d||e[38]!==h||e[39]!==f||e[40]!==M||e[41]!==C||e[42]!==b||e[43]!==g||e[44]!==m?(E=t.jsxs(ut,{ref:i,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:d,children:[b,g,m,h,f,M,C]}),e[36]=i,e[37]=d,e[38]=h,e[39]=f,e[40]=M,e[41]=C,e[42]=b,e[43]=g,e[44]=m,e[45]=E):E=e[45],E}function nr(s){const e=le.c(26),{connectionIds:r,virtualMcpIds:l,tool:a,status:o,search:d,logs:i,hasMore:n,onLoadMore:c,isLoadingMore:u,connections:j,virtualMcps:v,membersData:b,client:x}=s,L=j??[],p=v??[],[g,m]=K.useState(null),k=Vs(c,n,u),S=Vt(b),h=new Map(S.map(mr)),T=new Map(p.map(dr));let f=i.map(N=>{const D=h.get(N.userId??""),B=N.virtualMcpId?T.get(N.virtualMcpId):null;return{...N,userName:D?.name??N.userId??"Unknown",userImage:D?.image??void 0,virtualMcpName:B?.title??null,virtualMcpIcon:B?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=D=>r.includes(D.connectionId),e[0]=r,e[1]=N):N=e[1],f=f.filter(N)}if(l.length>1){let N;e[2]!==l?(N=D=>D.virtualMcpId&&l.includes(D.virtualMcpId),e[2]=l,e[3]=N):N=e[3],f=f.filter(N)}const M=new Map(L.map(cr));if(d){const N=d.toLowerCase();f=f.filter(D=>D.toolName.toLowerCase().includes(N)||(M.get(D.connectionId)?.title??D.connectionId).toLowerCase().includes(N)||D.errorMessage?.toLowerCase().includes(N))}const y=g!==null?f[g]??null:null,R=yt({queryKey:it.monitoringLogDetail(y?.id??""),queryFn:async()=>{if(!x)throw new Error("MCP client is not available");const N=await x.callTool({name:"MONITORING_LOG_GET",arguments:{id:y.id}});return N.structuredContent??N},enabled:y!==null}),C=R.data?.log,E=y&&C?{...y,input:C.input,output:C.output}:y;if(f.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const D=d||r.length>0||l.length>0||a||o!=="all"?"No logs match your filters":"No logs found in this time range";let B;return e[5]!==D?(B=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(wt,{image:N,title:"No logs found",description:D})}),e[5]=D,e[6]=B):B=e[6],B}const F="flex-1 flex flex-col min-w-0",H="flex-1 min-w-0 pt-1",A="min-w-[600px] md:min-w-0",W=Gt,w="w-full border-collapse";let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Qt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(oe,{className:"w-5"}),t.jsx(oe,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(oe,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(oe,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(oe,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(oe,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(oe,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[7]=_):_=e[7];const $=Jt,z=f.map((N,D)=>t.jsx(ar,{log:N,connection:M.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>m(D),lastLogRef:D===f.length-1?k:void 0},N.id));let O;e[8]!==$||e[9]!==z?(O=t.jsx($,{children:z}),e[8]=$,e[9]=z,e[10]=O):O=e[10];let V;e[11]!==W||e[12]!==_||e[13]!==O?(V=t.jsx("div",{className:H,children:t.jsx("div",{className:A,children:t.jsxs(W,{className:w,children:[_,O]})})}),e[11]=W,e[12]=_,e[13]=O,e[14]=V):V=e[14];const q=g!==null;let J;e[15]!==m?(J=N=>{N||m(null)},e[15]=m,e[16]=J):J=e[16];const G=y&&g!==null&&t.jsxs(t.Fragment,{children:[t.jsx(zs,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:M.get(y.connectionId)?.icon||null,name:M.get(y.connectionId)?.title??y.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Os,{className:"text-sm leading-snug truncate",children:y.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:M.get(y.connectionId)?.title??y.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(ir),disabled:g===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(As,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(N=>N!==null&&N<f.length-1?N+1:N),disabled:g===f.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(Ut,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:R.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):R.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>R.refetch(),children:"Retry"})]}):t.jsx(Hs,{log:E})})]});let Q;e[17]!==G?(Q=t.jsx(Es,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:G}),e[17]=G,e[18]=Q):Q=e[18];let U;e[19]!==J||e[20]!==Q||e[21]!==q?(U=t.jsx(Ps,{open:q,onOpenChange:J,children:Q}),e[19]=J,e[20]=Q,e[21]=q,e[22]=U):U=e[22];let P;return e[23]!==U||e[24]!==V?(P=t.jsxs("div",{className:F,children:[V,U]}),e[23]=U,e[24]=V,e[25]=P):P=e[25],P}function ir(s){return s!==null&&s>0?s-1:s}function cr(s){return[s.id,s]}function dr(s){return[s.id,s]}function mr(s){return[s.userId,s.user]}function ur(){const s=le.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(oe,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(oe,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(oe,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=l):l=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(oe,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(oe,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=o):o=s[4];let d;s[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(oe,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=d):d=s[5];let i;s[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,l,a,o,d,t.jsx(oe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=i):i=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Gt,{className:"w-full border-collapse",children:[i,t.jsx(Jt,{children:Array.from({length:8}).map(xr)})]})})}),s[7]=n):n=s[7],n}function xr(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const Nt=Object.assign(nr,{Skeleton:ur});function fr(s){const e=le.c(34),{client:r,locator:l,baseParams:a,pageSize:o,isStreaming:d,streamingRefetchInterval:i,connectionIds:n,virtualMcpIds:c,tool:u,status:j,searchQuery:v,allConnections:b,allVirtualMcps:x,membersData:L}=s;let p;e[0]!==a||e[1]!==l?(p=it.monitoringLogsInfinite(l,JSON.stringify(a)),e[0]=a,e[1]=l,e[2]=p):p=e[2];let g;e[3]!==a||e[4]!==r||e[5]!==o?(g=async H=>{const{pageParam:A}=H,W=A===void 0?0:A;if(!r)throw new Error("MCP client is not available");const w=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:o,offset:W}});return w.structuredContent??w},e[3]=a,e[4]=r,e[5]=o,e[6]=g):g=e[6];let m;e[7]!==o?(m=(H,A)=>{if(!((H?.logs?.length??0)<o))return A.length*o},e[7]=o,e[8]=m):m=e[8];const k=d?i:!1;let S;e[9]!==p||e[10]!==g||e[11]!==m||e[12]!==k?(S={queryKey:p,queryFn:g,initialPageParam:0,getNextPageParam:m,staleTime:0,refetchInterval:k},e[9]=p,e[10]=g,e[11]=m,e[12]=k,e[13]=S):S=e[13];const{data:h,fetchNextPage:T,hasNextPage:I,isFetchingNextPage:f}=Rs(S);let M;e[14]!==h.pages?(M=h.pages.flatMap(pr),e[14]=h.pages,e[15]=M):M=e[15];const y=M;let R;e[16]!==T||e[17]!==I||e[18]!==f?(R=()=>{I&&!f&&T()},e[16]=T,e[17]=I,e[18]=f,e[19]=R):R=e[19];const C=R,E=I??!1;let F;return e[20]!==b||e[21]!==x||e[22]!==r||e[23]!==n||e[24]!==C||e[25]!==f||e[26]!==L||e[27]!==y||e[28]!==v||e[29]!==j||e[30]!==E||e[31]!==u||e[32]!==c?(F=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(Nt,{connectionIds:n,virtualMcpIds:c,tool:u,status:j,search:v,logs:y,hasMore:E,onLoadMore:C,isLoadingMore:f,connections:b,virtualMcps:x,membersData:L,client:r})})})}),e[20]=b,e[21]=x,e[22]=r,e[23]=n,e[24]=C,e[25]=f,e[26]=L,e[27]=y,e[28]=v,e[29]=j,e[30]=E,e[31]=u,e[32]=c,e[33]=F):F=e[33],F}function pr(s){return s.logs??[]}function hr(s){const e=le.c(15),{dateRange:r}=s,{data:l,isLoading:a}=Us(void 0);let o;e[0]!==l?(o=l===void 0?[]:l,e[0]=l,e[1]=o):o=e[1];const d=o,[i,n]=K.useState(null),c=i??d[0]?.id??null,{data:u}=Ks(c??"");let j;e[2]!==r.startDate?(j=r.startDate.toISOString(),e[2]=r.startDate,e[3]=j):j=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==j||e[7]!==v?(b={startDate:j,endDate:v},e[6]=j,e[7]=v,e[8]=b):b=e[8];const x=b;let L;return e[9]!==u||e[10]!==d||e[11]!==c||e[12]!==a||e[13]!==x?(L=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):d.length===0?t.jsx("div",{className:"py-16",children:t.jsx(wt,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:c??"",onValueChange:p=>n(p),children:[t.jsx(lt,{className:"w-72",children:t.jsx(ot,{placeholder:"Select an automation…"})}),t.jsx(at,{children:d.map(jr)})]})}),u?t.jsx(ws,{automationId:u.id,triggerIds:u.triggers.map(gr),range:x}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=u,e[10]=d,e[11]=c,e[12]=a,e[13]=x,e[14]=L):L=e[14],L}function gr(s){return s.id}function jr(s){return t.jsx(Fe,{value:s.id,children:s.name},s.id)}const vr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Nr({connectionIds:s,virtualMcpIds:e,tool:r,status:l,hideSystem:a,propertyFilters:o,connectionOptions:d,virtualMcpOptions:i,activeFiltersCount:n,onUpdateFilters:c,onConnectionSearchChange:u,memberOptions:j,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:x}){const[L,p]=K.useState(!1),[g,m]=K.useState("form"),[k,S]=K.useState(r),[h,T]=K.useState(o),[I,f]=K.useState(Ye(o)),M=K.useRef(r),y=K.useRef(Le(o));M.current!==r&&(M.current=r,k!==r&&S(r));const R=Le(o);y.current!==R&&(y.current=R,T(o),f(Ye(o)));const C=(w,_)=>{const $=[...h],z=$[w];z&&($[w]={key:_.key??z.key,operator:_.operator??z.operator,value:_.value??z.value},T($))},E=()=>{T([...h,{key:"",operator:"eq",value:""}])},F=w=>{const _=h.filter(($,z)=>z!==w);T(_),f(Ye(_)),c({propertyFilters:Le(_)})},H=()=>{c({propertyFilters:Le(h)})},A=()=>{const w=Lt(I);T(w),c({propertyFilters:Le(w)})},W=()=>{if(g==="raw"){const w=Lt(I);T(w),m("form")}else f(Ye(h)),m("raw")};return t.jsxs(ct,{open:L,onOpenChange:p,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(Pt,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(_s,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(Ms,{id:"hide-system-calls",checked:a,onCheckedChange:w=>c({hideSystem:!!w})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(ht,{options:d,defaultValue:s,onValueChange:w=>c({connectionId:w}),onSearchChange:u,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(ht,{options:i,defaultValue:e,onValueChange:w=>c({virtualMcpId:w}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),x&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(ht,{options:j??[],defaultValue:v,onValueChange:w=>b?.(w),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Ge,{id:"filter-tool",placeholder:"Filter by tool...",value:k,onChange:w=>S(w.target.value),onBlur:()=>{k!==r&&c({tool:k})},onKeyDown:w=>{w.key==="Enter"&&k!==r&&c({tool:k})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:l,onValueChange:w=>c({status:w}),children:[t.jsx(lt,{className:"w-full",children:t.jsx(ot,{})}),t.jsxs(at,{children:[t.jsx(Fe,{value:"all",children:"All Status"}),t.jsx(Fe,{value:"success",children:"Success Only"}),t.jsx(Fe,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:W,children:g==="raw"?t.jsx(js,{size:14}):t.jsx(us,{size:14})})}),t.jsx(tt,{children:g==="raw"?"Switch to form view":"Switch to raw text"})]})]}),g==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ts,{placeholder:`Paste property filters here:
|
|
6
|
-
thread_id=abc123
|
|
7
|
-
user~test
|
|
8
|
-
debug?`,value:I,onChange:w=>f(w.target.value),onBlur:A,onKeyDown:w=>{w.key==="Enter"&&w.metaKey&&A()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[h.map((w,_)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",_+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>F(_),children:t.jsx(Ns,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:w.key,onChange:$=>C(_,{key:$.target.value}),onBlur:H,onKeyDown:$=>{$.key==="Enter"&&H()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:w.operator,onValueChange:$=>{const z=[...h],O=z[_];O&&(z[_]={...O,operator:$,value:$==="exists"?"":O.value},T(z),c({propertyFilters:Le(z)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:vr.map($=>t.jsx(Fe,{value:$.value,children:$.label},$.value))})]})]}),w.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:w.value,onChange:$=>C(_,{value:$.target.value}),onBlur:H,onKeyDown:$=>{$.key==="Enter"&&H()},className:"w-full font-mono text-sm"})]},_)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:E,children:[t.jsx(vs,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),T([]),f(""),c({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),p(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:d,tool:i,status:n,search:c,streaming:u,hideSystem:j,activeFiltersCount:v,from:b,to:x,propertyFilters:L,onUpdateFilters:p,onTimeRangeChange:g,onStreamingToggle:m,onTabChange:k}=s,S=Mt(),h=gs(),{data:T}=xs(),[I,f]=K.useState(""),M=I||void 0;let y;e[0]!==M?(y={searchTerm:M},e[0]=M,e[1]=y):y=e[1];const R=Mt(y);let C;e[2]!==R?(C=R??[],e[2]=R,e[3]=C):C=e[3];let E;e[4]!==C?(E=C.map(Sr),e[4]=C,e[5]=E):E=e[5];const F=E;let H;e[6]!==h?(H=h.map(wr),e[6]=h,e[7]=H):H=e[7];const A=H,{pageSize:W,streamingRefetchInterval:w}=vt,{org:_,locator:$}=Be();let z;e[8]!==_.id||e[9]!==_.slug?(z={connectionId:fs,orgId:_.id,orgSlug:_.slug},e[8]=_.id,e[9]=_.slug,e[10]=z):z=e[10];const O=ps(z);let V;e[11]!==L?(V=Bs(L),e[11]=L,e[12]=V):V=e[12];const q=V;let J;e[13]!==j||e[14]!==_.id?(J=j?[hs.SELF(_.id)]:void 0,e[13]=j,e[14]=_.id,e[15]=J):J=e[15];const G=J;let Q;e[16]===Symbol.for("react.memo_cache_sentinel")?(Q=[],e[16]=Q):Q=e[16];const[U,P]=K.useState(Q);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[D,B]=K.useState(N);let ee;e[18]===Symbol.for("react.memo_cache_sentinel")?(ee=[],e[18]=ee):ee=e[18];const[X,te]=K.useState(ee),[Y,ae]=K.useState("all"),_e=(D.length>0?1:0)+(X.length>0?1:0)+(Y!=="all"?1:0);let $e;e[19]!==T?($e=Vt(T).map(yr),e[19]=T,e[20]=$e):$e=e[20];const Se=$e;let ne;e[21]!==l.startDate?(ne=l.startDate.toISOString(),e[21]=l.startDate,e[22]=ne):ne=e[22];let he;e[23]!==l.endDate?(he=l.endDate.toISOString(),e[23]=l.endDate,e[24]=he):he=e[24];const ge=o.length===1?o[0]:void 0,je=d.length===1?d[0]:void 0,ve=i||void 0,Ne=n==="errors"?!0:n==="success"?!1:void 0;let de;e[25]!==G||e[26]!==q||e[27]!==ne||e[28]!==he||e[29]!==ge||e[30]!==je||e[31]!==ve||e[32]!==Ne?(de={startDate:ne,endDate:he,connectionId:ge,excludeConnectionIds:G,virtualMcpId:je,toolName:ve,isError:Ne,...q},e[25]=G,e[26]=q,e[27]=ne,e[28]=he,e[29]=ge,e[30]=je,e[31]=ve,e[32]=Ne,e[33]=de):de=e[33];const be=de;let me;e[34]===Symbol.for("react.memo_cache_sentinel")?(me={id:"overview",label:"Overview"},e[34]=me):me=e[34];let ue;e[35]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"audit",label:"Audit"},e[35]=ue):ue=e[35];let xe;e[36]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"threads",label:"Threads"},e[36]=xe):xe=e[36];let fe;e[37]===Symbol.for("react.memo_cache_sentinel")?(fe=[me,ue,xe,{id:"automations",label:"Automations"}],e[37]=fe):fe=e[37];const Re=fe;let se;e[38]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(Me.Title,{children:"Monitoring"}),e[38]=se):se=e[38];let re;e[39]!==k?(re=Ie=>k(Ie),e[39]=k,e[40]=re):re=e[40];let ie;e[41]!==re||e[42]!==r?(ie=t.jsx(Kt,{tabs:Re,activeTab:r,onTabChange:re}),e[41]=re,e[42]=r,e[43]=ie):ie=e[43];let pe;e[44]!==v||e[45]!==o||e[46]!==F||e[47]!==I||e[48]!==j||e[49]!==u||e[50]!==U||e[51]!==Se||e[52]!==m||e[53]!==p||e[54]!==L||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==d||e[59]!==A?(pe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:u?"secondary":"outline",className:"gap-1.5",onClick:m,children:[u&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),u&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:o,virtualMcpIds:d,tool:i,status:n,hideSystem:j,propertyFilters:L,connectionOptions:F,virtualMcpOptions:A,activeFiltersCount:v,onUpdateFilters:p,connectionSearchTerm:I,onConnectionSearchChange:f,memberOptions:Se,llmUserIds:U,onLlmUserIdsChange:P,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=F,e[47]=I,e[48]=j,e[49]=u,e[50]=U,e[51]=Se,e[52]=m,e[53]=p,e[54]=L,e[55]=n,e[56]=r,e[57]=i,e[58]=d,e[59]=A,e[60]=pe):pe=e[60];let ye;e[61]!==Se||e[62]!==r||e[63]!==_e||e[64]!==D||e[65]!==Y||e[66]!==X||e[67]!==A?(ye=r==="threads"&&t.jsx(Ss,{filterAgentIds:D,filterUserIds:X,filterStatus:Y,virtualMcpOptions:A,memberOptions:Se,activeFiltersCount:_e,onUpdateFilters:Ie=>{const{filterAgentIds:St,filterUserIds:It,filterStatus:Ct}=Ie;St!==void 0&&B(St),It!==void 0&&te(It),Ct!==void 0&&ae(Ct)}}),e[61]=Se,e[62]=r,e[63]=_e,e[64]=D,e[65]=Y,e[66]=X,e[67]=A,e[68]=ye):ye=e[68];let ze;e[69]!==b||e[70]!==x?(ze={from:b,to:x},e[69]=b,e[70]=x,e[71]=ze):ze=e[71];let Oe;e[72]!==g||e[73]!==ze?(Oe=t.jsx(Ys,{value:ze,onChange:g}),e[72]=g,e[73]=ze,e[74]=Oe):Oe=e[74];let Ee;e[75]!==pe||e[76]!==ye||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[pe,ye,Oe]}),e[75]=pe,e[76]=ye,e[77]=Oe,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ie||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ie,Ee]}),e[79]=ie,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==p||e[83]!==c||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(os,{value:c,onChange:Ie=>p({search:Ie}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Ie=>{Ie.key==="Escape"&&(p({search:""}),Ie.target.blur())},className:"w-full md:w-[375px]"}),e[82]=p,e[83]=c,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(Me.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[se,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==h||e[91]!==be||e[92]!==O||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==G||e[97]!==u||e[98]!==U||e[99]!==$||e[100]!==T||e[101]!==c||e[102]!==n||e[103]!==r||e[104]!==D||e[105]!==Y||e[106]!==X||e[107]!==i||e[108]!==d?(Ue=r==="automations"?t.jsx(hr,{dateRange:l}):r==="threads"?t.jsx(Is,{client:O,locator:$,membersData:T,allConnections:S,allVirtualMcps:h,dateRange:l,searchQuery:c,filterAgentIds:D,filterUserIds:X,filterStatus:Y}):r==="audit"?t.jsx(fr,{client:O,locator:$,baseParams:be,pageSize:W,isStreaming:u,streamingRefetchInterval:w,connectionIds:o,virtualMcpIds:d,tool:i,status:n,searchQuery:c,allConnections:S,allVirtualMcps:h,membersData:T}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:G,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:u,streamingRefetchInterval:w,llmUserIds:U})}),e[89]=S,e[90]=h,e[91]=be,e[92]=O,e[93]=o,e[94]=l,e[95]=a,e[96]=G,e[97]=u,e[98]=U,e[99]=$,e[100]=T,e[101]=c,e[102]=n,e[103]=r,e[104]=D,e[105]=Y,e[106]=X,e[107]=i,e[108]=d,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(qt,{url:r,fallback:e,shape:"circle",size:"2xs",className:ce("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:ce("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:ce("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Lo(){const s=le.c(83),{org:e}=Be(),r=bt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=rs(l),{tab:o,from:d,to:i,connectionId:n,virtualMcpId:c,tool:u,search:j,status:v,streaming:b,propertyFilters:x,hideSystem:L}=a,p=o===void 0?"overview":o;let g;s[1]!==n?(g=n===void 0?[]:n,s[1]=n,s[2]=g):g=s[2];const m=g;let k;s[3]!==c?(k=c===void 0?[]:c,s[3]=c,s[4]=k):k=s[4];const S=k,h=b===void 0?!0:b,T=x===void 0?"":x,I=L===void 0?!1:L;let f,M,y,R,C,E,F;if(s[5]!==m.length||s[6]!==d||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==T||s[11]!==a||s[12]!==v||s[13]!==h||s[14]!==i||s[15]!==u||s[16]!==S.length){C=qs(T);let P;s[24]!==r||s[25]!==e.slug||s[26]!==a?(P=X=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...X}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=P):P=s[27],F=P;let N;s[28]!==F?(N=X=>{F({from:X.from,to:X.to})},s[28]=F,s[29]=N):N=s[29],R=N;let D,B;if(s[30]!==d||s[31]!==h||s[32]!==i){const X=we(d),te=we(i);B=X.date||new Date(Date.now()-18e5);const Y=te.date||new Date;y={startDate:B,endDate:Y},D=Y,h&&i==="now"&&(D=new Date(Y),D.setHours(D.getHours()+1)),s[30]=d,s[31]=h,s[32]=i,s[33]=y,s[34]=D,s[35]=B}else y=s[33],D=s[34],B=s[35];let ee;s[36]!==D||s[37]!==B?(ee={startDate:B,endDate:D},s[36]=D,s[37]=B,s[38]=ee):ee=s[38],M=ee,f=0,m.length>0&&f++,S.length>0&&f++,u&&f++,v!=="all"&&f++,I&&f++,E=C.filter(Ir),s[5]=m.length,s[6]=d,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=T,s[11]=a,s[12]=v,s[13]=h,s[14]=i,s[15]=u,s[16]=S.length,s[17]=f,s[18]=M,s[19]=y,s[20]=R,s[21]=C,s[22]=E,s[23]=F}else f=s[17],M=s[18],y=s[19],R=s[20],C=s[21],E=s[22],F=s[23];const H=E;H.length>0&&(f=f+H.length);let A;s[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Me.Body,{className:"!pb-3",children:t.jsx(Me.Title,{children:"Monitoring"})}),s[39]=A):A=s[39];let W;s[40]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsxs(t.Fragment,{children:[A,t.jsx(Me.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(wt,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=W):W=s[40];let w;s[41]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Me.Title,{children:"Monitoring"}),s[41]=w):w=s[41];let _;s[42]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=_):_=s[42];let $;s[43]!==F?($=P=>F({tab:P}),s[43]=F,s[44]=$):$=s[44];let z;s[45]!==$||s[46]!==p?(z=t.jsx(Me.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[w,t.jsx(Kt,{tabs:_,activeTab:p,onTabChange:$})]})}),s[45]=$,s[46]=p,s[47]=z):z=s[47];let O;s[48]!==p?(O=p==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(Nt.Skeleton,{})}):p==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(Nt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(or,{})}),s[48]=p,s[49]=O):O=s[49];let V;s[50]!==z||s[51]!==O?(V=t.jsxs(t.Fragment,{children:[z,O]}),s[50]=z,s[51]=O,s[52]=V):V=s[52];let q;s[53]!==R?(q=P=>{xt("monitoring_time_range_changed",{from:P.from,to:P.to}),R(P)},s[53]=R,s[54]=q):q=s[54];let J;s[55]!==h||s[56]!==F?(J=()=>{xt("monitoring_live_toggled",{enabled:!h}),F({streaming:!h})},s[55]=h,s[56]=F,s[57]=J):J=s[57];let G;s[58]!==p||s[59]!==F?(G=P=>{P!==p&&xt("monitoring_tab_changed",{from_tab:p,to_tab:P}),F({tab:P})},s[58]=p,s[59]=F,s[60]=G):G=s[60];let Q;s[61]!==f||s[62]!==m||s[63]!==M||s[64]!==y||s[65]!==d||s[66]!==I||s[67]!==C||s[68]!==j||s[69]!==v||s[70]!==h||s[71]!==q||s[72]!==J||s[73]!==G||s[74]!==p||s[75]!==i||s[76]!==u||s[77]!==F||s[78]!==S?(Q=t.jsx(br,{tab:p,dateRange:M,displayDateRange:y,connectionIds:m,virtualMcpIds:S,tool:u,status:v,search:j,streaming:h,hideSystem:I,activeFiltersCount:f,from:d,to:i,propertyFilters:C,onUpdateFilters:F,onTimeRangeChange:q,onStreamingToggle:J,onTabChange:G}),s[61]=f,s[62]=m,s[63]=M,s[64]=y,s[65]=d,s[66]=I,s[67]=C,s[68]=j,s[69]=v,s[70]=h,s[71]=q,s[72]=J,s[73]=G,s[74]=p,s[75]=i,s[76]=u,s[77]=F,s[78]=S,s[79]=Q):Q=s[79];let U;return s[80]!==V||s[81]!==Q?(U=t.jsx(as,{capability:"monitoring:view",area:"monitoring",children:t.jsx(Me,{children:t.jsx(ls,{fallback:W,children:t.jsx(K.Suspense,{fallback:V,children:Q})})})}),s[80]=V,s[81]=Q,s[82]=U):U=s[82],U}function Ir(s){return s.key.trim()}export{Lo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as k,j as o,p as T,r as N,O as D}from"./index-DHxOddsj.js";import{u as z,S as E,a as I,b as L}from"./sidebar-BY-0S2nV.js";import{T as M,a as O,b as A,u as P}from"./tooltip-6OktDyzD.js";import{S as $,a as W,b as B}from"./shell-route-loading-B6fsTD_h.js";import{u as X,C as H}from"./chat-context-CpxV-LEc.js";import{T as F}from"./tab-id-DaQY5Du1.js";import{i as q}from"./Monitor01-C_pzVd4h.js";import{v as G,C as K}from"./connect-desktop-dialog-BoRQM4OA.js";import{T as Y,a as b}from"./toolbar-BptUton3.js";import{S as U,M as J}from"./shell-controls-pFVNS2Vn.js";import"./LayoutLeft-DwKLO_V_.js";import"./sheet-4GES45T2.js";import"./X-8-D5pATw.js";import"./useRouterState-Dnb9kW5z.js";import"./ZoomOut-aYAC7hBe.js";import"./skeleton-B2rX4p4v.js";import"./popover-8cVh6gq0.js";import"./drawer-Be_zu0QX.js";import"./SearchMd-DFhUmylG.js";import"./Star01-DkpG4lGE.js";import"./Plus-Dx1SIiMT.js";import"./use-mcp-client-Bbkq-Btq.js";import"./use-virtual-mcp-C6pMpGrR.js";import"./use-collections-3gcbdMo5.js";import"./use-create-virtual-mcp-BJIgmNjf.js";import"./use-navigate-to-agent-7jnPTeCV.js";import"./github-repo-picker-Cd_kXw_v.js";import"./use-connection-Cygt3JAU.js";import"./dialog-BnOLdErK.js";import"./RefreshCcw01-C3I3Y9Tu.js";import"./collection-search-DHln9QoJ.js";import"./checkbox-C0OD5DTK.js";import"./Check-Cl07asRj.js";import"./agent-icon-cetEWq0Z.js";import"./AlertCircle-A2M1Yk61.js";import"./Tool01-Cm1sVqXs.js";import"./SwitchHorizontal01-CDVzg25U.js";import"./XCircle-D0Uf6feY.js";import"./ArrowUpRight-CjvxrowT.js";import"./ZapSquare-qMfSZ8L9.js";import"./Users03-DIxLvYmx.js";import"./CheckCircle-Ck9u9W7w.js";import"./ChevronDown-Ce3UdjOo.js";import"./ChevronLeft-SeayBU0G.js";import"./ChevronRight-C8KzXj8H.js";import"./ChevronUp-zA2iz0JQ.js";import"./DotsVertical-_g_anHKb.js";import"./Container-B3y5dlGc.js";import"./Eye-lcuSJE4l.js";import"./Globe01-CfZP4vCY.js";import"./FilterLines-EpjZnXUA.js";import"./Palette-DdA_ILd6.js";import"./HardDrive-75MAycL-.js";import"./Stars02-bH2-rrrk.js";import"./Key01-DyeMqFvi.js";import"./LinkExternal01-r7kaLetr.js";import"./Sun-CLmK6D64.js";import"./Play-CnkDDouZ.js";import"./Settings02-CWkfxXGQ.js";import"./Shield01-CbvWDrmE.js";import"./Stars01-CJ8FecuG.js";import"./Trash01-CA4jg9ww.js";import"./Upload01-BbVOBYlS.js";import"./User01-CMz2xYx2.js";import"./Users01-DBOuOgB6.js";import"./XClose-Cnj8fI9u.js";import"./Zap-mYMK3ZBL.js";import"./use-mcp-tools-BiO0x3bS.js";import"./extract-connection-data-bN8kltS6.js";import"./generate-id-CQZwmjfI.js";import"./collections-Deko--Yp.js";import"./shell-layout-DtkuyxW9.js";import"./avatar-Bg8Fajzf.js";import"./required-auth-layout-Cidb--Hk.js";import"./use-organization-settings-6ykeD7wG.js";import"./use-org-sso-HULZXLZY.js";import"./alert-dialog-DokKbPq-.js";import"./form-C_FOfVah.js";import"./label-g7a72jJD.js";import"./input-C3YblD3D.js";import"./spinner-WtoCvpNX.js";import"./index-D0AW3RJr.js";import"./sortable.esm-C0tZpwHI.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-ZCt-smg_.js";import"./use-registry-connections-Cw0Uu9HN.js";import"./useInfiniteQuery-DnxNK7B2.js";import"./infiniteQueryObserver-Da-l1Mrb.js";import"./card-BVDRUeiB.js";import"./integration-icon-DNnbE81S.js";import"./collection-tabs-BaiyS1az.js";import"./badge-CWyTrVve.js";import"./select-LvZkQCcv.js";import"./textarea-CxRmk2pV.js";import"./connection-form-helpers-B6JNJh-A.js";import"./use-infinite-scroll-D7Lz32GP.js";import"./useSuspenseInfiniteQuery-Bdpr4GcQ.js";import"./use-ai-providers-Czs3LwMV.js";import"./command-3qLn4P52.js";import"./index-bcXz_XDV.js";import"./studio-tools-CH7dZ7HT.js";import"./use-org-auth-client-DwSMx4xq.js";import"./hover-card-CHj7OURi.js";import"./task-status-BlpPmTT-.js";import"./use-clock-tick-DRfafiJJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./watch-sse-pool-CuN8_Ws2.js";import"./decopilot-sse-pool-8baykh62.js";function Q(e){const t=k.c(5),{onPointerDown:r,onDoubleClick:d}=e,{state:f,isMobile:u}=z();if(u||f==="collapsed")return null;let s,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={left:"var(--sidebar-width)"},n=o.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),t[0]=s,t[1]=n):(s=t[0],n=t[1]);let i;return t[2]!==d||t[3]!==r?(i=o.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:r,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:s,children:n}),t[2]=d,t[3]=r,t[4]=i):i=t[4],i}const R=240,V=400,Z="sidebar.width";function _(e){return Math.max(R,Math.min(V,e))}function ee(){const e=k.c(11),[t,r]=T(Z,te),d=N.useRef(null);let f;e[0]!==r||e[1]!==t?(f=a=>{a.preventDefault();const m=a.clientX,p=_(t),c=d.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=c?Array.from(c.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const x of h)x.style.transition="none";const j=x=>{const g=_(p+(x.clientX-m));c?.style.setProperty("--sidebar-width",`${g}px`)},S=x=>{const g=_(p+(x.clientX-m));r(g);for(const v of h)v.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S)},e[0]=r,e[1]=t,e[2]=f):f=e[2];const u=f;let s;e[3]!==r?(s=()=>{r(R)},e[3]=r,e[4]=s):s=e[4];const n=s;let i;e[5]!==t?(i=_(t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==u||e[8]!==n||e[9]!==i?(l={width:i,wrapperRef:d,onStartResize:u,resetWidth:n},e[7]=u,e[8]=n,e[9]=i,e[10]=l):l=e[10],l}function te(e){return typeof e=="number"?_(e):R}function oe(){const e=k.c(22),t=X(),[r,d]=N.useState(!1);let f;if(e[0]!==t.capabilities||e[1]!==t.hostname||e[2]!==t.machineId||e[3]!==t.online){const j=G(t.capabilities);f=t.online?o.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[o.jsx("span",{className:"font-medium",children:t.hostname??t.machineId??"Desktop linked"}),o.jsx("span",{className:"text-muted-foreground",children:j.length>0?`Available: ${j.join(", ")}`:"No CLI agents detected"})]}):o.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=t.capabilities,e[1]=t.hostname,e[2]=t.machineId,e[3]=t.online,e[4]=f}else f=e[4];const u=f;let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=()=>d(!0),e[5]=s):s=e[5];const n=t.online?"Desktop linked":"Connect your desktop";let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(q,{size:16}),e[6]=i):i=e[6];let l;e[7]!==t.online?(l=t.online&&o.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[7]=t.online,e[8]=l):l=e[8];let a;e[9]!==n||e[10]!==l?(a=o.jsx(M,{asChild:!0,children:o.jsxs(Y,{onClick:s,"aria-label":n,children:[i,l]})}),e[9]=n,e[10]=l,e[11]=a):a=e[11];let m;e[12]!==u?(m=o.jsx(O,{side:"bottom",children:u}),e[12]=u,e[13]=m):m=e[13];let p;e[14]!==a||e[15]!==m?(p=o.jsxs(A,{children:[a,m]}),e[14]=a,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==r?(c=o.jsx(K,{open:r,onOpenChange:d}),e[17]=r,e[18]=c):c=e[18];let h;return e[19]!==p||e[20]!==c?(h=o.jsxs(o.Fragment,{children:[p,c]}),e[19]=p,e[20]=c,e[21]=h):h=e[21],h}const ie="sidebar.open";function re(){const e=k.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(B,{}),e[0]=t):t=e[0],t}function no(){const e=k.c(26),t=P(),[r,d]=T(ie,!1),{width:f,wrapperRef:u,onStartResize:s,resetWidth:n}=ee();let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(b.LogoLink,{}),l=o.jsx(U,{}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let a,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsxs(b.LeftColumn,{children:[i,l,o.jsx("span",{className:"hidden md:contents",children:o.jsx(b.Nav,{})}),o.jsx(b.TogglesSlot,{}),o.jsx(oe,{})]}),m=o.jsx(b.CenterSlot,{}),e[2]=a,e[3]=m):(a=e[2],m=e[3]);let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(b.Header,{children:[a,m,o.jsxs(b.RightColumn,{children:[o.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:o.jsx(b.TabsSlot,{})}),o.jsx(b.RightSlot,{})]})]}),e[4]=p):p=e[4];const c=`${f}px`;let h;e[5]!==c?(h={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},e[5]=c,e[6]=h):h=e[6];const j=h;let S;e[7]!==t||e[8]!==s||e[9]!==n?(S=!t&&o.jsxs(o.Fragment,{children:[o.jsx($,{}),o.jsx(Q,{onPointerDown:s,onDoubleClick:n})]}),e[7]=t,e[8]=s,e[9]=n,e[10]=S):S=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},e[11]=x):x=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(E,{className:"flex flex-col",style:x,children:o.jsx("div",{className:"flex flex-col h-full min-h-0",children:o.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:o.jsx(N.Suspense,{fallback:o.jsx(re,{}),children:o.jsx(D,{})})})})}),e[12]=g):g=e[12];let v;e[13]!==j||e[14]!==S||e[15]!==u?(v=o.jsxs(I,{ref:u,className:"flex-1 bg-sidebar relative min-h-0",style:j,children:[S,g]}),e[13]=j,e[14]=S,e[15]=u,e[16]=v):v=e[16];let y;e[17]!==t?(y=t&&o.jsx(J,{renderSidebar:se}),e[17]=t,e[18]=y):y=e[18];let w;e[19]!==v||e[20]!==y?(w=o.jsx(H,{children:o.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[p,v,y]})}),e[19]=v,e[20]=y,e[21]=w):w=e[21];let C;return e[22]!==d||e[23]!==r||e[24]!==w?(C=o.jsx(F,{children:o.jsx(b.Provider,{children:o.jsx(L,{open:r,onOpenChange:d,children:w})})}),e[22]=d,e[23]=r,e[24]=w,e[25]=C):C=e[25],C}function se(e){const{onClose:t}=e;return o.jsx("div",{className:"flex h-full",children:o.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:o.jsx(W,{onClose:t})})})}export{no as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ar as Ze,as as de,at as Ye,au as et,av as $e,G as he,aw as tt,ax as st,r as A,ay as it,az as nt,aA as rt,aB as ot,aC as ve,aD as lt,aE as at,aF as ct,e as T,j as i,q as J,c as q,l as Ie,aG as pe,o as W,K as ne,n as re,a as dt,v as mt,E as ut,b as ft,B as je}from"./index-DHxOddsj.js";import{u as xe}from"./tooltip-6OktDyzD.js";import{i as ht,u as oe,g as pt,a as xt}from"./use-mcp-client-Bbkq-Btq.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-C6pMpGrR.js";import{i as jt}from"./Check-Cl07asRj.js";import{_ as wt,A as Y,a0 as Nt,v as St,c as _t}from"./agent-icon-cetEWq0Z.js";import{s as ge}from"./Plus-Dx1SIiMT.js";import{i as Te}from"./X-8-D5pATw.js";import{u as Ct,b as kt,h as Et,C as se}from"./agent-capabilities-CFuGvMed.js";import{u as $t,c as It}from"./chat-context-CpxV-LEc.js";import{N as Tt}from"./agent-icons-CK-xDflz.js";import{u as Ae,a as ie,K as Me,P as Oe,D as Re,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-C0tZpwHI.js";import{u as ze,a as Pe,o as Ut}from"./use-organization-settings-6ykeD7wG.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-DtkuyxW9.js";import{I as Qt}from"./input-C3YblD3D.js";import{S as Wt}from"./scroll-area-D2NfEZKG.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Jt}from"./sheet-4GES45T2.js";import{S as H}from"./skeleton-B2rX4p4v.js";import{t as De}from"./ChevronDown-Ce3UdjOo.js";import{d as He}from"./ZoomOut-aYAC7hBe.js";import{g as Xt,M as Zt}from"./types-k3mlT_jb.js";import{I as Yt}from"./integration-icon-DNnbE81S.js";import{u as es}from"./studio-tools-CH7dZ7HT.js";import{t as Le,P as ts,e as ss,s as is,g as ns}from"./pair-CV7DGW5V.js";import{a as rs}from"./XCircle-D0Uf6feY.js";import{g as os}from"./use-mcp-prompts-C2IR7B-B.js";import{u as ls,w as as}from"./tab-id-DaQY5Du1.js";import{a as cs,g as ds,c as ms,b as us,D as fs}from"./dropdown-menu-mHDT-XH7.js";import{s as hs}from"./Trash01-CA4jg9ww.js";import{a as ps,u as xs}from"./use-ai-providers-Czs3LwMV.js";import{a as gs}from"./toolbar-BptUton3.js";import"./use-collections-3gcbdMo5.js";import"./AlertCircle-A2M1Yk61.js";import"./Tool01-Cm1sVqXs.js";import"./SwitchHorizontal01-CDVzg25U.js";import"./RefreshCcw01-C3I3Y9Tu.js";import"./ArrowUpRight-CjvxrowT.js";import"./ZapSquare-qMfSZ8L9.js";import"./Users03-DIxLvYmx.js";import"./CheckCircle-Ck9u9W7w.js";import"./ChevronLeft-SeayBU0G.js";import"./ChevronRight-C8KzXj8H.js";import"./ChevronUp-zA2iz0JQ.js";import"./DotsVertical-_g_anHKb.js";import"./Container-B3y5dlGc.js";import"./Eye-lcuSJE4l.js";import"./Globe01-CfZP4vCY.js";import"./FilterLines-EpjZnXUA.js";import"./Star01-DkpG4lGE.js";import"./Palette-DdA_ILd6.js";import"./HardDrive-75MAycL-.js";import"./Stars02-bH2-rrrk.js";import"./Key01-DyeMqFvi.js";import"./LayoutLeft-DwKLO_V_.js";import"./LinkExternal01-r7kaLetr.js";import"./Monitor01-C_pzVd4h.js";import"./Sun-CLmK6D64.js";import"./Play-CnkDDouZ.js";import"./SearchMd-DFhUmylG.js";import"./Settings02-CWkfxXGQ.js";import"./Shield01-CbvWDrmE.js";import"./Stars01-CJ8FecuG.js";import"./Upload01-BbVOBYlS.js";import"./User01-CMz2xYx2.js";import"./Users01-DBOuOgB6.js";import"./XClose-Cnj8fI9u.js";import"./Zap-mYMK3ZBL.js";import"./spinner-WtoCvpNX.js";import"./dialog-BnOLdErK.js";import"./drawer-Be_zu0QX.js";import"./collection-search-DHln9QoJ.js";import"./form-C_FOfVah.js";import"./label-g7a72jJD.js";import"./select-LvZkQCcv.js";import"./tabs-D_XRbq3N.js";import"./toggle-group-B_ZhC8rH.js";import"./connect-desktop-dialog-BoRQM4OA.js";import"./popover-8cVh6gq0.js";import"./command-3qLn4P52.js";import"./index-bcXz_XDV.js";import"./useInfiniteQuery-DnxNK7B2.js";import"./infiniteQueryObserver-Da-l1Mrb.js";import"./index-CXrzfY3D.js";import"./question-004-sINsf4GQ.js";import"./checkbox-C0OD5DTK.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-Bg8Fajzf.js";import"./settings-section-BiebCtcC.js";import"./card-BVDRUeiB.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-ZCt-smg_.js";import"./use-registry-connections-Cw0Uu9HN.js";import"./use-connection-Cygt3JAU.js";import"./extract-connection-data-bN8kltS6.js";import"./generate-id-CQZwmjfI.js";import"./collections-Deko--Yp.js";import"./collection-tabs-BaiyS1az.js";import"./badge-CWyTrVve.js";import"./textarea-CxRmk2pV.js";import"./connection-form-helpers-B6JNJh-A.js";import"./use-infinite-scroll-D7Lz32GP.js";import"./useSuspenseInfiniteQuery-Bdpr4GcQ.js";import"./required-auth-layout-Cidb--Hk.js";import"./useRouterState-Dnb9kW5z.js";import"./use-org-sso-HULZXLZY.js";import"./use-clock-tick-DRfafiJJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BzO5OLbn.js";import"./file-type-icon-DHQvk0za.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-7jnPTeCV.js";import"./watch-sse-pool-CuN8_Ws2.js";import"./decopilot-sse-pool-8baykh62.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ze{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),l=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),o=l||c,d=o?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!Ye(m,f)});!o&&!d||(o&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(o&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,l)=>a!==r[l]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=et(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),l=e.get(n.queryHash)?.shift()??new $e(this.#n,n);s.push({defaultedQueryOptions:n,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=tt(),a=st(),l=A.useMemo(()=>t.map(h=>{const p=r.defaultQueryOptions(h);return p._optimisticResults=n?"isRestoring":"optimistic",p}),[t,r,n]);l.forEach(h=>{it(h);const p=r.getQueryCache().get(h.queryHash);nt(h,a,p)}),rt(a);const[c]=A.useState(()=>new ys(r,l,e)),[o,d,m]=c.getOptimisticResult(l,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?c.subscribe(de.batchCalls(h)):ot,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const x=o.some((h,p)=>ve(l[p],h))?o.flatMap((h,p)=>{const b=l[p];if(b&&ve(b,h)){const v=new $e(r,b);return lt(b,v,a)}return[]}):[];if(x.length>0)throw Promise.all(x);const g=o.find((h,p)=>{const b=l[p];return b&&at({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return d(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ct,enabled:!0,placeholderData:void 0}))},e)}const ee=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(qt,{children:"Manage home"}),c=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(wt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h=>a(h.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[l,c,i.jsxs("div",{className:"relative mt-3",children:[o,i.jsx(Qt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==x?(g=i.jsx(Jt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=J(),r=ze();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,l=Pe(),c=bt(),o=he();let d;e[2]!==s||e[3]!==o?(d=()=>o.refetchQueries({queryKey:ne.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=o,e[4]=d):d=e[4];const m=d;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let x;e[7]!==a||e[8]!==t?(x=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=x):x=e[9];const h=x>=ee;let p;e[10]!==h||e[11]!==f||e[12]!==l?(p=C=>f(C)||h?Promise.resolve():l.apply($=>$.includes(C)?null:[...$,C]),e[10]=h,e[11]=f,e[12]=l,e[13]=p):p=e[13];const b=p;let v;e[14]!==l?(v=C=>l.apply($=>$.filter(E=>E!==C)),e[14]=l,e[15]=v):v=e[15];const w=v;let y;e[16]!==l?(y=C=>l.apply(()=>C),e[16]=l,e[17]=y):y=e[17];const j=y;let N;e[18]!==c||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==l?(N=async(C,$)=>{await c.update.mutateAsync({id:C.id,data:{metadata:$}}),!f(C.id)&&!h&&await l.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=c,e[19]=h,e[20]=f,e[21]=m,e[22]=l,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map($s)),e[1]=n,e[2]=a):a=e[2];const l=Ns(a);let c,o,d;if(e[3]!==n||e[4]!==l||e[5]!==s){const h=new Map(n.map(Es));c=s.trim().toLowerCase();const p=v=>!c||v.title?.toLowerCase().includes(c);o=l.homeIds.map(v=>h.get(v)).filter(ks).filter(p);let b;e[9]!==l?(b=v=>!l.isOnHome(v.id),e[9]=l,e[10]=b):b=e[10],d=n.filter(Cs).filter(b).filter(p).sort(_s),e[3]=n,e[4]=l,e[5]=s,e[6]=c,e[7]=o,e[8]=d}else c=e[6],o=e[7],d=e[8];const m=d;let u;e[11]!==l||e[12]!==o?(u=i.jsx(Is,{home:l,agents:o}),e[11]=l,e[12]=o,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==l||e[16]!==f?(x=i.jsx(Ms,{home:l,agents:m,hasSearch:f}),e[14]=m,e[15]=l,e[16]=f,e[17]=x):x=e[17];let g;return e[18]!==u||e[19]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!ht(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function $s(t){return t.id}function Ue(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==a?(l=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function Is(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const l=Ae(ie(Oe,n),ie(Me,a));let c;e[2]!==s?(c=x=>{const{active:g,over:h}=x;if(!h||g.id===h.id)return;const p=s.homeIds,b=p.indexOf(g.id),v=p.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...p],b,v)).catch(As)},e[2]=s,e[3]=c):c=e[3];const o=c,d=`${s.homeIds.length}/${ee}`;let m;e[4]!==d?(m=i.jsx(Ue,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==o||e[8]!==s||e[9]!==l?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Re,{sensors:l,collisionDetection:At,onDragEnd:o,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Rs,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=o,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,l]=A.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const o=r.slice(0,a);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ue,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:o.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>l(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=c}else c=e[4];return c}function Os(t){return t+20}function Be(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:c,listeners:o,setNodeRef:d,transform:m,transition:u,isDragging:f}=Rt(l),x=Be(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,p=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==p||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:p},e[4]=g,e[5]=h,e[6]=p,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(He,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==o||e[14]!==j?(S=i.jsx("button",{type:"button",...c,...o,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=c,e[13]=o,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let $;e[17]!==s.icon||e[18]!==C?($=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=$):$=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let I;e[22]!==x?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=I):I=e[23];let O;e[24]!==_||e[25]!==I?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,I]}),e[24]=_,e[25]=I,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(De,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==$||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[$,O,P]}),e[31]=n,e[32]=$,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Te,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Fe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==d||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:d,style:v,className:y,children:[L,U]}),e[51]=d,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),l=Be(t),c=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(o=>!o),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),i.jsx(De,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ee}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx(Ie,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Fe,{agent:t,home:e})]})}function Fe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,l,c,o,d,m;if(e[0]!==s||e[1]!==r){const p=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,l=s,c=r,o=v,d=new Set(p.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=l,e[5]=c,e[6]=o,e[7]=d,e[8]=m}else n=e[2],a=e[3],l=e[4],c=e[5],o=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==l||e[13]!==c||e[14]!==o||e[15]!==d?(u=i.jsx(n,{agent:l,home:c,connectionIds:o,pinnedResourceUris:d}),e[11]=n,e[12]=l,e[13]=c,e[14]=o,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const x=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==x?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const n=es(),{data:a,isLoading:l}=re({queryKey:ne.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async o=>{try{const{item:d}=await n.call("COLLECTION_CONNECTIONS_GET",{id:o}),m=(d?.tools??[]).flatMap(u=>{const f=Xt(u._meta);return f?[{name:u.name,description:u.description,resourceUri:f}]:[]});return{id:o,title:d?.title??o,icon:d?.icon??null,uiTools:m}}catch{return{id:o,title:o,icon:null,uiTools:[]}}}))).filter(o=>o.uiTools.length>0)});return s.length===0?null:l?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!a||a.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:a.map(c=>c.uiTools.map(o=>i.jsx(Fs,{agent:t,home:e,connection:c,tool:o,isPinned:r.has(o.resourceUri)},`${c.id}:${o.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=pe(t.metadata?.ui),d=n?o.filter(u=>u.resourceUri!==r.resourceUri):[...o,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle tile",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Le(r.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Qe(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==l?(c=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=c):c=e[1];let o;e[2]!==s||e[3]!==r?(o=r?i.jsx(Ie,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==o?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:c,children:o}),e[5]=a,e[6]=n,e[7]=r,e[8]=c,e[9]=o,e[10]=d):d=e[10],d}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=J();let l;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const c=oe(l);let o;e[4]!==s.id||e[5]!==a.id?(o=ne.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=o):o=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Gs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==o||e[10]!==d?(m={queryKey:o,queryFn:d,staleTime:3e4,retry:!1},e[9]=o,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=re(m),g=be(a.slug);let h,p;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],p=[...N];for(const S of h)p.some(k=>k.name===S.name)||p.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=p}else h=e[15],p=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(x&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(p.length===0)return null;let b;e[22]!==n||e[23]!==p?(b=n??p.map(qs),e[22]=n,e[23]=p,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==p||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:p.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:p.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=p,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=t.metadata?.ui?.homePrompts;let d;Array.isArray(o)?d=n?o.filter(u=>u!==s.name):[...o,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle prompt",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Le(s.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Js(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const Z=1,We=`home-board.layout.v${Z}`;function qe(t){return`home-board.layout.v${Z}.${t}`}const Ke={version:Z,tiles:{},hidden:[]};function me(t){return!t||t.version!==Z?Ke:{version:Z,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(qe(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(qe(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${We}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=ne.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const l=a;let c;e[4]!==l||e[5]!==t?(c=async()=>{const b=await fetch(`/api/${t}/kv/${We}`);if(b.status===404)return l&&Zs(l)?(await Se(t,l),l):Ke;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=l,e[5]=t,e[6]=c):c=e[6];let o;e[7]!==l||e[8]!==n||e[9]!==c?(o={queryKey:n,queryFn:c,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=n,e[9]=c,e[10]=o):o=e[10];const{data:d,isLoading:m}=re(o);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=dt(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const g=x;let h;e[18]!==d?(h=me(d),e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==m||e[21]!==g||e[22]!==h?(p={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=p):p=e[23],p}const Ge=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=J(),n=ei(r.slug),[a,l]=A.useState(!1),[c,o]=A.useState(null);let d;e[0]!==n.layout?(d=()=>{o(n.layout),l(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{o(null),l(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),o(null),l(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const g=x,h=a&&c!==null,p=h?c:n.layout;let b;e[6]!==c||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?o(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==p||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:p,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=p,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ge.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ve(){const t=A.useContext(Ge);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=J(),r=oe({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[l,c]=A.useState(null),[o,d]=A.useState(!1),m=A.useRef(!1),u=async(p,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const v=await os(r,p.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:p.name,name:is(p.name,ns(p._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async p=>{if(!m.current){if(p.arguments&&p.arguments.length>0){c(p);return}await u(p)}},x=async p=>{if(!l)return;const b=l;c(null),await u(b,p)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const p=crypto.randomUUID();await n({id:p,virtual_mcp_id:t}),a(p,t)}catch(p){console.error("[start-thread-from-prompt] startBlank failed",p),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ts,{prompt:l,setPrompt:p=>c(p),onSubmit:x}),dialogPrompt:l,starting:o}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(mt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:l,onRemove:c}=t,o=xe(),d=A.useRef(null),[m,u]=A.useState(null),[f,x]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Ae(ie(Oe,g),ie(Me)),p=s.reduce(oi,0),b=r?Math.max(p+2,4):Math.max(p,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),x(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),x(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(o){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,$,E,_,I,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(X=>X.id===m):null;C=Re,B=h,z=j,$=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==l||e[44]!==n||e[45]!==s){let X;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==l||e[51]!==n?(X=te=>i.jsx(ci,{tile:te,isEditMode:r,isDragging:m===te.id,onResize:l,onRemove:c,children:n(te)},te.id),e[47]=m,e[48]=r,e[49]=c,e[50]=l,e[51]=n,e[52]=X):X=e[52],U=s.map(X),e[40]=m,e[41]=r,e[42]=c,e[43]=l,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?(I={width:G,height:le},e[57]=G,e[58]=le,e[59]=I):I=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=l,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=$,e[27]=E,e[28]=_,e[29]=I,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],$=e[26],E=e[27],_=e[28],I=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==I||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:I,children:O}),e[60]=k,e[61]=_,e[62]=I,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==$||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:$,children:[E,P]}),e[65]=C,e[66]=$,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(o,d)=>r.some(m=>o>=m.x&&o<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let l;if(e[2]!==a||e[3]!==s){l=[];for(let o=0;o<s;o++)for(let d=0;d<K;d++)a(d,o)||l.push({x:d,y:o});e[2]=a,e[3]=s,e[4]=l}else l=e[4];let c;return e[5]!==l?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(ai)}),e[5]=l,e[6]=c):c=e[6],c}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:l,children:c}=t,o=!r;let d;e[0]!==o||e[1]!==s.id?(d={id:s.id,disabled:o},e[0]=o,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Lt(d),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,p=s.y*V,b=s.h*V,v=x||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==p||e[9]!==h?(N={left:g,top:p,width:h,height:b},e[6]=b,e[7]=g,e[8]=p,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(He,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=a,e[18]=s,e[19]=C):C=e[19];let $;e[20]!==c?($=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:c})}),e[20]=c,e[21]=$):$=e[21];let E;e[22]!==$||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,$]}),e[22]=$,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,l]=A.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(cs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(St,{size:16})})}),e[0]=c):c=e[0];let o;e[1]!==r||e[2]!==s.id?(o=p=>{r(s.id,p),l(!1)},e[1]=r,e[2]=s.id,e[3]=o):o=e[3];let d;e[4]!==o||e[5]!==s?(d=i.jsx(mi,{tile:s,onPick:o}),e[4]=o,e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let x;e[12]!==u?(x=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=x):x=e[13];let g;e[14]!==d||e[15]!==x?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[d,m,x]}),e[14]=d,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:l,children:[c,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[l,c]=A.useState(null);let o;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(o=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==d.h||e[6]!==d.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[d.w," × ",d.h]})]}),e[5]=d.h,e[6]=d.w,e[7]=u):u=e[7];let f,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},x=()=>c(null),e[8]=f,e[9]=x):(f=e[8],x=e[9]);let g;e[10]!==d.h||e[11]!==d.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:x,children:Array.from({length:ii},(p,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=d.w&&j<=d.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>c({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=d.h,e[11]=d.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let l=0;l<s&&a;l++)for(let c=0;c<e&&a;c++)ui(t,n+c,r+l)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(o=>o.id===e);if(!r)return t;const n=t.filter(o=>o.id!==e),a=n.find(o=>s.x>=o.x&&s.x<o.x+o.w&&s.y>=o.y&&s.y<o.y+o.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(o=>o.id===e?{...o,x:a.x,y:a.y}:o.id===a.id?{...o,x:r.x,y:r.y}:o);const c=[{...r,x:s.x,y:s.y}];for(const o of n){const d=fe(c,o.w,o.h);c.push({...o,x:d.x,y:d.y})}return c}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ve();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const l=a;let c,o;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){o=[];let v;e[7]!==l?(v=y=>y.pinned||!l.has(y.id),e[7]=l,e[8]=v):v=e[8];const w=t.filter(v);c=new Map;for(const y of t)y.minSize&&c.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:$}=ce(j.x,j.y,S);o.push({id:y.id,x:C,y:$,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(o.some($=>$.id===y.id))continue;const j=y.defaultSize??ni,N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(o,S,k);o.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=c,e[6]=o}else c=e[5],o=e[6];let d;e[9]!==t?(d=new Set(t.map(pi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:Z,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==o?(x={visible:o},e[14]=o,e[15]=x):x=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==o?(g=(v,w)=>{const y=o.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(o,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=o,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==o?(h=(v,w)=>{const y=o.find(E=>E.id===v);if(!y)return;const j=c.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=o.filter(E=>E.id!==v),$=[k];for(const E of C){const _=fe($,E.w,E.h);$.push({...E,x:_.x,y:_.y})}f($,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=o,e[24]=h):h=e[24];let p;e[25]!==f||e[26]!==s||e[27]!==o?(p=v=>{const w=o.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=o,e[28]=p):p=e[28];let b;return e[29]!==r||e[30]!==x||e[31]!==g||e[32]!==h||e[33]!==p?(b={snapshot:x,isLoading:r,moveTile:g,resizeTile:h,hideTile:p},e[29]=r,e[30]=x,e[31]=g,e[32]=h,e[33]=p,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:l}=si(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const o=c;let d;return e[5]!==a||e[6]!==o||e[7]!==n||e[8]!==l?(d={open:o,startBlank:n,dialog:a,starting:l},e[5]=a,e[6]=o,e[7]=n,e[8]=l,e[9]=d):d=e[9],d}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:l}=ye(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const o=l||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let p;e[14]!==h?(p=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=p):p=e[15];let b;e[16]!==p||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,p]}),e[16]=p,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=v):v=e[20];let w;e[21]!==l||e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==o||e[26]!==f||e[27]!==x?(w=i.jsxs("button",{type:"button",onClick:c,disabled:o,"aria-busy":l,className:f,children:[x,b,v]}),e[21]=l,e[22]=c,e[23]=b,e[24]=v,e[25]=o,e[26]=f,e[27]=x,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:l}=J(),{open:c,startBlank:o,dialog:d,starting:m}=ye(s.agentId);let u,f,x,g,h;if(e[0]!==n||e[1]!==c||e[2]!==l.id||e[3]!==l.slug||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==o?(w=()=>{o()},e[14]=o,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let $;e[23]!==C?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=$):$=e[24];let E;e[25]!==k||e[26]!==$?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,$]}),e[25]=k,e[26]=$,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx($i,{}),e[35]=_):_=e[35],e[36]!==l.id||e[37]!==l.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[36]=l.id,e[37]=l.slug,e[38]=s,e[39]=f):f=e[39],x=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(I=>i.jsx("button",{type:"button",onClick:()=>c(I),disabled:m,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:I.title})},I.promptName))}),e[0]=n,e[1]=c,e[2]=l.id,e[3]=l.slug,e[4]=r,e[5]=o,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=x,e[12]=g,e[13]=h}else u=e[9],f=e[10],x=e[11],g=e[12],h=e[13];let p;e[40]!==u||e[41]!==f||e[42]!==x?(p=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=p):p=e[43];let b;return e[44]!==d||e[45]!==g||e[46]!==h||e[47]!==p?(b=i.jsxs("div",{className:g,children:[h,p,d]}),e[44]=d,e[45]=g,e[46]=h,e[47]=p,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const l=oe(a),c=s.minHeight??200,o=s.maxHeight??4e3;let d;return e[4]!==l||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==o||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(Zt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:l,displayMode:"fullscreen",minHeight:c,maxHeight:o,className:"h-full"}),e[4]=l,e[5]=r,e[6]=n,e[7]=c,e[8]=o,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ii(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let c;e[6]!==a?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,l]}),e[6]=a,e[7]=c):c=e[7];let o;e[8]!==n||e[9]!==c?(o=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=o):o=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==o?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[o,d]}),e[12]=o,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:l,dialog:c,starting:o}=ye(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==o||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Ai);d="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==l?(g=()=>{l()},e[10]=l,e[11]=g):g=e[11];const h=o||n,p=n&&"pl-10 pr-10";let b;e[12]!==p?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",p),e[12]=p,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:o,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=J(),{isLoading:n,prompts:a,tiles:l}=be(r.slug),c=ze()?.ids??[];let o;e[0]!==c?(o=new Set(c),e[0]=c,e[1]=o):o=e[1];const d=o,m=Pe();let u;e[2]!==l?(u=new Set(l.map(Pi)),e[2]=l,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==a){x=new Map;for(const _ of a){const I=x.get(_.agentId);I?I.push(_):x.set(_.agentId,[_])}e[4]=a,e[5]=x}else x=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==l){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const I=a.filter(_);g=[...l.map(zi),...I.map(Ri)],e[6]=a,e[7]=f,e[8]=l,e[9]=g}else g=e[9];const h=g;let p;e[12]!==h?(p=new Map(h.map(Oi)),e[12]=h,e[13]=p):p=e[13];const b=p;let v;e[14]!==h||e[15]!==d?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:d.has(_.data.agentId)})),e[14]=h,e[15]=d,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply(I=>I.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==d||e[22]!==j?(N=_=>{const I=b.get(_);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==x?(k=_=>{const I=b.get(_.id);if(!I)return null;if(I.kind==="tile"){const O=x.get(I.data.agentId)??[];return i.jsx(ut,{fallback:i.jsx(Ti,{tile:I.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx(Ii,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ci,{tile:I.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:I.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=x,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ft.useSession(),{org:s}=J(),r=xe(),n=$t(),{selectedVirtualMcp:a}=It();let l;t[0]!==s.id?(l=pt(s.id),t[0]=s.id,t[1]=l):l=t[1];const o=a??l;let d;t[2]!==s.slug?(d=Ft(s.slug),t[2]=s.slug,t[3]=d):d=t[3],re(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:xt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=oe(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let g;t[13]!==o.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,o.id,u),t[13]=o.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==x||t[19]!==g?(h={queries:[f,x,g]},t[17]=f,t[18]=x,t[19]=g,t[20]=h):h=t[20],js(h);const p=xs(),b=vt(o.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(p.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}let $;t[22]!==e?.user?.name?($=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=$):$=t[23];const E=$,_=v&&y&&j!=null,I=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==I?(O=_?i.jsx(se.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(se.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=I,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let l;e[3]!==r?(l=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let c;e[5]!==a||e[6]!==l?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(se.Input,{showConnectionsBanner:!0})}),e[8]=o):o=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,o,d]}),e[10]=c,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:l,save:c,cancel:o,hasChanges:d}=Ve(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==c?(x=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:d,onEnter:l,onSave:c,onCancel:o,onAddTile:f})}),e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=c,e[6]=x):x=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const p=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==p?(b=q("relative flex flex-col items-center px-10 pb-4",p),e[10]=p,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(se.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==x||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[x,g,k]}),e[28]=k,e[29]=x,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:l,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Te,{size:14}),e[3]=f):f=e[3];let x;e[4]!==l?(x=i.jsxs(je,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=x):x=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let p;e[7]!==a||e[8]!==g?(p=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=p):p=e[9];let b;return e[10]!==u||e[11]!==x||e[12]!==p?(b=i.jsxs(i.Fragment,{children:[u,x,p]}),e[10]=u,e[11]=x,e[12]=p,e[13]=b):b=e[13],b}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_t,{size:14}),e[14]=o):o=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[o,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{av as g,dE as d,dF as v}from"./index-DHxOddsj.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:u,isError:c,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",f=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
|