decocms 3.26.1 → 3.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BDfUS-lh.js → AlertCircle-9EFUZenf.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-8daK_Mrm.js → ArrowUpRight-97355q5v.js} +1 -1
- package/dist/client/assets/{Check-C9-fsV6-.js → Check-D-9dblUn.js} +1 -1
- package/dist/client/assets/{CheckCircle-B_rVd_l8.js → CheckCircle-C2ualSpf.js} +1 -1
- package/dist/client/assets/{ChevronDown--2U1gfXf.js → ChevronDown-Cf2Q-GlB.js} +1 -1
- package/dist/client/assets/{ChevronLeft-TttN4toV.js → ChevronLeft-BaV4nFMQ.js} +1 -1
- package/dist/client/assets/{ChevronRight-BVEygGVH.js → ChevronRight-CrZy8tHx.js} +1 -1
- package/dist/client/assets/{ChevronUp-C-xaVM7d.js → ChevronUp-BAxoXhnT.js} +1 -1
- package/dist/client/assets/{Container-Bso4WS0x.js → Container-CYcITvPW.js} +1 -1
- package/dist/client/assets/{DotsVertical-Q3F6UWC_.js → DotsVertical-SvwN4CeV.js} +1 -1
- package/dist/client/assets/{Eye-CKz6zS_m.js → Eye-ByuwKsdh.js} +1 -1
- package/dist/client/assets/{FilterLines-SKQT-eWL.js → FilterLines-BJZdiggU.js} +1 -1
- package/dist/client/assets/{Globe01-iupU5eqh.js → Globe01-DfGFlik1.js} +1 -1
- package/dist/client/assets/{HardDrive-DpuvbJvr.js → HardDrive-DNFvbooP.js} +1 -1
- package/dist/client/assets/{Key01-6eW9IRFT.js → Key01-CzmPnHuw.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BkxKKkMX.js → LayoutLeft-CQ8Vq9nI.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BXhdtlT7.js → LinkExternal01-CgI1VTqi.js} +1 -1
- package/dist/client/assets/{Monitor01-DUICZH5i.js → Monitor01-Cw6kmClm.js} +1 -1
- package/dist/client/assets/{Palette-CS36Icvl.js → Palette-Druykvzw.js} +1 -1
- package/dist/client/assets/{Play-CbbqvWPd.js → Play-CMJ2IWYR.js} +1 -1
- package/dist/client/assets/{Plus-CSNkL1o7.js → Plus-CjrtKB-Y.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Dncu-kYd.js → RefreshCcw01-3BsQQkRx.js} +1 -1
- package/dist/client/assets/{SearchMd-B-q2EsGW.js → SearchMd-BL2y99rx.js} +1 -1
- package/dist/client/assets/{Settings02-CdJ0CKrL.js → Settings02-Cd4DIqaJ.js} +1 -1
- package/dist/client/assets/{Shield01-Crgp73nV.js → Shield01-zIbMct6w.js} +1 -1
- package/dist/client/assets/{Star01-CN33xE6w.js → Star01-eRdSY4QW.js} +1 -1
- package/dist/client/assets/{Stars01-BXO9Nc4-.js → Stars01-v0yz6PCZ.js} +1 -1
- package/dist/client/assets/{Stars02-B4CoQ82E.js → Stars02-EuAFDZ5E.js} +1 -1
- package/dist/client/assets/{Sun-CEzPQTAJ.js → Sun-CH2HWLCn.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BI_yHGXL.js → SwitchHorizontal01-BMnNI1Fi.js} +1 -1
- package/dist/client/assets/{Tool01-R6WyaXsu.js → Tool01-Dcq7KP8Y.js} +1 -1
- package/dist/client/assets/{Trash01-C3pnsiws.js → Trash01-Cup7-ZTT.js} +1 -1
- package/dist/client/assets/{Upload01-BHsRhr7X.js → Upload01-C9yi1Bdg.js} +1 -1
- package/dist/client/assets/{User01-JuGE_kA7.js → User01-thAIxsAs.js} +1 -1
- package/dist/client/assets/{Users01-BVUwP6xk.js → Users01-DPJm6-u-.js} +1 -1
- package/dist/client/assets/{Users03-Bek4Ag3W.js → Users03-BlNe2PnN.js} +1 -1
- package/dist/client/assets/{X-BdwzFded.js → X-1KR4wibP.js} +1 -1
- package/dist/client/assets/{XCircle-D_3MYOn4.js → XCircle-UPVnJx4i.js} +1 -1
- package/dist/client/assets/{XClose-Da5LgJSi.js → XClose-pR-QU0OQ.js} +1 -1
- package/dist/client/assets/{Zap-DHBAOmqP.js → Zap-Cl-JM7N9.js} +1 -1
- package/dist/client/assets/{ZapSquare-CP91cLS8.js → ZapSquare-B1o2Q9OR.js} +1 -1
- package/dist/client/assets/{ZoomOut-CaG3Pd1Z.js → ZoomOut-D8vQ49we.js} +1 -1
- package/dist/client/assets/{access-gate-AjUY-gkn.js → access-gate-CWPebMdP.js} +1 -1
- package/dist/client/assets/{accordion-JZC0q2Q6.js → accordion-aX0NKKKh.js} +1 -1
- package/dist/client/assets/{add-section-modal-B5en9ngD.js → add-section-modal-DbuGc2qc.js} +1 -1
- package/dist/client/assets/{agent-capabilities-gx2lqG9R.js → agent-capabilities-BJLQSkAN.js} +1 -1
- package/dist/client/assets/{agent-icon-DAPplz1A.js → agent-icon-DT8dQ9tq.js} +1 -1
- package/dist/client/assets/{agent-icons-Dk-aO0GI.js → agent-icons-DRrDyR7j.js} +1 -1
- package/dist/client/assets/{agents-list-Cqp5uusD.js → agents-list-DDhPNISh.js} +1 -1
- package/dist/client/assets/{ai-providers-DLs4iaPF.js → ai-providers-GxPLAPId.js} +1 -1
- package/dist/client/assets/{alert-C04qeSRO.js → alert-DyB_hFGI.js} +1 -1
- package/dist/client/assets/{alert-dialog-Q8M8ngFf.js → alert-dialog-CSkQIwm8.js} +1 -1
- package/dist/client/assets/app-editor-BsxVHV86.js +1 -0
- package/dist/client/assets/{auth-catchall-BbuGVKd9.js → auth-catchall-BUwhIhze.js} +1 -1
- package/dist/client/assets/{auth-split-layout-sY7FyVQz.js → auth-split-layout-CY4CpKKX.js} +1 -1
- package/dist/client/assets/{automation-list-row-BRsSmcOA.js → automation-list-row-5M4PNEWw.js} +1 -1
- package/dist/client/assets/{automation-runs-gdpRnoA6.js → automation-runs-BJTRztep.js} +1 -1
- package/dist/client/assets/{automations-zDSrpko2.js → automations-Cy981ltn.js} +1 -1
- package/dist/client/assets/{avatar-BqNGZrFg.js → avatar-BHEXMwdE.js} +1 -1
- package/dist/client/assets/{badge-BBLSXFe0.js → badge-Da0IsrqH.js} +1 -1
- package/dist/client/assets/{brand-context-Be4M-ZZ_.js → brand-context-DTmvDRqf.js} +1 -1
- package/dist/client/assets/{buckets-D-k7xX4_.js → buckets-Cv3AB_TT.js} +1 -1
- package/dist/client/assets/{calendar-CfY7gp-n.js → calendar-BbhbS2FE.js} +1 -1
- package/dist/client/assets/{capability-load-error-CjE005FF.js → capability-load-error-Dfw4xb8a.js} +1 -1
- package/dist/client/assets/{card-D41ULrnf.js → card-BUTabNLA.js} +1 -1
- package/dist/client/assets/{chat-context-BFmJRDzy.js → chat-context-Bu6qpu9K.js} +1 -1
- package/dist/client/assets/{checkbox-CBmcFqoh.js → checkbox--nDaSUZE.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BcBQhgvD.js → cli-auth-success-CUSnxWUp.js} +1 -1
- package/dist/client/assets/{collection-detail-kkp2noDH.js → collection-detail-DHxXW6T4.js} +1 -1
- package/dist/client/assets/{collection-display-button-BNfKMIgL.js → collection-display-button-BfQyXSIv.js} +1 -1
- package/dist/client/assets/{collection-search-CDLcWLfd.js → collection-search-LsgoMrVO.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DrTvLn6R.js → collection-table-wrapper-D3ciIIEv.js} +1 -1
- package/dist/client/assets/{collection-tabs-CbZbTMYY.js → collection-tabs-CQJiHDMR.js} +1 -1
- package/dist/client/assets/{collections-BxDJ4z3g.js → collections-C_j8CeI8.js} +1 -1
- package/dist/client/assets/{command-B8qtKAnE.js → command-BehF6pb8.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CDUh5Otr.js → connect-desktop-dialog-DPqrgnkS.js} +1 -1
- package/dist/client/assets/{connection-card-CSsbMtfE.js → connection-card-EXvV7rxl.js} +1 -1
- package/dist/client/assets/{connection-detail-E_AC0EPN.js → connection-detail-58UbdFd3.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BonOFyzw.js → connection-form-helpers-DoJomSCQ.js} +1 -1
- package/dist/client/assets/{connections-Ca9YMoFm.js → connections-BMZIGugH.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BHhoQKaF.js → decopilot-sse-pool-BUhEcft-.js} +1 -1
- package/dist/client/assets/{dialog-Cwf6uY_y.js → dialog-Bm1pP7Vu.js} +1 -1
- package/dist/client/assets/{domain-settings-oLlPZ4Z3.js → domain-settings-DHsRsnmX.js} +1 -1
- package/dist/client/assets/{drawer-CF0b7Dg3.js → drawer-B51jkLaX.js} +1 -1
- package/dist/client/assets/{dropdown-menu-UGlYpK18.js → dropdown-menu-CIu58K9q.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-V_3blVro.js → dynamic-plugin-layout-DWE13BKk.js} +1 -1
- package/dist/client/assets/{empty-state-CoXt5rYF.js → empty-state-1AbmTLd7.js} +1 -1
- package/dist/client/assets/{empty-state-h_qXtgbw.js → empty-state-BfmCVPeb.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BKeaLULt.js → extract-connection-data-LoMqboL3.js} +1 -1
- package/dist/client/assets/{features-u4e9ViPZ.js → features-DWJ09Fdz.js} +1 -1
- package/dist/client/assets/{file-explorer-BHKOSo2p.js → file-explorer-Dmpsw-4-.js} +1 -1
- package/dist/client/assets/{file-type-icon-7TqtrpuQ.js → file-type-icon-CX5JEvCQ.js} +1 -1
- package/dist/client/assets/{files-C9p4yssc.js → files-QExlaPCQ.js} +1 -1
- package/dist/client/assets/{form-Bbpyf2N_.js → form-BcPtow5O.js} +1 -1
- package/dist/client/assets/{general-DqO6G3WI.js → general-CLesrOe8.js} +1 -1
- package/dist/client/assets/{generate-id-BHe5yw90.js → generate-id-CadHbHqX.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CVG2zsbh.js → github-repo-picker-B24_pGAu.js} +1 -1
- package/dist/client/assets/{header-tab-button-t5WNjrVG.js → header-tab-button-DSX6YPkf.js} +1 -1
- package/dist/client/assets/{hover-card-Azyk5Kxa.js → hover-card-DE2_8MLP.js} +1 -1
- package/dist/client/assets/{image-field-CXkzTwa7.js → image-field-D00iYa4G.js} +1 -1
- package/dist/client/assets/{index-CwyiLbkO.js → index-50-dmJFK.js} +1 -1
- package/dist/client/assets/{index-sqqDCA0K.js → index-B1bHiM-j.js} +1 -1
- package/dist/client/assets/{index-DkWynf6r.js → index-BZvxagUr.js} +4 -4
- package/dist/client/assets/{index-f0X8ef8k.js → index-BflNEs6l.js} +1 -1
- package/dist/client/assets/{index-Co-NpkaC.js → index-Bo5bzoUm.js} +1 -1
- package/dist/client/assets/{index-B_tO_wVS.js → index-CCs3Chg3.js} +1 -1
- package/dist/client/assets/{index-CAs8iq4o.js → index-CHdFXpqc.js} +1 -1
- package/dist/client/assets/{index-DJTEqPXf.js → index-CR_LeyNj.js} +1 -1
- package/dist/client/assets/{index-DcI1sEv_.js → index-D6ELOmUq.js} +1 -1
- package/dist/client/assets/{index-Bjie-Vum.js → index-Db3P8pHg.js} +1 -1
- package/dist/client/assets/{index-skFG1_ns.js → index-Dr4Isy1j.js} +1 -1
- package/dist/client/assets/{index-DbpajCnQ.js → index-J2NhKqyZ.js} +1 -1
- package/dist/client/assets/{index-DCeOX6CY.js → index-YdX5UjUB.js} +1 -1
- package/dist/client/assets/{index-CiRQNPVt.js → index-biiHZ5l9.js} +3 -3
- package/dist/client/assets/{index-Dci2MWs9.js → index-r7-3fAFf.js} +1 -1
- package/dist/client/assets/{index-redirect-D6d28r6b.js → index-redirect-pPYMz5D6.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BND7fiNU.js → infiniteQueryObserver-B0VBGXv5.js} +1 -1
- package/dist/client/assets/{input-D3E6n6la.js → input-5PMMNPU9.js} +1 -1
- package/dist/client/assets/{integration-icon-vaGvNHHz.js → integration-icon-Dy-a3x5R.js} +1 -1
- package/dist/client/assets/{label-DLUhXNk7.js → label-CcC4_aKf.js} +1 -1
- package/dist/client/assets/{layout-PdamBSR0.js → layout-CbTbCjmA.js} +1 -1
- package/dist/client/assets/{login-CX7WJC_U.js → login-Dn4EF5EK.js} +1 -1
- package/dist/client/assets/{members-Bw9vSm5N.js → members-BwcNzXwU.js} +1 -1
- package/dist/client/assets/{monaco-editor-Bgzj9gt4.js → monaco-editor-CJVi8Ty8.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DOXVZiRZ.js → monitoring-stats-row-BAplEVfE.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cfp_JeoH.js → oauth-callback-D5XAAL8p.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DOmF-VOd.js → oauth-callback-ai-provider-tGQCB63I.js} +1 -1
- package/dist/client/assets/{onboarding-C4KH1uOA.js → onboarding-CgvYwT2C.js} +1 -1
- package/dist/client/assets/{org-install-CrBGOT0T.js → org-install-CV5qvXsE.js} +1 -1
- package/dist/client/assets/{org-layout-BCdmD1Ye.js → org-layout-BFil8fwL.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-shv3-lWc.js → org-plugin-layout-DyCflrr1.js} +1 -1
- package/dist/client/assets/{page-seo-form-qANN0Bj1.js → page-seo-form-Bbna5w2y.js} +1 -1
- package/dist/client/assets/page-seo-sheet-D9M3CoUb.js +1 -0
- package/dist/client/assets/{pair-CpEuUIpQ.js → pair-Ba1UoSSJ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CrO1kZyK.js → plugin-empty-state-DM8dR2Wk.js} +1 -1
- package/dist/client/assets/{plugin-header-DTTyXwvF.js → plugin-header-CaWKfaZE.js} +1 -1
- package/dist/client/assets/{plugin-layout-CXygrV9H.js → plugin-layout-DrVKV-lp.js} +1 -1
- package/dist/client/assets/{popover-C1MgHMHU.js → popover-Cvcd3A1d.js} +1 -1
- package/dist/client/assets/{post-editor-aLUVDKW-.js → post-editor-CM-ESdP7.js} +1 -1
- package/dist/client/assets/{primitives-BBsQqWkR.js → primitives-DWXKnou4.js} +1 -1
- package/dist/client/assets/{profile-CjQ0lj2q.js → profile-DmCC3zYK.js} +1 -1
- package/dist/client/assets/{project-app-view-Br1j175t.js → project-app-view-C9azYjZP.js} +1 -1
- package/dist/client/assets/record-editor-DJucp492.js +1 -0
- package/dist/client/assets/registry-hKns5OCc.js +2 -0
- package/dist/client/assets/{registry-layout-CHn-aQtX.js → registry-layout-DPaKDLDg.js} +1 -1
- package/dist/client/assets/{require-capability-vzDtNqMc.js → require-capability-DVI2cKO3.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BE5eceMw.js → required-auth-layout-zYH6NIDF.js} +1 -1
- package/dist/client/assets/{reset-password-8Qbe0fKB.js → reset-password-DXXx8e6Q.js} +1 -1
- package/dist/client/assets/{resizable-CrMJy22o.js → resizable-BbbLszRZ.js} +1 -1
- package/dist/client/assets/{roles-BRTHcf_Y.js → roles-vHYrQg5g.js} +1 -1
- package/dist/client/assets/save-referenced-block-q2CPWVkl.js +1 -0
- package/dist/client/assets/{save-status-BZf4M3tc.js → save-status-pJVz5vCQ.js} +1 -1
- package/dist/client/assets/{schema-form-DNuUk0WJ.js → schema-form-nZH-67HX.js} +1 -1
- package/dist/client/assets/{scroll-area-verb-Y8E.js → scroll-area-BqOijBAI.js} +1 -1
- package/dist/client/assets/{search-input-CZKc9XZR.js → search-input-BgGthWir.js} +1 -1
- package/dist/client/assets/{secrets-ScbIQJha.js → secrets-YkTDT7yT.js} +1 -1
- package/dist/client/assets/{sections-editor-CysGozit.js → sections-editor-CSz4pxMw.js} +1 -1
- package/dist/client/assets/{select-BMX9jvQG.js → select-CNSUv3cw.js} +1 -1
- package/dist/client/assets/{select-model-BB2-8k_v.js → select-model-0CGh6cKF.js} +1 -1
- package/dist/client/assets/{seo-editor-gLS5nwCw.js → seo-editor-CspZxazh.js} +1 -1
- package/dist/client/assets/{settings-layout-EdgjO8iZ.js → settings-layout-DRYgevr6.js} +1 -1
- package/dist/client/assets/{settings-section-CQW36fJV.js → settings-section-V9kb8x32.js} +1 -1
- package/dist/client/assets/{sheet-Utq51ofH.js → sheet-D99KevZC.js} +1 -1
- package/dist/client/assets/{shell-controls-CXM2LvTp.js → shell-controls-DSSWZ7Ia.js} +1 -1
- package/dist/client/assets/{shell-layout-3b4NfWya.js → shell-layout-4LsIVsl3.js} +1 -1
- package/dist/client/assets/{shell-route-loading-DSfyT3dO.js → shell-route-loading-5KSwc3hj.js} +1 -1
- package/dist/client/assets/{sidebar-BBqRosV0.js → sidebar-CPZXU-2w.js} +1 -1
- package/dist/client/assets/{skeleton-dQOYuNlQ.js → skeleton--DN75sg7.js} +1 -1
- package/dist/client/assets/{sortable.esm-D7AgS_lX.js → sortable.esm-g7bq1nDZ.js} +1 -1
- package/dist/client/assets/{spinner-_hqWpG0c.js → spinner-DJD6-9r-.js} +1 -1
- package/dist/client/assets/{sso-Cg_UsaPg.js → sso-D04DjSnZ.js} +1 -1
- package/dist/client/assets/{store-BIRCadh0.js → store-DTK5DubB.js} +1 -1
- package/dist/client/assets/store-registry-nABlp_7k.js +2 -0
- package/dist/client/assets/{switch-CTAzWsjZ.js → switch-D6SWnoi2.js} +1 -1
- package/dist/client/assets/{tab-id-C7unjelb.js → tab-id-D4SJwEQy.js} +1 -1
- package/dist/client/assets/{table-BuLHtfTA.js → table-Cx3PhNth.js} +1 -1
- package/dist/client/assets/{tabs-DVd_y6YL.js → tabs-DCDCb9Pz.js} +1 -1
- package/dist/client/assets/{task-status-5oHTrkjV.js → task-status-P3BULAyA.js} +1 -1
- package/dist/client/assets/{textarea-D1h5iq3D.js → textarea-QEULyLXh.js} +1 -1
- package/dist/client/assets/{toggle-group-vA7ktrP-.js → toggle-group-DhVqXGfs.js} +1 -1
- package/dist/client/assets/{toolbar-D3G0G9U8.js → toolbar-BsB4Mvyv.js} +1 -1
- package/dist/client/assets/{tools-list-BL4u8QMN.js → tools-list-Ch5RlbiL.js} +1 -1
- package/dist/client/assets/{tooltip-C47QSg8i.js → tooltip-bsrBmmjV.js} +1 -1
- package/dist/client/assets/{types-Df_Z2FUK.js → types-jBdXInU0.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bwbur0GT.js → use-ai-providers-v0sCRzMO.js} +1 -1
- package/dist/client/assets/{use-automations-B9mdkXiu.js → use-automations-Db8x6SNU.js} +1 -1
- package/dist/client/assets/{use-capability-1uxC8-oZ.js → use-capability-BPM45mbW.js} +1 -1
- package/dist/client/assets/{use-collections-B1Mg9Y32.js → use-collections-B5Jh_wGd.js} +1 -1
- package/dist/client/assets/{use-connection-DpxWBF4Y.js → use-connection-DyJtuHQI.js} +1 -1
- package/dist/client/assets/{use-copy-B_uLjrw6.js → use-copy-P6tx-uOp.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BBxov1Li.js → use-create-virtual-mcp-CWYOy45e.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DDZnxori.js → use-debounced-autosave-ClLbciGl.js} +1 -1
- package/dist/client/assets/{use-delete-connection-eQCNxdaR.js → use-delete-connection-C60uGs0b.js} +1 -1
- package/dist/client/assets/{use-file-configs-o-LP0Blk.js → use-file-configs-CC8ghNUa.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D8iZFAEQ.js → use-infinite-scroll-xQQ6lYk4.js} +1 -1
- package/dist/client/assets/{use-list-state-BkETzhj1.js → use-list-state-BZmeG7gi.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D0A6RZFw.js → use-mcp-client-CWFUu1lY.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BuV5LRNr.js → use-mcp-prompts-B5RhBVzg.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BTzw-W77.js → use-mcp-tools-DePRGZE5.js} +1 -1
- package/dist/client/assets/{use-members-DDVaE5yQ.js → use-members-Cw70r_Wh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Drh7z3D_.js → use-navigate-to-agent-CdsMYUzL.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BlGBETGB.js → use-org-auth-client--i_Sx92M.js} +1 -1
- package/dist/client/assets/{use-org-sso-nq4qWMpD.js → use-org-sso-C1cJTBIx.js} +1 -1
- package/dist/client/assets/{use-organization-roles-i1o2TOl8.js → use-organization-roles-ATKYiNpl.js} +1 -1
- package/dist/client/assets/{use-organization-settings-PADdytdf.js → use-organization-settings-Izqk1Gkk.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C0VEE_YX.js → use-registry-connections-C-WVKjSU.js} +1 -1
- package/dist/client/assets/{use-secrets-DZDUsUGC.js → use-secrets-BpdIBEe6.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DR8WA3PU.js → use-status-sounds-BJ_LqdGJ.js} +1 -1
- package/dist/client/assets/{use-view-mode-BpduDYTq.js → use-view-mode-CbT8E3wV.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DciRKx1X.js → use-virtual-mcp-0jbEmvOc.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BGg7INCQ.js +1 -0
- package/dist/client/assets/{useRouterState-BXwm4DCl.js → useRouterState-Dm0UHjU4.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B4dQiTEq.js +1 -0
- package/dist/client/assets/{user-DaO6RYsc.js → user-DRDdFgUw.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B-ZBNJWV.js → view-mode-toggle-G0qNMbJ1.js} +1 -1
- package/dist/client/assets/{workflow-C3zNP9N8.js → workflow-D1PUPL3K.js} +1 -1
- package/dist/client/assets/workflow-detail-CRUxUbKb.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +382 -378
- package/dist/server/migrate.js +98 -94
- package/dist/server/server.js +244 -244
- package/package.json +1 -1
- package/dist/client/assets/app-editor-CNA09iLR.js +0 -1
- package/dist/client/assets/page-seo-sheet-D4wNk0RY.js +0 -1
- package/dist/client/assets/record-editor-QHa9iaw5.js +0 -1
- package/dist/client/assets/registry-BkLh6mX8.js +0 -2
- package/dist/client/assets/save-referenced-block-CBTtXYiM.js +0 -1
- package/dist/client/assets/store-registry-Duulq-Qg.js +0 -2
- package/dist/client/assets/useInfiniteQuery-C1jLiRqA.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CHLM-3cW.js +0 -1
- package/dist/client/assets/workflow-detail-CFwJ5L9v.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e5 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e6 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e7 as Nt,e8 as es,o as Ys,v as Zs,e9 as en,ea as tn}from"./index-CiRQNPVt.js";import{D as sn,F as nn,B as on}from"./index-DCeOX6CY.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-D0A6RZFw.js";import{a as ts}from"./use-virtual-mcp-DciRKx1X.js";import{M as Oe}from"./monaco-editor-Bgzj9gt4.js";import{b as ln,R as zt,a as cn}from"./resizable-CrMJy22o.js";import{B as le}from"./badge-BBLSXFe0.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-BMX9jvQG.js";import{S as et}from"./spinner-_hqWpG0c.js";import{V as an}from"./view-mode-toggle-B-ZBNJWV.js";import{ai as un,o as dn,i as fn,z as ss,aj as mn,a3 as pn,u as xn,ak as ns,a9 as hn,N as os,al as gn,am as bn,a5 as ft,an as jn}from"./agent-icon-DAPplz1A.js";import{i as rs}from"./Play-CbbqvWPd.js";import{b as Sn,a as yn,V as Ge}from"./layout-PdamBSR0.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-C47QSg8i.js";import{u as wn,a as vn}from"./use-connection-DpxWBF4Y.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-BTzw-W77.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-Cwf6uY_y.js";import"./index-CwyiLbkO.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-verb-Y8E.js";import{S as Fn}from"./index-Co-NpkaC.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-Azyk5Kxa.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-UGlYpK18.js";import{s as Un}from"./Plus-CSNkL1o7.js";import{b as ps}from"./Tool01-R6WyaXsu.js";import{i as Fe}from"./Check-C9-fsV6-.js";import{s as _t}from"./XClose-Da5LgJSi.js";import{I as Ct}from"./integration-icon-vaGvNHHz.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-JZC0q2Q6.js";import"./index-sqqDCA0K.js";import{i as xs}from"./X-BdwzFded.js";import{u as hs,a as Gn}from"./use-collections-B1Mg9Y32.js";import{E as gs}from"./empty-state-h_qXtgbw.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as Wt}from"./input-D3E6n6la.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{e5 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e6 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e7 as Nt,e8 as es,o as Ys,v as Zs,e9 as en,ea as tn}from"./index-biiHZ5l9.js";import{D as sn,F as nn,B as on}from"./index-YdX5UjUB.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-CWFUu1lY.js";import{a as ts}from"./use-virtual-mcp-0jbEmvOc.js";import{M as Oe}from"./monaco-editor-CJVi8Ty8.js";import{b as ln,R as zt,a as cn}from"./resizable-BbbLszRZ.js";import{B as le}from"./badge-Da0IsrqH.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-CNSUv3cw.js";import{S as et}from"./spinner-DJD6-9r-.js";import{V as an}from"./view-mode-toggle-G0qNMbJ1.js";import{ai as un,o as dn,i as fn,z as ss,aj as mn,a3 as pn,u as xn,ak as ns,a9 as hn,N as os,al as gn,am as bn,a5 as ft,an as jn}from"./agent-icon-DT8dQ9tq.js";import{i as rs}from"./Play-CMJ2IWYR.js";import{b as Sn,a as yn,V as Ge}from"./layout-CbTbCjmA.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-bsrBmmjV.js";import{u as wn,a as vn}from"./use-connection-DyJtuHQI.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-DePRGZE5.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-Bm1pP7Vu.js";import"./index-50-dmJFK.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-BqOijBAI.js";import{S as Fn}from"./index-Bo5bzoUm.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-DE2_8MLP.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-CIu58K9q.js";import{s as Un}from"./Plus-CjrtKB-Y.js";import{b as ps}from"./Tool01-Dcq7KP8Y.js";import{i as Fe}from"./Check-D-9dblUn.js";import{s as _t}from"./XClose-pR-QU0OQ.js";import{I as Ct}from"./integration-icon-Dy-a3x5R.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-aX0NKKKh.js";import"./index-B1bHiM-j.js";import{i as xs}from"./X-1KR4wibP.js";import{u as hs,a as Gn}from"./use-collections-B5Jh_wGd.js";import{E as gs}from"./empty-state-BfmCVPeb.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as Wt}from"./input-5PMMNPU9.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
|
|
3
3
|
`:""} ${u}${f}: ${n(d)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as Ye,as as de,at as et,au as tt,av as Ie,G as he,aw as st,ax as it,r as A,ay as nt,az as rt,aA as ot,aB as lt,aC as ve,aD as at,aE as ct,aF as dt,e as T,j as i,q as Z,c as q,l as $e,aG as pe,o as W,K as re,n as oe,a as mt,v as ut,E as ft,b as ht,B as je}from"./index-CiRQNPVt.js";import{u as xe}from"./tooltip-C47QSg8i.js";import{i as pt,u as ee,S as Te,g as xt}from"./use-mcp-client-D0A6RZFw.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-DciRKx1X.js";import{i as jt}from"./Check-C9-fsV6-.js";import{Z as wt,A as Y,$ as Nt,u as St,c as _t}from"./agent-icon-DAPplz1A.js";import{s as ge}from"./Plus-CSNkL1o7.js";import{i as Ae}from"./X-BdwzFded.js";import{u as Ct,b as kt,h as Et,C as ie}from"./agent-capabilities-gx2lqG9R.js";import{u as It,c as $t}from"./chat-context-BFmJRDzy.js";import{N as Tt}from"./agent-icons-Dk-aO0GI.js";import{u as Me,a as ne,K as Oe,P as Re,D as ze,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-D7AgS_lX.js";import{u as Pe,a as De,o as Ut}from"./use-organization-settings-PADdytdf.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-3b4NfWya.js";import{I as Qt}from"./input-D3E6n6la.js";import{S as Wt}from"./scroll-area-verb-Y8E.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Zt}from"./sheet-Utq51ofH.js";import{S as H}from"./skeleton-dQOYuNlQ.js";import{t as He}from"./ChevronDown--2U1gfXf.js";import{d as Le}from"./ZoomOut-CaG3Pd1Z.js";import{g as Jt,M as Xt}from"./types-Df_Z2FUK.js";import{I as Yt}from"./integration-icon-vaGvNHHz.js";import{u as es}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Ue,P as ts,e as ss,s as is,g as ns}from"./pair-CpEuUIpQ.js";import{a as rs}from"./XCircle-D_3MYOn4.js";import{g as os}from"./use-mcp-prompts-BuV5LRNr.js";import{u as ls,w as as}from"./tab-id-C7unjelb.js";import{a as cs,d as ds,c as ms,b as us,D as fs}from"./dropdown-menu-UGlYpK18.js";import{s as hs}from"./Trash01-C3pnsiws.js";import{a as ps,u as xs}from"./use-ai-providers-Bwbur0GT.js";import{a as gs}from"./toolbar-D3G0G9U8.js";import"./use-collections-B1Mg9Y32.js";import"./AlertCircle-BDfUS-lh.js";import"./Tool01-R6WyaXsu.js";import"./SwitchHorizontal01-BI_yHGXL.js";import"./RefreshCcw01-Dncu-kYd.js";import"./ArrowUpRight-8daK_Mrm.js";import"./ZapSquare-CP91cLS8.js";import"./Users03-Bek4Ag3W.js";import"./CheckCircle-B_rVd_l8.js";import"./ChevronLeft-TttN4toV.js";import"./ChevronRight-BVEygGVH.js";import"./ChevronUp-C-xaVM7d.js";import"./DotsVertical-Q3F6UWC_.js";import"./Container-Bso4WS0x.js";import"./Eye-CKz6zS_m.js";import"./Globe01-iupU5eqh.js";import"./FilterLines-SKQT-eWL.js";import"./Star01-CN33xE6w.js";import"./Palette-CS36Icvl.js";import"./HardDrive-DpuvbJvr.js";import"./Stars02-B4CoQ82E.js";import"./Key01-6eW9IRFT.js";import"./LayoutLeft-BkxKKkMX.js";import"./LinkExternal01-BXhdtlT7.js";import"./Monitor01-DUICZH5i.js";import"./Sun-CEzPQTAJ.js";import"./Play-CbbqvWPd.js";import"./SearchMd-B-q2EsGW.js";import"./Settings02-CdJ0CKrL.js";import"./Shield01-Crgp73nV.js";import"./Stars01-BXO9Nc4-.js";import"./Upload01-BHsRhr7X.js";import"./User01-JuGE_kA7.js";import"./Users01-BVUwP6xk.js";import"./XClose-Da5LgJSi.js";import"./Zap-DHBAOmqP.js";import"./spinner-_hqWpG0c.js";import"./dialog-Cwf6uY_y.js";import"./drawer-CF0b7Dg3.js";import"./collection-search-CDLcWLfd.js";import"./form-Bbpyf2N_.js";import"./label-DLUhXNk7.js";import"./select-BMX9jvQG.js";import"./tabs-DVd_y6YL.js";import"./toggle-group-vA7ktrP-.js";import"./connect-desktop-dialog-CDUh5Otr.js";import"./popover-C1MgHMHU.js";import"./command-B8qtKAnE.js";import"./index-DJTEqPXf.js";import"./useInfiniteQuery-C1jLiRqA.js";import"./infiniteQueryObserver-BND7fiNU.js";import"./index-Co-NpkaC.js";import"./question-004-sINsf4GQ.js";import"./checkbox-CBmcFqoh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BqNGZrFg.js";import"./settings-section-CQW36fJV.js";import"./card-D41ULrnf.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CSsbMtfE.js";import"./use-registry-connections-C0VEE_YX.js";import"./use-connection-DpxWBF4Y.js";import"./extract-connection-data-BKeaLULt.js";import"./generate-id-BHe5yw90.js";import"./collections-BxDJ4z3g.js";import"./collection-tabs-CbZbTMYY.js";import"./badge-BBLSXFe0.js";import"./textarea-D1h5iq3D.js";import"./connection-form-helpers-BonOFyzw.js";import"./use-infinite-scroll-D8iZFAEQ.js";import"./useSuspenseInfiniteQuery-CHLM-3cW.js";import"./required-auth-layout-BE5eceMw.js";import"./useRouterState-BXwm4DCl.js";import"./use-org-sso-nq4qWMpD.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B_uLjrw6.js";import"./file-type-icon-7TqtrpuQ.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Drh7z3D_.js";import"./decopilot-sse-pool-BHhoQKaF.js";import"./create-sse-subscription-BS5983N4.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ye{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),o=s.length!==n.length,d=n.some((m,u)=>m!==s[u]),l=o||d,c=l?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!et(m,f)});!l&&!c||(l&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(l&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(o=>{o.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,o)=>a!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=tt(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ie(this.#n,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=st(),a=it(),o=A.useMemo(()=>t.map(h=>{const x=r.defaultQueryOptions(h);return x._optimisticResults=n?"isRestoring":"optimistic",x}),[t,r,n]);o.forEach(h=>{nt(h);const x=r.getQueryCache().get(h.queryHash);rt(h,a,x)}),ot(a);const[d]=A.useState(()=>new ys(r,o,e)),[l,c,m]=d.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?d.subscribe(de.batchCalls(h)):lt,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),A.useEffect(()=>{d.setQueries(o,e)},[o,e,d]);const p=l.some((h,x)=>ve(o[x],h))?l.flatMap((h,x)=>{const b=o[x];if(b&&ve(b,h)){const v=new Ie(r,b);return at(b,v,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((h,x)=>{const b=o[x];return b&&ct({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return c(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:dt,enabled:!0,placeholderData:void 0}))},e)}const te=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let o,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(qt,{children:"Manage home"}),d=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=d):(o=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(wt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>a(h.target.value),e[3]=c):c=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[o,d,i.jsxs("div",{className:"relative mt-3",children:[l,i.jsx(Qt,{value:n,onChange:c,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Zs,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==p?(g=i.jsx(Zt,{open:s,onOpenChange:r,children:p}),e[12]=r,e[13]=s,e[14]=p,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=Z(),r=Pe();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,o=De(),d=bt(),l=he();let c;e[2]!==s||e[3]!==l?(c=()=>l.refetchQueries({queryKey:re.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=c):c=e[4];const m=c;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let p;e[7]!==a||e[8]!==t?(p=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=p):p=e[9];const h=p>=te;let x;e[10]!==h||e[11]!==f||e[12]!==o?(x=C=>f(C)||h?Promise.resolve():o.apply(I=>I.includes(C)?null:[...I,C]),e[10]=h,e[11]=f,e[12]=o,e[13]=x):x=e[13];const b=x;let v;e[14]!==o?(v=C=>o.apply(I=>I.filter(E=>E!==C)),e[14]=o,e[15]=v):v=e[15];const w=v;let y;e[16]!==o?(y=C=>o.apply(()=>C),e[16]=o,e[17]=y):y=e[17];const j=y;let N;e[18]!==d||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==o?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!h&&await o.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=d,e[19]=h,e[20]=f,e[21]=m,e[22]=o,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map(Is)),e[1]=n,e[2]=a):a=e[2];const o=Ns(a);let d,l,c;if(e[3]!==n||e[4]!==o||e[5]!==s){const h=new Map(n.map(Es));d=s.trim().toLowerCase();const x=v=>!d||v.title?.toLowerCase().includes(d);l=o.homeIds.map(v=>h.get(v)).filter(ks).filter(x);let b;e[9]!==o?(b=v=>!o.isOnHome(v.id),e[9]=o,e[10]=b):b=e[10],c=n.filter(Cs).filter(b).filter(x).sort(_s),e[3]=n,e[4]=o,e[5]=s,e[6]=d,e[7]=l,e[8]=c}else d=e[6],l=e[7],c=e[8];const m=c;let u;e[11]!==o||e[12]!==l?(u=i.jsx($s,{home:o,agents:l}),e[11]=o,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==m||e[15]!==o||e[16]!==f?(p=i.jsx(Ms,{home:o,agents:m,hasSearch:f}),e[14]=m,e[15]=o,e[16]=f,e[17]=p):p=e[17];let g;return e[18]!==u||e[19]!==p?(g=i.jsxs(i.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!pt(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function Is(t){return t.id}function Be(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==a?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function $s(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const o=Me(ne(Re,n),ne(Oe,a));let d;e[2]!==s?(d=p=>{const{active:g,over:h}=p;if(!h||g.id===h.id)return;const x=s.homeIds,b=x.indexOf(g.id),v=x.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...x],b,v)).catch(As)},e[2]=s,e[3]=d):d=e[3];const l=d,c=`${s.homeIds.length}/${te}`;let m;e[4]!==c?(m=i.jsx(Be,{title:"On home",hint:c}),e[4]=c,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(ze,{sensors:o,collisionDetection:At,onDragEnd:l,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(p=>i.jsx(Rs,{agent:p,home:s},p.id))})})}),e[6]=r,e[7]=l,e[8]=s,e[9]=o,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,o]=A.useState(20);let d;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const l=r.slice(0,a);let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Be,{title:"Add to home"}),e[5]=c):c=e[5],d=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:l.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>o(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function Fe(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let o;e[0]!==s.id?(o={id:s.id},e[0]=s.id,e[1]=o):o=e[1];const{attributes:d,listeners:l,setNodeRef:c,transform:m,transition:u,isDragging:f}=Rt(o),p=Fe(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,x=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==x||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:x},e[4]=g,e[5]=h,e[6]=x,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Le,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==j?(S=i.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=d,e[13]=l,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let $;e[22]!==p?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=$):$=e[23];let O;e[24]!==_||e[25]!==$?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,$]}),e[24]=_,e[25]=$,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(He,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==I||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[I,O,P]}),e[31]=n,e[32]=I,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Ae,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Qe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==c||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:c,style:v,className:y,children:[L,U]}),e[51]=c,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),o=Fe(t),d=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(He,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:d,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx($e,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Qe,{agent:t,home:e})]})}function Qe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,o,d,l,c,m;if(e[0]!==s||e[1]!==r){const x=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,o=s,d=r,l=v,c=new Set(x.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=d,e[6]=l,e[7]=c,e[8]=m}else n=e[2],a=e[3],o=e[4],d=e[5],l=e[6],c=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==d||e[14]!==l||e[15]!==c?(u=i.jsx(n,{agent:o,home:d,connectionIds:l,pinnedResourceUris:c}),e[11]=n,e[12]=o,e[13]=d,e[14]=l,e[15]=c,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const p=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==p?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:p})}),e[18]=s,e[19]=r,e[20]=p,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const{org:n}=Z(),a=ee({connectionId:Te,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:d}=oe({queryKey:re.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async c=>{try{const m=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:c}}),{item:u}=es(m),f=(u?.tools??[]).flatMap(p=>{const g=Jt(p._meta);return g?[{name:p.name,description:p.description,resourceUri:g}]:[]});return{id:c,title:u?.title??c,icon:u?.icon??null,uiTools:f}}catch{return{id:c,title:c,icon:null,uiTools:[]}}}))).filter(c=>c.uiTools.length>0)});return s.length===0?null:d?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(l=>l.uiTools.map(c=>i.jsx(Fs,{agent:t,home:e,connection:l,tool:c,isPinned:r.has(c.resourceUri)},`${l.id}:${c.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=pe(t.metadata?.ui),c=n?l.filter(u=>u.resourceUri!==r.resourceUri):[...l,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle tile",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Ue(r.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function We(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,o=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==o?(d=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==r?(l=r?i.jsx($e,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==d||e[9]!==l?(c=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:d,children:l}),e[5]=a,e[6]=n,e[7]=r,e[8]=d,e[9]=l,e[10]=c):c=e[10],c}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=Z();let o;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(o={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=o):o=e[3];const d=ee(o);let l;e[4]!==s.id||e[5]!==a.id?(l=re.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=l):l=e[6];let c;e[7]!==d?(c=async()=>{const{prompts:j}=await d.listPrompts();return j.map(Gs)},e[7]=d,e[8]=c):c=e[8];let m;e[9]!==l||e[10]!==c?(m={queryKey:l,queryFn:c,staleTime:3e4,retry:!1},e[9]=l,e[10]=c,e[11]=m):m=e[11];const{data:u,isLoading:f,error:p}=oe(m),g=be(a.slug);let h,x;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],x=[...N];for(const S of h)x.some(k=>k.name===S.name)||x.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=x}else h=e[15],x=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(p&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(x.length===0)return null;let b;e[22]!==n||e[23]!==x?(b=n??x.map(qs),e[22]=n,e[23]=x,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==x||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:x.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:x.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=x,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=t.metadata?.ui?.homePrompts;let c;Array.isArray(l)?c=n?l.filter(u=>u!==s.name):[...l,s.name]:c=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Ue(s.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function Zs(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Js)}),t[0]=e):e=t[0],e}function Js(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const X=1,qe=`home-board.layout.v${X}`;function Ke(t){return`home-board.layout.v${X}.${t}`}const Ge={version:X,tiles:{},hidden:[]};function me(t){return!t||t.version!==X?Ge:{version:X,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Xs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Ke(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(Ke(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=re.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const o=a;let d;e[4]!==o||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${qe}`);if(b.status===404)return o&&Xs(o)?(await Se(t,o),o):Ge;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=o,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==o||e[8]!==n||e[9]!==d?(l={queryKey:n,queryFn:d,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=d,e[10]=l):l=e[10];const{data:c,isLoading:m}=oe(l);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=mt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(p=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=p):p=e[17];const g=p;let h;e[18]!==c?(h=me(c),e[18]=c,e[19]=h):h=e[19];let x;return e[20]!==m||e[21]!==g||e[22]!==h?(x={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=x):x=e[23],x}const Ve=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=Z(),n=ei(r.slug),[a,o]=A.useState(!1),[d,l]=A.useState(null);let c;e[0]!==n.layout?(c=()=>{l(n.layout),o(!0)},e[0]=n.layout,e[1]=c):c=e[1];const m=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),o(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==n?(p=()=>{d&&n.save(d),l(null),o(!1)},e[3]=d,e[4]=n,e[5]=p):p=e[5];const g=p,h=a&&d!==null,x=h?d:n.layout;let b;e[6]!==d||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(d)!==JSON.stringify(n.layout):!1,e[6]=d,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?l(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==x||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:x,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=x,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ve.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ze(){const t=A.useContext(Ve);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=Z(),r=ee({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[o,d]=A.useState(null),[l,c]=A.useState(!1),m=A.useRef(!1),u=async(x,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,c(!0);try{const v=await os(r,x.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:x.name,name:is(x.name,ns(x._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},f=async x=>{if(!m.current){if(x.arguments&&x.arguments.length>0){d(x);return}await u(x)}},p=async x=>{if(!o)return;const b=o;d(null),await u(b,x)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,c(!0);try{const x=crypto.randomUUID();await n({id:x,virtual_mcp_id:t}),a(x,t)}catch(x){console.error("[start-thread-from-prompt] startBlank failed",x),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},dialog:i.jsx(ts,{prompt:o,setPrompt:x=>d(x),onSubmit:p}),dialogPrompt:o,starting:l}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(ut,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:o,onRemove:d}=t,l=xe(),c=A.useRef(null),[m,u]=A.useState(null),[f,p]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Me(ne(Re,g),ne(Oe)),x=s.reduce(oi,0),b=r?Math.max(x+2,4):Math.max(x,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=c.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),p(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),p(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(l){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,I,E,_,$,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==o||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(J=>J.id===m):null;C=ze,B=h,z=j,I=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==d||e[43]!==o||e[44]!==n||e[45]!==s){let J;e[47]!==m||e[48]!==r||e[49]!==d||e[50]!==o||e[51]!==n?(J=se=>i.jsx(ci,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:d,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=d,e[50]=o,e[51]=n,e[52]=J):J=e[52],U=s.map(J),e[40]=m,e[41]=r,e[42]=d,e[43]=o,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:c,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?($={width:G,height:le},e[57]=G,e[58]=le,e[59]=$):$=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=o,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=I,e[27]=E,e[28]=_,e[29]=$,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],I=e[26],E=e[27],_=e[28],$=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==$||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:$,children:O}),e[60]=k,e[61]=_,e[62]=$,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==I||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:I,children:[E,P]}),e[65]=C,e[66]=I,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(l,c)=>r.some(m=>l>=m.x&&l<m.x+m.w&&c>=m.y&&c<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let o;if(e[2]!==a||e[3]!==s){o=[];for(let l=0;l<s;l++)for(let c=0;c<K;c++)a(c,l)||o.push({x:c,y:l});e[2]=a,e[3]=s,e[4]=o}else o=e[4];let d;return e[5]!==o?(d=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(ai)}),e[5]=o,e[6]=d):d=e[6],d}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:o,children:d}=t,l=!r;let c;e[0]!==l||e[1]!==s.id?(c={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=c):c=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:p}=Lt(c),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,x=s.y*V,b=s.h*V,v=p||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==x||e[9]!==h?(N={left:g,top:x,width:h,height:b},e[6]=b,e[7]=g,e[8]=x,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==o||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(Le,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=o,e[17]=a,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:d})}),e[20]=d,e[21]=I):I=e[21];let E;e[22]!==I||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,I]}),e[22]=I,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,o]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(cs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(St,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==r||e[2]!==s.id?(l=x=>{r(s.id,x),o(!1)},e[1]=r,e[2]=s.id,e[3]=l):l=e[3];let c;e[4]!==l||e[5]!==s?(c=i.jsx(mi,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let g;e[14]!==c||e[15]!==p?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[c,m,p]}),e[14]=c,e[15]=p,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:o,children:[d,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[o,d]=A.useState(null);let l;e[0]!==o||e[1]!==s.h||e[2]!==s.w?(l=o??{w:s.w,h:s.h},e[0]=o,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const c=l;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==c.h||e[6]!==c.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[c.w," × ",c.h]})]}),e[5]=c.h,e[6]=c.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let g;e[10]!==c.h||e[11]!==c.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:ii},(x,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=c.w&&j<=c.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>d({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=c.h,e[11]=c.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let o=0;o<s&&a;o++)for(let d=0;d<e&&a;d++)ui(t,n+d,r+o)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(l=>l.id===e);if(!r)return t;const n=t.filter(l=>l.id!==e),a=n.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(l=>l.id===e?{...l,x:a.x,y:a.y}:l.id===a.id?{...l,x:r.x,y:r.y}:l);const d=[{...r,x:s.x,y:s.y}];for(const l of n){const c=fe(d,l.w,l.h);d.push({...l,x:c.x,y:c.y})}return d}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ze();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const o=a;let d,l;if(e[2]!==t||e[3]!==o||e[4]!==s.tiles){l=[];let v;e[7]!==o?(v=y=>y.pinned||!o.has(y.id),e[7]=o,e[8]=v):v=e[8];const w=t.filter(v);d=new Map;for(const y of t)y.minSize&&d.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:I}=ce(j.x,j.y,S);l.push({id:y.id,x:C,y:I,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(l.some(I=>I.id===y.id))continue;const j=y.defaultSize??ni,N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(l,S,k);l.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=o,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let c;e[9]!==t?(c=new Set(t.map(pi)),e[9]=t,e[10]=c):c=e[10];const m=c;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:X,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==l?(g=(v,w)=>{const y=l.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(l,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(h=(v,w)=>{const y=l.find(E=>E.id===v);if(!y)return;const j=d.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=l.filter(E=>E.id!==v),I=[k];for(const E of C){const _=fe(I,E.w,E.h);I.push({...E,x:_.x,y:_.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=h):h=e[24];let x;e[25]!==f||e[26]!==s||e[27]!==l?(x=v=>{const w=l.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=x):x=e[28];let b;return e[29]!==r||e[30]!==p||e[31]!==g||e[32]!==h||e[33]!==x?(b={snapshot:p,isLoading:r,moveTile:g,resizeTile:h,hideTile:x},e[29]=r,e[30]=p,e[31]=g,e[32]=h,e[33]=x,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:o}=si(s);let d;e[2]!==r||e[3]!==n?(d=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=d):d=e[4];const l=d;let c;return e[5]!==a||e[6]!==l||e[7]!==n||e[8]!==o?(c={open:l,startBlank:n,dialog:a,starting:o},e[5]=a,e[6]=l,e[7]=n,e[8]=o,e[9]=c):c=e[9],c}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:o}=ye(s.agentId);let d;e[0]!==s||e[1]!==n?(d=()=>n(s),e[0]=s,e[1]=n,e[2]=d):d=e[2];const l=o||r,c=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let f;e[3]!==c||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",c,m,u),e[3]=c,e[4]=m,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let x;e[14]!==h?(x=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=x):x=e[15];let b;e[16]!==x||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,x]}),e[16]=x,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=v):v=e[20];let w;e[21]!==o||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(w=i.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":o,className:f,children:[p,b,v]}),e[21]=o,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:o}=Z(),{open:d,startBlank:l,dialog:c,starting:m}=ye(s.agentId);let u,f,p,g,h;if(e[0]!==n||e[1]!==d||e[2]!==o.id||e[3]!==o.slug||e[4]!==r||e[5]!==l||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==l?(w=()=>{l()},e[14]=l,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let I;e[23]!==C?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=I):I=e[24];let E;e[25]!==k||e[26]!==I?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,I]}),e[25]=k,e[26]=I,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Ii,{}),e[35]=_):_=e[35],e[36]!==o.id||e[37]!==o.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:o.id,orgSlug:o.slug})})}),e[36]=o.id,e[37]=o.slug,e[38]=s,e[39]=f):f=e[39],p=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map($=>i.jsx("button",{type:"button",onClick:()=>d($),disabled:m,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:$.title})},$.promptName))}),e[0]=n,e[1]=d,e[2]=o.id,e[3]=o.slug,e[4]=r,e[5]=l,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=p,e[12]=g,e[13]=h}else u=e[9],f=e[10],p=e[11],g=e[12],h=e[13];let x;e[40]!==u||e[41]!==f||e[42]!==p?(x=i.jsxs("div",{className:u,children:[f,p]}),e[40]=u,e[41]=f,e[42]=p,e[43]=x):x=e[43];let b;return e[44]!==c||e[45]!==g||e[46]!==h||e[47]!==x?(b=i.jsxs("div",{className:g,children:[h,x,c]}),e[44]=c,e[45]=g,e[46]=h,e[47]=x,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const o=ee(a),d=s.minHeight??200,l=s.maxHeight??4e3;let c;return e[4]!==o||e[5]!==r||e[6]!==n||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri?(c=i.jsx(Xt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:o,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=o,e[5]=r,e[6]=n,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=c):c=e[11],c}function Ii(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function $i(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let d;e[6]!==a?(d=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,o]}),e[6]=a,e[7]=d):d=e[7];let l;e[8]!==n||e[9]!==d?(l=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,d]}),e[8]=n,e[9]=d,e[10]=l):l=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=c):c=e[11];let m;return e[12]!==l?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,c]}),e[12]=l,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:o,dialog:d,starting:l}=ye(s.agentId);let c,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==l||e[5]!==s.agentIcon||e[6]!==s.agentName){const p=r.filter(Ai);c="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==o?(g=()=>{o()},e[10]=o,e[11]=g):g=e[11];const h=l||n,x=n&&"pl-10 pr-10";let b;e[12]!==x?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",x),e[12]=x,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=p.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:p.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=o,e[4]=l,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=c,e[8]=m,e[9]=u}else c=e[7],m=e[8],u=e[9];let f;return e[28]!==d||e[29]!==c||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:c,children:[m,u,d]}),e[28]=d,e[29]=c,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=Z(),{isLoading:n,prompts:a,tiles:o}=be(r.slug),d=Pe()?.ids??[];let l;e[0]!==d?(l=new Set(d),e[0]=d,e[1]=l):l=e[1];const c=l,m=De();let u;e[2]!==o?(u=new Set(o.map(Pi)),e[2]=o,e[3]=u):u=e[3];const f=u;let p;if(e[4]!==a){p=new Map;for(const _ of a){const $=p.get(_.agentId);$?$.push(_):p.set(_.agentId,[_])}e[4]=a,e[5]=p}else p=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==o){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const $=a.filter(_);g=[...o.map(zi),...$.map(Ri)],e[6]=a,e[7]=f,e[8]=o,e[9]=g}else g=e[9];const h=g;let x;e[12]!==h?(x=new Map(h.map(Oi)),e[12]=h,e[13]=x):x=e[13];const b=x;let v;e[14]!==h||e[15]!==c?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:c.has(_.data.agentId)})),e[14]=h,e[15]=c,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply($=>$.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==c||e[22]!==j?(N=_=>{const $=b.get(_);$&&c.has($.data.agentId)?j($.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=c,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==p?(k=_=>{const $=b.get(_.id);if(!$)return null;if($.kind==="tile"){const O=p.get($.data.agentId)??[];return i.jsx(ft,{fallback:i.jsx(Ti,{tile:$.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx($i,{icon:$.data.agentIcon,name:$.data.agentName}),children:i.jsx(Ci,{tile:$.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:$.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=p,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ht.useSession(),{org:s}=Z(),r=xe(),n=It(),{selectedVirtualMcp:a}=$t();let o;t[0]!==s.id?(o=xt(s.id),t[0]=s.id,t[1]=o):o=t[1];const l=a??o;let c;t[2]!==s.slug?(c=Ft(s.slug),t[2]=s.slug,t[3]=c):c=t[3],oe(c);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:Te,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=ee(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==u?(p=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=p):p=t[12];let g;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==p||t[19]!==g?(h={queries:[f,p,g]},t[17]=f,t[18]=p,t[19]=g,t[20]=h):h=t[20],js(h);const x=xs(),b=vt(l.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(x.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const E=I,_=v&&y&&j!=null,$=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==$?(O=_?i.jsx(ie.CreditsEyebrow,{balanceDollars:j}):$?i.jsx(ie.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=$,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let d;e[5]!==a||e[6]!==o?(d=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ie.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=c):c=e[9];let m;return e[10]!==d?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,d,l,c]}),e[10]=d,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:o,save:d,cancel:l,hasChanges:c}=Ze(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==o||e[3]!==c||e[4]!==a||e[5]!==d?(p=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:c,onEnter:o,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=o,e[3]=c,e[4]=a,e[5]=d,e[6]=p):p=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const x=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==x?(b=q("relative flex flex-col items-center px-10 pb-4",x),e[10]=x,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(ie.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==p||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[p,g,k]}),e[28]=k,e[29]=p,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:o,onAddTile:d}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==d?(u=i.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Ae,{size:14}),e[3]=f):f=e[3];let p;e[4]!==o?(p=i.jsxs(je,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=o,e[5]=p):p=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let x;e[7]!==a||e[8]!==g?(x=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=x):x=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==x?(b=i.jsxs(i.Fragment,{children:[u,p,x]}),e[10]=u,e[11]=p,e[12]=x,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(_t,{size:14}),e[14]=l):l=e[14];let c;return e[15]!==n?(c=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=n,e[16]=c):c=e[16],c}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|
|
1
|
+
import{ar as Ye,as as de,at as et,au as tt,av as Ie,G as he,aw as st,ax as it,r as A,ay as nt,az as rt,aA as ot,aB as lt,aC as ve,aD as at,aE as ct,aF as dt,e as T,j as i,q as Z,c as q,l as $e,aG as pe,o as W,K as re,n as oe,a as mt,v as ut,E as ft,b as ht,B as je}from"./index-biiHZ5l9.js";import{u as xe}from"./tooltip-bsrBmmjV.js";import{i as pt,u as ee,S as Te,g as xt}from"./use-mcp-client-CWFUu1lY.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-0jbEmvOc.js";import{i as jt}from"./Check-D-9dblUn.js";import{Z as wt,A as Y,$ as Nt,u as St,c as _t}from"./agent-icon-DT8dQ9tq.js";import{s as ge}from"./Plus-CjrtKB-Y.js";import{i as Ae}from"./X-1KR4wibP.js";import{u as Ct,b as kt,h as Et,C as ie}from"./agent-capabilities-BJLQSkAN.js";import{u as It,c as $t}from"./chat-context-Bu6qpu9K.js";import{N as Tt}from"./agent-icons-DRrDyR7j.js";import{u as Me,a as ne,K as Oe,P as Re,D as ze,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-g7bq1nDZ.js";import{u as Pe,a as De,o as Ut}from"./use-organization-settings-Izqk1Gkk.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-4LsIVsl3.js";import{I as Qt}from"./input-5PMMNPU9.js";import{S as Wt}from"./scroll-area-BqOijBAI.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Zt}from"./sheet-D99KevZC.js";import{S as H}from"./skeleton--DN75sg7.js";import{t as He}from"./ChevronDown-Cf2Q-GlB.js";import{d as Le}from"./ZoomOut-D8vQ49we.js";import{g as Jt,M as Xt}from"./types-jBdXInU0.js";import{I as Yt}from"./integration-icon-Dy-a3x5R.js";import{u as es}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Ue,P as ts,e as ss,s as is,g as ns}from"./pair-Ba1UoSSJ.js";import{a as rs}from"./XCircle-UPVnJx4i.js";import{g as os}from"./use-mcp-prompts-B5RhBVzg.js";import{u as ls,w as as}from"./tab-id-D4SJwEQy.js";import{a as cs,d as ds,c as ms,b as us,D as fs}from"./dropdown-menu-CIu58K9q.js";import{s as hs}from"./Trash01-Cup7-ZTT.js";import{a as ps,u as xs}from"./use-ai-providers-v0sCRzMO.js";import{a as gs}from"./toolbar-BsB4Mvyv.js";import"./use-collections-B5Jh_wGd.js";import"./AlertCircle-9EFUZenf.js";import"./Tool01-Dcq7KP8Y.js";import"./SwitchHorizontal01-BMnNI1Fi.js";import"./RefreshCcw01-3BsQQkRx.js";import"./ArrowUpRight-97355q5v.js";import"./ZapSquare-B1o2Q9OR.js";import"./Users03-BlNe2PnN.js";import"./CheckCircle-C2ualSpf.js";import"./ChevronLeft-BaV4nFMQ.js";import"./ChevronRight-CrZy8tHx.js";import"./ChevronUp-BAxoXhnT.js";import"./DotsVertical-SvwN4CeV.js";import"./Container-CYcITvPW.js";import"./Eye-ByuwKsdh.js";import"./Globe01-DfGFlik1.js";import"./FilterLines-BJZdiggU.js";import"./Star01-eRdSY4QW.js";import"./Palette-Druykvzw.js";import"./HardDrive-DNFvbooP.js";import"./Stars02-EuAFDZ5E.js";import"./Key01-CzmPnHuw.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./LinkExternal01-CgI1VTqi.js";import"./Monitor01-Cw6kmClm.js";import"./Sun-CH2HWLCn.js";import"./Play-CMJ2IWYR.js";import"./SearchMd-BL2y99rx.js";import"./Settings02-Cd4DIqaJ.js";import"./Shield01-zIbMct6w.js";import"./Stars01-v0yz6PCZ.js";import"./Upload01-C9yi1Bdg.js";import"./User01-thAIxsAs.js";import"./Users01-DPJm6-u-.js";import"./XClose-pR-QU0OQ.js";import"./Zap-Cl-JM7N9.js";import"./spinner-DJD6-9r-.js";import"./dialog-Bm1pP7Vu.js";import"./drawer-B51jkLaX.js";import"./collection-search-LsgoMrVO.js";import"./form-BcPtow5O.js";import"./label-CcC4_aKf.js";import"./select-CNSUv3cw.js";import"./tabs-DCDCb9Pz.js";import"./toggle-group-DhVqXGfs.js";import"./connect-desktop-dialog-DPqrgnkS.js";import"./popover-Cvcd3A1d.js";import"./command-BehF6pb8.js";import"./index-CR_LeyNj.js";import"./useInfiniteQuery-BGg7INCQ.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./index-Bo5bzoUm.js";import"./question-004-sINsf4GQ.js";import"./checkbox--nDaSUZE.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BHEXMwdE.js";import"./settings-section-V9kb8x32.js";import"./card-BUTabNLA.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-EXvV7rxl.js";import"./use-registry-connections-C-WVKjSU.js";import"./use-connection-DyJtuHQI.js";import"./extract-connection-data-LoMqboL3.js";import"./generate-id-CadHbHqX.js";import"./collections-C_j8CeI8.js";import"./collection-tabs-CQJiHDMR.js";import"./badge-Da0IsrqH.js";import"./textarea-QEULyLXh.js";import"./connection-form-helpers-DoJomSCQ.js";import"./use-infinite-scroll-xQQ6lYk4.js";import"./useSuspenseInfiniteQuery-B4dQiTEq.js";import"./required-auth-layout-zYH6NIDF.js";import"./useRouterState-Dm0UHjU4.js";import"./use-org-sso-C1cJTBIx.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-P6tx-uOp.js";import"./file-type-icon-CX5JEvCQ.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-CdsMYUzL.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ye{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),o=s.length!==n.length,d=n.some((m,u)=>m!==s[u]),l=o||d,c=l?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!et(m,f)});!l&&!c||(l&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(l&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(o=>{o.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,o)=>a!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=tt(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ie(this.#n,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=st(),a=it(),o=A.useMemo(()=>t.map(h=>{const x=r.defaultQueryOptions(h);return x._optimisticResults=n?"isRestoring":"optimistic",x}),[t,r,n]);o.forEach(h=>{nt(h);const x=r.getQueryCache().get(h.queryHash);rt(h,a,x)}),ot(a);const[d]=A.useState(()=>new ys(r,o,e)),[l,c,m]=d.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?d.subscribe(de.batchCalls(h)):lt,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),A.useEffect(()=>{d.setQueries(o,e)},[o,e,d]);const p=l.some((h,x)=>ve(o[x],h))?l.flatMap((h,x)=>{const b=o[x];if(b&&ve(b,h)){const v=new Ie(r,b);return at(b,v,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((h,x)=>{const b=o[x];return b&&ct({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return c(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:dt,enabled:!0,placeholderData:void 0}))},e)}const te=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let o,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(qt,{children:"Manage home"}),d=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=d):(o=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(wt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>a(h.target.value),e[3]=c):c=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[o,d,i.jsxs("div",{className:"relative mt-3",children:[l,i.jsx(Qt,{value:n,onChange:c,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Zs,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==p?(g=i.jsx(Zt,{open:s,onOpenChange:r,children:p}),e[12]=r,e[13]=s,e[14]=p,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=Z(),r=Pe();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,o=De(),d=bt(),l=he();let c;e[2]!==s||e[3]!==l?(c=()=>l.refetchQueries({queryKey:re.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=c):c=e[4];const m=c;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let p;e[7]!==a||e[8]!==t?(p=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=p):p=e[9];const h=p>=te;let x;e[10]!==h||e[11]!==f||e[12]!==o?(x=C=>f(C)||h?Promise.resolve():o.apply(I=>I.includes(C)?null:[...I,C]),e[10]=h,e[11]=f,e[12]=o,e[13]=x):x=e[13];const b=x;let v;e[14]!==o?(v=C=>o.apply(I=>I.filter(E=>E!==C)),e[14]=o,e[15]=v):v=e[15];const w=v;let y;e[16]!==o?(y=C=>o.apply(()=>C),e[16]=o,e[17]=y):y=e[17];const j=y;let N;e[18]!==d||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==o?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!h&&await o.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=d,e[19]=h,e[20]=f,e[21]=m,e[22]=o,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map(Is)),e[1]=n,e[2]=a):a=e[2];const o=Ns(a);let d,l,c;if(e[3]!==n||e[4]!==o||e[5]!==s){const h=new Map(n.map(Es));d=s.trim().toLowerCase();const x=v=>!d||v.title?.toLowerCase().includes(d);l=o.homeIds.map(v=>h.get(v)).filter(ks).filter(x);let b;e[9]!==o?(b=v=>!o.isOnHome(v.id),e[9]=o,e[10]=b):b=e[10],c=n.filter(Cs).filter(b).filter(x).sort(_s),e[3]=n,e[4]=o,e[5]=s,e[6]=d,e[7]=l,e[8]=c}else d=e[6],l=e[7],c=e[8];const m=c;let u;e[11]!==o||e[12]!==l?(u=i.jsx($s,{home:o,agents:l}),e[11]=o,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==m||e[15]!==o||e[16]!==f?(p=i.jsx(Ms,{home:o,agents:m,hasSearch:f}),e[14]=m,e[15]=o,e[16]=f,e[17]=p):p=e[17];let g;return e[18]!==u||e[19]!==p?(g=i.jsxs(i.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!pt(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function Is(t){return t.id}function Be(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==a?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function $s(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const o=Me(ne(Re,n),ne(Oe,a));let d;e[2]!==s?(d=p=>{const{active:g,over:h}=p;if(!h||g.id===h.id)return;const x=s.homeIds,b=x.indexOf(g.id),v=x.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...x],b,v)).catch(As)},e[2]=s,e[3]=d):d=e[3];const l=d,c=`${s.homeIds.length}/${te}`;let m;e[4]!==c?(m=i.jsx(Be,{title:"On home",hint:c}),e[4]=c,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(ze,{sensors:o,collisionDetection:At,onDragEnd:l,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(p=>i.jsx(Rs,{agent:p,home:s},p.id))})})}),e[6]=r,e[7]=l,e[8]=s,e[9]=o,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,o]=A.useState(20);let d;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const l=r.slice(0,a);let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Be,{title:"Add to home"}),e[5]=c):c=e[5],d=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:l.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>o(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function Fe(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let o;e[0]!==s.id?(o={id:s.id},e[0]=s.id,e[1]=o):o=e[1];const{attributes:d,listeners:l,setNodeRef:c,transform:m,transition:u,isDragging:f}=Rt(o),p=Fe(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,x=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==x||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:x},e[4]=g,e[5]=h,e[6]=x,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Le,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==j?(S=i.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=d,e[13]=l,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let $;e[22]!==p?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=$):$=e[23];let O;e[24]!==_||e[25]!==$?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,$]}),e[24]=_,e[25]=$,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(He,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==I||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[I,O,P]}),e[31]=n,e[32]=I,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Ae,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Qe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==c||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:c,style:v,className:y,children:[L,U]}),e[51]=c,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),o=Fe(t),d=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(He,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:d,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx($e,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Qe,{agent:t,home:e})]})}function Qe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,o,d,l,c,m;if(e[0]!==s||e[1]!==r){const x=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,o=s,d=r,l=v,c=new Set(x.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=d,e[6]=l,e[7]=c,e[8]=m}else n=e[2],a=e[3],o=e[4],d=e[5],l=e[6],c=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==d||e[14]!==l||e[15]!==c?(u=i.jsx(n,{agent:o,home:d,connectionIds:l,pinnedResourceUris:c}),e[11]=n,e[12]=o,e[13]=d,e[14]=l,e[15]=c,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const p=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==p?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:p})}),e[18]=s,e[19]=r,e[20]=p,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const{org:n}=Z(),a=ee({connectionId:Te,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:d}=oe({queryKey:re.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async c=>{try{const m=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:c}}),{item:u}=es(m),f=(u?.tools??[]).flatMap(p=>{const g=Jt(p._meta);return g?[{name:p.name,description:p.description,resourceUri:g}]:[]});return{id:c,title:u?.title??c,icon:u?.icon??null,uiTools:f}}catch{return{id:c,title:c,icon:null,uiTools:[]}}}))).filter(c=>c.uiTools.length>0)});return s.length===0?null:d?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(l=>l.uiTools.map(c=>i.jsx(Fs,{agent:t,home:e,connection:l,tool:c,isPinned:r.has(c.resourceUri)},`${l.id}:${c.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=pe(t.metadata?.ui),c=n?l.filter(u=>u.resourceUri!==r.resourceUri):[...l,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle tile",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Ue(r.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function We(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,o=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==o?(d=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==r?(l=r?i.jsx($e,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==d||e[9]!==l?(c=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:d,children:l}),e[5]=a,e[6]=n,e[7]=r,e[8]=d,e[9]=l,e[10]=c):c=e[10],c}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=Z();let o;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(o={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=o):o=e[3];const d=ee(o);let l;e[4]!==s.id||e[5]!==a.id?(l=re.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=l):l=e[6];let c;e[7]!==d?(c=async()=>{const{prompts:j}=await d.listPrompts();return j.map(Gs)},e[7]=d,e[8]=c):c=e[8];let m;e[9]!==l||e[10]!==c?(m={queryKey:l,queryFn:c,staleTime:3e4,retry:!1},e[9]=l,e[10]=c,e[11]=m):m=e[11];const{data:u,isLoading:f,error:p}=oe(m),g=be(a.slug);let h,x;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],x=[...N];for(const S of h)x.some(k=>k.name===S.name)||x.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=x}else h=e[15],x=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(p&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(x.length===0)return null;let b;e[22]!==n||e[23]!==x?(b=n??x.map(qs),e[22]=n,e[23]=x,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==x||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:x.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:x.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=x,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=t.metadata?.ui?.homePrompts;let c;Array.isArray(l)?c=n?l.filter(u=>u!==s.name):[...l,s.name]:c=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Ue(s.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function Zs(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Js)}),t[0]=e):e=t[0],e}function Js(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const X=1,qe=`home-board.layout.v${X}`;function Ke(t){return`home-board.layout.v${X}.${t}`}const Ge={version:X,tiles:{},hidden:[]};function me(t){return!t||t.version!==X?Ge:{version:X,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Xs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Ke(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(Ke(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=re.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const o=a;let d;e[4]!==o||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${qe}`);if(b.status===404)return o&&Xs(o)?(await Se(t,o),o):Ge;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=o,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==o||e[8]!==n||e[9]!==d?(l={queryKey:n,queryFn:d,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=d,e[10]=l):l=e[10];const{data:c,isLoading:m}=oe(l);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=mt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(p=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=p):p=e[17];const g=p;let h;e[18]!==c?(h=me(c),e[18]=c,e[19]=h):h=e[19];let x;return e[20]!==m||e[21]!==g||e[22]!==h?(x={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=x):x=e[23],x}const Ve=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=Z(),n=ei(r.slug),[a,o]=A.useState(!1),[d,l]=A.useState(null);let c;e[0]!==n.layout?(c=()=>{l(n.layout),o(!0)},e[0]=n.layout,e[1]=c):c=e[1];const m=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),o(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==n?(p=()=>{d&&n.save(d),l(null),o(!1)},e[3]=d,e[4]=n,e[5]=p):p=e[5];const g=p,h=a&&d!==null,x=h?d:n.layout;let b;e[6]!==d||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(d)!==JSON.stringify(n.layout):!1,e[6]=d,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?l(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==x||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:x,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=x,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ve.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ze(){const t=A.useContext(Ve);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=Z(),r=ee({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[o,d]=A.useState(null),[l,c]=A.useState(!1),m=A.useRef(!1),u=async(x,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,c(!0);try{const v=await os(r,x.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:x.name,name:is(x.name,ns(x._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},f=async x=>{if(!m.current){if(x.arguments&&x.arguments.length>0){d(x);return}await u(x)}},p=async x=>{if(!o)return;const b=o;d(null),await u(b,x)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,c(!0);try{const x=crypto.randomUUID();await n({id:x,virtual_mcp_id:t}),a(x,t)}catch(x){console.error("[start-thread-from-prompt] startBlank failed",x),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},dialog:i.jsx(ts,{prompt:o,setPrompt:x=>d(x),onSubmit:p}),dialogPrompt:o,starting:l}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(ut,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:o,onRemove:d}=t,l=xe(),c=A.useRef(null),[m,u]=A.useState(null),[f,p]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Me(ne(Re,g),ne(Oe)),x=s.reduce(oi,0),b=r?Math.max(x+2,4):Math.max(x,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=c.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),p(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),p(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(l){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,I,E,_,$,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==o||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(J=>J.id===m):null;C=ze,B=h,z=j,I=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==d||e[43]!==o||e[44]!==n||e[45]!==s){let J;e[47]!==m||e[48]!==r||e[49]!==d||e[50]!==o||e[51]!==n?(J=se=>i.jsx(ci,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:d,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=d,e[50]=o,e[51]=n,e[52]=J):J=e[52],U=s.map(J),e[40]=m,e[41]=r,e[42]=d,e[43]=o,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:c,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?($={width:G,height:le},e[57]=G,e[58]=le,e[59]=$):$=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=o,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=I,e[27]=E,e[28]=_,e[29]=$,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],I=e[26],E=e[27],_=e[28],$=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==$||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:$,children:O}),e[60]=k,e[61]=_,e[62]=$,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==I||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:I,children:[E,P]}),e[65]=C,e[66]=I,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(l,c)=>r.some(m=>l>=m.x&&l<m.x+m.w&&c>=m.y&&c<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let o;if(e[2]!==a||e[3]!==s){o=[];for(let l=0;l<s;l++)for(let c=0;c<K;c++)a(c,l)||o.push({x:c,y:l});e[2]=a,e[3]=s,e[4]=o}else o=e[4];let d;return e[5]!==o?(d=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(ai)}),e[5]=o,e[6]=d):d=e[6],d}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:o,children:d}=t,l=!r;let c;e[0]!==l||e[1]!==s.id?(c={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=c):c=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:p}=Lt(c),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,x=s.y*V,b=s.h*V,v=p||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==x||e[9]!==h?(N={left:g,top:x,width:h,height:b},e[6]=b,e[7]=g,e[8]=x,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==o||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(Le,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=o,e[17]=a,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:d})}),e[20]=d,e[21]=I):I=e[21];let E;e[22]!==I||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,I]}),e[22]=I,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,o]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(cs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(St,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==r||e[2]!==s.id?(l=x=>{r(s.id,x),o(!1)},e[1]=r,e[2]=s.id,e[3]=l):l=e[3];let c;e[4]!==l||e[5]!==s?(c=i.jsx(mi,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let g;e[14]!==c||e[15]!==p?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[c,m,p]}),e[14]=c,e[15]=p,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:o,children:[d,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[o,d]=A.useState(null);let l;e[0]!==o||e[1]!==s.h||e[2]!==s.w?(l=o??{w:s.w,h:s.h},e[0]=o,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const c=l;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==c.h||e[6]!==c.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[c.w," × ",c.h]})]}),e[5]=c.h,e[6]=c.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let g;e[10]!==c.h||e[11]!==c.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:ii},(x,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=c.w&&j<=c.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>d({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=c.h,e[11]=c.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let o=0;o<s&&a;o++)for(let d=0;d<e&&a;d++)ui(t,n+d,r+o)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(l=>l.id===e);if(!r)return t;const n=t.filter(l=>l.id!==e),a=n.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(l=>l.id===e?{...l,x:a.x,y:a.y}:l.id===a.id?{...l,x:r.x,y:r.y}:l);const d=[{...r,x:s.x,y:s.y}];for(const l of n){const c=fe(d,l.w,l.h);d.push({...l,x:c.x,y:c.y})}return d}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ze();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const o=a;let d,l;if(e[2]!==t||e[3]!==o||e[4]!==s.tiles){l=[];let v;e[7]!==o?(v=y=>y.pinned||!o.has(y.id),e[7]=o,e[8]=v):v=e[8];const w=t.filter(v);d=new Map;for(const y of t)y.minSize&&d.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:I}=ce(j.x,j.y,S);l.push({id:y.id,x:C,y:I,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(l.some(I=>I.id===y.id))continue;const j=y.defaultSize??ni,N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(l,S,k);l.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=o,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let c;e[9]!==t?(c=new Set(t.map(pi)),e[9]=t,e[10]=c):c=e[10];const m=c;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:X,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==l?(g=(v,w)=>{const y=l.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(l,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(h=(v,w)=>{const y=l.find(E=>E.id===v);if(!y)return;const j=d.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=l.filter(E=>E.id!==v),I=[k];for(const E of C){const _=fe(I,E.w,E.h);I.push({...E,x:_.x,y:_.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=h):h=e[24];let x;e[25]!==f||e[26]!==s||e[27]!==l?(x=v=>{const w=l.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=x):x=e[28];let b;return e[29]!==r||e[30]!==p||e[31]!==g||e[32]!==h||e[33]!==x?(b={snapshot:p,isLoading:r,moveTile:g,resizeTile:h,hideTile:x},e[29]=r,e[30]=p,e[31]=g,e[32]=h,e[33]=x,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:o}=si(s);let d;e[2]!==r||e[3]!==n?(d=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=d):d=e[4];const l=d;let c;return e[5]!==a||e[6]!==l||e[7]!==n||e[8]!==o?(c={open:l,startBlank:n,dialog:a,starting:o},e[5]=a,e[6]=l,e[7]=n,e[8]=o,e[9]=c):c=e[9],c}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:o}=ye(s.agentId);let d;e[0]!==s||e[1]!==n?(d=()=>n(s),e[0]=s,e[1]=n,e[2]=d):d=e[2];const l=o||r,c=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let f;e[3]!==c||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",c,m,u),e[3]=c,e[4]=m,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let x;e[14]!==h?(x=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=x):x=e[15];let b;e[16]!==x||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,x]}),e[16]=x,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=v):v=e[20];let w;e[21]!==o||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(w=i.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":o,className:f,children:[p,b,v]}),e[21]=o,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:o}=Z(),{open:d,startBlank:l,dialog:c,starting:m}=ye(s.agentId);let u,f,p,g,h;if(e[0]!==n||e[1]!==d||e[2]!==o.id||e[3]!==o.slug||e[4]!==r||e[5]!==l||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==l?(w=()=>{l()},e[14]=l,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let I;e[23]!==C?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=I):I=e[24];let E;e[25]!==k||e[26]!==I?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,I]}),e[25]=k,e[26]=I,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Ii,{}),e[35]=_):_=e[35],e[36]!==o.id||e[37]!==o.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:o.id,orgSlug:o.slug})})}),e[36]=o.id,e[37]=o.slug,e[38]=s,e[39]=f):f=e[39],p=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map($=>i.jsx("button",{type:"button",onClick:()=>d($),disabled:m,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:$.title})},$.promptName))}),e[0]=n,e[1]=d,e[2]=o.id,e[3]=o.slug,e[4]=r,e[5]=l,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=p,e[12]=g,e[13]=h}else u=e[9],f=e[10],p=e[11],g=e[12],h=e[13];let x;e[40]!==u||e[41]!==f||e[42]!==p?(x=i.jsxs("div",{className:u,children:[f,p]}),e[40]=u,e[41]=f,e[42]=p,e[43]=x):x=e[43];let b;return e[44]!==c||e[45]!==g||e[46]!==h||e[47]!==x?(b=i.jsxs("div",{className:g,children:[h,x,c]}),e[44]=c,e[45]=g,e[46]=h,e[47]=x,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const o=ee(a),d=s.minHeight??200,l=s.maxHeight??4e3;let c;return e[4]!==o||e[5]!==r||e[6]!==n||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri?(c=i.jsx(Xt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:o,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=o,e[5]=r,e[6]=n,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=c):c=e[11],c}function Ii(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function $i(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let d;e[6]!==a?(d=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,o]}),e[6]=a,e[7]=d):d=e[7];let l;e[8]!==n||e[9]!==d?(l=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,d]}),e[8]=n,e[9]=d,e[10]=l):l=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=c):c=e[11];let m;return e[12]!==l?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,c]}),e[12]=l,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:o,dialog:d,starting:l}=ye(s.agentId);let c,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==l||e[5]!==s.agentIcon||e[6]!==s.agentName){const p=r.filter(Ai);c="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==o?(g=()=>{o()},e[10]=o,e[11]=g):g=e[11];const h=l||n,x=n&&"pl-10 pr-10";let b;e[12]!==x?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",x),e[12]=x,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=p.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:p.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=o,e[4]=l,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=c,e[8]=m,e[9]=u}else c=e[7],m=e[8],u=e[9];let f;return e[28]!==d||e[29]!==c||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:c,children:[m,u,d]}),e[28]=d,e[29]=c,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=Z(),{isLoading:n,prompts:a,tiles:o}=be(r.slug),d=Pe()?.ids??[];let l;e[0]!==d?(l=new Set(d),e[0]=d,e[1]=l):l=e[1];const c=l,m=De();let u;e[2]!==o?(u=new Set(o.map(Pi)),e[2]=o,e[3]=u):u=e[3];const f=u;let p;if(e[4]!==a){p=new Map;for(const _ of a){const $=p.get(_.agentId);$?$.push(_):p.set(_.agentId,[_])}e[4]=a,e[5]=p}else p=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==o){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const $=a.filter(_);g=[...o.map(zi),...$.map(Ri)],e[6]=a,e[7]=f,e[8]=o,e[9]=g}else g=e[9];const h=g;let x;e[12]!==h?(x=new Map(h.map(Oi)),e[12]=h,e[13]=x):x=e[13];const b=x;let v;e[14]!==h||e[15]!==c?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:c.has(_.data.agentId)})),e[14]=h,e[15]=c,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply($=>$.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==c||e[22]!==j?(N=_=>{const $=b.get(_);$&&c.has($.data.agentId)?j($.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=c,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==p?(k=_=>{const $=b.get(_.id);if(!$)return null;if($.kind==="tile"){const O=p.get($.data.agentId)??[];return i.jsx(ft,{fallback:i.jsx(Ti,{tile:$.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx($i,{icon:$.data.agentIcon,name:$.data.agentName}),children:i.jsx(Ci,{tile:$.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:$.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=p,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ht.useSession(),{org:s}=Z(),r=xe(),n=It(),{selectedVirtualMcp:a}=$t();let o;t[0]!==s.id?(o=xt(s.id),t[0]=s.id,t[1]=o):o=t[1];const l=a??o;let c;t[2]!==s.slug?(c=Ft(s.slug),t[2]=s.slug,t[3]=c):c=t[3],oe(c);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:Te,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=ee(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==u?(p=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=p):p=t[12];let g;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==p||t[19]!==g?(h={queries:[f,p,g]},t[17]=f,t[18]=p,t[19]=g,t[20]=h):h=t[20],js(h);const x=xs(),b=vt(l.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(x.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const E=I,_=v&&y&&j!=null,$=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==$?(O=_?i.jsx(ie.CreditsEyebrow,{balanceDollars:j}):$?i.jsx(ie.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=$,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let d;e[5]!==a||e[6]!==o?(d=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ie.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=c):c=e[9];let m;return e[10]!==d?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,d,l,c]}),e[10]=d,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:o,save:d,cancel:l,hasChanges:c}=Ze(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==o||e[3]!==c||e[4]!==a||e[5]!==d?(p=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:c,onEnter:o,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=o,e[3]=c,e[4]=a,e[5]=d,e[6]=p):p=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const x=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==x?(b=q("relative flex flex-col items-center px-10 pb-4",x),e[10]=x,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(ie.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==p||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[p,g,k]}),e[28]=k,e[29]=p,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:o,onAddTile:d}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==d?(u=i.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Ae,{size:14}),e[3]=f):f=e[3];let p;e[4]!==o?(p=i.jsxs(je,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=o,e[5]=p):p=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let x;e[7]!==a||e[8]!==g?(x=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=x):x=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==x?(b=i.jsxs(i.Fragment,{children:[u,p,x]}),e[10]=u,e[11]=p,e[12]=x,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(_t,{size:14}),e[14]=l):l=e[14];let c;return e[15]!==n?(c=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=n,e[16]=c):c=e[16],c}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as S,r as E,j as t,n as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,q as $e,G as Ge,C as Xe,o as I}from"./index-
|
|
1
|
+
import{e as S,r as E,j as t,n as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,q as $e,G as Ge,C as Xe,o as I}from"./index-biiHZ5l9.js";import{i as Qe}from"./ChevronRight-CrZy8tHx.js";import{s as De}from"./Eye-ByuwKsdh.js";import{n as ae,i as We}from"./Globe01-DfGFlik1.js";import{a as Ye,c as Ze}from"./ZoomOut-D8vQ49we.js";import{s as Je}from"./Plus-CjrtKB-Y.js";import{t as et}from"./Stars01-v0yz6PCZ.js";import{i as ze}from"./Upload01-C9yi1Bdg.js";import{b as K,T as V,a as q,u as Fe}from"./tooltip-bsrBmmjV.js";import{A as tt,a as lt,b as st,c as nt,d as it,e as rt,f as ot,g as at}from"./alert-dialog-CSkQIwm8.js";import{c as Z,D as ce,a as de,f as ct,b as dt,e as ft,d as mt}from"./dialog-Bm1pP7Vu.js";import{I as ut}from"./input-5PMMNPU9.js";import{S as H}from"./skeleton--DN75sg7.js";import{F as A,d as _e,M as ht}from"./file-type-icon-CX5JEvCQ.js";import{a as xt}from"./toolbar-BsB4Mvyv.js";import{u as Oe,c as Pe,H as Te,e as Ue,f as Ae,b as fe,F as Ee,i as me,j as Me,h as pt,k as ye,l as jt,m as Le,n as gt}from"./header-tab-button-DSX6YPkf.js";import{i as ue}from"./DotsVertical-SvwN4CeV.js";import{s as he}from"./Trash01-Cup7-ZTT.js";import{i as Re}from"./Zap-Cl-JM7N9.js";import{a as xe,c as X,b as pe,D as je}from"./dropdown-menu-CIu58K9q.js";import{R as ve,a as bt,b as yt}from"./resizable-BbbLszRZ.js";import{n as Be}from"./LinkExternal01-CgI1VTqi.js";import{s as Ie}from"./XClose-pR-QU0OQ.js";import{i as vt}from"./X-1KR4wibP.js";import"./Check-D-9dblUn.js";import"./ChevronLeft-BaV4nFMQ.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./index-BflNEs6l.js";const wt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return wt.has(l)||!Nt.test(l)?"home":l}function Ct(l){const e=S.c(33);let s,i,o;e[0]!==l?({glyph:s,readOnly:o,...i}=l,e[0]=l,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);const c=E.useId(),r=`${c}-back`,a=`${c}-front`,n=`url(#${r})`;let d;e[4]!==n?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:n}),e[4]=n,e[5]=d):d=e[5];const m=`url(#${a})`;let f;e[6]!==m?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:m}),e[6]=m,e[7]=f):f=e[7];let u,g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),g=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),b=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=u,e[9]=g,e[10]=b):(u=e[8],g=e[9],b=e[10]);let p;e[11]!==s?(p=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==o?(x=o&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(De,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=o,e[14]=x):x=e[14];let h,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),N=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=N):(h=e[15],N=e[16]);let v;e[17]!==r?(v=t.jsxs("linearGradient",{id:r,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,N]}),e[17]=r,e[18]=v):v=e[18];let w,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=w,e[20]=j):(w=e[19],j=e[20]);let C;e[21]!==a?(C=t.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[w,j]}),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==v||e[24]!==C?(k=t.jsxs("defs",{children:[v,C]}),e[23]=v,e[24]=C,e[25]=k):k=e[25];let $;return e[26]!==i||e[27]!==k||e[28]!==d||e[29]!==f||e[30]!==p||e[31]!==x?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,u,g,b,p,x,k]}),e[26]=i,e[27]=k,e[28]=d,e[29]=f,e[30]=p,e[31]=x,e[32]=$):$=e[32],$}function St(l){const e={};for(const s of l.split(`
|
|
2
2
|
`)){const i=s.match(/^([A-Za-z][\w-]*):\s*(.*)$/);i?.[1]&&i[2]!==void 0&&(e[i[1].toLowerCase()]=i[2].trim())}return e}function we(l){for(const e of l.split(/\n\s*\n/)){const s=e.trim();if(!(!s||s.startsWith("#")))return s.replace(/\n/g," ")}return null}function He(l){const e=l.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:we(l),body:l};const s=St(e[1]),i=l.slice(e[0].length);return{name:s.name||null,description:s.description||we(i),body:i}}const $t=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Dt=new Set(["csv","tsv"]),zt=new Set(["mp4","webm","mov","m4v"]),Ft=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),_t=256*1024;function ee(l){const e=new Date(l);if(Number.isNaN(e.getTime()))return"";const s=Date.now()-e.getTime(),i=Math.floor(s/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);return c<30?`${c}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ot(l){return l.split(".").pop()?.toLowerCase()??""}function Ke(l){const e=S.c(15),{downloadUrl:s,filename:i,onDelete:o}=l,c=`Actions for ${i}`;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ue,{size:14}),e[0]=r):r=e[0];let a;e[1]!==c?(a=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Tt,"aria-label":c,children:r})}),e[1]=c,e[2]=a):a=e[2];let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ae,{size:14}),e[3]=n):n=e[3];let d;e[4]!==s||e[5]!==i?(d=t.jsx(X,{asChild:!0,children:t.jsxs("a",{href:s,download:i,children:[n,"Download"]})}),e[4]=s,e[5]=i,e[6]=d):d=e[6];let m;e[7]!==o?(m=o&&t.jsxs(X,{variant:"destructive",onClick:o,children:[t.jsx(he,{size:14}),"Delete"]}),e[7]=o,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs(pe,{align:"end",onClick:Pt,children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsxs(je,{children:[a,f]}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Pt(l){return l.stopPropagation()}function Tt(l){return l.stopPropagation()}function te(l){const e=S.c(9),{onOpen:s,children:i,className:o}=l;let c;e[0]!==s?(c=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),s())},e[0]=s,e[1]=c):c=e[1];let r;e[2]!==o?(r=Y("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",o),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==s||e[6]!==c||e[7]!==r?(a=t.jsx("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:c,className:r,children:i}),e[4]=i,e[5]=s,e[6]=c,e[7]=r,e[8]=a):a=e[8],a}function le(l){const e=S.c(16),{icon:s,name:i,meta:o,subtitle:c,actions:r}=l;let a;e[0]!==i?(a=t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:i,children:i}),e[0]=i,e[1]=a):a=e[1];let n;e[2]!==o?(n=o&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=n):n=e[3];let d;e[4]!==a||e[5]!==n?(d=t.jsxs("div",{className:"flex items-start gap-3",children:[a,n]}),e[4]=a,e[5]=n,e[6]=d):d=e[6];let m;e[7]!==c?(m=c&&t.jsx("span",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==r||e[13]!==s||e[14]!==f?(u=t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s,f,r]}),e[12]=r,e[13]=s,e[14]=f,e[15]=u):u=e[15],u}function se(l){const e=S.c(15),{name:s,meta:i,subtitle:o,glyph:c,readOnly:r,onOpen:a,onDelete:n}=l;let d;e[0]!==c||e[1]!==r?(d=t.jsx(Ct,{glyph:c,readOnly:r,className:"size-8 shrink-0"}),e[0]=c,e[1]=r,e[2]=d):d=e[2];let m;e[3]!==s||e[4]!==n?(m=n?t.jsxs(je,{children:[t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:At,"aria-label":`Actions for ${s}`,children:t.jsx(ue,{size:14})})}),t.jsx(pe,{align:"end",onClick:Ut,children:t.jsxs(X,{variant:"destructive",onClick:n,children:[t.jsx(he,{size:14}),"Delete"]})})]}):void 0,e[3]=s,e[4]=n,e[5]=m):m=e[5];let f;e[6]!==i||e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==m?(f=t.jsx(le,{icon:d,name:s,meta:i,subtitle:o,actions:m}),e[6]=i,e[7]=s,e[8]=o,e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsx(te,{onOpen:a,children:f}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Ut(l){return l.stopPropagation()}function At(l){return l.stopPropagation()}function Ve(l){const e=S.c(19),{filename:s,updatedAt:i,downloadUrl:o,onOpen:c,onDelete:r}=l;let a;e[0]!==s?(a=t.jsx(A,{filename:s,className:"h-8 w-6.5 shrink-0"}),e[0]=s,e[1]=a):a=e[1];let n;e[2]!==i?(n=ee(i),e[2]=i,e[3]=n):n=e[3];let d;e[4]!==s?(d=_e(s),e[4]=s,e[5]=d):d=e[5];let m;e[6]!==o||e[7]!==s||e[8]!==r?(m=t.jsx(Ke,{downloadUrl:o,filename:s,onDelete:r}),e[6]=o,e[7]=s,e[8]=r,e[9]=m):m=e[9];let f;e[10]!==s||e[11]!==a||e[12]!==n||e[13]!==d||e[14]!==m?(f=t.jsx(le,{icon:a,name:s,meta:n,subtitle:d,actions:m}),e[10]=s,e[11]=a,e[12]=n,e[13]=d,e[14]=m,e[15]=f):f=e[15];let u;return e[16]!==c||e[17]!==f?(u=t.jsx(te,{onOpen:c,children:f}),e[16]=c,e[17]=f,e[18]=u):u=e[18],u}function Et(l){const e=S.c(36),{dirName:s,updatedAt:i,skillMdUrl:o,onOpen:c,onBrowse:r,onDelete:a}=l;let n;e[0]!==o?(n=M.fileText(o),e[0]=o,e[1]=n):n=e[1];let d;e[2]!==o?(d=async()=>{const F=await fetch(o,{credentials:"include"});if(!F.ok)throw new Error(`fetch failed: ${F.status}`);return F.text()},e[2]=o,e[3]=d):d=e[3];let m;e[4]!==n||e[5]!==d?(m={queryKey:n,queryFn:d,staleTime:6e4,retry:!1},e[4]=n,e[5]=d,e[6]=m):m=e[6];const{data:f}=J(m);let u;e[7]!==f?(u=f?He(f):null,e[7]=f,e[8]=u):u=e[8];const g=u;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(Re,{size:16})}),e[9]=b):b=e[9];const p=g?.name??s;let x;e[10]!==i?(x=ee(i),e[10]=i,e[11]=x):x=e[11];const h=`Actions for ${s}`;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ue,{size:14}),e[12]=N):N=e[12];let v;e[13]!==h?(v=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Lt,"aria-label":h,children:N})}),e[13]=h,e[14]=v):v=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ye,{size:14}),e[15]=w):w=e[15];let j;e[16]!==r?(j=t.jsxs(X,{onClick:r,children:[w,"Browse files"]}),e[16]=r,e[17]=j):j=e[17];let C;e[18]!==a?(C=a&&t.jsxs(X,{variant:"destructive",onClick:a,children:[t.jsx(he,{size:14}),"Delete"]}),e[18]=a,e[19]=C):C=e[19];let k;e[20]!==j||e[21]!==C?(k=t.jsxs(pe,{align:"end",onClick:Mt,children:[j,C]}),e[20]=j,e[21]=C,e[22]=k):k=e[22];let $;e[23]!==v||e[24]!==k?($=t.jsxs(je,{children:[v,k]}),e[23]=v,e[24]=k,e[25]=$):$=e[25];let z;e[26]!==$||e[27]!==p||e[28]!==x?(z=t.jsx(le,{icon:b,name:p,meta:x,subtitle:"Skill",actions:$}),e[26]=$,e[27]=p,e[28]=x,e[29]=z):z=e[29];const P=g?.description??"";let D;e[30]!==P?(D=t.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:P}),e[30]=P,e[31]=D):D=e[31];let y;return e[32]!==c||e[33]!==z||e[34]!==D?(y=t.jsxs(te,{onOpen:c,children:[z,D]}),e[32]=c,e[33]=z,e[34]=D,e[35]=y):y=e[35],y}function Mt(l){return l.stopPropagation()}function Lt(l){return l.stopPropagation()}function oe(l){const e=S.c(4),{children:s}=l,[i,o]=E.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n=>{if(!n)return;const d=new IntersectionObserver(m=>{const[f]=m;f?.isIntersecting&&(o(!0),d.disconnect())},{rootMargin:"200px"});d.observe(n)},e[0]=c):c=e[0];const[r]=E.useState(c);if(i){let n;return e[1]!==s?(n=t.jsx(t.Fragment,{children:s}),e[1]=s,e[2]=n):n=e[2],n}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{ref:r,className:"h-full w-full"}),e[3]=a):a=e[3],a}function Rt(l){const e=S.c(11),{url:s}=l;let i;e[0]!==s?(i=M.fileText(s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==s?(o=async()=>{const d=await fetch(s,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=s,e[3]=o):o=e[3];let c;e[4]!==i||e[5]!==o?(c={queryKey:i,queryFn:o,staleTime:6e4,retry:!1},e[4]=i,e[5]=o,e[6]=c):c=e[6];const{data:r}=J(c);if(!r)return null;let a;e[7]!==r?(a=r.slice(0,2e3),e[7]=r,e[8]=a):a=e[8];let n;return e[9]!==a?(n=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:a}),e[9]=a,e[10]=n):n=e[10],n}function Bt(l){const e=S.c(23),{url:s,ext:i}=l;let o;e[0]!==s?(o=M.csvThumb(s),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==s?(c=async()=>{const x=await fetch(s,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!x.ok)throw new Error(`fetch failed: ${x.status}`);return x.text()},e[2]=s,e[3]=c):c=e[3];let r;e[4]!==o||e[5]!==c?(r={queryKey:o,queryFn:c,staleTime:6e4,retry:!1},e[4]=o,e[5]=c,e[6]=r):r=e[6];const{data:a}=J(r);if(!a)return null;const n=i==="tsv"?" ":",";let d,m,f,u;if(e[7]!==a||e[8]!==n){u=Symbol.for("react.early_return_sentinel");e:{let x;e[13]!==n?(x=N=>N.split(n).slice(0,6).map(Kt),e[13]=n,e[14]=x):x=e[14];const h=a.split(`
|
|
3
3
|
`).filter(Boolean).slice(0,7).map(x);if(h.length===0){u=null;break e}f="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",m="w-full border-collapse",d=h.map(It)}e[7]=a,e[8]=n,e[9]=d,e[10]=m,e[11]=f,e[12]=u}else d=e[9],m=e[10],f=e[11],u=e[12];if(u!==Symbol.for("react.early_return_sentinel"))return u;let g;e[15]!==d?(g=t.jsx("tbody",{children:d}),e[15]=d,e[16]=g):g=e[16];let b;e[17]!==m||e[18]!==g?(b=t.jsx("table",{className:m,children:g}),e[17]=m,e[18]=g,e[19]=b):b=e[19];let p;return e[20]!==f||e[21]!==b?(p=t.jsx("div",{className:f,children:b}),e[20]=f,e[21]=b,e[22]=p):p=e[22],p}function It(l,e){return t.jsx("tr",{className:Y(e===0&&"bg-muted/50 font-medium"),children:l.map(Ht)},e)}function Ht(l,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:l})},e)}function Kt(l){return l.trim().replace(/^"|"$/g,"")}function Vt(l){const e=S.c(14),{filename:s,size:i,downloadUrl:o}=l;let c;if(e[0]!==o||e[1]!==s||e[2]!==i){const r=Ot(s);let a;if($t.has(r)){let n;e[4]!==o?(n=t.jsx("img",{src:o,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=o,e[5]=n):n=e[5],a=n}else if(zt.has(r)){const n=`${o}#t=0.1`;let d;e[6]!==n?(d=t.jsx(oe,{children:t.jsx("video",{src:n,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=n,e[7]=d):d=e[7],a=d}else if(r==="pdf"){let n;e[8]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[8]=s,e[9]=n):n=e[9],a=n}else if(Dt.has(r))a=t.jsx(oe,{children:t.jsx(Bt,{url:o,ext:r})});else if(Ft.has(r)&&i<=_t){let n;e[10]!==o?(n=t.jsx(oe,{children:t.jsx(Rt,{url:o})}),e[10]=o,e[11]=n):n=e[11],a=n}else{let n;e[12]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[12]=s,e[13]=n):n=e[13],a=n}c=t.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:a}),e[0]=o,e[1]=s,e[2]=i,e[3]=c}else c=e[3];return c}function qt(l){const e=S.c(24),s=l.onOpen;let i;e[0]!==l.filename?(i=t.jsx(A,{filename:l.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=l.filename,e[1]=i):i=e[1];const o=l.filename;let c;e[2]!==l.updatedAt?(c=ee(l.updatedAt),e[2]=l.updatedAt,e[3]=c):c=e[3];let r;e[4]!==l.filename?(r=_e(l.filename),e[4]=l.filename,e[5]=r):r=e[5];let a;e[6]!==l.downloadUrl||e[7]!==l.filename||e[8]!==l.onDelete?(a=t.jsx(Ke,{downloadUrl:l.downloadUrl,filename:l.filename,onDelete:l.onDelete}),e[6]=l.downloadUrl,e[7]=l.filename,e[8]=l.onDelete,e[9]=a):a=e[9];let n;e[10]!==l.filename||e[11]!==i||e[12]!==c||e[13]!==r||e[14]!==a?(n=t.jsx(le,{icon:i,name:o,meta:c,subtitle:r,actions:a}),e[10]=l.filename,e[11]=i,e[12]=c,e[13]=r,e[14]=a,e[15]=n):n=e[15];let d;e[16]!==l.downloadUrl||e[17]!==l.filename||e[18]!==l.size?(d=t.jsx(Vt,{filename:l.filename,size:l.size,downloadUrl:l.downloadUrl}),e[16]=l.downloadUrl,e[17]=l.filename,e[18]=l.size,e[19]=d):d=e[19];let m;return e[20]!==l.onOpen||e[21]!==n||e[22]!==d?(m=t.jsxs(te,{onOpen:s,children:[n,d]}),e[20]=l.onOpen,e[21]=n,e[22]=d,e[23]=m):m=e[23],m}function ne(l){const e=l?l.split("/").filter(Boolean):[],s=e[0]==="public",i=s?e[1]??null:null,o=s?i?`public-${i}`:null:e[0]??null,c=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:c,isPublic:s,publicSet:i,readOnly:s}}function W(l,e){return l.isPublic&&l.publicSet?`public/${l.publicSet}/${e}`:l.volume?`${l.volume}/${e}`:e}function O(l){const e=l.lastIndexOf("/");return e===-1?l:l.slice(e+1)}const Gt=l=>/\.html?$/i.test(l);function Xt(l){const e=S.c(26),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==i||e[7]!==s||e[8]!==r){const v=O(a),w=n&&n.kind==="file"?{key:s,filename:v,size:n.size,downloadUrl:m(n.path)}:null;u=ce,p=!0,e[15]!==i?(x=j=>{j||i()},e[15]=i,e[16]=x):x=e[16],f=de,g="flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",b=w&&n&&Gt(v)?t.jsxs(t.Fragment,{children:[t.jsx(Z,{className:"sr-only",children:v}),t.jsx(Te,{readUrl:w.downloadUrl,marker:Ue(n),title:v,savePath:r==="home"?a:void 0,trailing:t.jsx("div",{className:"w-8 shrink-0"})},s)]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border/60 py-1 pr-12 pl-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[t.jsx(A,{filename:v,className:"h-4.5 w-3.5 shrink-0"}),t.jsx(Z,{className:"truncate text-xs font-medium text-foreground",children:v}),w&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(w.size)})]}),w&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:w.downloadUrl,download:w.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(w.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]})]}),t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:w?t.jsx(fe,{file:w}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:v,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})})]}),e[2]=m,e[3]=n,e[4]=a,e[5]=d,e[6]=i,e[7]=s,e[8]=r,e[9]=f,e[10]=u,e[11]=g,e[12]=b,e[13]=p,e[14]=x}else f=e[9],u=e[10],g=e[11],b=e[12],p=e[13],x=e[14];let h;e[17]!==f||e[18]!==g||e[19]!==b?(h=t.jsx(f,{className:g,children:b}),e[17]=f,e[18]=g,e[19]=b,e[20]=h):h=e[20];let N;return e[21]!==u||e[22]!==p||e[23]!==x||e[24]!==h?(N=t.jsx(u,{open:p,onOpenChange:x,children:h}),e[21]=u,e[22]=p,e[23]=x,e[24]=h,e[25]=N):N=e[25],N}const Qt=l=>/\.html?$/i.test(l);function Wt(l){const e=S.c(6),{onClose:s}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ie,{size:14}),e[0]=i):i=e[0];let o;e[1]!==s?(o=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:s,children:i})}),e[1]=s,e[2]=o):o=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(q,{side:"bottom",children:"Close"}),e[3]=c):c=e[3];let r;return e[4]!==o?(r=t.jsxs(K,{children:[o,c]}),e[4]=o,e[5]=r):r=e[5],r}function Yt(l){const e=S.c(49),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x,h,N,v;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==i||e[6]!==s||e[7]!==r){v=Symbol.for("react.early_return_sentinel");e:{if(u=O(a),f=n&&n.kind==="file"?{key:s,filename:u,size:n.size,downloadUrl:m(n.path)}:null,f&&n&&Qt(u)){const F=f.downloadUrl;let U;e[17]!==n?(U=Ue(n),e[17]=n,e[18]=U):U=e[18];let B;e[19]!==i?(B=t.jsx(Wt,{onClose:i}),e[19]=i,e[20]=B):B=e[20],v=t.jsx(Te,{readUrl:F,marker:U,title:u,savePath:r==="home"?a:void 0,trailing:B},s);break e}N="flex h-full w-full flex-col bg-background",h="flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",g="flex min-w-0 flex-1 items-center gap-2 px-2",b=t.jsx(A,{filename:u,className:"h-4.5 w-3.5 shrink-0"}),e[21]!==u?(p=t.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:u}),e[21]=u,e[22]=p):p=e[22],x=f&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(f.size)})}e[2]=m,e[3]=n,e[4]=a,e[5]=i,e[6]=s,e[7]=r,e[8]=f,e[9]=u,e[10]=g,e[11]=b,e[12]=p,e[13]=x,e[14]=h,e[15]=N,e[16]=v}else f=e[8],u=e[9],g=e[10],b=e[11],p=e[12],x=e[13],h=e[14],N=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let w;e[23]!==g||e[24]!==b||e[25]!==p||e[26]!==x?(w=t.jsxs("div",{className:g,children:[b,p,x]}),e[23]=g,e[24]=b,e[25]=p,e[26]=x,e[27]=w):w=e[27];let j;e[28]!==f?(j=f&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:f.downloadUrl,download:f.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(f.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]}),e[28]=f,e[29]=j):j=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{size:14}),e[30]=C):C=e[30];let k;e[31]!==i?(k=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:i,children:C})}),e[31]=i,e[32]=k):k=e[32];let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(q,{side:"bottom",children:"Close"}),e[33]=$):$=e[33];let z;e[34]!==k?(z=t.jsxs(K,{children:[k,$]}),e[34]=k,e[35]=z):z=e[35];let P;e[36]!==j||e[37]!==z||e[38]!==h||e[39]!==w?(P=t.jsxs("div",{className:h,children:[w,j,z]}),e[36]=j,e[37]=z,e[38]=h,e[39]=w,e[40]=P):P=e[40];let D;e[41]!==f||e[42]!==u||e[43]!==d?(D=t.jsx("div",{className:"relative min-h-0 flex-1",children:f?t.jsx(fe,{file:f}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:u,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[41]=f,e[42]=u,e[43]=d,e[44]=D):D=e[44];let y;return e[45]!==P||e[46]!==D||e[47]!==N?(y=t.jsxs("div",{className:N,children:[P,D]}),e[45]=P,e[46]=D,e[47]=N,e[48]=y):y=e[48],y}function Zt(l){const e=S.c(21),{skillPath:s,onClose:i}=l,o=ne(s),{volume:c,dirPath:r}=o,a=me(),n=a(c??"",`${r}/SKILL.md`),d=M.fileText(n);let m;e[0]!==n?(m=async()=>{const _=await fetch(n,{credentials:"include"});if(!_.ok)throw new Error(`fetch failed: ${_.status}`);return _.text()},e[0]=n,e[1]=m):m=e[1];let f;e[2]!==d||e[3]!==m?(f={queryKey:d,queryFn:m,staleTime:6e4,retry:!1},e[2]=d,e[3]=m,e[4]=f):f=e[4];const u=J(f),g=Me(c??"",r);let b;e[5]!==r?(b=O(r),e[5]=r,e[6]=b):b=e[6];const p=b;let x;e[7]!==u.data?(x=u.data?He(u.data):null,e[7]=u.data,e[8]=x):x=e[8];const h=x,N=el;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(_,G)=>N(_.path)?-1:N(G.path)?1:O(_.path).localeCompare(O(G.path)),e[9]=v):v=e[9];const w=(g.data??[]).filter(Jt).sort(v),[j,C]=E.useState(null),k=j===null?null:w.find(_=>_.path===j)??null;let $;e[10]!==i?($=_=>{_||i()},e[10]=i,e[11]=$):$=e[11];let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Re,{size:18})}),e[12]=z):z=e[12];const P=h?.name??p;let D;e[13]!==P?(D=t.jsx(Z,{className:"flex-1 truncate text-base font-medium text-foreground",children:P}),e[13]=P,e[14]=D):D=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ct,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(vt,{size:16})})}),e[15]=y):y=e[15];let F;e[16]!==D?(F=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,D,y]}),e[16]=D,e[17]=F):F=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[18]=U):U=e[18];const B="relative flex min-w-0 flex-1 flex-col overflow-y-auto",ie=k?t.jsx(fe,{file:{key:k.path,filename:O(k.path),size:k.size,downloadUrl:a(c??"",k.path)}}):u.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(H,{className:"h-4 w-1/3"}),t.jsx(H,{className:"h-3 w-full"}),t.jsx(H,{className:"h-3 w-5/6"}),t.jsx(H,{className:"h-3 w-2/3"})]}):u.isError||!h?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:h.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ht,{id:`skill-preview-${s}`,text:h.body})})]});let Q;return e[19]!==ie?(Q=t.jsx("div",{className:B,children:ie}),e[19]=ie,e[20]=Q):Q=e[20],t.jsx(ce,{open:!0,onOpenChange:$,children:t.jsxs(de,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:[F,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[U,g.isPending?t.jsx(H,{className:"mx-2 h-4 w-24"}):w.map(_=>{const G=N(_.path)?k===null:j===_.path;return t.jsxs("button",{type:"button",onClick:()=>C(N(_.path)?null:_.path),className:Y("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(A,{filename:O(_.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:Y("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:O(_.path)})]},_.path)})]}),Q]})]})})}function Jt(l){return l.kind==="file"}function el(l){return O(l)==="SKILL.md"}const qe=[{id:"home",description:"Your organization's home folder",glyph:Ze},{id:"uploads",description:"Files your team uploads",glyph:ze},{id:"outputs",description:"Agent run outputs",glyph:et}],Ne=3;function R(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function L(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ge(l){const e=S.c(2),{rows:s}=l,i=s===void 0?1:s;let o;return e[0]!==i?(o=t.jsx(L,{children:Array.from({length:i*3},tl)}),e[0]=i,e[1]=o):o=e[1],o}function tl(l,e){return t.jsx(H,{className:"h-16 rounded-2xl"},e)}function be(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ll(l){const e=S.c(6),{volume:s,displayName:i,description:o,glyph:c,onOpen:r}=l,a=gt(s),n=i??s,d=a.data?`${a.data.files} files`:void 0;let m;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n||e[4]!==d?(m=t.jsx(se,{name:n,meta:d,subtitle:o,glyph:c,onOpen:r}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=d,e[5]=m):m=e[5],m}function sl(l){const e=S.c(8),{segments:s,onNavigate:i}=l;let o;e[0]!==i?(o=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=o):o=e[1];let c;e[2]!==i||e[3]!==s?(c=s.map((a,n)=>{const d=s.slice(0,n+1).join("/"),m=n===s.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Qe,{size:12,className:"shrink-0 text-muted-foreground"}),m?t.jsx("span",{className:"truncate font-medium text-foreground",children:a}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:a})]},d)}),e[2]=i,e[3]=s,e[4]=c):c=e[4];let r;return e[5]!==o||e[6]!==c?(r=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[o,c]}),e[5]=o,e[6]=c,e[7]=r):r=e[7],r}function nl(l){const e=S.c(19),{onOpenDir:s,onOpenFile:i,onDelete:o}=l,{org:c}=$e(),r=jt(),a=Le(),n=me();let d;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==i||e[4]!==c||e[5]!==a.data?.length||e[6]!==r.data||e[7]!==r.isPending){const m=r.data??[],f=m.slice(0,Ne),u=m.slice(Ne);let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(R,{children:"Folders"}),e[9]=g):g=e[9];let b;e[10]!==s||e[11]!==c?(b=qe.map(h=>t.jsx(ll,{volume:h.id,displayName:h.id==="home"?kt(c.slug):void 0,description:h.description,glyph:h.glyph,onOpen:()=>s(h.id)},h.id)),e[10]=s,e[11]=c,e[12]=b):b=e[12];let p;e[13]!==s||e[14]!==a.data?.length?(p=(a.data?.length??0)>0&&t.jsx(se,{name:"public",meta:`${a.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:We,readOnly:!0,onOpen:()=>s("public")}),e[13]=s,e[14]=a.data?.length,e[15]=p):p=e[15];let x;e[16]!==b||e[17]!==p?(x=t.jsxs("div",{className:"flex flex-col gap-3",children:[g,t.jsxs(L,{children:[b,p]})]}),e[16]=b,e[17]=p,e[18]=x):x=e[18],d=t.jsxs(t.Fragment,{children:[r.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(ge,{})]}):f.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(L,{children:f.map(h=>t.jsx(qt,{filename:O(h.path),updatedAt:h.updatedAt,size:h.size,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]}):t.jsx(be,{children:"No files yet — upload one, or ask an agent to produce something."}),x,u.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"All files"}),t.jsx(L,{children:u.map(h=>t.jsx(Ve,{filename:O(h.path),updatedAt:h.updatedAt,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]})]}),e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=c,e[5]=a.data?.length,e[6]=r.data,e[7]=r.isPending,e[8]=d}else d=e[8];return d}function il(l){const e=S.c(11),{onOpenDir:s}=l,i=Le();if(i.isPending){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ge,{}),e[0]=n):n=e[0],n}let o;e[1]!==i.data?(o=i.data??[],e[1]=i.data,e[2]=o):o=e[2];const c=o;if(c.length===0){let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(be,{children:"No public skill sets are configured."}),e[3]=n):n=e[3],n}let r;if(e[4]!==s||e[5]!==c){let n;e[7]!==s?(n=d=>t.jsx(se,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>s(`public/${d}`)},d),e[7]=s,e[8]=n):n=e[8],r=c.map(n),e[4]=s,e[5]=c,e[6]=r}else r=e[6];let a;return e[9]!==r?(a=t.jsx(L,{children:r}),e[9]=r,e[10]=a):a=e[10],a}function rl(l){const e=S.c(25),{location:s,onOpenDir:i,onOpenFile:o,onOpenSkill:c,onDelete:r}=l,a=s.volume??"",n=Me(a,s.dirPath),d=me();if(n.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ge,{rows:2}),e[0]=p):p=e[0],p}if(n.isError){const p=n.error instanceof Error?n.error.message:"Failed to load";let x;return e[1]!==p?(x=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[1]=p,e[2]=x):x=e[2],x}let m,f,u,g;if(e[3]!==d||e[4]!==n.data||e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==o||e[9]!==c||e[10]!==a){g=Symbol.for("react.early_return_sentinel");e:{const p=n.data??[],x=p.filter(cl),h=p.filter(al),N=p.filter(ol);if(p.length===0){const j=s.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let C;e[15]!==j?(C=t.jsx(be,{children:j}),e[15]=j,e[16]=C):C=e[16],g=C;break e}let v;e[17]!==s.readOnly||e[18]!==r||e[19]!==a?(v=j=>s.readOnly?void 0:()=>r({volume:a,path:j.path,kind:j.kind}),e[17]=s.readOnly,e[18]=r,e[19]=a,e[20]=v):v=e[20];const w=v;m=x.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Skills"}),t.jsx(L,{children:x.map(j=>t.jsx(Et,{dirName:O(j.path),updatedAt:j.updatedAt,skillMdUrl:d(a,`${j.path}/SKILL.md`),onOpen:()=>c(W(s,j.path)),onBrowse:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),f=h.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Folders"}),t.jsx(L,{children:h.map(j=>t.jsx(se,{name:O(j.path),meta:ee(j.updatedAt),readOnly:s.readOnly,onOpen:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),u=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Files"}),t.jsx(L,{children:N.map(j=>t.jsx(Ve,{filename:O(j.path),updatedAt:j.updatedAt,downloadUrl:d(a,j.path),onOpen:()=>o(W(s,j.path)),onDelete:w(j)},j.path))})]})}e[3]=d,e[4]=n.data,e[5]=s,e[6]=r,e[7]=i,e[8]=o,e[9]=c,e[10]=a,e[11]=m,e[12]=f,e[13]=u,e[14]=g}else m=e[11],f=e[12],u=e[13],g=e[14];if(g!==Symbol.for("react.early_return_sentinel"))return g;let b;return e[21]!==m||e[22]!==f||e[23]!==u?(b=t.jsxs(t.Fragment,{children:[m,f,u]}),e[21]=m,e[22]=f,e[23]=u,e[24]=b):b=e[24],b}function ol(l){return l.kind==="file"}function al(l){return l.kind==="dir"&&!l.hasSkill}function cl(l){return l.kind==="dir"&&l.hasSkill}function ke(){const{org:l}=$e(),e=Ge(),s=Ce(),i=Fe(),o=Se({strict:!1}),c=o.path??"",r=ne(c),a=r.segments.length===0,n=(y,F)=>s({to:".",search:U=>({...U,[y]:F||void 0})}),d=y=>n("path",y),m=y=>n("preview",y),f=y=>n("skill",y),[u,g]=E.useState(null),[b,p]=E.useState(!1),[x,h]=E.useState(""),N=E.useRef(null),v=r.readOnly?null:r.volume??"uploads",w=r.volume?r.dirPath:"",{upload:j,mkdir:C}=ye(v??"uploads"),{remove:k}=ye(u?.volume??"uploads");async function $(y){if(!(!v||!y||y.length===0))try{await j.mutateAsync({dir:w,files:[...y]}),I.success(y.length===1?`Uploaded ${y[0]?.name}`:`Uploaded ${y.length} files`)}catch(F){I.error(F instanceof Error?F.message:"Upload failed")}finally{N.current&&(N.current.value="")}}async function z(){const y=x.trim();if(!(!v||!y))try{await C.mutateAsync(w?`${w}/${y}`:y),I.success(`Folder "${y}" created`),p(!1),h("")}catch(F){I.error(F instanceof Error?F.message:"Failed to create folder")}}async function P(){if(!u)return;const y=u;try{await k.mutateAsync(y.path),I.success(`Deleted ${O(y.path)}`)}catch(F){I.error(F instanceof Error?F.message:"Delete failed")}finally{g(null)}}function D(){for(const y of qe)e.invalidateQueries({queryKey:M.orgFsVolume(l.id,y.id)});r.volume&&e.invalidateQueries({queryKey:M.orgFsVolume(l.id,r.volume)}),e.invalidateQueries({queryKey:M.orgFsRecent(l.id)}),e.invalidateQueries({queryKey:M.orgFsPublicSets(l.id)})}return t.jsxs("div",{className:"h-full overflow-y-auto",children:[t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!a&&t.jsx(sl,{segments:r.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:a?"Library":r.segments.at(-1)??"Library"}),t.jsx(T,{variant:"ghost",size:"icon",onClick:D,"aria-label":"Refresh",children:t.jsx(Xe,{size:14})}),!a&&v&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Je,{size:14}),"New folder"]}),r.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(De,{size:12}),"Read-only"]}):t.jsxs(T,{size:"sm",disabled:j.isPending,onClick:()=>N.current?.click(),children:[t.jsx(ze,{size:14}),j.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:N,type:"file",multiple:!0,className:"hidden",onChange:y=>{$(y.target.files)}})]})]}),a?t.jsx(nl,{onOpenDir:d,onOpenFile:m,onDelete:g}):r.volume===null?t.jsx(il,{onOpenDir:d}):t.jsx(rl,{location:r,onOpenDir:d,onOpenFile:m,onOpenSkill:f,onDelete:g},r.volume)]}),o.preview?i&&t.jsx(Xt,{previewPath:o.preview,onClose:()=>n("preview",null)}):o.skill?t.jsx(Zt,{skillPath:o.skill,onClose:()=>n("skill",null)},o.skill):null,t.jsx(ce,{open:b,onOpenChange:p,children:t.jsxs(de,{children:[t.jsxs(dt,{children:[t.jsx(Z,{children:"New folder"}),t.jsxs(ft,{children:["Create a folder in ",c||"the library","."]})]}),t.jsx(ut,{autoFocus:!0,placeholder:"folder-name",value:x,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&z()}}),t.jsxs(mt,{children:[t.jsx(T,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),t.jsx(T,{disabled:!x.trim()||C.isPending,onClick:()=>{z()},children:"Create"})]})]})}),t.jsx(tt,{open:u!==null,onOpenChange:y=>{y||g(null)},children:t.jsxs(lt,{children:[t.jsxs(st,{children:[t.jsxs(nt,{children:["Delete ",u?O(u.path):"","?"]}),t.jsx(it,{children:u?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(rt,{children:[t.jsx(ot,{children:"Cancel"}),t.jsx(at,{onClick:()=>{P()},children:"Delete"})]})]})})]})}function Ll(){const l=S.c(13),e=Fe(),s=Ce();let i;l[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},l[0]=i):i=l[0];const c=Se(i).preview;let r;l[1]!==c?(r=c?O(c):"",l[1]=c,l[2]=r):r=l[2];const a=r;let n;l[3]!==s?(n=()=>s({to:".",search:dl}),l[3]=s,l[4]=n):n=l[4];const d=n;if(e){let g;return l[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})}),l[5]=g):g=l[5],g}let m;l[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})})})}),l[6]=m):m=l[6];let f;l[7]!==d||l[8]!==a||l[9]!==c?(f=c&&t.jsxs(t.Fragment,{children:[t.jsx(xt.Tabs,{children:t.jsx(pt,{title:a,icon:{kind:"component",Component:g=>t.jsx(A,{filename:a,...g})},active:!0,onClick:d})}),t.jsx(bt,{className:"bg-sidebar"}),t.jsx(ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(Yt,{previewPath:c,onClose:d})})})})})]}),l[7]=d,l[8]=a,l[9]=c,l[10]=f):f=l[10];let u;return l[11]!==f?(u=t.jsxs(yt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[m,f]}),l[11]=f,l[12]=u):u=l[12],u}function dl(l){return{...l,preview:void 0}}export{Ll as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-
|
|
1
|
+
import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-biiHZ5l9.js";import{S as as}from"./search-input-BgGthWir.js";import{P as Me}from"./index-r7-3fAFf.js";import{E as wt}from"./empty-state-1AbmTLd7.js";import{R as ns}from"./require-capability-DVI2cKO3.js";import{B as rt}from"./badge-Da0IsrqH.js";import{P as ct,a as dt,b as mt}from"./popover-Cvcd3A1d.js";import{b as Ze,T as et,a as tt}from"./tooltip-bsrBmmjV.js";import{i as ft}from"./Check-D-9dblUn.js";import{a as Xe}from"./Eye-ByuwKsdh.js";import{n as Mt}from"./Globe01-DfGFlik1.js";import{i as Vt}from"./FilterLines-BJZdiggU.js";import{i as is}from"./Key01-CzmPnHuw.js";import{i as cs}from"./Play-CMJ2IWYR.js";import{a8 as ds,a9 as ms,Q as us,F as xs}from"./agent-icon-DT8dQ9tq.js";import{M as _t}from"./monaco-editor-CJVi8Ty8.js";import{u as fs}from"./use-members-Cw70r_Wh.js";import{u as Dt}from"./use-connection-DyJtuHQI.js";import{S as St,u as It,W as ps}from"./use-mcp-client-CWFUu1lY.js";import{a as hs}from"./use-virtual-mcp-0jbEmvOc.js";import{n as Qe}from"./Container-CYcITvPW.js";import{c as gs}from"./SwitchHorizontal01-BMnNI1Fi.js";import{s as js}from"./Plus-CjrtKB-Y.js";import{s as vs}from"./Trash01-Cup7-ZTT.js";import{I as Ge}from"./input-5PMMNPU9.js";import{g as Ns,b as Lt,f as st,a as Ut,c as pt,d as bs,e as Ft,h as Kt,A as ys,T as ws,i as Ss,M as ht}from"./automation-runs-BJTRztep.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-CNSUv3cw.js";import{S as Is}from"./scroll-area-BqOijBAI.js";import{t as qt}from"./ChevronDown-Cf2Q-GlB.js";import{C as Cs}from"./calendar-BbhbS2FE.js";import{T as ks}from"./textarea-QEULyLXh.js";import{C as Bt}from"./collection-tabs-CQJiHDMR.js";import{S as Ts}from"./switch-D6SWnoi2.js";import{L as Ms}from"./label-CcC4_aKf.js";import{I as qe}from"./integration-icon-Dy-a3x5R.js";import{A as Ht}from"./avatar-BHEXMwdE.js";import{A as _s,a as Ds,b as Ls}from"./alert-DyB_hFGI.js";import{C as Jt}from"./card-BUTabNLA.js";import{K as ke}from"./monitoring-stats-row-BAplEVfE.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-B4dQiTEq.js";import{d as Rs,S as Os,a as zs,b as Es}from"./sheet-D99KevZC.js";import{T as De,a as ut,b as Gt,c as Qt,d as Wt,e as oe}from"./table-Cx3PhNth.js";import{n as As}from"./ChevronUp-BAxoXhnT.js";import{u as Ps}from"./use-infinite-scroll-xQQ6lYk4.js";import{c as Vs,b as Us}from"./use-automations-Db8x6SNU.js";import"./SearchMd-BL2y99rx.js";import"./sidebar-CPZXU-2w.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";import"./AlertCircle-9EFUZenf.js";import"./Tool01-Dcq7KP8Y.js";import"./RefreshCcw01-3BsQQkRx.js";import"./XCircle-UPVnJx4i.js";import"./ArrowUpRight-97355q5v.js";import"./ZapSquare-B1o2Q9OR.js";import"./Users03-BlNe2PnN.js";import"./CheckCircle-C2ualSpf.js";import"./ChevronLeft-BaV4nFMQ.js";import"./ChevronRight-CrZy8tHx.js";import"./DotsVertical-SvwN4CeV.js";import"./ZoomOut-D8vQ49we.js";import"./Star01-eRdSY4QW.js";import"./Palette-Druykvzw.js";import"./HardDrive-DNFvbooP.js";import"./Stars02-EuAFDZ5E.js";import"./LinkExternal01-CgI1VTqi.js";import"./Monitor01-Cw6kmClm.js";import"./Sun-CH2HWLCn.js";import"./Settings02-Cd4DIqaJ.js";import"./Shield01-zIbMct6w.js";import"./Stars01-v0yz6PCZ.js";import"./Upload01-C9yi1Bdg.js";import"./User01-thAIxsAs.js";import"./Users01-DPJm6-u-.js";import"./XClose-pR-QU0OQ.js";import"./X-1KR4wibP.js";import"./Zap-Cl-JM7N9.js";import"./index-BflNEs6l.js";import"./spinner-DJD6-9r-.js";import"./use-org-auth-client--i_Sx92M.js";import"./use-collections-B5Jh_wGd.js";import"./useInfiniteQuery-BGg7INCQ.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./task-status-P3BULAyA.js";import"./checkbox--nDaSUZE.js";import"./command-BehF6pb8.js";import"./index-CR_LeyNj.js";import"./dialog-Bm1pP7Vu.js";import"./pair-Ba1UoSSJ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-P6tx-uOp.js";import"./file-type-icon-CX5JEvCQ.js";import"./content-blocks-o63cs2vh.js";import"./types-jBdXInU0.js";import"./chat-context-Bu6qpu9K.js";import"./tab-id-D4SJwEQy.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-v0sCRzMO.js";import"./use-organization-settings-Izqk1Gkk.js";import"./shell-layout-4LsIVsl3.js";import"./required-auth-layout-zYH6NIDF.js";import"./useRouterState-Dm0UHjU4.js";import"./use-org-sso-C1cJTBIx.js";import"./use-navigate-to-agent-CdsMYUzL.js";import"./use-mcp-prompts-B5RhBVzg.js";import"./form-BcPtow5O.js";import"./index-50-dmJFK.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function Ks(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function $t(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function qs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
|
|
4
4
|
|