decocms 4.21.0 → 4.22.0
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-DrgnpYmf.js → AlertCircle-BAqebLND.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CEF-CsVj.js → ArrowUpRight-BejkutVa.js} +1 -1
- package/dist/client/assets/Check-CC3ah2EP.js +1 -0
- package/dist/client/assets/{CheckCircle-xbzaC4iQ.js → CheckCircle-C_Aedf-I.js} +1 -1
- package/dist/client/assets/{ChevronDown-DDeoixaJ.js → ChevronDown-ChsImHZJ.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cc93D1fP.js → ChevronRight-DKpM0qdo.js} +1 -1
- package/dist/client/assets/ChevronUp-CJ6cOnxb.js +1 -0
- package/dist/client/assets/Circle-Blw66dbf.js +1 -0
- package/dist/client/assets/Copy01-B9fTK-Gv.js +1 -0
- package/dist/client/assets/DotsVertical-CmhOyP1I.js +1 -0
- package/dist/client/assets/Eye-CFP70kHf.js +1 -0
- package/dist/client/assets/{FilterLines-C174NPGB.js → FilterLines-BCJIlwsH.js} +1 -1
- package/dist/client/assets/{Globe01-y8c9C4nH.js → Globe01-CdKa67VI.js} +1 -1
- package/dist/client/assets/{Globe04-v8yJBvO0.js → Globe04-BwB-L-v7.js} +1 -1
- package/dist/client/assets/{HardDrive-vkw_bVtH.js → HardDrive-Cvln_XgB.js} +1 -1
- package/dist/client/assets/{Key01-8wUzNiiB.js → Key01-Dq3fyqt5.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DFSfhhoN.js → LayoutLeft-D7T3E-u6.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CPcvHi4V.js → LinkExternal01-Cohlmmy1.js} +1 -1
- package/dist/client/assets/List-BX1Dxe3c.js +1 -0
- package/dist/client/assets/Loading02-DutOxXF8.js +1 -0
- package/dist/client/assets/{Monitor01-DQ9B5dBT.js → Monitor01-Do0cCBdt.js} +1 -1
- package/dist/client/assets/{Palette-BP0gnn-x.js → Palette-BmgCpHFj.js} +1 -1
- package/dist/client/assets/{Play-6woe_bCf.js → Play-BBHolMYa.js} +1 -1
- package/dist/client/assets/{Plus-sSvDtP2D.js → Plus-Cpa6DE3F.js} +1 -1
- package/dist/client/assets/{SearchLg-BHGwQ11F.js → SearchLg-D1sKIH4t.js} +1 -1
- package/dist/client/assets/{SearchMd-DcwBMfFO.js → SearchMd-CafLz5-k.js} +1 -1
- package/dist/client/assets/{Settings02-B0ZT4yzH.js → Settings02-Qe5DtIFk.js} +1 -1
- package/dist/client/assets/{Shield01-16ivhP9D.js → Shield01-CmqQX7z4.js} +1 -1
- package/dist/client/assets/{Star01-BwzFDtQr.js → Star01-Dx3yxBV5.js} +1 -1
- package/dist/client/assets/{Stars01-D_GgsBTV.js → Stars01-Cjj351UH.js} +1 -1
- package/dist/client/assets/{Stars02-CgeR-sX4.js → Stars02-DVjaFNiu.js} +1 -1
- package/dist/client/assets/{Sun-vVeG2mZ0.js → Sun-9KvJTXMD.js} +1 -1
- package/dist/client/assets/SwitchHorizontal01-C2AiHI6d.js +1 -0
- package/dist/client/assets/{Tool01-BUi-a5a2.js → Tool01-CMdJij71.js} +1 -1
- package/dist/client/assets/{Trash01-YsCUBRvj.js → Trash01-Bk68wFhO.js} +1 -1
- package/dist/client/assets/{Upload01-CTPdQzyc.js → Upload01-DfieuDNH.js} +1 -1
- package/dist/client/assets/{User01-C4JQrjGt.js → User01-BiwKrQu6.js} +1 -1
- package/dist/client/assets/{Users01-TIl6xBro.js → Users01-rcBZnIdC.js} +1 -1
- package/dist/client/assets/{Users03-Cw_16vbZ.js → Users03-C2FdBaet.js} +1 -1
- package/dist/client/assets/{X-CAjmVwOR.js → X-Dfoip5yB.js} +1 -1
- package/dist/client/assets/{XCircle-D3nhMqns.js → XCircle-C9R5bCeP.js} +1 -1
- package/dist/client/assets/{XClose-B93vthJT.js → XClose-CPqc0UtD.js} +1 -1
- package/dist/client/assets/{Zap-8CUqVoBU.js → Zap-CRPirG1P.js} +1 -1
- package/dist/client/assets/{ZapSquare-BDUSHcAn.js → ZapSquare-CGsw7HnP.js} +1 -1
- package/dist/client/assets/{ZoomOut-BN-KB_0J.js → ZoomOut-Cq_jwvnh.js} +1 -1
- package/dist/client/assets/{access-gate-B6S-WMth.js → access-gate-7q5PI6kF.js} +1 -1
- package/dist/client/assets/{add-section-modal-CQq5kJUo.js → add-section-modal-BVhFBSux.js} +1 -1
- package/dist/client/assets/agent-capabilities-BGx_yFvg.js +1 -0
- package/dist/client/assets/agent-icon-DAuEpvjN.js +1 -0
- package/dist/client/assets/agents-list-DEbqbve9.js +1 -0
- package/dist/client/assets/ai-providers-jW9pV5wT.js +1 -0
- package/dist/client/assets/{alert-BBmFOgXs.js → alert-Chi9L6Lo.js} +1 -1
- package/dist/client/assets/{alert-dialog-ClCDLHyi.js → alert-dialog-DNV8OhbX.js} +1 -1
- package/dist/client/assets/app-editor-B90O76NW.js +1 -0
- package/dist/client/assets/{auth-catchall-DCUDZpnm.js → auth-catchall-BeENOKgo.js} +1 -1
- package/dist/client/assets/{auth-entry-CDU8nxvN.js → auth-entry-Banhr0Dj.js} +1 -1
- package/dist/client/assets/{auth-CxjVr2Fw.js → auth-k2I4x92r.js} +1 -1
- package/dist/client/assets/{auth-split-layout-VRGxSLqT.js → auth-split-layout-BpIandE_.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CZ-MLzKy.js → authenticate-and-persist-oauth-DiKNvlD_.js} +1 -1
- package/dist/client/assets/{automation-list-row-B57SiMbH.js → automation-list-row-pGg9Lluh.js} +1 -1
- package/dist/client/assets/automation-runs-8IQ_r9WW.js +1 -0
- package/dist/client/assets/automations-DYcjcF3S.js +1 -0
- package/dist/client/assets/{avatar-BAkTMYHj.js → avatar-BD1bv4j8.js} +1 -1
- package/dist/client/assets/{badge-CxIGH9s7.js → badge-Dz2OFDxQ.js} +1 -1
- package/dist/client/assets/{block-document-sOmo01vI.js → block-document-MEJKfSm3.js} +1 -1
- package/dist/client/assets/{brand-context-rYfc__eE.js → brand-context-C-0cx-zk.js} +1 -1
- package/dist/client/assets/{breadcrumb-WlMbFTff.js → breadcrumb-DDrlJm3F.js} +1 -1
- package/dist/client/assets/buckets-K1kG3QiU.js +1 -0
- package/dist/client/assets/bulk-category-panel-Cpe8cv7-.js +1 -0
- package/dist/client/assets/{capability-load-error-Bj6xKhKF.js → capability-load-error-CV7OdywL.js} +1 -1
- package/dist/client/assets/{card-9jdGQNnr.js → card-DT6z8UIy.js} +1 -1
- package/dist/client/assets/category-editor-97EZw1QP.js +1 -0
- package/dist/client/assets/{chat-context-OmrHZlWm.js → chat-context-CcZXAHlF.js} +5 -5
- package/dist/client/assets/checkbox-CGiCIR_t.js +1 -0
- package/dist/client/assets/{cli-auth-success-CkMPwuV_.js → cli-auth-success-C0sOgmEb.js} +1 -1
- package/dist/client/assets/collection-detail-Clwh-BUk.js +1 -0
- package/dist/client/assets/collection-display-button-S0ZgQk6P.js +1 -0
- package/dist/client/assets/{collection-search-BHP0uS8b.js → collection-search-eFRNtpdt.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DeKnxXxy.js → collection-table-wrapper-DQSn1GJT.js} +1 -1
- package/dist/client/assets/{collection-tabs-CvLerKx4.js → collection-tabs-CYD2CpTe.js} +1 -1
- package/dist/client/assets/{command-D9kK6qBS.js → command-DWilEO1e.js} +1 -1
- package/dist/client/assets/commerce-onboarding-Dmxkngyz.js +1 -0
- package/dist/client/assets/connect-desktop-dialog-C8fqunJ_.js +1 -0
- package/dist/client/assets/connection-card-De6SHWCH.js +1 -0
- package/dist/client/assets/connection-detail-BUV19nAJ.js +1 -0
- package/dist/client/assets/{connection-form-helpers-oKSRt7Z9.js → connection-form-helpers-DsTip61C.js} +1 -1
- package/dist/client/assets/connections-DHz382Nc.js +1 -0
- package/dist/client/assets/constants-C8_Swa4x.js +1 -0
- package/dist/client/assets/{decopilot-xPgbGeJc.js → decopilot-DA6E6MgD.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BdE-V58A.js → decopilot-sse-pool-B-Li8vIf.js} +1 -1
- package/dist/client/assets/{dialog-D_ieAQTy.js → dialog-Bx9_D2-i.js} +1 -1
- package/dist/client/assets/{domain-settings-ByTW2skH.js → domain-settings-CmBMcneA.js} +1 -1
- package/dist/client/assets/{drawer-BP70Rujn.js → drawer-DUrVpGtt.js} +1 -1
- package/dist/client/assets/dropdown-menu-BXlOZYEj.js +1 -0
- package/dist/client/assets/{empty-state-BS7npFnj.js → empty-state-DrOUH3OQ.js} +1 -1
- package/dist/client/assets/extract-connection-data-AeQK1qls.js +1 -0
- package/dist/client/assets/file-explorer-cazCHuV9.js +2 -0
- package/dist/client/assets/{file-type-icon-DALXnNwz.js → file-type-icon-DHWkW0ug.js} +1 -1
- package/dist/client/assets/{files-hG4e0Y52.js → files-CHpi2r2q.js} +1 -1
- package/dist/client/assets/{form-DaxgojJl.js → form-C6xzxaKT.js} +1 -1
- package/dist/client/assets/format-time-Cy7tTmZp.js +1 -0
- package/dist/client/assets/general-CBqmiHQR.js +1 -0
- package/dist/client/assets/github-repo-picker-BFPwF92l.js +1 -0
- package/dist/client/assets/{hooks-ChlRS_Cr.js → hooks-DPy92pzv.js} +4 -4
- package/dist/client/assets/{index-DSNOu07Q.js → index-C8i8F2aZ.js} +12 -12
- package/dist/client/assets/index-CARq6YCN.js +1 -0
- package/dist/client/assets/{index-CrIRvXb3.js → index-CO9SnRbg.js} +4 -4
- package/dist/client/assets/{index-Bo5LvjuQ.js → index-CYLzTU3h.js} +6 -6
- package/dist/client/assets/{index-6Q-DcRF4.js → index-ChSXukaC.js} +1 -1
- package/dist/client/assets/index-CveMeMql.css +1 -0
- package/dist/client/assets/{index-CYTkc5bj.js → index-DD6weYxO.js} +1 -1
- package/dist/client/assets/{index-7osCyUPH.js → index-DU_SD-rb.js} +1 -1
- package/dist/client/assets/{index-CvxPzQfb.js → index-DWzm9A1x.js} +1 -1
- package/dist/client/assets/{index-xZ8IGJ2g.js → index-Dx-JuX8X.js} +2 -2
- package/dist/client/assets/{index-DpMErrhr.js → index-LGROg_hz.js} +1 -1
- package/dist/client/assets/index-Mlqi33Qh.js +1 -0
- package/dist/client/assets/{index-DgNLMhiy.js → index-S0Q7YlOD.js} +25 -25
- package/dist/client/assets/index-r-ZTThxt.js +1 -0
- package/dist/client/assets/{index-redirect-TiE2LCg3.js → index-redirect-BDcT3T7b.js} +1 -1
- package/dist/client/assets/{index-yloThw-p.js → index-zDHcoqw4.js} +1 -1
- package/dist/client/assets/{input-CjQtu1h5.js → input-Dmp_t77f.js} +1 -1
- package/dist/client/assets/{integration-icon-DvmR_kCi.js → integration-icon-D1vivc8T.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BHrSHQE6.js → invite-member-dialog-B52NxzkC.js} +2 -2
- package/dist/client/assets/{label-CyPUYQaT.js → label-D3ajqQqF.js} +1 -1
- package/dist/client/assets/{library-tab-CrasAutb.js → library-tab-D0-rbhqe.js} +3 -3
- package/dist/client/assets/{login-C4Xj3ZGq.js → login-B5g56FG8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cjq6PMkC.js → mcp-oauth-jAFObzAH.js} +1 -1
- package/dist/client/assets/members-C3EfSHkY.js +1 -0
- package/dist/client/assets/{monaco-editor-kdhsccRw.js → monaco-editor-DMzl3sdg.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DeKE4QGN.js → monitoring-stats-row-Cn7CUK3V.js} +1 -1
- package/dist/client/assets/{oauth-callback-CTt195fk.js → oauth-callback-Bs1-J2uC.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CXZF8sn_.js → oauth-callback-ai-provider-1jknSd8R.js} +1 -1
- package/dist/client/assets/{onboarding-BgKa_2mX.js → onboarding-DvEuy0D_.js} +1 -1
- package/dist/client/assets/{org-install-CFWrpbg8.js → org-install-CJ7F5mZU.js} +1 -1
- package/dist/client/assets/{org-layout-B7y5gvzJ.js → org-layout-CQsIu6xu.js} +1 -1
- package/dist/client/assets/{organization-choice-LKw28vSy.js → organization-choice-UHSo9CAk.js} +1 -1
- package/dist/client/assets/{page-seo-form-DmWg08s4.js → page-seo-form-BY-XtFIF.js} +1 -1
- package/dist/client/assets/page-seo-sheet-C-o48EMg.js +1 -0
- package/dist/client/assets/{popover-Dk6C_xyw.js → popover-DbclufIS.js} +1 -1
- package/dist/client/assets/post-editor-o5fS997b.js +1 -0
- package/dist/client/assets/{primitives-D3eMc46F.js → primitives-PoyK9-WR.js} +1 -1
- package/dist/client/assets/profile-DXLRzqRR.js +1 -0
- package/dist/client/assets/project-app-view-sebr-y53.js +1 -0
- package/dist/client/assets/record-editor-BGPyrMO7.js +1 -0
- package/dist/client/assets/registry-GJh_dUyE.js +2 -0
- package/dist/client/assets/{registry-layout-BljHeZAP.js → registry-layout-DaPQiP8-.js} +4 -4
- package/dist/client/assets/{require-capability-ByiCIEvf.js → require-capability-D_bY_XS6.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B1_k8uZH.js → required-auth-layout-CUJtlw7e.js} +1 -1
- package/dist/client/assets/{reset-password-14ERSLOr.js → reset-password-Boo6v3a2.js} +1 -1
- package/dist/client/assets/roles-CP5n6DBo.js +1 -0
- package/dist/client/assets/{scroll-area-DVEw9jTn.js → scroll-area-C9lD0DG9.js} +11 -11
- package/dist/client/assets/{search-input-Cw7dukB_.js → search-input-CDcgzOxB.js} +1 -1
- package/dist/client/assets/secrets-BXbhAnGl.js +1 -0
- package/dist/client/assets/{sections-editor-Bnz1L7UN.js → sections-editor-DHI42whV.js} +2 -2
- package/dist/client/assets/select-CsaBdTgI.js +1 -0
- package/dist/client/assets/{select-model-1JGm9WVZ.js → select-model-DflkFrTV.js} +1 -1
- package/dist/client/assets/seo-editor-CaMUQOw8.js +1 -0
- package/dist/client/assets/{settings-layout-f8IHCdTn.js → settings-layout-B_-ExZeb.js} +1 -1
- package/dist/client/assets/{settings-section-CTfa0pnb.js → settings-section-URYHyOYi.js} +1 -1
- package/dist/client/assets/{sheet-B3x8ZiS-.js → sheet-BGhHsN5F.js} +1 -1
- package/dist/client/assets/{shell-controls-C4LCUc-y.js → shell-controls-6cosW1pP.js} +1 -1
- package/dist/client/assets/shell-layout-DdBCXSg-.js +1 -0
- package/dist/client/assets/{sidebar-C8N0hRhw.js → sidebar-BAsFQ-MT.js} +1 -1
- package/dist/client/assets/{skeleton-C5L5O22N.js → skeleton-BUBk-3xi.js} +1 -1
- package/dist/client/assets/sso-D_2b6Fc8.js +1 -0
- package/dist/client/assets/store-ievF1htD.js +1 -0
- package/dist/client/assets/store-registry-B3gzmTlr.js +2 -0
- package/dist/client/assets/{studio-tools-kXfq3pN5.js → studio-tools-DgAshZ-_.js} +1 -1
- package/dist/client/assets/{switch-BL5aJnqG.js → switch-BonZrdli.js} +1 -1
- package/dist/client/assets/{table-77ubNeic.js → table-DEH4uiQe.js} +1 -1
- package/dist/client/assets/{tabs-Dh_kZG_m.js → tabs-CRj6AkcW.js} +1 -1
- package/dist/client/assets/task-row-ChWV-nAj.js +1 -0
- package/dist/client/assets/task-status-Dh1x9gPU.js +1 -0
- package/dist/client/assets/{textarea-D5nE7rMP.js → textarea-BNlJNx-b.js} +1 -1
- package/dist/client/assets/{toggle-group-oUYd1Jxm.js → toggle-group-QkV1Q0_i.js} +1 -1
- package/dist/client/assets/{toolbar-BSesNl59.js → toolbar-CCAeF5A-.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Da4GFxZS.js → toolbar-icon-button-D7VY-9VN.js} +1 -1
- package/dist/client/assets/{tools-list-JC_5uk0t.js → tools-list-M23BH1hq.js} +1 -1
- package/dist/client/assets/{tooltip-B3h8W9fM.js → tooltip-FlCInimM.js} +1 -1
- package/dist/client/assets/{types-H_rr3OSP.js → types-kWY4145T.js} +1 -1
- package/dist/client/assets/{use-ai-providers-lTSdzFgc.js → use-ai-providers-Bc5pT284.js} +1 -1
- package/dist/client/assets/use-automations-CF2YS293.js +1 -0
- package/dist/client/assets/{use-capability-Cgr7yHYD.js → use-capability-BY1ZsP4P.js} +1 -1
- package/dist/client/assets/use-clock-tick-DiVstnVw.js +1 -0
- package/dist/client/assets/{use-collections-Bb5vIdWQ.js → use-collections-BwIgjkkY.js} +1 -1
- package/dist/client/assets/use-connection-BuLrAfYP.js +1 -0
- package/dist/client/assets/{use-copy-ClKjk1Nz.js → use-copy-ue2G1-hn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BcrC97GS.js → use-create-virtual-mcp-CwTiuOpk.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CEbGGyRe.js → use-debounced-autosave-DPoL6EyR.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BCxrmAGw.js → use-debounced-value-BaMggBf4.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CkQ3Rugh.js → use-decopilot-events-CqBKeCC-.js} +1 -1
- package/dist/client/assets/{use-delete-connection-COjWhEca.js → use-delete-connection-Dz7PGuLT.js} +1 -1
- package/dist/client/assets/{use-file-configs-CxoqQtr4.js → use-file-configs-DG9Mhiyd.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DqqX0EF_.js → use-infinite-scroll-3Uj2RNwo.js} +1 -1
- package/dist/client/assets/{use-join-requests-BFV1IEGJ.js → use-join-requests-S43CfCdf.js} +1 -1
- package/dist/client/assets/use-mcp-client-CnRSGieI.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-F7AgPwEV.js → use-mcp-prompts-BHkYncis.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-UjXU5ids.js → use-mcp-tools-CDyeZmTp.js} +1 -1
- package/dist/client/assets/{use-members-B-1xXj0d.js → use-members-DSSi_h3c.js} +1 -1
- package/dist/client/assets/{use-mobile-CTYLPqKT.js → use-mobile-FUxUqTQv.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-ZLpx01PW.js → use-navigate-to-agent-DqOg0uVZ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-NLz6RBvg.js → use-org-auth-client-DOD7ccpR.js} +1 -1
- package/dist/client/assets/{use-org-sso-nbZu8iS1.js → use-org-sso-DU73DmAG.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BEuKNbP8.js → use-organization-roles-Dcz2MjMd.js} +1 -1
- package/dist/client/assets/use-organization-settings-C8EmnI93.js +1 -0
- package/dist/client/assets/use-registry-connections-Ctaa0JQV.js +1 -0
- package/dist/client/assets/{use-secrets-CIN5lIiD.js → use-secrets-B5E8bF7h.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bl8mPZM3.js → use-status-sounds-BH3nLka8.js} +1 -1
- package/dist/client/assets/{use-view-mode-DE98MrNw.js → use-view-mode-DHvPeuX3.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-iU8WqU_q.js +1 -0
- package/dist/client/assets/useInfiniteQuery-MSYpmccr.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Wt188HkA.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-g9RVw8Va.js → useSuspenseQueries-Cy-j8ofE.js} +1 -1
- package/dist/client/assets/variant-calendar-BWM8PQLC.js +1 -0
- package/dist/client/assets/{view-mode-toggle-B3xxjWBP.js → view-mode-toggle-td--5Ihh.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +502 -502
- package/dist/server/migrate.js +83 -83
- package/dist/server/server.js +314 -314
- package/package.json +1 -1
- package/dist/client/assets/ChevronUp-C2DYINXH.js +0 -1
- package/dist/client/assets/DotsVertical-CB1RTV9h.js +0 -1
- package/dist/client/assets/Eye-DHiUyPMS.js +0 -1
- package/dist/client/assets/SwitchHorizontal01-DTag6ZGf.js +0 -1
- package/dist/client/assets/agent-capabilities-BLdjNi42.js +0 -1
- package/dist/client/assets/agent-icon-HIFEO6vs.js +0 -1
- package/dist/client/assets/agents-list-YngYFo7C.js +0 -1
- package/dist/client/assets/ai-providers-BbExXFlh.js +0 -1
- package/dist/client/assets/app-editor-dXgIlUYv.js +0 -1
- package/dist/client/assets/automation-runs-LATF_NNh.js +0 -1
- package/dist/client/assets/automations-BBkP1No_.js +0 -1
- package/dist/client/assets/buckets-oHa98Efr.js +0 -1
- package/dist/client/assets/bulk-category-panel-C9FEvCBV.js +0 -1
- package/dist/client/assets/category-editor-Y8aXIh-A.js +0 -1
- package/dist/client/assets/checkbox-DnPlj3-W.js +0 -1
- package/dist/client/assets/collection-detail-C28Se3ZZ.js +0 -1
- package/dist/client/assets/collection-display-button-DOUzSfH_.js +0 -1
- package/dist/client/assets/commerce-onboarding-Dwo4yg2j.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-3SiI_mFd.js +0 -1
- package/dist/client/assets/connection-card-MLfvU4EZ.js +0 -1
- package/dist/client/assets/connection-detail-AC0jwDBB.js +0 -1
- package/dist/client/assets/connections-DNvp-Wd0.js +0 -1
- package/dist/client/assets/dropdown-menu-Ctb60TB7.js +0 -1
- package/dist/client/assets/extract-connection-data-RxV5HgFK.js +0 -1
- package/dist/client/assets/file-explorer-CqV9i4IM.js +0 -2
- package/dist/client/assets/general-mdgztBV6.js +0 -1
- package/dist/client/assets/github-repo-picker-CZI-ClVg.js +0 -1
- package/dist/client/assets/index-B1I1Oi0g.css +0 -1
- package/dist/client/assets/index-BMeJsDzW.js +0 -1
- package/dist/client/assets/index-DoOMda_E.js +0 -1
- package/dist/client/assets/members-C-oUAFwh.js +0 -1
- package/dist/client/assets/page-seo-sheet-Cg02Z-pf.js +0 -1
- package/dist/client/assets/post-editor-DoYb2wDl.js +0 -1
- package/dist/client/assets/profile-D3nqggYc.js +0 -1
- package/dist/client/assets/project-app-view-B9CUuk6-.js +0 -1
- package/dist/client/assets/record-editor-CjPHKje-.js +0 -1
- package/dist/client/assets/registry-8Yn6aIkw.js +0 -2
- package/dist/client/assets/roles-Dk6u6yco.js +0 -1
- package/dist/client/assets/secrets-CswlU-Ba.js +0 -1
- package/dist/client/assets/select-bneCBMXH.js +0 -1
- package/dist/client/assets/seo-editor-D0gZRnH2.js +0 -1
- package/dist/client/assets/shell-layout-CSNtx2tN.js +0 -1
- package/dist/client/assets/sso-CmKVccvq.js +0 -1
- package/dist/client/assets/store-DnZXwM23.js +0 -1
- package/dist/client/assets/store-registry-DzUKthzk.js +0 -2
- package/dist/client/assets/task-row-LdEr6awi.js +0 -1
- package/dist/client/assets/task-status-DNIO7fCq.js +0 -1
- package/dist/client/assets/use-automations-1J-hXDhd.js +0 -1
- package/dist/client/assets/use-clock-tick-D7gbCPid.js +0 -1
- package/dist/client/assets/use-connection-C0zEwTpO.js +0 -1
- package/dist/client/assets/use-mcp-client-C62ZsAPE.js +0 -10
- package/dist/client/assets/use-organization-settings-Dys1xzl0.js +0 -1
- package/dist/client/assets/use-registry-connections-By0sWOC0.js +0 -1
- package/dist/client/assets/use-virtual-mcp-D_g2q7bN.js +0 -1
- package/dist/client/assets/useInfiniteQuery-YzbBhr0w.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cgpvcam3.js +0 -1
- package/dist/client/assets/variant-calendar-CHjE3Ibi.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,j as s,C as We,r as D,l as F,v as ue,D as zs,F as Ts,a as be,G as te,b as ne,H as Ms,I as Os,t as se,J as Ds,M as Ps,m as Lt,u as Ke,P as vt,B as ze,y as Es,R as Rs,K as Fs,k as Ls,i as Bt,e as ct,E as Ht,o as Bs,s as Hs,n as Us,p as Gs,d as qs,x as Ws,T as Ut,O as Ks,U as Vs}from"./index-DgNLMhiy.js";import{u as ve,S as dt,a as mt,b as fe,c as J,d as K,e as ut,f as Gt,g as Xs,h as Qs,i as st,j as Ys,k as Js,l as Zs}from"./sidebar-C8N0hRhw.js";import{u as ft}from"./use-mobile-CTYLPqKT.js";import{S as oe}from"./skeleton-C5L5O22N.js";import{i as qt}from"./LayoutLeft-DFSfhhoN.js";import{T as ae}from"./toolbar-icon-button-Da4GFxZS.js";import{P as De,a as je,b as Pe}from"./popover-Dk6C_xyw.js";import{D as Wt,a as Kt,b as Vt}from"./drawer-BP70Rujn.js";import{A as Oe}from"./avatar-BAkTMYHj.js";import{a as he,b as xe,c as nt,T as pe}from"./tooltip-B3h8W9fM.js";import{a as yt}from"./Eye-DHiUyPMS.js";import{n as en,i as tn}from"./Globe01-y8c9C4nH.js";import{i as sn}from"./ZoomOut-BN-KB_0J.js";import{i as nn,a as ln}from"./ZapSquare-BDUSHcAn.js";import{i as Xt}from"./Monitor01-DQ9B5dBT.js";import{n as rn,a as on}from"./Sun-vVeG2mZ0.js";import{a as Ve,b as an}from"./Settings02-B0ZT4yzH.js";import{i as cn}from"./Shield01-16ivhP9D.js";import{a as dn}from"./Users03-Cw_16vbZ.js";import{a as St,b as Nt,c as Qt,d as mn,A as Te,e as _t,i as un,s as fn,f as hn}from"./agent-icon-HIFEO6vs.js";import"./index-6Q-DcRF4.js";import{n as Xe}from"./Stars02-CgeR-sX4.js";import{D as xn,a as pn,b as gn,c as wt,d as bn}from"./dropdown-menu-Ctb60TB7.js";import{i as Ee}from"./ChevronUp-C2DYINXH.js";import{s as $e}from"./Plus-sSvDtP2D.js";import{u as jn}from"./use-connection-C0zEwTpO.js";import{i as Yt,S as Jt,u as Zt,a as Ge}from"./use-mcp-client-C62ZsAPE.js";import{u as ht,a as xt}from"./use-virtual-mcp-D_g2q7bN.js";import{G as vn,g as lt,i as yn,a as rt}from"./github-repo-picker-CZI-ClVg.js";import{u as Sn,S as es,a as Nn,g as _n,b as wn,c as Cn}from"./use-navigate-to-agent-ZLpx01PW.js";import{I as kn}from"./invite-member-dialog-BHrSHQE6.js";import{u as ts,A as In,g as An}from"./agent-capabilities-BLdjNi42.js";import{u as $n,v as zn,C as Tn}from"./connect-desktop-dialog-3SiI_mFd.js";import{s as ss}from"./XClose-B93vthJT.js";import{u as Mn,a as On}from"./use-join-requests-BFV1IEGJ.js";import{i as ns}from"./ChevronRight-Cc93D1fP.js";import{u as Dn,R as Pn,a as En,b as pt,r as Rn}from"./shell-layout-CSNtx2tN.js";import{i as Fn}from"./FilterLines-C174NPGB.js";import{T as Ln,a as Bn}from"./toggle-group-oUYd1Jxm.js";import{u as Hn,a as gt,b as ls,T as Un}from"./hooks-ChlRS_Cr.js";import{c as Gn,a as qn,b as Wn,d as Kn,e as Vn}from"./dialog-D_ieAQTy.js";import{C as Xn,a as Qn,b as Yn,c as Jn,d as Zn}from"./command-D9kK6qBS.js";import{u as rs}from"./studio-tools-kXfq3pN5.js";import{i as el}from"./Zap-8CUqVoBU.js";import{S as is,M as tl}from"./shell-controls-C4LCUc-y.js";import{T as os}from"./task-row-LdEr6awi.js";import{t as bt}from"./ChevronDown-DDeoixaJ.js";import{S as sl}from"./task-status-DNIO7fCq.js";import{S as nl,C as ll}from"./chat-context-OmrHZlWm.js";import{B as Ct,a as rl,b as il}from"./breadcrumb-WlMbFTff.js";import{T as Z}from"./toolbar-BSesNl59.js";import{i as as}from"./SearchMd-DcwBMfFO.js";import{A as ol,a as al,b as cl,c as dl,d as ml,e as ul,f as fl}from"./alert-dialog-ClCDLHyi.js";import{F as hl,a as xl,b as pl,c as gl,d as bl,f as jl,e as vl}from"./form-DaxgojJl.js";import{I as yl}from"./input-CjQtu1h5.js";import"./sheet-B3x8ZiS-.js";import"./X-CAjmVwOR.js";import"./User01-C4JQrjGt.js";import"./AlertCircle-DrgnpYmf.js";import"./Tool01-BUi-a5a2.js";import"./SwitchHorizontal01-DTag6ZGf.js";import"./XCircle-D3nhMqns.js";import"./ArrowUpRight-CEF-CsVj.js";import"./CheckCircle-xbzaC4iQ.js";import"./DotsVertical-CB1RTV9h.js";import"./Star01-BwzFDtQr.js";import"./Globe04-v8yJBvO0.js";import"./HardDrive-vkw_bVtH.js";import"./Key01-8wUzNiiB.js";import"./LinkExternal01-CPcvHi4V.js";import"./Palette-BP0gnn-x.js";import"./Play-6woe_bCf.js";import"./SearchLg-BHGwQ11F.js";import"./Stars01-D_GgsBTV.js";import"./Trash01-YsCUBRvj.js";import"./Upload01-CTPdQzyc.js";import"./Users01-TIl6xBro.js";import"./use-collections-Bb5vIdWQ.js";import"./auth-CxjVr2Fw.js";import"./checkbox-DnPlj3-W.js";import"./collection-search-BHP0uS8b.js";import"./use-debounced-value-BCxrmAGw.js";import"./authenticate-and-persist-oauth-CZ-MLzKy.js";import"./mcp-oauth-Cjq6PMkC.js";import"./use-mcp-tools-UjXU5ids.js";import"./extract-connection-data-RxV5HgFK.js";import"./github-installations-DzN1UQ4x.js";import"./select-bneCBMXH.js";import"./textarea-D5nE7rMP.js";import"./use-org-auth-client-NLz6RBvg.js";import"./use-organization-roles-BEuKNbP8.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-MLfvU4EZ.js";import"./use-registry-connections-By0sWOC0.js";import"./use-organization-settings-Dys1xzl0.js";import"./useInfiniteQuery-YzbBhr0w.js";import"./use-infinite-scroll-DqqX0EF_.js";import"./card-9jdGQNnr.js";import"./integration-icon-DvmR_kCi.js";import"./collection-tabs-CvLerKx4.js";import"./badge-CxIGH9s7.js";import"./connection-form-helpers-oKSRt7Z9.js";import"./useSuspenseInfiniteQuery-Cgpvcam3.js";import"./use-ai-providers-lTSdzFgc.js";import"./use-capability-Cgr7yHYD.js";import"./required-auth-layout-B1_k8uZH.js";import"./tab-id-CLpu897Q.js";import"./use-org-sso-nbZu8iS1.js";import"./decopilot-sse-pool-BdE-V58A.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-yloThw-p.js";import"./use-clock-tick-D7gbCPid.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-CkQ3Rugh.js";import"./label-CyPUYQaT.js";function Sl(t){const e=C.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:r,isMobile:i}=ve();if(i||r==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=o,e[1]=a):(o=e[0],a=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const jt=240,Nl=400,_l="sidebar.width";function Me(t){return Math.max(jt,Math.min(Nl,t))}function wl(){const t=C.c(11),[e,n]=We(_l,Cl),l=D.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Me(e),x=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const h=b=>{const j=Me(f+(b.clientX-u));x?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Me(f+(b.clientX-u));n(j);for(const v of p)v.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const i=r;let o;t[3]!==n?(o=()=>{n(jt)},t[3]=n,t[4]=o):o=t[4];const a=o;let d;t[5]!==e?(d=Me(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 Cl(t){return typeof t=="number"?Me(t):jt}function cs(){return[]}function ds(t){const e=C.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 r;return e[1]!==n?(r=s.jsxs(dt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(mt,{children:s.jsx(fe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function ms(t){const e=C.c(18),{item:n}=t,{isMobile:l,setOpenMobile:r}=ve();let i;e[0]!==l||e[1]!==n||e[2]!==r?(i=()=>{ue("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&r(!1)},e[0]=l,e[1]=n,e[2]=r,e[3]=i):i=e[3];const o=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=F(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]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function kl(t){const e=C.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ut,{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,r=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Al),e[2]=n.group.items,e[3]=i):i=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(o=s.jsx(ds,{label:l,defaultExpanded:r,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map(Il),e[8]=n.items,e[9]=l):l=e[9];let r;return e[10]!==l?(r=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(fe,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=r):r=e[11],r}case"custom":return n.content}}function Il(t){return s.jsx(ms,{item:t},t.key)}function Al(t){return s.jsx(ms,{item:t},t.key)}function $l(t){const e=C.c(14),{sections:n,footer:l,additionalContent:r,variant:i,contentClassName:o}=t,a=i===void 0?"sidebar":i;let d;e[0]!==o?(d=F("flex flex-col flex-1 px-2 py-2 gap-0.5",o),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(zl),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&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:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Gt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==a?(f=s.jsxs(Xs,{variant:a,children:[u,l]}),e[10]=l,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function zl(t,e){return s.jsx(kl,{section:t},e)}function us(t){const e=C.c(2);let n;return e[0]!==t?(n=s.jsx($l,{...t}),e[0]=t,e[1]=n):n=e[1],n}us.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(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Tl(t){const e=C.c(16),{onToggle:n,className:l}=t,i=zs().logo??Ts,o=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let d;e[0]!==l?(d=F("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==o?(c=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=o,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qt,{size:16}),e[9]=f):f=e[9];let x;e[10]!==n?(x=s.jsx(ae,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=x):x=e[11];let p;return e[12]!==d||e[13]!==u||e[14]!==x?(p=s.jsxs(Qs,{className:d,children:[u,x]}),e[12]=d,e[13]=u,e[14]=x,e[15]=p):p=e[15],p}function kt(t){const e=C.c(18),{item:n,onClose:l}=t,r=n.isActive&&"z-10";let i;e[0]!==r?(i=F(r),e[0]=r,e[1]=i):i=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=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]!==o||e[12]!==a||e[13]!==d?(c=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(K,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function Ml(t){const e=C.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,i=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(kt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],o=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(ds,{label:r,defaultExpanded:i,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(kt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],r=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(fe,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}case"custom":return n.content}}function Ol(t){const e=C.c(17),{sections:n,onClose:l,footer:r,additionalContent:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(D.Suspense,{fallback:o,children:s.jsx(Tl,{onToggle:l})}),e[1]=l,e[2]=a):a=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(x,p)=>s.jsx(Ml,{section:x,onClose:l},p),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Gt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=C.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==l?(r=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=r):r=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let o;e[16]!==n.label?(o=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=o):o=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==o?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,o]}),e[18]=r,e[19]=i,e[20]=o,e[21]=a):a=e[21],a}function It(t){const e=C.c(126),{user:n,userImage:l,menuItems:r,signOutItem:i,themeOptions:o,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const T=n?.name??"U";let P;e[0]!==T||e[1]!==l?(P=s.jsx(Oe,{url:l,fallback:T,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=T,e[1]=l,e[2]=P):P=e[2];const Y=n?.name??"User";let q;e[3]!==Y?(q=s.jsx("p",{className:"text-sm font-medium truncate",children:Y}),e[3]=Y,e[4]=q):q=e[4];const le=n?.email;let W;e[5]!==le?(W=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:le}),e[5]=le,e[6]=W):W=e[6];let re;e[7]!==q||e[8]!==W?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[q,W]}),e[7]=q,e[8]=W,e[9]=re):re=e[9];let ie;e[10]!==n?(ie=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Rl)},e[10]=n,e[11]=ie):ie=e[11];let ce;e[12]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(yt,{size:14}),e[12]=ce):ce=e[12];let ge;e[13]!==ie?(ge=s.jsx(he,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ie,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ce})}),e[13]=ie,e[14]=ge):ge=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let I;e[16]!==ge?(I=s.jsx(nt,{delayDuration:300,children:s.jsxs(pe,{children:[ge,ye]})}),e[16]=ge,e[17]=I):I=e[17];let L;e[18]!==I||e[19]!==P||e[20]!==re?(L=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[P,re,I]}),e[18]=I,e[19]=P,e[20]=re,e[21]=L):L=e[21];let V;if(e[22]!==c||e[23]!==r){let me;e[25]!==c?(me=Le=>s.jsx(Be,{item:Le,onClose:c},Le.key),e[25]=c,e[26]=me):me=e[26],V=r.map(me),e[22]=c,e[23]=r,e[24]=V}else V=e[24];let H;e[27]!==c||e[28]!==i?(H=s.jsx(Be,{item:i,onClose:c}),e[27]=c,e[28]=i,e[29]=H):H=e[29];let de;e[30]!==V||e[31]!==H?(de=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,H]})}),e[30]=V,e[31]=H,e[32]=de):de=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==o){let me;e[37]!==a.theme||e[38]!==d?(me=Le=>{const{value:Ze,icon:Is,label:As}=Le;return s.jsx("button",{type:"button","aria-label":As,onClick:()=>d($s=>({...$s,theme:Ze})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Is},Ze)},e[37]=a.theme,e[38]=d,e[39]=me):me=e[39],Se=o.map(me),e[33]=a.theme,e[34]=d,e[35]=o,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const Ye=a.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(El),e[42]=d,e[43]=_e):_e=e[43];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Je?(we=F("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[44]=Je,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Ye||e[49]!==_e||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Ye,onClick:_e,className:we,children:Ce}),e[48]=Ye,e[49]=_e,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Re;e[53]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.21.0"]}),e[53]=Re):Re=e[53];let Ie;e[54]!==ke?(Ie=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Re]}),e[54]=ke,e[55]=Ie):Ie=e[55];let Ae;e[56]!==Ne||e[57]!==Ie?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ie]}),e[56]=Ne,e[57]=Ie,e[58]=Ae):Ae=e[58];let Fe;return e[59]!==L||e[60]!==de||e[61]!==Ae?(Fe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,de,Ae]}),e[59]=L,e[60]=de,e[61]=Ae,e[62]=Fe):Fe=e[62],Fe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Oe,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const x=n?.name??"User";let p;e[66]!==x?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:x}),e[66]=x,e[67]=p):p=e[67];const h=n?.email;let g;e[68]!==h?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[68]=h,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Pl)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(yt,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(he,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let k;e[79]!==y?(k=s.jsx(nt,{delayDuration:300,children:s.jsxs(pe,{children:[y,w]})}),e[79]=y,e[80]=k):k=e[80];let S;e[81]!==k||e[82]!==f||e[83]!==b?(S=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,k]}),e[81]=k,e[82]=f,e[83]=b,e[84]=S):S=e[84];let N;if(e[85]!==c||e[86]!==r){let T;e[88]!==c?(T=P=>s.jsx(Be,{item:P,onClose:c},P.key),e[88]=c,e[89]=T):T=e[89],N=r.map(T),e[85]=c,e[86]=r,e[87]=N}else N=e[87];let _;e[90]!==c||e[91]!==i?(_=s.jsx(Be,{item:i,onClose:c}),e[90]=c,e[91]=i,e[92]=_):_=e[92];let A;e[93]!==N||e[94]!==_?(A=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[N,_]}),e[93]=N,e[94]=_,e[95]=A):A=e[95];let O;if(e[96]!==a.theme||e[97]!==d||e[98]!==o){let T;e[100]!==a.theme||e[101]!==d?(T=P=>{const{value:Y,icon:q,label:le}=P;return s.jsx("button",{type:"button","aria-label":le,onClick:()=>d(W=>({...W,theme:Y})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Y?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:q},Y)},e[100]=a.theme,e[101]=d,e[102]=T):T=e[102],O=o.map(T),e[96]=a.theme,e[97]=d,e[98]=o,e[99]=O}else O=e[99];let $;e[103]!==O?($=s.jsx("div",{className:"flex items-center gap-0.5",children:O}),e[103]=O,e[104]=$):$=e[104];const z=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[105]!==d?(R=()=>d(Dl),e[105]=d,e[106]=R):R=e[106];const U=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let E;e[107]!==U?(E=F("size-7 rounded-md flex items-center justify-center transition-colors",U),e[107]=U,e[108]=E):E=e[108];let B;e[109]!==a.enableSounds?(B=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[109]=a.enableSounds,e[110]=B):B=e[110];let M;e[111]!==z||e[112]!==R||e[113]!==E||e[114]!==B?(M=s.jsx("button",{type:"button","aria-label":z,onClick:R,className:E,children:B}),e[111]=z,e[112]=R,e[113]=E,e[114]=B,e[115]=M):M=e[115];let G;e[116]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.21.0"]}),e[116]=G):G=e[116];let X;e[117]!==M?(X=s.jsxs("div",{className:"flex items-center gap-2",children:[M,G]}),e[117]=M,e[118]=X):X=e[118];let Q;e[119]!==$||e[120]!==X?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[$,X]}),e[119]=$,e[120]=X,e[121]=Q):Q=e[121];let ee;return e[122]!==S||e[123]!==A||e[124]!==Q?(ee=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[S,A,Q]})}),e[122]=S,e[123]=A,e[124]=Q,e[125]=ee):ee=e[125],ee}function Dl(t){return{...t,enableSounds:!t.enableSounds}}function Pl(){se.success("User ID copied")}function El(t){return{...t,enableSounds:!t.enableSounds}}function Rl(){se.success("User ID copied")}function it(){const t=C.c(34),{data:e}=be.useSession(),{org:n}=te(),l=ne();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const o=Ms(r)?.params.org,[a,d]=Os(),c=ft(),[m,u]=D.useState(!1),f=e?.user,x=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const h=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ve,{size:16}),t[2]=g):g=t[2];let b;t[3]!==l||t[4]!==o?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==l?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(en,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(sn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(cn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ds,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k={key:"community",label:"Community",icon:s.jsx(dn,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=k):k=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S={key:"homepage",label:"Homepage",icon:s.jsx(tn,{size:16}),href:"https://decocms.com",external:!0},t[13]=S):S=t[13];let N;t[14]!==b||t[15]!==j?(N=[b,...j,v,y,w,k,S],t[14]=b,t[15]=j,t[16]=N):N=t[16];const _=N;let A;t[17]===Symbol.for("react.memo_cache_sentinel")?(A={key:"logout",label:"Sign out",icon:s.jsx(nn,{size:16}),onClick:Ll},t[17]=A):A=t[17];const O=A;let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($={value:"light",icon:s.jsx(rn,{size:14}),label:"Light theme"},t[18]=$):$=t[18];let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={value:"dark",icon:s.jsx(on,{size:14}),label:"Dark theme"},t[19]=z):z=t[19];let R;t[20]===Symbol.for("react.memo_cache_sentinel")?(R=[$,z,{value:"system",icon:s.jsx(Xt,{size:14}),label:"System theme"}],t[20]=R):R=t[20];const U=R;let E;t[21]!==c||t[22]!==_||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==x?(E={user:f,userImage:x,menuItems:_,signOutItem:O,themeOptions:U,preferences:a,setPreferences:d,close:h,isMobile:c},t[21]=c,t[22]=_,t[23]=a,t[24]=d,t[25]=f,t[26]=x,t[27]=E):E=t[27];const B=E;let M;return t[28]!==c||t[29]!==m||t[30]!==B||t[31]!==f?.name||t[32]!==x?(M=s.jsx(s.Fragment,{children:c?s.jsxs(Wt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Kt,{className:"h-[80dvh] p-0",children:[s.jsx(Vt,{className:"sr-only",children:"Account"}),s.jsx(It,{...B})]})]}):s.jsxs(De,{open:m,onOpenChange:u,children:[s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Pe,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Fl,children:s.jsx(It,{...B})})]})}),t[28]=c,t[29]=m,t[30]=B,t[31]=f?.name,t[32]=x,t[33]=M):M=t[33],M}function Fl(t){return t.preventDefault()}function Ll(){ue("signed_out",{source:"account_popover"}),Ps(),be.signOut()}const At=["requires_action","in_progress","failed","expired","completed"];function Bl(t){const e=new Map(At.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return At.map(n=>({status:n,threads:e.get(n)}))}function fs(t){const e=C.c(4),{onClick:n}=t;let l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(rt,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=l,e[1]=r):(l=e[0],r=e[1]);let i;return e[2]!==n?(i=s.jsxs(J,{tooltip:"Add repo",onClick:n,children:[l,r]}),e[2]=n,e[3]=i):i=e[3],i}function Hl(t){const e=C.c(41),{onAddNew:n}=t,{org:l}=te(),r=Lt(),i=ne(),o=Sn();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ke(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!Yt(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const p=jn(f).filter(Gl),h=ht(),b=xt(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==l.id||e[5]!==l.slug?(j={connectionId:Jt,orgId:l.id,orgSlug:l.slug},e[4]=l.id,e[5]=l.slug,e[6]=j):j=e[6];const v=Zt(j);if(p.length===0){let T;return e[7]!==n?(T=s.jsx(fs,{onClick:n}),e[7]=n,e[8]=T):T=e[8],T}let y;e[9]!==c||e[10]!==i||e[11]!==l.id||e[12]!==r||e[13]!==v?(y=async(T,P)=>{await v.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:T}}}}),vt(r,l.id),se.success(`Previewing ${P}`),i({to:".",search:Ul,replace:!0})},e[9]=c,e[10]=i,e[11]=l.id,e[12]=r,e[13]=v,e[14]=y):y=e[14];const w=y;let k;e[15]!==h||e[16]!==o||e[17]!==l.id||e[18]!==r||e[19]!==v?(k=async(T,P,Y)=>{const q=h.find(re=>{const ie=re.metadata?.githubRepo;return ie?.owner?.toLowerCase()===T.owner.toLowerCase()&&ie?.name?.toLowerCase()===T.name.toLowerCase()});if(q){o(q.id,{search:{main:"preview"}});return}const W=(await v.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:T.name,description:`Imported from ${Y}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:P}],metadata:{githubRepo:T,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,l.id),!W)throw new Error("Failed to create the repo agent");se.success(`Created ${Y}`),o(W,{search:{main:"preview"}})},e[15]=h,e[16]=o,e[17]=l.id,e[18]=r,e[19]=v,e[20]=k):k=e[20];const S=k;let N;e[21]!==w||e[22]!==u||e[23]!==S?(N=async T=>{const P=lt(T);if(!P)return;const Y=`${P.owner}/${P.repo}`,q={owner:P.owner,name:P.repo,url:`https://github.com/${P.owner}/${P.repo}`,installationId:P.installationId,connectionId:T.id};try{u?await w(q,Y):await S(q,T.id,Y)}catch(le){const W=le;se.error("Failed to set preview repo: "+(W instanceof Error?W.message:"Unknown error"))}},e[21]=w,e[22]=u,e[23]=S,e[24]=N):N=e[24];const _=N,A=pn;let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(gn,{asChild:!0,children:s.jsxs(J,{children:[s.jsx(rt,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=O):O=e[25];const $=xn,z="start",R="right",U="w-56";let E;e[26]!==b||e[27]!==_?(E=T=>{const P=lt(T);return P?s.jsxs(wt,{onSelect:()=>_(T),children:[s.jsx(rt,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[P.owner,"/",P.repo]}),T.id===b&&s.jsx(Ee,{className:"size-4"})]},T.id):null},e[26]=b,e[27]=_,e[28]=E):E=e[28];const B=p.map(E);let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(bn,{}),e[29]=M):M=e[29];let G;e[30]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx($e,{className:"size-4"}),e[30]=G):G=e[30];let X;e[31]!==n?(X=s.jsxs(wt,{onSelect:n,children:[G,"Add new repo…"]}),e[31]=n,e[32]=X):X=e[32];let Q;e[33]!==$||e[34]!==B||e[35]!==X?(Q=s.jsxs($,{align:z,side:R,className:U,children:[B,M,X]}),e[33]=$,e[34]=B,e[35]=X,e[36]=Q):Q=e[36];let ee;return e[37]!==A||e[38]!==Q||e[39]!==O?(ee=s.jsxs(A,{children:[O,Q]}),e[37]=A,e[38]=Q,e[39]=O,e[40]=ee):ee=e[40],ee}function Ul(t){return{...t,main:"preview"}}function Gl(t){return lt(t)!==null&&yn(t)}function ql(){const t=C.c(4),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(fs,{onClick:()=>n(!0)}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(D.Suspense,{fallback:l,children:s.jsx(Hl,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let i;return t[2]!==e?(i=s.jsxs(s.Fragment,{children:[r,s.jsx(vn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=i):i=t[3],i}function ot(){const t=C.c(22),e=$n(),[n,l]=D.useState(!1);let r;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const h=zn(e.capabilities);r=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:h.length>0?`Available: ${h.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=r}else r=t[4];const i=r;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(!0),t[5]=o):o=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16}),t[6]=d):d=t[6];let c;t[7]!==e.online?(c=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=c):c=t[8];let m;t[9]!==a||t[10]!==c?(m=s.jsx(he,{asChild:!0,children:s.jsxs(ae,{onClick:o,"aria-label":a,children:[d,c]})}),t[9]=a,t[10]=c,t[11]=m):m=t[11];let u;t[12]!==i?(u=s.jsx(xe,{side:"bottom",children:i}),t[12]=i,t[13]=u):u=t[13];let f;t[14]!==m||t[15]!==u?(f=s.jsxs(pe,{children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16];let x;t[17]!==n?(x=s.jsx(Tn,{open:n,onOpenChange:l}),t[17]=n,t[18]=x):x=t[18];let p;return t[19]!==f||t[20]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),t[19]=f,t[20]=x,t[21]=p):p=t[21],p}function Wl({invitation:t}){const[e,n]=D.useState(!1),[l,r]=D.useState(!1),i=Lt(),o=async()=>{n(!0);try{const c=await be.organization.acceptInvitation({invitationId:t.id});if(c.error){se.error(c.error.message),n(!1);return}}catch{se.error("Failed to accept invitation"),n(!1);return}se.success("Invitation accepted!"),Es();let d;try{d=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},a=async()=>{r(!0);try{const d=await be.organization.rejectInvitation({invitationId:t.id});d.error?(se.error(d.error.message),r(!1)):(se.success("Invitation declined"),i.invalidateQueries())}catch{se.error("Failed to decline invitation"),r(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:o,disabled:e||l,"aria-label":"Accept invitation",children:s.jsx(Ee,{size:14})}),s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||l,"aria-label":"Decline invitation",children:s.jsx(ss,{size:14})})]})]})}function Kl(t){const e=C.c(29),{request:n}=t,{approve:l,deny:r}=Mn(),i=l.isPending||r.isPending,o=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let d;e[0]!==o?(d=o.charAt(0).toUpperCase(),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==a||e[3]!==d?(c=s.jsx(Oe,{url:a,fallback:d,shape:"circle",size:"sm"}),e[2]=a,e[3]=d,e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==o?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:o})]}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==n.id?(f=()=>l.mutate(n.id),e[8]=l,e[9]=n.id,e[10]=f):f=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ee,{size:14}),e[11]=x):x=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:x}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let h;e[15]!==r||e[16]!==n.id?(h=()=>r.mutate(n.id),e[15]=r,e[16]=n.id,e[17]=h):h=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ss,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==h?(b=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:h,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=h,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let v;return e[25]!==j||e[26]!==c||e[27]!==u?(v=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[c,u,j]}),e[25]=j,e[26]=c,e[27]=u,e[28]=v):v=e[28],v}function Vl(t){const e=C.c(14),{release:n,isSeen:l,onSelect:r}=t;let i;e[0]!==l?(i=!l&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=l,e[1]=i):i=e[1];let o;e[2]!==n.eyebrow?(o=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=o):o=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==a?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[o,a]}),e[6]=o,e[7]=a,e[8]=d):d=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==i||e[12]!==d?(m=s.jsxs("button",{type:"button",onClick:r,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,d,c]}),e[10]=r,e[11]=i,e[12]=d,e[13]=m):m=e[13],m}function Xl(){const t=D.useContext(Rs),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(l=>l.status==="pending"&&new Date(l.expiresAt)>new Date)}function hs(){const t=C.c(11),{isSeen:e,markSeen:n,unseenCount:l}=Dn(),r=Xl(),i=On();let o;if(t[0]!==e||t[1]!==r||t[2]!==i){const c=[...i].sort(er).map(Zl),m=[...r].sort(Jl).map(Yl);let u;t[4]!==e?(u=x=>({type:"release",release:x,isSeen:e(x.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...Pn].sort(Ql).map(u);o=[...c,...m,...f],t[0]=e,t[1]=r,t[2]=i,t[3]=o}else o=t[3];const a=l+r.length+i.length;let d;return t[6]!==n||t[7]!==r||t[8]!==o||t[9]!==a?(d={items:o,pendingInvitations:r,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=r,t[8]=o,t[9]=a,t[10]=d):d=t[10],d}function Ql(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Yl(t){return{type:"invitation",invitation:t}}function Jl(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function Zl(t){return{type:"join-request",request:t}}function er(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class xs extends D.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 ps(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function tr(){const t=C.c(17),e=ne(),{org:n}=te(),{hasDecoKey:l,balanceDollars:r}=ts();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];let o;t[2]!==r?(o=F(r!=null&&ps(r)),t[2]=r,t[3]=o):o=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(Qt,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,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]!==o||t[14]!==a||t[15]!==m?(u=s.jsx(fe,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:i,className:o,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=o,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function sr(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xs,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(tr,{})})}),t[0]=e):e=t[0],e}function nr(){const t=C.c(17),e=ne(),{org:n}=te(),{hasDecoKey:l,balanceDollars:r}=ts();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];const o=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let d;t[5]!==r?(d=F(r!=null&&ps(r)),t[5]=r,t[6]=d):d=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qt,{className:"size-4"}),t[7]=c):c=t[7];let m;t[8]!==a||t[9]!==d||t[10]!==o?(m=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":o,onClick:a,className:d,children:c})}),t[8]=a,t[9]=d,t[10]=o,t[11]=m):m=t[11];let u;t[12]!==o?(u=s.jsx(xe,{side:"top",children:o}),t[12]=o,t[13]=u):u=t[13];let f;return t[14]!==m||t[15]!==u?(f=s.jsxs(pe,{delayDuration:300,children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16],f}function lr(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xs,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(nr,{})})}),t[0]=e):e=t[0],e}function gs(t){const e=C.c(15),{children:n}=t,{items:l,markReleaseSeen:r}=hs(),[i,o]=D.useState(null);let a;if(e[0]!==l||e[1]!==i){let h;e[3]!==i?(h=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=h):h=e[4],a=l.find(h),e[0]=l,e[1]=i,e[2]=a}else a=e[2];const d=a,c=d?.type==="release"?d.release:null;let m;e[5]!==r?(m=h=>{o(h),r(h)},e[5]=r,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=h=>{h||o(null)},e[7]=f):f=e[7];let x;e[8]!==u||e[9]!==l||e[10]!==c?(x=s.jsx(Pe,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>o(null),children:s.jsx(an,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:c.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(En,{release:c})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),l.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Xe,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:l.map(h=>h.type==="join-request"?s.jsx(Kl,{request:h.request},`req-${h.request.id}`):h.type==="invitation"?s.jsx(Wl,{invitation:h.invitation},`inv-${h.invitation.id}`):s.jsx(Vl,{release:h.release,isSeen:h.isSeen,onSelect:()=>u(h.release.id)},`rel-${h.release.id}`))})]})}),e[8]=u,e[9]=l,e[10]=c,e[11]=x):x=e[11];let p;return e[12]!==n||e[13]!==x?(p=s.jsxs(De,{onOpenChange:f,children:[n,x]}),e[12]=n,e[13]=x,e[14]=p):p=e[14],p}function bs(){const{redDotCount:t}=hs();return t>0}function rr(){const t=C.c(6),e=bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xe,{}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{children:"Inbox"}),t[3]=r):r=t[3];let i;return t[4]!==l?(i=s.jsx(gs,{children:s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:"Inbox",className:"relative",children:[n,l,r]})})}),t[4]=l,t[5]=i):i=t[5],i}function ir(){const t=C.c(8),e=bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xe,{className:"size-4"}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]!==l?(r=s.jsx(je,{asChild:!0,children:s.jsx(he,{asChild:!0,children:s.jsxs(ae,{"aria-label":"Inbox",children:[n,l]})})}),t[3]=l,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let o;return t[6]!==r?(o=s.jsx(gs,{children:s.jsxs(pe,{delayDuration:300,children:[r,i]})}),t[6]=r,t[7]=o):o=t[7],o}function or(){const t=C.c(7),e=ne(),{org:n}=te();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let r,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ve,{}),i=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=i):(r=t[3],i=t[4]);let o;return t[5]!==l?(o=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[r,i]}),t[5]=l,t[6]=o):o=t[6],o}function ar(){const t=C.c(9),e=ne(),{org:n}=te();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ve,{className:"size-4"}),t[3]=r):r=t[3];let i;t[4]!==l?(i=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":"Settings",onClick:l,children:r})}),t[4]=l,t[5]=i):i=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(xe,{side:"top",children:"Settings"}),t[6]=o):o=t[6];let a;return t[7]!==i?(a=s.jsxs(pe,{delayDuration:300,children:[i,o]}),t[7]=i,t[8]=a):a=t[8],a}function cr(){const t=C.c(5),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(kn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(mn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(ql,{})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(fe,{className:"gap-0.5",children:[l,r,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(ln,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=i):i=t[2];let o;return t[3]!==e?(o=s.jsxs(s.Fragment,{children:[i,s.jsx(In,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=o):o=t[4],o}function dr(){const t=C.c(8),{state:e}=ve();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(sr,{}),t[0]=o):o=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(ot,{})})}),t[1]=a):a=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(K,{children:s.jsx(rr,{})}),t[2]=d):d=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(K,{children:s.jsx(or,{})}),t[3]=c):c=t[3];let m;return t[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(st,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(fe,{children:[a,d,c,s.jsx(K,{children:s.jsx(it,{})})]})]}),t[4]=m):m=t[4],m}let l,r;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(cr,{}),r=s.jsx(ut,{className:"mx-0"}),t[5]=l,t[6]=r):(l=t[5],r=t[6]);let i;return t[7]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(st,{className:"px-2 pb-3 gap-1.5",children:[l,r,s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fe,{children:s.jsx(K,{children:s.jsx(it,{})})})}),s.jsx(ar,{}),s.jsx(ir,{}),s.jsx(ot,{}),s.jsx(lr,{})]})]}),t[7]=i):i=t[7],i}function mr(){const t=C.c(8),e=ne(),{org:n}=te(),{setOpenMobile:l}=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fe,{children:s.jsx(K,{children:s.jsx(it,{})})})}),t[0]=r):r=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==l?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=i):i=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==i?(a=s.jsx(st,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(ae,{"aria-label":"Settings",onClick:i,children:o})]})}),t[6]=i,t[7]=a):a=t[7],a}function $t(t){const e=C.c(15),{className:n,wrapperClassName:l,children:r}=t,[i,o]=D.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(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;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=F("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const x=i?"opacity-100":"opacity-0";let p;e[7]!==x?(p=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",x),e[7]=x,e[8]=p):p=e[8];let h;e[9]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=h):h=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==h?(g=s.jsxs("div",{className:u,children:[f,h]}),e[11]=u,e[12]=f,e[13]=h,e[14]=g):g=e[14],g}function ur(t){const e=C.c(8),{virtualMcpId:n,size:l,showAutomationBadge:r}=t,i=l===void 0?"sm":l;let o;e[0]!==i||e[1]!==n?(o=n?s.jsx(fr,{virtualMcpId:n,size:i}):s.jsx(Te,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(el,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==o||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=d):d=e[7],d}function fr(t){const e=C.c(6),{virtualMcpId:n,size:l}=t,r=xt(n);if(!r){let a;return e[0]!==l?(a=s.jsx(Te,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const i=r.icon??null;let o;return e[2]!==r.title||e[3]!==l||e[4]!==i?(o=s.jsx(Te,{icon:i,name:r.title,size:l}),e[2]=r.title,e[3]=l,e[4]=i,e[5]=o):o=e[5],o}function zt(t){const e=C.c(36),{open:n,onOpenChange:l}=t,[r,i]=D.useState(""),{org:o}=te(),{setTaskId:a}=pt(),d=rs();let c,m,u;e[0]!==o.id||e[1]!==r?(u=r.trim(),m=Ls,c=Fs.globalSearch(o.id,u),e[0]=o.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let x;e[5]!==d||e[6]!==u?(x=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=x):x=e[7];let p;e[8]!==c||e[9]!==f||e[10]!==x?(p={queryKey:c,enabled:f,queryFn:x,staleTime:1e4},e[8]=c,e[9]=f,e[10]=x,e[11]=p):p=e[11];const{data:h,isFetching:g}=m(p);let b;e[12]!==h?.items?(b=h?.items??[],e[12]=h?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==l?(v=z=>{z||i(""),l(z)},e[14]=l,e[15]=v):v=e[15];const y=v;let w;e[16]!==y||e[17]!==a?(w=z=>{y(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=w):w=e[18];const k=w;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(Gn,{className:"sr-only",children:[s.jsx(qn,{children:"Search"}),s.jsx(Wn,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let N;e[20]!==r?(N=s.jsx(Yn,{value:r,onValueChange:i,placeholder:"Search..."}),e[20]=r,e[21]=N):N=e[21];let _;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==u?(_=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Xn,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(Qn,{value:`thread:${z.id}:${z.title}`,onSelect:()=>k(z),className:"gap-2.5",children:[s.jsx(ur,{virtualMcpId:z.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:z.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=u,e[26]=_):_=e[26];let A;e[27]!==_?(A=s.jsx(Jn,{children:_}),e[27]=_,e[28]=A):A=e[28];let O;e[29]!==N||e[30]!==A?(O=s.jsxs(Kn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(Zn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[N,A]})]}),e[29]=N,e[30]=A,e[31]=O):O=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==O?($=s.jsx(Vn,{open:n,onOpenChange:y,children:O}),e[32]=y,e[33]=n,e[34]=O,e[35]=$):$=e[35],$}const hr="sidebar.group.expanded.";function xr(t,e){const n=C.c(3),[l,r]=We(`${hr}${t}`,e);let i;return n[0]!==l||n[1]!==r?(i=[l,r],n[0]=l,n[1]=r,n[2]=i):i=n[2],i}function js(t){const e=C.c(12),{onClick:n,isFetching:l,indented:r}=t,i=r?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==i?(o=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(Bt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=m):m=e[11],m}function pr(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function gr(t){return t.member==="mine"&&!t.currentUserId}const vs=4;let Ue=0;const at=[];function br(){for(;Ue<vs&&at.length>0;){const t=at.shift();t&&t()}}function ys(t){return new Promise((e,n)=>{const l=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,br()})};Ue<vs?l():at.push(l)})}const Qe=10;function Tt(t,e,n,l,r){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 o={where:i,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function jr(t,e,n,l){let r=0;for(const i of t)Ss(i,e,n,l)&&r++;return r}function et(t,e,n,l){return jr(t,e,n,l)}function vr(t,e){return!!(t>=Qe||t===0&&e)}function Mt(t,e){return t<e}function yr(t,e){return e===!1?!1:e===!0?!0:t}function Ss(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 qe=new Map,He=new Map;function Sr(t,e){return e?t>=Qe?!0:null:!1}function Ot(t){return qe.get(t)}function Nr(t,e){qe.set(t,e)}function _r(t,e,n){const l=qe.get(t);if(l!==void 0){n(l);return}let r=He.get(t);r||(r=ys(e).then(i=>(qe.set(t,i),He.delete(t),i)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,r)),r.then(n,()=>n(!1))}function Dt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Qe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function wr(t,e,n,l,r){let i=0;for(const o of t)e.has(o.id)||Ss(o,n,l,r)&&i++;return i}function Cr(t,e,n,l){const r=C.c(8),{org:i}=te(),o=pr(i.id,t,e,n);let a;r[0]!==n?(a=gr(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=D.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=Hn(),{threads:f,hasMore:x}=gt(),p=et(f,t,e,n),h=vr(p,x),g=Sr(p,x),b=rs();if(c.identity===o&&c.serverHasMore===null){const S=g??Ot(o);S!==void 0&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:S})}!d&&c.identity===o&&c.serverHasMore===null&&g===null&&Ot(o)===void 0&&c.probeSubscribedIdentity!==o&&(m(S=>S.identity===o?{...S,isProbing:!0,probeSubscribedIdentity:o}:S),_r(o,async()=>{const S=Tt(t,e,0,n,1),N=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:_}=Dt(N),A=et(u.threads.get(),t,e,n);return _===void 0?!1:Mt(A,_)},S=>{m(N=>N.identity!==o?N:{...N,isProbing:!1,serverHasMore:S})}));const v=async function(){if(c.isFetching||c.isProbing||d)return;const N=o;m(_=>_.identity===N?{..._,isFetching:!0}:_);try{const _=et(f,t,e,n),A=Tt(t,e,_,n,Qe),O=await ys(()=>b.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:z,totalCount:R}=Dt(O),U=new Set(f.map(kr)),E=wr($,U,t,e,n),B=_;u.mergeThreads($),m(M=>{if(M.identity!==N)return M;let G;return R!==void 0?G=Mt(B+E,R):G=$.length===0||E===0?!1:z,Nr(N,G),{...M,isFetching:!1,serverHasMore:G}})}catch(_){const A=_,O=A instanceof Error?A.message:String(A);se.error(`Could not load more tasks: ${O}`),m($=>$.identity===N?{...$,isFetching:!1}:$)}},y=c.isFetching||c.isProbing,w=!d&&!y&&yr(h,c.serverHasMore);let k;return r[2]!==y||r[3]!==v||r[4]!==w||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(k={hasMore:w,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},r[2]=y,r[3]=v,r[4]=w,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=k):k=r[7],k}function kr(t){return t.id}function Ir(t){const e=C.c(18),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,{isFetching:d,isProbing:c,loadMore:m,hasMore:u,serverHasMore:f}=Cr("status",n,a),[x,p]=D.useState(!1);!x&&l.length===0&&f===!0&&!d&&!c&&(p(!0),queueMicrotask(()=>{m()}));let h;if(e[0]!==r||e[1]!==a||e[2]!==o||e[3]!==i||e[4]!==l){let j;e[6]!==r||e[7]!==a||e[8]!==o||e[9]!==i?(j=v=>s.jsx(os,{task:v,isActive:r===v.id,onClick:()=>i(v),onArchive:v.created_by===a.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=r,e[7]=a,e[8]=o,e[9]=i,e[10]=j):j=e[10],h=l.map(j),e[0]=r,e[1]=a,e[2]=o,e[3]=i,e[4]=l,e[5]=h}else h=e[5];let g;e[11]!==u||e[12]!==d||e[13]!==m?(g=(u||d)&&s.jsx(js,{onClick:()=>{m()},isFetching:d,indented:!0}),e[11]=u,e[12]=d,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==h||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),e[15]=h,e[16]=g,e[17]=b):b=e[17],b}function Ar(t){const e=C.c(35),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,d=sl[n],c=d.icon,[m,u]=xr(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const x=f;let p;e[3]!==x?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=p):p=e[4];let h;e[5]!==c||e[6]!==d.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(c,{size:12,className:d.iconClassName})}),e[5]=c,e[6]=d.iconClassName,e[7]=h):h=e[7];let g;e[8]!==m?(g=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:m?s.jsx(bt,{size:14}):s.jsx(ns,{size:14})}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==h||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,g]}),e[10]=h,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==d.label?(j=s.jsx("span",{className:"flex-1 truncate",children:d.label}),e[13]=d.label,e[14]=j):j=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let y;e[17]!==m||e[18]!==x||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:x,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,v]}),e[17]=m,e[18]=x,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let w;e[24]!==r||e[25]!==m||e[26]!==a||e[27]!==o||e[28]!==i||e[29]!==n||e[30]!==l?(w=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Ir,{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a})}),e[24]=r,e[25]=m,e[26]=a,e[27]=o,e[28]=i,e[29]=n,e[30]=l,e[31]=w):w=e[31];let k;return e[32]!==y||e[33]!==w?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,w]}),e[32]=y,e[33]=w,e[34]=k):k=e[34],k}function Pt(t){const e=C.c(34),{threads:n,groupBy:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[h,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(l==="status"){let h;if(e[3]!==r||e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==n){let b;e[9]!==r||e[10]!==a||e[11]!==o||e[12]!==i?(b=j=>s.jsx(Ar,{status:j.status,threads:j.threads,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a},j.status),e[9]=r,e[10]=a,e[11]=o,e[12]=i,e[13]=b):b=e[13],h=Bl(n).map(b),e[3]=r,e[4]=a,e[5]=o,e[6]=i,e[7]=n,e[8]=h}else h=e[8];let g;return e[14]!==h?(g=s.jsx(s.Fragment,{children:h}),e[14]=h,e[15]=g):g=e[15],g}let f;if(e[16]!==r||e[17]!==a||e[18]!==o||e[19]!==i||e[20]!==n){let h;e[22]!==r||e[23]!==a||e[24]!==o||e[25]!==i?(h=g=>s.jsx(os,{task:g,isActive:r===g.id,onClick:()=>i(g),onArchive:g.created_by===a.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=r,e[23]=a,e[24]=o,e[25]=i,e[26]=h):h=e[26],f=n.map(h),e[16]=r,e[17]=a,e[18]=o,e[19]=i,e[20]=n,e[21]=f}else f=e[21];let x;e[27]!==d||e[28]!==c||e[29]!==m?(x=(d||c)&&s.jsx(js,{onClick:m,isFetching:c}),e[27]=d,e[28]=c,e[29]=m,e[30]=x):x=e[30];let p;return e[31]!==f||e[32]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),e[31]=f,e[32]=x,e[33]=p):p=e[33],p}function Et(t){const e=C.c(17),{label:n,onClick:l,active:r,children:i}=t,[o,a]=D.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=r&&"bg-sidebar-accent text-foreground";let x;e[4]!==f?(x=F(f),e[4]=f,e[5]=x):x=e[5];let p;e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==x?(p=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:i})}),e[6]=i,e[7]=n,e[8]=l,e[9]=x,e[10]=p):p=e[10];let h;e[11]!==n?(h=s.jsx(xe,{side:"bottom",children:n}),e[11]=n,e[12]=h):h=e[12];let g;return e[13]!==o||e[14]!==p||e[15]!==h?(g=s.jsxs(pe,{open:o,children:[p,h]}),e[13]=o,e[14]=p,e[15]=h,e[16]=g):g=e[16],g}function tt(t){const e=C.c(13),{label:n,value:l,onChange:r,options:i}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let a;e[2]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map($r),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==l?(c=s.jsx(Bn,{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]!==o||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=m):m=e[12],m}function $r(t){return s.jsxs(Ln,{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 Ns({onNavigate:t}={}){const{data:e}=be.useSession(),n=e?.user?.id,{org:l}=te(),r=Zt({connectionId:Jt,orgId:l.id,orgSlug:l.slug}),i=Ge(l.id).id,o=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=gt(),u=a.filter(I=>!I.hidden),{hide:f}=ls(),x=ne(),{setTaskId:p,createNewTask:h}=pt(),g=ct({strict:!1}),b=Ke({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(I=>I.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},w=[...u].sort((I,L)=>(L.updated_at??"").localeCompare(I.updated_at??"")),[k,S]=D.useState("all"),[N,_]=D.useState("flat"),[A,O]=We("sidebar-threads-scope-all",!1),[$,z]=D.useState(!1),[R,U]=D.useState(!1),E={type:k,member:"mine",currentUserId:n??null},B=I=>n?I.filter(L=>L.created_by===n):[],M=I=>k==="automation"?I.filter(L=>!!L.trigger_id):k==="manual"?I.filter(L=>!L.trigger_id):I,G=B(w),X=M(G),Q=M(w),ee=A?Q:X,T=I=>{if(n&&I.created_by&&I.created_by!==n)return;const L=I.id===j;if(f(I.id),!L)return;const V=G.find(H=>H.id!==I.id&&H.virtual_mcp_id===I.virtual_mcp_id);y(),V?p(V.id,V.virtual_mcp_id):x({to:"/$org",params:{org:l.slug}})},P=I=>{y(),p(I.id,I.virtual_mcp_id)},Y=async I=>{try{const L=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:I,limit:1,offset:0}});return((L.structuredContent??L).items?.length??0)===0}catch{return!1}},q=async()=>{const I=v??i;ue("sidebar_new_thread_clicked",{virtual_mcp_id:I});const L=G.find(V=>V.virtual_mcp_id===I&&V.title==="New chat");if(L&&await Y(L.id)){y(),p(L.id,I);return}y(),h(I)},{state:le,isMobile:W,toggleSidebar:re}=ve();if(le==="collapsed"&&!W){const I=Ge(l.id),L=new Map((o??[]).map(H=>[H.id,H])),V=H=>(H?L.get(H):void 0)??(H===i?I:void 0);return s.jsxs(fe,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:re,children:s.jsx(qt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{q()},children:s.jsx(_t,{size:16})})}),ee.map(H=>{const de=V(H.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:H.title||"New chat",isActive:H.id===j,onClick:()=>P(H),children:s.jsx(Te,{icon:de?.icon??null,name:de?.title??"Agent",size:"2xs"})})},H.id)})]})}const ce=N!=="flat"||k!=="all"||A===!0,ge=s.jsxs(De,{children:[s.jsxs(pe,{children:[s.jsx(he,{asChild:!0,children:s.jsx(je,{asChild:!0,children:s.jsxs(ae,{"aria-label":"Filter threads",active:ce,children:[s.jsx(Fn,{size:16}),ce&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(xe,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Pe,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(tt,{label:"View",value:N,onChange:I=>{ue("tasks_panel_group_by_changed",{to_value:I}),_(I)},options:[{value:"flat",label:"List",icon:s.jsx(fn,{size:13})},{value:"status",label:"Status",icon:s.jsx(hn,{size:13})}]}),s.jsx(tt,{label:"Type",value:k,onChange:I=>{ue("tasks_panel_filter_changed",{to_value:I}),S(I)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(tt,{label:"Scope",value:A?"team":"mine",onChange:I=>O(I==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),ye=I=>s.jsx(nt,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",I?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!I&&s.jsx(is,{}),ge]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Et,{label:"Search threads",onClick:()=>{ue("tasks_panel_search_opened"),U(!0),z(!0)},children:s.jsx(un,{size:16})}),s.jsx(Et,{label:"New thread",onClick:()=>{q()},children:s.jsx(_t,{size:16})})]})]})});return W?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ye(!0),s.jsx($t,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:ee,groupBy:N,activeTaskId:j,onSelectTask:P,onArchiveTask:T,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})}),R&&s.jsx(zt,{open:$,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ye(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx($t,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:ee,groupBy:N,activeTaskId:j,onSelectTask:P,onArchiveTask:T,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})})}),R&&s.jsx(zt,{open:$,onOpenChange:z})]})}const zr=5,Tr=[{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 _s(){const t=C.c(3),{state:e}=ve();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:zr}).map(Dr)}),t[0]=r):r=t[0],r}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(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{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:Tr.map(Mr)})]}),t[2]=l):l=t[2],l}function Mr(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(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:F("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(Or)})]},e)}function Or(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Dr(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function Pr(){const t=C.c(4),e=cs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(dr,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ht,{children:s.jsx(D.Suspense,{fallback:s.jsx(_s,{}),children:s.jsx(Ns,{})})}),t[1]=l):l=t[1];let r;return t[2]!==e?(r=s.jsx(es,{children:s.jsx(us,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=r):r=t[3],r}function Er(t){const e=C.c(8),{onClose:n}=t,l=cs();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(mr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(_s,{}),e[1]=i):i=e[1];let o;e[2]!==n?(o=s.jsx(Ht,{children:s.jsx(D.Suspense,{fallback:i,children:s.jsx(Ns,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(es,{children:s.jsx(Ol,{sections:l,onClose:n,footer:r,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function ws(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Rr=Bs({name:Hs().min(2,"Organization name is required")});function Fr(t){const e=C.c(41),{open:n,onOpenChange:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Us(Rr),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Gs(r);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:Br,onSuccess:Lr},e[1]=o):o=e[1];const a=qs(o),d=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(cl,{children:[s.jsx(dl,{children:"Create a new organization"}),s.jsx(ml,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=N=>a.mutateAsync(N),e[6]=a,e[7]=S):S=e[7],m=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=m}else m=e[5];let u;e[8]!==i.formState.isSubmitting?(u=S=>{const{field:N}=S;return s.jsxs(pl,{children:[s.jsx(gl,{children:"Organization Name"}),s.jsx(bl,{children:s.jsx(yl,{...N,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(jl,{children:"The name of your company or organization"}),N.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ws(N.value)]})]}),s.jsx(vl,{})]})},e[8]=i.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==i.control||e[11]!==u?(f=s.jsx(hl,{control:i.control,name:"name",render:u}),e[10]=i.control,e[11]=u,e[12]=f):f=e[12];let x;e[13]!==d?(x=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=x):x=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let h;e[18]!==i.formState.isSubmitting||e[19]!==p?(h=s.jsx(ol,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=h):h=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(nl,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(ze,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==h?(v=s.jsxs(ul,{children:[h,j]}),e[26]=j,e[27]=h,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==x?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,x,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=x,e[33]=y):y=e[33];let w;e[34]!==i||e[35]!==y?(w=s.jsxs(al,{children:[c,s.jsx(xl,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=w):w=e[36];let k;return e[37]!==l||e[38]!==n||e[39]!==w?(k=s.jsx(fl,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=k):k=e[40],k}function Lr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Br(t){const e=ws(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await be.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function Hr(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 Cs(t){const e=C.c(13),{org:n,size:l}=t,r=l===void 0?"sm":l,i=r==="xs"?"size-5":"size-6",o=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=F(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:Hr(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]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,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 Ur(t){const e=C.c(24),{orgParam:n,onSelectOrg:l,onCreateOrg:r}=t,{data:i}=Ws();let o;e[0]!==n?(o=(_,A)=>_.slug===n?-1:A.slug===n?1:_.name.localeCompare(A.name),e[0]=n,e[1]=o):o=e[1];const a=[...i??[]].sort(o),[d,c]=D.useState(""),m=d.toLowerCase(),u=m?a.filter(_=>_.name.toLowerCase().includes(m)||_.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(as,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=_=>c(_.target.value),e[3]=x):x=e[3];let p;e[4]!==d?(p=_=>_.key==="Escape"&&d&&c(""),e[4]=d,e[5]=p):p=e[5];let h;e[6]!==d||e[7]!==p?(h=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:x,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=h):h=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($e,{size:16}),e[9]=g):g=e[9];let b;e[10]!==r?(b=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=r,e[11]=b):b=e[11];let j;e[12]!==h||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,h,b]}),e[12]=h,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let w;e[15]!==l||e[16]!==n?(w=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Cs,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[15]=l,e[16]=n,e[17]=w):w=e[17];const k=u.map(w);let S;e[18]!==y||e[19]!==k?(S=s.jsxs("div",{className:v,children:[y,k]}),e[18]=y,e[19]=k,e[20]=S):S=e[20];let N;return e[21]!==S||e[22]!==j?(N=s.jsxs(s.Fragment,{children:[j,S]}),e[21]=S,e[22]=j,e[23]=N):N=e[23],N}function Gr(t){const e=C.c(22),{trigger:n,orgParam:l,align:r,side:i}=t,o=r===void 0?"start":r,a=i===void 0?"bottom":i,d=ne(),[c,m]=D.useState(!1),[u,f]=D.useState(!1);let x;e[0]!==n?(x=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=x):x=e[1];const p=String(c);let h;e[2]!==d?(h=k=>{m(!1),d({to:"/$org",params:{org:k}})},e[2]=d,e[3]=h):h=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==l||e[6]!==p||e[7]!==h?(b=s.jsx(Ur,{orgParam:l,onSelectOrg:h,onCreateOrg:g},p),e[5]=l,e[6]=p,e[7]=h,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(Pe,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Wr,onCloseAutoFocus:qr,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==x||e[15]!==j?(v=s.jsxs(De,{open:c,onOpenChange:m,children:[x,j]}),e[13]=c,e[14]=x,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Fr,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let w;return e[19]!==y||e[20]!==v?(w=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=w):w=e[21],w}function qr(t){return t.preventDefault()}function Wr(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Kr(t){const e=C.c(21),{value:n,onChange:l,placeholder:r,onKeyDown:i,className:o,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==o?(m=F("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let x;e[4]!==a?(x=a?s.jsx(Bt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(as,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let p;e[6]!==l?(p=j=>l(j.target.value),e[6]=l,e[7]=p):p=e[7];let h;e[8]!==d||e[9]!==i||e[10]!==c||e[11]!==p||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:p,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]=p,e[12]=n,e[13]=h):h=e[13];let g;e[14]!==f||e[15]!==x||e[16]!==h?(g=s.jsxs("label",{className:f,children:[x,h]}),e[14]=f,e[15]=x,e[16]=h,e[17]=g):g=e[17];let b;return e[18]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Vr="Select an existing agent";function Xr(t){const e=C.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(he,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(xe,{side:"right",sideOffset:8,children:Vr}),e[2]=r):r=e[2];let i;return e[3]!==l?(i=s.jsxs(pe,{defaultOpen:!0,delayDuration:0,children:[l,r]}),e[3]=l,e[4]=i):i=e[4],i}function Qr(t){const e=ne(),{create:n}=ls(),{locator:l}=te(),r=ct({strict:!1}),i=Ke({strict:!1});return async o=>{const a=crypto.randomUUID(),d=o===i.virtualmcpid?Rn(t,l,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function Rt(t){const e=C.c(20),{agent:n,selected:l,onClick:r}=t,i=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==i?(o=F("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]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(Te,{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(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==o||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,m,u]}),e[14]=r,e[15]=o,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Yr(t){const e=C.c(23),{onClose:n,onSelectAgent:l,selectedAgentId:r}=t,[i,o]=D.useState(""),a=ht(),d=a??[],{org:c}=te(),{data:m}=be.useSession(),u=m?.user?.id??"anon",f=_n(a),x=wn(),p=Qr(c.slug),h=An(a),g=i.toLowerCase(),b=d.filter(Jr).filter(M=>!h.has(M.id)).filter(M=>!i||M.title.toLowerCase().includes(g)),j=Ge(c.id),v=!i||j.title.toLowerCase().includes(g);let y;e[0]!==n||e[1]!==l?(y=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=y):y=e[2];const w=y,k=M=>{if(l){l(M.id),n(),o("");return}Cn({orgId:c.id,userId:u},M.id,f),x(),n(),o(""),p(M.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let N;e[3]!==i?(N=s.jsx(Kr,{value:i,onChange:o,placeholder:"Search agents..."}),e[3]=i,e[4]=N):N=e[4];const _="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",A=l&&v&&j&&s.jsx(Rt,{agent:j,selected:!r||r===j.id,onClick:w}),O=b.map(M=>s.jsx(Rt,{agent:M,selected:l?r===M.id:void 0,onClick:()=>k(M)},M.id));let $;e[5]!==i||e[6]!==b.length?($=b.length===0&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[5]=i,e[6]=b.length,e[7]=$):$=e[7];let z;e[8]!==A||e[9]!==O||e[10]!==$?(z=s.jsxs("div",{className:_,children:[A,O,$]}),e[8]=A,e[9]=O,e[10]=$,e[11]=z):z=e[11];let R;e[12]!==c.slug?(R={org:c.slug},e[12]=c.slug,e[13]=R):R=e[13];let U;e[14]!==n?(U=()=>n(),e[14]=n,e[15]=U):U=e[15];let E;e[16]!==U||e[17]!==R?(E=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ut,{to:"/$org/settings/agents",params:R,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[16]=U,e[17]=R,e[18]=E):E=e[18];let B;return e[19]!==E||e[20]!==N||e[21]!==z?(B=s.jsxs("div",{className:S,children:[N,z,E]}),e[19]=E,e[20]=N,e[21]=z,e[22]=B):B=e[22],B}function Jr(t){return!Yt(t.id)}function Zr(t){const e=C.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:r,onSelectAgent:i,selectedAgentId:o,side:a,align:d}=n,c=l===void 0?!1:l,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,x]=D.useState(!1),p=ft(),{setOpenMobile:h}=ve(),g=Nn(),b=g?"border border-border":void 0;let j;e[2]!==g?(j=_=>g?s.jsx(Xr,{children:_}):_,e[2]=g,e[3]=j):j=e[3];const v=j;let y;e[4]!==p||e[5]!==h?(y=()=>{x(!1),p&&h(!1)},e[4]=p,e[5]=h,e[6]=y):y=e[6];const w=y;let k;e[7]!==w||e[8]!==i||e[9]!==f||e[10]!==o?(k=f&&s.jsx(D.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Yr,{onClose:w,onSelectAgent:i,selectedAgentId:o})}),e[7]=w,e[8]=i,e[9]=f,e[10]=o,e[11]=k):k=e[11];const S=k;let N;return e[12]!==u||e[13]!==c||e[14]!==b||e[15]!==g||e[16]!==p||e[17]!==f||e[18]!==S||e[19]!==m||e[20]!==r||e[21]!==v?(N=s.jsx(s.Fragment,{children:p?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:r}):c?v(s.jsx(ae,{"aria-label":"Browse agents",className:F(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:v(s.jsxs(J,{tooltip:g?void 0:"Browse agents",className:F(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Wt,{open:f,onOpenChange:x,direction:"bottom",children:s.jsxs(Kt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Vt,{className:"sr-only",children:"Browse agents"}),S]})})]}):s.jsxs(De,{open:f,onOpenChange:_=>{_&&!f&&ue("agent_browser_opened",{surface:"desktop_popover"}),x(_)},children:[r?s.jsx(je,{asChild:!0,children:r}):c?v(s.jsx(je,{asChild:!0,children:s.jsx(ae,{"aria-label":"Browse agents",className:F(b),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:v(s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:g?void 0:"Browse agents",className:F(b),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Pe,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:S})]})}),e[12]=u,e[13]=c,e[14]=b,e[15]=g,e[16]=p,e[17]=f,e[18]=S,e[19]=m,e[20]=r,e[21]=v,e[22]=N):N=e[22],N}const ks="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function ei(t){const e=C.c(19),{agentId:n,onOpenHome:l,onPick:r}=t,i=xt(n),o=i?.title??"Decopilot",a=`Open ${o} home`,d=i?.icon??null;let c;e[0]!==d||e[1]!==o?(c=s.jsx(Te,{icon:d,name:o,size:"2xs"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let m;e[3]!==l||e[4]!==a||e[5]!==c?(m=s.jsx("button",{type:"button",onClick:l,"aria-label":a,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:c}),e[3]=l,e[4]=a,e[5]=c,e[6]=m):m=e[6];let u;e[7]!==o?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let x;e[10]!==u?(x=s.jsxs("button",{type:"button",className:ks,children:[u,f]}),e[10]=u,e[11]=x):x=e[11];let p;e[12]!==n||e[13]!==r||e[14]!==x?(p=s.jsx(Zr,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=p):p=e[15];let h;return e[16]!==m||e[17]!==p?(h=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=h):h=e[18],h}function Ft(){const t=C.c(33),{org:e}=te(),{state:n}=ve(),l=n==="collapsed",r=ne();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[0]=i):i=t[0];const o=ct(i);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const d=Ke(a),{threads:c}=gt(),{setTaskId:m,createNewTask:u}=pt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const x=f.id,p=o.taskId?d.virtualmcpid??x:x;let h;t[4]!==u||t[5]!==x||t[6]!==r||t[7]!==e.slug||t[8]!==m||t[9]!==c?(h=A=>{if(!A||A===x){r({to:"/$org",params:{org:e.slug}});return}const O=c.find($=>!$.hidden&&$.virtual_mcp_id===A&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));O?m(O.id,A):u(A)},t[4]=u,t[5]=x,t[6]=r,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=h):h=t[10];const g=h;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Z.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Ut,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==l?(y=!l&&s.jsx(Gr,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:ks,children:[s.jsx(Cs,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=l,t[18]=y):y=t[18];let w;t[19]!==v||t[20]!==y?(w=s.jsxs(Ct,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=w):w=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[22]=k):k=t[22];let S;t[23]!==p||t[24]!==g?(S=()=>g(p),t[23]=p,t[24]=g,t[25]=S):S=t[25];let N;t[26]!==p||t[27]!==g||t[28]!==S?(N=s.jsx(Ct,{children:s.jsx(D.Suspense,{fallback:k,children:s.jsx(ei,{agentId:p,onOpenHome:S,onPick:g})})}),t[26]=p,t[27]=g,t[28]=S,t[29]=N):N=t[29];let _;return t[30]!==N||t[31]!==w?(_=s.jsx(rl,{className:"wco-no-drag",children:s.jsxs(il,{className:"flex-nowrap",children:[w,N]})}),t[30]=N,t[31]=w,t[32]=_):_=t[32],_}const ti="sidebar.open";function si(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Vs,{}),t[0]=e):e=t[0],e}function fa(){const t=C.c(24),e=ft(),[n,l]=We(ti,!1),{width:r,wrapperRef:i,onStartResize:o,resetWidth:a}=wl();let d;t[0]!==e?(d=e?s.jsxs(Z.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(is,{}),s.jsx(Ft,{}),s.jsx(ot,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(Z.CenterSlot,{}),s.jsx(Z.RightSlot,{})]}):s.jsxs(Z.Header,{children:[s.jsx(Z.LeftColumn,{children:s.jsx(Ft,{})}),s.jsx(Z.CenterSlot,{}),s.jsxs(Z.RightColumn,{children:[s.jsxs("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.TogglesSlot,{}),s.jsx(Z.TabsSlot,{})]}),s.jsx(Z.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==o||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Pr,{}),s.jsx(Sl,{onPointerDown:o,onDoubleClick:a})]}),t[4]=e,t[5]=o,t[6]=a,t[7]=f):f=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},t[8]=x):x=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ys,{className:"flex flex-col",style:x,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(D.Suspense,{fallback:s.jsx(si,{}),children:s.jsx(Ks,{})})})})}),t[9]=p):p=t[9];let h;t[10]!==u||t[11]!==f||t[12]!==i?(h=s.jsxs(Js,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=i,t[13]=h):h=t[13];let g;t[14]!==e?(g=e&&s.jsx(tl,{renderSidebar:ni}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==d||t[17]!==h||t[18]!==g?(b=s.jsx(ll,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,h,g]})}),t[16]=d,t[17]=h,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==l||t[21]!==n||t[22]!==b?(j=s.jsx(Un,{children:s.jsx(Z.Provider,{children:s.jsx(Zs,{open:n,onOpenChange:l,children:b})})}),t[20]=l,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ni(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(Er,{onClose:e})})})}export{fa as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as n,r as A,G as J,m as xe,l as Q,i as le,ag as Z,t as K,K as te,k as se,B as Y,d as nt,W as it,E as ot,a as rt,b as lt,u as at}from"./index-DgNLMhiy.js";import{u as ge}from"./use-mobile-CTYLPqKT.js";import{u as ct}from"./useSuspenseQueries-g9RVw8Va.js";import{i as dt,u as ae,m as mt,a as ut,S as ft}from"./use-mcp-client-C62ZsAPE.js";import{u as pt,b as ht,v as xt,a as gt}from"./use-virtual-mcp-D_g2q7bN.js";import{i as bt}from"./ChevronUp-C2DYINXH.js";import{b as Pe,a as Se}from"./ZoomOut-BN-KB_0J.js";import{i as yt,A as ce,t as jt,ae as vt,H as Nt,l as wt}from"./agent-icon-HIFEO6vs.js";import{s as be}from"./Plus-sSvDtP2D.js";import{i as ye}from"./X-CAjmVwOR.js";import{p as St}from"./index-Bo5LvjuQ.js";import{b as Me,c as oe,K as Ee,P as ze,D as Le,d as _t,S as Ct,v as It,g as Tt,h as kt,i as $t,f as At,e as Pt,n as Mt,C as re,L as Et,k as zt}from"./library-tab-CrasAutb.js";import{f as Lt,d as Ot}from"./tab-id-CLpu897Q.js";import{b as Ht}from"./chat-context-OmrHZlWm.js";import{N as Dt}from"./decopilot-xPgbGeJc.js";import{g as Rt,u as Ft,c as Ut,h as Bt}from"./agent-capabilities-BLdjNi42.js";import{u as Oe,a as He,o as Vt}from"./use-organization-settings-Dys1xzl0.js";import{c as je,b as Kt,h as Wt}from"./shell-layout-CSNtx2tN.js";import{I as De}from"./input-CjQtu1h5.js";import{S as qt,t as ve,P as Gt,j as Qt,s as Jt,g as Xt}from"./scroll-area-DVEw9jTn.js";import{S as Zt,a as Yt,b as es,c as ts,d as ss}from"./sheet-B3x8ZiS-.js";import{S as V}from"./skeleton-C5L5O22N.js";import{t as Re}from"./ChevronDown-DDeoixaJ.js";import{g as Fe,M as ns}from"./types-H_rr3OSP.js";import{I as Ue}from"./integration-icon-DvmR_kCi.js";import{S as is,a as os,b as rs,c as _e,d as ls}from"./select-bneCBMXH.js";import{T as as}from"./textarea-D5nE7rMP.js";import{u as Be}from"./studio-tools-kXfq3pN5.js";import{a as cs}from"./use-mcp-tools-UjXU5ids.js";import{i as ds}from"./XCircle-D3nhMqns.js";import{g as ms}from"./use-mcp-prompts-F7AgPwEV.js";import{b as us,w as fs}from"./hooks-ChlRS_Cr.js";import{b as ps,d as hs,c as xs,D as gs,a as bs}from"./dropdown-menu-Ctb60TB7.js";import{s as ys}from"./Trash01-YsCUBRvj.js";import{a as js,u as vs}from"./use-ai-providers-lTSdzFgc.js";import{u as Ns}from"./connect-desktop-dialog-3SiI_mFd.js";import{T as ws}from"./toolbar-BSesNl59.js";import"./auth-CxjVr2Fw.js";import"./use-collections-Bb5vIdWQ.js";import"./AlertCircle-DrgnpYmf.js";import"./Tool01-BUi-a5a2.js";import"./SwitchHorizontal01-DTag6ZGf.js";import"./Settings02-B0ZT4yzH.js";import"./ArrowUpRight-CEF-CsVj.js";import"./ZapSquare-BDUSHcAn.js";import"./Users03-Cw_16vbZ.js";import"./CheckCircle-xbzaC4iQ.js";import"./ChevronRight-Cc93D1fP.js";import"./DotsVertical-CB1RTV9h.js";import"./Stars02-CgeR-sX4.js";import"./Eye-DHiUyPMS.js";import"./Globe01-y8c9C4nH.js";import"./FilterLines-C174NPGB.js";import"./Star01-BwzFDtQr.js";import"./Globe04-v8yJBvO0.js";import"./HardDrive-vkw_bVtH.js";import"./Key01-8wUzNiiB.js";import"./LayoutLeft-DFSfhhoN.js";import"./LinkExternal01-CPcvHi4V.js";import"./Monitor01-DQ9B5dBT.js";import"./Sun-vVeG2mZ0.js";import"./Palette-BP0gnn-x.js";import"./Play-6woe_bCf.js";import"./SearchLg-BHGwQ11F.js";import"./SearchMd-DcwBMfFO.js";import"./Shield01-16ivhP9D.js";import"./Stars01-D_GgsBTV.js";import"./Upload01-CTPdQzyc.js";import"./User01-C4JQrjGt.js";import"./Users01-TIl6xBro.js";import"./XClose-B93vthJT.js";import"./Zap-8CUqVoBU.js";import"./alert-dialog-ClCDLHyi.js";import"./dialog-D_ieAQTy.js";import"./file-type-icon-DALXnNwz.js";import"./use-debounced-value-BCxrmAGw.js";import"./popover-Dk6C_xyw.js";import"./tooltip-B3h8W9fM.js";import"./index-CYTkc5bj.js";import"./drawer-BP70Rujn.js";import"./collection-search-BHP0uS8b.js";import"./form-DaxgojJl.js";import"./label-CyPUYQaT.js";import"./tabs-Dh_kZG_m.js";import"./toggle-group-oUYd1Jxm.js";import"./command-D9kK6qBS.js";import"./index-yloThw-p.js";import"./useInfiniteQuery-YzbBhr0w.js";import"./use-infinite-scroll-DqqX0EF_.js";import"./question-004-sINsf4GQ.js";import"./use-decopilot-events-CkQ3Rugh.js";import"./decopilot-sse-pool-BdE-V58A.js";import"./backoff-CrEUbyZT.js";import"./checkbox-DnPlj3-W.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BAkTMYHj.js";import"./settings-section-CTfa0pnb.js";import"./card-9jdGQNnr.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-MLfvU4EZ.js";import"./use-registry-connections-By0sWOC0.js";import"./use-connection-C0zEwTpO.js";import"./extract-connection-data-RxV5HgFK.js";import"./collection-tabs-CvLerKx4.js";import"./badge-CxIGH9s7.js";import"./connection-form-helpers-oKSRt7Z9.js";import"./authenticate-and-persist-oauth-CZ-MLzKy.js";import"./mcp-oauth-Cjq6PMkC.js";import"./useSuspenseInfiniteQuery-Cgpvcam3.js";import"./required-auth-layout-B1_k8uZH.js";import"./use-org-sso-nbZu8iS1.js";import"./use-clock-tick-D7gbCPid.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ClKjk1Nz.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-ZLpx01PW.js";import"./delay-CnY5UFtP.js";function Ve(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(Ss,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function Ss(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(as,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=g=>r(g==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(is,{className:"h-7 text-xs",children:n.jsx(os,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(rs,{children:[n.jsx(_e,{value:"true",children:"true"}),n.jsx(_e,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(ls,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(De,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function _s(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=A.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Zt,{children:"Manage home"}),d=n.jsx(Yt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=g=>r(g.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(es,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(De,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(tn,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx(A.Suspense,{fallback:u,children:n.jsx(Is,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(ts,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(ss,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function Cs(t){const e=k.c(32),{org:s}=J(),o=Oe();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=He(),d=ht(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const g=p>=ne;let b;e[10]!==g||e[11]!==f||e[12]!==a?(b=_=>f(_)||g?Promise.resolve():a.apply(C=>C.includes(_)?null:[...C,_]),e[10]=g,e[11]=f,e[12]=a,e[13]=b):b=e[13];const y=b;let N;e[14]!==a?(N=_=>a.apply(C=>C.filter(I=>I!==_)),e[14]=a,e[15]=N):N=e[15];const v=N;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const x=j;let w;e[18]!==d||e[19]!==g||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,C)=>{await d.update.mutateAsync({id:_.id,data:{metadata:C}}),!f(_.id)&&!g&&await a.apply(I=>I.includes(_.id)?null:[...I,_.id]),await c()},e[18]=d,e[19]=g,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let T;return e[24]!==y||e[25]!==g||e[26]!==r||e[27]!==f||e[28]!==v||e[29]!==x||e[30]!==S?(T={homeIds:r,isOnHome:f,atLimit:g,addAgent:y,removeAgent:v,reorder:x,saveAgentMetadata:S},e[24]=y,e[25]=g,e[26]=r,e[27]=f,e[28]=v,e[29]=x,e[30]=S,e[31]=T):T=e[31],T}function Is(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=pt(o);let r;e[1]!==i?(r=new Set(i.map(Ps)),e[1]=i,e[2]=r):r=e[2];const a=Cs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const g=new Map(i.map(As));d=s.trim().toLowerCase();const b=v=>!d||v.title?.toLowerCase().includes(d);l=a.homeIds.map(v=>g.get(v)).filter($s).filter(b);const y=Rt(i);let N;e[9]!==a?(N=v=>!a.isOnHome(v.id),e[9]=a,e[10]=N):N=e[10],m=i.filter(ks).filter(v=>!y.has(v.id)).filter(N).filter(b).sort(Ts),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Ms,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(Ls,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function Ts(t,e){return(t.title??"").localeCompare(e.title??"")}function ks(t){return t.id&&!dt(t.id)}function $s(t){return!!t}function As(t){return[t.id,t]}function Ps(t){return t.id}function Ke(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Ms(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:$t},e[1]=r):r=e[1];const a=Me(oe(ze,i),oe(Ee,r));let d;e[2]!==s?(d=p=>{const{active:h,over:g}=p;if(!g||h.id===g.id)return;const b=s.homeIds,y=b.indexOf(h.id),N=b.indexOf(g.id);y===-1||N===-1||s.reorder(At([...b],y,N)).catch(zs)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ke,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Le,{sensors:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(Es),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Hs,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function Es(t){return t.id}function zs(){return K.error("Couldn't reorder home — please try again.")}function Ls(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=A.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ke,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Fs,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Os),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function We(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function Hs(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=A.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=Tt(a),p=We(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const g=f?.5:void 0,b=f?100:void 0;let y;e[4]!==h||e[5]!==g||e[6]!==b||e[7]!==u?(y={transform:h,transition:u,opacity:g,zIndex:b},e[4]=h,e[5]=g,e[6]=b,e[7]=u,e[8]=y):y=e[8];const N=y,v=f&&"shadow-lg";let j;e[9]!==v?(j=Q("rounded-lg border border-border bg-card",v),e[9]=v,e[10]=j):j=e[10];const x=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Pe,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==x?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":x,children:w}),e[12]=d,e[13]=l,e[14]=x,e[15]=S):S=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>r(Rs),e[16]=T):T=e[16];const _=s.title??s.id;let C;e[17]!==s.icon||e[18]!==_?(C=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=C):C=e[19];const I=s.title??s.id;let P;e[20]!==I?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:I}),e[20]=I,e[21]=P):P=e[21];let E;e[22]!==p?(E=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=E):E=e[23];let z;e[24]!==P||e[25]!==E?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,E]}),e[24]=P,e[25]=E,e[26]=z):z=e[26];const D=i&&"rotate-180";let L;e[27]!==D?(L=Q("shrink-0 text-muted-foreground transition-transform",D),e[27]=D,e[28]=L):L=e[28];let H;e[29]!==L?(H=n.jsx(Re,{size:16,className:L}),e[29]=L,e[30]=H):H=e[30];let U;e[31]!==i||e[32]!==C||e[33]!==z||e[34]!==H?(U=n.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[C,z,H]}),e[31]=i,e[32]=C,e[33]=z,e[34]=H,e[35]=U):U=e[35];let $;e[36]!==s.id||e[37]!==o?($=()=>o.removeAgent(s.id).catch(Ds),e[36]=s.id,e[37]=o,e[38]=$):$=e[38];const R=`Remove ${s.title??s.id} from home`;let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ye,{size:14}),e[39]=O):O=e[39];let M;e[40]!==$||e[41]!==R?(M=n.jsx("button",{type:"button",onClick:$,"aria-label":R,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:O}),e[40]=$,e[41]=R,e[42]=M):M=e[42];let F;e[43]!==S||e[44]!==U||e[45]!==M?(F=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,U,M]}),e[43]=S,e[44]=U,e[45]=M,e[46]=F):F=e[46];let B;e[47]!==s||e[48]!==i||e[49]!==o?(B=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=B):B=e[50];let W;return e[51]!==m||e[52]!==N||e[53]!==F||e[54]!==B||e[55]!==j?(W=n.jsxs("div",{ref:m,style:N,className:j,children:[F,B]}),e[51]=m,e[52]=N,e[53]=F,e[54]=B,e[55]=j,e[56]=W):W=e[56],W}function Ds(){return K.error("Couldn't remove from home — please try again.")}function Rs(t){return!t}function Fs({agent:t,home:e}){const[s,o]=A.useState(!1),[i,r]=A.useState(!1),a=We(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{K.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(Re,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(be,{size:14})})]}),s&&n.jsx(qe,{agent:t,home:e})]})}function qe(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(Us).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Vs,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Bs,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx(A.Suspense,{fallback:u,children:n.jsx(Qs,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function Us(t){return t.connection_id}function Bs(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(V,{className:"h-8 w-full"}),n.jsx(V,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Vs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Be(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const g=Fe(h._meta);return g?[{name:h.name,description:h.description,resourceUri:g,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(qs,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Gs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function Ge(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Ks(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Ws(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function qs({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=A.useState(!1),[d,l]=A.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=A.useState(()=>Ks(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const g=Z(t.metadata?.ui),b=i.tileId?g.filter(N=>N.tileId!==i.tileId):g.filter(N=>N!==i),y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,y),l(!1)}catch(g){console.error("[home-tiles] failed to remove tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let g;if(m&&o.inputSchema?.properties){const v=Ge(c,o.inputSchema.properties);if(!v){K.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(v).length>0&&(g=v)}const y=Z(t.metadata?.ui).map(v=>(i.tileId?v.tileId===i.tileId:v===i)?{...v,toolInput:g}:v),N={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,N),l(!1)}catch(g){console.error("[home-tiles] failed to save tile",g),K.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Ws(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Ue,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:ve(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(g=>!g),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(jt,{size:14})}),n.jsx(Ne,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(g,b)=>u(y=>({...y,[g]:b}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Gs({agent:t,home:e,connection:s,tool:o}){const[i,r]=A.useState(!1),[a,d]=A.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=A.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const y=Ge(m,o.inputSchema.properties);if(!y){K.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(y).length>0&&(p=y)}const g=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:g}};await e.saveAgentMetadata(t,b),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),K.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Ue,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:ve(o.name)}),n.jsx(Ne,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Ve,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(g=>({...g,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function Ne(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(vt,{size:14}):n.jsx(be,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Qs(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:x}=await d.listPrompts();return x.map(Ys)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=je(r.slug);let g,b;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let x;e[17]!==s.id?(x=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=x):x=e[18],g=h.prompts.filter(x).map(Zs);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],b=[...w];for(const S of g)b.some(T=>T.name===S.name)||b.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=g,e[16]=b}else g=e[15],b=e[16];if(f&&g.length===0){let x;return e[21]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(V,{className:"h-7 w-full"}),n.jsx(V,{className:"h-7 w-2/3"})]}),e[21]=x):x=e[21],x}if(p&&g.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(b.length===0)return null;let y;e[22]!==i||e[23]!==b?(y=i??b.map(Xs),e[22]=i,e[23]=b,e[24]=y):y=e[24];let N;e[25]!==y?(N=new Set(y),e[25]=y,e[26]=N):N=e[26];const v=N;let j;return e[27]!==s||e[28]!==o||e[29]!==b||e[30]!==v?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:b.map(x=>n.jsx(en,{agent:s,home:o,prompt:x,allPromptNames:b.map(Js),isPinned:v.has(x.name)},x.name))}),e[27]=s,e[28]=o,e[29]=b,e[30]=v,e[31]=j):j=e[31],j}function Js(t){return t.name}function Xs(t){return t.name}function Zs(t){return{name:t.promptName,title:t.title,description:t.description}}function Ys(t){return{name:t.name,title:t.title,description:t.description}}function en({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=A.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){K.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),K.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??ve(s.name)}),n.jsx(Ne,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function tn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},sn)}),t[0]=e):e=t[0],e}function sn(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(V,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Qe=`home-board.layout.v${ee}`;function Je(t){return`home-board.layout.v${ee}.${t}`}const Xe={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Xe:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function nn(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function on(t){try{const e=localStorage.getItem(Je(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Ce(t,e){try{localStorage.setItem(Je(t),JSON.stringify(e))}catch{}}async function Ie(t,e){if(!(await fetch(`/api/${t}/kv/${Qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function rn(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=on(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const y=await fetch(`/api/${t}/kv/${Qe}`);if(y.status===404)return a&&nn(a)?(await Ie(t,a),a):Xe;if(!y.ok)throw new Error("Failed to load board layout");const N=await y.json(),v=fe(N.value);return Ce(t,v),v},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:y=>Ie(t,y)},e[11]=t,e[12]=u):u=e[12];const f=nt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=y=>{Ce(t,y),s.setQueryData(i,y),f.mutate(y)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let g;e[18]!==m?(g=fe(m),e[18]=m,e[19]=g):g=e[19];let b;return e[20]!==c||e[21]!==h||e[22]!==g?(b={layout:g,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=g,e[23]=b):b=e[23],b}const Ze=A.createContext(null);function ln(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=rn(o.slug),[r,a]=A.useState(!1),[d,l]=A.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,g=r&&d!==null,b=g?d:i.layout;let y;e[6]!==d||e[7]!==g||e[8]!==i.layout?(y=g?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=g,e[8]=i.layout,e[9]=y):y=e[9];const N=y;let v;e[10]!==r||e[11]!==i?(v=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=v):v=e[12];const j=v;let x;e[13]!==j||e[14]!==c||e[15]!==N||e[16]!==r||e[17]!==b||e[18]!==h||e[19]!==i.isLoading?(x={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:N,layout:b,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=N,e[16]=r,e[17]=b,e[18]=h,e[19]=i.isLoading,e[20]=x):x=e[20];let w;return e[21]!==s||e[22]!==x?(w=n.jsx(Ze.Provider,{value:x,children:s}),e[21]=s,e[22]=x,e[23]=w):w=e[23],w}function Ye(){const t=A.useContext(Ze);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function an({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=us(),{setTaskId:r}=Kt(),[a,d]=A.useState(null),[l,m]=A.useState(!1),c=A.useRef(!1),u=async(b,y)=>{if(!o){K.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const N=await ms(o,b.name,y),v={type:"doc",content:[{type:"paragraph",content:[Qt({id:b.name,name:Jt(b.name,Xt(b._meta)),metadata:N.messages,char:"/",kind:"prompt",args:y}),{type:"text",text:" "}]}]},j=crypto.randomUUID();fs(sessionStorage,s,j,{tiptapDoc:v}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(N){console.error("[start-thread-from-prompt] failed",N),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async b=>{if(!c.current){if(b.arguments&&b.arguments.length>0){d(b);return}await u(b)}},p=async b=>{if(!a)return;const y=a;d(null),await u(y,b)};return{start:f,startBlank:async b=>{if(!c.current){c.current=!0,m(!0);try{const y=crypto.randomUUID();await i({id:y,virtual_mcp_id:t}),r(y,t,b?.main?{main:b.main}:void 0)}catch(y){console.error("[start-thread-from-prompt] startBlank failed",y),K.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Gt,{prompt:a,setPrompt:b=>d(b),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Te=12,cn=5,dn={w:2,h:2};class pe extends A.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(it,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function mn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=A.useRef(null),[c,u]=A.useState(null),[f,p]=A.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const g=Me(oe(ze,h),oe(Ee)),b=s.reduce(un,0),y=o?Math.max(b+2,4):Math.max(b,1);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=()=>{const $=m.current?.getBoundingClientRect();return $?{cellWidth:$.width/q,cellHeight:G}:null},e[1]=N):N=e[1];const v=N;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=$=>{u(String($.active.id)),p(v())},e[2]=j):j=e[2];const x=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=$=>{const R=String($.active.id),O=f??v();if(u(null),p(null),!O||O.cellWidth<=0)return;const M=s.find(W=>W.id===R);if(!M)return;const F=Math.round($.delta.x/O.cellWidth),B=Math.round($.delta.y/O.cellHeight);F===0&&B===0||r(R,{x:M.x+F,y:M.y+B})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let $;if(e[7]!==i||e[8]!==s){let O;e[10]!==i?(O=M=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(M)})},M.id),e[10]=i,e[11]=O):O=e[11],$=s.map(O),e[7]=i,e[8]=s,e[9]=$}else $=e[9];let R;return e[12]!==$?(R=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:$}),e[12]=$,e[13]=R):R=e[13],R}let T,_,C,I,P,E,z,D,L;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==g||e[22]!==s||e[23]!==y){const $=c?s.find(X=>X.id===c):null;_=Le,D=g,L=x,C=S;const R=y*G,O=o?G*4:G;let M;e[33]!==R||e[34]!==O?(M={height:R,minHeight:O},e[33]=R,e[34]=O,e[35]=M):M=e[35];let F;e[36]!==o||e[37]!==s||e[38]!==y?(F=o&&n.jsx(fn,{rows:y,tiles:s}),e[36]=o,e[37]=s,e[38]=y,e[39]=F):F=e[39];let B;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(hn,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],B=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=B}else B=e[46];e[53]!==M||e[54]!==F||e[55]!==B?(I=n.jsxs("div",{ref:m,className:"relative w-full",style:M,children:[F,B]}),e[53]=M,e[54]=F,e[55]=B,e[56]=I):I=e[56],T=Pt,P=null;const W=$&&f?$.w*f.cellWidth-Te:void 0,de=$&&f?$.h*f.cellHeight-Te:void 0;e[57]!==W||e[58]!==de?(E={width:W,height:de},e[57]=W,e[58]=de,e[59]=E):E=e[59],z=$&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i($)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=g,e[22]=s,e[23]=y,e[24]=T,e[25]=_,e[26]=C,e[27]=I,e[28]=P,e[29]=E,e[30]=z,e[31]=D,e[32]=L}else T=e[24],_=e[25],C=e[26],I=e[27],P=e[28],E=e[29],z=e[30],D=e[31],L=e[32];let H;e[60]!==T||e[61]!==P||e[62]!==E||e[63]!==z?(H=n.jsx(T,{dropAnimation:P,style:E,children:z}),e[60]=T,e[61]=P,e[62]=E,e[63]=z,e[64]=H):H=e[64];let U;return e[65]!==_||e[66]!==C||e[67]!==I||e[68]!==H||e[69]!==D||e[70]!==L?(U=n.jsxs(_,{sensors:D,onDragStart:L,onDragEnd:C,children:[I,H]}),e[65]=_,e[66]=C,e[67]=I,e[68]=H,e[69]=D,e[70]=L,e[71]=U):U=e[71],U}function un(t,e){return Math.max(t,e.y+e.h)}function fn(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<q;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(pn)}),e[5]=a,e[6]=d):d=e[6],d}function pn(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/q*100}%`,top:t.y*G,width:`${1/q*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function hn(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Mt(m),h=`${s.x/q*100}%`,g=`${s.w/q*100}%`,b=s.y*G,y=s.h*G,N=p||i,v=!N&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=N&&"opacity-30";let x;e[3]!==v||e[4]!==j?(x=Q("absolute p-1 will-change-[left,top,width,height,opacity]",v,j),e[3]=v,e[4]=j,e[5]=x):x=e[5];let w;e[6]!==y||e[7]!==h||e[8]!==b||e[9]!==g?(w={left:h,top:b,width:g,height:y},e[6]=y,e[7]=h,e[8]=b,e[9]=g,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==S?(T=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=T):T=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(Pe,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(xn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let C;e[20]!==d?(C=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=C):C=e[21];let I;e[22]!==C||e[23]!==T||e[24]!==_?(I=n.jsxs("div",{className:T,children:[_,C]}),e[22]=C,e[23]=T,e[24]=_,e[25]=I):I=e[25];let P;return e[26]!==c||e[27]!==I||e[28]!==x||e[29]!==w?(P=n.jsx("div",{ref:c,className:x,style:w,children:I}),e[26]=c,e[27]=I,e[28]=x,e[29]=w,e[30]=P):P=e[30],P}function xn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ps,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(Nt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=b=>{o(s.id,b),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(gn,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(hs,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ys,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(xs,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(gs,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let g;return e[17]!==r||e[18]!==h?(g=n.jsxs(bs,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=g):g=e[19],g}function gn(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=A.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${q}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:cn},(b,y)=>Array.from({length:q},(N,v)=>{const j=v+1,x=y+1,w=j<i||x<r,S=j<=m.w&&x<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${x}`,onPointerEnter:()=>d({w:j,h:x}),onClick:()=>o({w:j,h:x}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${x}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let g;return e[16]!==u||e[17]!==h?(g=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=g):g=e[18],g}function bn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=q-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)bn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(q,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(q-s,t)),i=Math.max(0,e);return{x:o,y:i}}function yn(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function jn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ye();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let N;e[7]!==a?(N=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=N):N=e[8];const v=t.filter(N);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of v){const x=s.tiles[j.id];if(!x)continue;const w=d.get(j.id),{w:S,h:T}=me(x.w,x.h,w),{x:_,y:C}=ue(x.x,x.y,S);l.push({id:j.id,x:_,y:C,w:S,h:T,minW:w?.w,minH:w?.h})}for(const j of v){if(l.some(C=>C.id===j.id))continue;const x=j.defaultSize??dn,w=d.get(j.id),{w:S,h:T}=me(x.w,x.h,w),_=he(l,S,T);l.push({id:j.id,x:_.x,y:_.y,w:S,h:T,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(vn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(N,v)=>{const j={};for(const x of N)j[x.id]={x:x.x,y:x.y,w:x.w,h:x.h};i({version:ee,tiles:j,hidden:v.filter(x=>c.has(x))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(N,v)=>{const j=l.find(S=>S.id===N);if(!j)return;const x=ue(v.x,v.y,j.w);if(x.x===j.x&&x.y===j.y)return;const w=yn(l,N,x);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let g;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(g=(N,v)=>{const j=l.find(I=>I.id===N);if(!j)return;const x=d.get(N),{w,h:S}=me(v.w,v.h,x);if(w===j.w&&S===j.h)return;const T={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(I=>I.id!==N),C=[T];for(const I of _){const P=he(C,I.w,I.h);C.push({...I,x:P.x,y:P.y})}f(C,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=g):g=e[24];let b;e[25]!==f||e[26]!==s||e[27]!==l?(b=N=>{const v=l.filter(j=>j.id!==N);f(v,Array.from(new Set([...s.hidden,N])))},e[25]=f,e[26]=s,e[27]=l,e[28]=b):b=e[28];let y;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==g||e[33]!==b?(y={snapshot:p,isLoading:o,moveTile:h,resizeTile:g,hideTile:b},e[29]=o,e[30]=p,e[31]=h,e[32]=g,e[33]=b,e[34]=y):y=e[34],y}function vn(t){return t.id}const Nn={w:2,h:4},wn={w:1,h:2},Sn={w:1,h:1};function _n(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function Cn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function In(t){return t.promptName?t.agentName:t.description}function Tn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function et(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=mt({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=cs(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Fe(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?Lt(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function we(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=an(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(Tn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function kn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=we(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let g;e[12]!==s?(g=In(s),e[12]=s,e[13]=g):g=e[13];let b;e[14]!==g?(b=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:g}),e[14]=g,e[15]=b):b=e[15];let y;e[16]!==b||e[17]!==h?(y=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,b]}),e[16]=b,e[17]=h,e[18]=y):y=e[18];let N;e[19]!==o?(N=!o&&n.jsx(ds,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=N):N=e[20];let v;e[21]!==a||e[22]!==d||e[23]!==y||e[24]!==N||e[25]!==l||e[26]!==f||e[27]!==p?(v=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,y,N]}),e[21]=a,e[22]=d,e[23]=y,e[24]=N,e[25]=l,e[26]=f,e[27]=p,e[28]=v):v=e[28];let j;return e[29]!==r||e[30]!==v?(j=n.jsxs(n.Fragment,{children:[v,r]}),e[29]=r,e[30]=v,e[31]=j):j=e[31],j}function $n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},An)}),t[0]=e):e=t[0],e}function An(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(V,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Pn(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=we(s.agentId),u=o.filter(Mn),f=et(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const g="flex min-h-0 flex-1 gap-3 overflow-hidden";let b;e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(zn,{}),e[5]=b):b=e[5];let y;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(y=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx(A.Suspense,{fallback:b,children:n.jsx(En,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=y):y=e[9];const N=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(x=>n.jsx("button",{type:"button",onClick:()=>d(x),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:x.title})},x.promptName))});let v;e[10]!==y||e[11]!==N?(v=n.jsxs("div",{className:g,children:[y,N]}),e[10]=y,e[11]=N,e[12]=v):v=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==v?(j=n.jsxs("div",{className:p,children:[h,v,m]}),e[13]=m,e[14]=h,e[15]=v,e[16]=j):j=e[16],j}function Mn(t){return!!t.promptName}function En(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(ns,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function zn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(V,{className:"h-3 w-2/3"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function Ln(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(V,{className:"h-3 w-3/4"}),n.jsx(V,{className:"h-3 w-1/2"}),n.jsx(V,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function On(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=we(s.agentId),m=o.filter(Hn),c=et(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const g=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(y=>n.jsx("button",{type:"button",onClick:()=>!i&&r(y),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:y.title})},y.promptName))});let b;return e[6]!==d||e[7]!==h||e[8]!==g?(b=n.jsxs("div",{className:u,children:[h,g,d]}),e[6]=d,e[7]=h,e[8]=g,e[9]=b):b=e[9],b}function Hn(t){return!!t.promptName}function tt({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=je(e.slug),r=Oe()?.ids??[],a=new Set(r),d=He(),l=Be(),m=xe(),c=new Set(i.map(x=>x.agentId)),u=new Map;for(const x of o){const w=u.get(x.agentId);w?w.push(x):u.set(x.agentId,[x])}const f=o.filter(x=>!c.has(x.agentId)),p=[...i.map(x=>({kind:"tile",id:Cn(x),data:x})),...f.map(x=>({kind:"prompt",id:_n(x),data:x}))],h=new Map(p.map(x=>[x.id,x])),g=jn(p.map(x=>({id:x.id,defaultSize:x.kind==="tile"?Nn:Sn,minSize:x.kind==="tile"?wn:void 0,pinned:a.has(x.data.agentId)}))),b=x=>{d.apply(w=>w.filter(S=>S!==x)).catch(()=>K.error("Couldn't remove from home — please try again."))},y=async x=>{if(i.filter(S=>S.agentId===x.agentId).length<=1){b(x.agentId);return}try{const T=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:x.agentId})).item;if(!T)throw new Error("Agent not found");const _=Z(T.metadata?.ui),C=x.tileId?_.filter(I=>I.tileId!==x.tileId):_.filter(I=>I.connectionId!==x.connectionId||I.resourceUri!==x.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:x.agentId,data:{metadata:{...T.metadata??{},ui:{...T.metadata?.ui??{},homeTile:null,homeTiles:C}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{K.error("Couldn't remove tile — please try again.")}},N=x=>{const w=h.get(x);if(w){if(!a.has(w.data.agentId)){g.hideTile(x);return}w.kind==="tile"?y(w.data):b(w.data.agentId)}},v=x=>{const w=h.get(x.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(On,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx(A.Suspense,{fallback:n.jsx(Ln,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t,tileWidth:x.w})})})}return n.jsx(kn,{entry:w.data,isEditMode:t})};return s||g.isLoading?n.jsx($n,{}):g.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(mn,{tiles:g.snapshot.visible,isEditMode:t,renderTile:v,onMove:g.moveTile,onResize:g.resizeTile,onRemove:N})})}function Dn(t){const e=k.c(2),{prompts:s,tiles:o}=je(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const ke=420,$e=305;function st(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:$e}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:$e}})]}),t[3]=i):i=t[3],i}function Ae(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=Ns(),{selectedVirtualMcp:r}=Ht();let a;t[0]!==s.id?(a=ut(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Wt(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:ft,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=js(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Vt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=xt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let g;t[17]!==f||t[18]!==p||t[19]!==h?(g={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=g):g=t[20],ct(g);const b=vs(),y=gt(l.id),{hasDecoKey:N,isZeroBalance:v,isInitialFreeCredit:j,balanceDollars:x,hasOnlyDecoProvider:w}=Ft(),{hasVisibleTiles:S}=Dn(s.slug),T=Ut(y?.metadata);if(b.length===0&&!(T&&Bt(i))){let H;return t[21]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(Dt,{})})}),t[21]=H):H=t[21],H}let C;t[22]!==e?.user?.name?(C=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=C):C=t[23];const I=C,P=N&&j&&x!=null,E=N&&v&&w;let z;t[24]!==x||t[25]!==P||t[26]!==E?(z=P?n.jsx(re.CreditsEyebrow,{balanceDollars:x}):E?n.jsx(re.NoCreditsEyebrow,{}):null,t[24]=x,t[25]=P,t[26]=E,t[27]=z):z=t[27];const D=z;let L;return t[28]!==D||t[29]!==S||t[30]!==o||t[31]!==I?(L=n.jsx(ln,{children:o?n.jsx(Rn,{eyebrow:D,userName:I}):n.jsx(Fn,{eyebrow:D,userName:I,hasVisibleTiles:S})}),t[28]=D,t[29]=S,t[30]=o,t[31]=I,t[32]=L):L=t[32],L}function Rn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(st,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(re.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(tt,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function Fn(t){const e=k.c(54),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ye(),[c,u]=A.useState(!1),f=lt();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={strict:!1},e[0]=p):p=e[0];const{main:h}=at(p);let g;e[1]!==h?(g=h?Ot(h):null,e[1]=h,e[2]=g):g=e[2];const b=g,y=h==="files"||!!b;let N;e[3]!==f?(N=B=>f({to:".",search:W=>({...W,main:B}),replace:!0}),e[3]=f,e[4]=N):N=e[4];const v=N;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j={kind:"component",Component:Se},e[5]=j):j=e[5];let x;e[6]!==y||e[7]!==v?(x=()=>v(y?void 0:"files"),e[6]=y,e[7]=v,e[8]=x):x=e[8];let w;e[9]!==y||e[10]!==x?(w=n.jsx(St,{title:"Library",icon:j,active:y,onClick:x}),e[9]=y,e[10]=x,e[11]=w):w=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=()=>u(!0),e[12]=S):S=e[12];let T;e[13]!==l||e[14]!==a||e[15]!==m||e[16]!==r||e[17]!==d?(T=n.jsx(Un,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:S}),e[13]=l,e[14]=a,e[15]=m,e[16]=r,e[17]=d,e[18]=T):T=e[18];let _;e[19]!==w||e[20]!==T?(_=n.jsxs(ws.Right,{children:[w,T]}),e[19]=w,e[20]=T,e[21]=_):_=e[21];let C;e[22]!==c?(C=n.jsx(_s,{open:c,onOpenChange:u}),e[22]=c,e[23]=C):C=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(st,{}),e[24]=I):I=e[24];const P=i||r?"pt-32":"flex-1 justify-center";let E;e[25]!==P?(E=Q("relative flex flex-col items-center px-10 pb-4",P),e[25]=P,e[26]=E):E=e[26];let z;e[27]!==s?(z=s&&n.jsx("div",{className:"mb-4",children:s}),e[27]=s,e[28]=z):z=e[28];let D;e[29]!==o?(D=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[29]=o,e[30]=D):D=e[30];let L;e[31]!==z||e[32]!==D?(L=n.jsxs("div",{className:"text-center mb-10",children:[z,D]}),e[31]=z,e[32]=D,e[33]=L):L=e[33];let H;e[34]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Bn,{}),n.jsx(re.Input,{showConnectionsBanner:!0})]}),e[34]=H):H=e[34];let U;e[35]!==L?(U=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[L,H]}),e[35]=L,e[36]=U):U=e[36];let $;e[37]!==r?($=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(tt,{isEditMode:r})}),e[37]=r,e[38]=$):$=e[38];let R;e[39]!==E||e[40]!==U||e[41]!==$?(R=n.jsxs("div",{className:"flex-1 min-w-0 relative flex flex-col",children:[I,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:E,children:[U,$]})})]}),e[39]=E,e[40]=U,e[41]=$,e[42]=R):R=e[42];let O;e[43]!==b||e[44]!==y||e[45]!==v?(O=y&&n.jsxs("div",{className:"w-[45%] max-w-[680px] min-w-[380px] shrink-0 flex flex-col min-h-0 border-l border-border bg-background",children:[n.jsxs("div",{className:"h-10 shrink-0 flex items-center justify-between px-3 border-b border-border",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-sm font-medium text-foreground",children:[n.jsx(Se,{size:16}),"Library"]}),n.jsx("button",{type:"button",onClick:()=>v(void 0),"aria-label":"Close Library panel",className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors",children:n.jsx(ye,{size:16})})]}),n.jsx("div",{className:"flex-1 min-h-0",children:b?n.jsx(Et,{path:b.path}):n.jsx(zt,{})})]}),e[43]=b,e[44]=y,e[45]=v,e[46]=O):O=e[46];let M;e[47]!==R||e[48]!==O?(M=n.jsxs("div",{className:"flex-1 relative flex flex-row min-h-0",children:[R,O]}),e[47]=R,e[48]=O,e[49]=M):M=e[49];let F;return e[50]!==C||e[51]!==M||e[52]!==_?(F=n.jsxs(n.Fragment,{children:[_,C,M]}),e[50]=C,e[51]=M,e[52]=_,e[53]=F):F=e[53],F}function Un(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(be,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(ye,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(bt,{size:14}),e[6]=g):g=e[6];let b;e[7]!==r||e[8]!==h?(b=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[g,"Save"]}),e[7]=r,e[8]=h,e[9]=b):b=e[9];let y;return e[10]!==u||e[11]!==p||e[12]!==b?(y=n.jsxs(n.Fragment,{children:[u,p,b]}),e[10]=u,e[11]=p,e[12]=b,e[13]=y):y=e[13],y}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(wt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function Bn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function er(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(Ae,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(Ae,{})})})}),t[1]=s):s=t[1],s}export{er as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,j as s,B as ze,G as pe,q as Mt,m as Ve,d as Me,K as ce,t as oe,k as Ct,r as re,l as ke,i as Xe,E as Rt,v as Re}from"./index-DgNLMhiy.js";import{C as zt}from"./collection-display-button-DOUzSfH_.js";import{S as Pt}from"./search-input-Cw7dukB_.js";import{P as Ae}from"./index-CvxPzQfb.js";import{C as Et}from"./collection-table-wrapper-DeKnxXxy.js";import{E as We}from"./empty-state-BS7npFnj.js";import{I as kt}from"./invite-member-dialog-BHrSHQE6.js";import{b as Dt,S as $t,a as Ot}from"./settings-section-CTfa0pnb.js";import{a as qt,u as Lt}from"./use-join-requests-BFV1IEGJ.js";import{A as De}from"./avatar-BAkTMYHj.js";import{u as Ft}from"./use-members-B-1xXj0d.js";import{u as $e}from"./studio-tools-kXfq3pN5.js";import{u as yt}from"./use-org-auth-client-NLz6RBvg.js";import{u as Bt}from"./use-organization-roles-BEuKNbP8.js";import{a as Kt,b as Ut,c as Vt,T as Gt}from"./tooltip-B3h8W9fM.js";import{a as st,e as nt,g as it,b as at,c as lt,d as ot,A as rt,f as ct}from"./alert-dialog-ClCDLHyi.js";import{B as Ge}from"./badge-CxIGH9s7.js";import{C as mt}from"./card-9jdGQNnr.js";import{a as St,b as Nt,D as wt,e as Qt,f as Jt,g as Ht,c as et,d as Wt}from"./dropdown-menu-Ctb60TB7.js";import{i as _t}from"./DotsVertical-CB1RTV9h.js";import{i as Yt}from"./Key01-8wUzNiiB.js";import{i as Zt}from"./Shield01-16ivhP9D.js";import{b as Xt}from"./SwitchHorizontal01-DTag6ZGf.js";import{s as es}from"./Trash01-YsCUBRvj.js";import{s as Tt}from"./XClose-B93vthJT.js";import{a as dt,S as ut,c as ft,b as pt,d as ht}from"./select-bneCBMXH.js";import{C as gt}from"./checkbox-DnPlj3-W.js";import{e as Ye,a as Ze,g as xt,C as ts,c as ss,d as ns,b as is}from"./command-D9kK6qBS.js";import{b as as,P as ls,a as os}from"./popover-Dk6C_xyw.js";import{t as rs}from"./ChevronDown-DDeoixaJ.js";import{s as cs}from"./Plus-sSvDtP2D.js";import{R as ms}from"./require-capability-ByiCIEvf.js";import"./ChevronUp-C2DYINXH.js";import"./view-mode-toggle-B3xxjWBP.js";import"./SearchMd-DcwBMfFO.js";import"./sidebar-C8N0hRhw.js";import"./LayoutLeft-DFSfhhoN.js";import"./use-mobile-CTYLPqKT.js";import"./sheet-B3x8ZiS-.js";import"./X-CAjmVwOR.js";import"./table-77ubNeic.js";import"./dialog-D_ieAQTy.js";import"./form-DaxgojJl.js";import"./label-CyPUYQaT.js";import"./textarea-D5nE7rMP.js";import"./ArrowUpRight-CEF-CsVj.js";import"./use-capability-Cgr7yHYD.js";import"./User01-C4JQrjGt.js";import"./ChevronRight-Cc93D1fP.js";import"./index-yloThw-p.js";import"./access-gate-B6S-WMth.js";import"./capability-load-error-Bj6xKhKF.js";function ds(){const t=Q.c(9),e=qt(),{approve:n,deny:l}=Lt();if(e.length===0)return null;let i;if(t[0]!==n||t[1]!==l||t[2]!==e){let o;t[4]!==n||t[5]!==l?(o=r=>s.jsx(Dt,{icon:s.jsx(De,{url:r.user?.image??void 0,fallback:(r.user?.name??r.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:r.user?.name??r.user?.email??r.userId,description:r.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ze,{size:"sm",variant:"outline",onClick:()=>l.mutate(r.id),disabled:l.isPending||n.isPending,children:"Deny"}),s.jsx(ze,{size:"sm",onClick:()=>n.mutate(r.id),disabled:n.isPending||l.isPending,children:"Approve"})]})},r.id),t[4]=n,t[5]=l,t[6]=o):o=t[6],i=e.map(o),t[0]=n,t[1]=l,t[2]=e,t[3]=i}else i=t[3];let a;return t[7]!==i?(a=s.jsx($t,{title:"Join requests",description:"People who requested to join via a domain in approval mode.",children:s.jsx(Ot,{children:i})}),t[7]=i,t[8]=a):a=t[8],a}function us(){const t=Q.c(7),{locator:e}=pe(),n=$e();let l;t[0]!==e?(l=ce.invitations(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i},t[4]=l,t[5]=i,t[6]=a):a=t[6],Mt(a)}function fs(){const t=Q.c(10),{locator:e}=pe(),n=yt(),l=Ve();let i;t[0]!==n?(i=async f=>{const g=await n.organization.cancelInvitation({invitationId:f});if(g?.error)throw new Error(g.error.message);return g.data},t[0]=n,t[1]=i):i=t[1];let a;t[2]!==e||t[3]!==l?(a=()=>{l.invalidateQueries({queryKey:ce.invitations(e)}),oe.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=a):a=t[4];let o;t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:ps},t[5]=i,t[6]=a,t[7]=o):o=t[7];const r=Me(o);let u;return t[8]!==r?(u={cancel:r},t[8]=r,t[9]=u):u=t[9],u}function ps(t){oe.error(t instanceof Error?t.message:"Failed to cancel invitation")}function hs(){const t=Q.c(7),{locator:e}=pe(),n=$e();let l;t[0]!==e?(l=ce.tags(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>{const{tags:o}=await n.call("TAGS_LIST",{});return o},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[4]=l,t[5]=i,t[6]=a):a=t[6],Ct(a)}function gs(){const t=Q.c(8),e=Ve(),{locator:n}=pe(),l=$e();let i;t[0]!==l?(i=async r=>{const{tag:u}=await l.call("TAGS_CREATE",{name:r});return u},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=()=>{e.invalidateQueries({queryKey:ce.tags(n)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:xs},t[5]=i,t[6]=a,t[7]=o):o=t[7],Me(o)}function xs(t){oe.error(t instanceof Error?t.message:"Failed to create tag")}function bs(t){const e=Q.c(10),{locator:n}=pe(),l=$e();let i;e[0]!==n||e[1]!==t?(i=ce.memberTags(n,t),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==l?(a=async()=>{const{tags:u}=await l.call("MEMBER_TAGS_GET",{memberId:t});return u},e[3]=t,e[4]=l,e[5]=a):a=e[5];const o=!!t;let r;return e[6]!==i||e[7]!==a||e[8]!==o?(r={queryKey:i,queryFn:a,staleTime:3e4,enabled:o},e[6]=i,e[7]=a,e[8]=o,e[9]=r):r=e[9],Ct(r)}function js(){const t=Q.c(8),e=Ve(),{locator:n}=pe(),l=$e();let i;t[0]!==l?(i=async r=>{const{memberId:u,tagIds:f}=r;return await l.call("MEMBER_TAGS_SET",{memberId:u,tagIds:f})},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=(r,u)=>{e.invalidateQueries({queryKey:ce.memberTags(n,u.memberId)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o={mutationFn:i,onSuccess:a,onError:vs},t[5]=i,t[6]=a,t[7]=o):o=t[7],Me(o)}function vs(t){oe.error(t instanceof Error?t.message:"Failed to update member tags")}function It(t){const e=Q.c(44),{memberId:n,className:l,disabled:i,placeholder:a,maxDisplay:o}=t,r=i===void 0?!1:i,u=a===void 0?"Add tags...":a,f=o===void 0?2:o,[g,b]=re.useState(!1),[p,I]=re.useState(""),{data:M,isLoading:j}=hs(),D=M===void 0?[]:M,{data:v,isLoading:$}=bs(n),C=v===void 0?[]:v,E=gs(),N=js(),R=j||$,S=C.map(ys);let z;e[0]!==p?(z=x=>x.name.toLowerCase().includes(p.toLowerCase()),e[0]=p,e[1]=z):z=e[1];const A=D.filter(z);let y;e[2]!==p?(y=x=>x.name.toLowerCase()===p.toLowerCase(),e[2]=p,e[3]=y):y=e[3];const K=D.find(y),w=p.trim()&&!K,k=async x=>{const fe=S.includes(x.id)?S.filter(xe=>xe!==x.id):[...S,x.id];await N.mutateAsync({memberId:n,tagIds:fe})},_=async()=>{if(!p.trim())return;const x=await E.mutateAsync(p.trim());await N.mutateAsync({memberId:n,tagIds:[...S,x.id]}),I("")},c=async x=>{const se=S.filter(fe=>fe!==x);await N.mutateAsync({memberId:n,tagIds:se})},h=E.isPending||N.isPending,L=ls;let P;e[4]!==g?(P=()=>b(!g),e[4]=g,e[5]=P):P=e[5];let O;e[6]!==l?(O=ke("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=O):O=e[7];const U=r||R,q=R?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):C.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[C.slice(0,f).map(Cs),C.length>f&&s.jsxs(Ge,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",C.length-f]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:u});let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(rs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=V):V=e[8];let F;e[9]!==U||e[10]!==q||e[11]!==P||e[12]!==O?(F=s.jsx(os,{asChild:!0,children:s.jsxs(ze,{variant:"ghost",size:"sm",onClick:P,className:O,disabled:U,children:[q,V]})}),e[9]=U,e[10]=q,e[11]=P,e[12]=O,e[13]=F):F=e[13];const G=as,J="w-56 p-0",H="start";let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>b(!1),e[14]=W):W=e[14];const ne=ns,he=!1;let Y;e[15]!==p?(Y=s.jsx(is,{placeholder:"Search or create...",value:p,onValueChange:I,className:"h-9"}),e[15]=p,e[16]=Y):Y=e[16];const ie=ss,me=C.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:C.map(x=>s.jsx(Ze,{onSelect:()=>k(x),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(gt,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:x.name})]}),s.jsx("button",{onClick:se=>{se.stopPropagation(),c(x.id)},className:"opacity-50 hover:opacity-100",disabled:h,children:s.jsx(Tt,{size:14})})]})},x.id))}),s.jsx(xt,{})]}),Pe=Ye,ge="Available",Ee=A.length===0&&!w&&s.jsx(ts,{children:"No tags found."}),ue=A.filter(x=>!S.includes(x.id)).map(x=>s.jsx(Ze,{onSelect:()=>k(x),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(gt,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:x.name})]})},x.id));let ae;e[17]!==Pe||e[18]!==Ee||e[19]!==ue?(ae=s.jsxs(Pe,{heading:ge,children:[Ee,ue]}),e[17]=Pe,e[18]=Ee,e[19]=ue,e[20]=ae):ae=e[20];let le;e[21]!==_||e[22]!==h||e[23]!==p||e[24]!==w?(le=w&&s.jsxs(s.Fragment,{children:[s.jsx(xt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:_,className:"cursor-pointer",disabled:h,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[h?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(cs,{size:14}),s.jsxs("span",{children:['Create "',p.trim(),'"']})]})})})]}),e[21]=_,e[22]=h,e[23]=p,e[24]=w,e[25]=le):le=e[25];let Z;e[26]!==ie||e[27]!==me||e[28]!==ae||e[29]!==le?(Z=s.jsxs(ie,{children:[me,ae,le]}),e[26]=ie,e[27]=me,e[28]=ae,e[29]=le,e[30]=Z):Z=e[30];let X;e[31]!==ne||e[32]!==Y||e[33]!==Z?(X=s.jsxs(ne,{shouldFilter:he,children:[Y,Z]}),e[31]=ne,e[32]=Y,e[33]=Z,e[34]=X):X=e[34];let ee;e[35]!==G||e[36]!==W||e[37]!==X?(ee=s.jsx(G,{className:J,align:H,onEscapeKeyDown:W,children:X}),e[35]=G,e[36]=W,e[37]=X,e[38]=ee):ee=e[38];let te;return e[39]!==L||e[40]!==g||e[41]!==F||e[42]!==ee?(te=s.jsxs(L,{open:g,onOpenChange:b,children:[F,ee]}),e[39]=L,e[40]=g,e[41]=F,e[42]=ee,e[43]=te):te=e[43],te}function Cs(t){return s.jsx(Ge,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function ys(t){return t.id}const bt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Ss={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ue(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ns(t){const e=new Map;for(const[n,l]of Object.entries(Ss))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,bt[n%bt.length]??"bg-neutral-400")}return e}function ws(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Ke(t){const e=Q.c(79),{role:n,memberId:l,isOwner:i,roleColorMap:a,selectableRoles:o,onRoleChange:r,size:u,className:f}=t,g=u===void 0?"xs":u;let b,p,I,M,j,D,v,$,C,E,N;if(e[0]!==f||e[1]!==i||e[2]!==l||e[3]!==r||e[4]!==n||e[5]!==a||e[6]!==o||e[7]!==g){N=Symbol.for("react.early_return_sentinel");e:{const _=a.get(n)??"bg-neutral-400";if(i){let c;e[19]!==l||e[20]!==r?(c=J=>r(l,J),e[19]=l,e[20]=r,e[21]=c):c=e[21];let h;e[22]!==n?(h=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=h):h=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:ke("size-2 rounded-full shrink-0",_)}),h]});let P;e[24]!==L?(P=s.jsx(dt,{children:L}),e[24]=L,e[25]=P):P=e[25];let O;e[26]!==f||e[27]!==g||e[28]!==P?(O=s.jsx(ut,{size:g,className:f,children:P}),e[26]=f,e[27]=g,e[28]=P,e[29]=O):O=e[29];let U;if(e[30]!==a||e[31]!==o){let J;e[33]!==a?(J=H=>{const W=a.get(H.role)??"bg-neutral-400";return s.jsx(ft,{value:H.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ke("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:H.label})]})},H.role)},e[33]=a,e[34]=J):J=e[34],U=o.map(J),e[30]=a,e[31]=o,e[32]=U}else U=e[32];let q;e[35]!==U?(q=s.jsx(pt,{children:U}),e[35]=U,e[36]=q):q=e[36];let V;e[37]!==i||e[38]!==n||e[39]!==c||e[40]!==O||e[41]!==q?(V=s.jsx(Kt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(ht,{value:n,onValueChange:c,disabled:i,children:[O,q]})})}),e[37]=i,e[38]=n,e[39]=c,e[40]=O,e[41]=q,e[42]=V):V=e[42];let F;e[43]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ut,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=F):F=e[43];let G;e[44]!==V?(G=s.jsx(Vt,{children:s.jsxs(Gt,{children:[V,F]})}),e[44]=V,e[45]=G):G=e[45],N=G;break e}I=ht,$=n,e[46]!==l||e[47]!==r?(C=c=>r(l,c),e[46]=l,e[47]=r,e[48]=C):C=e[48],E=i,p=ut,D=g,v=f,b=dt,j="flex items-center gap-2 min-w-0",M=ke("size-2 rounded-full shrink-0",_)}e[0]=f,e[1]=i,e[2]=l,e[3]=r,e[4]=n,e[5]=a,e[6]=o,e[7]=g,e[8]=b,e[9]=p,e[10]=I,e[11]=M,e[12]=j,e[13]=D,e[14]=v,e[15]=$,e[16]=C,e[17]=E,e[18]=N}else b=e[8],p=e[9],I=e[10],M=e[11],j=e[12],D=e[13],v=e[14],$=e[15],C=e[16],E=e[17],N=e[18];if(N!==Symbol.for("react.early_return_sentinel"))return N;let R;e[49]!==M?(R=s.jsx("div",{className:M}),e[49]=M,e[50]=R):R=e[50];let S;e[51]!==n?(S=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=S):S=e[52];let z;e[53]!==R||e[54]!==S||e[55]!==j?(z=s.jsxs("div",{className:j,children:[R,S]}),e[53]=R,e[54]=S,e[55]=j,e[56]=z):z=e[56];let A;e[57]!==b||e[58]!==z?(A=s.jsx(b,{children:z}),e[57]=b,e[58]=z,e[59]=A):A=e[59];let y;e[60]!==p||e[61]!==A||e[62]!==D||e[63]!==v?(y=s.jsx(p,{size:D,className:v,children:A}),e[60]=p,e[61]=A,e[62]=D,e[63]=v,e[64]=y):y=e[64];let K;if(e[65]!==a||e[66]!==o){let _;e[68]!==a?(_=c=>{const h=a.get(c.role)??"bg-neutral-400";return s.jsx(ft,{value:c.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ke("size-3 rounded-full",h)}),s.jsx("span",{className:"capitalize",children:c.label})]})},c.role)},e[68]=a,e[69]=_):_=e[69],K=o.map(_),e[65]=a,e[66]=o,e[67]=K}else K=e[67];let w;e[70]!==K?(w=s.jsx(pt,{children:K}),e[70]=K,e[71]=w):w=e[71];let k;return e[72]!==I||e[73]!==y||e[74]!==w||e[75]!==$||e[76]!==C||e[77]!==E?(k=s.jsxs(I,{value:$,onValueChange:C,disabled:E,children:[y,w]}),e[72]=I,e[73]=y,e[74]=w,e[75]=$,e[76]=C,e[77]=E,e[78]=k):k=e[78],k}function jt(t){const e=Q.c(51),{member:n,roles:l,onChangeRole:i,onRemove:a,isUpdating:o}=t,r=o===void 0?!1:o,u=n.role==="owner";let f,g,b,p,I,M,j,D,v;if(e[0]!==u||e[1]!==r||e[2]!==n.id||e[3]!==n.role||e[4]!==i||e[5]!==l){let y;e[15]!==n.role?(y=c=>c.role!==n.role&&c.role!=="owner",e[15]=n.role,e[16]=y):y=e[16];const K=l.filter(y);p=St;let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(_t,{size:20}),e[17]=w):w=e[17],e[18]!==u?(v=s.jsx(Nt,{asChild:!0,children:s.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:u,onClick:Ts,children:w})}),e[18]=u,e[19]=v):v=e[19],b=wt,j="end",D=_s,g=Qt;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Xt,{size:16}),e[20]=k):k=e[20],e[21]!==r?(M=s.jsxs(Jt,{disabled:r,children:[k,"Change Role"]}),e[21]=r,e[22]=M):M=e[22],f=Ht;let _;e[23]!==r||e[24]!==n.id||e[25]!==i?(_=c=>{const h=[];return c.isBuiltin||(c.allowsAllStaticPermissions?h.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&h.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?h.push("All connections"):c.connectionCount&&c.connectionCount>0&&h.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?h.push("all tools"):c.toolCount&&c.toolCount>0&&h.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsxs(et,{onClick:L=>{L.stopPropagation(),i(n.id,c.role)},disabled:r,children:[c.isBuiltin?s.jsx(Zt,{size:16}):s.jsx(Yt,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&h.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:h.join(", ")})]})]},c.role)},e[23]=r,e[24]=n.id,e[25]=i,e[26]=_):_=e[26],I=K.map(_),e[0]=u,e[1]=r,e[2]=n.id,e[3]=n.role,e[4]=i,e[5]=l,e[6]=f,e[7]=g,e[8]=b,e[9]=p,e[10]=I,e[11]=M,e[12]=j,e[13]=D,e[14]=v}else f=e[6],g=e[7],b=e[8],p=e[9],I=e[10],M=e[11],j=e[12],D=e[13],v=e[14];let $;e[27]!==f||e[28]!==I?($=s.jsx(f,{children:I}),e[27]=f,e[28]=I,e[29]=$):$=e[29];let C;e[30]!==g||e[31]!==M||e[32]!==$?(C=s.jsxs(g,{children:[M,$]}),e[30]=g,e[31]=M,e[32]=$,e[33]=C):C=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Wt,{}),e[34]=E):E=e[34];let N;e[35]!==n.id||e[36]!==a?(N=y=>{y.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=N):N=e[37];let R;e[38]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(es,{size:16}),e[38]=R):R=e[38];let S;e[39]!==N?(S=s.jsxs(et,{variant:"destructive",onClick:N,children:[R,"Remove Member"]}),e[39]=N,e[40]=S):S=e[40];let z;e[41]!==b||e[42]!==S||e[43]!==j||e[44]!==D||e[45]!==C?(z=s.jsxs(b,{align:j,onClick:D,children:[C,E,S]}),e[41]=b,e[42]=S,e[43]=j,e[44]=D,e[45]=C,e[46]=z):z=e[46];let A;return e[47]!==p||e[48]!==z||e[49]!==v?(A=s.jsxs(p,{children:[v,z]}),e[47]=p,e[48]=z,e[49]=v,e[50]=A):A=e[50],A}function _s(t){return t.stopPropagation()}function Ts(t){return t.stopPropagation()}function vt(t){const e=Q.c(8),{invitationId:n,onCancel:l,isCancelling:i}=t,a=i===void 0?!1:i;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Nt,{asChild:!0,children:s.jsx(ze,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:As,children:s.jsx(_t,{size:20})})}),e[0]=o):o=e[0];let r;e[1]!==n||e[2]!==l?(r=g=>{g.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=r):r=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Tt,{size:16}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==r?(f=s.jsxs(St,{children:[o,s.jsx(wt,{align:"end",onClick:Is,children:s.jsxs(et,{variant:"destructive",onClick:r,disabled:a,children:[u,"Cancel Invitation"]})})]}),e[5]=a,e[6]=r,e[7]=f):f=e[7],f}function Is(t){return t.stopPropagation()}function As(t){return t.stopPropagation()}function Ms(){const t=Q.c(103),{data:e}=Ft(),{data:n}=us(),l=fs(),i=Ve(),{locator:a}=pe(),o=yt(),[r,u]=re.useState(null),[f,g]=re.useState(null),[b,p]=re.useState(""),[I,M]=re.useState("table"),[j,D]=re.useState("member"),[v,$]=re.useState("asc"),C=e?.data?.members;let E;t[0]!==j?(E=m=>{j===m?$(Fs):(D(m),$("asc"))},t[0]=j,t[1]=E):E=t[1];const N=E;let R=C??[],S=n??[];if(b){const m=b.toLowerCase();R=R.filter(d=>d.user?.name?.toLowerCase().includes(m)||d.user?.email?.toLowerCase().includes(m)||d.role?.toLowerCase().includes(m)),S=S.filter(d=>d.email?.toLowerCase().includes(m)||d.role?.toLowerCase().includes(m))}if(j&&v){let m;t[2]!==v||t[3]!==j?(m=(d,T)=>{let B,de;e:switch(j){case"member":{B=d.user?.name||"",de=T.user?.name||"";break e}case"role":{B=d.role||"",de=T.role||"";break e}case"joined":{B=d.createdAt?typeof d.createdAt=="string"?d.createdAt:d.createdAt.toISOString():"",de=T.createdAt?typeof T.createdAt=="string"?T.createdAt:T.createdAt.toISOString():"";break e}default:return 0}return v==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=v,t[3]=j,t[4]=m):m=t[4],R=[...R].sort(m)}const z=R;let A;t[5]!==o?(A=async m=>{const d=await o.organization.removeMember({memberIdOrEmail:m});if(d?.error)throw new Error(d.error.message)},t[5]=o,t[6]=A):A=t[6];let y;t[7]!==a||t[8]!==i?(y=()=>{Re("member_removed"),i.invalidateQueries({queryKey:ce.members(a)}),oe.success("Member has been removed from the organization"),u(null)},t[7]=a,t[8]=i,t[9]=y):y=t[9];let K;t[10]!==A||t[11]!==y?(K={mutationFn:A,onSuccess:y,onError:Ls},t[10]=A,t[11]=y,t[12]=K):K=t[12];const w=Me(K);let k;t[13]!==o?(k=async m=>{const{memberId:d,role:T}=m,B=await o.organization.updateMemberRole({memberId:d,role:[T]});if(B?.error)throw new Error(B.error.message)},t[13]=o,t[14]=k):k=t[14];let _;t[15]!==a||t[16]!==i?(_=(m,d)=>{Re("member_role_updated",{new_role:d.role}),i.invalidateQueries({queryKey:ce.members(a)}),oe.success("Member's role has been updated")},t[15]=a,t[16]=i,t[17]=_):_=t[17];let c;t[18]!==k||t[19]!==_?(c={mutationFn:k,onSuccess:_,onError:qs},t[18]=k,t[19]=_,t[20]=c):c=t[20];const h=Me(c);let L;t[21]!==o?(L=async m=>{const{invitationId:d,role:T,email:B}=m,de=await o.organization.cancelInvitation({invitationId:d});if(de?.error)throw new Error(de.error.message);const tt=await o.organization.inviteMember({email:B,role:T});if(tt?.error)throw new Error(tt.error.message)},t[21]=o,t[22]=L):L=t[22];let P;t[23]!==a||t[24]!==i?(P=(m,d)=>{Re("invitation_role_updated",{new_role:d.role}),i.invalidateQueries({queryKey:ce.invitations(a)}),oe.success("Invitation role has been updated")},t[23]=a,t[24]=i,t[25]=P):P=t[25];let O;t[26]!==L||t[27]!==P?(O={mutationFn:L,onSuccess:P,onError:Os},t[26]=L,t[27]=P,t[28]=O):O=t[28];const U=Me(O),{roles:q,customRoles:V}=Bt();let F;t[29]!==V?(F=Ns(V),t[29]=V,t[30]=F):F=t[30];const G=F;let J;t[31]!==q?(J=q.filter($s),t[31]=q,t[32]=J):J=t[32];const H=J;let W;t[33]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:Ds,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=W):W=t[33];let ne;t[34]!==G||t[35]!==H||t[36]!==U||t[37]!==h?(ne={id:"role",header:"Role",render:m=>m.type==="member"?s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:m.data.role==="owner",roleColorMap:G,selectableRoles:H,onRoleChange:(d,T)=>h.mutate({memberId:d,role:T}),className:"w-36"}):s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:!1,roleColorMap:G,selectableRoles:H,onRoleChange:(d,T)=>U.mutate({invitationId:d,role:T,email:m.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=G,t[35]=H,t[36]=U,t[37]=h,t[38]=ne):ne=t[38];let he,Y;t[39]===Symbol.for("react.memo_cache_sentinel")?(he={id:"tags",header:"Tags",render:ks,cellClassName:"w-40 shrink-0"},Y={id:"joined",header:"Joined",render:Es,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=he,t[40]=Y):(he=t[39],Y=t[40]);let ie;t[41]!==l.cancel.isPending||t[42]!==q||t[43]!==h?(ie={id:"actions",header:"",render:m=>m.type==="member"?s.jsx(jt,{member:m.data,roles:q,onChangeRole:(d,T)=>h.mutate({memberId:d,role:T}),onRemove:u,isUpdating:h.isPending}):s.jsx(vt,{invitationId:m.data.id,onCancel:g,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=q,t[43]=h,t[44]=ie):ie=t[44];let me;t[45]!==ne||t[46]!==ie?(me=[W,ne,he,Y,ie],t[45]=ne,t[46]=ie,t[47]=me):me=t[47];const Pe=me;let ge;t[48]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(kt,{trigger:s.jsx(ze,{children:"Invite Member"})})}),t[48]=ge):ge=t[48];const Ee=ge,ue=[...z.map(Ps),...S.filter(zs).map(Rs)],ae=Ae,le=!!f;let Z;t[49]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>g(null),t[49]=Z):Z=t[49];let X;t[50]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs(at,{children:[s.jsx(lt,{children:"Cancel Invitation"}),s.jsx(ot,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=X):X=t[50];let ee;t[51]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(rt,{children:"Keep Invitation"}),t[51]=ee):ee=t[51];let te;t[52]!==l.cancel||t[53]!==f?(te=()=>{f&&(l.cancel.mutate(f),g(null))},t[52]=l.cancel,t[53]=f,t[54]=te):te=t[54];let x;t[55]!==l.cancel.isPending||t[56]!==te?(x=s.jsxs(st,{children:[X,s.jsxs(nt,{children:[ee,s.jsx(it,{onClick:te,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=te,t[57]=x):x=t[57];let se;t[58]!==le||t[59]!==x?(se=s.jsx(ct,{open:le,onOpenChange:Z,children:x}),t[58]=le,t[59]=x,t[60]=se):se=t[60];const fe=!!r;let xe;t[61]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>u(null),t[61]=xe):xe=t[61];let Oe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsxs(at,{children:[s.jsx(lt,{children:"Remove Member"}),s.jsx(ot,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Oe):Oe=t[62];let qe;t[63]===Symbol.for("react.memo_cache_sentinel")?(qe=s.jsx(rt,{children:"Cancel"}),t[63]=qe):qe=t[63];let be;t[64]!==r||t[65]!==w?(be=()=>r&&w.mutate(r),t[64]=r,t[65]=w,t[66]=be):be=t[66];let je;t[67]!==w.isPending||t[68]!==be?(je=s.jsxs(st,{children:[Oe,s.jsxs(nt,{children:[qe,s.jsx(it,{onClick:be,disabled:w.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=w.isPending,t[68]=be,t[69]=je):je=t[69];let ve;t[70]!==fe||t[71]!==je?(ve=s.jsx(ct,{open:fe,onOpenChange:xe,children:je}),t[70]=fe,t[71]=je,t[72]=ve):ve=t[72];const Qe=Ae,Je=Ae,At="flex flex-col gap-6";let Ce,ye;t[73]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(ds,{}),ye=s.jsx(Ae.Title,{children:"Members"}),t[73]=Ce,t[74]=ye):(Ce=t[73],ye=t[74]);let Le;t[75]===Symbol.for("react.memo_cache_sentinel")?(Le=m=>{m.key==="Escape"&&(p(""),m.target.blur())},t[75]=Le):Le=t[75];let Se;t[76]!==b?(Se=s.jsx(Pt,{value:b,onChange:p,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Le}),t[76]=b,t[77]=Se):Se=t[77];let Fe;t[78]===Symbol.for("react.memo_cache_sentinel")?(Fe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[78]=Fe):Fe=t[78];let Ne;t[79]!==N||t[80]!==v||t[81]!==j||t[82]!==I?(Ne=s.jsx(zt,{viewMode:I,onViewModeChange:M,sortKey:j,sortDirection:v,onSort:N,sortOptions:Fe}),t[79]=N,t[80]=v,t[81]=j,t[82]=I,t[83]=Ne):Ne=t[83];let we;t[84]!==Se||t[85]!==Ne?(we=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Se,Ne]}),Ee]}),t[84]=Se,t[85]=Ne,t[86]=we):we=t[86];const He=I==="cards"?s.jsx("div",{children:ue.length===0?s.jsx(We,{title:"No members found",description:b?`No members match "${b}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:ue.map(m=>{if(m.type==="invitation")return s.jsxs(mt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(vt,{invitationId:m.data.id,onCancel:g,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{fallback:Ue(m.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:m.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ge,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ke,{role:m.data.role,memberId:m.data.id,isOwner:!1,roleColorMap:G,selectableRoles:H,onRoleChange:(T,B)=>U.mutate({invitationId:T,role:B,email:m.data.email}),className:"w-fit"})]})]})]},`inv-${m.data.id}`);const d=m.data;return s.jsxs(mt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(jt,{member:d,roles:q,onChangeRole:(T,B)=>h.mutate({memberId:T,role:B}),onRemove:u,isUpdating:h.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(De,{url:d.user?.image??void 0,fallback:Ue(d.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:d.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:d.user?.email}),s.jsx(Ke,{role:d.role,memberId:d.id,isOwner:d.role==="owner",roleColorMap:G,selectableRoles:H,onRoleChange:(T,B)=>h.mutate({memberId:T,role:B}),className:"w-fit"}),s.jsx(It,{memberId:d.id,maxDisplay:3})]})]})]},d.id)})})}):s.jsx(Et,{columns:Pe,data:ue,isLoading:!1,sortKey:j,sortDirection:v,onSort:N,emptyState:b?s.jsx(We,{title:"No members found",description:`No members match "${b}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let _e;t[87]!==Ce||t[88]!==ye||t[89]!==we||t[90]!==He?(_e=s.jsxs("div",{className:At,children:[Ce,ye,we,He]}),t[87]=Ce,t[88]=ye,t[89]=we,t[90]=He,t[91]=_e):_e=t[91];let Te;t[92]!==Je.Body||t[93]!==_e?(Te=s.jsx(Je.Body,{children:_e}),t[92]=Je.Body,t[93]=_e,t[94]=Te):Te=t[94];let Ie;t[95]!==Qe.Content||t[96]!==Te?(Ie=s.jsx(Qe.Content,{children:Te}),t[95]=Qe.Content,t[96]=Te,t[97]=Ie):Ie=t[97];let Be;return t[98]!==ae||t[99]!==se||t[100]!==ve||t[101]!==Ie?(Be=s.jsxs(ae,{children:[se,ve,Ie]}),t[98]=ae,t[99]=se,t[100]=ve,t[101]=Ie,t[102]=Be):Be=t[102],Be}function Rs(t){return{type:"invitation",data:t}}function zs(t){return t.status==="pending"}function Ps(t){return{type:"member",data:t}}function Es(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?ws(t.data.createdAt):"N/A"}):s.jsx(Ge,{variant:"outline",children:"Pending"})}function ks(t){return t.type==="member"?s.jsx(It,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Ds(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{url:t.data.user?.image??void 0,fallback:Ue(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(De,{fallback:Ue(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function $s(t){return t.role!=="owner"}function Os(t,e){Re("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to update invitation role")}function qs(t,e){Re("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to update role")}function Ls(t){Re("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),oe.error(t instanceof Error?t.message:"Failed to remove member")}function Fs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Bs(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Rt,{fallback:e,children:s.jsx(re.Suspense,{fallback:s.jsx(Ae,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Ms,{})})}),t[1]=n):n=t[1],n}function Bn(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ms,{capability:"members:manage",area:"members",children:s.jsx(Bs,{})}),t[0]=e):e=t[0],e}export{Bn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as it,r as E,j as e,i as rt}from"./index-DgNLMhiy.js";import{S as mt,b as pt,c as st,d as at}from"./sheet-B3x8ZiS-.js";import{S as nt}from"./scroll-area-DVEw9jTn.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-DmWg08s4.js";import{v as xt}from"./index-DSNOu07Q.js";import"./X-CAjmVwOR.js";import"./agent-icon-HIFEO6vs.js";import"./AlertCircle-DrgnpYmf.js";import"./Tool01-BUi-a5a2.js";import"./SwitchHorizontal01-DTag6ZGf.js";import"./Settings02-B0ZT4yzH.js";import"./XCircle-D3nhMqns.js";import"./ArrowUpRight-CEF-CsVj.js";import"./ZapSquare-BDUSHcAn.js";import"./Users03-Cw_16vbZ.js";import"./CheckCircle-xbzaC4iQ.js";import"./ChevronUp-C2DYINXH.js";import"./ChevronDown-DDeoixaJ.js";import"./ChevronRight-Cc93D1fP.js";import"./DotsVertical-CB1RTV9h.js";import"./Stars02-CgeR-sX4.js";import"./Eye-DHiUyPMS.js";import"./ZoomOut-BN-KB_0J.js";import"./Globe01-y8c9C4nH.js";import"./FilterLines-C174NPGB.js";import"./Star01-BwzFDtQr.js";import"./Globe04-v8yJBvO0.js";import"./HardDrive-vkw_bVtH.js";import"./Key01-8wUzNiiB.js";import"./LayoutLeft-DFSfhhoN.js";import"./LinkExternal01-CPcvHi4V.js";import"./Monitor01-DQ9B5dBT.js";import"./Sun-vVeG2mZ0.js";import"./Palette-BP0gnn-x.js";import"./Play-6woe_bCf.js";import"./Plus-sSvDtP2D.js";import"./SearchLg-BHGwQ11F.js";import"./SearchMd-DcwBMfFO.js";import"./Shield01-16ivhP9D.js";import"./Stars01-D_GgsBTV.js";import"./Trash01-YsCUBRvj.js";import"./Upload01-CTPdQzyc.js";import"./User01-C4JQrjGt.js";import"./Users01-TIl6xBro.js";import"./XClose-B93vthJT.js";import"./Zap-8CUqVoBU.js";import"./use-clock-tick-D7gbCPid.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ClKjk1Nz.js";import"./tooltip-B3h8W9fM.js";import"./file-type-icon-DALXnNwz.js";import"./dialog-D_ieAQTy.js";import"./use-mobile-CTYLPqKT.js";import"./tab-id-CLpu897Q.js";import"./content-blocks-o63cs2vh.js";import"./types-H_rr3OSP.js";import"./use-mcp-client-C62ZsAPE.js";import"./auth-CxjVr2Fw.js";import"./chat-context-OmrHZlWm.js";import"./hooks-ChlRS_Cr.js";import"./decopilot-sse-pool-BdE-V58A.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-D_g2q7bN.js";import"./use-collections-Bb5vIdWQ.js";import"./use-ai-providers-lTSdzFgc.js";import"./studio-tools-kXfq3pN5.js";import"./use-decopilot-events-CkQ3Rugh.js";import"./use-organization-settings-Dys1xzl0.js";import"./shell-layout-CSNtx2tN.js";import"./avatar-BAkTMYHj.js";import"./alert-dialog-ClCDLHyi.js";import"./required-auth-layout-B1_k8uZH.js";import"./use-org-sso-nbZu8iS1.js";import"./integration-icon-DvmR_kCi.js";import"./use-navigate-to-agent-ZLpx01PW.js";import"./use-connection-C0zEwTpO.js";import"./use-mcp-prompts-F7AgPwEV.js";import"./form-DaxgojJl.js";import"./label-CyPUYQaT.js";import"./input-CjQtu1h5.js";import"./select-bneCBMXH.js";import"./switch-BL5aJnqG.js";import"./library-tab-CrasAutb.js";import"./drawer-BP70Rujn.js";import"./collection-search-BHP0uS8b.js";import"./tabs-Dh_kZG_m.js";import"./toggle-group-oUYd1Jxm.js";import"./agent-capabilities-BLdjNi42.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-MLfvU4EZ.js";import"./use-registry-connections-By0sWOC0.js";import"./useInfiniteQuery-YzbBhr0w.js";import"./use-infinite-scroll-DqqX0EF_.js";import"./extract-connection-data-RxV5HgFK.js";import"./card-9jdGQNnr.js";import"./collection-tabs-CvLerKx4.js";import"./badge-CxIGH9s7.js";import"./textarea-D5nE7rMP.js";import"./connection-form-helpers-oKSRt7Z9.js";import"./authenticate-and-persist-oauth-CZ-MLzKy.js";import"./mcp-oauth-Cjq6PMkC.js";import"./useSuspenseInfiniteQuery-Cgpvcam3.js";import"./connect-desktop-dialog-3SiI_mFd.js";import"./decopilot-xPgbGeJc.js";import"./checkbox-DnPlj3-W.js";import"./skeleton-C5L5O22N.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CTfa0pnb.js";import"./popover-Dk6C_xyw.js";import"./command-D9kK6qBS.js";import"./index-yloThw-p.js";import"./index-Bo5LvjuQ.js";import"./toolbar-BSesNl59.js";import"./use-debounced-value-BCxrmAGw.js";import"./dropdown-menu-Ctb60TB7.js";import"./index-CYTkc5bj.js";import"./question-004-sINsf4GQ.js";import"./task-row-LdEr6awi.js";import"./task-status-DNIO7fCq.js";import"./use-status-sounds-Bl8mPZM3.js";import"./empty-state-BS7npFnj.js";import"./use-mcp-tools-UjXU5ids.js";import"./use-capability-Cgr7yHYD.js";import"./tools-list-JC_5uk0t.js";import"./use-debounced-autosave-CEbGGyRe.js";import"./index-CvxPzQfb.js";import"./sidebar-C8N0hRhw.js";import"./search-input-Cw7dukB_.js";import"./github-repo-picker-CZI-ClVg.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-CIN5lIiD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-Da4GFxZS.js";import"./automation-runs-LATF_NNh.js";import"./table-77ubNeic.js";import"./use-members-B-1xXj0d.js";import"./use-org-auth-client-NLz6RBvg.js";import"./use-automations-1J-hXDhd.js";import"./use-file-configs-CxoqQtr4.js";import"./monaco-editor-kdhsccRw.js";import"./select-model-1JGm9WVZ.js";import"./automation-list-row-B57SiMbH.js";function ri(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{ri as SeoSheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as H,j as t,B as Z}from"./index-DgNLMhiy.js";import{n as ee}from"./LinkExternal01-CPcvHi4V.js";import{aE as te,t as oe}from"./agent-icon-HIFEO6vs.js";import{I as J}from"./input-CjQtu1h5.js";import{L as G}from"./label-CyPUYQaT.js";import{M as ie}from"./automation-runs-LATF_NNh.js";import{T as Q,a as se,b as W,c as le}from"./tabs-Dh_kZG_m.js";import{T as re}from"./textarea-D5nE7rMP.js";import{au as ae,av as me,at as pe,aw as ne,ax as ce,ay as de,az as fe}from"./index-DSNOu07Q.js";import{b as ue,a as xe,B as he}from"./block-document-sOmo01vI.js";import{u as ge,s as F,E as ve,R as ye,A as je}from"./primitives-D3eMc46F.js";import"./AlertCircle-DrgnpYmf.js";import"./Tool01-BUi-a5a2.js";import"./SwitchHorizontal01-DTag6ZGf.js";import"./Settings02-B0ZT4yzH.js";import"./XCircle-D3nhMqns.js";import"./ArrowUpRight-CEF-CsVj.js";import"./ZapSquare-BDUSHcAn.js";import"./Users03-Cw_16vbZ.js";import"./CheckCircle-xbzaC4iQ.js";import"./ChevronUp-C2DYINXH.js";import"./ChevronDown-DDeoixaJ.js";import"./ChevronRight-Cc93D1fP.js";import"./DotsVertical-CB1RTV9h.js";import"./Stars02-CgeR-sX4.js";import"./Eye-DHiUyPMS.js";import"./ZoomOut-BN-KB_0J.js";import"./Globe01-y8c9C4nH.js";import"./FilterLines-C174NPGB.js";import"./Star01-BwzFDtQr.js";import"./Globe04-v8yJBvO0.js";import"./HardDrive-vkw_bVtH.js";import"./Key01-8wUzNiiB.js";import"./LayoutLeft-DFSfhhoN.js";import"./Monitor01-DQ9B5dBT.js";import"./Sun-vVeG2mZ0.js";import"./Palette-BP0gnn-x.js";import"./Play-6woe_bCf.js";import"./Plus-sSvDtP2D.js";import"./SearchLg-BHGwQ11F.js";import"./SearchMd-DcwBMfFO.js";import"./Shield01-16ivhP9D.js";import"./Stars01-D_GgsBTV.js";import"./Trash01-YsCUBRvj.js";import"./Upload01-CTPdQzyc.js";import"./User01-C4JQrjGt.js";import"./Users01-TIl6xBro.js";import"./XClose-B93vthJT.js";import"./X-CAjmVwOR.js";import"./Zap-8CUqVoBU.js";import"./useInfiniteQuery-YzbBhr0w.js";import"./use-infinite-scroll-DqqX0EF_.js";import"./use-connection-C0zEwTpO.js";import"./use-collections-Bb5vIdWQ.js";import"./use-mcp-client-C62ZsAPE.js";import"./auth-CxjVr2Fw.js";import"./use-virtual-mcp-D_g2q7bN.js";import"./card-9jdGQNnr.js";import"./sheet-B3x8ZiS-.js";import"./table-77ubNeic.js";import"./empty-state-BS7npFnj.js";import"./use-members-B-1xXj0d.js";import"./use-org-auth-client-NLz6RBvg.js";import"./task-status-DNIO7fCq.js";import"./use-automations-1J-hXDhd.js";import"./studio-tools-kXfq3pN5.js";import"./useSuspenseInfiniteQuery-Cgpvcam3.js";import"./badge-CxIGH9s7.js";import"./select-bneCBMXH.js";import"./tooltip-B3h8W9fM.js";import"./checkbox-DnPlj3-W.js";import"./command-D9kK6qBS.js";import"./index-yloThw-p.js";import"./dialog-D_ieAQTy.js";import"./popover-Dk6C_xyw.js";import"./avatar-BAkTMYHj.js";import"./scroll-area-DVEw9jTn.js";import"./use-clock-tick-D7gbCPid.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ClKjk1Nz.js";import"./file-type-icon-DALXnNwz.js";import"./use-mobile-CTYLPqKT.js";import"./tab-id-CLpu897Q.js";import"./content-blocks-o63cs2vh.js";import"./types-H_rr3OSP.js";import"./chat-context-OmrHZlWm.js";import"./hooks-ChlRS_Cr.js";import"./decopilot-sse-pool-BdE-V58A.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-lTSdzFgc.js";import"./use-decopilot-events-CkQ3Rugh.js";import"./use-organization-settings-Dys1xzl0.js";import"./shell-layout-CSNtx2tN.js";import"./alert-dialog-ClCDLHyi.js";import"./required-auth-layout-B1_k8uZH.js";import"./use-org-sso-nbZu8iS1.js";import"./integration-icon-DvmR_kCi.js";import"./use-navigate-to-agent-ZLpx01PW.js";import"./use-mcp-prompts-F7AgPwEV.js";import"./form-DaxgojJl.js";import"./library-tab-CrasAutb.js";import"./drawer-BP70Rujn.js";import"./collection-search-BHP0uS8b.js";import"./toggle-group-oUYd1Jxm.js";import"./agent-capabilities-BLdjNi42.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-MLfvU4EZ.js";import"./use-registry-connections-By0sWOC0.js";import"./extract-connection-data-RxV5HgFK.js";import"./collection-tabs-CvLerKx4.js";import"./connection-form-helpers-oKSRt7Z9.js";import"./authenticate-and-persist-oauth-CZ-MLzKy.js";import"./mcp-oauth-Cjq6PMkC.js";import"./connect-desktop-dialog-3SiI_mFd.js";import"./decopilot-xPgbGeJc.js";import"./skeleton-C5L5O22N.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CTfa0pnb.js";import"./index-Bo5LvjuQ.js";import"./toolbar-BSesNl59.js";import"./use-debounced-value-BCxrmAGw.js";import"./dropdown-menu-Ctb60TB7.js";import"./index-CYTkc5bj.js";import"./question-004-sINsf4GQ.js";import"./task-row-LdEr6awi.js";import"./use-status-sounds-Bl8mPZM3.js";import"./use-mcp-tools-UjXU5ids.js";import"./use-capability-Cgr7yHYD.js";import"./tools-list-JC_5uk0t.js";import"./switch-BL5aJnqG.js";import"./use-debounced-autosave-CEbGGyRe.js";import"./index-CvxPzQfb.js";import"./sidebar-C8N0hRhw.js";import"./search-input-Cw7dukB_.js";import"./github-repo-picker-CZI-ClVg.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-CIN5lIiD.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-Da4GFxZS.js";import"./use-file-configs-CxoqQtr4.js";import"./monaco-editor-kdhsccRw.js";import"./select-model-1JGm9WVZ.js";import"./automation-list-row-B57SiMbH.js";function be(A){return Array.isArray(A)?A.map(e=>({key:F(e?.key),value:F(e?.value)})):[]}function ai(A){const e=H.c(66),{orgSlug:i,virtualMcpId:d,branch:o,blockKey:l,block:p,decofile:m,meta:u,previewBaseUrl:x}=A;let y;e[0]!==o||e[1]!==i||e[2]!==d?(y={orgSlug:i,virtualMcpId:d,branch:o},e[0]=o,e[1]=i,e[2]=d,e[3]=y):y=e[3];const s=ae(y);let n;e[4]!==p?(n=me(p,"posts"),e[4]=p,e[5]=n):n=e[5];const j=n;let b;e[6]!==l||e[7]!==s?(b=T=>{s.mutate({blockKey:l,data:ne(l,"posts",T)})},e[6]=l,e[7]=s,e[8]=b):b=e[8];const[r,_]=ge(j,b);let C;e[9]!==r||e[10]!==_?(C=(T,Y)=>_({...r,[T]:Y}),e[9]=r,e[10]=_,e[11]=C):C=e[11];const h=C;let S;e[12]!==m||e[13]!==r||e[14]!==x?(S=ue({decofile:m,post:r,previewBaseUrl:x}),e[12]=m,e[13]=r,e[14]=x,e[15]=S):S=e[15];const f=S;let a;e[16]!==r.title?(a=F(r.title)||"Untitled post",e[16]=r.title,e[17]=a):a=e[17];let c;e[18]!==a?(c=t.jsx("span",{className:"truncate text-sm font-medium",children:a}),e[18]=a,e[19]=c):c=e[19];let g;e[20]!==s.isError||e[21]!==s.isPending?(g=t.jsx(pe,{isPending:s.isPending,isError:s.isError}),e[20]=s.isError,e[21]=s.isPending,e[22]=g):g=e[22];const k=!f,P=f?"Open the post preview in a new tab":"Set the post slug (and its category) plus the blog app's pageSlug to preview";let N;e[23]!==f?(N=()=>{f&&window.open(f,"_blank","noopener,noreferrer")},e[23]=f,e[24]=N):N=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(ee,{size:14}),e[25]=B):B=e[25];let w;e[26]!==P||e[27]!==N||e[28]!==k?(w=t.jsxs(Z,{type:"button",variant:"outline",size:"sm",disabled:k,title:P,onClick:N,children:[B,"See preview"]}),e[26]=P,e[27]=N,e[28]=k,e[29]=w):w=e[29];let E;e[30]!==w||e[31]!==g?(E=t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[g,w]}),e[30]=w,e[31]=g,e[32]=E):E=e[32];let v;e[33]!==E||e[34]!==c?(v=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,E]}),e[33]=E,e[34]=c,e[35]=v):v=e[35];let L;e[36]!==r.title?(L=F(r.title),e[36]=r.title,e[37]=L):L=e[37];let R;e[38]!==h?(R=T=>h("title",T),e[38]=h,e[39]=R):R=e[39];let U;e[40]!==L||e[41]!==R?(U=t.jsx(ve,{value:L,onChange:R,placeholder:"Post title",className:"py-1 text-4xl font-bold text-foreground"}),e[40]=L,e[41]=R,e[42]=U):U=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Q,{value:"content",children:[t.jsx(te,{}),"Content"]}),e[43]=O):O=e[43];let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(se,{children:[O,t.jsxs(Q,{value:"settings",children:[t.jsx(oe,{}),"Settings"]})]}),e[44]=K):K=e[44];let $;e[45]!==r.sections?($=xe(r.sections),e[45]=r.sections,e[46]=$):$=e[46];let I;e[47]!==h?(I=T=>h("sections",T),e[47]=h,e[48]=I):I=e[48];let M;e[49]!==u||e[50]!==$||e[51]!==I?(M=t.jsx(W,{value:"content",children:t.jsx("div",{className:"rounded-xl border bg-card p-8 shadow-sm",children:t.jsx(he,{value:$,onChange:I,meta:u,emptyMessage:"This post has no content yet. Use ⊕ to add your first block."})})}),e[49]=u,e[50]=$,e[51]=I,e[52]=M):M=e[52];let z;e[53]!==m||e[54]!==r||e[55]!==h?(z=t.jsx(W,{value:"settings",children:t.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t.jsx(Ce,{post:r,decofile:m,onChange:h})})}),e[53]=m,e[54]=r,e[55]=h,e[56]=z):z=e[56];let D;e[57]!==M||e[58]!==z?(D=t.jsxs(le,{defaultValue:"content",className:"mt-6 gap-4",children:[K,M,z]}),e[57]=M,e[58]=z,e[59]=D):D=e[59];let V;e[60]!==U||e[61]!==D?(V=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[U,D]})}),e[60]=U,e[61]=D,e[62]=V):V=e[62];let q;return e[63]!==v||e[64]!==V?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[v,V]}),e[63]=v,e[64]=V,e[65]=q):q=e[65],q}function Ce(A){const e=H.c(59),{post:i,decofile:d,onChange:o}=A;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(G,{htmlFor:"post-excerpt",children:"Excerpt"}),e[0]=l):l=e[0];let p;e[1]!==i.excerpt?(p=F(i.excerpt),e[1]=i.excerpt,e[2]=p):p=e[2];let m;e[3]!==o?(m=v=>o("excerpt",v.target.value),e[3]=o,e[4]=m):m=e[4];let u;e[5]!==p||e[6]!==m?(u=t.jsxs("div",{className:"space-y-2",children:[l,t.jsx(re,{id:"post-excerpt",value:p,onChange:m,rows:2})]}),e[5]=p,e[6]=m,e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(G,{htmlFor:"post-slug",children:"Slug"}),e[8]=x):x=e[8];let y;e[9]!==i.slug?(y=F(i.slug),e[9]=i.slug,e[10]=y):y=e[10];let s;e[11]!==o?(s=v=>o("slug",v.target.value),e[11]=o,e[12]=s):s=e[12];let n;e[13]!==y||e[14]!==s?(n=t.jsxs("div",{className:"space-y-2",children:[x,t.jsx(J,{id:"post-slug",value:y,onChange:s,placeholder:"my-post",className:"h-10"})]}),e[13]=y,e[14]=s,e[15]=n):n=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={type:"string",format:"date",title:"Date"},e[16]=j):j=e[16];let b;e[17]!==i.date?(b=F(i.date),e[17]=i.date,e[18]=b):b=e[18];let r;e[19]!==o?(r=v=>o("date",v),e[19]=o,e[20]=r):r=e[20];let _;e[21]!==b||e[22]!==r?(_=t.jsx(fe,{schema:j,value:b,onChange:r,path:"post-date",label:"Date"}),e[21]=b,e[22]=r,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==n?(C=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n,_]}),e[24]=_,e[25]=n,e[26]=C):C=e[26];let h;e[27]===Symbol.for("react.memo_cache_sentinel")?(h={type:"string",format:"image-uri",title:"Cover image"},e[27]=h):h=e[27];let S;e[28]!==o?(S=v=>o("image",v),e[28]=o,e[29]=S):S=e[29];let f;e[30]!==i.image||e[31]!==S?(f=t.jsx(ce,{schema:h,value:i.image,onChange:S,path:"post-image",label:"Cover image"}),e[30]=i.image,e[31]=S,e[32]=f):f=e[32];let a;e[33]===Symbol.for("react.memo_cache_sentinel")?(a=["email"],e[33]=a):a=e[33];let c;e[34]!==o?(c=v=>o("authors",v),e[34]=o,e[35]=c):c=e[35];let g;e[36]!==d||e[37]!==i.authors||e[38]!==c?(g=t.jsx(X,{label:"Authors",decofile:d,kind:"authors",valueField:"email",extraFields:a,selected:i.authors,onChange:c}),e[36]=d,e[37]=i.authors,e[38]=c,e[39]=g):g=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=["slug"],e[40]=k):k=e[40];let P;e[41]!==o?(P=v=>o("categories",v),e[41]=o,e[42]=P):P=e[42];let N;e[43]!==d||e[44]!==i.categories||e[45]!==P?(N=t.jsx(X,{label:"Categories",decofile:d,kind:"categories",valueField:"slug",extraFields:k,selected:i.categories,onChange:P}),e[43]=d,e[44]=i.categories,e[45]=P,e[46]=N):N=e[46];let B;e[47]!==o?(B=v=>o("extraProps",v),e[47]=o,e[48]=B):B=e[48];let w;e[49]!==i.extraProps||e[50]!==B?(w=t.jsx(ke,{value:i.extraProps,onChange:B}),e[49]=i.extraProps,e[50]=B,e[51]=w):w=e[51];let E;return e[52]!==C||e[53]!==f||e[54]!==g||e[55]!==N||e[56]!==w||e[57]!==u?(E=t.jsxs("div",{className:"space-y-5",children:[u,C,f,g,N,w]}),e[52]=C,e[53]=f,e[54]=g,e[55]=N,e[56]=w,e[57]=u,e[58]=E):E=e[58],E}function ke(A){const e=H.c(15),{value:i,onChange:d}=A;let o,l,p,m;if(e[0]!==d||e[1]!==i){o=be(i);const y=(s,n)=>d(o.map((j,b)=>b===s?{...j,...n}:j));l="space-y-2",e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(G,{children:"Extra props"}),e[6]=p):p=e[6],m=o.length>0&&t.jsx("ul",{className:"space-y-2",children:o.map((s,n)=>t.jsxs("li",{className:"group/item flex items-center gap-2",children:[t.jsx(J,{value:s.key,onChange:j=>y(n,{key:j.target.value}),placeholder:"key",className:"h-9 flex-1"}),t.jsx(J,{value:s.value,onChange:j=>y(n,{value:j.target.value}),placeholder:"value",className:"h-9 flex-1"}),t.jsx(ye,{label:"Remove prop",onClick:()=>d(o.filter((j,b)=>b!==n))})]},n))}),e[0]=d,e[1]=i,e[2]=o,e[3]=l,e[4]=p,e[5]=m}else o=e[2],l=e[3],p=e[4],m=e[5];let u;e[7]!==o||e[8]!==d?(u=t.jsx(je,{label:"Add prop",onClick:()=>d([...o,{key:"",value:""}])}),e[7]=o,e[8]=d,e[9]=u):u=e[9];let x;return e[10]!==l||e[11]!==p||e[12]!==m||e[13]!==u?(x=t.jsxs("div",{className:l,children:[p,m,u]}),e[10]=l,e[11]=p,e[12]=m,e[13]=u,e[14]=x):x=e[14],x}function X(A){const e=H.c(31),{label:i,decofile:d,kind:o,valueField:l,extraFields:p,selected:m,onChange:u}=A;let x,y,s;if(e[0]!==d||e[1]!==o||e[2]!==l){x=de(d,o);let f;e[6]!==l?(f=(c,g)=>F(c[l])||g,e[6]=l,e[7]=f):f=e[7],s=f;let a;e[8]!==s?(a=c=>{const{key:g,payload:k}=c;return{value:s(k,g),label:F(k.name)||s(k,g)}},e[8]=s,e[9]=a):a=e[9],y=x.map(a),e[0]=d,e[1]=o,e[2]=l,e[3]=x,e[4]=y,e[5]=s}else x=e[3],y=e[4],s=e[5];const n=y;let j;if(e[10]!==m||e[11]!==l){const f=Array.isArray(m)?m:[];let a;e[13]!==l?(a=c=>F(c[l]),e[13]=l,e[14]=a):a=e[14],j=f.map(a).filter(Boolean),e[10]=m,e[11]=l,e[12]=j}else j=e[12];const b=j;let r;e[15]!==p||e[16]!==u||e[17]!==x||e[18]!==l||e[19]!==s?(r=f=>{u(f.map(a=>{const c=x.find(k=>{const{key:P,payload:N}=k;return s(N,P)===a});if(!c)return{name:a,[l]:a};const g={name:F(c.payload.name)};for(const k of p)g[k]=c.payload[k]??a;return g}))},e[15]=p,e[16]=u,e[17]=x,e[18]=l,e[19]=s,e[20]=r):r=e[20];const _=r;let C;e[21]!==i?(C=t.jsx(G,{children:i}),e[21]=i,e[22]=C):C=e[22];let h;e[23]!==b||e[24]!==_||e[25]!==i||e[26]!==n?(h=n.length===0?t.jsxs("p",{className:"text-xs text-muted-foreground",children:["No ",i.toLowerCase()," yet — create some in the"," ",i.toLowerCase()," collection."]}):t.jsx(ie,{options:n,defaultValue:b,onValueChange:_,placeholder:`Select ${i.toLowerCase()}`,maxCount:4}),e[23]=b,e[24]=_,e[25]=i,e[26]=n,e[27]=h):h=e[27];let S;return e[28]!==C||e[29]!==h?(S=t.jsxs("div",{className:"space-y-2",children:[C,h]}),e[28]=C,e[29]=h,e[30]=S):S=e[30],S}export{ai as PostEditor};
|