decocms 4.31.1 → 4.32.0
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-BUU3NjXR.js → AlertCircle-Db_5w_pO.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CrcBlCWJ.js → ArrowUpRight-B2VxdxbH.js} +1 -1
- package/dist/client/assets/{Check-CFtVdzS5.js → Check-VVh423TU.js} +1 -1
- package/dist/client/assets/{CheckCircle-IO-B2gUA.js → CheckCircle-auAoHYRc.js} +1 -1
- package/dist/client/assets/{ChevronDown-ChePT051.js → ChevronDown-mDFyCzyV.js} +1 -1
- package/dist/client/assets/{ChevronRight-BQty91sJ.js → ChevronRight-Ceh-WF7H.js} +1 -1
- package/dist/client/assets/{ChevronUp-BgocMkpt.js → ChevronUp-D03XJ0vS.js} +1 -1
- package/dist/client/assets/{Circle-DmasUYiA.js → Circle-DNMct17O.js} +1 -1
- package/dist/client/assets/{Copy01-u9FKB5rw.js → Copy01-CuSfBG1R.js} +1 -1
- package/dist/client/assets/{DotsVertical-B1hMTL7B.js → DotsVertical-Cr4sUrn_.js} +1 -1
- package/dist/client/assets/{Eye-BxKKdsHf.js → Eye-aR-oC6dj.js} +1 -1
- package/dist/client/assets/{FilterLines-CUnsJiex.js → FilterLines-Cr2IL8ug.js} +1 -1
- package/dist/client/assets/{Globe01-B3aht_cF.js → Globe01-DkdmhUM8.js} +1 -1
- package/dist/client/assets/{Globe04-DcPELS8T.js → Globe04-TuZvt3ov.js} +1 -1
- package/dist/client/assets/{HardDrive-C9XlwGOT.js → HardDrive-CrxPr3va.js} +1 -1
- package/dist/client/assets/{Key01-D2RWjQ2a.js → Key01-CfvrTjDF.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Dkd8UOnM.js → LayoutLeft-Cog6SqwZ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DrtX8tOp.js → LinkExternal01-BYpL3ACE.js} +1 -1
- package/dist/client/assets/{List-BMEYlI0J.js → List-D5svP-6k.js} +1 -1
- package/dist/client/assets/{Loading02-DEVERrXB.js → Loading02-D2Hh17zb.js} +1 -1
- package/dist/client/assets/{Monitor01-Df3tXZlk.js → Monitor01-cNkbuWdj.js} +1 -1
- package/dist/client/assets/{Palette-DC6ufhM5.js → Palette-Dz_ldMx7.js} +1 -1
- package/dist/client/assets/{Play-Z2pkSQAh.js → Play-CVarwVeR.js} +1 -1
- package/dist/client/assets/{Plus-CUV2RWYL.js → Plus-DNCXili3.js} +1 -1
- package/dist/client/assets/{SearchLg-CQwb9kkL.js → SearchLg-DvsDitCO.js} +1 -1
- package/dist/client/assets/{SearchMd-CXgy8A_w.js → SearchMd-87dvi4KF.js} +1 -1
- package/dist/client/assets/{Settings02-B8QXkOks.js → Settings02-D7asukv0.js} +1 -1
- package/dist/client/assets/{Shield01-DGSPyrTF.js → Shield01-BT2HQXan.js} +1 -1
- package/dist/client/assets/{Star01-BD9oKUBZ.js → Star01-B90wIaBV.js} +1 -1
- package/dist/client/assets/{Stars01-BgPEomHY.js → Stars01-D1lDEQh2.js} +1 -1
- package/dist/client/assets/{Stars02-BLbSaBjT.js → Stars02-LnA0-zz4.js} +1 -1
- package/dist/client/assets/{Sun-C0N2xKS2.js → Sun-DLqplG3r.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B2kf3_j6.js → SwitchHorizontal01-C9ua90Hw.js} +1 -1
- package/dist/client/assets/{Tool01-DsbaAXps.js → Tool01-dGPltLKJ.js} +1 -1
- package/dist/client/assets/{Trash01-fQ2HT4he.js → Trash01-BJe3gUZc.js} +1 -1
- package/dist/client/assets/{Upload01-Dni07u2x.js → Upload01-DIYVb8n9.js} +1 -1
- package/dist/client/assets/{User01-BPjZKl04.js → User01-DcNAHFa-.js} +1 -1
- package/dist/client/assets/{Users01-BpBlXa0A.js → Users01-q9IKnEsX.js} +1 -1
- package/dist/client/assets/{Users03-DdQQIEyW.js → Users03-BMw5o14D.js} +1 -1
- package/dist/client/assets/{X-qmyBqDy5.js → X-CYIGv8wX.js} +1 -1
- package/dist/client/assets/{XCircle-C8HSY-30.js → XCircle-29rFa-09.js} +1 -1
- package/dist/client/assets/{XClose-Dw1PtgmP.js → XClose-DT64mUwh.js} +1 -1
- package/dist/client/assets/{Zap-D0DCUM9B.js → Zap-Br_Hg1wB.js} +1 -1
- package/dist/client/assets/{ZapSquare-DNICYpKN.js → ZapSquare-0BsdXZY9.js} +1 -1
- package/dist/client/assets/{ZoomOut-ta-f5OLo.js → ZoomOut-Dqj1q_yU.js} +1 -1
- package/dist/client/assets/{access-gate-DFAnOjnF.js → access-gate-033kBvzX.js} +1 -1
- package/dist/client/assets/{add-section-modal-BDVoUqhB.js → add-section-modal-DRg-YhLT.js} +1 -1
- package/dist/client/assets/{agent-capabilities-tJSDy4st.js → agent-capabilities-CRvnIg9m.js} +1 -1
- package/dist/client/assets/{agent-icon-O5iF9kv6.js → agent-icon-EdtPDJXM.js} +1 -1
- package/dist/client/assets/{agents-list-CVwvGniX.js → agents-list-COIOrWTd.js} +1 -1
- package/dist/client/assets/{ai-providers-DiuJ6tGF.js → ai-providers--C84J8bO.js} +1 -1
- package/dist/client/assets/{alert-nJsCJ-tW.js → alert-BG1upMQ5.js} +1 -1
- package/dist/client/assets/{alert-dialog-DhDoheqT.js → alert-dialog-BbHr6pLd.js} +1 -1
- package/dist/client/assets/app-editor-DFt6eACm.js +1 -0
- package/dist/client/assets/{auth-bk37GVIj.js → auth-BEQgA40y.js} +1 -1
- package/dist/client/assets/{auth-catchall-thG7XZG_.js → auth-catchall-CfZrCH1R.js} +1 -1
- package/dist/client/assets/{auth-entry-D6tJoXRU.js → auth-entry-Cr25LD_X.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DowfzhS-.js → auth-split-layout-DSPfwaoV.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Ch9zHPtL.js → authenticate-and-persist-oauth-nkmQY5vG.js} +1 -1
- package/dist/client/assets/{automation-list-row-BpjtFwhr.js → automation-list-row-xAynmOqb.js} +1 -1
- package/dist/client/assets/{automation-runs-qL_FRZ6c.js → automation-runs-D98OdVC5.js} +1 -1
- package/dist/client/assets/{automations-C4FWutVo.js → automations-DVf2_2C_.js} +1 -1
- package/dist/client/assets/{autosend-4RjZHAxY.js → autosend-REHFoRRR.js} +1 -1
- package/dist/client/assets/{avatar-DzCyZoOu.js → avatar-B2d04wRu.js} +1 -1
- package/dist/client/assets/{badge-DRcHWKtK.js → badge-DiKw8RbW.js} +1 -1
- package/dist/client/assets/{block-document-BnWtPdQV.js → block-document-CPFtVEpa.js} +1 -1
- package/dist/client/assets/{brand-context-CJUBISXL.js → brand-context-DHN-dSvf.js} +1 -1
- package/dist/client/assets/{breadcrumb-DKe1-dnc.js → breadcrumb-CC9Gfd5p.js} +1 -1
- package/dist/client/assets/{buckets-CLMTxVzD.js → buckets-CKM582z_.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BtXPbq1x.js → bulk-category-panel-B4j7bMVg.js} +1 -1
- package/dist/client/assets/{calendar-COq53OPk.js → calendar-Dh7ySVQi.js} +1 -1
- package/dist/client/assets/{capability-load-error-zNz8pca9.js → capability-load-error-Dg3eOVDS.js} +1 -1
- package/dist/client/assets/{card-D4sSe7pw.js → card-D5CauofV.js} +1 -1
- package/dist/client/assets/category-editor-SUwhv1rI.js +1 -0
- package/dist/client/assets/{chat-context-Df8VsXKt.js → chat-context-BsRUICZs.js} +1 -1
- package/dist/client/assets/{checkbox-CbS18Pl-.js → checkbox-DhHH_mmR.js} +1 -1
- package/dist/client/assets/{cli-auth-success-KBeKOTi6.js → cli-auth-success-NNi-TvQO.js} +1 -1
- package/dist/client/assets/collection-detail-L5hLAtjn.js +1 -0
- package/dist/client/assets/{collection-display-button-Caogovjg.js → collection-display-button-D5THp447.js} +1 -1
- package/dist/client/assets/{collection-search-CvR0edbX.js → collection-search-BgFXdSC0.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BI6nGSgY.js → collection-table-wrapper-328T8nSg.js} +1 -1
- package/dist/client/assets/{collection-tabs-DBC0UI8k.js → collection-tabs-Cxl16cFM.js} +1 -1
- package/dist/client/assets/{command-DJFScz8d.js → command-Cx8bKs7m.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BbqP5wij.js → commerce-onboarding-DmVh_p0A.js} +1 -1
- package/dist/client/assets/config-ByOdiANb.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-CNlFMBe_.js → connect-desktop-dialog-BWEylyh-.js} +1 -1
- package/dist/client/assets/{connection-card-Dk3Yn25D.js → connection-card-CmLZ3i0M.js} +1 -1
- package/dist/client/assets/{connection-detail-Cj1lsQRh.js → connection-detail-tk24zTUu.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-qln4KCoc.js → connection-form-helpers-C1s-KSGU.js} +1 -1
- package/dist/client/assets/{connections-LL5X_kcS.js → connections-qp5myPzL.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DkWnTrGm.js → decopilot-sse-pool-CiyJzTNT.js} +1 -1
- package/dist/client/assets/{dialog-ePMaAFHW.js → dialog-BFPr54WG.js} +1 -1
- package/dist/client/assets/{domain-settings-I_D5BlVD.js → domain-settings-DHynySRj.js} +1 -1
- package/dist/client/assets/{drawer-3sebaOA4.js → drawer-DcfPm_vi.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CG9vxOUx.js → dropdown-menu-BlfYJTRx.js} +1 -1
- package/dist/client/assets/{empty-state-3VTKkuAb.js → empty-state-CeXPb2VU.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DquYMvXA.js → extract-connection-data-5BWVDciX.js} +1 -1
- package/dist/client/assets/file-explorer-CwWWlUiZ.js +2 -0
- package/dist/client/assets/{file-type-icon-CC-9ymE7.js → file-type-icon-D2xX1xnm.js} +1 -1
- package/dist/client/assets/{files-5Sm-7yRT.js → files-Bzd-uxW7.js} +1 -1
- package/dist/client/assets/{form-aZBAoZuM.js → form-Trt6kqr0.js} +1 -1
- package/dist/client/assets/{general-C-9rO6o9.js → general-C_FzX3UD.js} +1 -1
- package/dist/client/assets/github-repo-picker-CTMAbHxR.js +1 -0
- package/dist/client/assets/{hooks-BaBBRCZd.js → hooks-BSiz_AKB.js} +1 -1
- package/dist/client/assets/{index-DXDgyX4y.js → index-35Tak7qk.js} +1 -1
- package/dist/client/assets/{index-CFYzPlXz.js → index-BMxNGICG.js} +1 -1
- package/dist/client/assets/{index-yEVJ3fdV.js → index-C8Vaq4GI.js} +1 -1
- package/dist/client/assets/{index-DlvaCTnY.js → index-CLj_5r89.js} +18 -18
- package/dist/client/assets/{index-c-r_RAhR.js → index-CPelPFhM.js} +1 -1
- package/dist/client/assets/{index-Dh1gUIVU.js → index-CfigvylE.js} +1 -1
- package/dist/client/assets/{index-MMaR_LN0.js → index-CqLJnBFj.js} +1 -1
- package/dist/client/assets/{index-BV-Vckp5.js → index-CsAnNpRc.js} +1 -1
- package/dist/client/assets/index-Cwk7SIrW.js +1 -0
- package/dist/client/assets/{index-BW3_pVZp.js → index-DtEv5T2k.js} +1 -1
- package/dist/client/assets/{index-CZFDfHka.js → index-GJfKnZn_.js} +1 -1
- package/dist/client/assets/index-dPmP2Tp4.css +1 -0
- package/dist/client/assets/index-g8i--Kvx.js +1 -0
- package/dist/client/assets/index-gz1tAOXr.js +519 -0
- package/dist/client/assets/{index-redirect-DSdqIt3U.js → index-redirect-DDeVol4f.js} +1 -1
- package/dist/client/assets/{index-Ci7pkPTZ.js → index-uAuiYVKB.js} +1 -1
- package/dist/client/assets/{input-VCGuYeNm.js → input-BdpM0TEL.js} +1 -1
- package/dist/client/assets/{integration-icon-l0eIBg8D.js → integration-icon-Bf1Nt7-n.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-Bz_bLfOK.js → invite-member-dialog-BPpBeslC.js} +1 -1
- package/dist/client/assets/{label-Brp6Tj12.js → label-DjarSga4.js} +1 -1
- package/dist/client/assets/{login-CkpXilVC.js → login-DoEfLmln.js} +1 -1
- package/dist/client/assets/{mcp-oauth-h0hme0wb.js → mcp-oauth-DWePFULn.js} +1 -1
- package/dist/client/assets/{members-x3GpwjuJ.js → members-B3B7IloN.js} +1 -1
- package/dist/client/assets/{monaco-editor-v6qGp2oa.js → monaco-editor-D4hwKq5W.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BwifK3av.js → monitoring-stats-row-B7f4HN3G.js} +1 -1
- package/dist/client/assets/{oauth-callback-ngsHLxhx.js → oauth-callback-BoH2P_bn.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-hl5AhVW3.js → oauth-callback-ai-provider-CuMMS3lP.js} +1 -1
- package/dist/client/assets/{onboarding-9scIwXIO.js → onboarding-wUH-DGeU.js} +1 -1
- package/dist/client/assets/{org-install-CKJpxtUc.js → org-install-DXT9J0I8.js} +1 -1
- package/dist/client/assets/{org-layout-DOW3VRzD.js → org-layout-BrLrP4eq.js} +1 -1
- package/dist/client/assets/{organization-choice-BnhkcguU.js → organization-choice-C6lztIt3.js} +1 -1
- package/dist/client/assets/{page-seo-form-BazixXyS.js → page-seo-form-DQA0wg3R.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DurRfIZb.js +1 -0
- package/dist/client/assets/{popover-BbzwXOdH.js → popover-CKlhZKOG.js} +1 -1
- package/dist/client/assets/post-editor--rN0Vw5m.js +1 -0
- package/dist/client/assets/{primitives-9PYIGbkM.js → primitives-CAgzIvjA.js} +1 -1
- package/dist/client/assets/{profile-oxAw2Xq3.js → profile-CY7AQM7b.js} +1 -1
- package/dist/client/assets/project-app-view-CHytmdja.js +1 -0
- package/dist/client/assets/record-editor-CNuCZ1ZI.js +1 -0
- package/dist/client/assets/registry-BZBmEaE-.js +2 -0
- package/dist/client/assets/{registry-layout-D1j1Rku6.js → registry-layout-D25VdidL.js} +1 -1
- package/dist/client/assets/{require-capability-BECv9WxB.js → require-capability-CYDVRBkW.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BH7KEtF6.js → required-auth-layout-DGQr874S.js} +1 -1
- package/dist/client/assets/{reset-password-HzDhmJ_n.js → reset-password-Ci3XAz4n.js} +1 -1
- package/dist/client/assets/{roles-De0jni6b.js → roles-oTvdi6Hw.js} +1 -1
- package/dist/client/assets/{search-input-CG7twucQ.js → search-input-DJ05ViVl.js} +1 -1
- package/dist/client/assets/{secrets-B3Nlfb2y.js → secrets-HOer9kv3.js} +1 -1
- package/dist/client/assets/{sections-editor-C7s6dU2D.js → sections-editor-5ju1cxyx.js} +2 -2
- package/dist/client/assets/{select-XaD0utC1.js → select-CeXH3gjW.js} +1 -1
- package/dist/client/assets/{select-model-DZW2PTsR.js → select-model-DYpThBVD.js} +1 -1
- package/dist/client/assets/seo-editor-BIKFI9Fl.js +1 -0
- package/dist/client/assets/{settings-layout-D2oNI4oU.js → settings-layout-kdDgoGQC.js} +1 -1
- package/dist/client/assets/{settings-section-D0q0mPyR.js → settings-section-CyBwf4qC.js} +1 -1
- package/dist/client/assets/{shell-controls-DLUt_wsv.js → shell-controls-CD6bdY9w.js} +1 -1
- package/dist/client/assets/{shell-layout-3sU0F915.js → shell-layout-IYwmwgpp.js} +1 -1
- package/dist/client/assets/{sidebar-D7jmt9fv.js → sidebar-B_c4VYke.js} +1 -1
- package/dist/client/assets/{skeleton-CFt1eDrG.js → skeleton-Dl1AhqdL.js} +1 -1
- package/dist/client/assets/{sso-DJcw5X6e.js → sso-1rsjb8hb.js} +1 -1
- package/dist/client/assets/{store-BLFDD4g4.js → store-BHrgdJmn.js} +1 -1
- package/dist/client/assets/store-registry-B0GhK-Yr.js +2 -0
- package/dist/client/assets/{studio-tools-DDIjP03d.js → studio-tools-F5G0urN7.js} +1 -1
- package/dist/client/assets/{switch-0OiqIuhe.js → switch-B9wSH4oe.js} +1 -1
- package/dist/client/assets/{table-DbMaiE4E.js → table-C2Aqsz0m.js} +1 -1
- package/dist/client/assets/{tabs-DptfuquN.js → tabs-W14caGou.js} +1 -1
- package/dist/client/assets/{textarea-DSOO-B2l.js → textarea-ConjZ7fN.js} +1 -1
- package/dist/client/assets/{toggle-group-BwpyaIqb.js → toggle-group-CYFywiUW.js} +1 -1
- package/dist/client/assets/{toolbar-DrcyGVUN.js → toolbar-DR2I0_KA.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CGGe07uu.js → toolbar-icon-button-Cf6OwFTU.js} +1 -1
- package/dist/client/assets/{tools-list-C0Z8AAtz.js → tools-list-DL49NRaT.js} +1 -1
- package/dist/client/assets/{tooltip-CeON1mCu.js → tooltip-C51X6QKO.js} +1 -1
- package/dist/client/assets/{types-H5wyK8v3.js → types-C0d4Ohpx.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CrSb-eqz.js → use-ai-providers-BqQDQsEQ.js} +1 -1
- package/dist/client/assets/{use-automations-CaSY4FkI.js → use-automations-tqGwPES0.js} +1 -1
- package/dist/client/assets/{use-capability-DhYr6408.js → use-capability-CqEMs0z_.js} +1 -1
- package/dist/client/assets/{use-clock-tick-bJFnUrDz.js → use-clock-tick-Bz8Z9860.js} +1 -1
- package/dist/client/assets/{use-collections-Dppien-7.js → use-collections-Y12o4qWE.js} +1 -1
- package/dist/client/assets/{use-connection-ChCtc0dq.js → use-connection-D5Vs5qOp.js} +1 -1
- package/dist/client/assets/{use-copy-CWr7IA-i.js → use-copy-Dc9VZjfD.js} +1 -1
- package/dist/client/assets/use-create-virtual-mcp-fbAeF2Sf.js +1 -0
- package/dist/client/assets/{use-debounced-autosave-CjhQmCIT.js → use-debounced-autosave-BPwP00mx.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BCKrw3rK.js → use-debounced-value-DfUpwXh9.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-_Vv0E2CW.js → use-decopilot-events-C70DCxcq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DP5so2ZD.js → use-delete-connection-BBFdYZGQ.js} +1 -1
- package/dist/client/assets/{use-file-configs-DAt3voVO.js → use-file-configs-DGZxsbJi.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DhC3RCtl.js → use-infinite-scroll-BU44dmI-.js} +1 -1
- package/dist/client/assets/{use-join-requests-CC6aZ-BG.js → use-join-requests-DyX59dkl.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CwZuTwIh.js → use-mcp-client-3hG4jk-y.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C_egCHIK.js → use-mcp-prompts-K_jp9fAb.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DR2wl-kg.js → use-mcp-tools-DkI8MzuJ.js} +1 -1
- package/dist/client/assets/{use-members-sKD8ZcQ0.js → use-members-CcCdz_hQ.js} +1 -1
- package/dist/client/assets/{use-mobile-DYwlg5rv.js → use-mobile-BJ6No951.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-CZiiGkPG.js +1 -0
- package/dist/client/assets/{use-org-auth-client-CdjRE4bd.js → use-org-auth-client-B7yAA88H.js} +1 -1
- package/dist/client/assets/{use-org-sso-23qcZ-TM.js → use-org-sso-DcXTIOxB.js} +1 -1
- package/dist/client/assets/{use-organization-roles-zxYeeAXh.js → use-organization-roles-C6Eyg5qk.js} +1 -1
- package/dist/client/assets/{use-organization-settings-fcvOeyjq.js → use-organization-settings-BzhOQtxD.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CsRHS3pv.js → use-registry-connections-DnT_Dh3O.js} +1 -1
- package/dist/client/assets/{use-secrets-C7cfGc6s.js → use-secrets-BBj5PT7D.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BJxqakhM.js → use-status-sounds-B0huGKlG.js} +1 -1
- package/dist/client/assets/{use-view-mode-CjfFjk_d.js → use-view-mode-BL1OAyYV.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C7uc6Bcn.js → use-virtual-mcp-D3UxifiP.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-8DjDwhQn.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BYjapKbe.js +1 -0
- package/dist/client/assets/{variant-calendar-BwMydqIV.js → variant-calendar-Dx_VP5De.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Bnbj98tn.js → view-mode-toggle-DFM8ec78.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-BuX2eXY5.js +0 -1
- package/dist/client/assets/category-editor-ClqLRuPx.js +0 -1
- package/dist/client/assets/collection-detail-DEI2A58e.js +0 -1
- package/dist/client/assets/file-explorer-BFQtRdLG.js +0 -2
- package/dist/client/assets/github-repo-picker-D49GYlXV.js +0 -1
- package/dist/client/assets/index-5VOMto8p.js +0 -1
- package/dist/client/assets/index-BHMS93Fr.js +0 -519
- package/dist/client/assets/index-BYSbf1og.css +0 -1
- package/dist/client/assets/index-BaPNY_1f.js +0 -1
- package/dist/client/assets/page-seo-sheet-HXnfLe3V.js +0 -1
- package/dist/client/assets/post-editor-BkWu1Gf_.js +0 -1
- package/dist/client/assets/project-app-view-kwVutPWA.js +0 -1
- package/dist/client/assets/record-editor-DuD_VH1k.js +0 -1
- package/dist/client/assets/registry-BMd9sNzs.js +0 -2
- package/dist/client/assets/seo-editor-B4gk6EGo.js +0 -1
- package/dist/client/assets/store-registry-BS_qvXlt.js +0 -2
- package/dist/client/assets/use-create-virtual-mcp-DJbscOM9.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-BYK9qhRb.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BgiiodB_.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dn5Fxe_Q.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ye,r as w,j as o,l as ge,t as ue,i as Se}from"./index-DlvaCTnY.js";import{i as _e}from"./ChevronRight-BQty91sJ.js";import{A as je}from"./automation-runs-qL_FRZ6c.js";import{A as ke}from"./add-section-modal-BDVoUqhB.js";import{aC as Be,aD as we,aE as Ae,x as Ne,y as Ce,aF as Re,ac as Ee,aG as Ke,as as Fe}from"./index-BHMS93Fr.js";import"./select-XaD0utC1.js";import"./tooltip-CeON1mCu.js";import"./Check-CFtVdzS5.js";import"./ChevronDown-ChePT051.js";import"./ChevronUp-BgocMkpt.js";import"./useInfiniteQuery-BgiiodB_.js";import"./use-infinite-scroll-DhC3RCtl.js";import"./use-connection-ChCtc0dq.js";import"./use-collections-Dppien-7.js";import"./use-mcp-client-CwZuTwIh.js";import"./constants-B72Xmt_K.js";import"./auth-bk37GVIj.js";import"./use-virtual-mcp-C7uc6Bcn.js";import"./card-D4sSe7pw.js";import"./sidebar-D7jmt9fv.js";import"./LayoutLeft-Dkd8UOnM.js";import"./use-mobile-DYwlg5rv.js";import"./X-qmyBqDy5.js";import"./table-DbMaiE4E.js";import"./empty-state-3VTKkuAb.js";import"./use-members-sKD8ZcQ0.js";import"./use-org-auth-client-CdjRE4bd.js";import"./use-clock-tick-bJFnUrDz.js";import"./AlertCircle-BUU3NjXR.js";import"./CheckCircle-IO-B2gUA.js";import"./Circle-DmasUYiA.js";import"./agent-icon-O5iF9kv6.js";import"./Tool01-DsbaAXps.js";import"./SwitchHorizontal01-B2kf3_j6.js";import"./Settings02-B8QXkOks.js";import"./XCircle-C8HSY-30.js";import"./ArrowUpRight-CrcBlCWJ.js";import"./ZapSquare-DNICYpKN.js";import"./Users03-DdQQIEyW.js";import"./Loading02-DEVERrXB.js";import"./Stars02-BLbSaBjT.js";import"./Copy01-u9FKB5rw.js";import"./ZoomOut-ta-f5OLo.js";import"./DotsVertical-B1hMTL7B.js";import"./Globe01-B3aht_cF.js";import"./Eye-BxKKdsHf.js";import"./FilterLines-CUnsJiex.js";import"./Star01-BD9oKUBZ.js";import"./Globe04-DcPELS8T.js";import"./HardDrive-C9XlwGOT.js";import"./Key01-D2RWjQ2a.js";import"./LinkExternal01-DrtX8tOp.js";import"./List-BMEYlI0J.js";import"./Monitor01-Df3tXZlk.js";import"./Sun-C0N2xKS2.js";import"./Palette-DC6ufhM5.js";import"./Play-Z2pkSQAh.js";import"./Plus-CUV2RWYL.js";import"./SearchLg-CQwb9kkL.js";import"./SearchMd-CXgy8A_w.js";import"./Shield01-DGSPyrTF.js";import"./Stars01-BgPEomHY.js";import"./Trash01-fQ2HT4he.js";import"./Upload01-Dni07u2x.js";import"./User01-BPjZKl04.js";import"./Users01-BpBlXa0A.js";import"./XClose-Dw1PtgmP.js";import"./Zap-D0DCUM9B.js";import"./use-automations-CaSY4FkI.js";import"./studio-tools-DDIjP03d.js";import"./useSuspenseInfiniteQuery-Dn5Fxe_Q.js";import"./badge-DRcHWKtK.js";import"./checkbox-CbS18Pl-.js";import"./command-DJFScz8d.js";import"./index-c-r_RAhR.js";import"./dialog-ePMaAFHW.js";import"./popover-BbzwXOdH.js";import"./avatar-DzCyZoOu.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CWr7IA-i.js";import"./file-type-icon-CC-9ymE7.js";import"./tab-id-DznSzCvK.js";import"./monaco-editor-v6qGp2oa.js";import"./index-Dh1gUIVU.js";import"./chat-context-Df8VsXKt.js";import"./autosend-4RjZHAxY.js";import"./hooks-BaBBRCZd.js";import"./decopilot-sse-pool-DkWnTrGm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CrSb-eqz.js";import"./use-decopilot-events-_Vv0E2CW.js";import"./use-organization-settings-fcvOeyjq.js";import"./types-H5wyK8v3.js";import"./shell-layout-3sU0F915.js";import"./alert-dialog-DhDoheqT.js";import"./required-auth-layout-BH7KEtF6.js";import"./use-org-sso-23qcZ-TM.js";import"./integration-icon-l0eIBg8D.js";import"./use-navigate-to-agent-BYK9qhRb.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-C_egCHIK.js";import"./form-aZBAoZuM.js";import"./label-Brp6Tj12.js";import"./input-VCGuYeNm.js";import"./drawer-3sebaOA4.js";import"./collection-search-CvR0edbX.js";import"./tabs-DptfuquN.js";import"./toggle-group-BwpyaIqb.js";import"./agent-capabilities-tJSDy4st.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dk3Yn25D.js";import"./use-registry-connections-CsRHS3pv.js";import"./extract-connection-data-DquYMvXA.js";import"./collection-tabs-DBC0UI8k.js";import"./textarea-DSOO-B2l.js";import"./connection-form-helpers-qln4KCoc.js";import"./authenticate-and-persist-oauth-Ch9zHPtL.js";import"./mcp-oauth-h0hme0wb.js";import"./connect-desktop-dialog-CNlFMBe_.js";import"./select-model-DZW2PTsR.js";import"./skeleton-CFt1eDrG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D0q0mPyR.js";import"./dropdown-menu-CG9vxOUx.js";import"./index-BV-Vckp5.js";import"./toolbar-DrcyGVUN.js";import"./use-debounced-value-BCKrw3rK.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BJxqakhM.js";import"./use-mcp-tools-DR2wl-kg.js";import"./use-capability-DhYr6408.js";import"./tools-list-C0Z8AAtz.js";import"./switch-0OiqIuhe.js";import"./use-debounced-autosave-CjhQmCIT.js";import"./index-CFYzPlXz.js";import"./search-input-CG7twucQ.js";import"./github-repo-picker-D49GYlXV.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-C7cfGc6s.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-CGGe07uu.js";import"./calendar-COq53OPk.js";import"./use-file-configs-DAt3voVO.js";import"./automation-list-row-BpjtFwhr.js";function Te(l,e){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function _r(l){const e=ye.c(77),{orgSlug:s,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:m,decofile:c,title:Z,excludeFields:G,schemaPending:ae,previewBaseUrl:ne}=l,H=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let C;e[0]!==G||e[1]!==m||e[2]!==x?(C=we(x,m,G),e[0]=G,e[1]=m,e[2]=x,e[3]=C):C=e[3];const h=C;let R;e[4]!==h?(R=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=R):R=e[5];const J=R;let E;e[6]!==n||e[7]!==i||e[8]!==m||e[9]!==Z?(E=Z??(n?Ae(i,n,m):i),e[6]=n,e[7]=i,e[8]=m,e[9]=Z,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==s||e[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:a},e[11]=a,e[12]=s,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let F;e[15]!==a||e[16]!==s||e[17]!==f?(F={orgSlug:s,virtualMcpId:f,branch:a},e[15]=a,e[16]=s,e[17]=f,e[18]=F):F=e[18];const X=Ce(F);let T;e[19]!==b?(T=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=T):T=e[20];const Y=T,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=[],e[21]=$):$=e[21];const[p,fe]=w.useState($),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let y;e[24]!==ee?(y=ee??{},e[24]=ee,e[25]=y):y=e[25];let z;e[26]!==ie||e[27]!==y?(z={...ie,...y},e[26]=ie,e[27]=y,e[28]=z):z=e[28];const me=z;let L;e[29]!==i||e[30]!==x||e[31]!==b?(L=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=L):L=e[32];const se=L;let V;e[33]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{fe(t)},e[33]=V):V=e[33];const pe=V;let q;e[34]!==c||e[35]!==Q||e[36]!==X?(q=async(t,r)=>{try{const{blockKey:d,data:N}=Te(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=q):q=e[37];const g=q;let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t=>{P.current=t.append,re(!0)},e[38]=I):I=e[38];const ve=I;let U;e[39]!==g?(U=async t=>{const r=P.current;if(r)try{await g(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=g,e[40]=U):U=e[40];const le=U;let D;e[41]!==p||e[42]!==v?(D=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=D):D=e[43];const A=D;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_e,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Re(p,r)),de($e)},title:t,className:ge("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let _;e[48]!==W?(_=o.jsx(Ke,{isPending:W,isError:!1}),e[48]=W,e[49]=_):_=e[49];let j;e[50]!==S||e[51]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,_]}),e[50]=S,e[51]=_,e[52]=j):j=e[52];let k;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==me||e[57]!==te||e[58]!==g||e[59]!==se||e[60]!==J||e[61]!==m||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==H?(k=o.jsx(je,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Fe,{schema:h,value:me,onChange:se,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:g,onRequestAddSection:ve},`${i}:${te}`):H?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=me,e[57]=te,e[58]=g,e[59]=se,e[60]=J,e[61]=m,e[62]=u,e[63]=Y,e[64]=h,e[65]=H,e[66]=k):k=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==m||e[71]!==u?(B=u&&o.jsx(ke,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=m,e[71]=u,e[72]=B):B=e[72];let M;return e[73]!==j||e[74]!==k||e[75]!==B?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,B]}),e[73]=j,e[74]=k,e[75]=B,e[76]=M):M=e[76],M}function $e(l){return l+1}function Pe(l){return l+1}export{_r as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,r as S,l as Q,j as t,B as I,i as V,t as U}from"./index-DlvaCTnY.js";import{i as X}from"./XCircle-C8HSY-30.js";import{aG as Y,a9 as T}from"./agent-icon-O5iF9kv6.js";import{n as Z}from"./LinkExternal01-DrtX8tOp.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DhDoheqT.js";import{I as L}from"./input-VCGuYeNm.js";import{L as G}from"./label-Brp6Tj12.js";import{aH as at,aI as mt,aR as nt,aG as lt,aJ as B,aL as pt,aS as ct}from"./index-BHMS93Fr.js";import{c as dt,B as ut,a as gt}from"./block-document-BnWtPdQV.js";import{u as xt,s as v,E as ft}from"./primitives-9PYIGbkM.js";import{t as ht}from"./ChevronDown-ChePT051.js";import{J as jt,K as yt,I as vt}from"./automation-runs-qL_FRZ6c.js";import"./AlertCircle-BUU3NjXR.js";import"./Tool01-DsbaAXps.js";import"./SwitchHorizontal01-B2kf3_j6.js";import"./Settings02-B8QXkOks.js";import"./ArrowUpRight-CrcBlCWJ.js";import"./ZapSquare-DNICYpKN.js";import"./Users03-DdQQIEyW.js";import"./Loading02-DEVERrXB.js";import"./CheckCircle-IO-B2gUA.js";import"./Check-CFtVdzS5.js";import"./ChevronRight-BQty91sJ.js";import"./ChevronUp-BgocMkpt.js";import"./Circle-DmasUYiA.js";import"./Stars02-BLbSaBjT.js";import"./Copy01-u9FKB5rw.js";import"./ZoomOut-ta-f5OLo.js";import"./DotsVertical-B1hMTL7B.js";import"./Globe01-B3aht_cF.js";import"./Eye-BxKKdsHf.js";import"./FilterLines-CUnsJiex.js";import"./Star01-BD9oKUBZ.js";import"./Globe04-DcPELS8T.js";import"./HardDrive-C9XlwGOT.js";import"./Key01-D2RWjQ2a.js";import"./LayoutLeft-Dkd8UOnM.js";import"./List-BMEYlI0J.js";import"./Monitor01-Df3tXZlk.js";import"./Sun-C0N2xKS2.js";import"./Palette-DC6ufhM5.js";import"./Play-Z2pkSQAh.js";import"./Plus-CUV2RWYL.js";import"./SearchLg-CQwb9kkL.js";import"./SearchMd-CXgy8A_w.js";import"./Shield01-DGSPyrTF.js";import"./Stars01-BgPEomHY.js";import"./Trash01-fQ2HT4he.js";import"./Upload01-Dni07u2x.js";import"./User01-BPjZKl04.js";import"./Users01-BpBlXa0A.js";import"./XClose-Dw1PtgmP.js";import"./X-qmyBqDy5.js";import"./Zap-D0DCUM9B.js";import"./chat-context-Df8VsXKt.js";import"./autosend-4RjZHAxY.js";import"./hooks-BaBBRCZd.js";import"./use-mcp-client-CwZuTwIh.js";import"./constants-B72Xmt_K.js";import"./auth-bk37GVIj.js";import"./decopilot-sse-pool-DkWnTrGm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-C7uc6Bcn.js";import"./use-collections-Dppien-7.js";import"./use-ai-providers-CrSb-eqz.js";import"./studio-tools-DDIjP03d.js";import"./use-decopilot-events-_Vv0E2CW.js";import"./tab-id-DznSzCvK.js";import"./use-organization-settings-fcvOeyjq.js";import"./tooltip-CeON1mCu.js";import"./dialog-ePMaAFHW.js";import"./drawer-3sebaOA4.js";import"./collection-search-CvR0edbX.js";import"./use-mobile-DYwlg5rv.js";import"./use-mcp-prompts-C_egCHIK.js";import"./shell-layout-3sU0F915.js";import"./avatar-DzCyZoOu.js";import"./required-auth-layout-BH7KEtF6.js";import"./use-org-sso-23qcZ-TM.js";import"./form-aZBAoZuM.js";import"./select-XaD0utC1.js";import"./tabs-DptfuquN.js";import"./toggle-group-BwpyaIqb.js";import"./agent-capabilities-tJSDy4st.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dk3Yn25D.js";import"./use-registry-connections-CsRHS3pv.js";import"./use-connection-ChCtc0dq.js";import"./useInfiniteQuery-BgiiodB_.js";import"./use-infinite-scroll-DhC3RCtl.js";import"./extract-connection-data-DquYMvXA.js";import"./card-D4sSe7pw.js";import"./integration-icon-l0eIBg8D.js";import"./collection-tabs-DBC0UI8k.js";import"./badge-DRcHWKtK.js";import"./textarea-DSOO-B2l.js";import"./connection-form-helpers-qln4KCoc.js";import"./authenticate-and-persist-oauth-Ch9zHPtL.js";import"./mcp-oauth-h0hme0wb.js";import"./useSuspenseInfiniteQuery-Dn5Fxe_Q.js";import"./connect-desktop-dialog-CNlFMBe_.js";import"./select-model-DZW2PTsR.js";import"./checkbox-CbS18Pl-.js";import"./skeleton-CFt1eDrG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D0q0mPyR.js";import"./command-DJFScz8d.js";import"./index-c-r_RAhR.js";import"./popover-BbzwXOdH.js";import"./dropdown-menu-CG9vxOUx.js";import"./index-BV-Vckp5.js";import"./file-type-icon-CC-9ymE7.js";import"./toolbar-DrcyGVUN.js";import"./use-debounced-value-BCKrw3rK.js";import"./index-Dh1gUIVU.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BJxqakhM.js";import"./empty-state-3VTKkuAb.js";import"./use-mcp-tools-DR2wl-kg.js";import"./types-H5wyK8v3.js";import"./use-capability-DhYr6408.js";import"./tools-list-C0Z8AAtz.js";import"./switch-0OiqIuhe.js";import"./use-debounced-autosave-CjhQmCIT.js";import"./index-CFYzPlXz.js";import"./sidebar-D7jmt9fv.js";import"./search-input-CG7twucQ.js";import"./github-repo-picker-D49GYlXV.js";import"./use-navigate-to-agent-BYK9qhRb.js";import"./reusable-new-chat-qqWu133U.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-C7cfGc6s.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-sKD8ZcQ0.js";import"./use-org-auth-client-CdjRE4bd.js";import"./toolbar-icon-button-CGGe07uu.js";import"./calendar-COq53OPk.js";import"./use-file-configs-DAt3voVO.js";import"./monaco-editor-v6qGp2oa.js";import"./use-automations-CaSY4FkI.js";import"./automation-list-row-BpjtFwhr.js";import"./table-DbMaiE4E.js";import"./use-clock-tick-bJFnUrDz.js";import"./format-time-Cy7tTmZp.js";import"./use-copy-CWr7IA-i.js";function bt(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function nr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=z.length,H=o=>s("slug",o),J=async(o,w)=>{const W=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:W,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:B(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:B(n,"categories",E)}),c(E),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},M=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:M,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(G,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{nr as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O,j as t,B as F,i as Y,G as Ge,H as te,P as Pe,r as $,Z as re,J as Qe,u as Ye,a7 as K,t as Ze,l as je,e as le,aW as ke}from"./index-DlvaCTnY.js";import{E as Ae}from"./empty-state-3VTKkuAb.js";import{u as Xe,a as Ee}from"./use-collections-Dppien-7.js";import{u as ae}from"./use-mcp-client-CwZuTwIh.js";import{F as se,a as et,b as ce,d as de}from"./form-aZBAoZuM.js";import{I as me}from"./input-VCGuYeNm.js";import{T as ie}from"./textarea-DSOO-B2l.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-yEVJ3fdV.js";import{aq as it,L as rt,am as lt,$ as at,ac as ct,ar as dt,V as be}from"./agent-icon-O5iF9kv6.js";import{g as mt,M as ut,a as Ne}from"./types-H5wyK8v3.js";import{A as xt,a as pt,b as ft}from"./alert-nJsCJ-tW.js";import{a as ve,c as Se,d as ye,S as we,b as ne}from"./select-XaD0utC1.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-CeON1mCu.js";import{i as gt}from"./AlertCircle-BUU3NjXR.js";import{s as jt}from"./Stars02-BLbSaBjT.js";import{a as bt}from"./Copy01-u9FKB5rw.js";import{i as Nt}from"./Play-Z2pkSQAh.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-DKe1-dnc.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-C0Z8AAtz.js";import{a as De,u as Me}from"./use-connection-ChCtc0dq.js";import{a as wt}from"./use-mcp-tools-DR2wl-kg.js";import{M as Ct,c as It}from"./monaco-editor-v6qGp2oa.js";import{I as Te}from"./integration-icon-l0eIBg8D.js";import{g as $t,l as Tt}from"./chat-context-Df8VsXKt.js";import{u as Pt}from"./shell-layout-3sU0F915.js";import{n as kt}from"./XCircle-C8HSY-30.js";import"./constants-B72Xmt_K.js";import"./auth-bk37GVIj.js";import"./label-Brp6Tj12.js";import"./index-CFYzPlXz.js";import"./sidebar-D7jmt9fv.js";import"./LayoutLeft-Dkd8UOnM.js";import"./use-mobile-DYwlg5rv.js";import"./X-qmyBqDy5.js";import"./ZoomOut-ta-f5OLo.js";import"./Key01-D2RWjQ2a.js";import"./extract-connection-data-DquYMvXA.js";import"./use-registry-connections-CsRHS3pv.js";import"./use-organization-settings-fcvOeyjq.js";import"./studio-tools-DDIjP03d.js";import"./Plus-CUV2RWYL.js";import"./index-DXDgyX4y.js";import"./index-BW3_pVZp.js";import"./index-c-r_RAhR.js";import"./popover-BbzwXOdH.js";import"./use-virtual-mcp-C7uc6Bcn.js";import"./Check-CFtVdzS5.js";import"./SearchMd-CXgy8A_w.js";import"./Users03-DdQQIEyW.js";import"./use-create-virtual-mcp-DJbscOM9.js";import"./use-navigate-to-agent-BYK9qhRb.js";import"./hooks-BaBBRCZd.js";import"./decopilot-sse-pool-DkWnTrGm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-qqWu133U.js";import"./Tool01-DsbaAXps.js";import"./SwitchHorizontal01-B2kf3_j6.js";import"./Settings02-B8QXkOks.js";import"./ArrowUpRight-CrcBlCWJ.js";import"./ZapSquare-DNICYpKN.js";import"./Loading02-DEVERrXB.js";import"./CheckCircle-IO-B2gUA.js";import"./ChevronDown-ChePT051.js";import"./ChevronRight-BQty91sJ.js";import"./ChevronUp-BgocMkpt.js";import"./Circle-DmasUYiA.js";import"./DotsVertical-B1hMTL7B.js";import"./Globe01-B3aht_cF.js";import"./Eye-BxKKdsHf.js";import"./FilterLines-CUnsJiex.js";import"./Star01-BD9oKUBZ.js";import"./Globe04-DcPELS8T.js";import"./HardDrive-C9XlwGOT.js";import"./LinkExternal01-DrtX8tOp.js";import"./List-BMEYlI0J.js";import"./Monitor01-Df3tXZlk.js";import"./Sun-C0N2xKS2.js";import"./Palette-DC6ufhM5.js";import"./SearchLg-CQwb9kkL.js";import"./Shield01-DGSPyrTF.js";import"./Stars01-BgPEomHY.js";import"./Trash01-fQ2HT4he.js";import"./Upload01-Dni07u2x.js";import"./User01-BPjZKl04.js";import"./Users01-BpBlXa0A.js";import"./XClose-Dw1PtgmP.js";import"./Zap-D0DCUM9B.js";import"./mcp-oauth-h0hme0wb.js";import"./badge-DRcHWKtK.js";import"./index-Dh1gUIVU.js";import"./autosend-4RjZHAxY.js";import"./use-ai-providers-CrSb-eqz.js";import"./use-decopilot-events-_Vv0E2CW.js";import"./tab-id-DznSzCvK.js";import"./avatar-DzCyZoOu.js";import"./dialog-ePMaAFHW.js";import"./alert-dialog-DhDoheqT.js";import"./required-auth-layout-BH7KEtF6.js";import"./use-org-sso-23qcZ-TM.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Xe(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=$t(),A=Tt(),{setChatOpen:U}=Pt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=$.useState("json"),[ze,Le]=$.useState(!1);E&&!ze&&(Z("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const X=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),We=Math.round(He-a);p(W),g(v),C(h);const Ke=JSON.stringify(W),he=new TextEncoder().encode(Ke).length;y({duration:`${We}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const W=performance.now();y({duration:`${Math.round(W-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:X(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(z,a),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Wt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Kt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Wt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(K,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==L||s[39]!==E?(V=t.jsx(ue,{breadcrumb:L,children:E}),s[38]=L,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{}),s[2]=i):i=s[2],i}function Jn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Jn as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Z,r as u,j as r,i as ie,B as he,dZ as Mt,aL as Dt,aR as se,d_ as Rt,d$ as Pt,e0 as Et,e1 as kt,bK as Tt,e2 as Ot,e3 as qe,aN as At,e4 as Lt,e5 as Ft,e6 as It,e7 as $t,e8 as _t,e9 as zt,ea as Wt,eb as Gt,ec as Kt,l as ae,p as Bt,t as W,K as $e}from"./index-DlvaCTnY.js";import{F as Vt,l as Ut}from"./index-Dh1gUIVU.js";import{i as qt,aC as Qt,aD as Ht,aE as ue,aF as Xt,a9 as _e}from"./agent-icon-O5iF9kv6.js";import{a as Jt}from"./Tool01-DsbaAXps.js";import{s as Yt}from"./XClose-Dw1PtgmP.js";import{A as Zt}from"./automation-runs-qL_FRZ6c.js";import{T as ze,a as We,b as Ge}from"./tooltip-CeON1mCu.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-DhDoheqT.js";import{a as cn}from"./chat-context-Df8VsXKt.js";import{u as dn}from"./shell-layout-3sU0F915.js";import{s as fe,a as Ke,f as un}from"./index-BHMS93Fr.js";import{a as fn,b as mn,c as pn,D as xn,d as hn,e as gn}from"./dialog-ePMaAFHW.js";import{I as Be}from"./input-VCGuYeNm.js";import{t as vn}from"./ChevronDown-ChePT051.js";import{i as yn}from"./ChevronRight-BQty91sJ.js";import{a as Cn}from"./ZoomOut-ta-f5OLo.js";import{E as wn,v as Ve,w as Ce,x as bn,y as jn,z as Nn,A as V,C as me,g as we,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-BV-Vckp5.js";import"./AlertCircle-BUU3NjXR.js";import"./SwitchHorizontal01-B2kf3_j6.js";import"./Settings02-B8QXkOks.js";import"./XCircle-C8HSY-30.js";import"./ArrowUpRight-CrcBlCWJ.js";import"./ZapSquare-DNICYpKN.js";import"./Users03-DdQQIEyW.js";import"./Loading02-DEVERrXB.js";import"./CheckCircle-IO-B2gUA.js";import"./Check-CFtVdzS5.js";import"./ChevronUp-BgocMkpt.js";import"./Circle-DmasUYiA.js";import"./Stars02-BLbSaBjT.js";import"./Copy01-u9FKB5rw.js";import"./DotsVertical-B1hMTL7B.js";import"./Globe01-B3aht_cF.js";import"./Eye-BxKKdsHf.js";import"./FilterLines-CUnsJiex.js";import"./Star01-BD9oKUBZ.js";import"./Globe04-DcPELS8T.js";import"./HardDrive-C9XlwGOT.js";import"./Key01-D2RWjQ2a.js";import"./LayoutLeft-Dkd8UOnM.js";import"./LinkExternal01-DrtX8tOp.js";import"./List-BMEYlI0J.js";import"./Monitor01-Df3tXZlk.js";import"./Sun-C0N2xKS2.js";import"./Palette-DC6ufhM5.js";import"./Play-Z2pkSQAh.js";import"./Plus-CUV2RWYL.js";import"./SearchLg-CQwb9kkL.js";import"./SearchMd-CXgy8A_w.js";import"./Shield01-DGSPyrTF.js";import"./Stars01-BgPEomHY.js";import"./Trash01-fQ2HT4he.js";import"./Upload01-Dni07u2x.js";import"./User01-BPjZKl04.js";import"./Users01-BpBlXa0A.js";import"./X-qmyBqDy5.js";import"./Zap-D0DCUM9B.js";import"./select-XaD0utC1.js";import"./useInfiniteQuery-BgiiodB_.js";import"./use-infinite-scroll-DhC3RCtl.js";import"./use-connection-ChCtc0dq.js";import"./use-collections-Dppien-7.js";import"./use-mcp-client-CwZuTwIh.js";import"./constants-B72Xmt_K.js";import"./auth-bk37GVIj.js";import"./use-virtual-mcp-C7uc6Bcn.js";import"./card-D4sSe7pw.js";import"./sidebar-D7jmt9fv.js";import"./use-mobile-DYwlg5rv.js";import"./table-DbMaiE4E.js";import"./empty-state-3VTKkuAb.js";import"./use-members-sKD8ZcQ0.js";import"./use-org-auth-client-CdjRE4bd.js";import"./use-clock-tick-bJFnUrDz.js";import"./use-automations-CaSY4FkI.js";import"./studio-tools-DDIjP03d.js";import"./useSuspenseInfiniteQuery-Dn5Fxe_Q.js";import"./badge-DRcHWKtK.js";import"./checkbox-CbS18Pl-.js";import"./command-DJFScz8d.js";import"./index-c-r_RAhR.js";import"./popover-BbzwXOdH.js";import"./avatar-DzCyZoOu.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CWr7IA-i.js";import"./file-type-icon-CC-9ymE7.js";import"./tab-id-DznSzCvK.js";import"./monaco-editor-v6qGp2oa.js";import"./delay-CnY5UFtP.js";import"./types-H5wyK8v3.js";import"./hooks-BaBBRCZd.js";import"./decopilot-sse-pool-DkWnTrGm.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-l0eIBg8D.js";import"./use-navigate-to-agent-BYK9qhRb.js";import"./reusable-new-chat-qqWu133U.js";import"./use-mcp-prompts-C_egCHIK.js";import"./form-aZBAoZuM.js";import"./label-Brp6Tj12.js";import"./autosend-4RjZHAxY.js";import"./use-ai-providers-CrSb-eqz.js";import"./use-decopilot-events-_Vv0E2CW.js";import"./use-organization-settings-fcvOeyjq.js";import"./required-auth-layout-BH7KEtF6.js";import"./use-org-sso-23qcZ-TM.js";import"./drawer-3sebaOA4.js";import"./collection-search-CvR0edbX.js";import"./tabs-DptfuquN.js";import"./toggle-group-BwpyaIqb.js";import"./agent-capabilities-tJSDy4st.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dk3Yn25D.js";import"./use-registry-connections-CsRHS3pv.js";import"./extract-connection-data-DquYMvXA.js";import"./collection-tabs-DBC0UI8k.js";import"./textarea-DSOO-B2l.js";import"./connection-form-helpers-qln4KCoc.js";import"./authenticate-and-persist-oauth-Ch9zHPtL.js";import"./mcp-oauth-h0hme0wb.js";import"./connect-desktop-dialog-CNlFMBe_.js";import"./select-model-DZW2PTsR.js";import"./skeleton-CFt1eDrG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D0q0mPyR.js";import"./dropdown-menu-CG9vxOUx.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BJxqakhM.js";import"./toolbar-DrcyGVUN.js";import"./use-mcp-tools-DR2wl-kg.js";import"./use-capability-DhYr6408.js";import"./tools-list-C0Z8AAtz.js";import"./switch-0OiqIuhe.js";import"./use-debounced-autosave-CjhQmCIT.js";import"./index-CFYzPlXz.js";import"./search-input-CG7twucQ.js";import"./github-repo-picker-D49GYlXV.js";import"./use-debounced-value-BCKrw3rK.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-C7cfGc6s.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-CGGe07uu.js";import"./calendar-COq53OPk.js";import"./use-file-configs-DAt3voVO.js";import"./automation-list-row-BpjtFwhr.js";const Pn={"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(i){const e=Z.c(51),{open:s,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=i,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,U]=u.useState(s),C=Pn[a];s!==B&&(U(s),s&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==C.title?($=r.jsx(fn,{children:C.title}),e[7]=C.title,e[8]=$):$=e[8];let T;e[9]!==C.description?(T=r.jsx(mn,{children:C.description}),e[9]=C.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==C.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:C.placeholder,autoFocus:!0,disabled:d})]}),e[18]=C.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let w;e[33]!==C.submit||e[34]!==d?(w=d?r.jsxs(r.Fragment,{children:[r.jsx(ie,{size:14,className:"animate-spin"}),"Saving…"]}):C.submit,e[33]=C.submit,e[34]=d,e[35]=w):w=e[35];let L;e[36]!==k||e[37]!==w?(L=r.jsx(he,{type:"submit",disabled:k,children:w}),e[36]=k,e[37]=w,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==s||e[49]!==S?(z=r.jsx(gn,{open:s,onOpenChange:H,children:S}),e[47]=H,e[48]=s,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:c,modal:m=!0}=i,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:s})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...c}=i,m=Qe(Xe,s),x=F(s),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:se(i.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?i.onPointerDown:se(i.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?i.onPointerMove:se(i.onPointerMove,xe(d)),onPointerCancel:a?i.onPointerCancel:se(i.onPointerCancel,xe(d)),onPointerUp:a?i.onPointerUp:se(i.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=i=>{const{__scopeContextMenu:e,...s}=i,a=F(e);return r.jsx(Et,{...a,...s})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=Qe(Ze,s),m=F(s),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{i.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{i.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Vn="ContextMenuItemIndicator",Un=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(zt,{...c,...a,ref:e})});Un.displayName=Vn;var qn="ContextMenuSeparator",nt=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,c=F(s);return r.jsx(Kt,{...c,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,sr=nt;function ir(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(er,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function ar(i){const e=Z.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function lr(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(i){const e=Z.c(12);let s,a,c,m;e[0]!==i?({className:s,inset:a,variant:m,...c}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=c,e[4]=m):(s=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==s?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ue(i){const e=Z.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let c;e[3]!==s?(c=ae("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(sr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(i){const e=Z.c(45),{node:s,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:U,onDelete:C}=i,I=x===void 0?!1:x,H=s.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(ie,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(Cn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==s.name?(P=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ue,{}),e[25]=k):k=e[25];let w;e[26]!==y?(w=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=w):w=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ue,{}),e[30]=b):b=e[30];let S;e[31]!==U?(S=r.jsx(te,{onSelect:U,children:"Rename"}),e[31]=U,e[32]=S):S=e[32];let z;e[33]!==C?(z=r.jsx(te,{variant:"destructive",onSelect:C,children:"Delete"}),e[33]=C,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==w||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,w,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=w,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(ir,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Ut.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(i,e,s,a){return`/api/${i}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(s)}/${a}`}function ur(i){const e=V(i);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(i){const e=i.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function Ys({orgSlug:i,virtualMcpId:e,branch:s,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[U,C]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,w]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{setChatOpen:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(i,e,s,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(i,e,s)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${i}/${e}/${s}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function st(t){const n=me(t);return U.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){C(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),w(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function it(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:V(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=V(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of Ce(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:V(n),to:V(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:V(t.path),recursive:t.kind==="directory"}),ot(t),it(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:V(t),limit:Ve}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of Ce(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ve,maxDepth:wn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){w(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(i,e,s,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");w(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(i,e,s,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:V(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(i,e,s)});try{const l=await un(i,e,s);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}w(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),U.includes(t)||C(n=>[...n,t]),Oe(t)}function vt(t){C(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),w(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function Ct(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=Ce(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function wt(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=wt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?st(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=we(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_(!0),z({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(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"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?Ct(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",V(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[U.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:U.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.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 o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.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"&&S(null)}}),r.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:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Vt,{language:we(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&w(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{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}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(ie,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",we(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":V(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{Ys as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as H,j as t,Z as J,a as ie,p as Y,r as $,a4 as q,i as U,d as ee,t as L,dV as ae,K as F,k as le,B as ce,l as V,L as ue,ak as de}from"./index-DlvaCTnY.js";import{c as me,a as fe,d as pe,e as ge}from"./dialog-ePMaAFHW.js";import{C as W}from"./checkbox-CbS18Pl-.js";import{C as xe}from"./collection-search-CvR0edbX.js";import{u as he}from"./use-debounced-value-BCKrw3rK.js";import{b as te,u as ye}from"./use-connection-ChCtc0dq.js";import{u as D}from"./use-mcp-client-CwZuTwIh.js";import{W as be,S as ne}from"./constants-B72Xmt_K.js";import{a as se}from"./authenticate-and-persist-oauth-Ch9zHPtL.js";import{b as oe}from"./Settings02-B8QXkOks.js";import{K as we}from"./agent-icon-O5iF9kv6.js";import{u as Ne}from"./use-mcp-tools-DR2wl-kg.js";import{e as Ce}from"./extract-connection-data-DquYMvXA.js";import{u as je}from"./use-navigate-to-agent-BYK9qhRb.js";import{f as Ie}from"./github-installations-DzN1UQ4x.js";const K={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return K;const e=s;return Object.values(e).some(n=>typeof n!="string")?K:e}function ve(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ee(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=ve(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function Te(s){return(s??[]).filter(e=>Ee(e)===null)}function rt(s){return s.metadata?.orgShared===!0}function z(s){const e=H.c(4),{size:n,className:o}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=l):l=e[0];let d;return e[1]!==o||e[2]!==n?(d=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:l}),e[1]=o,e[2]=n,e[3]=d):d=e[3],d}function ke(s,e){const n=H.c(12),{org:o}=J();let l;n[0]!==o.id?(l=be.REGISTRY(o.id),n[0]=o.id,n[1]=l):l=n[1];const d=l;let f;n[2]!==o.id||n[3]!==o.slug||n[4]!==d?(f={connectionId:d,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=d,n[5]=f):f=n[5];const m=D(f);let p;n[6]!==s?(p={name:s},n[6]=s,n[7]=p):p=n[7];const b=e?.enabled??!0;let i;return n[8]!==m||n[9]!==p||n[10]!==b?(i={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:p,enabled:b,staleTime:3e5,select:_e},n[8]=m,n[9]=p,n[10]=b,n[11]=i):i=n[11],Ne(i)}function _e(s){return s.structuredContent?.item??null}const Ae="deco/mcp-github";function Re(s){const{org:e}=J(),{data:n}=ie.useSession(),o=te(),l=Y(),[d,f]=$.useState("idle"),[m,p]=$.useState(null),[b,i]=$.useState(null),{data:h,isLoading:c}=ke(Ae,{enabled:s.enabled}),g=$.useRef(!1);s.enabled&&h&&!c&&!g.current&&n?.user?.id&&d==="idle"&&(g.current=!0,w());async function w(){if(!(!h||!n?.user?.id||!e))try{f("installing"),p(null);const N=Ce(h,e.id,n.user.id,{remoteIndex:0});if(!N.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:x}=await o.create.mutateAsync(N);f("authenticating");const u=await se({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:a=>o.update.mutateAsync({id:x,data:{connection_token:a}}).then(()=>{})});if(u.ran&&!u.ok){try{await o.delete.mutateAsync(x)}catch{}throw new Error(u.error&&u.error!=="no token received"?u.error:"No token received from GitHub")}q(l,e.id),i(N),f("ready")}catch(N){p(N instanceof Error?N.message:String(N)),f("error")}}function j(){f("idle"),p(null),i(null),g.current=!1}return s.enabled&&c&&d==="idle"?{status:"installing",error:null,connection:null,retry:j}:{status:d,error:m,connection:b,retry:j}}const B=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Oe(s,e){const n=new Set;if(s.paramsSchema)for(const l of Object.keys(s.paramsSchema))n.add(l);if(Array.isArray(s.params))for(const l of s.params)n.add(l.name);else if(s.params&&typeof s.params=="object")for(const l of Object.keys(s.params))n.add(l);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Ge({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:l,selectedKeys:d}){const f=await s({name:"TRIGGER_LIST",arguments:{}}),m=f.structuredContent??f,p=new Map((m.triggers??[]).map(c=>[c.type,c])),b=B.filter(c=>d.has(c.key)),i=await Promise.allSettled(b.map(async c=>{const g=p.get(c.triggerType);if(!g)throw new Error(`Trigger ${c.triggerType} not exposed`);const w=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${c.nameSuffix}`,virtual_mcp_id:n,messages:c.instructions(o),active:!0}}),j=(w.structuredContent??w).id;if(!j)throw new Error(`AUTOMATION_CREATE returned no id for ${c.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:j,type:"event",connection_id:l,event_type:c.triggerType,params:Oe(g,o)}})})),h=i.filter(c=>c.status==="rejected").length;return h>0&&console.error("Some GitHub automations failed to set up:",i.filter(c=>c.status==="rejected")),{total:i.length,failed:h}}const Z="GitHub MCP did not return refreshable repo grant metadata";function M(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Pe(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function $e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function X(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:l,repo:d,githubCallTool:f,selfCallTool:m,orgShared:p}=s,b=await f({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:l,repo:d,permissions:K}}),i=b.structuredContent;if(b.isError||!i?.token){const y=b.content?.find(T=>T.type==="text")?.text;throw new Error(y?`Failed to mint a repo-scoped GitHub token: ${y}`:"Failed to mint a repo-scoped GitHub token")}const h=M(i.refreshToken),c=M(i.tokenEndpoint),g=M(i.clientId);if(!h||!c||!g)throw new Error(Z);if(!Pe(c))throw new Error(Z);const w=M(i.repository?.owner),j=M(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==l.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!j||j.toLowerCase()!==d.toLowerCase()))throw new Error(N);const C=$e(i.repository?.id),x=i.expiresAt?Date.parse(i.expiresAt):NaN,u=Number.isFinite(x)?Math.max(0,Math.floor((x-Date.now())/1e3)):null,I=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??u,v=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${l}/${d}`,description:`Repo-scoped GitHub access for ${l}/${d}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{...p?{orgShared:!0}:{},repoScope:{installationId:o,repositoryId:C,owner:l,repo:d,permissions:K,grantProvider:"github-mcp"}}}}}),S=v.structuredContent??v,E=S.item?.id??S.id;if(!E)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${E}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:I,scope:i.scope??null,clientId:g,tokenEndpoint:c})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:E,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:E}}function it(s){const e=H.c(23),{open:n,onOpenChange:o,title:l,hideAutoRespondCheckbox:d,onImportComplete:f,mode:m}=s,p=d===void 0?!1:d,b=m===void 0?"agent":m,i=l??(b==="connection"?"Add repo":"Import from GitHub"),[h,c]=$.useState(null);let g;e[0]!==i?(g=t.jsx(me,{className:"sr-only",children:t.jsx(fe,{children:i})}),e[0]=i,e[1]=g):g=e[1];let w;e[2]!==i||e[3]!==h?(w=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:h?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>c(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(oe,{size:16})}),t.jsx("img",{src:h.avatarUrl,alt:h.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:h.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(z,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i})]})}),e[2]=i,e[3]=h,e[4]=w):w=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let N;e[6]!==o?(N=()=>o(!1),e[6]=o,e[7]=N):N=e[7];const C=p||b==="connection";let x;e[8]!==b||e[9]!==f||e[10]!==n||e[11]!==h||e[12]!==N||e[13]!==C?(x=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx($.Suspense,{fallback:j,children:t.jsx(He,{open:n,onComplete:N,selectedInstallation:h,onSelectInstallation:c,hideAutoRespondCheckbox:C,onImportComplete:f,mode:b})})}),e[8]=b,e[9]=f,e[10]=n,e[11]=h,e[12]=N,e[13]=C,e[14]=x):x=e[14];let u;e[15]!==g||e[16]!==w||e[17]!==x?(u=t.jsxs(pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[g,w,x]}),e[15]=g,e[16]=w,e[17]=x,e[18]=u):u=e[18];let a;return e[19]!==o||e[20]!==n||e[21]!==u?(a=t.jsx(ge,{open:n,onOpenChange:o,children:u}),e[19]=o,e[20]=n,e[21]=u,e[22]=a):a=e[22],a}function He({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:l,onImportComplete:d,mode:f="agent"}){const{org:m}=J(),p=Y(),b=je(),[i,h]=$.useState(null),[c,g]=$.useState(!0),[w,j]=$.useState(()=>new Set(B.filter(r=>r.defaultEnabled).map(r=>r.key))),N=B.filter(r=>r.defaultEnabled).map(r=>r.key),C=l?new Set(N):c?w:new Set,x=ye({slug:"mcp-github"}),u=Te(x),a=Re({enabled:s&&u.length===0}),I=u.length===1?u[0]??null:i,v=D({connectionId:I?.id??"",orgId:m.id,orgSlug:m.slug}),S=D({connectionId:ne,orgId:m.id,orgSlug:m.slug}),E=async(r,k)=>{try{const P=await v.callTool({name:"get_file_contents",arguments:{owner:r.owner,repo:r.name,path:k}});if(P.isError)return null;const O=P.content?.find(G=>G.type==="resource")?.resource?.text;if(!O)return null;try{const G=JSON.parse(O);return typeof G=="string"?G:JSON.stringify(G)}catch{return O}}catch{return null}},_=(r,k)=>{Promise.all([E(k,"AGENTS.md"),E(k,"CLAUDE.md")]).then(async([A,P])=>{const R=A??P??null;R&&(await S.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{metadata:{instructions:R}}}}),q(p,m.id))}).catch(A=>{console.error("GitHub instructions fetch failed:",A)})},y=async({virtualMcpId:r,repo:k,connectionId:A,selectedKeys:P})=>{const{total:R,failed:O}=await Ge({githubCallTool:G=>v.callTool(G),selfCallTool:G=>S.callTool(G),virtualMcpId:r,repo:k,connectionId:A,selectedKeys:P});O>0&&L.warning(`Set up ${R-O}/${R} GitHub automations. Add the rest from the automations view.`)},T=ee({mutationFn:async r=>{if(!I||!n)throw new Error("No GitHub connection or installation");const k=n.installationId;if(f==="connection"){const{childConnectionId:R}=await X({orgSlug:m.slug,sourceConnection:I,installationId:k,owner:r.owner,repo:r.name,githubCallTool:O=>v.callTool(O),selfCallTool:O=>S.callTool(O),orgShared:!0});return{virtualMcpId:null,repo:r,connectionId:R,item:null}}const{childConnectionId:A}=await X({orgSlug:m.slug,sourceConnection:I,installationId:k,owner:r.owner,repo:r.name,githubCallTool:R=>v.callTool(R),selfCallTool:R=>S.callTool(R)});let P=null;try{const R=await S.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:r.name,description:r.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:r.owner,name:r.name,url:r.url,installationId:k,connectionId:A},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:A}]}}}),O=R.structuredContent??R,G=O.item?.id;if(!O.item||!G)throw new Error("Failed to create the imported agent");return P=G,C.size>0&&await y({virtualMcpId:G,repo:r,connectionId:A,selectedKeys:C}).catch(re=>{console.error("Failed to set up GitHub automations:",re),L.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:G,repo:r,connectionId:A,item:O.item}}catch(R){throw P&&await S.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:P}}).catch(()=>{}),await S.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:r,repo:k,connectionId:A,item:P})=>{if(f==="connection"||!r||!P){q(p,m.id),ae(p,m.id),L.success(`Added ${k.name}`),e();return}if(p.setQueryData(F.collectionItem(S,m.id,"","VIRTUAL_MCP",r),{item:P}),q(p,m.id),_(r,k),d){d({virtualMcpId:r,repo:k,connectionId:A});return}L.success(`Imported ${k.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),b(r)},onError:r=>{L.error("Failed to import repo: "+(r instanceof Error?r.message:"Unknown error"))}});return a.status==="installing"||a.status==="authenticating"?t.jsx(Q,{status:a.status,error:null,retry:a.retry}):a.status==="error"?t.jsx(Q,{status:"error",error:a.error,retry:a.retry}):u.length===0&&a.status==="idle"?t.jsx(Q,{status:"installing",error:null,retry:a.retry}):u.length>1&&!I?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(r=>t.jsxs("button",{type:"button",onClick:()=>h(r),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[r.icon?t.jsx("img",{src:r.icon,alt:r.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(z,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:r.title})]},r.id))]}):I?n?t.jsx(Fe,{connectionId:I.id,orgId:m.id,orgSlug:m.slug,installation:n,onSelectRepo:r=>T.mutate(r),isSaving:T.isPending,autoRespondEnabled:c,onAutoRespondChange:g,selectedAutomationKeys:w,onAutomationKeysChange:j,hideAutoRespondCheckbox:l}):t.jsx(Le,{connectionId:I.id,orgId:m.id,orgSlug:m.slug,onSelect:o,showBackButton:u.length>1,onBack:()=>h(null)}):null}function Le(s){const e=H.c(47),{connectionId:n,orgId:o,orgSlug:l,onSelect:d,showBackButton:f,onBack:m}=s;let p;e[0]!==o||e[1]!==l?(p={connectionId:ne,orgId:o,orgSlug:l},e[0]=o,e[1]=l,e[2]=p):p=e[2];const b=D(p),i=Y(),h=te();let c;e[3]!==n||e[4]!==o?(c=F.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=c):c=e[5];let g;e[6]!==n||e[7]!==b?(g=()=>Ie(y=>b.callTool(y),n),e[6]=n,e[7]=b,e[8]=g):g=e[8];let w;e[9]!==c||e[10]!==g?(w={queryKey:c,queryFn:g},e[9]=c,e[10]=g,e[11]=w):w=e[11];const j=le(w);let N;e[12]!==h||e[13]!==n||e[14]!==j||e[15]!==o||e[16]!==l||e[17]!==i?(N={mutationFn:async()=>{const y=await se({connectionId:n,orgId:o,orgSlug:l,persistFallback:r=>h.update.mutateAsync({id:n,data:{connection_token:r}}).then(Me)});if(y.ran&&!y.ok)throw new Error(y.error??"no token received");const T=new URL(`/api/${l}/mcp/${n}`,window.location.origin);await i.invalidateQueries({queryKey:F.isMCPAuthenticated(T.href,null)}),await i.invalidateQueries({queryKey:F.mcpClientPrefix()}),await j.refetch()},onError:ze},e[12]=h,e[13]=n,e[14]=j,e[15]=o,e[16]=l,e[17]=i,e[18]=N):N=e[18];const C=ee(N);if(j.isLoading){let y;return e[19]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=y):y=e[19],y}if(j.isError){let y,T;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),T=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=y,e[21]=T):(y=e[20],T=e[21]);let r;e[22]!==C?(r=()=>C.mutate(),e[22]=C,e[23]=r):r=e[23];let k;e[24]!==C.isPending?(k=C.isPending?t.jsx(U,{size:14,className:"animate-spin"}):t.jsx(z,{className:"size-3.5"}),e[24]=C.isPending,e[25]=k):k=e[25];let A;return e[26]!==C.isPending||e[27]!==r||e[28]!==k?(A=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[y,T,t.jsxs(ce,{type:"button",variant:"outline",size:"sm",onClick:r,disabled:C.isPending,children:[k,"Reconnect GitHub"]})]}),e[26]=C.isPending,e[27]=r,e[28]=k,e[29]=A):A=e[29],A}const x=j.data;if(!x)return null;let u;e[30]!==m||e[31]!==f?(u=f&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(oe,{size:12}),"Change connection"]})}),e[30]=m,e[31]=f,e[32]=u):u=e[32];let a;if(e[33]!==x.installations||e[34]!==d){let y;e[36]!==d?(y=T=>t.jsxs("button",{type:"button",onClick:()=>d(T),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:T.avatarUrl,alt:T.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:T.login}),T.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},T.installationId),e[36]=d,e[37]=y):y=e[37],a=x.installations.map(y),e[33]=x.installations,e[34]=d,e[35]=a}else a=e[35];let I;e[38]!==a?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:a}),e[38]=a,e[39]=I):I=e[39];const v=x.appSlug?`https://github.com/apps/${x.appSlug}/installations/new`:"https://github.com/settings/installations";let S;e[40]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=S):S=e[40];let E;e[41]!==v?(E=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",S]})}),e[41]=v,e[42]=E):E=e[42];let _;return e[43]!==E||e[44]!==u||e[45]!==I?(_=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u,I,E]}),e[43]=E,e[44]=u,e[45]=I,e[46]=_):_=e[46],_}function ze(s){L.error("Failed to reconnect GitHub: "+(s instanceof Error?s.message:"Unknown error"))}function Me(){}function Fe(s){const e=H.c(27),{connectionId:n,orgId:o,orgSlug:l,installation:d,onSelectRepo:f,isSaving:m,autoRespondEnabled:p,onAutoRespondChange:b,selectedAutomationKeys:i,onAutomationKeysChange:h,hideAutoRespondCheckbox:c}=s,[g,w]=$.useState(""),j=he(g,300),N=$.useDeferredValue(j),C=g!==N;let x;e[0]!==C||e[1]!==g?(x=t.jsx(xe,{placeholder:"Search repositories...",value:g,onChange:w,isSearching:C}),e[0]=C,e[1]=g,e[2]=x):x=e[2];const u=C?"opacity-40":"opacity-100";let a;e[3]!==u?(a=V("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",u),e[3]=u,e[4]=a):a=e[4];let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(U,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=I):I=e[5];let v;e[6]!==n||e[7]!==N||e[8]!==d||e[9]!==m||e[10]!==f||e[11]!==o||e[12]!==l?(v=t.jsx($.Suspense,{fallback:I,children:t.jsx(Ue,{connectionId:n,orgId:o,orgSlug:l,installation:d,query:N,onSelectRepo:f,isSaving:m})}),e[6]=n,e[7]=N,e[8]=d,e[9]=m,e[10]=f,e[11]=o,e[12]=l,e[13]=v):v=e[13];let S;e[14]!==a||e[15]!==v?(S=t.jsx("div",{className:a,children:v}),e[14]=a,e[15]=v,e[16]=S):S=e[16];let E;e[17]!==p||e[18]!==c||e[19]!==b||e[20]!==h||e[21]!==i?(E=!c&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(W,{checked:p,onCheckedChange:y=>b(y===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),p&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:B.map(y=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(W,{checked:i.has(y.key),onCheckedChange:T=>{const r=new Set(i);T===!0?r.add(y.key):r.delete(y.key),h(r)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:y.label})]},y.key))})]}),e[17]=p,e[18]=c,e[19]=b,e[20]=h,e[21]=i,e[22]=E):E=e[22];let _;return e[23]!==x||e[24]!==S||e[25]!==E?(_=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,S,E]}),e[23]=x,e[24]=S,e[25]=E,e[26]=_):_=e[26],_}function Ue(s){const e=H.c(29),{connectionId:n,orgId:o,orgSlug:l,installation:d,query:f,onSelectRepo:m,isSaving:p}=s;let b;e[0]!==n||e[1]!==o||e[2]!==l?(b={connectionId:n,orgId:o,orgSlug:l},e[0]=n,e[1]=o,e[2]=l,e[3]=b):b=e[3];const i=D(b),h=d.type==="User"?"user":"org",c=f?`${h}:${d.login} ${f} in:name`:`${h}:${d.login}`;let g;e[4]!==n||e[5]!==d.login||e[6]!==o||e[7]!==f?(g=F.githubOrgRepos(o,n,d.login,f),e[4]=n,e[5]=d.login,e[6]=o,e[7]=f,e[8]=g):g=e[8];let w;e[9]!==i||e[10]!==c?(w=async u=>{const{signal:a}=u,v=(await i.callTool({name:"search_repositories",arguments:{query:c,page:1,perPage:30}},void 0,{signal:a})).content?.[0]?.text;if(!v)throw new Error("No response from search_repositories");return(JSON.parse(v).items??[]).map(De)},e[9]=i,e[10]=c,e[11]=w):w=e[11];let j;e[12]!==g||e[13]!==w?(j={queryKey:g,queryFn:w},e[12]=g,e[13]=w,e[14]=j):j=e[14];const{data:N}=ue(j);if(N.length===0){let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=u):u=e[15];let a;e[16]!==f?(a=f&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=f,e[17]=a):a=e[17];let I;return e[18]!==a?(I=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[u,a]}),e[18]=a,e[19]=I):I=e[19],I}let C;if(e[20]!==p||e[21]!==m||e[22]!==N){let u;e[24]!==p||e[25]!==m?(u=a=>t.jsxs("button",{type:"button",onClick:()=>m(a),disabled:p,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(z,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:a.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[a.private?t.jsx(de,{size:10}):t.jsx(we,{size:10}),a.private?"Private":"Public"]})]},a.fullName),e[24]=p,e[25]=m,e[26]=u):u=e[26],C=N.map(u),e[20]=p,e[21]=m,e[22]=N,e[23]=C}else C=e[23];let x;return e[27]!==C?(x=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:C}),e[27]=C,e[28]=x):x=e[28],x}function De(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function Q(s){const e=H.c(33),{status:n,error:o,retry:l}=s;if(n==="error"){let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(z,{className:"size-5 text-destructive"})}),e[0]=v):v=e[0];let S;e[1]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=S):S=e[1];const E=o??"Something went wrong while connecting to GitHub.";let _;e[2]!==E?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[S,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:E})]}),e[2]=E,e[3]=_):_=e[3];let y;e[4]!==l?(y=t.jsx("button",{type:"button",onClick:l,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=l,e[5]=y):y=e[5];let T;return e[6]!==_||e[7]!==y?(T=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[v,_,y]}),e[6]=_,e[7]=y,e[8]=T):T=e[8],T}const d=n==="authenticating";let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(z,{className:"size-5 text-foreground"})}),e[9]=f):f=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[f,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(U,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const p=d?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==p?(b=t.jsx("p",{className:"text-sm font-medium",children:p}),e[11]=p,e[12]=b):b=e[12];const i=d?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let h;e[13]!==i?(h=t.jsx("p",{className:"text-xs text-muted-foreground",children:i}),e[13]=i,e[14]=h):h=e[14];let c;e[15]!==b||e[16]!==h?(c=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,h]}),e[15]=b,e[16]=h,e[17]=c):c=e[17];const g=d?"bg-muted-foreground/30":"bg-foreground animate-pulse";let w;e[18]!==g?(w=V("size-1.5 rounded-full",g),e[18]=g,e[19]=w):w=e[19];let j;e[20]!==w?(j=t.jsx("span",{className:w}),e[20]=w,e[21]=j):j=e[21];const N=d?"bg-foreground animate-pulse":"bg-muted-foreground/30";let C;e[22]!==N?(C=V("size-1.5 rounded-full",N),e[22]=N,e[23]=C):C=e[23];let x;e[24]!==C?(x=t.jsx("span",{className:C}),e[24]=C,e[25]=x):x=e[25];let u;e[26]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=u):u=e[26];let a;e[27]!==j||e[28]!==x?(a=t.jsxs("div",{className:"flex items-center gap-1.5",children:[j,x,u]}),e[27]=j,e[28]=x,e[29]=a):a=e[29];let I;return e[30]!==a||e[31]!==c?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,c,a]}),e[30]=a,e[31]=c,e[32]=I):I=e[32],I}export{it as G,z as a,Te as b,Ee as g,rt as i,X as p,Re as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,j as s,Y as He,r as L,Z as se,b as le,l as B,M as me,_ as Ns,$ as ws,a as ge,a0 as Cs,a1 as ks,t as te,a2 as As,a3 as Is,p as $s,u as Ue,a4 as vt,K as zs,k as Ts,a5 as Ms,i as Gt,e as at,P as Wt,G as Os,H as Ps,I as Ds,J as Es,d as Fs,B as Ze,a6 as Rs,T as Ls,U as Bs,a7 as Hs,X as Us,a8 as Gs}from"./index-DlvaCTnY.js";import{u as be,S as ct,a as dt,b as ue,c as J,d as q,e as qt,f as Kt,g as Ws,h as qs,i as et,j as Ks,k as Vs,l as Xs}from"./sidebar-D7jmt9fv.js";import{u as mt}from"./use-mobile-DYwlg5rv.js";import{n as Qs}from"./Loading02-DEVERrXB.js";import{u as Ys}from"./use-organization-settings-fcvOeyjq.js";import{S as oe}from"./skeleton-CFt1eDrG.js";import{i as Vt}from"./LayoutLeft-Dkd8UOnM.js";import{T as ve}from"./toolbar-icon-button-CGGe07uu.js";import{P as Ge,a as ze,b as We}from"./popover-BbzwXOdH.js";import{D as Xt,a as Qt,b as Yt}from"./drawer-3sebaOA4.js";import{A as Re}from"./avatar-DzCyZoOu.js";import{a as fe,b as he,c as tt,T as pe}from"./tooltip-CeON1mCu.js";import{a as yt}from"./Copy01-u9FKB5rw.js";import{n as Js,i as Zs}from"./Globe01-B3aht_cF.js";import{i as en}from"./ZoomOut-ta-f5OLo.js";import{i as tn,a as sn}from"./ZapSquare-DNICYpKN.js";import{i as st}from"./Monitor01-Df3tXZlk.js";import{n as nn,a as rn}from"./Sun-C0N2xKS2.js";import{a as ut}from"./Settings02-B8QXkOks.js";import{i as on}from"./Shield01-DGSPyrTF.js";import{a as ln}from"./Users03-DdQQIEyW.js";import{a as St,b as _t,c as an,d as cn,A as ye,e as Nt,i as dn,s as mn,f as un}from"./agent-icon-O5iF9kv6.js";import"./index-CZFDfHka.js";import{D as fn,a as hn,b as pn,c as wt,d as xn}from"./dropdown-menu-CG9vxOUx.js";import{i as ft}from"./Check-CFtVdzS5.js";import{s as $e}from"./Plus-CUV2RWYL.js";import{u as gn}from"./use-connection-ChCtc0dq.js";import{u as Jt}from"./use-mcp-client-CwZuTwIh.js";import{u as ht,a as qe}from"./use-virtual-mcp-C7uc6Bcn.js";import{i as Zt,S as es,a as Le,b as bn}from"./constants-B72Xmt_K.js";import{G as jn,g as nt,i as vn,a as it}from"./github-repo-picker-D49GYlXV.js";import{u as yn,S as ts,a as Sn,g as _n,b as Nn,c as wn}from"./use-navigate-to-agent-BYK9qhRb.js";import{I as Cn}from"./invite-member-dialog-Bz_bLfOK.js";import{u as kn,A as An,g as In,a as $n}from"./agent-capabilities-tJSDy4st.js";import{u as zn,v as Tn,C as Ct}from"./connect-desktop-dialog-CNlFMBe_.js";import{i as Mn}from"./FilterLines-CUnsJiex.js";import{T as On,a as Pn}from"./toggle-group-BwpyaIqb.js";import{u as Dn,a as pt,b as ss,T as En}from"./hooks-BaBBRCZd.js";import{u as xt,r as Fn}from"./shell-layout-3sU0F915.js";import{c as Rn,a as Ln,b as Bn,d as Hn,e as Un}from"./dialog-ePMaAFHW.js";import{C as Gn,a as Wn,b as qn,c as Kn,d as Vn}from"./command-DJFScz8d.js";import{u as ns}from"./studio-tools-DDIjP03d.js";import{i as is}from"./Zap-D0DCUM9B.js";import{S as rs,M as Xn}from"./shell-controls-DLUt_wsv.js";import{n as Qn}from"./Stars02-BLbSaBjT.js";import{g as Yn,u as Jn,S as Zn}from"./use-clock-tick-bJFnUrDz.js";import{f as ei}from"./format-time-Cy7tTmZp.js";import{t as gt}from"./ChevronDown-ChePT051.js";import{i as ti}from"./ChevronRight-BQty91sJ.js";import{S as si,C as ni}from"./chat-context-Df8VsXKt.js";import{B as kt,a as ii,b as ri}from"./breadcrumb-DKe1-dnc.js";import{i as os}from"./SearchMd-CXgy8A_w.js";import{s as oi}from"./XClose-Dw1PtgmP.js";import{A as li,a as ai,b as ci,c as di,d as mi,e as ui,f as fi}from"./alert-dialog-DhDoheqT.js";import{F as hi,a as pi,b as xi,c as gi,d as bi,f as ji,e as vi}from"./form-aZBAoZuM.js";import{I as yi}from"./input-VCGuYeNm.js";import{f as Si}from"./reusable-new-chat-qqWu133U.js";import{T as ee}from"./toolbar-DrcyGVUN.js";import"./X-qmyBqDy5.js";import"./User01-BPjZKl04.js";import"./AlertCircle-BUU3NjXR.js";import"./Tool01-DsbaAXps.js";import"./SwitchHorizontal01-B2kf3_j6.js";import"./XCircle-C8HSY-30.js";import"./ArrowUpRight-CrcBlCWJ.js";import"./CheckCircle-IO-B2gUA.js";import"./ChevronUp-BgocMkpt.js";import"./Circle-DmasUYiA.js";import"./DotsVertical-B1hMTL7B.js";import"./Eye-BxKKdsHf.js";import"./Star01-BD9oKUBZ.js";import"./Globe04-DcPELS8T.js";import"./HardDrive-C9XlwGOT.js";import"./Key01-D2RWjQ2a.js";import"./LinkExternal01-DrtX8tOp.js";import"./List-BMEYlI0J.js";import"./Palette-DC6ufhM5.js";import"./Play-Z2pkSQAh.js";import"./SearchLg-CQwb9kkL.js";import"./Stars01-BgPEomHY.js";import"./Trash01-fQ2HT4he.js";import"./Upload01-Dni07u2x.js";import"./Users01-BpBlXa0A.js";import"./use-collections-Dppien-7.js";import"./auth-bk37GVIj.js";import"./checkbox-CbS18Pl-.js";import"./collection-search-CvR0edbX.js";import"./use-debounced-value-BCKrw3rK.js";import"./authenticate-and-persist-oauth-Ch9zHPtL.js";import"./mcp-oauth-h0hme0wb.js";import"./use-mcp-tools-DR2wl-kg.js";import"./extract-connection-data-DquYMvXA.js";import"./github-installations-DzN1UQ4x.js";import"./select-XaD0utC1.js";import"./textarea-DSOO-B2l.js";import"./use-org-auth-client-CdjRE4bd.js";import"./use-organization-roles-zxYeeAXh.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dk3Yn25D.js";import"./use-registry-connections-CsRHS3pv.js";import"./useInfiniteQuery-BgiiodB_.js";import"./use-infinite-scroll-DhC3RCtl.js";import"./card-D4sSe7pw.js";import"./integration-icon-l0eIBg8D.js";import"./collection-tabs-DBC0UI8k.js";import"./badge-DRcHWKtK.js";import"./connection-form-helpers-qln4KCoc.js";import"./useSuspenseInfiniteQuery-Dn5Fxe_Q.js";import"./use-ai-providers-CrSb-eqz.js";import"./decopilot-sse-pool-DkWnTrGm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-BH7KEtF6.js";import"./autosend-4RjZHAxY.js";import"./tab-id-DznSzCvK.js";import"./use-org-sso-23qcZ-TM.js";import"./index-c-r_RAhR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-_Vv0E2CW.js";import"./label-Brp6Tj12.js";function _i(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:i}=t,{state:r,isMobile:o}=be();if(o||r==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.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"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let d;return e[2]!==i||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:i,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=i,e[3]=n,e[4]=d):d=e[4],d}const bt=240,Ni=400,wi="sidebar.width";function Te(t){return Math.max(bt,Math.min(Ni,t))}function Ci(){const t=$.c(11),[e,n]=He(wi,ki),i=L.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Te(e),g=i.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=g?Array.from(g.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const h of x)h.style.transition="none";const b=h=>{const j=Te(f+(h.clientX-u));g?.style.setProperty("--sidebar-width",`${j}px`)},p=h=>{const j=Te(f+(h.clientX-u));n(j);for(const y of x)y.style.transition="";window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",b),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const o=r;let l;t[3]!==n?(l=()=>{n(bt)},t[3]=n,t[4]=l):l=t[4];const a=l;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==o||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:i,onStartResize:o,resetWidth:a},t[7]=o,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function ki(t){return typeof t=="number"?Te(t):bt}function ls(){const t=$.c(8),{org:e}=se(),n=le(),i=Ys();let r;if(t[0]!==n||t[1]!==e||t[2]!==i){if(r=[],i){let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qs,{className:"size-4!"}),t[4]=o):o=t[4];let l;t[5]!==n||t[6]!==e?(l={type:"items",items:[{key:"board",label:"Board",icon:o,onClick:()=>n({to:"/$org/board",params:{org:e.slug}})}]},t[5]=n,t[6]=e,t[7]=l):l=t[7],r.push(l)}t[0]=n,t[1]=e,t[2]=i,t[3]=r}else r=t[3];return r}function as(t){const e=$.c(3),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=i):i=e[0];let r;return e[1]!==n?(r=s.jsxs(ct,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[i,s.jsx(dt,{children:s.jsx(ue,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function cs(t){const e=$.c(18),{item:n}=t,{isMobile:i,setOpenMobile:r}=be();let o;e[0]!==i||e[1]!==n||e[2]!==r?(o=()=>{me("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:i}),n.onClick?.(),i&&r(!1)},e[0]=i,e[1]=n,e[2]=r,e[3]=o):o=e[3];const l=o,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=B(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(q,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Ai(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let o;e[2]!==n.group.items?(o=n.group.items.map($i),e[2]=n.group.items,e[3]=o):o=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==o?(l=s.jsx(as,{label:i,defaultExpanded:r,children:o}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=o,e[7]=l):l=e[7],l}case"items":{let i;e[8]!==n.items?(i=n.items.map(Ii),e[8]=n.items,e[9]=i):i=e[9];let r;return e[10]!==i?(r=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ue,{className:"gap-1.5",children:i})})}),e[10]=i,e[11]=r):r=e[11],r}case"custom":return n.content}}function Ii(t){return s.jsx(cs,{item:t},t.key)}function $i(t){return s.jsx(cs,{item:t},t.key)}function zi(t){const e=$.c(14),{sections:n,footer:i,additionalContent:r,variant:o,contentClassName:l}=t,a=o===void 0?"sidebar":o;let d;e[0]!==l?(d=B("flex flex-col flex-1 px-2 pb-2 gap-0.5",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(Ti),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Kt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==i||e[11]!==u||e[12]!==a?(f=s.jsxs(Ws,{variant:a,children:[u,i]}),e[10]=i,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Ti(t,e){return s.jsx(Ai,{section:t},e)}function ds(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ds.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Mi(t){const e=$.c(16),{onToggle:n,className:i}=t,o=Ns().logo??ws,l=typeof o=="string"?o:o.light,a=typeof o=="string"?o:o.dark;let d;e[0]!==i?(d=B("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",i),e[0]=i,e[1]=d):d=e[1];let c;e[2]!==l?(c=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Vt,{size:16}),e[9]=f):f=e[9];let g;e[10]!==n?(g=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=g):g=e[11];let x;return e[12]!==d||e[13]!==u||e[14]!==g?(x=s.jsxs(qs,{className:d,children:[u,g]}),e[12]=d,e[13]=u,e[14]=g,e[15]=x):x=e[15],x}function At(t){const e=$.c(18),{item:n,onClose:i}=t,r=n.isActive&&"z-10";let o;e[0]!==r?(o=B(r),e[0]=r,e[1]=o):o=e[1];let l;e[2]!==n||e[3]!==i?(l=()=>{n.onClick?.(),i()},e[2]=n,e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==d?(c=s.jsxs(J,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==o||e[16]!==c?(m=s.jsx(q,{className:o,children:c}),e[15]=o,e[16]=c,e[17]=m):m=e[17],m}function Oi(t){const e=$.c(18),{section:n,onClose:i}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(qt,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let l;if(e[2]!==i||e[3]!==n.group.items){let d;e[5]!==i?(d=c=>s.jsx(At,{item:c,onClose:i},c.key),e[5]=i,e[6]=d):d=e[6],l=n.group.items.map(d),e[2]=i,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(as,{label:r,defaultExpanded:o,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==i||e[12]!==n.items){let l;e[14]!==i?(l=a=>s.jsx(At,{item:a,onClose:i},a.key),e[14]=i,e[15]=l):l=e[15],r=n.items.map(l),e[11]=i,e[12]=n.items,e[13]=r}else r=e[13];let o;return e[16]!==r?(o=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ue,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=o):o=e[17],o}case"custom":return n.content}}function Pi(t){const e=$.c(17),{sections:n,onClose:i,footer:r,additionalContent:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==i?(a=s.jsx(L.Suspense,{fallback:l,children:s.jsx(Mi,{onToggle:i})}),e[1]=i,e[2]=a):a=e[2];let d;if(e[3]!==i||e[4]!==n){let f;e[6]!==i?(f=(g,x)=>s.jsx(Oi,{section:g,onClose:i},x),e[6]=i,e[7]=f):f=e[7],d=n.map(f),e[3]=i,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==o?(c=o&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:o}),e[8]=o,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Kt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:i}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==i||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:i,children:[m,u]}),e[4]=n.href,e[5]=i,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==i?(r=()=>{n.onClick?.(),i()},e[11]=n,e[12]=i,e[13]=r):r=e[13];let o;e[14]!==n.icon?(o=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=o):o=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==o||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[o,l]}),e[18]=r,e[19]=o,e[20]=l,e[21]=a):a=e[21],a}function It(t){const e=$.c(126),{user:n,userImage:i,menuItems:r,signOutItem:o,themeOptions:l,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const F=n?.name??"U";let R;e[0]!==F||e[1]!==i?(R=s.jsx(Re,{url:i,fallback:F,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=F,e[1]=i,e[2]=R):R=e[2];const Y=n?.name??"User";let K;e[3]!==Y?(K=s.jsx("p",{className:"text-sm font-medium truncate",children:Y}),e[3]=Y,e[4]=K):K=e[4];const ne=n?.email;let V;e[5]!==ne?(V=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=V):V=e[6];let ie;e[7]!==K||e[8]!==V?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[K,V]}),e[7]=K,e[8]=V,e[9]=ie):ie=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ri)},e[10]=n,e[11]=re):re=e[11];let ae;e[12]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(yt,{size:14}),e[12]=ae):ae=e[12];let xe;e[13]!==re?(xe=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ae})}),e[13]=re,e[14]=xe):xe=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==xe?(T=s.jsx(tt,{delayDuration:300,children:s.jsxs(pe,{children:[xe,je]})}),e[16]=xe,e[17]=T):T=e[17];let U;e[18]!==T||e[19]!==R||e[20]!==ie?(U=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[R,ie,T]}),e[18]=T,e[19]=R,e[20]=ie,e[21]=U):U=e[21];let X;if(e[22]!==c||e[23]!==r){let de;e[25]!==c?(de=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=de):de=e[26],X=r.map(de),e[22]=c,e[23]=r,e[24]=X}else X=e[24];let W;e[27]!==c||e[28]!==o?(W=s.jsx(De,{item:o,onClose:c}),e[27]=c,e[28]=o,e[29]=W):W=e[29];let ce;e[30]!==X||e[31]!==W?(ce=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[X,W]})}),e[30]=X,e[31]=W,e[32]=ce):ce=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==l){let de;e[37]!==a.theme||e[38]!==d?(de=Pe=>{const{value:Qe,icon:ys,label:Ss}=Pe;return s.jsx("button",{type:"button","aria-label":Ss,onClick:()=>d(_s=>({..._s,theme:Qe})),className:B("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ys},Qe)},e[37]=a.theme,e[38]=d,e[39]=de):de=e[39],Se=l.map(de),e[33]=a.theme,e[34]=d,e[35]=l,e[36]=Se}else Se=e[36];let _e;e[40]!==Se?(_e=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=_e):_e=e[41];const Ve=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[42]!==d?(Ne=()=>d(Fi),e[42]=d,e[43]=Ne):Ne=e[43];const Xe=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Xe?(we=B("size-8 rounded-md flex items-center justify-center transition-colors",Xe),e[44]=Xe,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(_t,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Ve||e[49]!==Ne||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Ve,onClick:Ne,className:we,children:Ce}),e[48]=Ve,e[49]=Ne,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.31.1"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==_e||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[_e,Ae]}),e[56]=_e,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==U||e[60]!==ce||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[U,ce,Ie]}),e[59]=U,e[60]=ce,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==i?(f=s.jsx(Re,{url:i,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=i,e[65]=f):f=e[65];const g=n?.name??"User";let x;e[66]!==g?(x=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[66]=g,e[67]=x):x=e[67];const b=n?.email;let p;e[68]!==b?(p=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b}),e[68]=b,e[69]=p):p=e[69];let h;e[70]!==x||e[71]!==p?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,p]}),e[70]=x,e[71]=p,e[72]=h):h=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ei)},e[73]=n,e[74]=j):j=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(yt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==j?(v=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=j,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let N;e[79]!==v?(N=s.jsx(tt,{delayDuration:300,children:s.jsxs(pe,{children:[v,w]})}),e[79]=v,e[80]=N):N=e[80];let _;e[81]!==N||e[82]!==f||e[83]!==h?(_=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,h,N]}),e[81]=N,e[82]=f,e[83]=h,e[84]=_):_=e[84];let S;if(e[85]!==c||e[86]!==r){let F;e[88]!==c?(F=R=>s.jsx(De,{item:R,onClose:c},R.key),e[88]=c,e[89]=F):F=e[89],S=r.map(F),e[85]=c,e[86]=r,e[87]=S}else S=e[87];let C;e[90]!==c||e[91]!==o?(C=s.jsx(De,{item:o,onClose:c}),e[90]=c,e[91]=o,e[92]=C):C=e[92];let A;e[93]!==S||e[94]!==C?(A=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,C]}),e[93]=S,e[94]=C,e[95]=A):A=e[95];let I;if(e[96]!==a.theme||e[97]!==d||e[98]!==l){let F;e[100]!==a.theme||e[101]!==d?(F=R=>{const{value:Y,icon:K,label:ne}=R;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>d(V=>({...V,theme:Y})),className:B("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Y?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:K},Y)},e[100]=a.theme,e[101]=d,e[102]=F):F=e[102],I=l.map(F),e[96]=a.theme,e[97]=d,e[98]=l,e[99]=I}else I=e[99];let k;e[103]!==I?(k=s.jsx("div",{className:"flex items-center gap-0.5",children:I}),e[103]=I,e[104]=k):k=e[104];const z=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[105]!==d?(E=()=>d(Di),e[105]=d,e[106]=E):E=e[106];const H=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let O;e[107]!==H?(O=B("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=O):O=e[108];let D;e[109]!==a.enableSounds?(D=a.enableSounds?s.jsx(St,{size:14}):s.jsx(_t,{size:14}),e[109]=a.enableSounds,e[110]=D):D=e[110];let M;e[111]!==z||e[112]!==E||e[113]!==O||e[114]!==D?(M=s.jsx("button",{type:"button","aria-label":z,onClick:E,className:O,children:D}),e[111]=z,e[112]=E,e[113]=O,e[114]=D,e[115]=M):M=e[115];let P;e[116]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.31.1"]}),e[116]=P):P=e[116];let G;e[117]!==M?(G=s.jsxs("div",{className:"flex items-center gap-2",children:[M,P]}),e[117]=M,e[118]=G):G=e[118];let Q;e[119]!==k||e[120]!==G?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[k,G]}),e[119]=k,e[120]=G,e[121]=Q):Q=e[121];let Z;return e[122]!==_||e[123]!==A||e[124]!==Q?(Z=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[_,A,Q]})}),e[122]=_,e[123]=A,e[124]=Q,e[125]=Z):Z=e[125],Z}function Di(t){return{...t,enableSounds:!t.enableSounds}}function Ei(){te.success("User ID copied")}function Fi(t){return{...t,enableSounds:!t.enableSounds}}function Ri(){te.success("User ID copied")}function rt(){const t=$.c(34),{data:e}=ge.useSession(),{org:n}=se(),i=le();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=Cs(r)?.params.org,[a,d]=ks(),c=mt(),[m,u]=L.useState(!1),f=e?.user,g=f?.image;let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=()=>u(!1),t[1]=x):x=t[1];const b=x;let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ut,{size:16}),t[2]=p):p=t[2];let h;t[3]!==i||t[4]!==l?(h={key:"preferences",label:"Preferences",icon:p,onClick:()=>{i({to:"/$org/settings/profile",params:{org:l??""}})}},t[3]=i,t[4]=l,t[5]=h):h=t[5];let j;t[6]!==n||t[7]!==i?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Js,{size:16}),onClick:()=>{i({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=i,t[8]=j):j=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(en,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(on,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(As,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N={key:"community",label:"Community",icon:s.jsx(ln,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=N):N=t[12];let _;t[13]===Symbol.for("react.memo_cache_sentinel")?(_={key:"homepage",label:"Homepage",icon:s.jsx(Zs,{size:16}),href:"https://decocms.com",external:!0},t[13]=_):_=t[13];let S;t[14]!==h||t[15]!==j?(S=[h,...j,y,v,w,N,_],t[14]=h,t[15]=j,t[16]=S):S=t[16];const C=S;let A;t[17]===Symbol.for("react.memo_cache_sentinel")?(A={key:"logout",label:"Sign out",icon:s.jsx(tn,{size:16}),onClick:Bi},t[17]=A):A=t[17];const I=A;let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k={value:"light",icon:s.jsx(nn,{size:14}),label:"Light theme"},t[18]=k):k=t[18];let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={value:"dark",icon:s.jsx(rn,{size:14}),label:"Dark theme"},t[19]=z):z=t[19];let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=[k,z,{value:"system",icon:s.jsx(st,{size:14}),label:"System theme"}],t[20]=E):E=t[20];const H=E;let O;t[21]!==c||t[22]!==C||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==g?(O={user:f,userImage:g,menuItems:C,signOutItem:I,themeOptions:H,preferences:a,setPreferences:d,close:b,isMobile:c},t[21]=c,t[22]=C,t[23]=a,t[24]=d,t[25]=f,t[26]=g,t[27]=O):O=t[27];const D=O;let M;return t[28]!==c||t[29]!==m||t[30]!==D||t[31]!==f?.name||t[32]!==g?(M=s.jsx(s.Fragment,{children:c?s.jsxs(Xt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Re,{url:g,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Qt,{className:"h-[80dvh] p-0",children:[s.jsx(Yt,{className:"sr-only",children:"Account"}),s.jsx(It,{...D})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Re,{url:g,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(We,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Li,children:s.jsx(It,{...D})})]})}),t[28]=c,t[29]=m,t[30]=D,t[31]=f?.name,t[32]=g,t[33]=M):M=t[33],M}function Li(t){return t.preventDefault()}function Bi(){me("signed_out",{source:"account_popover"}),Is(),ge.signOut()}const $t=["requires_action","in_progress","failed","expired","completed"];function Hi(t){const e=new Map($t.map(n=>[n,[]]));for(const n of t){const i=n.status??"completed";(e.get(i)??e.get("completed")).push(n)}return $t.map(n=>({status:n,threads:e.get(n)}))}function ms(t){const e=$.c(4),{onClick:n}=t;let i,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=i,e[1]=r):(i=e[0],r=e[1]);let o;return e[2]!==n?(o=s.jsxs(J,{tooltip:"Add repo",onClick:n,children:[i,r]}),e[2]=n,e[3]=o):o=e[3],o}function Ui(t){const e=$.c(41),{onAddNew:n}=t,{org:i}=se(),r=$s(),o=le(),l=yn();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ue(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!Zt(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const x=gn(f).filter(Wi),b=ht(),h=qe(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==i.id||e[5]!==i.slug?(j={connectionId:es,orgId:i.id,orgSlug:i.slug},e[4]=i.id,e[5]=i.slug,e[6]=j):j=e[6];const y=Jt(j);if(x.length===0){let F;return e[7]!==n?(F=s.jsx(ms,{onClick:n}),e[7]=n,e[8]=F):F=e[8],F}let v;e[9]!==c||e[10]!==o||e[11]!==i.id||e[12]!==r||e[13]!==y?(v=async(F,R)=>{await y.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:F}}}}),vt(r,i.id),te.success(`Previewing ${R}`),o({to:".",search:Gi,replace:!0})},e[9]=c,e[10]=o,e[11]=i.id,e[12]=r,e[13]=y,e[14]=v):v=e[14];const w=v;let N;e[15]!==b||e[16]!==l||e[17]!==i.id||e[18]!==r||e[19]!==y?(N=async(F,R,Y)=>{const K=b.find(ie=>{const re=ie.metadata?.githubRepo;return re?.owner?.toLowerCase()===F.owner.toLowerCase()&&re?.name?.toLowerCase()===F.name.toLowerCase()});if(K){l(K.id,{search:{main:"preview"}});return}const V=(await y.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:F.name,description:`Imported from ${Y}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:R}],metadata:{githubRepo:F,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,i.id),!V)throw new Error("Failed to create the repo agent");te.success(`Created ${Y}`),l(V,{search:{main:"preview"}})},e[15]=b,e[16]=l,e[17]=i.id,e[18]=r,e[19]=y,e[20]=N):N=e[20];const _=N;let S;e[21]!==w||e[22]!==u||e[23]!==_?(S=async F=>{const R=nt(F);if(!R)return;const Y=`${R.owner}/${R.repo}`,K={owner:R.owner,name:R.repo,url:`https://github.com/${R.owner}/${R.repo}`,installationId:R.installationId,connectionId:F.id};try{u?await w(K,Y):await _(K,F.id,Y)}catch(ne){const V=ne;te.error("Failed to set preview repo: "+(V instanceof Error?V.message:"Unknown error"))}},e[21]=w,e[22]=u,e[23]=_,e[24]=S):S=e[24];const C=S,A=hn;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(pn,{asChild:!0,children:s.jsxs(J,{tooltip:"Add repo",children:[s.jsx(it,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=I):I=e[25];const k=fn,z="start",E="right",H="w-56";let O;e[26]!==h||e[27]!==C?(O=F=>{const R=nt(F);return R?s.jsxs(wt,{onSelect:()=>C(F),children:[s.jsx(it,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[R.owner,"/",R.repo]}),F.id===h&&s.jsx(ft,{className:"size-4"})]},F.id):null},e[26]=h,e[27]=C,e[28]=O):O=e[28];const D=x.map(O);let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(xn,{}),e[29]=M):M=e[29];let P;e[30]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx($e,{className:"size-4"}),e[30]=P):P=e[30];let G;e[31]!==n?(G=s.jsxs(wt,{onSelect:n,children:[P,"Add new repo…"]}),e[31]=n,e[32]=G):G=e[32];let Q;e[33]!==k||e[34]!==D||e[35]!==G?(Q=s.jsxs(k,{align:z,side:E,className:H,children:[D,M,G]}),e[33]=k,e[34]=D,e[35]=G,e[36]=Q):Q=e[36];let Z;return e[37]!==A||e[38]!==Q||e[39]!==I?(Z=s.jsxs(A,{children:[I,Q]}),e[37]=A,e[38]=Q,e[39]=I,e[40]=Z):Z=e[40],Z}function Gi(t){return{...t,main:"preview"}}function Wi(t){return nt(t)!==null&&vn(t)}function qi(){const t=$.c(4),[e,n]=L.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ms,{onClick:()=>n(!0)}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(L.Suspense,{fallback:i,children:s.jsx(Ui,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(jn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=o):o=t[3],o}function ot(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,i=n===void 0?"icon":n,r=zn(),[o,l]=L.useState(!1);let a,d;if(e[0]!==r.capabilities||e[1]!==r.hostname||e[2]!==r.machineId||e[3]!==r.online){const y=Tn(r.capabilities);a=r.online?"Desktop linked":"Connect desktop",d=r.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:r.hostname??r.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=r.capabilities,e[1]=r.hostname,e[2]=r.machineId,e[3]=r.online,e[4]=a,e[5]=d}else a=e[4],d=e[5];const c=d;if(i==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),v=s.jsx(st,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==a?(w=s.jsx("span",{children:a}),e[8]=a,e[9]=w):w=e[9];let N;e[10]!==r.online?(N=r.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=r.online,e[11]=N):N=e[11];let _;e[12]!==a||e[13]!==w||e[14]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(J,{tooltip:a,onClick:y,children:[v,w,N]})}),e[12]=a,e[13]=w,e[14]=N,e[15]=_):_=e[15];let S;e[16]!==c?(S=s.jsx(he,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let C;e[18]!==_||e[19]!==S?(C=s.jsxs(pe,{children:[_,S]}),e[18]=_,e[19]=S,e[20]=C):C=e[20];let A;e[21]!==o?(A=s.jsx(Ct,{open:o,onOpenChange:l}),e[21]=o,e[22]=A):A=e[22];let I;return e[23]!==A||e[24]!==C?(I=s.jsxs(s.Fragment,{children:[C,A]}),e[23]=A,e[24]=C,e[25]=I):I=e[25],I}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[26]=m):m=e[26];const u=r.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(st,{size:16}),e[27]=f):f=e[27];let g;e[28]!==r.online?(g=r.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=r.online,e[29]=g):g=e[29];let x;e[30]!==u||e[31]!==g?(x=s.jsx(fe,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,g]})}),e[30]=u,e[31]=g,e[32]=x):x=e[32];let b;e[33]!==c?(b=s.jsx(he,{side:"bottom",children:c}),e[33]=c,e[34]=b):b=e[34];let p;e[35]!==x||e[36]!==b?(p=s.jsxs(pe,{children:[x,b]}),e[35]=x,e[36]=b,e[37]=p):p=e[37];let h;e[38]!==o?(h=s.jsx(Ct,{open:o,onOpenChange:l}),e[38]=o,e[39]=h):h=e[39];let j;return e[40]!==h||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,h]}),e[40]=h,e[41]=p,e[42]=j):j=e[42],j}class Ki extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Vi(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Xi(){const t=$.c(17),e=le(),{org:n}=se(),{hasDecoKey:i,balanceDollars:r}=kn();if(!i)return null;let o;t[0]!==r?(o=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=o):o=t[1];let l;t[2]!==r?(l=B(r!=null&&Vi(r)),t[2]=r,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(an,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==l||t[14]!==a||t[15]!==m?(u=s.jsx(ue,{children:s.jsx(q,{children:s.jsxs(J,{tooltip:o,className:l,onClick:a,children:[d,m]})})}),t[12]=o,t[13]=l,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function zt(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ki,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function Tt(){const t=$.c(7),e=le(),{org:n}=se();let i;t[0]!==e||t[1]!==n.slug?(i=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=i):i=t[2];let r,o;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{}),o=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=o):(r=t[3],o=t[4]);let l;return t[5]!==i?(l=s.jsxs(J,{tooltip:"Settings",onClick:i,children:[r,o]}),t[5]=i,t[6]=l):l=t[6],l}function Mt(){const t=$.c(5),[e,n]=L.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q,{children:s.jsx(Cn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(cn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(q,{children:s.jsx(qi,{})}),t[1]=r):r=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(ue,{className:"gap-0.5",children:[i,r,s.jsx(q,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(sn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=o):o=t[2];let l;return t[3]!==e?(l=s.jsxs(s.Fragment,{children:[o,s.jsx(An,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=l):l=t[4],l}function Qi(){const t=$.c(10),{state:e}=be();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Mt,{}),c=s.jsx(zt,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(q,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(ot,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(q,{children:s.jsx(Tt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(et,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ue,{children:[m,u,s.jsx(q,{children:s.jsx(rt,{})})]})]}),t[4]=f):f=t[4],f}let i,r;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Mt,{}),r=s.jsx(zt,{}),t[5]=i,t[6]=r):(i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(q,{children:s.jsx(ot,{variant:"full"})}),t[7]=o):o=t[7];let l;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(q,{children:s.jsx(Tt,{})}),t[8]=l):l=t[8];let a;return t[9]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs(et,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ue,{className:"gap-0.5",children:[o,l,s.jsx(q,{children:s.jsx(rt,{})})]})]}),t[9]=a):a=t[9],a}function Yi(){const t=$.c(8),e=le(),{org:n}=se(),{setOpenMobile:i}=be();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ue,{children:s.jsx(q,{children:s.jsx(rt,{})})})}),t[0]=r):r=t[0];let o;t[1]!==e||t[2]!==n.slug||t[3]!==i?(o=()=>{e({to:"/$org/settings",params:{org:n.slug}}),i(!1)},t[1]=e,t[2]=n.slug,t[3]=i,t[4]=o):o=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ut,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==o?(a=s.jsx(et,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(ve,{"aria-label":"Settings",onClick:o,children:l})]})}),t[6]=o,t[7]=a):a=t[7],a}function Ot(t){const e=$.c(15),{className:n,wrapperClassName:i,children:r}=t,[o,l]=L.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h=>{h&&l(h.scrollHeight>h.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h=>{const j=h.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==i?(u=B("relative",i),e[2]=i,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const g=o?"opacity-100":"opacity-0";let x;e[7]!==g?(x=B("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",g),e[7]=g,e[8]=x):x=e[8];let b;e[9]!==x?(b=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=b):b=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==b?(p=s.jsxs("div",{className:u,children:[f,b]}),e[11]=u,e[12]=f,e[13]=b,e[14]=p):p=e[14],p}function Ji(t){const e=$.c(8),{virtualMcpId:n,size:i,showAutomationBadge:r}=t,o=i===void 0?"sm":i;let l;e[0]!==o||e[1]!==n?(l=n?s.jsx(Zi,{virtualMcpId:n,size:o}):s.jsx(ye,{icon:null,name:"?",size:o}),e[0]=o,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(is,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=d):d=e[7],d}function Zi(t){const e=$.c(6),{virtualMcpId:n,size:i}=t,r=qe(n);if(!r){let a;return e[0]!==i?(a=s.jsx(ye,{icon:null,name:"?",size:i}),e[0]=i,e[1]=a):a=e[1],a}const o=r.icon??null;let l;return e[2]!==r.title||e[3]!==i||e[4]!==o?(l=s.jsx(ye,{icon:o,name:r.title,size:i}),e[2]=r.title,e[3]=i,e[4]=o,e[5]=l):l=e[5],l}function Pt(t){const e=$.c(36),{open:n,onOpenChange:i}=t,[r,o]=L.useState(""),{org:l}=se(),{setTaskId:a}=xt(),d=ns();let c,m,u;e[0]!==l.id||e[1]!==r?(u=r.trim(),m=Ts,c=zs.globalSearch(l.id,u),e[0]=l.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let g;e[5]!==d||e[6]!==u?(g=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=g):g=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==g?(x={queryKey:c,enabled:f,queryFn:g,staleTime:1e4},e[8]=c,e[9]=f,e[10]=g,e[11]=x):x=e[11];const{data:b,isFetching:p}=m(x);let h;e[12]!==b?.items?(h=b?.items??[],e[12]=b?.items,e[13]=h):h=e[13];const j=h;let y;e[14]!==i?(y=z=>{z||o(""),i(z)},e[14]=i,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==a?(w=z=>{v(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=w):w=e[18];const N=w;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Rn,{className:"sr-only",children:[s.jsx(Ln,{children:"Search"}),s.jsx(Bn,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let S;e[20]!==r?(S=s.jsx(qn,{value:r,onValueChange:o,placeholder:"Search..."}),e[20]=r,e[21]=S):S=e[21];let C;e[22]!==N||e[23]!==p||e[24]!==j||e[25]!==u?(C=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Gn,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(Wn,{value:`thread:${z.id}:${z.title}`,onSelect:()=>N(z),className:"gap-2.5",children:[s.jsx(Ji,{virtualMcpId:z.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:z.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=N,e[23]=p,e[24]=j,e[25]=u,e[26]=C):C=e[26];let A;e[27]!==C?(A=s.jsx(Kn,{children:C}),e[27]=C,e[28]=A):A=e[28];let I;e[29]!==S||e[30]!==A?(I=s.jsxs(Hn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Vn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,A]})]}),e[29]=S,e[30]=A,e[31]=I):I=e[31];let k;return e[32]!==v||e[33]!==n||e[34]!==I?(k=s.jsx(Un,{open:n,onOpenChange:v,children:I}),e[32]=v,e[33]=n,e[34]=I,e[35]=k):k=e[35],k}function er(t){return t==="ephemeral"||t.startsWith("thread:")}function us(t){const e=$.c(40),{task:n,isActive:i,onClick:r,onArchive:o,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=Yn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",g=qe(f?void 0:n.virtual_mcp_id);let x;e[0]!==g?(x=In(g),e[0]=g,e[1]=x):x=e[1];const b=x;Jn(6e4);const p=l||!!n.trigger_id,h=n.id,j="button",y=0;let v;e[2]!==r?(v=G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),r())},e[2]=r,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",N=i?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==w||e[5]!==N?(_=B("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=w,e[5]=N,e[6]=_):_=e[6];let S;e[7]!==f||e[8]!==a||e[9]!==g?.icon||e[10]!==g?.title?(S=a&&!f&&s.jsx(ye,{icon:g?.icon??null,name:g?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=g?.icon,e[10]=g?.title,e[11]=S):S=e[11];let C;e[12]!==p?(C=p&&s.jsx(is,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=C):C=e[13];const A=n.title||"Untitled task";let I;e[14]!==A?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:A}),e[14]=A,e[15]=I):I=e[15];let k;e[16]!==C||e[17]!==I?(k=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[C,I]}),e[16]=C,e[17]=I,e[18]=k):k=e[18];let z;e[19]!==b||e[20]!==i||e[21]!==n.branch||e[22]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:B("flex items-center gap-1 text-[11px] min-w-0",i?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!er(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):b?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[b.owner,"/",b.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:ei(new Date(n.updated_at))})]}),e[19]=b,e[20]=i,e[21]=n.branch,e[22]=n.updated_at,e[23]=z):z=e[23];let E;e[24]!==k||e[25]!==z?(E=s.jsxs("div",{className:"flex-1 min-w-0",children:[k,z]}),e[24]=k,e[25]=z,e[26]=E):E=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O=!d&&s.jsx("span",{className:B("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",o&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:B(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[27]!==o?(D=o&&s.jsxs(pe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:G=>{G.stopPropagation(),o()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ms,{size:14})})}),s.jsx(he,{side:"right",children:"Archive"})]}),e[27]=o,e[28]=D):D=e[28];let M;e[29]!==O||e[30]!==D?(M=s.jsxs("div",{className:H,children:[O,D]}),e[29]=O,e[30]=D,e[31]=M):M=e[31];let P;return e[32]!==r||e[33]!==E||e[34]!==M||e[35]!==v||e[36]!==_||e[37]!==S||e[38]!==n.id?(P=s.jsxs("div",{"data-task-id":h,role:j,tabIndex:y,onClick:r,onKeyDown:v,className:_,children:[S,E,M]}),e[32]=r,e[33]=E,e[34]=M,e[35]=v,e[36]=_,e[37]=S,e[38]=n.id,e[39]=P):P=e[39],P}const tr="sidebar.group.expanded.";function sr(t,e){const n=$.c(3),[i,r]=He(`${tr}${t}`,e);let o;return n[0]!==i||n[1]!==r?(o=[i,r],n[0]=i,n[1]=r,n[2]=o):o=n[2],o}function fs(t){const e=$.c(12),{onClick:n,isFetching:i,indented:r}=t,o=r?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==o?(l=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",o,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==i?(a=i&&s.jsx(Gt,{size:14,className:"animate-spin"}),e[2]=i,e[3]=a):a=e[3];const d=i?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:i,className:l,children:[a,c]}),e[6]=i,e[7]=n,e[8]=l,e[9]=a,e[10]=c,e[11]=m):m=e[11],m}function nr(t,e,n,i){return[t,e,n,i.type,i.member,i.currentUserId??""].join("|")}function ir(t){return t.member==="mine"&&!t.currentUserId}const hs=4;let Fe=0;const lt=[];function rr(){for(;Fe<hs&<.length>0;){const t=lt.shift();t&&t()}}function ps(t){return new Promise((e,n)=>{const i=()=>{Fe++,t().then(e,n).finally(()=>{Fe--,rr()})};Fe<hs?i():lt.push(i)})}const Ke=10;function Dt(t,e,n,i,r){const o={hidden:!1};i.member==="mine"&&i.currentUserId&&(o.created_by=i.currentUserId),i.type==="automation"&&(o.has_trigger=!0),i.type==="manual"&&(o.has_trigger=!1);const l={where:o,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function or(t,e,n,i){let r=0;for(const o of t)xs(o,e,n,i)&&r++;return r}function Ye(t,e,n,i){return or(t,e,n,i)}function lr(t,e){return!!(t>=Ke||t===0&&e)}function Et(t,e){return t<e}function ar(t,e){return e===!1?!1:e===!0?!0:t}function xs(t,e,n,i){return!(t.hidden||(t.status??"completed")!==n||i.member==="mine"&&i.currentUserId&&t.created_by!==i.currentUserId||i.type==="automation"&&!t.trigger_id||i.type==="manual"&&t.trigger_id)}const Be=new Map,Ee=new Map;function cr(t,e){return e?t>=Ke?!0:null:!1}function Ft(t){return Be.get(t)}function dr(t,e){Be.set(t,e)}function mr(t,e,n){const i=Be.get(t);if(i!==void 0){n(i);return}let r=Ee.get(t);r||(r=ps(e).then(o=>(Be.set(t,o),Ee.delete(t),o)).catch(()=>(Ee.delete(t),Promise.reject(new Error("group probe failed")))),Ee.set(t,r)),r.then(n,()=>n(!1))}function Rt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ke,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ur(t,e,n,i,r){let o=0;for(const l of t)e.has(l.id)||xs(l,n,i,r)&&o++;return o}function fr(t,e,n,i){const r=$.c(8),{org:o}=se(),l=nr(o.id,t,e,n);let a;r[0]!==n?(a=ir(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==l&&m({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const u=Dn(),{threads:f,hasMore:g}=pt(),x=Ye(f,t,e,n),b=lr(x,g),p=cr(x,g),h=ns();if(c.identity===l&&c.serverHasMore===null){const _=p??Ft(l);_!==void 0&&m({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!d&&c.identity===l&&c.serverHasMore===null&&p===null&&Ft(l)===void 0&&c.probeSubscribedIdentity!==l&&(m(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),mr(l,async()=>{const _=Dt(t,e,0,n,1),S=await h.call("COLLECTION_THREADS_LIST",_),{totalCount:C}=Rt(S),A=Ye(u.threads.get(),t,e,n);return C===void 0?!1:Et(A,C)},_=>{m(S=>S.identity!==l?S:{...S,isProbing:!1,serverHasMore:_})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=l;m(C=>C.identity===S?{...C,isFetching:!0}:C);try{const C=Ye(f,t,e,n),A=Dt(t,e,C,n,Ke),I=await ps(()=>h.call("COLLECTION_THREADS_LIST",A)),{items:k,hasMore:z,totalCount:E}=Rt(I),H=new Set(f.map(hr)),O=ur(k,H,t,e,n),D=C;u.mergeThreads(k),m(M=>{if(M.identity!==S)return M;let P;return E!==void 0?P=Et(D+O,E):P=k.length===0||O===0?!1:z,dr(S,P),{...M,isFetching:!1,serverHasMore:P}})}catch(C){const A=C,I=A instanceof Error?A.message:String(A);te.error(`Could not load more tasks: ${I}`),m(k=>k.identity===S?{...k,isFetching:!1}:k)}},v=c.isFetching||c.isProbing,w=!d&&!v&&ar(b,c.serverHasMore);let N;return r[2]!==v||r[3]!==y||r[4]!==w||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(N={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},r[2]=v,r[3]=y,r[4]=w,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=N):N=r[7],N}function hr(t){return t.id}function pr(t){const e=$.c(20),{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:g}=fr("status",n,d),[x,b]=L.useState(!1);!x&&i.length===0&&g===!0&&!c&&!m&&(b(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==r||e[1]!==a||e[2]!==d||e[3]!==l||e[4]!==o||e[5]!==i){let y;e[7]!==r||e[8]!==a||e[9]!==d||e[10]!==l||e[11]!==o?(y=v=>s.jsx(us,{task:v,isActive:r===v.id,onClick:()=>o(v),onArchive:a&&v.created_by===d.currentUserId?()=>l(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=r,e[8]=a,e[9]=d,e[10]=l,e[11]=o,e[12]=y):y=e[12],p=i.map(y),e[0]=r,e[1]=a,e[2]=d,e[3]=l,e[4]=o,e[5]=i,e[6]=p}else p=e[6];let h;e[13]!==f||e[14]!==c||e[15]!==u?(h=(f||c)&&s.jsx(fs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=h):h=e[16];let j;return e[17]!==p||e[18]!==h?(j=s.jsxs(s.Fragment,{children:[p,h]}),e[17]=p,e[18]=h,e[19]=j):j=e[19],j}function xr(t){const e=$.c(36),{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d}=t,c=Zn[n],m=c.icon,[u,f]=sr(`status-${n}`,!1);let g;e[0]!==u||e[1]!==f?(g=function(){f(!u)},e[0]=u,e[1]=f,e[2]=g):g=e[2];const x=g;let b;e[3]!==x?(b=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=b):b=e[4];let p;e[5]!==m||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=p):p=e[7];let h;e[8]!==u?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(gt,{size:14}):s.jsx(ti,{size:14})}),e[8]=u,e[9]=h):h=e[9];let j;e[10]!==p||e[11]!==h?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,h]}),e[10]=p,e[11]=h,e[12]=j):j=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==i.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:i.length})}),e[15]=i.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==x||e[19]!==b||e[20]!==j||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:b,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,y,v]}),e[17]=u,e[18]=x,e[19]=b,e[20]=j,e[21]=y,e[22]=v,e[23]=w):w=e[23];let N;e[24]!==r||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==l||e[29]!==o||e[30]!==n||e[31]!==i?(N=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(pr,{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d})}),e[24]=r,e[25]=a,e[26]=u,e[27]=d,e[28]=l,e[29]=o,e[30]=n,e[31]=i,e[32]=N):N=e[32];let _;return e[33]!==w||e[34]!==N?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,N]}),e[33]=w,e[34]=N,e[35]=_):_=e[35],_}function Lt(t){const e=$.c(38),{threads:n,groupBy:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qn,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const h=u?"No threads match your filters":"No threads yet";let j;return e[1]!==h?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:h})]}),e[1]=h,e[2]=j):j=e[2],j}const f=n.length>1||d;if(i==="status"){let p;if(e[3]!==r||e[4]!==f||e[5]!==a||e[6]!==l||e[7]!==o||e[8]!==n){let j;e[10]!==r||e[11]!==f||e[12]!==a||e[13]!==l||e[14]!==o?(j=y=>s.jsx(xr,{status:y.status,threads:y.threads,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:f,filters:a},y.status),e[10]=r,e[11]=f,e[12]=a,e[13]=l,e[14]=o,e[15]=j):j=e[15],p=Hi(n).map(j),e[3]=r,e[4]=f,e[5]=a,e[6]=l,e[7]=o,e[8]=n,e[9]=p}else p=e[9];let h;return e[16]!==p?(h=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=h):h=e[17],h}let g;if(e[18]!==r||e[19]!==f||e[20]!==a||e[21]!==l||e[22]!==o||e[23]!==n){let p;e[25]!==r||e[26]!==f||e[27]!==a||e[28]!==l||e[29]!==o?(p=h=>s.jsx(us,{task:h,isActive:r===h.id,onClick:()=>o(h),onArchive:f&&h.created_by===a.currentUserId?()=>l(h):void 0,showAutomationBadge:!!h.trigger_id,showAgentIcon:!0},h.id),e[25]=r,e[26]=f,e[27]=a,e[28]=l,e[29]=o,e[30]=p):p=e[30],g=n.map(p),e[18]=r,e[19]=f,e[20]=a,e[21]=l,e[22]=o,e[23]=n,e[24]=g}else g=e[24];let x;e[31]!==d||e[32]!==c||e[33]!==m?(x=(d||c)&&s.jsx(fs,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=x):x=e[34];let b;return e[35]!==g||e[36]!==x?(b=s.jsxs(s.Fragment,{children:[g,x]}),e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Bt(t){const e=$.c(17),{label:n,onClick:i,active:r,children:o}=t,[l,a]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=r&&"bg-sidebar-accent text-foreground";let g;e[4]!==f?(g=B(f),e[4]=f,e[5]=g):g=e[5];let x;e[6]!==o||e[7]!==n||e[8]!==i||e[9]!==g?(x=s.jsx(fe,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:i,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:g,children:o})}),e[6]=o,e[7]=n,e[8]=i,e[9]=g,e[10]=x):x=e[10];let b;e[11]!==n?(b=s.jsx(he,{side:"bottom",children:n}),e[11]=n,e[12]=b):b=e[12];let p;return e[13]!==l||e[14]!==x||e[15]!==b?(p=s.jsxs(pe,{open:l,children:[x,b]}),e[13]=l,e[14]=x,e[15]=b,e[16]=p):p=e[16],p}function Je(t){const e=$.c(13),{label:n,value:i,onChange:r,options:o}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==o?(d=o.map(gr),e[4]=o,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==i?(c=s.jsx(Pn,{type:"single",size:"sm",value:i,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=i,e[9]=c):c=e[9];let m;return e[10]!==l||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,c]}),e[10]=l,e[11]=c,e[12]=m):m=e[12],m}function gr(t){return s.jsxs(On,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function gs({onNavigate:t}={}){const{data:e}=ge.useSession(),n=e?.user?.id,{org:i}=se(),r=Jt({connectionId:es,orgId:i.id,orgSlug:i.slug}),o=Le(i.id).id,l=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=pt(),u=a.filter(T=>!T.hidden),{hide:f}=ss(),g=le(),{setTaskId:x,createNewTask:b}=xt(),p=at({strict:!1}),h=Ue({strict:!1}),j=p.taskId??null,y=h.virtualmcpid??a.find(T=>T.id===j)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,U)=>(U.updated_at??"").localeCompare(T.updated_at??"")),[N,_]=L.useState("all"),[S,C]=L.useState("flat"),[A,I]=He("sidebar-threads-scope-all",!1),[k,z]=L.useState(!1),[E,H]=L.useState(!1),O={type:N,member:"mine",currentUserId:n??null},D=T=>n?T.filter(U=>U.created_by===n):[],M=T=>N==="automation"?T.filter(U=>!!U.trigger_id):N==="manual"?T.filter(U=>!U.trigger_id):T,P=D(w),G=M(P),Q=M(w),Z=A?Q:G,F=T=>{if(n&&T.created_by&&T.created_by!==n)return;const U=T.id===j;if(f(T.id),!U)return;const X=P.find(W=>W.id!==T.id&&W.virtual_mcp_id===T.virtual_mcp_id);v(),X?x(X.id,X.virtual_mcp_id):g({to:"/$org",params:{org:i.slug}})},R=T=>{v(),x(T.id,T.virtual_mcp_id)},Y=async T=>{try{const U=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((U.structuredContent??U).items?.length??0)===0}catch{return!1}},K=async()=>{const T=y??o;me("sidebar_new_thread_clicked",{virtual_mcp_id:T});const U=P.find(X=>X.virtual_mcp_id===T&&X.title==="New chat");if(U&&await Y(U.id)){v(),x(U.id,T);return}v(),b(T)},{state:ne,isMobile:V,toggleSidebar:ie}=be();if(ne==="collapsed"&&!V){const T=Le(i.id),U=new Map((l??[]).map(W=>[W.id,W])),X=W=>(W?U.get(W):void 0)??(W===o?T:void 0);return s.jsxs(ue,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(q,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ie,children:s.jsx(Vt,{size:16})})}),s.jsx(q,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{K()},children:s.jsx(Nt,{size:16})})}),Z.map(W=>{const ce=X(W.virtual_mcp_id);return s.jsx(q,{children:s.jsx(J,{tooltip:W.title||"New chat",isActive:W.id===j,onClick:()=>R(W),children:s.jsx(ye,{icon:ce?.icon??null,name:ce?.title??"Agent",size:"2xs"})})},W.id)})]})}const ae=S!=="flat"||N!=="all"||A===!0,xe=s.jsxs(Ge,{children:[s.jsxs(pe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ae,children:[s.jsx(Mn,{size:16}),ae&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(he,{side:"bottom",children:"Filter threads"})]}),s.jsxs(We,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Je,{label:"View",value:S,onChange:T=>{me("tasks_panel_group_by_changed",{to_value:T}),C(T)},options:[{value:"flat",label:"List",icon:s.jsx(mn,{size:13})},{value:"status",label:"Status",icon:s.jsx(un,{size:13})}]}),s.jsx(Je,{label:"Type",value:N,onChange:T=>{me("tasks_panel_filter_changed",{to_value:T}),_(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Je,{label:"Scope",value:A?"team":"mine",onChange:T=>I(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(tt,{delayDuration:300,children:s.jsxs("div",{className:B("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(rs,{}),xe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Bt,{label:"Search threads",onClick:()=>{me("tasks_panel_search_opened"),H(!0),z(!0)},children:s.jsx(dn,{size:16})}),s.jsx(Bt,{label:"New thread",onClick:()=>{K()},children:s.jsx(Nt,{size:16})})]})]})});return V?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(Ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Lt,{threads:Z,groupBy:S,activeTaskId:j,onSelectTask:R,onArchiveTask:F,filters:O,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ae})}),E&&s.jsx(Pt,{open:k,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Lt,{threads:Z,groupBy:S,activeTaskId:j,onSelectTask:R,onArchiveTask:F,filters:O,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ae})})}),E&&s.jsx(Pt,{open:k,onOpenChange:z})]})}const br=5,jr=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function bs(){const t=$.c(3),{state:e}=be();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:br}).map(Sr)}),t[0]=r):r=t[0],r}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:jr.map(vr)})]}),t[2]=i):i=t[2],i}function vr(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:B("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(yr)})]},e)}function yr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Sr(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function _r(){const t=$.c(4),e=ls();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Qi,{}),t[0]=n):n=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Wt,{children:s.jsx(L.Suspense,{fallback:s.jsx(bs,{}),children:s.jsx(gs,{})})}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsx(ts,{children:s.jsx(ds,{sections:e,footer:n,additionalContent:i})}),t[2]=e,t[3]=r):r=t[3],r}function Nr(t){const e=$.c(8),{onClose:n}=t,i=ls();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Yi,{}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{}),e[1]=o):o=e[1];let l;e[2]!==n?(l=s.jsx(Wt,{children:s.jsx(L.Suspense,{fallback:o,children:s.jsx(gs,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==i||e[6]!==l?(a=s.jsx(ts,{children:s.jsx(Pi,{sections:i,onClose:n,footer:r,additionalContent:l})}),e[4]=n,e[5]=i,e[6]=l,e[7]=a):a=e[7],a}function js(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wr=Os({name:Ps().min(2,"Organization name is required")});function Cr(t){const e=$.c(41),{open:n,onOpenChange:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Ds(wr),defaultValues:{name:""}},e[0]=r):r=e[0];const o=Es(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Ar,onSuccess:kr},e[1]=l):l=e[1];const a=Fs(l),d=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ci,{children:[s.jsx(di,{children:"Create a new organization"}),s.jsx(mi,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==o){let _;e[6]!==a?(_=S=>a.mutateAsync(S),e[6]=a,e[7]=_):_=e[7],m=o.handleSubmit(_),e[3]=a,e[4]=o,e[5]=m}else m=e[5];let u;e[8]!==o.formState.isSubmitting?(u=_=>{const{field:S}=_;return s.jsxs(xi,{children:[s.jsx(gi,{children:"Organization Name"}),s.jsx(bi,{children:s.jsx(yi,{...S,placeholder:"Acme Inc.",disabled:o.formState.isSubmitting})}),s.jsx(ji,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",js(S.value)]})]}),s.jsx(vi,{})]})},e[8]=o.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==o.control||e[11]!==u?(f=s.jsx(hi,{control:o.control,name:"name",render:u}),e[10]=o.control,e[11]=u,e[12]=f):f=e[12];let g;e[13]!==d?(g=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=g):g=e[14];let x;e[15]!==a||e[16]!==o?(x=()=>{a.reset(),o.reset()},e[15]=a,e[16]=o,e[17]=x):x=e[17];let b;e[18]!==o.formState.isSubmitting||e[19]!==x?(b=s.jsx(li,{disabled:o.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=o.formState.isSubmitting,e[19]=x,e[20]=b):b=e[20];const p=!o.formState.isValid||o.formState.isSubmitting;let h;e[21]!==o.formState.isSubmitting?(h=o.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(si,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=o.formState.isSubmitting,e[22]=h):h=e[22];let j;e[23]!==p||e[24]!==h?(j=s.jsx(Ze,{type:"submit",variant:"default",disabled:p,children:h}),e[23]=p,e[24]=h,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==b?(y=s.jsxs(ui,{children:[b,j]}),e[26]=j,e[27]=b,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==g?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=g,e[33]=v):v=e[33];let w;e[34]!==o||e[35]!==v?(w=s.jsxs(ai,{children:[c,s.jsx(pi,{...o,children:v})]}),e[34]=o,e[35]=v,e[36]=w):w=e[36];let N;return e[37]!==i||e[38]!==n||e[39]!==w?(N=s.jsx(fi,{open:n,onOpenChange:i,children:w}),e[37]=i,e[38]=n,e[39]=w,e[40]=N):N=e[40],N}function kr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ar(t){const e=js(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ge.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const i=n?.data?.slug??e;if(!i)throw new Error("Failed to create organization");return{orgSlug:i}}function vs(){const t=L.useContext(Rs),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date),refetch:()=>n?.()}}function Ir(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function jt(t){const e=$.c(13),{org:n,size:i}=t,r=i===void 0?"sm":i,o=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==o?(a=B(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Ir(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function $r({invitation:t,onChanged:e}){const[n,i]=L.useState(!1),r=t.organizationName??"Unknown organization",o=async()=>{i(!0);try{const d=await ge.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),i(!1);return}}catch{te.error("Failed to accept invitation"),i(!1);return}te.success(`Joined ${r}`),Bs();let a;try{a=(await ge.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},l=async()=>{i(!0);try{const a=await ge.organization.rejectInvitation({invitationId:t.id});if(a.error){te.error(a.error.message),i(!1);return}te.success("Invitation declined"),i(!1),e()}catch{te.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(jt,{org:{name:r},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:r}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Ze,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:o,disabled:n,children:"Accept"}),s.jsx(Ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:n,"aria-label":`Decline invitation to ${r}`,children:s.jsx(oi,{size:14})})]})]})}function zr(t){const e=$.c(29),{orgParam:n,onSelectOrg:i,onCreateOrg:r}=t,{data:o}=Ls(),{invitations:l,refetch:a}=vs();let d;e[0]!==n?(d=(k,z)=>k.slug===n?-1:z.slug===n?1:k.name.localeCompare(z.name),e[0]=n,e[1]=d):d=e[1];const c=[...o??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),g=f?c.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(os,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=k=>u(k.target.value),e[3]=b):b=e[3];let p;e[4]!==m?(p=k=>k.key==="Escape"&&m&&u(""),e[4]=m,e[5]=p):p=e[5];let h;e[6]!==m||e[7]!==p?(h=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:b,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=p,e[8]=h):h=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx($e,{size:16}),e[9]=j):j=e[9];let y;e[10]!==r?(y=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=r,e[11]=y):y=e[11];let v;e[12]!==h||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,h,y]}),e[12]=h,e[13]=y,e[14]=v):v=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let N;e[15]!==l||e[16]!==m||e[17]!==a?(N=!m&&l.map(k=>s.jsx($r,{invitation:k,onChanged:a},k.id)),e[15]=l,e[16]=m,e[17]=a,e[18]=N):N=e[18];const _=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==i||e[20]!==n?(S=k=>s.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(jt,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[19]=i,e[20]=n,e[21]=S):S=e[21];const C=g.map(S);let A;e[22]!==N||e[23]!==_||e[24]!==C?(A=s.jsxs("div",{className:w,children:[N,_,C]}),e[22]=N,e[23]=_,e[24]=C,e[25]=A):A=e[25];let I;return e[26]!==A||e[27]!==v?(I=s.jsxs(s.Fragment,{children:[v,A]}),e[26]=A,e[27]=v,e[28]=I):I=e[28],I}function Tr(t){const e=$.c(22),{trigger:n,orgParam:i,align:r,side:o}=t,l=r===void 0?"start":r,a=o===void 0?"bottom":o,d=le(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let g;e[0]!==n?(g=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=g):g=e[1];const x=String(c);let b;e[2]!==d?(b=N=>{m(!1),d({to:"/$org",params:{org:N}})},e[2]=d,e[3]=b):b=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{m(!1),f(!0)},e[4]=p):p=e[4];let h;e[5]!==i||e[6]!==x||e[7]!==b?(h=s.jsx(zr,{orgParam:i,onSelectOrg:b,onCreateOrg:p},x),e[5]=i,e[6]=x,e[7]=b,e[8]=h):h=e[8];let j;e[9]!==l||e[10]!==a||e[11]!==h?(j=s.jsx(We,{side:a,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Or,onCloseAutoFocus:Mr,children:h}),e[9]=l,e[10]=a,e[11]=h,e[12]=j):j=e[12];let y;e[13]!==c||e[14]!==g||e[15]!==j?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[g,j]}),e[13]=c,e[14]=g,e[15]=j,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(Cr,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let w;return e[19]!==v||e[20]!==y?(w=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=w):w=e[21],w}function Mr(t){return t.preventDefault()}function Or(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Pr(t){const e=$.c(21),{value:n,onChange:i,placeholder:r,onKeyDown:o,className:l,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==l?(m=B("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=B("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let g;e[4]!==a?(g=a?s.jsx(Gt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=g):g=e[5];let x;e[6]!==i?(x=j=>i(j.target.value),e[6]=i,e[7]=x):x=e[7];let b;e[8]!==d||e[9]!==o||e[10]!==c||e[11]!==x||e[12]!==n?(b=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:o,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=o,e[10]=c,e[11]=x,e[12]=n,e[13]=b):b=e[13];let p;e[14]!==f||e[15]!==g||e[16]!==b?(p=s.jsxs("label",{className:f,children:[g,b]}),e[14]=f,e[15]=g,e[16]=b,e[17]=p):p=e[17];let h;return e[18]!==m||e[19]!==p?(h=s.jsx("div",{className:m,children:p}),e[18]=m,e[19]=p,e[20]=h):h=e[20],h}const Dr="Select an existing agent";function Er(t){const e=$.c(5),{children:n}=t;let i;e[0]!==n?(i=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(he,{side:"right",sideOffset:8,children:Dr}),e[2]=r):r=e[2];let o;return e[3]!==i?(o=s.jsxs(pe,{defaultOpen:!0,delayDuration:0,children:[i,r]}),e[3]=i,e[4]=o):o=e[4],o}function Fr(t){const e=le(),{create:n}=ss(),{locator:i}=se(),r=at({strict:!1}),o=Ue({strict:!1});return async l=>{const a=crypto.randomUUID(),d=l===o.virtualmcpid?Fn(t,i,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Ht(t){const e=$.c(20),{agent:n,selected:i,onClick:r}=t,o=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==o?(l=B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==i?(u=i&&s.jsx(ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==l||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:l,children:[a,m,u]}),e[14]=r,e[15]=l,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Rr(t){const e=$.c(24),{onClose:n,onSelectAgent:i,selectedAgentId:r}=t,[o,l]=L.useState(""),a=ht(),d=a??[],{org:c}=se(),{data:m}=ge.useSession(),u=m?.user?.id??"anon",f=_n(a),g=Nn(),x=Fr(c.slug),b=$n(a),p=o.toLowerCase(),h=d.filter(Br).filter(P=>!b.has(P.id)).filter(Lr).filter(P=>!o||P.title.toLowerCase().includes(p)),j=Le(c.id),y=!o||j.title.toLowerCase().includes(p),v=!!(i&&y);let w;e[0]!==n||e[1]!==i?(w=()=>{i?.(null),n(),l("")},e[0]=n,e[1]=i,e[2]=w):w=e[2];const N=w,_=P=>{if(i){i(P.id),n(),l("");return}wn({orgId:c.id,userId:u},P.id,f),g(),n(),l(""),x(P.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let C;e[3]!==o?(C=s.jsx(Pr,{value:o,onChange:l,placeholder:"Search agents..."}),e[3]=o,e[4]=C):C=e[4];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",I=i&&y&&j&&s.jsx(Ht,{agent:j,selected:!r||r===j.id,onClick:N}),k=h.map(P=>s.jsx(Ht,{agent:P,selected:i?r===P.id:void 0,onClick:()=>_(P)},P.id));let z;e[5]!==v||e[6]!==o||e[7]!==h.length?(z=h.length===0&&!v&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o?"No agents found":"No agents yet"}),e[5]=v,e[6]=o,e[7]=h.length,e[8]=z):z=e[8];let E;e[9]!==I||e[10]!==k||e[11]!==z?(E=s.jsxs("div",{className:A,children:[I,k,z]}),e[9]=I,e[10]=k,e[11]=z,e[12]=E):E=e[12];let H;e[13]!==c.slug?(H={org:c.slug},e[13]=c.slug,e[14]=H):H=e[14];let O;e[15]!==n?(O=()=>n(),e[15]=n,e[16]=O):O=e[16];let D;e[17]!==O||e[18]!==H?(D=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Hs,{to:"/$org/settings/agents",params:H,onClick:O,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[17]=O,e[18]=H,e[19]=D):D=e[19];let M;return e[20]!==D||e[21]!==C||e[22]!==E?(M=s.jsxs("div",{className:S,children:[C,E,D]}),e[20]=D,e[21]=C,e[22]=E,e[23]=M):M=e[23],M}function Lr(t){return!bn(t.id)}function Br(t){return!Zt(t.id)}function Hr(t){const e=$.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:i,trigger:r,onSelectAgent:o,selectedAgentId:l,side:a,align:d}=n,c=i===void 0?!1:i,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,g]=L.useState(!1),x=mt(),{setOpenMobile:b}=be(),p=Sn(),h=p?"border border-border":void 0;let j;e[2]!==p?(j=C=>p?s.jsx(Er,{children:C}):C,e[2]=p,e[3]=j):j=e[3];const y=j;let v;e[4]!==x||e[5]!==b?(v=()=>{g(!1),x&&b(!1)},e[4]=x,e[5]=b,e[6]=v):v=e[6];const w=v;let N;e[7]!==w||e[8]!==o||e[9]!==f||e[10]!==l?(N=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Rr,{onClose:w,onSelectAgent:o,selectedAgentId:l})}),e[7]=w,e[8]=o,e[9]=f,e[10]=l,e[11]=N):N=e[11];const _=N;let S;return e[12]!==u||e[13]!==c||e[14]!==h||e[15]!==p||e[16]!==x||e[17]!==f||e[18]!==_||e[19]!==m||e[20]!==r||e[21]!==y?(S=s.jsx(s.Fragment,{children:x?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:r}):c?y(s.jsx(ve,{"aria-label":"Browse agents",className:B(h),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),g(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(q,{children:y(s.jsxs(J,{tooltip:p?void 0:"Browse agents",className:B(h),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),g(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Xt,{open:f,onOpenChange:g,direction:"bottom",children:s.jsxs(Qt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Yt,{className:"sr-only",children:"Browse agents"}),_]})})]}):s.jsxs(Ge,{open:f,onOpenChange:C=>{C&&!f&&me("agent_browser_opened",{surface:"desktop_popover"}),g(C)},children:[r?s.jsx(ze,{asChild:!0,children:r}):c?y(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:B(h),children:s.jsx($e,{className:"size-4"})})})):s.jsx(q,{children:y(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:p?void 0:"Browse agents",className:B(h),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(We,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:_})]})}),e[12]=u,e[13]=c,e[14]=h,e[15]=p,e[16]=x,e[17]=f,e[18]=_,e[19]=m,e[20]=r,e[21]=y,e[22]=S):S=e[22],S}const Ur="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Gr(t){const e=$.c(19),{agentId:n,fallback:i,onOpenHome:r,onPick:o}=t,l=qe(n)??i??null,a=l?.title??"Super Agent",d=`Open ${a} home`,c=l?.icon??null;let m;e[0]!==c||e[1]!==a?(m=s.jsx(ye,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=m):m=e[2];let u;e[3]!==r||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:r,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=r,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(gt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=g):g=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:Ur,children:[f,g]}),e[10]=f,e[11]=x):x=e[11];let b;e[12]!==n||e[13]!==o||e[14]!==x?(b=s.jsx(Hr,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:o,trigger:x}),e[12]=n,e[13]=o,e[14]=x,e[15]=b):b=e[15];let p;return e[16]!==u||e[17]!==b?(p=s.jsxs("div",{className:"flex items-center gap-1",children:[u,b]}),e[16]=u,e[17]=b,e[18]=p):p=e[18],p}function Ut(){const t=$.c(43),{org:e}=se(),{state:n,isMobile:i}=be(),r=le();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const l=at(o);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const d=Ue(a),{threads:c}=pt(),{setTaskId:m,createNewTask:u}=xt(),f=vs().invitations.length>0,g=n==="collapsed"||i;let x;t[2]!==e.id?(x=Le(e.id),t[2]=e.id,t[3]=x):x=t[3];const b=x,p=b.id,h=l.taskId?d.virtualmcpid??p:p;let j;t[4]!==u||t[5]!==p||t[6]!==r||t[7]!==e.slug||t[8]!==m||t[9]!==c?(j=M=>{if(!M||M===p){r({to:"/$org",params:{org:e.slug}});return}const P=Si(c,M);P?m(P.id,M):u(M)},t[4]=u,t[5]=p,t[6]=r,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=j):j=t[10];const y=j,v=f?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let w;t[11]!==e?(w=s.jsx(jt,{org:e,size:"sm"}),t[11]=e,t[12]=w):w=t[12];let N;t[13]!==f||t[14]!==g?(N=f&&s.jsx("span",{className:B("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",g?"-top-1":"top-1/2 -translate-y-1/2")}),t[13]=f,t[14]=g,t[15]=N):N=t[15];let _;t[16]!==w||t[17]!==N?(_=s.jsxs("span",{className:"relative inline-flex",children:[w,N]}),t[16]=w,t[17]=N,t[18]=_):_=t[18];let S;t[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(gt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[19]=S):S=t[19];let C;t[20]!==v||t[21]!==_?(C=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":v,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[_,S]})}),t[20]=v,t[21]=_,t[22]=C):C=t[22];let A;t[23]!==e.slug||t[24]!==C?(A=s.jsx(Tr,{orgParam:e.slug,trigger:C}),t[23]=e.slug,t[24]=C,t[25]=A):A=t[25];let I;t[26]!==e.name?(I=s.jsx(he,{side:"bottom",children:e.name}),t[26]=e.name,t[27]=I):I=t[27];let k;t[28]!==A||t[29]!==I?(k=s.jsx(kt,{children:s.jsxs(pe,{children:[A,I]})}),t[28]=A,t[29]=I,t[30]=k):k=t[30];let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[31]=z):z=t[31];const E=h===p?b:void 0;let H;t[32]!==h||t[33]!==y?(H=()=>y(h),t[32]=h,t[33]=y,t[34]=H):H=t[34];let O;t[35]!==h||t[36]!==y||t[37]!==E||t[38]!==H?(O=s.jsx(kt,{children:s.jsx(L.Suspense,{fallback:z,children:s.jsx(Gr,{agentId:h,fallback:E,onOpenHome:H,onPick:y})})}),t[35]=h,t[36]=y,t[37]=E,t[38]=H,t[39]=O):O=t[39];let D;return t[40]!==k||t[41]!==O?(D=s.jsx(ii,{className:"wco-no-drag",children:s.jsxs(ri,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[k,O]})}),t[40]=k,t[41]=O,t[42]=D):D=t[42],D}const Wr="sidebar.open";function qr(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Gs,{}),t[0]=e):e=t[0],e}function la(){const t=$.c(24),e=mt(),[n,i]=He(Wr,!1),{width:r,wrapperRef:o,onStartResize:l,resetWidth:a}=Ci();let d;t[0]!==e?(d=e?s.jsxs(ee.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(rs,{}),s.jsx(Ut,{}),s.jsx(ot,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ee.TogglesSlot,{}),s.jsx(ee.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ee.CenterSlot,{}),s.jsx(ee.RightSlot,{})]}):s.jsxs(ee.Header,{children:[s.jsxs(ee.LeftColumn,{children:[s.jsx(Ut,{}),s.jsx(ee.TogglesSlot,{})]}),s.jsx(ee.CenterSlot,{}),s.jsxs(ee.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(ee.TabsSlot,{})}),s.jsx(ee.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(_r,{}),s.jsx(_i,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[8]=g):g=t[8];let x;t[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ks,{className:"flex flex-col",style:g,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(L.Suspense,{fallback:s.jsx(qr,{}),children:s.jsx(Us,{})})})})}),t[9]=x):x=t[9];let b;t[10]!==u||t[11]!==f||t[12]!==o?(b=s.jsxs(Vs,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,x]}),t[10]=u,t[11]=f,t[12]=o,t[13]=b):b=t[13];let p;t[14]!==e?(p=e&&s.jsx(Xn,{renderSidebar:Kr}),t[14]=e,t[15]=p):p=t[15];let h;t[16]!==d||t[17]!==b||t[18]!==p?(h=s.jsx(ni,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,b,p]})}),t[16]=d,t[17]=b,t[18]=p,t[19]=h):h=t[19];let j;return t[20]!==i||t[21]!==n||t[22]!==h?(j=s.jsx(En,{children:s.jsx(ee.Provider,{children:s.jsx(Xs,{open:n,onOpenChange:i,children:h})})}),t[20]=i,t[21]=n,t[22]=h,t[23]=j):j=t[23],j}function Kr(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Nr,{onClose:e})})})}export{la as default};
|