decocms 4.99.2 → 4.99.4
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-hYag6BbI.js → AlertCircle-C7MslaLR.js} +1 -1
- package/dist/client/assets/{AreaChart-dF42II9e.js → AreaChart-BTuJ9KfA.js} +1 -1
- package/dist/client/assets/{ArrowRight-n-TBn01e.js → ArrowRight-BcxHvBZl.js} +1 -1
- package/dist/client/assets/{ArrowUp-CV_nwp67.js → ArrowUp-Dx5p-RmC.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CUu0poE7.js → ArrowUpRight-DZ3-lzXp.js} +1 -1
- package/dist/client/assets/{Check-BqUfCoBF.js → Check-Btldp1zg.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ci5HXbyi.js → CheckCircle-BuQjG5TK.js} +1 -1
- package/dist/client/assets/{ChevronDown-B5nNx5Dx.js → ChevronDown-l_A3M_wf.js} +1 -1
- package/dist/client/assets/{ChevronRight-BIhvsLci.js → ChevronRight-BIspaBbu.js} +1 -1
- package/dist/client/assets/{ChevronUp-DskNR2pe.js → ChevronUp-CbWj-JPO.js} +1 -1
- package/dist/client/assets/{Copy01-CZUAh9vx.js → Copy01-CaG2A2wm.js} +1 -1
- package/dist/client/assets/{DotsVertical-DH3n__PV.js → DotsVertical-BegrkRAd.js} +1 -1
- package/dist/client/assets/{Eye-CbhCOWW3.js → Eye-n7F3_pH4.js} +1 -1
- package/dist/client/assets/{FilterLines-CjyDVxAQ.js → FilterLines-D74fcuno.js} +1 -1
- package/dist/client/assets/{Globe01-xZl4NLjm.js → Globe01-BUN-6dPc.js} +1 -1
- package/dist/client/assets/{Globe04-DHgs3GZc.js → Globe04-OC3kWxEd.js} +1 -1
- package/dist/client/assets/{HardDrive-BwxUHvE5.js → HardDrive-sPxi9cVE.js} +1 -1
- package/dist/client/assets/{Image01-zzq68Thg.js → Image01-DOKZLS3n.js} +1 -1
- package/dist/client/assets/{Key01-BG2GwAxV.js → Key01-BOkUeTGR.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CJjI1ZVY.js → LayoutLeft-C0Cux1Fk.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DuM-ETL7.js → LinkExternal01-DCsltjSv.js} +1 -1
- package/dist/client/assets/{Monitor01-DCBBoK-Q.js → Monitor01-CDwcd_zn.js} +1 -1
- package/dist/client/assets/{Package-DGdUJKLk.js → Package-ChEjJzRf.js} +1 -1
- package/dist/client/assets/{Palette-B9U3WzWJ.js → Palette-BtxFGIye.js} +1 -1
- package/dist/client/assets/{Play-MPnFN4Ot.js → Play-DCNHEpbv.js} +1 -1
- package/dist/client/assets/{Plus-D8R0whKy.js → Plus-BWpeDIiC.js} +1 -1
- package/dist/client/assets/{SearchLg-DxljGMIS.js → SearchLg-BAFos4ti.js} +1 -1
- package/dist/client/assets/{SearchMd-Cl1wFEaP.js → SearchMd-D5PMm26-.js} +1 -1
- package/dist/client/assets/{Settings02-CHWQ4cze.js → Settings02-CETfKPeQ.js} +1 -1
- package/dist/client/assets/{Shield01-KvnJOfKG.js → Shield01-CaJG0J3f.js} +1 -1
- package/dist/client/assets/{Star01-CFLS8vM8.js → Star01-E3H8ZPcr.js} +1 -1
- package/dist/client/assets/{Stars01-Du90yOKu.js → Stars01-CPSc8KBd.js} +1 -1
- package/dist/client/assets/{Stars02-DNKnMVas.js → Stars02-ai2IOE66.js} +1 -1
- package/dist/client/assets/{Sun-wJrJ62L2.js → Sun-M3urxdUJ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Bu9Qz3KN.js → SwitchHorizontal01-Bs5gwvDo.js} +1 -1
- package/dist/client/assets/{Tool01-C2j5CN3o.js → Tool01-D8Lh-5Kv.js} +1 -1
- package/dist/client/assets/{Tool02-M4Cw_hi1.js → Tool02-DWpcCeVk.js} +1 -1
- package/dist/client/assets/{Trash01-BRj8BMoQ.js → Trash01-BunOPvOH.js} +1 -1
- package/dist/client/assets/{TrendUp01-DCszOWxx.js → TrendUp01-DRBQwzJp.js} +1 -1
- package/dist/client/assets/{Upload01-BYmQrCvZ.js → Upload01-BKoh1Eu-.js} +1 -1
- package/dist/client/assets/{User01-xWnqcBX5.js → User01-CfQjQb3O.js} +1 -1
- package/dist/client/assets/{Users01-BCCI59Cd.js → Users01-1qAiw5kv.js} +1 -1
- package/dist/client/assets/{Users03-BhAf1OI0.js → Users03-CFoRyG6w.js} +1 -1
- package/dist/client/assets/{X-D9a7mA7z.js → X-DefYjaiC.js} +1 -1
- package/dist/client/assets/{XCircle-CLqcbEJ5.js → XCircle-CSTEYaFt.js} +1 -1
- package/dist/client/assets/{XClose-B4_aZN-d.js → XClose-dktsudpR.js} +1 -1
- package/dist/client/assets/{Zap-BM4kHy7D.js → Zap-DKyNws_D.js} +1 -1
- package/dist/client/assets/{ZapSquare-CHvbVMtu.js → ZapSquare-uV_3SRZQ.js} +1 -1
- package/dist/client/assets/{ZoomOut-BgBVt7xO.js → ZoomOut-BYn_nuTa.js} +1 -1
- package/dist/client/assets/{access-gate-Blc6kHRZ.js → access-gate-CrIPbIcm.js} +1 -1
- package/dist/client/assets/{add-section-modal-CLgI9snf.js → add-section-modal-mlLl5feN.js} +1 -1
- package/dist/client/assets/{agent-icon-CWafS0z1.js → agent-icon-DPj46qz4.js} +1 -1
- package/dist/client/assets/{agents-list-DARePumV.js → agents-list-BPZ-7q6f.js} +1 -1
- package/dist/client/assets/{ai-providers-CcOvZknr.js → ai-providers-JySJkbSR.js} +1 -1
- package/dist/client/assets/{alert-dialog-Dlf2Maxi.js → alert-dialog-D05um7oC.js} +1 -1
- package/dist/client/assets/{alert-CEbwozBK.js → alert-jjMCqhWY.js} +1 -1
- package/dist/client/assets/{app-editor-CfMliRW7.js → app-editor-DxBJbEVO.js} +1 -1
- package/dist/client/assets/{auth-_luaz7eq.js → auth-BuYROqYP.js} +1 -1
- package/dist/client/assets/{auth-catchall-BIhNL7Oo.js → auth-catchall-DRSSIoFG.js} +1 -1
- package/dist/client/assets/{auth-entry-Bu2S0sSm.js → auth-entry-lkwKiMpv.js} +1 -1
- package/dist/client/assets/{auth-split-layout-jhdl7GwA.js → auth-split-layout-Be2wbR6N.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DuV0O3R6.js → authenticate-and-persist-oauth-CYhnPvSD.js} +1 -1
- package/dist/client/assets/{automation-list-row-BOa-I3b7.js → automation-list-row-CkVMCd1b.js} +1 -1
- package/dist/client/assets/{automation-runs-5NMUIL2C.js → automation-runs-B_KWcbT8.js} +1 -1
- package/dist/client/assets/{automations-BaTgc-lk.js → automations-Bp7YUGVd.js} +1 -1
- package/dist/client/assets/{autosend-BqtYaPyS.js → autosend-C3KvfWIZ.js} +1 -1
- package/dist/client/assets/{avatar-Bm7TRFyI.js → avatar-BZVXAJYd.js} +1 -1
- package/dist/client/assets/{badge-BfKxdp6w.js → badge-BP8obAYN.js} +1 -1
- package/dist/client/assets/{block-document-SAqGRPVB.js → block-document-BIOalMD-.js} +1 -1
- package/dist/client/assets/{brand-context-7QvMVJRB.js → brand-context-Xq1jc6-g.js} +1 -1
- package/dist/client/assets/{buckets-DN160Fe5.js → buckets-B1oIOPxV.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BeU95ijv.js → bulk-category-panel-CX4yequ8.js} +1 -1
- package/dist/client/assets/{calendar-ChM-0ri5.js → calendar-BqryvOsJ.js} +1 -1
- package/dist/client/assets/{capability-load-error-DED97G7U.js → capability-load-error-BKIWgBVB.js} +1 -1
- package/dist/client/assets/{card-_b2At37s.js → card-DsawJB79.js} +1 -1
- package/dist/client/assets/{category-editor-C3tPwo-O.js → category-editor-_9aftiUj.js} +1 -1
- package/dist/client/assets/{chat-context-CWj_5Xjy.js → chat-context-CdcAuDUS.js} +1 -1
- package/dist/client/assets/{checkbox-B8I8ULDM.js → checkbox-1NHA6ags.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BZZJ8ljw.js → cli-auth-success-B52wNL2V.js} +1 -1
- package/dist/client/assets/{collection-detail-CAJRlJNz.js → collection-detail-BfHxFPCW.js} +1 -1
- package/dist/client/assets/{collection-display-button-MK8sJgYK.js → collection-display-button-CARi-X__.js} +1 -1
- package/dist/client/assets/{collection-search-JF6iMFQe.js → collection-search-EZ_TgeOx.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DfpdV9wl.js → collection-table-wrapper-ntW_kap4.js} +1 -1
- package/dist/client/assets/{collection-tabs-DTBgpjpb.js → collection-tabs-DexOABMQ.js} +1 -1
- package/dist/client/assets/{command-X9fO0ToS.js → command-CSe-uHrh.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CKQucrdu.js → commerce-onboarding-ggTPgfmk.js} +1 -1
- package/dist/client/assets/{companions-core-j_0J30PJ.js → companions-core-QrJolxkg.js} +1 -1
- package/dist/client/assets/{connect-BeRtumRu.js → connect-B_xZYpLA.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CUJxiyZC.js → connect-desktop-dialog-S8cCvTaK.js} +1 -1
- package/dist/client/assets/{connection-card-Bxo1rJ_l.js → connection-card-BXqR2l1c.js} +1 -1
- package/dist/client/assets/{connection-detail-VMrYv0bl.js → connection-detail-BR7vqb17.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Dwr0QnsN.js → connection-form-helpers-CfHSjpL2.js} +1 -1
- package/dist/client/assets/{connections-k5M7YhJ5.js → connections-DuBuf_K7.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CsaxjWqo.js → decopilot-sse-pool-SqtdCkZ4.js} +1 -1
- package/dist/client/assets/{dialog-DTERmMdq.js → dialog-dfAy2TTt.js} +1 -1
- package/dist/client/assets/{domain-settings-QEBY_O22.js → domain-settings-CKc4FNZk.js} +1 -1
- package/dist/client/assets/{drawer-D592XSz-.js → drawer-BhtgSPao.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DCVSlDdU.js → dropdown-menu-BxpmNkvj.js} +1 -1
- package/dist/client/assets/{empty-state-DnkxLOwP.js → empty-state-Wdt305BC.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D0xv5f6d.js → extract-connection-data-CUPY4h8x.js} +1 -1
- package/dist/client/assets/{file-explorer-Cc7Fo9Vw.js → file-explorer-DvSJunYy.js} +1 -1
- package/dist/client/assets/{file-type-icon-DKZTktyz.js → file-type-icon-BIP3n6ye.js} +1 -1
- package/dist/client/assets/{files-C52diAtY.js → files-zAd-2EvH.js} +1 -1
- package/dist/client/assets/{form-CTIDjV5U.js → form-CF3RjQBx.js} +1 -1
- package/dist/client/assets/{general-CA388VDO.js → general-DXlHAo7g.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DTwuNdN8.js → github-repo-picker-Cq0j6Fer.js} +1 -1
- package/dist/client/assets/{hooks-CGrRNfgB.js → hooks-yHiQMJ5W.js} +1 -1
- package/dist/client/assets/{index-pOKU1sel.js → index-8CSCdJSN.js} +1 -1
- package/dist/client/assets/{index-CziH8yUr.js → index-BB0l7D8W.js} +1 -1
- package/dist/client/assets/{index-vNH0v8Fd.js → index-BIkMD2a1.js} +1 -1
- package/dist/client/assets/{index-DcuzUaPh.js → index-BMpEXBXM.js} +1 -1
- package/dist/client/assets/{index-zBE2ow0w.js → index-BMv4jCYv.js} +1 -1
- package/dist/client/assets/{index-Dq0Rv4T6.js → index-BitSPwcw.js} +1 -1
- package/dist/client/assets/{index-DExceWv9.js → index-CHOirrNp.js} +1 -1
- package/dist/client/assets/{index-BbVhqZHS.js → index-CPD_qiK-.js} +1 -1
- package/dist/client/assets/{index-fNoeLmyx.js → index-CRaj4we8.js} +1 -1
- package/dist/client/assets/{index-AYpZp1GA.js → index-CYQEaXdg.js} +1 -1
- package/dist/client/assets/{index-pSvo-p7O.js → index-CetUKuua.js} +1 -1
- package/dist/client/assets/{index-BG2iLEXm.js → index-CsnXc5Et.js} +23 -23
- package/dist/client/assets/{index-BndAfnBN.js → index-h2Txlgmb.js} +3 -3
- package/dist/client/assets/{index-redirect-WN2k7pJg.js → index-redirect-CGMmT7Ut.js} +1 -1
- package/dist/client/assets/{index-BFgGPpC8.js → index-xMAThnJ3.js} +29 -29
- package/dist/client/assets/{input-CsC1Diu-.js → input-u9ojR0Jk.js} +1 -1
- package/dist/client/assets/{integration-icon-pm2IQO2U.js → integration-icon-BMvzy0w5.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-D7IRVBXl.js → invite-member-dialog-BT6zttg7.js} +1 -1
- package/dist/client/assets/{label-DqXNZATI.js → label-7U_jcH3x.js} +1 -1
- package/dist/client/assets/{layout-BqTeageM.js → layout-DwuWA2A3.js} +1 -1
- package/dist/client/assets/{login-ClDrj-2f.js → login-DjRzz0_j.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BORbgW4H.js → mcp-oauth-Det9HVTR.js} +1 -1
- package/dist/client/assets/{members-WF-PminE.js → members-Ct31LEsu.js} +1 -1
- package/dist/client/assets/{monaco-editor-B9HyQg7v.js → monaco-editor-GkkiGiO2.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-pvL8qOz4.js → monitoring-stats-row-oSpt-0Nf.js} +1 -1
- package/dist/client/assets/{multi-select-BDaSL9uP.js → multi-select-CQorHX_C.js} +1 -1
- package/dist/client/assets/{oauth-callback-B5QzBUa_.js → oauth-callback-B4eBU_O3.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BDKSQRVP.js → oauth-callback-ai-provider-BcADfU57.js} +1 -1
- package/dist/client/assets/{onboarding-iNKOe8fc.js → onboarding-COoWUwjK.js} +1 -1
- package/dist/client/assets/{org-install-CWBMjUat.js → org-install-DPiHB5gc.js} +1 -1
- package/dist/client/assets/{org-layout-BAP0xFKg.js → org-layout-IDVVMg-8.js} +1 -1
- package/dist/client/assets/{organization-choice-BSm2aJn0.js → organization-choice-CTkHG9wB.js} +1 -1
- package/dist/client/assets/{orgs-DmDVOJNZ.js → orgs-BEVouQN2.js} +1 -1
- package/dist/client/assets/{page-seo-form-D3Q5GmQ_.js → page-seo-form-CgTRO54t.js} +1 -1
- package/dist/client/assets/page-seo-sheet-ZXZqYZeH.js +1 -0
- package/dist/client/assets/{popover-BHJXyBcl.js → popover-DeNJXOxs.js} +1 -1
- package/dist/client/assets/{post-editor-L5eyLvH2.js → post-editor-BC_EqG95.js} +1 -1
- package/dist/client/assets/{primitives-BTXI1UhP.js → primitives-DW_xJ0XY.js} +1 -1
- package/dist/client/assets/{profile-D40D6IbB.js → profile-B6LJKYaV.js} +1 -1
- package/dist/client/assets/project-app-view-CIBx6iGT.js +1 -0
- package/dist/client/assets/record-editor-DDua03Aj.js +1 -0
- package/dist/client/assets/{redirect-editor-DJ1Y_Dqx.js → redirect-editor-BR4k4dU-.js} +1 -1
- package/dist/client/assets/registry-BZHylcQg.js +2 -0
- package/dist/client/assets/{registry-layout-Czee_ui1.js → registry-layout-DdpD2Ry7.js} +1 -1
- package/dist/client/assets/{reports-BvsqcplZ.js → reports-BqaJMLUV.js} +1 -1
- package/dist/client/assets/{require-capability-DmAVYrxg.js → require-capability-c3gGgAdr.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DZtKKGLa.js → required-auth-layout-DreE2Dff.js} +1 -1
- package/dist/client/assets/{reset-password-Bk83Kx_H.js → reset-password-BLNw7U5H.js} +1 -1
- package/dist/client/assets/{roles-DsJ5Ylxf.js → roles-COJ501I0.js} +1 -1
- package/dist/client/assets/{search-input-CwAJ7BWA.js → search-input-mUDoQdXW.js} +1 -1
- package/dist/client/assets/{secrets-B-pJRADZ.js → secrets-B7kBoBlY.js} +1 -1
- package/dist/client/assets/{sections-editor-CJbGysPH.js → sections-editor-CkxSPNTY.js} +1 -1
- package/dist/client/assets/{select-DyDdd0ox.js → select-Dwl6tgyc.js} +1 -1
- package/dist/client/assets/{select-model-J8fBCN0u.js → select-model-5fuU93qG.js} +1 -1
- package/dist/client/assets/{self-tool-result-nnnPnWxT.js → self-tool-result-ClGvUSzE.js} +1 -1
- package/dist/client/assets/{seo-editor-CCzJc2E0.js → seo-editor-4m4pHaJn.js} +1 -1
- package/dist/client/assets/{settings-layout-DwppcUBS.js → settings-layout-CEhhqr5X.js} +1 -1
- package/dist/client/assets/{settings-section-ZQhYRZpE.js → settings-section-8wzuI0e2.js} +1 -1
- package/dist/client/assets/{shell-controls-scS1Rhux.js → shell-controls-QkO6fUAg.js} +1 -1
- package/dist/client/assets/{shell-layout-EXrCt72h.js → shell-layout-D1cDRvrL.js} +1 -1
- package/dist/client/assets/{sidebar-DosOHS89.js → sidebar-B6ruAgp1.js} +1 -1
- package/dist/client/assets/{skeleton-BTs-Tdu0.js → skeleton-AlkG0Gdf.js} +1 -1
- package/dist/client/assets/{sso-BM8eE3tq.js → sso-CXey7xHX.js} +1 -1
- package/dist/client/assets/{store-CRnZmc6Z.js → store-DtsPgCIa.js} +1 -1
- package/dist/client/assets/store-registry-XsXH60Bx.js +2 -0
- package/dist/client/assets/{studio-tools-ukrAmOkD.js → studio-tools-CwZ4ZBgT.js} +1 -1
- package/dist/client/assets/{switch-C9pj46Z6.js → switch-6H8FKWGB.js} +1 -1
- package/dist/client/assets/{table-DWcE-ljO.js → table-CXPm9nhx.js} +1 -1
- package/dist/client/assets/{tabs-CzbcVejC.js → tabs-7TkasHGl.js} +1 -1
- package/dist/client/assets/{textarea-I-beCo8f.js → textarea-DrzR5udY.js} +1 -1
- package/dist/client/assets/{toggle-group-CSett6iF.js → toggle-group-DcCG_z_S.js} +1 -1
- package/dist/client/assets/{toolbar-f60X9WiD.js → toolbar-Dwqw-NGi.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BFnmKkKr.js → toolbar-icon-button-BANxrES2.js} +1 -1
- package/dist/client/assets/{tooltip-BDJ7iYv_.js → tooltip-Cx4iVbBS.js} +1 -1
- package/dist/client/assets/{use-ai-providers-7OtHxRqt.js → use-ai-providers-CNxbdOdh.js} +1 -1
- package/dist/client/assets/{use-api-keys-B-WaFIiT.js → use-api-keys-C_mORge4.js} +1 -1
- package/dist/client/assets/{use-automations-886ySqJq.js → use-automations-CRPUaRnG.js} +1 -1
- package/dist/client/assets/{use-autosave-CXrMNytc.js → use-autosave-C2LdWtX4.js} +1 -1
- package/dist/client/assets/{use-capability-HyvPV9Kc.js → use-capability-DDoizOsm.js} +1 -1
- package/dist/client/assets/{use-clock-tick-ByL-Lh2G.js → use-clock-tick-BXUEdeXU.js} +1 -1
- package/dist/client/assets/{use-connection-C8ytM15b.js → use-connection-CRf-DTB0.js} +1 -1
- package/dist/client/assets/{use-copy-8xFrbNwA.js → use-copy-BIvcisP7.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-vCdnBcqV.js → use-create-virtual-mcp-5RZTzNZt.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Dl0bn9CK.js → use-debounced-autosave-BZzQGoBJ.js} +1 -1
- package/dist/client/assets/{use-debounced-value-KA9O7hhh.js → use-debounced-value-C5_koqkI.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DO8B21gs.js → use-deco-credits-a2tWMbhr.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-ik0j7Idu.js → use-decopilot-events-D4WclKO1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CB9H-v-Z.js → use-delete-connection-DvDrdj8E.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DmUmcR7f.js → use-deployment-admin-BY9aiNeW.js} +1 -1
- package/dist/client/assets/{use-file-configs-BrCSqQHA.js → use-file-configs-rAeCy2m6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-0_XM1a-S.js → use-infinite-scroll-5JOaC6HH.js} +1 -1
- package/dist/client/assets/{use-join-requests-DKHalNnE.js → use-join-requests-Dk8eY_ir.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DlBw1ZFI.js → use-mcp-auth-status-Cti2GrcA.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DYOS_8eo.js → use-mcp-client-CxJl6URN.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BLQoKB-2.js → use-mcp-tools-CZl6XrZ7.js} +1 -1
- package/dist/client/assets/{use-members-XmfA74-e.js → use-members-BDKlfbtq.js} +1 -1
- package/dist/client/assets/{use-mobile-CLI42gmv.js → use-mobile-CljsORKC.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cilssw61.js → use-navigate-to-agent-CfNAtLX9.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DOOxheWY.js → use-org-auth-client-WFmIGMAp.js} +1 -1
- package/dist/client/assets/{use-org-sso-ClgxAraI.js → use-org-sso-CdqzH40J.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D9JXEbEX.js → use-organization-roles-snr9TURY.js} +1 -1
- package/dist/client/assets/{use-organization-settings-VgIejHMx.js → use-organization-settings-CPH24cID.js} +1 -1
- package/dist/client/assets/{use-registry-app-DNeAw21p.js → use-registry-app-B5yOQbYF.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Bluv6sTk.js → use-registry-connections-DOp_CmU_.js} +1 -1
- package/dist/client/assets/{use-secrets-3k-32-A8.js → use-secrets-BngqMQYW.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D9IFNrZv.js → use-status-sounds-Csty195w.js} +1 -1
- package/dist/client/assets/{use-view-mode-CjB0RzKt.js → use-view-mode--DcXGci1.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-B8ePNwQG.js → use-virtual-mcp-C9595_o4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BUdwW0Ym.js +1 -0
- package/dist/client/assets/{useRouterState-DUsZKnyS.js → useRouterState-B5E07hul.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CPYBdW4F.js +1 -0
- package/dist/client/assets/{users-KkKpy9nz.js → users-B8tx5ZHD.js} +1 -1
- package/dist/client/assets/{variant-calendar-y8BhfKBh.js → variant-calendar-Sp_Pw0W3.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-RIrGcafb.js → view-mode-toggle-DFicmu5N.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +214 -214
- package/dist/server/server.js +166 -166
- package/package.json +1 -1
- package/dist/client/assets/page-seo-sheet-BHz6iSrk.js +0 -1
- package/dist/client/assets/project-app-view-dFDZ7PrH.js +0 -1
- package/dist/client/assets/record-editor-JpnOewHP.js +0 -1
- package/dist/client/assets/registry-US3Gsp4u.js +0 -2
- package/dist/client/assets/store-registry-BWDgwr86.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CzUic10e.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B96CIiaZ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as z,d as ie,F as J,b as B,G as Ms,j as s,B as ce,r as G,E as at,H as Ts,v as Ut,a as oe,w as Ps,K as Wt,e as st,q as Y,I as Ge,m as U,J as Ds,M as Es,P as Fs,R as Rs,U as Ls,s as Gs,t as ee,x as Bs,k as Kt,f as ct,u as Be,L as qt,V as Hs,W as Us,X as Ws,n as Ks,Y as qs,O as Vs,Z as Ys}from"./index-BFgGPpC8.js";import{u as de,S as dt,a as mt,b as te,c as Q,d as W,e as Vt,f as Xs,g as Yt,h as Qs,i as Ae,j as Js,k as Zs,l as en}from"./sidebar-DosOHS89.js";import{u as ut}from"./use-mobile-CLI42gmv.js";import{C as tn,p as Qe,s as sn,b as nn,S as on,d as ln,e as rn,c as an,n as cn}from"./self-tool-result-nnnPnWxT.js";import{f as dn,b as ft,e as pt,g as mn,d as Xt,h as Qt,a as Jt}from"./dialog-DTERmMdq.js";import{f as un}from"./tab-id-BijBBRwE.js";import{C as fn,W as Zt,g as pn,u as es,S as ts,a as Re,i as hn,b as xn}from"./use-mcp-client-DYOS_8eo.js";import{i as ht}from"./ArrowRight-n-TBn01e.js";import{S as le}from"./skeleton-BTs-Tdu0.js";import{i as ss}from"./LayoutLeft-CJjI1ZVY.js";import{t as xt}from"./ChevronDown-B5nNx5Dx.js";import{T as fe,a as pe,b as he,c as ns}from"./tooltip-BDJ7iYv_.js";import{u as os,a as gt}from"./use-virtual-mcp-B8ePNwQG.js";import{A as be,t as ls,a as gn,i as bn,b as St,c as jn,d as vn,e as is,f as _t,s as yn,g as Sn,h as _n}from"./agent-icon-CWafS0z1.js";import{P as ke,a as He,b as Ue}from"./popover-BHJXyBcl.js";import{i as Oe}from"./Check-BqUfCoBF.js";import{s as Me}from"./Plus-D8R0whKy.js";import{i as rs}from"./SearchMd-Cl1wFEaP.js";import{s as Cn}from"./XClose-B4_aZN-d.js";import{A as Nn,a as wn,b as kn,c as An,d as In,e as zn,f as $n}from"./alert-dialog-Dlf2Maxi.js";import{F as On,a as Mn,b as Tn,c as Pn,d as Dn,e as En,f as Fn}from"./form-CTIDjV5U.js";import{I as Rn}from"./input-CsC1Diu-.js";import{S as Ln,u as Gn,C as Bn}from"./chat-context-CWj_5Xjy.js";import{T as je}from"./toolbar-icon-button-BFnmKkKr.js";import{D as as,a as cs,b as ds}from"./drawer-D592XSz-.js";import{G as Hn}from"./use-registry-app-DNeAw21p.js";import{G as Un}from"./github-repo-picker-DTwuNdN8.js";import{u as ms,a as bt,b as Wn,T as Kn}from"./hooks-CGrRNfgB.js";import{r as qn,u as jt,f as Vn}from"./shell-layout-EXrCt72h.js";import{u as Yn,g as Xn,a as Qn,b as Jn,S as us}from"./use-navigate-to-agent-Cilssw61.js";import{g as Zn,a as fs,u as eo,A as to,b as so}from"./use-deco-credits-DO8B21gs.js";import{f as no}from"./reusable-new-chat-CouMjkYR.js";import{A as nt}from"./avatar-Bm7TRFyI.js";import{a as ot}from"./Copy01-CZUAh9vx.js";import{n as oo,i as lo}from"./Globe01-xZl4NLjm.js";import{i as io}from"./ZoomOut-BgBVt7xO.js";import{n as ro}from"./LinkExternal01-DuM-ETL7.js";import{i as Ct,a as ao}from"./ZapSquare-CHvbVMtu.js";import{i as lt}from"./Monitor01-DCBBoK-Q.js";import{n as co,a as mo}from"./Sun-wJrJ62L2.js";import{a as We}from"./Settings02-CHWQ4cze.js";import{i as uo}from"./Shield01-KvnJOfKG.js";import{a as fo}from"./Users03-BhAf1OI0.js";import{u as po}from"./use-deployment-admin-DmUmcR7f.js";import"./index-pOKU1sel.js";import{a as ps}from"./XCircle-CLqcbEJ5.js";import{I as hs}from"./invite-member-dialog-D7IRVBXl.js";import{u as Nt}from"./use-copy-8xFrbNwA.js";import{m as ho,u as xo,c as go}from"./use-api-keys-B-WaFIiT.js";import{v as bo,C as wt}from"./connect-desktop-dialog-CUJxiyZC.js";import{u as Ke}from"./use-organization-settings-VgIejHMx.js";import{i as jo}from"./FilterLines-CjyDVxAQ.js";import{T as vo,a as yo}from"./toggle-group-CSett6iF.js";import{C as So,a as _o,b as Co,c as No,d as wo}from"./command-X9fO0ToS.js";import{u as xs}from"./studio-tools-ukrAmOkD.js";import{i as gs}from"./Zap-BM4kHy7D.js";import{S as bs,M as ko}from"./shell-controls-scS1Rhux.js";import{n as Ao}from"./Stars02-DNKnMVas.js";import{g as Io,u as zo,S as $o}from"./use-clock-tick-ByL-Lh2G.js";import{a as Oo}from"./format-time-BnbuEtat.js";import{i as Mo}from"./ChevronRight-BIhvsLci.js";import{T as Z}from"./toolbar-f60X9WiD.js";import"./X-D9a7mA7z.js";import"./integration-icon-pm2IQO2U.js";import"./Tool02-M4Cw_hi1.js";import"./CheckCircle-Ci5HXbyi.js";import"./companions-core-j_0J30PJ.js";import"./extract-connection-data-D0xv5f6d.js";import"./github-repo-scope-DjMZbiKa.js";import"./Eye-CbhCOWW3.js";import"./use-debounced-value-KA9O7hhh.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./authenticate-and-persist-oauth-DuV0O3R6.js";import"./mcp-oauth-BORbgW4H.js";import"./auth-_luaz7eq.js";import"./ArrowUpRight-CUu0poE7.js";import"./AlertCircle-hYag6BbI.js";import"./Tool01-C2j5CN3o.js";import"./ArrowUp-CV_nwp67.js";import"./TrendUp01-DCszOWxx.js";import"./ChevronUp-DskNR2pe.js";import"./DotsVertical-DH3n__PV.js";import"./Star01-CFLS8vM8.js";import"./Globe04-DHgs3GZc.js";import"./SwitchHorizontal01-Bu9Qz3KN.js";import"./HardDrive-BwxUHvE5.js";import"./Image01-zzq68Thg.js";import"./Key01-BG2GwAxV.js";import"./Package-DGdUJKLk.js";import"./Palette-B9U3WzWJ.js";import"./Play-MPnFN4Ot.js";import"./SearchLg-DxljGMIS.js";import"./Stars01-Du90yOKu.js";import"./Trash01-BRj8BMoQ.js";import"./Upload01-BYmQrCvZ.js";import"./User01-xWnqcBX5.js";import"./Users01-BCCI59Cd.js";import"./label-DqXNZATI.js";import"./autosend-BqtYaPyS.js";import"./use-ai-providers-7OtHxRqt.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-ik0j7Idu.js";import"./decopilot-sse-pool-CsaxjWqo.js";import"./backoff-CrEUbyZT.js";import"./use-mcp-tools-BLQoKB-2.js";import"./collection-search-JF6iMFQe.js";import"./use-connection-C8ytM15b.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-DZtKKGLa.js";import"./use-org-sso-ClgxAraI.js";import"./connection-card-Bxo1rJ_l.js";import"./use-registry-connections-Bluv6sTk.js";import"./useInfiniteQuery-CzUic10e.js";import"./use-infinite-scroll-0_XM1a-S.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-_b2At37s.js";import"./select-DyDdd0ox.js";import"./textarea-I-beCo8f.js";import"./connection-form-helpers-Dwr0QnsN.js";import"./collection-tabs-DTBgpjpb.js";import"./badge-BfKxdp6w.js";import"./useSuspenseInfiniteQuery-B96CIiaZ.js";import"./use-org-auth-client-DOOxheWY.js";import"./use-organization-roles-D9JXEbEX.js";import"./index-DExceWv9.js";import"./differenceInSeconds-NQ4PDo0z.js";function To(t){const e=z.c(22),{siteUrl:n}=t,l=ie(),{org:o}=J(),i=B();let r;e[0]!==l||e[1]!==o.id||e[2]!==o.slug?(r=()=>{localStorage.setItem(Ms.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:o.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:pn(o.id),main:un(Zt.COMMERCE_DISCOVERY(o.id),fn),sidepanel:0}})},e[0]=l,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const a=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(dn,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=d):d=e[4];let c;e[5]!==i?(c=i("routes.commerceOnboarding.connectModal.dialogTitle"),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==c?(m=s.jsx(ft,{className:"sr-only",children:c}),e[7]=c,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==i?(u=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:i("routes.commerceOnboarding.connectModal.loadError")}),s.jsxs(ce,{type:"button",size:"xl",className:"w-full",onClick:a,children:[i("routes.commerceOnboarding.connectModal.continueButton"),s.jsx(ht,{size:18})]})]}),e[9]=a,e[10]=i,e[11]=u):u=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tn,{}),e[12]=f):f=e[12];let p;e[13]!==a||e[14]!==n?(p=s.jsx(G.Suspense,{fallback:f,children:s.jsx(Fo,{siteUrlFromUrl:n,onComplete:a})}),e[13]=a,e[14]=n,e[15]=p):p=e[15];let h;e[16]!==u||e[17]!==p?(h=s.jsx(at,{fallback:u,children:p}),e[16]=u,e[17]=p,e[18]=h):h=e[18];let g;return e[19]!==m||e[20]!==h?(g=s.jsx(pt,{open:!0,children:s.jsxs(mn,{children:[d,s.jsxs(Ts,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Eo,onPointerDownOutside:Do,onInteractOutside:Po,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,h]})]})}),e[19]=m,e[20]=h,e[21]=g):g=e[21],g}function Po(t){return t.preventDefault()}function Do(t){return t.preventDefault()}function Eo(t){return t.preventDefault()}function Fo({siteUrlFromUrl:t,onComplete:e}){const n=B(),[l]=Ut(),{org:o}=J(),{data:i}=oe.useSession(),r=Zt.COMMERCE_DISCOVERY(o.id),a=es({connectionId:ts,orgId:o.id,orgSlug:o.slug}),c=Ps({queryKey:Wt.commerceDiscoveryConnection(o.id,r),queryFn:async()=>{const v=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}});return Qe(v)},retry:!1}).data.item,m=typeof c?.metadata?.siteUrl=="string"?c.metadata.siteUrl:void 0,u=t||m,f=sn(u),[p,h]=G.useState(!0),[g,x]=G.useState(null),b=st({mutationFn:async v=>Qe(await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:v}})),retry:!1}),j=st({mutationFn:async v=>Qe(await a.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:v}})),retry:!1}),S=nn({siteUrl:u,email:i?.user?.email,locale:l.language}),y=async()=>{x(null),Y("commerce_onboarding_open_report_clicked",{domain:f??void 0,organization_id:o.id});const v=u?cn(u):null;if(v?.ok)try{let C=await j.mutateAsync(v.value);if(C.triggered||(Y("commerce_onboarding_run_reclaim",{domain:f??void 0,organization_id:o.id,reason:C.reason??"not_upgraded"}),await b.mutateAsync(v.value),C=await j.mutateAsync(v.value)),!C.triggered){Y("commerce_onboarding_run_failed",{domain:f??void 0,organization_id:o.id,error:C.reason??"not_triggered"}),x(n("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(C){Y("commerce_onboarding_run_failed",{domain:f??void 0,organization_id:o.id,error:C instanceof Error?C.message:String(C)}),x(n("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[f?s.jsx(on,{host:f}):null,s.jsx(ln,{org:o,cdConnectionId:r,siteUrl:u,onReadinessChange:h}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(rn,{href:S,orgId:o.id,className:"lg:hidden"}),g?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:g}):null,s.jsxs(ce,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{y()},disabled:j.isPending||!p,children:[j.isPending?n("routes.commerceOnboarding.connectModal.openingReport"):n(p?"routes.commerceOnboarding.connectModal.viewFullReport":"routes.commerceOnboarding.connectModal.connectToolToContinue"),!j.isPending&&p?s.jsx(ht,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(an,{href:S,orgId:o.id})})]})}function Ro(t){const e=z.c(11),{onPointerDown:n,onDoubleClick:l}=t,o=B(),{state:i,isMobile:r}=de();if(r||i==="collapsed")return null;let a;e[0]!==o?(a=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==o?(d=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=d):d=e[3];let c,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={left:"var(--sidebar-width)"},m=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[4]=c,e[5]=m):(c=e[4],m=e[5]);let u;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==d?(u=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a,title:d,onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:c,children:m}),e[6]=l,e[7]=n,e[8]=a,e[9]=d,e[10]=u):u=e[10],u}const vt=240,Lo=400,Go="sidebar.width";function Ie(t){return Math.max(vt,Math.min(Lo,t))}function Bo(){const t=z.c(11),[e,n]=Ge(Go,Ho),l=G.useRef(null);let o;t[0]!==n||t[1]!==e?(o=m=>{m.preventDefault();const u=m.clientX,f=Ie(e),p=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of h)b.style.transition="none";const g=b=>{const j=Ie(f+(b.clientX-u));p?.style.setProperty("--sidebar-width",`${j}px`)},x=b=>{const j=Ie(f+(b.clientX-u));n(j);for(const S of h)S.style.transition="";window.removeEventListener("pointermove",g),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",g),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let r;t[3]!==n?(r=()=>{n(vt)},t[3]=n,t[4]=r):r=t[4];const a=r;let d;t[5]!==e?(d=Ie(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function Ho(t){return typeof t=="number"?Ie(t):vt}function js(){return[]}function vs(t){const e=z.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 o;return e[1]!==n?(o=s.jsxs(dt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(mt,{children:s.jsx(te,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function ys(t){const e=z.c(18),{item:n}=t,{isMobile:l,setOpenMobile:o}=de();let i;e[0]!==l||e[1]!==n||e[2]!==o?(i=()=>{Y("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&o(!1)},e[0]=l,e[1]=n,e[2]=o,e[3]=i):i=e[3];const r=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=U(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]!==r||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(Q,{onClick:r,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=r,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(W,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Uo(t){const e=z.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Vt,{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,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ko),e[2]=n.group.items,e[3]=i):i=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(r=s.jsx(vs,{label:l,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=r):r=e[7],r}case"items":{let l;e[8]!==n.items?(l=n.items.map(Wo),e[8]=n.items,e[9]=l):l=e[9];let o;return e[10]!==l?(o=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(te,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=o):o=e[11],o}case"custom":return n.content}}function Wo(t){return s.jsx(ys,{item:t},t.key)}function Ko(t){return s.jsx(ys,{item:t},t.key)}function qo(t){const e=z.c(17),{sections:n,footer:l,additionalContent:o,header:i,variant:r,contentClassName:a}=t,d=r===void 0?"sidebar":r;let c;e[0]!==i?(c=i&&s.jsx(Xs,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:i}),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=U("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n.map(Vo),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==o?(f=o&&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:o}),e[6]=o,e[7]=f):f=e[7];let p;e[8]!==m||e[9]!==u||e[10]!==f?(p=s.jsxs(Yt,{className:m,children:[u,f]}),e[8]=m,e[9]=u,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==l||e[13]!==c||e[14]!==p||e[15]!==d?(h=s.jsxs(Qs,{variant:d,children:[c,p,l]}),e[12]=l,e[13]=c,e[14]=p,e[15]=d,e[16]=h):h=e[16],h}function Vo(t,e){return s.jsx(Uo,{section:t},e)}function Ss(t){const e=z.c(2);let n;return e[0]!==t?(n=s.jsx(qo,{...t}),e[0]=t,e[1]=n):n=e[1],n}Ss.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(le,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function kt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Yo=Ds({name:Es().min(2,"Organization name is required")});function Xo(t){const e=z.c(66),{open:n,onOpenChange:l}=t,o=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Fs(Yo),defaultValues:{name:""}},e[0]=i):i=e[0];const r=Rs(i);let a;e[1]!==o?(a=async D=>{const T=kt(D.name);if(!T)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const E=await oe.organization.create({name:D.name,slug:T});if(E?.error)throw new Error(E.error.message||o("common.createOrganizationDialog.failedToCreate"));const H=E?.data?.slug??T;if(!H)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:H}},e[1]=o,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=Qo,e[3]=d):d=e[3];let c;e[4]!==a?(c={mutationFn:a,onSuccess:d},e[4]=a,e[5]=c):c=e[5];const m=st(c);let u;e[6]!==m.error||e[7]!==o?(u=m.error instanceof Error?m.error.message:m.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=m.error,e[7]=o,e[8]=u):u=e[8];const f=u;let p;e[9]!==o?(p=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=p):p=e[10];let h;e[11]!==p?(h=s.jsx(Nn,{children:p}),e[11]=p,e[12]=h):h=e[12];let g;e[13]!==o?(g=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=g):g=e[14];let x;e[15]!==g?(x=s.jsx(wn,{children:g}),e[15]=g,e[16]=x):x=e[16];let b;e[17]!==h||e[18]!==x?(b=s.jsxs(kn,{children:[h,x]}),e[17]=h,e[18]=x,e[19]=b):b=e[19];let j;if(e[20]!==m||e[21]!==r){let D;e[23]!==m?(D=T=>m.mutateAsync(T),e[23]=m,e[24]=D):D=e[24],j=r.handleSubmit(D),e[20]=m,e[21]=r,e[22]=j}else j=e[22];let S;e[25]!==r.formState.isSubmitting||e[26]!==o?(S=D=>{const{field:T}=D;return s.jsxs(Tn,{children:[s.jsx(Pn,{children:o("common.createOrganizationDialog.nameLabel")}),s.jsx(Dn,{children:s.jsx(Rn,{...T,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:r.formState.isSubmitting})}),s.jsx(En,{children:o("common.createOrganizationDialog.nameDescription")}),T.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",kt(T.value)]})]}),s.jsx(Fn,{})]})},e[25]=r.formState.isSubmitting,e[26]=o,e[27]=S):S=e[27];let y;e[28]!==r.control||e[29]!==S?(y=s.jsx(On,{control:r.control,name:"name",render:S}),e[28]=r.control,e[29]=S,e[30]=y):y=e[30];let v;e[31]!==f?(v=f&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:f}),e[31]=f,e[32]=v):v=e[32];const C=r.formState.isSubmitting;let N;e[33]!==m||e[34]!==r?(N=()=>{m.reset(),r.reset()},e[33]=m,e[34]=r,e[35]=N):N=e[35];let _;e[36]!==o?(_=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=_):_=e[37];let w;e[38]!==r.formState.isSubmitting||e[39]!==N||e[40]!==_?(w=s.jsx(An,{disabled:C,onClick:N,children:_}),e[38]=r.formState.isSubmitting,e[39]=N,e[40]=_,e[41]=w):w=e[41];const I=!r.formState.isValid||r.formState.isSubmitting;let $;e[42]!==r.formState.isSubmitting||e[43]!==o?($=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Ln,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=r.formState.isSubmitting,e[43]=o,e[44]=$):$=e[44];let k;e[45]!==I||e[46]!==$?(k=s.jsx(ce,{type:"submit",variant:"default",disabled:I,children:$}),e[45]=I,e[46]=$,e[47]=k):k=e[47];let O;e[48]!==w||e[49]!==k?(O=s.jsxs(In,{children:[w,k]}),e[48]=w,e[49]=k,e[50]=O):O=e[50];let A;e[51]!==j||e[52]!==y||e[53]!==v||e[54]!==O?(A=s.jsxs("form",{className:"space-y-6",onSubmit:j,autoComplete:"off",children:[y,v,O]}),e[51]=j,e[52]=y,e[53]=v,e[54]=O,e[55]=A):A=e[55];let M;e[56]!==r||e[57]!==A?(M=s.jsx(Mn,{...r,children:A}),e[56]=r,e[57]=A,e[58]=M):M=e[58];let F;e[59]!==b||e[60]!==M?(F=s.jsxs(zn,{children:[b,M]}),e[59]=b,e[60]=M,e[61]=F):F=e[61];let R;return e[62]!==l||e[63]!==n||e[64]!==F?(R=s.jsx($n,{open:n,onOpenChange:l,children:F}),e[62]=l,e[63]=n,e[64]=F,e[65]=R):R=e[65],R}function Qo(t){const{orgSlug:e}=t;window.location.href=`/${e}`}function _s(){const t=G.useContext(Ls),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>n?.()}}function Jo(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 qe(t){const e=z.c(13),{org:n,size:l}=t,o=l===void 0?"sm":l,i=o==="xs"?"size-5":"size-6",r=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=U(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Jo(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]!==r?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:U("font-semibold leading-none",r),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=r,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function Zo({invitation:t,onChanged:e}){const n=B(),[l,o]=G.useState(!1),i=t.organizationName??n("header.orgSwitcher.unknownOrganization"),r=async()=>{o(!0);try{const c=await oe.organization.acceptInvitation({invitationId:t.id});if(c.error){ee.error(c.error.message),o(!1);return}}catch{ee.error(n("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}ee.success(n("header.orgSwitcher.joined",{name:i})),Bs();let d;try{d=(await oe.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},a=async()=>{o(!0);try{const d=await oe.organization.rejectInvitation({invitationId:t.id});if(d.error){ee.error(d.error.message),o(!1);return}ee.success(n("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{ee.error(n("header.orgSwitcher.failedToDeclineInvitation")),o(!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(qe,{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:n("header.orgSwitcher.invitedToJoin")})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(ce,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:l,children:n("header.orgSwitcher.accept")}),s.jsx(ce,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:l,"aria-label":n("header.orgSwitcher.declineInvitationTo",{name:i}),children:s.jsx(Cn,{size:14})})]})]})}function el(t){const e=z.c(32),{orgParam:n,onSelectOrg:l,onCreateOrg:o}=t,i=B(),{data:r}=Gs(),{invitations:a,refetch:d}=_s();let c;e[0]!==n?(c=(A,M)=>A.slug===n?-1:M.slug===n?1:A.name.localeCompare(M.name),e[0]=n,e[1]=c):c=e[1];const m=[...r??[]].sort(c),[u,f]=G.useState(""),p=u.toLowerCase(),h=p?m.filter(A=>A.name.toLowerCase().includes(p)||A.slug.toLowerCase().includes(p)):m;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=A=>f(A.target.value),e[3]=x):x=e[3];let b;e[4]!==u?(b=A=>A.key==="Escape"&&u&&f(""),e[4]=u,e[5]=b):b=e[5];let j;e[6]!==i?(j=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=j):j=e[7];let S;e[8]!==u||e[9]!==b||e[10]!==j?(S=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:u,onChange:x,onKeyDown:b,placeholder:j,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=u,e[9]=b,e[10]=j,e[11]=S):S=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Me,{size:16}),e[12]=y):y=e[12];let v;e[13]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[13]=o,e[14]=v):v=e[14];let C;e[15]!==S||e[16]!==v?(C=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,S,v]}),e[15]=S,e[16]=v,e[17]=C):C=e[17];const N="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let _;e[18]!==a||e[19]!==u||e[20]!==d?(_=!u&&a.map(A=>s.jsx(Zo,{invitation:A,onChanged:d},A.id)),e[18]=a,e[19]=u,e[20]=d,e[21]=_):_=e[21];const w=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?i("header.orgSwitcher.noOrganizationsMatch",{query:u}):i("header.orgSwitcher.noOrganizationsAvailable")});let I;e[22]!==l||e[23]!==n?(I=A=>s.jsxs("button",{type:"button",onClick:()=>l(A.slug),className:U("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",A.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(qe,{org:A,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:A.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.slug})]}),A.slug===n&&s.jsx(Oe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},A.id),e[22]=l,e[23]=n,e[24]=I):I=e[24];const $=h.map(I);let k;e[25]!==_||e[26]!==w||e[27]!==$?(k=s.jsxs("div",{className:N,children:[_,w,$]}),e[25]=_,e[26]=w,e[27]=$,e[28]=k):k=e[28];let O;return e[29]!==k||e[30]!==C?(O=s.jsxs(s.Fragment,{children:[C,k]}),e[29]=k,e[30]=C,e[31]=O):O=e[31],O}function Cs(t){const e=z.c(22),{trigger:n,orgParam:l,align:o,side:i}=t,r=o===void 0?"start":o,a=i===void 0?"bottom":i,d=ie(),[c,m]=G.useState(!1),[u,f]=G.useState(!1);let p;e[0]!==n?(p=s.jsx(ke,{asChild:!0,children:n}),e[0]=n,e[1]=p):p=e[1];const h=String(c);let g;e[2]!==d?(g=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=g):g=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let b;e[5]!==l||e[6]!==h||e[7]!==g?(b=s.jsx(el,{orgParam:l,onSelectOrg:g,onCreateOrg:x},h),e[5]=l,e[6]=h,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==r||e[10]!==a||e[11]!==b?(j=s.jsx(He,{side:a,align:r,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:sl,onCloseAutoFocus:tl,children:b}),e[9]=r,e[10]=a,e[11]=b,e[12]=j):j=e[12];let S;e[13]!==c||e[14]!==p||e[15]!==j?(S=s.jsxs(Ue,{open:c,onOpenChange:m,children:[p,j]}),e[13]=c,e[14]=p,e[15]=j,e[16]=S):S=e[16];let y;e[17]!==u?(y=s.jsx(Xo,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let v;return e[19]!==y||e[20]!==S?(v=s.jsxs(s.Fragment,{children:[S,y]}),e[19]=y,e[20]=S,e[21]=v):v=e[21],v}function tl(t){return t.preventDefault()}function sl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function nl(t){const e=z.c(21),{value:n,onChange:l,placeholder:o,onKeyDown:i,className:r,isSearching:a,disabled:d}=t,c=o===void 0?"Search...":o;let m;e[0]!==r?(m=U("shrink-0 w-full border-b border-border h-12",r),e[0]=r,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=U("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let p;e[4]!==a?(p=a?s.jsx(Kt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(rs,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=p):p=e[5];let h;e[6]!==l?(h=j=>l(j.target.value),e[6]=l,e[7]=h):h=e[7];let g;e[8]!==d||e[9]!==i||e[10]!==c||e[11]!==h||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:h,onKeyDown:i,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]=i,e[10]=c,e[11]=h,e[12]=n,e[13]=g):g=e[13];let x;e[14]!==f||e[15]!==p||e[16]!==g?(x=s.jsxs("label",{className:f,children:[p,g]}),e[14]=f,e[15]=p,e[16]=g,e[17]=x):x=e[17];let b;return e[18]!==m||e[19]!==x?(b=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=b):b=e[20],b}function ol(t){const e=z.c(6),{value:n,onChange:l}=t,o=B();let i;e[0]!==o?(i=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i||e[4]!==n?(r=s.jsx(nl,{value:n,onChange:l,placeholder:i}),e[2]=l,e[3]=i,e[4]=n,e[5]=r):r=e[5],r}function ll(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:n}),t[2]=n,t[3]=l):l=t[3],l}function il(t){const e=z.c(10),{org:n,onClose:l}=t,o=B();let i;e[0]!==n.slug?(i={org:n.slug},e[0]=n.slug,e[1]=i):i=e[1];let r;e[2]!==l?(r=()=>l(),e[2]=l,e[3]=r):r=e[3];let a;e[4]!==o?(a=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==i||e[7]!==r||e[8]!==a?(d=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(qt,{to:"/$org/settings/agents",params:i,onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:a})}),e[6]=i,e[7]=r,e[8]=a,e[9]=d):d=e[9],d}function rl(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx(Ns,{children:n}),t[2]=n,t[3]=l):l=t[3],l}function al(t){const e=z.c(11),{onImportFromGithub:n}=t,l=B();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Hn,{className:"size-3.5"}),e[0]=o):o=e[0];let i;e[1]!==l?(i=l("sidebar.agentsSection.import"),e[1]=l,e[2]=i):i=e[2];let r;e[3]!==n||e[4]!==i?(r=s.jsxs("button",{type:"button",onClick:n,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:[o,i]}),e[3]=n,e[4]=i,e[5]=r):r=e[5];let a;e[6]!==l?(a=l("sidebar.agentsSection.codeAgents"),e[6]=l,e[7]=a):a=e[7];let d;return e[8]!==r||e[9]!==a?(d=s.jsx(Ns,{action:r,children:a}),e[8]=r,e[9]=a,e[10]=d):d=e[10],d}function cl(t){const e=z.c(11),{setOpen:n,emptyCtaClass:l}=t,o=B();let i;e[0]!==o?(i=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i):i=e[1];let r;e[2]!==l?(r=U(l),e[2]=l,e[3]=r):r=e[3];let a;e[4]!==n?(a=()=>{Y("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[4]=n,e[5]=a):a=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Me,{className:"size-4"}),e[6]=d):d=e[6];let c;return e[7]!==i||e[8]!==r||e[9]!==a?(c=s.jsx(je,{"aria-label":i,className:r,onClick:a,children:d}),e[7]=i,e[8]=r,e[9]=a,e[10]=c):c=e[10],c}function dl(t){const e=z.c(17),{setOpen:n,highlightEmpty:l,emptyCtaClass:o}=t,i=B();let r;e[0]!==l||e[1]!==i?(r=l?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=l,e[1]=i,e[2]=r):r=e[2];let a;e[3]!==o?(a=U(o),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==n?(d=()=>{Y("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[5]=n,e[6]=d):d=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Me,{}),e[7]=c):c=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let u;e[10]!==m?(u=s.jsx("span",{children:m}),e[10]=m,e[11]=u):u=e[11];let f;return e[12]!==r||e[13]!==a||e[14]!==d||e[15]!==u?(f=s.jsx(W,{children:s.jsxs(Q,{tooltip:r,className:a,onClick:d,children:[c,u]})}),e[12]=r,e[13]=a,e[14]=d,e[15]=u,e[16]=f):f=e[16],f}function ml(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx(ds,{className:"sr-only",children:n}),t[2]=n,t[3]=l):l=t[3],l}function ul(t){const e=z.c(8),{emptyCtaClass:n}=t,l=B();let o;e[0]!==l?(o=l("sidebar.agentsSection.browseAgents"),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n?(i=U(n),e[2]=n,e[3]=i):i=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Me,{className:"size-4"}),e[4]=r):r=e[4];let a;return e[5]!==o||e[6]!==i?(a=s.jsx(je,{"aria-label":o,className:i,children:r}),e[5]=o,e[6]=i,e[7]=a):a=e[7],a}function fl(t){const e=z.c(19),{wrapEmptyHint:n,highlightEmpty:l,emptyCtaClass:o}=t,i=B();let r;e[0]!==l||e[1]!==i?(r=l?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=l,e[1]=i,e[2]=r):r=e[2];let a;e[3]!==o?(a=U(o),e[3]=o,e[4]=a):a=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Me,{}),e[5]=d):d=e[5];let c;e[6]!==i?(c=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=c):c=e[7];let m;e[8]!==c?(m=s.jsx("span",{children:c}),e[8]=c,e[9]=m):m=e[9];let u;e[10]!==r||e[11]!==a||e[12]!==m?(u=s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{tooltip:r,className:a,children:[d,m]})}),e[10]=r,e[11]=a,e[12]=m,e[13]=u):u=e[13];let f;e[14]!==u||e[15]!==n?(f=n(u),e[14]=u,e[15]=n,e[16]=f):f=e[16];let p;return e[17]!==f?(p=s.jsx(W,{children:f}),e[17]=f,e[18]=p):p=e[18],p}function pl(t){const e=z.c(9),{children:n}=t,l=B();let o;e[0]!==n?(o=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==l?(i=l("sidebar.agentsSection.selectAnExistingAgent"),e[2]=l,e[3]=i):i=e[3];let r;e[4]!==i?(r=s.jsx(pe,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=r):r=e[5];let a;return e[6]!==o||e[7]!==r?(a=s.jsxs(he,{defaultOpen:!0,delayDuration:0,children:[o,r]}),e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function hl(t){const e=ie(),{create:n}=ms(),{locator:l}=J(),o=ct({strict:!1}),i=Be({strict:!1});return async r=>{const a=crypto.randomUUID(),d=r===i.virtualmcpid?qn(t,l,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:r,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:r}})}}function Je(t){const e=z.c(20),{agent:n,selected:l,onClick:o}=t,i=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let r;e[0]!==i?(r=U("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(be,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(Oe,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==o||e[15]!==r||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:o,className:r,children:[a,m,u]}),e[14]=o,e[15]=r,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ns(t){const e=z.c(5),{children:n,action:l}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;return e[2]!==l||e[3]!==o?(i=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,l]}),e[2]=l,e[3]=o,e[4]=i):i=e[4],i}function xl(t){const e=z.c(23),{onClose:n,onSelectAgent:l,selectedAgentId:o,onImportFromGithub:i}=t,[r,a]=G.useState(""),d=os(),c=d??[],{org:m}=J(),{data:u}=oe.useSession(),f=u?.user?.id??"anon",p=Xn(d),h=Qn(),g=hl(m.slug),x=Zn(d),b=r.toLowerCase(),j=c.filter(vl).filter(L=>!x.has(L.id)).filter(jl).filter(L=>!r||L.title.toLowerCase().includes(b)),S=j.filter(bl),y=j.filter(gl),v=Re(m.id),C=!r||v.title.toLowerCase().includes(b),N=!!(l&&C);let _;e[0]!==n||e[1]!==l?(_=()=>{l?.(null),n(),a("")},e[0]=n,e[1]=l,e[2]=_):_=e[2];const w=_,I=L=>{if(l){l(L.id),n(),a("");return}Jn({orgId:m.id,userId:f},L.id,p),h(),n(),a(""),g(L.id)},$="flex flex-col max-h-[min(640px,80dvh)]";let k;e[3]!==r?(k=s.jsx(ol,{value:r,onChange:a}),e[3]=r,e[4]=k):k=e[4];const O="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",A=l&&C&&v&&s.jsx(Je,{agent:v,selected:!o||o===v.id,onClick:w}),M=(S.length>0||!r)&&s.jsx(al,{onImportFromGithub:i}),F=S.map(L=>s.jsx(Je,{agent:L,selected:l?o===L.id:void 0,onClick:()=>I(L)},L.id)),R=y.length>0&&s.jsx(rl,{}),D=y.map(L=>s.jsx(Je,{agent:L,selected:l?o===L.id:void 0,onClick:()=>I(L)},L.id));let T;e[5]!==N||e[6]!==r||e[7]!==j.length?(T=j.length===0&&!N&&r&&s.jsx(ll,{}),e[5]=N,e[6]=r,e[7]=j.length,e[8]=T):T=e[8];let E;e[9]!==T||e[10]!==A||e[11]!==M||e[12]!==F||e[13]!==R||e[14]!==D?(E=s.jsxs("div",{className:O,children:[A,M,F,R,D,T]}),e[9]=T,e[10]=A,e[11]=M,e[12]=F,e[13]=R,e[14]=D,e[15]=E):E=e[15];let H;e[16]!==n||e[17]!==m?(H=s.jsx(il,{org:m,onClose:n}),e[16]=n,e[17]=m,e[18]=H):H=e[18];let q;return e[19]!==E||e[20]!==H||e[21]!==k?(q=s.jsxs("div",{className:$,children:[k,E,H]}),e[19]=E,e[20]=H,e[21]=k,e[22]=q):q=e[22],q}function gl(t){return!fs(t.metadata)}function bl(t){return fs(t.metadata)}function jl(t){return!xn(t.id)}function vl(t){return!hn(t.id)}function yl(t){const e=z.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:o,onSelectAgent:i,selectedAgentId:r,side:a,align:d}=n,c=l===void 0?!1:l,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,p]=G.useState(!1),[h,g]=G.useState(!1),x=ut(),{setOpenMobile:b}=de(),j=Yn(),S=j?"border border-border":void 0;let y;e[2]!==j?(y=M=>j?s.jsx(pl,{children:M}):M,e[2]=j,e[3]=y):y=e[3];const v=y;let C;e[4]!==x||e[5]!==b?(C=()=>{p(!1),x&&b(!1)},e[4]=x,e[5]=b,e[6]=C):C=e[6];const N=C;let _;e[7]!==N?(_=()=>{N(),g(!0)},e[7]=N,e[8]=_):_=e[8];const w=_;let I;e[9]!==N||e[10]!==w||e[11]!==i||e[12]!==f||e[13]!==r?(I=f&&s.jsx(G.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(le,{className:"h-4 w-24"})}),children:s.jsx(xl,{onClose:N,onSelectAgent:i,selectedAgentId:r,onImportFromGithub:w})}),e[9]=N,e[10]=w,e[11]=i,e[12]=f,e[13]=r,e[14]=I):I=e[14];const $=I;let k;e[15]!==u||e[16]!==c||e[17]!==S||e[18]!==j||e[19]!==x||e[20]!==f||e[21]!==$||e[22]!==m||e[23]!==o||e[24]!==v?(k=x?s.jsxs(s.Fragment,{children:[o?s.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:o}):c?v(s.jsx(cl,{setOpen:p,emptyCtaClass:S})):s.jsx(dl,{setOpen:p,highlightEmpty:j,emptyCtaClass:S}),s.jsx(as,{open:f,onOpenChange:p,direction:"bottom",children:s.jsxs(cs,{className:"max-h-[85dvh] p-0",children:[s.jsx(ml,{}),$]})})]}):s.jsxs(Ue,{open:f,onOpenChange:M=>{M&&!f&&Y("agent_browser_opened",{surface:"desktop_popover"}),p(M)},children:[o?s.jsx(ke,{asChild:!0,children:o}):c?v(s.jsx(ke,{asChild:!0,children:s.jsx(ul,{emptyCtaClass:S})})):s.jsx(fl,{wrapEmptyHint:v,highlightEmpty:j,emptyCtaClass:S}),s.jsx(He,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:$})]}),e[15]=u,e[16]=c,e[17]=S,e[18]=j,e[19]=x,e[20]=f,e[21]=$,e[22]=m,e[23]=o,e[24]=v,e[25]=k):k=e[25];let O;e[26]!==h?(O=s.jsx(Un,{open:h,onOpenChange:g,mode:"agent"}),e[26]=h,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==k?(A=s.jsxs(s.Fragment,{children:[k,O]}),e[28]=O,e[29]=k,e[30]=A):A=e[30],A}const Sl="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-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 _l(t){const e=z.c(19),{agentId:n,fallback:l,onOpenHome:o,onPick:i}=t,r=gt(n)??l??null,a=r?.title??"Super Agent",d=`Open ${a} home`,c=r?.icon??null;let m;e[0]!==c||e[1]!==a?(m=s.jsx(be,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=m):m=e[2];let u;e[3]!==o||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:o,"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]=o,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=p):p=e[9];let h;e[10]!==f?(h=s.jsxs("button",{type:"button",className:Sl,children:[f,p]}),e[10]=f,e[11]=h):h=e[11];let g;e[12]!==n||e[13]!==i||e[14]!==h?(g=s.jsx(yl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:i,trigger:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==g?(x=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=x):x=e[18],x}function it(t){const e=z.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:l}=n,{org:o}=J(),{state:i,isMobile:r}=de(),a=_s().invitations.length>0,d=i==="collapsed"||r,c=a?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let m;e[2]!==o?(m=s.jsx(qe,{org:o,size:"sm"}),e[2]=o,e[3]=m):m=e[3];let u;e[4]!==a||e[5]!==d?(u=a&&s.jsx("span",{className:U("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[m,u]}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o.name||e[11]!==l?(p=l&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=l,e[12]=p):p=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=h):h=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==p?(g=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] 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:[f,p,h]})}),e[14]=c,e[15]=f,e[16]=p,e[17]=g):g=e[17];let x;e[18]!==o.slug||e[19]!==g?(x=s.jsx(Cs,{orgParam:o.slug,trigger:g}),e[18]=o.slug,e[19]=g,e[20]=x):x=e[20];let b;e[21]!==o.name?(b=s.jsx(pe,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==x?(j=s.jsxs(he,{children:[x,b]}),e[23]=b,e[24]=x,e[25]=j):j=e[25],j}function Ve(t){const e=z.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:l}=n,{org:o}=J(),i=ie();let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[2]=r):r=e[2];const a=ct(r);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const c=Be(d),{threads:m}=bt(),{data:u}=oe.useSession(),{setTaskId:f,createNewTask:p}=jt();let h;e[4]!==o.id?(h=Re(o.id),e[4]=o.id,e[5]=h):h=e[5];const g=h,x=g.id,b=a.taskId?c.virtualmcpid??x:x;let j;e[6]!==p||e[7]!==x||e[8]!==i||e[9]!==l||e[10]!==o.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==m?(j=_=>{if(!_||_===x){i({to:"/$org",params:{org:o.slug}}),l?.();return}const w=no(m,_,u?.user?.id);w?f(w.id,_):p(_),l?.()},e[6]=p,e[7]=x,e[8]=i,e[9]=l,e[10]=o.slug,e[11]=u?.user?.id,e[12]=f,e[13]=m,e[14]=j):j=e[14];const S=j;let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=y):y=e[15];const v=b===x?g:void 0;let C;e[16]!==b||e[17]!==S?(C=()=>S(b),e[16]=b,e[17]=S,e[18]=C):C=e[18];let N;return e[19]!==b||e[20]!==S||e[21]!==v||e[22]!==C?(N=s.jsx(G.Suspense,{fallback:y,children:s.jsx(_l,{agentId:b,fallback:v,onOpenHome:C,onPick:S})}),e[19]=b,e[20]=S,e[21]=v,e[22]=C,e[23]=N):N=e[23],N}function At(t){const e=z.c(18),{item:n,onClose:l}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=U(o),e[0]=o,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==l?(r=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==r||e[12]!==a||e[13]!==d?(c=s.jsxs(Q,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=r,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(W,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function Cl(t){const e=z.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Vt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let r;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(At,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],r=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(vs,{label:o,defaultExpanded:i,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==l||e[12]!==n.items){let r;e[14]!==l?(r=a=>s.jsx(At,{item:a,onClose:l},a.key),e[14]=l,e[15]=r):r=e[15],o=n.items.map(r),e[11]=l,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(te,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Nl(t){const e=z.c(27),{sections:n,onClose:l,footer:o,additionalContent:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(it,{}),e[0]=r):r=e[0];let a;e[1]!==l?(a=s.jsx(Ve,{onNavigate:l}),e[1]=l,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1"}),e[3]=d):d=e[3];const c=B();let m;e[4]!==c?(m=c("sidebar.navigationMobile.closeSidebar"),e[4]=c,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ss,{size:16}),e[6]=u):u=e[6];let f;e[7]!==l||e[8]!==m?(f=s.jsx(je,{onClick:l,"aria-label":m,children:u}),e[7]=l,e[8]=m,e[9]=f):f=e[9];let p;e[10]!==a||e[11]!==f?(p=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[r,a,d,f]}),e[10]=a,e[11]=f,e[12]=p):p=e[12];let h;if(e[13]!==l||e[14]!==n){let j;e[16]!==l?(j=(S,y)=>s.jsx(Cl,{section:S,onClose:l},y),e[16]=l,e[17]=j):j=e[17],h=n.map(j),e[13]=l,e[14]=n,e[15]=h}else h=e[15];let g;e[18]!==i?(g=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[18]=i,e[19]=g):g=e[19];let x;e[20]!==g||e[21]!==h?(x=s.jsxs(Yt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[h,g]}),e[20]=g,e[21]=h,e[22]=x):x=e[22];let b;return e[23]!==o||e[24]!==x||e[25]!==p?(b=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[p,x,o]}),e[23]=o,e[24]=x,e[25]=p,e[26]=b):b=e[26],b}function we(t){const e=z.c(26),{item:n,onClose:l}=t;let o;e[0]!==n.className?(o=U("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",n.className),e[0]=n.className,e[1]=o):o=e[1];const i=o;if(n.href){const m=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let p;e[4]!==n.label?(p=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=p):p=e[5];let h;return e[6]!==i||e[7]!==n.href||e[8]!==l||e[9]!==m||e[10]!==u||e[11]!==f||e[12]!==p?(h=s.jsxs("a",{href:n.href,target:m,rel:u,className:i,onClick:l,children:[f,p]}),e[6]=i,e[7]=n.href,e[8]=l,e[9]=m,e[10]=u,e[11]=f,e[12]=p,e[13]=h):h=e[13],h}let r;e[14]!==n||e[15]!==l?(r=()=>{n.onClick?.(),l()},e[14]=n,e[15]=l,e[16]=r):r=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let d;e[19]!==n.label?(d=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=d):d=e[20];let c;return e[21]!==i||e[22]!==r||e[23]!==a||e[24]!==d?(c=s.jsxs("button",{type:"button",onClick:r,className:i,children:[a,d]}),e[21]=i,e[22]=r,e[23]=a,e[24]=d,e[25]=c):c=e[25],c}function wl(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("common.accountPopover.impersonating"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:n}),t[2]=n,t[3]=l):l=t[3],l}function It(t){const e=z.c(38),{user:n,userImage:l,isImpersonating:o,isMobile:i}=t,r=B(),a=i?"py-4 border-b border-border":"py-3 mx-1 mt-1";let d;e[0]!==a?(d=U("flex items-center gap-3 px-4",a),e[0]=a,e[1]=d):d=e[1];const c=n?.name??"U";let m;e[2]!==c||e[3]!==l?(m=s.jsx(nt,{url:l,fallback:c,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=c,e[3]=l,e[4]=m):m=e[4];let u;e[5]!==r||e[6]!==n?.name?(u=n?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=n?.name,e[7]=u):u=e[7];let f;e[8]!==u?(f=s.jsx("p",{className:"text-sm font-medium truncate",children:u}),e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o?(p=o&&s.jsx(wl,{}),e[10]=o,e[11]=p):p=e[11];let h;e[12]!==f||e[13]!==p?(h=s.jsxs("div",{className:"flex items-center gap-2",children:[f,p]}),e[12]=f,e[13]=p,e[14]=h):h=e[14];const g=n?.email;let x;e[15]!==g?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=x):x=e[16];let b;e[17]!==x||e[18]!==h?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,x]}),e[17]=x,e[18]=h,e[19]=b):b=e[19];let j;e[20]!==r||e[21]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{ee.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=n,e[22]=j):j=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ot,{size:14}),e[23]=S):S=e[23];let y;e[24]!==j?(y=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[24]=j,e[25]=y):y=e[25];let v;e[26]!==r?(v=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=v):v=e[27];let C;e[28]!==v?(C=s.jsx(pe,{side:"right",children:s.jsx("p",{className:"text-xs",children:v})}),e[28]=v,e[29]=C):C=e[29];let N;e[30]!==y||e[31]!==C?(N=s.jsx(ns,{delayDuration:300,children:s.jsxs(he,{children:[y,C]})}),e[30]=y,e[31]=C,e[32]=N):N=e[32];let _;return e[33]!==b||e[34]!==N||e[35]!==d||e[36]!==m?(_=s.jsxs("div",{className:d,children:[m,b,N]}),e[33]=b,e[34]=N,e[35]=d,e[36]=m,e[37]=_):_=e[37],_}function zt(t){const e=z.c(35),{themeOptions:n,preferences:l,setPreferences:o,isMobile:i}=t,r=B(),a=i?"size-8":"size-7",d=i?"px-3 py-3":"px-2 py-1.5";let c;e[0]!==d?(c=U("flex items-center justify-between border-t border-border/50",d),e[0]=d,e[1]=c):c=e[1];let m;if(e[2]!==a||e[3]!==l.theme||e[4]!==o||e[5]!==n){let v;e[7]!==a||e[8]!==l.theme||e[9]!==o?(v=C=>{const{value:N,icon:_,label:w}=C;return s.jsx("button",{type:"button","aria-label":w,onClick:()=>o(I=>({...I,theme:N})),className:U(a,"rounded-md flex items-center justify-center transition-colors",l.theme===N?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:_},N)},e[7]=a,e[8]=l.theme,e[9]=o,e[10]=v):v=e[10],m=n.map(v),e[2]=a,e[3]=l.theme,e[4]=o,e[5]=n,e[6]=m}else m=e[6];let u;e[11]!==m?(u=s.jsx("div",{className:"flex items-center gap-0.5",children:m}),e[11]=m,e[12]=u):u=e[12];let f;e[13]!==l.enableSounds||e[14]!==r?(f=l.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=l.enableSounds,e[14]=r,e[15]=f):f=e[15];let p;e[16]!==o?(p=()=>o(kl),e[16]=o,e[17]=p):p=e[17];const h=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let g;e[18]!==a||e[19]!==h?(g=U(a,"rounded-md flex items-center justify-center transition-colors",h),e[18]=a,e[19]=h,e[20]=g):g=e[20];let x;e[21]!==l.enableSounds?(x=l.enableSounds?s.jsx(gn,{size:14}):s.jsx(bn,{size:14}),e[21]=l.enableSounds,e[22]=x):x=e[22];let b;e[23]!==f||e[24]!==p||e[25]!==g||e[26]!==x?(b=s.jsx("button",{type:"button","aria-label":f,onClick:p,className:g,children:x}),e[23]=f,e[24]=p,e[25]=g,e[26]=x,e[27]=b):b=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.99.2"]}),e[28]=j):j=e[28];let S;e[29]!==b?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[b,j]}),e[29]=b,e[30]=S):S=e[30];let y;return e[31]!==S||e[32]!==c||e[33]!==u?(y=s.jsxs("div",{className:c,children:[u,S]}),e[31]=S,e[32]=c,e[33]=u,e[34]=y):y=e[34],y}function kl(t){return{...t,enableSounds:!t.enableSounds}}function $t(t){const e=z.c(54),{user:n,userImage:l,menuItems:o,signOutItem:i,stopImpersonatingItem:r,isImpersonating:a,themeOptions:d,preferences:c,setPreferences:m,close:u,isMobile:f}=t;if(f){let y;e[0]!==a||e[1]!==n||e[2]!==l?(y=s.jsx(It,{user:n,userImage:l,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=l,e[3]=y):y=e[3];let v;if(e[4]!==u||e[5]!==o){let $;e[7]!==u?($=k=>s.jsx(we,{item:k,onClose:u},k.key),e[7]=u,e[8]=$):$=e[8],v=o.map($),e[4]=u,e[5]=o,e[6]=v}else v=e[6];let C;e[9]!==u||e[10]!==r?(C=r&&s.jsx(we,{item:r,onClose:u}),e[9]=u,e[10]=r,e[11]=C):C=e[11];let N;e[12]!==u||e[13]!==i?(N=s.jsx(we,{item:i,onClose:u}),e[12]=u,e[13]=i,e[14]=N):N=e[14];let _;e[15]!==v||e[16]!==C||e[17]!==N?(_=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,C,N]})}),e[15]=v,e[16]=C,e[17]=N,e[18]=_):_=e[18];let w;e[19]!==c||e[20]!==m||e[21]!==d?(w=s.jsx(zt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!0}),e[19]=c,e[20]=m,e[21]=d,e[22]=w):w=e[22];let I;return e[23]!==y||e[24]!==_||e[25]!==w?(I=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,_,w]}),e[23]=y,e[24]=_,e[25]=w,e[26]=I):I=e[26],I}let p;e[27]!==a||e[28]!==n||e[29]!==l?(p=s.jsx(It,{user:n,userImage:l,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=l,e[30]=p):p=e[30];let h;if(e[31]!==u||e[32]!==o){let y;e[34]!==u?(y=v=>s.jsx(we,{item:v,onClose:u},v.key),e[34]=u,e[35]=y):y=e[35],h=o.map(y),e[31]=u,e[32]=o,e[33]=h}else h=e[33];let g;e[36]!==u||e[37]!==r?(g=r&&s.jsx(we,{item:r,onClose:u}),e[36]=u,e[37]=r,e[38]=g):g=e[38];let x;e[39]!==u||e[40]!==i?(x=s.jsx(we,{item:i,onClose:u}),e[39]=u,e[40]=i,e[41]=x):x=e[41];let b;e[42]!==h||e[43]!==g||e[44]!==x?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[h,g,x]}),e[42]=h,e[43]=g,e[44]=x,e[45]=b):b=e[45];let j;e[46]!==c||e[47]!==m||e[48]!==d?(j=s.jsx(zt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!1}),e[46]=c,e[47]=m,e[48]=d,e[49]=j):j=e[49];let S;return e[50]!==p||e[51]!==b||e[52]!==j?(S=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[p,b,j]})}),e[50]=p,e[51]=b,e[52]=j,e[53]=S):S=e[53],S}function ze(){const t=z.c(99),e=B(),{data:n}=oe.useSession(),{org:l}=J(),o=ie();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=Hs(i)?.params.org,[d,c]=Ut(),m=ut(),{isAdmin:u}=po(),[f,p]=G.useState(!1),h=n?.user,g=h?.image,x=!!n?.session?.impersonatedBy;let b;t[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>p(!1),t[1]=b):b=t[1];const j=b;let S;t[2]!==e?(S=e("common.accountPopover.preferences"),t[2]=e,t[3]=S):S=t[3];let y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(We,{size:16}),t[4]=y):y=t[4];let v;t[5]!==o||t[6]!==a?(v=()=>{o({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=o,t[6]=a,t[7]=v):v=t[7];let C;t[8]!==S||t[9]!==v?(C={key:"preferences",label:S,icon:y,onClick:v},t[8]=S,t[9]=v,t[10]=C):C=t[10];let N;t[11]!==l||t[12]!==o||t[13]!==e?(N=l?[{key:"install-app",label:e("common.accountPopover.addToHomeScreen"),icon:s.jsx(oo,{size:16}),onClick:()=>{o({to:"/$org/install",params:{org:l.slug}})}},{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(ro,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:l.slug}})}}]:[],t[11]=l,t[12]=o,t[13]=e,t[14]=N):N=t[14];let _;t[15]!==e?(_=e("common.accountPopover.termsOfUse"),t[15]=e,t[16]=_):_=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(io,{size:16}),t[17]=w):w=t[17];let I;t[18]!==_?(I={key:"terms",label:_,icon:w,href:"https://www.decocms.com/terms-of-use",external:!0},t[18]=_,t[19]=I):I=t[19];let $;t[20]!==e?($=e("common.accountPopover.privacyPolicy"),t[20]=e,t[21]=$):$=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(uo,{size:16}),t[22]=k):k=t[22];let O;t[23]!==$?(O={key:"privacy",label:$,icon:k,href:"https://www.decocms.com/privacy-policy",external:!0},t[23]=$,t[24]=O):O=t[24];let A;t[25]!==e?(A=e("common.accountPopover.githubRepo"),t[25]=e,t[26]=A):A=t[26];let M;t[27]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Us,{className:"w-4 h-4"}),t[27]=M):M=t[27];let F;t[28]!==A?(F={key:"github",label:A,icon:M,href:"https://github.com/decocms/studio",external:!0},t[28]=A,t[29]=F):F=t[29];let R;t[30]!==e?(R=e("common.accountPopover.community"),t[30]=e,t[31]=R):R=t[31];let D;t[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(fo,{size:16}),t[32]=D):D=t[32];let T;t[33]!==R?(T={key:"community",label:R,icon:D,href:"https://decocms.com/discord",external:!0},t[33]=R,t[34]=T):T=t[34];let E;t[35]!==e?(E=e("common.accountPopover.homepage"),t[35]=e,t[36]=E):E=t[36];let H;t[37]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(lo,{size:16}),t[37]=H):H=t[37];let q;t[38]!==E?(q={key:"homepage",label:E,icon:H,href:"https://decocms.com",external:!0},t[38]=E,t[39]=q):q=t[39];let L;t[40]!==u||t[41]!==o||t[42]!==e?(L=u?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(ls,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[40]=u,t[41]=o,t[42]=e,t[43]=L):L=t[43];let se;t[44]!==O||t[45]!==F||t[46]!==T||t[47]!==q||t[48]!==L||t[49]!==C||t[50]!==N||t[51]!==I?(se=[C,...N,I,O,F,T,q,...L],t[44]=O,t[45]=F,t[46]=T,t[47]=q,t[48]=L,t[49]=C,t[50]=N,t[51]=I,t[52]=se):se=t[52];const me=se;let re;t[53]!==e?(re=e("common.accountPopover.signOut"),t[53]=e,t[54]=re):re=t[54];let ue;t[55]===Symbol.for("react.memo_cache_sentinel")?(ue=s.jsx(Ct,{size:16}),t[55]=ue):ue=t[55];let ve;t[56]!==re?(ve={key:"logout",label:re,icon:ue,onClick:Il},t[56]=re,t[57]=ve):ve=t[57];const ye=ve;let Se;t[58]!==x||t[59]!==e?(Se=x?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(Ct,{size:16}),onClick:async()=>{const{error:yt}=await oe.admin.stopImpersonating();if(yt){ee.error(yt.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[58]=x,t[59]=e,t[60]=Se):Se=t[60];const _e=Se;let Ce;t[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(co,{size:14}),t[61]=Ce):Ce=t[61];let xe;t[62]!==e?(xe=e("common.accountPopover.lightTheme"),t[62]=e,t[63]=xe):xe=t[63];let ne;t[64]!==xe?(ne={value:"light",icon:Ce,label:xe},t[64]=xe,t[65]=ne):ne=t[65];let Ne;t[66]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(mo,{size:14}),t[66]=Ne):Ne=t[66];let ae;t[67]!==e?(ae=e("common.accountPopover.darkTheme"),t[67]=e,t[68]=ae):ae=t[68];let P;t[69]!==ae?(P={value:"dark",icon:Ne,label:ae},t[69]=ae,t[70]=P):P=t[70];let K;t[71]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(lt,{size:14}),t[71]=K):K=t[71];let X;t[72]!==e?(X=e("common.accountPopover.systemTheme"),t[72]=e,t[73]=X):X=t[73];let V;t[74]!==X?(V={value:"system",icon:K,label:X},t[74]=X,t[75]=V):V=t[75];let ge;t[76]!==ne||t[77]!==P||t[78]!==V?(ge=[ne,P,V],t[76]=ne,t[77]=P,t[78]=V,t[79]=ge):ge=t[79];const Xe=ge;let Te;t[80]!==x||t[81]!==m||t[82]!==me||t[83]!==d||t[84]!==c||t[85]!==ye||t[86]!==_e||t[87]!==Xe||t[88]!==h||t[89]!==g?(Te={user:h,userImage:g,menuItems:me,signOutItem:ye,stopImpersonatingItem:_e,isImpersonating:x,themeOptions:Xe,preferences:d,setPreferences:c,close:j,isMobile:m},t[80]=x,t[81]=m,t[82]=me,t[83]=d,t[84]=c,t[85]=ye,t[86]=_e,t[87]=Xe,t[88]=h,t[89]=g,t[90]=Te):Te=t[90];const Pe=Te;let De;return t[91]!==x||t[92]!==m||t[93]!==f||t[94]!==Pe||t[95]!==e||t[96]!==h?.name||t[97]!==g?(De=s.jsx(s.Fragment,{children:m?s.jsxs(as,{open:f,onOpenChange:p,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>p(!0),className:U("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",x&&"border-2 border-dashed border-warning"),children:[s.jsx(nt,{url:g,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(cs,{className:"h-[80dvh] p-0",children:[s.jsx(ds,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx($t,{...Pe})]})]}):s.jsxs(Ue,{open:f,onOpenChange:p,children:[s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{tooltip:h?.name??e("common.accountPopover.defaultAccountLabel"),className:U("rounded-md",x&&"border-2 border-dashed border-warning"),children:[s.jsx(nt,{url:g,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(He,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Al,children:s.jsx($t,{...Pe})})]})}),t[91]=x,t[92]=m,t[93]=f,t[94]=Pe,t[95]=e,t[96]=h?.name,t[97]=g,t[98]=De):De=t[98],De}function Al(t){return t.preventDefault()}function Il(){Y("signed_out",{source:"account_popover"}),Ws(),oe.signOut()}const zl=["Browse and edit your Library files","Run your agents","Enable and call any MCP tool in this org"],$l="Connect: ";function Ol(){return typeof window>"u"?"unknown host":window.location.hostname}function Ml(t){const e=z.c(45),{onClose:n}=t,{org:l}=J();let o;e[0]!==l.slug?(o=ho(l.slug),e[0]=l.slug,e[1]=o):o=e[1];const i=o,r=xo(),[a,d]=G.useState(null),c=Nt(),m=Nt();let u;e[2]!==r||e[3]!==l.slug?(u=()=>{r.mutate({name:`${$l}Claude Code on ${Ol()}`,permissions:{"*":["*"]}},{onSuccess:F=>{const R=go(l.slug,F.key);d(R),Y("connect_studio_generate",{target:"claude-code"}),navigator.clipboard?.writeText(R).then(El,Dl)},onError:Pl})},e[2]=r,e[3]=l.slug,e[4]=u):u=e[4];const f=u;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("span",{className:"size-8 rounded-lg bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(ps,{size:17})}),e[5]=p):p=e[5];let h;e[6]!==l.name?(h=s.jsxs(ft,{className:"flex items-center gap-2.5",children:[p,"Connect ",l.name," to Claude"]}),e[6]=l.name,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Qt,{children:"Hand Claude this org's MCP endpoint. Once linked, Claude can:"}),e[8]=g):g=e[8];let x;e[9]!==h?(x=s.jsxs(Jt,{children:[h,g]}),e[9]=h,e[10]=x):x=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("ul",{className:"flex flex-col gap-2 text-sm",children:zl.map(Tl)}),e[11]=b):b=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(St,{size:15,className:"text-muted-foreground"}),e[12]=j):j=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[j,"Claude Code",s.jsx("span",{className:"ml-auto text-[11px] font-medium text-special uppercase tracking-wide",children:"Recommended"})]}),e[13]=S):S=e[13];let y;e[14]!==a||e[15]!==c||e[16]!==r.isPending||e[17]!==f?(y=s.jsxs("section",{className:"rounded-xl border border-border bg-muted/30 p-4 flex flex-col gap-3",children:[S,a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-lg border border-border bg-background p-3 max-h-32 overflow-y-auto",children:s.jsx("code",{className:"text-xs leading-relaxed break-all font-mono text-foreground/90 whitespace-pre-wrap",children:a})}),s.jsxs(ce,{size:"sm",className:"gap-1.5 self-start",onClick:()=>{c.handleCopy(a),Y("connect_studio_copy",{target:"claude-code"}),ee.success("Command copied — paste it in your terminal")},children:[c.copied?s.jsx(Oe,{size:14}):s.jsx(ot,{size:14}),c.copied?"Copied":"Copy command"]}),s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2",children:[s.jsx(ls,{size:14,className:"text-warning shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-xs leading-relaxed text-foreground/80",children:["No login step — this command embeds a"," ",s.jsx("span",{className:"font-medium text-foreground",children:"full-access token"}),". Treat it like a password; revoke it any time in Settings → Connect."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"One command, no browser login. We'll mint a scoped access token and embed it so Claude Code connects instantly."}),s.jsxs(ce,{size:"sm",className:"gap-1.5 self-start",disabled:r.isPending,onClick:f,children:[s.jsx(St,{size:14}),r.isPending?"Generating…":"Generate connect command"]})]})]}),e[14]=a,e[15]=c,e[16]=r.isPending,e[17]=f,e[18]=y):y=e[18];let v,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(jn,{size:15,className:"text-muted-foreground"}),"Claude Desktop or claude.ai"]}),C=s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Add a custom connector in Settings → Connectors and paste this URL. Claude signs in with OAuth on first use."}),e[19]=v,e[20]=C):(v=e[19],C=e[20]);let N;e[21]!==i?(N=s.jsx("code",{className:"text-xs flex-1 min-w-0 truncate font-mono text-foreground/90",children:i}),e[21]=i,e[22]=N):N=e[22];let _;e[23]!==i||e[24]!==m?(_=()=>{m.handleCopy(i),Y("connect_studio_copy",{target:"claude-connector"})},e[23]=i,e[24]=m,e[25]=_):_=e[25];let w;e[26]!==m.copied?(w=m.copied?s.jsx(Oe,{size:14}):s.jsx(ot,{size:14}),e[26]=m.copied,e[27]=w):w=e[27];let I;e[28]!==_||e[29]!==w?(I=s.jsx(ce,{variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"Copy URL",onClick:_,children:w}),e[28]=_,e[29]=w,e[30]=I):I=e[30];let $;e[31]!==N||e[32]!==I?($=s.jsxs("section",{className:"flex flex-col gap-2.5",children:[v,C,s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 pl-3 pr-1.5 py-1.5 min-w-0",children:[N,I]})]}),e[31]=N,e[32]=I,e[33]=$):$=e[33];let k;e[34]!==l.slug?(k={org:l.slug},e[34]=l.slug,e[35]=k):k=e[35];let O;e[36]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(ht,{size:12}),e[36]=O):O=e[36];let A;e[37]!==n||e[38]!==k?(A=s.jsx("div",{className:"flex items-center border-t border-border pt-3",children:s.jsx(ce,{asChild:!0,variant:"link",size:"sm",className:"px-0 text-xs gap-1",children:s.jsxs(qt,{to:"/$org/settings/connect",params:k,onClick:n,children:["More clients & API keys ",O]})})}),e[37]=n,e[38]=k,e[39]=A):A=e[39];let M;return e[40]!==y||e[41]!==$||e[42]!==A||e[43]!==x?(M=s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[x,b,y,$,A]}),e[40]=y,e[41]=$,e[42]=A,e[43]=x,e[44]=M):M=e[44],M}function Tl(t){return s.jsxs("li",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"size-4 rounded-full bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(Oe,{size:11,strokeWidth:3})}),s.jsx("span",{className:"text-foreground",children:t})]},t)}function Pl(t){return ee.error(t.message)}function Dl(){return ee.success("Command ready — copy it below")}function El(){return ee.success("Command copied — paste it in your terminal")}function Fl(t){const e=z.c(6),{open:n,onOpenChange:l}=t;let o;e[0]!==l?(o=s.jsx(Xt,{className:"max-w-lg gap-4",children:s.jsx(Ml,{onClose:()=>l(!1)})}),e[0]=l,e[1]=o):o=e[1];let i;return e[2]!==l||e[3]!==n||e[4]!==o?(i=s.jsx(pt,{open:n,onOpenChange:l,children:o}),e[2]=l,e[3]=n,e[4]=o,e[5]=i):i=e[5],i}function $e(t){const e=z.c(50),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,o=B(),i=Gn(),[r,a]=G.useState(!1);let d,c;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online||e[4]!==o){const y=bo(i.capabilities,o);let v;e[7]!==i.online||e[8]!==o?(v=i.online?o("header.linkedDesktopIndicator.desktopLinked"):o("header.linkedDesktopIndicator.connectDesktop"),e[7]=i.online,e[8]=o,e[9]=v):v=e[9],d=v,c=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??o("header.linkedDesktopIndicator.desktopLinked")}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?o("header.linkedDesktopIndicator.availableCapabilities",{capabilities:y.join(", ")}):o("header.linkedDesktopIndicator.noCliAgents")})]}):s.jsx("span",{className:"text-xs",children:o("header.linkedDesktopIndicator.desktopDisconnected")}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d,e[6]=c}else d=e[5],c=e[6];const m=c;if(l==="full"){let y,v;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(lt,{}),e[10]=y,e[11]=v):(y=e[10],v=e[11]);let C;e[12]!==d?(C=s.jsx("span",{children:d}),e[12]=d,e[13]=C):C=e[13];let N;e[14]!==i.online?(N=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[14]=i.online,e[15]=N):N=e[15];let _;e[16]!==d||e[17]!==C||e[18]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(Q,{tooltip:d,onClick:y,children:[v,C,N]})}),e[16]=d,e[17]=C,e[18]=N,e[19]=_):_=e[19];let w;e[20]!==m?(w=s.jsx(pe,{side:"right",children:m}),e[20]=m,e[21]=w):w=e[21];let I;e[22]!==_||e[23]!==w?(I=s.jsxs(he,{children:[_,w]}),e[22]=_,e[23]=w,e[24]=I):I=e[24];let $;e[25]!==r?($=s.jsx(wt,{open:r,onOpenChange:a}),e[25]=r,e[26]=$):$=e[26];let k;return e[27]!==$||e[28]!==I?(k=s.jsxs(s.Fragment,{children:[I,$]}),e[27]=$,e[28]=I,e[29]=k):k=e[29],k}let u;e[30]===Symbol.for("react.memo_cache_sentinel")?(u=()=>a(!0),e[30]=u):u=e[30];let f;e[31]!==i.online||e[32]!==o?(f=i.online?o("header.linkedDesktopIndicator.desktopLinked"):o("header.linkedDesktopIndicator.connectYourDesktop"),e[31]=i.online,e[32]=o,e[33]=f):f=e[33];let p;e[34]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(lt,{size:16}),e[34]=p):p=e[34];let h;e[35]!==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[35]=i.online,e[36]=h):h=e[36];let g;e[37]!==f||e[38]!==h?(g=s.jsx(fe,{asChild:!0,children:s.jsxs(je,{onClick:u,"aria-label":f,children:[p,h]})}),e[37]=f,e[38]=h,e[39]=g):g=e[39];let x;e[40]!==m?(x=s.jsx(pe,{side:"bottom",children:m}),e[40]=m,e[41]=x):x=e[41];let b;e[42]!==g||e[43]!==x?(b=s.jsxs(he,{children:[g,x]}),e[42]=g,e[43]=x,e[44]=b):b=e[44];let j;e[45]!==r?(j=s.jsx(wt,{open:r,onOpenChange:a}),e[45]=r,e[46]=j):j=e[46];let S;return e[47]!==j||e[48]!==b?(S=s.jsxs(s.Fragment,{children:[b,j]}),e[47]=j,e[48]=b,e[49]=S):S=e[49],S}class Rl extends G.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 Ll(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Gl(){const t=z.c(17),e=ie(),{org:n}=J(),{hasDecoKey:l,balanceDollars:o}=eo();if(!l)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let r;t[2]!==o?(r=U(o!=null&&Ll(o)),t[2]=o,t[3]=r):r=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(vn,{}),t[7]=d):d=t[7];let c;t[8]!==o?(c=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,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]!==i||t[13]!==r||t[14]!==a||t[15]!==m?(u=s.jsx(te,{children:s.jsx(W,{children:s.jsxs(Q,{tooltip:i,className:r,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=r,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function Ot(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Rl,{children:s.jsx(G.Suspense,{fallback:null,children:s.jsx(Gl,{})})}),t[0]=e):e=t[0],e}function Ze(){const t=z.c(14),e=B(),n=ie(),{org:l}=J();let o;t[0]!==e?(o=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==n||t[3]!==l.slug?(i=()=>n({to:"/$org/settings",params:{org:l.slug}}),t[2]=n,t[3]=l.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(We,{}),t[5]=r):r=t[5];let a;t[6]!==e?(a=e("sidebar.sidebarFooter.settings"),t[6]=e,t[7]=a):a=t[7];let d;t[8]!==a?(d=s.jsx("span",{children:a}),t[8]=a,t[9]=d):d=t[9];let c;return t[10]!==o||t[11]!==i||t[12]!==d?(c=s.jsxs(Q,{tooltip:o,onClick:i,children:[r,d]}),t[10]=o,t[11]=i,t[12]=d,t[13]=c):c=t[13],c}function Bl(){const t=z.c(9),e=B(),n=ie(),{org:l}=J();let o;t[0]!==e?(o=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==n||t[3]!==l.slug?(i=()=>n({to:"/$org/settings",params:{org:l.slug}}),t[2]=n,t[3]=l.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(We,{size:15}),t[5]=r):r=t[5];let a;return t[6]!==o||t[7]!==i?(a=s.jsx("button",{type:"button","aria-label":o,onClick:i,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:r}),t[6]=o,t[7]=i,t[8]=a):a=t[8],a}function Mt(){const t=z.c(33),e=B(),[n,l]=G.useState(!1),[o,i]=G.useState(!1);let r;t[0]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=r):r=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(is,{}),t[2]=a):a=t[2];let d;t[3]!==e?(d=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=d):d=t[4];let c;t[5]!==d?(c=s.jsx("span",{children:d}),t[5]=d,t[6]=c):c=t[6];let m;t[7]!==r||t[8]!==c?(m=s.jsx(W,{children:s.jsx(hs,{trigger:s.jsxs(Q,{tooltip:r,children:[a,c]})})}),t[7]=r,t[8]=c,t[9]=m):m=t[9];let u;t[10]!==e?(u=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=u):u=t[11];let f,p;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(!0),p=s.jsx(ao,{}),t[12]=f,t[13]=p):(f=t[12],p=t[13]);let h;t[14]!==e?(h=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=h):h=t[15];let g;t[16]!==h?(g=s.jsx("span",{children:h}),t[16]=h,t[17]=g):g=t[17];let x;t[18]!==u||t[19]!==g?(x=s.jsx(W,{children:s.jsxs(Q,{tooltip:u,onClick:f,children:[p,g]})}),t[18]=u,t[19]=g,t[20]=x):x=t[20];let b;t[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(W,{children:s.jsxs(Q,{tooltip:"Connect to Claude",onClick:()=>{Y("connect_studio_opened",{source:"sidebar_footer"}),i(!0)},children:[s.jsx(ps,{}),s.jsx("span",{children:"Connect to Claude"})]})}),t[21]=b):b=t[21];let j;t[22]!==x||t[23]!==m?(j=s.jsxs(te,{className:"gap-0.5",children:[m,x,b]}),t[22]=x,t[23]=m,t[24]=j):j=t[24];let S;t[25]!==n?(S=s.jsx(to,{open:n,onOpenChange:l,mode:"browse"}),t[25]=n,t[26]=S):S=t[26];let y;t[27]!==o?(y=s.jsx(Fl,{open:o,onOpenChange:i}),t[27]=o,t[28]=y):y=t[28];let v;return t[29]!==j||t[30]!==S||t[31]!==y?(v=s.jsxs(s.Fragment,{children:[j,S,y]}),t[29]=j,t[30]=S,t[31]=y,t[32]=v):v=t[32],v}function Tt(){const t=z.c(10),e=B();let n;t[0]!==e?(n=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=n):n=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(is,{}),t[2]=l):l=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let i;t[5]!==o?(i=s.jsx("span",{children:o}),t[5]=o,t[6]=i):i=t[6];let r;return t[7]!==n||t[8]!==i?(r=s.jsx(te,{className:"gap-0.5",children:s.jsx(W,{children:s.jsx(hs,{trigger:s.jsxs(Q,{tooltip:n,children:[l,i]})})})}),t[7]=n,t[8]=i,t[9]=r):r=t[9],r}function Hl(){const t=z.c(17),{state:e}=de(),n=e==="collapsed";if(Ke()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Tt,{}),t[0]=f):f=t[0];let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(W,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx($e,{})})}),t[1]=p):p=t[1];let h;t[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(W,{children:s.jsx(Ze,{})}),t[2]=h):h=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(Ae,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(te,{children:[p,h,s.jsx(W,{children:s.jsx(ze,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Tt,{}),t[4]=c):c=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W,{children:s.jsx($e,{variant:"full"})}),t[5]=m):m=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Ae,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(te,{className:"gap-0.5",children:[m,s.jsx(W,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ze,{})}),s.jsx(Bl,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,m;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Mt,{}),m=s.jsx(Ot,{}),t[7]=c,t[8]=m):(c=t[7],m=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(W,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx($e,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(W,{children:s.jsx(Ze,{})}),t[10]=f):f=t[10];let p;return t[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(Ae,{className:"px-2 pb-3 gap-1",children:[c,m,s.jsxs(te,{children:[u,f,s.jsx(W,{children:s.jsx(ze,{})})]})]}),t[11]=p):p=t[11],p}let o,i;t[12]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Mt,{}),i=s.jsx(Ot,{}),t[12]=o,t[13]=i):(o=t[12],i=t[13]);let r;t[14]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(W,{children:s.jsx($e,{variant:"full"})}),t[14]=r):r=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(W,{children:s.jsx(Ze,{})}),t[15]=a):a=t[15];let d;return t[16]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(Ae,{className:"px-2 pb-3 gap-0.5",children:[o,i,s.jsxs(te,{className:"gap-0.5",children:[r,a,s.jsx(W,{children:s.jsx(ze,{})})]})]}),t[16]=d):d=t[16],d}function Ul(){const t=z.c(11),e=B(),n=ie(),{org:l}=J(),{setOpenMobile:o}=de();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(te,{children:s.jsx(W,{children:s.jsx(ze,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e?(r=e("sidebar.sidebarFooterMobile.settings"),t[1]=e,t[2]=r):r=t[2];let a;t[3]!==n||t[4]!==l.slug||t[5]!==o?(a=()=>{n({to:"/$org/settings",params:{org:l.slug}}),o(!1)},t[3]=n,t[4]=l.slug,t[5]=o,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(We,{className:"size-4"}),t[7]=d):d=t[7];let c;return t[8]!==r||t[9]!==a?(c=s.jsx(Ae,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(je,{"aria-label":r,onClick:a,children:d})]})}),t[8]=r,t[9]=a,t[10]=c):c=t[10],c}function Pt(t){const e=z.c(15),{className:n,wrapperClassName:l,children:o}=t,[i,r]=G.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&r(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;r(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=U("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==o||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:o}),e[4]=o,e[5]=n,e[6]=f):f=e[6];const p=i?"opacity-100":"opacity-0";let h;e[7]!==p?(h=U("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",p),e[7]=p,e[8]=h):h=e[8];let g;e[9]!==h?(g=s.jsx("div",{"aria-hidden":!0,className:h}),e[9]=h,e[10]=g):g=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==g?(x=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=x):x=e[14],x}function Wl(t){const e=z.c(9),{virtualMcpId:n,size:l,showAutomationBadge:o}=t,i=l===void 0?"sm":l,r=B();let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(Kl,{virtualMcpId:n,size:i}):s.jsx(be,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let d;e[3]!==o||e[4]!==r?(d=o&&s.jsx("span",{"aria-label":r("tasksPanel.mcpAvatar.automationTriggered"),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(gs,{size:10,className:"text-white"})}),e[3]=o,e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==a||e[7]!==d?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,d]}),e[6]=a,e[7]=d,e[8]=c):c=e[8],c}function Kl(t){const e=z.c(6),{virtualMcpId:n,size:l}=t,o=gt(n);if(!o){let a;return e[0]!==l?(a=s.jsx(be,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const i=o.icon??null;let r;return e[2]!==o.title||e[3]!==l||e[4]!==i?(r=s.jsx(be,{icon:i,name:o.title,size:l}),e[2]=o.title,e[3]=l,e[4]=i,e[5]=r):r=e[5],r}function Dt(t){const e=z.c(53),{open:n,onOpenChange:l}=t,[o,i]=G.useState(""),{org:r}=J(),{setTaskId:a}=jt(),d=xs(),c=B();let m,u,f;e[0]!==r.id||e[1]!==o?(f=o.trim(),u=Ks,m=Wt.globalSearch(r.id,f),e[0]=r.id,e[1]=o,e[2]=m,e[3]=u,e[4]=f):(m=e[2],u=e[3],f=e[4]);const p=n&&f.length>0;let h;e[5]!==d||e[6]!==f?(h=async()=>await d.call("GLOBAL_SEARCH",{query:f,limit:20}),e[5]=d,e[6]=f,e[7]=h):h=e[7];let g;e[8]!==m||e[9]!==p||e[10]!==h?(g={queryKey:m,enabled:p,queryFn:h,staleTime:1e4},e[8]=m,e[9]=p,e[10]=h,e[11]=g):g=e[11];const{data:x,isFetching:b}=u(g);let j;e[12]!==x?.items?(j=x?.items??[],e[12]=x?.items,e[13]=j):j=e[13];const S=j;let y;e[14]!==l?(y=E=>{E||i(""),l(E)},e[14]=l,e[15]=y):y=e[15];const v=y;let C;e[16]!==v||e[17]!==a?(C=E=>{v(!1),a(E.id,E.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=C):C=e[18];const N=C;let _;e[19]!==c?(_=c("tasksPanel.globalSearchDialog.title"),e[19]=c,e[20]=_):_=e[20];let w;e[21]!==_?(w=s.jsx(ft,{children:_}),e[21]=_,e[22]=w):w=e[22];let I;e[23]!==c?(I=c("tasksPanel.globalSearchDialog.description"),e[23]=c,e[24]=I):I=e[24];let $;e[25]!==I?($=s.jsx(Qt,{children:I}),e[25]=I,e[26]=$):$=e[26];let k;e[27]!==w||e[28]!==$?(k=s.jsxs(Jt,{className:"sr-only",children:[w,$]}),e[27]=w,e[28]=$,e[29]=k):k=e[29];let O;e[30]!==c?(O=c("tasksPanel.globalSearchDialog.placeholder"),e[30]=c,e[31]=O):O=e[31];let A;e[32]!==o||e[33]!==O?(A=s.jsx(Co,{value:o,onValueChange:i,placeholder:O}),e[32]=o,e[33]=O,e[34]=A):A=e[34];let M;e[35]!==N||e[36]!==b||e[37]!==S||e[38]!==c||e[39]!==f?(M=f?b&&S.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.searching")}):S.length===0?s.jsx(So,{children:c("tasksPanel.globalSearchDialog.noResults")}):S.map(E=>E.type==="thread"?s.jsxs(_o,{value:`thread:${E.id}:${E.title}`,onSelect:()=>N(E),className:"gap-2.5",children:[s.jsx(Wl,{virtualMcpId:E.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:E.title||c("tasksPanel.globalSearchDialog.untitledChat")})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(E.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${E.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.startTyping")}),e[35]=N,e[36]=b,e[37]=S,e[38]=c,e[39]=f,e[40]=M):M=e[40];let F;e[41]!==M?(F=s.jsx(No,{children:M}),e[41]=M,e[42]=F):F=e[42];let R;e[43]!==A||e[44]!==F?(R=s.jsxs(wo,{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:[A,F]}),e[43]=A,e[44]=F,e[45]=R):R=e[45];let D;e[46]!==k||e[47]!==R?(D=s.jsxs(Xt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[k,R]}),e[46]=k,e[47]=R,e[48]=D):D=e[48];let T;return e[49]!==v||e[50]!==n||e[51]!==D?(T=s.jsx(pt,{open:n,onOpenChange:v,children:D}),e[49]=v,e[50]=n,e[51]=D,e[52]=T):T=e[52],T}function ql(t){return t==="ephemeral"||t.startsWith("thread:")}function ws(t){const e=z.c(45),{task:n,isActive:l,onClick:o,onArchive:i,showAutomationBadge:r,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=B(),u=Io(n.status),f=u.icon,p=n.metadata?.kind==="tool_call_run",h=gt(p?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=so(h),e[0]=h,e[1]=g):g=e[1];const x=g;zo(6e4);const b=r||!!n.trigger_id,j=n.id,S="button",y=0;let v;e[2]!==o?(v=H=>{H.target===H.currentTarget&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const C=c?"-ml-4 pl-6":"pl-[7px]",N=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==C||e[5]!==N?(_=U("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=_):_=e[6];let w;e[7]!==p||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(w=a&&!p&&s.jsx(be,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=p,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=w):w=e[11];let I;e[12]!==b||e[13]!==m?(I=b&&s.jsx(gs,{size:12,"aria-label":m("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=b,e[13]=m,e[14]=I):I=e[14];let $;e[15]!==m||e[16]!==n.title?($=n.title||m("tasksPanel.taskRow.untitledTask"),e[15]=m,e[16]=n.title,e[17]=$):$=e[17];let k;e[18]!==$?(k=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[18]=$,e[19]=k):k=e[19];let O;e[20]!==I||e[21]!==k?(O=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[I,k]}),e[20]=I,e[21]=k,e[22]=O):O=e[22];let A;e[23]!==x||e[24]!==l||e[25]!==n.branch||e[26]!==n.updated_at?(A=n.updated_at&&s.jsxs("div",{className:U("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!ql(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Oo(new Date(n.updated_at))})]}),e[23]=x,e[24]=l,e[25]=n.branch,e[26]=n.updated_at,e[27]=A):A=e[27];let M;e[28]!==O||e[29]!==A?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,A]}),e[28]=O,e[29]=A,e[30]=M):M=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!d&&s.jsx("span",{className:U("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",i&&"group-hover/row:opacity-0"),"aria-label":m("tasksPanel.taskRow.statusLabel",{status:u.label}),children:s.jsx(f,{size:14,className:U(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[31]!==i||e[32]!==m?(D=i&&s.jsxs(he,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":m("tasksPanel.taskRow.archiveTask"),onClick:H=>{H.stopPropagation(),i()},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-8 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(qs,{size:14})})}),s.jsx(pe,{side:"right",children:m("tasksPanel.taskRow.archive")})]}),e[31]=i,e[32]=m,e[33]=D):D=e[33];let T;e[34]!==R||e[35]!==D?(T=s.jsxs("div",{className:F,children:[R,D]}),e[34]=R,e[35]=D,e[36]=T):T=e[36];let E;return e[37]!==o||e[38]!==M||e[39]!==T||e[40]!==v||e[41]!==_||e[42]!==w||e[43]!==n.id?(E=s.jsxs("div",{"data-task-id":j,role:S,tabIndex:y,onClick:o,onKeyDown:v,className:_,children:[w,M,T]}),e[37]=o,e[38]=M,e[39]=T,e[40]=v,e[41]=_,e[42]=w,e[43]=n.id,e[44]=E):E=e[44],E}const Et=["requires_action","in_progress","failed","expired","completed"];function Vl(t){const e=new Map(Et.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return Et.map(n=>({status:n,threads:e.get(n)}))}const Yl="sidebar.group.expanded.";function Xl(t,e){const n=z.c(3),[l,o]=Ge(`${Yl}${t}`,e);let i;return n[0]!==l||n[1]!==o?(i=[l,o],n[0]=l,n[1]=o,n[2]=i):i=n[2],i}function ks(t){const e=z.c(18),{onClick:n,isFetching:l,indented:o}=t,i=B();let r;e[0]!==i?(r=i("sidebar.showMoreButton.ariaLabel"),e[0]=i,e[1]=r):r=e[1];const a=o?"-ml-4 pl-6 pr-2":"px-2";let d;e[2]!==a?(d=U("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",a,"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[2]=a,e[3]=d):d=e[3];let c;e[4]!==l?(c=l&&s.jsx(Kt,{size:14,className:"animate-spin"}),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==l||e[7]!==i?(m=i(l?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=l,e[7]=i,e[8]=m):m=e[8];let u;e[9]!==m?(u=s.jsx("span",{children:m}),e[9]=m,e[10]=u):u=e[10];let f;return e[11]!==l||e[12]!==n||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==u?(f=s.jsxs("button",{type:"button","aria-label":r,onClick:n,disabled:l,className:d,children:[c,u]}),e[11]=l,e[12]=n,e[13]=r,e[14]=d,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Ql(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Jl(t){return t.member==="mine"&&!t.currentUserId}const As=4;let Fe=0;const rt=[];function Zl(){for(;Fe<As&&rt.length>0;){const t=rt.shift();t&&t()}}function Is(t){return new Promise((e,n)=>{const l=()=>{Fe++,t().then(e,n).finally(()=>{Fe--,Zl()})};Fe<As?l():rt.push(l)})}const Ye=10;function Ft(t,e,n,l,o){const i={hidden:!1};l.member==="mine"&&l.currentUserId&&(i.created_by=l.currentUserId),l.type==="automation"&&(i.has_trigger=!0),l.type==="manual"&&(i.has_trigger=!1);const r={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return r.status=e,r}function ei(t,e,n,l){let o=0;for(const i of t)zs(i,e,n,l)&&o++;return o}function et(t,e,n,l){return ei(t,e,n,l)}function ti(t,e){return!!(t>=Ye||t===0&&e)}function Rt(t,e){return t<e}function si(t,e){return e===!1?!1:e===!0?!0:t}function zs(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 Le=new Map,Ee=new Map;function ni(t,e){return e?t>=Ye?!0:null:!1}function Lt(t){return Le.get(t)}function oi(t,e){Le.set(t,e)}function li(t,e,n){const l=Le.get(t);if(l!==void 0){n(l);return}let o=Ee.get(t);o||(o=Is(e).then(i=>(Le.set(t,i),Ee.delete(t),i)).catch(()=>(Ee.delete(t),Promise.reject(new Error("group probe failed")))),Ee.set(t,o)),o.then(n,()=>n(!1))}function Gt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ye,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ii(t,e,n,l,o){let i=0;for(const r of t)e.has(r.id)||zs(r,n,l,o)&&i++;return i}function ri(t,e,n,l){const o=z.c(8),{org:i}=J(),r=Ql(i.id,t,e,n);let a;o[0]!==n?(a=Jl(n),o[0]=n,o[1]=a):a=o[1];const d=a,[c,m]=G.useState({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==r&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});const u=Wn(),{threads:f,hasMore:p}=bt(),h=et(f,t,e,n),g=ti(h,p),x=ni(h,p),b=xs();if(c.identity===r&&c.serverHasMore===null){const N=x??Lt(r);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===r&&c.serverHasMore===null&&x===null&&Lt(r)===void 0&&c.probeSubscribedIdentity!==r&&(m(N=>N.identity===r?{...N,isProbing:!0,probeSubscribedIdentity:r}:N),li(r,async()=>{const N=Ft(t,e,0,n,1),_=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:w}=Gt(_),I=et(u.threads.get(),t,e,n);return w===void 0?!1:Rt(I,w)},N=>{m(_=>_.identity!==r?_:{..._,isProbing:!1,serverHasMore:N})}));const S=async function(){if(c.isFetching||c.isProbing||d)return;const _=r;m(w=>w.identity===_?{...w,isFetching:!0}:w);try{const w=et(f,t,e,n),I=Ft(t,e,w,n,Ye),$=await Is(()=>b.call("COLLECTION_THREADS_LIST",I)),{items:k,hasMore:O,totalCount:A}=Gt($),M=new Set(f.map(ai)),F=ii(k,M,t,e,n),R=w;u.mergeThreads(k),m(D=>{if(D.identity!==_)return D;let T;return A!==void 0?T=Rt(R+F,A):T=k.length===0||F===0?!1:O,oi(_,T),{...D,isFetching:!1,serverHasMore:T}})}catch(w){const I=w,$=I instanceof Error?I.message:String(I);ee.error(`Could not load more tasks: ${$}`),m(k=>k.identity===_?{...k,isFetching:!1}:k)}},y=c.isFetching||c.isProbing,v=!d&&!y&&si(g,c.serverHasMore);let C;return o[2]!==y||o[3]!==S||o[4]!==v||o[5]!==c.isProbing||o[6]!==c.serverHasMore?(C={hasMore:v,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:S},o[2]=y,o[3]=S,o[4]=v,o[5]=c.isProbing,o[6]=c.serverHasMore,o[7]=C):C=o[7],C}function ai(t){return t.id}function ci(t){const e=z.c(20),{status:n,threads:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:p}=ri("status",n,d),[h,g]=G.useState(!1);!h&&l.length===0&&p===!0&&!c&&!m&&(g(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==d||e[3]!==r||e[4]!==i||e[5]!==l){let S;e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r||e[11]!==i?(S=y=>s.jsx(ws,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:a&&y.created_by===d.currentUserId?()=>r(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=i,e[12]=S):S=e[12],x=l.map(S),e[0]=o,e[1]=a,e[2]=d,e[3]=r,e[4]=i,e[5]=l,e[6]=x}else x=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(ks,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==x||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[x,b]}),e[17]=x,e[18]=b,e[19]=j):j=e[19],j}function di(t){const e=z.c(36),{status:n,threads:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,c=$o[n],m=c.icon,[u,f]=Xl(`status-${n}`,!1);let p;e[0]!==u||e[1]!==f?(p=function(){f(!u)},e[0]=u,e[1]=f,e[2]=p):p=e[2];const h=p;let g;e[3]!==h?(g=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),h())},e[3]=h,e[4]=g):g=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 b;e[8]!==u?(b=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(xt,{size:14}):s.jsx(Mo,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==x||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,b]}),e[10]=x,e[11]=b,e[12]=j):j=e[12];let S;e[13]!==c.label?(S=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=S):S=e[14];let y;e[15]!==l.length?(y=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]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==g||e[20]!==j||e[21]!==S||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,S,y]}),e[17]=u,e[18]=h,e[19]=g,e[20]=j,e[21]=S,e[22]=y,e[23]=v):v=e[23];let C;e[24]!==o||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==r||e[29]!==i||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(ci,{status:n,threads:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d})}),e[24]=o,e[25]=a,e[26]=u,e[27]=d,e[28]=r,e[29]=i,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==v||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,C]}),e[33]=v,e[34]=C,e[35]=N):N=e[35],N}function Bt(t){const e=z.c(38),{threads:n,groupBy:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,filters:a,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(Ao,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=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:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==o||e[4]!==f||e[5]!==a||e[6]!==r||e[7]!==i||e[8]!==n){let j;e[10]!==o||e[11]!==f||e[12]!==a||e[13]!==r||e[14]!==i?(j=S=>s.jsx(di,{status:S.status,threads:S.threads,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:f,filters:a},S.status),e[10]=o,e[11]=f,e[12]=a,e[13]=r,e[14]=i,e[15]=j):j=e[15],x=Vl(n).map(j),e[3]=o,e[4]=f,e[5]=a,e[6]=r,e[7]=i,e[8]=n,e[9]=x}else x=e[9];let b;return e[16]!==x?(b=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=b):b=e[17],b}let p;if(e[18]!==o||e[19]!==f||e[20]!==a||e[21]!==r||e[22]!==i||e[23]!==n){let x;e[25]!==o||e[26]!==f||e[27]!==a||e[28]!==r||e[29]!==i?(x=b=>s.jsx(ws,{task:b,isActive:o===b.id,onClick:()=>i(b),onArchive:f&&b.created_by===a.currentUserId?()=>r(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=o,e[26]=f,e[27]=a,e[28]=r,e[29]=i,e[30]=x):x=e[30],p=n.map(x),e[18]=o,e[19]=f,e[20]=a,e[21]=r,e[22]=i,e[23]=n,e[24]=p}else p=e[24];let h;e[31]!==d||e[32]!==c||e[33]!==m?(h=(d||c)&&s.jsx(ks,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=h):h=e[34];let g;return e[35]!==p||e[36]!==h?(g=s.jsxs(s.Fragment,{children:[p,h]}),e[35]=p,e[36]=h,e[37]=g):g=e[37],g}function mi(t,e,n){if(!n)return;const l=t.findIndex(o=>o.id===e);if(l!==-1){for(let o=l+1;o<t.length;o++){const i=t[o];if(i?.created_by===n)return i}for(let o=l-1;o>=0;o--){const i=t[o];if(i?.created_by===n)return i}}}function Ht(t){const e=z.c(17),{label:n,onClick:l,active:o,children:i}=t,[r,a]=G.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=o&&"bg-sidebar-accent text-foreground";let p;e[4]!==f?(p=U("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=p):p=e[5];let h;e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==p?(h=s.jsx(fe,{asChild:!0,children:s.jsx(je,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:p,children:i})}),e[6]=i,e[7]=n,e[8]=l,e[9]=p,e[10]=h):h=e[10];let g;e[11]!==n?(g=s.jsx(pe,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let x;return e[13]!==r||e[14]!==h||e[15]!==g?(x=s.jsxs(he,{open:r,children:[h,g]}),e[13]=r,e[14]=h,e[15]=g,e[16]=x):x=e[16],x}function tt(t){const e=z.c(13),{label:n,value:l,onChange:o,options:i}=t;let r;e[0]!==n?(r=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==o?(a=u=>u&&o(u),e[2]=o,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(ui),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==l?(c=s.jsx(yo,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r,c]}),e[10]=r,e[11]=c,e[12]=m):m=e[12],m}function ui(t){return s.jsxs(vo,{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 $s({onNavigate:t}={}){const e=B(),{data:n}=oe.useSession(),l=n?.user?.id,{org:o}=J(),i=es({connectionId:ts,orgId:o.id,orgSlug:o.slug}),r=Re(o.id).id,a=os(),{threads:d,hasMore:c,isFetchingMore:m,fetchNextPage:u}=bt(),f=d.filter(P=>!P.hidden),{hide:p,setScope:h}=ms(),g=ie(),{setTaskId:x,createNewTask:b}=jt(),j=ct({strict:!1}),S=Be({strict:!1}),y=j.taskId??null,v=S.virtualmcpid??d.find(P=>P.id===y)?.virtual_mcp_id??null,C=()=>{t?.()},N=[...f].sort((P,K)=>(K.updated_at??"").localeCompare(P.updated_at??"")),[_,w]=G.useState("all"),[I,$]=G.useState("flat"),[k,O]=Ge("sidebar-threads-scope-all",!1),[A,M]=G.useState(!1),[F,R]=G.useState(!1),D={type:_,member:"mine",currentUserId:l??null},T={};k||(T.created_by="me"),h(T);const E=P=>l?P.filter(K=>K.created_by===l):[],H=P=>_==="automation"?P.filter(K=>!!K.trigger_id):_==="manual"?P.filter(K=>!K.trigger_id):P,q=E(N),L=H(q),se=H(N),me=k?se:L,re=P=>{if(l&&P.created_by&&P.created_by!==l)return;const K=P.id===y;if(p(P.id),Vn(P.id),!K)return;const X=mi(me,P.id,l);C(),X?x(X.id,X.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},ue=P=>{C(),x(P.id,P.virtual_mcp_id)},ve=async P=>{try{const K=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P,limit:1,offset:0}});return((K.structuredContent??K).items?.length??0)===0}catch{return!1}},ye=async()=>{const P=v??r;Y("sidebar_new_thread_clicked",{virtual_mcp_id:P});const K=q.find(X=>X.virtual_mcp_id===P&&X.title==="New chat");if(K&&await ve(K.id)){C(),x(K.id,P);return}C(),b(P)},{state:Se,isMobile:_e,toggleSidebar:Ce}=de();if(Se==="collapsed"&&!_e){const P=Re(o.id),K=new Map((a??[]).map(V=>[V.id,V])),X=V=>(V?K.get(V):void 0)??(V===r?P:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(Cs,{orgParam:o.slug,side:"right",align:"start",trigger:s.jsx(Q,{tooltip:o.name,children:s.jsx(qe,{org:o,size:"sm"})})})}),s.jsxs(te,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(W,{children:s.jsx(Q,{"aria-label":e("sidebar.taskGroupsList.toggleSidebar"),tooltip:e("sidebar.taskGroupsList.toggleSidebar"),onClick:Ce,children:s.jsx(ss,{size:16})})}),s.jsx(W,{children:s.jsx(Q,{"aria-label":e("sidebar.taskGroupsList.newChat"),tooltip:e("sidebar.taskGroupsList.newChat"),onClick:()=>{ye()},children:s.jsx(_t,{size:16})})}),me.map(V=>{const ge=X(V.virtual_mcp_id);return s.jsx(W,{children:s.jsx(Q,{"aria-label":V.title||e("sidebar.taskGroupsList.newChat"),tooltip:V.title||e("sidebar.taskGroupsList.newChat"),isActive:V.id===y,onClick:()=>ue(V),children:s.jsx(be,{icon:ge?.icon??null,name:ge?.title??"Agent",size:"xs"})})},V.id)})]})]})}const ne=I!=="flat"||_!=="all"||k===!0,Ne=s.jsxs(Ue,{children:[s.jsxs(he,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ke,{asChild:!0,children:s.jsxs(je,{"aria-label":e("sidebar.taskGroupsList.filterChats"),active:ne,className:"md:size-[34px] rounded-lg",children:[s.jsx(jo,{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(pe,{side:"bottom",children:e("sidebar.taskGroupsList.filterChats")})]}),s.jsxs(He,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(tt,{label:e("sidebar.taskGroupsList.filterView"),value:I,onChange:P=>{Y("tasks_panel_group_by_changed",{to_value:P}),$(P)},options:[{value:"flat",label:e("sidebar.taskGroupsList.viewList"),icon:s.jsx(yn,{size:13})},{value:"status",label:e("sidebar.taskGroupsList.viewStatus"),icon:s.jsx(Sn,{size:13})}]}),s.jsx(tt,{label:e("sidebar.taskGroupsList.filterType"),value:_,onChange:P=>{Y("tasks_panel_filter_changed",{to_value:P}),w(P)},options:[{value:"all",label:e("sidebar.taskGroupsList.typeAll")},{value:"manual",label:e("sidebar.taskGroupsList.typeChats")},{value:"automation",label:e("sidebar.taskGroupsList.typeAuto")}]}),s.jsx(tt,{label:e("sidebar.taskGroupsList.filterScope"),value:k?"team":"mine",onChange:P=>O(P==="team"),options:[{value:"mine",label:e("sidebar.taskGroupsList.scopeMine")},{value:"team",label:e("sidebar.taskGroupsList.scopeTeam")}]})]})]}),ae=P=>s.jsx(ns,{delayDuration:300,children:s.jsxs("div",{className:U("shrink-0 flex items-center justify-between",P?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!P&&s.jsx(bs,{className:"md:size-[34px] rounded-lg"}),Ne]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Ht,{label:e("sidebar.taskGroupsList.searchChats"),onClick:()=>{Y("tasks_panel_search_opened"),R(!0),M(!0)},children:s.jsx(_n,{size:16})}),s.jsx(Ht,{label:e("sidebar.taskGroupsList.newChat"),onClick:()=>{ye()},children:s.jsx(_t,{size:16})})]})]})});return _e?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ae(!0),s.jsx(Pt,{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(Bt,{threads:me,groupBy:I,activeTaskId:y,onSelectTask:ue,onArchiveTask:re,filters:D,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:ne})}),F&&s.jsx(Dt,{open:A,onOpenChange:M})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ae(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Pt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Bt,{threads:me,groupBy:I,activeTaskId:y,onSelectTask:ue,onArchiveTask:re,filters:D,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:ne})})}),F&&s.jsx(Dt,{open:A,onOpenChange:M})]})}const fi=5,pi=[{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 Os(){const t=z.c(3),{state:e}=de();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:fi}).map(gi)}),t[0]=o):o=t[0],o}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(le,{className:"size-6 rounded-md"}),s.jsx(le,{className:"size-6 rounded-md"}),s.jsx(le,{className:"size-6 rounded-md"})]}),s.jsx(le,{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:pi.map(hi)})]}),t[2]=l):l=t[2],l}function hi(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(le,{className:"size-5 rounded-full shrink-0"}),s.jsx(le,{className:U("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(xi)})]},e)}function xi(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(le,{className:"h-3 flex-1 rounded-sm"})},e)}function gi(t,e){return s.jsx(le,{className:"size-10 rounded-lg mx-auto"},e)}function bi(){const t=z.c(2);if(Ke()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(it,{showName:!0}),t[0]=l):l=t[0],l}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(it,{}),s.jsx(Ve,{})]}),t[1]=n):n=t[1],n}function ji(){const t=z.c(5),e=js();let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Hl,{}),l=s.jsx(bi,{}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(at,{children:s.jsx(G.Suspense,{fallback:s.jsx(Os,{}),children:s.jsx($s,{})})}),t[2]=o):o=t[2];let i;return t[3]!==e?(i=s.jsx(us,{children:s.jsx(Ss,{sections:e,footer:n,header:l,additionalContent:o})}),t[3]=e,t[4]=i):i=t[4],i}function vi(t){const e=z.c(8),{onClose:n}=t,l=js();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ul,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Os,{}),e[1]=i):i=e[1];let r;e[2]!==n?(r=s.jsx(at,{children:s.jsx(G.Suspense,{fallback:i,children:s.jsx($s,{onNavigate:n})})}),e[2]=n,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==r?(a=s.jsx(us,{children:s.jsx(Nl,{sections:l,onClose:n,footer:o,additionalContent:r})}),e[4]=n,e[5]=l,e[6]=r,e[7]=a):a=e[7],a}const yi="sidebar.open";function Si(){const t=z.c(1),{state:e}=de(),n=Ke();if(e!=="collapsed"||n)return null;let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ve,{}),t[0]=l):l=t[0],l}function _i(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{}),t[0]=e):e=t[0],e}function Ua(){const t=z.c(43),e=ut(),n=Ke();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{connect:o,siteUrl:i}=Be(l),r=o==="1",[a,d]=Ge(yi,!1),{width:c,wrapperRef:m,onStartResize:u,resetWidth:f}=Bo(),p=!e;let h,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(Z.LeftColumn,{children:[s.jsx(Si,{}),s.jsx(Z.TogglesSlot,{})]}),g=s.jsx(Z.CenterSlot,{}),t[1]=h,t[2]=g):(h=t[1],g=t[2]);let x;t[3]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(Z.Header,{children:[h,g,s.jsxs(Z.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Z.TabsSlot,{})}),s.jsx(Z.RightSlot,{})]})]}),t[3]=x):x=t[3];const b=x;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(bs,{}),t[4]=j):j=t[4];let S;t[5]!==n?(S=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(Ve,{})}),t[5]=n,t[6]=S):S=t[6];let y,v,C,N,_;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx($e,{}),C=s.jsx(Z.TogglesSlot,{}),N=s.jsx(Z.TabsSlot,{className:"shrink-0"}),_=s.jsx(Z.CenterSlot,{}),y=s.jsx(Z.RightSlot,{}),t[7]=y,t[8]=v,t[9]=C,t[10]=N,t[11]=_):(y=t[7],v=t[8],C=t[9],N=t[10],_=t[11]);let w;t[12]!==S?(w=s.jsx(Z.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,S,v,C,N,_,y]})}),t[12]=S,t[13]=w):w=t[13];const I=w;let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={background:"transparent",containerType:"inline-size"},t[14]=$):$=t[14];let k;t[15]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Js,{className:"flex flex-col min-h-0",style:$,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(G.Suspense,{fallback:s.jsx(_i,{}),children:s.jsx(Vs,{})})})})}),t[15]=k):k=t[15];const O=k,A=!p&&(e?I:b),M=`${c}px`;let F;t[16]!==M?(F={"--sidebar-width":M,"--sidebar-width-icon":"3.125rem"},t[16]=M,t[17]=F):F=t[17];const R=F;let D;t[18]!==e||t[19]!==u||t[20]!==f?(D=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ji,{}),s.jsx(Ro,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=D):D=t[21];let T;t[22]!==p?(T=p?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,O]}):O,t[22]=p,t[23]=T):T=t[23];let E;t[24]!==R||t[25]!==D||t[26]!==T||t[27]!==m?(E=s.jsxs(Zs,{ref:m,className:"flex-1 bg-sidebar relative min-h-0",style:R,children:[D,T]}),t[24]=R,t[25]=D,t[26]=T,t[27]=m,t[28]=E):E=t[28];let H;t[29]!==e?(H=e&&s.jsx(ko,{renderSidebar:Ci}),t[29]=e,t[30]=H):H=t[30];let q;t[31]!==i||t[32]!==r?(q=r&&s.jsx(To,{siteUrl:i}),t[31]=i,t[32]=r,t[33]=q):q=t[33];let L;t[34]!==A||t[35]!==E||t[36]!==H||t[37]!==q?(L=s.jsx(Bn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[A,E,H,q]})}),t[34]=A,t[35]=E,t[36]=H,t[37]=q,t[38]=L):L=t[38];let se;return t[39]!==d||t[40]!==a||t[41]!==L?(se=s.jsx(Kn,{children:s.jsx(Z.Provider,{children:s.jsx(en,{open:a,onOpenChange:d,children:L})})}),t[39]=d,t[40]=a,t[41]=L,t[42]=se):se=t[42],se}function Ci(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(vi,{onClose:e})})})}export{Ua as default};
|
|
1
|
+
import{c as z,d as ie,F as J,b as B,G as Ms,j as s,B as ce,r as G,E as at,H as Ts,v as Ut,a as oe,w as Ps,K as Wt,e as st,q as Y,I as Ge,m as U,J as Ds,M as Es,P as Fs,R as Rs,U as Ls,s as Gs,t as ee,x as Bs,k as Kt,f as ct,u as Be,L as qt,V as Hs,W as Us,X as Ws,n as Ks,Y as qs,O as Vs,Z as Ys}from"./index-xMAThnJ3.js";import{u as de,S as dt,a as mt,b as te,c as Q,d as W,e as Vt,f as Xs,g as Yt,h as Qs,i as Ae,j as Js,k as Zs,l as en}from"./sidebar-B6ruAgp1.js";import{u as ut}from"./use-mobile-CljsORKC.js";import{C as tn,p as Qe,s as sn,b as nn,S as on,d as ln,e as rn,c as an,n as cn}from"./self-tool-result-ClGvUSzE.js";import{f as dn,b as ft,e as pt,g as mn,d as Xt,h as Qt,a as Jt}from"./dialog-dfAy2TTt.js";import{f as un}from"./tab-id-BijBBRwE.js";import{C as fn,W as Zt,g as pn,u as es,S as ts,a as Re,i as hn,b as xn}from"./use-mcp-client-CxJl6URN.js";import{i as ht}from"./ArrowRight-BcxHvBZl.js";import{S as le}from"./skeleton-AlkG0Gdf.js";import{i as ss}from"./LayoutLeft-C0Cux1Fk.js";import{t as xt}from"./ChevronDown-l_A3M_wf.js";import{T as fe,a as pe,b as he,c as ns}from"./tooltip-Cx4iVbBS.js";import{u as os,a as gt}from"./use-virtual-mcp-C9595_o4.js";import{A as be,t as ls,a as gn,i as bn,b as St,c as jn,d as vn,e as is,f as _t,s as yn,g as Sn,h as _n}from"./agent-icon-DPj46qz4.js";import{P as ke,a as He,b as Ue}from"./popover-DeNJXOxs.js";import{i as Oe}from"./Check-Btldp1zg.js";import{s as Me}from"./Plus-BWpeDIiC.js";import{i as rs}from"./SearchMd-D5PMm26-.js";import{s as Cn}from"./XClose-dktsudpR.js";import{A as Nn,a as wn,b as kn,c as An,d as In,e as zn,f as $n}from"./alert-dialog-D05um7oC.js";import{F as On,a as Mn,b as Tn,c as Pn,d as Dn,e as En,f as Fn}from"./form-CF3RjQBx.js";import{I as Rn}from"./input-u9ojR0Jk.js";import{S as Ln,u as Gn,C as Bn}from"./chat-context-CdcAuDUS.js";import{T as je}from"./toolbar-icon-button-BANxrES2.js";import{D as as,a as cs,b as ds}from"./drawer-BhtgSPao.js";import{G as Hn}from"./use-registry-app-B5yOQbYF.js";import{G as Un}from"./github-repo-picker-Cq0j6Fer.js";import{u as ms,a as bt,b as Wn,T as Kn}from"./hooks-yHiQMJ5W.js";import{r as qn,u as jt,f as Vn}from"./shell-layout-D1cDRvrL.js";import{u as Yn,g as Xn,a as Qn,b as Jn,S as us}from"./use-navigate-to-agent-CfNAtLX9.js";import{g as Zn,a as fs,u as eo,A as to,b as so}from"./use-deco-credits-a2tWMbhr.js";import{f as no}from"./reusable-new-chat-CouMjkYR.js";import{A as nt}from"./avatar-BZVXAJYd.js";import{a as ot}from"./Copy01-CaG2A2wm.js";import{n as oo,i as lo}from"./Globe01-BUN-6dPc.js";import{i as io}from"./ZoomOut-BYn_nuTa.js";import{n as ro}from"./LinkExternal01-DCsltjSv.js";import{i as Ct,a as ao}from"./ZapSquare-uV_3SRZQ.js";import{i as lt}from"./Monitor01-CDwcd_zn.js";import{n as co,a as mo}from"./Sun-M3urxdUJ.js";import{a as We}from"./Settings02-CETfKPeQ.js";import{i as uo}from"./Shield01-CaJG0J3f.js";import{a as fo}from"./Users03-CFoRyG6w.js";import{u as po}from"./use-deployment-admin-BY9aiNeW.js";import"./index-8CSCdJSN.js";import{a as ps}from"./XCircle-CSTEYaFt.js";import{I as hs}from"./invite-member-dialog-BT6zttg7.js";import{u as Nt}from"./use-copy-BIvcisP7.js";import{m as ho,u as xo,c as go}from"./use-api-keys-C_mORge4.js";import{v as bo,C as wt}from"./connect-desktop-dialog-S8cCvTaK.js";import{u as Ke}from"./use-organization-settings-CPH24cID.js";import{i as jo}from"./FilterLines-D74fcuno.js";import{T as vo,a as yo}from"./toggle-group-DcCG_z_S.js";import{C as So,a as _o,b as Co,c as No,d as wo}from"./command-CSe-uHrh.js";import{u as xs}from"./studio-tools-CwZ4ZBgT.js";import{i as gs}from"./Zap-DKyNws_D.js";import{S as bs,M as ko}from"./shell-controls-QkO6fUAg.js";import{n as Ao}from"./Stars02-ai2IOE66.js";import{g as Io,u as zo,S as $o}from"./use-clock-tick-BXUEdeXU.js";import{a as Oo}from"./format-time-BnbuEtat.js";import{i as Mo}from"./ChevronRight-BIspaBbu.js";import{T as Z}from"./toolbar-Dwqw-NGi.js";import"./X-DefYjaiC.js";import"./integration-icon-BMvzy0w5.js";import"./Tool02-DWpcCeVk.js";import"./CheckCircle-BuQjG5TK.js";import"./companions-core-QrJolxkg.js";import"./extract-connection-data-CUPY4h8x.js";import"./github-repo-scope-DjMZbiKa.js";import"./Eye-n7F3_pH4.js";import"./use-debounced-value-C5_koqkI.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./authenticate-and-persist-oauth-CYhnPvSD.js";import"./mcp-oauth-Det9HVTR.js";import"./auth-BuYROqYP.js";import"./ArrowUpRight-DZ3-lzXp.js";import"./AlertCircle-C7MslaLR.js";import"./Tool01-D8Lh-5Kv.js";import"./ArrowUp-Dx5p-RmC.js";import"./TrendUp01-DRBQwzJp.js";import"./ChevronUp-CbWj-JPO.js";import"./DotsVertical-BegrkRAd.js";import"./Star01-E3H8ZPcr.js";import"./Globe04-OC3kWxEd.js";import"./SwitchHorizontal01-Bs5gwvDo.js";import"./HardDrive-sPxi9cVE.js";import"./Image01-DOKZLS3n.js";import"./Key01-BOkUeTGR.js";import"./Package-ChEjJzRf.js";import"./Palette-BtxFGIye.js";import"./Play-DCNHEpbv.js";import"./SearchLg-BAFos4ti.js";import"./Stars01-CPSc8KBd.js";import"./Trash01-BunOPvOH.js";import"./Upload01-BKoh1Eu-.js";import"./User01-CfQjQb3O.js";import"./Users01-1qAiw5kv.js";import"./label-7U_jcH3x.js";import"./autosend-C3KvfWIZ.js";import"./use-ai-providers-CNxbdOdh.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-D4WclKO1.js";import"./decopilot-sse-pool-SqtdCkZ4.js";import"./backoff-CrEUbyZT.js";import"./use-mcp-tools-CZl6XrZ7.js";import"./collection-search-EZ_TgeOx.js";import"./use-connection-CRf-DTB0.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-DreE2Dff.js";import"./use-org-sso-CdqzH40J.js";import"./connection-card-BXqR2l1c.js";import"./use-registry-connections-DOp_CmU_.js";import"./useInfiniteQuery-BUdwW0Ym.js";import"./use-infinite-scroll-5JOaC6HH.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-DsawJB79.js";import"./select-Dwl6tgyc.js";import"./textarea-DrzR5udY.js";import"./connection-form-helpers-CfHSjpL2.js";import"./collection-tabs-DexOABMQ.js";import"./badge-BP8obAYN.js";import"./useSuspenseInfiniteQuery-CPYBdW4F.js";import"./use-org-auth-client-WFmIGMAp.js";import"./use-organization-roles-snr9TURY.js";import"./index-CHOirrNp.js";import"./differenceInSeconds-NQ4PDo0z.js";function To(t){const e=z.c(22),{siteUrl:n}=t,l=ie(),{org:o}=J(),i=B();let r;e[0]!==l||e[1]!==o.id||e[2]!==o.slug?(r=()=>{localStorage.setItem(Ms.sidebarOpen(),JSON.stringify(!1)),l({to:"/$org/$taskId",params:{org:o.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:pn(o.id),main:un(Zt.COMMERCE_DISCOVERY(o.id),fn),sidepanel:0}})},e[0]=l,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const a=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(dn,{className:"bg-black/15 backdrop-blur-sm"}),e[4]=d):d=e[4];let c;e[5]!==i?(c=i("routes.commerceOnboarding.connectModal.dialogTitle"),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==c?(m=s.jsx(ft,{className:"sr-only",children:c}),e[7]=c,e[8]=m):m=e[8];let u;e[9]!==a||e[10]!==i?(u=()=>s.jsxs("div",{className:"grid gap-4 p-6",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:i("routes.commerceOnboarding.connectModal.loadError")}),s.jsxs(ce,{type:"button",size:"xl",className:"w-full",onClick:a,children:[i("routes.commerceOnboarding.connectModal.continueButton"),s.jsx(ht,{size:18})]})]}),e[9]=a,e[10]=i,e[11]=u):u=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tn,{}),e[12]=f):f=e[12];let p;e[13]!==a||e[14]!==n?(p=s.jsx(G.Suspense,{fallback:f,children:s.jsx(Fo,{siteUrlFromUrl:n,onComplete:a})}),e[13]=a,e[14]=n,e[15]=p):p=e[15];let h;e[16]!==u||e[17]!==p?(h=s.jsx(at,{fallback:u,children:p}),e[16]=u,e[17]=p,e[18]=h):h=e[18];let g;return e[19]!==m||e[20]!==h?(g=s.jsx(pt,{open:!0,children:s.jsxs(mn,{children:[d,s.jsxs(Ts,{"data-slot":"commerce-connect-modal",onEscapeKeyDown:Eo,onPointerDownOutside:Do,onInteractOutside:Po,className:"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex h-[calc(100dvh-1rem)] w-full max-w-[calc(100%-1rem)] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-2xl border p-0 shadow-md duration-200 sm:max-w-lg md:h-auto md:max-h-[calc(100dvh-2rem)] lg:max-h-[calc(100dvh-4rem)] lg:max-w-5xl",children:[m,h]})]})}),e[19]=m,e[20]=h,e[21]=g):g=e[21],g}function Po(t){return t.preventDefault()}function Do(t){return t.preventDefault()}function Eo(t){return t.preventDefault()}function Fo({siteUrlFromUrl:t,onComplete:e}){const n=B(),[l]=Ut(),{org:o}=J(),{data:i}=oe.useSession(),r=Zt.COMMERCE_DISCOVERY(o.id),a=es({connectionId:ts,orgId:o.id,orgSlug:o.slug}),c=Ps({queryKey:Wt.commerceDiscoveryConnection(o.id,r),queryFn:async()=>{const v=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:r}});return Qe(v)},retry:!1}).data.item,m=typeof c?.metadata?.siteUrl=="string"?c.metadata.siteUrl:void 0,u=t||m,f=sn(u),[p,h]=G.useState(!0),[g,x]=G.useState(null),b=st({mutationFn:async v=>Qe(await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:v}})),retry:!1}),j=st({mutationFn:async v=>Qe(await a.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:v}})),retry:!1}),S=nn({siteUrl:u,email:i?.user?.email,locale:l.language}),y=async()=>{x(null),Y("commerce_onboarding_open_report_clicked",{domain:f??void 0,organization_id:o.id});const v=u?cn(u):null;if(v?.ok)try{let C=await j.mutateAsync(v.value);if(C.triggered||(Y("commerce_onboarding_run_reclaim",{domain:f??void 0,organization_id:o.id,reason:C.reason??"not_upgraded"}),await b.mutateAsync(v.value),C=await j.mutateAsync(v.value)),!C.triggered){Y("commerce_onboarding_run_failed",{domain:f??void 0,organization_id:o.id,error:C.reason??"not_triggered"}),x(n("routes.commerceOnboarding.connectModal.couldNotGenerateReport"));return}}catch(C){Y("commerce_onboarding_run_failed",{domain:f??void 0,organization_id:o.id,error:C instanceof Error?C.message:String(C)}),x(n("routes.commerceOnboarding.connectModal.somethingWentWrong"));return}e()};return s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4 lg:gap-6 lg:bg-sidebar lg:p-10",children:[f?s.jsx(on,{host:f}):null,s.jsx(ln,{org:o,cdConnectionId:r,siteUrl:u,onReadinessChange:h}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-3",children:[s.jsx(rn,{href:S,orgId:o.id,className:"lg:hidden"}),g?s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:g}):null,s.jsxs(ce,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium whitespace-normal h-auto py-3",onClick:()=>{y()},disabled:j.isPending||!p,children:[j.isPending?n("routes.commerceOnboarding.connectModal.openingReport"):n(p?"routes.commerceOnboarding.connectModal.viewFullReport":"routes.commerceOnboarding.connectModal.connectToolToContinue"),!j.isPending&&p?s.jsx(ht,{size:18}):null]})]})]}),s.jsx("aside",{className:"hidden lg:flex lg:w-[380px] lg:shrink-0 lg:items-center lg:justify-center lg:overflow-y-auto lg:border-l lg:border-border lg:bg-muted",children:s.jsx(an,{href:S,orgId:o.id})})]})}function Ro(t){const e=z.c(11),{onPointerDown:n,onDoubleClick:l}=t,o=B(),{state:i,isMobile:r}=de();if(r||i==="collapsed")return null;let a;e[0]!==o?(a=o("sidebar.sidebarResizeHandle.ariaLabel"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==o?(d=o("sidebar.sidebarResizeHandle.title"),e[2]=o,e[3]=d):d=e[3];let c,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={left:"var(--sidebar-width)"},m=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[4]=c,e[5]=m):(c=e[4],m=e[5]);let u;return e[6]!==l||e[7]!==n||e[8]!==a||e[9]!==d?(u=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":a,title:d,onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:c,children:m}),e[6]=l,e[7]=n,e[8]=a,e[9]=d,e[10]=u):u=e[10],u}const vt=240,Lo=400,Go="sidebar.width";function Ie(t){return Math.max(vt,Math.min(Lo,t))}function Bo(){const t=z.c(11),[e,n]=Ge(Go,Ho),l=G.useRef(null);let o;t[0]!==n||t[1]!==e?(o=m=>{m.preventDefault();const u=m.clientX,f=Ie(e),p=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of h)b.style.transition="none";const g=b=>{const j=Ie(f+(b.clientX-u));p?.style.setProperty("--sidebar-width",`${j}px`)},x=b=>{const j=Ie(f+(b.clientX-u));n(j);for(const S of h)S.style.transition="";window.removeEventListener("pointermove",g),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",g),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let r;t[3]!==n?(r=()=>{n(vt)},t[3]=n,t[4]=r):r=t[4];const a=r;let d;t[5]!==e?(d=Ie(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function Ho(t){return typeof t=="number"?Ie(t):vt}function js(){return[]}function vs(t){const e=z.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 o;return e[1]!==n?(o=s.jsxs(dt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(mt,{children:s.jsx(te,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function ys(t){const e=z.c(18),{item:n}=t,{isMobile:l,setOpenMobile:o}=de();let i;e[0]!==l||e[1]!==n||e[2]!==o?(i=()=>{Y("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&o(!1)},e[0]=l,e[1]=n,e[2]=o,e[3]=i):i=e[3];const r=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=U(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]!==r||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(Q,{onClick:r,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=r,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(W,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Uo(t){const e=z.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Vt,{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,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ko),e[2]=n.group.items,e[3]=i):i=e[3];let r;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(r=s.jsx(vs,{label:l,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=r):r=e[7],r}case"items":{let l;e[8]!==n.items?(l=n.items.map(Wo),e[8]=n.items,e[9]=l):l=e[9];let o;return e[10]!==l?(o=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(te,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=o):o=e[11],o}case"custom":return n.content}}function Wo(t){return s.jsx(ys,{item:t},t.key)}function Ko(t){return s.jsx(ys,{item:t},t.key)}function qo(t){const e=z.c(17),{sections:n,footer:l,additionalContent:o,header:i,variant:r,contentClassName:a}=t,d=r===void 0?"sidebar":r;let c;e[0]!==i?(c=i&&s.jsx(Xs,{className:"sidebar-titlebar wco-drag shrink-0 h-12 flex flex-row items-center px-2 py-0 group-data-[collapsible=icon]/sidebar:hidden",children:i}),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=U("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n.map(Vo),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==o?(f=o&&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:o}),e[6]=o,e[7]=f):f=e[7];let p;e[8]!==m||e[9]!==u||e[10]!==f?(p=s.jsxs(Yt,{className:m,children:[u,f]}),e[8]=m,e[9]=u,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==l||e[13]!==c||e[14]!==p||e[15]!==d?(h=s.jsxs(Qs,{variant:d,children:[c,p,l]}),e[12]=l,e[13]=c,e[14]=p,e[15]=d,e[16]=h):h=e[16],h}function Vo(t,e){return s.jsx(Uo,{section:t},e)}function Ss(t){const e=z.c(2);let n;return e[0]!==t?(n=s.jsx(qo,{...t}),e[0]=t,e[1]=n):n=e[1],n}Ss.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(le,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function kt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Yo=Ds({name:Es().min(2,"Organization name is required")});function Xo(t){const e=z.c(66),{open:n,onOpenChange:l}=t,o=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Fs(Yo),defaultValues:{name:""}},e[0]=i):i=e[0];const r=Rs(i);let a;e[1]!==o?(a=async D=>{const T=kt(D.name);if(!T)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const E=await oe.organization.create({name:D.name,slug:T});if(E?.error)throw new Error(E.error.message||o("common.createOrganizationDialog.failedToCreate"));const H=E?.data?.slug??T;if(!H)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:H}},e[1]=o,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=Qo,e[3]=d):d=e[3];let c;e[4]!==a?(c={mutationFn:a,onSuccess:d},e[4]=a,e[5]=c):c=e[5];const m=st(c);let u;e[6]!==m.error||e[7]!==o?(u=m.error instanceof Error?m.error.message:m.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=m.error,e[7]=o,e[8]=u):u=e[8];const f=u;let p;e[9]!==o?(p=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=p):p=e[10];let h;e[11]!==p?(h=s.jsx(Nn,{children:p}),e[11]=p,e[12]=h):h=e[12];let g;e[13]!==o?(g=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=g):g=e[14];let x;e[15]!==g?(x=s.jsx(wn,{children:g}),e[15]=g,e[16]=x):x=e[16];let b;e[17]!==h||e[18]!==x?(b=s.jsxs(kn,{children:[h,x]}),e[17]=h,e[18]=x,e[19]=b):b=e[19];let j;if(e[20]!==m||e[21]!==r){let D;e[23]!==m?(D=T=>m.mutateAsync(T),e[23]=m,e[24]=D):D=e[24],j=r.handleSubmit(D),e[20]=m,e[21]=r,e[22]=j}else j=e[22];let S;e[25]!==r.formState.isSubmitting||e[26]!==o?(S=D=>{const{field:T}=D;return s.jsxs(Tn,{children:[s.jsx(Pn,{children:o("common.createOrganizationDialog.nameLabel")}),s.jsx(Dn,{children:s.jsx(Rn,{...T,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:r.formState.isSubmitting})}),s.jsx(En,{children:o("common.createOrganizationDialog.nameDescription")}),T.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",kt(T.value)]})]}),s.jsx(Fn,{})]})},e[25]=r.formState.isSubmitting,e[26]=o,e[27]=S):S=e[27];let y;e[28]!==r.control||e[29]!==S?(y=s.jsx(On,{control:r.control,name:"name",render:S}),e[28]=r.control,e[29]=S,e[30]=y):y=e[30];let v;e[31]!==f?(v=f&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:f}),e[31]=f,e[32]=v):v=e[32];const C=r.formState.isSubmitting;let N;e[33]!==m||e[34]!==r?(N=()=>{m.reset(),r.reset()},e[33]=m,e[34]=r,e[35]=N):N=e[35];let _;e[36]!==o?(_=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=_):_=e[37];let w;e[38]!==r.formState.isSubmitting||e[39]!==N||e[40]!==_?(w=s.jsx(An,{disabled:C,onClick:N,children:_}),e[38]=r.formState.isSubmitting,e[39]=N,e[40]=_,e[41]=w):w=e[41];const I=!r.formState.isValid||r.formState.isSubmitting;let $;e[42]!==r.formState.isSubmitting||e[43]!==o?($=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Ln,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=r.formState.isSubmitting,e[43]=o,e[44]=$):$=e[44];let k;e[45]!==I||e[46]!==$?(k=s.jsx(ce,{type:"submit",variant:"default",disabled:I,children:$}),e[45]=I,e[46]=$,e[47]=k):k=e[47];let O;e[48]!==w||e[49]!==k?(O=s.jsxs(In,{children:[w,k]}),e[48]=w,e[49]=k,e[50]=O):O=e[50];let A;e[51]!==j||e[52]!==y||e[53]!==v||e[54]!==O?(A=s.jsxs("form",{className:"space-y-6",onSubmit:j,autoComplete:"off",children:[y,v,O]}),e[51]=j,e[52]=y,e[53]=v,e[54]=O,e[55]=A):A=e[55];let M;e[56]!==r||e[57]!==A?(M=s.jsx(Mn,{...r,children:A}),e[56]=r,e[57]=A,e[58]=M):M=e[58];let F;e[59]!==b||e[60]!==M?(F=s.jsxs(zn,{children:[b,M]}),e[59]=b,e[60]=M,e[61]=F):F=e[61];let R;return e[62]!==l||e[63]!==n||e[64]!==F?(R=s.jsx($n,{open:n,onOpenChange:l,children:F}),e[62]=l,e[63]=n,e[64]=F,e[65]=R):R=e[65],R}function Qo(t){const{orgSlug:e}=t;window.location.href=`/${e}`}function _s(){const t=G.useContext(Ls),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>n?.()}}function Jo(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 qe(t){const e=z.c(13),{org:n,size:l}=t,o=l===void 0?"sm":l,i=o==="xs"?"size-5":"size-6",r=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=U(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Jo(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]!==r?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:U("font-semibold leading-none",r),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=r,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function Zo({invitation:t,onChanged:e}){const n=B(),[l,o]=G.useState(!1),i=t.organizationName??n("header.orgSwitcher.unknownOrganization"),r=async()=>{o(!0);try{const c=await oe.organization.acceptInvitation({invitationId:t.id});if(c.error){ee.error(c.error.message),o(!1);return}}catch{ee.error(n("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}ee.success(n("header.orgSwitcher.joined",{name:i})),Bs();let d;try{d=(await oe.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},a=async()=>{o(!0);try{const d=await oe.organization.rejectInvitation({invitationId:t.id});if(d.error){ee.error(d.error.message),o(!1);return}ee.success(n("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{ee.error(n("header.orgSwitcher.failedToDeclineInvitation")),o(!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(qe,{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:n("header.orgSwitcher.invitedToJoin")})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(ce,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:l,children:n("header.orgSwitcher.accept")}),s.jsx(ce,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:l,"aria-label":n("header.orgSwitcher.declineInvitationTo",{name:i}),children:s.jsx(Cn,{size:14})})]})]})}function el(t){const e=z.c(32),{orgParam:n,onSelectOrg:l,onCreateOrg:o}=t,i=B(),{data:r}=Gs(),{invitations:a,refetch:d}=_s();let c;e[0]!==n?(c=(A,M)=>A.slug===n?-1:M.slug===n?1:A.name.localeCompare(M.name),e[0]=n,e[1]=c):c=e[1];const m=[...r??[]].sort(c),[u,f]=G.useState(""),p=u.toLowerCase(),h=p?m.filter(A=>A.name.toLowerCase().includes(p)||A.slug.toLowerCase().includes(p)):m;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(rs,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=A=>f(A.target.value),e[3]=x):x=e[3];let b;e[4]!==u?(b=A=>A.key==="Escape"&&u&&f(""),e[4]=u,e[5]=b):b=e[5];let j;e[6]!==i?(j=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=j):j=e[7];let S;e[8]!==u||e[9]!==b||e[10]!==j?(S=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:u,onChange:x,onKeyDown:b,placeholder:j,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=u,e[9]=b,e[10]=j,e[11]=S):S=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Me,{size:16}),e[12]=y):y=e[12];let v;e[13]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[13]=o,e[14]=v):v=e[14];let C;e[15]!==S||e[16]!==v?(C=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,S,v]}),e[15]=S,e[16]=v,e[17]=C):C=e[17];const N="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let _;e[18]!==a||e[19]!==u||e[20]!==d?(_=!u&&a.map(A=>s.jsx(Zo,{invitation:A,onChanged:d},A.id)),e[18]=a,e[19]=u,e[20]=d,e[21]=_):_=e[21];const w=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?i("header.orgSwitcher.noOrganizationsMatch",{query:u}):i("header.orgSwitcher.noOrganizationsAvailable")});let I;e[22]!==l||e[23]!==n?(I=A=>s.jsxs("button",{type:"button",onClick:()=>l(A.slug),className:U("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",A.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(qe,{org:A,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:A.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.slug})]}),A.slug===n&&s.jsx(Oe,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},A.id),e[22]=l,e[23]=n,e[24]=I):I=e[24];const $=h.map(I);let k;e[25]!==_||e[26]!==w||e[27]!==$?(k=s.jsxs("div",{className:N,children:[_,w,$]}),e[25]=_,e[26]=w,e[27]=$,e[28]=k):k=e[28];let O;return e[29]!==k||e[30]!==C?(O=s.jsxs(s.Fragment,{children:[C,k]}),e[29]=k,e[30]=C,e[31]=O):O=e[31],O}function Cs(t){const e=z.c(22),{trigger:n,orgParam:l,align:o,side:i}=t,r=o===void 0?"start":o,a=i===void 0?"bottom":i,d=ie(),[c,m]=G.useState(!1),[u,f]=G.useState(!1);let p;e[0]!==n?(p=s.jsx(ke,{asChild:!0,children:n}),e[0]=n,e[1]=p):p=e[1];const h=String(c);let g;e[2]!==d?(g=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=g):g=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let b;e[5]!==l||e[6]!==h||e[7]!==g?(b=s.jsx(el,{orgParam:l,onSelectOrg:g,onCreateOrg:x},h),e[5]=l,e[6]=h,e[7]=g,e[8]=b):b=e[8];let j;e[9]!==r||e[10]!==a||e[11]!==b?(j=s.jsx(He,{side:a,align:r,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:sl,onCloseAutoFocus:tl,children:b}),e[9]=r,e[10]=a,e[11]=b,e[12]=j):j=e[12];let S;e[13]!==c||e[14]!==p||e[15]!==j?(S=s.jsxs(Ue,{open:c,onOpenChange:m,children:[p,j]}),e[13]=c,e[14]=p,e[15]=j,e[16]=S):S=e[16];let y;e[17]!==u?(y=s.jsx(Xo,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let v;return e[19]!==y||e[20]!==S?(v=s.jsxs(s.Fragment,{children:[S,y]}),e[19]=y,e[20]=S,e[21]=v):v=e[21],v}function tl(t){return t.preventDefault()}function sl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function nl(t){const e=z.c(21),{value:n,onChange:l,placeholder:o,onKeyDown:i,className:r,isSearching:a,disabled:d}=t,c=o===void 0?"Search...":o;let m;e[0]!==r?(m=U("shrink-0 w-full border-b border-border h-12",r),e[0]=r,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=U("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let p;e[4]!==a?(p=a?s.jsx(Kt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(rs,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=p):p=e[5];let h;e[6]!==l?(h=j=>l(j.target.value),e[6]=l,e[7]=h):h=e[7];let g;e[8]!==d||e[9]!==i||e[10]!==c||e[11]!==h||e[12]!==n?(g=s.jsx("input",{type:"text",value:n,onChange:h,onKeyDown:i,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]=i,e[10]=c,e[11]=h,e[12]=n,e[13]=g):g=e[13];let x;e[14]!==f||e[15]!==p||e[16]!==g?(x=s.jsxs("label",{className:f,children:[p,g]}),e[14]=f,e[15]=p,e[16]=g,e[17]=x):x=e[17];let b;return e[18]!==m||e[19]!==x?(b=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=b):b=e[20],b}function ol(t){const e=z.c(6),{value:n,onChange:l}=t,o=B();let i;e[0]!==o?(i=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i||e[4]!==n?(r=s.jsx(nl,{value:n,onChange:l,placeholder:i}),e[2]=l,e[3]=i,e[4]=n,e[5]=r):r=e[5],r}function ll(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("sidebar.agentsSection.noAgentsFound"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:n}),t[2]=n,t[3]=l):l=t[3],l}function il(t){const e=z.c(10),{org:n,onClose:l}=t,o=B();let i;e[0]!==n.slug?(i={org:n.slug},e[0]=n.slug,e[1]=i):i=e[1];let r;e[2]!==l?(r=()=>l(),e[2]=l,e[3]=r):r=e[3];let a;e[4]!==o?(a=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==i||e[7]!==r||e[8]!==a?(d=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(qt,{to:"/$org/settings/agents",params:i,onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:a})}),e[6]=i,e[7]=r,e[8]=a,e[9]=d):d=e[9],d}function rl(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("sidebar.agentsSection.agents"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx(Ns,{children:n}),t[2]=n,t[3]=l):l=t[3],l}function al(t){const e=z.c(11),{onImportFromGithub:n}=t,l=B();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Hn,{className:"size-3.5"}),e[0]=o):o=e[0];let i;e[1]!==l?(i=l("sidebar.agentsSection.import"),e[1]=l,e[2]=i):i=e[2];let r;e[3]!==n||e[4]!==i?(r=s.jsxs("button",{type:"button",onClick:n,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:[o,i]}),e[3]=n,e[4]=i,e[5]=r):r=e[5];let a;e[6]!==l?(a=l("sidebar.agentsSection.codeAgents"),e[6]=l,e[7]=a):a=e[7];let d;return e[8]!==r||e[9]!==a?(d=s.jsx(Ns,{action:r,children:a}),e[8]=r,e[9]=a,e[10]=d):d=e[10],d}function cl(t){const e=z.c(11),{setOpen:n,emptyCtaClass:l}=t,o=B();let i;e[0]!==o?(i=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i):i=e[1];let r;e[2]!==l?(r=U(l),e[2]=l,e[3]=r):r=e[3];let a;e[4]!==n?(a=()=>{Y("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[4]=n,e[5]=a):a=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Me,{className:"size-4"}),e[6]=d):d=e[6];let c;return e[7]!==i||e[8]!==r||e[9]!==a?(c=s.jsx(je,{"aria-label":i,className:r,onClick:a,children:d}),e[7]=i,e[8]=r,e[9]=a,e[10]=c):c=e[10],c}function dl(t){const e=z.c(17),{setOpen:n,highlightEmpty:l,emptyCtaClass:o}=t,i=B();let r;e[0]!==l||e[1]!==i?(r=l?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=l,e[1]=i,e[2]=r):r=e[2];let a;e[3]!==o?(a=U(o),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==n?(d=()=>{Y("agent_browser_opened",{surface:"mobile_drawer"}),n(!0)},e[5]=n,e[6]=d):d=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Me,{}),e[7]=c):c=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let u;e[10]!==m?(u=s.jsx("span",{children:m}),e[10]=m,e[11]=u):u=e[11];let f;return e[12]!==r||e[13]!==a||e[14]!==d||e[15]!==u?(f=s.jsx(W,{children:s.jsxs(Q,{tooltip:r,className:a,onClick:d,children:[c,u]})}),e[12]=r,e[13]=a,e[14]=d,e[15]=u,e[16]=f):f=e[16],f}function ml(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("sidebar.agentsSection.browseAgents"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx(ds,{className:"sr-only",children:n}),t[2]=n,t[3]=l):l=t[3],l}function ul(t){const e=z.c(8),{emptyCtaClass:n}=t,l=B();let o;e[0]!==l?(o=l("sidebar.agentsSection.browseAgents"),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==n?(i=U(n),e[2]=n,e[3]=i):i=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Me,{className:"size-4"}),e[4]=r):r=e[4];let a;return e[5]!==o||e[6]!==i?(a=s.jsx(je,{"aria-label":o,className:i,children:r}),e[5]=o,e[6]=i,e[7]=a):a=e[7],a}function fl(t){const e=z.c(19),{wrapEmptyHint:n,highlightEmpty:l,emptyCtaClass:o}=t,i=B();let r;e[0]!==l||e[1]!==i?(r=l?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=l,e[1]=i,e[2]=r):r=e[2];let a;e[3]!==o?(a=U(o),e[3]=o,e[4]=a):a=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Me,{}),e[5]=d):d=e[5];let c;e[6]!==i?(c=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=c):c=e[7];let m;e[8]!==c?(m=s.jsx("span",{children:c}),e[8]=c,e[9]=m):m=e[9];let u;e[10]!==r||e[11]!==a||e[12]!==m?(u=s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{tooltip:r,className:a,children:[d,m]})}),e[10]=r,e[11]=a,e[12]=m,e[13]=u):u=e[13];let f;e[14]!==u||e[15]!==n?(f=n(u),e[14]=u,e[15]=n,e[16]=f):f=e[16];let p;return e[17]!==f?(p=s.jsx(W,{children:f}),e[17]=f,e[18]=p):p=e[18],p}function pl(t){const e=z.c(9),{children:n}=t,l=B();let o;e[0]!==n?(o=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==l?(i=l("sidebar.agentsSection.selectAnExistingAgent"),e[2]=l,e[3]=i):i=e[3];let r;e[4]!==i?(r=s.jsx(pe,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=r):r=e[5];let a;return e[6]!==o||e[7]!==r?(a=s.jsxs(he,{defaultOpen:!0,delayDuration:0,children:[o,r]}),e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function hl(t){const e=ie(),{create:n}=ms(),{locator:l}=J(),o=ct({strict:!1}),i=Be({strict:!1});return async r=>{const a=crypto.randomUUID(),d=r===i.virtualmcpid?qn(t,l,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:r,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:r}})}}function Je(t){const e=z.c(20),{agent:n,selected:l,onClick:o}=t,i=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let r;e[0]!==i?(r=U("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(be,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(Oe,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==o||e[15]!==r||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:o,className:r,children:[a,m,u]}),e[14]=o,e[15]=r,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ns(t){const e=z.c(5),{children:n,action:l}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;return e[2]!==l||e[3]!==o?(i=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,l]}),e[2]=l,e[3]=o,e[4]=i):i=e[4],i}function xl(t){const e=z.c(23),{onClose:n,onSelectAgent:l,selectedAgentId:o,onImportFromGithub:i}=t,[r,a]=G.useState(""),d=os(),c=d??[],{org:m}=J(),{data:u}=oe.useSession(),f=u?.user?.id??"anon",p=Xn(d),h=Qn(),g=hl(m.slug),x=Zn(d),b=r.toLowerCase(),j=c.filter(vl).filter(L=>!x.has(L.id)).filter(jl).filter(L=>!r||L.title.toLowerCase().includes(b)),S=j.filter(bl),y=j.filter(gl),v=Re(m.id),C=!r||v.title.toLowerCase().includes(b),N=!!(l&&C);let _;e[0]!==n||e[1]!==l?(_=()=>{l?.(null),n(),a("")},e[0]=n,e[1]=l,e[2]=_):_=e[2];const w=_,I=L=>{if(l){l(L.id),n(),a("");return}Jn({orgId:m.id,userId:f},L.id,p),h(),n(),a(""),g(L.id)},$="flex flex-col max-h-[min(640px,80dvh)]";let k;e[3]!==r?(k=s.jsx(ol,{value:r,onChange:a}),e[3]=r,e[4]=k):k=e[4];const O="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",A=l&&C&&v&&s.jsx(Je,{agent:v,selected:!o||o===v.id,onClick:w}),M=(S.length>0||!r)&&s.jsx(al,{onImportFromGithub:i}),F=S.map(L=>s.jsx(Je,{agent:L,selected:l?o===L.id:void 0,onClick:()=>I(L)},L.id)),R=y.length>0&&s.jsx(rl,{}),D=y.map(L=>s.jsx(Je,{agent:L,selected:l?o===L.id:void 0,onClick:()=>I(L)},L.id));let T;e[5]!==N||e[6]!==r||e[7]!==j.length?(T=j.length===0&&!N&&r&&s.jsx(ll,{}),e[5]=N,e[6]=r,e[7]=j.length,e[8]=T):T=e[8];let E;e[9]!==T||e[10]!==A||e[11]!==M||e[12]!==F||e[13]!==R||e[14]!==D?(E=s.jsxs("div",{className:O,children:[A,M,F,R,D,T]}),e[9]=T,e[10]=A,e[11]=M,e[12]=F,e[13]=R,e[14]=D,e[15]=E):E=e[15];let H;e[16]!==n||e[17]!==m?(H=s.jsx(il,{org:m,onClose:n}),e[16]=n,e[17]=m,e[18]=H):H=e[18];let q;return e[19]!==E||e[20]!==H||e[21]!==k?(q=s.jsxs("div",{className:$,children:[k,E,H]}),e[19]=E,e[20]=H,e[21]=k,e[22]=q):q=e[22],q}function gl(t){return!fs(t.metadata)}function bl(t){return fs(t.metadata)}function jl(t){return!xn(t.id)}function vl(t){return!hn(t.id)}function yl(t){const e=z.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:o,onSelectAgent:i,selectedAgentId:r,side:a,align:d}=n,c=l===void 0?!1:l,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,p]=G.useState(!1),[h,g]=G.useState(!1),x=ut(),{setOpenMobile:b}=de(),j=Yn(),S=j?"border border-border":void 0;let y;e[2]!==j?(y=M=>j?s.jsx(pl,{children:M}):M,e[2]=j,e[3]=y):y=e[3];const v=y;let C;e[4]!==x||e[5]!==b?(C=()=>{p(!1),x&&b(!1)},e[4]=x,e[5]=b,e[6]=C):C=e[6];const N=C;let _;e[7]!==N?(_=()=>{N(),g(!0)},e[7]=N,e[8]=_):_=e[8];const w=_;let I;e[9]!==N||e[10]!==w||e[11]!==i||e[12]!==f||e[13]!==r?(I=f&&s.jsx(G.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(le,{className:"h-4 w-24"})}),children:s.jsx(xl,{onClose:N,onSelectAgent:i,selectedAgentId:r,onImportFromGithub:w})}),e[9]=N,e[10]=w,e[11]=i,e[12]=f,e[13]=r,e[14]=I):I=e[14];const $=I;let k;e[15]!==u||e[16]!==c||e[17]!==S||e[18]!==j||e[19]!==x||e[20]!==f||e[21]!==$||e[22]!==m||e[23]!==o||e[24]!==v?(k=x?s.jsxs(s.Fragment,{children:[o?s.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:o}):c?v(s.jsx(cl,{setOpen:p,emptyCtaClass:S})):s.jsx(dl,{setOpen:p,highlightEmpty:j,emptyCtaClass:S}),s.jsx(as,{open:f,onOpenChange:p,direction:"bottom",children:s.jsxs(cs,{className:"max-h-[85dvh] p-0",children:[s.jsx(ml,{}),$]})})]}):s.jsxs(Ue,{open:f,onOpenChange:M=>{M&&!f&&Y("agent_browser_opened",{surface:"desktop_popover"}),p(M)},children:[o?s.jsx(ke,{asChild:!0,children:o}):c?v(s.jsx(ke,{asChild:!0,children:s.jsx(ul,{emptyCtaClass:S})})):s.jsx(fl,{wrapEmptyHint:v,highlightEmpty:j,emptyCtaClass:S}),s.jsx(He,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:$})]}),e[15]=u,e[16]=c,e[17]=S,e[18]=j,e[19]=x,e[20]=f,e[21]=$,e[22]=m,e[23]=o,e[24]=v,e[25]=k):k=e[25];let O;e[26]!==h?(O=s.jsx(Un,{open:h,onOpenChange:g,mode:"agent"}),e[26]=h,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==k?(A=s.jsxs(s.Fragment,{children:[k,O]}),e[28]=O,e[29]=k,e[30]=A):A=e[30],A}const Sl="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-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 _l(t){const e=z.c(19),{agentId:n,fallback:l,onOpenHome:o,onPick:i}=t,r=gt(n)??l??null,a=r?.title??"Super Agent",d=`Open ${a} home`,c=r?.icon??null;let m;e[0]!==c||e[1]!==a?(m=s.jsx(be,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=m):m=e[2];let u;e[3]!==o||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:o,"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]=o,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=p):p=e[9];let h;e[10]!==f?(h=s.jsxs("button",{type:"button",className:Sl,children:[f,p]}),e[10]=f,e[11]=h):h=e[11];let g;e[12]!==n||e[13]!==i||e[14]!==h?(g=s.jsx(yl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:i,trigger:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=g):g=e[15];let x;return e[16]!==u||e[17]!==g?(x=s.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[u,g]}),e[16]=u,e[17]=g,e[18]=x):x=e[18],x}function it(t){const e=z.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{showName:l}=n,{org:o}=J(),{state:i,isMobile:r}=de(),a=_s().invitations.length>0,d=i==="collapsed"||r,c=a?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let m;e[2]!==o?(m=s.jsx(qe,{org:o,size:"sm"}),e[2]=o,e[3]=m):m=e[3];let u;e[4]!==a||e[5]!==d?(u=a&&s.jsx("span",{className:U("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=a,e[5]=d,e[6]=u):u=e[6];let f;e[7]!==m||e[8]!==u?(f=s.jsxs("span",{className:"relative inline-flex",children:[m,u]}),e[7]=m,e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o.name||e[11]!==l?(p=l&&s.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=l,e[12]=p):p=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=h):h=e[13];let g;e[14]!==c||e[15]!==f||e[16]!==p?(g=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":c,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] 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:[f,p,h]})}),e[14]=c,e[15]=f,e[16]=p,e[17]=g):g=e[17];let x;e[18]!==o.slug||e[19]!==g?(x=s.jsx(Cs,{orgParam:o.slug,trigger:g}),e[18]=o.slug,e[19]=g,e[20]=x):x=e[20];let b;e[21]!==o.name?(b=s.jsx(pe,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=b):b=e[22];let j;return e[23]!==b||e[24]!==x?(j=s.jsxs(he,{children:[x,b]}),e[23]=b,e[24]=x,e[25]=j):j=e[25],j}function Ve(t){const e=z.c(24);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:l}=n,{org:o}=J(),i=ie();let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[2]=r):r=e[2];const a=ct(r);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const c=Be(d),{threads:m}=bt(),{data:u}=oe.useSession(),{setTaskId:f,createNewTask:p}=jt();let h;e[4]!==o.id?(h=Re(o.id),e[4]=o.id,e[5]=h):h=e[5];const g=h,x=g.id,b=a.taskId?c.virtualmcpid??x:x;let j;e[6]!==p||e[7]!==x||e[8]!==i||e[9]!==l||e[10]!==o.slug||e[11]!==u?.user?.id||e[12]!==f||e[13]!==m?(j=_=>{if(!_||_===x){i({to:"/$org",params:{org:o.slug}}),l?.();return}const w=no(m,_,u?.user?.id);w?f(w.id,_):p(_),l?.()},e[6]=p,e[7]=x,e[8]=i,e[9]=l,e[10]=o.slug,e[11]=u?.user?.id,e[12]=f,e[13]=m,e[14]=j):j=e[14];const S=j;let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=y):y=e[15];const v=b===x?g:void 0;let C;e[16]!==b||e[17]!==S?(C=()=>S(b),e[16]=b,e[17]=S,e[18]=C):C=e[18];let N;return e[19]!==b||e[20]!==S||e[21]!==v||e[22]!==C?(N=s.jsx(G.Suspense,{fallback:y,children:s.jsx(_l,{agentId:b,fallback:v,onOpenHome:C,onPick:S})}),e[19]=b,e[20]=S,e[21]=v,e[22]=C,e[23]=N):N=e[23],N}function At(t){const e=z.c(18),{item:n,onClose:l}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=U(o),e[0]=o,e[1]=i):i=e[1];let r;e[2]!==n||e[3]!==l?(r=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=r):r=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==r||e[12]!==a||e[13]!==d?(c=s.jsxs(Q,{onClick:r,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=r,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(W,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function Cl(t){const e=z.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Vt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let r;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(At,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],r=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=r}else r=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==r?(a=s.jsx(vs,{label:o,defaultExpanded:i,children:r}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=r,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==l||e[12]!==n.items){let r;e[14]!==l?(r=a=>s.jsx(At,{item:a,onClose:l},a.key),e[14]=l,e[15]=r):r=e[15],o=n.items.map(r),e[11]=l,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(te,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Nl(t){const e=z.c(27),{sections:n,onClose:l,footer:o,additionalContent:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(it,{}),e[0]=r):r=e[0];let a;e[1]!==l?(a=s.jsx(Ve,{onNavigate:l}),e[1]=l,e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"flex-1"}),e[3]=d):d=e[3];const c=B();let m;e[4]!==c?(m=c("sidebar.navigationMobile.closeSidebar"),e[4]=c,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ss,{size:16}),e[6]=u):u=e[6];let f;e[7]!==l||e[8]!==m?(f=s.jsx(je,{onClick:l,"aria-label":m,children:u}),e[7]=l,e[8]=m,e[9]=f):f=e[9];let p;e[10]!==a||e[11]!==f?(p=s.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 px-1.5",children:[r,a,d,f]}),e[10]=a,e[11]=f,e[12]=p):p=e[12];let h;if(e[13]!==l||e[14]!==n){let j;e[16]!==l?(j=(S,y)=>s.jsx(Cl,{section:S,onClose:l},y),e[16]=l,e[17]=j):j=e[17],h=n.map(j),e[13]=l,e[14]=n,e[15]=h}else h=e[15];let g;e[18]!==i?(g=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[18]=i,e[19]=g):g=e[19];let x;e[20]!==g||e[21]!==h?(x=s.jsxs(Yt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[h,g]}),e[20]=g,e[21]=h,e[22]=x):x=e[22];let b;return e[23]!==o||e[24]!==x||e[25]!==p?(b=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[p,x,o]}),e[23]=o,e[24]=x,e[25]=p,e[26]=b):b=e[26],b}function we(t){const e=z.c(26),{item:n,onClose:l}=t;let o;e[0]!==n.className?(o=U("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",n.className),e[0]=n.className,e[1]=o):o=e[1];const i=o;if(n.href){const m=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let f;e[2]!==n.icon?(f=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[2]=n.icon,e[3]=f):f=e[3];let p;e[4]!==n.label?(p=s.jsx("span",{className:"flex-1",children:n.label}),e[4]=n.label,e[5]=p):p=e[5];let h;return e[6]!==i||e[7]!==n.href||e[8]!==l||e[9]!==m||e[10]!==u||e[11]!==f||e[12]!==p?(h=s.jsxs("a",{href:n.href,target:m,rel:u,className:i,onClick:l,children:[f,p]}),e[6]=i,e[7]=n.href,e[8]=l,e[9]=m,e[10]=u,e[11]=f,e[12]=p,e[13]=h):h=e[13],h}let r;e[14]!==n||e[15]!==l?(r=()=>{n.onClick?.(),l()},e[14]=n,e[15]=l,e[16]=r):r=e[16];let a;e[17]!==n.icon?(a=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[17]=n.icon,e[18]=a):a=e[18];let d;e[19]!==n.label?(d=s.jsx("span",{className:"flex-1",children:n.label}),e[19]=n.label,e[20]=d):d=e[20];let c;return e[21]!==i||e[22]!==r||e[23]!==a||e[24]!==d?(c=s.jsxs("button",{type:"button",onClick:r,className:i,children:[a,d]}),e[21]=i,e[22]=r,e[23]=a,e[24]=d,e[25]=c):c=e[25],c}function wl(){const t=z.c(4),e=B();let n;t[0]!==e?(n=e("common.accountPopover.impersonating"),t[0]=e,t[1]=n):n=t[1];let l;return t[2]!==n?(l=s.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-medium text-warning",children:n}),t[2]=n,t[3]=l):l=t[3],l}function It(t){const e=z.c(38),{user:n,userImage:l,isImpersonating:o,isMobile:i}=t,r=B(),a=i?"py-4 border-b border-border":"py-3 mx-1 mt-1";let d;e[0]!==a?(d=U("flex items-center gap-3 px-4",a),e[0]=a,e[1]=d):d=e[1];const c=n?.name??"U";let m;e[2]!==c||e[3]!==l?(m=s.jsx(nt,{url:l,fallback:c,shape:"circle",size:"sm",className:"shrink-0"}),e[2]=c,e[3]=l,e[4]=m):m=e[4];let u;e[5]!==r||e[6]!==n?.name?(u=n?.name??r("common.accountPopover.defaultUserName"),e[5]=r,e[6]=n?.name,e[7]=u):u=e[7];let f;e[8]!==u?(f=s.jsx("p",{className:"text-sm font-medium truncate",children:u}),e[8]=u,e[9]=f):f=e[9];let p;e[10]!==o?(p=o&&s.jsx(wl,{}),e[10]=o,e[11]=p):p=e[11];let h;e[12]!==f||e[13]!==p?(h=s.jsxs("div",{className:"flex items-center gap-2",children:[f,p]}),e[12]=f,e[13]=p,e[14]=h):h=e[14];const g=n?.email;let x;e[15]!==g?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g}),e[15]=g,e[16]=x):x=e[16];let b;e[17]!==x||e[18]!==h?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,x]}),e[17]=x,e[18]=h,e[19]=b):b=e[19];let j;e[20]!==r||e[21]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{ee.success(r("common.accountPopover.userIdCopied"))})},e[20]=r,e[21]=n,e[22]=j):j=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ot,{size:14}),e[23]=S):S=e[23];let y;e[24]!==j?(y=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[24]=j,e[25]=y):y=e[25];let v;e[26]!==r?(v=r("common.accountPopover.copyUserId"),e[26]=r,e[27]=v):v=e[27];let C;e[28]!==v?(C=s.jsx(pe,{side:"right",children:s.jsx("p",{className:"text-xs",children:v})}),e[28]=v,e[29]=C):C=e[29];let N;e[30]!==y||e[31]!==C?(N=s.jsx(ns,{delayDuration:300,children:s.jsxs(he,{children:[y,C]})}),e[30]=y,e[31]=C,e[32]=N):N=e[32];let _;return e[33]!==b||e[34]!==N||e[35]!==d||e[36]!==m?(_=s.jsxs("div",{className:d,children:[m,b,N]}),e[33]=b,e[34]=N,e[35]=d,e[36]=m,e[37]=_):_=e[37],_}function zt(t){const e=z.c(35),{themeOptions:n,preferences:l,setPreferences:o,isMobile:i}=t,r=B(),a=i?"size-8":"size-7",d=i?"px-3 py-3":"px-2 py-1.5";let c;e[0]!==d?(c=U("flex items-center justify-between border-t border-border/50",d),e[0]=d,e[1]=c):c=e[1];let m;if(e[2]!==a||e[3]!==l.theme||e[4]!==o||e[5]!==n){let v;e[7]!==a||e[8]!==l.theme||e[9]!==o?(v=C=>{const{value:N,icon:_,label:w}=C;return s.jsx("button",{type:"button","aria-label":w,onClick:()=>o(I=>({...I,theme:N})),className:U(a,"rounded-md flex items-center justify-center transition-colors",l.theme===N?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:_},N)},e[7]=a,e[8]=l.theme,e[9]=o,e[10]=v):v=e[10],m=n.map(v),e[2]=a,e[3]=l.theme,e[4]=o,e[5]=n,e[6]=m}else m=e[6];let u;e[11]!==m?(u=s.jsx("div",{className:"flex items-center gap-0.5",children:m}),e[11]=m,e[12]=u):u=e[12];let f;e[13]!==l.enableSounds||e[14]!==r?(f=l.enableSounds?r("common.accountPopover.disableSounds"):r("common.accountPopover.enableSounds"),e[13]=l.enableSounds,e[14]=r,e[15]=f):f=e[15];let p;e[16]!==o?(p=()=>o(kl),e[16]=o,e[17]=p):p=e[17];const h=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let g;e[18]!==a||e[19]!==h?(g=U(a,"rounded-md flex items-center justify-center transition-colors",h),e[18]=a,e[19]=h,e[20]=g):g=e[20];let x;e[21]!==l.enableSounds?(x=l.enableSounds?s.jsx(gn,{size:14}):s.jsx(bn,{size:14}),e[21]=l.enableSounds,e[22]=x):x=e[22];let b;e[23]!==f||e[24]!==p||e[25]!==g||e[26]!==x?(b=s.jsx("button",{type:"button","aria-label":f,onClick:p,className:g,children:x}),e[23]=f,e[24]=p,e[25]=g,e[26]=x,e[27]=b):b=e[27];let j;e[28]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.99.4"]}),e[28]=j):j=e[28];let S;e[29]!==b?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[b,j]}),e[29]=b,e[30]=S):S=e[30];let y;return e[31]!==S||e[32]!==c||e[33]!==u?(y=s.jsxs("div",{className:c,children:[u,S]}),e[31]=S,e[32]=c,e[33]=u,e[34]=y):y=e[34],y}function kl(t){return{...t,enableSounds:!t.enableSounds}}function $t(t){const e=z.c(54),{user:n,userImage:l,menuItems:o,signOutItem:i,stopImpersonatingItem:r,isImpersonating:a,themeOptions:d,preferences:c,setPreferences:m,close:u,isMobile:f}=t;if(f){let y;e[0]!==a||e[1]!==n||e[2]!==l?(y=s.jsx(It,{user:n,userImage:l,isImpersonating:a,isMobile:!0}),e[0]=a,e[1]=n,e[2]=l,e[3]=y):y=e[3];let v;if(e[4]!==u||e[5]!==o){let $;e[7]!==u?($=k=>s.jsx(we,{item:k,onClose:u},k.key),e[7]=u,e[8]=$):$=e[8],v=o.map($),e[4]=u,e[5]=o,e[6]=v}else v=e[6];let C;e[9]!==u||e[10]!==r?(C=r&&s.jsx(we,{item:r,onClose:u}),e[9]=u,e[10]=r,e[11]=C):C=e[11];let N;e[12]!==u||e[13]!==i?(N=s.jsx(we,{item:i,onClose:u}),e[12]=u,e[13]=i,e[14]=N):N=e[14];let _;e[15]!==v||e[16]!==C||e[17]!==N?(_=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,C,N]})}),e[15]=v,e[16]=C,e[17]=N,e[18]=_):_=e[18];let w;e[19]!==c||e[20]!==m||e[21]!==d?(w=s.jsx(zt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!0}),e[19]=c,e[20]=m,e[21]=d,e[22]=w):w=e[22];let I;return e[23]!==y||e[24]!==_||e[25]!==w?(I=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[y,_,w]}),e[23]=y,e[24]=_,e[25]=w,e[26]=I):I=e[26],I}let p;e[27]!==a||e[28]!==n||e[29]!==l?(p=s.jsx(It,{user:n,userImage:l,isImpersonating:a,isMobile:!1}),e[27]=a,e[28]=n,e[29]=l,e[30]=p):p=e[30];let h;if(e[31]!==u||e[32]!==o){let y;e[34]!==u?(y=v=>s.jsx(we,{item:v,onClose:u},v.key),e[34]=u,e[35]=y):y=e[35],h=o.map(y),e[31]=u,e[32]=o,e[33]=h}else h=e[33];let g;e[36]!==u||e[37]!==r?(g=r&&s.jsx(we,{item:r,onClose:u}),e[36]=u,e[37]=r,e[38]=g):g=e[38];let x;e[39]!==u||e[40]!==i?(x=s.jsx(we,{item:i,onClose:u}),e[39]=u,e[40]=i,e[41]=x):x=e[41];let b;e[42]!==h||e[43]!==g||e[44]!==x?(b=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[h,g,x]}),e[42]=h,e[43]=g,e[44]=x,e[45]=b):b=e[45];let j;e[46]!==c||e[47]!==m||e[48]!==d?(j=s.jsx(zt,{themeOptions:d,preferences:c,setPreferences:m,isMobile:!1}),e[46]=c,e[47]=m,e[48]=d,e[49]=j):j=e[49];let S;return e[50]!==p||e[51]!==b||e[52]!==j?(S=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[p,b,j]})}),e[50]=p,e[51]=b,e[52]=j,e[53]=S):S=e[53],S}function ze(){const t=z.c(99),e=B(),{data:n}=oe.useSession(),{org:l}=J(),o=ie();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=Hs(i)?.params.org,[d,c]=Ut(),m=ut(),{isAdmin:u}=po(),[f,p]=G.useState(!1),h=n?.user,g=h?.image,x=!!n?.session?.impersonatedBy;let b;t[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>p(!1),t[1]=b):b=t[1];const j=b;let S;t[2]!==e?(S=e("common.accountPopover.preferences"),t[2]=e,t[3]=S):S=t[3];let y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(We,{size:16}),t[4]=y):y=t[4];let v;t[5]!==o||t[6]!==a?(v=()=>{o({to:"/$org/settings/profile",params:{org:a??""}})},t[5]=o,t[6]=a,t[7]=v):v=t[7];let C;t[8]!==S||t[9]!==v?(C={key:"preferences",label:S,icon:y,onClick:v},t[8]=S,t[9]=v,t[10]=C):C=t[10];let N;t[11]!==l||t[12]!==o||t[13]!==e?(N=l?[{key:"install-app",label:e("common.accountPopover.addToHomeScreen"),icon:s.jsx(oo,{size:16}),onClick:()=>{o({to:"/$org/install",params:{org:l.slug}})}},{key:"connect-clients",label:"Connect to Agents",icon:s.jsx(ro,{size:16}),onClick:()=>{o({to:"/$org/settings/connect",params:{org:l.slug}})}}]:[],t[11]=l,t[12]=o,t[13]=e,t[14]=N):N=t[14];let _;t[15]!==e?(_=e("common.accountPopover.termsOfUse"),t[15]=e,t[16]=_):_=t[16];let w;t[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(io,{size:16}),t[17]=w):w=t[17];let I;t[18]!==_?(I={key:"terms",label:_,icon:w,href:"https://www.decocms.com/terms-of-use",external:!0},t[18]=_,t[19]=I):I=t[19];let $;t[20]!==e?($=e("common.accountPopover.privacyPolicy"),t[20]=e,t[21]=$):$=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(uo,{size:16}),t[22]=k):k=t[22];let O;t[23]!==$?(O={key:"privacy",label:$,icon:k,href:"https://www.decocms.com/privacy-policy",external:!0},t[23]=$,t[24]=O):O=t[24];let A;t[25]!==e?(A=e("common.accountPopover.githubRepo"),t[25]=e,t[26]=A):A=t[26];let M;t[27]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Us,{className:"w-4 h-4"}),t[27]=M):M=t[27];let F;t[28]!==A?(F={key:"github",label:A,icon:M,href:"https://github.com/decocms/studio",external:!0},t[28]=A,t[29]=F):F=t[29];let R;t[30]!==e?(R=e("common.accountPopover.community"),t[30]=e,t[31]=R):R=t[31];let D;t[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(fo,{size:16}),t[32]=D):D=t[32];let T;t[33]!==R?(T={key:"community",label:R,icon:D,href:"https://decocms.com/discord",external:!0},t[33]=R,t[34]=T):T=t[34];let E;t[35]!==e?(E=e("common.accountPopover.homepage"),t[35]=e,t[36]=E):E=t[36];let H;t[37]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(lo,{size:16}),t[37]=H):H=t[37];let q;t[38]!==E?(q={key:"homepage",label:E,icon:H,href:"https://decocms.com",external:!0},t[38]=E,t[39]=q):q=t[39];let L;t[40]!==u||t[41]!==o||t[42]!==e?(L=u?[{key:"admin-dashboard",label:e("common.accountPopover.adminDashboard"),icon:s.jsx(ls,{size:16}),onClick:()=>o({to:"/_admin"}),className:"text-warning"}]:[],t[40]=u,t[41]=o,t[42]=e,t[43]=L):L=t[43];let se;t[44]!==O||t[45]!==F||t[46]!==T||t[47]!==q||t[48]!==L||t[49]!==C||t[50]!==N||t[51]!==I?(se=[C,...N,I,O,F,T,q,...L],t[44]=O,t[45]=F,t[46]=T,t[47]=q,t[48]=L,t[49]=C,t[50]=N,t[51]=I,t[52]=se):se=t[52];const me=se;let re;t[53]!==e?(re=e("common.accountPopover.signOut"),t[53]=e,t[54]=re):re=t[54];let ue;t[55]===Symbol.for("react.memo_cache_sentinel")?(ue=s.jsx(Ct,{size:16}),t[55]=ue):ue=t[55];let ve;t[56]!==re?(ve={key:"logout",label:re,icon:ue,onClick:Il},t[56]=re,t[57]=ve):ve=t[57];const ye=ve;let Se;t[58]!==x||t[59]!==e?(Se=x?{key:"stop-impersonating",label:e("common.accountPopover.stopImpersonation"),icon:s.jsx(Ct,{size:16}),onClick:async()=>{const{error:yt}=await oe.admin.stopImpersonating();if(yt){ee.error(yt.message||e("common.accountPopover.failedToStopImpersonation"));return}window.location.href="/"},className:"text-warning"}:null,t[58]=x,t[59]=e,t[60]=Se):Se=t[60];const _e=Se;let Ce;t[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(co,{size:14}),t[61]=Ce):Ce=t[61];let xe;t[62]!==e?(xe=e("common.accountPopover.lightTheme"),t[62]=e,t[63]=xe):xe=t[63];let ne;t[64]!==xe?(ne={value:"light",icon:Ce,label:xe},t[64]=xe,t[65]=ne):ne=t[65];let Ne;t[66]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(mo,{size:14}),t[66]=Ne):Ne=t[66];let ae;t[67]!==e?(ae=e("common.accountPopover.darkTheme"),t[67]=e,t[68]=ae):ae=t[68];let P;t[69]!==ae?(P={value:"dark",icon:Ne,label:ae},t[69]=ae,t[70]=P):P=t[70];let K;t[71]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(lt,{size:14}),t[71]=K):K=t[71];let X;t[72]!==e?(X=e("common.accountPopover.systemTheme"),t[72]=e,t[73]=X):X=t[73];let V;t[74]!==X?(V={value:"system",icon:K,label:X},t[74]=X,t[75]=V):V=t[75];let ge;t[76]!==ne||t[77]!==P||t[78]!==V?(ge=[ne,P,V],t[76]=ne,t[77]=P,t[78]=V,t[79]=ge):ge=t[79];const Xe=ge;let Te;t[80]!==x||t[81]!==m||t[82]!==me||t[83]!==d||t[84]!==c||t[85]!==ye||t[86]!==_e||t[87]!==Xe||t[88]!==h||t[89]!==g?(Te={user:h,userImage:g,menuItems:me,signOutItem:ye,stopImpersonatingItem:_e,isImpersonating:x,themeOptions:Xe,preferences:d,setPreferences:c,close:j,isMobile:m},t[80]=x,t[81]=m,t[82]=me,t[83]=d,t[84]=c,t[85]=ye,t[86]=_e,t[87]=Xe,t[88]=h,t[89]=g,t[90]=Te):Te=t[90];const Pe=Te;let De;return t[91]!==x||t[92]!==m||t[93]!==f||t[94]!==Pe||t[95]!==e||t[96]!==h?.name||t[97]!==g?(De=s.jsx(s.Fragment,{children:m?s.jsxs(as,{open:f,onOpenChange:p,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>p(!0),className:U("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",x&&"border-2 border-dashed border-warning"),children:[s.jsx(nt,{url:g,fallback:h?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]}),s.jsxs(cs,{className:"h-[80dvh] p-0",children:[s.jsx(ds,{className:"sr-only",children:e("common.accountPopover.account")}),s.jsx($t,{...Pe})]})]}):s.jsxs(Ue,{open:f,onOpenChange:p,children:[s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{tooltip:h?.name??e("common.accountPopover.defaultAccountLabel"),className:U("rounded-md",x&&"border-2 border-dashed border-warning"),children:[s.jsx(nt,{url:g,fallback:h?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:h?.name??e("common.accountPopover.defaultAccountLabel")})]})}),s.jsx(He,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Al,children:s.jsx($t,{...Pe})})]})}),t[91]=x,t[92]=m,t[93]=f,t[94]=Pe,t[95]=e,t[96]=h?.name,t[97]=g,t[98]=De):De=t[98],De}function Al(t){return t.preventDefault()}function Il(){Y("signed_out",{source:"account_popover"}),Ws(),oe.signOut()}const zl=["Browse and edit your Library files","Run your agents","Enable and call any MCP tool in this org"],$l="Connect: ";function Ol(){return typeof window>"u"?"unknown host":window.location.hostname}function Ml(t){const e=z.c(45),{onClose:n}=t,{org:l}=J();let o;e[0]!==l.slug?(o=ho(l.slug),e[0]=l.slug,e[1]=o):o=e[1];const i=o,r=xo(),[a,d]=G.useState(null),c=Nt(),m=Nt();let u;e[2]!==r||e[3]!==l.slug?(u=()=>{r.mutate({name:`${$l}Claude Code on ${Ol()}`,permissions:{"*":["*"]}},{onSuccess:F=>{const R=go(l.slug,F.key);d(R),Y("connect_studio_generate",{target:"claude-code"}),navigator.clipboard?.writeText(R).then(El,Dl)},onError:Pl})},e[2]=r,e[3]=l.slug,e[4]=u):u=e[4];const f=u;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("span",{className:"size-8 rounded-lg bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(ps,{size:17})}),e[5]=p):p=e[5];let h;e[6]!==l.name?(h=s.jsxs(ft,{className:"flex items-center gap-2.5",children:[p,"Connect ",l.name," to Claude"]}),e[6]=l.name,e[7]=h):h=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Qt,{children:"Hand Claude this org's MCP endpoint. Once linked, Claude can:"}),e[8]=g):g=e[8];let x;e[9]!==h?(x=s.jsxs(Jt,{children:[h,g]}),e[9]=h,e[10]=x):x=e[10];let b;e[11]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("ul",{className:"flex flex-col gap-2 text-sm",children:zl.map(Tl)}),e[11]=b):b=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(St,{size:15,className:"text-muted-foreground"}),e[12]=j):j=e[12];let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[j,"Claude Code",s.jsx("span",{className:"ml-auto text-[11px] font-medium text-special uppercase tracking-wide",children:"Recommended"})]}),e[13]=S):S=e[13];let y;e[14]!==a||e[15]!==c||e[16]!==r.isPending||e[17]!==f?(y=s.jsxs("section",{className:"rounded-xl border border-border bg-muted/30 p-4 flex flex-col gap-3",children:[S,a?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-lg border border-border bg-background p-3 max-h-32 overflow-y-auto",children:s.jsx("code",{className:"text-xs leading-relaxed break-all font-mono text-foreground/90 whitespace-pre-wrap",children:a})}),s.jsxs(ce,{size:"sm",className:"gap-1.5 self-start",onClick:()=>{c.handleCopy(a),Y("connect_studio_copy",{target:"claude-code"}),ee.success("Command copied — paste it in your terminal")},children:[c.copied?s.jsx(Oe,{size:14}):s.jsx(ot,{size:14}),c.copied?"Copied":"Copy command"]}),s.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2",children:[s.jsx(ls,{size:14,className:"text-warning shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-xs leading-relaxed text-foreground/80",children:["No login step — this command embeds a"," ",s.jsx("span",{className:"font-medium text-foreground",children:"full-access token"}),". Treat it like a password; revoke it any time in Settings → Connect."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"One command, no browser login. We'll mint a scoped access token and embed it so Claude Code connects instantly."}),s.jsxs(ce,{size:"sm",className:"gap-1.5 self-start",disabled:r.isPending,onClick:f,children:[s.jsx(St,{size:14}),r.isPending?"Generating…":"Generate connect command"]})]})]}),e[14]=a,e[15]=c,e[16]=r.isPending,e[17]=f,e[18]=y):y=e[18];let v,C;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[s.jsx(jn,{size:15,className:"text-muted-foreground"}),"Claude Desktop or claude.ai"]}),C=s.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:"Add a custom connector in Settings → Connectors and paste this URL. Claude signs in with OAuth on first use."}),e[19]=v,e[20]=C):(v=e[19],C=e[20]);let N;e[21]!==i?(N=s.jsx("code",{className:"text-xs flex-1 min-w-0 truncate font-mono text-foreground/90",children:i}),e[21]=i,e[22]=N):N=e[22];let _;e[23]!==i||e[24]!==m?(_=()=>{m.handleCopy(i),Y("connect_studio_copy",{target:"claude-connector"})},e[23]=i,e[24]=m,e[25]=_):_=e[25];let w;e[26]!==m.copied?(w=m.copied?s.jsx(Oe,{size:14}):s.jsx(ot,{size:14}),e[26]=m.copied,e[27]=w):w=e[27];let I;e[28]!==_||e[29]!==w?(I=s.jsx(ce,{variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"Copy URL",onClick:_,children:w}),e[28]=_,e[29]=w,e[30]=I):I=e[30];let $;e[31]!==N||e[32]!==I?($=s.jsxs("section",{className:"flex flex-col gap-2.5",children:[v,C,s.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 pl-3 pr-1.5 py-1.5 min-w-0",children:[N,I]})]}),e[31]=N,e[32]=I,e[33]=$):$=e[33];let k;e[34]!==l.slug?(k={org:l.slug},e[34]=l.slug,e[35]=k):k=e[35];let O;e[36]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(ht,{size:12}),e[36]=O):O=e[36];let A;e[37]!==n||e[38]!==k?(A=s.jsx("div",{className:"flex items-center border-t border-border pt-3",children:s.jsx(ce,{asChild:!0,variant:"link",size:"sm",className:"px-0 text-xs gap-1",children:s.jsxs(qt,{to:"/$org/settings/connect",params:k,onClick:n,children:["More clients & API keys ",O]})})}),e[37]=n,e[38]=k,e[39]=A):A=e[39];let M;return e[40]!==y||e[41]!==$||e[42]!==A||e[43]!==x?(M=s.jsxs("div",{className:"flex flex-col gap-4 min-w-0",children:[x,b,y,$,A]}),e[40]=y,e[41]=$,e[42]=A,e[43]=x,e[44]=M):M=e[44],M}function Tl(t){return s.jsxs("li",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"size-4 rounded-full bg-special/15 text-special flex items-center justify-center shrink-0",children:s.jsx(Oe,{size:11,strokeWidth:3})}),s.jsx("span",{className:"text-foreground",children:t})]},t)}function Pl(t){return ee.error(t.message)}function Dl(){return ee.success("Command ready — copy it below")}function El(){return ee.success("Command copied — paste it in your terminal")}function Fl(t){const e=z.c(6),{open:n,onOpenChange:l}=t;let o;e[0]!==l?(o=s.jsx(Xt,{className:"max-w-lg gap-4",children:s.jsx(Ml,{onClose:()=>l(!1)})}),e[0]=l,e[1]=o):o=e[1];let i;return e[2]!==l||e[3]!==n||e[4]!==o?(i=s.jsx(pt,{open:n,onOpenChange:l,children:o}),e[2]=l,e[3]=n,e[4]=o,e[5]=i):i=e[5],i}function $e(t){const e=z.c(50),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,o=B(),i=Gn(),[r,a]=G.useState(!1);let d,c;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online||e[4]!==o){const y=bo(i.capabilities,o);let v;e[7]!==i.online||e[8]!==o?(v=i.online?o("header.linkedDesktopIndicator.desktopLinked"):o("header.linkedDesktopIndicator.connectDesktop"),e[7]=i.online,e[8]=o,e[9]=v):v=e[9],d=v,c=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??o("header.linkedDesktopIndicator.desktopLinked")}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?o("header.linkedDesktopIndicator.availableCapabilities",{capabilities:y.join(", ")}):o("header.linkedDesktopIndicator.noCliAgents")})]}):s.jsx("span",{className:"text-xs",children:o("header.linkedDesktopIndicator.desktopDisconnected")}),e[0]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d,e[6]=c}else d=e[5],c=e[6];const m=c;if(l==="full"){let y,v;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(lt,{}),e[10]=y,e[11]=v):(y=e[10],v=e[11]);let C;e[12]!==d?(C=s.jsx("span",{children:d}),e[12]=d,e[13]=C):C=e[13];let N;e[14]!==i.online?(N=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[14]=i.online,e[15]=N):N=e[15];let _;e[16]!==d||e[17]!==C||e[18]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(Q,{tooltip:d,onClick:y,children:[v,C,N]})}),e[16]=d,e[17]=C,e[18]=N,e[19]=_):_=e[19];let w;e[20]!==m?(w=s.jsx(pe,{side:"right",children:m}),e[20]=m,e[21]=w):w=e[21];let I;e[22]!==_||e[23]!==w?(I=s.jsxs(he,{children:[_,w]}),e[22]=_,e[23]=w,e[24]=I):I=e[24];let $;e[25]!==r?($=s.jsx(wt,{open:r,onOpenChange:a}),e[25]=r,e[26]=$):$=e[26];let k;return e[27]!==$||e[28]!==I?(k=s.jsxs(s.Fragment,{children:[I,$]}),e[27]=$,e[28]=I,e[29]=k):k=e[29],k}let u;e[30]===Symbol.for("react.memo_cache_sentinel")?(u=()=>a(!0),e[30]=u):u=e[30];let f;e[31]!==i.online||e[32]!==o?(f=i.online?o("header.linkedDesktopIndicator.desktopLinked"):o("header.linkedDesktopIndicator.connectYourDesktop"),e[31]=i.online,e[32]=o,e[33]=f):f=e[33];let p;e[34]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(lt,{size:16}),e[34]=p):p=e[34];let h;e[35]!==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[35]=i.online,e[36]=h):h=e[36];let g;e[37]!==f||e[38]!==h?(g=s.jsx(fe,{asChild:!0,children:s.jsxs(je,{onClick:u,"aria-label":f,children:[p,h]})}),e[37]=f,e[38]=h,e[39]=g):g=e[39];let x;e[40]!==m?(x=s.jsx(pe,{side:"bottom",children:m}),e[40]=m,e[41]=x):x=e[41];let b;e[42]!==g||e[43]!==x?(b=s.jsxs(he,{children:[g,x]}),e[42]=g,e[43]=x,e[44]=b):b=e[44];let j;e[45]!==r?(j=s.jsx(wt,{open:r,onOpenChange:a}),e[45]=r,e[46]=j):j=e[46];let S;return e[47]!==j||e[48]!==b?(S=s.jsxs(s.Fragment,{children:[b,j]}),e[47]=j,e[48]=b,e[49]=S):S=e[49],S}class Rl extends G.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 Ll(t){return t<=1?"text-destructive":t<=5?"text-warning":"text-foreground/70"}function Gl(){const t=z.c(17),e=ie(),{org:n}=J(),{hasDecoKey:l,balanceDollars:o}=eo();if(!l)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let r;t[2]!==o?(r=U(o!=null&&Ll(o)),t[2]=o,t[3]=r):r=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(vn,{}),t[7]=d):d=t[7];let c;t[8]!==o?(c=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,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]!==i||t[13]!==r||t[14]!==a||t[15]!==m?(u=s.jsx(te,{children:s.jsx(W,{children:s.jsxs(Q,{tooltip:i,className:r,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=r,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function Ot(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Rl,{children:s.jsx(G.Suspense,{fallback:null,children:s.jsx(Gl,{})})}),t[0]=e):e=t[0],e}function Ze(){const t=z.c(14),e=B(),n=ie(),{org:l}=J();let o;t[0]!==e?(o=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==n||t[3]!==l.slug?(i=()=>n({to:"/$org/settings",params:{org:l.slug}}),t[2]=n,t[3]=l.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(We,{}),t[5]=r):r=t[5];let a;t[6]!==e?(a=e("sidebar.sidebarFooter.settings"),t[6]=e,t[7]=a):a=t[7];let d;t[8]!==a?(d=s.jsx("span",{children:a}),t[8]=a,t[9]=d):d=t[9];let c;return t[10]!==o||t[11]!==i||t[12]!==d?(c=s.jsxs(Q,{tooltip:o,onClick:i,children:[r,d]}),t[10]=o,t[11]=i,t[12]=d,t[13]=c):c=t[13],c}function Bl(){const t=z.c(9),e=B(),n=ie(),{org:l}=J();let o;t[0]!==e?(o=e("sidebar.sidebarFooter.settings"),t[0]=e,t[1]=o):o=t[1];let i;t[2]!==n||t[3]!==l.slug?(i=()=>n({to:"/$org/settings",params:{org:l.slug}}),t[2]=n,t[3]=l.slug,t[4]=i):i=t[4];let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(We,{size:15}),t[5]=r):r=t[5];let a;return t[6]!==o||t[7]!==i?(a=s.jsx("button",{type:"button","aria-label":o,onClick:i,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",children:r}),t[6]=o,t[7]=i,t[8]=a):a=t[8],a}function Mt(){const t=z.c(33),e=B(),[n,l]=G.useState(!1),[o,i]=G.useState(!1);let r;t[0]!==e?(r=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=r):r=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(is,{}),t[2]=a):a=t[2];let d;t[3]!==e?(d=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=d):d=t[4];let c;t[5]!==d?(c=s.jsx("span",{children:d}),t[5]=d,t[6]=c):c=t[6];let m;t[7]!==r||t[8]!==c?(m=s.jsx(W,{children:s.jsx(hs,{trigger:s.jsxs(Q,{tooltip:r,children:[a,c]})})}),t[7]=r,t[8]=c,t[9]=m):m=t[9];let u;t[10]!==e?(u=e("sidebar.sidebarFooter.addConnection"),t[10]=e,t[11]=u):u=t[11];let f,p;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(!0),p=s.jsx(ao,{}),t[12]=f,t[13]=p):(f=t[12],p=t[13]);let h;t[14]!==e?(h=e("sidebar.sidebarFooter.addConnection"),t[14]=e,t[15]=h):h=t[15];let g;t[16]!==h?(g=s.jsx("span",{children:h}),t[16]=h,t[17]=g):g=t[17];let x;t[18]!==u||t[19]!==g?(x=s.jsx(W,{children:s.jsxs(Q,{tooltip:u,onClick:f,children:[p,g]})}),t[18]=u,t[19]=g,t[20]=x):x=t[20];let b;t[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(W,{children:s.jsxs(Q,{tooltip:"Connect to Claude",onClick:()=>{Y("connect_studio_opened",{source:"sidebar_footer"}),i(!0)},children:[s.jsx(ps,{}),s.jsx("span",{children:"Connect to Claude"})]})}),t[21]=b):b=t[21];let j;t[22]!==x||t[23]!==m?(j=s.jsxs(te,{className:"gap-0.5",children:[m,x,b]}),t[22]=x,t[23]=m,t[24]=j):j=t[24];let S;t[25]!==n?(S=s.jsx(to,{open:n,onOpenChange:l,mode:"browse"}),t[25]=n,t[26]=S):S=t[26];let y;t[27]!==o?(y=s.jsx(Fl,{open:o,onOpenChange:i}),t[27]=o,t[28]=y):y=t[28];let v;return t[29]!==j||t[30]!==S||t[31]!==y?(v=s.jsxs(s.Fragment,{children:[j,S,y]}),t[29]=j,t[30]=S,t[31]=y,t[32]=v):v=t[32],v}function Tt(){const t=z.c(10),e=B();let n;t[0]!==e?(n=e("sidebar.sidebarFooter.inviteMembers"),t[0]=e,t[1]=n):n=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(is,{}),t[2]=l):l=t[2];let o;t[3]!==e?(o=e("sidebar.sidebarFooter.inviteMembers"),t[3]=e,t[4]=o):o=t[4];let i;t[5]!==o?(i=s.jsx("span",{children:o}),t[5]=o,t[6]=i):i=t[6];let r;return t[7]!==n||t[8]!==i?(r=s.jsx(te,{className:"gap-0.5",children:s.jsx(W,{children:s.jsx(hs,{trigger:s.jsxs(Q,{tooltip:n,children:[l,i]})})})}),t[7]=n,t[8]=i,t[9]=r):r=t[9],r}function Hl(){const t=z.c(17),{state:e}=de(),n=e==="collapsed";if(Ke()){if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Tt,{}),t[0]=f):f=t[0];let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(W,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx($e,{})})}),t[1]=p):p=t[1];let h;t[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(W,{children:s.jsx(Ze,{})}),t[2]=h):h=t[2];let g;return t[3]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(Ae,{className:"px-2 pb-3 gap-1",children:[f,s.jsxs(te,{children:[p,h,s.jsx(W,{children:s.jsx(ze,{})})]})]}),t[3]=g):g=t[3],g}let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Tt,{}),t[4]=c):c=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W,{children:s.jsx($e,{variant:"full"})}),t[5]=m):m=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(Ae,{className:"px-2 pb-3 gap-0.5",children:[c,s.jsxs(te,{className:"gap-0.5",children:[m,s.jsx(W,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ze,{})}),s.jsx(Bl,{})]})})]})]}),t[6]=u):u=t[6],u}if(n){let c,m;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Mt,{}),m=s.jsx(Ot,{}),t[7]=c,t[8]=m):(c=t[7],m=t[8]);let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(W,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx($e,{})})}),t[9]=u):u=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(W,{children:s.jsx(Ze,{})}),t[10]=f):f=t[10];let p;return t[11]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs(Ae,{className:"px-2 pb-3 gap-1",children:[c,m,s.jsxs(te,{children:[u,f,s.jsx(W,{children:s.jsx(ze,{})})]})]}),t[11]=p):p=t[11],p}let o,i;t[12]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Mt,{}),i=s.jsx(Ot,{}),t[12]=o,t[13]=i):(o=t[12],i=t[13]);let r;t[14]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(W,{children:s.jsx($e,{variant:"full"})}),t[14]=r):r=t[14];let a;t[15]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(W,{children:s.jsx(Ze,{})}),t[15]=a):a=t[15];let d;return t[16]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(Ae,{className:"px-2 pb-3 gap-0.5",children:[o,i,s.jsxs(te,{className:"gap-0.5",children:[r,a,s.jsx(W,{children:s.jsx(ze,{})})]})]}),t[16]=d):d=t[16],d}function Ul(){const t=z.c(11),e=B(),n=ie(),{org:l}=J(),{setOpenMobile:o}=de();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(te,{children:s.jsx(W,{children:s.jsx(ze,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e?(r=e("sidebar.sidebarFooterMobile.settings"),t[1]=e,t[2]=r):r=t[2];let a;t[3]!==n||t[4]!==l.slug||t[5]!==o?(a=()=>{n({to:"/$org/settings",params:{org:l.slug}}),o(!1)},t[3]=n,t[4]=l.slug,t[5]=o,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(We,{className:"size-4"}),t[7]=d):d=t[7];let c;return t[8]!==r||t[9]!==a?(c=s.jsx(Ae,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(je,{"aria-label":r,onClick:a,children:d})]})}),t[8]=r,t[9]=a,t[10]=c):c=t[10],c}function Pt(t){const e=z.c(15),{className:n,wrapperClassName:l,children:o}=t,[i,r]=G.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&r(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;r(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=U("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==o||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:o}),e[4]=o,e[5]=n,e[6]=f):f=e[6];const p=i?"opacity-100":"opacity-0";let h;e[7]!==p?(h=U("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",p),e[7]=p,e[8]=h):h=e[8];let g;e[9]!==h?(g=s.jsx("div",{"aria-hidden":!0,className:h}),e[9]=h,e[10]=g):g=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==g?(x=s.jsxs("div",{className:u,children:[f,g]}),e[11]=u,e[12]=f,e[13]=g,e[14]=x):x=e[14],x}function Wl(t){const e=z.c(9),{virtualMcpId:n,size:l,showAutomationBadge:o}=t,i=l===void 0?"sm":l,r=B();let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(Kl,{virtualMcpId:n,size:i}):s.jsx(be,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let d;e[3]!==o||e[4]!==r?(d=o&&s.jsx("span",{"aria-label":r("tasksPanel.mcpAvatar.automationTriggered"),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(gs,{size:10,className:"text-white"})}),e[3]=o,e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==a||e[7]!==d?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,d]}),e[6]=a,e[7]=d,e[8]=c):c=e[8],c}function Kl(t){const e=z.c(6),{virtualMcpId:n,size:l}=t,o=gt(n);if(!o){let a;return e[0]!==l?(a=s.jsx(be,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const i=o.icon??null;let r;return e[2]!==o.title||e[3]!==l||e[4]!==i?(r=s.jsx(be,{icon:i,name:o.title,size:l}),e[2]=o.title,e[3]=l,e[4]=i,e[5]=r):r=e[5],r}function Dt(t){const e=z.c(53),{open:n,onOpenChange:l}=t,[o,i]=G.useState(""),{org:r}=J(),{setTaskId:a}=jt(),d=xs(),c=B();let m,u,f;e[0]!==r.id||e[1]!==o?(f=o.trim(),u=Ks,m=Wt.globalSearch(r.id,f),e[0]=r.id,e[1]=o,e[2]=m,e[3]=u,e[4]=f):(m=e[2],u=e[3],f=e[4]);const p=n&&f.length>0;let h;e[5]!==d||e[6]!==f?(h=async()=>await d.call("GLOBAL_SEARCH",{query:f,limit:20}),e[5]=d,e[6]=f,e[7]=h):h=e[7];let g;e[8]!==m||e[9]!==p||e[10]!==h?(g={queryKey:m,enabled:p,queryFn:h,staleTime:1e4},e[8]=m,e[9]=p,e[10]=h,e[11]=g):g=e[11];const{data:x,isFetching:b}=u(g);let j;e[12]!==x?.items?(j=x?.items??[],e[12]=x?.items,e[13]=j):j=e[13];const S=j;let y;e[14]!==l?(y=E=>{E||i(""),l(E)},e[14]=l,e[15]=y):y=e[15];const v=y;let C;e[16]!==v||e[17]!==a?(C=E=>{v(!1),a(E.id,E.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=C):C=e[18];const N=C;let _;e[19]!==c?(_=c("tasksPanel.globalSearchDialog.title"),e[19]=c,e[20]=_):_=e[20];let w;e[21]!==_?(w=s.jsx(ft,{children:_}),e[21]=_,e[22]=w):w=e[22];let I;e[23]!==c?(I=c("tasksPanel.globalSearchDialog.description"),e[23]=c,e[24]=I):I=e[24];let $;e[25]!==I?($=s.jsx(Qt,{children:I}),e[25]=I,e[26]=$):$=e[26];let k;e[27]!==w||e[28]!==$?(k=s.jsxs(Jt,{className:"sr-only",children:[w,$]}),e[27]=w,e[28]=$,e[29]=k):k=e[29];let O;e[30]!==c?(O=c("tasksPanel.globalSearchDialog.placeholder"),e[30]=c,e[31]=O):O=e[31];let A;e[32]!==o||e[33]!==O?(A=s.jsx(Co,{value:o,onValueChange:i,placeholder:O}),e[32]=o,e[33]=O,e[34]=A):A=e[34];let M;e[35]!==N||e[36]!==b||e[37]!==S||e[38]!==c||e[39]!==f?(M=f?b&&S.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.searching")}):S.length===0?s.jsx(So,{children:c("tasksPanel.globalSearchDialog.noResults")}):S.map(E=>E.type==="thread"?s.jsxs(_o,{value:`thread:${E.id}:${E.title}`,onSelect:()=>N(E),className:"gap-2.5",children:[s.jsx(Wl,{virtualMcpId:E.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:E.title||c("tasksPanel.globalSearchDialog.untitledChat")})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(E.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${E.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:c("tasksPanel.globalSearchDialog.startTyping")}),e[35]=N,e[36]=b,e[37]=S,e[38]=c,e[39]=f,e[40]=M):M=e[40];let F;e[41]!==M?(F=s.jsx(No,{children:M}),e[41]=M,e[42]=F):F=e[42];let R;e[43]!==A||e[44]!==F?(R=s.jsxs(wo,{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:[A,F]}),e[43]=A,e[44]=F,e[45]=R):R=e[45];let D;e[46]!==k||e[47]!==R?(D=s.jsxs(Xt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[k,R]}),e[46]=k,e[47]=R,e[48]=D):D=e[48];let T;return e[49]!==v||e[50]!==n||e[51]!==D?(T=s.jsx(pt,{open:n,onOpenChange:v,children:D}),e[49]=v,e[50]=n,e[51]=D,e[52]=T):T=e[52],T}function ql(t){return t==="ephemeral"||t.startsWith("thread:")}function ws(t){const e=z.c(45),{task:n,isActive:l,onClick:o,onArchive:i,showAutomationBadge:r,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=B(),u=Io(n.status),f=u.icon,p=n.metadata?.kind==="tool_call_run",h=gt(p?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=so(h),e[0]=h,e[1]=g):g=e[1];const x=g;zo(6e4);const b=r||!!n.trigger_id,j=n.id,S="button",y=0;let v;e[2]!==o?(v=H=>{H.target===H.currentTarget&&(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const C=c?"-ml-4 pl-6":"pl-[7px]",N=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==C||e[5]!==N?(_=U("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=_):_=e[6];let w;e[7]!==p||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(w=a&&!p&&s.jsx(be,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=p,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=w):w=e[11];let I;e[12]!==b||e[13]!==m?(I=b&&s.jsx(gs,{size:12,"aria-label":m("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-blue-500"}),e[12]=b,e[13]=m,e[14]=I):I=e[14];let $;e[15]!==m||e[16]!==n.title?($=n.title||m("tasksPanel.taskRow.untitledTask"),e[15]=m,e[16]=n.title,e[17]=$):$=e[17];let k;e[18]!==$?(k=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[18]=$,e[19]=k):k=e[19];let O;e[20]!==I||e[21]!==k?(O=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[I,k]}),e[20]=I,e[21]=k,e[22]=O):O=e[22];let A;e[23]!==x||e[24]!==l||e[25]!==n.branch||e[26]!==n.updated_at?(A=n.updated_at&&s.jsxs("div",{className:U("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!ql(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Oo(new Date(n.updated_at))})]}),e[23]=x,e[24]=l,e[25]=n.branch,e[26]=n.updated_at,e[27]=A):A=e[27];let M;e[28]!==O||e[29]!==A?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,A]}),e[28]=O,e[29]=A,e[30]=M):M=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!d&&s.jsx("span",{className:U("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",i&&"group-hover/row:opacity-0"),"aria-label":m("tasksPanel.taskRow.statusLabel",{status:u.label}),children:s.jsx(f,{size:14,className:U(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[31]!==i||e[32]!==m?(D=i&&s.jsxs(he,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":m("tasksPanel.taskRow.archiveTask"),onClick:H=>{H.stopPropagation(),i()},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-8 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(qs,{size:14})})}),s.jsx(pe,{side:"right",children:m("tasksPanel.taskRow.archive")})]}),e[31]=i,e[32]=m,e[33]=D):D=e[33];let T;e[34]!==R||e[35]!==D?(T=s.jsxs("div",{className:F,children:[R,D]}),e[34]=R,e[35]=D,e[36]=T):T=e[36];let E;return e[37]!==o||e[38]!==M||e[39]!==T||e[40]!==v||e[41]!==_||e[42]!==w||e[43]!==n.id?(E=s.jsxs("div",{"data-task-id":j,role:S,tabIndex:y,onClick:o,onKeyDown:v,className:_,children:[w,M,T]}),e[37]=o,e[38]=M,e[39]=T,e[40]=v,e[41]=_,e[42]=w,e[43]=n.id,e[44]=E):E=e[44],E}const Et=["requires_action","in_progress","failed","expired","completed"];function Vl(t){const e=new Map(Et.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return Et.map(n=>({status:n,threads:e.get(n)}))}const Yl="sidebar.group.expanded.";function Xl(t,e){const n=z.c(3),[l,o]=Ge(`${Yl}${t}`,e);let i;return n[0]!==l||n[1]!==o?(i=[l,o],n[0]=l,n[1]=o,n[2]=i):i=n[2],i}function ks(t){const e=z.c(18),{onClick:n,isFetching:l,indented:o}=t,i=B();let r;e[0]!==i?(r=i("sidebar.showMoreButton.ariaLabel"),e[0]=i,e[1]=r):r=e[1];const a=o?"-ml-4 pl-6 pr-2":"px-2";let d;e[2]!==a?(d=U("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",a,"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[2]=a,e[3]=d):d=e[3];let c;e[4]!==l?(c=l&&s.jsx(Kt,{size:14,className:"animate-spin"}),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==l||e[7]!==i?(m=i(l?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=l,e[7]=i,e[8]=m):m=e[8];let u;e[9]!==m?(u=s.jsx("span",{children:m}),e[9]=m,e[10]=u):u=e[10];let f;return e[11]!==l||e[12]!==n||e[13]!==r||e[14]!==d||e[15]!==c||e[16]!==u?(f=s.jsxs("button",{type:"button","aria-label":r,onClick:n,disabled:l,className:d,children:[c,u]}),e[11]=l,e[12]=n,e[13]=r,e[14]=d,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Ql(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Jl(t){return t.member==="mine"&&!t.currentUserId}const As=4;let Fe=0;const rt=[];function Zl(){for(;Fe<As&&rt.length>0;){const t=rt.shift();t&&t()}}function Is(t){return new Promise((e,n)=>{const l=()=>{Fe++,t().then(e,n).finally(()=>{Fe--,Zl()})};Fe<As?l():rt.push(l)})}const Ye=10;function Ft(t,e,n,l,o){const i={hidden:!1};l.member==="mine"&&l.currentUserId&&(i.created_by=l.currentUserId),l.type==="automation"&&(i.has_trigger=!0),l.type==="manual"&&(i.has_trigger=!1);const r={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return r.status=e,r}function ei(t,e,n,l){let o=0;for(const i of t)zs(i,e,n,l)&&o++;return o}function et(t,e,n,l){return ei(t,e,n,l)}function ti(t,e){return!!(t>=Ye||t===0&&e)}function Rt(t,e){return t<e}function si(t,e){return e===!1?!1:e===!0?!0:t}function zs(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 Le=new Map,Ee=new Map;function ni(t,e){return e?t>=Ye?!0:null:!1}function Lt(t){return Le.get(t)}function oi(t,e){Le.set(t,e)}function li(t,e,n){const l=Le.get(t);if(l!==void 0){n(l);return}let o=Ee.get(t);o||(o=Is(e).then(i=>(Le.set(t,i),Ee.delete(t),i)).catch(()=>(Ee.delete(t),Promise.reject(new Error("group probe failed")))),Ee.set(t,o)),o.then(n,()=>n(!1))}function Gt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ye,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ii(t,e,n,l,o){let i=0;for(const r of t)e.has(r.id)||zs(r,n,l,o)&&i++;return i}function ri(t,e,n,l){const o=z.c(8),{org:i}=J(),r=Ql(i.id,t,e,n);let a;o[0]!==n?(a=Jl(n),o[0]=n,o[1]=a):a=o[1];const d=a,[c,m]=G.useState({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==r&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:null,serverHasMore:null});const u=Wn(),{threads:f,hasMore:p}=bt(),h=et(f,t,e,n),g=ti(h,p),x=ni(h,p),b=xs();if(c.identity===r&&c.serverHasMore===null){const N=x??Lt(r);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:r,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===r&&c.serverHasMore===null&&x===null&&Lt(r)===void 0&&c.probeSubscribedIdentity!==r&&(m(N=>N.identity===r?{...N,isProbing:!0,probeSubscribedIdentity:r}:N),li(r,async()=>{const N=Ft(t,e,0,n,1),_=await b.call("COLLECTION_THREADS_LIST",N),{totalCount:w}=Gt(_),I=et(u.threads.get(),t,e,n);return w===void 0?!1:Rt(I,w)},N=>{m(_=>_.identity!==r?_:{..._,isProbing:!1,serverHasMore:N})}));const S=async function(){if(c.isFetching||c.isProbing||d)return;const _=r;m(w=>w.identity===_?{...w,isFetching:!0}:w);try{const w=et(f,t,e,n),I=Ft(t,e,w,n,Ye),$=await Is(()=>b.call("COLLECTION_THREADS_LIST",I)),{items:k,hasMore:O,totalCount:A}=Gt($),M=new Set(f.map(ai)),F=ii(k,M,t,e,n),R=w;u.mergeThreads(k),m(D=>{if(D.identity!==_)return D;let T;return A!==void 0?T=Rt(R+F,A):T=k.length===0||F===0?!1:O,oi(_,T),{...D,isFetching:!1,serverHasMore:T}})}catch(w){const I=w,$=I instanceof Error?I.message:String(I);ee.error(`Could not load more tasks: ${$}`),m(k=>k.identity===_?{...k,isFetching:!1}:k)}},y=c.isFetching||c.isProbing,v=!d&&!y&&si(g,c.serverHasMore);let C;return o[2]!==y||o[3]!==S||o[4]!==v||o[5]!==c.isProbing||o[6]!==c.serverHasMore?(C={hasMore:v,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:S},o[2]=y,o[3]=S,o[4]=v,o[5]=c.isProbing,o[6]=c.serverHasMore,o[7]=C):C=o[7],C}function ai(t){return t.id}function ci(t){const e=z.c(20),{status:n,threads:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:p}=ri("status",n,d),[h,g]=G.useState(!1);!h&&l.length===0&&p===!0&&!c&&!m&&(g(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==d||e[3]!==r||e[4]!==i||e[5]!==l){let S;e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r||e[11]!==i?(S=y=>s.jsx(ws,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:a&&y.created_by===d.currentUserId?()=>r(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=i,e[12]=S):S=e[12],x=l.map(S),e[0]=o,e[1]=a,e[2]=d,e[3]=r,e[4]=i,e[5]=l,e[6]=x}else x=e[6];let b;e[13]!==f||e[14]!==c||e[15]!==u?(b=(f||c)&&s.jsx(ks,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=b):b=e[16];let j;return e[17]!==x||e[18]!==b?(j=s.jsxs(s.Fragment,{children:[x,b]}),e[17]=x,e[18]=b,e[19]=j):j=e[19],j}function di(t){const e=z.c(36),{status:n,threads:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d}=t,c=$o[n],m=c.icon,[u,f]=Xl(`status-${n}`,!1);let p;e[0]!==u||e[1]!==f?(p=function(){f(!u)},e[0]=u,e[1]=f,e[2]=p):p=e[2];const h=p;let g;e[3]!==h?(g=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),h())},e[3]=h,e[4]=g):g=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 b;e[8]!==u?(b=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(xt,{size:14}):s.jsx(Mo,{size:14})}),e[8]=u,e[9]=b):b=e[9];let j;e[10]!==x||e[11]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,b]}),e[10]=x,e[11]=b,e[12]=j):j=e[12];let S;e[13]!==c.label?(S=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=S):S=e[14];let y;e[15]!==l.length?(y=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]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==g||e[20]!==j||e[21]!==S||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:g,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,S,y]}),e[17]=u,e[18]=h,e[19]=g,e[20]=j,e[21]=S,e[22]=y,e[23]=v):v=e[23];let C;e[24]!==o||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==r||e[29]!==i||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(ci,{status:n,threads:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:a,filters:d})}),e[24]=o,e[25]=a,e[26]=u,e[27]=d,e[28]=r,e[29]=i,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==v||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,C]}),e[33]=v,e[34]=C,e[35]=N):N=e[35],N}function Bt(t){const e=z.c(38),{threads:n,groupBy:l,activeTaskId:o,onSelectTask:i,onArchiveTask:r,filters:a,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(Ao,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const b=u?"No chats match your filters":"No chats yet";let j;return e[1]!==b?(j=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:b})]}),e[1]=b,e[2]=j):j=e[2],j}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==o||e[4]!==f||e[5]!==a||e[6]!==r||e[7]!==i||e[8]!==n){let j;e[10]!==o||e[11]!==f||e[12]!==a||e[13]!==r||e[14]!==i?(j=S=>s.jsx(di,{status:S.status,threads:S.threads,activeTaskId:o,onSelectTask:i,onArchiveTask:r,canArchive:f,filters:a},S.status),e[10]=o,e[11]=f,e[12]=a,e[13]=r,e[14]=i,e[15]=j):j=e[15],x=Vl(n).map(j),e[3]=o,e[4]=f,e[5]=a,e[6]=r,e[7]=i,e[8]=n,e[9]=x}else x=e[9];let b;return e[16]!==x?(b=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=b):b=e[17],b}let p;if(e[18]!==o||e[19]!==f||e[20]!==a||e[21]!==r||e[22]!==i||e[23]!==n){let x;e[25]!==o||e[26]!==f||e[27]!==a||e[28]!==r||e[29]!==i?(x=b=>s.jsx(ws,{task:b,isActive:o===b.id,onClick:()=>i(b),onArchive:f&&b.created_by===a.currentUserId?()=>r(b):void 0,showAutomationBadge:!!b.trigger_id,showAgentIcon:!0},b.id),e[25]=o,e[26]=f,e[27]=a,e[28]=r,e[29]=i,e[30]=x):x=e[30],p=n.map(x),e[18]=o,e[19]=f,e[20]=a,e[21]=r,e[22]=i,e[23]=n,e[24]=p}else p=e[24];let h;e[31]!==d||e[32]!==c||e[33]!==m?(h=(d||c)&&s.jsx(ks,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=h):h=e[34];let g;return e[35]!==p||e[36]!==h?(g=s.jsxs(s.Fragment,{children:[p,h]}),e[35]=p,e[36]=h,e[37]=g):g=e[37],g}function mi(t,e,n){if(!n)return;const l=t.findIndex(o=>o.id===e);if(l!==-1){for(let o=l+1;o<t.length;o++){const i=t[o];if(i?.created_by===n)return i}for(let o=l-1;o>=0;o--){const i=t[o];if(i?.created_by===n)return i}}}function Ht(t){const e=z.c(17),{label:n,onClick:l,active:o,children:i}=t,[r,a]=G.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=o&&"bg-sidebar-accent text-foreground";let p;e[4]!==f?(p=U("md:size-[34px] rounded-lg",f),e[4]=f,e[5]=p):p=e[5];let h;e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==p?(h=s.jsx(fe,{asChild:!0,children:s.jsx(je,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:p,children:i})}),e[6]=i,e[7]=n,e[8]=l,e[9]=p,e[10]=h):h=e[10];let g;e[11]!==n?(g=s.jsx(pe,{side:"bottom",children:n}),e[11]=n,e[12]=g):g=e[12];let x;return e[13]!==r||e[14]!==h||e[15]!==g?(x=s.jsxs(he,{open:r,children:[h,g]}),e[13]=r,e[14]=h,e[15]=g,e[16]=x):x=e[16],x}function tt(t){const e=z.c(13),{label:n,value:l,onChange:o,options:i}=t;let r;e[0]!==n?(r=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=r):r=e[1];let a;e[2]!==o?(a=u=>u&&o(u),e[2]=o,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(ui),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==l?(c=s.jsx(yo,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r,c]}),e[10]=r,e[11]=c,e[12]=m):m=e[12],m}function ui(t){return s.jsxs(vo,{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 $s({onNavigate:t}={}){const e=B(),{data:n}=oe.useSession(),l=n?.user?.id,{org:o}=J(),i=es({connectionId:ts,orgId:o.id,orgSlug:o.slug}),r=Re(o.id).id,a=os(),{threads:d,hasMore:c,isFetchingMore:m,fetchNextPage:u}=bt(),f=d.filter(P=>!P.hidden),{hide:p,setScope:h}=ms(),g=ie(),{setTaskId:x,createNewTask:b}=jt(),j=ct({strict:!1}),S=Be({strict:!1}),y=j.taskId??null,v=S.virtualmcpid??d.find(P=>P.id===y)?.virtual_mcp_id??null,C=()=>{t?.()},N=[...f].sort((P,K)=>(K.updated_at??"").localeCompare(P.updated_at??"")),[_,w]=G.useState("all"),[I,$]=G.useState("flat"),[k,O]=Ge("sidebar-threads-scope-all",!1),[A,M]=G.useState(!1),[F,R]=G.useState(!1),D={type:_,member:"mine",currentUserId:l??null},T={};k||(T.created_by="me"),h(T);const E=P=>l?P.filter(K=>K.created_by===l):[],H=P=>_==="automation"?P.filter(K=>!!K.trigger_id):_==="manual"?P.filter(K=>!K.trigger_id):P,q=E(N),L=H(q),se=H(N),me=k?se:L,re=P=>{if(l&&P.created_by&&P.created_by!==l)return;const K=P.id===y;if(p(P.id),Vn(P.id),!K)return;const X=mi(me,P.id,l);C(),X?x(X.id,X.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},ue=P=>{C(),x(P.id,P.virtual_mcp_id)},ve=async P=>{try{const K=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:P,limit:1,offset:0}});return((K.structuredContent??K).items?.length??0)===0}catch{return!1}},ye=async()=>{const P=v??r;Y("sidebar_new_thread_clicked",{virtual_mcp_id:P});const K=q.find(X=>X.virtual_mcp_id===P&&X.title==="New chat");if(K&&await ve(K.id)){C(),x(K.id,P);return}C(),b(P)},{state:Se,isMobile:_e,toggleSidebar:Ce}=de();if(Se==="collapsed"&&!_e){const P=Re(o.id),K=new Map((a??[]).map(V=>[V.id,V])),X=V=>(V?K.get(V):void 0)??(V===r?P:void 0);return s.jsxs("div",{className:"flex flex-col min-h-0 flex-1 -mt-1 w-[calc(var(--sidebar-width-icon)-1rem)]",children:[s.jsx("div",{className:"flex h-12 shrink-0 items-center justify-center",children:s.jsx(Cs,{orgParam:o.slug,side:"right",align:"start",trigger:s.jsx(Q,{tooltip:o.name,children:s.jsx(qe,{org:o,size:"sm"})})})}),s.jsxs(te,{className:"mt-2 min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(W,{children:s.jsx(Q,{"aria-label":e("sidebar.taskGroupsList.toggleSidebar"),tooltip:e("sidebar.taskGroupsList.toggleSidebar"),onClick:Ce,children:s.jsx(ss,{size:16})})}),s.jsx(W,{children:s.jsx(Q,{"aria-label":e("sidebar.taskGroupsList.newChat"),tooltip:e("sidebar.taskGroupsList.newChat"),onClick:()=>{ye()},children:s.jsx(_t,{size:16})})}),me.map(V=>{const ge=X(V.virtual_mcp_id);return s.jsx(W,{children:s.jsx(Q,{"aria-label":V.title||e("sidebar.taskGroupsList.newChat"),tooltip:V.title||e("sidebar.taskGroupsList.newChat"),isActive:V.id===y,onClick:()=>ue(V),children:s.jsx(be,{icon:ge?.icon??null,name:ge?.title??"Agent",size:"xs"})})},V.id)})]})]})}const ne=I!=="flat"||_!=="all"||k===!0,Ne=s.jsxs(Ue,{children:[s.jsxs(he,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ke,{asChild:!0,children:s.jsxs(je,{"aria-label":e("sidebar.taskGroupsList.filterChats"),active:ne,className:"md:size-[34px] rounded-lg",children:[s.jsx(jo,{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(pe,{side:"bottom",children:e("sidebar.taskGroupsList.filterChats")})]}),s.jsxs(He,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(tt,{label:e("sidebar.taskGroupsList.filterView"),value:I,onChange:P=>{Y("tasks_panel_group_by_changed",{to_value:P}),$(P)},options:[{value:"flat",label:e("sidebar.taskGroupsList.viewList"),icon:s.jsx(yn,{size:13})},{value:"status",label:e("sidebar.taskGroupsList.viewStatus"),icon:s.jsx(Sn,{size:13})}]}),s.jsx(tt,{label:e("sidebar.taskGroupsList.filterType"),value:_,onChange:P=>{Y("tasks_panel_filter_changed",{to_value:P}),w(P)},options:[{value:"all",label:e("sidebar.taskGroupsList.typeAll")},{value:"manual",label:e("sidebar.taskGroupsList.typeChats")},{value:"automation",label:e("sidebar.taskGroupsList.typeAuto")}]}),s.jsx(tt,{label:e("sidebar.taskGroupsList.filterScope"),value:k?"team":"mine",onChange:P=>O(P==="team"),options:[{value:"mine",label:e("sidebar.taskGroupsList.scopeMine")},{value:"team",label:e("sidebar.taskGroupsList.scopeTeam")}]})]})]}),ae=P=>s.jsx(ns,{delayDuration:300,children:s.jsxs("div",{className:U("shrink-0 flex items-center justify-between",P?"h-10":"h-10 md:h-[34px] mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!P&&s.jsx(bs,{className:"md:size-[34px] rounded-lg"}),Ne]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Ht,{label:e("sidebar.taskGroupsList.searchChats"),onClick:()=>{Y("tasks_panel_search_opened"),R(!0),M(!0)},children:s.jsx(_n,{size:16})}),s.jsx(Ht,{label:e("sidebar.taskGroupsList.newChat"),onClick:()=>{ye()},children:s.jsx(_t,{size:16})})]})]})});return _e?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ae(!0),s.jsx(Pt,{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(Bt,{threads:me,groupBy:I,activeTaskId:y,onSelectTask:ue,onArchiveTask:re,filters:D,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:ne})}),F&&s.jsx(Dt,{open:A,onOpenChange:M})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ae(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Pt,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Bt,{threads:me,groupBy:I,activeTaskId:y,onSelectTask:ue,onArchiveTask:re,filters:D,hasMore:c,isFetchingMore:m,onLoadMore:()=>{u()},filtersActive:ne})})}),F&&s.jsx(Dt,{open:A,onOpenChange:M})]})}const fi=5,pi=[{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 Os(){const t=z.c(3),{state:e}=de();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:fi}).map(gi)}),t[0]=o):o=t[0],o}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(le,{className:"size-6 rounded-md"}),s.jsx(le,{className:"size-6 rounded-md"}),s.jsx(le,{className:"size-6 rounded-md"})]}),s.jsx(le,{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:pi.map(hi)})]}),t[2]=l):l=t[2],l}function hi(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(le,{className:"size-5 rounded-full shrink-0"}),s.jsx(le,{className:U("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(xi)})]},e)}function xi(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(le,{className:"h-3 flex-1 rounded-sm"})},e)}function gi(t,e){return s.jsx(le,{className:"size-10 rounded-lg mx-auto"},e)}function bi(){const t=z.c(2);if(Ke()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(it,{showName:!0}),t[0]=l):l=t[0],l}let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(s.Fragment,{children:[s.jsx(it,{}),s.jsx(Ve,{})]}),t[1]=n):n=t[1],n}function ji(){const t=z.c(5),e=js();let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Hl,{}),l=s.jsx(bi,{}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(at,{children:s.jsx(G.Suspense,{fallback:s.jsx(Os,{}),children:s.jsx($s,{})})}),t[2]=o):o=t[2];let i;return t[3]!==e?(i=s.jsx(us,{children:s.jsx(Ss,{sections:e,footer:n,header:l,additionalContent:o})}),t[3]=e,t[4]=i):i=t[4],i}function vi(t){const e=z.c(8),{onClose:n}=t,l=js();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ul,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Os,{}),e[1]=i):i=e[1];let r;e[2]!==n?(r=s.jsx(at,{children:s.jsx(G.Suspense,{fallback:i,children:s.jsx($s,{onNavigate:n})})}),e[2]=n,e[3]=r):r=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==r?(a=s.jsx(us,{children:s.jsx(Nl,{sections:l,onClose:n,footer:o,additionalContent:r})}),e[4]=n,e[5]=l,e[6]=r,e[7]=a):a=e[7],a}const yi="sidebar.open";function Si(){const t=z.c(1),{state:e}=de(),n=Ke();if(e!=="collapsed"||n)return null;let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ve,{}),t[0]=l):l=t[0],l}function _i(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ys,{}),t[0]=e):e=t[0],e}function Ua(){const t=z.c(43),e=ut(),n=Ke();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{connect:o,siteUrl:i}=Be(l),r=o==="1",[a,d]=Ge(yi,!1),{width:c,wrapperRef:m,onStartResize:u,resetWidth:f}=Bo(),p=!e;let h,g;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsxs(Z.LeftColumn,{children:[s.jsx(Si,{}),s.jsx(Z.TogglesSlot,{})]}),g=s.jsx(Z.CenterSlot,{}),t[1]=h,t[2]=g):(h=t[1],g=t[2]);let x;t[3]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(Z.Header,{children:[h,g,s.jsxs(Z.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(Z.TabsSlot,{})}),s.jsx(Z.RightSlot,{})]})]}),t[3]=x):x=t[3];const b=x;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(bs,{}),t[4]=j):j=t[4];let S;t[5]!==n?(S=!n&&s.jsx("div",{className:"flex min-w-0 flex-1 items-center",children:s.jsx(Ve,{})}),t[5]=n,t[6]=S):S=t[6];let y,v,C,N,_;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx($e,{}),C=s.jsx(Z.TogglesSlot,{}),N=s.jsx(Z.TabsSlot,{className:"shrink-0"}),_=s.jsx(Z.CenterSlot,{}),y=s.jsx(Z.RightSlot,{}),t[7]=y,t[8]=v,t[9]=C,t[10]=N,t[11]=_):(y=t[7],v=t[8],C=t[9],N=t[10],_=t[11]);let w;t[12]!==S?(w=s.jsx(Z.Header,{className:"grid-cols-1 px-1",children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-1",children:[j,S,v,C,N,_,y]})}),t[12]=S,t[13]=w):w=t[13];const I=w;let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={background:"transparent",containerType:"inline-size"},t[14]=$):$=t[14];let k;t[15]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Js,{className:"flex flex-col min-h-0",style:$,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(G.Suspense,{fallback:s.jsx(_i,{}),children:s.jsx(Vs,{})})})})}),t[15]=k):k=t[15];const O=k,A=!p&&(e?I:b),M=`${c}px`;let F;t[16]!==M?(F={"--sidebar-width":M,"--sidebar-width-icon":"3.125rem"},t[16]=M,t[17]=F):F=t[17];const R=F;let D;t[18]!==e||t[19]!==u||t[20]!==f?(D=!e&&s.jsxs(s.Fragment,{children:[s.jsx(ji,{}),s.jsx(Ro,{onPointerDown:u,onDoubleClick:f})]}),t[18]=e,t[19]=u,t[20]=f,t[21]=D):D=t[21];let T;t[22]!==p?(T=p?s.jsxs("div",{className:"flex flex-col flex-1 min-w-0 min-h-0 h-full",children:[b,O]}):O,t[22]=p,t[23]=T):T=t[23];let E;t[24]!==R||t[25]!==D||t[26]!==T||t[27]!==m?(E=s.jsxs(Zs,{ref:m,className:"flex-1 bg-sidebar relative min-h-0",style:R,children:[D,T]}),t[24]=R,t[25]=D,t[26]=T,t[27]=m,t[28]=E):E=t[28];let H;t[29]!==e?(H=e&&s.jsx(ko,{renderSidebar:Ci}),t[29]=e,t[30]=H):H=t[30];let q;t[31]!==i||t[32]!==r?(q=r&&s.jsx(To,{siteUrl:i}),t[31]=i,t[32]=r,t[33]=q):q=t[33];let L;t[34]!==A||t[35]!==E||t[36]!==H||t[37]!==q?(L=s.jsx(Bn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[A,E,H,q]})}),t[34]=A,t[35]=E,t[36]=H,t[37]=q,t[38]=L):L=t[38];let se;return t[39]!==d||t[40]!==a||t[41]!==L?(se=s.jsx(Kn,{children:s.jsx(Z.Provider,{children:s.jsx(en,{open:a,onOpenChange:d,children:L})})}),t[39]=d,t[40]=a,t[41]=L,t[42]=se):se=t[42],se}function Ci(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(vi,{onClose:e})})})}export{Ua as default};
|