decocms 4.49.0 → 4.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-k25R3-Si.js → AlertCircle-B9onYPsx.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-goUbSV_t.js → ArrowUpRight-31bYFmB1.js} +1 -1
- package/dist/client/assets/{Check-tfEbDiSO.js → Check-CAm_pNZb.js} +1 -1
- package/dist/client/assets/{CheckCircle-B-AysnVj.js → CheckCircle-LZxCN5IY.js} +1 -1
- package/dist/client/assets/{ChevronDown-DDh3Hhw_.js → ChevronDown-DDQcR6fD.js} +1 -1
- package/dist/client/assets/{ChevronRight-3DlxSDpa.js → ChevronRight-ZwqhPdyq.js} +1 -1
- package/dist/client/assets/{ChevronUp-CGRHCTkf.js → ChevronUp-CFaryGNc.js} +1 -1
- package/dist/client/assets/{Circle-9NU9F6cw.js → Circle-Cb2xDFmW.js} +1 -1
- package/dist/client/assets/{Copy01-v70-83R3.js → Copy01-CuE5Mdxv.js} +1 -1
- package/dist/client/assets/{DotsVertical-CJNxrPQc.js → DotsVertical-8bp0B0ya.js} +1 -1
- package/dist/client/assets/{Eye-BQAd-UWR.js → Eye-DkQOgqLy.js} +1 -1
- package/dist/client/assets/{FilterLines-WY77jC6d.js → FilterLines-DXM-OYLy.js} +1 -1
- package/dist/client/assets/{Globe01-BJm_6L1K.js → Globe01-DBXbzkud.js} +1 -1
- package/dist/client/assets/{Globe04-Bvx5rGM6.js → Globe04-D3KvtDDx.js} +1 -1
- package/dist/client/assets/{HardDrive-DqhFpjyW.js → HardDrive-C-0ZSA5F.js} +1 -1
- package/dist/client/assets/{Key01-Ca3H4Guz.js → Key01-Dd9wKRX6.js} +1 -1
- package/dist/client/assets/{LayoutLeft-LgchNodn.js → LayoutLeft-lNBuuI5W.js} +1 -1
- package/dist/client/assets/{LinkExternal01-4WLYi2mX.js → LinkExternal01-D_Rlg4XY.js} +1 -1
- package/dist/client/assets/{List-CP5qu-Ed.js → List-5gTuVFju.js} +1 -1
- package/dist/client/assets/{Loading02-EeaKovpr.js → Loading02-BKjix3t4.js} +1 -1
- package/dist/client/assets/{Monitor01-B7DuF8uL.js → Monitor01-BxJdzfiN.js} +1 -1
- package/dist/client/assets/{Palette-BDkRrX1I.js → Palette-DHuaqxQW.js} +1 -1
- package/dist/client/assets/{Play-DSAmPT6o.js → Play-siKyKpye.js} +1 -1
- package/dist/client/assets/{Plus-C1-9U7xY.js → Plus-OhB-LRM_.js} +1 -1
- package/dist/client/assets/{SearchLg-CvEhHQsI.js → SearchLg-Cw1vzWS4.js} +1 -1
- package/dist/client/assets/{SearchMd-DiN4RXkm.js → SearchMd-OFgwXHVA.js} +1 -1
- package/dist/client/assets/{Settings02-C31aohuM.js → Settings02-B3B_P5fs.js} +1 -1
- package/dist/client/assets/{Shield01-CszvfMrq.js → Shield01-BGz5Kh9w.js} +1 -1
- package/dist/client/assets/{Star01-DGbt_SIN.js → Star01-CKALy4hI.js} +1 -1
- package/dist/client/assets/{Stars01-BKEHGK4f.js → Stars01-CVOa90uJ.js} +1 -1
- package/dist/client/assets/{Stars02-KrIAmQsB.js → Stars02-DEytbopx.js} +1 -1
- package/dist/client/assets/{Sun-BdOFeDi1.js → Sun-C9p5qQM_.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C6ZclJC7.js → SwitchHorizontal01-X4Ivgb48.js} +1 -1
- package/dist/client/assets/{Tool01-MLrVuoSu.js → Tool01-De44pARs.js} +1 -1
- package/dist/client/assets/{Trash01-DggFSL1b.js → Trash01-CldWiayK.js} +1 -1
- package/dist/client/assets/{Upload01-Cxs1z0Jh.js → Upload01-BdN7-z6J.js} +1 -1
- package/dist/client/assets/{User01-L5odKA9U.js → User01-DICqHJXD.js} +1 -1
- package/dist/client/assets/{Users01-0hD-3O0B.js → Users01-BbT3orCr.js} +1 -1
- package/dist/client/assets/{Users03-OwsRMjku.js → Users03-7hIYOoO1.js} +1 -1
- package/dist/client/assets/{X-BSHZ0M6H.js → X-CWu4KAgv.js} +1 -1
- package/dist/client/assets/{XCircle-Ce3AP-z1.js → XCircle-BnMyXX6H.js} +1 -1
- package/dist/client/assets/{XClose-Dha2rZyS.js → XClose-B4Kds20_.js} +1 -1
- package/dist/client/assets/{Zap-MjamIo9C.js → Zap-kwvB2Aey.js} +1 -1
- package/dist/client/assets/{ZapSquare-2TYVPpzw.js → ZapSquare-CO43pmjR.js} +1 -1
- package/dist/client/assets/{ZoomOut-DOMq8Qks.js → ZoomOut-DAzAklM3.js} +1 -1
- package/dist/client/assets/{access-gate-B7i8fTcq.js → access-gate-DPJVwytb.js} +1 -1
- package/dist/client/assets/{add-section-modal-BFa2vink.js → add-section-modal-nY5ZEjwv.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CcfbqOca.js → agent-capabilities-DiwM8z_R.js} +1 -1
- package/dist/client/assets/{agent-icon-BxlAfYtU.js → agent-icon-D9GYV26D.js} +1 -1
- package/dist/client/assets/{agents-list-Dpg0mQ5j.js → agents-list-Djll6W7z.js} +1 -1
- package/dist/client/assets/{ai-providers-hukOcDkN.js → ai-providers-7YFyaNPR.js} +1 -1
- package/dist/client/assets/{alert-CPrpIdPz.js → alert-DH6_1sf9.js} +1 -1
- package/dist/client/assets/{alert-dialog-9kOsUrrA.js → alert-dialog-C-4lAz2-.js} +1 -1
- package/dist/client/assets/{app-editor-BznZUTpm.js → app-editor-COWA0gLS.js} +1 -1
- package/dist/client/assets/{auth-DEpjtwun.js → auth-5F6-aJmo.js} +1 -1
- package/dist/client/assets/{auth-catchall-D_RkydrM.js → auth-catchall-T_Tc3w05.js} +1 -1
- package/dist/client/assets/{auth-entry-jFqYAMuT.js → auth-entry-BOu9WfTk.js} +1 -1
- package/dist/client/assets/{auth-split-layout-7N_nwEWR.js → auth-split-layout-B2X42J2r.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Z5iZl3NY.js → authenticate-and-persist-oauth-DDtpfxrP.js} +1 -1
- package/dist/client/assets/{automation-list-row-DoFEAvgQ.js → automation-list-row-aWkha2kK.js} +1 -1
- package/dist/client/assets/{automation-runs-DbWyk7jb.js → automation-runs-BJpZPWhG.js} +1 -1
- package/dist/client/assets/{automations-CABzNKUu.js → automations-BpLrGqO1.js} +1 -1
- package/dist/client/assets/{autosend-hYfyQlKa.js → autosend-Ho-hw6LZ.js} +1 -1
- package/dist/client/assets/{avatar-B5g154Et.js → avatar-DuOsWYcG.js} +1 -1
- package/dist/client/assets/{badge-qy7vzuZ8.js → badge-CzvDyOP_.js} +1 -1
- package/dist/client/assets/{block-document-DNsS2KRT.js → block-document-BOy_zGcw.js} +1 -1
- package/dist/client/assets/{brand-context-D7jkbFUV.js → brand-context-R0iVvEH8.js} +1 -1
- package/dist/client/assets/{breadcrumb-COfYELC8.js → breadcrumb-voNACu1V.js} +1 -1
- package/dist/client/assets/{buckets-CB-PCLi2.js → buckets-Bb05h-zL.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-EPnEykuu.js → bulk-category-panel-BTQtHqS3.js} +1 -1
- package/dist/client/assets/{calendar-CqrMvOtO.js → calendar-CFx1zR5S.js} +1 -1
- package/dist/client/assets/{capability-load-error-DcdUflTi.js → capability-load-error-z2KG7Z7c.js} +1 -1
- package/dist/client/assets/{card-BhI7Np_f.js → card-kXMv7TY0.js} +1 -1
- package/dist/client/assets/{category-editor-BiFT8zOt.js → category-editor-DSCqUCPd.js} +1 -1
- package/dist/client/assets/{chat-context-DbtHJFUr.js → chat-context-DwqbCivU.js} +1 -1
- package/dist/client/assets/{checkbox-C9d1lIYX.js → checkbox-B7RCGW8m.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bv1VcbtV.js → cli-auth-success-DJBNtNIm.js} +1 -1
- package/dist/client/assets/{collection-detail-CRVut8n4.js → collection-detail-BEA2EhoB.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cruq60_Q.js → collection-display-button-CegkzxeF.js} +1 -1
- package/dist/client/assets/{collection-search-CwUbH4qH.js → collection-search-BPxsVhJJ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BjYwYC4q.js → collection-table-wrapper-CTf5_GQE.js} +1 -1
- package/dist/client/assets/{collection-tabs-ClxY84rJ.js → collection-tabs-B9fzylNI.js} +1 -1
- package/dist/client/assets/{command-B3cu0Aev.js → command-DQcISPQW.js} +1 -1
- package/dist/client/assets/commerce-onboarding-DogAzM5M.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-CsHMUYFP.js → connect-desktop-dialog-epPbnUVm.js} +1 -1
- package/dist/client/assets/{connection-card-CDb2GmfN.js → connection-card-BKI86wdV.js} +1 -1
- package/dist/client/assets/{connection-detail-DaB9Caux.js → connection-detail-BnmFVoeJ.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DwHnDZGX.js → connection-form-helpers-BwLjgtsz.js} +1 -1
- package/dist/client/assets/{connections-C5LmG-ha.js → connections-CyvrAE2b.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Xn1jBQQZ.js → decopilot-sse-pool-OlccTr4u.js} +1 -1
- package/dist/client/assets/{dialog-Doo4cf6x.js → dialog-GMipq3bN.js} +1 -1
- package/dist/client/assets/{domain-settings-DY3jmP1m.js → domain-settings-B-sqks9R.js} +1 -1
- package/dist/client/assets/{drawer-CzFCT3PH.js → drawer-DS0hJ2mS.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Zn5Qzoi0.js → dropdown-menu-BcNFF_FB.js} +1 -1
- package/dist/client/assets/{empty-state-B5ZXJOuz.js → empty-state-D4qJAGbA.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CAN-85EW.js → extract-connection-data-BqrHdbra.js} +1 -1
- package/dist/client/assets/{file-explorer-37Ixz2H8.js → file-explorer-t9hk2bdP.js} +1 -1
- package/dist/client/assets/{file-type-icon-CpecjgQb.js → file-type-icon-BhN035oL.js} +1 -1
- package/dist/client/assets/{files-7KwaVvpP.js → files-C8O9yA5-.js} +1 -1
- package/dist/client/assets/{form-DGt94nWL.js → form-DsLI-cso.js} +1 -1
- package/dist/client/assets/{general-DpPTR2IV.js → general-D8XS_oON.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DFQ47NAm.js → github-repo-picker-dtivs6I9.js} +1 -1
- package/dist/client/assets/{hooks-CVWEOPPl.js → hooks-BZkcj2r4.js} +1 -1
- package/dist/client/assets/{index-DRHqcbla.js → index-B1051xzt.js} +1 -1
- package/dist/client/assets/{index-CO1L2k6F.js → index-B7JNGFVx.js} +3 -3
- package/dist/client/assets/{index-DH2YDD3V.js → index-BKndjreU.js} +1 -1
- package/dist/client/assets/{index-B9mjAGk9.js → index-BVZ_r-K-.js} +1 -1
- package/dist/client/assets/{index-8tv7d0Ve.js → index-BrBhXbYM.js} +1 -1
- package/dist/client/assets/{index-rTzepySe.js → index-BxU_rwXD.js} +1 -1
- package/dist/client/assets/{index-CiXX-fWm.js → index-CD5Jwhj2.js} +1 -1
- package/dist/client/assets/{index-dIqwxqlw.js → index-CYYm5HCO.js} +1 -1
- package/dist/client/assets/{index-CeaSA5WZ.js → index-CgKTaY8f.js} +1 -1
- package/dist/client/assets/{index-CDfGnUft.js → index-DN4es646.js} +1 -1
- package/dist/client/assets/{index-BiBP_IJ-.js → index-DeTRNkFd.js} +1 -1
- package/dist/client/assets/{index-B-lL4Bof.js → index-PHwNl1XB.js} +7 -7
- package/dist/client/assets/{index-B46tvY2S.js → index-Tg8sdJ1w.js} +1 -1
- package/dist/client/assets/{index-BHFkoj3g.js → index-VqwZFWNF.js} +1 -1
- package/dist/client/assets/{index-redirect-SiI_MmOn.js → index-redirect-BYibEEwr.js} +1 -1
- package/dist/client/assets/{input-COW4go5N.js → input-CHky12sK.js} +1 -1
- package/dist/client/assets/{integration-icon-BnLf1D5y.js → integration-icon-BFZYNQuW.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-D-VduUaY.js → invite-member-dialog-ektjPOuy.js} +1 -1
- package/dist/client/assets/{label-D-dsSZO9.js → label-msw6-gdP.js} +1 -1
- package/dist/client/assets/{login-BBExhs0i.js → login-CHaF3CC3.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BkvwEKNk.js → mcp-oauth-7gmCRD5I.js} +1 -1
- package/dist/client/assets/{members-BsA618Ds.js → members-Bvb6D5QH.js} +1 -1
- package/dist/client/assets/{monaco-editor-RTekDV_G.js → monaco-editor-Zx0Ag8L5.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DXsXFCSg.js → monitoring-stats-row-CJCcXz8y.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C_RrwpQT.js → oauth-callback-ai-provider-CvagoZEl.js} +1 -1
- package/dist/client/assets/{oauth-callback-CqjNzHWn.js → oauth-callback-mA-xzC34.js} +1 -1
- package/dist/client/assets/{onboarding-BWDDHwD0.js → onboarding-BjQanYXn.js} +1 -1
- package/dist/client/assets/{org-install-Bey3pM-s.js → org-install-BEQYqnp_.js} +1 -1
- package/dist/client/assets/{org-layout-CBrTiXLW.js → org-layout-wpb8P17S.js} +1 -1
- package/dist/client/assets/{organization-choice-BcTXS06q.js → organization-choice-Cg_2h-2D.js} +1 -1
- package/dist/client/assets/page-seo-sheet-nHtaw93i.js +1 -0
- package/dist/client/assets/{popover-COxSNUI9.js → popover-Bz_Xru-P.js} +1 -1
- package/dist/client/assets/{post-editor-Dg36btgx.js → post-editor-HL0rlBj2.js} +1 -1
- package/dist/client/assets/{primitives-ySArMO8A.js → primitives-DIBvRULT.js} +1 -1
- package/dist/client/assets/{profile-CHW3d_C3.js → profile-CX7d-Erk.js} +1 -1
- package/dist/client/assets/project-app-view-B7vqrrdE.js +1 -0
- package/dist/client/assets/record-editor-B1ZKaNCA.js +1 -0
- package/dist/client/assets/registry-kBrMyKY-.js +2 -0
- package/dist/client/assets/{registry-layout-DM6iRP4R.js → registry-layout-C4kp6l98.js} +1 -1
- package/dist/client/assets/{require-capability-C0bowvl-.js → require-capability-BWjUaB5B.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CANoL34o.js → required-auth-layout-Cinp25Ct.js} +1 -1
- package/dist/client/assets/{reset-password-Bu-RIMAl.js → reset-password-DZDseYc6.js} +1 -1
- package/dist/client/assets/{roles-CEWWPS9R.js → roles-BUZuQxBh.js} +1 -1
- package/dist/client/assets/{search-input-B51XuoAi.js → search-input-gJuqvZHJ.js} +1 -1
- package/dist/client/assets/{secrets-D3WG23GX.js → secrets-D2SNOS8o.js} +1 -1
- package/dist/client/assets/{sections-editor-BmLUDELp.js → sections-editor-C5Un2D1A.js} +1 -1
- package/dist/client/assets/{select-B1glqaL5.js → select-djrgFxBF.js} +1 -1
- package/dist/client/assets/{select-model-CTRtCpyq.js → select-model-CHyztNvP.js} +1 -1
- package/dist/client/assets/{seo-editor-BiVjKNYD.js → seo-editor-BvsGgsGT.js} +1 -1
- package/dist/client/assets/{seo-save-Di9kBsWL.js → seo-save-CoT8WcVH.js} +1 -1
- package/dist/client/assets/{settings-layout-DWTWQdbp.js → settings-layout-DOzm1d9a.js} +1 -1
- package/dist/client/assets/{settings-section-BJ5Z9sbk.js → settings-section-DamXIdEC.js} +1 -1
- package/dist/client/assets/{shell-controls-C_t0yT4o.js → shell-controls-BZPUCjyN.js} +1 -1
- package/dist/client/assets/{shell-layout-BtQe-dI_.js → shell-layout-DbtPHFXH.js} +1 -1
- package/dist/client/assets/{sidebar-xOgqyAzw.js → sidebar-bjJvb4gf.js} +1 -1
- package/dist/client/assets/{skeleton-Y0aYZIGv.js → skeleton-DL4GzfYu.js} +1 -1
- package/dist/client/assets/{sso-p-GWEiH_.js → sso-BsxfLmwX.js} +1 -1
- package/dist/client/assets/{store-DG4R5TyA.js → store-DjwC4BRa.js} +1 -1
- package/dist/client/assets/store-registry-B2phgpZb.js +2 -0
- package/dist/client/assets/{studio-tools-CkzkLbeK.js → studio-tools-CXs7tmNe.js} +1 -1
- package/dist/client/assets/{switch-BeCDglKS.js → switch-DZFKDGrI.js} +1 -1
- package/dist/client/assets/{table-CK7f3A2A.js → table-CBgjwcYZ.js} +1 -1
- package/dist/client/assets/{tabs-CJJv0rqZ.js → tabs-ZPYmeZvl.js} +1 -1
- package/dist/client/assets/{textarea-BoXzEDCS.js → textarea-CGL1_Au9.js} +1 -1
- package/dist/client/assets/{toggle-group-D8suAen9.js → toggle-group-DnVLPXfF.js} +1 -1
- package/dist/client/assets/{toolbar-L2J1s5cv.js → toolbar-DgjSQqtK.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-D8lNvCwb.js → toolbar-icon-button-vYHpP2V_.js} +1 -1
- package/dist/client/assets/{tools-list-B9fSZWYy.js → tools-list-BoQVqGkv.js} +1 -1
- package/dist/client/assets/{tooltip-B8UTXuYj.js → tooltip-DfM4QSuK.js} +1 -1
- package/dist/client/assets/{types-CI4ZpBJG.js → types-BCdM8Cqh.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CakVoxd1.js → use-ai-providers-ZXXawdWI.js} +1 -1
- package/dist/client/assets/{use-automations-DeM5roCe.js → use-automations-Bihj6PCT.js} +1 -1
- package/dist/client/assets/{use-capability-B9S8HhSs.js → use-capability-BLp--8xF.js} +1 -1
- package/dist/client/assets/{use-clock-tick-JSYy3xwe.js → use-clock-tick-bhMgDN35.js} +1 -1
- package/dist/client/assets/{use-collections-DwtBugWF.js → use-collections-CD3k8D6X.js} +1 -1
- package/dist/client/assets/{use-connection-BDpHVnM9.js → use-connection-DDhhP7Ph.js} +1 -1
- package/dist/client/assets/{use-copy-CVEWQijj.js → use-copy-akuTSKf4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CyHPTRnR.js → use-create-virtual-mcp-_RLJSy4_.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-C-WNNWm4.js → use-debounced-autosave-B1tAicTn.js} +1 -1
- package/dist/client/assets/{use-debounced-value-bUjKN4su.js → use-debounced-value-oPrTFKLx.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-vQdREpgW.js → use-decopilot-events-B15cvyYy.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CHv507Hm.js → use-delete-connection-a61PAN9R.js} +1 -1
- package/dist/client/assets/{use-file-configs-D4DkA1o5.js → use-file-configs-Z7phqTHa.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C76DIcY8.js → use-infinite-scroll-BVH17KKe.js} +1 -1
- package/dist/client/assets/{use-join-requests-D6ap2Uj2.js → use-join-requests-DZL_bSIS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DwetKDRa.js → use-mcp-client-DvbRbjIF.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Dd5bB4_b.js → use-mcp-prompts-CYvAbk37.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BUiL0JOE.js → use-mcp-tools-DFWJ7tBv.js} +1 -1
- package/dist/client/assets/{use-members-BH7s_bbV.js → use-members-BDnKuBZb.js} +1 -1
- package/dist/client/assets/{use-mobile-BK99wTJG.js → use-mobile-KXOF-k75.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C6bEo5XD.js → use-navigate-to-agent-ZdTP31W5.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C_ymtLDP.js → use-org-auth-client-C3nOVxFM.js} +1 -1
- package/dist/client/assets/{use-org-sso-C-2oQsVK.js → use-org-sso-6Kgm_D55.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BlEJ6Gvi.js → use-organization-roles-CsFElDKy.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DDeNqP-7.js → use-organization-settings-D9bn2vMB.js} +1 -1
- package/dist/client/assets/{use-registry-connections-D-CxCgyF.js → use-registry-connections-CxelwF1s.js} +1 -1
- package/dist/client/assets/{use-secrets-Bh4ndTN4.js → use-secrets-P82GL4M9.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BcOUu7LR.js → use-status-sounds-DH9ry82I.js} +1 -1
- package/dist/client/assets/{use-view-mode-SybAG8SK.js → use-view-mode-YB5NATmH.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-KIabF-QC.js → use-virtual-mcp-DSK2scNk.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3mthAoE.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Dgafp0Uz.js +1 -0
- package/dist/client/assets/{variant-calendar-DlZJbhfj.js → variant-calendar-D_GhERcJ.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C3x6LuYl.js → view-mode-toggle-Dm0P_i1M.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/commerce-onboarding-BYoRokdz.js +0 -1
- package/dist/client/assets/page-seo-sheet-C9KcJIyh.js +0 -1
- package/dist/client/assets/project-app-view-DSJYwYNP.js +0 -1
- package/dist/client/assets/record-editor-BKk1cGnm.js +0 -1
- package/dist/client/assets/registry-jF11637A.js +0 -2
- package/dist/client/assets/store-registry-D_uqHVBf.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BauhQX45.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DJ9BuAY-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,j as s,Y as He,r as L,l as E,M as oe,Z as bs,_ as js,a as ae,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-CO1L2k6F.js";import{u as pe,S as ot,a as at,b as ce,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-xOgqyAzw.js";import{u as ct}from"./use-mobile-BK99wTJG.js";import{S as te}from"./skeleton-Y0aYZIGv.js";import{i as Gt}from"./LayoutLeft-LgchNodn.js";import{T as ve}from"./toolbar-icon-button-D8lNvCwb.js";import{P as Ge,a as ze,b as Ue}from"./popover-COxSNUI9.js";import{D as Ut,a as Wt,b as qt}from"./drawer-CzFCT3PH.js";import{A as Le}from"./avatar-B5g154Et.js";import{a as de,b as me,c as et,T as ue}from"./tooltip-B8UTXuYj.js";import{a as gt}from"./Copy01-v70-83R3.js";import{n as Gs,i as Us}from"./Globe01-BJm_6L1K.js";import{i as Ws}from"./ZoomOut-DOMq8Qks.js";import{i as qs,a as Ks}from"./ZapSquare-2TYVPpzw.js";import{i as tt}from"./Monitor01-B7DuF8uL.js";import{n as Xs,a as Vs}from"./Sun-BdOFeDi1.js";import{a as dt}from"./Settings02-C31aohuM.js";import{i as Ys}from"./Shield01-CszvfMrq.js";import{a as Qs}from"./Users03-OwsRMjku.js";import{b as bt,c as jt,d as Js,e as Zs,A as ye,f as vt,i as en,s as tn,g as sn}from"./agent-icon-BxlAfYtU.js";import"./index-BHFkoj3g.js";import{I as nn}from"./invite-member-dialog-D-VduUaY.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-CcfbqOca.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-CsHMUYFP.js";import{i as mn}from"./FilterLines-WY77jC6d.js";import{T as un,a as fn}from"./toggle-group-D8suAen9.js";import{u as hn}from"./use-mcp-client-DwetKDRa.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-KIabF-QC.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-CVWEOPPl.js";import{u as ft,r as vn}from"./shell-layout-BtQe-dI_.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-Doo4cf6x.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-B3cu0Aev.js";import{u as Yt}from"./studio-tools-CkzkLbeK.js";import{i as Qt}from"./Zap-MjamIo9C.js";import{S as Jt,M as $n}from"./shell-controls-C_t0yT4o.js";import{n as Tn}from"./Stars02-KrIAmQsB.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-JSYy3xwe.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-DDh3Hhw_.js";import{i as Fn}from"./ChevronRight-3DlxSDpa.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-C6bEo5XD.js";import{S as Hn,C as Gn}from"./chat-context-DbtHJFUr.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-COfYELC8.js";import{i as es}from"./Check-tfEbDiSO.js";import{s as $e}from"./Plus-C1-9U7xY.js";import{i as ts}from"./SearchMd-DiN4RXkm.js";import{s as qn}from"./XClose-Dha2rZyS.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-9kOsUrrA.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-DGt94nWL.js";import{I as oi}from"./input-COW4go5N.js";import{G as ai,a as ci}from"./github-repo-picker-DFQ47NAm.js";import{f as di}from"./reusable-new-chat-CouMjkYR.js";import{T as Q}from"./toolbar-L2J1s5cv.js";import{u as mi}from"./use-organization-settings-DDeNqP-7.js";import"./X-BSHZ0M6H.js";import"./User01-L5odKA9U.js";import"./AlertCircle-k25R3-Si.js";import"./Tool01-MLrVuoSu.js";import"./SwitchHorizontal01-C6ZclJC7.js";import"./XCircle-Ce3AP-z1.js";import"./ArrowUpRight-goUbSV_t.js";import"./Loading02-EeaKovpr.js";import"./CheckCircle-B-AysnVj.js";import"./ChevronUp-CGRHCTkf.js";import"./Circle-9NU9F6cw.js";import"./DotsVertical-CJNxrPQc.js";import"./Eye-BQAd-UWR.js";import"./Star01-DGbt_SIN.js";import"./Globe04-Bvx5rGM6.js";import"./HardDrive-DqhFpjyW.js";import"./Key01-Ca3H4Guz.js";import"./LinkExternal01-4WLYi2mX.js";import"./List-CP5qu-Ed.js";import"./Palette-BDkRrX1I.js";import"./Play-DSAmPT6o.js";import"./SearchLg-CvEhHQsI.js";import"./Stars01-BKEHGK4f.js";import"./Trash01-DggFSL1b.js";import"./Upload01-Cxs1z0Jh.js";import"./Users01-0hD-3O0B.js";import"./select-B1glqaL5.js";import"./textarea-BoXzEDCS.js";import"./use-org-auth-client-C_ymtLDP.js";import"./use-organization-roles-BlEJ6Gvi.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CDb2GmfN.js";import"./use-registry-connections-D-CxCgyF.js";import"./use-connection-BDpHVnM9.js";import"./use-collections-DwtBugWF.js";import"./useInfiniteQuery-BauhQX45.js";import"./use-infinite-scroll-C76DIcY8.js";import"./extract-connection-data-CAN-85EW.js";import"./card-BhI7Np_f.js";import"./integration-icon-BnLf1D5y.js";import"./collection-search-CwUbH4qH.js";import"./collection-tabs-ClxY84rJ.js";import"./badge-qy7vzuZ8.js";import"./connection-form-helpers-DwHnDZGX.js";import"./authenticate-and-persist-oauth-Z5iZl3NY.js";import"./mcp-oauth-BkvwEKNk.js";import"./auth-DEpjtwun.js";import"./useSuspenseInfiniteQuery-DJ9BuAY-.js";import"./use-ai-providers-CakVoxd1.js";import"./decopilot-sse-pool-Xn1jBQQZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-CANoL34o.js";import"./autosend-hYfyQlKa.js";import"./tab-id-bb-jjgGv.js";import"./use-org-sso-C-2oQsVK.js";import"./index-CiXX-fWm.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-vQdREpgW.js";import"./label-D-dsSZO9.js";import"./use-debounced-value-bUjKN4su.js";import"./use-mcp-tools-BUiL0JOE.js";import"./github-installations-D2vHSx02.js";function ui(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,fi=400,hi="sidebar.width";function Te(t){return Math.max(xt,Math.min(fi,t))}function xi(){const t=$.c(11),[e,n]=He(hi,pi),l=L.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));h?.style.setProperty("--sidebar-width",`${b}px`)},x=p=>{const b=Te(f+(p.clientX-u));n(b);for(const y of g)y.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function pi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ce,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=E(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function gi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(ji),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(bi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){return s.jsx(is,{item:t},t.key)}function vi(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=E("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(yi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function yi(t,e){return s.jsx(gi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(vi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Si(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=E("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==h?(g=s.jsxs(Ls,{className:d,children:[u,h]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=E(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Ni(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function _i(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(L.Suspense,{fallback:a,children:s.jsx(Si,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(h,g)=>s.jsx(Ni,{section:h,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let W;e[0]!==U||e[1]!==l?(W=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=W):W=e[2];const R=n?.name??"User";let Z;e[3]!==R?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:R}),e[3]=R,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let fe;e[7]!==Z||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=fe):fe=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ai)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let he;e[13]!==be?(he=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=he):he=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==he?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[he,je]})}),e[16]=he,e[17]=T):T=e[17];let G;e[18]!==T||e[19]!==W||e[20]!==fe?(G=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,fe,T]}),e[18]=T,e[19]=W,e[20]=fe,e[21]=G):G=e[21];let V;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],V=i.map(le),e[22]=c,e[23]=i,e[24]=V}else V=e[24];let q;e[27]!==c||e[28]!==r?(q=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=q):q=e[29];let ie;e[30]!==V||e[31]!==q?(ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[V,q]})}),e[30]=V,e[31]=q,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:E("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(ki),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=E("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.49.0"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==G||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,ie,Ie]}),e[59]=G,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const h=n?.name??"User";let g;e[66]!==h?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=g):g=e[67];const j=n?.email;let x;e[68]!==j?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=x):x=e[69];let p;e[70]!==g||e[71]!==x?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,x]}),e[70]=g,e[71]=x,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[73]=n,e[74]=b):b=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(gt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==b?(v=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=b,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==v?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[v,w]})}),e[79]=v,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=W=>s.jsx(De,{item:W,onClose:c},W.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=W=>{const{value:R,icon:Z,label:ge}=W;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:R})),className:E("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===R?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},R)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Ci),e[105]=d,e[106]=M):M=e[106];const H=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[107]!==H?(D=E("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=D):D=e[108];let P;e[109]!==o.enableSounds?(P=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=P):P=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==D||e[114]!==P?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:D,children:P}),e[111]=I,e[112]=M,e[113]=D,e[114]=P,e[115]=O):O=e[115];let F;e[116]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.49.0"]}),e[116]=F):F=e[116];let B;e[117]!==O?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[O,F]}),e[117]=O,e[118]=B):B=e[118];let Y;e[119]!==_||e[120]!==B?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,B]}),e[119]=_,e[120]=B,e[121]=Y):Y=e[121];let X;return e[122]!==N||e[123]!==k||e[124]!==Y?(X=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,Y]})}),e[122]=N,e[123]=k,e[124]=Y,e[125]=X):X=e[125],X}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){re.success("User ID copied")}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ai(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=ae.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=L.useState(!1),f=e?.user,h=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(dt,{size:16}),t[2]=x):x=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:x,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(Ys,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,y,v,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:zi},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const H=M;let D;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==h?(D={user:f,userImage:h,menuItems:A,signOutItem:z,themeOptions:H,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=h,t[27]=D):D=t[27];const P=D;let O;return t[28]!==c||t[29]!==m||t[30]!==P||t[31]!==f?.name||t[32]!==h?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...P})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ii,children:s.jsx(_t,{...P})})]})}),t[28]=c,t[29]=m,t[30]=P,t[31]=f?.name,t[32]=h,t[33]=O):O=t[33],O}function Ii(t){return t.preventDefault()}function zi(){oe("signed_out",{source:"account_popover"}),Ns(),ae.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=L.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(tt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(de,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:y,children:[v,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(me,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(ue,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let g;e[30]!==u||e[31]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(me,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let x;e[35]!==g||e[36]!==j?(x=s.jsxs(ue,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=x):x=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==x?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[40]=p,e[41]=x,e[42]=b):b=e[42],b}class $i extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Ti(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Mi(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=E(i!=null&&Ti(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ce,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($i,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Mi,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=L.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ce,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Oi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ce,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ce,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Pi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ce,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=L.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=E("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let g;e[7]!==h?(g=E("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==j?(x=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=x):x=e[14],x}function Di(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Fi,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Fi(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=L.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==d||e[6]!==u?(h=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==h?(g={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=g):g=e[11];const{data:j,isFetching:x}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let y;e[14]!==l?(y=I=>{I||r(""),l(I)},e[14]=l,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==o?(w=I=>{v(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==x||e[24]!==b||e[25]!==u?(A=u?x&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Di,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=x,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==v||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Ei(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",h=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=on(h),e[0]=h,e[1]=g):g=e[1];const j=g;On(6e4);const x=a||!!n.trigger_id,p=n.id,b="button",y=0;let v;e[2]!==i?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=E("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==h?.icon||e[10]!==h?.title?(S=o&&!f&&s.jsx(ye,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let A;e[12]!==x?(A=x&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:E("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ei(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",D=!d&&s.jsx("span",{className:E("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:E(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let P;e[27]!==r?(P=r&&s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:B=>{B.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ws,{size:14})})}),s.jsx(me,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=P):P=e[28];let O;e[29]!==D||e[30]!==P?(O=s.jsxs("div",{className:H,children:[D,P]}),e[29]=D,e[30]=P,e[31]=O):O=e[31];let F;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(F=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=F):F=e[39],F}const zt=["requires_action","in_progress","failed","expired","completed"];function Li(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Ri="sidebar.group.expanded.";function Bi(t,e){const n=$.c(3),[l,i]=He(`${Ri}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=E("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Hi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Gi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Ui(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Ui()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Wi(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Wi(t,e,n,l)}function qi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function Ki(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Xi(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Vi(t,e){Be.set(t,e)}function Yi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Qi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Ji(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Hi(r.id,t,e,n);let o;i[0]!==n?(o=Gi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:h}=ut(),g=Ve(f,t,e,n),j=qi(g,h),x=Xi(g,h),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=x??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&x===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Yi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),H=new Set(f.map(Zi)),D=Qi(_,H,t,e,n),P=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let F;return M!==void 0?F=Tt(P+D,M):F=_.length===0||D===0?!1:I,Vi(S,F),{...O,isFetching:!1,serverHasMore:F}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},v=c.isFetching||c.isProbing,w=!d&&!v&&Ki(j,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Zi(t){return t.id}function el(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:h}=Ji("status",n,d),[g,j]=L.useState(!1);!g&&l.length===0&&h===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(y=v=>s.jsx(rs,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:o&&v.created_by===d.currentUserId?()=>a(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=y):y=e[12],x=l.map(y),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=x}else x=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==x||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=b):b=e[19],b}function tl(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Bi(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const g=h;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let x;e[5]!==m||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=x):x=e[7];let p;e[8]!==u?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==x||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,y,v]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=y,e[22]=v,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(el,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=y=>s.jsx(tl,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},y.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],x=Li(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=x}else x=e[9];let p;return e[16]!==x?(p=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=p):p=e[17],p}let h;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let x;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(x=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=x):x=e[30],h=n.map(x),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function sl(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=E(f),e[4]=f,e[5]=h):h=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(me,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let x;return e[13]!==a||e[14]!==g||e[15]!==j?(x=s.jsxs(ue,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=x):x=e[16],x}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(nl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function nl(t){return s.jsxs(un,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function ms({onNavigate:t}={}){const{data:e}=ae.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),h=xe(),{setTaskId:g,createNewTask:j}=ft(),x=lt({strict:!1}),p=rt({strict:!1}),b=x.taskId??null,y=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,G)=>(G.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=L.useState("all"),[S,A]=L.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=L.useState(!1),[M,H]=L.useState(!1),D={type:C,member:"mine",currentUserId:n??null},P=T=>n?T.filter(G=>G.created_by===n):[],O=T=>C==="automation"?T.filter(G=>!!G.trigger_id):C==="manual"?T.filter(G=>!G.trigger_id):T,F=P(w),B=O(F),Y=O(w),X=k?Y:B,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const G=T.id===b;if(f(T.id),!G)return;const V=sl(X,T.id,n);v(),V?g(V.id,V.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},W=T=>{v(),g(T.id,T.virtual_mcp_id)},R=async T=>{try{const G=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((G.structuredContent??G).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=y??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const G=F.find(V=>V.virtual_mcp_id===T&&V.title==="New chat");if(G&&await R(G.id)){v(),g(G.id,T);return}v(),j(T)},{state:ge,isMobile:ee,toggleSidebar:fe}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),G=new Map((a??[]).map(q=>[q.id,q])),V=q=>(q?G.get(q):void 0)??(q===r?T:void 0);return s.jsxs(ce,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fe,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),X.map(q=>{const ie=V(q.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:q.title||"New chat",isActive:q.id===b,onClick:()=>W(q),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},q.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,he=s.jsxs(Ge,{children:[s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(me,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:E("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Jt,{}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),H(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const il=5,ll=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:il}).map(al)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:ll.map(rl)})]}),t[2]=l):l=t[2],l}function rl(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:E("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(ol)})]},e)}function ol(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function al(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function cl(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function dl(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(_i,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ml=ks({name:As().min(2,"Organization name is required")});function ul(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(ml),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:hl,onSuccess:fl},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==d?(h=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const x=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==x||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:x,children:p}),e[23]=x,e[24]=p,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==j?(y=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=h,e[33]=v):v=e[33];let w;e[34]!==r||e[35]!==v?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function fl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function hl(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ae.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=L.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function xl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=E(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:xl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:E("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function pl({invitation:t,onChanged:e}){const[n,l]=L.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await ae.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await ae.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await ae.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function gl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),h=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let x;e[4]!==m?(x=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=x):x=e[5];let p;e[6]!==m||e[7]!==x?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:x,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=x,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==p||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,y]}),e[12]=p,e[13]=y,e[14]=v):v=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(pl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=h.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=z):z=e[28],z}function bl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let h;e[0]!==n?(h=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(gl,{orgParam:l,onSelectOrg:j,onCreateOrg:x},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vl,onCloseAutoFocus:jl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==b?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[h,b]}),e[13]=c,e[14]=h,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(ul,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let w;return e[19]!==v||e[20]!==y?(w=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=w):w=e[21],w}function jl(t){return t.preventDefault()}function vl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function yl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=E("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=E("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o?(h=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=h):h=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let x;e[14]!==f||e[15]!==h||e[16]!==j?(x=s.jsxs("label",{className:f,children:[h,j]}),e[14]=f,e[15]=h,e[16]=j,e[17]=x):x=e[17];let p;return e[18]!==m||e[19]!==x?(p=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=p):p=e[20],p}const Sl="Select an existing agent";function Nl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(de,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(me,{side:"right",sideOffset:8,children:Sl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(ue,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function _l(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Cl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=L.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=ae.useSession(),f=u?.user?.id??"anon",h=Ln(d),g=Rn(),j=_l(m.slug),x=an(d),p=a.toLowerCase(),b=c.filter(Il).filter(R=>!x.has(R.id)).filter(Al).filter(R=>!a||R.title.toLowerCase().includes(p)),y=b.filter(kl),v=b.filter(wl),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=R=>{if(l){l(R.id),n(),o("");return}Bn({orgId:m.id,userId:f},R.id,h),g(),n(),o(""),j(R.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(yl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),H=v.length>0&&s.jsx(Ft,{children:"Agents"}),D=v.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id)),P=(y.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=y.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id));let F;e[5]!==N||e[6]!==a||e[7]!==b.length?(F=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=F):F=e[8];let B;e[9]!==F||e[10]!==M||e[11]!==H||e[12]!==D||e[13]!==P||e[14]!==O?(B=s.jsxs("div",{className:I,children:[M,H,D,P,O,F]}),e[9]=F,e[10]=M,e[11]=H,e[12]=D,e[13]=P,e[14]=O,e[15]=B):B=e[15];let Y;e[16]!==m.slug?(Y={org:m.slug},e[16]=m.slug,e[17]=Y):Y=e[17];let X;e[18]!==n?(X=()=>n(),e[18]=n,e[19]=X):X=e[19];let U;e[20]!==Y||e[21]!==X?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:Y,onClick:X,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=Y,e[21]=X,e[22]=U):U=e[22];let W;return e[23]!==B||e[24]!==U||e[25]!==_?(W=s.jsxs("div",{className:z,children:[_,B,U]}),e[23]=B,e[24]=U,e[25]=_,e[26]=W):W=e[26],W}function wl(t){return!Kt(t.metadata)}function kl(t){return Kt(t.metadata)}function Al(t){return!gn(t.id)}function Il(t){return!pn(t.id)}function zl(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,h]=L.useState(!1),[g,j]=L.useState(!1),x=ct(),{setOpenMobile:p}=pe(),b=En(),y=b?"border border-border":void 0;let v;e[2]!==b?(v=H=>b?s.jsx(Nl,{children:H}):H,e[2]=b,e[3]=v):v=e[3];const w=v;let C;e[4]!==x||e[5]!==p?(C=()=>{h(!1),x&&p(!1)},e[4]=x,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Cl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==b||e[19]!==x||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=x?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:H=>{H&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),h(H)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:E(y),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=b,e[19]=x,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const $l="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Tl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:$l,children:[f,h]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(zl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let x;return e[16]!==u||e[17]!==j?(x=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=x):x=e[18],x}function Et(){const t=$.c(44),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{data:m}=ae.useSession(),{setTaskId:u,createNewTask:f}=ft(),h=hs().invitations.length>0,g=n==="collapsed"||l;let j;t[2]!==e.id?(j=Re(e.id),t[2]=e.id,t[3]=j):j=t[3];const x=j,p=x.id,b=a.taskId?d.virtualmcpid??p:p;let y;t[4]!==f||t[5]!==p||t[6]!==i||t[7]!==e.slug||t[8]!==m?.user?.id||t[9]!==u||t[10]!==c?(y=F=>{if(!F||F===p){i({to:"/$org",params:{org:e.slug}});return}const B=di(c,F,m?.user?.id);B?u(B.id,F):f(F)},t[4]=f,t[5]=p,t[6]=i,t[7]=e.slug,t[8]=m?.user?.id,t[9]=u,t[10]=c,t[11]=y):y=t[11];const v=y,w=h?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let C;t[12]!==e?(C=s.jsx(pt,{org:e,size:"sm"}),t[12]=e,t[13]=C):C=t[13];let N;t[14]!==h||t[15]!==g?(N=h&&s.jsx("span",{className:E("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",g?"-top-1":"top-1/2 -translate-y-1/2")}),t[14]=h,t[15]=g,t[16]=N):N=t[16];let S;t[17]!==C||t[18]!==N?(S=s.jsxs("span",{className:"relative inline-flex",children:[C,N]}),t[17]=C,t[18]=N,t[19]=S):S=t[19];let A;t[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[20]=A):A=t[20];let k;t[21]!==w||t[22]!==S?(k=s.jsx(de,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":w,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[S,A]})}),t[21]=w,t[22]=S,t[23]=k):k=t[23];let z;t[24]!==e.slug||t[25]!==k?(z=s.jsx(bl,{orgParam:e.slug,trigger:k}),t[24]=e.slug,t[25]=k,t[26]=z):z=t[26];let _;t[27]!==e.name?(_=s.jsx(me,{side:"bottom",children:e.name}),t[27]=e.name,t[28]=_):_=t[28];let I;t[29]!==z||t[30]!==_?(I=s.jsx(St,{children:s.jsxs(ue,{children:[z,_]})}),t[29]=z,t[30]=_,t[31]=I):I=t[31];let M;t[32]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[32]=M):M=t[32];const H=b===p?x:void 0;let D;t[33]!==b||t[34]!==v?(D=()=>v(b),t[33]=b,t[34]=v,t[35]=D):D=t[35];let P;t[36]!==b||t[37]!==v||t[38]!==H||t[39]!==D?(P=s.jsx(St,{children:s.jsx(L.Suspense,{fallback:M,children:s.jsx(Tl,{agentId:b,fallback:H,onOpenHome:D,onPick:v})})}),t[36]=b,t[37]=v,t[38]=H,t[39]=D,t[40]=P):P=t[40];let O;return t[41]!==I||t[42]!==P?(O=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[I,P]})}),t[41]=I,t[42]=P,t[43]=O):O=t[43],O}const Ml="sidebar.open";function Ol(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function Ko(){const t=$.c(27),e=ct(),n=mi(),[l,i]=He(Ml,!1),{width:r,wrapperRef:a,onStartResize:o,resetWidth:d}=xi();let c;t[0]!==e||t[1]!==n?(c=e?s.jsxs(Q.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[!n&&s.jsx(Jt,{}),!n&&s.jsx(Et,{}),!n&&s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),!n&&s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),!n&&s.jsx(Q.CenterSlot,{}),!n&&s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[!n&&s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),n?s.jsx("div",{"aria-hidden":!0}):s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightColumn,{children:!n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})})]}),t[0]=e,t[1]=n,t[2]=c):c=t[2];const m=`${r}px`;let u;t[3]!==m?(u={"--sidebar-width":m,"--sidebar-width-icon":"3.5rem"},t[3]=m,t[4]=u):u=t[4];const f=u;let h;t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==d?(h=!e&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(cl,{}),s.jsx(ui,{onPointerDown:o,onDoubleClick:d})]}),t[5]=e,t[6]=o,t[7]=n,t[8]=d,t[9]=h):h=t[9];let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[10]=g):g=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rs,{className:"flex flex-col",style:g,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(L.Suspense,{fallback:s.jsx(Ol,{}),children:s.jsx(Ds,{})})})})}),t[11]=j):j=t[11];let x;t[12]!==f||t[13]!==h||t[14]!==a?(x=s.jsxs(Bs,{ref:a,className:"flex-1 bg-sidebar relative min-h-0",style:f,children:[h,j]}),t[12]=f,t[13]=h,t[14]=a,t[15]=x):x=t[15];let p;t[16]!==e||t[17]!==n?(p=e&&!n&&s.jsx($n,{renderSidebar:Pl}),t[16]=e,t[17]=n,t[18]=p):p=t[18];let b;t[19]!==c||t[20]!==x||t[21]!==p?(b=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,p]})}),t[19]=c,t[20]=x,t[21]=p,t[22]=b):b=t[22];let y;return t[23]!==i||t[24]!==l||t[25]!==b?(y=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:l,onOpenChange:i,children:b})})}),t[23]=i,t[24]=l,t[25]=b,t[26]=y):y=t[26],y}function Pl(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(dl,{onClose:e})})})}export{Ko as default};
|
|
1
|
+
import{c as $,j as s,Y as He,r as L,l as E,M as oe,Z as bs,_ as js,a as ae,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-B7JNGFVx.js";import{u as pe,S as ot,a as at,b as ce,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-bjJvb4gf.js";import{u as ct}from"./use-mobile-KXOF-k75.js";import{S as te}from"./skeleton-DL4GzfYu.js";import{i as Gt}from"./LayoutLeft-lNBuuI5W.js";import{T as ve}from"./toolbar-icon-button-vYHpP2V_.js";import{P as Ge,a as ze,b as Ue}from"./popover-Bz_Xru-P.js";import{D as Ut,a as Wt,b as qt}from"./drawer-DS0hJ2mS.js";import{A as Le}from"./avatar-DuOsWYcG.js";import{a as de,b as me,c as et,T as ue}from"./tooltip-DfM4QSuK.js";import{a as gt}from"./Copy01-CuE5Mdxv.js";import{n as Gs,i as Us}from"./Globe01-DBXbzkud.js";import{i as Ws}from"./ZoomOut-DAzAklM3.js";import{i as qs,a as Ks}from"./ZapSquare-CO43pmjR.js";import{i as tt}from"./Monitor01-BxJdzfiN.js";import{n as Xs,a as Vs}from"./Sun-C9p5qQM_.js";import{a as dt}from"./Settings02-B3B_P5fs.js";import{i as Ys}from"./Shield01-BGz5Kh9w.js";import{a as Qs}from"./Users03-7hIYOoO1.js";import{b as bt,c as jt,d as Js,e as Zs,A as ye,f as vt,i as en,s as tn,g as sn}from"./agent-icon-D9GYV26D.js";import"./index-VqwZFWNF.js";import{I as nn}from"./invite-member-dialog-ektjPOuy.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-DiwM8z_R.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-epPbnUVm.js";import{i as mn}from"./FilterLines-DXM-OYLy.js";import{T as un,a as fn}from"./toggle-group-DnVLPXfF.js";import{u as hn}from"./use-mcp-client-DvbRbjIF.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-DSK2scNk.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-BZkcj2r4.js";import{u as ft,r as vn}from"./shell-layout-DbtPHFXH.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-GMipq3bN.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-DQcISPQW.js";import{u as Yt}from"./studio-tools-CXs7tmNe.js";import{i as Qt}from"./Zap-kwvB2Aey.js";import{S as Jt,M as $n}from"./shell-controls-BZPUCjyN.js";import{n as Tn}from"./Stars02-DEytbopx.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-bhMgDN35.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-DDQcR6fD.js";import{i as Fn}from"./ChevronRight-ZwqhPdyq.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-ZdTP31W5.js";import{S as Hn,C as Gn}from"./chat-context-DwqbCivU.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-voNACu1V.js";import{i as es}from"./Check-CAm_pNZb.js";import{s as $e}from"./Plus-OhB-LRM_.js";import{i as ts}from"./SearchMd-OFgwXHVA.js";import{s as qn}from"./XClose-B4Kds20_.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-C-4lAz2-.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-DsLI-cso.js";import{I as oi}from"./input-CHky12sK.js";import{G as ai,a as ci}from"./github-repo-picker-dtivs6I9.js";import{f as di}from"./reusable-new-chat-CouMjkYR.js";import{T as Q}from"./toolbar-DgjSQqtK.js";import{u as mi}from"./use-organization-settings-D9bn2vMB.js";import"./X-CWu4KAgv.js";import"./User01-DICqHJXD.js";import"./AlertCircle-B9onYPsx.js";import"./Tool01-De44pARs.js";import"./SwitchHorizontal01-X4Ivgb48.js";import"./XCircle-BnMyXX6H.js";import"./ArrowUpRight-31bYFmB1.js";import"./Loading02-BKjix3t4.js";import"./CheckCircle-LZxCN5IY.js";import"./ChevronUp-CFaryGNc.js";import"./Circle-Cb2xDFmW.js";import"./DotsVertical-8bp0B0ya.js";import"./Eye-DkQOgqLy.js";import"./Star01-CKALy4hI.js";import"./Globe04-D3KvtDDx.js";import"./HardDrive-C-0ZSA5F.js";import"./Key01-Dd9wKRX6.js";import"./LinkExternal01-D_Rlg4XY.js";import"./List-5gTuVFju.js";import"./Palette-DHuaqxQW.js";import"./Play-siKyKpye.js";import"./SearchLg-Cw1vzWS4.js";import"./Stars01-CVOa90uJ.js";import"./Trash01-CldWiayK.js";import"./Upload01-BdN7-z6J.js";import"./Users01-BbT3orCr.js";import"./select-djrgFxBF.js";import"./textarea-CGL1_Au9.js";import"./use-org-auth-client-C3nOVxFM.js";import"./use-organization-roles-CsFElDKy.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BKI86wdV.js";import"./use-registry-connections-CxelwF1s.js";import"./use-connection-DDhhP7Ph.js";import"./use-collections-CD3k8D6X.js";import"./useInfiniteQuery-B3mthAoE.js";import"./use-infinite-scroll-BVH17KKe.js";import"./extract-connection-data-BqrHdbra.js";import"./card-kXMv7TY0.js";import"./integration-icon-BFZYNQuW.js";import"./collection-search-BPxsVhJJ.js";import"./collection-tabs-B9fzylNI.js";import"./badge-CzvDyOP_.js";import"./connection-form-helpers-BwLjgtsz.js";import"./authenticate-and-persist-oauth-DDtpfxrP.js";import"./mcp-oauth-7gmCRD5I.js";import"./auth-5F6-aJmo.js";import"./useSuspenseInfiniteQuery-Dgafp0Uz.js";import"./use-ai-providers-ZXXawdWI.js";import"./decopilot-sse-pool-OlccTr4u.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-Cinp25Ct.js";import"./autosend-Ho-hw6LZ.js";import"./tab-id-bb-jjgGv.js";import"./use-org-sso-6Kgm_D55.js";import"./index-CD5Jwhj2.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-B15cvyYy.js";import"./label-msw6-gdP.js";import"./use-debounced-value-oPrTFKLx.js";import"./use-mcp-tools-DFWJ7tBv.js";import"./github-installations-D2vHSx02.js";function ui(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,fi=400,hi="sidebar.width";function Te(t){return Math.max(xt,Math.min(fi,t))}function xi(){const t=$.c(11),[e,n]=He(hi,pi),l=L.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));h?.style.setProperty("--sidebar-width",`${b}px`)},x=p=>{const b=Te(f+(p.clientX-u));n(b);for(const y of g)y.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function pi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ce,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=E(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function gi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(ji),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(bi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){return s.jsx(is,{item:t},t.key)}function vi(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=E("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(yi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function yi(t,e){return s.jsx(gi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(vi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Si(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=E("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Gt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==h?(g=s.jsxs(Ls,{className:d,children:[u,h]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=E(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Ni(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function _i(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(L.Suspense,{fallback:a,children:s.jsx(Si,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(h,g)=>s.jsx(Ni,{section:h,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let W;e[0]!==U||e[1]!==l?(W=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=W):W=e[2];const R=n?.name??"User";let Z;e[3]!==R?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:R}),e[3]=R,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let fe;e[7]!==Z||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=fe):fe=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ai)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let he;e[13]!==be?(he=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=he):he=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==he?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[he,je]})}),e[16]=he,e[17]=T):T=e[17];let G;e[18]!==T||e[19]!==W||e[20]!==fe?(G=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,fe,T]}),e[18]=T,e[19]=W,e[20]=fe,e[21]=G):G=e[21];let V;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],V=i.map(le),e[22]=c,e[23]=i,e[24]=V}else V=e[24];let q;e[27]!==c||e[28]!==r?(q=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=q):q=e[29];let ie;e[30]!==V||e[31]!==q?(ie=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[V,q]})}),e[30]=V,e[31]=q,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:E("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(ki),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=E("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.49.2"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==G||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,ie,Ie]}),e[59]=G,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const h=n?.name??"User";let g;e[66]!==h?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=g):g=e[67];const j=n?.email;let x;e[68]!==j?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=x):x=e[69];let p;e[70]!==g||e[71]!==x?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,x]}),e[70]=g,e[71]=x,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[73]=n,e[74]=b):b=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(gt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==b?(v=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=b,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==v?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[v,w]})}),e[79]=v,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=W=>s.jsx(De,{item:W,onClose:c},W.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=W=>{const{value:R,icon:Z,label:ge}=W;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:R})),className:E("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===R?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},R)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Ci),e[105]=d,e[106]=M):M=e[106];const H=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[107]!==H?(D=E("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=D):D=e[108];let P;e[109]!==o.enableSounds?(P=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=P):P=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==D||e[114]!==P?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:D,children:P}),e[111]=I,e[112]=M,e[113]=D,e[114]=P,e[115]=O):O=e[115];let F;e[116]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.49.2"]}),e[116]=F):F=e[116];let B;e[117]!==O?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[O,F]}),e[117]=O,e[118]=B):B=e[118];let Y;e[119]!==_||e[120]!==B?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,B]}),e[119]=_,e[120]=B,e[121]=Y):Y=e[121];let X;return e[122]!==N||e[123]!==k||e[124]!==Y?(X=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,Y]})}),e[122]=N,e[123]=k,e[124]=Y,e[125]=X):X=e[125],X}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){re.success("User ID copied")}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ai(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=ae.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=L.useState(!1),f=e?.user,h=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(dt,{size:16}),t[2]=x):x=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:x,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(Ys,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,y,v,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:zi},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const H=M;let D;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==h?(D={user:f,userImage:h,menuItems:A,signOutItem:z,themeOptions:H,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=h,t[27]=D):D=t[27];const P=D;let O;return t[28]!==c||t[29]!==m||t[30]!==P||t[31]!==f?.name||t[32]!==h?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...P})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ii,children:s.jsx(_t,{...P})})]})}),t[28]=c,t[29]=m,t[30]=P,t[31]=f?.name,t[32]=h,t[33]=O):O=t[33],O}function Ii(t){return t.preventDefault()}function zi(){oe("signed_out",{source:"account_popover"}),Ns(),ae.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=L.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(tt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(de,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:y,children:[v,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(me,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(ue,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let g;e[30]!==u||e[31]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(me,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let x;e[35]!==g||e[36]!==j?(x=s.jsxs(ue,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=x):x=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==x?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[40]=p,e[41]=x,e[42]=b):b=e[42],b}class $i extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Ti(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Mi(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=E(i!=null&&Ti(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ce,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($i,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Mi,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=L.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ce,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Oi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ce,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ce,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Pi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ce,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=L.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=E("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let g;e[7]!==h?(g=E("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==j?(x=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=x):x=e[14],x}function Di(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Fi,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Fi(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=L.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let h;e[5]!==d||e[6]!==u?(h=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==h?(g={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=g):g=e[11];const{data:j,isFetching:x}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let y;e[14]!==l?(y=I=>{I||r(""),l(I)},e[14]=l,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==o?(w=I=>{v(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==x||e[24]!==b||e[25]!==u?(A=u?x&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Di,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=x,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==v||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Ei(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",h=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=on(h),e[0]=h,e[1]=g):g=e[1];const j=g;On(6e4);const x=a||!!n.trigger_id,p=n.id,b="button",y=0;let v;e[2]!==i?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=E("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==h?.icon||e[10]!==h?.title?(S=o&&!f&&s.jsx(ye,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let A;e[12]!==x?(A=x&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:E("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ei(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",D=!d&&s.jsx("span",{className:E("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:E(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let P;e[27]!==r?(P=r&&s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:B=>{B.stopPropagation(),r()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ws,{size:14})})}),s.jsx(me,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=P):P=e[28];let O;e[29]!==D||e[30]!==P?(O=s.jsxs("div",{className:H,children:[D,P]}),e[29]=D,e[30]=P,e[31]=O):O=e[31];let F;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(F=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=F):F=e[39],F}const zt=["requires_action","in_progress","failed","expired","completed"];function Li(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Ri="sidebar.group.expanded.";function Bi(t,e){const n=$.c(3),[l,i]=He(`${Ri}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=E("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Hi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Gi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Ui(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Ui()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Wi(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Wi(t,e,n,l)}function qi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function Ki(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Xi(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Vi(t,e){Be.set(t,e)}function Yi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Qi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Ji(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Hi(r.id,t,e,n);let o;i[0]!==n?(o=Gi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:h}=ut(),g=Ve(f,t,e,n),j=qi(g,h),x=Xi(g,h),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=x??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&x===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Yi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),H=new Set(f.map(Zi)),D=Qi(_,H,t,e,n),P=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let F;return M!==void 0?F=Tt(P+D,M):F=_.length===0||D===0?!1:I,Vi(S,F),{...O,isFetching:!1,serverHasMore:F}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},v=c.isFetching||c.isProbing,w=!d&&!v&&Ki(j,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Zi(t){return t.id}function el(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:h}=Ji("status",n,d),[g,j]=L.useState(!1);!g&&l.length===0&&h===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(y=v=>s.jsx(rs,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:o&&v.created_by===d.currentUserId?()=>a(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=y):y=e[12],x=l.map(y),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=x}else x=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==x||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=b):b=e[19],b}function tl(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Bi(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const g=h;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let x;e[5]!==m||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=x):x=e[7];let p;e[8]!==u?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==x||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,y,v]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=y,e[22]=v,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(el,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=y=>s.jsx(tl,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},y.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],x=Li(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=x}else x=e[9];let p;return e[16]!==x?(p=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=p):p=e[17],p}let h;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let x;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(x=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=x):x=e[30],h=n.map(x),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function sl(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=E(f),e[4]=f,e[5]=h):h=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(me,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let x;return e[13]!==a||e[14]!==g||e[15]!==j?(x=s.jsxs(ue,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=x):x=e[16],x}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(nl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function nl(t){return s.jsxs(un,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function ms({onNavigate:t}={}){const{data:e}=ae.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),h=xe(),{setTaskId:g,createNewTask:j}=ft(),x=lt({strict:!1}),p=rt({strict:!1}),b=x.taskId??null,y=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,G)=>(G.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=L.useState("all"),[S,A]=L.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=L.useState(!1),[M,H]=L.useState(!1),D={type:C,member:"mine",currentUserId:n??null},P=T=>n?T.filter(G=>G.created_by===n):[],O=T=>C==="automation"?T.filter(G=>!!G.trigger_id):C==="manual"?T.filter(G=>!G.trigger_id):T,F=P(w),B=O(F),Y=O(w),X=k?Y:B,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const G=T.id===b;if(f(T.id),!G)return;const V=sl(X,T.id,n);v(),V?g(V.id,V.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},W=T=>{v(),g(T.id,T.virtual_mcp_id)},R=async T=>{try{const G=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((G.structuredContent??G).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=y??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const G=F.find(V=>V.virtual_mcp_id===T&&V.title==="New chat");if(G&&await R(G.id)){v(),g(G.id,T);return}v(),j(T)},{state:ge,isMobile:ee,toggleSidebar:fe}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),G=new Map((a??[]).map(q=>[q.id,q])),V=q=>(q?G.get(q):void 0)??(q===r?T:void 0);return s.jsxs(ce,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fe,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),X.map(q=>{const ie=V(q.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:q.title||"New chat",isActive:q.id===b,onClick:()=>W(q),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},q.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,he=s.jsxs(Ge,{children:[s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(me,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:E("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(Jt,{}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),H(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const il=5,ll=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:il}).map(al)}),t[0]=i):i=t[0],i}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:ll.map(rl)})]}),t[2]=l):l=t[2],l}function rl(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:E("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(ol)})]},e)}function ol(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function al(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function cl(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function dl(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(_i,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ml=ks({name:As().min(2,"Organization name is required")});function ul(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(ml),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:hl,onSuccess:fl},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==d?(h=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const x=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==x||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:x,children:p}),e[23]=x,e[24]=p,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==j?(y=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=h,e[33]=v):v=e[33];let w;e[34]!==r||e[35]!==v?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function fl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function hl(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ae.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=L.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function xl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=E(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:xl(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:E("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function pl({invitation:t,onChanged:e}){const[n,l]=L.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await ae.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await ae.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await ae.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function gl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),h=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let x;e[4]!==m?(x=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=x):x=e[5];let p;e[6]!==m||e[7]!==x?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:x,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=x,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==p||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,y]}),e[12]=p,e[13]=y,e[14]=v):v=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(pl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=h.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=z):z=e[28],z}function bl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let h;e[0]!==n?(h=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(gl,{orgParam:l,onSelectOrg:j,onCreateOrg:x},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vl,onCloseAutoFocus:jl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==b?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[h,b]}),e[13]=c,e[14]=h,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(ul,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let w;return e[19]!==v||e[20]!==y?(w=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=w):w=e[21],w}function jl(t){return t.preventDefault()}function vl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function yl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=E("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=E("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o?(h=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=h):h=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let x;e[14]!==f||e[15]!==h||e[16]!==j?(x=s.jsxs("label",{className:f,children:[h,j]}),e[14]=f,e[15]=h,e[16]=j,e[17]=x):x=e[17];let p;return e[18]!==m||e[19]!==x?(p=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=p):p=e[20],p}const Sl="Select an existing agent";function Nl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(de,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(me,{side:"right",sideOffset:8,children:Sl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(ue,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function _l(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Cl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=L.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=ae.useSession(),f=u?.user?.id??"anon",h=Ln(d),g=Rn(),j=_l(m.slug),x=an(d),p=a.toLowerCase(),b=c.filter(Il).filter(R=>!x.has(R.id)).filter(Al).filter(R=>!a||R.title.toLowerCase().includes(p)),y=b.filter(kl),v=b.filter(wl),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=R=>{if(l){l(R.id),n(),o("");return}Bn({orgId:m.id,userId:f},R.id,h),g(),n(),o(""),j(R.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(yl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),H=v.length>0&&s.jsx(Ft,{children:"Agents"}),D=v.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id)),P=(y.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=y.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id));let F;e[5]!==N||e[6]!==a||e[7]!==b.length?(F=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=F):F=e[8];let B;e[9]!==F||e[10]!==M||e[11]!==H||e[12]!==D||e[13]!==P||e[14]!==O?(B=s.jsxs("div",{className:I,children:[M,H,D,P,O,F]}),e[9]=F,e[10]=M,e[11]=H,e[12]=D,e[13]=P,e[14]=O,e[15]=B):B=e[15];let Y;e[16]!==m.slug?(Y={org:m.slug},e[16]=m.slug,e[17]=Y):Y=e[17];let X;e[18]!==n?(X=()=>n(),e[18]=n,e[19]=X):X=e[19];let U;e[20]!==Y||e[21]!==X?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:Y,onClick:X,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=Y,e[21]=X,e[22]=U):U=e[22];let W;return e[23]!==B||e[24]!==U||e[25]!==_?(W=s.jsxs("div",{className:z,children:[_,B,U]}),e[23]=B,e[24]=U,e[25]=_,e[26]=W):W=e[26],W}function wl(t){return!Kt(t.metadata)}function kl(t){return Kt(t.metadata)}function Al(t){return!gn(t.id)}function Il(t){return!pn(t.id)}function zl(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,h]=L.useState(!1),[g,j]=L.useState(!1),x=ct(),{setOpenMobile:p}=pe(),b=En(),y=b?"border border-border":void 0;let v;e[2]!==b?(v=H=>b?s.jsx(Nl,{children:H}):H,e[2]=b,e[3]=v):v=e[3];const w=v;let C;e[4]!==x||e[5]!==p?(C=()=>{h(!1),x&&p(!1)},e[4]=x,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Cl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==b||e[19]!==x||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=x?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:H=>{H&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),h(H)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:E(y),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=b,e[19]=x,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const $l="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Tl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:$l,children:[f,h]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(zl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let x;return e[16]!==u||e[17]!==j?(x=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=x):x=e[18],x}function Et(){const t=$.c(44),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{data:m}=ae.useSession(),{setTaskId:u,createNewTask:f}=ft(),h=hs().invitations.length>0,g=n==="collapsed"||l;let j;t[2]!==e.id?(j=Re(e.id),t[2]=e.id,t[3]=j):j=t[3];const x=j,p=x.id,b=a.taskId?d.virtualmcpid??p:p;let y;t[4]!==f||t[5]!==p||t[6]!==i||t[7]!==e.slug||t[8]!==m?.user?.id||t[9]!==u||t[10]!==c?(y=F=>{if(!F||F===p){i({to:"/$org",params:{org:e.slug}});return}const B=di(c,F,m?.user?.id);B?u(B.id,F):f(F)},t[4]=f,t[5]=p,t[6]=i,t[7]=e.slug,t[8]=m?.user?.id,t[9]=u,t[10]=c,t[11]=y):y=t[11];const v=y,w=h?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let C;t[12]!==e?(C=s.jsx(pt,{org:e,size:"sm"}),t[12]=e,t[13]=C):C=t[13];let N;t[14]!==h||t[15]!==g?(N=h&&s.jsx("span",{className:E("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",g?"-top-1":"top-1/2 -translate-y-1/2")}),t[14]=h,t[15]=g,t[16]=N):N=t[16];let S;t[17]!==C||t[18]!==N?(S=s.jsxs("span",{className:"relative inline-flex",children:[C,N]}),t[17]=C,t[18]=N,t[19]=S):S=t[19];let A;t[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[20]=A):A=t[20];let k;t[21]!==w||t[22]!==S?(k=s.jsx(de,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":w,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[S,A]})}),t[21]=w,t[22]=S,t[23]=k):k=t[23];let z;t[24]!==e.slug||t[25]!==k?(z=s.jsx(bl,{orgParam:e.slug,trigger:k}),t[24]=e.slug,t[25]=k,t[26]=z):z=t[26];let _;t[27]!==e.name?(_=s.jsx(me,{side:"bottom",children:e.name}),t[27]=e.name,t[28]=_):_=t[28];let I;t[29]!==z||t[30]!==_?(I=s.jsx(St,{children:s.jsxs(ue,{children:[z,_]})}),t[29]=z,t[30]=_,t[31]=I):I=t[31];let M;t[32]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[32]=M):M=t[32];const H=b===p?x:void 0;let D;t[33]!==b||t[34]!==v?(D=()=>v(b),t[33]=b,t[34]=v,t[35]=D):D=t[35];let P;t[36]!==b||t[37]!==v||t[38]!==H||t[39]!==D?(P=s.jsx(St,{children:s.jsx(L.Suspense,{fallback:M,children:s.jsx(Tl,{agentId:b,fallback:H,onOpenHome:D,onPick:v})})}),t[36]=b,t[37]=v,t[38]=H,t[39]=D,t[40]=P):P=t[40];let O;return t[41]!==I||t[42]!==P?(O=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[I,P]})}),t[41]=I,t[42]=P,t[43]=O):O=t[43],O}const Ml="sidebar.open";function Ol(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function Ko(){const t=$.c(27),e=ct(),n=mi(),[l,i]=He(Ml,!1),{width:r,wrapperRef:a,onStartResize:o,resetWidth:d}=xi();let c;t[0]!==e||t[1]!==n?(c=e?s.jsxs(Q.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[!n&&s.jsx(Jt,{}),!n&&s.jsx(Et,{}),!n&&s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),!n&&s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),!n&&s.jsx(Q.CenterSlot,{}),!n&&s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[!n&&s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),n?s.jsx("div",{"aria-hidden":!0}):s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightColumn,{children:!n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})})]}),t[0]=e,t[1]=n,t[2]=c):c=t[2];const m=`${r}px`;let u;t[3]!==m?(u={"--sidebar-width":m,"--sidebar-width-icon":"3.5rem"},t[3]=m,t[4]=u):u=t[4];const f=u;let h;t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==d?(h=!e&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(cl,{}),s.jsx(ui,{onPointerDown:o,onDoubleClick:d})]}),t[5]=e,t[6]=o,t[7]=n,t[8]=d,t[9]=h):h=t[9];let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[10]=g):g=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rs,{className:"flex flex-col",style:g,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(L.Suspense,{fallback:s.jsx(Ol,{}),children:s.jsx(Ds,{})})})})}),t[11]=j):j=t[11];let x;t[12]!==f||t[13]!==h||t[14]!==a?(x=s.jsxs(Bs,{ref:a,className:"flex-1 bg-sidebar relative min-h-0",style:f,children:[h,j]}),t[12]=f,t[13]=h,t[14]=a,t[15]=x):x=t[15];let p;t[16]!==e||t[17]!==n?(p=e&&!n&&s.jsx($n,{renderSidebar:Pl}),t[16]=e,t[17]=n,t[18]=p):p=t[18];let b;t[19]!==c||t[20]!==x||t[21]!==p?(b=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,p]})}),t[19]=c,t[20]=x,t[21]=p,t[22]=b):b=t[22];let y;return t[23]!==i||t[24]!==l||t[25]!==b?(y=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:l,onOpenChange:i,children:b})})}),t[23]=i,t[24]=l,t[25]=b,t[26]=y):y=t[26],y}function Pl(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(dl,{onClose:e})})})}export{Ko as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h}from"./index-
|
|
1
|
+
import{r as h}from"./index-B7JNGFVx.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,e as p,j as s,i as u,N as a}from"./index-
|
|
1
|
+
import{c as g,e as p,j as s,i as u,N as a}from"./index-B7JNGFVx.js";import{a as x}from"./use-capability-BLp--8xF.js";import{C as j}from"./capability-load-error-z2KG7Z7c.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,l as a,j as d}from"./index-
|
|
1
|
+
import{c as s,l as a,j as d}from"./index-B7JNGFVx.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as h,r as C,l as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,l as L}from"./index-B7JNGFVx.js";import{n as Z}from"./XCircle-BnMyXX6H.js";import{A as y}from"./agent-icon-D9GYV26D.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
package/dist/client/assets/{invite-member-dialog-D-VduUaY.js → invite-member-dialog-ektjPOuy.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{H as M,r as N,$ as R,p as L,a as V,J as B,d as K,M as p,t as c,K as j,j as s,B as C}from"./index-
|
|
1
|
+
import{H as M,r as N,$ as R,p as L,a as V,J as B,d as K,M as p,t as c,K as j,j as s,B as C}from"./index-B7JNGFVx.js";import{e as O,i as q,d as z,c as Q,a as k,D as H}from"./dialog-GMipq3bN.js";import{a as J,F as b,b as v,c as U,d as w,e as S}from"./form-DsLI-cso.js";import{a as Y,c as G,d as W,S as X,b as Z}from"./select-djrgFxBF.js";import{T as _}from"./textarea-CGL1_Au9.js";import{u as ee}from"./use-org-auth-client-C3nOVxFM.js";import{u as se}from"./use-organization-roles-CsFElDKy.js";const te=M().email("Invalid email address");function ne(r){if(!r.trim())return[];const m=r.split(/[,;\n]/).map(a=>a.trim().toLowerCase()).filter(a=>a.length>0);return Array.from(new Set(m))}function de({trigger:r}){const[m,a]=N.useState(!1),{locator:g}=R(),E=ee(),x=L(),{data:F}=V.useSession(),f=F?.user?.email,{roles:P,isLoading:y}=se(),T=P.filter(t=>t.role!=="owner"),i=B({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),$=i.watch("emailsText"),A=i.watch("role"),l=ne($).filter(t=>{const e=te.safeParse(t).success,n=!f||t!==f.toLowerCase();return e&&n}),o=K({mutationFn:async({emails:t,role:e})=>{if(!e)throw new Error("Please select a role");const n=await Promise.allSettled(t.map(async d=>{const h=await E.organization.inviteMember({email:d,role:e});if(h.error)throw new Error(h.error.message);return h.data})),u=n.filter(d=>d.status==="rejected");if(u.length>0)throw new Error(`Failed to invite ${u.length} member${u.length>1?"s":""}`);return n},onSuccess:(t,{emails:e,role:n})=>{p("member_invited",{count:e.length,role:n}),x.invalidateQueries({queryKey:j.members(g)}),x.invalidateQueries({queryKey:j.invitations(g)}),c.success(e.length===1?"Member invited successfully!":`${e.length} members invited successfully!`),i.reset({emailsText:"",role:"user"}),a(!1)},onError:(t,{emails:e,role:n})=>{p("member_invite_failed",{count:e.length,role:n,error:t instanceof Error?t.message:String(t)}),c.error(t instanceof Error?t.message:"Failed to invite members")}}),D=t=>{if(l.length===0){c.error("Please enter at least one valid email address");return}if(!t.role){c.error("Please select a role");return}o.mutate({emails:l,role:t.role})},I=l.length>0&&!!A;return s.jsxs(O,{open:m,onOpenChange:a,children:[s.jsx(q,{asChild:!0,children:r}),s.jsxs(z,{className:"sm:max-w-lg",children:[s.jsx(Q,{children:s.jsx(k,{children:"Invite members"})}),s.jsx(J,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(D),className:"space-y-4",children:[s.jsx(b,{control:i.control,name:"emailsText",render:({field:t})=>s.jsxs(v,{children:[s.jsx(U,{children:"Email addresses"}),s.jsx(w,{children:s.jsx(_,{...t,disabled:o.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
2
|
e.g. user1@example.com, user2@example.com
|
|
3
3
|
or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(S,{})]})}),s.jsx(b,{control:i.control,name:"role",render:({field:t})=>s.jsxs(v,{children:[s.jsx(w,{children:s.jsxs(Y,{value:t.value,onValueChange:t.onChange,disabled:o.isPending||y,children:[s.jsx(G,{className:"w-full",children:s.jsx(W,{placeholder:"Select a role"})}),s.jsx(X,{children:T.map(e=>{const n=[];return e.isBuiltin||(e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),(e.connectionCount!==0||e.allowsAllConnections)&&(e.allowsAllTools?n.push("all tools"):e.toolCount&&e.toolCount>0&&n.push(`${e.toolCount} tool${e.toolCount!==1?"s":""}`))),s.jsx(Z,{value:e.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:e.label}),!e.isBuiltin&&n.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:n.join(", ")})]})},e.role)})})]})}),s.jsx(S,{})]})}),s.jsxs(H,{children:[s.jsx(C,{variant:"outline",onClick:()=>{i.reset({emailsText:"",role:"user"}),a(!1)},type:"button",disabled:o.isPending,children:"Cancel"}),s.jsx(C,{type:"submit",disabled:o.isPending||!I,children:o.isPending?"Inviting...":`Invite ${l.length||0} Member${l.length!==1?"s":""}`})]})]})})]})]})}export{de as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as r,j as i,bC as p}from"./index-
|
|
1
|
+
import{c as n,l as r,j as i,bC as p}from"./index-B7JNGFVx.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,u as f,j as o,S as g,N as p}from"./index-
|
|
1
|
+
import{a,u as f,j as o,S as g,N as p}from"./index-B7JNGFVx.js";import{A as x}from"./auth-entry-BOu9WfTk.js";import{A as S}from"./auth-split-layout-B2X42J2r.js";import"./input-CHky12sK.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function L(){const e=a.useSession(),t=f({from:"/login"}),{next:i="/",client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_}=t,n=i.startsWith("/")&&!i.startsWith("//")?i:"/",c=y({client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_});return e.data?c?(window.location.href=c,o.jsx(g,{})):o.jsx(p,{to:n}):o.jsx(S,{children:o.jsx(x,{callbackUrl:n,redirectUrl:c})})}export{L as default};
|