decocms 3.83.2 → 3.83.3
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-DM0HzopE.js → AlertCircle-Dq_G2Nzm.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CoxAwUHc.js → ArrowUpRight-CQ9V3qZ2.js} +1 -1
- package/dist/client/assets/{CheckCircle-D5UuMIIH.js → CheckCircle-M-SB_oIp.js} +1 -1
- package/dist/client/assets/{ChevronDown-CW3qqv2x.js → ChevronDown-BfYdHkpN.js} +1 -1
- package/dist/client/assets/{ChevronLeft-LzGuMB2U.js → ChevronLeft-C491iKrG.js} +1 -1
- package/dist/client/assets/{ChevronRight-B0GGkNIH.js → ChevronRight-BY1HqVE6.js} +1 -1
- package/dist/client/assets/{ChevronUp-DZQVuDwV.js → ChevronUp-BLP78FPA.js} +1 -1
- package/dist/client/assets/{DotsVertical-CGmC-AuM.js → DotsVertical-CCea0DBY.js} +1 -1
- package/dist/client/assets/{Eye-DRB5PFSd.js → Eye-LeoubK3e.js} +1 -1
- package/dist/client/assets/{FilterLines-uyaFw99Z.js → FilterLines-BS68ypb2.js} +1 -1
- package/dist/client/assets/{Globe01-J_5kAZ2G.js → Globe01-BcsvYW1p.js} +1 -1
- package/dist/client/assets/{Globe04-DzVxOgG6.js → Globe04-BVNSKsf5.js} +1 -1
- package/dist/client/assets/{HardDrive-BD491-6A.js → HardDrive-BYvsH8om.js} +1 -1
- package/dist/client/assets/{Key01-DpArIwgm.js → Key01-BuD8mP7N.js} +1 -1
- package/dist/client/assets/{LayoutLeft-i76gAzb8.js → LayoutLeft-CYKuZwii.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BGVgwGxd.js → LinkExternal01-DU5nTXy3.js} +1 -1
- package/dist/client/assets/{Monitor01-C4cglHcn.js → Monitor01-DiwEyrIh.js} +1 -1
- package/dist/client/assets/{Palette-NYPFTebi.js → Palette-CYyTNBF1.js} +1 -1
- package/dist/client/assets/{Play-CIhVolnk.js → Play-oEOHn7Kl.js} +1 -1
- package/dist/client/assets/{Plus-DEhikgBr.js → Plus-p2e2tk7T.js} +1 -1
- package/dist/client/assets/{SearchMd-1YEF5GNC.js → SearchMd-DLvQebgX.js} +1 -1
- package/dist/client/assets/{Settings02-B_oiQbnJ.js → Settings02-C9u5iyRe.js} +1 -1
- package/dist/client/assets/{Shield01-BrCb9Fbq.js → Shield01-CeaSgNsE.js} +1 -1
- package/dist/client/assets/{Star01-K5E2EVFR.js → Star01--VHLdkhz.js} +1 -1
- package/dist/client/assets/{Stars01-D-F-KCAY.js → Stars01-1RvLNgsH.js} +1 -1
- package/dist/client/assets/{Stars02-D5rVREl5.js → Stars02-Er9DZAE5.js} +1 -1
- package/dist/client/assets/{Sun-0LQy_BRh.js → Sun-DDm9LtlE.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Y2S_GG49.js → SwitchHorizontal01-772sqvX3.js} +1 -1
- package/dist/client/assets/{Tool01-B21_bo9F.js → Tool01-B4pupQ7x.js} +1 -1
- package/dist/client/assets/{Trash01-D4qJL0O5.js → Trash01-BOAu4VFs.js} +1 -1
- package/dist/client/assets/{Upload01-B89V4QHh.js → Upload01-Bb4xamfI.js} +1 -1
- package/dist/client/assets/{User01-676cwM-d.js → User01-CRJiYDWT.js} +1 -1
- package/dist/client/assets/{Users01-Wg2zRTbW.js → Users01-D8fzZILN.js} +1 -1
- package/dist/client/assets/{Users03-ClYFKrw1.js → Users03-BC-_ZtVi.js} +1 -1
- package/dist/client/assets/{X-B9D2h3Td.js → X-5CnCtsJU.js} +1 -1
- package/dist/client/assets/{XCircle-CSFP3d9h.js → XCircle-Dsot7agl.js} +1 -1
- package/dist/client/assets/{XClose-DBh1WmP1.js → XClose-B8-m6Ysp.js} +1 -1
- package/dist/client/assets/{Zap-BRPDiIJ_.js → Zap-DbdLJbyv.js} +1 -1
- package/dist/client/assets/{ZapSquare-Dnw5HzjO.js → ZapSquare-BD-d-pzC.js} +1 -1
- package/dist/client/assets/{ZoomOut-Cz0dpIX0.js → ZoomOut-DvNle-6p.js} +1 -1
- package/dist/client/assets/{access-gate-BrhqO3VF.js → access-gate-Bfo1MN-6.js} +1 -1
- package/dist/client/assets/{add-section-modal-D2CiFRjh.js → add-section-modal-C8cK4YYY.js} +1 -1
- package/dist/client/assets/{agent-icon-o19yp48z.js → agent-icon-OikJQ0tD.js} +1 -1
- package/dist/client/assets/{agents-list-CZG4qszH.js → agents-list-CP6nVUf_.js} +1 -1
- package/dist/client/assets/{ai-providers-CO0WuHGD.js → ai-providers-BUUJWdPq.js} +1 -1
- package/dist/client/assets/{alert-D1A1Zc_j.js → alert-BEdX_qhI.js} +1 -1
- package/dist/client/assets/{alert-dialog-BOS0dCJh.js → alert-dialog-B35bQh9V.js} +1 -1
- package/dist/client/assets/{app-editor-CIfs2FL1.js → app-editor-4WQA1zYh.js} +1 -1
- package/dist/client/assets/{auth-BdbahkUc.js → auth-9EhfyRsv.js} +1 -1
- package/dist/client/assets/{auth-catchall-CNPgs4YU.js → auth-catchall-5sn9wiIr.js} +1 -1
- package/dist/client/assets/{auth-entry-B1WtHQhf.js → auth-entry-DxGnHSZi.js} +1 -1
- package/dist/client/assets/{auth-split-layout-nvPMwr8u.js → auth-split-layout-akB0devr.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BMdVL1CA.js → authenticate-and-persist-oauth-tBiMyMPG.js} +1 -1
- package/dist/client/assets/{automation-list-row-CyNcj0ry.js → automation-list-row-Cdw0YVrC.js} +1 -1
- package/dist/client/assets/{automation-runs-Bk8JCPKW.js → automation-runs-CgHl-onu.js} +1 -1
- package/dist/client/assets/{automations-D5t0_F84.js → automations-Dg84pPYA.js} +1 -1
- package/dist/client/assets/{avatar-3AHqY5tt.js → avatar-CWHc4EZj.js} +1 -1
- package/dist/client/assets/{badge-DAumNibn.js → badge-DUbO_RN4.js} +1 -1
- package/dist/client/assets/{block-document-CyMP0Nwa.js → block-document-CHDcd7GV.js} +1 -1
- package/dist/client/assets/{brand-context-yzHlJmXd.js → brand-context-84fuZTux.js} +1 -1
- package/dist/client/assets/{buckets-D9fspdLY.js → buckets-BtWZ7TTY.js} +1 -1
- package/dist/client/assets/{capability-load-error-B4Sf_UJj.js → capability-load-error-efC7JvaJ.js} +1 -1
- package/dist/client/assets/{card-DPMEGAqZ.js → card-CNNf5saL.js} +1 -1
- package/dist/client/assets/category-editor-D-q4clOB.js +1 -0
- package/dist/client/assets/{chat-context-DANWEvls.js → chat-context-CVPSA0cN.js} +1 -1
- package/dist/client/assets/{checkbox-ByFK_aep.js → checkbox-C9da9yB_.js} +1 -1
- package/dist/client/assets/{cli-auth-success-s1Ge9151.js → cli-auth-success-VJOTMDXR.js} +1 -1
- package/dist/client/assets/{collection-detail-NWtLzyq5.js → collection-detail-CjdbzQ7n.js} +1 -1
- package/dist/client/assets/{collection-display-button-CTz7X8CM.js → collection-display-button-DzmDbICa.js} +1 -1
- package/dist/client/assets/{collection-search-CQMKW4Jp.js → collection-search-Do7Cp7BP.js} +1 -1
- package/dist/client/assets/{collection-tabs-jlQTSy-i.js → collection-tabs-NlIGO6dT.js} +1 -1
- package/dist/client/assets/{command-DNx5Uhv2.js → command-DMfMyCz6.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BGm-51c6.js → commerce-onboarding-DG1WmOiH.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BeQBPgXI.js → connect-desktop-dialog-BpO---Ho.js} +1 -1
- package/dist/client/assets/{connection-card-CHIFmA8R.js → connection-card-D2GNuFJz.js} +1 -1
- package/dist/client/assets/{connection-detail-BTDN1t-U.js → connection-detail-DGvDSyd2.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CWhKbOwZ.js → connection-form-helpers-B19OLFDN.js} +1 -1
- package/dist/client/assets/{connections-Df79XqMS.js → connections-DagbmY0t.js} +1 -1
- package/dist/client/assets/{context-menu-DkDkJvo8.js → context-menu-qcMftRg7.js} +1 -1
- package/dist/client/assets/{decopilot-CmY0uQsK.js → decopilot-b_zAKgPV.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CXkkAKQx.js → decopilot-sse-pool-DelsNiOI.js} +1 -1
- package/dist/client/assets/{dialog-fVpV_18N.js → dialog-DHc-iPx9.js} +1 -1
- package/dist/client/assets/{domain-settings-BIaZaqXi.js → domain-settings-BUi0oMEx.js} +1 -1
- package/dist/client/assets/{drawer-iojIyQ7Z.js → drawer-Cwhc32-v.js} +1 -1
- package/dist/client/assets/{dropdown-menu-HRW3zYBQ.js → dropdown-menu-9t4d4l4a.js} +1 -1
- package/dist/client/assets/{empty-state-ySGQGV31.js → empty-state-Dg_iHbDT.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CrjpOcI0.js → extract-connection-data-DNQRXpX9.js} +1 -1
- package/dist/client/assets/{file-explorer-D1OUZ8cU.js → file-explorer-Ch_-pBTl.js} +1 -1
- package/dist/client/assets/{file-type-icon-BSAfTQY6.js → file-type-icon-DYGh6lpU.js} +1 -1
- package/dist/client/assets/{files-Dvw5nwbp.js → files-DU9-Yfzy.js} +1 -1
- package/dist/client/assets/{form-dD3QczZa.js → form-DKjNHSgl.js} +1 -1
- package/dist/client/assets/{general-C6KcKAXv.js → general-BV5-cxzn.js} +1 -1
- package/dist/client/assets/{github-repo-picker-YqP06Fto.js → github-repo-picker-D85COA-s.js} +1 -1
- package/dist/client/assets/{hooks-C3qiFxIG.js → hooks-DK3MSO7c.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DDsiz0pE.js → import-from-deco-dialog-DdNn_Vm5.js} +1 -1
- package/dist/client/assets/{index-BO-4uKUn.js → index-B6XJrY37.js} +1 -1
- package/dist/client/assets/{index-jh_AV7fc.js → index-BRDh59qB.js} +1 -1
- package/dist/client/assets/{index-C102AH4s.js → index-BZ1n_eeg.js} +1 -1
- package/dist/client/assets/{index-BMCJlhk3.js → index-Ba-qr1CW.js} +3 -3
- package/dist/client/assets/{index-q8ngIE68.js → index-BgSq9_gk.js} +1 -1
- package/dist/client/assets/{index-DqK88OS0.js → index-BiDBbTkI.js} +1 -1
- package/dist/client/assets/{index-CpgQ8CBr.js → index-ChXm-kke.js} +1 -1
- package/dist/client/assets/{index-BodEVjlg.js → index-CtYIN751.js} +1 -1
- package/dist/client/assets/{index-CXXnf1Qe.js → index-D6Goqiqa.js} +1 -1
- package/dist/client/assets/{index-B7xwJlcR.js → index-DLD_CxqI.js} +5 -5
- package/dist/client/assets/{index-Ci5DmEN0.js → index-DPCQ9W7J.js} +1 -1
- package/dist/client/assets/{index-BK10Xdph.js → index-DhgDI0NK.js} +1 -1
- package/dist/client/assets/{index-FKJOX04p.js → index-Dis4Pr9Y.js} +1 -1
- package/dist/client/assets/{index-Cvy8WHIB.js → index-DoNPC42T.js} +1 -1
- package/dist/client/assets/{index-redirect-B05if20n.js → index-redirect-BAZCiFNw.js} +1 -1
- package/dist/client/assets/{input-Bk-XA8aE.js → input-BBCESNsB.js} +1 -1
- package/dist/client/assets/{integration-icon-D5R24LMd.js → integration-icon-qruX57ku.js} +1 -1
- package/dist/client/assets/{label-DbgfgBJH.js → label-B485QK8V.js} +1 -1
- package/dist/client/assets/{login-BnanKvfh.js → login-ltMol0GQ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Ge7_9DJm.js → mcp-oauth-dU1JqorS.js} +1 -1
- package/dist/client/assets/{members-OMqqgRie.js → members-OJ7G0YUL.js} +1 -1
- package/dist/client/assets/{monaco-editor-CLbivzeA.js → monaco-editor-BIiIfKcK.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D988ksKz.js → monitoring-stats-row-D6qosWnk.js} +1 -1
- package/dist/client/assets/{oauth-callback-CMcTYSQ9.js → oauth-callback-DOOGhQs-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CPlg-Iun.js → oauth-callback-ai-provider-Bmuhx9bM.js} +1 -1
- package/dist/client/assets/{onboarding-BQtZWhzG.js → onboarding-B61MPRWq.js} +1 -1
- package/dist/client/assets/{org-install-EHXdq4o2.js → org-install-CEh8CLxc.js} +1 -1
- package/dist/client/assets/{org-layout-qDY2vnUU.js → org-layout-CMZz9TrX.js} +1 -1
- package/dist/client/assets/{organization-choice-BOiOzldx.js → organization-choice-DtJ-TCYP.js} +1 -1
- package/dist/client/assets/{page-seo-form-DeK8_ys8.js → page-seo-form-snxzdzwx.js} +1 -1
- package/dist/client/assets/page-seo-sheet-B2tZgmq5.js +1 -0
- package/dist/client/assets/{popover-BTH_4TON.js → popover-Cv6LCVas.js} +1 -1
- package/dist/client/assets/{post-editor-DJSqRdmQ.js → post-editor-CSzzEUXL.js} +1 -1
- package/dist/client/assets/{preview-dialog-C4U9zVzk.js → preview-dialog-B4xvQs8x.js} +1 -1
- package/dist/client/assets/{primitives-CXIIxbFE.js → primitives-BuTs77_N.js} +1 -1
- package/dist/client/assets/{profile-OkUeU-xS.js → profile-Cq91ylKm.js} +1 -1
- package/dist/client/assets/project-app-view-DEcY821H.js +1 -0
- package/dist/client/assets/record-editor-DKwCdsae.js +1 -0
- package/dist/client/assets/registry-CXRQtC1R.js +2 -0
- package/dist/client/assets/{registry-layout-CmbVIFjk.js → registry-layout-hgoaCWQE.js} +1 -1
- package/dist/client/assets/{require-capability-B3YVeyKQ.js → require-capability-KHCur5VM.js} +1 -1
- package/dist/client/assets/{required-auth-layout-hwOac595.js → required-auth-layout-D-J1BueF.js} +1 -1
- package/dist/client/assets/{reset-password-DYADQ6t-.js → reset-password-Btve25Sd.js} +1 -1
- package/dist/client/assets/{roles-CwZxDmMd.js → roles-DDuyJ6YR.js} +1 -1
- package/dist/client/assets/{save-status-cz-ufgN_.js → save-status-CJES-J6W.js} +1 -1
- package/dist/client/assets/{scroll-area-BliS1K3p.js → scroll-area-DrAN9Fvu.js} +1 -1
- package/dist/client/assets/{search-input-CUOcSr_7.js → search-input-fHPtOP7y.js} +1 -1
- package/dist/client/assets/{secrets-CyW5acaW.js → secrets-CiTh5KLj.js} +1 -1
- package/dist/client/assets/{sections-editor-Dv8SUTjk.js → sections-editor-DB30d9vt.js} +1 -1
- package/dist/client/assets/{select-8EVXQGwX.js → select-Dd_an4jF.js} +1 -1
- package/dist/client/assets/{select-model-iQAMpxgJ.js → select-model-BKUEE8m5.js} +1 -1
- package/dist/client/assets/{seo-editor-BNVUsXCz.js → seo-editor-CTBBS5En.js} +1 -1
- package/dist/client/assets/{settings-layout-D-yUHTQc.js → settings-layout-Coikikdv.js} +1 -1
- package/dist/client/assets/{settings-section-DHTir3TC.js → settings-section-ZNhTRSX3.js} +1 -1
- package/dist/client/assets/{sheet-ZPG9h0Fj.js → sheet-B69G1O5h.js} +1 -1
- package/dist/client/assets/{shell-controls-Zawsretc.js → shell-controls-B16XaWpP.js} +1 -1
- package/dist/client/assets/{shell-layout-CWAvk5Go.js → shell-layout-DQpppXAg.js} +1 -1
- package/dist/client/assets/{shell-route-loading-mpOo6h4k.js → shell-route-loading-BhN3sCYk.js} +1 -1
- package/dist/client/assets/{sidebar-DU6XXtnA.js → sidebar-Pqq_WVl7.js} +1 -1
- package/dist/client/assets/{skeleton-CKrKTMUA.js → skeleton-DDfTse6v.js} +1 -1
- package/dist/client/assets/{sortable.esm-B3t9DDZ6.js → sortable.esm-Zgc8llTJ.js} +1 -1
- package/dist/client/assets/{sso-CERYxMuj.js → sso-5g-PCMCm.js} +1 -1
- package/dist/client/assets/{store-mnbDCvL0.js → store-0O9jG9RN.js} +1 -1
- package/dist/client/assets/store-registry-BE28Qqir.js +2 -0
- package/dist/client/assets/{studio-tools-BdR8-wJW.js → studio-tools-Zf2j5Vw6.js} +1 -1
- package/dist/client/assets/{switch-DLwkt3ng.js → switch-DVGIVYD-.js} +1 -1
- package/dist/client/assets/{table-CHbuq2So.js → table-CaQbuRGR.js} +1 -1
- package/dist/client/assets/{tabs-C3tau4Eq.js → tabs-CNn3gT-l.js} +1 -1
- package/dist/client/assets/{task-status-Cpo5H16E.js → task-status-C22YJZSD.js} +1 -1
- package/dist/client/assets/{textarea-CJuB4hQ7.js → textarea-BNj8LeAc.js} +1 -1
- package/dist/client/assets/{toggle-group-Ckfjs-c4.js → toggle-group-BGuBCRpR.js} +1 -1
- package/dist/client/assets/{toolbar-D1N_WILM.js → toolbar-MHh5nkt1.js} +1 -1
- package/dist/client/assets/{tooltip-DjHKSu56.js → tooltip-Bv4DpGHU.js} +1 -1
- package/dist/client/assets/{types-CNWQoCyo.js → types-DV4xEeHM.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BxzRSeJ0.js → use-ai-providers-rovOwk8E.js} +1 -1
- package/dist/client/assets/{use-automations-Br1p5DHc.js → use-automations-5rZgDplp.js} +1 -1
- package/dist/client/assets/{use-capability-E8ccWznH.js → use-capability-DrYAgeoP.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BW4BJ8Tt.js → use-clock-tick-CPqO-BWO.js} +1 -1
- package/dist/client/assets/{use-collections-CsNhZa6R.js → use-collections-CdkIpoPj.js} +1 -1
- package/dist/client/assets/{use-connection-_slG13py.js → use-connection-BvI4z5Go.js} +1 -1
- package/dist/client/assets/{use-copy-60B0ujzD.js → use-copy-Cud6yKog.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-aSsDb_hC.js → use-create-virtual-mcp-DvBuDwwU.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DlQ25v46.js → use-debounced-autosave-1NuS6x2p.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BSgRrEnr.js → use-delete-connection-CUPyGyfe.js} +1 -1
- package/dist/client/assets/{use-file-configs-TueoM3xk.js → use-file-configs-iLxbpR0W.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B7KmD1ay.js → use-infinite-scroll-CMIncUkM.js} +1 -1
- package/dist/client/assets/{use-join-requests-Bugx9GLx.js → use-join-requests-Rcyk6COV.js} +1 -1
- package/dist/client/assets/{use-mcp-client--_ZSmyGd.js → use-mcp-client-DNt8z_cQ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Bi0YM-MV.js → use-mcp-prompts-BvvmYT5d.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C6z5gFrv.js → use-mcp-tools-DmQFC6-r.js} +1 -1
- package/dist/client/assets/{use-members-D4NNP_ry.js → use-members-Ddo88B9U.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C2eJezkw.js → use-navigate-to-agent-BKUFyiJj.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bn9WqUMO.js → use-org-auth-client-CiDUlr9j.js} +1 -1
- package/dist/client/assets/{use-org-sso-CgbvxseW.js → use-org-sso-BFHNwstz.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cg0ug59K.js → use-organization-roles-Dq9V89Eq.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DQ5ROkEQ.js → use-organization-settings-gIQB6FWt.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Ba1xQHz9.js → use-registry-connections-BASvWu3z.js} +1 -1
- package/dist/client/assets/{use-secrets-B1jqMRBn.js → use-secrets-BghcHplb.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bj_NbDO6.js → use-status-sounds-uYZzmwes.js} +1 -1
- package/dist/client/assets/{use-view-mode-BvWJalT6.js → use-view-mode-lCZKY_ek.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BZlyJ3on.js → use-virtual-mcp-C-sRaXYQ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C_KTVASW.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CsMnvHSV.js +1 -0
- package/dist/client/assets/{variant-calendar-C0Qs1GnN.js → variant-calendar-B-ZaZ0O3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DcivAyKH.js → view-mode-toggle-CjqQoLPT.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +36 -36
- package/dist/server/server.js +31 -31
- package/package.json +1 -1
- package/dist/client/assets/category-editor-nDclmHNc.js +0 -1
- package/dist/client/assets/page-seo-sheet-CnuTSA1a.js +0 -1
- package/dist/client/assets/project-app-view-ClFsE-uv.js +0 -1
- package/dist/client/assets/record-editor-Ba_-uY6W.js +0 -1
- package/dist/client/assets/registry-OeyyY_3h.js +0 -2
- package/dist/client/assets/store-registry-CJLz8NHB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DDGqv00b.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DI0bMzys.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,w as q,K as H,p as $,a7 as V,ad as z,j as n,r as R,ai as Y,a2 as W,bc as X,U as x,Z as C,ba as J,V as I,bb as _,Y as Q,X as k,bK as Z,bJ as ee}from"./index-
|
|
1
|
+
import{c as j,w as q,K as H,p as $,a7 as V,ad as z,j as n,r as R,ai as Y,a2 as W,bc as X,U as x,Z as C,ba as J,V as I,bb as _,Y as Q,X as k,bK as Z,bJ as ee}from"./index-Ba-qr1CW.js";import{i as oe}from"./mcp-oauth-dU1JqorS.js";import{B as w}from"./badge-DUbO_RN4.js";import{b as E,T as P,a as S,c as te}from"./tooltip-Bv4DpGHU.js";import{g as re}from"./types-DV4xEeHM.js";import{s as ae}from"./Eye-LeoubK3e.js";import{s as se}from"./Star01--VHLdkhz.js";import{ai as ne}from"./agent-icon-OikJQ0tD.js";function ke(d){const e=j.c(11),{connectionId:t}=d,{org:a}=q();let o,r,s;e[0]!==t||e[1]!==a.slug?(o=new URL(`/api/${a.slug}/mcp/${t}`,window.location.origin),s=$,r=H.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=a.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==a.id?(i=()=>oe({url:o.href,token:null,orgId:a.id}),e[5]=o,e[6]=a.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}const ie=[{key:"readOnlyHint",label:"Read-only",Icon:ae,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:V,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:z,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:se,variant:"outline"}];function we(d){const e=j.c(18),{annotations:t,_meta:a}=d;let o;e[0]!==a?(o=re(a),e[0]=a,e[1]=o):o=e[1];const r=!!o;let s,i,c,l,p;if(e[2]!==t||e[3]!==r){p=Symbol.for("react.early_return_sentinel");e:{const f=t?ie.filter(m=>t[m.key]===!0):[];if(f.length===0&&!r){p=null;break e}s=te,i="flex gap-1 flex-nowrap",e[9]!==r?(c=r&&n.jsxs(E,{children:[n.jsx(P,{asChild:!0,children:n.jsx(w,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:n.jsx(ne,{})})}),n.jsx(S,{children:"Interactive"})]}),e[9]=r,e[10]=c):c=e[10],l=f.map(ce)}e[2]=t,e[3]=r,e[4]=s,e[5]=i,e[6]=c,e[7]=l,e[8]=p}else s=e[4],i=e[5],c=e[6],l=e[7],p=e[8];if(p!==Symbol.for("react.early_return_sentinel"))return p;let u;e[11]!==i||e[12]!==c||e[13]!==l?(u=n.jsxs("div",{className:i,children:[c,l]}),e[11]=i,e[12]=c,e[13]=l,e[14]=u):u=e[14];let v;return e[15]!==s||e[16]!==u?(v=n.jsx(s,{children:u}),e[15]=s,e[16]=u,e[17]=v):v=e[17],v}function ce(d){const{label:e,Icon:t,variant:a}=d;return n.jsxs(E,{children:[n.jsx(P,{asChild:!0,children:n.jsx(w,{asChild:!0,variant:a,className:"size-6 p-1",children:n.jsx(t,{})})}),n.jsx(S,{children:e})]},e)}var g="Radio",[de,A]=k(g),[le,ue]=de(g),N=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:a,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...p}=d,[u,v]=R.useState(null),f=C(e,y=>v(y)),m=R.useRef(!1),h=u?l||!!u.closest("form"):!0;return n.jsxs(le,{scope:t,checked:o,disabled:s,children:[n.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":O(o),"data-disabled":s?"":void 0,disabled:s,value:i,...p,ref:f,onClick:I(d.onClick,y=>{o||c?.(),h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),h&&n.jsx(D,{control:u,bubbles:!m.current,name:a,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});N.displayName=g;var G="RadioIndicator",T=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:a,...o}=d,r=ue(G,t);return n.jsx(Q,{present:a||r.checked,children:n.jsx(x.span,{"data-state":O(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});T.displayName=G;var pe="RadioBubbleInput",D=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:a=!0,...o},r)=>{const s=R.useRef(null),i=C(s,r),c=Z(t),l=ee(e);return R.useEffect(()=>{const p=s.current;if(!p)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&f){const m=new Event("click",{bubbles:a});f.call(p,t),p.dispatchEvent(m)}},[c,t,a]),n.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=pe;function O(d){return d?"checked":"unchecked"}var fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[ve]=k(b,[_,A]),M=_(),U=A(),[me,Re]=ve(b),B=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:a,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:p=!0,onValueChange:u,...v}=d,f=M(t),m=Y(l),[h,y]=W({prop:r,defaultProp:o??null,onChange:u,caller:b});return n.jsx(me,{scope:t,name:a,required:s,disabled:i,value:h,onValueChange:y,children:n.jsx(X,{asChild:!0,...f,orientation:c,dir:m,loop:p,children:n.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});B.displayName=b;var K="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:a,...o}=d,r=Re(K,t),s=r.disabled||a,i=M(t),c=U(t),l=R.useRef(null),p=C(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const f=h=>{fe.includes(h.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",m)}},[]),n.jsx(J,{asChild:!0,...i,focusable:!s,active:u,children:n.jsx(N,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:p,onCheck:()=>r.onValueChange(o.value),onKeyDown:I(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:I(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=K;var he="RadioGroupIndicator",L=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...a}=d,o=U(t);return n.jsx(T,{...o,...a,ref:e})});L.displayName=he;var Ee=B,Pe=F,Se=L;export{Pe as I,Ee as R,we as T,Se as a,ke as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as d,r as p,j as r}from"./index-
|
|
1
|
+
import{c as f,l as d,r as p,j as r}from"./index-Ba-qr1CW.js";import{m as w}from"./sidebar-Pqq_WVl7.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,w as Fe,m as Je,t as W,b as et,u as tt,E as Te,ad as Tt}from"./index-
|
|
1
|
+
import{c as S,r as U,j as t,k as Y,B as _,K as B,l as ee,w as Fe,m as Je,t as W,b as et,u as tt,E as Te,ad as Tt}from"./index-Ba-qr1CW.js";import{i as zt}from"./ChevronRight-BY1HqVE6.js";import{s as st}from"./Eye-LeoubK3e.js";import{n as Pt,i as nt}from"./Globe01-BcsvYW1p.js";import{a as lt,d as Ft,e as Ot,i as Et}from"./ZoomOut-DvNle-6p.js";import{a as pe}from"./Palette-CYyTNBF1.js";import{s as At}from"./Plus-p2e2tk7T.js";import{t as Mt}from"./Stars01-1RvLNgsH.js";import{i as xe}from"./Upload01-Bb4xamfI.js";import{i as Oe}from"./Zap-DbdLJbyv.js";import{u as it}from"./tooltip-Bv4DpGHU.js";import{f as Ut,a as Bt,b as Lt,c as _t,d as Rt,e as qt,A as It,g as Kt}from"./alert-dialog-B35bQh9V.js";import{c as Ee,d as Ae,a as Me,f as rt,D as Ht,b as Vt,e as Gt}from"./dialog-DHc-iPx9.js";import{I as Ue}from"./input-BBCESNsB.js";import{S as K}from"./skeleton-DDfTse6v.js";import{F as ie,d as at,M as ot}from"./file-type-icon-DYGh6lpU.js";import{a as Qt}from"./toolbar-MHh5nkt1.js";import{r as Be,s as A,a as be,t as Wt,u as Pe,v as Le,h as Yt,L as Xt,o as Zt,p as Jt,n as es,R as Ve,q as ts,S as ss,b as ns,w as ct,x as le,y as ls}from"./preview-dialog-B4xvQs8x.js";import{a as ve}from"./DotsVertical-CCea0DBY.js";import{i as is}from"./Key01-BuD8mP7N.js";import{s as je}from"./Trash01-BOAu4VFs.js";import{a as ye,c as te,b as we,D as ke}from"./dropdown-menu-9t4d4l4a.js";import{T as rs}from"./textarea-BNj8LeAc.js";import{t as as}from"./ChevronDown-BfYdHkpN.js";import{n as os}from"./ChevronUp-BLP78FPA.js";import{i as ge}from"./X-5CnCtsJU.js";import"./tab-id-BptcWVWa.js";import"./ChevronLeft-C491iKrG.js";import"./LinkExternal01-DU5nTXy3.js";import"./XClose-B8-m6Ysp.js";import"./index-BZ1n_eeg.js";import"./LayoutLeft-CYKuZwii.js";import"./popover-Cv6LCVas.js";const cs=new Set(["output","upload","public","home"]),ds=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function fs(s){return cs.has(s)||!ds.test(s)?"home":s}function us(s){const e=S.c(33);let n,i,l;e[0]!==s?({glyph:n,readOnly:l,...i}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=l):(n=e[1],i=e[2],l=e[3]);const r=U.useId(),a=`${r}-back`,c=`${r}-front`,o=`url(#${a})`;let d;e[4]!==o?(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:o}),e[4]=o,e[5]=d):d=e[5];const u=`url(#${c})`;let f;e[6]!==u?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),e[6]=u,e[7]=f):f=e[7];let m,h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),h=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),x=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=m,e[9]=h,e[10]=x):(m=e[8],h=e[9],x=e[10]);let v;e[11]!==n?(v=n&&t.jsx(n,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=n,e[12]=v):v=e[12];let j;e[13]!==l?(j=l&&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(st,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=l,e[14]=j):j=e[14];let y,k;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),k=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=y,e[16]=k):(y=e[15],k=e[16]);let N;e[17]!==a?(N=t.jsxs("linearGradient",{id:a,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[y,k]}),e[17]=a,e[18]=N):N=e[18];let g,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("stop",{stopColor:"#72B6FA"}),C=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=g,e[20]=C):(g=e[19],C=e[20]);let D;e[21]!==c?(D=t.jsxs("radialGradient",{id:c,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[g,C]}),e[21]=c,e[22]=D):D=e[22];let P;e[23]!==N||e[24]!==D?(P=t.jsxs("defs",{children:[N,D]}),e[23]=N,e[24]=D,e[25]=P):P=e[25];let $;return e[26]!==i||e[27]!==P||e[28]!==d||e[29]!==f||e[30]!==v||e[31]!==j?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,m,h,x,v,j,P]}),e[26]=i,e[27]=P,e[28]=d,e[29]=f,e[30]=v,e[31]=j,e[32]=$):$=e[32],$}function ms(s,e,n){return e?"color":n?"font":/^--brand-(text|fw|leading|tracking)/i.test(s)?"type":/^--brand-space/i.test(s)?"space":/^--brand-radius/i.test(s)?"radius":/^--brand-shadow/i.test(s)?"shadow":/^--brand-(duration|delay|ease)/i.test(s)?"motion":"other"}const hs=/^(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\(/i,ps=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,xs=["svg","png","jpg","jpeg","webp","avif","gif"];function gs(s){return s.split(".").pop()?.toLowerCase()??""}function bs(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vs(s){const e=s.trim();return ps.test(e)||hs.test(e)}function js(s){const e=s.trim(),n=e.match(/^#([0-9a-f]{3})$/i);return n?.[1]?`#${[...n[1]].map(i=>i+i).join("")}`:e}function dt(s){const e=[],n=new Map,i=/(--brand-[\w-]+)\s*:\s*([^;]+);/g;let l;for(;(l=i.exec(s))!==null;){const r=l[1],a=l[2].trim();n.has(r)||e.push(r),n.set(r,a)}return e.map(r=>{const a=n.get(r),c=vs(a),o=/^--brand-font/i.test(r);return{name:r,value:a,isColor:c,isFont:o,kind:ms(r,c,o)}})}const Ge=["primary","secondary","accent","neutral","success","warning","error","info","bg","fg","border","ring"];function ys(s){return s.match(/^--brand-([a-z]+)/i)?.[1]?.toLowerCase()??s}function ws(s){const e=[],n=new Map;for(const l of s){if(l.kind!=="color")continue;const r=ys(l.name);n.has(r)||(e.push(r),n.set(r,[])),n.get(r).push(l)}return e.map(l=>{const r=n.get(l);return{family:l,tokens:r,isRamp:r.filter(a=>/-\d+$/.test(a.name)).length>=5}}).sort((l,r)=>{const a=Ge.indexOf(l.family),c=Ge.indexOf(r.family);return a===-1&&c===-1?0:a===-1?1:c===-1?-1:a-c})}function ks(s,e,n){const i=new RegExp(`(${bs(e)}\\s*:\\s*)[^;]+(;)`);if(i.test(s))return s.replace(i,(a,c,o)=>`${c}${n}${o}`);const l=s.search(/:root\s*\{/);if(l!==-1){const a=s.indexOf("{",l)+1;return`${s.slice(0,a)}
|
|
2
2
|
${e}: ${n};${s.slice(a)}`}const r=s.length>0&&!s.endsWith(`
|
|
3
3
|
`)?`
|
|
4
4
|
`:"";return`${s}${r}:root {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{am as ot,an as he,ao as lt,ap as at,aq as Oe,m as le,ar as ct,as as dt,r as $,at as mt,au as ut,av as ft,aw as ht,ax as Se,ay as pt,az as xt,aA as gt,c as k,j as n,w as J,l as G,i as ae,aB as Z,t as U,K as te,k as se,B as Y,d as bt,a7 as yt,E as vt,a as jt}from"./index-BMCJlhk3.js";import{u as be}from"./tooltip-DjHKSu56.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client--_ZSmyGd.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-BZlyJ3on.js";import{i as $t}from"./ChevronUp-DZQVuDwV.js";import{e as At,A as de,Y as Et,a7 as Ot,D as Pt,k as Mt}from"./agent-icon-o19yp48z.js";import{s as ye}from"./Plus-DEhikgBr.js";import{i as Pe}from"./X-B9D2h3Td.js";import{C as re}from"./index-Ci5DmEN0.js";import{b as zt}from"./chat-context-DANWEvls.js";import{N as Rt}from"./decopilot-CmY0uQsK.js";import{g as Lt,b as Me,c as oe,K as ze,P as Re,D as Le,d as Ht,S as Dt,v as Ft,e as Ut,C as Qt,s as Bt,l as qt,k as Vt,o as Kt,u as Wt,j as Gt,h as Jt}from"./sortable.esm-B3t9DDZ6.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-DQ5ROkEQ.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-CWAvk5Go.js";import{I as Fe}from"./input-Bk-XA8aE.js";import{S as es,t as je,P as ts,j as ss,s as ns,g as is}from"./scroll-area-BliS1K3p.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-ZPG9h0Fj.js";import{S as H}from"./skeleton-CKrKTMUA.js";import{t as Ue}from"./ChevronDown-CW3qqv2x.js";import{c as Qe}from"./ZoomOut-Cz0dpIX0.js";import{g as Be,M as ds}from"./types-CNWQoCyo.js";import{I as qe}from"./integration-icon-D5R24LMd.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-8EVXQGwX.js";import{T as ps}from"./textarea-CJuB4hQ7.js";import{u as Ve}from"./studio-tools-BdR8-wJW.js";import{a as xs}from"./use-mcp-tools-C6z5gFrv.js";import{i as gs}from"./XCircle-CSFP3d9h.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-Bi0YM-MV.js";import{u as vs,w as js}from"./hooks-C3qiFxIG.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-HRW3zYBQ.js";import{s as Is}from"./Trash01-D4qJL0O5.js";import{a as Ts,u as ks}from"./use-ai-providers-BxzRSeJ0.js";import{u as $s}from"./connect-desktop-dialog-BeQBPgXI.js";import{a as As}from"./toolbar-D1N_WILM.js";import"./auth-BdbahkUc.js";import"./use-collections-CsNhZa6R.js";import"./AlertCircle-DM0HzopE.js";import"./Tool01-B21_bo9F.js";import"./SwitchHorizontal01-Y2S_GG49.js";import"./Settings02-B_oiQbnJ.js";import"./ArrowUpRight-CoxAwUHc.js";import"./ZapSquare-Dnw5HzjO.js";import"./Users03-ClYFKrw1.js";import"./CheckCircle-D5UuMIIH.js";import"./ChevronLeft-LzGuMB2U.js";import"./ChevronRight-B0GGkNIH.js";import"./DotsVertical-CGmC-AuM.js";import"./Stars02-D5rVREl5.js";import"./Eye-DRB5PFSd.js";import"./Globe01-J_5kAZ2G.js";import"./FilterLines-uyaFw99Z.js";import"./Star01-K5E2EVFR.js";import"./Globe04-DzVxOgG6.js";import"./HardDrive-BD491-6A.js";import"./Key01-DpArIwgm.js";import"./LayoutLeft-i76gAzb8.js";import"./LinkExternal01-BGVgwGxd.js";import"./Monitor01-C4cglHcn.js";import"./Sun-0LQy_BRh.js";import"./Palette-NYPFTebi.js";import"./Play-CIhVolnk.js";import"./SearchMd-1YEF5GNC.js";import"./Shield01-BrCb9Fbq.js";import"./Stars01-D-F-KCAY.js";import"./Upload01-B89V4QHh.js";import"./User01-676cwM-d.js";import"./Users01-Wg2zRTbW.js";import"./XClose-DBh1WmP1.js";import"./Zap-BRPDiIJ_.js";import"./dialog-fVpV_18N.js";import"./drawer-iojIyQ7Z.js";import"./collection-search-CQMKW4Jp.js";import"./form-dD3QczZa.js";import"./label-DbgfgBJH.js";import"./tabs-C3tau4Eq.js";import"./toggle-group-Ckfjs-c4.js";import"./popover-BTH_4TON.js";import"./command-DNx5Uhv2.js";import"./index-jh_AV7fc.js";import"./useInfiniteQuery-DDGqv00b.js";import"./use-infinite-scroll-B7KmD1ay.js";import"./question-004-sINsf4GQ.js";import"./checkbox-ByFK_aep.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-3AHqY5tt.js";import"./settings-section-DHTir3TC.js";import"./card-DPMEGAqZ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CHIFmA8R.js";import"./use-registry-connections-Ba1xQHz9.js";import"./use-connection-_slG13py.js";import"./extract-connection-data-CrjpOcI0.js";import"./collection-tabs-jlQTSy-i.js";import"./badge-DAumNibn.js";import"./connection-form-helpers-CWhKbOwZ.js";import"./authenticate-and-persist-oauth-BMdVL1CA.js";import"./mcp-oauth-Ge7_9DJm.js";import"./useSuspenseInfiniteQuery-DI0bMzys.js";import"./required-auth-layout-hwOac595.js";import"./use-org-sso-CgbvxseW.js";import"./use-clock-tick-BW4BJ8Tt.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-60B0ujzD.js";import"./file-type-icon-BSAfTQY6.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-C2eJezkw.js";import"./decopilot-sse-pool-CXkkAKQx.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=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.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,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(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.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 i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(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.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{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]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.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 i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Lt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Bt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(qt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Ht,onDragEnd:a,children:n.jsx(Dt,{items:r.map(Vs),strategy:Ft,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),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-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ut(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Qt.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,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":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,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:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — 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:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.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?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.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 Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=Vt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Kt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.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:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.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:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("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")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{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]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,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:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,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:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.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:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.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:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.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:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}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 T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.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 v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.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:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,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:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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 io(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{io as default};
|
|
1
|
+
import{am as ot,an as he,ao as lt,ap as at,aq as Oe,m as le,ar as ct,as as dt,r as $,at as mt,au as ut,av as ft,aw as ht,ax as Se,ay as pt,az as xt,aA as gt,c as k,j as n,w as J,l as G,i as ae,aB as Z,t as U,K as te,k as se,B as Y,d as bt,a7 as yt,E as vt,a as jt}from"./index-Ba-qr1CW.js";import{u as be}from"./tooltip-Bv4DpGHU.js";import{i as wt,u as ce,m as Nt,a as St,S as Ct}from"./use-mcp-client-DNt8z_cQ.js";import{u as _t,b as It,v as Tt,a as kt}from"./use-virtual-mcp-C-sRaXYQ.js";import{i as $t}from"./ChevronUp-BLP78FPA.js";import{e as At,A as de,Y as Et,a7 as Ot,D as Pt,k as Mt}from"./agent-icon-OikJQ0tD.js";import{s as ye}from"./Plus-p2e2tk7T.js";import{i as Pe}from"./X-5CnCtsJU.js";import{C as re}from"./index-DPCQ9W7J.js";import{b as zt}from"./chat-context-CVPSA0cN.js";import{N as Rt}from"./decopilot-b_zAKgPV.js";import{g as Lt,b as Me,c as oe,K as ze,P as Re,D as Le,d as Ht,S as Dt,v as Ft,e as Ut,C as Qt,s as Bt,l as qt,k as Vt,o as Kt,u as Wt,j as Gt,h as Jt}from"./sortable.esm-Zgc8llTJ.js";import{u as He,a as De,o as Xt}from"./use-organization-settings-gIQB6FWt.js";import{c as ve,b as Zt,h as Yt}from"./shell-layout-DQpppXAg.js";import{I as Fe}from"./input-BBCESNsB.js";import{S as es,t as je,P as ts,j as ss,s as ns,g as is}from"./scroll-area-DrAN9Fvu.js";import{S as rs,a as os,b as ls,c as as,d as cs}from"./sheet-B69G1O5h.js";import{S as H}from"./skeleton-DDfTse6v.js";import{t as Ue}from"./ChevronDown-BfYdHkpN.js";import{c as Qe}from"./ZoomOut-DvNle-6p.js";import{g as Be,M as ds}from"./types-DV4xEeHM.js";import{I as qe}from"./integration-icon-qruX57ku.js";import{b as ms,c as us,S as fs,a as Ce,d as hs}from"./select-Dd_an4jF.js";import{T as ps}from"./textarea-BNj8LeAc.js";import{u as Ve}from"./studio-tools-Zf2j5Vw6.js";import{a as xs}from"./use-mcp-tools-DmQFC6-r.js";import{i as gs}from"./XCircle-Dsot7agl.js";import{f as bs}from"./tab-id-BptcWVWa.js";import{g as ys}from"./use-mcp-prompts-BvvmYT5d.js";import{u as vs,w as js}from"./hooks-DK3MSO7c.js";import{a as ws,g as Ns,c as Ss,b as Cs,D as _s}from"./dropdown-menu-9t4d4l4a.js";import{s as Is}from"./Trash01-BOAu4VFs.js";import{a as Ts,u as ks}from"./use-ai-providers-rovOwk8E.js";import{u as $s}from"./connect-desktop-dialog-BpO---Ho.js";import{a as As}from"./toolbar-MHh5nkt1.js";import"./auth-9EhfyRsv.js";import"./use-collections-CdkIpoPj.js";import"./AlertCircle-Dq_G2Nzm.js";import"./Tool01-B4pupQ7x.js";import"./SwitchHorizontal01-772sqvX3.js";import"./Settings02-C9u5iyRe.js";import"./ArrowUpRight-CQ9V3qZ2.js";import"./ZapSquare-BD-d-pzC.js";import"./Users03-BC-_ZtVi.js";import"./CheckCircle-M-SB_oIp.js";import"./ChevronLeft-C491iKrG.js";import"./ChevronRight-BY1HqVE6.js";import"./DotsVertical-CCea0DBY.js";import"./Stars02-Er9DZAE5.js";import"./Eye-LeoubK3e.js";import"./Globe01-BcsvYW1p.js";import"./FilterLines-BS68ypb2.js";import"./Star01--VHLdkhz.js";import"./Globe04-BVNSKsf5.js";import"./HardDrive-BYvsH8om.js";import"./Key01-BuD8mP7N.js";import"./LayoutLeft-CYKuZwii.js";import"./LinkExternal01-DU5nTXy3.js";import"./Monitor01-DiwEyrIh.js";import"./Sun-DDm9LtlE.js";import"./Palette-CYyTNBF1.js";import"./Play-oEOHn7Kl.js";import"./SearchMd-DLvQebgX.js";import"./Shield01-CeaSgNsE.js";import"./Stars01-1RvLNgsH.js";import"./Upload01-Bb4xamfI.js";import"./User01-CRJiYDWT.js";import"./Users01-D8fzZILN.js";import"./XClose-B8-m6Ysp.js";import"./Zap-DbdLJbyv.js";import"./dialog-DHc-iPx9.js";import"./drawer-Cwhc32-v.js";import"./collection-search-Do7Cp7BP.js";import"./form-DKjNHSgl.js";import"./label-B485QK8V.js";import"./tabs-CNn3gT-l.js";import"./toggle-group-BGuBCRpR.js";import"./popover-Cv6LCVas.js";import"./command-DMfMyCz6.js";import"./index-BRDh59qB.js";import"./useInfiniteQuery-C_KTVASW.js";import"./use-infinite-scroll-CMIncUkM.js";import"./question-004-sINsf4GQ.js";import"./checkbox-C9da9yB_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CWHc4EZj.js";import"./settings-section-ZNhTRSX3.js";import"./card-CNNf5saL.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-D2GNuFJz.js";import"./use-registry-connections-BASvWu3z.js";import"./use-connection-BvI4z5Go.js";import"./extract-connection-data-DNQRXpX9.js";import"./collection-tabs-NlIGO6dT.js";import"./badge-DUbO_RN4.js";import"./connection-form-helpers-B19OLFDN.js";import"./authenticate-and-persist-oauth-tBiMyMPG.js";import"./mcp-oauth-dU1JqorS.js";import"./useSuspenseInfiniteQuery-CsMnvHSV.js";import"./required-auth-layout-D-J1BueF.js";import"./use-org-sso-BFHNwstz.js";import"./use-clock-tick-CPqO-BWO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cud6yKog.js";import"./file-type-icon-DYGh6lpU.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-BKUFyiJj.js";import"./decopilot-sse-pool-DelsNiOI.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function _e(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function Es(t,e,s){const r=t.slice(0);return r[e]=s,r}var Os=class extends ot{#i;#e;#r;#n;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#i=t,this.#n=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.#n=e,he.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(c=>c.observer.setOptions(c.defaultedQueryOptions));const i=r.map(c=>c.observer),o=i.map(c=>c.getCurrentResult()),l=s.length!==i.length,d=i.some((c,u)=>c!==s[u]),a=l||d,m=a?!0:o.some((c,u)=>{const f=this.#e[u];return!f||!lt(c,f)});!a&&!m||(a&&(this.#c=r,this.#t=i),this.#e=o,this.hasListeners()&&(a&&(_e(s,i).forEach(c=>{c.destroy()}),_e(i,s).forEach(c=>{c.subscribe(u=>{this.#f(c,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(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),i=s.map(o=>o.defaultedQueryOptions.queryHash);return[r,o=>this.#m(o??r,e,i),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const i=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,o=>{e.forEach(l=>{l.observer.trackProp(o)})})})}#m(t,e,s){if(e){const r=this.#a,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((o,l)=>o!==r[l]));return(!this.#s||this.#e!==this.#l||i||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=at(this.#s,e(t))),this.#s}return t}#p(){return this.#n?.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 i=r.options.queryHash;if(!i)return;const o=e.get(i);o?o.push(r):e.set(i,[r])});const s=[];return t.forEach(r=>{const i=this.#i.defaultQueryOptions(r),l=e.get(i.queryHash)?.shift()??new Oe(this.#i,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=Es(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.#n?.combine);(e||s!==r)&&he.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Ps({queries:t,...e},s){const r=le(s),i=ct(),o=dt(),l=$.useMemo(()=>t.map(p=>{const g=r.defaultQueryOptions(p);return g._optimisticResults=i?"isRestoring":"optimistic",g}),[t,r,i]);l.forEach(p=>{mt(p);const g=r.getQueryCache().get(p.queryHash);ut(p,o,g)}),ft(o);const[d]=$.useState(()=>new Os(r,l,e)),[a,m,c]=d.getOptimisticResult(l,e.combine),u=!i&&e.subscribed!==!1;$.useSyncExternalStore($.useCallback(p=>u?d.subscribe(he.batchCalls(p)):ht,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),$.useEffect(()=>{d.setQueries(l,e)},[l,e,d]);const h=a.some((p,g)=>Se(l[g],p))?a.flatMap((p,g)=>{const y=l[g];if(y&&Se(y,p)){const j=new Oe(r,y);return pt(y,j,o)}return[]}):[];if(h.length>0)throw Promise.all(h);const x=a.find((p,g)=>{const y=l[g];return y&&xt({result:p,errorResetBoundary:o,throwOnError:y.throwOnError,query:r.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(x?.error)throw x.error;return m(c())}function Ms(t,e){return Ps({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:gt,enabled:!0,placeholderData:void 0}))},e)}function Ke(t){const e=k.c(11),{properties:s,required:r,values:i,onChange:o}=t;let l;e[0]!==r?(l=r??[],e[0]=r,e[1]=l):l=e[1];let d;e[2]!==l?(d=new Set(l),e[2]=l,e[3]=d):d=e[3];const a=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,h]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,a.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:h.type})]}),h.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:h.description}),n.jsx(zs,{type:h.type,fieldKey:f,value:i[f],onChange:x=>o(f,x)})]},f)})}),e[6]=o,e[7]=a,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function zs(t){const e=k.c(19),{type:s,fieldKey:r,value:i,onChange:o}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==o?(u=x=>o(x.target.value),e[0]=o,e[1]=u):u=e[1];const f=`Enter ${r} as JSON…`;let h;return e[2]!==c||e[3]!==u||e[4]!==f?(h=n.jsx(ps,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=h):h=e[5],h}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==o?(u=p=>o(p==="true"),e[6]=o,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ms,{className:"h-7 text-xs",children:n.jsx(us,{placeholder:"Select…"})}),e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsxs(fs,{children:[n.jsx(Ce,{value:"true",children:"true"}),n.jsx(Ce,{value:"false",children:"false"})]}),e[9]=h):h=e[9];let x;return e[10]!==c||e[11]!==u?(x=n.jsxs(hs,{value:c,onValueChange:u,children:[f,h]}),e[10]=c,e[11]=u,e[12]=x):x=e[12],x}const l=i??"";let d;e[13]!==o?(d=c=>o(c.target.value),e[13]=o,e[14]=d):d=e[14];const a=`Enter ${r}…`;let m;return e[15]!==l||e[16]!==d||e[17]!==a?(m=n.jsx(Fe,{className:"h-7 text-xs",value:l,onChange:d,placeholder:a}),e[15]=l,e[16]=d,e[17]=a,e[18]=m):m=e[18],m}const ne=8;function Rs(t){const e=k.c(16),{open:s,onOpenChange:r}=t,[i,o]=$.useState("");let l,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(rs,{children:"Manage home"}),d=n.jsx(os,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=d):(l=e[0],d=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(At,{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]=a):a=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=p=>o(p.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(ls,{className:"px-5 py-4 border-b border-border",children:[l,d,n.jsxs("div",{className:"relative mt-3",children:[a,n.jsx(Fe,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(hn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(es,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Hs,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let h;e[9]!==c||e[10]!==f?(h=n.jsxs(as,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=h):h=e[11];let x;return e[12]!==r||e[13]!==s||e[14]!==h?(x=n.jsx(cs,{open:s,onOpenChange:r,children:h}),e[12]=r,e[13]=s,e[14]=h,e[15]=x):x=e[15],x}function Ls(t){const e=k.c(32),{org:s}=J(),r=He();let i;e[0]!==r?.ids?(i=r?.ids??[],e[0]=r?.ids,e[1]=i):i=e[1];const o=i,l=De(),d=It(),a=le();let m;e[2]!==s||e[3]!==a?(m=()=>a.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=a,e[4]=m):m=e[4];const c=m;let u;e[5]!==o?(u=C=>o.includes(C),e[5]=o,e[6]=u):u=e[6];const f=u;let h;e[7]!==o||e[8]!==t?(h=t?o.filter(C=>t.has(C)).length:o.length,e[7]=o,e[8]=t,e[9]=h):h=e[9];const p=h>=ne;let g;e[10]!==p||e[11]!==f||e[12]!==l?(g=C=>f(C)||p?Promise.resolve():l.apply(I=>I.includes(C)?null:[...I,C]),e[10]=p,e[11]=f,e[12]=l,e[13]=g):g=e[13];const y=g;let j;e[14]!==l?(j=C=>l.apply(I=>I.filter(T=>T!==C)),e[14]=l,e[15]=j):j=e[15];const w=j;let v;e[16]!==l?(v=C=>l.apply(()=>C),e[16]=l,e[17]=v):v=e[17];const b=v;let N;e[18]!==d||e[19]!==p||e[20]!==f||e[21]!==c||e[22]!==l?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!p&&await l.apply(T=>T.includes(C.id)?null:[...T,C.id]),await c()},e[18]=d,e[19]=p,e[20]=f,e[21]=c,e[22]=l,e[23]=N):N=e[23];const S=N;let _;return e[24]!==y||e[25]!==p||e[26]!==o||e[27]!==f||e[28]!==w||e[29]!==b||e[30]!==S?(_={homeIds:o,isOnHome:f,atLimit:p,addAgent:y,removeAgent:w,reorder:b,saveAgentMetadata:S},e[24]=y,e[25]=p,e[26]=o,e[27]=f,e[28]=w,e[29]=b,e[30]=S,e[31]=_):_=e[31],_}function Hs(t){const e=k.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 i=_t(r);let o;e[1]!==i?(o=new Set(i.map(Bs)),e[1]=i,e[2]=o):o=e[2];const l=Ls(o);let d,a,m;if(e[3]!==i||e[4]!==l||e[5]!==s){const p=new Map(i.map(Qs));d=s.trim().toLowerCase();const g=w=>!d||w.title?.toLowerCase().includes(d);a=l.homeIds.map(w=>p.get(w)).filter(Us).filter(g);const y=Lt(i);let j;e[9]!==l?(j=w=>!l.isOnHome(w.id),e[9]=l,e[10]=j):j=e[10],m=i.filter(Fs).filter(w=>!y.has(w.id)).filter(j).filter(g).sort(Ds),e[3]=i,e[4]=l,e[5]=s,e[6]=d,e[7]=a,e[8]=m}else d=e[6],a=e[7],m=e[8];const c=m;let u;e[11]!==l||e[12]!==a?(u=n.jsx(qs,{home:l,agents:a}),e[11]=l,e[12]=a,e[13]=u):u=e[13];const f=!!d;let h;e[14]!==c||e[15]!==l||e[16]!==f?(h=n.jsx(Ws,{home:l,agents:c,hasSearch:f}),e[14]=c,e[15]=l,e[16]=f,e[17]=h):h=e[17];let x;return e[18]!==u||e[19]!==h?(x=n.jsxs(n.Fragment,{children:[u,h]}),e[18]=u,e[19]=h,e[20]=x):x=e[20],x}function Ds(t,e){return(t.title??"").localeCompare(e.title??"")}function Fs(t){return t.id&&!wt(t.id)}function Us(t){return!!t}function Qs(t){return[t.id,t]}function Bs(t){return t.id}function We(t){const e=k.c(7),{title:s,hint:r}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==r?(o=r&&n.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3];let l;return e[4]!==i||e[5]!==o?(l=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,o]}),e[4]=i,e[5]=o,e[6]=l):l=e[6],l}function qs(t){const e=k.c(14),{home:s,agents:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={coordinateGetter:Bt},e[1]=o):o=e[1];const l=Me(oe(Re,i),oe(ze,o));let d;e[2]!==s?(d=h=>{const{active:x,over:p}=h;if(!p||x.id===p.id)return;const g=s.homeIds,y=g.indexOf(x.id),j=g.indexOf(p.id);y===-1||j===-1||s.reorder(qt([...g],y,j)).catch(Ks)},e[2]=s,e[3]=d):d=e[3];const a=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(We,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==l?(u=r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:l,collisionDetection:Ht,onDragEnd:a,children:n.jsx(Dt,{items:r.map(Vs),strategy:Ft,children:n.jsx("div",{className:"flex flex-col gap-1",children:r.map(h=>n.jsx(Js,{agent:h,home:s},h.id))})})}),e[6]=r,e[7]=a,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Vs(t){return t.id}function Ks(){return U.error("Couldn't reorder home — please try again.")}function Ws(t){const e=k.c(6),{home:s,agents:r,hasSearch:i}=t,[o,l]=$.useState(20);let d;if(e[0]!==r||e[1]!==i||e[2]!==s||e[3]!==o){const a=r.slice(0,o);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(We,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,r.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:a.map(c=>n.jsx(Ys,{agent:c,home:s},c.id))}),r.length>o&&n.jsxs("button",{type:"button",onClick:()=>l(Gs),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-o,")"]})]})]}),e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=d}else d=e[4];return d}function Gs(t){return t+20}function Ge(t){const e=Z(t.metadata?.ui).filter(o=>!!o.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&i.push(`${r} prompt${r===1?"":"s"}`),r===0&&i.push("prompts off"),i.join(" · ")}function Js(t){const e=k.c(57),{agent:s,home:r}=t,[i,o]=$.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:d,listeners:a,setNodeRef:m,transform:c,transition:u,isDragging:f}=Ut(l),h=Ge(s)||"Quick access";let x;e[2]!==c?(x=Qt.Transform.toString(c),e[2]=c,e[3]=x):x=e[3];const p=f?.5:void 0,g=f?100:void 0;let y;e[4]!==x||e[5]!==p||e[6]!==g||e[7]!==u?(y={transform:x,transition:u,opacity:p,zIndex:g},e[4]=x,e[5]=p,e[6]=g,e[7]=u,e[8]=y):y=e[8];const j=y,w=f&&"shadow-lg";let v;e[9]!==w?(v=G("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const b=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Qe,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==a||e[14]!==b?(S=n.jsx("button",{type:"button",...d,...a,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":b,children:N}),e[12]=d,e[13]=a,e[14]=b,e[15]=S):S=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(Zs),e[16]=_):_=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=n.jsx(de,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const T=s.title??s.id;let E;e[20]!==T?(E=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=E):E=e[21];let P;e[22]!==h?(P=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:h}),e[22]=h,e[23]=P):P=e[23];let M;e[24]!==E||e[25]!==P?(M=n.jsxs("div",{className:"min-w-0 flex-1",children:[E,P]}),e[24]=E,e[25]=P,e[26]=M):M=e[26];const Q=i&&"rotate-180";let z;e[27]!==Q?(z=G("shrink-0 text-muted-foreground transition-transform",Q),e[27]=Q,e[28]=z):z=e[28];let R;e[29]!==z?(R=n.jsx(Ue,{size:16,className:z}),e[29]=z,e[30]=R):R=e[30];let q;e[31]!==i||e[32]!==I||e[33]!==M||e[34]!==R?(q=n.jsxs("button",{type:"button",onClick:_,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,M,R]}),e[31]=i,e[32]=I,e[33]=M,e[34]=R,e[35]=q):q=e[35];let A;e[36]!==s.id||e[37]!==r?(A=()=>r.removeAgent(s.id).catch(Xs),e[36]=s.id,e[37]=r,e[38]=A):A=e[38];const B=`Remove ${s.title??s.id} from home`;let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pe,{size:14}),e[39]=L):L=e[39];let O;e[40]!==A||e[41]!==B?(O=n.jsx("button",{type:"button",onClick:A,"aria-label":B,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:L}),e[40]=A,e[41]=B,e[42]=O):O=e[42];let D;e[43]!==S||e[44]!==q||e[45]!==O?(D=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,q,O]}),e[43]=S,e[44]=q,e[45]=O,e[46]=D):D=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==r?(F=i&&n.jsx(Je,{agent:s,home:r}),e[47]=s,e[48]=i,e[49]=r,e[50]=F):F=e[50];let K;return e[51]!==m||e[52]!==j||e[53]!==D||e[54]!==F||e[55]!==v?(K=n.jsxs("div",{ref:m,style:j,className:v,children:[D,F]}),e[51]=m,e[52]=j,e[53]=D,e[54]=F,e[55]=v,e[56]=K):K=e[56],K}function Xs(){return U.error("Couldn't remove from home — please try again.")}function Zs(t){return!t}function Ys({agent:t,home:e}){const[s,r]=$.useState(!1),[i,o]=$.useState(!1),l=Ge(t),d=async()=>{if(!e.atLimit){o(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{o(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(de,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),n.jsx(Ue,{size:16,className:G("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — 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:i?n.jsx(ae,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(Je,{agent:t,home:e})]})}function Je(t){const e=k.c(17),{agent:s,home:r}=t,i=s.metadata?.ui;let o;e[0]!==i?(o=Z(i),e[0]=i,e[1]=o):o=e[1];const l=o;let d;e[2]!==s.connections?(d=(s.connections??[]).map(en).sort(),e[2]=s.connections,e[3]=d):d=e[3];const a=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==l?(c=n.jsx(sn,{agent:s,home:r,connectionIds:a,pinnedTiles:l}),e[4]=s,e[5]=a,e[6]=r,e[7]=l,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[9]=u):u=e[9];const f=m??null;let h;e[10]!==s||e[11]!==r||e[12]!==f?(h=n.jsx($.Suspense,{fallback:u,children:n.jsx(an,{agent:s,home:r,curated:f})}),e[10]=s,e[11]=r,e[12]=f,e[13]=h):h=e[13];let x;return e[14]!==c||e[15]!==h?(x=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,h]}),e[14]=c,e[15]=h,e[16]=x):x=e[16],x}function en(t){return t.connection_id}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function sn({agent:t,home:e,connectionIds:s,pinnedTiles:r}){const i=Ve(),{data:o,isLoading:l}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),h=(f?.tools??[]).flatMap(x=>{const p=Be(x._meta);return p?[{name:x.name,description:x.description,resourceUri:p,inputSchema:x.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:h}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(l)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!o||o.length===0)return null;const d=new Map;for(const c of o)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const a=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=r.some(c=>!!a(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),r.map(c=>{const u=a(c);return u?n.jsx(on,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),o.map(c=>c.uiTools.map(u=>n.jsx(ln,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Xe(t,e){const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;if((o==="object"||o==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[r]=JSON.parse(i)}catch{return null}}else if((o==="number"||o==="integer")&&typeof i=="string"){if(!i.trim())continue;s[r]=Number(i)}else i!==""&&i!=null&&(s[r]=i)}return s}function nn(t,e){if(!t||!e)return{};const s={};for(const[r,i]of Object.entries(t)){const o=e[r]?.type;(o==="object"||o==="array")&&i!=null&&typeof i!="string"?s[r]=JSON.stringify(i,null,2):s[r]=i}return s}function rn(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,r])=>{const i=typeof r=="object"?JSON.stringify(r):String(r);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function on({agent:t,home:e,connection:s,tool:r,tile:i}){const[o,l]=$.useState(!1),[d,a]=$.useState(!1),m=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[c,u]=$.useState(()=>nn(i.toolInput,r.inputSchema?.properties)),f=async()=>{l(!0);try{const p=Z(t.metadata?.ui),g=i.tileId?p.filter(j=>j.tileId!==i.tileId):p.filter(j=>j!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,y),a(!1)}catch(p){console.error("[home-tiles] failed to remove tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},h=async()=>{l(!0);try{let p;if(m&&r.inputSchema?.properties){const w=Xe(c,r.inputSchema.properties);if(!w){U.error("Invalid JSON in one of the fields — please fix it."),l(!1);return}Object.keys(w).length>0&&(p=w)}const y=Z(t.metadata?.ui).map(w=>(i.tileId?w.tileId===i.tileId:w===i)?{...w,toolInput:p}:w),j={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,j),a(!1)}catch(p){console.error("[home-tiles] failed to save tile",p),U.error("Couldn't update home — please try again.")}finally{l(!1)}},x=rn(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(r.name)}),x&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:x})]}),m&&n.jsx("button",{type:"button",onClick:()=>a(p=>!p),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(Et,{size:14})}),n.jsx(we,{isPinned:!0,submitting:o,onClick:f,label:"Remove from home"})]}),d&&m&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:c,onChange:(p,g)=>u(y=>({...y,[p]:g}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>a(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:o,onClick:h,children:o?n.jsx(ae,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function ln({agent:t,home:e,connection:s,tool:r}){const[i,o]=$.useState(!1),[l,d]=$.useState(!1),a=r.inputSchema?.properties&&Object.keys(r.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(a&&!l){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{o(!0);try{let h;if(a&&r.inputSchema?.properties){const y=Xe(m,r.inputSchema.properties);if(!y){U.error("Invalid JSON in one of the fields — please fix it."),o(!1);return}Object.keys(y).length>0&&(h=y)}const p=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:r.resourceUri,toolName:r.name,...h?{toolInput:h}:{}}],g={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:p}};await e.saveAgentMetadata(t,g),d(!1),c({})}catch(h){console.error("[home-tiles] failed to add tile",h),U.error("Couldn't update home — please try again.")}finally{o(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(qe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(r.name)}),n.jsx(we,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),l&&a&&r.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ke,{properties:r.inputSchema.properties,required:r.inputSchema.required,values:m,onChange:(h,x)=>c(p=>({...p,[h]:x}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(ae,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function we(t){const e=k.c(11),{isPinned:s,submitting:r,onClick:i,label:o}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==l?(d=G("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=d):d=e[1];let a;e[2]!==s||e[3]!==r?(a=r?n.jsx(ae,{size:12,className:"animate-spin"}):s?n.jsx(Ot,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=r,e[4]=a):a=e[4];let m;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==d||e[9]!==a?(m=n.jsx("button",{type:"button",onClick:i,disabled:r,"aria-label":o,title:o,className:d,children:a}),e[5]=o,e[6]=i,e[7]=r,e[8]=d,e[9]=a,e[10]=m):m=e[10],m}function an(t){const e=k.c(32),{agent:s,home:r,curated:i}=t,{org:o}=J();let l;e[0]!==s.id||e[1]!==o.id||e[2]!==o.slug?(l={connectionId:s.id,orgId:o.id,orgSlug:o.slug},e[0]=s.id,e[1]=o.id,e[2]=o.slug,e[3]=l):l=e[3];const d=ce(l);let a;e[4]!==s.id||e[5]!==o.id?(a=te.agentPrompts(o.id,s.id),e[4]=s.id,e[5]=o.id,e[6]=a):a=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:b}=await d.listPrompts();return b.map(un)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==a||e[10]!==m?(c={queryKey:a,queryFn:m,staleTime:3e4,retry:!1},e[9]=a,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:h}=se(c),x=ve(o.slug);let p,g;if(e[12]!==s.id||e[13]!==u||e[14]!==x.prompts){let b;e[17]!==s.id?(b=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=b):b=e[18],p=x.prompts.filter(b).map(mn);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],g=[...N];for(const S of p)g.some(_=>_.name===S.name)||g.push(S);e[12]=s.id,e[13]=u,e[14]=x.prompts,e[15]=p,e[16]=g}else p=e[15],g=e[16];if(f&&p.length===0){let b;return e[21]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=b):b=e[21],b}if(h&&p.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,h),null;if(g.length===0)return null;let y;e[22]!==i||e[23]!==g?(y=i??g.map(dn),e[22]=i,e[23]=g,e[24]=y):y=e[24];let j;e[25]!==y?(j=new Set(y),e[25]=y,e[26]=j):j=e[26];const w=j;let v;return e[27]!==s||e[28]!==r||e[29]!==g||e[30]!==w?(v=n.jsx("div",{className:"flex flex-col gap-0.5",children:g.map(b=>n.jsx(fn,{agent:s,home:r,prompt:b,allPromptNames:g.map(cn),isPinned:w.has(b.name)},b.name))}),e[27]=s,e[28]=r,e[29]=g,e[30]=w,e[31]=v):v=e[31],v}function cn(t){return t.name}function dn(t){return t.name}function mn(t){return{name:t.promptName,title:t.title,description:t.description}}function un(t){return{name:t.name,title:t.title,description:t.description}}function fn({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:i}){const[o,l]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}l(!0);try{const a=t.metadata?.ui?.homePrompts;let m;Array.isArray(a)?m=i?a.filter(u=>u!==s.name):[...a,s.name]:m=i?r.filter(u=>u!==s.name):r;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),U.error("Couldn't update home — please try again.")}finally{l(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(we,{isPinned:i,submitting:o,onClick:d,label:i?"Remove from home":"Add to home"})]})}function hn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},pn)}),t[0]=e):e=t[0],e}function pn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ze=`home-board.layout.v${ee}`;function Ye(t){return`home-board.layout.v${ee}.${t}`}const et={version:ee,tiles:{},hidden:[]};function pe(t){return!t||t.version!==ee?et:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function xn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function gn(t){try{const e=localStorage.getItem(Ye(t));return e?pe(JSON.parse(e)):void 0}catch{return}}function Ie(t,e){try{localStorage.setItem(Ye(t),JSON.stringify(e))}catch{}}async function Te(t,e){if(!(await fetch(`/api/${t}/kv/${Ze}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function bn(t){const e=k.c(24),s=le();let r;e[0]!==t?(r=te.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const i=r;let o;e[2]!==t?(o=gn(t),e[2]=t,e[3]=o):o=e[3];const l=o;let d;e[4]!==l||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Ze}`);if(y.status===404)return l&&xn(l)?(await Te(t,l),l):et;if(!y.ok)throw new Error("Failed to load board layout");const j=await y.json(),w=pe(j.value);return Ie(t,w),w},e[4]=l,e[5]=t,e[6]=d):d=e[6];let a;e[7]!==l||e[8]!==i||e[9]!==d?(a={queryKey:i,queryFn:d,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=i,e[9]=d,e[10]=a):a=e[10];const{data:m,isLoading:c}=se(a);let u;e[11]!==t?(u={mutationFn:y=>Te(t,y)},e[11]=t,e[12]=u):u=e[12];const f=bt(u);let h;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(h=y=>{Ie(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=h):h=e[17];const x=h;let p;e[18]!==m?(p=pe(m),e[18]=m,e[19]=p):p=e[19];let g;return e[20]!==c||e[21]!==x||e[22]!==p?(g={layout:p,isLoading:c,save:x},e[20]=c,e[21]=x,e[22]=p,e[23]=g):g=e[23],g}const tt=$.createContext(null);function yn(t){const e=k.c(24),{children:s}=t,{org:r}=J(),i=bn(r.slug),[o,l]=$.useState(!1),[d,a]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{a(i.layout),l(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),l(!1)},e[2]=u):u=e[2];const f=u;let h;e[3]!==d||e[4]!==i?(h=()=>{d&&i.save(d),a(null),l(!1)},e[3]=d,e[4]=i,e[5]=h):h=e[5];const x=h,p=o&&d!==null,g=p?d:i.layout;let y;e[6]!==d||e[7]!==p||e[8]!==i.layout?(y=p?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=p,e[8]=i.layout,e[9]=y):y=e[9];const j=y;let w;e[10]!==o||e[11]!==i?(w=S=>{o?a(S):i.save(S)},e[10]=o,e[11]=i,e[12]=w):w=e[12];const v=w;let b;e[13]!==v||e[14]!==c||e[15]!==j||e[16]!==o||e[17]!==g||e[18]!==x||e[19]!==i.isLoading?(b={isEditMode:o,enter:c,cancel:f,save:x,hasChanges:j,layout:g,isLayoutLoading:i.isLoading,commitLayout:v},e[13]=v,e[14]=c,e[15]=j,e[16]=o,e[17]=g,e[18]=x,e[19]=i.isLoading,e[20]=b):b=e[20];let N;return e[21]!==s||e[22]!==b?(N=n.jsx(tt.Provider,{value:b,children:s}),e[21]=s,e[22]=b,e[23]=N):N=e[23],N}function st(){const t=$.useContext(tt);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function vn({agentId:t}){const{org:e,locator:s}=J(),r=ce({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=vs(),{setTaskId:o}=Zt(),[l,d]=$.useState(null),[a,m]=$.useState(!1),c=$.useRef(!1),u=async(g,y)=>{if(!r){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const j=await ys(r,g.name,y),w={type:"doc",content:[{type:"paragraph",content:[ss({id:g.name,name:ns(g.name,is(g._meta)),metadata:j.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},v=crypto.randomUUID();js(sessionStorage,s,v,{tiptapDoc:w}),await i({id:v,virtual_mcp_id:t}),o(v,t,{autosend:!0})}catch(j){console.error("[start-thread-from-prompt] failed",j),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async g=>{if(!c.current){if(g.arguments&&g.arguments.length>0){d(g);return}await u(g)}},h=async g=>{if(!l)return;const y=l;d(null),await u(y,g)};return{start:f,startBlank:async g=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),o(y,t,g?.main?{main:g.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(ts,{prompt:l,setPrompt:g=>d(g),onSubmit:h}),dialogPrompt:l,starting:a}}const V=4,W=100,ke=12,jn=5,wn={w:2,h:2};class xe extends $.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?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(yt,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.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 Nn(t){const e=k.c(72),{tiles:s,isEditMode:r,renderTile:i,onMove:o,onResize:l,onRemove:d}=t,a=be(),m=$.useRef(null),[c,u]=$.useState(null),[f,h]=$.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={activationConstraint:{distance:4}},e[0]=x):x=e[0];const p=Me(oe(Re,x),oe(ze)),g=s.reduce(Sn,0),y=r?Math.max(g+2,4):Math.max(g,1);let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/V,cellHeight:W}:null},e[1]=j):j=e[1];const w=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=A=>{u(String(A.active.id)),h(w())},e[2]=v):v=e[2];const b=v;let N;e[3]!==f||e[4]!==o||e[5]!==s?(N=A=>{const B=String(A.active.id),L=f??w();if(u(null),h(null),!L||L.cellWidth<=0)return;const O=s.find(K=>K.id===B);if(!O)return;const D=Math.round(A.delta.x/L.cellWidth),F=Math.round(A.delta.y/L.cellHeight);D===0&&F===0||o(B,{x:O.x+D,y:O.y+F})},e[3]=f,e[4]=o,e[5]=s,e[6]=N):N=e[6];const S=N;if(a){let A;if(e[7]!==i||e[8]!==s){let L;e[10]!==i?(L=O=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:W},children:n.jsx(xe,{children:i(O)})},O.id),e[10]=i,e[11]=L):L=e[11],A=s.map(L),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let B;return e[12]!==A?(B=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=B):B=e[13],B}let _,C,I,T,E,P,M,Q,z;if(e[14]!==c||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==l||e[20]!==i||e[21]!==p||e[22]!==s||e[23]!==y){const A=c?s.find(X=>X.id===c):null;C=Le,Q=p,z=b,I=S;const B=y*W,L=r?W*4:W;let O;e[33]!==B||e[34]!==L?(O={height:B,minHeight:L},e[33]=B,e[34]=L,e[35]=O):O=e[35];let D;e[36]!==r||e[37]!==s||e[38]!==y?(D=r&&n.jsx(Cn,{rows:y,tiles:s}),e[36]=r,e[37]=s,e[38]=y,e[39]=D):D=e[39];let F;if(e[40]!==c||e[41]!==r||e[42]!==d||e[43]!==l||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==r||e[49]!==d||e[50]!==l||e[51]!==i?(X=ie=>n.jsx(In,{tile:ie,isEditMode:r,isDragging:c===ie.id,onResize:l,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=r,e[49]=d,e[50]=l,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=r,e[42]=d,e[43]=l,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==O||e[54]!==D||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:O,children:[D,F]}),e[53]=O,e[54]=D,e[55]=F,e[56]=T):T=e[56],_=Vt,E=null;const K=A&&f?A.w*f.cellWidth-ke:void 0,me=A&&f?A.h*f.cellHeight-ke:void 0;e[57]!==K||e[58]!==me?(P={width:K,height:me},e[57]=K,e[58]=me,e[59]=P):P=e[59],M=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(xe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=l,e[20]=i,e[21]=p,e[22]=s,e[23]=y,e[24]=_,e[25]=C,e[26]=I,e[27]=T,e[28]=E,e[29]=P,e[30]=M,e[31]=Q,e[32]=z}else _=e[24],C=e[25],I=e[26],T=e[27],E=e[28],P=e[29],M=e[30],Q=e[31],z=e[32];let R;e[60]!==_||e[61]!==E||e[62]!==P||e[63]!==M?(R=n.jsx(_,{dropAnimation:E,style:P,children:M}),e[60]=_,e[61]=E,e[62]=P,e[63]=M,e[64]=R):R=e[64];let q;return e[65]!==C||e[66]!==I||e[67]!==T||e[68]!==R||e[69]!==Q||e[70]!==z?(q=n.jsxs(C,{sensors:Q,onDragStart:z,onDragEnd:I,children:[T,R]}),e[65]=C,e[66]=I,e[67]=T,e[68]=R,e[69]=Q,e[70]=z,e[71]=q):q=e[71],q}function Sn(t,e){return Math.max(t,e.y+e.h)}function Cn(t){const e=k.c(7),{rows:s,tiles:r}=t;let i;e[0]!==r?(i=(a,m)=>r.some(c=>a>=c.x&&a<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=r,e[1]=i):i=e[1];const o=i;let l;if(e[2]!==o||e[3]!==s){l=[];for(let a=0;a<s;a++)for(let m=0;m<V;m++)o(m,a)||l.push({x:m,y:a});e[2]=o,e[3]=s,e[4]=l}else l=e[4];let d;return e[5]!==l?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(_n)}),e[5]=l,e[6]=d):d=e[6],d}function _n(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/V*100}%`,top:t.y*W,width:`${1/V*100}%`,height:W},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function In(t){const e=k.c(31),{tile:s,isEditMode:r,isDragging:i,onResize:o,onRemove:l,children:d}=t,a=!r;let m;e[0]!==a||e[1]!==s.id?(m={id:s.id,disabled:a},e[0]=a,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:h}=Kt(m),x=`${s.x/V*100}%`,p=`${s.w/V*100}%`,g=s.y*W,y=s.h*W,j=h||i,w=!j&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=j&&"opacity-30";let b;e[3]!==w||e[4]!==v?(b=G("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=b):b=e[5];let N;e[6]!==y||e[7]!==x||e[8]!==g||e[9]!==p?(N={left:x,top:g,width:p,height:y},e[6]=y,e[7]=x,e[8]=g,e[9]=p,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let _;e[11]!==S?(_=G("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=_):_=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==o||e[18]!==s?(C=r&&n.jsxs(n.Fragment,{children:[n.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:n.jsx(Qe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(Tn,{tile:s,onResize:o,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=o,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(xe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==_||e[24]!==C?(T=n.jsxs("div",{className:_,children:[C,I]}),e[22]=I,e[23]=_,e[24]=C,e[25]=T):T=e[25];let E;return e[26]!==c||e[27]!==T||e[28]!==b||e[29]!==N?(E=n.jsx("div",{ref:c,className:b,style:N,children:T}),e[26]=c,e[27]=T,e[28]=b,e[29]=N,e[30]=E):E=e[30],E}function Tn(t){const e=k.c(20),{tile:s,onResize:r,onRemove:i}=t,[o,l]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ws,{asChild:!0,children:n.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:n.jsx(Pt,{size:16})})}),e[0]=d):d=e[0];let a;e[1]!==r||e[2]!==s.id?(a=g=>{r(s.id,g),l(!1)},e[1]=r,e[2]=s.id,e[3]=a):a=e[3];let m;e[4]!==a||e[5]!==s?(m=n.jsx(kn,{tile:s,onPick:a}),e[4]=a,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Ns,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Is,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let h;e[12]!==u?(h=n.jsxs(Ss,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=h):h=e[13];let x;e[14]!==m||e[15]!==h?(x=n.jsxs(Cs,{align:"end",className:"w-auto",children:[m,c,h]}),e[14]=m,e[15]=h,e[16]=x):x=e[16];let p;return e[17]!==o||e[18]!==x?(p=n.jsxs(_s,{open:o,onOpenChange:l,children:[d,x]}),e[17]=o,e[18]=x,e[19]=p):p=e[19],p}function kn(t){const e=k.c(19),{tile:s,onPick:r}=t,i=s.minW??1,o=s.minH??1,[l,d]=$.useState(null);let a;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(a=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=a):a=e[3];const m=a;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,h;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${V}, 1.25rem)`},h=()=>d(null),e[8]=f,e[9]=h):(f=e[8],h=e[9]);let x;e[10]!==m.h||e[11]!==m.w||e[12]!==o||e[13]!==i||e[14]!==r?(x=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:h,children:Array.from({length:jn},(g,y)=>Array.from({length:V},(j,w)=>{const v=w+1,b=y+1,N=v<i||b<o,S=v<=m.w&&b<=m.h;return n.jsx("button",{type:"button",disabled:N,"aria-label":`${v} by ${b}`,onPointerEnter:()=>d({w:v,h:b}),onClick:()=>r({w:v,h:b}),className:G("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")},`${v}x${b}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=o,e[13]=i,e[14]=r,e[15]=x):x=e[15];let p;return e[16]!==u||e[17]!==x?(p=n.jsxs("div",{className:"px-2 py-1.5",children:[u,x]}),e[16]=u,e[17]=x,e[18]=p):p=e[18],p}function $n(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function ge(t,e,s){for(let r=0;r<100;r++)for(let i=0;i<=V-e;i++){let o=!0;for(let l=0;l<s&&o;l++)for(let d=0;d<e&&o;d++)$n(t,i+d,r+l)&&(o=!1);if(o)return{x:i,y:r}}return{x:0,y:0}}function ue(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(V,t)),i=Math.max(s.h,Math.min(6,e));return{w:r,h:i}}function fe(t,e,s){const r=Math.max(0,Math.min(V-s,t)),i=Math.max(0,e);return{x:r,y:i}}function An(t,e,s){const r=t.find(a=>a.id===e);if(!r)return t;const i=t.filter(a=>a.id!==e),o=i.find(a=>s.x>=a.x&&s.x<a.x+a.w&&s.y>=a.y&&s.y<a.y+a.h);if(o&&o.w===r.w&&o.h===r.h)return t.map(a=>a.id===e?{...a,x:o.x,y:o.y}:a.id===o.id?{...a,x:r.x,y:r.y}:a);const d=[{...r,x:s.x,y:s.y}];for(const a of i){const m=ge(d,a.w,a.h);d.push({...a,x:m.x,y:m.y})}return d}function En(t){const e=k.c(35),{layout:s,isLayoutLoading:r,commitLayout:i}=st();let o;e[0]!==s.hidden?(o=new Set(s.hidden),e[0]=s.hidden,e[1]=o):o=e[1];const l=o;let d,a;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){a=[];let j;e[7]!==l?(j=v=>v.pinned||!l.has(v.id),e[7]=l,e[8]=j):j=e[8];const w=t.filter(j);d=new Map;for(const v of t)v.minSize&&d.set(v.id,v.minSize);for(const v of w){const b=s.tiles[v.id];if(!b)continue;const N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),{x:C,y:I}=fe(b.x,b.y,S);a.push({id:v.id,x:C,y:I,w:S,h:_,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(I=>I.id===v.id))continue;const b=v.defaultSize??wn,N=d.get(v.id),{w:S,h:_}=ue(b.w,b.h,N),C=ge(a,S,_);a.push({id:v.id,x:C.x,y:C.y,w:S,h:_,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=d,e[6]=a}else d=e[5],a=e[6];let m;e[9]!==t?(m=new Set(t.map(On)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(j,w)=>{const v={};for(const b of j)v[b.id]={x:b.x,y:b.y,w:b.w,h:b.h};i({version:ee,tiles:v,hidden:w.filter(b=>c.has(b))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let h;e[14]!==a?(h={visible:a},e[14]=a,e[15]=h):h=e[15];let x;e[16]!==f||e[17]!==s||e[18]!==a?(x=(j,w)=>{const v=a.find(S=>S.id===j);if(!v)return;const b=fe(w.x,w.y,v.w);if(b.x===v.x&&b.y===v.y)return;const N=An(a,j,b);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=a,e[19]=x):x=e[19];let p;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==a?(p=(j,w)=>{const v=a.find(T=>T.id===j);if(!v)return;const b=d.get(j),{w:N,h:S}=ue(w.w,w.h,b);if(N===v.w&&S===v.h)return;const _={...v,w:N,h:S,x:fe(v.x,v.y,N).x},C=a.filter(T=>T.id!==j),I=[_];for(const T of C){const E=ge(I,T.w,T.h);I.push({...T,x:E.x,y:E.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=a,e[24]=p):p=e[24];let g;e[25]!==f||e[26]!==s||e[27]!==a?(g=j=>{const w=a.filter(v=>v.id!==j);f(w,Array.from(new Set([...s.hidden,j])))},e[25]=f,e[26]=s,e[27]=a,e[28]=g):g=e[28];let y;return e[29]!==r||e[30]!==h||e[31]!==x||e[32]!==p||e[33]!==g?(y={snapshot:h,isLoading:r,moveTile:x,resizeTile:p,hideTile:g},e[29]=r,e[30]=h,e[31]=x,e[32]=p,e[33]=g,e[34]=y):y=e[34],y}function On(t){return t.id}const Pn={w:2,h:4},Mn={w:1,h:2},zn={w:1,h:1};function Rn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Ln(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Hn(t){return t.promptName?t.agentName:t.description}function Dn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function nt(t){const e=k.c(14),{org:s}=J();let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(r=Nt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=r):r=e[3];const{data:i}=se(r),o=!!i&&!t.toolName;let l;e[4]!==i||e[5]!==o?(l={client:i,enabled:o},e[4]=i,e[5]=o,e[6]=l):l=e[6];const{data:d}=xs(l);let a;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(a=t.toolName??d?.tools.find(u=>Be(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=a):a=e[10];const m=a;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?bs(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:i,dialog:o,starting:l}=vn(s);let d;e[2]!==r||e[3]!==i?(d=c=>{if(!c.promptName){i();return}r(Dn(c))},e[2]=r,e[3]=i,e[4]=d):d=e[4];const a=d;let m;return e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==l?(m={open:a,startBlank:i,dialog:o,starting:l},e[5]=o,e[6]=a,e[7]=i,e[8]=l,e[9]=m):m=e[9],m}function Fn(t){const e=k.c(32),{entry:s,isEditMode:r}=t,{open:i,dialog:o,starting:l}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const a=l||r,m=!r&&"cursor-pointer transition-colors hover:bg-accent/40",c=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=G("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let h;e[7]!==s.agentIcon||e[8]!==s.agentName?(h=n.jsx(de,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=h):h=e[9];let x;e[10]!==s.title?(x=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=x):x=e[11];let p;e[12]!==s?(p=Hn(s),e[12]=s,e[13]=p):p=e[13];let g;e[14]!==p?(g=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:p}),e[14]=p,e[15]=g):g=e[15];let y;e[16]!==g||e[17]!==x?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[x,g]}),e[16]=g,e[17]=x,e[18]=y):y=e[18];let j;e[19]!==r?(j=!r&&n.jsx(gs,{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]=j):j=e[20];let w;e[21]!==l||e[22]!==d||e[23]!==y||e[24]!==j||e[25]!==a||e[26]!==f||e[27]!==h?(w=n.jsxs("button",{type:"button",onClick:d,disabled:a,"aria-busy":l,className:f,children:[h,y,j]}),e[21]=l,e[22]=d,e[23]=y,e[24]=j,e[25]=a,e[26]=f,e[27]=h,e[28]=w):w=e[28];let v;return e[29]!==o||e[30]!==w?(v=n.jsxs(n.Fragment,{children:[w,o]}),e[29]=o,e[30]=w,e[31]=v):v=e[31],v}function Un(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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},Qn)}),t[0]=e):e=t[0],e}function Qn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Bn(t){const e=k.c(17),{tile:s,prompts:r,isEditMode:i,tileWidth:o}=t,{org:l}=J(),{open:d,startBlank:a,dialog:m,starting:c}=Ne(s.agentId),u=r.filter(qn),f=nt(s),h="relative flex h-full w-full flex-col p-3";let x;e[0]!==i||e[1]!==f||e[2]!==a||e[3]!==c?(x=!i&&n.jsx("button",{type:"button",onClick:()=>{a(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=a,e[3]=c,e[4]=x):x=e[4];const p="flex min-h-0 flex-1 gap-3 overflow-hidden";let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Kn,{}),e[5]=g):g=e[5];let y;e[6]!==l.id||e[7]!==l.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:g,children:n.jsx(Vn,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[6]=l.id,e[7]=l.slug,e[8]=s,e[9]=y):y=e[9];const j=u.length>0&&!i&&o>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(b=>n.jsx("button",{type:"button",onClick:()=>d(b),disabled:c,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:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let w;e[10]!==y||e[11]!==j?(w=n.jsxs("div",{className:p,children:[y,j]}),e[10]=y,e[11]=j,e[12]=w):w=e[12];let v;return e[13]!==m||e[14]!==x||e[15]!==w?(v=n.jsxs("div",{className:h,children:[x,w,m]}),e[13]=m,e[14]=x,e[15]=w,e[16]=v):v=e[16],v}function qn(t){return!!t.promptName}function Vn(t){const e=k.c(13),{tile:s,orgId:r,orgSlug:i}=t;let o;e[0]!==r||e[1]!==i||e[2]!==s.connectionId?(o={connectionId:s.connectionId,orgId:r,orgSlug:i},e[0]=r,e[1]=i,e[2]=s.connectionId,e[3]=o):o=e[3];const l=ce(o),d=s.minHeight??200,a=s.maxHeight??4e3;let m;return e[4]!==l||e[5]!==r||e[6]!==i||e[7]!==d||e[8]!==a||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ds,{resourceURI:s.resourceUri,orgId:r,orgSlug:i,connectionId:s.connectionId,client:l,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:a,className:"h-full"}),e[4]=l,e[5]=r,e[6]=i,e[7]=d,e[8]=a,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function Kn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Wn(t){const e=k.c(14),{icon:s,name:r}=t;let i;e[0]!==s||e[1]!==r?(i=n.jsx(de,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=i):i=e[2];let o;e[3]!==r?(o=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=o):o=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let d;e[6]!==o?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[o,l]}),e[6]=o,e[7]=d):d=e[7];let a;e[8]!==i||e[9]!==d?(a=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=a):a=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==a?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,m]}),e[12]=a,e[13]=c):c=e[13],c}function Gn(t){const e=k.c(10),{tile:s,prompts:r,isEditMode:i}=t,{open:o,startBlank:l,dialog:d,starting:a}=Ne(s.agentId),m=r.filter(Jn),c=nt(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==l?(f=()=>{l(c?{main:c}:void 0)},e[0]=c,e[1]=l,e[2]=f):f=e[2];const h=a||i;let x;e[3]!==f||e[4]!==h?(x=n.jsx("button",{type:"button",onClick:f,disabled:h,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=h,e[5]=x):x=e[5];const p=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&o(y),disabled:a,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:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let g;return e[6]!==d||e[7]!==x||e[8]!==p?(g=n.jsxs("div",{className:u,children:[x,p,d]}),e[6]=d,e[7]=x,e[8]=p,e[9]=g):g=e[9],g}function Jn(t){return!!t.promptName}function it({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:r,tiles:i}=ve(e.slug),o=He()?.ids??[],l=new Set(o),d=De(),a=Ve(),m=le(),c=new Set(i.map(b=>b.agentId)),u=new Map;for(const b of r){const N=u.get(b.agentId);N?N.push(b):u.set(b.agentId,[b])}const f=r.filter(b=>!c.has(b.agentId)),h=[...i.map(b=>({kind:"tile",id:Ln(b),data:b})),...f.map(b=>({kind:"prompt",id:Rn(b),data:b}))],x=new Map(h.map(b=>[b.id,b])),p=En(h.map(b=>({id:b.id,defaultSize:b.kind==="tile"?Pn:zn,minSize:b.kind==="tile"?Mn:void 0,pinned:l.has(b.data.agentId)}))),g=b=>{d.apply(N=>N.filter(S=>S!==b)).catch(()=>U.error("Couldn't remove from home — please try again."))},y=async b=>{if(i.filter(S=>S.agentId===b.agentId).length<=1){g(b.agentId);return}try{const _=(await a.call("COLLECTION_VIRTUAL_MCP_GET",{id:b.agentId})).item;if(!_)throw new Error("Agent not found");const C=Z(_.metadata?.ui),I=b.tileId?C.filter(T=>T.tileId!==b.tileId):C.filter(T=>T.connectionId!==b.connectionId||T.resourceUri!==b.resourceUri);await a.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b.agentId,data:{metadata:{..._.metadata??{},ui:{..._.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},j=b=>{const N=x.get(b);if(N){if(!l.has(N.data.agentId)){p.hideTile(b);return}N.kind==="tile"?y(N.data):g(N.data.agentId)}},w=b=>{const N=x.get(b.id);if(!N)return null;if(N.kind==="tile"){const S=u.get(N.data.agentId)??[];return n.jsx(vt,{fallback:n.jsx(Gn,{tile:N.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(Wn,{icon:N.data.agentIcon,name:N.data.agentName}),children:n.jsx(Bn,{tile:N.data,prompts:S,isEditMode:t,tileWidth:b.w})})})}return n.jsx(Fn,{entry:N.data,isEditMode:t})};return s||p.isLoading?n.jsx(Un,{}):p.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(Nn,{tiles:p.snapshot.visible,isEditMode:t,renderTile:w,onMove:p.moveTile,onResize:p.resizeTile,onRemove:j})})}function Xn(t){const e=k.c(2),{prompts:s,tiles:r}=ve(t),i=r.length>0||s.length>0;let o;return e[0]!==i?(o={hasVisibleTiles:i},e[0]=i,e[1]=o):o=e[1],o}const $e=420,Ae=305;function rt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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:$e}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.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:$e}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.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:Ae}}),t[2]=r):r=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,n.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:Ae}})]}),t[3]=i):i=t[3],i}function Ee(){const t=k.c(33),{data:e}=jt.useSession(),{org:s}=J(),r=be(),i=$s(),{selectedVirtualMcp:o}=zt();let l;t[0]!==s.id?(l=St(s.id),t[0]=s.id,t[1]=l):l=t[1];const a=o??l;let m;t[2]!==s.slug?(m=Yt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:Ct,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ce(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=Ts(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let h;t[10]!==s.id||t[11]!==s.slug?(h=Xt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=h):h=t[12];let x;t[13]!==a.id||t[14]!==s.id||t[15]!==u?(x=Tt(s.id,a.id,u),t[13]=a.id,t[14]=s.id,t[15]=u,t[16]=x):x=t[16];let p;t[17]!==f||t[18]!==h||t[19]!==x?(p={queries:[f,h,x]},t[17]=f,t[18]=h,t[19]=x,t[20]=p):p=t[20],Ms(p);const g=ks(),y=kt(a.id),{hasDecoKey:j,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:b,hasOnlyDecoProvider:N}=Wt(),{hasVisibleTiles:S}=Xn(s.slug),_=Gt(y?.metadata);if(g.length===0&&!(_&&Jt(i))){let R;return t[21]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Rt,{})})}),t[21]=R):R=t[21],R}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 T=I,E=j&&v&&b!=null,P=j&&w&&N;let M;t[24]!==b||t[25]!==E||t[26]!==P?(M=E?n.jsx(re.CreditsEyebrow,{balanceDollars:b}):P?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=b,t[25]=E,t[26]=P,t[27]=M):M=t[27];const Q=M;let z;return t[28]!==Q||t[29]!==S||t[30]!==r||t[31]!==T?(z=n.jsx(yn,{children:r?n.jsx(Zn,{eyebrow:Q,userName:T}):n.jsx(Yn,{eyebrow:Q,userName:T,hasVisibleTiles:S})}),t[28]=Q,t[29]=S,t[30]=r,t[31]=T,t[32]=z):z=t[32],z}function Zn(t){const e=k.c(12),{eyebrow:s,userName:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(rt,{}),e[0]=i):i=e[0];let o;e[1]!==s?(o=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=o):o=e[2];let l;e[3]!==r?(l=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let d;e[5]!==o||e[6]!==l?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(it,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,a,m]}),e[10]=d,e[11]=c):c=e[11],c}function Yn(t){const e=k.c(32),{eyebrow:s,userName:r,hasVisibleTiles:i}=t,{isEditMode:o,enter:l,save:d,cancel:a,hasChanges:m}=st(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let h;e[1]!==a||e[2]!==l||e[3]!==m||e[4]!==o||e[5]!==d?(h=n.jsx(As.Right,{children:n.jsx(ei,{isEditMode:o,hasChanges:m,onEnter:l,onSave:d,onCancel:a,onAddTile:f})}),e[1]=a,e[2]=l,e[3]=m,e[4]=o,e[5]=d,e[6]=h):h=e[6];let x;e[7]!==c?(x=n.jsx(Rs,{open:c,onOpenChange:u}),e[7]=c,e[8]=x):x=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(rt,{}),e[9]=p):p=e[9];const g=i||o?"pt-32":"flex-1 justify-center";let y;e[10]!==g?(y=G("relative flex flex-col items-center px-10 pb-4",g),e[10]=g,e[11]=y):y=e[11];let j;e[12]!==s?(j=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=j):j=e[13];let w;e[14]!==r?(w=n.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 v;e[16]!==j||e[17]!==w?(v=n.jsxs("div",{className:"text-center mb-10",children:[j,w]}),e[16]=j,e[17]=w,e[18]=v):v=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs("div",{className:"relative w-full",children:[n.jsx(ti,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[19]=b):b=e[19];let N;e[20]!==v?(N=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,b]}),e[20]=v,e[21]=N):N=e[21];let S;e[22]!==o?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(it,{isEditMode:o})}),e[22]=o,e[23]=S):S=e[23];let _;e[24]!==N||e[25]!==S||e[26]!==y?(_=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[p,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:y,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=y,e[27]=_):_=e[27];let C;return e[28]!==_||e[29]!==h||e[30]!==x?(C=n.jsxs(n.Fragment,{children:[h,x,_]}),e[28]=_,e[29]=h,e[30]=x,e[31]=C):C=e[31],C}function ei(t){const e=k.c(17),{isEditMode:s,hasChanges:r,onEnter:i,onSave:o,onCancel:l,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.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:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Pe,{size:14}),e[3]=f):f=e[3];let h;e[4]!==l?(h=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=h):h=e[5];const x=!r;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx($t,{size:14}),e[6]=p):p=e[6];let g;e[7]!==o||e[8]!==x?(g=n.jsxs(Y,{size:"sm",onClick:o,disabled:x,className:"gap-1.5 h-7 text-xs",children:[p,"Save"]}),e[7]=o,e[8]=x,e[9]=g):g=e[9];let y;return e[10]!==u||e[11]!==h||e[12]!==g?(y=n.jsxs(n.Fragment,{children:[u,h,g]}),e[10]=u,e[11]=h,e[12]=g,e[13]=y):y=e[13],y}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Mt,{size:14}),e[14]=a):a=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,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:[a,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function ti(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.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 io(){const t=k.c(2);if(be()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{io as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as le,r as K,b as yt,w as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a7 as rs,u as ls,s as xt,E as os}from"./index-
|
|
1
|
+
import{c as le,r as K,b as yt,w as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a7 as rs,u as ls,s as xt,E as os}from"./index-Ba-qr1CW.js";import{S as as}from"./search-input-fHPtOP7y.js";import{P as De}from"./index-BiDBbTkI.js";import{E as St}from"./empty-state-Dg_iHbDT.js";import{R as ns}from"./require-capability-KHCur5VM.js";import{J as Tt,S as is}from"./scroll-area-DrAN9Fvu.js";import{u as vt}from"./use-connection-BvI4z5Go.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-DUbO_RN4.js";import{P as ct,a as dt,b as mt}from"./popover-Cv6LCVas.js";import{b as Ze,T as et,a as tt}from"./tooltip-Bv4DpGHU.js";import{i as ft,n as cs}from"./ChevronUp-BLP78FPA.js";import{a as Xe}from"./Eye-LeoubK3e.js";import{n as Mt}from"./Globe01-BcsvYW1p.js";import{i as At}from"./FilterLines-BS68ypb2.js";import{i as ds}from"./Key01-BuD8mP7N.js";import{i as ms}from"./Play-oEOHn7Kl.js";import{aj as us,T as xs,M as fs}from"./agent-icon-OikJQ0tD.js";import{M as _t}from"./monaco-editor-BIiIfKcK.js";import{u as ps}from"./use-members-Ddo88B9U.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-DNt8z_cQ.js";import{u as vs}from"./use-virtual-mcp-C-sRaXYQ.js";import{n as Qe}from"./XCircle-Dsot7agl.js";import{c as Ns}from"./SwitchHorizontal01-772sqvX3.js";import{s as bs}from"./Plus-p2e2tk7T.js";import{s as ys}from"./Trash01-BOAu4VFs.js";import{I as Ge}from"./input-BBCESNsB.js";import{C as ws,g as Ss,b as Dt,f as st,a as Vt,c as pt,d as Is,e as Lt,h as Ut,A as Cs,T as ks,i as Ts,M as ht}from"./automation-runs-CgHl-onu.js";import{b as lt,c as ot,S as at,a as $e,d as nt}from"./select-Dd_an4jF.js";import{t as Kt}from"./ChevronDown-BfYdHkpN.js";import{s as Ms}from"./Stars02-Er9DZAE5.js";import{T as _s}from"./textarea-BNj8LeAc.js";import{C as qt}from"./collection-tabs-NlIGO6dT.js";import{S as Ds}from"./switch-DVGIVYD-.js";import{L as Ls}from"./label-B485QK8V.js";import{I as qe}from"./integration-icon-qruX57ku.js";import{A as Bt}from"./avatar-CWHc4EZj.js";import{A as Fs,a as Rs,b as $s}from"./alert-BEdX_qhI.js";import{C as Ht}from"./card-CNNf5saL.js";import{K as Me}from"./monitoring-stats-row-D6qosWnk.js";import{u as Jt}from"./studio-tools-Zf2j5Vw6.js";import{u as zs}from"./useSuspenseInfiniteQuery-CsMnvHSV.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-B69G1O5h.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-CaQbuRGR.js";import{u as Vs}from"./use-infinite-scroll-CMIncUkM.js";import{c as Us,b as Ks}from"./use-automations-5rZgDplp.js";import"./SearchMd-DLvQebgX.js";import"./sidebar-Pqq_WVl7.js";import"./LayoutLeft-CYKuZwii.js";import"./use-capability-DrYAgeoP.js";import"./access-gate-Bfo1MN-6.js";import"./capability-load-error-efC7JvaJ.js";import"./Stars01-1RvLNgsH.js";import"./ChevronRight-BY1HqVE6.js";import"./use-clock-tick-CPqO-BWO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Cud6yKog.js";import"./file-type-icon-DYGh6lpU.js";import"./dialog-DHc-iPx9.js";import"./X-5CnCtsJU.js";import"./ZoomOut-DvNle-6p.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-DV4xEeHM.js";import"./chat-context-CVPSA0cN.js";import"./hooks-DK3MSO7c.js";import"./decopilot-sse-pool-DelsNiOI.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-rovOwk8E.js";import"./use-organization-settings-gIQB6FWt.js";import"./AlertCircle-Dq_G2Nzm.js";import"./Star01--VHLdkhz.js";import"./XClose-B8-m6Ysp.js";import"./ZapSquare-BD-d-pzC.js";import"./Tool01-B4pupQ7x.js";import"./Monitor01-DiwEyrIh.js";import"./Upload01-Bb4xamfI.js";import"./shell-layout-DQpppXAg.js";import"./Users03-BC-_ZtVi.js";import"./CheckCircle-M-SB_oIp.js";import"./Zap-DbdLJbyv.js";import"./required-auth-layout-D-J1BueF.js";import"./use-org-sso-BFHNwstz.js";import"./LinkExternal01-DU5nTXy3.js";import"./ArrowUpRight-CQ9V3qZ2.js";import"./Palette-CYyTNBF1.js";import"./use-navigate-to-agent-BKUFyiJj.js";import"./use-mcp-prompts-BvvmYT5d.js";import"./form-DKjNHSgl.js";import"./use-collections-CdkIpoPj.js";import"./Settings02-C9u5iyRe.js";import"./ChevronLeft-C491iKrG.js";import"./DotsVertical-CCea0DBY.js";import"./Globe04-BVNSKsf5.js";import"./HardDrive-BYvsH8om.js";import"./Sun-DDm9LtlE.js";import"./Shield01-CeaSgNsE.js";import"./User01-CRJiYDWT.js";import"./Users01-D8fzZILN.js";import"./index-BZ1n_eeg.js";import"./use-org-auth-client-CiDUlr9j.js";import"./auth-9EhfyRsv.js";import"./useInfiniteQuery-C_KTVASW.js";import"./task-status-C22YJZSD.js";import"./checkbox-C9da9yB_.js";import"./command-DMfMyCz6.js";import"./index-BRDh59qB.js";import"./index-DhgDI0NK.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function Ft(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 Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function 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<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
|
|
4
4
|
|