decocms 3.28.1 → 3.28.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-De-QnqNt.js → AlertCircle-C4TQxCvt.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-B0GfNpsw.js → ArrowUpRight-D_F85AmM.js} +1 -1
- package/dist/client/assets/{Check-DHmAQH53.js → Check-pmcSX7Ds.js} +1 -1
- package/dist/client/assets/{CheckCircle-DKSRB9Xd.js → CheckCircle-3ECsT-zB.js} +1 -1
- package/dist/client/assets/{ChevronDown-CN6qoGcG.js → ChevronDown-C4k7LIxV.js} +1 -1
- package/dist/client/assets/{ChevronLeft-HFx1Uufy.js → ChevronLeft-BJhNWHOk.js} +1 -1
- package/dist/client/assets/{ChevronRight-BJSYQUmF.js → ChevronRight-BNY74L1V.js} +1 -1
- package/dist/client/assets/{ChevronUp-CTGwFzLw.js → ChevronUp-BYoitSH0.js} +1 -1
- package/dist/client/assets/{Container-DZBZNA8Y.js → Container-DkRkONtL.js} +1 -1
- package/dist/client/assets/{DotsVertical-jUGLCiy5.js → DotsVertical-DJtuELuQ.js} +1 -1
- package/dist/client/assets/{Eye-CGoLCmzu.js → Eye-TeLMkAIt.js} +1 -1
- package/dist/client/assets/{FilterLines-DYSfUppO.js → FilterLines-C7Uh3aPq.js} +1 -1
- package/dist/client/assets/{Globe01--hrfRyvA.js → Globe01-DcV1IvQc.js} +1 -1
- package/dist/client/assets/{HardDrive-yKlUP3QG.js → HardDrive-hauprmZ4.js} +1 -1
- package/dist/client/assets/{Key01-DqH2W8Qa.js → Key01-BhvQgQvA.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CLZVvVLM.js → LayoutLeft-CCjwztft.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CaYoYL1Y.js → LinkExternal01-C-EuIQk5.js} +1 -1
- package/dist/client/assets/{Monitor01-BRL4_dKI.js → Monitor01-C0AyFDoy.js} +1 -1
- package/dist/client/assets/{Palette-B9PbEO6t.js → Palette-B6fuauoi.js} +1 -1
- package/dist/client/assets/{Play-Btpg8EpH.js → Play-DwlSKe5K.js} +1 -1
- package/dist/client/assets/{Plus-Cv0T2Pov.js → Plus-DgMianxx.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CcpA4rje.js → RefreshCcw01-BZNxVpdM.js} +1 -1
- package/dist/client/assets/{SearchMd-BP9M1g2N.js → SearchMd-BX7CdT-X.js} +1 -1
- package/dist/client/assets/{Settings02-BMRrFVdB.js → Settings02-QpROtTDF.js} +1 -1
- package/dist/client/assets/{Shield01-rOhEAWZ1.js → Shield01-EBH9mxXN.js} +1 -1
- package/dist/client/assets/{Star01-BjpgI7im.js → Star01-B0KVVYi_.js} +1 -1
- package/dist/client/assets/{Stars01-yuWjNyMF.js → Stars01-C-cJK68D.js} +1 -1
- package/dist/client/assets/{Stars02-Cv3Kyp_N.js → Stars02-CjwPUV9S.js} +1 -1
- package/dist/client/assets/{Sun-C0I4hv8e.js → Sun-DmvZNVcY.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CLZ8VEjC.js → SwitchHorizontal01-DXvf2f9m.js} +1 -1
- package/dist/client/assets/{Tool01-DPPRaW86.js → Tool01-B3oBdSEQ.js} +1 -1
- package/dist/client/assets/{Trash01-s7FZsfBC.js → Trash01-BMVrAqxq.js} +1 -1
- package/dist/client/assets/{Upload01-xUCMslnL.js → Upload01-CVliSV9e.js} +1 -1
- package/dist/client/assets/{User01-BsF0RS3z.js → User01-BVUfnIdT.js} +1 -1
- package/dist/client/assets/{Users01-D-iBSVXa.js → Users01-D-4KurdS.js} +1 -1
- package/dist/client/assets/{Users03-CKUicuTa.js → Users03-v_ItRW5T.js} +1 -1
- package/dist/client/assets/{X-CMYaHMo4.js → X-4DUZJqa0.js} +1 -1
- package/dist/client/assets/{XCircle-BdbzgmP6.js → XCircle-BzRD1Jd9.js} +1 -1
- package/dist/client/assets/{XClose-N2P2hiYb.js → XClose-Cu1koOKq.js} +1 -1
- package/dist/client/assets/{Zap-gqEvk94k.js → Zap-3U1K5cTy.js} +1 -1
- package/dist/client/assets/{ZapSquare-AN7R7mTa.js → ZapSquare-C5IO5ouL.js} +1 -1
- package/dist/client/assets/{ZoomOut-Xe1itnU7.js → ZoomOut-BYuR8aeQ.js} +1 -1
- package/dist/client/assets/{access-gate-Dx320Euv.js → access-gate-mN3wzjy_.js} +1 -1
- package/dist/client/assets/{accordion-BIWbMpHu.js → accordion-D9YwMIzO.js} +1 -1
- package/dist/client/assets/{add-section-modal-e667gRvo.js → add-section-modal-D1xFmKc0.js} +1 -1
- package/dist/client/assets/{agent-capabilities-Deuuzqbm.js → agent-capabilities-BOO0rztH.js} +1 -1
- package/dist/client/assets/{agent-icon-D1ySfhKA.js → agent-icon-T0Pj37EB.js} +1 -1
- package/dist/client/assets/{agent-icons-DpDt_xvu.js → agent-icons-DEflXPpL.js} +1 -1
- package/dist/client/assets/{agents-list-DXTuElJ5.js → agents-list-DcBcC4gm.js} +1 -1
- package/dist/client/assets/{ai-providers-CHLGgXkW.js → ai-providers-BprJeZ5N.js} +1 -1
- package/dist/client/assets/{alert-zJcnZqHG.js → alert-C4vjqJ0t.js} +1 -1
- package/dist/client/assets/{alert-dialog-CBzhgusU.js → alert-dialog-Dwxfxg1i.js} +1 -1
- package/dist/client/assets/app-editor-BxDGPID0.js +1 -0
- package/dist/client/assets/{auth-catchall-GeRmeWq3.js → auth-catchall-CcUR97ei.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B_vpA1VO.js → auth-split-layout-Qe3dXBW8.js} +1 -1
- package/dist/client/assets/{automation-list-row-7qb4yrwv.js → automation-list-row-Q13E2qM_.js} +1 -1
- package/dist/client/assets/{automation-runs-BcknuTTv.js → automation-runs-D-mua2nd.js} +1 -1
- package/dist/client/assets/{automations-K7jo5bzv.js → automations-BwxgjQEx.js} +1 -1
- package/dist/client/assets/{avatar-AI83PqVE.js → avatar-Cv8RAhQG.js} +1 -1
- package/dist/client/assets/{badge-CikIA9ZK.js → badge-f4YWnZL0.js} +1 -1
- package/dist/client/assets/{brand-context-BwVwErVn.js → brand-context-qJJ2F933.js} +1 -1
- package/dist/client/assets/{buckets-DUsKq9i-.js → buckets-CS3zpcgH.js} +1 -1
- package/dist/client/assets/{calendar-DZmZKFmb.js → calendar-CHyA12cZ.js} +1 -1
- package/dist/client/assets/{capability-load-error-Db8x02Oo.js → capability-load-error-CJeUoRGW.js} +1 -1
- package/dist/client/assets/{card-DmbfBYZU.js → card-BW8XcmNf.js} +1 -1
- package/dist/client/assets/{chat-context-BOn4WPpq.js → chat-context-CAanIJU3.js} +1 -1
- package/dist/client/assets/{checkbox-Cwl_z5GL.js → checkbox-CNj9E_s7.js} +1 -1
- package/dist/client/assets/{cli-auth-success--vqcpMzi.js → cli-auth-success-Cbid5ewl.js} +1 -1
- package/dist/client/assets/{collection-detail-BnmgQ1CE.js → collection-detail-7Kcq6B0O.js} +1 -1
- package/dist/client/assets/{collection-display-button-0uuG9Zva.js → collection-display-button-Dtw31ugJ.js} +1 -1
- package/dist/client/assets/{collection-search-B-CX-Cb7.js → collection-search-DMK1eBHh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DI5q4GEY.js → collection-table-wrapper-DTywOitX.js} +1 -1
- package/dist/client/assets/{collection-tabs-CdfD34L4.js → collection-tabs-DP-FMzzd.js} +1 -1
- package/dist/client/assets/{collections-CXYJ8MVZ.js → collections-FCb6t5rG.js} +1 -1
- package/dist/client/assets/{command-BHuAtd3n.js → command-CXvlGLCD.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DRFjva34.js → connect-desktop-dialog-BgQ9OeQZ.js} +1 -1
- package/dist/client/assets/{connection-card-DEvkcpmQ.js → connection-card-B5wplSNn.js} +1 -1
- package/dist/client/assets/{connection-detail-CWd-Y8iP.js → connection-detail-DRTbW7EB.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BxYEqmM8.js → connection-form-helpers-o4WBNnQu.js} +1 -1
- package/dist/client/assets/{connections-BtPFfd05.js → connections-x91ehTOk.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Bj1W2y0B.js → decopilot-sse-pool-Bmfj-SDf.js} +1 -1
- package/dist/client/assets/{dialog-IkiImd7I.js → dialog-B5s00-oF.js} +1 -1
- package/dist/client/assets/{domain-settings-B-px7BiX.js → domain-settings-PFlBJKW2.js} +1 -1
- package/dist/client/assets/{drawer-DO_U_Bhd.js → drawer-LPSuQTOw.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C-Cxaez8.js → dropdown-menu-BaJFpb9J.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DHOlocDg.js → dynamic-plugin-layout-BsJxVywv.js} +1 -1
- package/dist/client/assets/{empty-state-o52Hq4fy.js → empty-state-D7YGvge3.js} +1 -1
- package/dist/client/assets/{empty-state-CzxH8T9l.js → empty-state-ZXtUjdxe.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Uz57CpVC.js → extract-connection-data-DgoDS4_Y.js} +1 -1
- package/dist/client/assets/{features-DfTRf5eR.js → features-D9_I78r2.js} +1 -1
- package/dist/client/assets/{file-explorer-Wed6GBRH.js → file-explorer-DRoGrOQX.js} +1 -1
- package/dist/client/assets/{file-type-icon-BYSeb5A3.js → file-type-icon-CDc_izX0.js} +1 -1
- package/dist/client/assets/{files-PguEGaiI.js → files-CrKfgrGV.js} +1 -1
- package/dist/client/assets/{form-ChQh_wIn.js → form-BLgBgnav.js} +1 -1
- package/dist/client/assets/{general-BoF0bKER.js → general-D_FdDl2h.js} +1 -1
- package/dist/client/assets/{generate-id-BrtbvnKY.js → generate-id-DXj8sIGx.js} +1 -1
- package/dist/client/assets/{github-repo-picker-13FobS0K.js → github-repo-picker-CAK6NZTZ.js} +1 -1
- package/dist/client/assets/{header-tab-button-Qu1eh6fb.js → header-tab-button-DPplseth.js} +1 -1
- package/dist/client/assets/{hover-card-5iaAH0_M.js → hover-card-QfPMM7-7.js} +1 -1
- package/dist/client/assets/{image-field-C3Pv1Di2.js → image-field-J2UR9SMx.js} +1 -1
- package/dist/client/assets/{index-YyegPZ6_.js → index-4e2CTVL7.js} +1 -1
- package/dist/client/assets/{index-C5R8l9NR.js → index-B6FehCUO.js} +1 -1
- package/dist/client/assets/{index-CwSpOXRj.js → index-BFL9nnAw.js} +1 -1
- package/dist/client/assets/{index-Kzj6xvOo.js → index-BnTkC4uZ.js} +1 -1
- package/dist/client/assets/{index-BxF-LrkW.js → index-C5jlCV2I.js} +1 -1
- package/dist/client/assets/{index-D0sk3sYa.js → index-CIYOHhZQ.js} +1 -1
- package/dist/client/assets/{index-DFp-rnQf.js → index-CJt7pypa.js} +1 -1
- package/dist/client/assets/{index-CwnBaaeQ.js → index-CeAw691B.js} +4 -4
- package/dist/client/assets/{index-NNvehl9i.js → index-DKWQ7z_t.js} +1 -1
- package/dist/client/assets/{index-Dlc4tDxO.js → index-DOoAabap.js} +3 -3
- package/dist/client/assets/{index-BxgO4x6f.js → index-Dp7xqa9S.js} +1 -1
- package/dist/client/assets/{index-CbGPcWEH.js → index-DzDUNutB.js} +1 -1
- package/dist/client/assets/{index-Dcfw-W2O.js → index-GEjv2UZA.js} +1 -1
- package/dist/client/assets/{index-Ctxajzpe.js → index-XhpNNRDn.js} +1 -1
- package/dist/client/assets/{index-redirect-BRsZDGI9.js → index-redirect-C2dwmlAm.js} +1 -1
- package/dist/client/assets/{index-CweEMiqH.js → index-vLnKQzUP.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D4Z6Hq7s.js → infiniteQueryObserver-DApjSDt2.js} +1 -1
- package/dist/client/assets/{input-CDaarCl_.js → input-OGtZJjEE.js} +1 -1
- package/dist/client/assets/{integration-icon-DylMdkB7.js → integration-icon-ChFvmc9D.js} +1 -1
- package/dist/client/assets/{label-CmtFIrH6.js → label-DTe8NzB0.js} +1 -1
- package/dist/client/assets/{layout-Czl8yfyb.js → layout-BWEcMi1N.js} +1 -1
- package/dist/client/assets/{login-CZ304Hwe.js → login-Co2pcu6Z.js} +1 -1
- package/dist/client/assets/{members-DldCeEf4.js → members-B_NiZgeY.js} +1 -1
- package/dist/client/assets/{monaco-editor--8410HRL.js → monaco-editor-xVGWgwtQ.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-p2QkpslG.js → monitoring-stats-row-ByVvV2ie.js} +1 -1
- package/dist/client/assets/{oauth-callback-BjKMJUNm.js → oauth-callback-BDILuE_I.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider--EBMOSLZ.js → oauth-callback-ai-provider-DShAsuGx.js} +1 -1
- package/dist/client/assets/{onboarding-Dujhc2aN.js → onboarding-CmxDxoER.js} +1 -1
- package/dist/client/assets/{org-install-BRL26TWn.js → org-install-DR2-zloB.js} +1 -1
- package/dist/client/assets/{org-layout-7aQLDDnY.js → org-layout-BuB_tEV_.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-Ch8ukpQt.js → org-plugin-layout-CoO0eSJj.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cz5Nib_0.js → page-seo-form-BJ2P33W_.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CqPtJlao.js +1 -0
- package/dist/client/assets/{pair-BfYvjacw.js → pair-CuPAm5Bi.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Bafs814S.js → plugin-empty-state-L3VuPQzd.js} +1 -1
- package/dist/client/assets/{plugin-header-CzH_o1AA.js → plugin-header-nh1rjw6P.js} +1 -1
- package/dist/client/assets/{plugin-layout-BrlPuAvi.js → plugin-layout-CQVjD7pK.js} +1 -1
- package/dist/client/assets/{popover-DaxAVDXR.js → popover-C0XpZKfX.js} +1 -1
- package/dist/client/assets/{post-editor-DZv3v9vs.js → post-editor-Ujefbll0.js} +1 -1
- package/dist/client/assets/{primitives-C2FB52ts.js → primitives-DdUgHbcn.js} +1 -1
- package/dist/client/assets/{profile-Ch1PMZ--.js → profile-Bc5pUfle.js} +1 -1
- package/dist/client/assets/project-app-view-YyQnhq2c.js +1 -0
- package/dist/client/assets/record-editor-nBvi-yPi.js +1 -0
- package/dist/client/assets/registry-BWNT0mI6.js +2 -0
- package/dist/client/assets/{registry-layout-D5296RDd.js → registry-layout-YlO9r3lS.js} +1 -1
- package/dist/client/assets/{require-capability-D8n6HrEr.js → require-capability-BQvim5O5.js} +1 -1
- package/dist/client/assets/{required-auth-layout-q1UX5iFV.js → required-auth-layout-Dvpx0uYK.js} +1 -1
- package/dist/client/assets/{reset-password-BUp5wXvt.js → reset-password-BxhQ1r_k.js} +1 -1
- package/dist/client/assets/{resizable-B_wg5OKG.js → resizable-JcKp4uhd.js} +1 -1
- package/dist/client/assets/{roles-CFjXltMh.js → roles-gWoW_w7Z.js} +1 -1
- package/dist/client/assets/save-referenced-block-EoD0JuD1.js +1 -0
- package/dist/client/assets/{save-status-CJhEsrLH.js → save-status-BWSP_gRJ.js} +1 -1
- package/dist/client/assets/{schema-form-D_d0W0_5.js → schema-form-CHT4Cc-z.js} +1 -1
- package/dist/client/assets/{scroll-area-CifcP4Wg.js → scroll-area-DOidgWV9.js} +1 -1
- package/dist/client/assets/{search-input-eml2HEUh.js → search-input-BRLbSyxE.js} +1 -1
- package/dist/client/assets/{secrets-DnWBimzu.js → secrets-C4h-YogY.js} +1 -1
- package/dist/client/assets/{sections-editor-GEeJkb9Q.js → sections-editor-BRulELYR.js} +1 -1
- package/dist/client/assets/{select-Dz7DPkoH.js → select-DtexK_z5.js} +1 -1
- package/dist/client/assets/{select-model-B6KC9bZ9.js → select-model-AblBAcYY.js} +1 -1
- package/dist/client/assets/{seo-editor-yjW-SMAL.js → seo-editor-1rtm8KlY.js} +1 -1
- package/dist/client/assets/{settings-layout-Cvw0dTbU.js → settings-layout-DFrFdd-Y.js} +1 -1
- package/dist/client/assets/{settings-section-BkfPlxIX.js → settings-section-CKNefgVO.js} +1 -1
- package/dist/client/assets/{sheet-C2OErkZR.js → sheet-Ds2u6iNE.js} +1 -1
- package/dist/client/assets/{shell-controls-CgyBrm6l.js → shell-controls-TpzVn2KN.js} +1 -1
- package/dist/client/assets/{shell-layout-D-4Zna-j.js → shell-layout-BHmrKjJ7.js} +1 -1
- package/dist/client/assets/{shell-route-loading-D7iIgnMy.js → shell-route-loading-DxGBys3x.js} +1 -1
- package/dist/client/assets/{sidebar-BT1O99E-.js → sidebar-B8xglaCl.js} +1 -1
- package/dist/client/assets/{skeleton-bErIIEAe.js → skeleton-DXwBFrmR.js} +1 -1
- package/dist/client/assets/{sortable.esm-D_73qywG.js → sortable.esm-BKxlC02W.js} +1 -1
- package/dist/client/assets/{spinner-DUmur8qx.js → spinner-BiM6tNa6.js} +1 -1
- package/dist/client/assets/{sso-jmWB0IlU.js → sso-CBrsX3zV.js} +1 -1
- package/dist/client/assets/{store-CPLW6WOq.js → store-Csvq01ry.js} +1 -1
- package/dist/client/assets/store-registry-Bt2ovs6q.js +2 -0
- package/dist/client/assets/{studio-tools-B-zlmqyw.js → studio-tools-CKvJG16E.js} +1 -1
- package/dist/client/assets/{switch-CRVfQAZr.js → switch-C11gJmy6.js} +1 -1
- package/dist/client/assets/{tab-id-By_JW--7.js → tab-id-5WB0EpeZ.js} +6 -6
- package/dist/client/assets/{table-70fRVfwQ.js → table-9jRKIUhw.js} +1 -1
- package/dist/client/assets/{tabs-_yym-ubf.js → tabs-BYvmM5A_.js} +1 -1
- package/dist/client/assets/{task-status-B3M1uY2i.js → task-status-CvxTf2VK.js} +1 -1
- package/dist/client/assets/{textarea-BhyLj2Dp.js → textarea-Ds5imYZm.js} +1 -1
- package/dist/client/assets/{toggle-group-BYYoZiYB.js → toggle-group-BmE5kRMT.js} +1 -1
- package/dist/client/assets/{toolbar-BQgYgute.js → toolbar-ZRWeSQFu.js} +1 -1
- package/dist/client/assets/{tools-list-Bib10JJv.js → tools-list-CnTK9CuR.js} +1 -1
- package/dist/client/assets/{tooltip-D0rD3x8T.js → tooltip-DjQW44FW.js} +1 -1
- package/dist/client/assets/{types-Bt2jh4HB.js → types-Dc5cEQpH.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BL6EQsm8.js → use-ai-providers-XhZCg1_E.js} +1 -1
- package/dist/client/assets/{use-automations-jCgcI_Hn.js → use-automations-i7RRg3se.js} +1 -1
- package/dist/client/assets/{use-capability-DqPX2R7m.js → use-capability-DzFqA_ML.js} +1 -1
- package/dist/client/assets/{use-collections-CH3Uvmj5.js → use-collections-YdlS5GS5.js} +1 -1
- package/dist/client/assets/{use-connection-BGpjiuJJ.js → use-connection-gDoBL3iK.js} +1 -1
- package/dist/client/assets/{use-copy-DHiMTnai.js → use-copy-BPFzc0Dk.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-8G8o89BT.js → use-create-virtual-mcp-DcKYoquB.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BnF-F24h.js → use-debounced-autosave-Dc2f-IpJ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DSxSiAyt.js → use-delete-connection-CEg_2cre.js} +1 -1
- package/dist/client/assets/{use-file-configs-CDby3RwC.js → use-file-configs-JiatUQs-.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BlDyJWAa.js → use-infinite-scroll-p2B5TchE.js} +1 -1
- package/dist/client/assets/{use-list-state-nfg3Cb56.js → use-list-state-D6tqpIP2.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BoOtVD9g.js → use-mcp-client-DnwBQgtt.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CYbN8Yyl.js → use-mcp-prompts-Clc-WOtL.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DlzThqmJ.js → use-mcp-tools-BQmNGmmp.js} +1 -1
- package/dist/client/assets/{use-members-BLEStPtC.js → use-members-U2A7MOWt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-_X_kAEcz.js → use-navigate-to-agent-DGKOJZZo.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-ziK5gAU8.js → use-org-auth-client-BtA9q92Y.js} +1 -1
- package/dist/client/assets/{use-org-sso-BCRYycoj.js → use-org-sso-C7W79uGy.js} +1 -1
- package/dist/client/assets/{use-organization-roles-zr9qa8BU.js → use-organization-roles-F5igVlxZ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BQtNgLEs.js → use-organization-settings-79qw4RP3.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CPtcwe6P.js → use-registry-connections-B7ROIw00.js} +1 -1
- package/dist/client/assets/{use-secrets-wimlaYjN.js → use-secrets-BZWXRb4X.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CZU7jLXq.js → use-status-sounds-ZKWD8wXu.js} +1 -1
- package/dist/client/assets/{use-view-mode-BJ_FnvkJ.js → use-view-mode-DozvbNbv.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-_FyR-EfH.js → use-virtual-mcp-B4ctZV2V.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-qWamWTas.js +1 -0
- package/dist/client/assets/{useRouterState-CfhsEB7J.js → useRouterState-VKNXuMDL.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CDj1xolJ.js +1 -0
- package/dist/client/assets/{user-CXZKnlfK.js → user-oT5nEq50.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BO9qiFWG.js → view-mode-toggle-C_ukyuBD.js} +1 -1
- package/dist/client/assets/{workflow-CA6KPd9J.js → workflow-BpAUD1S2.js} +1 -1
- package/dist/client/assets/workflow-detail-DNlVdn_V.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +5 -5
- package/dist/server/server.js +4 -4
- package/package.json +1 -1
- package/dist/client/assets/app-editor-DqV_IRWA.js +0 -1
- package/dist/client/assets/page-seo-sheet-CcoAXMMc.js +0 -1
- package/dist/client/assets/project-app-view-CNkoTSGZ.js +0 -1
- package/dist/client/assets/record-editor-B2xsglRQ.js +0 -1
- package/dist/client/assets/registry-BD5AwdfO.js +0 -2
- package/dist/client/assets/save-referenced-block-C-C4ro26.js +0 -1
- package/dist/client/assets/store-registry-BUknjkUH.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Dzg2BCY9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D3ys-EbO.js +0 -1
- package/dist/client/assets/workflow-detail-DzevlE_t.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as Ze,as as de,at as Ye,au as et,av as $e,G as he,aw as tt,ax as st,r as A,ay as it,az as nt,aA as rt,aB as ot,aC as ve,aD as lt,aE as at,aF as ct,e as T,j as i,q as J,c as q,l as Ie,aG as pe,o as W,K as ne,n as re,a as dt,v as mt,E as ut,b as ft,B as je}from"./index-Dlc4tDxO.js";import{u as xe}from"./tooltip-D0rD3x8T.js";import{i as ht,u as oe,g as pt,a as xt}from"./use-mcp-client-BoOtVD9g.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-_FyR-EfH.js";import{i as jt}from"./Check-DHmAQH53.js";import{_ as wt,A as Y,a0 as Nt,v as St,c as _t}from"./agent-icon-D1ySfhKA.js";import{s as ge}from"./Plus-Cv0T2Pov.js";import{i as Te}from"./X-CMYaHMo4.js";import{u as Ct,b as kt,h as Et,C as se}from"./agent-capabilities-Deuuzqbm.js";import{u as $t,c as It}from"./chat-context-BOn4WPpq.js";import{N as Tt}from"./agent-icons-DpDt_xvu.js";import{u as Ae,a as ie,K as Me,P as Oe,D as Re,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-D_73qywG.js";import{u as ze,a as Pe,o as Ut}from"./use-organization-settings-BQtNgLEs.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-D-4Zna-j.js";import{I as Qt}from"./input-CDaarCl_.js";import{S as Wt}from"./scroll-area-CifcP4Wg.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Jt}from"./sheet-C2OErkZR.js";import{S as H}from"./skeleton-bErIIEAe.js";import{t as De}from"./ChevronDown-CN6qoGcG.js";import{d as He}from"./ZoomOut-Xe1itnU7.js";import{g as Xt,M as Zt}from"./types-Bt2jh4HB.js";import{I as Yt}from"./integration-icon-DylMdkB7.js";import{u as es}from"./studio-tools-B-zlmqyw.js";import{t as Le,P as ts,e as ss,s as is,g as ns}from"./pair-BfYvjacw.js";import{a as rs}from"./XCircle-BdbzgmP6.js";import{g as os}from"./use-mcp-prompts-CYbN8Yyl.js";import{u as ls,w as as}from"./tab-id-By_JW--7.js";import{a as cs,g as ds,c as ms,b as us,D as fs}from"./dropdown-menu-C-Cxaez8.js";import{s as hs}from"./Trash01-s7FZsfBC.js";import{a as ps,u as xs}from"./use-ai-providers-BL6EQsm8.js";import{a as gs}from"./toolbar-BQgYgute.js";import"./use-collections-CH3Uvmj5.js";import"./AlertCircle-De-QnqNt.js";import"./Tool01-DPPRaW86.js";import"./SwitchHorizontal01-CLZ8VEjC.js";import"./RefreshCcw01-CcpA4rje.js";import"./ArrowUpRight-B0GfNpsw.js";import"./ZapSquare-AN7R7mTa.js";import"./Users03-CKUicuTa.js";import"./CheckCircle-DKSRB9Xd.js";import"./ChevronLeft-HFx1Uufy.js";import"./ChevronRight-BJSYQUmF.js";import"./ChevronUp-CTGwFzLw.js";import"./DotsVertical-jUGLCiy5.js";import"./Container-DZBZNA8Y.js";import"./Eye-CGoLCmzu.js";import"./Globe01--hrfRyvA.js";import"./FilterLines-DYSfUppO.js";import"./Star01-BjpgI7im.js";import"./Palette-B9PbEO6t.js";import"./HardDrive-yKlUP3QG.js";import"./Stars02-Cv3Kyp_N.js";import"./Key01-DqH2W8Qa.js";import"./LayoutLeft-CLZVvVLM.js";import"./LinkExternal01-CaYoYL1Y.js";import"./Monitor01-BRL4_dKI.js";import"./Sun-C0I4hv8e.js";import"./Play-Btpg8EpH.js";import"./SearchMd-BP9M1g2N.js";import"./Settings02-BMRrFVdB.js";import"./Shield01-rOhEAWZ1.js";import"./Stars01-yuWjNyMF.js";import"./Upload01-xUCMslnL.js";import"./User01-BsF0RS3z.js";import"./Users01-D-iBSVXa.js";import"./XClose-N2P2hiYb.js";import"./Zap-gqEvk94k.js";import"./spinner-DUmur8qx.js";import"./dialog-IkiImd7I.js";import"./drawer-DO_U_Bhd.js";import"./collection-search-B-CX-Cb7.js";import"./form-ChQh_wIn.js";import"./label-CmtFIrH6.js";import"./select-Dz7DPkoH.js";import"./tabs-_yym-ubf.js";import"./toggle-group-BYYoZiYB.js";import"./connect-desktop-dialog-DRFjva34.js";import"./popover-DaxAVDXR.js";import"./command-BHuAtd3n.js";import"./index-C5R8l9NR.js";import"./useInfiniteQuery-Dzg2BCY9.js";import"./infiniteQueryObserver-D4Z6Hq7s.js";import"./index-DFp-rnQf.js";import"./question-004-sINsf4GQ.js";import"./checkbox-Cwl_z5GL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-AI83PqVE.js";import"./settings-section-BkfPlxIX.js";import"./card-DmbfBYZU.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DEvkcpmQ.js";import"./use-registry-connections-CPtcwe6P.js";import"./use-connection-BGpjiuJJ.js";import"./extract-connection-data-Uz57CpVC.js";import"./generate-id-BrtbvnKY.js";import"./collections-CXYJ8MVZ.js";import"./collection-tabs-CdfD34L4.js";import"./badge-CikIA9ZK.js";import"./textarea-BhyLj2Dp.js";import"./connection-form-helpers-BxYEqmM8.js";import"./use-infinite-scroll-BlDyJWAa.js";import"./useSuspenseInfiniteQuery-D3ys-EbO.js";import"./required-auth-layout-q1UX5iFV.js";import"./useRouterState-CfhsEB7J.js";import"./use-org-sso-BCRYycoj.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DHiMTnai.js";import"./file-type-icon-BYSeb5A3.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-_X_kAEcz.js";import"./decopilot-sse-pool-Bj1W2y0B.js";import"./create-sse-subscription-BS5983N4.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ze{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),l=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),o=l||c,d=o?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!Ye(m,f)});!o&&!d||(o&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(o&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,l)=>a!==r[l]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=et(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),l=e.get(n.queryHash)?.shift()??new $e(this.#n,n);s.push({defaultedQueryOptions:n,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=tt(),a=st(),l=A.useMemo(()=>t.map(h=>{const p=r.defaultQueryOptions(h);return p._optimisticResults=n?"isRestoring":"optimistic",p}),[t,r,n]);l.forEach(h=>{it(h);const p=r.getQueryCache().get(h.queryHash);nt(h,a,p)}),rt(a);const[c]=A.useState(()=>new ys(r,l,e)),[o,d,m]=c.getOptimisticResult(l,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?c.subscribe(de.batchCalls(h)):ot,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const x=o.some((h,p)=>ve(l[p],h))?o.flatMap((h,p)=>{const b=l[p];if(b&&ve(b,h)){const v=new $e(r,b);return lt(b,v,a)}return[]}):[];if(x.length>0)throw Promise.all(x);const g=o.find((h,p)=>{const b=l[p];return b&&at({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return d(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ct,enabled:!0,placeholderData:void 0}))},e)}const ee=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(qt,{children:"Manage home"}),c=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(wt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h=>a(h.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[l,c,i.jsxs("div",{className:"relative mt-3",children:[o,i.jsx(Qt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==x?(g=i.jsx(Jt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=J(),r=ze();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,l=Pe(),c=bt(),o=he();let d;e[2]!==s||e[3]!==o?(d=()=>o.refetchQueries({queryKey:ne.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=o,e[4]=d):d=e[4];const m=d;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let x;e[7]!==a||e[8]!==t?(x=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=x):x=e[9];const h=x>=ee;let p;e[10]!==h||e[11]!==f||e[12]!==l?(p=C=>f(C)||h?Promise.resolve():l.apply($=>$.includes(C)?null:[...$,C]),e[10]=h,e[11]=f,e[12]=l,e[13]=p):p=e[13];const b=p;let v;e[14]!==l?(v=C=>l.apply($=>$.filter(E=>E!==C)),e[14]=l,e[15]=v):v=e[15];const w=v;let y;e[16]!==l?(y=C=>l.apply(()=>C),e[16]=l,e[17]=y):y=e[17];const j=y;let N;e[18]!==c||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==l?(N=async(C,$)=>{await c.update.mutateAsync({id:C.id,data:{metadata:$}}),!f(C.id)&&!h&&await l.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=c,e[19]=h,e[20]=f,e[21]=m,e[22]=l,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map($s)),e[1]=n,e[2]=a):a=e[2];const l=Ns(a);let c,o,d;if(e[3]!==n||e[4]!==l||e[5]!==s){const h=new Map(n.map(Es));c=s.trim().toLowerCase();const p=v=>!c||v.title?.toLowerCase().includes(c);o=l.homeIds.map(v=>h.get(v)).filter(ks).filter(p);let b;e[9]!==l?(b=v=>!l.isOnHome(v.id),e[9]=l,e[10]=b):b=e[10],d=n.filter(Cs).filter(b).filter(p).sort(_s),e[3]=n,e[4]=l,e[5]=s,e[6]=c,e[7]=o,e[8]=d}else c=e[6],o=e[7],d=e[8];const m=d;let u;e[11]!==l||e[12]!==o?(u=i.jsx(Is,{home:l,agents:o}),e[11]=l,e[12]=o,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==l||e[16]!==f?(x=i.jsx(Ms,{home:l,agents:m,hasSearch:f}),e[14]=m,e[15]=l,e[16]=f,e[17]=x):x=e[17];let g;return e[18]!==u||e[19]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!ht(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function $s(t){return t.id}function Ue(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==a?(l=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function Is(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const l=Ae(ie(Oe,n),ie(Me,a));let c;e[2]!==s?(c=x=>{const{active:g,over:h}=x;if(!h||g.id===h.id)return;const p=s.homeIds,b=p.indexOf(g.id),v=p.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...p],b,v)).catch(As)},e[2]=s,e[3]=c):c=e[3];const o=c,d=`${s.homeIds.length}/${ee}`;let m;e[4]!==d?(m=i.jsx(Ue,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==o||e[8]!==s||e[9]!==l?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Re,{sensors:l,collisionDetection:At,onDragEnd:o,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Rs,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=o,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,l]=A.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const o=r.slice(0,a);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ue,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:o.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>l(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=c}else c=e[4];return c}function Os(t){return t+20}function Be(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:c,listeners:o,setNodeRef:d,transform:m,transition:u,isDragging:f}=Rt(l),x=Be(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,p=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==p||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:p},e[4]=g,e[5]=h,e[6]=p,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(He,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==o||e[14]!==j?(S=i.jsx("button",{type:"button",...c,...o,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=c,e[13]=o,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let $;e[17]!==s.icon||e[18]!==C?($=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=$):$=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let I;e[22]!==x?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=I):I=e[23];let O;e[24]!==_||e[25]!==I?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,I]}),e[24]=_,e[25]=I,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(De,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==$||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[$,O,P]}),e[31]=n,e[32]=$,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Te,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Fe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==d||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:d,style:v,className:y,children:[L,U]}),e[51]=d,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),l=Be(t),c=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(o=>!o),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),i.jsx(De,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ee}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx(Ie,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Fe,{agent:t,home:e})]})}function Fe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,l,c,o,d,m;if(e[0]!==s||e[1]!==r){const p=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,l=s,c=r,o=v,d=new Set(p.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=l,e[5]=c,e[6]=o,e[7]=d,e[8]=m}else n=e[2],a=e[3],l=e[4],c=e[5],o=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==l||e[13]!==c||e[14]!==o||e[15]!==d?(u=i.jsx(n,{agent:l,home:c,connectionIds:o,pinnedResourceUris:d}),e[11]=n,e[12]=l,e[13]=c,e[14]=o,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const x=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==x?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const n=es(),{data:a,isLoading:l}=re({queryKey:ne.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async o=>{try{const{item:d}=await n.call("COLLECTION_CONNECTIONS_GET",{id:o}),m=(d?.tools??[]).flatMap(u=>{const f=Xt(u._meta);return f?[{name:u.name,description:u.description,resourceUri:f}]:[]});return{id:o,title:d?.title??o,icon:d?.icon??null,uiTools:m}}catch{return{id:o,title:o,icon:null,uiTools:[]}}}))).filter(o=>o.uiTools.length>0)});return s.length===0?null:l?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!a||a.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:a.map(c=>c.uiTools.map(o=>i.jsx(Fs,{agent:t,home:e,connection:c,tool:o,isPinned:r.has(o.resourceUri)},`${c.id}:${o.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=pe(t.metadata?.ui),d=n?o.filter(u=>u.resourceUri!==r.resourceUri):[...o,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle tile",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Le(r.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Qe(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==l?(c=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=c):c=e[1];let o;e[2]!==s||e[3]!==r?(o=r?i.jsx(Ie,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==o?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:c,children:o}),e[5]=a,e[6]=n,e[7]=r,e[8]=c,e[9]=o,e[10]=d):d=e[10],d}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=J();let l;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const c=oe(l);let o;e[4]!==s.id||e[5]!==a.id?(o=ne.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=o):o=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Gs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==o||e[10]!==d?(m={queryKey:o,queryFn:d,staleTime:3e4,retry:!1},e[9]=o,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=re(m),g=be(a.slug);let h,p;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],p=[...N];for(const S of h)p.some(k=>k.name===S.name)||p.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=p}else h=e[15],p=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(x&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(p.length===0)return null;let b;e[22]!==n||e[23]!==p?(b=n??p.map(qs),e[22]=n,e[23]=p,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==p||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:p.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:p.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=p,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=t.metadata?.ui?.homePrompts;let d;Array.isArray(o)?d=n?o.filter(u=>u!==s.name):[...o,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle prompt",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Le(s.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Js(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const Z=1,We=`home-board.layout.v${Z}`;function qe(t){return`home-board.layout.v${Z}.${t}`}const Ke={version:Z,tiles:{},hidden:[]};function me(t){return!t||t.version!==Z?Ke:{version:Z,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(qe(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(qe(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${We}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=ne.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const l=a;let c;e[4]!==l||e[5]!==t?(c=async()=>{const b=await fetch(`/api/${t}/kv/${We}`);if(b.status===404)return l&&Zs(l)?(await Se(t,l),l):Ke;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=l,e[5]=t,e[6]=c):c=e[6];let o;e[7]!==l||e[8]!==n||e[9]!==c?(o={queryKey:n,queryFn:c,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=n,e[9]=c,e[10]=o):o=e[10];const{data:d,isLoading:m}=re(o);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=dt(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const g=x;let h;e[18]!==d?(h=me(d),e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==m||e[21]!==g||e[22]!==h?(p={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=p):p=e[23],p}const Ge=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=J(),n=ei(r.slug),[a,l]=A.useState(!1),[c,o]=A.useState(null);let d;e[0]!==n.layout?(d=()=>{o(n.layout),l(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{o(null),l(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),o(null),l(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const g=x,h=a&&c!==null,p=h?c:n.layout;let b;e[6]!==c||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?o(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==p||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:p,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=p,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ge.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ve(){const t=A.useContext(Ge);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=J(),r=oe({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[l,c]=A.useState(null),[o,d]=A.useState(!1),m=A.useRef(!1),u=async(p,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const v=await os(r,p.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:p.name,name:is(p.name,ns(p._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async p=>{if(!m.current){if(p.arguments&&p.arguments.length>0){c(p);return}await u(p)}},x=async p=>{if(!l)return;const b=l;c(null),await u(b,p)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const p=crypto.randomUUID();await n({id:p,virtual_mcp_id:t}),a(p,t)}catch(p){console.error("[start-thread-from-prompt] startBlank failed",p),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ts,{prompt:l,setPrompt:p=>c(p),onSubmit:x}),dialogPrompt:l,starting:o}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(mt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:l,onRemove:c}=t,o=xe(),d=A.useRef(null),[m,u]=A.useState(null),[f,x]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Ae(ie(Oe,g),ie(Me)),p=s.reduce(oi,0),b=r?Math.max(p+2,4):Math.max(p,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),x(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),x(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(o){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,$,E,_,I,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(X=>X.id===m):null;C=Re,B=h,z=j,$=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==l||e[44]!==n||e[45]!==s){let X;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==l||e[51]!==n?(X=te=>i.jsx(ci,{tile:te,isEditMode:r,isDragging:m===te.id,onResize:l,onRemove:c,children:n(te)},te.id),e[47]=m,e[48]=r,e[49]=c,e[50]=l,e[51]=n,e[52]=X):X=e[52],U=s.map(X),e[40]=m,e[41]=r,e[42]=c,e[43]=l,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?(I={width:G,height:le},e[57]=G,e[58]=le,e[59]=I):I=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=l,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=$,e[27]=E,e[28]=_,e[29]=I,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],$=e[26],E=e[27],_=e[28],I=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==I||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:I,children:O}),e[60]=k,e[61]=_,e[62]=I,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==$||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:$,children:[E,P]}),e[65]=C,e[66]=$,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(o,d)=>r.some(m=>o>=m.x&&o<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let l;if(e[2]!==a||e[3]!==s){l=[];for(let o=0;o<s;o++)for(let d=0;d<K;d++)a(d,o)||l.push({x:d,y:o});e[2]=a,e[3]=s,e[4]=l}else l=e[4];let c;return e[5]!==l?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(ai)}),e[5]=l,e[6]=c):c=e[6],c}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:l,children:c}=t,o=!r;let d;e[0]!==o||e[1]!==s.id?(d={id:s.id,disabled:o},e[0]=o,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Lt(d),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,p=s.y*V,b=s.h*V,v=x||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==p||e[9]!==h?(N={left:g,top:p,width:h,height:b},e[6]=b,e[7]=g,e[8]=p,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(He,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=a,e[18]=s,e[19]=C):C=e[19];let $;e[20]!==c?($=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:c})}),e[20]=c,e[21]=$):$=e[21];let E;e[22]!==$||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,$]}),e[22]=$,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,l]=A.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(cs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(St,{size:16})})}),e[0]=c):c=e[0];let o;e[1]!==r||e[2]!==s.id?(o=p=>{r(s.id,p),l(!1)},e[1]=r,e[2]=s.id,e[3]=o):o=e[3];let d;e[4]!==o||e[5]!==s?(d=i.jsx(mi,{tile:s,onPick:o}),e[4]=o,e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let x;e[12]!==u?(x=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=x):x=e[13];let g;e[14]!==d||e[15]!==x?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[d,m,x]}),e[14]=d,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:l,children:[c,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[l,c]=A.useState(null);let o;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(o=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==d.h||e[6]!==d.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[d.w," × ",d.h]})]}),e[5]=d.h,e[6]=d.w,e[7]=u):u=e[7];let f,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},x=()=>c(null),e[8]=f,e[9]=x):(f=e[8],x=e[9]);let g;e[10]!==d.h||e[11]!==d.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:x,children:Array.from({length:ii},(p,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=d.w&&j<=d.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>c({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=d.h,e[11]=d.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let l=0;l<s&&a;l++)for(let c=0;c<e&&a;c++)ui(t,n+c,r+l)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(o=>o.id===e);if(!r)return t;const n=t.filter(o=>o.id!==e),a=n.find(o=>s.x>=o.x&&s.x<o.x+o.w&&s.y>=o.y&&s.y<o.y+o.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(o=>o.id===e?{...o,x:a.x,y:a.y}:o.id===a.id?{...o,x:r.x,y:r.y}:o);const c=[{...r,x:s.x,y:s.y}];for(const o of n){const d=fe(c,o.w,o.h);c.push({...o,x:d.x,y:d.y})}return c}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ve();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const l=a;let c,o;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){o=[];let v;e[7]!==l?(v=y=>y.pinned||!l.has(y.id),e[7]=l,e[8]=v):v=e[8];const w=t.filter(v);c=new Map;for(const y of t)y.minSize&&c.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:$}=ce(j.x,j.y,S);o.push({id:y.id,x:C,y:$,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(o.some($=>$.id===y.id))continue;const j=y.defaultSize??ni,N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(o,S,k);o.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=c,e[6]=o}else c=e[5],o=e[6];let d;e[9]!==t?(d=new Set(t.map(pi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:Z,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==o?(x={visible:o},e[14]=o,e[15]=x):x=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==o?(g=(v,w)=>{const y=o.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(o,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=o,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==o?(h=(v,w)=>{const y=o.find(E=>E.id===v);if(!y)return;const j=c.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=o.filter(E=>E.id!==v),$=[k];for(const E of C){const _=fe($,E.w,E.h);$.push({...E,x:_.x,y:_.y})}f($,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=o,e[24]=h):h=e[24];let p;e[25]!==f||e[26]!==s||e[27]!==o?(p=v=>{const w=o.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=o,e[28]=p):p=e[28];let b;return e[29]!==r||e[30]!==x||e[31]!==g||e[32]!==h||e[33]!==p?(b={snapshot:x,isLoading:r,moveTile:g,resizeTile:h,hideTile:p},e[29]=r,e[30]=x,e[31]=g,e[32]=h,e[33]=p,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:l}=si(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const o=c;let d;return e[5]!==a||e[6]!==o||e[7]!==n||e[8]!==l?(d={open:o,startBlank:n,dialog:a,starting:l},e[5]=a,e[6]=o,e[7]=n,e[8]=l,e[9]=d):d=e[9],d}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:l}=ye(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const o=l||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let p;e[14]!==h?(p=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=p):p=e[15];let b;e[16]!==p||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,p]}),e[16]=p,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=v):v=e[20];let w;e[21]!==l||e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==o||e[26]!==f||e[27]!==x?(w=i.jsxs("button",{type:"button",onClick:c,disabled:o,"aria-busy":l,className:f,children:[x,b,v]}),e[21]=l,e[22]=c,e[23]=b,e[24]=v,e[25]=o,e[26]=f,e[27]=x,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:l}=J(),{open:c,startBlank:o,dialog:d,starting:m}=ye(s.agentId);let u,f,x,g,h;if(e[0]!==n||e[1]!==c||e[2]!==l.id||e[3]!==l.slug||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==o?(w=()=>{o()},e[14]=o,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let $;e[23]!==C?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=$):$=e[24];let E;e[25]!==k||e[26]!==$?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,$]}),e[25]=k,e[26]=$,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx($i,{}),e[35]=_):_=e[35],e[36]!==l.id||e[37]!==l.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[36]=l.id,e[37]=l.slug,e[38]=s,e[39]=f):f=e[39],x=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(I=>i.jsx("button",{type:"button",onClick:()=>c(I),disabled:m,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:I.title})},I.promptName))}),e[0]=n,e[1]=c,e[2]=l.id,e[3]=l.slug,e[4]=r,e[5]=o,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=x,e[12]=g,e[13]=h}else u=e[9],f=e[10],x=e[11],g=e[12],h=e[13];let p;e[40]!==u||e[41]!==f||e[42]!==x?(p=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=p):p=e[43];let b;return e[44]!==d||e[45]!==g||e[46]!==h||e[47]!==p?(b=i.jsxs("div",{className:g,children:[h,p,d]}),e[44]=d,e[45]=g,e[46]=h,e[47]=p,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const l=oe(a),c=s.minHeight??200,o=s.maxHeight??4e3;let d;return e[4]!==l||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==o||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(Zt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:l,displayMode:"fullscreen",minHeight:c,maxHeight:o,className:"h-full"}),e[4]=l,e[5]=r,e[6]=n,e[7]=c,e[8]=o,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ii(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let c;e[6]!==a?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,l]}),e[6]=a,e[7]=c):c=e[7];let o;e[8]!==n||e[9]!==c?(o=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=o):o=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==o?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[o,d]}),e[12]=o,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:l,dialog:c,starting:o}=ye(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==o||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Ai);d="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==l?(g=()=>{l()},e[10]=l,e[11]=g):g=e[11];const h=o||n,p=n&&"pl-10 pr-10";let b;e[12]!==p?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",p),e[12]=p,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:o,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=J(),{isLoading:n,prompts:a,tiles:l}=be(r.slug),c=ze()?.ids??[];let o;e[0]!==c?(o=new Set(c),e[0]=c,e[1]=o):o=e[1];const d=o,m=Pe();let u;e[2]!==l?(u=new Set(l.map(Pi)),e[2]=l,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==a){x=new Map;for(const _ of a){const I=x.get(_.agentId);I?I.push(_):x.set(_.agentId,[_])}e[4]=a,e[5]=x}else x=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==l){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const I=a.filter(_);g=[...l.map(zi),...I.map(Ri)],e[6]=a,e[7]=f,e[8]=l,e[9]=g}else g=e[9];const h=g;let p;e[12]!==h?(p=new Map(h.map(Oi)),e[12]=h,e[13]=p):p=e[13];const b=p;let v;e[14]!==h||e[15]!==d?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:d.has(_.data.agentId)})),e[14]=h,e[15]=d,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply(I=>I.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==d||e[22]!==j?(N=_=>{const I=b.get(_);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==x?(k=_=>{const I=b.get(_.id);if(!I)return null;if(I.kind==="tile"){const O=x.get(I.data.agentId)??[];return i.jsx(ut,{fallback:i.jsx(Ti,{tile:I.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx(Ii,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ci,{tile:I.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:I.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=x,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ft.useSession(),{org:s}=J(),r=xe(),n=$t(),{selectedVirtualMcp:a}=It();let l;t[0]!==s.id?(l=pt(s.id),t[0]=s.id,t[1]=l):l=t[1];const o=a??l;let d;t[2]!==s.slug?(d=Ft(s.slug),t[2]=s.slug,t[3]=d):d=t[3],re(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:xt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=oe(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let g;t[13]!==o.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,o.id,u),t[13]=o.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==x||t[19]!==g?(h={queries:[f,x,g]},t[17]=f,t[18]=x,t[19]=g,t[20]=h):h=t[20],js(h);const p=xs(),b=vt(o.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(p.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}let $;t[22]!==e?.user?.name?($=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=$):$=t[23];const E=$,_=v&&y&&j!=null,I=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==I?(O=_?i.jsx(se.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(se.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=I,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let l;e[3]!==r?(l=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let c;e[5]!==a||e[6]!==l?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(se.Input,{showConnectionsBanner:!0})}),e[8]=o):o=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,o,d]}),e[10]=c,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:l,save:c,cancel:o,hasChanges:d}=Ve(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==c?(x=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:d,onEnter:l,onSave:c,onCancel:o,onAddTile:f})}),e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=c,e[6]=x):x=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const p=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==p?(b=q("relative flex flex-col items-center px-10 pb-4",p),e[10]=p,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(se.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==x||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[x,g,k]}),e[28]=k,e[29]=x,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:l,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Te,{size:14}),e[3]=f):f=e[3];let x;e[4]!==l?(x=i.jsxs(je,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=x):x=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let p;e[7]!==a||e[8]!==g?(p=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=p):p=e[9];let b;return e[10]!==u||e[11]!==x||e[12]!==p?(b=i.jsxs(i.Fragment,{children:[u,x,p]}),e[10]=u,e[11]=x,e[12]=p,e[13]=b):b=e[13],b}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_t,{size:14}),e[14]=o):o=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[o,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|
|
1
|
+
import{ar as Ze,as as de,at as Ye,au as et,av as $e,G as he,aw as tt,ax as st,r as A,ay as it,az as nt,aA as rt,aB as ot,aC as ve,aD as lt,aE as at,aF as ct,e as T,j as i,q as J,c as q,l as Ie,aG as pe,o as W,K as ne,n as re,a as dt,v as mt,E as ut,b as ft,B as je}from"./index-DOoAabap.js";import{u as xe}from"./tooltip-DjQW44FW.js";import{i as ht,u as oe,g as pt,a as xt}from"./use-mcp-client-DnwBQgtt.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-B4ctZV2V.js";import{i as jt}from"./Check-pmcSX7Ds.js";import{_ as wt,A as Y,a0 as Nt,v as St,c as _t}from"./agent-icon-T0Pj37EB.js";import{s as ge}from"./Plus-DgMianxx.js";import{i as Te}from"./X-4DUZJqa0.js";import{u as Ct,b as kt,h as Et,C as se}from"./agent-capabilities-BOO0rztH.js";import{u as $t,c as It}from"./chat-context-CAanIJU3.js";import{N as Tt}from"./agent-icons-DEflXPpL.js";import{u as Ae,a as ie,K as Me,P as Oe,D as Re,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-BKxlC02W.js";import{u as ze,a as Pe,o as Ut}from"./use-organization-settings-79qw4RP3.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-BHmrKjJ7.js";import{I as Qt}from"./input-OGtZJjEE.js";import{S as Wt}from"./scroll-area-DOidgWV9.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Jt}from"./sheet-Ds2u6iNE.js";import{S as H}from"./skeleton-DXwBFrmR.js";import{t as De}from"./ChevronDown-C4k7LIxV.js";import{d as He}from"./ZoomOut-BYuR8aeQ.js";import{g as Xt,M as Zt}from"./types-Dc5cEQpH.js";import{I as Yt}from"./integration-icon-ChFvmc9D.js";import{u as es}from"./studio-tools-CKvJG16E.js";import{t as Le,P as ts,e as ss,s as is,g as ns}from"./pair-CuPAm5Bi.js";import{a as rs}from"./XCircle-BzRD1Jd9.js";import{g as os}from"./use-mcp-prompts-Clc-WOtL.js";import{u as ls,w as as}from"./tab-id-5WB0EpeZ.js";import{a as cs,g as ds,c as ms,b as us,D as fs}from"./dropdown-menu-BaJFpb9J.js";import{s as hs}from"./Trash01-BMVrAqxq.js";import{a as ps,u as xs}from"./use-ai-providers-XhZCg1_E.js";import{a as gs}from"./toolbar-ZRWeSQFu.js";import"./use-collections-YdlS5GS5.js";import"./AlertCircle-C4TQxCvt.js";import"./Tool01-B3oBdSEQ.js";import"./SwitchHorizontal01-DXvf2f9m.js";import"./RefreshCcw01-BZNxVpdM.js";import"./ArrowUpRight-D_F85AmM.js";import"./ZapSquare-C5IO5ouL.js";import"./Users03-v_ItRW5T.js";import"./CheckCircle-3ECsT-zB.js";import"./ChevronLeft-BJhNWHOk.js";import"./ChevronRight-BNY74L1V.js";import"./ChevronUp-BYoitSH0.js";import"./DotsVertical-DJtuELuQ.js";import"./Container-DkRkONtL.js";import"./Eye-TeLMkAIt.js";import"./Globe01-DcV1IvQc.js";import"./FilterLines-C7Uh3aPq.js";import"./Star01-B0KVVYi_.js";import"./Palette-B6fuauoi.js";import"./HardDrive-hauprmZ4.js";import"./Stars02-CjwPUV9S.js";import"./Key01-BhvQgQvA.js";import"./LayoutLeft-CCjwztft.js";import"./LinkExternal01-C-EuIQk5.js";import"./Monitor01-C0AyFDoy.js";import"./Sun-DmvZNVcY.js";import"./Play-DwlSKe5K.js";import"./SearchMd-BX7CdT-X.js";import"./Settings02-QpROtTDF.js";import"./Shield01-EBH9mxXN.js";import"./Stars01-C-cJK68D.js";import"./Upload01-CVliSV9e.js";import"./User01-BVUfnIdT.js";import"./Users01-D-4KurdS.js";import"./XClose-Cu1koOKq.js";import"./Zap-3U1K5cTy.js";import"./spinner-BiM6tNa6.js";import"./dialog-B5s00-oF.js";import"./drawer-LPSuQTOw.js";import"./collection-search-DMK1eBHh.js";import"./form-BLgBgnav.js";import"./label-DTe8NzB0.js";import"./select-DtexK_z5.js";import"./tabs-BYvmM5A_.js";import"./toggle-group-BmE5kRMT.js";import"./connect-desktop-dialog-BgQ9OeQZ.js";import"./popover-C0XpZKfX.js";import"./command-CXvlGLCD.js";import"./index-B6FehCUO.js";import"./useInfiniteQuery-qWamWTas.js";import"./infiniteQueryObserver-DApjSDt2.js";import"./index-CJt7pypa.js";import"./question-004-sINsf4GQ.js";import"./checkbox-CNj9E_s7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-Cv8RAhQG.js";import"./settings-section-CKNefgVO.js";import"./card-BW8XcmNf.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B5wplSNn.js";import"./use-registry-connections-B7ROIw00.js";import"./use-connection-gDoBL3iK.js";import"./extract-connection-data-DgoDS4_Y.js";import"./generate-id-DXj8sIGx.js";import"./collections-FCb6t5rG.js";import"./collection-tabs-DP-FMzzd.js";import"./badge-f4YWnZL0.js";import"./textarea-Ds5imYZm.js";import"./connection-form-helpers-o4WBNnQu.js";import"./use-infinite-scroll-p2B5TchE.js";import"./useSuspenseInfiniteQuery-CDj1xolJ.js";import"./required-auth-layout-Dvpx0uYK.js";import"./useRouterState-VKNXuMDL.js";import"./use-org-sso-C7W79uGy.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BPFzc0Dk.js";import"./file-type-icon-CDc_izX0.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-DGKOJZZo.js";import"./decopilot-sse-pool-Bmfj-SDf.js";import"./create-sse-subscription-BS5983N4.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ze{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),l=s.length!==n.length,c=n.some((m,u)=>m!==s[u]),o=l||c,d=o?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!Ye(m,f)});!o&&!d||(o&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(o&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(l=>{l.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,l)=>a!==r[l]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=et(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),l=e.get(n.queryHash)?.shift()??new $e(this.#n,n);s.push({defaultedQueryOptions:n,observer:l})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=tt(),a=st(),l=A.useMemo(()=>t.map(h=>{const p=r.defaultQueryOptions(h);return p._optimisticResults=n?"isRestoring":"optimistic",p}),[t,r,n]);l.forEach(h=>{it(h);const p=r.getQueryCache().get(h.queryHash);nt(h,a,p)}),rt(a);const[c]=A.useState(()=>new ys(r,l,e)),[o,d,m]=c.getOptimisticResult(l,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?c.subscribe(de.batchCalls(h)):ot,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(l,e)},[l,e,c]);const x=o.some((h,p)=>ve(l[p],h))?o.flatMap((h,p)=>{const b=l[p];if(b&&ve(b,h)){const v=new $e(r,b);return lt(b,v,a)}return[]}):[];if(x.length>0)throw Promise.all(x);const g=o.find((h,p)=>{const b=l[p];return b&&at({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return d(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:ct,enabled:!0,placeholderData:void 0}))},e)}const ee=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let l,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(qt,{children:"Manage home"}),c=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=l,e[1]=c):(l=e[0],c=e[1]);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(wt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=h=>a(h.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[l,c,i.jsxs("div",{className:"relative mt-3",children:[o,i.jsx(Qt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let x;e[9]!==m||e[10]!==f?(x=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=x):x=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==x?(g=i.jsx(Jt,{open:s,onOpenChange:r,children:x}),e[12]=r,e[13]=s,e[14]=x,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=J(),r=ze();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,l=Pe(),c=bt(),o=he();let d;e[2]!==s||e[3]!==o?(d=()=>o.refetchQueries({queryKey:ne.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=o,e[4]=d):d=e[4];const m=d;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let x;e[7]!==a||e[8]!==t?(x=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=x):x=e[9];const h=x>=ee;let p;e[10]!==h||e[11]!==f||e[12]!==l?(p=C=>f(C)||h?Promise.resolve():l.apply($=>$.includes(C)?null:[...$,C]),e[10]=h,e[11]=f,e[12]=l,e[13]=p):p=e[13];const b=p;let v;e[14]!==l?(v=C=>l.apply($=>$.filter(E=>E!==C)),e[14]=l,e[15]=v):v=e[15];const w=v;let y;e[16]!==l?(y=C=>l.apply(()=>C),e[16]=l,e[17]=y):y=e[17];const j=y;let N;e[18]!==c||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==l?(N=async(C,$)=>{await c.update.mutateAsync({id:C.id,data:{metadata:$}}),!f(C.id)&&!h&&await l.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=c,e[19]=h,e[20]=f,e[21]=m,e[22]=l,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map($s)),e[1]=n,e[2]=a):a=e[2];const l=Ns(a);let c,o,d;if(e[3]!==n||e[4]!==l||e[5]!==s){const h=new Map(n.map(Es));c=s.trim().toLowerCase();const p=v=>!c||v.title?.toLowerCase().includes(c);o=l.homeIds.map(v=>h.get(v)).filter(ks).filter(p);let b;e[9]!==l?(b=v=>!l.isOnHome(v.id),e[9]=l,e[10]=b):b=e[10],d=n.filter(Cs).filter(b).filter(p).sort(_s),e[3]=n,e[4]=l,e[5]=s,e[6]=c,e[7]=o,e[8]=d}else c=e[6],o=e[7],d=e[8];const m=d;let u;e[11]!==l||e[12]!==o?(u=i.jsx(Is,{home:l,agents:o}),e[11]=l,e[12]=o,e[13]=u):u=e[13];const f=!!c;let x;e[14]!==m||e[15]!==l||e[16]!==f?(x=i.jsx(Ms,{home:l,agents:m,hasSearch:f}),e[14]=m,e[15]=l,e[16]=f,e[17]=x):x=e[17];let g;return e[18]!==u||e[19]!==x?(g=i.jsxs(i.Fragment,{children:[u,x]}),e[18]=u,e[19]=x,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!ht(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function $s(t){return t.id}function Ue(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let l;return e[4]!==n||e[5]!==a?(l=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=l):l=e[6],l}function Is(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const l=Ae(ie(Oe,n),ie(Me,a));let c;e[2]!==s?(c=x=>{const{active:g,over:h}=x;if(!h||g.id===h.id)return;const p=s.homeIds,b=p.indexOf(g.id),v=p.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...p],b,v)).catch(As)},e[2]=s,e[3]=c):c=e[3];const o=c,d=`${s.homeIds.length}/${ee}`;let m;e[4]!==d?(m=i.jsx(Ue,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==o||e[8]!==s||e[9]!==l?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Re,{sensors:l,collisionDetection:At,onDragEnd:o,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(x=>i.jsx(Rs,{agent:x,home:s},x.id))})})}),e[6]=r,e[7]=o,e[8]=s,e[9]=l,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,l]=A.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const o=r.slice(0,a);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ue,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:o.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>l(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=c}else c=e[4];return c}function Os(t){return t+20}function Be(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let l;e[0]!==s.id?(l={id:s.id},e[0]=s.id,e[1]=l):l=e[1];const{attributes:c,listeners:o,setNodeRef:d,transform:m,transition:u,isDragging:f}=Rt(l),x=Be(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,p=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==p||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:p},e[4]=g,e[5]=h,e[6]=p,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(He,{size:14}),e[11]=N):N=e[11];let S;e[12]!==c||e[13]!==o||e[14]!==j?(S=i.jsx("button",{type:"button",...c,...o,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=c,e[13]=o,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let $;e[17]!==s.icon||e[18]!==C?($=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=$):$=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let I;e[22]!==x?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:x}),e[22]=x,e[23]=I):I=e[23];let O;e[24]!==_||e[25]!==I?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,I]}),e[24]=_,e[25]=I,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(De,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==$||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[$,O,P]}),e[31]=n,e[32]=$,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Te,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Fe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==d||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:d,style:v,className:y,children:[L,U]}),e[51]=d,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),l=Be(t),c=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(o=>!o),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),l&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:l})]}),i.jsx(De,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ee}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx(Ie,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Fe,{agent:t,home:e})]})}function Fe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,l,c,o,d,m;if(e[0]!==s||e[1]!==r){const p=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,l=s,c=r,o=v,d=new Set(p.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=l,e[5]=c,e[6]=o,e[7]=d,e[8]=m}else n=e[2],a=e[3],l=e[4],c=e[5],o=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==l||e[13]!==c||e[14]!==o||e[15]!==d?(u=i.jsx(n,{agent:l,home:c,connectionIds:o,pinnedResourceUris:d}),e[11]=n,e[12]=l,e[13]=c,e[14]=o,e[15]=d,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const x=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==x?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:x})}),e[18]=s,e[19]=r,e[20]=x,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const n=es(),{data:a,isLoading:l}=re({queryKey:ne.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async o=>{try{const{item:d}=await n.call("COLLECTION_CONNECTIONS_GET",{id:o}),m=(d?.tools??[]).flatMap(u=>{const f=Xt(u._meta);return f?[{name:u.name,description:u.description,resourceUri:f}]:[]});return{id:o,title:d?.title??o,icon:d?.icon??null,uiTools:m}}catch{return{id:o,title:o,icon:null,uiTools:[]}}}))).filter(o=>o.uiTools.length>0)});return s.length===0?null:l?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!a||a.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:a.map(c=>c.uiTools.map(o=>i.jsx(Fs,{agent:t,home:e,connection:c,tool:o,isPinned:r.has(o.resourceUri)},`${c.id}:${o.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=pe(t.metadata?.ui),d=n?o.filter(u=>u.resourceUri!==r.resourceUri):[...o,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle tile",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Le(r.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Qe(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,l=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==l?(c=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",l),e[0]=l,e[1]=c):c=e[1];let o;e[2]!==s||e[3]!==r?(o=r?i.jsx(Ie,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==o?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:c,children:o}),e[5]=a,e[6]=n,e[7]=r,e[8]=c,e[9]=o,e[10]=d):d=e[10],d}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=J();let l;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(l={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=l):l=e[3];const c=oe(l);let o;e[4]!==s.id||e[5]!==a.id?(o=ne.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=o):o=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Gs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==o||e[10]!==d?(m={queryKey:o,queryFn:d,staleTime:3e4,retry:!1},e[9]=o,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:f,error:x}=re(m),g=be(a.slug);let h,p;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],p=[...N];for(const S of h)p.some(k=>k.name===S.name)||p.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=p}else h=e[15],p=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(x&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,x),null;if(p.length===0)return null;let b;e[22]!==n||e[23]!==p?(b=n??p.map(qs),e[22]=n,e[23]=p,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==p||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:p.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:p.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=p,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,l]=A.useState(!1),c=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${ee}) — remove an agent first`);return}l(!0);try{const o=t.metadata?.ui?.homePrompts;let d;Array.isArray(o)?d=n?o.filter(u=>u!==s.name):[...o,s.name]:d=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(t,m)}catch(o){console.error("[home-tiles] failed to toggle prompt",o),W.error("Couldn't update home — please try again.")}finally{l(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Le(s.name)}),i.jsx(Qe,{isPinned:n,submitting:a,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Js(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const Z=1,We=`home-board.layout.v${Z}`;function qe(t){return`home-board.layout.v${Z}.${t}`}const Ke={version:Z,tiles:{},hidden:[]};function me(t){return!t||t.version!==Z?Ke:{version:Z,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(qe(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(qe(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${We}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=ne.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const l=a;let c;e[4]!==l||e[5]!==t?(c=async()=>{const b=await fetch(`/api/${t}/kv/${We}`);if(b.status===404)return l&&Zs(l)?(await Se(t,l),l):Ke;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=l,e[5]=t,e[6]=c):c=e[6];let o;e[7]!==l||e[8]!==n||e[9]!==c?(o={queryKey:n,queryFn:c,initialData:l,staleTime:0,refetchOnWindowFocus:!1},e[7]=l,e[8]=n,e[9]=c,e[10]=o):o=e[10];const{data:d,isLoading:m}=re(o);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=dt(u);let x;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(x=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=x):x=e[17];const g=x;let h;e[18]!==d?(h=me(d),e[18]=d,e[19]=h):h=e[19];let p;return e[20]!==m||e[21]!==g||e[22]!==h?(p={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=p):p=e[23],p}const Ge=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=J(),n=ei(r.slug),[a,l]=A.useState(!1),[c,o]=A.useState(null);let d;e[0]!==n.layout?(d=()=>{o(n.layout),l(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{o(null),l(!1)},e[2]=u):u=e[2];const f=u;let x;e[3]!==c||e[4]!==n?(x=()=>{c&&n.save(c),o(null),l(!1)},e[3]=c,e[4]=n,e[5]=x):x=e[5];const g=x,h=a&&c!==null,p=h?c:n.layout;let b;e[6]!==c||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?o(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==p||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:p,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=p,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ge.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ve(){const t=A.useContext(Ge);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=J(),r=oe({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[l,c]=A.useState(null),[o,d]=A.useState(!1),m=A.useRef(!1),u=async(p,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const v=await os(r,p.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:p.name,name:is(p.name,ns(p._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},f=async p=>{if(!m.current){if(p.arguments&&p.arguments.length>0){c(p);return}await u(p)}},x=async p=>{if(!l)return;const b=l;c(null),await u(b,p)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const p=crypto.randomUUID();await n({id:p,virtual_mcp_id:t}),a(p,t)}catch(p){console.error("[start-thread-from-prompt] startBlank failed",p),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ts,{prompt:l,setPrompt:p=>c(p),onSubmit:x}),dialogPrompt:l,starting:o}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(mt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:l,onRemove:c}=t,o=xe(),d=A.useRef(null),[m,u]=A.useState(null),[f,x]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Ae(ie(Oe,g),ie(Me)),p=s.reduce(oi,0),b=r?Math.max(p+2,4):Math.max(p,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),x(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),x(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(o){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,$,E,_,I,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==c||e[19]!==l||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(X=>X.id===m):null;C=Re,B=h,z=j,$=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==l||e[44]!==n||e[45]!==s){let X;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==l||e[51]!==n?(X=te=>i.jsx(ci,{tile:te,isEditMode:r,isDragging:m===te.id,onResize:l,onRemove:c,children:n(te)},te.id),e[47]=m,e[48]=r,e[49]=c,e[50]=l,e[51]=n,e[52]=X):X=e[52],U=s.map(X),e[40]=m,e[41]=r,e[42]=c,e[43]=l,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?(I={width:G,height:le},e[57]=G,e[58]=le,e[59]=I):I=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=c,e[19]=l,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=$,e[27]=E,e[28]=_,e[29]=I,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],$=e[26],E=e[27],_=e[28],I=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==I||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:I,children:O}),e[60]=k,e[61]=_,e[62]=I,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==$||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:$,children:[E,P]}),e[65]=C,e[66]=$,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(o,d)=>r.some(m=>o>=m.x&&o<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let l;if(e[2]!==a||e[3]!==s){l=[];for(let o=0;o<s;o++)for(let d=0;d<K;d++)a(d,o)||l.push({x:d,y:o});e[2]=a,e[3]=s,e[4]=l}else l=e[4];let c;return e[5]!==l?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:l.map(ai)}),e[5]=l,e[6]=c):c=e[6],c}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:l,children:c}=t,o=!r;let d;e[0]!==o||e[1]!==s.id?(d={id:s.id,disabled:o},e[0]=o,e[1]=s.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:x}=Lt(d),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,p=s.y*V,b=s.h*V,v=x||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==p||e[9]!==h?(N={left:g,top:p,width:h,height:b},e[6]=b,e[7]=g,e[8]=p,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==l||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(He,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:l})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=l,e[17]=a,e[18]=s,e[19]=C):C=e[19];let $;e[20]!==c?($=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:c})}),e[20]=c,e[21]=$):$=e[21];let E;e[22]!==$||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,$]}),e[22]=$,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,l]=A.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(cs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(St,{size:16})})}),e[0]=c):c=e[0];let o;e[1]!==r||e[2]!==s.id?(o=p=>{r(s.id,p),l(!1)},e[1]=r,e[2]=s.id,e[3]=o):o=e[3];let d;e[4]!==o||e[5]!==s?(d=i.jsx(mi,{tile:s,onPick:o}),e[4]=o,e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let x;e[12]!==u?(x=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=x):x=e[13];let g;e[14]!==d||e[15]!==x?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[d,m,x]}),e[14]=d,e[15]=x,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:l,children:[c,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[l,c]=A.useState(null);let o;e[0]!==l||e[1]!==s.h||e[2]!==s.w?(o=l??{w:s.w,h:s.h},e[0]=l,e[1]=s.h,e[2]=s.w,e[3]=o):o=e[3];const d=o;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==d.h||e[6]!==d.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[d.w," × ",d.h]})]}),e[5]=d.h,e[6]=d.w,e[7]=u):u=e[7];let f,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},x=()=>c(null),e[8]=f,e[9]=x):(f=e[8],x=e[9]);let g;e[10]!==d.h||e[11]!==d.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:x,children:Array.from({length:ii},(p,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=d.w&&j<=d.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>c({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=d.h,e[11]=d.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let l=0;l<s&&a;l++)for(let c=0;c<e&&a;c++)ui(t,n+c,r+l)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(o=>o.id===e);if(!r)return t;const n=t.filter(o=>o.id!==e),a=n.find(o=>s.x>=o.x&&s.x<o.x+o.w&&s.y>=o.y&&s.y<o.y+o.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(o=>o.id===e?{...o,x:a.x,y:a.y}:o.id===a.id?{...o,x:r.x,y:r.y}:o);const c=[{...r,x:s.x,y:s.y}];for(const o of n){const d=fe(c,o.w,o.h);c.push({...o,x:d.x,y:d.y})}return c}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ve();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const l=a;let c,o;if(e[2]!==t||e[3]!==l||e[4]!==s.tiles){o=[];let v;e[7]!==l?(v=y=>y.pinned||!l.has(y.id),e[7]=l,e[8]=v):v=e[8];const w=t.filter(v);c=new Map;for(const y of t)y.minSize&&c.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:$}=ce(j.x,j.y,S);o.push({id:y.id,x:C,y:$,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(o.some($=>$.id===y.id))continue;const j=y.defaultSize??ni,N=c.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(o,S,k);o.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=l,e[4]=s.tiles,e[5]=c,e[6]=o}else c=e[5],o=e[6];let d;e[9]!==t?(d=new Set(t.map(pi)),e[9]=t,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:Z,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const f=u;let x;e[14]!==o?(x={visible:o},e[14]=o,e[15]=x):x=e[15];let g;e[16]!==f||e[17]!==s||e[18]!==o?(g=(v,w)=>{const y=o.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(o,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=o,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==c||e[23]!==o?(h=(v,w)=>{const y=o.find(E=>E.id===v);if(!y)return;const j=c.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=o.filter(E=>E.id!==v),$=[k];for(const E of C){const _=fe($,E.w,E.h);$.push({...E,x:_.x,y:_.y})}f($,s.hidden)},e[20]=f,e[21]=s,e[22]=c,e[23]=o,e[24]=h):h=e[24];let p;e[25]!==f||e[26]!==s||e[27]!==o?(p=v=>{const w=o.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=o,e[28]=p):p=e[28];let b;return e[29]!==r||e[30]!==x||e[31]!==g||e[32]!==h||e[33]!==p?(b={snapshot:x,isLoading:r,moveTile:g,resizeTile:h,hideTile:p},e[29]=r,e[30]=x,e[31]=g,e[32]=h,e[33]=p,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:l}=si(s);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const o=c;let d;return e[5]!==a||e[6]!==o||e[7]!==n||e[8]!==l?(d={open:o,startBlank:n,dialog:a,starting:l},e[5]=a,e[6]=o,e[7]=n,e[8]=l,e[9]=d):d=e[9],d}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:l}=ye(s.agentId);let c;e[0]!==s||e[1]!==n?(c=()=>n(s),e[0]=s,e[1]=n,e[2]=c):c=e[2];const o=l||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=l&&"opacity-60";let f;e[3]!==d||e[4]!==m||e[5]!==u?(f=q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=f):f=e[6];let x;e[7]!==s.agentIcon||e[8]!==s.agentName?(x=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=x):x=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let p;e[14]!==h?(p=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=p):p=e[15];let b;e[16]!==p||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,p]}),e[16]=p,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=v):v=e[20];let w;e[21]!==l||e[22]!==c||e[23]!==b||e[24]!==v||e[25]!==o||e[26]!==f||e[27]!==x?(w=i.jsxs("button",{type:"button",onClick:c,disabled:o,"aria-busy":l,className:f,children:[x,b,v]}),e[21]=l,e[22]=c,e[23]=b,e[24]=v,e[25]=o,e[26]=f,e[27]=x,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:l}=J(),{open:c,startBlank:o,dialog:d,starting:m}=ye(s.agentId);let u,f,x,g,h;if(e[0]!==n||e[1]!==c||e[2]!==l.id||e[3]!==l.slug||e[4]!==r||e[5]!==o||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==o?(w=()=>{o()},e[14]=o,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let $;e[23]!==C?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=$):$=e[24];let E;e[25]!==k||e[26]!==$?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,$]}),e[25]=k,e[26]=$,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx($i,{}),e[35]=_):_=e[35],e[36]!==l.id||e[37]!==l.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:l.id,orgSlug:l.slug})})}),e[36]=l.id,e[37]=l.slug,e[38]=s,e[39]=f):f=e[39],x=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(I=>i.jsx("button",{type:"button",onClick:()=>c(I),disabled:m,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:I.title})},I.promptName))}),e[0]=n,e[1]=c,e[2]=l.id,e[3]=l.slug,e[4]=r,e[5]=o,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=x,e[12]=g,e[13]=h}else u=e[9],f=e[10],x=e[11],g=e[12],h=e[13];let p;e[40]!==u||e[41]!==f||e[42]!==x?(p=i.jsxs("div",{className:u,children:[f,x]}),e[40]=u,e[41]=f,e[42]=x,e[43]=p):p=e[43];let b;return e[44]!==d||e[45]!==g||e[46]!==h||e[47]!==p?(b=i.jsxs("div",{className:g,children:[h,p,d]}),e[44]=d,e[45]=g,e[46]=h,e[47]=p,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const l=oe(a),c=s.minHeight??200,o=s.maxHeight??4e3;let d;return e[4]!==l||e[5]!==r||e[6]!==n||e[7]!==c||e[8]!==o||e[9]!==s.connectionId||e[10]!==s.resourceUri?(d=i.jsx(Zt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:l,displayMode:"fullscreen",minHeight:c,maxHeight:o,className:"h-full"}),e[4]=l,e[5]=r,e[6]=n,e[7]=c,e[8]=o,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=d):d=e[11],d}function $i(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ii(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=l):l=e[5];let c;e[6]!==a?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,l]}),e[6]=a,e[7]=c):c=e[7];let o;e[8]!==n||e[9]!==c?(o=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=o):o=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==o?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[o,d]}),e[12]=o,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:l,dialog:c,starting:o}=ye(s.agentId);let d,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==l||e[4]!==o||e[5]!==s.agentIcon||e[6]!==s.agentName){const x=r.filter(Ai);d="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==l?(g=()=>{l()},e[10]=l,e[11]=g):g=e[11];const h=o||n,p=n&&"pl-10 pr-10";let b;e[12]!==p?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",p),e[12]=p,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=x.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:x.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),disabled:o,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let f;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=J(),{isLoading:n,prompts:a,tiles:l}=be(r.slug),c=ze()?.ids??[];let o;e[0]!==c?(o=new Set(c),e[0]=c,e[1]=o):o=e[1];const d=o,m=Pe();let u;e[2]!==l?(u=new Set(l.map(Pi)),e[2]=l,e[3]=u):u=e[3];const f=u;let x;if(e[4]!==a){x=new Map;for(const _ of a){const I=x.get(_.agentId);I?I.push(_):x.set(_.agentId,[_])}e[4]=a,e[5]=x}else x=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==l){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const I=a.filter(_);g=[...l.map(zi),...I.map(Ri)],e[6]=a,e[7]=f,e[8]=l,e[9]=g}else g=e[9];const h=g;let p;e[12]!==h?(p=new Map(h.map(Oi)),e[12]=h,e[13]=p):p=e[13];const b=p;let v;e[14]!==h||e[15]!==d?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:d.has(_.data.agentId)})),e[14]=h,e[15]=d,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply(I=>I.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==d||e[22]!==j?(N=_=>{const I=b.get(_);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==x?(k=_=>{const I=b.get(_.id);if(!I)return null;if(I.kind==="tile"){const O=x.get(I.data.agentId)??[];return i.jsx(ut,{fallback:i.jsx(Ti,{tile:I.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx(Ii,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ci,{tile:I.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:I.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=x,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ft.useSession(),{org:s}=J(),r=xe(),n=$t(),{selectedVirtualMcp:a}=It();let l;t[0]!==s.id?(l=pt(s.id),t[0]=s.id,t[1]=l):l=t[1];const o=a??l;let d;t[2]!==s.slug?(d=Ft(s.slug),t[2]=s.slug,t[3]=d):d=t[3],re(d);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:xt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=oe(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let x;t[10]!==s.id||t[11]!==u?(x=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=x):x=t[12];let g;t[13]!==o.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,o.id,u),t[13]=o.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==x||t[19]!==g?(h={queries:[f,x,g]},t[17]=f,t[18]=x,t[19]=g,t[20]=h):h=t[20],js(h);const p=xs(),b=vt(o.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(p.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}let $;t[22]!==e?.user?.name?($=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=$):$=t[23];const E=$,_=v&&y&&j!=null,I=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==I?(O=_?i.jsx(se.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(se.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=I,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let l;e[3]!==r?(l=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=l):l=e[4];let c;e[5]!==a||e[6]!==l?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(se.Input,{showConnectionsBanner:!0})}),e[8]=o):o=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,o,d]}),e[10]=c,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:l,save:c,cancel:o,hasChanges:d}=Ve(),[m,u]=A.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let x;e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==c?(x=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:d,onEnter:l,onSave:c,onCancel:o,onAddTile:f})}),e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=c,e[6]=x):x=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const p=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==p?(b=q("relative flex flex-col items-center px-10 pb-4",p),e[10]=p,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(se.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==x||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[x,g,k]}),e[28]=k,e[29]=x,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:l,onAddTile:c}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Te,{size:14}),e[3]=f):f=e[3];let x;e[4]!==l?(x=i.jsxs(je,{size:"sm",variant:"ghost",onClick:l,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=l,e[5]=x):x=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let p;e[7]!==a||e[8]!==g?(p=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=p):p=e[9];let b;return e[10]!==u||e[11]!==x||e[12]!==p?(b=i.jsxs(i.Fragment,{children:[u,x,p]}),e[10]=u,e[11]=x,e[12]=p,e[13]=b):b=e[13],b}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(_t,{size:14}),e[14]=o):o=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[o,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,bi as q,cy as R,cz as Ee,cA as ke,cB as Se,bE as xe,cC as j}from"./index-Dlc4tDxO.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...B}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Ve,Input:Be,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
1
|
+
import{r as n,bi as q,cy as R,cz as Ee,cA as ke,cB as Se,bE as xe,cC as j}from"./index-DOoAabap.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...B}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:B,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Be=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Oe=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Oe,Item:Ve,Input:Be,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e5 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e6 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e7 as Nt,e8 as es,o as Ys,v as Zs,e9 as en,ea as tn}from"./index-Dlc4tDxO.js";import{D as sn,F as nn,B as on}from"./index-BxF-LrkW.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-BoOtVD9g.js";import{a as ts}from"./use-virtual-mcp-_FyR-EfH.js";import{M as Oe}from"./monaco-editor--8410HRL.js";import{b as ln,R as zt,a as cn}from"./resizable-B_wg5OKG.js";import{B as le}from"./badge-CikIA9ZK.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-Dz7DPkoH.js";import{S as et}from"./spinner-DUmur8qx.js";import{V as an}from"./view-mode-toggle-BO9qiFWG.js";import{aj as un,q as dn,i as fn,B as ss,ak as mn,a4 as pn,v as xn,al as ns,aa as hn,O as os,am as gn,an as bn,a6 as ft,ao as jn}from"./agent-icon-D1ySfhKA.js";import{i as rs}from"./Play-Btpg8EpH.js";import{b as Sn,a as yn,V as Ge}from"./layout-Czl8yfyb.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-D0rD3x8T.js";import{u as wn,a as vn}from"./use-connection-BGpjiuJJ.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-DlzThqmJ.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-IkiImd7I.js";import"./index-Kzj6xvOo.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-CifcP4Wg.js";import{S as Fn}from"./index-DFp-rnQf.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-5iaAH0_M.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-C-Cxaez8.js";import{s as Un}from"./Plus-Cv0T2Pov.js";import{b as ps}from"./Tool01-DPPRaW86.js";import{i as Fe}from"./Check-DHmAQH53.js";import{s as _t}from"./XClose-N2P2hiYb.js";import{I as Ct}from"./integration-icon-DylMdkB7.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-BIWbMpHu.js";import"./index-CweEMiqH.js";import{i as xs}from"./X-CMYaHMo4.js";import{u as hs,a as Gn}from"./use-collections-CH3Uvmj5.js";import{E as gs}from"./empty-state-CzxH8T9l.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as Wt}from"./input-CDaarCl_.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{e5 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e6 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e7 as Nt,e8 as es,o as Ys,v as Zs,e9 as en,ea as tn}from"./index-DOoAabap.js";import{D as sn,F as nn,B as on}from"./index-C5jlCV2I.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-DnwBQgtt.js";import{a as ts}from"./use-virtual-mcp-B4ctZV2V.js";import{M as Oe}from"./monaco-editor-xVGWgwtQ.js";import{b as ln,R as zt,a as cn}from"./resizable-JcKp4uhd.js";import{B as le}from"./badge-f4YWnZL0.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-DtexK_z5.js";import{S as et}from"./spinner-BiM6tNa6.js";import{V as an}from"./view-mode-toggle-C_ukyuBD.js";import{aj as un,q as dn,i as fn,B as ss,ak as mn,a4 as pn,v as xn,al as ns,aa as hn,O as os,am as gn,an as bn,a6 as ft,ao as jn}from"./agent-icon-T0Pj37EB.js";import{i as rs}from"./Play-DwlSKe5K.js";import{b as Sn,a as yn,V as Ge}from"./layout-BWEcMi1N.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-DjQW44FW.js";import{u as wn,a as vn}from"./use-connection-gDoBL3iK.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-BQmNGmmp.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-B5s00-oF.js";import"./index-BnTkC4uZ.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-DOidgWV9.js";import{S as Fn}from"./index-CJt7pypa.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-QfPMM7-7.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-BaJFpb9J.js";import{s as Un}from"./Plus-DgMianxx.js";import{b as ps}from"./Tool01-B3oBdSEQ.js";import{i as Fe}from"./Check-pmcSX7Ds.js";import{s as _t}from"./XClose-Cu1koOKq.js";import{I as Ct}from"./integration-icon-ChFvmc9D.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-D9YwMIzO.js";import"./index-vLnKQzUP.js";import{i as xs}from"./X-4DUZJqa0.js";import{u as hs,a as Gn}from"./use-collections-YdlS5GS5.js";import{E as gs}from"./empty-state-ZXtUjdxe.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as Wt}from"./input-OGtZJjEE.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
|
|
3
3
|
`:""} ${u}${f}: ${n(d)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bC as _}from"./index-
|
|
1
|
+
import{bC as _}from"./index-DOoAabap.js";var S={exports:{}},r={};var $;function C(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function I(){return v||(v=1,S.exports=C()),S.exports}var g=I();const h=_(g);export{h as R,g as r};
|