decocms 3.3.2 → 3.4.1
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-f1EMyhcF.js → AlertCircle-Bc3r3AGq.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DDOS_CqL.js → ArrowUpRight-DfEIENBd.js} +1 -1
- package/dist/client/assets/{Check-CtI-OH3k.js → Check--VLhXi5l.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dk0E48Vj.js → CheckCircle-7xc6-R3M.js} +1 -1
- package/dist/client/assets/{ChevronDown-BL2fNdeZ.js → ChevronDown-66ErjaPf.js} +1 -1
- package/dist/client/assets/{ChevronLeft-ItYaMHNU.js → ChevronLeft-DyW6EtsM.js} +1 -1
- package/dist/client/assets/{ChevronRight-TMlXoq-Z.js → ChevronRight-C87PRbBa.js} +1 -1
- package/dist/client/assets/{ChevronUp-O10NbvHe.js → ChevronUp-BuPeXu8C.js} +1 -1
- package/dist/client/assets/{Container-B1sUXs1U.js → Container-cZo3l6OX.js} +1 -1
- package/dist/client/assets/{DotsVertical-DNPNHBpl.js → DotsVertical-CQgc8nSx.js} +1 -1
- package/dist/client/assets/{Eye-DWIY-6KS.js → Eye-DHHjYDbX.js} +1 -1
- package/dist/client/assets/{FilterLines-CWRo79Yt.js → FilterLines-CWR_eJ7z.js} +1 -1
- package/dist/client/assets/{Globe01-Cjaw-3jR.js → Globe01-B10jCcNH.js} +1 -1
- package/dist/client/assets/{HardDrive-Ddx5WtDi.js → HardDrive-7KMC69UH.js} +1 -1
- package/dist/client/assets/{Key01-ChvR9ujt.js → Key01-CTKRB2Cd.js} +1 -1
- package/dist/client/assets/LayoutLeft-SQH1HcmI.js +1 -0
- package/dist/client/assets/{LinkExternal01-Bo28LxVY.js → LinkExternal01-CjT-4hM8.js} +1 -1
- package/dist/client/assets/{Monitor01-Cx9Nl0mU.js → Monitor01-svtG00ql.js} +1 -1
- package/dist/client/assets/{Palette-DkgVQjRz.js → Palette-CA_16qMN.js} +1 -1
- package/dist/client/assets/{Play-VGEgQ-36.js → Play-CrdarOgl.js} +1 -1
- package/dist/client/assets/{Plus-DXVOsj8b.js → Plus-C9icoBmX.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CxP3kNii.js → RefreshCcw01-D1tvoH2_.js} +1 -1
- package/dist/client/assets/{SearchMd-B9xeWi0e.js → SearchMd-Di6_vvQ1.js} +1 -1
- package/dist/client/assets/{Settings02-DYlioLKt.js → Settings02-BylJiOHK.js} +1 -1
- package/dist/client/assets/{Shield01-CLHpjaQL.js → Shield01-CDSs18-B.js} +1 -1
- package/dist/client/assets/{Star01-BT882_xb.js → Star01-D1DEXGAi.js} +1 -1
- package/dist/client/assets/{Stars01-DDxsFd_C.js → Stars01-UWs0NZ30.js} +1 -1
- package/dist/client/assets/{Stars02-lM9wDOP9.js → Stars02-CXAcgX2g.js} +1 -1
- package/dist/client/assets/{Sun-CNIfXy2-.js → Sun-CCiXRotp.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Den03c4j.js → SwitchHorizontal01-BU3C5ze8.js} +1 -1
- package/dist/client/assets/{Tool01-D7SzxWeU.js → Tool01-BMk00CcA.js} +1 -1
- package/dist/client/assets/{Trash01-C2MDqKmR.js → Trash01-MTKniuxn.js} +1 -1
- package/dist/client/assets/{Upload01-BTsf5tML.js → Upload01-DsrMMWgf.js} +1 -1
- package/dist/client/assets/{User01-B1vfX-f8.js → User01-DShN8gQ-.js} +1 -1
- package/dist/client/assets/{Users01-dpqTHJ7Y.js → Users01-Bvh39Ydu.js} +1 -1
- package/dist/client/assets/{Users03-e9b5gRLu.js → Users03--pQkY_Pm.js} +1 -1
- package/dist/client/assets/{X-DvNDI9Zw.js → X-D-FyhysP.js} +1 -1
- package/dist/client/assets/{XCircle-DBS00WN3.js → XCircle-Pgrh_mFJ.js} +1 -1
- package/dist/client/assets/{XClose-BdAeKt9F.js → XClose-CXixB7oH.js} +1 -1
- package/dist/client/assets/{Zap-aFVcxgaa.js → Zap-BcF-Iz_3.js} +1 -1
- package/dist/client/assets/{ZapSquare-CC0ClMfp.js → ZapSquare-BH297b52.js} +1 -1
- package/dist/client/assets/ZoomOut-qupe1GUj.js +1 -0
- package/dist/client/assets/{access-gate-B8AAPT1T.js → access-gate-b8qBeVwB.js} +1 -1
- package/dist/client/assets/{accordion-BFQ7Yu8X.js → accordion-bX483Ztz.js} +1 -1
- package/dist/client/assets/add-section-modal-wMptfoHV.js +1 -0
- package/dist/client/assets/{agent-capabilities-BE7hHGoA.js → agent-capabilities-ADaK_qqp.js} +1 -1
- package/dist/client/assets/agent-icon-6l7Nwe2K.js +1 -0
- package/dist/client/assets/{agent-icons-UJTit2wi.js → agent-icons-BDS9BBHh.js} +1 -1
- package/dist/client/assets/agents-list-BdFiPs3r.js +1 -0
- package/dist/client/assets/ai-providers-lM-GGoBl.js +1 -0
- package/dist/client/assets/{alert-DkX6LwPv.js → alert-Ta86Z4_L.js} +1 -1
- package/dist/client/assets/{alert-dialog-DKXzP7Bt.js → alert-dialog-_2G9ccD7.js} +1 -1
- package/dist/client/assets/app-editor-BJ_HJXFs.js +1 -0
- package/dist/client/assets/{auth-catchall-CmwVLqj-.js → auth-catchall-BdHpJwKo.js} +1 -1
- package/dist/client/assets/{auth-split-layout-COIVkHnQ.js → auth-split-layout-DVUC3dWq.js} +1 -1
- package/dist/client/assets/{automation-list-row-c065EJtO.js → automation-list-row-BNHDxEG_.js} +1 -1
- package/dist/client/assets/{automation-runs-CPH-3xtw.js → automation-runs-BbNb5m5Z.js} +1 -1
- package/dist/client/assets/automations-ChMgB7Hm.js +1 -0
- package/dist/client/assets/{avatar-ETg7Q-GU.js → avatar-KTqg6Pir.js} +1 -1
- package/dist/client/assets/{badge-C8j1DE3m.js → badge-jK5_JNPO.js} +1 -1
- package/dist/client/assets/brand-context-D1YLW65X.js +1 -0
- package/dist/client/assets/buckets-CZodJDYe.js +1 -0
- package/dist/client/assets/{calendar-CLbDOOHw.js → calendar-DFy-BKZq.js} +1 -1
- package/dist/client/assets/{capability-load-error-DVzMymKs.js → capability-load-error-DUP-Lw9V.js} +1 -1
- package/dist/client/assets/{card-lOxFSSkP.js → card-Ce7y-Nqu.js} +1 -1
- package/dist/client/assets/chat-context-CpKbwwmM.js +20 -0
- package/dist/client/assets/{checkbox-DWa4G7u9.js → checkbox-MO2_GITU.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BGZNVK0p.js → cli-auth-success-XZzsr92m.js} +1 -1
- package/dist/client/assets/collection-detail-Bv6I7A_k.js +1 -0
- package/dist/client/assets/{collection-display-button-NMk2O1lx.js → collection-display-button-DzXqmtbd.js} +1 -1
- package/dist/client/assets/{collection-search-BPGQygd8.js → collection-search-CPYfTi84.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BXPnPT96.js → collection-table-wrapper-DgzLrzuP.js} +1 -1
- package/dist/client/assets/{collection-tabs-C_qWo2-y.js → collection-tabs-CIsqNrxU.js} +1 -1
- package/dist/client/assets/{collections-NKJwWp8f.js → collections-B-PXiD2Y.js} +1 -1
- package/dist/client/assets/{command-B3U7wd2O.js → command-BHmAxNRB.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-CqBwflr-.js → connect-desktop-dialog-BQZD1I8n.js} +1 -1
- package/dist/client/assets/{connection-card-DG_N0P2G.js → connection-card-BHzG8ppu.js} +1 -1
- package/dist/client/assets/connection-detail-BlmixFGl.js +1 -0
- package/dist/client/assets/{connection-form-helpers-D79c5tFA.js → connection-form-helpers-CgKn2eM9.js} +1 -1
- package/dist/client/assets/connections-D5zy3mYf.js +1 -0
- package/dist/client/assets/{constants-Oykg5_q9.js → constants-DI_u-hVk.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-02ukeQqS.js → decopilot-sse-pool-DPWhf2bX.js} +1 -1
- package/dist/client/assets/{dialog-DCjJZndp.js → dialog-Bt3zXcK6.js} +1 -1
- package/dist/client/assets/{domain-settings-Jn9iDH8k.js → domain-settings-CZnFXOwr.js} +1 -1
- package/dist/client/assets/{drawer-BTJhbpa8.js → drawer-DeHC5s3g.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BnsK64En.js → dropdown-menu-SwrAlbwN.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-WDrQTfck.js +1 -0
- package/dist/client/assets/{empty-state-C-NWO5ph.js → empty-state-BJFB-AwN.js} +1 -1
- package/dist/client/assets/{empty-state-CKyi-9Wl.js → empty-state-DlCayRAK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-AirIeyvr.js → extract-connection-data-CrMYEI5i.js} +1 -1
- package/dist/client/assets/features-BgkDxOlu.js +1 -0
- package/dist/client/assets/file-explorer-DrueRu5k.js +2 -0
- package/dist/client/assets/{file-type-icon-DM9XMqae.js → file-type-icon-BHF_Ovux.js} +1 -1
- package/dist/client/assets/{files-BuO1w5Lh.js → files-BCcd3t2S.js} +1 -1
- package/dist/client/assets/{form-DMPH0FOJ.js → form-8jBGaVW7.js} +1 -1
- package/dist/client/assets/general-BJkPBrz3.js +1 -0
- package/dist/client/assets/{generate-id-i1xx8q5L.js → generate-id-Bfx7nOJH.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CTcBo2fn.js → github-repo-picker-F4vLHgJ-.js} +1 -1
- package/dist/client/assets/header-tab-button-DCSg63Wl.js +5 -0
- package/dist/client/assets/{hover-card-CxtN1xCB.js → hover-card-DcJvwauT.js} +1 -1
- package/dist/client/assets/{image-field-HoCNk-1B.js → image-field-cind3dwC.js} +1 -1
- package/dist/client/assets/index-BIANv7ur.js +1 -0
- package/dist/client/assets/{index-DtSBWsbe.js → index-Bac2tQWh.js} +1 -1
- package/dist/client/assets/{index-CALXjj7d.js → index-BrIVZCzt.js} +1 -1
- package/dist/client/assets/index-BzoFvbIH.js +1 -0
- package/dist/client/assets/{index-C7oVr4Gj.js → index-C0t_9xyr.js} +1 -1
- package/dist/client/assets/{index-N_rB2zyq.js → index-C1kxS2Io.js} +1 -1
- package/dist/client/assets/index-C3tcbzRj.js +3 -0
- package/dist/client/assets/{index-Bja6OpPs.js → index-C_oSBqFD.js} +3 -3
- package/dist/client/assets/index-CfGIr4vM.js +310 -0
- package/dist/client/assets/index-ChzbgMa2.js +1 -0
- package/dist/client/assets/index-D5dv4kfs.css +1 -0
- package/dist/client/assets/{index-CB2ubqvZ.js → index-DEWYXjIf.js} +3 -3
- package/dist/client/assets/{index-lU9yS_Jh.js → index-DML39Lt-.js} +1 -1
- package/dist/client/assets/{index-xAwaYY9z.js → index-DQj7btfC.js} +15 -15
- package/dist/client/assets/{index-C6M-_40T.js → index-DlcvFOU2.js} +1 -1
- package/dist/client/assets/{index-DUzjuDnX.js → index-d7-A3CDs.js} +1 -1
- package/dist/client/assets/{index-redirect-Bh1l7WCU.js → index-redirect-KnAJlqvx.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DFB-ygfX.js → infiniteQueryObserver-w8EJyyrI.js} +1 -1
- package/dist/client/assets/{input-D9gxUyjr.js → input-Ct22kLSY.js} +1 -1
- package/dist/client/assets/{integration-icon-BffTGZN4.js → integration-icon-CNf7sZ5b.js} +1 -1
- package/dist/client/assets/{label-BL0BsZ1B.js → label-CvDTa89d.js} +1 -1
- package/dist/client/assets/{layout-CfSS4bsq.js → layout-Dkxj2bFg.js} +1 -1
- package/dist/client/assets/{login-BuZSwsso.js → login-Dv6Rz1bY.js} +1 -1
- package/dist/client/assets/{members-D7WrKG_A.js → members-BQXsk1m4.js} +2 -2
- package/dist/client/assets/{monaco-editor-DtMcxLSi.js → monaco-editor-DR4yoUjc.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-fp6agr8k.js → monitoring-stats-row-Co70p3-n.js} +1 -1
- package/dist/client/assets/{oauth-callback-d6LUyXrn.js → oauth-callback-CQPHoHy-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CkKiZhn4.js → oauth-callback-ai-provider-BJeYyFlX.js} +1 -1
- package/dist/client/assets/{onboarding-DfbOcrIX.js → onboarding-CzNreyu4.js} +1 -1
- package/dist/client/assets/{org-install-CFDYPwCg.js → org-install-aZxuYxoI.js} +1 -1
- package/dist/client/assets/{org-layout-WeQp4B6-.js → org-layout-CR6iFjC9.js} +1 -1
- package/dist/client/assets/org-plugin-layout-Ah6P36_M.js +1 -0
- package/dist/client/assets/{page-seo-form-BAg1yciU.js → page-seo-form-BzX1ts5p.js} +1 -1
- package/dist/client/assets/page-seo-sheet-v7xZnlYi.js +1 -0
- package/dist/client/assets/pair--AN1yq4g.js +39 -0
- package/dist/client/assets/{plugin-empty-state-9CxATRN3.js → plugin-empty-state-CIZ1bBrP.js} +1 -1
- package/dist/client/assets/{plugin-header-7GRdizIh.js → plugin-header-CExvgCKI.js} +1 -1
- package/dist/client/assets/{plugin-layout-CJOy-tZB.js → plugin-layout-DS-orBC-.js} +1 -1
- package/dist/client/assets/{popover-OiarPewu.js → popover-DXn7orE4.js} +1 -1
- package/dist/client/assets/{post-editor-BQ_9KZ48.js → post-editor-bszZQHpg.js} +3 -3
- package/dist/client/assets/{primitives-pd_yvF0S.js → primitives-CIXky-Gt.js} +1 -1
- package/dist/client/assets/profile-CZWeJMEP.js +1 -0
- package/dist/client/assets/project-app-view-DJMvDwFa.js +1 -0
- package/dist/client/assets/record-editor-C5KWfSLg.js +1 -0
- package/dist/client/assets/registry-CX2hi2E3.js +2 -0
- package/dist/client/assets/{registry-layout-D6FuqVAe.js → registry-layout-DjFUi3yC.js} +1 -1
- package/dist/client/assets/{require-capability-DVkbMmft.js → require-capability-DDbNSPG5.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CRGKVRTF.js → required-auth-layout-Bpv6G5uE.js} +1 -1
- package/dist/client/assets/{reset-password-DsVXpYD9.js → reset-password-D1T0PiTj.js} +1 -1
- package/dist/client/assets/{resizable-a1gJgrB1.js → resizable-Bi3jkg9o.js} +1 -1
- package/dist/client/assets/roles-BBWw8puD.js +1 -0
- package/dist/client/assets/{save-status-DRXktsXS.js → save-status-PzXq6KUK.js} +1 -1
- package/dist/client/assets/{schema-form-DvpyibqS.js → schema-form-CM7pfylQ.js} +1 -1
- package/dist/client/assets/{scroll-area-Ds73tc0J.js → scroll-area-BNzrPnq5.js} +1 -1
- package/dist/client/assets/{search-input-BNN911DE.js → search-input-C76EA-t6.js} +1 -1
- package/dist/client/assets/secrets-DMEa7GIW.js +1 -0
- package/dist/client/assets/{sections-editor-6P4Yegkk.js → sections-editor--GuZPQzC.js} +2 -2
- package/dist/client/assets/{select-fwtyEN3G.js → select-D_4UU9rK.js} +1 -1
- package/dist/client/assets/{select-model-D7RFa4up.js → select-model-cV_VUU8G.js} +1 -1
- package/dist/client/assets/seo-editor-fhccoPNR.js +1 -0
- package/dist/client/assets/settings-layout-DH37q17x.js +1 -0
- package/dist/client/assets/{settings-section-T0fDyncu.js → settings-section-DsXtuKDY.js} +1 -1
- package/dist/client/assets/sheet-D01YX9h0.js +1 -0
- package/dist/client/assets/shell-controls-CNVI6ZJJ.js +1 -0
- package/dist/client/assets/{shell-layout-I9tl7R9J.js → shell-layout-xPMsY5hC.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CdGn4Kpm.js → shell-route-loading-jPQ9XajT.js} +1 -1
- package/dist/client/assets/sidebar-CJNdWlwy.js +1 -0
- package/dist/client/assets/{skeleton-CM-Pi0cm.js → skeleton-DEf5lpEA.js} +1 -1
- package/dist/client/assets/{sortable.esm-KFDeRhD3.js → sortable.esm-KhkNVCRe.js} +1 -1
- package/dist/client/assets/{spinner-D4UjUyLz.js → spinner-srK7FwNe.js} +1 -1
- package/dist/client/assets/sso-BLXKmxlD.js +1 -0
- package/dist/client/assets/store-DydXTg6V.js +1 -0
- package/dist/client/assets/store-registry-BJqdtxTv.js +2 -0
- package/dist/client/assets/{switch-DB7mlnDa.js → switch-Cbu6JSI9.js} +1 -1
- package/dist/client/assets/{tab-id-BFVzx5fb.js → tab-id-CbYpEVAZ.js} +11 -11
- package/dist/client/assets/{table-Cd_YQk4M.js → table-dr9K2jWM.js} +1 -1
- package/dist/client/assets/{tabs-Dsmq9_wP.js → tabs-CJU0nxr6.js} +1 -1
- package/dist/client/assets/{task-status-C990ALOP.js → task-status-Dyf8qaxz.js} +1 -1
- package/dist/client/assets/{textarea-DGZy_omr.js → textarea-BquesfD_.js} +1 -1
- package/dist/client/assets/{toggle-group-BkLJ1frl.js → toggle-group-m3q7pubc.js} +1 -1
- package/dist/client/assets/{toolbar-Bnt0c2J3.js → toolbar-Bkxu3n7s.js} +1 -1
- package/dist/client/assets/{tools-list-Dpd5zOg1.js → tools-list-CG_BLK1j.js} +1 -1
- package/dist/client/assets/{tooltip-BvIsFjJR.js → tooltip-Bm-whGHF.js} +1 -1
- package/dist/client/assets/{types-Dn1K45P2.js → types-Bkz2p_os.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BQwBnNI3.js → use-ai-providers-B82V9Np8.js} +1 -1
- package/dist/client/assets/{use-automations-BEPg-aek.js → use-automations-B5qTxkL8.js} +1 -1
- package/dist/client/assets/{use-capability-rrurYBXm.js → use-capability-DpFGw1TU.js} +1 -1
- package/dist/client/assets/{use-collections-e25i0NM-.js → use-collections-iUV-5kFm.js} +1 -1
- package/dist/client/assets/{use-connection-BQxCYR_o.js → use-connection-DTKE65yR.js} +1 -1
- package/dist/client/assets/{use-copy-BKbXbMuY.js → use-copy-Dr7XRETN.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-trxCQUHO.js → use-create-virtual-mcp-DlMteKXP.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Oryp4cAP.js → use-debounced-autosave-DFapff8c.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DEEK0oTT.js → use-delete-connection-CU96IyMZ.js} +1 -1
- package/dist/client/assets/{use-file-configs-Qrd6eZyZ.js → use-file-configs-C8ipJXZL.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DcQNoJ7_.js → use-infinite-scroll-KU0QCoEE.js} +1 -1
- package/dist/client/assets/{use-list-state-BoOb09L9.js → use-list-state-DtwRJx6R.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D9JZQ88U.js → use-mcp-prompts-aLA3FcF_.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DkcEQK3V.js → use-mcp-tools-CK1DUQVb.js} +1 -1
- package/dist/client/assets/{use-members-DERsL77r.js → use-members-C9apz-8a.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-sJoZ-Wbv.js → use-navigate-to-agent-DRRtr51U.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CF8P1btO.js → use-org-auth-client-CI8XyYuM.js} +1 -1
- package/dist/client/assets/{use-org-sso-D2JNbrnR.js → use-org-sso-CYBgAyDV.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Ca1byRHM.js → use-organization-roles-C5ABG30J.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CVmm-jyI.js → use-organization-settings-B4ywx3QZ.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B6OVBI_G.js → use-registry-connections-B-c9LId-.js} +1 -1
- package/dist/client/assets/{use-secrets-_k7d1I4Z.js → use-secrets-D3irvtLI.js} +1 -1
- package/dist/client/assets/{use-status-sounds-gVglgYnC.js → use-status-sounds-BEbMXd3N.js} +1 -1
- package/dist/client/assets/{use-view-mode-DdD0TD2N.js → use-view-mode-Jd_CE1Mx.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BNfSbQBW.js → use-virtual-mcp-DsdNWb58.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DrZL_IGs.js +1 -0
- package/dist/client/assets/{useRouterState-CI4Wmw4H.js → useRouterState-CU2GqlKv.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CN1mQR7i.js +1 -0
- package/dist/client/assets/{user-ChT4iOGQ.js → user-sLZtiN2i.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DCljG_Km.js → view-mode-toggle-DSmCr2tD.js} +1 -1
- package/dist/client/assets/workflow-BK9KKo6T.js +1 -0
- package/dist/client/assets/workflow-detail-DzASvQVR.js +1 -0
- package/dist/client/deck-runtime/v1/deck-viewer.js +1516 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +542 -539
- package/dist/server/migrate.js +90 -90
- package/dist/server/server.js +287 -287
- package/package.json +1 -1
- package/dist/client/assets/ZoomOut-Bj5jamAx.js +0 -1
- package/dist/client/assets/add-section-modal-BmCzDi10.js +0 -1
- package/dist/client/assets/agent-icon-D4vfmbIE.js +0 -1
- package/dist/client/assets/agents-list-LpRFwfeM.js +0 -1
- package/dist/client/assets/ai-providers-BqYvRcM4.js +0 -1
- package/dist/client/assets/app-editor-CIaq7eCO.js +0 -1
- package/dist/client/assets/automations-jHIRR-Gp.js +0 -1
- package/dist/client/assets/brand-context-pJc99xfz.js +0 -1
- package/dist/client/assets/buckets-CD20kw5y.js +0 -1
- package/dist/client/assets/chat-context-Bnval_3z.js +0 -20
- package/dist/client/assets/collection-detail-BQV4fFQi.js +0 -1
- package/dist/client/assets/connection-detail-BxZdoV6Y.js +0 -1
- package/dist/client/assets/connections-BKRkcjPX.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-DI1tAQQN.js +0 -1
- package/dist/client/assets/features-CCh1HKhB.js +0 -1
- package/dist/client/assets/file-explorer-BQmgDEDi.js +0 -2
- package/dist/client/assets/general-BorJGZAV.js +0 -1
- package/dist/client/assets/header-tab-button-CJMFloVi.js +0 -3
- package/dist/client/assets/index-BNc5J02Q.js +0 -1
- package/dist/client/assets/index-CTo6iOJE.js +0 -1
- package/dist/client/assets/index-DRkA4nnL.js +0 -3
- package/dist/client/assets/index-DzP6PZZ7.css +0 -1
- package/dist/client/assets/index-tZSWGe84.js +0 -1
- package/dist/client/assets/index-t_7wQBv1.js +0 -310
- package/dist/client/assets/org-plugin-layout-CtY6eOb7.js +0 -1
- package/dist/client/assets/page-seo-sheet-CG4OfDmr.js +0 -1
- package/dist/client/assets/pair-CCKXkNYO.js +0 -39
- package/dist/client/assets/profile-BQDabc6t.js +0 -1
- package/dist/client/assets/project-app-view-B6xEMwDB.js +0 -1
- package/dist/client/assets/record-editor-DeENCgCd.js +0 -1
- package/dist/client/assets/registry-C8DHcJ9B.js +0 -2
- package/dist/client/assets/roles-CX312B39.js +0 -1
- package/dist/client/assets/secrets-BeeL9rnH.js +0 -1
- package/dist/client/assets/seo-editor-CsFpa8ZP.js +0 -1
- package/dist/client/assets/settings-layout-DwCpTLea.js +0 -1
- package/dist/client/assets/sheet-IM6_8Cdx.js +0 -1
- package/dist/client/assets/shell-controls-VlzjU05Z.js +0 -1
- package/dist/client/assets/sidebar-CAkfGpdS.js +0 -1
- package/dist/client/assets/sso-B5mHZmOT.js +0 -1
- package/dist/client/assets/store-DVYNpmdS.js +0 -1
- package/dist/client/assets/store-registry-DRdcwU2X.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Bj3r3xlf.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BbAiO9h1.js +0 -1
- package/dist/client/assets/workflow-BbaQXvps.js +0 -1
- package/dist/client/assets/workflow-detail-CU9YTyf_.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ae,j as t,E as et,r as W,l as re,q as Ne,f as ke,d as tt,b as De,u as nt,p as st,L as ot,G as it,H as at,B as z,t as ne,F as ct,c as le,o as Q,J as rt,I as lt,K as dt}from"./index-Bja6OpPs.js";import{g as mt}from"./generate-id-i1xx8q5L.js";import{C as ut}from"./collection-display-button-NMk2O1lx.js";import{S as pt}from"./search-input-BNN911DE.js";import{C as ht}from"./collection-tabs-C_qWo2-y.js";import{u as xt,a as Ae,g as gt,C as Ce}from"./connection-card-DG_N0P2G.js";import{E as ft}from"./empty-state-CKyi-9Wl.js";import{I as jt}from"./integration-icon-BffTGZN4.js";import{P as me}from"./index-N_rB2zyq.js";import{u as yt,D as Ct}from"./use-delete-connection-DEEK0oTT.js";import{u as ye}from"./use-capability-rrurYBXm.js";import{u as vt}from"./use-infinite-scroll-DcQNoJ7_.js";import{u as _t}from"./use-list-state-BoOb09L9.js";import{g as we,a as St,e as bt}from"./extract-connection-data-AirIeyvr.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Te,d as Ie,b as Pe,f as Le,e as Oe,g as $e,a as Ee,A as Me}from"./alert-dialog-DKXzP7Bt.js";import{C as ze}from"./checkbox-DWa4G7u9.js";import{D as Fe,a as Ve,b as Be,c as Ue,e as He,d as Re}from"./dialog-DCjJZndp.js";import{b as Nt,a as kt,c as Dt,D as At,d as wt,e as Tt,f as It}from"./drawer-BTJhbpa8.js";import{u as Pt}from"./tooltip-BvIsFjJR.js";import{D as Ke,a as We,b as Xe,c as he}from"./dropdown-menu-BnsK64En.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as Se}from"./form-DMPH0FOJ.js";import{I as ie}from"./input-D9gxUyjr.js";import{d as Lt,S as Ot,a as $t,b as Et,c as ce}from"./select-fwtyEN3G.js";import{T as Mt}from"./textarea-DGZy_omr.js";import{b as qe,u as zt}from"./use-connection-BQxCYR_o.js";import{u as Ft,S as Vt}from"./constants-Oykg5_q9.js";import{a as Bt}from"./use-virtual-mcp-BNfSbQBW.js";import{Q as Ut,a3 as Ht}from"./agent-icon-D4vfmbIE.js";import{n as xe}from"./Container-B1sUXs1U.js";import{i as Ge}from"./DotsVertical-DNPNHBpl.js";import{s as Qe}from"./Eye-DWIY-6KS.js";import{s as je}from"./Star01-BT882_xb.js";import{s as Je}from"./Plus-DXVOsj8b.js";import{s as Ye}from"./Trash01-C2MDqKmR.js";import{s as Ze}from"./XClose-BdAeKt9F.js";import{i as ue,a as be,E as Rt,c as Kt,p as Wt,b as Xt,d as qt}from"./connection-form-helpers-D79c5tFA.js";import"./collections-NKJwWp8f.js";import"./SwitchHorizontal01-Den03c4j.js";import"./Check-CtI-OH3k.js";import"./view-mode-toggle-DCljG_Km.js";import"./badge-C8j1DE3m.js";import"./SearchMd-B9xeWi0e.js";import"./use-registry-connections-B6OVBI_G.js";import"./use-organization-settings-CVmm-jyI.js";import"./useInfiniteQuery-Bj3r3xlf.js";import"./infiniteQueryObserver-DFB-ygfX.js";import"./card-lOxFSSkP.js";import"./sidebar-CAkfGpdS.js";import"./sheet-IM6_8Cdx.js";import"./X-DvNDI9Zw.js";import"./use-view-mode-DdD0TD2N.js";import"./ChevronRight-TMlXoq-Z.js";import"./label-BL0BsZ1B.js";import"./ChevronDown-BL2fNdeZ.js";import"./ChevronUp-O10NbvHe.js";import"./use-collections-e25i0NM-.js";import"./AlertCircle-f1EMyhcF.js";import"./Tool01-D7SzxWeU.js";import"./RefreshCcw01-CxP3kNii.js";import"./XCircle-DBS00WN3.js";import"./ArrowUpRight-DDOS_CqL.js";import"./ZapSquare-CC0ClMfp.js";import"./Users03-e9b5gRLu.js";import"./CheckCircle-Dk0E48Vj.js";import"./ChevronLeft-ItYaMHNU.js";import"./ZoomOut-Bj5jamAx.js";import"./Globe01-Cjaw-3jR.js";import"./FilterLines-CWRo79Yt.js";import"./Palette-DkgVQjRz.js";import"./HardDrive-Ddx5WtDi.js";import"./Stars02-lM9wDOP9.js";import"./Key01-ChvR9ujt.js";import"./LinkExternal01-Bo28LxVY.js";import"./Monitor01-Cx9Nl0mU.js";import"./Sun-CNIfXy2-.js";import"./Play-VGEgQ-36.js";import"./Settings02-DYlioLKt.js";import"./Shield01-CLHpjaQL.js";import"./Stars01-DDxsFd_C.js";import"./Upload01-BTsf5tML.js";import"./User01-B1vfX-f8.js";import"./Users01-dpqTHJ7Y.js";import"./Zap-aFVcxgaa.js";function Gt(v){const e=ae.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:a}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const x=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const g=y,b=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==b?(N={title:n.title,icon:n.icon,description:b},e[10]=n.icon,e[11]=n.title,e[12]=b,e[13]=N):N=e[13];let l;e[14]!==x||e[15]!==n.connections||e[16]!==p||e[17]!==a||e[18]!==m||e[19]!==u?(l=()=>u?(()=>{for(const C of n.connections)x?m.has(C.id)&&a(C.id):m.has(C.id)||a(C.id)})():p(),e[14]=x,e[15]=n.connections,e[16]=p,e[17]=a,e[18]=m,e[19]=u,e[20]=l):l=e[20];const j=u&&x&&"ring-2 ring-primary",d=u&&g&&!x&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=le(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(xe,{}),e[24]=_):_=e[24];let D;e[25]!==x||e[26]!==n.connections||e[27]!==a||e[28]!==m||e[29]!==u||e[30]!==g?(D=u?t.jsx(ze,{checked:x?!0:g?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)x?m.has(C.id)&&a(C.id):m.has(C.id)||a(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=x,e[26]=n.connections,e[27]=a,e[28]=m,e[29]=u,e[30]=g,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=le("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(We,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Jt,children:t.jsx(Ge,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Qe,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(Ke,{children:[s,t.jsx(Xe,{align:"end",onClick:Qt,children:t.jsxs(he,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==l||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:N,onClick:l,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=l,e[49]=k,e[50]=B):B=e[50],B}function Qt(v){return v.stopPropagation()}function Jt(v){return v.stopPropagation()}function Yt(v){const e=ae.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:a,onDeselectAll:h,onDelete:x,onAddToAgent:y,onToggleStatus:g,onCancel:b}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let l;e[2]!==n||e[3]!==h||e[4]!==a||e[5]!==p?(l=n<p?t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:["Select all (",p,")"]}):t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=a,e[5]=p,e[6]=l):l=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==x||e[12]!==g?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>g("active"),children:"Enable"}),t.jsx(z,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>g("inactive"),children:"Disable"}),t.jsxs(z,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:x,children:[t.jsx(Ye,{size:13}),"Delete"]})]}),e[10]=u,e[11]=x,e[12]=g,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ze,{size:13}),e[14]=k):k=e[14];let _;e[15]!==b?(_=t.jsx(z,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:b,children:k}),e[15]=b,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==l||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,l,j,d,_]})}),e[17]=N,e[18]=l,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function Zt(v){const e=ae.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[a,h]=W.useState(null);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs(Be,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(He,{children:"Select an agent to add the selected connections to."})]}),e[0]=x):x=e[0];let y;e[1]!==u||e[2]!==a?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:le("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",a===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(jt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=a,e[3]=y):y=e[3];let g;e[4]!==y?(g=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=g):g=e[5];let b;e[6]!==p?(b=t.jsx(z,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=b):b=e[7];const N=!a;let l;e[8]!==m||e[9]!==p||e[10]!==a?(l=()=>{a&&(m(a),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=a,e[11]=l):l=e[11];let j;e[12]!==N||e[13]!==l?(j=t.jsx(z,{disabled:N,onClick:l,children:"Add"}),e[12]=N,e[13]=l,e[14]=j):j=e[14];let d;e[15]!==b||e[16]!==j?(d=t.jsxs(Re,{children:[b,j]}),e[15]=b,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==g||e[19]!==d?(k=t.jsxs(Ve,{className:"sm:max-w-[400px]",children:[x,g,d]}),e[18]=g,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Fe,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function en(v){const e=ae.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,a=u!==1?"s":"";let h;e[0]!==u||e[1]!==a?(h=t.jsxs(Te,{children:["Delete ",u," connection",a,"?"]}),e[0]=u,e[1]=a,e[2]=h):h=e[2];const x=u!==1?"s":"";let y;e[3]!==x?(y=t.jsxs(Ie,{children:["This will permanently delete the selected connection",x,". This action cannot be undone."]}),e[3]=x,e[4]=y):y=e[4];let g;e[5]!==h||e[6]!==y?(g=t.jsxs(Pe,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=g):g=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Le,{children:"Cancel"}),e[8]=b):b=e[8];const N=u!==1?"s":"";let l;e[9]!==u||e[10]!==m||e[11]!==N?(l=t.jsxs(Oe,{children:[b,t.jsxs($e,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=l):l=e[12];let j;e[13]!==g||e[14]!==l?(j=t.jsxs(Ee,{children:[g,l]}),e[13]=g,e[14]=l,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function tn(v){return v._registryId?.includes("community-registry")===!0}function nn(v){const e=ae.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:a,onNavigateConnected:h,onConnect:x}=v,[y,g]=W.useState(!1),[b,N]=W.useState(null);let l,j;e[0]!==m||e[1]!==n?(l=we(n)??"",j=m.has(l),e[0]=m,e[1]=n,e[2]=l,e[3]=j):(l=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||St(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==l){let S;e[10]!==l?(S=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===l,e[10]=l,e[11]=S):S=e[11],s=u.filter(S),e[7]=u,e[8]=l,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=tn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==x||e[20]!==h?(w=()=>{if(d){const S=A[0];S&&h(S);return}p&&L()},L=()=>{$?(N("connect"),g(!0)):x(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=x,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==x||e[25]!==b?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),g(!1),b==="connect"&&x(n),N(null)},e[23]=n,e[24]=x,e[25]=b,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(xe,{}),e[31]=G):G=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let X;e[35]!==p||e[36]!==a||e[37]!==L||e[38]!==d||e[39]!==n.id?(X=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(z,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:a!==null,onClick:S=>{S.stopPropagation(),L()},children:a===n.id?t.jsx(re,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=a,e[37]=L,e[38]=d,e[39]=n.id,e[40]=X):X=e[40];let o;e[41]!==R||e[42]!==X?(o=t.jsxs("div",{className:"flex items-center gap-2",children:[R,X]}),e[41]=R,e[42]=X,e[43]=o):o=e[43];let f;e[44]!==w||e[45]!==o||e[46]!==P?(f=t.jsx(Ce,{connection:P,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:o}),e[44]=w,e[45]=o,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Pe,{children:[t.jsx(Te,{children:"Community MCP Server"}),t.jsx(Ie,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Le,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==C?(E=t.jsxs(Ee,{children:[O,t.jsxs(Oe,{children:[H,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=E):E=e[51];let c;e[52]!==y||e[53]!==E?(c=t.jsx(Me,{open:y,onOpenChange:g,children:E}),e[52]=y,e[53]=E,e[54]=c):c=e[54];let T;return e[55]!==f||e[56]!==c?(T=t.jsxs(t.Fragment,{children:[f,c]}),e[55]=f,e[56]=c,e[57]=T):T=e[57],T}function sn({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:a}=Ne(),h=ct(),x=ke(),{data:y}=De.useSession(),g=qe(),b=zt(v),N=yt(),{granted:l}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[d,k]=W.useState(new Set),_=d.size>0,[D,U]=W.useState(!1),[F,s]=W.useState(!1),[A,V]=W.useState(null),$=Bt(),w=b.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),L=gt(w),B=r=>{k(i=>{const M=new Set(i);return M.has(r)?M.delete(r):M.add(r),M})},C=()=>{k(new Set)},P=Ae(m,v.searchTerm),G=P.items,R=vt(P.loadMore,P.hasMore,P.isLoadingMore),X=new Set(b.filter(r=>r.app_name).map(r=>r.app_name)),o=u==="ALL"||m.some(r=>r.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?G.filter(r=>{if(o!=="ALL"&&r._registryId!==o)return!1;if(f){const i=we(r);if(i&&X.has(i))return!1}return!0}):[],H=e==="connected"||f?L:[],E=async r=>{if(!(!a||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),V(r.id);try{const i=bt(r,a.id,y.user.id,{remoteIndex:0}),M=i.connection_type==="STDIO",I=!!i.connection_url,q=M&&i.connection_headers&&typeof i.connection_headers=="object"&&"command"in i.connection_headers;if(!I&&!q){Q.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await g.create.mutateAsync(i),ve=new URL(`/api/${a.slug}/mcp/${K}`,window.location.origin),_e=await rt({url:ve.href,token:null,orgId:a.id});if(_e.supportsOAuth&&!_e.isAuthenticated){const{token:de,tokenInfo:se,error:fe}=await lt({connectionId:K,orgSlug:a.slug,scope:"offline_access"});if(fe||!de){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:fe??"no_token"}),Q.error(`Authentication failed: ${fe??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),se)try{(await fetch(`/api/${a.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:se.accessToken,refreshToken:se.refreshToken,expiresIn:se.expiresIn,scope:se.scope,clientId:se.clientId,clientSecret:se.clientSecret,tokenEndpoint:se.tokenEndpoint})})).ok?await g.update.mutateAsync({id:K,data:{}}):await g.update.mutateAsync({id:K,data:{connection_token:de}})}catch{await g.update.mutateAsync({id:K,data:{connection_token:de}})}else await g.update.mutateAsync({id:K,data:{connection_token:de}});await h.invalidateQueries({queryKey:dt.isMCPAuthenticated(ve.href,null)}),Q.success("Authentication successful")}}Q.success("Connected successfully")}catch(i){Q.error(`Failed to connect: ${i instanceof Error?i.message:String(i)}`)}finally{V(null)}}},c=Ft({connectionId:Vt,orgId:a.id,orgSlug:a.slug}),T=()=>{h.invalidateQueries({predicate:r=>{const i=r.queryKey;return i[1]===a.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},S=async()=>{U(!1);const r=[...d];ne("connections_bulk_delete",{count:r.length});let i=0;for(const M of r)try{(await c.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}})).isError||i++}catch{}T(),Q.success(`Deleted ${i} connection${i!==1?"s":""}`),C()},oe=async r=>{const i=[...d];ne("connections_bulk_status_toggled",{count:i.length,to_status:r});let M=0;for(const I of i)try{await g.update.mutateAsync({id:I,data:{status:r}}),M++}catch{}T(),Q.success(`${r==="active"?"Enabled":"Disabled"} ${M} connection${M!==1?"s":""}`),C()},ge=async r=>{const i=$.find(q=>q.id===r);if(!i||!c)return;ne("connections_bulk_add_to_agent",{agent_id:r,count:d.size});const M=new Set(i.connections.map(q=>q.connection_id)),I=[...d].filter(q=>!M.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){Q.info("All selected connections are already in that agent");return}try{await c.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{connections:[...i.connections,...I]}}}),h.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===a.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),Q.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${i.title}"`),C()}catch{Q.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{...N}),t.jsx(en,{open:D,onOpenChange:U,count:d.size,onConfirm:S}),t.jsx(Zt,{open:F,onOpenChange:s,agents:$,onConfirm:ge}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(ft,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:l?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(r=>{if(r.type==="group")return t.jsx(Gt,{group:r,onOpen:()=>{x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:r.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},r.key);const i=r.connection,M=d.has(i.id);return t.jsx(Ce,{connection:i,fallbackIcon:t.jsx(xe,{}),onClick:()=>_?B(i.id):x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}}),className:le(M&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(ze,{checked:M,onCheckedChange:()=>B(i.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:le("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ke,{children:[t.jsx(We,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Ge,{size:20})})}),t.jsxs(Xe,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(he,{onClick:I=>{I.stopPropagation(),x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}})},children:[t.jsx(Qe,{size:16}),"Open"]}),(l||j)&&t.jsxs(he,{onClick:I=>{I.stopPropagation(),B(i.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),l&&t.jsxs(he,{variant:"destructive",onClick:I=>{I.stopPropagation(),N.requestDelete(i)},children:[t.jsx(Ye,{size:16}),"Delete"]})]})]})})]})},i.id)}),O.map(r=>t.jsx(nn,{item:r,canManage:l,allConnections:b,connectedAppNames:X,connectingItemId:A,onNavigateConnected:i=>x({to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:pe(i)}}),onConnect:E},`catalog-${r._registryId}:${r.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Yt,{count:d.size,total:w.length,canManage:l,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(r=>r.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:oe,onCancel:C})]})}function on(){const{org:v}=Ne(),e=ke(),n=tt({strict:!1}),{data:p}=De.useSession(),{stdioEnabled:u}=nt(),m=Pt(),{granted:a}=ye("connections:manage"),h=_t({namespace:v.slug,resource:"connections"}),x=qe(),[y,g]=st(ot.connectionsTab(v.slug),o=>n.tab==="all"||n.tab==="connected"?n.tab:o??"all"),[b,N]=W.useState("ALL"),[l,j]=W.useState("ALL"),[d,k]=W.useState("ALL"),_=xt(),U=Ae(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=it({resolver:at(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=ue({uiType:A,connectionUrl:V??"",npxPackage:$??""})??be({uiType:A,connectionUrl:V??"",registryItems:U}),L=a&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async o=>{let f,O=null,H=null,E=null;o.ui_type==="NPX"?(f="STDIO",O="",E=Xt(o.npx_package||"",o.env_vars||[])):o.ui_type==="STDIO"?(f="STDIO",O="",E=qt(o.stdio_command||"",o.stdio_args||"",o.stdio_cwd,o.env_vars||[])):(f=o.ui_type,O=o.connection_url||"",H=o.connection_token||null);const c=mt("conn");ne("connection_custom_created",{connection_type:f,ui_type:o.ui_type}),await x.create.mutateAsync({id:c,title:o.title,description:o.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:o.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:pe({app_name:null,connection_url:O,title:o.title,id:c})}})},G=o=>{o||(L&&C(),s.reset())},R=o=>{const f=o.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,c=S=>{if(S&&(!O&&!s.getValues("title").trim()&&S.title&&s.setValue("title",S.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&S.description&&s.setValue("description",S.description,{shouldDirty:!1}),!E&&S.envVarKeys?.length)){const oe=s.getValues("env_vars")??[],ge=new Set(oe.map(i=>i.key)),r=S.envVarKeys.filter(i=>!ge.has(i));r.length>0&&s.setValue("env_vars",[...oe,...r.map(i=>({key:i,value:""}))],{shouldDirty:!0})}},T=Wt(f);if(T&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",T.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),c(ue({uiType:"NPX",npxPackage:T.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const S=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",S,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),c(ue({uiType:S,connectionUrl:f})??be({uiType:S,connectionUrl:f,registryItems:U}));return}A==="NPX"&&c(ue({uiType:"NPX",npxPackage:f}))},X=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(z,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const o="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Lt,{value:c.value,onValueChange:c.onChange,children:[t.jsx(ee,{children:t.jsx(Ot,{children:t.jsx($t,{})})}),t.jsxs(Et,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value??"",onPaste:T=>{const S=T.clipboardData.getData("text");S&&(T.preventDefault(),s.setValue("npx_package",S.trim(),{shouldDirty:!0}),R(S))},onBlur:T=>{R(T.target.value),c.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...c,value:c.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...c,value:c.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...c,value:c.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Rt,{value:c.value??[],onChange:c.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...c,value:c.value??"",onPaste:T=>{const S=T.clipboardData.getData("text");S&&(T.preventDefault(),s.setValue("connection_url",S.trim(),{shouldDirty:!0}),R(S))},onBlur:T=>{R(T.target.value),c.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...c,value:c.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...c})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:c})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...c,value:c.value??""})}),t.jsx(te,{})]})})]}),E=L;return m?t.jsx(Nt,{open:E,onOpenChange:G,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Dt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:o}),t.jsx(wt,{className:"mt-1",children:f})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(z,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ze,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(It,{children:t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Fe,{open:E,onOpenChange:G,children:t.jsxs(Ve,{className:"sm:max-w-[525px]",children:[t.jsxs(Be,{children:[t.jsx(Ue,{children:o}),t.jsx(He,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Re,{children:[t.jsx(z,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(z,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(pt,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:o=>{o.key==="Escape"&&(h.setSearch(""),o.target.blur())}}),t.jsx(ut,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:b,onChange:o=>N(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:l,onChange:o=>j(o||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:o=>k(o||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(o=>({id:o.id,label:o.id.includes("community-registry")?"Community MCP Registry":o.title}))]}]:[]]})]}),X]}),t.jsx(ht,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:o=>{const f=o;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),g(f)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(sn,{listState:h,activeTab:y,typeFilter:b,statusFilter:l,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Ms(){const v=ae.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(et,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(on,{})})}),v[0]=e):e=v[0],e}export{Ms as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as d,g as l,cb as p,j as s,O as u}from"./index-Bja6OpPs.js";import{P as c}from"./plugin-layout-CJOy-tZB.js";import"./use-connection-BQxCYR_o.js";import"./use-collections-e25i0NM-.js";import"./constants-Oykg5_q9.js";import"./Settings02-DYlioLKt.js";import"./index-N_rB2zyq.js";import"./sidebar-CAkfGpdS.js";import"./sheet-IM6_8Cdx.js";import"./X-DvNDI9Zw.js";import"./tooltip-BvIsFjJR.js";function L(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=l(n);let i;e[1]!==a?(i=p.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as P,q as k,F as q,cb as b,j as n,cc as E,b3 as R,K as S,o as K}from"./index-Bja6OpPs.js";import{P as j}from"./index-N_rB2zyq.js";import{d as _}from"./use-organization-settings-CVmm-jyI.js";import{S as F}from"./switch-DB7mlnDa.js";import{n as I}from"./Container-B1sUXs1U.js";import{b as Q,S as w,a as z,c as N}from"./settings-section-T0fDyncu.js";import{R as T}from"./require-capability-DVkbMmft.js";import"./sidebar-CAkfGpdS.js";import"./sheet-IM6_8Cdx.js";import"./X-DvNDI9Zw.js";import"./tooltip-BvIsFjJR.js";import"./constants-Oykg5_q9.js";import"./card-lOxFSSkP.js";import"./ArrowUpRight-DDOS_CqL.js";import"./use-capability-rrurYBXm.js";import"./access-gate-B8AAPT1T.js";import"./capability-load-error-DVzMymKs.js";function U(){const e=P.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:M})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(b.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=b.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(Q,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(I,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(F,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(w,{children:n.jsx(z,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return b.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function M(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function B(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function le(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(B,{})}),e[0]=t):t=e[0],t}export{le as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,F as ut,o as $,K as Te}from"./index-Bja6OpPs.js";import{F as mt,l as pt}from"./index-CALXjj7d.js";import{Y as ht,ap as xt,aq as gt,ar as ae,as as yt,F as $e}from"./agent-icon-D4vfmbIE.js";import{a as wt}from"./Tool01-D7SzxWeU.js";import{s as jt}from"./XClose-BdAeKt9F.js";import{S as bt}from"./scroll-area-Ds73tc0J.js";import{b as Re,T as Oe,a as ze}from"./tooltip-BvIsFjJR.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-DKXzP7Bt.js";import{a as Et}from"./chat-context-Bnval_3z.js";import{u as Pt}from"./shell-layout-I9tl7R9J.js";import{a1 as le,a2 as Ae,a3 as Tt}from"./index-t_7wQBv1.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-DCjJZndp.js";import{I as We}from"./input-D9gxUyjr.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-CdGn4Kpm.js";import{t as Vt}from"./ChevronDown-BL2fNdeZ.js";import{i as Bt}from"./ChevronRight-TMlXoq-Z.js";import{i as Gt}from"./ZoomOut-Bj5jamAx.js";import{E as qt,b as Me,c as he,d as Qt,e as Ut,h as Ht,t as M,i as ce,g as xe,j as ge,s as Jt,v as Yt,k as ye,l as de,p as we,m as Xt,n as Zt}from"./header-tab-button-CJMFloVi.js";import"./AlertCircle-f1EMyhcF.js";import"./SwitchHorizontal01-Den03c4j.js";import"./RefreshCcw01-CxP3kNii.js";import"./XCircle-DBS00WN3.js";import"./ArrowUpRight-DDOS_CqL.js";import"./ZapSquare-CC0ClMfp.js";import"./Users03-e9b5gRLu.js";import"./CheckCircle-Dk0E48Vj.js";import"./Check-CtI-OH3k.js";import"./ChevronLeft-ItYaMHNU.js";import"./ChevronUp-O10NbvHe.js";import"./DotsVertical-DNPNHBpl.js";import"./Container-B1sUXs1U.js";import"./Eye-DWIY-6KS.js";import"./Globe01-Cjaw-3jR.js";import"./FilterLines-CWRo79Yt.js";import"./Star01-BT882_xb.js";import"./Palette-DkgVQjRz.js";import"./HardDrive-Ddx5WtDi.js";import"./Stars02-lM9wDOP9.js";import"./Key01-ChvR9ujt.js";import"./sheet-IM6_8Cdx.js";import"./X-DvNDI9Zw.js";import"./LinkExternal01-Bo28LxVY.js";import"./Monitor01-Cx9Nl0mU.js";import"./Sun-CNIfXy2-.js";import"./Play-VGEgQ-36.js";import"./Plus-DXVOsj8b.js";import"./SearchMd-B9xeWi0e.js";import"./Settings02-DYlioLKt.js";import"./Shield01-CLHpjaQL.js";import"./Stars01-DDxsFd_C.js";import"./Trash01-C2MDqKmR.js";import"./Upload01-BTsf5tML.js";import"./User01-B1vfX-f8.js";import"./Users01-dpqTHJ7Y.js";import"./Zap-aFVcxgaa.js";import"./select-fwtyEN3G.js";import"./tab-id-BFVzx5fb.js";import"./constants-Oykg5_q9.js";import"./decopilot-sse-pool-02ukeQqS.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-BNfSbQBW.js";import"./use-collections-e25i0NM-.js";import"./use-ai-providers-BQwBnNI3.js";import"./use-organization-settings-CVmm-jyI.js";import"./avatar-ETg7Q-GU.js";import"./required-auth-layout-CRGKVRTF.js";import"./useRouterState-CI4Wmw4H.js";import"./use-org-sso-D2JNbrnR.js";import"./agent-capabilities-BE7hHGoA.js";import"./pair-CCKXkNYO.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BKbXbMuY.js";import"./file-type-icon-DM9XMqae.js";import"./content-blocks-o63cs2vh.js";import"./types-Dn1K45P2.js";import"./integration-icon-BffTGZN4.js";import"./use-navigate-to-agent-sJoZ-Wbv.js";import"./use-connection-BQxCYR_o.js";import"./use-mcp-prompts-D9JZQ88U.js";import"./form-DMPH0FOJ.js";import"./label-BL0BsZ1B.js";import"./spinner-D4UjUyLz.js";import"./drawer-BTJhbpa8.js";import"./collection-search-BPGQygd8.js";import"./tabs-Dsmq9_wP.js";import"./toggle-group-BkLJ1frl.js";import"./connect-desktop-dialog-CqBwflr-.js";import"./agent-icons-UJTit2wi.js";import"./checkbox-DWa4G7u9.js";import"./skeleton-CM-Pi0cm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-T0fDyncu.js";import"./card-lOxFSSkP.js";import"./popover-OiarPewu.js";import"./command-B3U7wd2O.js";import"./index-DtSBWsbe.js";import"./useInfiniteQuery-Bj3r3xlf.js";import"./infiniteQueryObserver-DFB-ygfX.js";import"./sortable.esm-KFDeRhD3.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DG_N0P2G.js";import"./use-registry-connections-B6OVBI_G.js";import"./extract-connection-data-AirIeyvr.js";import"./generate-id-i1xx8q5L.js";import"./collections-NKJwWp8f.js";import"./collection-tabs-C_qWo2-y.js";import"./badge-C8j1DE3m.js";import"./textarea-DGZy_omr.js";import"./connection-form-helpers-D79c5tFA.js";import"./use-infinite-scroll-DcQNoJ7_.js";import"./useSuspenseInfiniteQuery-BbAiO9h1.js";import"./index-lU9yS_Jh.js";import"./dropdown-menu-BnsK64En.js";import"./question-004-sINsf4GQ.js";import"./sidebar-CAkfGpdS.js";import"./use-status-sounds-gVglgYnC.js";import"./empty-state-CKyi-9Wl.js";import"./toolbar-Bnt0c2J3.js";import"./resizable-a1gJgrB1.js";import"./use-mcp-tools-DkcEQK3V.js";import"./use-capability-rrurYBXm.js";import"./user-ChT4iOGQ.js";import"./tools-list-Dpd5zOg1.js";import"./switch-DB7mlnDa.js";import"./use-debounced-autosave-Oryp4cAP.js";import"./index-N_rB2zyq.js";import"./search-input-BNN911DE.js";import"./use-secrets-_k7d1I4Z.js";import"./github-repo-picker-CTcBo2fn.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-BFQ7Yu8X.js";import"./view-mode-toggle-DCljG_Km.js";import"./select-model-D7RFa4up.js";import"./use-automations-BEPg-aek.js";import"./monaco-editor-DtMcxLSi.js";import"./automation-runs-CPH-3xtw.js";import"./table-Cd_YQk4M.js";import"./use-members-DERsL77r.js";import"./use-org-auth-client-CF8P1btO.js";import"./task-status-C990ALOP.js";import"./automation-list-row-c065EJtO.js";import"./use-create-virtual-mcp-trxCQUHO.js";import"./index-C7oVr4Gj.js";import"./hover-card-CxtN1xCB.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:Y,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=Y===void 0?"":Y,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:Y,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==Y||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):Y?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=Y,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[Y,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=Y,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Xt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Ye(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Xe(t){const n=Yt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(X=>{const oe=new Set(X);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const X=new Map(d);return X.set(t,{savedContent:a,editorValue:a,loaded:!0}),X})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,X=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:X}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:X}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:X}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Xe,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Ye(J)},children:"Delete"})]})]})})]})}export{qi as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as H,q as V,F as Y,G as Z,H as J,a as M,t as L,o as D,K as q,j as n,C as B,R as W,U as k,e as P,r as T,B as X,L as $,a3 as ee}from"./index-Bja6OpPs.js";import{P as E}from"./index-N_rB2zyq.js";import{u as te}from"./use-org-auth-client-CF8P1btO.js";import{u as ne}from"./use-debounced-autosave-Oryp4cAP.js";import{A as ae}from"./avatar-ETg7Q-GU.js";import{I as G}from"./input-D9gxUyjr.js";import{S as K,a as U,b as F,c as se}from"./settings-section-T0fDyncu.js";import{D as oe}from"./domain-settings-Jn9iDH8k.js";import{S as ie,u as re}from"./constants-Oykg5_q9.js";import{c as le,b as ce,d as ue,f as de,e as ge,g as me,a as fe,A as pe}from"./alert-dialog-DKXzP7Bt.js";import{R as he}from"./require-capability-DVkbMmft.js";import"./sidebar-CAkfGpdS.js";import"./sheet-IM6_8Cdx.js";import"./X-DvNDI9Zw.js";import"./tooltip-BvIsFjJR.js";import"./User01-B1vfX-f8.js";import"./card-lOxFSSkP.js";import"./ArrowUpRight-DDOS_CqL.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-DB7mlnDa.js";import"./use-capability-rrurYBXm.js";import"./access-gate-B8AAPT1T.js";import"./capability-load-error-DVzMymKs.js";const xe=W({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function je(e){const t=P.c(13),{value:y,onChange:h,name:o,disabled:g}=e,c=T.useRef(null);let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c.current?.click(),t[0]=u):u=t[0];const i=u;let l;t[1]!==h?(l=j=>{const f=j.target.files?.[0];if(!f)return;if(f.size>2097152){D.error("Image must be smaller than 2MB");return}const p=new FileReader;p.onerror=ye,p.onloadend=()=>{p.result&&h(p.result),c.current&&(c.current.value="")},p.readAsDataURL(f)},t[1]=h,t[2]=l):l=t[2];const a=l;let s;t[3]!==g||t[4]!==a?(s=n.jsx("input",{ref:c,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:g}),t[3]=g,t[4]=a,t[5]=s):s=t[5];const r=y||void 0,d=o??"?";let m;t[6]!==r||t[7]!==d?(m=n.jsx(ae,{url:r,fallback:d,shape:"square",size:"base"}),t[6]=r,t[7]=d,t[8]=m):m=t[8];let x;return t[9]!==g||t[10]!==s||t[11]!==m?(x=n.jsxs("button",{type:"button",onClick:i,disabled:g,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,m]}),t[9]=g,t[10]=s,t[11]=m,t[12]=x):x=t[12],x}function ye(){return D.error("Failed to read image")}function ve(){const e=H(),{org:t}=V(),y=te(),h=Y(),o=Z({resolver:J(xe),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),g=M({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const r=await y.organization.update({data:s});if(r?.error)throw new Error(r.error.message||"Failed to update organization");return r},onSuccess:(a,s)=>{L("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:q.organizations()}),h.invalidateQueries({queryKey:q.activeOrganization(t.slug)}),D.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{L("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),D.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:c,flush:u}=ne({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const r=o.getValues(),d=o.control._defaultValues;o.reset(r,{keepValues:!0});try{await g.mutateAsync(r)}catch{o.reset(d,{keepValues:!0})}}}),i=o.formState.errors,l=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(K,{children:n.jsxs(U,{children:[n.jsx(F,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(je,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),u()},name:o.watch("name")})}),n.jsx(F,{title:"Name",action:n.jsx(B,{control:o.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:s=>{a.onChange(s),c()},onBlur:()=>{a.onBlur(),u()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(F,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[l&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:l}),n.jsx(B,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const r=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",r,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),c()},onBlur:()=>{a.onBlur(),u()}})})]})}),(i.name||i.slug||i.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[i.name&&n.jsx("p",{className:"text-xs text-destructive",children:i.name.message}),i.slug&&n.jsx("p",{className:"text-xs text-destructive",children:i.slug.message}),i.logo&&n.jsx("p",{className:"text-xs text-destructive",children:i.logo.message})]})]})})}function be(){const e=P.c(45),{org:t}=V(),[y,h]=T.useState(!1),[o,g]=T.useState("");let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:ie,orgSlug:t.slug,orgId:t.id},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const u=re(c);let i;e[3]!==t.id||e[4]!==u?(i=async()=>{const v=await u.callTool({name:"ORGANIZATION_DELETE",arguments:{id:t.id}});if(v.isError){const N=v.content,Q=Array.isArray(N)&&N[0]?.type==="text"&&typeof N[0].text=="string"?N[0].text:"Failed to delete organization";throw new Error(Q)}},e[3]=t.id,e[4]=u,e[5]=i):i=e[5];let l;e[6]!==t.id||e[7]!==t.slug?(l=()=>{L("organization_deleted",{organization_id:t.id}),localStorage.getItem($.lastOrgSlug())===t.slug&&localStorage.removeItem($.lastOrgSlug()),ee(),D.success("Organization deleted"),window.location.href="/"},e[6]=t.id,e[7]=t.slug,e[8]=l):l=e[8];let a;e[9]!==i||e[10]!==l?(a={mutationFn:i,onSuccess:l,onError:Se},e[9]=i,e[10]=l,e[11]=a):a=e[11];const s=M(a);let r;e[12]===Symbol.for("react.memo_cache_sentinel")?(r=()=>h(!0),e[12]=r):r=e[12];let d;e[13]!==s.isPending?(d=n.jsx(K,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(U,{className:"border-destructive/40",children:n.jsx(F,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(X,{variant:"destructive",size:"sm",onClick:r,disabled:s.isPending,children:"Delete"})})})}),e[13]=s.isPending,e[14]=d):d=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=v=>{h(v),v||g("")},e[15]=m):m=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(le,{children:"Delete Organization?"}),e[16]=x):x=e[16];let j;e[17]!==t.name?(j=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[17]=t.name,e[18]=j):j=e[18];let f;e[19]!==t.name?(f=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[19]=t.name,e[20]=f):f=e[20];let p;e[21]===Symbol.for("react.memo_cache_sentinel")?(p=v=>g(v.target.value),e[21]=p):p=e[21];let b;e[22]!==o||e[23]!==t.name?(b=n.jsx(G,{value:o,onChange:p,placeholder:t.name,autoFocus:!0}),e[22]=o,e[23]=t.name,e[24]=b):b=e[24];let S;e[25]!==b||e[26]!==j||e[27]!==f?(S=n.jsxs(ce,{children:[x,n.jsx(ue,{asChild:!0,children:n.jsxs("div",{children:[j,f,b]})})]}),e[25]=b,e[26]=j,e[27]=f,e[28]=S):S=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(de,{children:"Cancel"}),e[29]=A):A=e[29];let z;e[30]!==s?(z=()=>s.mutate(),e[30]=s,e[31]=z):z=e[31];const R=o!==t.name||s.isPending,I=s.isPending?"Deleting…":"Delete organization";let C;e[32]!==z||e[33]!==R||e[34]!==I?(C=n.jsxs(ge,{children:[A,n.jsx(me,{onClick:z,disabled:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:I})]}),e[32]=z,e[33]=R,e[34]=I,e[35]=C):C=e[35];let _;e[36]!==S||e[37]!==C?(_=n.jsxs(fe,{children:[S,C]}),e[36]=S,e[37]=C,e[38]=_):_=e[38];let w;e[39]!==y||e[40]!==_?(w=n.jsx(pe,{open:y,onOpenChange:m,children:_}),e[39]=y,e[40]=_,e[41]=w):w=e[41];let O;return e[42]!==w||e[43]!==d?(O=n.jsxs(n.Fragment,{children:[d,w]}),e[42]=w,e[43]=d,e[44]=O):O=e[44],O}function Se(e){D.error(e instanceof Error?e.message:"Failed to delete organization")}function ze(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(E,{children:n.jsx(E.Content,{children:n.jsx(E.Body,{children:n.jsxs(se,{children:[n.jsx(E.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(oe,{}),n.jsx(be,{})]})})})}),e[0]=t):t=e[0],t}function Qe(){const e=P.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(he,{capability:"org:manage",area:"general settings",children:n.jsx(ze,{})}),e[0]=t):t=e[0],t}export{Qe as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{e as h,a0 as N,j as i,l as W,B as _,K as E,n as S,c as z}from"./index-Bja6OpPs.js";import{S as p}from"./skeleton-CM-Pi0cm.js";import{n as $}from"./Globe01-Cjaw-3jR.js";import{l as T,F as U}from"./index-CALXjj7d.js";import{F as P,M as B}from"./file-type-icon-DM9XMqae.js";import{a as F}from"./ZoomOut-Bj5jamAx.js";const ee=1e4,L=3;function j(r){return r.trim()?(r.startsWith("/")?r:`/${r}`).replace(/\/+/g,"/"):"/"}function g(r){return r.startsWith("/")?r.slice(1):r}function w(r){return r.trim()?r.startsWith("/")?r:`/${r}`:"/"}function C(r){const e=w(r);if(e==="/")return"/";const t=e.split("/").filter(Boolean);return t.pop(),t.length===0?"/":`/${t.join("/")}`}function te(r,e){const t=e.replace(/^\/+|\/+$/g,"");return w(t?`${r==="/"?"":r}/${t}`:r)}function ne(r,e){return e==="directory"?r:C(r)}function re(r){const e=r.trim();return e?e.includes("/")||e.includes("\\")||e.includes("..")||e.includes("\0")?"Name cannot contain /, \\, or ..":e.startsWith(".")?"Name cannot start with a dot":null:"Name is required"}function R(r){const e=g(r);return e?e.split("/").filter(Boolean).length:0}function se(r,e,t,s=!1){return{files:[...new Set([...r,...t.files])],directories:[...new Set([...e,...t.directories??[]])],truncated:s||!!t.truncated}}function ie(r,e){return R(r)>L&&!e.has(r)}function le(r,e,t=[]){const s=g(r);if(e.includes(s)||t.includes(s))return!0;if(!s)return!1;const n=`${s}/`;return e.some(o=>o.startsWith(n))||t.some(o=>o.startsWith(n))}function oe(r){const e=g(r),t=".deco/blocks/";if(!e.startsWith(t)||!e.endsWith(".json"))return null;const s=e.slice(t.length,-5);try{return decodeURIComponent(s)}catch{return s}}function D(r){if(!r)return"plaintext";const e=r.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?"typescript":e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?"javascript":e.endsWith(".json")?"json":e.endsWith(".md")||e.endsWith(".mdx")?"markdown":e.endsWith(".css")?"css":e.endsWith(".scss")?"scss":e.endsWith(".html")?"html":e.endsWith(".yaml")||e.endsWith(".yml")?"yaml":e.endsWith(".xml")||e.endsWith(".svg")?"xml":e.endsWith(".py")?"python":e.endsWith(".sql")?"sql":e.endsWith(".sh")?"shell":"plaintext"}function ae(r){const e=j(r).split("/").filter(Boolean),t=["/"];let s="";for(const n of e.slice(0,-1))s+=`/${n}`,t.push(s);return t}function ce(r,e=[]){const t={children:[]},s=o=>{const c=j(o).split("/").filter(Boolean);let f=t,m="";for(const d of c){m+=`/${d}`;let l=f.children.find(u=>u.name===d);l?l.kind==="file"&&(l.kind="directory"):(l={name:d,path:m,kind:"directory",children:[]},f.children.push(l)),f=l}};for(const o of r){const c=j(o).split("/").filter(Boolean);let f=t,m="";c.forEach((d,l)=>{m+=`/${d}`;const u=l===c.length-1;let x=f.children.find(k=>k.name===d);x||(x={name:d,path:m,kind:u?"file":"directory",children:[]},f.children.push(x)),f=x})}for(const o of e)s(w(o));const n=o=>{o.sort((a,c)=>a.kind!==c.kind?a.kind==="directory"?-1:1:a.name.localeCompare(c.name));for(const a of o)a.children.length>0&&n(a.children)};return n(t.children),t.children}function M(r,e,t=0){const s=[];for(const n of r)n.name!==".gitkeep"&&(s.push({node:n,depth:t}),n.kind==="directory"&&n.children.length>0&&e.has(n.path)&&s.push(...M(n.children,e,t+1)));return s}function fe(r){return r.split(`
|
|
2
|
-
`).map(e=>{const t=e.match(/^\d+\t(.*)/);return t?t[1]:e}).join(`
|
|
3
|
-
`)}T.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function I(r){const e=h.c(11),{value:t,filename:s}=r,[n]=N(),o=n.theme==="dark"||n.theme==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;let a;e[0]!==s?(a=D(s),e[0]=s,e[1]=a):a=e[1];const c=o?"vs-dark":"light";let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex h-full w-full items-center justify-center",children:i.jsx(W,{size:20,className:"animate-spin text-muted-foreground"})}),e[2]=f):f=e[2];let m,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(m={enabled:!1},d={top:12,bottom:12},e[3]=m,e[4]=d):(m=e[3],d=e[4]);let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={readOnly:!0,domReadOnly:!0,fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:3,wordWrap:"on",minimap:m,padding:d,renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}},e[5]=l):l=e[5];let u;return e[6]!==s||e[7]!==a||e[8]!==c||e[9]!==t?(u=i.jsx(U,{path:s,language:a,value:t,theme:c,loading:f,options:l},s),e[6]=s,e[7]=a,e[8]=c,e[9]=t,e[10]=u):u=e[10],u}function X(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}const q=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),K=new Set(["txt","json","csv","tsv","log","yaml","yml","xml","toml","ts","tsx","js","jsx","py","rb","go","rs","java","sh","sql"]),y=2*1024*1024;function O(r,e){const t=r.split(".").pop()?.toLowerCase()??"";return q.has(t)?"image":t==="pdf"?"pdf":t==="html"||t==="htm"?"html":t==="md"||t==="markdown"?e<=y?"markdown":"download":K.has(t)&&e<=y?"text":"download"}function A(){const r=h.c(2);let e;r[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(p,{className:"h-6 w-2/3"}),r[0]=e):e=r[0];let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex h-full w-full items-center justify-center",children:i.jsxs("div",{className:"flex w-3/4 max-w-md flex-col gap-3 p-6",children:[e,i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(p,{className:"h-3 w-full"}),i.jsx(p,{className:"h-3 w-5/6"}),i.jsx(p,{className:"h-3 w-2/3"})]})]})}),r[1]=t):t=r[1],t}function v(r){const e=h.c(20),{file:t,note:s}=r;let n;e[0]!==t.filename?(n=i.jsx(P,{filename:t.filename,className:"h-12 w-10"}),e[0]=t.filename,e[1]=n):n=e[1];let o;e[2]!==t.filename?(o=i.jsx("span",{className:"text-sm font-medium text-foreground",children:t.filename}),e[2]=t.filename,e[3]=o):o=e[3];let a;e[4]!==t.size?(a=X(t.size),e[4]=t.size,e[5]=a):a=e[5];const c=s?` · ${s}`:"";let f;e[6]!==a||e[7]!==c?(f=i.jsxs("span",{className:"text-xs text-muted-foreground",children:[a,c]}),e[6]=a,e[7]=c,e[8]=f):f=e[8];let m;e[9]!==o||e[10]!==f?(m=i.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[o,f]}),e[9]=o,e[10]=f,e[11]=m):m=e[11];let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx($,{size:14}),e[12]=d):d=e[12];let l;e[13]!==t.downloadUrl||e[14]!==t.filename?(l=i.jsx(_,{asChild:!0,variant:"outline",size:"sm",children:i.jsxs("a",{href:t.downloadUrl,download:t.filename,children:[d,"Download"]})}),e[13]=t.downloadUrl,e[14]=t.filename,e[15]=l):l=e[15];let u;return e[16]!==n||e[17]!==m||e[18]!==l?(u=i.jsx("div",{className:"flex h-full w-full items-center justify-center",children:i.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-border bg-muted/30 px-10 py-8",children:[n,m,l]})}),e[16]=n,e[17]=m,e[18]=l,e[19]=u):u=e[19],u}function b(r){const e=h.c(16),{file:t,markdown:s}=r;let n;e[0]!==t.downloadUrl?(n=E.fileText(t.downloadUrl),e[0]=t.downloadUrl,e[1]=n):n=e[1];let o;e[2]!==t.downloadUrl?(o=async()=>{const l=await fetch(t.downloadUrl,{credentials:"include"});if(!l.ok)throw new Error(`fetch failed: ${l.status}`);return l.text()},e[2]=t.downloadUrl,e[3]=o):o=e[3];let a;e[4]!==n||e[5]!==o?(a={queryKey:n,queryFn:o,staleTime:6e4,retry:!1},e[4]=n,e[5]=o,e[6]=a):a=e[6];const{data:c,isPending:f,isError:m}=S(a);if(f){let l;return e[7]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(A,{}),e[7]=l):l=e[7],l}if(m||c===void 0){let l;return e[8]!==t?(l=i.jsx(v,{file:t,note:"preview unavailable"}),e[8]=t,e[9]=l):l=e[9],l}if(s){const l=`file-preview-${t.key}`;let u;return e[10]!==c||e[11]!==l?(u=i.jsx("div",{className:"h-full overflow-y-auto",children:i.jsx("div",{className:"prose prose-sm dark:prose-invert mx-auto max-w-3xl px-6 py-6",children:i.jsx(B,{id:l,text:c})})}),e[10]=c,e[11]=l,e[12]=u):u=e[12],u}let d;return e[13]!==c||e[14]!==t.filename?(d=i.jsx(I,{value:c,filename:t.filename}),e[13]=c,e[14]=t.filename,e[15]=d):d=e[15],d}function de(r){const e=h.c(15),{file:t}=r;switch(O(t.filename,t.size)){case"image":{let n;return e[0]!==t.downloadUrl||e[1]!==t.filename?(n=i.jsx("div",{className:"flex h-full w-full items-center justify-center overflow-auto bg-muted/30 p-4",children:i.jsx("img",{src:t.downloadUrl,alt:t.filename,className:"max-h-full max-w-full rounded-lg object-contain"})}),e[0]=t.downloadUrl,e[1]=t.filename,e[2]=n):n=e[2],n}case"pdf":{let n;return e[3]!==t.downloadUrl||e[4]!==t.filename?(n=i.jsx("iframe",{src:t.downloadUrl,title:t.filename,className:"block h-full w-full bg-white"}),e[3]=t.downloadUrl,e[4]=t.filename,e[5]=n):n=e[5],n}case"html":{let n;return e[6]!==t.downloadUrl||e[7]!==t.filename?(n=i.jsx("iframe",{src:t.downloadUrl,title:t.filename,sandbox:"allow-scripts",className:"block h-full w-full bg-white"}),e[6]=t.downloadUrl,e[7]=t.filename,e[8]=n):n=e[8],n}case"markdown":{let n;return e[9]!==t?(n=i.jsx(b,{file:t,markdown:!0}),e[9]=t,e[10]=n):n=e[10],n}case"text":{let n;return e[11]!==t?(n=i.jsx(b,{file:t,markdown:!1}),e[11]=t,e[12]=n):n=e[12],n}default:{let n;return e[13]!==t?(n=i.jsx(v,{file:t}),e[13]=t,e[14]=n):n=e[14],n}}}function me(r){const e=h.c(13),{title:t,icon:s,active:n,onClick:o}=r,a=n?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let c;e[0]!==a?(c=z("shrink-0 flex items-center gap-1.5 h-8 rounded-md px-2","[transition:background-color_180ms_ease,color_180ms_ease]",a),e[0]=a,e[1]=c):c=e[1];let f;e[2]!==s?(f=i.jsx("span",{className:"flex size-5 items-center justify-center shrink-0",children:i.jsx(G,{icon:s})}),e[2]=s,e[3]=f):f=e[3];let m;e[4]!==t?(m=i.jsx("span",{className:"whitespace-nowrap text-sm font-medium leading-none",children:t}),e[4]=t,e[5]=m):m=e[5];let d;return e[6]!==n||e[7]!==o||e[8]!==c||e[9]!==f||e[10]!==m||e[11]!==t?(d=i.jsxs("button",{type:"button",onClick:o,"aria-pressed":n,"aria-label":t,className:c,children:[f,m]}),e[6]=n,e[7]=o,e[8]=c,e[9]=f,e[10]=m,e[11]=t,e[12]=d):d=e[12],d}function G(r){const e=h.c(5),{icon:t}=r;if(t.kind==="component"){const{Component:n}=t;let o;return e[0]!==n?(o=i.jsx(n,{className:"size-4"}),e[0]=n,e[1]=o):o=e[1],o}if(t.kind==="url"){let n;return e[2]!==t.src?(n=i.jsx("img",{src:t.src,alt:"",className:"size-4 rounded-sm object-cover"}),e[2]=t.src,e[3]=n):n=e[3],n}let s;return e[4]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(F,{className:"size-4"}),e[4]=s):s=e[4],s}export{L as E,A as F,me as H,de as a,ee as b,ae as c,ce as d,M as e,X as f,D as g,ne as h,w as i,ie as j,C as k,te as l,oe as m,se as n,le as p,fe as s,g as t,re as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aq as st,ar as me,as as it,at as nt,au as Ae,F as pe,av as rt,aw as ot,r as L,ax as lt,ay as at,az as ct,aA as dt,aB as je,aC as mt,aD as ut,aE as ft,e as $,j as i,q as V,c as K,l as Me,aF as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-Bja6OpPs.js";import{u as ge}from"./tooltip-BvIsFjJR.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-Oykg5_q9.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-BNfSbQBW.js";import{i as St}from"./Check-CtI-OH3k.js";import{Y as _t,A as Y,_ as Ct,s as Tt,c as Et}from"./agent-icon-D4vfmbIE.js";import{s as be}from"./Plus-DXVOsj8b.js";import{i as ze}from"./X-DvNDI9Zw.js";import{u as kt,b as It,h as $t,C as ne}from"./agent-capabilities-BE7hHGoA.js";import{u as At,c as Mt}from"./chat-context-Bnval_3z.js";import{N as Lt}from"./agent-icons-UJTit2wi.js";import{u as Oe,a as re,K as Re,P as De,D as Pe,c as zt,S as Ot,v as Rt,b as Dt,C as Pt,s as Ht,d as Ut,e as Bt,f as Ft}from"./sortable.esm-KFDeRhD3.js";import{u as He,a as Ue,o as Qt}from"./use-organization-settings-CVmm-jyI.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-I9tl7R9J.js";import{I as Kt}from"./input-D9gxUyjr.js";import{S as Xt}from"./scroll-area-Ds73tc0J.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-IM6_8Cdx.js";import{S as H}from"./skeleton-CM-Pi0cm.js";import{t as Be}from"./ChevronDown-BL2fNdeZ.js";import{c as Fe}from"./ZoomOut-Bj5jamAx.js";import{g as es,M as ts}from"./types-Dn1K45P2.js";import{I as ss}from"./integration-icon-BffTGZN4.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-CCKXkNYO.js";import{a as as}from"./XCircle-DBS00WN3.js";import{g as cs}from"./use-mcp-prompts-D9JZQ88U.js";import{u as ds,w as ms}from"./tab-id-BFVzx5fb.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-BnsK64En.js";import{s as gs}from"./Trash01-C2MDqKmR.js";import{a as bs,u as ys}from"./use-ai-providers-BQwBnNI3.js";import{a as vs}from"./toolbar-Bnt0c2J3.js";import"./use-collections-e25i0NM-.js";import"./AlertCircle-f1EMyhcF.js";import"./Tool01-D7SzxWeU.js";import"./SwitchHorizontal01-Den03c4j.js";import"./RefreshCcw01-CxP3kNii.js";import"./ArrowUpRight-DDOS_CqL.js";import"./ZapSquare-CC0ClMfp.js";import"./Users03-e9b5gRLu.js";import"./CheckCircle-Dk0E48Vj.js";import"./ChevronLeft-ItYaMHNU.js";import"./ChevronRight-TMlXoq-Z.js";import"./ChevronUp-O10NbvHe.js";import"./DotsVertical-DNPNHBpl.js";import"./Container-B1sUXs1U.js";import"./Eye-DWIY-6KS.js";import"./Globe01-Cjaw-3jR.js";import"./FilterLines-CWRo79Yt.js";import"./Star01-BT882_xb.js";import"./Palette-DkgVQjRz.js";import"./HardDrive-Ddx5WtDi.js";import"./Stars02-lM9wDOP9.js";import"./Key01-ChvR9ujt.js";import"./LinkExternal01-Bo28LxVY.js";import"./Monitor01-Cx9Nl0mU.js";import"./Sun-CNIfXy2-.js";import"./Play-VGEgQ-36.js";import"./SearchMd-B9xeWi0e.js";import"./Settings02-DYlioLKt.js";import"./Shield01-CLHpjaQL.js";import"./Stars01-DDxsFd_C.js";import"./Upload01-BTsf5tML.js";import"./User01-B1vfX-f8.js";import"./Users01-dpqTHJ7Y.js";import"./XClose-BdAeKt9F.js";import"./Zap-aFVcxgaa.js";import"./spinner-D4UjUyLz.js";import"./dialog-DCjJZndp.js";import"./drawer-BTJhbpa8.js";import"./collection-search-BPGQygd8.js";import"./form-DMPH0FOJ.js";import"./label-BL0BsZ1B.js";import"./select-fwtyEN3G.js";import"./tabs-Dsmq9_wP.js";import"./toggle-group-BkLJ1frl.js";import"./connect-desktop-dialog-CqBwflr-.js";import"./popover-OiarPewu.js";import"./command-B3U7wd2O.js";import"./index-DtSBWsbe.js";import"./useInfiniteQuery-Bj3r3xlf.js";import"./infiniteQueryObserver-DFB-ygfX.js";import"./index-lU9yS_Jh.js";import"./question-004-sINsf4GQ.js";import"./checkbox-DWa4G7u9.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-ETg7Q-GU.js";import"./settings-section-T0fDyncu.js";import"./card-lOxFSSkP.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DG_N0P2G.js";import"./use-registry-connections-B6OVBI_G.js";import"./use-connection-BQxCYR_o.js";import"./extract-connection-data-AirIeyvr.js";import"./generate-id-i1xx8q5L.js";import"./collections-NKJwWp8f.js";import"./collection-tabs-C_qWo2-y.js";import"./badge-C8j1DE3m.js";import"./textarea-DGZy_omr.js";import"./connection-form-helpers-D79c5tFA.js";import"./use-infinite-scroll-DcQNoJ7_.js";import"./useSuspenseInfiniteQuery-BbAiO9h1.js";import"./required-auth-layout-CRGKVRTF.js";import"./useRouterState-CI4Wmw4H.js";import"./use-org-sso-D2JNbrnR.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BKbXbMuY.js";import"./file-type-icon-DM9XMqae.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-sJoZ-Wbv.js";import"./decopilot-sse-pool-02ukeQqS.js";import"./create-sse-subscription-BS5983N4.js";function Se(s,e){const t=new Set(e);return s.filter(r=>!t.has(r))}function js(s,e,t){const r=s.slice(0);return r[e]=t,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(s,e,t){super(),this.#n=s,this.#i=t,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(s=>{s.destroy()})}setQueries(s,e){this.#r=s,this.#i=e,me.batch(()=>{const t=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=t.length!==n.length,c=n.some((m,u)=>m!==t[u]),a=o||c,d=a?!0:l.some((m,u)=>{const p=this.#e[u];return!p||!it(m,p)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(t,n).forEach(m=>{m.destroy()}),Se(n,t).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(s=>s.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(s,e){const t=this.#u(s),r=t.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=t.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,t)]}#d(s,e){return e.map((t,r)=>{const n=s[r];return t.defaultedQueryOptions.notifyOnChangeProps?n:t.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(s,e,t){if(e){const r=this.#a,n=t!==void 0&&r!==void 0&&(r.length!==t.length||t.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,t!==void 0&&(this.#a=t),this.#s=nt(this.#s,e(s))),this.#s}return s}#p(){return this.#i?.combine!==void 0&&this.#t.some((s,e)=>s.options.suspense&&this.#e[e]?.data===void 0)}#u(s){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const t=[];return s.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);t.push({defaultedQueryOptions:n,observer:o})}),t}#f(s,e){const t=this.#t.indexOf(s);t!==-1&&(this.#e=js(this.#e,t,e),this.#h())}#h(){if(this.hasListeners()){const s=this.#d(this.#e,this.#c),e=this.#p(),t=this.#s,r=e?t:this.#m(s,this.#i?.combine);(e||t!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:s,...e},t){const r=pe(t),n=rt(),l=ot(),o=L.useMemo(()=>s.map(x=>{const f=r.defaultQueryOptions(x);return f._optimisticResults=n?"isRestoring":"optimistic",f}),[s,r,n]);o.forEach(x=>{lt(x);const f=r.getQueryCache().get(x.queryHash);at(x,l,f)}),ct(l);const[c]=L.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;L.useSyncExternalStore(L.useCallback(x=>u?c.subscribe(me.batchCalls(x)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const g=a.some((x,f)=>je(o[f],x))?a.flatMap((x,f)=>{const h=o[f];if(h&&je(h,x)){const y=new Ae(r,h);return mt(h,y,l)}return[]}):[];if(g.length>0)throw Promise.all(g);const b=a.find((x,f)=>{const h=o[f];return h&&ut({result:x,errorResetBoundary:l,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(s,e){return Ns({...s,queries:s.queries.map(t=>({...t,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(s){const e=$.c(16),{open:t,onOpenChange:r}=s,[n,l]=L.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=x=>l(x.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ys,{}),e[6]=u):u=e[6];let p;e[7]!==n?(p=i.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(L.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=p):p=e[8];let g;e[9]!==m||e[10]!==p?(g=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,p]}),e[9]=m,e[10]=p,e[11]=g):g=e[11];let b;return e[12]!==r||e[13]!==t||e[14]!==g?(b=i.jsx(Yt,{open:t,onOpenChange:r,children:g}),e[12]=r,e[13]=t,e[14]=g,e[15]=b):b=e[15],b}function Cs(s){const e=$.c(32),{org:t}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Ue(),c=jt(),a=pe();let d;e[2]!==t||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(t.slug),type:"active"}),e[2]=t,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=S=>l.includes(S),e[5]=l,e[6]=u):u=e[6];const p=u;let g;e[7]!==l||e[8]!==s?(g=s?l.filter(S=>s.has(S)).length:l.length,e[7]=l,e[8]=s,e[9]=g):g=e[9];const x=g>=te;let f;e[10]!==x||e[11]!==p||e[12]!==o?(f=S=>p(S)||x?Promise.resolve():o.apply(E=>E.includes(S)?null:[...E,S]),e[10]=x,e[11]=p,e[12]=o,e[13]=f):f=e[13];const h=f;let y;e[14]!==o?(y=S=>o.apply(E=>E.filter(k=>k!==S)),e[14]=o,e[15]=y):y=e[15];const w=y;let v;e[16]!==o?(v=S=>o.apply(()=>S),e[16]=o,e[17]=v):v=e[17];const j=v;let N;e[18]!==c||e[19]!==x||e[20]!==p||e[21]!==m||e[22]!==o?(N=async(S,E)=>{await c.update.mutateAsync({id:S.id,data:{metadata:E}}),!p(S.id)&&!x&&await o.apply(k=>k.includes(S.id)?null:[...k,S.id]),await m()},e[18]=c,e[19]=x,e[20]=p,e[21]=m,e[22]=o,e[23]=N):N=e[23];const _=N;let T;return e[24]!==h||e[25]!==x||e[26]!==l||e[27]!==p||e[28]!==w||e[29]!==j||e[30]!==_?(T={homeIds:l,isOnHome:p,atLimit:x,addAgent:h,removeAgent:w,reorder:j,saveAgentMetadata:_},e[24]=h,e[25]=x,e[26]=l,e[27]=p,e[28]=w,e[29]=j,e[30]=_,e[31]=T):T=e[31],T}function Ts(s){const e=$.c(21),{search:t}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==t){const x=new Map(n.map($s));c=t.trim().toLowerCase();const f=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>x.get(y)).filter(Is).filter(f);let h;e[9]!==o?(h=y=>!o.isOnHome(y.id),e[9]=o,e[10]=h):h=e[10],d=n.filter(ks).filter(h).filter(f).sort(Es),e[3]=n,e[4]=o,e[5]=t,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const p=!!c;let g;e[14]!==m||e[15]!==o||e[16]!==p?(g=i.jsx(Os,{home:o,agents:m,hasSearch:p}),e[14]=m,e[15]=o,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=i.jsxs(i.Fragment,{children:[u,g]}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}function Es(s,e){return(s.title??"").localeCompare(e.title??"")}function ks(s){return s.id&&!bt(s.id)}function Is(s){return!!s}function $s(s){return[s.id,s]}function As(s){return s.id}function We(s){const e=$.c(7),{title:t,hint:r}=s;let n;e[0]!==t?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),e[0]=t,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(s){const e=$.c(14),{home:t,agents:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(De,n),re(Re,l));let c;e[2]!==t?(c=g=>{const{active:b,over:x}=g;if(!x||b.id===x.id)return;const f=t.homeIds,h=f.indexOf(b.id),y=f.indexOf(x.id);h===-1||y===-1||t.reorder(Ut([...f],h,y)).catch(zs)},e[2]=t,e[3]=c):c=e[3];const a=c,d=`${t.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==t||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Pe,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(g=>i.jsx(Ds,{agent:g,home:t},g.id))})})}),e[6]=r,e[7]=a,e[8]=t,e[9]=o,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function Ls(s){return s.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(s){const e=$.c(6),{home:t,agents:r,hasSearch:n}=s,[l,o]=L.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==t||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:a.map(m=>i.jsx(Us,{agent:m,home:t},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=t,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(s){return s+20}function qe(s){const e=xe(s.metadata?.ui).filter(l=>!!l.resourceUri).length,t=s.metadata?.ui?.homePrompts,r=Array.isArray(t)?t.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Ds(s){const e=$.c(57),{agent:t,home:r}=s,[n,l]=L.useState(!1);let o;e[0]!==t.id?(o={id:t.id},e[0]=t.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:p}=Dt(o),g=qe(t)||"Quick access";let b;e[2]!==m?(b=Pt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const x=p?.5:void 0,f=p?100:void 0;let h;e[4]!==b||e[5]!==x||e[6]!==f||e[7]!==u?(h={transform:b,transition:u,opacity:x,zIndex:f},e[4]=b,e[5]=x,e[6]=f,e[7]=u,e[8]=h):h=e[8];const y=h,w=p&&"shadow-lg";let v;e[9]!==w?(v=K("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const j=`Drag to reorder ${t.title??t.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let _;e[12]!==c||e[13]!==a||e[14]!==j?(_=i.jsx("button",{type:"button",...c,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=c,e[13]=a,e[14]=j,e[15]=_):_=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(Hs),e[16]=T):T=e[16];const S=t.title??t.id;let E;e[17]!==t.icon||e[18]!==S?(E=i.jsx(Y,{icon:t.icon,name:S,size:"sm"}),e[17]=t.icon,e[18]=S,e[19]=E):E=e[19];const k=t.title??t.id;let C;e[20]!==k?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:k}),e[20]=k,e[21]=C):C=e[21];let I;e[22]!==g?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:g}),e[22]=g,e[23]=I):I=e[23];let A;e[24]!==C||e[25]!==I?(A=i.jsxs("div",{className:"min-w-0 flex-1",children:[C,I]}),e[24]=C,e[25]=I,e[26]=A):A=e[26];const D=n&&"rotate-180";let z;e[27]!==D?(z=K("shrink-0 text-muted-foreground transition-transform",D),e[27]=D,e[28]=z):z=e[28];let O;e[29]!==z?(O=i.jsx(Be,{size:16,className:z}),e[29]=z,e[30]=O):O=e[30];let Q;e[31]!==n||e[32]!==E||e[33]!==A||e[34]!==O?(Q=i.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[E,A,O]}),e[31]=n,e[32]=E,e[33]=A,e[34]=O,e[35]=Q):Q=e[35];let M;e[36]!==t.id||e[37]!==r?(M=()=>r.removeAgent(t.id).catch(Ps),e[36]=t.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${t.title??t.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:P}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let U;e[43]!==_||e[44]!==Q||e[45]!==R?(U=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[_,Q,R]}),e[43]=_,e[44]=Q,e[45]=R,e[46]=U):U=e[46];let B;e[47]!==t||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:t,home:r}),e[47]=t,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==U||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[U,B]}),e[51]=d,e[52]=y,e[53]=U,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ps(){return W.error("Couldn't remove from home — please try again.")}function Hs(s){return!s}function Us({agent:s,home:e}){const[t,r]=L.useState(!1),[n,l]=L.useState(!1),o=qe(s),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(s.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":t,children:[i.jsx(Y,{icon:s.icon,name:s.title??s.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.title??s.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Be,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),t&&i.jsx(Ke,{agent:s,home:e})]})}function Ke(s){const e=$.c(26),{agent:t,home:r}=s;let n,l,o,c,a,d,m;if(e[0]!==t||e[1]!==r){const f=xe(t.metadata?.ui);let h;e[9]!==t.connections?(h=(t.connections??[]).map(Fs).sort(),e[9]=t.connections,e[10]=h):h=e[10];const y=h;l=t.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=t,c=r,a=y,d=new Set(f.map(Bs)),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Qs,{}),e[17]=p):p=e[17];const g=l??null;let b;e[18]!==t||e[19]!==r||e[20]!==g?(b=i.jsx(L.Suspense,{fallback:p,children:i.jsx(Ks,{agent:t,home:r,curated:g})}),e[18]=t,e[19]=r,e[20]=g,e[21]=b):b=e[21];let x;return e[22]!==m||e[23]!==u||e[24]!==b?(x=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=x):x=e[25],x}function Bs(s){return s.resourceUri}function Fs(s){return s.connection_id}function Qs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),s[0]=e):e=s[0],e}function Ws({agent:s,home:e,connectionIds:t,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(s.id,t),enabled:t.length>0,queryFn:async()=>(await Promise.all(t.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),p=(u?.tools??[]).flatMap(g=>{const b=es(g._meta);return b?[{name:g.name,description:g.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:p}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return t.length===0?null:c?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(a=>a.uiTools.map(d=>i.jsx(qs,{agent:s,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:s,home:e,connection:t,tool:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(s.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:t.id,resourceUri:r.resourceUri}],m={...s.metadata??{},ui:{...s.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(ss,{icon:t.icon,name:t.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(s){const e=$.c(11),{isPinned:t,submitting:r,onClick:n,label:l}=s,o=t?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):t?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=t,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(s){const e=$.c(32),{agent:t,home:r,curated:n}=s,{org:l}=V();let o;e[0]!==t.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:t.id,orgId:l.id,orgSlug:l.slug},e[0]=t.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==t.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,t.id),e[4]=t.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:p,error:g}=le(m),b=ye(l.slug);let x,f;if(e[12]!==t.id||e[13]!==u||e[14]!==b.prompts){let j;e[17]!==t.id?(j=_=>_.agentId===t.id&&_.promptName,e[17]=t.id,e[18]=j):j=e[18],x=b.prompts.filter(j).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],f=[...N];for(const _ of x)f.some(T=>T.name===_.name)||f.push(_);e[12]=t.id,e[13]=u,e[14]=b.prompts,e[15]=x,e[16]=f}else x=e[15],f=e[16];if(p&&x.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(g&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",t.id,g),null;if(f.length===0)return null;let h;e[22]!==n||e[23]!==f?(h=n??f.map(Gs),e[22]=n,e[23]=f,e[24]=h):h=e[24];let y;e[25]!==h?(y=new Set(h),e[25]=h,e[26]=y):y=e[26];const w=y;let v;return e[27]!==t||e[28]!==r||e[29]!==f||e[30]!==w?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(j=>i.jsx(Js,{agent:t,home:r,prompt:j,allPromptNames:f.map(Xs),isPinned:w.has(j.name)},j.name))}),e[27]=t,e[28]=r,e[29]=f,e[30]=w,e[31]=v):v=e[31],v}function Xs(s){return s.name}function Gs(s){return s.name}function Vs(s){return{name:s.promptName,title:s.title,description:s.description}}function Zs(s){return{name:s.name,title:s.title,description:s.description}}function Js({agent:s,home:e,prompt:t,allPromptNames:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=s.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==t.name):[...a,t.name]:d=n?r.filter(u=>u!==t.name):r;const m={...s.metadata??{},ui:{...s.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.title??Qe(t.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),s[0]=e):e=s[0],e}function ei(s,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const J=1,Ge=`home-board.layout.v${J}`;function Ve(s){return`home-board.layout.v${J}.${s}`}const Ze={version:J,tiles:{},hidden:[]};function ue(s){return!s||s.version!==J?Ze:{version:J,tiles:s.tiles??{},hidden:Array.isArray(s.hidden)?s.hidden:[]}}function ti(s){return Object.keys(s.tiles).length>0||s.hidden.length>0}function si(s){try{const e=localStorage.getItem(Ve(s));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(s,e){try{localStorage.setItem(Ve(s),JSON.stringify(e))}catch{}}async function Ce(s,e){if(!(await fetch(`/api/${s}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(s){const e=$.c(24),t=pe();let r;e[0]!==s?(r=oe.boardLayout(s),e[0]=s,e[1]=r):r=e[1];const n=r;let l;e[2]!==s?(l=si(s),e[2]=s,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==s?(c=async()=>{const h=await fetch(`/api/${s}/kv/${Ge}`);if(h.status===404)return o&&ti(o)?(await Ce(s,o),o):Ze;if(!h.ok)throw new Error("Failed to load board layout");const y=await h.json(),w=ue(y.value);return _e(s,w),w},e[4]=o,e[5]=s,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==s?(u={mutationFn:h=>Ce(s,h)},e[11]=s,e[12]=u):u=e[12];const p=ht(u);let g;e[13]!==p||e[14]!==s||e[15]!==t||e[16]!==n?(g=h=>{_e(s,h),t.setQueryData(n,h),p.mutate(h)},e[13]=p,e[14]=s,e[15]=t,e[16]=n,e[17]=g):g=e[17];const b=g;let x;e[18]!==d?(x=ue(d),e[18]=d,e[19]=x):x=e[19];let f;return e[20]!==m||e[21]!==b||e[22]!==x?(f={layout:x,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=x,e[23]=f):f=e[23],f}const Je=L.createContext(null);function ni(s){const e=$.c(24),{children:t}=s,{org:r}=V(),n=ii(r.slug),[l,o]=L.useState(!1),[c,a]=L.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const p=u;let g;e[3]!==c||e[4]!==n?(g=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=g):g=e[5];const b=g,x=l&&c!==null,f=x?c:n.layout;let h;e[6]!==c||e[7]!==x||e[8]!==n.layout?(h=x?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=x,e[8]=n.layout,e[9]=h):h=e[9];const y=h;let w;e[10]!==l||e[11]!==n?(w=_=>{l?a(_):n.save(_)},e[10]=l,e[11]=n,e[12]=w):w=e[12];const v=w;let j;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==f||e[18]!==b||e[19]!==n.isLoading?(j={isEditMode:l,enter:m,cancel:p,save:b,hasChanges:y,layout:f,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=f,e[18]=b,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==t||e[22]!==j?(N=i.jsx(Je.Provider,{value:j,children:t}),e[21]=t,e[22]=j,e[23]=N):N=e[23],N}function Ye(){const s=L.useContext(Je);if(!s)throw new Error("useHomeEdit must be used within a HomeEditProvider");return s}function ri({agentId:s}){const{org:e,locator:t}=V(),r=ee({connectionId:s,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=L.useState(null),[a,d]=L.useState(!1),m=L.useRef(!1),u=async(f,h)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,f.name,h),w={type:"doc",content:[{type:"paragraph",content:[rs({id:f.name,name:os(f.name,ls(f._meta)),metadata:y.messages,char:"/",kind:"prompt",args:h}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,t,v,{tiptapDoc:w}),await n({id:v,virtual_mcp_id:s}),l(v,s,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},p=async f=>{if(!m.current){if(f.arguments&&f.arguments.length>0){c(f);return}await u(f)}},g=async f=>{if(!o)return;const h=o;c(null),await u(h,f)};return{start:p,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const f=crypto.randomUUID();await n({id:f,virtual_mcp_id:s}),l(f,s)}catch(f){console.error("[start-thread-from-prompt] startBlank failed",f),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:f=>c(f),onSubmit:g}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends L.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,t){console.error("[home-tiles] tile crashed:",e,t.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(pt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ai(s){const e=$.c(72),{tiles:t,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=s,a=ge(),d=L.useRef(null),[m,u]=L.useState(null),[p,g]=L.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const x=Oe(re(De,b),re(Re)),f=t.reduce(ci,0),h=r?Math.max(f+2,4):Math.max(f,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const w=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=M=>{u(String(M.active.id)),g(w())},e[2]=v):v=e[2];const j=v;let N;e[3]!==p||e[4]!==l||e[5]!==t?(N=M=>{const F=String(M.active.id),P=p??w();if(u(null),g(null),!P||P.cellWidth<=0)return;const R=t.find(q=>q.id===F);if(!R)return;const U=Math.round(M.delta.x/P.cellWidth),B=Math.round(M.delta.y/P.cellHeight);U===0&&B===0||l(F,{x:R.x+U,y:R.y+B})},e[3]=p,e[4]=l,e[5]=t,e[6]=N):N=e[6];const _=N;if(a){let M;if(e[7]!==n||e[8]!==t){let P;e[10]!==n?(P=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(R)})},R.id),e[10]=n,e[11]=P):P=e[11],M=t.map(P),e[7]=n,e[8]=t,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let T,S,E,k,C,I,A,D,z;if(e[14]!==m||e[15]!==p||e[16]!==r||e[17]!==_||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==x||e[22]!==t||e[23]!==h){const M=m?t.find(Z=>Z.id===m):null;S=Pe,D=x,z=j,E=_;const F=h*X,P=r?X*4:X;let R;e[33]!==F||e[34]!==P?(R={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=R):R=e[35];let U;e[36]!==r||e[37]!==t||e[38]!==h?(U=r&&i.jsx(di,{rows:h,tiles:t}),e[36]=r,e[37]=t,e[38]=h,e[39]=U):U=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==t){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=t.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=t,e[46]=B}else B=e[46];e[53]!==R||e[54]!==U||e[55]!==B?(k=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[U,B]}),e[53]=R,e[54]=U,e[55]=B,e[56]=k):k=e[56],T=Bt,C=null;const q=M&&p?M.w*p.cellWidth-Te:void 0,ae=M&&p?M.h*p.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(I={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=I):I=e[59],A=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(fe,{children:n(M)})}),e[14]=m,e[15]=p,e[16]=r,e[17]=_,e[18]=c,e[19]=o,e[20]=n,e[21]=x,e[22]=t,e[23]=h,e[24]=T,e[25]=S,e[26]=E,e[27]=k,e[28]=C,e[29]=I,e[30]=A,e[31]=D,e[32]=z}else T=e[24],S=e[25],E=e[26],k=e[27],C=e[28],I=e[29],A=e[30],D=e[31],z=e[32];let O;e[60]!==T||e[61]!==C||e[62]!==I||e[63]!==A?(O=i.jsx(T,{dropAnimation:C,style:I,children:A}),e[60]=T,e[61]=C,e[62]=I,e[63]=A,e[64]=O):O=e[64];let Q;return e[65]!==S||e[66]!==E||e[67]!==k||e[68]!==O||e[69]!==D||e[70]!==z?(Q=i.jsxs(S,{sensors:D,onDragStart:z,onDragEnd:E,children:[k,O]}),e[65]=S,e[66]=E,e[67]=k,e[68]=O,e[69]=D,e[70]=z,e[71]=Q):Q=e[71],Q}function ci(s,e){return Math.max(s,e.y+e.h)}function di(s){const e=$.c(7),{rows:t,tiles:r}=s;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==t){o=[];for(let a=0;a<t;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=t,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(s){return i.jsx("div",{className:"absolute p-1",style:{left:`${s.x/G*100}%`,top:s.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${s.x}-${s.y}`)}function ui(s){const e=$.c(31),{tile:t,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=s,a=!r;let d;e[0]!==a||e[1]!==t.id?(d={id:t.id,disabled:a},e[0]=a,e[1]=t.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:p,isDragging:g}=Ft(d),b=`${t.x/G*100}%`,x=`${t.w/G*100}%`,f=t.y*X,h=t.h*X,y=g||n,w=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let j;e[3]!==w||e[4]!==v?(j=K("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=j):j=e[5];let N;e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x?(N={left:b,top:f,width:x,height:h},e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=N):N=e[10];const _=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==_?(T=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",_),e[11]=_,e[12]=T):T=e[12];let S;e[13]!==u||e[14]!==r||e[15]!==p||e[16]!==o||e[17]!==l||e[18]!==t?(S=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...p,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:t,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=p,e[16]=o,e[17]=l,e[18]=t,e[19]=S):S=e[19];let E;e[20]!==c?(E=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=E):E=e[21];let k;e[22]!==E||e[23]!==T||e[24]!==S?(k=i.jsxs("div",{className:T,children:[S,E]}),e[22]=E,e[23]=T,e[24]=S,e[25]=k):k=e[25];let C;return e[26]!==m||e[27]!==k||e[28]!==j||e[29]!==N?(C=i.jsx("div",{ref:m,className:j,style:N,children:k}),e[26]=m,e[27]=k,e[28]=j,e[29]=N,e[30]=C):C=e[30],C}function fi(s){const e=$.c(43),{tile:t,onResize:r,onRemove:n}=s,l=t.minW??1,o=t.minH??1;let c,a,d,m,u,p,g;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==t.h||e[4]!==t.id||e[5]!==t.w){let v;e[13]!==o||e[14]!==l?(v=S=>{const E=ie[S];return E.w>=l&&E.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const j=Ee.filter(v);let N;e[16]!==t.h||e[17]!==t.w?(N=(()=>{for(const E of Ee){const k=ie[E];if(k.w===t.w&&k.h===t.h)return E}return null})(),e[16]=t.h,e[17]=t.w,e[18]=N):N=e[18];const _=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(fs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(Tt,{size:16})})}),e[19]=g):g=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let T;e[21]!==_||e[22]!==r||e[23]!==t.id?(T=S=>{const E=ie[S];return i.jsxs(Ne,{onSelect:()=>r(t.id,E),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[S]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:_===S?"✓":`${E.w}×${E.h}`})]},S)},e[21]=_,e[22]=r,e[23]=t.id,e[24]=T):T=e[24],p=j.map(T),e[0]=o,e[1]=l,e[2]=r,e[3]=t.h,e[4]=t.id,e[5]=t.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=p,e[12]=g}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],p=e[11],g=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let x;e[26]!==n||e[27]!==t.id?(x=()=>n(t.id),e[26]=n,e[27]=t.id,e[28]=x):x=e[28];let f;e[29]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=f):f=e[29];let h;e[30]!==x?(h=i.jsxs(Ne,{onSelect:x,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[30]=x,e[31]=h):h=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==p||e[37]!==h?(y=i.jsxs(c,{align:d,className:m,children:[u,p,b,h]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=p,e[37]=h,e[38]=y):y=e[38];let w;return e[39]!==a||e[40]!==y||e[41]!==g?(w=i.jsxs(a,{children:[g,y]}),e[39]=a,e[40]=y,e[41]=g,e[42]=w):w=e[42],w}function hi(s,e,t){return s.some(r=>e>=r.x&&e<r.x+r.w&&t>=r.y&&t<r.y+r.h)}function he(s,e,t){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<t&&l;o++)for(let c=0;c<e&&l;c++)hi(s,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(s,e,t={w:1,h:1}){const r=Math.max(t.w,Math.min(G,s)),n=Math.max(t.h,Math.min(6,e));return{w:r,h:n}}function de(s,e,t){const r=Math.max(0,Math.min(G-t,s)),n=Math.max(0,e);return{x:r,y:n}}function pi(s,e,t){const r=s.find(a=>a.id===e);if(!r)return s;const n=s.filter(a=>a.id!==e),l=n.find(a=>t.x>=a.x&&t.x<a.x+a.w&&t.y>=a.y&&t.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return s.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:t.x,y:t.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(s){const e=$.c(35),{layout:t,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==t.hidden?(l=new Set(t.hidden),e[0]=t.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==s||e[3]!==o||e[4]!==t.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const w=s.filter(y);c=new Map;for(const v of s)v.minSize&&c.set(v.id,v.minSize);for(const v of w){const j=t.tiles[v.id];if(!j)continue;const N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),{x:S,y:E}=de(j.x,j.y,_);a.push({id:v.id,x:S,y:E,w:_,h:T,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(E=>E.id===v.id))continue;const j=v.defaultSize??li,N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),S=he(a,_,T);a.push({id:v.id,x:S.x,y:S.y,w:_,h:T,minW:N?.w,minH:N?.h})}e[2]=s,e[3]=o,e[4]=t.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==s?(d=new Set(s.map(gi)),e[9]=s,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,w)=>{const v={};for(const j of y)v[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:J,tiles:v,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const p=u;let g;e[14]!==a?(g={visible:a},e[14]=a,e[15]=g):g=e[15];let b;e[16]!==p||e[17]!==t||e[18]!==a?(b=(y,w)=>{const v=a.find(_=>_.id===y);if(!v)return;const j=de(w.x,w.y,v.w);if(j.x===v.x&&j.y===v.y)return;const N=pi(a,y,j);p(N,t.hidden)},e[16]=p,e[17]=t,e[18]=a,e[19]=b):b=e[19];let x;e[20]!==p||e[21]!==t||e[22]!==c||e[23]!==a?(x=(y,w)=>{const v=a.find(k=>k.id===y);if(!v)return;const j=c.get(y),{w:N,h:_}=ce(w.w,w.h,j);if(N===v.w&&_===v.h)return;const T={...v,w:N,h:_,x:de(v.x,v.y,N).x},S=a.filter(k=>k.id!==y),E=[T];for(const k of S){const C=he(E,k.w,k.h);E.push({...k,x:C.x,y:C.y})}p(E,t.hidden)},e[20]=p,e[21]=t,e[22]=c,e[23]=a,e[24]=x):x=e[24];let f;e[25]!==p||e[26]!==t||e[27]!==a?(f=y=>{const w=a.filter(v=>v.id!==y);p(w,Array.from(new Set([...t.hidden,y])))},e[25]=p,e[26]=t,e[27]=a,e[28]=f):f=e[28];let h;return e[29]!==r||e[30]!==g||e[31]!==b||e[32]!==x||e[33]!==f?(h={snapshot:g,isLoading:r,moveTile:b,resizeTile:x,hideTile:f},e[29]=r,e[30]=g,e[31]=b,e[32]=x,e[33]=f,e[34]=h):h=e[34],h}function gi(s){return s.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(s){return`prompt:${s.agentId}:${s.promptName||"blank"}`}function wi(s){return`tile:${s.agentId}:${s.resourceUri}`}function Ni(s){return s.promptName?s.agentName:s.description}function Si(s){return{name:s.promptName,title:s.title,description:s.description,arguments:s.arguments,_meta:s._meta}}function ve(s){const e=$.c(10);let t;e[0]!==s?(t={agentId:s},e[0]=s,e[1]=t):t=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(t);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(s){const e=$.c(32),{entry:t,isEditMode:r}=s,{open:n,dialog:l,starting:o}=ve(t.agentId);let c;e[0]!==t||e[1]!==n?(c=()=>n(t),e[0]=t,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let p;e[3]!==d||e[4]!==m||e[5]!==u?(p=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=p):p=e[6];let g;e[7]!==t.agentIcon||e[8]!==t.agentName?(g=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[7]=t.agentIcon,e[8]=t.agentName,e[9]=g):g=e[9];let b;e[10]!==t.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:t.title}),e[10]=t.title,e[11]=b):b=e[11];let x;e[12]!==t?(x=Ni(t),e[12]=t,e[13]=x):x=e[13];let f;e[14]!==x?(f=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=f):f=e[15];let h;e[16]!==f||e[17]!==b?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,f]}),e[16]=f,e[17]=b,e[18]=h):h=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=y):y=e[20];let w;e[21]!==o||e[22]!==c||e[23]!==h||e[24]!==y||e[25]!==a||e[26]!==p||e[27]!==g?(w=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:p,children:[g,h,y]}),e[21]=o,e[22]=c,e[23]=h,e[24]=y,e[25]=a,e[26]=p,e[27]=g,e[28]=w):w=e[28];let v;return e[29]!==l||e[30]!==w?(v=i.jsxs(i.Fragment,{children:[w,l]}),e[29]=l,e[30]=w,e[31]=v):v=e[31],v}function Ci(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Ti)}),s[0]=e):e=s[0],e}function Ti(s,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ei(s){const e=$.c(59),{tile:t,prompts:r,isEditMode:n,tileWidth:l}=s,{org:o}=V();let c;e[0]!==o.id||e[1]!==o.slug||e[2]!==t.connectionId?(c={connectionId:t.connectionId,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=t.connectionId,e[3]=c):c=e[3];const a=ee(c),{open:d,startBlank:m,dialog:u,starting:p}=ve(t.agentId);let g,b,x,f,h;if(e[4]!==a||e[5]!==n||e[6]!==d||e[7]!==o.id||e[8]!==r||e[9]!==m||e[10]!==p||e[11]!==t.agentIcon||e[12]!==t.agentName||e[13]!==t.maxHeight||e[14]!==t.minHeight||e[15]!==t.resourceUri||e[16]!==l){const v=r.filter(ki);f="flex h-full w-full flex-col gap-3 p-3";let j;e[22]!==m?(j=()=>{m()},e[22]=m,e[23]=j):j=e[23];const N=p||n,_=n&&"pl-10 pr-10";let T;e[24]!==_?(T=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",_),e[24]=_,e[25]=T):T=e[25];let S;e[26]!==t.agentIcon||e[27]!==t.agentName?(S=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[26]=t.agentIcon,e[27]=t.agentName,e[28]=S):S=e[28];let E;e[29]!==t.agentName?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[29]=t.agentName,e[30]=E):E=e[30];const k=n?"Drag to rearrange":"Open chat";let C;e[31]!==k?(C=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=C):C=e[32];let I;e[33]!==E||e[34]!==C?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[E,C]}),e[33]=E,e[34]=C,e[35]=I):I=e[35],e[36]!==p||e[37]!==T||e[38]!==S||e[39]!==I||e[40]!==j||e[41]!==N?(h=i.jsxs("button",{type:"button",onClick:j,disabled:N,"aria-busy":p,className:T,children:[S,I]}),e[36]=p,e[37]=T,e[38]=S,e[39]=I,e[40]=j,e[41]=N,e[42]=h):h=e[42],g="flex min-h-0 flex-1 gap-3 overflow-hidden";let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Ii,{}),e[43]=A):A=e[43];const D=t.minHeight??200,z=t.maxHeight??4e3;e[44]!==a||e[45]!==o.id||e[46]!==D||e[47]!==z||e[48]!==t.resourceUri?(b=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(L.Suspense,{fallback:A,children:i.jsx(ts,{resourceURI:t.resourceUri,orgId:o.id,client:a,displayMode:"fullscreen",minHeight:D,maxHeight:z,className:"h-full"})})}),e[44]=a,e[45]=o.id,e[46]=D,e[47]=z,e[48]=t.resourceUri,e[49]=b):b=e[49],x=v.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(O=>i.jsx("button",{type:"button",onClick:()=>d(O),disabled:p,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:O.title})},O.promptName))}),e[4]=a,e[5]=n,e[6]=d,e[7]=o.id,e[8]=r,e[9]=m,e[10]=p,e[11]=t.agentIcon,e[12]=t.agentName,e[13]=t.maxHeight,e[14]=t.minHeight,e[15]=t.resourceUri,e[16]=l,e[17]=g,e[18]=b,e[19]=x,e[20]=f,e[21]=h}else g=e[17],b=e[18],x=e[19],f=e[20],h=e[21];let y;e[50]!==g||e[51]!==b||e[52]!==x?(y=i.jsxs("div",{className:g,children:[b,x]}),e[50]=g,e[51]=b,e[52]=x,e[53]=y):y=e[53];let w;return e[54]!==u||e[55]!==f||e[56]!==h||e[57]!==y?(w=i.jsxs("div",{className:f,children:[h,y,u]}),e[54]=u,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function ki(s){return!!s.promptName}function Ii(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),s[0]=e):e=s[0],e}function $i(s){const e=$.c(14),{icon:t,name:r}=s;let n;e[0]!==t||e[1]!==r?(n=i.jsx(Y,{icon:t,name:r,size:"sm+"}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Ai(s){const e=$.c(33),{tile:t,prompts:r,isEditMode:n}=s,{open:l,startBlank:o,dialog:c,starting:a}=ve(t.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==t.agentIcon||e[6]!==t.agentName){const g=r.filter(Mi);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const x=a||n,f=n&&"pl-10 pr-10";let h;e[12]!==f?(h=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",f),e[12]=f,e[13]=h):h=e[13];let y;e[14]!==t.agentIcon||e[15]!==t.agentName?(y=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[14]=t.agentIcon,e[15]=t.agentName,e[16]=y):y=e[16];let w;e[17]!==t.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[17]=t.agentName,e[18]=w):w=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,v]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==b||e[24]!==x||e[25]!==h||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:x,className:h,children:[y,j]}),e[22]=j,e[23]=b,e[24]=x,e[25]=h,e[26]=y,e[27]=m):m=e[27],u=g.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:g.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=t.agentIcon,e[6]=t.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let p;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(p=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=p):p=e[32],p}function Mi(s){return!!s.promptName}function et(s){const e=$.c(36),{isEditMode:t}=s,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Ue();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const p=u;let g;if(e[4]!==l){g=new Map;for(const C of l){const I=g.get(C.agentId);I?I.push(C):g.set(C.agentId,[C])}e[4]=l,e[5]=g}else g=e[5];let b;if(e[6]!==l||e[7]!==p||e[8]!==o){let C;e[10]!==p?(C=A=>!p.has(A.agentId),e[10]=p,e[11]=C):C=e[11];const I=l.filter(C);b=[...o.map(Ri),...I.map(Oi)],e[6]=l,e[7]=p,e[8]=o,e[9]=b}else b=e[9];const x=b;let f;e[12]!==x?(f=new Map(x.map(zi)),e[12]=x,e[13]=f):f=e[13];const h=f;let y;e[14]!==x||e[15]!==d?(y=x.map(C=>({id:C.id,defaultSize:C.kind==="tile"?bi:vi,minSize:C.kind==="tile"?yi:void 0,pinned:d.has(C.data.agentId)})),e[14]=x,e[15]=d,e[16]=y):y=e[16];const w=xi(y);let v;e[17]!==m?(v=C=>{m.apply(I=>I.filter(A=>A!==C)).catch(Li)},e[17]=m,e[18]=v):v=e[18];const j=v;let N;e[19]!==h||e[20]!==w||e[21]!==d||e[22]!==j?(N=C=>{const I=h.get(C);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(C)},e[19]=h,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const _=N;let T;e[24]!==h||e[25]!==t||e[26]!==g?(T=C=>{const I=h.get(C.id);if(!I)return null;if(I.kind==="tile"){const A=g.get(I.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Ai,{tile:I.data,prompts:A,isEditMode:t}),children:i.jsx(L.Suspense,{fallback:i.jsx($i,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ei,{tile:I.data,prompts:A,isEditMode:t,tileWidth:C.w})})})}return i.jsx(_i,{entry:I.data,isEditMode:t})},e[24]=h,e[25]=t,e[26]=g,e[27]=T):T=e[27];const S=T;if(n||w.isLoading){let C;return e[28]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ci,{}),e[28]=C):C=e[28],C}if(w.snapshot.visible.length===0&&!t)return null;let k;return e[29]!==t||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==_||e[34]!==S?(k=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:w.snapshot.visible,isEditMode:t,renderTile:S,onMove:w.moveTile,onResize:w.resizeTile,onRemove:_})}),e[29]=t,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=_,e[34]=S,e[35]=k):k=e[35],k}function Li(){return W.error("Couldn't remove from home — please try again.")}function zi(s){return[s.id,s]}function Oi(s){return{kind:"prompt",id:ji(s),data:s}}function Ri(s){return{kind:"tile",id:wi(s),data:s}}function Di(s){return s.agentId}function Pi(s){const e=$.c(2),{prompts:t,tiles:r}=ye(s),n=r.length>0||t.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const ke=420,Ie=305;function tt(){const s=$.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}}),s[1]=t):t=s[1];let r;s[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),s[2]=r):r=s[2];let n;return s[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,t,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}})]}),s[3]=n):n=s[3],n}function $e(){const s=$.c(33),{data:e}=gt.useSession(),{org:t}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;s[0]!==t.id?(o=yt(t.id),s[0]=t.id,s[1]=o):o=s[1];const a=l??o;let d;s[2]!==t.slug?(d=qt(t.slug),s[2]=t.slug,s[3]=d):d=s[3],le(d);let m;s[4]!==t.id||s[5]!==t.slug?(m={connectionId:Le,orgId:t.id,orgSlug:t.slug},s[4]=t.id,s[5]=t.slug,s[6]=m):m=s[6];const u=ee(m);let p;s[7]!==t.id||s[8]!==u?(p=bs(u,t.id),s[7]=t.id,s[8]=u,s[9]=p):p=s[9];let g;s[10]!==t.id||s[11]!==u?(g=Qt(u,t.id),s[10]=t.id,s[11]=u,s[12]=g):g=s[12];let b;s[13]!==a.id||s[14]!==t.id||s[15]!==u?(b=wt(t.id,a.id,u),s[13]=a.id,s[14]=t.id,s[15]=u,s[16]=b):b=s[16];let x;s[17]!==p||s[18]!==g||s[19]!==b?(x={queries:[p,g,b]},s[17]=p,s[18]=g,s[19]=b,s[20]=x):x=s[20],Ss(x);const f=ys(),h=Nt(a.id),{hasDecoKey:y,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:j,hasOnlyDecoProvider:N}=kt(),{hasVisibleTiles:_}=Pi(t.slug),T=It(h?.metadata);if(f.length===0&&!(T&&$t(n))){let O;return s[21]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Lt,{})})}),s[21]=O):O=s[21],O}let E;s[22]!==e?.user?.name?(E=e?.user?.name?.split(" ")[0]||"there",s[22]=e?.user?.name,s[23]=E):E=s[23];const k=E,C=y&&v&&j!=null,I=y&&w&&N;let A;s[24]!==j||s[25]!==C||s[26]!==I?(A=C?i.jsx(ne.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(ne.NoCreditsEyebrow,{}):null,s[24]=j,s[25]=C,s[26]=I,s[27]=A):A=s[27];const D=A;let z;return s[28]!==D||s[29]!==_||s[30]!==r||s[31]!==k?(z=i.jsx(ni,{children:r?i.jsx(Hi,{eyebrow:D,userName:k}):i.jsx(Ui,{eyebrow:D,userName:k,hasVisibleTiles:_})}),s[28]=D,s[29]=_,s[30]=r,s[31]=k,s[32]=z):z=s[32],z}function Hi(s){const e=$.c(12),{eyebrow:t,userName:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==t?(l=t&&i.jsx("div",{className:"mb-4",children:t}),e[1]=t,e[2]=l):l=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(s){const e=$.c(32),{eyebrow:t,userName:r,hasVisibleTiles:n}=s,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=L.useState(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!0),e[0]=p):p=e[0];let g;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(g=i.jsx(vs.Right,{children:i.jsx(Bi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:p})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=g):g=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(tt,{}),e[9]=x):x=e[9];const f=n||l?"pt-32":"flex-1 justify-center";let h;e[10]!==f?(h=K("relative flex flex-col items-center px-10 pb-4",f),e[10]=f,e[11]=h):h=e[11];let y;e[12]!==t?(y=t&&i.jsx("div",{className:"mb-4",children:t}),e[12]=t,e[13]=y):y=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==y||e[17]!==w?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,w]}),e[16]=y,e[17]=w,e[18]=v):v=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Fi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,j]}),e[20]=v,e[21]=N):N=e[21];let _;e[22]!==l?(_=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=_):_=e[23];let T;e[24]!==N||e[25]!==_||e[26]!==h?(T=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:h,children:[N,_]})})]}),e[24]=N,e[25]=_,e[26]=h,e[27]=T):T=e[27];let S;return e[28]!==T||e[29]!==g||e[30]!==b?(S=i.jsxs(i.Fragment,{children:[g,b,T]}),e[28]=T,e[29]=g,e[30]=b,e[31]=S):S=e[31],S}function Bi(s){const e=$.c(17),{isEditMode:t,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=s;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(ze,{size:14}),e[3]=p):p=e[3];let g;e[4]!==o?(g=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[p,"Cancel"]}),e[4]=o,e[5]=g):g=e[5];const b=!r;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(St,{size:14}),e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==b?(f=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=l,e[8]=b,e[9]=f):f=e[9];let h;return e[10]!==u||e[11]!==g||e[12]!==f?(h=i.jsxs(i.Fragment,{children:[u,g,f]}),e[10]=u,e[11]=g,e[12]=f,e[13]=h):h=e[13],h}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Fi(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),s[0]=e):e=s[0],e}function Gr(){const s=$.c(2);if(ge()){let r;return s[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx($e,{})}),s[0]=r):r=s[0],r}let t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx($e,{})})})}),s[1]=t):t=s[1],t}export{Gr as default};
|