decocms 4.514.5 → 4.515.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/ActiveShapeUtils-B2LFrfRE.js +1 -0
- package/dist/client/assets/{AlertCircle-xI8XX-bi.js → AlertCircle-BEMVsPah.js} +1 -1
- package/dist/client/assets/AreaChart-D7ncnKTv.js +1 -0
- package/dist/client/assets/{ArrowLeft-BKYzlDQY.js → ArrowLeft-BeJK1krP.js} +1 -1
- package/dist/client/assets/{ArrowUp-Cq3iZIwL.js → ArrowUp-CDPrL6Uz.js} +1 -1
- package/dist/client/assets/BarChart-D63RTQYz.js +1 -0
- package/dist/client/assets/{Building02-C9KWPxlH.js → Building02-BFpUButr.js} +1 -1
- package/dist/client/assets/CartesianChart-Cm278fbS.js +1 -0
- package/dist/client/assets/{CategoricalChart-DkwWvFDx.js → CategoricalChart-CNYNt0vK.js} +2 -2
- package/dist/client/assets/{CheckCircle-D30wPP6A.js → CheckCircle-Iq3Q6LLh.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CknWVrzo.js → ChevronSelectorVertical-02lw_CbG.js} +1 -1
- package/dist/client/assets/{ChevronUp-CFN68hLk.js → ChevronUp-DeTPLyaf.js} +1 -1
- package/dist/client/assets/{Copy01-C73PJJxr.js → Copy01-DQtv3upd.js} +1 -1
- package/dist/client/assets/{CreditCard01-C8DlQ7Ge.js → CreditCard01-4SHg1t_a.js} +1 -1
- package/dist/client/assets/{DotsVertical-BvyfZIer.js → DotsVertical-Drns5Frs.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-Bhpq3Y0r.js → ErrorBarContext-BkdZvkoD.js} +1 -1
- package/dist/client/assets/{Globe04-CVLAzwjm.js → Globe04-BXpRk-hX.js} +1 -1
- package/dist/client/assets/{Image01-DowwsvYG.js → Image01-1LQuy0wG.js} +1 -1
- package/dist/client/assets/{Key01-rbnGMz2E.js → Key01-CoFqvDTW.js} +1 -1
- package/dist/client/assets/{Link01-DRsKyIm5.js → Link01-DU3-3Ipb.js} +1 -1
- package/dist/client/assets/{LinkBroken01-ZRquEJUl.js → LinkBroken01-h_HqMIlK.js} +1 -1
- package/dist/client/assets/{Minus-DPDq6KAA.js → Minus-DpXFgo6a.js} +1 -1
- package/dist/client/assets/{Monitor01-DMME8GIo.js → Monitor01-BbCpGNqh.js} +1 -1
- package/dist/client/assets/{Play-c6bc1b3-.js → Play-C8EB0NeI.js} +1 -1
- package/dist/client/assets/{Plus-xabrshQG.js → Plus-DPS97GtY.js} +1 -1
- package/dist/client/assets/ReferenceLine-zJMNrbMl.js +1 -0
- package/dist/client/assets/{SearchMd-BODiv7c9.js → SearchMd-5E3M_LtW.js} +1 -1
- package/dist/client/assets/Sector-Chcdibol.js +28 -0
- package/dist/client/assets/{ShoppingBag01-DAjyOiiw.js → ShoppingBag01-BlUZ1Giu.js} +1 -1
- package/dist/client/assets/{Sun-BqmeoxcG.js → Sun-Bt6BixS7.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CESO3nxl.js → SwitchHorizontal01-BLJAU7vB.js} +1 -1
- package/dist/client/assets/{Tool01-BGL2Qt57.js → Tool01-DhUw9Xii.js} +1 -1
- package/dist/client/assets/{Trash01-Cf6bGuCZ.js → Trash01-y0tx6OKR.js} +1 -1
- package/dist/client/assets/{Upload01-ZLE7vfB9.js → Upload01-BT7hKOY8.js} +1 -1
- package/dist/client/assets/{User01-Cfg0yVvz.js → User01-Dtm_f3tA.js} +1 -1
- package/dist/client/assets/{UserSquare-DJngEPjS.js → UserSquare-DWYhjY7l.js} +1 -1
- package/dist/client/assets/{Users01-vn3EOu8A.js → Users01-DE8h5H5p.js} +1 -1
- package/dist/client/assets/{XClose-CdzjyNb0.js → XClose-sbj0sr-y.js} +1 -1
- package/dist/client/assets/{ZoomOut-B55seUHX.js → ZoomOut-Ult5yHk2.js} +1 -1
- package/dist/client/assets/{access-gate-CgSSvGG3.js → access-gate-C5s_nhLu.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-O4xCe9BP.js → add-connection-dialog-BbC6Awnv.js} +1 -1
- package/dist/client/assets/agent-analytics-DkajWLZM.js +2 -0
- package/dist/client/assets/agent-app-3J3u6Y8o.js +1 -0
- package/dist/client/assets/agent-assets-arexmZYy.js +1 -0
- package/dist/client/assets/{agent-automation-DBMflQw2.js → agent-automation-CJwaiyVY.js} +1 -1
- package/dist/client/assets/agent-automations-Cgl9-uX7.js +1 -0
- package/dist/client/assets/agent-calendar-CcJ-9tHm.js +1 -0
- package/dist/client/assets/{agent-connect-sources-CX6V3W-l.js → agent-connect-sources-BSWyCv4T.js} +1 -1
- package/dist/client/assets/agent-deck-D77BlzDi.js +1 -0
- package/dist/client/assets/agent-e2e-BZnv0041.js +1 -0
- package/dist/client/assets/agent-experiments-DU-xnevM.js +1 -0
- package/dist/client/assets/agent-file-CEbVOehe.js +1 -0
- package/dist/client/assets/agent-hosting-CLRf1egV.js +1 -0
- package/dist/client/assets/{agent-icon-c0hRUHIU.js → agent-icon-BLy2WH4s.js} +1 -1
- package/dist/client/assets/agent-library-CHysr2dn.js +1 -0
- package/dist/client/assets/agent-library-file-DCoIJ_Vl.js +1 -0
- package/dist/client/assets/agent-monitor-D4SI9Y1m.js +1 -0
- package/dist/client/assets/{agent-overview-C0WObUrB.js → agent-overview-DeQq_tHv.js} +1 -1
- package/dist/client/assets/agent-releases-Cp26QvMd.js +2 -0
- package/dist/client/assets/agent-settings-Bd8cfGLd.js +1 -0
- package/dist/client/assets/agent-site-editor-code-CGFxlenC.js +2 -0
- package/dist/client/assets/agent-site-editor-content-O4R-vecW.js +1 -0
- package/dist/client/assets/agent-site-editor-pMTgGoBo.js +16 -0
- package/dist/client/assets/agent-site-editor-preview-CCdH77a2.js +1 -0
- package/dist/client/assets/agent-view-COR3ZSfj.js +1 -0
- package/dist/client/assets/{agent-view-guard-CY0RZ3mz.js → agent-view-guard-26j3Evt5.js} +1 -1
- package/dist/client/assets/{agents-list-lrkIUH1p.js → agents-list-Dcd5sOX1.js} +1 -1
- package/dist/client/assets/{ai-providers-BJRpwnf3.js → ai-providers-C2RBL7tG.js} +2 -2
- package/dist/client/assets/alert-BV79ffMP.js +1 -0
- package/dist/client/assets/{alert-dialog-M8Y0zqSA.js → alert-dialog-BILupwtl.js} +3 -3
- package/dist/client/assets/analytics-sections-Wnoh3PYg.js +1 -0
- package/dist/client/assets/api-keys-BO3F5W2N.js +1 -0
- package/dist/client/assets/{api-keys-BuJhmHVr.js → api-keys-Drifqas3.js} +1 -1
- package/dist/client/assets/app-editor-DkKkzh3V.js +1 -0
- package/dist/client/assets/{asset-utils-D4ZYWTsd.js → asset-utils-CV_m_T7Z.js} +1 -1
- package/dist/client/assets/{auth-CJCUdDnK.js → auth-B7U7Hff4.js} +1 -1
- package/dist/client/assets/{auth-catchall-PMDrOrh4.js → auth-catchall-BM3zBwm1.js} +1 -1
- package/dist/client/assets/{auth-entry-D45yK4lP.js → auth-entry-BdihVcdH.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BeoAmW98.js → auth-split-layout-CPsRiXhM.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-D7W1mkzH.js → authenticate-and-persist-oauth-UvzpQNLL.js} +1 -1
- package/dist/client/assets/automation-list-row-CmreC44g.js +1 -0
- package/dist/client/assets/{automation-runs-7CDwsw1m.js → automation-runs-Ubm7wrw7.js} +1 -1
- package/dist/client/assets/{automations-DpOWGNx_.js → automations-ZAC4-o9b.js} +1 -1
- package/dist/client/assets/{autosend-BiXCzDoT.js → autosend-DEKkS89d.js} +1 -1
- package/dist/client/assets/{avatar-CVrfZDpI.js → avatar-BaUatl4r.js} +1 -1
- package/dist/client/assets/badge-BDrcnhS0.js +1 -0
- package/dist/client/assets/{block-document-EFEgqy7V.js → block-document-DWpcrKxc.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-FfAtB7Mh.js → blocks-preview-workspace-context-CNobOsoP.js} +1 -1
- package/dist/client/assets/blocks-tab-states-5KLuOsbu.js +1 -0
- package/dist/client/assets/blog-schema-BKkPmh2I.js +1 -0
- package/dist/client/assets/{buckets-EuucCx-Z.js → buckets-CfPMmliP.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-0HVt3TgE.js → build-improve-prompt-doc-DJbnBElj.js} +1 -1
- package/dist/client/assets/{calendar-B3WUDV6V.js → calendar-CCVXvCMs.js} +1 -1
- package/dist/client/assets/campaigns-view-CacWid3q.js +1 -0
- package/dist/client/assets/{capability-load-error-CaA022rx.js → capability-load-error-C-qrhNhU.js} +1 -1
- package/dist/client/assets/category-editor-CcRf7L2l.js +1 -0
- package/dist/client/assets/{chart-B6d33H1D.js → chart-gMXBaCie.js} +1 -1
- package/dist/client/assets/{chat-context-BnuwMOfj.js → chat-context-NcP7iS0u.js} +6 -6
- package/dist/client/assets/{chat-draft-D3EwPWFD.js → chat-draft-MYleVoub.js} +1 -1
- package/dist/client/assets/{checkbox-Dla8kRWj.js → checkbox-TbFNti2k.js} +1 -1
- package/dist/client/assets/{choose-editor-CFsJlwqs.js → choose-editor-CDZ08K_i.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DADJ0ld_.js → cli-auth-success-DMlxLLEu.js} +1 -1
- package/dist/client/assets/{client-icons-M2KssD4J.js → client-icons-DolqWn8Q.js} +1 -1
- package/dist/client/assets/cms-settings-editor-D03L9L4-.js +1 -0
- package/dist/client/assets/{collapsible-BWjY8cOG.js → collapsible-DvAZmEoh.js} +1 -1
- package/dist/client/assets/collection-detail-CQ4bhfmW.js +1 -0
- package/dist/client/assets/{collection-display-button-DcSGVqBT.js → collection-display-button-DTfH30As.js} +1 -1
- package/dist/client/assets/{collection-search-C0nHL4Zi.js → collection-search-C00LN-O5.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BqLbzGMr.js → collection-table-wrapper-DOUS3XlF.js} +1 -1
- package/dist/client/assets/{collection-tabs-DJst1PBn.js → collection-tabs-BjFLrDhl.js} +1 -1
- package/dist/client/assets/{column-rules-C6rmmvcZ.js → column-rules-13kfrugr.js} +1 -1
- package/dist/client/assets/{combobox-DJtWtG8e.js → combobox-CaB-y5Ze.js} +1 -1
- package/dist/client/assets/{coming-soon-page-CycWyIEs.js → coming-soon-page-Cyxpb_RU.js} +1 -1
- package/dist/client/assets/{command-DQxPvzO0.js → command-DF9CyXTP.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BaIOrb8k.js → companion-mcps-section-D4tO5Rpb.js} +1 -1
- package/dist/client/assets/{config-0dQr8OOs.js → config-BpbgNSKK.js} +1 -1
- package/dist/client/assets/{connect-AQ7wxQDD.js → connect-R8YgYoXN.js} +3 -3
- package/dist/client/assets/{connect-layout-CsBnyYo4.js → connect-layout-DCuq7jhf.js} +1 -1
- package/dist/client/assets/{connection-B5x-rxzp.js → connection-CynHS3Ve.js} +1 -1
- package/dist/client/assets/{connection-card-CFqu0_G8.js → connection-card-DWCHVdl-.js} +1 -1
- package/dist/client/assets/{connection-detail-B_xaSLIN.js → connection-detail-BvRd_OKE.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CouK82td.js → connection-form-helpers-Dta5jpsZ.js} +1 -1
- package/dist/client/assets/{connections-CrdtyJFL.js → connections-DhBzJz3R.js} +1 -1
- package/dist/client/assets/content-tab-COTFxvxm.js +22 -0
- package/dist/client/assets/context-DDY4mKfD.js +1 -0
- package/dist/client/assets/{context-menu-CI-AryjZ.js → context-menu-CUU-6Ui3.js} +1 -1
- package/dist/client/assets/{context-shell-BsFUt-ob.js → context-shell-CPsWfJ_3.js} +3 -3
- package/dist/client/assets/{core.esm-DOdwJCI5.js → core.esm-C0uaMHhK.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CDMsJ1wq.js → create-organization-dialog-DaLRO9Sp.js} +1 -1
- package/dist/client/assets/{daily-pulse-A6lEoniM.js → daily-pulse-DKIjgibs.js} +1 -1
- package/dist/client/assets/date-utils-CrvIKg-s.js +1 -0
- package/dist/client/assets/{discover-JQgSyvWz.js → discover-INKGTCGz.js} +1 -1
- package/dist/client/assets/{domain-settings-CNG0968P.js → domain-settings-DL4imbgg.js} +1 -1
- package/dist/client/assets/{drawer-CEiS53oX.js → drawer-CER6tItd.js} +1 -1
- package/dist/client/assets/{editor-DWhRi1_f.js → editor-DiFOLDbd.js} +1 -1
- package/dist/client/assets/{editor-classes-CZOMDDcn.js → editor-classes-BxczJlTk.js} +1 -1
- package/dist/client/assets/{empty-state-B1xpK558.js → empty-state-CEkcxXyE.js} +1 -1
- package/dist/client/assets/{empty-state-BoFIIv2e.js → empty-state-Cfwlgj7K.js} +1 -1
- package/dist/client/assets/experiments-tab-choice-CdB5dK1A.js +1 -0
- package/dist/client/assets/{extract-connection-data-CUvLfXNU.js → extract-connection-data-CnU07SX8.js} +1 -1
- package/dist/client/assets/{feature-gate-B9a4dBc0.js → feature-gate-Dnbny2HW.js} +1 -1
- package/dist/client/assets/{feature-paywall-DINMFUUx.js → feature-paywall-DruRkOvJ.js} +1 -1
- package/dist/client/assets/{file-explorer-2Z0Qhvp_.js → file-explorer-CsrTcKv1.js} +1 -1
- package/dist/client/assets/{file-preview-BFXgyqHl.js → file-preview-CUN1OHJ7.js} +1 -1
- package/dist/client/assets/{file-share-button-BIOHr9Xv.js → file-share-button-CEf0dwMj.js} +2 -2
- package/dist/client/assets/{file-type-icon-Ez8-DRHg.js → file-type-icon-etYEFstF.js} +1 -1
- package/dist/client/assets/{folder-icon-JgTmBbpC.js → folder-icon-8MGsFr-_.js} +2 -2
- package/dist/client/assets/{form-Bdh0vUeg.js → form-xTDgq-Tg.js} +1 -1
- package/dist/client/assets/{general-Dvy5SU0P.js → general-DKLM5WXB.js} +1 -1
- package/dist/client/assets/{home-UtAOwZ_a.js → home-iGYybPDR.js} +1 -1
- package/dist/client/assets/hosted-publish-api-BTYW-kmo.js +1 -0
- package/dist/client/assets/hosted-publish-feedback-DYVOaPsn.js +1 -0
- package/dist/client/assets/{icon-button-Dg2jSe-y.js → icon-button-Ht6P9npC.js} +1 -1
- package/dist/client/assets/{index-CrgWXxvo.js → index-1zZevs0I.js} +1 -1
- package/dist/client/assets/{index-1XeDvVO_.js → index-9equ5l6t.js} +1 -1
- package/dist/client/assets/{index-DxbCP5B6.js → index-B3yMIi0G.js} +1 -1
- package/dist/client/assets/index-BFqmRsAP.js +4 -0
- package/dist/client/assets/{index-DYLyKNcw.js → index-BbK9DXkK.js} +1 -1
- package/dist/client/assets/{index-DincrG3Y.js → index-Br0aaVqT.js} +3 -3
- package/dist/client/assets/{index-ILRCn1qM.js → index-CLvpgcGt.js} +6 -6
- package/dist/client/assets/{index-CXeJCI0G.js → index-CNohvsnC.js} +1 -1
- package/dist/client/assets/{index-_y92DzgS.js → index-D32uzOTA.js} +1 -1
- package/dist/client/assets/{index-7svLQYvL.js → index-DFJe-l7D.js} +1 -1
- package/dist/client/assets/{index-DKOhwHAG.js → index-DKwDh9fC.js} +1 -1
- package/dist/client/assets/{index-DcU2uHG-.js → index-DQaJBLJ-.js} +54 -54
- package/dist/client/assets/index-EoMx4WDO.css +1 -0
- package/dist/client/assets/{index-WjQsIrkp.js → index-IRwT0rOS.js} +1 -1
- package/dist/client/assets/{index-6B342dVL.js → index-TESbMzS4.js} +1 -1
- package/dist/client/assets/{index-De44zW_k.js → index-hUmTzopE.js} +1 -1
- package/dist/client/assets/{index-redirect-BHJ13xlS.js → index-redirect-WdHUcKlN.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-P7ZNg4ZF.js → infiniteQueryObserver-Bia8aY1D.js} +1 -1
- package/dist/client/assets/infra-billing-CANL7vGd.js +1 -0
- package/dist/client/assets/{input-pg_Munw1.js → input-DQpuKkGH.js} +7 -7
- package/dist/client/assets/{input-HXHaYrka.js → input-rj9iyl8c.js} +1 -1
- package/dist/client/assets/{integration-icon-aeIvRSnw.js → integration-icon-BADY30E3.js} +1 -1
- package/dist/client/assets/{jira-icon-CZLCmGol.js → jira-icon-Bg6wm7Rh.js} +1 -1
- package/dist/client/assets/{label-DDPD5LQh.js → label-DwAqZKXh.js} +1 -1
- package/dist/client/assets/{layout-DGYUOV2D.js → layout-BS48rV-R.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B3GKD6WQ.js → legacy-agents-deep-BsgIlRpK.js} +1 -1
- package/dist/client/assets/legacy-main-redirect-CpUMHeOI.js +1 -0
- package/dist/client/assets/library-D-XIUCN0.js +1 -0
- package/dist/client/assets/{login-syjpZA32.js → login-Bx_Dj1KX.js} +1 -1
- package/dist/client/assets/{markdown-1PeXOKNt.js → markdown-DCFmpcRh.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DTPlWHGT.js → mcp-app-renderer-DlDykQO4.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DP6VNnFQ.js → mcp-oauth-BV1FnXP9.js} +1 -1
- package/dist/client/assets/{mcp-oauth-xBzZujQ_.js → mcp-oauth-DHudAstl.js} +1 -1
- package/dist/client/assets/{members-uR8n9Rms.js → members-lS9QzMri.js} +1 -1
- package/dist/client/assets/{memory-BYqDBVHV.js → memory-Dt2VdoJi.js} +2 -2
- package/dist/client/assets/{mini-report-page-D7tpDtif.js → mini-report-page-SkCZ-B7b.js} +1 -1
- package/dist/client/assets/{mock-board-BOSDq94-.js → mock-board-b5JcXuBT.js} +3 -3
- package/dist/client/assets/{monaco-editor-e80GuCNv.js → monaco-editor-B77kgSL6.js} +2 -2
- package/dist/client/assets/monitoring-CN_CCaIK.js +1 -0
- package/dist/client/assets/{monitoring-stats-row-94Mta4Nq.js → monitoring-stats-row-DfhuiMFd.js} +1 -1
- package/dist/client/assets/{multi-select-CmbGOwtN.js → multi-select-BcTcaQtg.js} +1 -1
- package/dist/client/assets/mustache-B1PzKbLg.js +4 -0
- package/dist/client/assets/named-rule-uses-l2kNdc58.js +1 -0
- package/dist/client/assets/named-rule-view-VDvju2NZ.js +1 -0
- package/dist/client/assets/{new-project-dialog-ShudNZIG.js → new-project-dialog-C1yGAeBD.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DQtTsT-Q.js → oauth-callback-ai-provider-CSn2MVuO.js} +1 -1
- package/dist/client/assets/{oauth-callback-CuZCWVkp.js → oauth-callback-d5bTE61x.js} +1 -1
- package/dist/client/assets/{onboarding-BYvWDC_s.js → onboarding-DMAd7boI.js} +1 -1
- package/dist/client/assets/{openai-conversation-DgaJVito.js → openai-conversation-DVrrnMH9.js} +2 -2
- package/dist/client/assets/{optimistic-project-sidebar-views-CKzSSiC-.js → optimistic-project-sidebar-views-NiW-ZsA6.js} +1 -1
- package/dist/client/assets/order-monitor-day-D1J-iu59.js +1 -0
- package/dist/client/assets/{organization-choice-D_5aYbIz.js → organization-choice-DtzDl4nE.js} +1 -1
- package/dist/client/assets/{orgs-CN3Yh6bp.js → orgs-CvRk7OxE.js} +1 -1
- package/dist/client/assets/page-seo-form-YDVeWiAp.js +1 -0
- package/dist/client/assets/{pair-Cn70Tm81.js → pair-u6RslQ29.js} +7 -7
- package/dist/client/assets/parse-sections-CBNQNauq.js +1 -0
- package/dist/client/assets/plan-Cs9I3MbI.js +1 -0
- package/dist/client/assets/{plan-ladder-D5aCNSRy.js → plan-ladder-DF2W1fWC.js} +1 -1
- package/dist/client/assets/{popover-CVCbWisj.js → popover-BOhP5vgB.js} +1 -1
- package/dist/client/assets/post-calendar-T4dPJKYM.js +1 -0
- package/dist/client/assets/post-editor-D7KyvZ7t.js +2 -0
- package/dist/client/assets/{preview-content-Bin2hNFJ.js → preview-content-DVXm4Z8s.js} +1 -1
- package/dist/client/assets/{preview-dialog-Fls4giAH.js → preview-dialog-WEx44iRd.js} +1 -1
- package/dist/client/assets/{preview-panel-BPPH_1cI.js → preview-panel-D0nsWsZH.js} +1 -1
- package/dist/client/assets/preview-tab-Dl6aDnQL.js +551 -0
- package/dist/client/assets/product-picker-dialog-BhbqLRJa.js +1 -0
- package/dist/client/assets/{profile-BZA6I0p4.js → profile-DlCjy7UA.js} +1 -1
- package/dist/client/assets/{project-app-view-B2uzp3zO.js → project-app-view-D5kv8H-C.js} +1 -1
- package/dist/client/assets/project-apps-BkYCf7yh.js +1 -0
- package/dist/client/assets/{project-feed-CxXgvjMu.js → project-feed-CnSoTeWf.js} +1 -1
- package/dist/client/assets/{project-icon-Dy5ndHVf.js → project-icon-DeQ6esGK.js} +1 -1
- package/dist/client/assets/project-reports-DQYEQVTh.js +1 -0
- package/dist/client/assets/project-tasks-CyVxacvN.js +1 -0
- package/dist/client/assets/{projects-6tFWscR3.js → projects-B8yQNAzt.js} +1 -1
- package/dist/client/assets/{projects-empty-state-B25sfM8y.js → projects-empty-state-BeIkadaG.js} +1 -1
- package/dist/client/assets/{prompts-C8y9cYvX.js → prompts-GMn4cz1Q.js} +1 -1
- package/dist/client/assets/record-editor-CI7K6OM1.js +1 -0
- package/dist/client/assets/redirect-editor-B5L_G5_H.js +1 -0
- package/dist/client/assets/releases-api-r2wwTMcb.js +1 -0
- package/dist/client/assets/{reports-DZf5GwgJ.js → reports-BSyJkGbx.js} +1 -1
- package/dist/client/assets/reports-DceQf3hD.js +1 -0
- package/dist/client/assets/{reports-onboarding-Ba6c9nYx.js → reports-onboarding-DTyYEPnh.js} +1 -1
- package/dist/client/assets/reports-tab-DhZyGBNJ.js +2 -0
- package/dist/client/assets/repositories-1ckAW2Cr.js +1 -0
- package/dist/client/assets/{repositories-D_HBag21.js → repositories-DTzcHO2P.js} +1 -1
- package/dist/client/assets/{repository-binding-B-JblZ3B.js → repository-binding-WIxmR2C2.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Aq7ItYog.js → repository-import-picker-Bwaz_IkW.js} +1 -1
- package/dist/client/assets/{repository-picker-CigkRPj6.js → repository-picker-C_FPAS2a.js} +1 -1
- package/dist/client/assets/{require-capability-fF33BjRE.js → require-capability-zDRexzvJ.js} +1 -1
- package/dist/client/assets/{required-auth-layout-n4GqwjUS.js → required-auth-layout-C9RNRyLG.js} +1 -1
- package/dist/client/assets/{reset-password-FYcr_EOZ.js → reset-password-D5Z9Z_ZV.js} +1 -1
- package/dist/client/assets/{resizable-B1jyEV0m.js → resizable-rv6DYDSR.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-CDRcFoik.js +1 -0
- package/dist/client/assets/{review-settings-w0gSi3zN.js → review-settings-BOEOAp5O.js} +1 -1
- package/dist/client/assets/{roles-CD7KBus5.js → roles-CvRMacB_.js} +1 -1
- package/dist/client/assets/route-BrdNU9FL.js +1 -0
- package/dist/client/assets/route-CYnJcvFb.js +1 -0
- package/dist/client/assets/route-HQBi1e9d.js +1 -0
- package/dist/client/assets/runnable-block-editor-B9jSPnPq.js +20 -0
- package/dist/client/assets/{sandbox-git-api-CRxdlhrN.js → sandbox-git-api-CH_-QFpD.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Cyz-VR-q.js → sandbox-lifecycle-context-aKdVFwPA.js} +1 -1
- package/dist/client/assets/{schema-DTqdooJM.js → schema-C0M6s76A.js} +1 -1
- package/dist/client/assets/{schema-Jt-SHSRj.js → schema-CtKRQiER.js} +1 -1
- package/dist/client/assets/{scroll-area-DowOzl5a.js → scroll-area-L8VlxVDv.js} +1 -1
- package/dist/client/assets/{search-input-C77c23a_.js → search-input-BCaqzpfC.js} +1 -1
- package/dist/client/assets/{search-toggle-BqUvwbnO.js → search-toggle-BAKgZCht.js} +1 -1
- package/dist/client/assets/{secret-picker-D6q2PbZG.js → secret-picker-Ciz2Oc6M.js} +1 -1
- package/dist/client/assets/{secrets-C6FiSzJz.js → secrets-DWM0UMVi.js} +1 -1
- package/dist/client/assets/{sections-uFSvOb1s.js → sections-DM2-ez5A.js} +1 -1
- package/dist/client/assets/sections-editor-Cs3VV_t6.js +4 -0
- package/dist/client/assets/{select-B47VUguS.js → select-3Bvf55R2.js} +1 -1
- package/dist/client/assets/{select-model-B0eE99E3.js → select-model-BrppT0xN.js} +1 -1
- package/dist/client/assets/seo-editor-qr_EWKDI.js +1 -0
- package/dist/client/assets/{separator-tMi_6w_o.js → separator-BARWlQZQ.js} +1 -1
- package/dist/client/assets/settings-tab-BX9Vfre3.js +1 -0
- package/dist/client/assets/{sheet-R9Pr50Sb.js → sheet-BKZqYlDG.js} +1 -1
- package/dist/client/assets/shell-layout-iu5E7VAW.js +1 -0
- package/dist/client/assets/site-draft-actions-01MQ6c7Q.js +12 -0
- package/dist/client/assets/site-draft-view-D-xycIA0.js +2 -0
- package/dist/client/assets/site-editor-CF4F4ijZ.js +1 -0
- package/dist/client/assets/{skills-DTPuV4HK.js → skills-B3sr04ZB.js} +1 -1
- package/dist/client/assets/slider-f1cHo-xI.js +1 -0
- package/dist/client/assets/{sortable.esm-7lfZBBX2.js → sortable.esm-B_g_IXou.js} +1 -1
- package/dist/client/assets/{sso-lvoln_ad.js → sso-8XgQMaoN.js} +1 -1
- package/dist/client/assets/{suggestion-D_Z3LuMt.js → suggestion-B-6wzPND.js} +2 -2
- package/dist/client/assets/{switch-BQFbXMA-.js → switch-CZd0EYW9.js} +1 -1
- package/dist/client/assets/{symbol-CIh5AfyD.js → symbol-BY53tx69.js} +1 -1
- package/dist/client/assets/{synced-repos-DQxi8k5O.js → synced-repos-CWNIOZxK.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-B2rDBqdy.js → tab-icon-glyph-40t6GZmc.js} +1 -1
- package/dist/client/assets/{table-DuCeyVXY.js → table-DDQzGcYG.js} +1 -1
- package/dist/client/assets/{tabs-CJ70csAp.js → tabs-BOwO3aPj.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-vyXzgPAK.js → task-assignee-avatar-mmHhkk0_.js} +1 -1
- package/dist/client/assets/{task-board-CSpxMIw7.js → task-board-S0qduW2n.js} +1 -1
- package/dist/client/assets/{task-route-CeJ19bNy.js → task-route-BCl-VxJy.js} +1 -1
- package/dist/client/assets/{task-status-CFz3dyVR.js → task-status-CNAd19KA.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CfseXo9_.js → taskboard-analytics-BNfa4eCu.js} +1 -1
- package/dist/client/assets/tasks-CtYqrb00.js +1 -0
- package/dist/client/assets/{tasks-C3liOhO2.js → tasks-Cz1AP9M-.js} +3 -3
- package/dist/client/assets/{textarea-BDWvYouR.js → textarea-CGkc_NoY.js} +1 -1
- package/dist/client/assets/{thread-analytics-Bp5Zz9ej.js → thread-analytics-CHcQ4J9G.js} +1 -1
- package/dist/client/assets/{thread-intent-DlbBEzNn.js → thread-intent-D02hOLlA.js} +4 -4
- package/dist/client/assets/{thread-route-DsRsjMOv.js → thread-route-BG5FYdPA.js} +1 -1
- package/dist/client/assets/{thread-route-glK7AgQo.js → thread-route-D5TPqP61.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BW8H1wdb.js → thread-sheet-body-B1Y2cEvJ.js} +1 -1
- package/dist/client/assets/time-range-picker-B8MLDnPR.js +1 -0
- package/dist/client/assets/toggle-group-5-dW1fE5.js +1 -0
- package/dist/client/assets/{tool-namespace-FeAXQzXg.js → tool-namespace-_uAlvwp8.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CTGjpqPD.js → toolbar-icon-button-BQvi-WW6.js} +1 -1
- package/dist/client/assets/{tooltip-BqHx2R4U.js → tooltip-CT8p-4e_.js} +1 -1
- package/dist/client/assets/tooltipContext-BqyDyVHC.js +1 -0
- package/dist/client/assets/{track-vnmuUrPF.js → track-wHia_J2E.js} +1 -1
- package/dist/client/assets/{types-Cj3BjtjJ.js → types-CKfFy-n_.js} +6 -6
- package/dist/client/assets/{url-slug-DfovzTSP.js → url-slug-BMSyCRIK.js} +1 -1
- package/dist/client/assets/{usage-stats-DcyLnEOC.js → usage-stats-tSDvCF_c.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DugUJNG4.js → use-ai-providers-D5-3qHgJ.js} +1 -1
- package/dist/client/assets/use-apply-named-rule-BuleRH2R.js +1 -0
- package/dist/client/assets/{use-automations-Dhy5bAQi.js → use-automations-DL7E2sXy.js} +1 -1
- package/dist/client/assets/{use-autosave-BKifxWxQ.js → use-autosave-Bga6Lczj.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CqPKeLYn.js → use-chat-layout-state-CrK3t-li.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CbuQEbGd.js → use-clock-tick-Dt0Rxdj9.js} +1 -1
- package/dist/client/assets/{use-connect-companion-BBUs22Yl.js → use-connect-companion-BQ6P9NqQ.js} +1 -1
- package/dist/client/assets/{use-connection-Dj54skEw.js → use-connection-DEU6cL_M.js} +1 -1
- package/dist/client/assets/use-content-sync-78T7URzs.js +1 -0
- package/dist/client/assets/{use-copy-K9rQ1PJH.js → use-copy-Lp25RdQW.js} +1 -1
- package/dist/client/assets/use-create-virtual-mcp-B5688LVi.js +1 -0
- package/dist/client/assets/{use-date-fns-locale-CEVf4Ifn.js → use-date-fns-locale-DzYqNQVc.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D0TGgFvB.js → use-debounced-autosave-B-FheggT.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CDunmz6Z.js → use-debounced-value-DnWAg7xS.js} +1 -1
- package/dist/client/assets/{use-deco-credits-orVqTX6I.js → use-deco-credits-Dcf7REFq.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-TumByBkr.js → use-decopilot-events-HymesIOH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BllZSjRL.js → use-delete-connection-GE6V1LSr.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BBVz6SL_.js → use-deployment-admin-BMcEtHAq.js} +1 -1
- package/dist/client/assets/use-fast-preview-draft-url-CCAgHiPb.js +1 -0
- package/dist/client/assets/{use-file-configs-BFq_wpSt.js → use-file-configs-C3GELqZ9.js} +1 -1
- package/dist/client/assets/{use-inbox-feed--WBiu__i.js → use-inbox-feed-60_eEWEx.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-7dT9x3fg.js → use-infinite-scroll-CktyBb0n.js} +1 -1
- package/dist/client/assets/{use-join-requests-ilYuD6XT.js → use-join-requests-Daf7hgc3.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-zwxUbRsW.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-2A9iou5g.js → use-mcp-auth-status-Ckh_s_m-.js} +1 -1
- package/dist/client/assets/use-mcp-client-BjCYOtMv.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-JJb6q8dH.js → use-mcp-prompts-D4ntfVw2.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BwuN38Gh.js → use-mcp-tools-BQ-vDoB-.js} +1 -1
- package/dist/client/assets/{use-members-CzSQTDAS.js → use-members-BKwSn6l-.js} +1 -1
- package/dist/client/assets/{use-mobile-BfmJV4wy.js → use-mobile-exvgjs5E.js} +1 -1
- package/dist/client/assets/use-move-blocks-jGxZ60KS.js +1 -0
- package/dist/client/assets/{use-navigate-to-agent-D05JNc-L.js → use-navigate-to-agent-CoDY7b67.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-pmLoKOyH.js → use-open-billing-url-gwWm2_gZ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-fPRUht_a.js → use-org-auth-client-D2nGERnL.js} +1 -1
- package/dist/client/assets/{use-org-fs-D82Vx4hB.js → use-org-fs-DsXUzUGl.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CD8TZnkH.js → use-org-repo-syncs-DTcvfXwj.js} +1 -1
- package/dist/client/assets/{use-org-sso-ClJ8vn5f.js → use-org-sso-BmpgR8iH.js} +1 -1
- package/dist/client/assets/{use-organization-roles-iaQivkLI.js → use-organization-roles-C9fRnsAm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DFkNTsS0.js → use-organization-settings-B5bwnmIE.js} +1 -1
- package/dist/client/assets/use-panel-navigate-D1HcWbMf.js +1 -0
- package/dist/client/assets/use-project-native-view-presence-WBIVN5MA.js +1 -0
- package/dist/client/assets/{use-project-scope-CGMALc0e.js → use-project-scope-0viRZIAS.js} +1 -1
- package/dist/client/assets/{use-recent-apps-C1945uiL.js → use-recent-apps-letFJ0RI.js} +1 -1
- package/dist/client/assets/{use-releases-D15mHXXN.js → use-releases-BzfYz1da.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BdbGTuns.js → use-reports-diagnostic-D4yF4iuL.js} +1 -1
- package/dist/client/assets/{use-secrets-DbkATagb.js → use-secrets-DS9zWxiz.js} +1 -1
- package/dist/client/assets/use-section-preview-base-H9VNpzGF.js +1 -0
- package/dist/client/assets/{use-sidebar-collapsed-BqLmDXCH.js → use-sidebar-collapsed-hUfsznLr.js} +1 -1
- package/dist/client/assets/{use-tags-Cn5U7HDa.js → use-tags-CVvzIGGr.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CftsNPjL.js → use-task-board-analytics-BgxWC82w.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BDk-u9KA.js → use-task-board-events-DBz1fm-T.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-CNMGpOwt.js → use-task-board-item-prs-D2PBN926.js} +1 -1
- package/dist/client/assets/{use-task-metadata-0ueqwOxI.js → use-task-metadata-1k4pU8z_.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-CgQGRl3S.js → use-thread-analytics-D40j8ndA.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DLitie4Q.js → use-thread-outputs-2XKKA9Gw.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-v90E8EIL.js +1 -0
- package/dist/client/assets/{useQueries-BfkCTicr.js → useQueries-DT3VE95i.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BoCx0vyL.js +1 -0
- package/dist/client/assets/{users-BIkPJzOg.js → users-GpxLvhWl.js} +1 -1
- package/dist/client/assets/{utils-Bp3fKbm9.js → utils-CkO9KdKe.js} +2 -2
- package/dist/client/assets/variant-calendar-CrETYYc9.js +1 -0
- package/dist/client/assets/variant-draft-pointer-jrxTxtyS.js +1 -0
- package/dist/client/assets/virtual-mcp-DHPQGUgu.js +1 -0
- package/dist/client/assets/{watch-sse-pool-CrLAsZHh.js → watch-sse-pool-Dc_r60nv.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +684 -684
- package/package.json +1 -1
- package/dist/client/assets/ActiveShapeUtils-CDpScllU.js +0 -1
- package/dist/client/assets/AreaChart-Du66qHXY.js +0 -1
- package/dist/client/assets/BarChart-BXz-bUtC.js +0 -1
- package/dist/client/assets/CartesianChart-BZmgsxge.js +0 -1
- package/dist/client/assets/ReferenceLine-BPq2MnBR.js +0 -1
- package/dist/client/assets/Sector-BraX9V6h.js +0 -28
- package/dist/client/assets/agent-analytics-Biob4Jvo.js +0 -2
- package/dist/client/assets/agent-app-DTwyyqho.js +0 -1
- package/dist/client/assets/agent-assets-DpuZ7qUq.js +0 -1
- package/dist/client/assets/agent-automations-CHJpber1.js +0 -1
- package/dist/client/assets/agent-deck-DRCJIHES.js +0 -1
- package/dist/client/assets/agent-e2e-rlzvrptO.js +0 -1
- package/dist/client/assets/agent-experiments-BzSUejrS.js +0 -1
- package/dist/client/assets/agent-file-pM3fkLSV.js +0 -1
- package/dist/client/assets/agent-hosting-CIblOaW0.js +0 -1
- package/dist/client/assets/agent-library-BF5T38g7.js +0 -1
- package/dist/client/assets/agent-library-file-BTDXrKvZ.js +0 -1
- package/dist/client/assets/agent-monitor-CMU4bHqc.js +0 -1
- package/dist/client/assets/agent-releases-CEAPMdCY.js +0 -2
- package/dist/client/assets/agent-settings-9voN143W.js +0 -1
- package/dist/client/assets/agent-site-editor-WHTbnkdB.js +0 -27
- package/dist/client/assets/agent-site-editor-code-DxTJ31bR.js +0 -2
- package/dist/client/assets/agent-site-editor-content-B8OXp1G1.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-Bu7A4U4r.js +0 -1
- package/dist/client/assets/agent-view-DW3bjKRU.js +0 -1
- package/dist/client/assets/alert-J8Wo4iMe.js +0 -1
- package/dist/client/assets/analytics-sections-Crtm-SOa.js +0 -1
- package/dist/client/assets/api-keys-DPclIgvr.js +0 -1
- package/dist/client/assets/app-editor-CWO6RLKf.js +0 -1
- package/dist/client/assets/automation-list-row-CO-7cr0O.js +0 -1
- package/dist/client/assets/badge-ByzdbptS.js +0 -1
- package/dist/client/assets/blocks-tab-states-diUqUrAK.js +0 -20
- package/dist/client/assets/blog-schema-pXyj_uKN.js +0 -1
- package/dist/client/assets/category-editor-16fFMZmU.js +0 -1
- package/dist/client/assets/cms-settings-editor-Cowvog2q.js +0 -1
- package/dist/client/assets/collection-detail-BVMX_w00.js +0 -1
- package/dist/client/assets/content-tab-CTbbT9Kp.js +0 -22
- package/dist/client/assets/context-DwXA-O6V.js +0 -1
- package/dist/client/assets/hosted-publish-feedback-NabikYNC.js +0 -1
- package/dist/client/assets/index-BqS2UmN9.css +0 -1
- package/dist/client/assets/index-CxtzBp5_.js +0 -4
- package/dist/client/assets/infra-billing-kRHrP-RL.js +0 -1
- package/dist/client/assets/legacy-main-redirect-BdnJuiDi.js +0 -1
- package/dist/client/assets/library-DYD_N6_K.js +0 -1
- package/dist/client/assets/monitoring-CgqK6OeU.js +0 -1
- package/dist/client/assets/mustache-Aw4qvxEW.js +0 -4
- package/dist/client/assets/order-monitor-day-CIHUt3pK.js +0 -1
- package/dist/client/assets/page-seo-form-CnjlIIXj.js +0 -1
- package/dist/client/assets/plan-ByMMI8KU.js +0 -1
- package/dist/client/assets/post-calendar-Dq_uFQwi.js +0 -1
- package/dist/client/assets/post-editor-DPLEIDHY.js +0 -2
- package/dist/client/assets/preview-tab-BHT_7Qja.js +0 -551
- package/dist/client/assets/product-picker-dialog-p0Ic9l9I.js +0 -1
- package/dist/client/assets/project-apps-v-sauknl.js +0 -1
- package/dist/client/assets/project-reports-CZJuTnYB.js +0 -1
- package/dist/client/assets/project-tasks-CGicoIeY.js +0 -1
- package/dist/client/assets/record-editor-Bh04Pm0_.js +0 -1
- package/dist/client/assets/redirect-editor-DQhKbdsA.js +0 -1
- package/dist/client/assets/reports-BupQ5Xhd.js +0 -1
- package/dist/client/assets/reports-tab-aEhqa7te.js +0 -2
- package/dist/client/assets/repositories-CEC-SgTJ.js +0 -1
- package/dist/client/assets/resolve-tab-icon-DtNff2Yq.js +0 -1
- package/dist/client/assets/route-Co7AkL50.js +0 -1
- package/dist/client/assets/route-D9eWdPea.js +0 -1
- package/dist/client/assets/route-P4X0mipC.js +0 -1
- package/dist/client/assets/secret-ciphertext-CI3Fu2ro.js +0 -1
- package/dist/client/assets/sections-editor-BgMrH8fq.js +0 -4
- package/dist/client/assets/seo-editor-C-YMij5b.js +0 -1
- package/dist/client/assets/settings-tab-Cp5pryb2.js +0 -1
- package/dist/client/assets/shell-layout-DNfiem0_.js +0 -1
- package/dist/client/assets/site-editor-Dsm_SPF7.js +0 -1
- package/dist/client/assets/site-editor-toast-L4A-Cxh7.js +0 -1
- package/dist/client/assets/slider-B9iKqweT.js +0 -1
- package/dist/client/assets/tasks-DrfrXIxf.js +0 -1
- package/dist/client/assets/time-range-picker-Dm5YljWh.js +0 -1
- package/dist/client/assets/toggle-group-CtPF-F41.js +0 -1
- package/dist/client/assets/tooltipContext-DFq6ns9J.js +0 -1
- package/dist/client/assets/use-content-sync-D4PHTEJr.js +0 -1
- package/dist/client/assets/use-create-virtual-mcp-C4gtrY2f.js +0 -1
- package/dist/client/assets/use-fast-preview-draft-url-6p2QJIdt.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-kHysLFoZ.js +0 -1
- package/dist/client/assets/use-main-schema-v8-Dcb6Yskn.js +0 -1
- package/dist/client/assets/use-mcp-client-ZokR8_74.js +0 -10
- package/dist/client/assets/use-panel-navigate-K8ACrPML.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-DJiBua9F.js +0 -1
- package/dist/client/assets/use-section-preview-base-De54Y3vh.js +0 -1
- package/dist/client/assets/useInfiniteQuery-B7za82zu.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B0JY_wMj.js +0 -1
- package/dist/client/assets/variant-calendar-BIblXEHb.js +0 -1
- package/dist/client/assets/variant-draft-pointer-fs9iIwvq.js +0 -1
- package/dist/client/assets/virtual-mcp-CeCtCq_o.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,bD as q,dm as R,dn as Ee,dp as ke,dq as Se,aJ as xe,dr as j}from"./index-DcU2uHG-.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),J=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(J);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:J,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Je(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:J,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Je(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
1
|
+
import{r as n,bz as j,dj as R,dk as Ee,dl as ke,dm as Se,aJ as xe,dn as V}from"./index-DQaJBLJ-.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var P='[cmdk-group=""]',_='[cmdk-group-items=""]',je='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",qe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=j(),ne=j(),J=j(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(J);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:J,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:qe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;q().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),z=m.getAttribute("id");return((g=e.get(z))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${P}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=q().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],z=le(S,y);r.current.filtered.items.set(g,z),z>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(P))==null?void 0:o.querySelector(je))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function q(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=q()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=q(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(P),a;for(;s&&!a;)s=e>0?Je(s,P):Ne(s,P),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(q().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),B(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Pe=n.forwardRef((t,l)=>{var r,f;let u=j(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:J,...M}=t;return n.createElement(R.div,{ref:V(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),Ve=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=j(),v=n.useRef(null),b=n.useRef(null),i=j(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:V(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),B(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:V(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:V(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},B(t,i=>n.createElement("div",{ref:V(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),Be=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},B(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:ze,Item:Pe,Input:Oe,Group:Ve,Separator:Le,Dialog:Be,Empty:Ue,Loading:He});function Je(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function B({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as q,b as Z,r as H,j as t,B as se,h as it,l as ve,X as js,T as ys,V as ws,U as He,at as Ut,ar as Yt,as as Bt,t as oe,a2 as Fe,D as Xe,q as Je,s as at,v as lt,H as Ye,a3 as Ss,fF as on,w as Vt,L as Ns,I as Me,ak as cn,z as dn,ey as tt,av as Wt,aj as un,ex as ze,ew as Be,an as Tt,m as Cs,K as Dt,fG as mn,fH as fn,fI as pn,b5 as be,fJ as je,n as Ue,P as hn,d as Pt,u as xn,af as rt,o as ks,e as gn,aM as Ms,y as Ve,b1 as vn,a as bn,fK as _s,fL as jn,aV as yn,ad as wn,aE as Sn,aD as Nn,a5 as Cn,fM as kn,aL as Mn}from"./index-DQaJBLJ-.js";import{g as _n}from"./extract-connection-data-CnU07SX8.js";import{b as Vn}from"./chat-context-NcP7iS0u.js";import{U as Tn,b as Dn}from"./build-improve-prompt-doc-DJbnBElj.js";import{E as Pn}from"./empty-state-CEkcxXyE.js";import{a as On}from"./shell-layout-iu5E7VAW.js";import{g as ft,n as In,a as Kt,e as An,u as $n,f as Fn}from"./use-date-fns-locale-DzYqNQVc.js";import{a as En}from"./mcp-oauth-DHudAstl.js";import{f as zn,e as Rn,b as Ln,A as Un,a as Yn,d as Bn,c as Wn,g as Kn}from"./alert-dialog-BILupwtl.js";import{T as ut}from"./textarea-CGkc_NoY.js";import{c as Ne,T as Ce,a as ke}from"./tooltip-CT8p-4e_.js";import{a as Ot,b as Vs,u as Gn}from"./use-connection-DEU6cL_M.js";import{b as qn,a as Ts,g as Ds,d as Hn,k as Qn}from"./repository-binding-WIxmR2C2.js";import{i as Gt}from"./mcp-oauth-BV1FnXP9.js";import{bg as Xn,k as Jn,bh as Zn,bi as ei,aJ as ti,aD as si,aG as ni,bj as ii,bk as Ps,bl as Os,bm as ai,aq as li,bn as ri,bo as jt,bp as qt,A as Ht,N as oi,bq as ci,br as di,g as Is,p as Qt,n as ui,x as mi,w as fi,v as pi,u as hi,r as xi,f as As,E as Xt,aH as gi,ae as vi,aw as bi}from"./agent-icon-BLy2WH4s.js";import{s as Pe}from"./Plus-DPS97GtY.js";import{t as dt,a as ji}from"./Tool01-DhUw9Xii.js";import{s as It}from"./Trash01-y0tx6OKR.js";import{u as Jt}from"./use-debounced-autosave-B-FheggT.js";import{A as yi}from"./add-connection-dialog-BbC6Awnv.js";import{i as Ct}from"./SearchMd-5E3M_LtW.js";import{F as Zt}from"./file-type-icon-etYEFstF.js";import{i as wi,j as Si,k as Ni,l as Ci}from"./use-org-fs-DsXUzUGl.js";import{I as Ze}from"./integration-icon-BADY30E3.js";import{C as $s}from"./checkbox-TbFNti2k.js";import{S as ki}from"./search-input-BCaqzpfC.js";import{b as Oe,a as Ie,c as we,d as Ae,S as $e}from"./select-3Bvf55R2.js";import{s as At}from"./XClose-sbj0sr-y.js";import{C as Mi}from"./collection-tabs-BjFLrDhl.js";import{T as Fs,u as Es}from"./use-mcp-auth-status-Ckh_s_m-.js";import{u as pt}from"./use-mcp-client-BjCYOtMv.js";import{a as zs}from"./use-mcp-tools-BQ-vDoB-.js";import{u as _i}from"./use-mcp-prompts-D4ntfVw2.js";import{g as Vi}from"./connection-slug-CITJ0kGN.js";import{t as kt}from"./utils-CVEq3hMx.js";import{S as ht}from"./switch-CZd0EYW9.js";import{a as Rs,b as Ls,P as Us}from"./popover-BOhP5vgB.js";import{S as Ti}from"./scroll-area-L8VlxVDv.js";import{i as Di}from"./Upload01-BT7hKOY8.js";import{i as Pi}from"./DotsVertical-Drns5Frs.js";import{a as Oi}from"./Image01-1LQuy0wG.js";import{i as Ii}from"./Monitor01-BbCpGNqh.js";import{g as Ai}from"./types-CKfFy-n_.js";import{a as Ys,f as $i,u as Fi}from"./experiments-tab-choice-CdB5dK1A.js";import{a as Ei}from"./use-panel-navigate-D1HcWbMf.js";import{u as zi,e as Mt,o as es,r as _t,p as Ri,g as Li,s as Ui,t as Yi,h as Bi,i as Wi,a as Ki}from"./use-project-native-view-presence-WBIVN5MA.js";import{a as Bs,u as Gi,i as qi,o as Hi,r as ts,p as Qi,w as Xi,b as ss}from"./optimistic-project-sidebar-views-NiW-ZsA6.js";import{P as Ji,a as Zi,i as ea}from"./sections-DM2-ez5A.js";import{i as $t}from"./Key01-CoFqvDTW.js";import{a as ta}from"./format-time-Cq80KKvY.js";import{a as xt}from"./Copy01-DQtv3upd.js";import{u as sa}from"./use-copy-Lp25RdQW.js";import{L as ye}from"./label-DwAqZKXh.js";import{s as Ws,o as na,r as ia}from"./thread-intent-D02hOLlA.js";import{V as aa,E as gt,r as Ks,C as la,w as ra}from"./virtual-mcp-DHPQGUgu.js";import{s as Gs}from"./slugify-CEUa2lfQ.js";import{b as oa,a as ca,D as da}from"./drawer-CER6tItd.js";import{u as ua}from"./use-mobile-exvgjs5E.js";import{d as vt}from"./delay-CnY5UFtP.js";import{b as ma}from"./sandbox-url-D3mC8qhT.js";import{S as fa,a as pa,b as ha}from"./secret-picker-Ciz2Oc6M.js";import{u as xa,a as ga}from"./use-secrets-DS9zWxiz.js";import{o as ns}from"./omit-sandbox-map-jj4lCB2U.js";import{G as va}from"./repository-picker-C_FPAS2a.js";import{r as ba}from"./serial-task-queue-CGOeQgpr.js";import{t as De,c as Qe,m as ja,a as qs}from"./differenceInSeconds-C3x8sHUj.js";function nt(a,e){const s=ft(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=De(a,e?.in),l=i.getDay(),r=(l<n?7:0)+l-n;return i.setDate(i.getDate()-r),i.setHours(0,0,0,0),i}function mt(a,e){return nt(a,{...e,weekStartsOn:1})}function Hs(a,e){const s=De(a,e?.in),n=s.getFullYear(),i=Qe(s,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const l=mt(i),r=Qe(s,0);r.setFullYear(n,0,4),r.setHours(0,0,0,0);const o=mt(r);return s.getTime()>=l.getTime()?n+1:s.getTime()>=o.getTime()?n:n-1}function is(a,e){const s=De(a,e?.in);return s.setHours(0,0,0,0),s}function ya(a,e,s){const[n,i]=In(s?.in,a,e),l=is(n),r=is(i),o=+l-Kt(l),p=+r-Kt(r);return Math.round((o-p)/ja)}function wa(a,e){const s=Hs(a,e),n=Qe(a,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),mt(n)}function Sa(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function Na(a){return!(!Sa(a)&&typeof a!="number"||isNaN(+De(a)))}function Ca(a,e){const s=De(a,e?.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function ka(a,e){const s=De(a,e?.in);return ya(s,Ca(s))+1}function Ma(a,e){const s=De(a,e?.in),n=+mt(s)-+wa(s);return Math.round(n/qs)+1}function Qs(a,e){const s=De(a,e?.in),n=s.getFullYear(),i=ft(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=Qe(e?.in||a,0);r.setFullYear(n+1,0,l),r.setHours(0,0,0,0);const o=nt(r,e),p=Qe(e?.in||a,0);p.setFullYear(n,0,l),p.setHours(0,0,0,0);const c=nt(p,e);return+s>=+o?n+1:+s>=+c?n:n-1}function _a(a,e){const s=ft(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=Qs(a,e),l=Qe(e?.in||a,0);return l.setFullYear(i,0,n),l.setHours(0,0,0,0),nt(l,e)}function Va(a,e){const s=De(a,e?.in),n=+nt(s,e)-+_a(s,e);return Math.round(n/qs)+1}function re(a,e){const s=a<0?"-":"",n=Math.abs(a).toString().padStart(e,"0");return s+n}const Ee={y(a,e){const s=a.getFullYear(),n=s>0?s:1-s;return re(e==="yy"?n%100:n,e.length)},M(a,e){const s=a.getMonth();return e==="M"?String(s+1):re(s+1,2)},d(a,e){return re(a.getDate(),e.length)},a(a,e){const s=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];default:return s==="am"?"a.m.":"p.m."}},h(a,e){return re(a.getHours()%12||12,e.length)},H(a,e){return re(a.getHours(),e.length)},m(a,e){return re(a.getMinutes(),e.length)},s(a,e){return re(a.getSeconds(),e.length)},S(a,e){const s=e.length,n=a.getMilliseconds(),i=Math.trunc(n*Math.pow(10,s-3));return re(i,e.length)}},qe={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},as={G:function(a,e,s){const n=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});default:return s.era(n,{width:"wide"})}},y:function(a,e,s){if(e==="yo"){const n=a.getFullYear(),i=n>0?n:1-n;return s.ordinalNumber(i,{unit:"year"})}return Ee.y(a,e)},Y:function(a,e,s,n){const i=Qs(a,n),l=i>0?i:1-i;if(e==="YY"){const r=l%100;return re(r,2)}return e==="Yo"?s.ordinalNumber(l,{unit:"year"}):re(l,e.length)},R:function(a,e){const s=Hs(a);return re(s,e.length)},u:function(a,e){const s=a.getFullYear();return re(s,e.length)},Q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return re(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(a,e,s){const n=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return re(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(a,e,s){const n=a.getMonth();switch(e){case"M":case"MM":return Ee.M(a,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(a,e,s){const n=a.getMonth();switch(e){case"L":return String(n+1);case"LL":return re(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(a,e,s,n){const i=Va(a,n);return e==="wo"?s.ordinalNumber(i,{unit:"week"}):re(i,e.length)},I:function(a,e,s){const n=Ma(a);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):re(n,e.length)},d:function(a,e,s){return e==="do"?s.ordinalNumber(a.getDate(),{unit:"date"}):Ee.d(a,e)},D:function(a,e,s){const n=ka(a);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):re(n,e.length)},E:function(a,e,s){const n=a.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return re(l,2);case"eo":return s.ordinalNumber(l,{unit:"day"});case"eee":return s.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"});default:return s.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,s,n){const i=a.getDay(),l=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return re(l,e.length);case"co":return s.ordinalNumber(l,{unit:"day"});case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"});default:return s.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,s){const n=a.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return re(i,e.length);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(a,e,s){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,s){const n=a.getHours();let i;switch(n===12?i=qe.noon:n===0?i=qe.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,s){const n=a.getHours();let i;switch(n>=17?i=qe.evening:n>=12?i=qe.afternoon:n>=4?i=qe.morning:i=qe.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});default:return s.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,s){if(e==="ho"){let n=a.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Ee.h(a,e)},H:function(a,e,s){return e==="Ho"?s.ordinalNumber(a.getHours(),{unit:"hour"}):Ee.H(a,e)},K:function(a,e,s){const n=a.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},k:function(a,e,s){let n=a.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):re(n,e.length)},m:function(a,e,s){return e==="mo"?s.ordinalNumber(a.getMinutes(),{unit:"minute"}):Ee.m(a,e)},s:function(a,e,s){return e==="so"?s.ordinalNumber(a.getSeconds(),{unit:"second"}):Ee.s(a,e)},S:function(a,e){return Ee.S(a,e)},X:function(a,e,s){const n=a.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return rs(n);case"XXXX":case"XX":return Le(n);default:return Le(n,":")}},x:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"x":return rs(n);case"xxxx":case"xx":return Le(n);default:return Le(n,":")}},O:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},z:function(a,e,s){const n=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ls(n,":");default:return"GMT"+Le(n,":")}},t:function(a,e,s){const n=Math.trunc(+a/1e3);return re(n,e.length)},T:function(a,e,s){return re(+a,e.length)}};function ls(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=Math.trunc(n/60),l=n%60;return l===0?s+String(i):s+String(i)+e+re(l,2)}function rs(a,e){return a%60===0?(a>0?"-":"+")+re(Math.abs(a)/60,2):Le(a,e)}function Le(a,e=""){const s=a>0?"-":"+",n=Math.abs(a),i=re(Math.trunc(n/60),2),l=re(n%60,2);return s+i+e+l}const os=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Xs=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Ta=(a,e)=>{const s=a.match(/(P+)(p+)?/)||[],n=s[1],i=s[2];if(!i)return os(a,e);let l;switch(n){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",os(n,e)).replace("{{time}}",Xs(i,e))},Da={p:Xs,P:Ta},Pa=/^D+$/,Oa=/^Y+$/,Ia=["D","DD","YY","YYYY"];function Aa(a){return Pa.test(a)}function $a(a){return Oa.test(a)}function Fa(a,e,s){const n=Ea(a,e,s);if(console.warn(n),Ia.includes(a))throw new RangeError(n)}function Ea(a,e,s){const n=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ra=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,La=/^'([^]*?)'?$/,Ua=/''/g,Ya=/[a-zA-Z]/;function Ba(a,e,s){const n=ft(),i=s?.locale??n.locale??An,l=s?.firstWeekContainsDate??s?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=De(a,s?.in);if(!Na(o))throw new RangeError("Invalid time value");let p=e.match(Ra).map(f=>{const m=f[0];if(m==="p"||m==="P"){const u=Da[m];return u(f,i.formatLong)}return f}).join("").match(za).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:Wa(f)};if(as[m])return{isToken:!0,value:f};if(m.match(Ya))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(p=i.localize.preprocessor(o,p));const c={firstWeekContainsDate:l,weekStartsOn:r,locale:i};return p.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!s?.useAdditionalWeekYearTokens&&$a(m)||!s?.useAdditionalDayOfYearTokens&&Aa(m))&&Fa(m,e,String(a));const u=as[m[0]];return u(o,m,i.localize,c)}).join("")}function Wa(a){const e=a.match(La);return e?e[1].replace(Ua,"'"):a}const Js=25*1024*1024,yt="home",wt="knowledge";function cs(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Re(a){return a.split("/").pop()??a}function Ka(a){const e=q.c(64),{form:s}=a,n=Z(),{upload:i}=wi(yt),l=Si(),r=H.useRef(null),[o,p]=H.useState(!1),[c,f]=H.useState(""),[m,u]=H.useState(!1);let h;e[0]!==o?(h={enabled:o},e[0]=o,e[1]=h):h=e[1];const{data:d}=Ni(60,h),x=d===void 0?[]:d;let g;e[2]!==o?(g={enabled:o},e[2]=o,e[3]=g):g=e[3];const{data:v}=Ci(g),y=v===void 0?[]:v;let j;e[4]!==s?(j=()=>s.getValues("metadata.knowledge")??[],e[4]=s,e[5]=j):j=e[5];const[b,w]=H.useState(j);let S;e[6]!==s?(S=A=>{w(A),s.setValue("metadata.knowledge",A,{shouldDirty:!0})},e[6]=s,e[7]=S):S=e[7];const M=S;let N;e[8]!==l||e[9]!==b||e[10]!==M||e[11]!==n||e[12]!==i?(N=async A=>{if(!A||A.length===0)return;const ne=Array.from(A),R=ne.filter(Za),te=ne.filter(Ja);if(te.length>0&&oe.warning(n("virtualMcp.filesSection.fileTooLargeTitle"),{description:n("virtualMcp.filesSection.fileTooLargeDescription",{names:te.map(Xa).join(", ")})}),R.length!==0){try{await i.mutateAsync({dir:wt,files:R})}catch(J){const pe=J;oe.error(pe instanceof Error?pe.message:n("virtualMcp.filesSection.failedUploadFile"));return}M([...b,...R.map(J=>({id:crypto.randomUUID(),name:J.name,volume:yt,path:`${wt}/${J.name}`,url:l(yt,`${wt}/${J.name}`),contentType:J.type||null,size:J.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=b,e[10]=M,e[11]=n,e[12]=i,e[13]=N):N=e[13];const C=N;let k;e[14]!==l||e[15]!==b||e[16]!==M?(k=A=>{b.some(ne=>ne.volume===A.volume&&ne.path===A.path)||(M([...b,{id:crypto.randomUUID(),name:Re(A.path),volume:A.volume,path:A.path,url:l(A.volume,A.path),contentType:null,size:A.size??null,addedAt:new Date().toISOString()}]),p(!1))},e[14]=l,e[15]=b,e[16]=M,e[17]=k):k=e[17];const V=k;let _;e[18]!==l||e[19]!==b||e[20]!==M?(_=A=>{b.some(ne=>ne.volume===A.volume&&ne.path===A.path)||(M([...b,{id:crypto.randomUUID(),name:Re(A.path),kind:"skill",volume:A.volume,path:A.path,url:l(A.volume,A.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),p(!1))},e[18]=l,e[19]=b,e[20]=M,e[21]=_):_=e[21];const E=_;let D;e[22]!==b||e[23]!==M?(D=A=>{M(b.filter(ne=>ne.id!==A))},e[22]=b,e[23]=M,e[24]=D):D=e[24];const $=D;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{p(A),A&&f("")},e[25]=I):I=e[25];const L=I;let U;e[26]!==b?(U=new Set(b.map(Qa)),e[26]=b,e[27]=U):U=e[27];const K=U,W=c.toLowerCase();let G;e[28]!==K?(G=A=>!K.has(`${A.volume}/${A.path}`),e[28]=K,e[29]=G):G=e[29];const F=x.filter(Ha).filter(G).filter(A=>Re(A.path).toLowerCase().includes(W)).slice(0,5);let Y;e[30]!==K?(Y=A=>!K.has(`${A.volume}/${A.path}`),e[30]=K,e[31]=Y):Y=e[31];const X=y.filter(Y).filter(A=>Re(A.path).toLowerCase().includes(W)).slice(0,5),T=A=>t.jsxs(js,{open:o,onOpenChange:L,children:[t.jsx(ys,{asChild:!0,children:A}),t.jsxs(ws,{align:"end",className:"w-56",children:[t.jsxs(He,{onSelect:()=>{r.current?.click()},children:[t.jsx(Xn,{size:16}),n("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Jn,{size:16}),n("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:ne=>f(ne.target.value),onKeyDown:qa,placeholder:n("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:F.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noFilesFound")}):F.map(ne=>t.jsxs(He,{onSelect:()=>V(ne),children:[t.jsx(Zt,{filename:Re(ne.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)}),ne.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:cs(ne.size)})]},`${ne.volume}/${ne.path}`))})]})]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(dt,{size:16}),n("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(Ct,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:ne=>f(ne.target.value),onKeyDown:Ga,placeholder:n("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:X.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:n("virtualMcp.filesSection.noSkillsFound")}):X.map(ne=>t.jsxs(He,{onSelect:()=>E(ne),children:[t.jsx(dt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Re(ne.path)})]},`${ne.volume}/${ne.path}`))})]})]})]})]}),z="flex flex-col gap-3";let B;e[32]!==n?(B=n("virtualMcp.filesSection.filesAndSkills"),e[32]=n,e[33]=B):B=e[33];let P;e[34]!==B?(P=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:B}),e[34]=B,e[35]=P):P=e[35];let O;e[36]!==n?(O=n("virtualMcp.filesSection.description"),e[36]=n,e[37]=O):O=e[37];let ee;e[38]!==O?(ee=t.jsx("p",{className:"text-sm text-muted-foreground",children:O}),e[38]=O,e[39]=ee):ee=e[39];let ae;e[40]!==P||e[41]!==ee?(ae=t.jsxs("div",{className:"flex flex-col gap-1",children:[P,ee]}),e[40]=P,e[41]=ee,e[42]=ae):ae=e[42];const ce=b.length>0&&T(t.jsxs(se,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(it,{size:"xs"}):t.jsx(Pe,{size:14}),n("virtualMcp.filesSection.add")]}));let le;e[43]!==ae||e[44]!==ce?(le=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ae,ce]}),e[43]=ae,e[44]=ce,e[45]=le):le=e[45];let ie;e[46]!==C?(ie=t.jsx("input",{ref:r,type:"file",multiple:!0,className:"hidden",onChange:A=>{C(A.target.files),A.target.value=""}}),e[46]=C,e[47]=ie):ie=e[47];let Q,de;e[48]===Symbol.for("react.memo_cache_sentinel")?(Q=A=>{A.preventDefault(),u(!0)},de=()=>u(!1),e[48]=Q,e[49]=de):(Q=e[48],de=e[49]);let ue;e[50]!==C?(ue=A=>{A.preventDefault(),A.stopPropagation(),u(!1),C(A.dataTransfer.files)},e[50]=C,e[51]=ue):ue=e[51];const he=m&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==he?(me=ve("flex flex-col gap-2 rounded-lg",he),e[52]=he,e[53]=me):me=e[53];const xe=b.length===0?T(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:n("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):b.map(A=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[A.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(dt,{size:16})}):t.jsx(Zt,{filename:A.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:A.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:A.kind==="skill"?n("virtualMcp.filesSection.kindSkill"):A.size!=null?cs(A.size):n("virtualMcp.filesSection.kindFile")})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>$(A.id),"aria-label":n("virtualMcp.filesSection.removeAriaLabel",{name:A.name}),children:t.jsx(It,{size:16})})]},A.id));let ge;e[54]!==Q||e[55]!==de||e[56]!==ue||e[57]!==me||e[58]!==xe?(ge=t.jsx("div",{onDragOver:Q,onDragLeave:de,onDrop:ue,className:me,children:xe}),e[54]=Q,e[55]=de,e[56]=ue,e[57]=me,e[58]=xe,e[59]=ge):ge=e[59];let fe;return e[60]!==le||e[61]!==ie||e[62]!==ge?(fe=t.jsxs("section",{className:z,children:[le,ie,ge]}),e[60]=le,e[61]=ie,e[62]=ge,e[63]=fe):fe=e[63],fe}function Ga(a){return a.stopPropagation()}function qa(a){return a.stopPropagation()}function Ha(a){return a.kind!=="dir"}function Qa(a){return`${a.volume}/${a.path}`}function Xa(a){return a.name}function Ja(a){return a.size>Js}function Za(a){return a.size<=Js}function el(a){return a==null?"all":a.length===0?"self":"selected"}function tl(a){const e=q.c(88),{form:s,currentAgentId:n}=a,i=Z(),{org:l}=Fe(),r=qn(),[o,p]=H.useState(!1);let c;e[0]!==s?(c=s.getValues("metadata.subAgents")??null,e[0]=s,e[1]=c):c=e[1];const f=c;let m;e[2]!==f?(m=()=>el(f),e[2]=f,e[3]=m):m=e[3];const[u,h]=H.useState(m);let d;e[4]!==f?(d=f??[],e[4]=f,e[5]=d):d=e[5];const[x,g]=H.useState(d);let v,y,j,b,w,S;if(e[6]!==r||e[7]!==n||e[8]!==s||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let k;e[19]!==n||e[20]!==l?(k=Q=>Q.id!==n&&Q.id!==l.id&&Q.status==="active",e[19]=n,e[20]=l,e[21]=k):k=e[21],v=r.filter(k);let V;e[22]!==x?(V=Q=>x.includes(Q.id),e[22]=x,e[23]=V):V=e[23];const _=v.filter(V);let E;e[24]!==s?(E=(Q,de)=>s.setValue("metadata.subAgents",Q==="all"?null:Q==="self"?[]:de,{shouldDirty:!0}),e[24]=s,e[25]=E):E=e[25];const D=E;let $;e[26]!==D||e[27]!==x?($=Q=>{h(Q),D(Q,x)},e[26]=D,e[27]=x,e[28]=$):$=e[28];const I=$;let L;e[29]!==D||e[30]!==x?(L=Q=>{const de=x.includes(Q)?x.filter(ue=>ue!==Q):[...x,Q];g(de),D("selected",de)},e[29]=D,e[30]=x,e[31]=L):L=e[31],y=L,w="flex flex-col gap-3";let U;e[32]!==i?(U=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=U):U=e[33];let K;e[34]!==U?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:U}),e[34]=U,e[35]=K):K=e[35];let W;e[36]!==u||e[37]!==i?(W=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=W):W=e[38];let G;e[39]!==u||e[40]!==i?(G=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=G):G=e[41];let F;e[42]!==K||e[43]!==W||e[44]!==G?(F=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,W,G]}),e[42]=K,e[43]=W,e[44]=G,e[45]=F):F=e[45];const Y=u==="selected"&&_.length>0&&t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Pe,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let X;e[46]!==I?(X=Q=>I(Q),e[46]=I,e[47]=X):X=e[47];let T;e[48]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Oe,{size:"sm",className:"w-auto",children:t.jsx(Ie,{})}),e[48]=T):T=e[48];let z;e[49]!==i?(z=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=z):z=e[50];let B;e[51]!==z?(B=t.jsx(we,{value:"all",children:z}),e[51]=z,e[52]=B):B=e[52];let P;e[53]!==i?(P=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=P):P=e[54];let O;e[55]!==P?(O=t.jsx(we,{value:"selected",children:P}),e[55]=P,e[56]=O):O=e[56];let ee;e[57]!==i?(ee=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ee):ee=e[58];let ae;e[59]!==ee?(ae=t.jsx(we,{value:"self",children:ee}),e[59]=ee,e[60]=ae):ae=e[60];let ce;e[61]!==B||e[62]!==O||e[63]!==ae?(ce=t.jsxs(Ae,{align:"end",children:[B,O,ae]}),e[61]=B,e[62]=O,e[63]=ae,e[64]=ce):ce=e[64];let le;e[65]!==u||e[66]!==X||e[67]!==ce?(le=t.jsxs($e,{value:u,onValueChange:X,children:[T,ce]}),e[65]=u,e[66]=X,e[67]=ce,e[68]=le):le=e[68];let ie;e[69]!==Y||e[70]!==le?(ie=t.jsxs("div",{className:"flex items-center gap-2",children:[Y,le]}),e[69]=Y,e[70]=le,e[71]=ie):ie=e[71],e[72]!==F||e[73]!==ie?(S=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[F,ie]}),e[72]=F,e[73]=ie,e[74]=S):S=e[74],j="flex flex-col gap-2",b=u==="selected"&&(_.length>0?_.map(Q=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 surface",children:[t.jsx(Ze,{icon:Q.icon,name:Q.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:Q.title}),Q.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:Q.description})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>y(Q.id),children:t.jsx(At,{size:16})})]},Q.id)):t.jsxs("button",{type:"button",onClick:()=>p(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=r,e[7]=n,e[8]=s,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=v,e[14]=y,e[15]=j,e[16]=b,e[17]=w,e[18]=S}else v=e[13],y=e[14],j=e[15],b=e[16],w=e[17],S=e[18];let M;e[75]!==j||e[76]!==b?(M=t.jsx("div",{className:j,children:b}),e[75]=j,e[76]=b,e[77]=M):M=e[77];let N;e[78]!==v||e[79]!==y||e[80]!==o||e[81]!==x?(N=t.jsx(sl,{open:o,onOpenChange:p,candidates:v,selectedIds:x,onToggle:y}),e[78]=v,e[79]=y,e[80]=o,e[81]=x,e[82]=N):N=e[82];let C;return e[83]!==w||e[84]!==S||e[85]!==M||e[86]!==N?(C=t.jsxs("section",{className:w,children:[S,M,N]}),e[83]=w,e[84]=S,e[85]=M,e[86]=N,e[87]=C):C=e[87],C}function sl(a){const e=q.c(39),{open:s,onOpenChange:n,candidates:i,selectedIds:l,onToggle:r}=a,o=Z(),[p,c]=H.useState("");let f,m,u,h,d,x,g,v,y;if(e[0]!==i||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==p||e[5]!==l||e[6]!==o){const S=p.toLowerCase(),M=i.filter(k=>k.title.toLowerCase().includes(S)||k.description?.toLowerCase().includes(S));m=Xe,v=s,y=n,f=Je,d="max-w-md";let N;e[16]!==o?(N=o("virtualMcp.subAgentsSection.title"),e[16]=o,e[17]=N):N=e[17],e[18]!==N?(x=t.jsx(at,{children:t.jsx(lt,{children:N})}),e[18]=N,e[19]=x):x=e[19];let C;e[20]!==o?(C=o("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=o,e[21]=C):C=e[21],e[22]!==p||e[23]!==C?(g=t.jsx(ki,{value:p,onChange:c,placeholder:C,className:"w-full"}),e[22]=p,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",h=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:o("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent transition-colors cursor-pointer w-full text-left",children:[t.jsx($s,{checked:l.includes(k.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ze,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[0]=i,e[1]=n,e[2]=r,e[3]=s,e[4]=p,e[5]=l,e[6]=o,e[7]=f,e[8]=m,e[9]=u,e[10]=h,e[11]=d,e[12]=x,e[13]=g,e[14]=v,e[15]=y}else f=e[7],m=e[8],u=e[9],h=e[10],d=e[11],x=e[12],g=e[13],v=e[14],y=e[15];let j;e[25]!==u||e[26]!==h?(j=t.jsx("div",{className:u,children:h}),e[25]=u,e[26]=h,e[27]=j):j=e[27];let b;e[28]!==f||e[29]!==d||e[30]!==x||e[31]!==g||e[32]!==j?(b=t.jsxs(f,{className:d,children:[x,g,j]}),e[28]=f,e[29]=d,e[30]=x,e[31]=g,e[32]=j,e[33]=b):b=e[33];let w;return e[34]!==m||e[35]!==v||e[36]!==y||e[37]!==b?(w=t.jsx(m,{open:v,onOpenChange:y,children:b}),e[34]=m,e[35]=v,e[36]=y,e[37]=b,e[38]=w):w=e[38],w}function st(){const a=q.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(it,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function ct(a,e){return({error:s})=>s?.message?.includes("Method not found")||s?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(Ss,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:s?.message?s.message.length>200?`${s.message.slice(0,200)}...`:s.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Zs(a){const e=q.c(23),{item:s,isSelected:n,onToggle:i,disabled:l}=a,r=l?"cursor-not-allowed opacity-50":"cursor-pointer",o=n?"bg-accent/25":"hover:bg-accent";let p;e[0]!==r||e[1]!==o?(p=ve("flex items-start gap-3 p-4 rounded-lg transition-colors",r,o),e[0]=r,e[1]=o,e[2]=p):p=e[2];let c;e[3]!==s.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:s.name}),e[3]=s.name,e[4]=c):c=e[4];let f;e[5]!==s.tags?(f=s.tags&&t.jsx("span",{className:"shrink-0",children:s.tags}),e[5]=s.tags,e[6]=f):f=e[6];let m;e[7]!==c||e[8]!==f?(m=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,f]}),e[7]=c,e[8]=f,e[9]=m):m=e[9];let u;e[10]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:s.description}),e[10]=s.description,e[11]=u):u=e[11];let h;e[12]!==m||e[13]!==u?(h=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[m,u]}),e[12]=m,e[13]=u,e[14]=h):h=e[14];let d;e[15]!==l||e[16]!==n||e[17]!==i?(d=t.jsx($s,{checked:n,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=n,e[17]=i,e[18]=d):d=e[18];let x;return e[19]!==p||e[20]!==h||e[21]!==d?(x=t.jsxs("label",{className:p,children:[h,d]}),e[19]=p,e[20]=h,e[21]=d,e[22]=x):x=e[22],x}function nl(a){const e=q.c(35),{activeTab:s,onTabChange:n,showSelectAll:i,isAllSelected:l,handleSelectAll:r}=a,o=Z();let p;e[0]!==o?(p=o("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c={id:"tools",label:p},e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=o,e[5]=f):f=e[5];let m;e[6]!==f?(m={id:"active",label:f},e[6]=f,e[7]=m):m=e[7];let u;e[8]!==o?(u=o("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=o,e[9]=u):u=e[9];let h;e[10]!==u?(h={id:"resources",label:u},e[10]=u,e[11]=h):h=e[11];let d;e[12]!==o?(d=o("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=o,e[13]=d):d=e[13];let x;e[14]!==d?(x={id:"prompts",label:d},e[14]=d,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==m||e[18]!==h||e[19]!==x?(g=[c,m,h,x],e[16]=c,e[17]=m,e[18]=h,e[19]=x,e[20]=g):g=e[20];let v;e[21]!==n?(v=w=>n(w),e[21]=n,e[22]=v):v=e[22];let y;e[23]!==s||e[24]!==v||e[25]!==g?(y=t.jsx(Mi,{tabs:g,activeTab:s,onTabChange:v}),e[23]=s,e[24]=v,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==r||e[28]!==l||e[29]!==i||e[30]!==o?(j=i&&t.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:o(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=r,e[28]=l,e[29]=i,e[30]=o,e[31]=j):j=e[31];let b;return e[32]!==y||e[33]!==j?(b=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=b):b=e[34],b}function Ft(a){const e=q.c(13),{items:s,selections:n,onToggle:i,emptyMessage:l,disabled:r}=a;let o,p,c;if(e[0]!==r||e[1]!==l||e[2]!==s||e[3]!==i||e[4]!==n){c=Symbol.for("react.early_return_sentinel");e:{const m=s.map(il);if(s.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],c=u;break e}o="flex-1 overflow-auto px-4 py-3 space-y-1",p=s.map(u=>t.jsx(Zs,{item:u,isSelected:n===null||n?.includes(u.id),onToggle:()=>i(u.id,m),disabled:r},u.id))}e[0]=r,e[1]=l,e[2]=s,e[3]=i,e[4]=n,e[5]=o,e[6]=p,e[7]=c}else o=e[5],p=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;let f;return e[10]!==o||e[11]!==p?(f=t.jsx("div",{className:o,children:p}),e[10]=o,e[11]=p,e[12]=f):f=e[12],f}function il(a){return a.id}function al(a){const e=q.c(22),{connectionId:s,toolSelections:n,onToggleTool:i}=a,l=Z(),{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=zs(c),m=f.tools;let u,h,d;if(e[6]!==f.tools||e[7]!==i||e[8]!==l||e[9]!==n){d=Symbol.for("react.early_return_sentinel");e:{const g=m.map(rl);let v;e[13]!==n?(v=b=>n===null||n.includes(b.name),e[13]=n,e[14]=v):v=e[14];const j=f.tools.filter(v).map(ll);if(j.length===0){let b;e[15]!==l?(b=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=b):b=e[16];let w;e[17]!==b?(w=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:b})}),e[17]=b,e[18]=w):w=e[18],d=w;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",h=j.map(b=>t.jsx(Zs,{item:b,isSelected:!0,onToggle:()=>i(b.id,g)},b.id))}e[6]=f.tools,e[7]=i,e[8]=l,e[9]=n,e[10]=u,e[11]=h,e[12]=d}else u=e[10],h=e[11],d=e[12];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;return e[19]!==u||e[20]!==h?(x=t.jsx("div",{className:u,children:h}),e[19]=u,e[20]=h,e[21]=x):x=e[21],x}function ll(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Fs,{annotations:a.annotations,_meta:a._meta})}}function rl(a){return a.name}function ol(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=zs(c);let m;e[6]!==f.tools?(m=f.tools.map(cl),e[6]=f.tools,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function cl(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Fs,{annotations:a.annotations,_meta:a._meta})}}function dl(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=on(c);let m;e[6]!==f.resources?(m=f.resources.map(ul),e[6]=f.resources,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function ul(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function ml(a){const e=q.c(16),{connectionId:s,selections:n,onToggle:i,disabled:l}=a,{org:r}=Fe();let o;e[0]!==s||e[1]!==r.id||e[2]!==r.slug?(o={connectionId:s,orgId:r.id,orgSlug:r.slug},e[0]=s,e[1]=r.id,e[2]=r.slug,e[3]=o):o=e[3];const p=pt(o);let c;e[4]!==p?(c={client:p},e[4]=p,e[5]=c):c=e[5];const{data:f}=_i(c);let m;e[6]!==f.prompts?(m=f.prompts.map(fl),e[6]=f.prompts,e[7]=m):m=e[7];const u=m,h=Z();let d;e[8]!==h?(d=h("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=h,e[9]=d):d=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==n||e[14]!==d?(x=t.jsx(Ft,{items:u,selections:n,onToggle:i,emptyMessage:d,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=n,e[14]=d,e[15]=x):x=e[15],x}function fl(a){return{id:a.name,name:a.name,description:a.description}}function pl(a){const e=q.c(58),{currentConnection:s,activeTab:n,selectedId:i,formData:l,toggleTool:r,toggleResource:o,togglePrompt:p,toggleAllTools:c,toggleAllResources:f,toggleAllPrompts:m,onTabChange:u}=a,h=Z(),d=l[i],x=n==="tools"?d?.tools===null:n==="resources"?d?.resources===null:n==="prompts"?d?.prompts===null:!1,g=n!=="active";let v;e[0]!==n||e[1]!==i||e[2]!==m||e[3]!==f||e[4]!==c?(v=()=>{n==="tools"?c(i):n==="resources"?f(i):n==="prompts"&&m(i)},e[0]=n,e[1]=i,e[2]=m,e[3]=f,e[4]=c,e[5]=v):v=e[5];const y=v;let j;e[6]!==s.icon||e[7]!==s.title?(j=t.jsx(Ze,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[6]=s.icon,e[7]=s.title,e[8]=j):j=e[8];let b;e[9]!==s.title?(b=t.jsx("h2",{className:"text-base font-semibold truncate",children:s.title}),e[9]=s.title,e[10]=b):b=e[10];let w;e[11]!==s.description?(w=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[11]=s.description,e[12]=w):w=e[12];let S;e[13]!==b||e[14]!==w?(S=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,w]}),e[13]=b,e[14]=w,e[15]=S):S=e[15];let M;e[16]!==j||e[17]!==S?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,S]})}),e[16]=j,e[17]=S,e[18]=M):M=e[18];let N;e[19]!==n||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(N=t.jsx(nl,{activeTab:n,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=n,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=N):N=e[24];let C;e[25]!==n||e[26]!==l||e[27]!==i||e[28]!==h||e[29]!==r?(C=n==="active"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(al,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:($,I)=>r(i,$,I)})})}),e[25]=n,e[26]=l,e[27]=i,e[28]=h,e[29]=r,e[30]=C):C=e[30];let k;e[31]!==n||e[32]!==l||e[33]!==i||e[34]!==h||e[35]!==r?(k=n==="tools"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.toolsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ol,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:($,I)=>r(i,$,I)})})}),e[31]=n,e[32]=l,e[33]=i,e[34]=h,e[35]=r,e[36]=k):k=e[36];let V;e[37]!==n||e[38]!==l||e[39]!==i||e[40]!==h||e[41]!==o?(V=n==="resources"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(dl,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:($,I)=>o(i,$,I)})})}),e[37]=n,e[38]=l,e[39]=i,e[40]=h,e[41]=o,e[42]=V):V=e[42];let _;e[43]!==n||e[44]!==l||e[45]!==i||e[46]!==h||e[47]!==p?(_=n==="prompts"&&t.jsx(Ye,{fallback:ct(h("virtualMcp.dependencySelectionDialog.promptsNotSupported"),h),children:t.jsx(H.Suspense,{fallback:t.jsx(st,{}),children:t.jsx(ml,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:($,I)=>p(i,$,I)})})}),e[43]=n,e[44]=l,e[45]=i,e[46]=h,e[47]=p,e[48]=_):_=e[48];let E;e[49]!==V||e[50]!==_||e[51]!==C||e[52]!==k?(E=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,k,V,_]}),e[49]=V,e[50]=_,e[51]=C,e[52]=k,e[53]=E):E=e[53];let D;return e[54]!==E||e[55]!==M||e[56]!==N?(D=t.jsxs(t.Fragment,{children:[M,N,E]}),e[54]=E,e[55]=M,e[56]=N,e[57]=D):D=e[57],D}function hl(a){const e=q.c(7),{onClose:s}=a,n=Z();let i;e[0]!==s?(i=()=>s(!1),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.dependencySelectionDialog.done"),e[2]=n,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==l?(r=t.jsx(Vt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(se,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=r):r=e[6],r}function xl(a){const e=q.c(23),{connectionId:s,onAuthenticate:n,children:i}=a,l=Z();let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const o=Es(r);if(o.supportsOAuth&&!o.isAuthenticated){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Zn,{size:22,className:"text-muted-foreground"})}),e[2]=f):f=e[2];let m;e[3]!==l?(m=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=m):m=e[4];let u;e[5]!==m?(u=t.jsx("p",{className:"text-sm font-medium",children:m}),e[5]=m,e[6]=u):u=e[6];let h;e[7]!==l?(h=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=h):h=e[8];let d;e[9]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:h}),e[9]=h,e[10]=d):d=e[10];let x;e[11]!==u||e[12]!==d?(x=t.jsxs("div",{className:"space-y-1",children:[u,d]}),e[11]=u,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==s||e[15]!==n||e[16]!==l?(g=n&&t.jsx(se,{variant:"outline",size:"sm",onClick:()=>n(s),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=s,e[15]=n,e[16]=l,e[17]=g):g=e[17];let v;return e[18]!==x||e[19]!==g?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[f,x,g]}),e[18]=x,e[19]=g,e[20]=v):v=e[20],v}let c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function gl(a){const e={};for(const s of a)e[s.connection_id]={tools:s.selected_tools,resources:s.selected_resources??null,prompts:s.selected_prompts??null};return e}function ds(a){return Object.entries(a).map(([e,s])=>({connection_id:e,selected_tools:s.tools,selected_resources:s.resources,selected_prompts:s.prompts}))}function us(a,e,s,n){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[s]:n}}}function vl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function bl(a){const e=q.c(49),{open:s,onOpenChange:n,selectedId:i,form:l,connections:r,onAuthenticate:o}=a;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={activeTab:"tools"},e[0]=p):p=e[0];const[c,f]=H.useReducer(vl,p),m=Ot(i??"");let u;e[1]!==r?(u=r??[],e[1]=r,e[2]=u):u=e[2];let h;e[3]!==u?(h=gl(u),e[3]=u,e[4]=h):h=e[4];const d=h;let x;e[5]!==l||e[6]!==d?(x=(F,Y,X,T)=>{const z=d[F]?.[Y];let B;z===null?B=T.filter(P=>P!==X):z?.includes(X)?B=z.filter(P=>P!==X):(B=[...z??[],X],B.length===T.length&&(B=null)),l.setValue("connections",ds(us(d,F,Y,B)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=d,e[7]=x):x=e[7];const g=x;let v;e[8]!==l||e[9]!==d?(v=(F,Y)=>{const T=d[F]?.[Y]===null?[]:null;l.setValue("connections",ds(us(d,F,Y,T)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=d,e[10]=v):v=e[10];const y=v;let j;e[11]!==g?(j=(F,Y,X)=>g(F,"tools",Y,X),e[11]=g,e[12]=j):j=e[12];const b=j;let w;e[13]!==g?(w=(F,Y,X)=>g(F,"resources",Y,X),e[13]=g,e[14]=w):w=e[14];const S=w;let M;e[15]!==g?(M=(F,Y,X)=>g(F,"prompts",Y,X),e[15]=g,e[16]=M):M=e[16];const N=M;let C;e[17]!==y?(C=F=>y(F,"tools"),e[17]=y,e[18]=C):C=e[18];const k=C;let V;e[19]!==y?(V=F=>y(F,"resources"),e[19]=y,e[20]=V):V=e[20];const _=V;let E;e[21]!==y?(E=F=>y(F,"prompts"),e[21]=y,e[22]=E):E=e[22];const D=E;if(!i||!m)return null;let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(st,{}),e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=F=>f({type:"SET_ACTIVE_TAB",payload:F}),e[24]=I):I=e[24];let L;e[25]!==m||e[26]!==c.activeTab||e[27]!==d||e[28]!==i||e[29]!==D||e[30]!==_||e[31]!==k||e[32]!==N||e[33]!==S||e[34]!==b?(L=t.jsx(pl,{currentConnection:m,activeTab:c.activeTab,selectedId:i,formData:d,toggleTool:b,toggleResource:S,togglePrompt:N,toggleAllTools:k,toggleAllResources:_,toggleAllPrompts:D,onTabChange:I},i),e[25]=m,e[26]=c.activeTab,e[27]=d,e[28]=i,e[29]=D,e[30]=_,e[31]=k,e[32]=N,e[33]=S,e[34]=b,e[35]=L):L=e[35];let U;e[36]!==o||e[37]!==i||e[38]!==L?(U=t.jsx(H.Suspense,{fallback:$,children:t.jsx(xl,{connectionId:i,onAuthenticate:o,children:L})}),e[36]=o,e[37]=i,e[38]=L,e[39]=U):U=e[39];let K;e[40]!==n?(K=t.jsx(hl,{onClose:n}),e[40]=n,e[41]=K):K=e[41];let W;e[42]!==U||e[43]!==K?(W=t.jsxs(Je,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[U,K]}),e[42]=U,e[43]=K,e[44]=W):W=e[44];let G;return e[45]!==n||e[46]!==s||e[47]!==W?(G=t.jsx(Xe,{open:s,onOpenChange:n,children:W}),e[45]=n,e[46]=s,e[47]=W,e[48]=G):G=e[48],G}const ms="__new_instance__";function jl(a){const e=q.c(25),{connection_id:s,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}=a,c=Ot(s),{org:f}=Fe();if(!c){let g;return e[0]!==l?(g=t.jsx(Nl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let m;e[2]!==c?(m=Vi(c),e[2]=c,e[3]=m):m=e[3];const u=m;let h;e[4]!==s?(h=t.jsx(Sl,{connection_id:s}),e[4]=s,e[5]=h):h=e[5];let d;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==s||e[13]!==r||e[14]!==p||e[15]!==i||e[16]!==l||e[17]!==o||e[18]!==f.slug||e[19]!==u||e[20]!==n?(d=t.jsx(wl,{connection_id:s,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:u,orgSlug:f.slug,appName:c.app_name,usedConnectionIds:n,onOpenSettings:i,onRemove:l,onAuthenticate:r,onSwitchInstance:o,onNewInstance:p}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=s,e[13]=r,e[14]=p,e[15]=i,e[16]=l,e[17]=o,e[18]=f.slug,e[19]=u,e[20]=n,e[21]=d):d=e[21];let x;return e[22]!==h||e[23]!==d?(x=t.jsx(H.Suspense,{fallback:h,children:d}),e[22]=h,e[23]=d,e[24]=x):x=e[24],x}function yl(a){const e=q.c(24),{appName:s,connectionId:n,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:r}=a,o=Z();let p;e[0]!==s?(p={filters:[{column:"app_name",value:s}]},e[0]=s,e[1]=p):p=e[1];const c=Gn(p);if(c.length<=1&&!r)return null;let f;e[2]!==n||e[3]!==r||e[4]!==l?(f=g=>{g===ms?r?.():l(n,g)},e[2]=n,e[3]=r,e[4]=l,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Oe,{size:"xs",className:"w-auto gap-1 shadow-none",children:t.jsx(Ie,{})}),e[6]=m):m=e[6];let u;if(e[7]!==n||e[8]!==c||e[9]!==i){let g;e[11]!==n||e[12]!==i?(g=v=>t.jsx(we,{value:v.id,className:"text-xs",disabled:v.id!==n&&i.has(v.id),children:v.title},v.id),e[11]=n,e[12]=i,e[13]=g):g=e[13],u=c.map(g),e[7]=n,e[8]=c,e[9]=i,e[10]=u}else u=e[10];let h;e[14]!==r||e[15]!==o?(h=r&&t.jsxs(we,{value:ms,className:"text-xs text-muted-foreground",children:["+ ",o("virtualMcp.connectionItem.newInstance")]}),e[14]=r,e[15]=o,e[16]=h):h=e[16];let d;e[17]!==u||e[18]!==h?(d=t.jsxs(Ae,{children:[u,h]}),e[17]=u,e[18]=h,e[19]=d):d=e[19];let x;return e[20]!==n||e[21]!==f||e[22]!==d?(x=t.jsxs($e,{value:n,onValueChange:f,children:[m,d]}),e[20]=n,e[21]=f,e[22]=d,e[23]=x):x=e[23],x}function wl({connection_id:a,connectionTitle:e,connectionDescription:s,connectionIcon:n,connectionType:i,connectionStatus:l,slug:r,orgSlug:o,appName:p,usedConnectionIds:c,onOpenSettings:f,onRemove:m,onAuthenticate:u,onSwitchInstance:h,onNewInstance:d}){const x=Es({connectionId:a}),g=Vs(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",b=Z(),w=async S=>{try{await g.update.mutateAsync({id:a,data:{status:S}}),oe.success(b(S==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{oe.error(b("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:ve("surface overflow-hidden transition-colors",(y||j)&&"shadow-edge-destructive bg-destructive/5"),children:[t.jsxs(Ns,{to:"/$org/settings/connections/$appSlug",params:{org:o,appSlug:r},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors",children:[t.jsx(Ze,{icon:n,name:e,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:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:b(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):s&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s})]}),y?t.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),u(a)},children:b("virtualMcp.connectionItem.authorize")}):j?t.jsxs(se,{variant:"outline",size:"sm",className:"gap-1.5 shrink-0",onClick:S=>{S.preventDefault(),S.stopPropagation(),w("active")},children:[t.jsx(ei,{size:13}),b("virtualMcp.connectionItem.enable")]}):t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(ji,{size:16})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[p&&t.jsx(yl,{appName:p,connectionId:a,usedConnectionIds:c,onSwitchInstance:h,onNewInstance:d}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",onClick:f,"aria-label":b("virtualMcp.connectionItem.configureResources"),children:t.jsx(ti,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>w("inactive"),"aria-label":b("virtualMcp.connectionItem.disableConnection"),children:t.jsx(si,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.disable")})]}),t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost-destructive",size:"icon-sm",onClick:m,"aria-label":b("virtualMcp.connectionItem.removeConnection"),children:t.jsx(At,{size:13})})}),t.jsx(ke,{side:"bottom",children:b("virtualMcp.connectionItem.remove")})]})]})]})]})}function Sl(a){const e=q.c(17),{connection_id:s}=a,n=Ot(s);if(!n){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(en,{}),e[0]=m):m=e[0],m}let i;e[1]!==n.icon||e[2]!==n.title?(i=t.jsx(Ze,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[1]=n.icon,e[2]=n.title,e[3]=i):i=e[3];let l;e[4]!==n.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let r;e[6]!==n.description?(r=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[6]=n.description,e[7]=r):r=e[7];let o;e[8]!==l||e[9]!==r?(o=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,r]}),e[8]=l,e[9]=r,e[10]=o):o=e[10];let p;e[11]!==i||e[12]!==o?(p=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,o]}),e[11]=i,e[12]=o,e[13]=p):p=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=c):c=e[14];let f;return e[15]!==p?(f=t.jsxs("div",{className:"surface overflow-hidden",children:[p,c]}),e[15]=p,e[16]=f):f=e[16],f}function Nl(a){const e=q.c(20),{onRemove:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.connectionItem.connectionNotFound"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.connectionItem.removeConnection"),e[4]=n,e[5]=r):r=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(At,{size:13}),e[6]=o):o=e[6];let p;e[7]!==s||e[8]!==r?(p=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost-destructive",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":r,children:o})}),e[7]=s,e[8]=r,e[9]=p):p=e[9];let c;e[10]!==n?(c=n("virtualMcp.connectionItem.remove"),e[10]=n,e[11]=c):c=e[11];let f;e[12]!==c?(f=t.jsx(ke,{side:"bottom",children:c}),e[12]=c,e[13]=f):f=e[13];let m;e[14]!==p||e[15]!==f?(m=t.jsxs(Ne,{delayDuration:0,children:[p,f]}),e[14]=p,e[15]=f,e[16]=m):m=e[16];let u;return e[17]!==l||e[18]!==m?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,m]}),e[17]=l,e[18]=m,e[19]=u):u=e[19],u}function en(){const a=q.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let s;a[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=s):s=a[1];let n;return a[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"surface overflow-hidden",children:[s,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=n):n=a[2],n}function tn(a){const e=q.c(85),{value:s,onChange:n,onColorChange:i,name:l,size:r,className:o,avatarClassName:p,showHoverOverlay:c,disabled:f}=a,m=r===void 0?"lg":r,u=c===void 0?!0:c,h=f===void 0?!1:f,d=Z(),[x,g]=H.useState(!1),[v,y]=H.useState("icons"),[j,b]=H.useState(""),[w,S]=H.useState("blue");let M;e[0]!==s?(M=ni(s),e[0]=s,e[1]=M):M=e[1];const N=M,C=N.type==="icon"||N.type==="url"&&N.color?N.color:w;let k;e[2]!==n||e[3]!==C?(k=te=>{n(jt(te,C))},e[2]=n,e[3]=C,e[4]=k):k=e[4];const V=k;let _;e[5]!==n||e[6]!==i||e[7]!==N.name||e[8]!==N.type||e[9]!==N.url?(_=te=>{S(te),i?.(te),N.type==="icon"?n(jt(N.name,te)):N.type==="url"&&n(qt(N.url,te))},e[5]=n,e[6]=i,e[7]=N.name,e[8]=N.type,e[9]=N.url,e[10]=_):_=e[10];const E=_;let D;e[11]!==n||e[12]!==C?(D=te=>{n(qt(te,C)),g(!1)},e[11]=n,e[12]=C,e[13]=D):D=e[13];const $=D;let I;e[14]!==n||e[15]!==C?(I=()=>{const te=Ps(),J=te[Math.floor(Math.random()*te.length)];n(jt(J,C))},e[14]=n,e[15]=C,e[16]=I):I=e[16];const L=I,U=h?!1:x;let K;e[17]!==d?(K=d("common.iconPicker.changeIcon"),e[17]=d,e[18]=K):K=e[18];const W=h?"cursor-default opacity-50":"cursor-pointer";let G;e[19]!==o||e[20]!==m||e[21]!==W?(G=ve("relative group overflow-hidden",W,ii(m),o),e[19]=o,e[20]=m,e[21]=W,e[22]=G):G=e[22];let F;e[23]!==p||e[24]!==l||e[25]!==m||e[26]!==s?(F=t.jsx(Ht,{icon:s,name:l,size:m,className:p}),e[23]=p,e[24]=l,e[25]=m,e[26]=s,e[27]=F):F=e[27];let Y;e[28]!==h||e[29]!==u?(Y=u&&!h&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(oi,{size:16,className:"text-white"})}),e[28]=h,e[29]=u,e[30]=Y):Y=e[30];let X;e[31]!==h||e[32]!==K||e[33]!==G||e[34]!==F||e[35]!==Y?(X=t.jsx(Rs,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:h,className:G,children:[F,Y]})}),e[31]=h,e[32]=K,e[33]=G,e[34]=F,e[35]=Y,e[36]=X):X=e[36];let T;e[37]!==l||e[38]!==s?(T=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ht,{icon:s,name:l,size:"xl"})}),e[37]=l,e[38]=s,e[39]=T):T=e[39];let z;e[40]!==v?(z=te=>{if(te.key!=="ArrowLeft"&&te.key!=="ArrowRight")return;te.preventDefault();const J=v==="icons"?"upload":"icons";y(J),document.getElementById(`icon-picker-tab-${J}`)?.focus()},e[40]=v,e[41]=z):z=e[41];const B=v==="icons",P=v==="icons"?0:-1;let O;e[42]===Symbol.for("react.memo_cache_sentinel")?(O=()=>y("icons"),e[42]=O):O=e[42];const ee=v==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ae;e[43]!==ee?(ae=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ee),e[43]=ee,e[44]=ae):ae=e[44];let ce;e[45]!==d?(ce=d("common.iconPicker.iconsTab"),e[45]=d,e[46]=ce):ce=e[46];let le;e[47]!==B||e[48]!==P||e[49]!==ae||e[50]!==ce?(le=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":B,"aria-controls":"icon-picker-panel-icons",tabIndex:P,onClick:O,className:ae,children:ce}),e[47]=B,e[48]=P,e[49]=ae,e[50]=ce,e[51]=le):le=e[51];const ie=v==="upload",Q=v==="upload"?0:-1;let de;e[52]===Symbol.for("react.memo_cache_sentinel")?(de=()=>y("upload"),e[52]=de):de=e[52];const ue=v==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let he;e[53]!==ue?(he=ve("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ue),e[53]=ue,e[54]=he):he=e[54];let me;e[55]!==d?(me=d("common.iconPicker.uploadTab"),e[55]=d,e[56]=me):me=e[56];let xe;e[57]!==ie||e[58]!==Q||e[59]!==he||e[60]!==me?(xe=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ie,"aria-controls":"icon-picker-panel-upload",tabIndex:Q,onClick:de,className:he,children:me}),e[57]=ie,e[58]=Q,e[59]=he,e[60]=me,e[61]=xe):xe=e[61];let ge;e[62]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex-1"}),e[62]=ge):ge=e[62];let fe;e[63]!==z||e[64]!==le||e[65]!==xe?(fe=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:z,children:[le,xe,ge]}),e[63]=z,e[64]=le,e[65]=xe,e[66]=fe):fe=e[66];let A;e[67]!==E||e[68]!==L||e[69]!==V||e[70]!==$||e[71]!==N.name||e[72]!==N.type||e[73]!==j||e[74]!==C||e[75]!==v?(A=v==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(_l,{search:j,onSearchChange:b,selectedColor:C,onColorChange:E,onSelectIcon:V,onRandom:L,currentIconName:N.type==="icon"?N.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(Vl,{onUpload:$})}),e[67]=E,e[68]=L,e[69]=V,e[70]=$,e[71]=N.name,e[72]=N.type,e[73]=j,e[74]=C,e[75]=v,e[76]=A):A=e[76];let ne;e[77]!==T||e[78]!==fe||e[79]!==A?(ne=t.jsx(Ls,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Cl,children:t.jsxs("div",{className:"flex flex-col",children:[T,fe,A]})}),e[77]=T,e[78]=fe,e[79]=A,e[80]=ne):ne=e[80];let R;return e[81]!==X||e[82]!==ne||e[83]!==U?(R=t.jsxs(Us,{open:U,onOpenChange:g,children:[X,ne]}),e[81]=X,e[82]=ne,e[83]=U,e[84]=R):R=e[84],R}function Cl(a){return a.preventDefault()}function kl(a){const e=q.c(33),{selectedColor:s,onColorChange:n}=a,i=Z(),[l,r]=H.useState(!1);let o,p,c,f,m,u,h;if(e[0]!==l||e[1]!==s){const w=Os(s);p=Us,u=l,h=r,o=Rs,m=!0,c="button",f=ve("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",w.dot,"ring-foreground/20"),e[0]=l,e[1]=s,e[2]=o,e[3]=p,e[4]=c,e[5]=f,e[6]=m,e[7]=u,e[8]=h}else o=e[2],p=e[3],c=e[4],f=e[5],m=e[6],u=e[7],h=e[8];let d;e[9]!==i?(d=i("common.iconPicker.changeColor"),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==c||e[14]!==f||e[15]!==d||e[16]!==x?(g=t.jsx("button",{type:c,className:f,title:d,"aria-label":x}),e[13]=c,e[14]=f,e[15]=d,e[16]=x,e[17]=g):g=e[17];let v;e[18]!==o||e[19]!==m||e[20]!==g?(v=t.jsx(o,{asChild:m,children:g}),e[18]=o,e[19]=m,e[20]=g,e[21]=v):v=e[21];let y;e[22]!==n||e[23]!==s?(y=di.map(w=>t.jsx("button",{type:"button",onClick:()=>{n(w.name),r(!1)},className:ve("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",w.dot,s===w.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:w.name,"aria-label":w.name},w.name)),e[22]=n,e[23]=s,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Ls,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Ml,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let b;return e[27]!==p||e[28]!==j||e[29]!==u||e[30]!==h||e[31]!==v?(b=t.jsxs(p,{open:u,onOpenChange:h,children:[v,j]}),e[27]=p,e[28]=j,e[29]=u,e[30]=h,e[31]=v,e[32]=b):b=e[32],b}function Ml(a){return a.preventDefault()}function _l(a){const e=q.c(55),{search:s,onSearchChange:n,selectedColor:i,onColorChange:l,onSelectIcon:r,onRandom:o,currentIconName:p}=a,c=Z();let f,m,u,h,d,x,g;if(e[0]!==p||e[1]!==l||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==c){const w=Ps(),S=Os(i);m=ai(w,s),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ct,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let N;e[16]!==n?(N=I=>n(I.target.value),e[16]=n,e[17]=N):N=e[17];let C;e[18]!==c?(C=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=C):C=e[19];let k;e[20]!==s||e[21]!==N||e[22]!==C?(k=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Me,{value:s,onChange:N,placeholder:C,size:"sm",className:"text-xs pl-7"})]}),e[20]=s,e[21]=N,e[22]=C,e[23]=k):k=e[23];let V;e[24]!==c?(V=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=V):V=e[25];let _;e[26]!==c?(_=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=_):_=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ci,{className:"size-3.5 text-muted-foreground"}),e[28]=E):E=e[28];let D;e[29]!==o||e[30]!==V||e[31]!==_?(D=t.jsx(se,{type:"button",variant:"outline",size:"icon",onClick:o,className:"shrink-0",title:V,"aria-label":_,children:E}),e[29]=o,e[30]=V,e[31]=_,e[32]=D):D=e[32];let $;e[33]!==l||e[34]!==i?($=t.jsx(kl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=$):$=e[35],e[36]!==D||e[37]!==$||e[38]!==k?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[k,D,$]}),e[36]=D,e[37]=$,e[38]=k,e[39]=g):g=e[39],f=Ti,d="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",h=m.map(I=>{const L=li(I);return L?t.jsx("button",{type:"button",onClick:()=>r(I),className:ve("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",p===I?ve(S.bg,S.text):ve(S.text,"hover:bg-accent")),title:I,"aria-label":ri(I),children:t.jsx(L,{size:18})},I):null}),e[0]=p,e[1]=l,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=c,e[8]=f,e[9]=m,e[10]=u,e[11]=h,e[12]=d,e[13]=x,e[14]=g}else f=e[8],m=e[9],u=e[10],h=e[11],d=e[12],x=e[13],g=e[14];let v;e[40]!==u||e[41]!==h?(v=t.jsx("div",{className:u,children:h}),e[40]=u,e[41]=h,e[42]=v):v=e[42];let y;e[43]!==m.length||e[44]!==c?(y=m.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=m.length,e[44]=c,e[45]=y):y=e[45];let j;e[46]!==f||e[47]!==d||e[48]!==v||e[49]!==y?(j=t.jsxs(f,{className:d,children:[v,y]}),e[46]=f,e[47]=d,e[48]=v,e[49]=y,e[50]=j):j=e[50];let b;return e[51]!==x||e[52]!==g||e[53]!==j?(b=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=b):b=e[54],b}function Vl(a){const e=q.c(46),{onUpload:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==s||e[1]!==n?(l=D=>{const $=D.target.files?.[0];if(!$)return;if($.size>2097152){oe.error(n("common.iconPicker.imageTooLarge")),D.target.value="";return}const I=new FileReader;I.onerror=()=>{oe.error(n("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&s(I.result),i.current&&(i.current.value="")},I.readAsDataURL($)},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l,[o,p]=H.useState("");let c;e[3]!==s||e[4]!==o?(c=()=>{const D=o.trim();D&&(s(D),p(""))},e[3]=s,e[4]=o,e[5]=c):c=e[5];const f=c;let m;e[6]!==r?(m=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:r}),e[6]=r,e[7]=m):m=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Di,{size:20}),e[9]=h):h=e[9];let d;e[10]!==n?(d=n("common.iconPicker.uploadHint"),e[10]=n,e[11]=d):d=e[11];let x;e[12]!==d?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[h,t.jsx("span",{className:"text-xs",children:d})]}),e[12]=d,e[13]=x):x=e[13];let g;e[14]!==n?(g=n("common.iconPicker.or"),e[14]=n,e[15]=g):g=e[15];let v;e[16]!==g?(v=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=v):v=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==v?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[19]=v,e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=D=>p(D.target.value),e[21]=b):b=e[21];let w;e[22]!==n?(w=n("common.iconPicker.pasteUrlPlaceholder"),e[22]=n,e[23]=w):w=e[23];let S;e[24]!==f?(S=D=>{D.key==="Enter"&&(D.preventDefault(),f())},e[24]=f,e[25]=S):S=e[25];let M;e[26]!==o||e[27]!==w||e[28]!==S?(M=t.jsx(Me,{value:o,onChange:b,placeholder:w,className:"h-8 text-xs flex-1",onKeyDown:S}),e[26]=o,e[27]=w,e[28]=S,e[29]=M):M=e[29];let N;e[30]!==o?(N=o.trim(),e[30]=o,e[31]=N):N=e[31];const C=!N;let k;e[32]!==n?(k=n("common.iconPicker.apply"),e[32]=n,e[33]=k):k=e[33];let V;e[34]!==f||e[35]!==C||e[36]!==k?(V=t.jsx(se,{variant:"outline",className:"shrink-0",onClick:f,disabled:C,children:k}),e[34]=f,e[35]=C,e[36]=k,e[37]=V):V=e[37];let _;e[38]!==M||e[39]!==V?(_=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,V]}),e[38]=M,e[39]=V,e[40]=_):_=e[40];let E;return e[41]!==j||e[42]!==_||e[43]!==m||e[44]!==x?(E=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[m,x,j,_]}),e[41]=j,e[42]=_,e[43]=m,e[44]=x,e[45]=E):E=e[45],E}function Tl(a){const e=q.c(13),{viewId:s,blocksSite:n}=a,i=n===void 0?!1:n;if(s==="overview"){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Is,{size:16}),e[0]=r):r=e[0],r}if(s==="reports"){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:16}),e[1]=r):r=e[1],r}if(s==="board"){let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ui,{size:16}),e[2]=r):r=e[2],r}if(s==="site-editor"){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ii,{size:16}),e[3]=r):r=e[3],r}if(s==="assets"){let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Oi,{size:16}),e[4]=r):r=e[4],r}if(s==="releases"){let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(mi,{size:16}),e[5]=r):r=e[5],r}if(s==="hosting"){let r;return e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(cn,{size:16}),e[6]=r):r=e[6],r}if(s==="e2e"){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(fi,{size:16}),e[7]=r):r=e[7],r}if(s==="analytics"){let r;return e[8]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{size:16}),e[8]=r):r=e[8],r}if(s==="cdn"){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(pi,{size:16}),e[9]=r):r=e[9],r}if(s==="experiments"&&i){let r;return e[10]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(hi,{size:16}),e[10]=r):r=e[10],r}if(s==="calendar"){let r;return e[11]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(xi,{size:16}),e[11]=r):r=e[11],r}let l;return e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(As,{size:16}),e[12]=l):l=e[12],l}function fs(a){const e=q.c(51),{pinned:s,canSetMainView:n,onOpen:i,onTogglePin:l,onSetMainView:r}=a,o=Z(),p=s?"text-foreground":"text-muted-foreground/40";let c;e[0]!==p?(c=ve("size-7",p),e[0]=p,e[1]=c):c=e[1];let f;e[2]!==s||e[3]!==o?(f=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=s,e[3]=o,e[4]=f):f=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Xt,{size:16}),e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==s||e[8]!==c||e[9]!==f?(u=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:c,"aria-label":f,"aria-pressed":s,onClick:l,children:m})}),e[6]=l,e[7]=s,e[8]=c,e[9]=f,e[10]=u):u=e[10];let h;e[11]!==s||e[12]!==o?(h=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=s,e[12]=o,e[13]=h):h=e[13];let d;e[14]!==h?(d=t.jsx(ke,{side:"top",children:h}),e[14]=h,e[15]=d):d=e[15];let x;e[16]!==u||e[17]!==d?(x=t.jsxs(Ne,{delayDuration:0,children:[u,d]}),e[16]=u,e[17]=d,e[18]=x):x=e[18];let g;e[19]!==o?(g=o("virtualMcp.settings.views.rowActions"),e[19]=o,e[20]=g):g=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Pi,{size:16}),e[21]=v):v=e[21];let y;e[22]!==g?(y=t.jsx(ys,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","aria-label":g,children:v})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(dn,{size:14}),e[24]=j):j=e[24];let b;e[25]!==o?(b=o("virtualMcp.settings.views.open"),e[25]=o,e[26]=b):b=e[26];let w;e[27]!==i||e[28]!==b?(w=t.jsxs(He,{onClick:i,children:[j,b]}),e[27]=i,e[28]=b,e[29]=w):w=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Xt,{size:14}),e[30]=S):S=e[30];let M;e[31]!==s||e[32]!==o?(M=o(s?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=s,e[32]=o,e[33]=M):M=e[33];let N;e[34]!==l||e[35]!==M?(N=t.jsxs(He,{onClick:l,children:[S,M]}),e[34]=l,e[35]=M,e[36]=N):N=e[36];let C;e[37]!==n||e[38]!==r||e[39]!==o?(C=n&&t.jsxs(He,{onClick:r,children:[t.jsx(Is,{size:14}),o("virtualMcp.settings.views.setMainView")]}),e[37]=n,e[38]=r,e[39]=o,e[40]=C):C=e[40];let k;e[41]!==w||e[42]!==N||e[43]!==C?(k=t.jsxs(ws,{align:"end",children:[w,N,C]}),e[41]=w,e[42]=N,e[43]=C,e[44]=k):k=e[44];let V;e[45]!==y||e[46]!==k?(V=t.jsxs(js,{children:[y,k]}),e[45]=y,e[46]=k,e[47]=V):V=e[47];let _;return e[48]!==V||e[49]!==x?(_=t.jsxs("div",{className:"flex items-center gap-1",children:[x,V]}),e[48]=V,e[49]=x,e[50]=_):_=e[50],_}const ps=a=>a.stopPropagation();function Dl(a){const e=q.c(8),{icon:s,title:n}=a;let i;e[0]!==s||e[1]!==n?(i=t.jsx(Ze,{icon:s,name:n,size:"xs",className:"shrink-0"}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:n}),e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==i||e[6]!==l?(r=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=r):r=e[7],r}function Pl(a){const e=q.c(70),{views:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.views.defaults"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==n?(l=n("virtualMcp.layoutTabContent.mainView"),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==n?(r=n("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=n,e[5]=r):r=e[5];const o=s.defaultMainView,p=s.setMainView;let c;e[6]!==n?(c=n("virtualMcp.layoutTabContent.mainView"),e[6]=n,e[7]=c):c=e[7];let f;e[8]!==n?(f=n("virtualMcp.layoutTabContent.noMainView"),e[8]=n,e[9]=f):f=e[9];let m;e[10]!==f?(m=t.jsx(Ie,{placeholder:f}),e[10]=f,e[11]=m):m=e[11];let u;e[12]!==c||e[13]!==m?(u=t.jsx(Oe,{"aria-label":c,size:"sm",className:"w-36 shrink-0 @min-xl/project-settings:w-44",children:m}),e[12]=c,e[13]=m,e[14]=u):u=e[14];let h;e[15]!==s.defaultMainOptions?(h=s.defaultMainOptions.map(Ol),e[15]=s.defaultMainOptions,e[16]=h):h=e[16];let d;e[17]!==h?(d=t.jsx(Ae,{children:h}),e[17]=h,e[18]=d):d=e[18];let x;e[19]!==d||e[20]!==u||e[21]!==s.defaultMainView||e[22]!==s.setMainView?(x=t.jsxs($e,{value:o,onValueChange:p,children:[u,d]}),e[19]=d,e[20]=u,e[21]=s.defaultMainView,e[22]=s.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==l||e[26]!==r?(g=t.jsx(tt,{title:l,description:r,action:x}),e[24]=x,e[25]=l,e[26]=r,e[27]=g):g=e[27];let v;e[28]!==n?(v=n("virtualMcp.layoutTabContent.showChat"),e[28]=n,e[29]=v):v=e[29];let y;e[30]!==n?(y=n("virtualMcp.layoutTabContent.showChatDescription"),e[30]=n,e[31]=y):y=e[31];let j;e[32]!==n?(j=n("virtualMcp.layoutTabContent.showChat"),e[32]=n,e[33]=j):j=e[33];const b=s.noMainView?!0:s.chatDefaultOpen;let w;e[34]!==j||e[35]!==b||e[36]!==s.noMainView||e[37]!==s.setChatDefaultOpen?(w=t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ht,{"aria-label":j,checked:b,disabled:s.noMainView,onCheckedChange:s.setChatDefaultOpen})})}),e[34]=j,e[35]=b,e[36]=s.noMainView,e[37]=s.setChatDefaultOpen,e[38]=w):w=e[38];let S;e[39]!==n||e[40]!==s.noMainView?(S=s.noMainView&&t.jsx(ke,{side:"top",children:n("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=n,e[40]=s.noMainView,e[41]=S):S=e[41];let M;e[42]!==w||e[43]!==S?(M=t.jsxs(Ne,{delayDuration:0,children:[w,S]}),e[42]=w,e[43]=S,e[44]=M):M=e[44];let N;e[45]!==v||e[46]!==y||e[47]!==M?(N=t.jsx(tt,{title:v,description:y,action:M}),e[45]=v,e[46]=y,e[47]=M,e[48]=N):N=e[48];let C;e[49]!==g||e[50]!==N?(C=t.jsxs(ze,{children:[g,N]}),e[49]=g,e[50]=N,e[51]=C):C=e[51];let k;e[52]!==i||e[53]!==C?(k=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=k):k=e[54];let V;e[55]!==n?(V=n("virtualMcp.settings.views.sidebar"),e[55]=n,e[56]=V):V=e[56];let _;e[57]!==s?(_=s.projectViews.map(L=>{const U=s.pinned(L);return t.jsx(tt,{icon:t.jsx(Tl,{viewId:L,blocksSite:s.blocksSite}),title:s.labels[L],onClick:()=>s.openView(L),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(fs,{pinned:U,canSetMainView:U&&!s.isMainView(L),onOpen:()=>s.openView(L),onTogglePin:()=>s.togglePin(L,!U),onSetMainView:()=>s.setMainView(L)}),t.jsx("span",{onClick:()=>s.openView(L),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},L)}),e[57]=s,e[58]=_):_=e[58];let E;e[59]!==s?(E=s.connectionsData.flatMap(L=>[t.jsx(Dl,{icon:L.icon,title:L.title},`${L.id}:header`),...L.uiTools.map(U=>{const K=s.pinnedAppViews.find(Y=>Y.connectionId===L.id&&Y.toolName===U.name),W=!!K,G=un(L.id,U.name),F=`ext-apps:${L.id}:${U.name}`;return t.jsx(tt,{onClick:()=>s.openView(G),icon:W?t.jsx("span",{onClick:ps,children:t.jsx(tn,{value:K.icon??null,name:K.label||U.name,size:"xs",showHoverOverlay:!1,onChange:Y=>s.setAppViewIcon(L.id,U.name,Y)})}):t.jsx(As,{size:16}),title:W?t.jsx("span",{onClick:ps,children:t.jsx(Me,{value:K.label,onChange:Y=>s.setAppViewLabel(L.id,U.name,Y.target.value),onBlur:s.commitAppViewLabel,"aria-label":U.title??kt(U.name),className:"h-7 w-full max-w-52 text-sm"})}):U.title??kt(U.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(fs,{pinned:W,canSetMainView:W&&!s.isMainView(F),onOpen:()=>s.openView(G),onTogglePin:()=>s.toggleAppViewPin(L.id,U.name),onSetMainView:()=>s.setMainView(F)}),t.jsx("span",{onClick:()=>s.openView(G),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Wt,{size:16})})]})},`${L.id}:${U.name}`)})]),e[59]=s,e[60]=E):E=e[60];let D;e[61]!==_||e[62]!==E?(D=t.jsxs(ze,{children:[_,E]}),e[61]=_,e[62]=E,e[63]=D):D=e[63];let $;e[64]!==V||e[65]!==D?($=t.jsx(Be,{title:V,children:D}),e[64]=V,e[65]=D,e[66]=$):$=e[66];let I;return e[67]!==k||e[68]!==$?(I=t.jsxs(t.Fragment,{children:[k,$]}),e[67]=k,e[68]=$,e[69]=I):I=e[69],I}function Ol(a){return t.jsx(we,{value:a.value,children:a.label},a.value)}const sn="site-editor",Il=new Set([sn,"content"]);function Al({virtualMcpId:a,form:e,flushAndSave:s}){const n=Z(),i=Tt(),{openPanel:l}=Ei(),r=Ts(a),o=zi(r),p=Bs(a),c=Gi(a),f=(r?.connections??[]).map(T=>T.connection_id).sort(),{data:m}=Cs({queryKey:Dt.projectConnectionDetails(a,f),enabled:f.length>0,queryFn:async()=>await Promise.all(f.map(async z=>{try{const{item:B}=await i.call("COLLECTION_CONNECTIONS_GET",{id:z}),P=(B?.tools??[]).flatMap(O=>{const ee=Ai(O._meta);return ee?[{name:O.name,title:O.title,description:O.description,resourceUri:ee}]:[]});return{fetchOk:!0,id:z,title:B?.title??z,icon:B?.icon??null,uiTools:P}}catch{return{fetchOk:!1,id:z,title:z,icon:null,uiTools:[]}}}))}),u=(m??[]).filter(T=>T.uiTools.length>0),h=new Set([...mn,...fn]),d=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,v=x?.chatDefaultOpen??!1,y=o.presence.calendar,j=e.watch("metadata.sidebarViewsSeen"),b=Mt(_t({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion"),es(j,y)),w=c??(r?Mt(_t(r.metadata),r.metadata.sidebarViewsVersion,es(r.metadata.sidebarViewsSeen,y)):b),S=(()=>{if(!g||g.type==="chat")return"";const T=pn(g.type);return T==="instructions"||T==="connections"||T==="layout"?"settings":Il.has(T)?sn:h.has(T)?T:`${T}:${g.id??""}:${g.toolName??""}`})(),M=S==="",N=T=>{const[z,B,P]=T.split(":");return z?h.has(z)?{type:z}:z==="ext-apps"&&B?{type:"ext-apps",id:B,toolName:P||void 0}:null:null},C=T=>{e.setValue("metadata.ui.pinnedViews",T,{shouldDirty:!0})},k=T=>{e.setValue("metadata.ui.layout",{...x,...T},{shouldDirty:!0})},V=H.useRef(!1);if(m&&m.length>0&&!V.current){V.current=!0;const T=new Set((m??[]).filter(O=>O.fetchOk).map(O=>O.id)),z=new Set(u.flatMap(O=>O.uiTools.map(ee=>`${O.id}:${ee.name}`))),B=new Set(f),P=d.filter(O=>B.has(O.connectionId)&&(!T.has(O.connectionId)||z.has(`${O.connectionId}:${O.toolName}`)));P.length!==d.length&&(C(P),g?.type==="ext-apps"&&!P.some(O=>O.connectionId===g.id&&O.toolName===g.toolName)&&k({defaultMainView:{type:"settings"}}))}const _=(T,z)=>{if(d.some(P=>P.connectionId===T&&P.toolName===z)){const P=d.filter(ee=>!(ee.connectionId===T&&ee.toolName===z));C(P);const O=`ext-apps:${T}:${z}`;S===O&&k({defaultMainView:{type:"settings"}})}else{const P=u.find(O=>O.id===T)?.uiTools.find(O=>O.name===z)?.title;C([...d,{connectionId:T,toolName:z,label:P??kt(z),icon:null}])}s()},E=(T,z,B)=>{C(d.map(P=>P.connectionId===T&&P.toolName===z?{...P,label:B}:P))},D=()=>{s()},$=(T,z,B)=>{C(d.map(P=>P.connectionId===T&&P.toolName===z?{...P,icon:B}:P)),s()},I=T=>{k({defaultMainView:N(T)}),s()},L=(T,z)=>{const B=Yi(w,T,z,1);e.setValue("metadata.sidebarViews",B,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),y&&e.setValue("metadata.sidebarViewsSeen",Bi(r?.metadata.sidebarViewsSeen??j,y),{shouldDirty:!0}),p.stage(B,w);const P=Wi(g,T,z);P!==g&&k({defaultMainView:P})},U=Ys(r?.metadata),K=Ri(U,o.presence),W=Li(K),G=Ui(w,K,1),F={overview:n("sidebar.navDestinations.home"),reports:n("sidebar.navDestinations.reports"),board:n("sidebar.navDestinations.tasks"),"site-editor":n("virtualMcp.layoutTabContent.siteEditor"),assets:n("common.mainPanelTabs.assets"),releases:n("common.mainPanelTabs.releases"),hosting:n("common.mainPanelTabs.hosting"),e2e:n("common.mainPanelTabs.e2e"),analytics:n("common.mainPanelTabs.analytics"),cdn:n("common.mainPanelTabs.cdn"),automations:n("virtualMcp.layoutTabContent.automations"),experiments:n("experiments.title"),calendar:n("common.mainPanelTabs.calendar")},Y=[];for(const T of G)T!=="automations"&&Y.push({value:T,label:F[T]});for(const T of d)Y.push({value:`ext-apps:${T.connectionId}:${T.toolName}`,label:T.label||T.toolName});return G.includes("automations")&&Y.push({value:"automations",label:F.automations}),Y.push({value:"settings",label:n("virtualMcp.layoutTabContent.settings")}),{projectViews:W,blocksSite:y,labels:F,pinned:T=>w.includes(T),isMainView:T=>S===T,defaultMainView:S,defaultMainOptions:Y,noMainView:M,chatDefaultOpen:v,connectionsData:u,pinnedAppViews:d,openView:T=>l(T,{virtualmcpid:a}),togglePin:(T,z)=>L(T,z),setMainView:I,setChatDefaultOpen:T=>{k({chatDefaultOpen:T}),s()},toggleAppViewPin:_,setAppViewIcon:$,setAppViewLabel:E,commitAppViewLabel:D}}function $l(a){const e=q.c(55),{form:s,onCommit:n}=a,i=Z(),l=H.useId();let r;e[0]!==i?(r=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx("p",{className:"text-sm font-medium",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==i?(p=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=p):p=e[5];let c;e[6]!==p?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:p}),e[6]=p,e[7]=c):c=e[7];let f;e[8]!==o||e[9]!==c?(f=t.jsxs("div",{children:[o,c]}),e[8]=o,e[9]=c,e[10]=f):f=e[10];let m;e[11]!==s||e[12]!==n||e[13]!==i?(m=V=>{const{field:_}=V;return t.jsx("div",{className:"justify-self-start",children:t.jsx(tn,{value:_.value??null,onChange:E=>{_.onChange(E),n()},onColorChange:E=>{s.setValue("metadata.ui.themeColor",E,{shouldDirty:!0}),n()},name:s.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=s,e[12]=n,e[13]=i,e[14]=m):m=e[14];let u;e[15]!==s.control||e[16]!==m?(u=t.jsx(be,{name:"icon",control:s.control,render:m}),e[15]=s.control,e[16]=m,e[17]=u):u=e[17];let h;e[18]!==f||e[19]!==u?(h=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[f,u]}),e[18]=f,e[19]=u,e[20]=h):h=e[20];const d=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==d?(g=t.jsx("label",{htmlFor:d,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=d,e[25]=g):g=e[25];let v;e[26]!==l||e[27]!==n||e[28]!==i?(v=V=>{const{field:_}=V;return t.jsx(Me,{..._,id:`${l}-name`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=n,e[28]=i,e[29]=v):v=e[29];let y;e[30]!==s.control||e[31]!==v?(y=t.jsx(be,{name:"title",control:s.control,render:v}),e[30]=s.control,e[31]=v,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const b=`${l}-description`;let w;e[36]!==i?(w=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=w):w=e[37];let S;e[38]!==b||e[39]!==w?(S=t.jsx("label",{htmlFor:b,className:"text-sm font-medium",children:w}),e[38]=b,e[39]=w,e[40]=S):S=e[40];let M;e[41]!==l||e[42]!==n||e[43]!==i?(M=V=>{const{field:_}=V;return t.jsx(ut,{..._,id:`${l}-description`,value:_.value??"",onBlur:()=>{_.onBlur(),n()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=n,e[43]=i,e[44]=M):M=e[44];let N;e[45]!==s.control||e[46]!==M?(N=t.jsx(be,{name:"description",control:s.control,render:M}),e[45]=s.control,e[46]=M,e[47]=N):N=e[47];let C;e[48]!==S||e[49]!==N?(C=t.jsxs(je,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[S,N]}),e[48]=S,e[49]=N,e[50]=C):C=e[50];let k;return e[51]!==j||e[52]!==C||e[53]!==h?(k=t.jsxs(ze,{children:[h,j,C]}),e[51]=j,e[52]=C,e[53]=h,e[54]=k):k=e[54],k}function Fl(a){const e=q.c(8),{section:s}=a,n=Z();let i;e[0]!==n?(i=n("virtualMcp.settings.navigation"),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==n?(l=Ji.map(o=>{const{titleKey:p}=Zi[o];return t.jsx(Ue.Tab,{active:s===o,asChild:!0,children:t.jsx(Ns,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:o==="general"?void 0:o}),children:n(p)})},o)}),e[2]=s,e[3]=n,e[4]=l):l=e[4];let r;if(e[5]!==i||e[6]!==l){const o=t.jsx(Ue.Tabs,{"aria-label":i,children:l});r=t.jsx(hn.Toolbar.Left.Portal,{fallback:o,children:o}),e[5]=i,e[6]=l,e[7]=r}else r=e[7];return r}function El(){const a=q.c(8),e=Pt();let s;a[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},a[0]=s):s=a[0];const{section:n}=xn(s);let i;a[1]!==n?(i=ea(n)?n:"general",a[1]=n,a[2]=i):i=a[2];let l;a[3]!==e?(l=o=>e({to:".",search:p=>({...p,section:o??void 0})}),a[3]=e,a[4]=l):l=a[4];let r;return a[5]!==i||a[6]!==l?(r={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=r):r=a[7],r}function nn(a){const e=q.c(20),{value:s,label:n,copiedLabel:i,variant:l,size:r,className:o,copiedClassName:p}=a,c=l===void 0?"ghost":l,f=r===void 0?"icon-sm":r,{handleCopy:m,copied:u}=sa();let h;e[0]!==m||e[1]!==s?(h=()=>{m(s).catch(zl)},e[0]=m,e[1]=s,e[2]=h):h=e[2];const d=u&&p;let x;e[3]!==o||e[4]!==d?(x=ve(o,d),e[3]=o,e[4]=d,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(rt,{className:"text-success"}):t.jsx(xt,{}),e[6]=u,e[7]=g):g=e[7];let v;e[8]!==n||e[9]!==f||e[10]!==h||e[11]!==x||e[12]!==g||e[13]!==c?(v=t.jsx(se,{type:"button",variant:c,size:f,"aria-label":n,onClick:h,className:x,children:g}),e[8]=n,e[9]=f,e[10]=h,e[11]=x,e[12]=g,e[13]=c,e[14]=v):v=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let b;return e[17]!==v||e[18]!==j?(b=t.jsxs(t.Fragment,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=b):b=e[19],b}function zl(){}function Rl(a){const e=q.c(14),{id:s,value:n,copyLabel:i,copiedLabel:l,className:r}=a;let o;e[0]!==r?(o=ve("relative h-fit",r),e[0]=r,e[1]=o):o=e[1];let p;e[2]!==s||e[3]!==n?(p=t.jsx(Me,{id:s,value:n,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=s,e[3]=n,e[4]=p):p=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=ve("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i||e[8]!==n?(f=t.jsx(nn,{value:n,label:i,copiedLabel:l,className:c,copiedClassName:"opacity-100"}),e[6]=l,e[7]=i,e[8]=n,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==p||e[12]!==f?(m=t.jsxs("div",{className:o,children:[p,f]}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13],m}async function hs(a){const e=await a.json().catch(()=>({}));if(!a.ok)throw new Error(e.error??`HTTP ${a.status}`);return e}function Ll(a){const e=q.c(106),{orgSlug:s,virtualMcpId:n}=a,i=Z(),l=ks(),r=`/api/${s}/hosted/${encodeURIComponent(n)}/site-tokens`;let o;e[0]!==s||e[1]!==n?(o=Dt.hostedSiteTokens(s,n),e[0]=s,e[1]=n,e[2]=o):o=e[2];const p=o,[c,f]=H.useState(null),m=H.useId();let u;e[3]!==r?(u=async()=>hs(await fetch(r)),e[3]=r,e[4]=u):u=e[4];let h;e[5]!==p||e[6]!==u?(h={queryKey:p,queryFn:u},e[5]=p,e[6]=u,e[7]=h):h=e[7];const d=Cs(h);let x;e[8]!==r?(x=async()=>hs(await fetch(r,{method:"POST"})),e[8]=r,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=fe=>{const{token:A}=fe;return f(A)},e[10]=g):g=e[10];let v;e[11]!==p||e[12]!==l?(v=()=>l.invalidateQueries({queryKey:p}),e[11]=p,e[12]=l,e[13]=v):v=e[13];let y;e[14]!==x||e[15]!==v?(y={mutationFn:x,onSuccess:g,onError:Ul,onSettled:v},e[14]=x,e[15]=v,e[16]=y):y=e[16];const j=gn(y);let b;e[17]!==d.data?.tokens?(b=d.data?.tokens??[],e[17]=d.data?.tokens,e[18]=b):b=e[18];const w=b,S=d.data?.site;let M;e[19]!==i?(M=i("siteTokens.title"),e[19]=i,e[20]=M):M=e[20];let N;e[21]!==i?(N=i("siteTokens.description"),e[21]=i,e[22]=N):N=e[22];let C;e[23]!==i?(C=i("siteTokens.siteId"),e[23]=i,e[24]=C):C=e[24];let k;e[25]!==m||e[26]!==C?(k=t.jsx("label",{htmlFor:m,className:"text-sm font-medium",children:C}),e[25]=m,e[26]=C,e[27]=k):k=e[27];let V;e[28]!==i?(V=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=V):V=e[29];let _;e[30]!==V?(_=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:V}),e[30]=V,e[31]=_):_=e[31];let E;e[32]!==S||e[33]!==m||e[34]!==i?(E=S?t.jsx(Rl,{id:m,value:S,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=S,e[33]=m,e[34]=i,e[35]=E):E=e[35];const D=!d.data||j.isPending;let $;e[36]!==j?($=()=>j.mutate(),e[36]=j,e[37]=$):$=e[37];let I;e[38]!==j.isPending?(I=j.isPending?t.jsx(it,{className:"size-3.5"}):t.jsx(Pe,{size:14}),e[38]=j.isPending,e[39]=I):I=e[39];let L;e[40]!==i?(L=i("siteTokens.issue"),e[40]=i,e[41]=L):L=e[41];let U;e[42]!==D||e[43]!==$||e[44]!==I||e[45]!==L?(U=t.jsxs(se,{type:"button",size:"sm",className:"shrink-0",disabled:D,onClick:$,children:[I,L]}),e[42]=D,e[43]=$,e[44]=I,e[45]=L,e[46]=U):U=e[46];let K;e[47]!==E||e[48]!==U?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[E,U]}),e[47]=E,e[48]=U,e[49]=K):K=e[49];let W;e[50]!==k||e[51]!==_||e[52]!==K?(W=t.jsxs(je,{className:"group",children:[k,_,K]}),e[50]=k,e[51]=_,e[52]=K,e[53]=W):W=e[53];let G;e[54]!==d.error||e[55]!==d.isError?(G=d.isError?t.jsx(je,{children:t.jsx("p",{className:"text-xs text-destructive",children:d.error.message})}):null,e[54]=d.error,e[55]=d.isError,e[56]=G):G=e[56];let F;if(e[57]!==i||e[58]!==w){let fe;e[60]!==i?(fe=A=>t.jsx(je,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx($t,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:A.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:ta(new Date(A.iat*1e3))})})]})]})},A.kid),e[60]=i,e[61]=fe):fe=e[61],F=w.map(fe),e[57]=i,e[58]=w,e[59]=F}else F=e[59];let Y;e[62]!==W||e[63]!==G||e[64]!==F?(Y=t.jsxs(ze,{children:[W,G,F]}),e[62]=W,e[63]=G,e[64]=F,e[65]=Y):Y=e[65];const X=c!==null;let T;e[66]===Symbol.for("react.memo_cache_sentinel")?(T=fe=>!fe&&f(null),e[66]=T):T=e[66];let z;e[67]!==i?(z=i("siteTokens.createdTitle"),e[67]=i,e[68]=z):z=e[68];let B;e[69]!==z?(B=t.jsx(lt,{children:z}),e[69]=z,e[70]=B):B=e[70];let P;e[71]!==i?(P=i("siteTokens.createdDescription"),e[71]=i,e[72]=P):P=e[72];let O;e[73]!==P?(O=t.jsx(Ms,{children:P}),e[73]=P,e[74]=O):O=e[74];let ee;e[75]!==B||e[76]!==O?(ee=t.jsxs(at,{children:[B,O]}),e[75]=B,e[76]=O,e[77]=ee):ee=e[77];let ae;e[78]!==i?(ae=i("siteTokens.createdTitle"),e[78]=i,e[79]=ae):ae=e[79];const ce=c??"";let le;e[80]!==ae||e[81]!==ce?(le=t.jsx(Me,{readOnly:!0,"aria-label":ae,value:ce,className:"font-mono text-xs"}),e[80]=ae,e[81]=ce,e[82]=le):le=e[82];let ie;e[83]!==c||e[84]!==i?(ie=c?t.jsx(nn,{value:c,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=c,e[84]=i,e[85]=ie):ie=e[85];let Q;e[86]!==le||e[87]!==ie?(Q=t.jsxs("div",{className:"flex items-center gap-2",children:[le,ie]}),e[86]=le,e[87]=ie,e[88]=Q):Q=e[88];let de;e[89]===Symbol.for("react.memo_cache_sentinel")?(de=()=>f(null),e[89]=de):de=e[89];let ue;e[90]!==i?(ue=i("siteTokens.done"),e[90]=i,e[91]=ue):ue=e[91];let he;e[92]!==ue?(he=t.jsx(Vt,{children:t.jsx(se,{onClick:de,children:ue})}),e[92]=ue,e[93]=he):he=e[93];let me;e[94]!==ee||e[95]!==Q||e[96]!==he?(me=t.jsxs(Je,{className:"sm:max-w-lg",children:[ee,Q,he]}),e[94]=ee,e[95]=Q,e[96]=he,e[97]=me):me=e[97];let xe;e[98]!==X||e[99]!==me?(xe=t.jsx(Xe,{open:X,onOpenChange:T,children:me}),e[98]=X,e[99]=me,e[100]=xe):xe=e[100];let ge;return e[101]!==N||e[102]!==Y||e[103]!==xe||e[104]!==M?(ge=t.jsxs(Be,{title:M,description:N,children:[Y,xe]}),e[101]=N,e[102]=Y,e[103]=xe,e[104]=M,e[105]=ge):ge=e[105],ge}function Ul(a){return oe.error(a.message)}function Yl(a){const e=q.c(8),{control:s,previewServerUrl:n}=a,i=Z();let l;e[0]!==n?(l=Ws(n),e[0]=n,e[1]=l):l=e[1];const r=!!l;let o;e[2]!==r||e[3]!==i?(o=c=>{const{field:f}=c;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(r?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ht,{id:"fast-preview",className:"shrink-0",checked:!!f.value&&r,disabled:!r,onCheckedChange:m=>f.onChange(m)})]})},e[2]=r,e[3]=i,e[4]=o):o=e[4];let p;return e[5]!==s||e[6]!==o?(p=t.jsx(be,{control:s,name:"metadata.fastPreview",render:o}),e[5]=s,e[6]=o,e[7]=p):p=e[7],p}function Bl(a){const e=q.c(5),{control:s,fastPreview:n}=a,i=Z();if(!n)return null;let l;e[0]!==i?(l=o=>{const{field:p}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(ht,{id:"fast-preview-in-place",className:"shrink-0",checked:!!p.value,onCheckedChange:c=>p.onChange(c)})]})},e[0]=i,e[1]=l):l=e[1];let r;return e[2]!==s||e[3]!==l?(r=t.jsx(be,{control:s,name:"metadata.fastPreviewInPlace",render:l}),e[2]=s,e[3]=l,e[4]=r):r=e[4],r}function Wl(a){const e=q.c(18),{control:s,isBlocksV8:n}=a,i=n===void 0?!1:n,l=Z();let r;e[0]!==l?(r=l("sandbox.previewServerUrlField.label"),e[0]=l,e[1]=r):r=e[1];let o;e[2]!==r?(o=t.jsx(ye,{htmlFor:"preview-server-url",children:r}),e[2]=r,e[3]=o):o=e[3];let p;e[4]!==l?(p=d=>{const{field:x}=d,g=x.value??"";return t.jsx(Me,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:l("sandbox.previewServerUrlField.placeholder"),value:g,onChange:v=>x.onChange(v.target.value===""?null:v.target.value),onBlur:()=>{x.onChange(na(g)),x.onBlur()}})},e[4]=l,e[5]=p):p=e[5];let c;e[6]!==s||e[7]!==p?(c=t.jsx(be,{control:s,name:"metadata.previewServerUrl",render:p}),e[6]=s,e[7]=p,e[8]=c):c=e[8];const f=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let m;e[9]!==l||e[10]!==f?(m=l(f),e[9]=l,e[10]=f,e[11]=m):m=e[11];let u;e[12]!==m?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;return e[14]!==o||e[15]!==c||e[16]!==u?(h=t.jsxs("div",{className:"space-y-2",children:[o,c,u]}),e[14]=o,e[15]=c,e[16]=u,e[17]=h):h=e[17],h}function Kl(a){const e=q.c(15),{control:s,isBlocksV8:n,previewServerUrl:i,fastPreview:l}=a,r=Z(),o=n||!!l;let p;e[0]!==s||e[1]!==n?(p=t.jsx(je,{children:t.jsx(Wl,{control:s,isBlocksV8:n})}),e[0]=s,e[1]=n,e[2]=p):p=e[2];let c;e[3]!==s||e[4]!==n||e[5]!==i||e[6]!==r?(c=n?!Ws(i)&&t.jsx(je,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:r("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(je,{children:t.jsx(Yl,{control:s,previewServerUrl:i})}),e[3]=s,e[4]=n,e[5]=i,e[6]=r,e[7]=c):c=e[7];let f;e[8]!==s||e[9]!==o?(f=o&&t.jsx(je,{children:t.jsx(Bl,{control:s,fastPreview:o})}),e[8]=s,e[9]=o,e[10]=f):f=e[10];let m;return e[11]!==p||e[12]!==c||e[13]!==f?(m=t.jsxs(t.Fragment,{children:[p,c,f]}),e[11]=p,e[12]=c,e[13]=f,e[14]=m):m=e[14],m}const St={tools:null,resources:null,prompts:null},Gl=aa.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function ql(a){const s=new TextEncoder().encode(a),n=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(n)}function an(a){return{"x-studio-client":a,"x-mesh-client":a}}function Hl(a){const e=q.c(15),{url:s,agentId:n}=a,i=Z(),[l,r]=H.useState(!1);let o;e[0]!==n||e[1]!==i||e[2]!==s?(o=async()=>{Ve("agent_connect_action",{agent_id:n,action:"copy_url"}),await navigator.clipboard.writeText(s),r(!0),oe.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await vt(2e3),r(!1)},e[0]=n,e[1]=i,e[2]=s,e[3]=o):o=e[3];const p=o;let c;e[4]!==l?(c=l?t.jsx(rt,{size:20,className:"text-success"}):t.jsx(xt,{size:20}),e[4]=l,e[5]=c):c=e[5];let f;e[6]!==l||e[7]!==i?(f=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=f):f=e[8];let m;e[9]!==f?(m=t.jsx("span",{className:"text-xs font-medium",children:f}),e[9]=f,e[10]=m):m=e[10];let u;return e[11]!==p||e[12]!==c||e[13]!==m?(u=t.jsxs(se,{type:"button",variant:"outline",onClick:p,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,m]}),e[11]=p,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function Ql(a){const e=q.c(13),{url:s,serverName:n,agentId:i}=a,l=Z();let r;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(r=()=>{Ve("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Gs(n),h={type:"http",url:s,headers:an("Cursor")},d=ql(JSON.stringify(h,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(d)}`;window.open(x,"_blank"),oe.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=r):r=e[4];const o=r;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=p):p=e[5];let c;e[6]!==l?(c=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=c):c=e[7];let f;e[8]!==c?(f=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=f):f=e[9];let m;return e[10]!==o||e[11]!==f?(m=t.jsxs(se,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[p,f]}),e[10]=o,e[11]=f,e[12]=m):m=e[12],m}function Xl(a){const e=q.c(16),{url:s,serverName:n,agentId:i}=a,l=Z(),[r,o]=H.useState(!1);let p;e[0]!==i||e[1]!==n||e[2]!==l||e[3]!==s?(p=async()=>{Ve("agent_connect_action",{agent_id:i,action:"install_claude_code"});const d=Gs(n),x={type:"http",url:s,headers:an("Claude Code")},g=JSON.stringify(x,null,2),v=`claude mcp add-json "${d}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(v),o(!0),oe.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await vt(2e3),o(!1)},e[0]=i,e[1]=n,e[2]=l,e[3]=s,e[4]=p):p=e[4];const c=p;let f;e[5]!==r?(f=r?t.jsx(rt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==r||e[8]!==l?(m=l(r?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=r,e[8]=l,e[9]=m):m=e[9];let u;e[10]!==m?(u=t.jsx("span",{className:"text-xs font-medium",children:m}),e[10]=m,e[11]=u):u=e[11];let h;return e[12]!==c||e[13]!==f||e[14]!==u?(h=t.jsxs(se,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[f,u]}),e[12]=c,e[13]=f,e[14]=u,e[15]=h):h=e[15],h}const Jl=720*60*60;function Zl({virtualMcp:a}){const e=Z(),s=Tt(),[n,i]=H.useState(null),[l,r]=H.useState(!1),[o,p]=H.useState(!1),c=a.id,f=a.title||`agent-${c.slice(0,8)}`,m=n?`bunx @decocms/typegen@latest --mcp ${c} --key ${n} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,u=async()=>{r(!0);try{const{key:d}=await s.call("API_KEY_CREATE",{name:`typegen-${f}`,permissions:{[c]:["*"]},expiresIn:Jl});if(!d)throw new Error("No key in response");i(d),Ve("agent_typegen_key_generated",{agent_id:c})}catch{Ve("agent_typegen_key_failed",{agent_id:c}),oe.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{r(!1)}},h=async()=>{Ve("agent_connect_action",{agent_id:c,action:"typegen_copy_command",has_api_key:!!n}),await navigator.clipboard.writeText(m),p(!0),oe.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await vt(2e3),p(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!n&&t.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(it,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),n&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:m}),t.jsx(se,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:h,children:o?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(er,{apiKey:n,agentId:c})]})}function er(a){const e=q.c(21),{apiKey:s,agentId:n}=a,[i,l]=H.useState(!1),r=window.location.origin,o=s?`STUDIO_API_KEY=${s}`:"STUDIO_API_KEY=<api-key>",p=`STUDIO_BASE_URL=${r}`,c=`${o}
|
|
2
|
+
${p}`;let f;e[0]!==n||e[1]!==s||e[2]!==c?(f=async()=>{Ve("agent_connect_action",{agent_id:n,action:"typegen_copy_env",has_api_key:!!s}),await navigator.clipboard.writeText(c),l(!0),await vt(2e3),l(!1)},e[0]=n,e[1]=s,e[2]=c,e[3]=f):f=e[3];const m=f,u=!s;let h;e[4]!==u?(h=ve({"opacity-50":u}),e[4]=u,e[5]=h):h=e[5];let d;e[6]!==o||e[7]!==h?(d=t.jsx("span",{className:h,children:o}),e[6]=o,e[7]=h,e[8]=d):d=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:p}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let v;e[11]!==d?(v=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[d,x,g]}),e[11]=d,e[12]=v):v=e[12];let y;e[13]!==i?(y=i?t.jsx(rt,{size:12,className:"text-success"}):t.jsx(xt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==m||e[16]!==y?(j=t.jsx(se,{type:"button",variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:m,children:y}),e[15]=m,e[16]=y,e[17]=j):j=e[17];let b;return e[18]!==v||e[19]!==j?(b=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[v,j]})}),e[18]=v,e[19]=j,e[20]=b):b=e[20],b}function tr(a){const e=q.c(3),{virtualMcp:s}=a;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=n):n=e[0];let i;return e[1]!==s?(i=t.jsx(H.Suspense,{fallback:n,children:t.jsx(Zl,{virtualMcp:s})}),e[1]=s,e[2]=i):i=e[2],i}function sr(a){const e=q.c(45),{open:s,onOpenChange:n,virtualMcp:i}=a,l=Z(),{org:r}=Fe(),o=`/api/${r.slug}/mcp/virtual-mcp/${i.id}`;let p;e[0]!==o?(p=new URL(o,window.location.origin),e[0]=o,e[1]=p):p=e[1];const c=p;let f;e[2]!==i.id||e[3]!==i.title?(f=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=f):f=e[4];const m=f,u=ua();let h;e[5]!==i.id||e[6]!==c.href?(h=t.jsx(Hl,{url:c.href,agentId:i.id}),e[5]=i.id,e[6]=c.href,e[7]=h):h=e[7];let d,x;e[8]!==m||e[9]!==i.id||e[10]!==c.href?(d=t.jsx(Ql,{url:c.href,serverName:m,agentId:i.id}),x=t.jsx(Xl,{url:c.href,serverName:m,agentId:i.id}),e[8]=m,e[9]=i.id,e[10]=c.href,e[11]=d,e[12]=x):(d=e[11],x=e[12]);let g;e[13]!==h||e[14]!==d||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[h,d,x]})}),e[13]=h,e[14]=d,e[15]=x,e[16]=g):g=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"border-t border-border"}),e[17]=v):v=e[17];let y;e[18]!==i?(y=t.jsx(tr,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,v,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const b=j;if(u){let C;e[23]!==l?(C=l("virtualMcp.virtualMcpShareModal.connect"),e[23]=l,e[24]=C):C=e[24];let k;e[25]!==C?(k=t.jsx(oa,{className:"mt-4 mb-4 text-base font-semibold",children:C}),e[25]=C,e[26]=k):k=e[26];let V;e[27]!==b||e[28]!==k?(V=t.jsx(ca,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[k,b]})}),e[27]=b,e[28]=k,e[29]=V):V=e[29];let _;return e[30]!==n||e[31]!==s||e[32]!==V?(_=t.jsx(da,{open:s,onOpenChange:n,children:V}),e[30]=n,e[31]=s,e[32]=V,e[33]=_):_=e[33],_}let w;e[34]!==l?(w=l("virtualMcp.virtualMcpShareModal.connect"),e[34]=l,e[35]=w):w=e[35];let S;e[36]!==w?(S=t.jsx(at,{children:t.jsx(lt,{children:w})}),e[36]=w,e[37]=S):S=e[37];let M;e[38]!==b||e[39]!==S?(M=t.jsxs(Je,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[S,b]}),e[38]=b,e[39]=S,e[40]=M):M=e[40];let N;return e[41]!==n||e[42]!==s||e[43]!==M?(N=t.jsx(Xe,{open:s,onOpenChange:n,children:M}),e[41]=n,e[42]=s,e[43]=M,e[44]=N):N=e[44],N}const nr=/^[A-Za-z_][A-Za-z0-9_]*$/;function ir(a){const e={},s=a.split(/\r?\n/);for(let n=0;n<s.length;n++){let i=(s[n]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${n+1}: missing '='`);const r=i.slice(0,l).trim();if(!nr.test(r))throw new Error(`Line ${n+1}: invalid key "${r}"`);let o=i.slice(l+1).trim();o.length>=2&&(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1)),e[r]=o}return e}function ar(a){const e=q.c(28),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z();let p;e[0]!==o?(p=o("sandbox.envVarsField.title"),e[0]=o,e[1]=p):p=e[1];let c;e[2]!==p?(c=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ye,{className:"font-normal text-foreground",children:p})}),e[2]=p,e[3]=c):c=e[3];let f;e[4]!==o?(f=o("sandbox.envVarsField.description"),e[4]=o,e[5]=f):f=e[5];let m;e[6]!==f?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[6]=f,e[7]=m):m=e[7];let u;e[8]!==s||e[9]!==n||e[10]!==l||e[11]!==r||e[12]!==i?(u=t.jsx(lr,{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}),e[8]=s,e[9]=n,e[10]=l,e[11]=r,e[12]=i,e[13]=u):u=e[13];let h;e[14]!==o?(h=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??o("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=o,e[15]=h):h=e[15];let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(vn,{className:"h-9 w-full"}),e[16]=d):d=e[16];let x;e[17]!==s||e[18]!==n?(x=t.jsx(H.Suspense,{fallback:d,children:t.jsx(or,{control:s,form:n})}),e[17]=s,e[18]=n,e[19]=x):x=e[19];let g;e[20]!==h||e[21]!==x?(g=t.jsx(Ye,{fallback:h,children:x}),e[20]=h,e[21]=x,e[22]=g):g=e[22];let v;return e[23]!==c||e[24]!==m||e[25]!==u||e[26]!==g?(v=t.jsxs("div",{className:"space-y-2",children:[c,m,u,g]}),e[23]=c,e[24]=m,e[25]=u,e[26]=g,e[27]=v):v=e[27],v}function lr(a){const e=q.c(33),{control:s,form:n,virtualMcpId:i,orgSlug:l,sandboxMap:r}=a,o=Z(),c=bn.useSession().data?.user?.id,f="metadata.runtime.env";let m;e[0]!==n?(m=()=>JSON.stringify(xs(n.getValues(f))),e[0]=n,e[1]=m):m=e[1];const[u,h]=H.useState(m);let d;e[2]!==s?(d={control:s,name:f},e[2]=s,e[3]=d):d=e[3];const x=_s(d);let g;e[4]!==x?(g=JSON.stringify(xs(x)),e[4]=x,e[5]=g):g=e[5];const v=g,y=v!==u;let j;e[6]!==r||e[7]!==c?(j=c?Object.keys(r?.[c]??{}):[],e[6]=r,e[7]=c,e[8]=j):j=e[8];const b=j,w=b.length>0,[S,M]=H.useState(!1);if(!y||!w)return null;let N;e[9]!==v||e[10]!==l||e[11]!==o||e[12]!==b||e[13]!==i?(N=async()=>{M(!0);const L=await Promise.allSettled(b.map(async K=>{const W=ma({orgSlug:l,virtualMcpId:i,branch:K,threadId:null},"setup/start"),G=await fetch(W,{method:"POST"});if(!G.ok){const F=await G.text().catch(()=>G.statusText);throw new Error(F||G.statusText)}}));M(!1);const U=L.filter(rr).length;U===0?(h(v),oe.success(b.length===1?o("sandbox.envVarsField.restartedSingle"):o("sandbox.envVarsField.restartedMultiple",{count:b.length}))):oe.error(o("sandbox.envVarsField.restartFailed",{failed:U,total:b.length}))},e[9]=v,e[10]=l,e[11]=o,e[12]=b,e[13]=i,e[14]=N):N=e[14];const C=N;let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ss,{className:"size-3.5 shrink-0"}),e[15]=k):k=e[15];let V;e[16]!==o?(V=o("sandbox.envVarsField.sandboxRunningNotice"),e[16]=o,e[17]=V):V=e[17];let _;e[18]!==V?(_=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[k,t.jsx("span",{className:"truncate",children:V})]}),e[18]=V,e[19]=_):_=e[19];let E;e[20]!==S?(E=S?t.jsx(it,{className:"size-3.5"}):t.jsx(yn,{className:"size-3.5"}),e[20]=S,e[21]=E):E=e[21];let D;e[22]!==S||e[23]!==o?(D=o(S?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=S,e[23]=o,e[24]=D):D=e[24];let $;e[25]!==C||e[26]!==S||e[27]!==D||e[28]!==E?($=t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:S,className:"shrink-0",children:[E,D]}),e[25]=C,e[26]=S,e[27]=D,e[28]=E,e[29]=$):$=e[29];let I;return e[30]!==$||e[31]!==_?(I=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[_,$]}),e[30]=$,e[31]=_,e[32]=I):I=e[32],I}function rr(a){return a.status==="rejected"}function or(a){const e=q.c(62),{control:s,form:n}=a,i=Z(),l="metadata.runtime.env";let r;e[0]!==s?(r={control:s,name:l},e[0]=s,e[1]=r):r=e[1];const o=jn(r),{fields:p,append:c,remove:f}=o;let m;e[2]!==n?(m=(W,G)=>{n.setValue(`${l}.${W}`,G,{shouldDirty:!0,shouldTouch:!0})},e[2]=n,e[3]=m):m=e[3];const u=m,h=xa();let d;if(e[4]!==h){d=new Map;for(const W of h)d.set(W.id,W);e[4]=h,e[5]=d}else d=e[5];const[x,g]=H.useState(null);let v;e[6]!==c?(v=()=>{c({key:"",kind:"literal",value:""})},e[6]=c,e[7]=v):v=e[7];const y=v;let j;e[8]!==c||e[9]!==n||e[10]!==i?(j=async()=>{let W;try{W=await navigator.clipboard.readText()}catch{oe.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!W.trim()){oe.error(i("sandbox.envVarsField.clipboardEmpty"));return}let G;try{G=ir(W)}catch(B){const P=B;oe.error(P.message);return}const F=Object.entries(G);if(F.length===0){oe.error(i("sandbox.envVarsField.nothingToAdd"));return}const Y=n.getValues(l)??[],X=new Set;for(const B of Y){const P=(B.key??"").trim();P&&X.add(P)}let T=0,z=0;for(const[B,P]of F){if(X.has(B)){z++;continue}c({key:B,kind:"literal",value:P}),X.add(B),T++}T===0&&z>0?oe.message(i("sandbox.envVarsField.allKeysExist",{count:z})):oe.success(z>0?i("sandbox.envVarsField.addedWithSkipped",{added:T,skipped:z}):i("sandbox.envVarsField.added",{added:T}))},e[8]=c,e[9]=n,e[10]=i,e[11]=j):j=e[11];const b=j;let w;if(e[12]!==s||e[13]!==p||e[14]!==n||e[15]!==f||e[16]!==d||e[17]!==h||e[18]!==u){let W;e[20]!==s||e[21]!==n||e[22]!==f||e[23]!==d||e[24]!==h||e[25]!==u?(W=(G,F)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(cr,{index:F,control:s,form:n,onUpdateEntry:u,fieldPath:l,secrets:h,secretById:d,onSaveAsSecret:(Y,X)=>g({kind:"save-literal",index:F,presetKey:Y,presetValue:X}),onCreateNewSecret:Y=>g({kind:"create-new",index:F,presetKey:Y}),onRemove:()=>f(F)})},G.id),e[20]=s,e[21]=n,e[22]=f,e[23]=d,e[24]=h,e[25]=u,e[26]=W):W=e[26],w=p.map(W),e[12]=s,e[13]=p,e[14]=n,e[15]=f,e[16]=d,e[17]=h,e[18]=u,e[19]=w}else w=e[19];let S;e[27]!==w?(S=t.jsx("ul",{className:"space-y-2",children:w}),e[27]=w,e[28]=S):S=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Pe,{className:"size-3.5"}),e[29]=M):M=e[29];let N;e[30]!==i?(N=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=N):N=e[31];let C;e[32]!==y||e[33]!==N?(C=t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[M,N]}),e[32]=y,e[33]=N,e[34]=C):C=e[34];let k;e[35]!==i?(k=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=k):k=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(gi,{className:"size-3.5"}),e[37]=V):V=e[37];let _;e[38]!==i?(_=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=_):_=e[39];let E;e[40]!==b||e[41]!==k||e[42]!==_?(E=t.jsx(Ce,{asChild:!0,children:t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:b,"aria-label":k,children:[V,_]})}),e[40]=b,e[41]=k,e[42]=_,e[43]=E):E=e[43];let D;e[44]!==i?(D=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=D):D=e[45];let $;e[46]!==D?($=t.jsx(ke,{children:D}),e[46]=D,e[47]=$):$=e[47];let I;e[48]!==E||e[49]!==$?(I=t.jsxs(Ne,{children:[E,$]}),e[48]=E,e[49]=$,e[50]=I):I=e[50];let L;e[51]!==I||e[52]!==C?(L=t.jsxs("div",{className:"flex items-center gap-2",children:[C,I]}),e[51]=I,e[52]=C,e[53]=L):L=e[53];let U;e[54]!==x||e[55]!==n||e[56]!==u?(U=x!==null?t.jsx(ur,{mode:x,onClose:()=>g(null),onSaved:W=>{const G=n.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:G,kind:"secret",secretId:W}),g(null)}}):null,e[54]=x,e[55]=n,e[56]=u,e[57]=U):U=e[57];let K;return e[58]!==L||e[59]!==U||e[60]!==S?(K=t.jsxs("div",{className:"space-y-2",children:[S,L,U]}),e[58]=L,e[59]=U,e[60]=S,e[61]=K):K=e[61],K}function cr(a){const e=q.c(77),{index:s,control:n,form:i,onUpdateEntry:l,fieldPath:r,secrets:o,secretById:p,onSaveAsSecret:c,onCreateNewSecret:f,onRemove:m}=a,u=Z(),h=`${r}.${s}.key`,d=`${r}.${s}.value`,x=`${r}.${s}.secretId`,g=`${r}.${s}.kind`;let v;e[0]!==n||e[1]!==g?(v={control:n,name:g},e[0]=n,e[1]=g,e[2]=v):v=e[2];const j=_s(v)==="secret"?"secret":"literal";let b;e[3]!==i||e[4]!==s||e[5]!==h||e[6]!==c||e[7]!==l||e[8]!==d?(b=P=>{const O=i.getValues(h)?.trim()??"";if(P==="literal"){l(s,{key:O,kind:"literal",value:""});return}const ee=i.getValues(d)??"";if(ee.length>0){c(O,ee);return}l(s,{key:O,kind:"secret",secretId:""})},e[3]=i,e[4]=s,e[5]=h,e[6]=c,e[7]=l,e[8]=d,e[9]=b):b=e[9];const w=b;let S;e[10]!==s||e[11]!==u?(S=P=>{const{field:O}=P,ee=(O.value??"").trim(),ae=ee.length>0&&!gt.test(ee);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Me,{...O,value:O.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:ve("font-mono",ae&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":ae,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:s+1}),onBlur:ce=>{const le=ce.target.value.trim();O.onChange(le),O.onBlur()}}),ae?t.jsx("p",{className:"text-2xs text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=s,e[11]=u,e[12]=S):S=e[12];let M;e[13]!==n||e[14]!==h||e[15]!==S?(M=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{control:n,name:h,render:S})}),e[13]=n,e[14]=h,e[15]=S,e[16]=M):M=e[16];let N;e[17]!==w?(N=P=>w(P),e[17]=w,e[18]=N):N=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Oe,{className:"h-9 w-[110px]",children:t.jsx(Ie,{})}),e[19]=C):C=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx($t,{className:"size-3.5"}),e[20]=k):k=e[20];let V;e[21]!==u?(V=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=V):V=e[22];let _;e[23]!==V?(_=t.jsx(we,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[k,V]})}),e[23]=V,e[24]=_):_=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(wn,{className:"size-3.5"}),e[25]=E):E=e[25];let D;e[26]!==u?(D=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=D):D=e[27];let $;e[28]!==D?($=t.jsx(we,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E,D]})}),e[28]=D,e[29]=$):$=e[29];let I;e[30]!==$||e[31]!==_?(I=t.jsxs(Ae,{children:[_,$]}),e[30]=$,e[31]=_,e[32]=I):I=e[32];let L;e[33]!==j||e[34]!==I||e[35]!==N?(L=t.jsx("div",{className:"shrink-0",children:t.jsxs($e,{value:j,onValueChange:N,children:[C,I]})}),e[33]=j,e[34]=I,e[35]=N,e[36]=L):L=e[36];let U;e[37]!==n||e[38]!==i||e[39]!==s||e[40]!==h||e[41]!==j||e[42]!==f||e[43]!==p||e[44]!==x||e[45]!==o||e[46]!==u||e[47]!==d?(U=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(be,{control:n,name:d,render:P=>{const{field:O}=P;return t.jsx(Me,{...O,value:O.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:s+1}),onBlur:ee=>{O.onChange(ee.target.value),O.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(be,{control:n,name:x,render:P=>{const{field:O}=P;return t.jsxs($e,{value:O.value||"",onValueChange:ee=>O.onChange(ee),children:[t.jsx(Oe,{className:ve("h-9 w-full",!O.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:s+1}),children:t.jsx(Ie,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(fa,{field:O,secretById:p})})}),t.jsx(Ae,{children:o.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):o.map(dr)})]})}}),t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const P=i.getValues(h)?.trim()??"";f(P)},children:t.jsx(Pe,{className:"size-3.5"})})}),t.jsx(ke,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=n,e[38]=i,e[39]=s,e[40]=h,e[41]=j,e[42]=f,e[43]=p,e[44]=x,e[45]=o,e[46]=u,e[47]=d,e[48]=U):U=e[48];let K;e[49]!==i||e[50]!==h||e[51]!==j||e[52]!==c||e[53]!==u||e[54]!==d?(K=j==="literal"?t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const P=i.getValues(h)?.trim()??"",O=i.getValues(d)??"";c(P,O)},children:t.jsx(vi,{className:"size-3.5"})})}),t.jsx(ke,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=h,e[51]=j,e[52]=c,e[53]=u,e[54]=d,e[55]=K):K=e[55];let W;e[56]!==u?(W=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=W):W=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(It,{className:"size-3.5"}),e[58]=G):G=e[58];let F;e[59]!==m||e[60]!==W?(F=t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":W,onClick:m,children:G})}),e[59]=m,e[60]=W,e[61]=F):F=e[61];let Y;e[62]!==u?(Y=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=Y):Y=e[63];let X;e[64]!==Y?(X=t.jsx(ke,{children:Y}),e[64]=Y,e[65]=X):X=e[65];let T;e[66]!==F||e[67]!==X?(T=t.jsxs(Ne,{children:[F,X]}),e[66]=F,e[67]=X,e[68]=T):T=e[68];let z;e[69]!==K||e[70]!==T?(z=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,T]}),e[69]=K,e[70]=T,e[71]=z):z=e[71];let B;return e[72]!==L||e[73]!==U||e[74]!==z||e[75]!==M?(B=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[M,L,U,z]}),e[72]=L,e[73]=U,e[74]=z,e[75]=M,e[76]=B):B=e[76],B}function dr(a){return t.jsx(we,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(ha,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function ur({mode:a,onClose:e,onSaved:s}){const n=Z(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[r,o]=H.useState(()=>mr(l)),[p,c]=H.useState("organization"),[f,m]=H.useState(i),[u,h]=H.useState(""),d=ga(),x=r.trim(),g=f.length>0&&x.length>0&&pa.test(x),v=async b=>{if(b.preventDefault(),!!g)try{const w=await d.mutateAsync({scope:p,name:x,value:f,description:u.trim()||void 0});oe.success(n("sandbox.envVarsField.secretSaved",{name:w.name})),s(w.id)}catch(w){oe.error(w instanceof Error?w.message:n("sandbox.envVarsField.failedToSaveSecret"))}},y=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretTitle"):n("sandbox.envVarsField.createNewSecretTitle"),j=a.kind==="save-literal"?n("sandbox.envVarsField.saveValueAsSecretDescription"):n("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Xe,{open:!0,onOpenChange:b=>{b||e()},children:t.jsxs(Je,{className:"sm:max-w-md",children:[t.jsxs(at,{children:[t.jsx(lt,{children:y}),t.jsx(Ms,{children:j})]}),t.jsxs("form",{onSubmit:v,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-scope",children:n("sandbox.envVarsField.scopeLabel")}),t.jsxs($e,{value:p,onValueChange:b=>c(b),children:[t.jsx(Oe,{id:"save-secret-scope",children:t.jsx(Ie,{})}),t.jsxs(Ae,{children:[t.jsx(we,{value:"organization",children:n("sandbox.envVarsField.scopeOrganization")}),t.jsx(we,{value:"user",children:n("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-name",children:n("sandbox.envVarsField.nameLabel")}),t.jsx(Me,{id:"save-secret-name",value:r,onChange:b=>o(b.target.value),placeholder:n("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-value",children:n("sandbox.envVarsField.valueLabel")}),t.jsx(Me,{id:"save-secret-value",type:"password",value:f,onChange:b=>m(b.target.value),placeholder:n("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-description",children:n("sandbox.envVarsField.descriptionLabel")}),t.jsx(ut,{id:"save-secret-description",value:u,onChange:b=>h(b.target.value),rows:2,placeholder:n("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Vt,{children:[t.jsx(se,{type:"button",variant:"outline",onClick:e,disabled:d.isPending,children:n("sandbox.envVarsField.cancel")}),t.jsx(se,{type:"submit",disabled:!g||d.isPending,children:d.isPending?n("sandbox.envVarsField.saving"):n("sandbox.envVarsField.saveSecret")})]})]})]})})}function xs(a){if(!Array.isArray(a))return[];const e=[];for(const s of a){if(!s||typeof s!="object")continue;const n=s,i=(n.key??"").trim();if(!(!i||!gt.test(i))){if(n.kind==="literal"){e.push({key:i,kind:"literal",value:n.value??""});continue}n.kind==="secret"&&n.secretId&&e.push({key:i,kind:"secret",secretId:n.secretId})}}return e}function mr(a){const e=a.trim();return e&>.test(e)?e:""}function fr(a){const e=q.c(21),{repo:s,className:n}=a,i=Z();let l;e[0]!==n?(l=ve("space-y-2",n),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.repoRow.label"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==r?(o=t.jsx(ye,{children:r}),e[4]=r,e[5]=o):o=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(va,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=p):p=e[6];let c;e[7]!==s||e[8]!==i?(c=t.jsx(Ce,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[p,t.jsx("div",{className:"min-w-0 flex-1",children:s?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[s.owner,"/",s.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=s,e[8]=i,e[9]=c):c=e[9];let f;e[10]!==i?(f=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==f?(m=t.jsx(ke,{children:f}),e[12]=f,e[13]=m):m=e[13];let u;e[14]!==c||e[15]!==m?(u=t.jsxs(Ne,{children:[c,m]}),e[14]=c,e[15]=m,e[16]=u):u=e[16];let h;return e[17]!==l||e[18]!==o||e[19]!==u?(h=t.jsxs("div",{className:l,children:[o,u]}),e[17]=l,e[18]=o,e[19]=u,e[20]=h):h=e[20],h}const pr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function hr(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const s=Number(e);return s<1||s>65535?{ok:!1}:{ok:!0,value:String(s)}}const xr=Object.keys(pr),Nt="__none__";function gr(a){const e=q.c(47),{control:s}=a,n=Z(),i=H.useRef(null);let l;e[0]!==n?(l=n("sandbox.runtimeFields.packageManager"),e[0]=n,e[1]=l):l=e[1];let r;e[2]!==l?(r=t.jsx(ye,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=r):r=e[3];let o;e[4]!==n?(o=N=>{const{field:C}=N;return t.jsxs($e,{value:C.value??Nt,onValueChange:k=>C.onChange(k===Nt?null:k),children:[t.jsx(Oe,{id:"runtime-pm",children:t.jsx(Ie,{placeholder:n("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Ae,{children:[t.jsx(we,{value:Nt,children:n("sandbox.runtimeFields.autoDetect")}),xr.map(br)]})]})},e[4]=n,e[5]=o):o=e[5];let p;e[6]!==s||e[7]!==o?(p=t.jsx(be,{control:s,name:"metadata.runtime.selected",render:o}),e[6]=s,e[7]=o,e[8]=p):p=e[8];let c;e[9]!==r||e[10]!==p?(c=t.jsxs("div",{className:"space-y-2",children:[r,p]}),e[9]=r,e[10]=p,e[11]=c):c=e[11];let f;e[12]!==n?(f=n("sandbox.runtimeFields.packagePath"),e[12]=n,e[13]=f):f=e[13];let m;e[14]!==f?(m=t.jsx(ye,{htmlFor:"runtime-path",children:f}),e[14]=f,e[15]=m):m=e[15];let u;e[16]!==s?(u=t.jsx(be,{control:s,name:"metadata.runtime.path",render:vr}),e[16]=s,e[17]=u):u=e[17];let h;e[18]!==n?(h=n("sandbox.runtimeFields.packagePathDescription"),e[18]=n,e[19]=h):h=e[19];let d;e[20]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[20]=h,e[21]=d):d=e[21];let x;e[22]!==d||e[23]!==m||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[m,u,d]}),e[22]=d,e[23]=m,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==n?(g=n("sandbox.runtimeFields.devServerPort"),e[26]=n,e[27]=g):g=e[27];let v;e[28]!==g?(v=t.jsx(ye,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=v):v=e[29];let y;e[30]!==n?(y=N=>{const{field:C}=N;return t.jsx(Me,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:n("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:k=>{const V=hr(k.target.value);V.ok?C.onChange(V.value):i.current&&(i.current.value=C.value??"")}})},e[30]=n,e[31]=y):y=e[31];let j;e[32]!==s||e[33]!==y?(j=t.jsx(be,{control:s,name:"metadata.runtime.port",render:y}),e[32]=s,e[33]=y,e[34]=j):j=e[34];let b;e[35]!==n?(b=n("sandbox.runtimeFields.devServerPortDescription"),e[35]=n,e[36]=b):b=e[36];let w;e[37]!==b?(w=t.jsx("p",{className:"text-xs text-muted-foreground",children:b}),e[37]=b,e[38]=w):w=e[38];let S;e[39]!==v||e[40]!==j||e[41]!==w?(S=t.jsxs("div",{className:"space-y-2",children:[v,j,w]}),e[39]=v,e[40]=j,e[41]=w,e[42]=S):S=e[42];let M;return e[43]!==x||e[44]!==S||e[45]!==c?(M=t.jsxs("div",{className:"space-y-5",children:[c,x,S]}),e[43]=x,e[44]=S,e[45]=c,e[46]=M):M=e[46],M}function vr(a){const{field:e}=a;return t.jsx(Me,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:s=>{const n=s.target.value.trim();e.onChange(n===""?null:n)}})}function br(a){return t.jsx(we,{value:a,children:a},a)}function jr(a){const e=q.c(5),{control:s}=a,n=Z();let i;e[0]!==n?(i=r=>{const{field:o}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:n("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(ht,{id:"field-description-tooltips",className:"shrink-0",checked:o.value??!1,onCheckedChange:p=>o.onChange(p)})]})},e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==i?(l=t.jsx(be,{control:s,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function yr(a){const e=q.c(32),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"smart",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"code-review",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==i?(m=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=m):m=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let h;e[18]!==m||e[19]!==u?(h={value:"open",label:m,description:u},e[18]=m,e[19]=u,e[20]=h):h=e[20];let d;e[21]!==o||e[22]!==f||e[23]!==h?(d=[o,f,h],e[21]=o,e[22]=f,e[23]=h,e[24]=d):d=e[24];const x=d;let g;e[25]!==n||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,b=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs($e,{value:b,onValueChange:w=>{j.onChange(w),n()},children:[t.jsx(Oe,{id:"publish-policy",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:x.map(wr)})]})]})},e[25]=n,e[26]=x,e[27]=i,e[28]=g):g=e[28];let v;return e[29]!==s||e[30]!==g?(v=t.jsx(be,{name:"metadata.publishPolicy",control:s,render:g}),e[29]=s,e[30]=g,e[31]=v):v=e[31],v}function wr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function Sr(a){const e=q.c(24),{control:s,onCommit:n}=a,i=Z();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let r;e[2]!==i?(r=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=r):r=e[3];let o;e[4]!==l||e[5]!==r?(o={value:"off",label:l,description:r},e[4]=l,e[5]=r,e[6]=o):o=e[6];let p;e[7]!==i?(p=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=p):p=e[8];let c;e[9]!==i?(c=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=c):c=e[10];let f;e[11]!==p||e[12]!==c?(f={value:"on",label:p,description:c},e[11]=p,e[12]=c,e[13]=f):f=e[13];let m;e[14]!==o||e[15]!==f?(m=[o,f],e[14]=o,e[15]=f,e[16]=m):m=e[16];const u=m;let h;e[17]!==n||e[18]!==u||e[19]!==i?(h=x=>{const{field:g}=x,v=g.value??null,y=Ks(v);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ye,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs($e,{value:y,onValueChange:j=>{const b=la.safeParse(j);b.success&&(g.onChange(ra(v,b.data)),n())},children:[t.jsx(Oe,{id:"content-editing-mode",className:"w-44 shrink-0",children:t.jsx(Ie,{})}),t.jsx(Ae,{className:"max-w-80",children:u.map(Nr)})]})]})},e[17]=n,e[18]=u,e[19]=i,e[20]=h):h=e[20];let d;return e[21]!==s||e[22]!==h?(d=t.jsx(be,{name:"metadata.ui.layout",control:s,render:h}),e[21]=s,e[22]=h,e[23]=d):d=e[23],d}function Nr(a){return t.jsx(we,{value:a.value,description:a.description,children:a.label},a.value)}function gs(a){const e=a.metadata?.sidebarViews,s=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Mt(_t(a.metadata),s)],rawViews:e===null?null:e?[...e]:void 0,version:s,seen:a.metadata?.sidebarViewsSeen??void 0}}function vs(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((s,n)=>s===e[n])}function Cr(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function kr(a,e){switch(e.type){case"accumulate":{const s=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},n=new Set(s.fields);for(const i of e.fields)n.add(i);return{...s,fields:n,saveCount:s.saveCount+1,instructionsLength:e.instructionsLength??s.instructionsLength}}case"reset":return null}}function Mr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const s=e.filter(n=>{if(!n||typeof n!="object")return!1;const i=(n.key??"").trim();return!i||!gt.test(i)?!1:n.kind==="literal"?!0:n.kind==="secret"?!!n.secretId:!1});return s.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:s}}}}async function _r(a,e){const s=a?.idToken??null;if(s){const i=bs(s);if(i)return i}const n=a?.userinfoEndpoint??null;if(n)try{const i=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),r=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(r)return r}}catch{}return bs(e)}function bs(a){try{const e=a.split(".");if(e.length===3&&e[1]){const s=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof s.email=="string")return s.email;if(typeof s.upn=="string")return s.upn;if(typeof s.preferred_username=="string")return s.preferred_username}}catch{}return null}function Vr({virtualMcp:a,contextSection:e}){const s=Z(),n=$n(),{org:i}=Fe(),l=Hn(),{data:r}=Qn([a.id]),o=r?.get(a.id)?.last_used_at,p=Vs(),c=ks(),f=Tt(),m=Bs(a.id),u=JSON.stringify([i.id,a.id]),h=qi(a.metadata,m.snapshot()),d=Sn({resolver:Nn(Gl),defaultValues:{...a,metadata:{...ns(a.metadata),previewServerUrl:ia(a.metadata),...h}}}),x=d.watch("connections"),g=$i(a),v=Ys(a?.metadata),y=v&&Ks(d.watch("metadata.ui.layout"))==="off",j=Ds(a),b=j?{owner:j.owner,name:j.name,url:j.url}:null,[w,S]=H.useReducer(Cr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[M,N]=H.useState(!1),[C,k]=H.useState(!1),{openSidePanel:V}=On(),{sendMessage:_}=Vn(),E=async()=>{if(C)return;const R=d.getValues("metadata.instructions");if(R?.trim()){k(!0);try{U(),Ve("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:R.length}),V();const te=Mn(i.id);await _({tiptapDoc:Dn({managerAgentId:te.id,managerName:te.title,kind:"agent",id:a.id,instructions:R})})}finally{k(!1)}}},[D,$]=H.useReducer(kr,null),I=()=>{D!==null&&(Ve("agent_updated",{agent_id:a.id,fields:Array.from(D.fields),instructions_length:D.instructionsLength,save_count:D.saveCount,edit_duration_ms:Date.now()-D.start}),$({type:"reset"}))},{schedule:L,flush:U}=Jt({delayMs:3e4,save:async()=>I()}),K=async()=>{const R=m.snapshot(),te={predicate:Se=>ss(Se.queryKey,i.id)},J=async()=>(await c.invalidateQueries({predicate:Se=>ss(Se.queryKey,i.id),refetchType:"all"}),ts(c,i.id,a.id)),pe=(Se,Ge)=>{if(Se){vs(d.getValues("metadata.sidebarViews"),Se.rawViews)||d.setValue("metadata.sidebarViews",Se.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Se.version&&d.setValue("metadata.sidebarViewsVersion",Se.version,{shouldDirty:!1}),vs(d.getValues("metadata.sidebarViewsSeen"),Se.seen)||d.setValue("metadata.sidebarViewsSeen",Se.seen,{shouldDirty:!1});return}Ge!==null&&(d.setValue("metadata.sidebarViews",[...Ge],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Ki,{shouldDirty:!1}))},_e=Hi(R),Te=Object.keys(d.control._formState.dirtyFields);if(Te.length===0&&!_e){await m.settle({snapshot:R,saved:!0,authoritativeViews:R?.persistedViews});return}const We=Te.length>0?Te:["metadata"],ot=We.includes("metadata"),Ke=d.getValues();d.reset(Ke,{keepValues:!0});const et=Mr(Ke),ln=ts(c,i.id,a.id),rn=Qi({sidebarViews:et.metadata?.sidebarViews,sidebarViewsVersion:et.metadata?.sidebarViewsVersion},R,ln?.metadata);et.metadata={...ns(et.metadata),...rn};let bt;try{bt=await l.update.mutateAsync({id:a.id,data:et})}catch(Se){let Ge=null;try{Ge=await J()}catch{}const Rt=Ge?gs(Ge):null,Lt=await m.settle({snapshot:R,saved:!1,authoritativeViews:Rt?.effectiveViews});throw Lt.settledLatest&&pe(Rt,Lt.reconciledViews),Se}await c.cancelQueries(te),Xi(c,i.id,bt);const Et=gs(bt),zt=await m.settle({snapshot:R,saved:!0,authoritativeViews:Et.effectiveViews});zt.settledLatest&&pe(Et,zt.reconciledViews),$({type:"accumulate",now:Date.now(),fields:We,instructionsLength:ot?Ke.metadata?.instructions?.length??0:null}),L()},W=()=>ba(u,K),{schedule:G,flush:F}=Jt({save:W});H.useEffect(()=>{const R=d.watch(()=>G());return()=>R.unsubscribe()},[]);const Y=()=>{Ve("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},X=async R=>{const te=d.getValues("connections");if(te.some(_e=>_e.connection_id===R))return;d.setValue("connections",[...te,{connection_id:R,selected_tools:St.tools,selected_resources:St.resources,selected_prompts:St.prompts}],{shouldDirty:!0}),S({type:"SET_ADD_DIALOG_OPEN",payload:!1});const J=new URL(`/api/${i.slug}/mcp/${R}`,window.location.origin),pe=await Gt({url:J.href,token:null,orgId:i.id});pe.supportsOAuth&&!pe.isAuthenticated&&await O(R)},T=R=>{const J=d.getValues("connections").filter(pe=>pe.connection_id!==R);d.setValue("connections",J,{shouldDirty:!0})},z=(R,te)=>{const J=d.getValues("connections");if(J.some(pe=>pe.connection_id===te)){oe.error(s("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",J.map(pe=>pe.connection_id===R?{...pe,connection_id:te}:pe),{shouldDirty:!0})},B=async R=>{if(d.getValues("connections").find(J=>J.connection_id===R))try{const{item:J}=await f.call("COLLECTION_CONNECTIONS_GET",{id:R});if(!J)return;const pe=J.title.replace(/\s*\(.*?\)\s*$/,""),_e=_n("conn"),Te=`${pe} (${Date.now().toString(36).slice(-4)})`;await p.create.mutateAsync({id:_e,title:Te,description:J.description??null,connection_type:J.connection_type,connection_url:J.connection_url??null,connection_token:null,icon:J.icon??null,app_name:J.app_name??null,app_id:J.app_id??null,connection_headers:J.connection_headers??null});const We=new URL(`/api/${i.slug}/mcp/${_e}`,window.location.origin),ot=await Gt({url:We.href,token:null,orgId:i.id});if(ot.supportsOAuth&&!ot.isAuthenticated){const Ke=await O(_e);if(!Ke){await p.delete.mutateAsync(_e);return}await p.update.mutateAsync({id:_e,data:{title:`${pe} (${Ke})`}})}z(R,_e),oe.success(s("virtualMcp.virtualMcp.newInstanceCreated"))}catch(J){console.error("Failed to create instance:",J),oe.error(s("virtualMcp.virtualMcp.failedToCreateInstance"))}},P=R=>{S({type:"OPEN_SETTINGS",payload:R})},O=async R=>{const{token:te,tokenInfo:J,error:pe}=await En({connectionId:R,orgSlug:i.slug,scope:"offline_access"});if(pe||!te)return oe.error(s("virtualMcp.virtualMcp.authenticationFailed",{error:pe??""})),null;if(J)try{const Te=await fetch(`/api/${i.slug}/connections/${R}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:J.accessToken,refreshToken:J.refreshToken,expiresIn:J.expiresIn,scope:J.scope,clientId:J.clientId,clientSecret:J.clientSecret,tokenEndpoint:J.tokenEndpoint})});if(!Te.ok)console.error("Failed to save OAuth token:",await Te.text()),await p.update.mutateAsync({id:R,data:{connection_token:te}});else try{await p.update.mutateAsync({id:R,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Te){console.error("Error saving OAuth token:",Te),await p.update.mutateAsync({id:R,data:{connection_token:te}})}else await p.update.mutateAsync({id:R,data:{connection_token:te}});const _e=new URL(`/api/${i.slug}/mcp/${R}`,window.location.origin);return await c.invalidateQueries({queryKey:Dt.isMCPAuthenticated(_e.href,null)}),oe.success(s("virtualMcp.virtualMcp.authenticationSuccessful")),_r(J,te)},ee=()=>{const R=d.getValues("metadata.instructions")??"",te=s("virtualMcp.virtualMcp.promptTemplateContent"),J=R.trim()?`${R}
|
|
3
|
+
|
|
4
|
+
${te}`:te;d.setValue("metadata.instructions",J,{shouldDirty:!0})},ae=new Set(x.map(R=>R.connection_id)),{section:ce}=El(),le=e!==null,ie=e==="instructions"?null:e??ce,Q=ie==="general",de=le?e==="instructions":Q,ue=Fi(a.id)==="v8",he=Al({virtualMcpId:a.id,form:d,flushAndSave:F}),me=Pt(),[xe,ge]=H.useState(!1),fe=async()=>{U();try{await l.delete.mutateAsync(a.id),Ve("agent_deleted",{agent_id:a.id,source:"agent_detail"}),oe.success(s("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),me({to:"/$org",params:{org:i.slug}})}catch{}},A=t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{Ve("agent_connect_modal_opened",{agent_id:a.id}),S({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Cn,{size:14}),s("virtualMcp.virtualMcp.connect")]}),ne=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(se,{variant:"outline",size:"sm",onClick:ee,children:s("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(se,{variant:"outline",size:"sm",disabled:C||!d.watch("metadata.instructions")?.trim(),onClick:E,children:[t.jsx(dt,{size:13}),s("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Ue,{children:[t.jsxs(t.Fragment,{children:[!le&&t.jsxs(t.Fragment,{children:[t.jsx(Ue.Title,{children:s("virtualMcp.settings.title")}),t.jsx(Fl,{section:ie??"general"})]}),t.jsx(Ue.Actions,{secondary:ie==="connections"?A:void 0,children:ie==="connections"?t.jsxs(se,{size:"sm",onClick:Y,children:[t.jsx(Pe,{size:14}),s("virtualMcp.virtualMcp.addConnection")]}):A}),t.jsx(Ue.Content,{children:t.jsx(Ue.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(kn,{children:[Q&&t.jsx(Pl,{views:he}),Q&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx($l,{form:d,onCommit:F}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(Tn,{id:a.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[s("virtualMcp.virtualMcp.created")," ",Ba(new Date(a.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:o?s("virtualMcp.virtualMcp.lastUsed",{time:Fn(new Date(o),{addSuffix:!0,locale:n})}):s("virtualMcp.virtualMcp.neverUsed")})]})]}),ie==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:x.length===0?t.jsxs("button",{type:"button",onClick:Y,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Pe,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:s("virtualMcp.virtualMcp.noConnectionsYet")})]}):x.map(R=>t.jsx(Ye,{fallback:()=>null,children:t.jsx(H.Suspense,{fallback:t.jsx(en,{}),children:t.jsx(jl,{connection_id:R.connection_id,usedConnectionIds:ae,onOpenSettings:()=>P(R.connection_id),onRemove:()=>T(R.connection_id),onAuthenticate:O,onSwitchInstance:z,onNewInstance:()=>B(R.connection_id)})})},R.connection_id))})}),de&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.instructions")}),ne]}),t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:R})=>t.jsxs("div",{className:"relative rounded-xl shadow-edge bg-card focus-within-ring",children:[t.jsx(ut,{...R,value:R.value??"",onChange:te=>{R.onChange(te)},onBlur:()=>{R.onBlur(),F()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(Ne,{delayDuration:0,children:[t.jsx(Ce,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2 text-muted-foreground",onClick:()=>N(!0),"aria-label":s("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(bi,{size:14})})}),t.jsx(ke,{side:"left",children:s("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),de&&t.jsx(Ka,{form:d}),Q&&t.jsx(Ye,{fallback:()=>null,children:t.jsx(H.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(tl,{form:d,currentAgentId:a.id})})}),ie==="site"&&v&&t.jsx(Be,{title:s("sandbox.cmsSettings.title"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(Sr,{control:d.control,onCommit:F})}),!y&&t.jsx(je,{children:t.jsx(jr,{control:d.control})}),!y&&g&&t.jsx(je,{children:t.jsx(yr,{control:d.control,onCommit:F})})]})}),ie==="site"&&!y&&t.jsx(Be,{title:s("sandbox.cmsSettings.preview.title"),description:s("sandbox.cmsSettings.preview.description"),children:t.jsx(ze,{children:t.jsx(Kl,{control:d.control,isBlocksV8:ue,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),ie==="site"&&ue&&g&&t.jsx(Ll,{orgSlug:i.slug,virtualMcpId:a.id}),ie==="site"&&t.jsx(Be,{title:s("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(ze,{children:[t.jsx(je,{children:t.jsx(fr,{repo:b})}),t.jsx(je,{children:t.jsx(gr,{control:d.control})}),t.jsx(je,{children:t.jsx(ar,{control:d.control,form:d,virtualMcpId:a.id,orgSlug:i.slug,sandboxMap:a.metadata.sandboxMap})})]})}),Q&&t.jsx(Be,{title:s("virtualMcp.settings.groups.advanced"),children:t.jsx(ze,{children:t.jsx(tt,{title:s("virtualMcp.virtualMcp.deleteAgent"),description:s("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(se,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ge(!0),children:[t.jsx(It,{size:14}),s("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},e??ie)]}),t.jsx(zn,{open:xe,onOpenChange:ge,children:t.jsxs(Rn,{children:[t.jsxs(Ln,{children:[t.jsx(Un,{children:s("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Yn,{children:s("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Bn,{children:[t.jsx(Wn,{children:s("virtualMcp.virtualMcp.cancel")}),t.jsx(Kn,{onClick:fe,variant:"destructive",children:s("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(yi,{open:w.addDialogOpen,onOpenChange:R=>S({type:"SET_ADD_DIALOG_OPEN",payload:R}),agentId:a.id,addedConnectionIds:ae,onAdd:X}),t.jsx(bl,{open:w.settingsDialogOpen,onOpenChange:R=>{R||S({type:"CLOSE_SETTINGS"})},selectedId:w.settingsConnectionId,form:d,connections:x,onAuthenticate:O}),t.jsx(sr,{open:w.shareDialogOpen,onOpenChange:R=>S({type:"SET_SHARE_DIALOG_OPEN",payload:R}),virtualMcp:a}),t.jsx(Xe,{open:M,onOpenChange:N,children:t.jsxs(Je,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(at,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(lt,{children:s("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(be,{name:"metadata.instructions",control:d.control,render:({field:R})=>t.jsx(ut,{...R,value:R.value??"",onChange:te=>{R.onChange(te)},onBlur:()=>{R.onBlur(),F()},placeholder:s("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl shadow-edge px-4 py-3 focus-ring bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function Yo(a){const e=q.c(22),{virtualMcpId:s,contextSection:n}=a,i=n===void 0?null:n,l=Z(),r=Pt(),{org:o}=Fe(),p=Ts(s);if(!p){let u;e[0]!==l?(u=l("virtualMcp.virtualMcp.spaceNotFound"),e[0]=l,e[1]=u):u=e[1];let h;e[2]!==l?(h=l("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=l,e[3]=h):h=e[3];let d;e[4]!==r||e[5]!==o.slug?(d=()=>r({to:"/$org",params:{org:o.slug}}),e[4]=r,e[5]=o.slug,e[6]=d):d=e[6];let x;e[7]!==l?(x=l("virtualMcp.virtualMcp.backToSpaces"),e[7]=l,e[8]=x):x=e[8];let g;e[9]!==d||e[10]!==x?(g=t.jsx(se,{variant:"outline",onClick:d,children:x}),e[9]=d,e[10]=x,e[11]=g):g=e[11];let v;return e[12]!==u||e[13]!==h||e[14]!==g?(v=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pn,{title:u,description:h,actions:g})}),e[12]=u,e[13]=h,e[14]=g,e[15]=v):v=e[15],v}let c;e[16]!==p?(c=Ds(p)?.connectionId??"",e[16]=p,e[17]=c):c=e[17];const f=`${p.id}:${c}`;let m;return e[18]!==i||e[19]!==f||e[20]!==p?(m=t.jsx(Vr,{virtualMcp:p,contextSection:i},f),e[18]=i,e[19]=f,e[20]=p,e[21]=m):m=e[21],m}export{Yo as V};
|