decocms 3.88.0 → 3.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DNYt-tuz.js → AlertCircle-BMCh3ayd.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DSMDHVEn.js → ArrowUpRight-CwVMUp5O.js} +1 -1
- package/dist/client/assets/{CheckCircle-C8562NdW.js → CheckCircle-BP2lb3AX.js} +1 -1
- package/dist/client/assets/{ChevronDown-Dm48Q67d.js → ChevronDown-CkcGr2qp.js} +1 -1
- package/dist/client/assets/{ChevronLeft-D_nUsg63.js → ChevronLeft-Cgw9JZYG.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bcz6YJK7.js → ChevronRight-DYe9AFXl.js} +1 -1
- package/dist/client/assets/{ChevronUp-C3RfevsM.js → ChevronUp-CiXD4kQk.js} +1 -1
- package/dist/client/assets/{DotsVertical-B-l8_f25.js → DotsVertical-Z_h1bSB3.js} +1 -1
- package/dist/client/assets/{Eye-BHnPPFUp.js → Eye-B92Ff4dY.js} +1 -1
- package/dist/client/assets/{FilterLines-DHUDHU2P.js → FilterLines-CMHeCbJ1.js} +1 -1
- package/dist/client/assets/{Form-CWWkyjn1.js → Form-GDlYmtQN.js} +1 -1
- package/dist/client/assets/{Globe01-BLiMWc9n.js → Globe01-MZlo2_34.js} +1 -1
- package/dist/client/assets/{Globe04-BqlPpl4_.js → Globe04-BPWbnzx0.js} +1 -1
- package/dist/client/assets/{HardDrive-CfQf_e9R.js → HardDrive-D8FSpDtM.js} +1 -1
- package/dist/client/assets/{Key01-Bfv34Mef.js → Key01-CZVV-ceU.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CcPo7JXp.js → LayoutLeft-CuTI_WR9.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B5xZwDru.js → LinkExternal01-DekFjc9P.js} +1 -1
- package/dist/client/assets/{Monitor01-DMrTtsPY.js → Monitor01-BxGhRsUq.js} +1 -1
- package/dist/client/assets/{Palette-DjBKeemm.js → Palette-BDlA8RUr.js} +1 -1
- package/dist/client/assets/{Play-CA15kbr2.js → Play-BGGUeSDd.js} +1 -1
- package/dist/client/assets/{Plus-ChDqk9yl.js → Plus-CQOl41pg.js} +1 -1
- package/dist/client/assets/{SearchMd-BJdNdDgV.js → SearchMd-Da504yGV.js} +1 -1
- package/dist/client/assets/{Settings02-CdJ-MF5L.js → Settings02-ozrzAwut.js} +1 -1
- package/dist/client/assets/{Shield01-_lgFokA3.js → Shield01-CYPtC_lA.js} +1 -1
- package/dist/client/assets/{Star01-BA0atS1H.js → Star01-BoZIiKCL.js} +1 -1
- package/dist/client/assets/{Stars01-DTmld-vb.js → Stars01-BJuGXG_N.js} +1 -1
- package/dist/client/assets/{Stars02-FgwFA-YB.js → Stars02-C4CXFnp9.js} +1 -1
- package/dist/client/assets/{Sun-h69r-joZ.js → Sun-2eUdoD8j.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BwxadfOg.js → SwitchHorizontal01-DXdcIz27.js} +1 -1
- package/dist/client/assets/{Tool01-CkNvrq09.js → Tool01-WsqNh4er.js} +1 -1
- package/dist/client/assets/{Trash01-D-__tdky.js → Trash01-z6De146C.js} +1 -1
- package/dist/client/assets/{Upload01-CwGIZeSB.js → Upload01-C4sYhZ0M.js} +1 -1
- package/dist/client/assets/{User01-EwoVEdCF.js → User01-Cvp121NC.js} +1 -1
- package/dist/client/assets/{Users01-DABshdQx.js → Users01-DcrlsWI1.js} +1 -1
- package/dist/client/assets/{Users03-Bf-frjqU.js → Users03-CJuVy8Iz.js} +1 -1
- package/dist/client/assets/{X-2CmMZPJ4.js → X-DgKWdqZ1.js} +1 -1
- package/dist/client/assets/{XCircle-rh0u-AOu.js → XCircle-DFBcUexW.js} +1 -1
- package/dist/client/assets/{XClose-CmkOZlDy.js → XClose-BKWXOZkj.js} +1 -1
- package/dist/client/assets/{Zap-BUXcLelz.js → Zap-Cxu6aoRs.js} +1 -1
- package/dist/client/assets/{ZapSquare-DvXQPG5z.js → ZapSquare-DOK7F1oe.js} +1 -1
- package/dist/client/assets/{ZoomOut-vPlJRu24.js → ZoomOut-ryBmf3S4.js} +1 -1
- package/dist/client/assets/{access-gate-oydbZeWg.js → access-gate-DvuwS2Bs.js} +1 -1
- package/dist/client/assets/{add-section-modal-CKStw-nX.js → add-section-modal-CEyStjwy.js} +1 -1
- package/dist/client/assets/{agent-icon-ChMYpg8v.js → agent-icon-pz8iT5cD.js} +1 -1
- package/dist/client/assets/{agents-list-BcCxoU_W.js → agents-list-C2TIIavL.js} +1 -1
- package/dist/client/assets/{ai-providers-BVDwRzcD.js → ai-providers-bb2flxno.js} +1 -1
- package/dist/client/assets/{alert-gczeMK6l.js → alert-BwNlkWBE.js} +1 -1
- package/dist/client/assets/{alert-dialog-DmzJu6RK.js → alert-dialog-CkCCiKt9.js} +1 -1
- package/dist/client/assets/{app-editor-CU9wcvQa.js → app-editor-mcTFLJlr.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dyib7I_w.js → auth-catchall-HTDRVC4_.js} +1 -1
- package/dist/client/assets/{auth-entry-BnLIuZbb.js → auth-entry-BNYZmdvo.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CkutljYl.js → auth-split-layout-DuCP9Fwl.js} +1 -1
- package/dist/client/assets/{auth-DJGEOj5x.js → auth-xlfJjVrK.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Dbbh-UIs.js → authenticate-and-persist-oauth-DPn6Vk96.js} +1 -1
- package/dist/client/assets/{automation-list-row-KKcJMeur.js → automation-list-row-CCZ8TAPg.js} +1 -1
- package/dist/client/assets/{automation-runs-BE3kByui.js → automation-runs-DBQv8Uvp.js} +1 -1
- package/dist/client/assets/{automations-0ExQk5so.js → automations-D1p0mjNs.js} +1 -1
- package/dist/client/assets/{avatar-Du-DTV8_.js → avatar-Bh53txVX.js} +1 -1
- package/dist/client/assets/{badge-Dh6PBPA_.js → badge-CdirlPdy.js} +1 -1
- package/dist/client/assets/block-document-D978uGtK.js +3 -0
- package/dist/client/assets/{brand-context-B7Bi1TYU.js → brand-context-Ds48Bazs.js} +1 -1
- package/dist/client/assets/{buckets-CbcvbE0C.js → buckets-C6_Hhy5c.js} +1 -1
- package/dist/client/assets/{capability-load-error-Dtths9dl.js → capability-load-error-DgQyDsKl.js} +1 -1
- package/dist/client/assets/{card-Z_vYjGFd.js → card-D_tApM0k.js} +1 -1
- package/dist/client/assets/category-editor-DMZmSuPk.js +1 -0
- package/dist/client/assets/{chat-context-BmruM_HR.js → chat-context-Dz9rhizY.js} +1 -1
- package/dist/client/assets/{checkbox-DxBJiMKc.js → checkbox-OtNKSART.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DfYzVaHW.js → cli-auth-success-BsGnTz93.js} +1 -1
- package/dist/client/assets/{collection-detail-BtX-cexG.js → collection-detail-8pBdQXs6.js} +1 -1
- package/dist/client/assets/{collection-display-button-DP49N1ly.js → collection-display-button-BgYBCk8T.js} +1 -1
- package/dist/client/assets/{collection-search-KITCKwRM.js → collection-search-JfLpXbmD.js} +1 -1
- package/dist/client/assets/{collection-tabs-7NDRZOqZ.js → collection-tabs-B5YA_dM5.js} +1 -1
- package/dist/client/assets/{command-B9r0yzOz.js → command-iFNWkWs6.js} +1 -1
- package/dist/client/assets/commerce-onboarding-CjPSY7Rg.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-BZI5w4jj.js → connect-desktop-dialog-BxJ3X8re.js} +1 -1
- package/dist/client/assets/{connection-card-BWTU_gxr.js → connection-card--7NnoNLM.js} +1 -1
- package/dist/client/assets/{connection-detail-BFllrp28.js → connection-detail-Bak6_MXj.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bkrt5xdb.js → connection-form-helpers-BW7AB-E3.js} +1 -1
- package/dist/client/assets/{connections-CD6zIPjp.js → connections-MxbhAMWj.js} +1 -1
- package/dist/client/assets/{context-menu-6VjL_3YW.js → context-menu-3RQyDKF5.js} +1 -1
- package/dist/client/assets/{decopilot-DZIyl23_.js → decopilot-CiHv6XGE.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BD2dFw0V.js → decopilot-sse-pool-DXv2T192.js} +1 -1
- package/dist/client/assets/{dialog-CcOc1VSc.js → dialog-BFjL_my-.js} +1 -1
- package/dist/client/assets/{domain-settings-8Om5yhGd.js → domain-settings-CuN5wwNc.js} +1 -1
- package/dist/client/assets/{drawer-DrZ3Xxxs.js → drawer-DZMXZPMN.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B1q2g0Oz.js → dropdown-menu-B1DaP6vk.js} +1 -1
- package/dist/client/assets/{empty-state-CvhIsMco.js → empty-state-Lmcbk0Zv.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BTddB-Ri.js → extract-connection-data-Bau_aQvM.js} +1 -1
- package/dist/client/assets/{file-explorer-BSlwYdKd.js → file-explorer-CdToudqs.js} +1 -1
- package/dist/client/assets/{file-type-icon-CjYEqWvi.js → file-type-icon-CWgZWEkL.js} +1 -1
- package/dist/client/assets/{files-IcowDFPX.js → files-C6shWZY2.js} +1 -1
- package/dist/client/assets/{form-CP422MCG.js → form-B6Nf7hvD.js} +1 -1
- package/dist/client/assets/{general-B17RyZbx.js → general-BRjdlS0B.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BtLRZJCn.js → github-repo-picker-CThHTj5h.js} +1 -1
- package/dist/client/assets/{hooks-JWEXOaom.js → hooks-CFfc1t5D.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-C5WKXlF0.js → import-from-deco-dialog-DnC_H8Us.js} +1 -1
- package/dist/client/assets/{index-BHeRj0aR.js → index-BDyN-RAN.js} +1 -1
- package/dist/client/assets/{index-B03rGLWY.js → index-BK0DpA7w.js} +1 -1
- package/dist/client/assets/{index-qNsRF2gN.js → index-BVXtRunj.js} +2 -2
- package/dist/client/assets/{index-D-AnYLMJ.js → index-BtmyrH9L.js} +1 -1
- package/dist/client/assets/index-BzszuDGF.css +1 -0
- package/dist/client/assets/{index-DqekK67c.js → index-C0_iRWcE.js} +1 -1
- package/dist/client/assets/{index-Cj3SUI-I.js → index-C2QgbLxn.js} +27 -27
- package/dist/client/assets/{index-j0FOxC5a.js → index-C_XJPG8Z.js} +1 -1
- package/dist/client/assets/{index-DFEHtli4.js → index-CjtDPqlj.js} +1 -1
- package/dist/client/assets/{index-5eBuuZqw.js → index-CurNB2HG.js} +3 -3
- package/dist/client/assets/{index-DvYHbw_E.js → index-DqUFDG_W.js} +1 -1
- package/dist/client/assets/{index-DUeyKzM8.js → index-EwbYDv-_.js} +1 -1
- package/dist/client/assets/{index-CDh-TvPt.js → index-ZANilAX7.js} +1 -1
- package/dist/client/assets/{index-B8kcRAQ7.js → index-ovnDLwrg.js} +1 -1
- package/dist/client/assets/{index-CpP1Ipdr.js → index-qZ5-LmpP.js} +1 -1
- package/dist/client/assets/{index-redirect-Dw_-IAJ6.js → index-redirect-Cc9Y9Kn-.js} +1 -1
- package/dist/client/assets/{input-MT_IAhPD.js → input-RRjvrcUF.js} +1 -1
- package/dist/client/assets/{integration-icon-Bto4FvsU.js → integration-icon-Dpj2NSXY.js} +1 -1
- package/dist/client/assets/{label-D-zq5duZ.js → label-DrXdAtn0.js} +1 -1
- package/dist/client/assets/{login-DU2J9q8-.js → login-CdGM36BM.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DjU0RuuX.js → mcp-oauth-B5dnAc7V.js} +1 -1
- package/dist/client/assets/{members-DgnEpiKT.js → members-C-wG0rnC.js} +1 -1
- package/dist/client/assets/{monaco-editor-D74M_RXn.js → monaco-editor-zMbhl8rq.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CAesDssN.js → monitoring-stats-row-BnDnFbz0.js} +1 -1
- package/dist/client/assets/{oauth-callback-dT4I0mTM.js → oauth-callback-Dkf89E49.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-D3NXifPx.js → oauth-callback-ai-provider-BzTdkWaI.js} +1 -1
- package/dist/client/assets/{onboarding-DyT0ouLY.js → onboarding-CK9ke2oh.js} +1 -1
- package/dist/client/assets/{org-install-Wgs7eCbc.js → org-install-CyaR-8_i.js} +1 -1
- package/dist/client/assets/{org-layout-FTpAuckr.js → org-layout-BDwAg4pd.js} +1 -1
- package/dist/client/assets/{organization-choice-CXASJ_AN.js → organization-choice-BcGxKG4I.js} +1 -1
- package/dist/client/assets/{page-seo-form-wwwQIKRU.js → page-seo-form-CvCtyrxH.js} +1 -1
- package/dist/client/assets/page-seo-sheet-lBchETUb.js +1 -0
- package/dist/client/assets/{popover-CNJ18mIX.js → popover-D7BamlkK.js} +1 -1
- package/dist/client/assets/post-editor-CJXGoikN.js +1 -0
- package/dist/client/assets/{preview-dialog-DL-IG58f.js → preview-dialog-C9Rx0Dtg.js} +1 -1
- package/dist/client/assets/primitives-BmW50XTY.js +1 -0
- package/dist/client/assets/{profile-C_B5WBjr.js → profile-CzQbXboe.js} +1 -1
- package/dist/client/assets/project-app-view-CMzykg6f.js +1 -0
- package/dist/client/assets/record-editor-B__3b7h2.js +1 -0
- package/dist/client/assets/registry-DpRLil7D.js +2 -0
- package/dist/client/assets/{registry-layout-D-yKaMTT.js → registry-layout-D86NULga.js} +1 -1
- package/dist/client/assets/{require-capability-ForXqNJT.js → require-capability-CBJ6cwe3.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DLZsxChB.js → required-auth-layout-Be__d9RH.js} +1 -1
- package/dist/client/assets/{reset-password-DAGGztQp.js → reset-password-CFeeThio.js} +1 -1
- package/dist/client/assets/{roles-DFOyRLHa.js → roles-P1-HY2OT.js} +1 -1
- package/dist/client/assets/{save-status-D3vFASLz.js → save-status-C9pT75mA.js} +1 -1
- package/dist/client/assets/{scroll-area-BCoUMG7p.js → scroll-area-CbWYdgRA.js} +1 -1
- package/dist/client/assets/{search-input-BPopcHkC.js → search-input-CeqwXCv0.js} +1 -1
- package/dist/client/assets/{secrets-BJpfq3ns.js → secrets-EVcWk0yc.js} +1 -1
- package/dist/client/assets/{sections-editor-CnBUARJ1.js → sections-editor-uxePiNCk.js} +1 -1
- package/dist/client/assets/{select-klWONHQR.js → select-BePf1IJF.js} +1 -1
- package/dist/client/assets/{select-model-TCKaJriG.js → select-model-CgXZFBIr.js} +1 -1
- package/dist/client/assets/{seo-editor-DhlnyFIt.js → seo-editor-BpqPSu1k.js} +1 -1
- package/dist/client/assets/{settings-layout-CBDigEZc.js → settings-layout-ljEOwxAc.js} +1 -1
- package/dist/client/assets/{settings-section-jRvT2jrq.js → settings-section-ELYurXQx.js} +1 -1
- package/dist/client/assets/{sheet-BwEVxvhV.js → sheet-Djk8ol5s.js} +1 -1
- package/dist/client/assets/{shell-controls-CyEKolKH.js → shell-controls-CqOBDieU.js} +1 -1
- package/dist/client/assets/{shell-layout-DpKf7Szu.js → shell-layout-BkVrkYmb.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BAJuc96A.js → shell-route-loading-gKBpXu2h.js} +1 -1
- package/dist/client/assets/{sidebar-OtZlhqgE.js → sidebar-DLCPSSnc.js} +1 -1
- package/dist/client/assets/{skeleton-Cszcs1jF.js → skeleton-DrM35KBr.js} +1 -1
- package/dist/client/assets/{sortable.esm-DF0lRk-K.js → sortable.esm-BN6bAoSL.js} +1 -1
- package/dist/client/assets/{sso-DYlfoDSZ.js → sso-By4pryNN.js} +1 -1
- package/dist/client/assets/{store-BG6bRV_N.js → store-BSz8T3hr.js} +1 -1
- package/dist/client/assets/store-registry-mttn5AI8.js +2 -0
- package/dist/client/assets/{studio-tools-DQk3L3Np.js → studio-tools-BvQ8Bli1.js} +1 -1
- package/dist/client/assets/{switch-CBJCp1EZ.js → switch-dEe0am9a.js} +1 -1
- package/dist/client/assets/{table-CxjU6jEb.js → table-D_zHkpnq.js} +1 -1
- package/dist/client/assets/{tabs-oXlWNJCw.js → tabs-DOJ7e6Z7.js} +1 -1
- package/dist/client/assets/{task-status-BRUYD-kl.js → task-status-DLHF9SZS.js} +1 -1
- package/dist/client/assets/{textarea-CsCSLm90.js → textarea-C7j7_npp.js} +1 -1
- package/dist/client/assets/{toggle-group-BnviIU3L.js → toggle-group-CSO_yZKm.js} +1 -1
- package/dist/client/assets/{toolbar-6TermrXG.js → toolbar-D9CfLhAB.js} +1 -1
- package/dist/client/assets/{tools-list-BZfEo-Br.js → tools-list-DC6csFT2.js} +1 -1
- package/dist/client/assets/{tooltip-s8H5WCf1.js → tooltip-CUlMaf5E.js} +1 -1
- package/dist/client/assets/{types-DNgaipDY.js → types-CDn4NSje.js} +1 -1
- package/dist/client/assets/{use-ai-providers-ZIByNjc8.js → use-ai-providers-D-XhQ6_q.js} +1 -1
- package/dist/client/assets/{use-automations-CM-xEWkW.js → use-automations-BllXXW29.js} +1 -1
- package/dist/client/assets/{use-capability-DnottVFE.js → use-capability-DfdnXTfH.js} +1 -1
- package/dist/client/assets/{use-clock-tick-NFxKppg0.js → use-clock-tick-DmUrmEeM.js} +1 -1
- package/dist/client/assets/{use-collections-Dgdgb3bI.js → use-collections-w44ZyJ1t.js} +1 -1
- package/dist/client/assets/{use-connection-C5_1OVd9.js → use-connection-Cvfufzsw.js} +1 -1
- package/dist/client/assets/{use-copy-BLtV1uRw.js → use-copy-BWQBaWRC.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-KWifEUmd.js → use-create-virtual-mcp-CGofqNOQ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B7IfON8g.js → use-debounced-autosave-CaTQp8tz.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DjavMpES.js → use-delete-connection-CNA7qawq.js} +1 -1
- package/dist/client/assets/{use-file-configs-CjCBYYEd.js → use-file-configs-Bg9S5WW4.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C5EOvSir.js → use-infinite-scroll-BlkXRVRw.js} +1 -1
- package/dist/client/assets/{use-join-requests-YCqx1-8a.js → use-join-requests-ByqDno7o.js} +1 -1
- package/dist/client/assets/{use-mcp-client-yg_7fL7d.js → use-mcp-client-BbOUwA1H.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-5Bobm_Dp.js → use-mcp-prompts-Y5le4syR.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B3L7d0qF.js → use-mcp-tools-xGr1pN0n.js} +1 -1
- package/dist/client/assets/{use-members-aQFClcPR.js → use-members-blURElyD.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-E6Clnz4W.js → use-navigate-to-agent-CidcWwFC.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BIIDGoHT.js → use-org-auth-client-oMz0ubhe.js} +1 -1
- package/dist/client/assets/{use-org-sso-CQDHX8Ol.js → use-org-sso-CIoYIaj1.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BAwop9JL.js → use-organization-roles-tA96x-8d.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Bt4Azr_V.js → use-organization-settings-B5L78CqV.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DqrzFF-B.js → use-registry-connections-3CHe_VwJ.js} +1 -1
- package/dist/client/assets/{use-secrets-BPUuwlqM.js → use-secrets-DlUSWVTu.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CTKzqdj3.js → use-status-sounds-Bbu_XWuO.js} +1 -1
- package/dist/client/assets/{use-view-mode-CSlJNn17.js → use-view-mode-Dff0V9fY.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Dd23vNPe.js → use-virtual-mcp-CLJ6qnG1.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BAIT4yxs.js +1 -0
- package/dist/client/assets/{useQueries-B5ocsfip.js → useQueries-BqFctUi9.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DpmGs3CS.js +1 -0
- package/dist/client/assets/{variant-calendar-JjtPE2XQ.js → variant-calendar-CUrfAk6h.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D_ZEPhLR.js → view-mode-toggle-CIiu6iGh.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +222 -222
- package/dist/server/server.js +166 -166
- package/package.json +1 -1
- package/dist/client/assets/block-document-BjcLuzD8.js +0 -3
- package/dist/client/assets/category-editor-C2_6fgzs.js +0 -1
- package/dist/client/assets/commerce-onboarding-Bj40Pvgb.js +0 -1
- package/dist/client/assets/index-B6DoI6qf.css +0 -1
- package/dist/client/assets/page-seo-sheet-CC2BIJqy.js +0 -1
- package/dist/client/assets/post-editor-C6Fq_MXy.js +0 -1
- package/dist/client/assets/primitives-BUiN38IN.js +0 -1
- package/dist/client/assets/project-app-view-Bu4eRc7c.js +0 -1
- package/dist/client/assets/record-editor-ClqDgpry.js +0 -1
- package/dist/client/assets/registry-UQsNW_2i.js +0 -2
- package/dist/client/assets/store-registry-BEABPsCe.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Bkshyape.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DW3O08AT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bg as st,bh as q,bi as De,C as c,ak as A,aF as Y,bj as Le,aC as _,bk as pe,bl as G,aD as ee,bm as le,z as p,bn as He,bo as Ve,bp as nt,bq as it,br as Ke,bs as ot,bt as at,bu as lt,bv as Ye,bw as ct,b6 as Z,bx as ut,aE as K,by as dt,c as U,r as F,l as _e,j as o,aP as Qe,w as Ue,a as ft,t as xe,B as Ce,i as $e,b as mt,E as ht,aa as pt}from"./index-5eBuuZqw.js";import{P as ce}from"./index-CpP1Ipdr.js";import{E as Xe}from"./empty-state-CvhIsMco.js";import{A as gt,f as bt,h as yt,n as xt,j as vt,k as wt,i as St,u as jt}from"./use-mcp-client-yg_7fL7d.js";import{c as _t}from"./use-mcp-tools-B3L7d0qF.js";import{c as Ct}from"./ZoomOut-vPlJRu24.js";import{i as Et}from"./Key01-Bfv34Mef.js";import{b as Nt,u as Ot,a as Tt}from"./use-connection-C5_1OVd9.js";import{U as ue,a as Ne,e as We}from"./auth-DJGEOj5x.js";import{i as kt,c as It,d as Pt,e as Mt}from"./extract-connection-data-BTddB-Ri.js";import{u as At}from"./use-registry-connections-DqrzFF-B.js";import{b as Rt}from"./use-organization-settings-Bt4Azr_V.js";import{s as Lt}from"./Plus-ChDqk9yl.js";import{d as Ht,b as Ut,c as $t,S as Ft,a as Bt}from"./select-klWONHQR.js";import{F as Dt,v as Vt}from"./Form-CWWkyjn1.js";import"./index-j0FOxC5a.js";import{A as et}from"./agent-icon-ChMYpg8v.js";import{I as Wt}from"./input-MT_IAhPD.js";import{a as qt,b as zt,P as Gt}from"./popover-CNJ18mIX.js";import{u as Jt,a as Zt,T as Kt,c as Yt,b as Qt}from"./tooltip-s8H5WCf1.js";import{u as Xt}from"./use-virtual-mcp-Dd23vNPe.js";import{i as er}from"./ChevronUp-C3RfevsM.js";import{i as tr}from"./SearchMd-BJdNdDgV.js";import{a as rr}from"./Users03-Bf-frjqU.js";import{u as sr}from"./use-create-virtual-mcp-KWifEUmd.js";function nr(){const t=new gt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return st(t),t}class ir{#e=nr();#t=new Map;#r=new WeakMap;getValidator(e){const r=this.#r.get(e);if(r)return r;let s;const n=i=>{if(!s){const a=or(e);let l=this.#t.get(a);l||(l=this.#e.compile(e),this.#t.set(a,l)),s=l}return s(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)}};return this.#r.set(e,n),n}}function or(t){return JSON.stringify(t,(e,r)=>r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.keys(r).sort().map(s=>[s,r[s]])):r)}const ar=new ir;var lr=class{apply(t,e){if(!e.type)return;const r=Array.isArray(e.type)?e.type:[e.type],s=new Set(r);if(s.has("string")||(t.string=!1),!s.has("number")&&!s.has("integer")&&(t.number=!1),s.has("boolean")||(t.boolean=!1),s.has("null")||(t.null=!1),s.has("array")||(t.array=!1),s.has("object")||(t.object=!1),s.has("integer")&&t.number!==!1){const n=t.number||A();n instanceof le&&(t.number=n.int())}}},cr=class{apply(t,e){if(e.const===void 0)return;const r=e.const;t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1,typeof r=="string"?t.string=G(r):typeof r=="number"?t.number=G(r):typeof r=="boolean"?t.boolean=G(r):r===null?t.null=Le():Array.isArray(r)?t.array=void 0:typeof r=="object"&&(t.object=void 0)}},ur=class{apply(t,e){if(!e.enum)return;if(e.enum.length===0){e.type||(t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1);return}const r={string:e.enum.filter(s=>typeof s=="string"),number:e.enum.filter(s=>typeof s=="number"),boolean:e.enum.filter(s=>typeof s=="boolean"),null:e.enum.filter(s=>s===null),array:e.enum.filter(s=>Array.isArray(s)),object:e.enum.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s))};t.string=this.createTypeSchema(r.string,"string"),t.number=this.createTypeSchema(r.number,"number"),t.boolean=this.createTypeSchema(r.boolean,"boolean"),t.null=r.null.length>0?Le():!1,t.array=r.array.length>0?void 0:!1,t.object=r.object.length>0?void 0:!1}createTypeSchema(t,e){if(t.length===0)return!1;if(t.length===1)return G(t[0]);if(e==="string")return ee(t);if(e==="number"){const[r,s,...n]=t;return pe([G(r),G(s),...n.map(i=>G(i))])}return e==="boolean"?pe([G(!0),G(!1)]):!1}},dr=class{apply(t,e){const r=e;if(r.type==="string"&&r.format==="binary"&&r.contentEncoding==="binary"){let s=lt();r.minLength!==void 0&&(s=s.min(r.minLength)),r.maxLength!==void 0&&(s=s.max(r.maxLength)),r.contentMediaType!==void 0&&(s=s.mime(r.contentMediaType)),t.file=s,t.string=!1}}},fr=class{apply(t,e){const r=e;e.type===void 0&&(r.minLength!==void 0||r.maxLength!==void 0||r.pattern!==void 0)&&t.string===void 0&&(t.string=c())}},mr=class{apply(t,e){const r=e;if(r.minLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length>=r.minLength,{message:`String must be at least ${r.minLength} characters long`}))}}},hr=class{apply(t,e){const r=e;if(r.maxLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length<=r.maxLength,{message:`String must be at most ${r.maxLength} characters long`}))}}},pr=class{apply(t,e){const r=e;if(r.pattern&&t.string!==!1){const s=t.string||c();if(s instanceof He){const n=new RegExp(r.pattern);t.string=s.regex(n)}}}},gr=class{apply(t,e){const r=e;if(r.minimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.min(r.minimum))}}},br=class{apply(t,e){const r=e;if(r.maximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.max(r.maximum))}}},yr=class{apply(t,e){const r=e;if(r.exclusiveMinimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMinimum=="number"?t.number=s.gt(r.exclusiveMinimum):t.number=!1)}}},xr=class{apply(t,e){const r=e;if(r.exclusiveMaximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMaximum=="number"?t.number=s.lt(r.exclusiveMaximum):t.number=!1)}}},vr=class{apply(t,e){const r=e;if(r.multipleOf!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.refine(n=>{if(r.multipleOf===0)return!1;const i=n/r.multipleOf,a=Math.round(i),l=Math.min(Math.abs(n)*Number.EPSILON*10,Math.abs(r.multipleOf)*Number.EPSILON*10);return Math.abs(i-a)<=l/Math.abs(r.multipleOf)},{message:`Must be a multiple of ${r.multipleOf}`}))}}},wr=class{apply(t,e){const r=e;e.type===void 0&&(r.minItems!==void 0||r.maxItems!==void 0||r.items!==void 0||r.prefixItems!==void 0)&&t.array===void 0&&(t.array=_(q()))}},Sr=class{apply(t,e){const r=e;r.minItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).min(r.minItems))}},jr=class{apply(t,e){const r=e;r.maxItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).max(r.maxItems))}},_r=class{apply(t,e){const r=e;if(t.array!==!1)if(Array.isArray(r.items))t.array=t.array||_(q());else if(r.items&&typeof r.items!="boolean"&&!r.prefixItems){const s=$(r.items);let n=_(s);if(t.array&&t.array instanceof nt){const i=t.array._def;i.checks&&i.checks.forEach(a=>{if(a._zod&&a._zod.def){const l=a._zod.def;l.check==="min_length"&&l.minimum!==void 0?n=n.min(l.minimum):l.check==="max_length"&&l.maximum!==void 0&&(n=n.max(l.maximum))}})}t.array=n}else typeof r.items=="boolean"&&r.items===!1?r.prefixItems?t.array=t.array||_(q()):t.array=_(q()).max(0):typeof r.items=="boolean"&&r.items===!0?t.array=t.array||_(q()):r.prefixItems&&(t.array=t.array||_(q()))}},Cr=class{apply(t,e){if(e.type!=="array")return;const r=e;if(!Array.isArray(r.items)||t.array===!1)return;const s=r.items.map(i=>$(i));let n;s.length===0?n=Ve([]):n=Ve(s),r.minItems!==void 0&&r.minItems>s.length&&(n=!1),r.maxItems!==void 0&&r.maxItems<s.length&&(n=!1),t.tuple=n,t.array=!1}},Er=class{apply(t,e){const r=e;t.object!==!1&&(r.properties||r.required||r.additionalProperties!==void 0)&&(t.object=t.object||p({}).passthrough())}},Nr=class{apply(t,e){const r=e;e.type===void 0&&(r.maxProperties!==void 0||r.minProperties!==void 0)&&t.object===void 0&&(t.object=p({}).passthrough())}},Or=class{apply(t,e){const r=e;if(r.maxProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length<=r.maxProperties,{message:`Object must have at most ${r.maxProperties} properties`})}}},Tr=class{apply(t,e){const r=e;if(r.minProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length>=r.minProperties,{message:`Object must have at least ${r.minProperties} properties`})}}};function ge(t,e){if(t===e)return!0;if(t==null||e==null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((r,s)=>ge(r,e[s]));if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(n=>s.includes(n)&&ge(t[n],e[n]))}return!1}function kr(){return t=>{if(!Array.isArray(t))return!0;const e=[];return t.every(r=>e.some(n=>ge(r,n))?!1:(e.push(r),!0))}}function Se(t,e){return t.safeParse(e).success}var Ir=class{apply(t,e){if(!e.not)return t;const r=$(e.not);return t.refine(s=>!Se(r,s),{message:"Value must not match the 'not' schema"})}},Pr=class{apply(t,e){return e.uniqueItems!==!0?t:t.refine(kr(),{message:"Array items must be unique"})}},Mr=class{apply(t,e){return!e.allOf||e.allOf.length===0?t:e.allOf.map(s=>$(s)).reduce((s,n)=>Ke(s,n),t)}},Ar=class{apply(t,e){if(!e.anyOf||e.anyOf.length===0)return t;const r=e.anyOf.length===1?$(e.anyOf[0]):pe([$(e.anyOf[0]),$(e.anyOf[1]),...e.anyOf.slice(2).map(s=>$(s))]);return Ke(t,r)}},Rr=class{apply(t,e){if(!e.oneOf||e.oneOf.length===0)return t;const r=e.oneOf.map(s=>$(s));return t.refine(s=>{let n=0;for(const i of r)if(i.safeParse(s).success&&(n++,n>1))return!1;return n===1},{message:"Value must match exactly one of the oneOf schemas"})}},Lr=class{apply(t,e){const r=e;if(r.prefixItems&&Array.isArray(r.prefixItems)){const n=r.prefixItems.map(i=>$(i));return t.refine(i=>{if(!Array.isArray(i))return!0;for(let a=0;a<Math.min(i.length,n.length);a++)if(!Se(n[a],i[a]))return!1;if(i.length>n.length){if(typeof r.items=="boolean"&&r.items===!1)return!1;if(r.items&&typeof r.items=="object"&&!Array.isArray(r.items)){const a=$(r.items);for(let l=n.length;l<i.length;l++)if(!Se(a,i[l]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return t}},Hr=class{apply(t,e){const r=e;if(!r.properties&&!r.required&&r.additionalProperties!==!1)return t;if(t instanceof ot||t instanceof at){const s={};if(r.properties)for(const[n,i]of Object.entries(r.properties))i!==void 0&&(s[n]=$(i));if(r.required&&Array.isArray(r.required)){const n=new Set(r.required);for(const i of Object.keys(s))n.has(i)||(s[i]=s[i].optional())}else for(const n of Object.keys(s))s[n]=s[n].optional();return r.additionalProperties===!1?p(s):p(s).passthrough()}return t.refine(s=>{if(typeof s!="object"||s===null||Array.isArray(s))return!0;if(r.properties){for(const[n,i]of Object.entries(r.properties))if(i!==void 0&&Object.getOwnPropertyDescriptor(s,n)!==void 0&&!$(i).safeParse(s[n]).success)return!1}if(r.required&&Array.isArray(r.required)){for(const n of r.required)if(!(Object.getOwnPropertyDescriptor(s,n)!==void 0))return!1}if(r.additionalProperties===!1&&r.properties){const n=new Set(Object.keys(r.properties));for(const i in s)if(!n.has(i))return!1}return!0},{message:"Object constraints validation failed"})}},Ur=class{apply(t,e){if(!e.enum||e.enum.length===0)return t;const r=e.enum.filter(s=>Array.isArray(s)||typeof s=="object"&&s!==null);return r.length===0?t:t.refine(s=>typeof s!="object"||s===null?!0:r.some(n=>ge(s,n)),{message:"Value must match one of the enum values"})}},$r=class{apply(t,e){if(e.const===void 0)return t;const r=e.const;return typeof r!="object"||r===null?t:t.refine(s=>ge(s,r),{message:"Value must equal the const value"})}},Fr=class{apply(t,e){return e.description&&(t=t.describe(e.description)),t}},Br=class{apply(t,e){var r;const s=e;return!((r=s.required)!=null&&r.includes("__proto__"))||e.type!==void 0?t:q().refine(n=>this.validateRequired(n,s.required),{message:"Missing required properties"})}validateRequired(t,e){return typeof t!="object"||t===null||Array.isArray(t)?!0:e.every(r=>Object.prototype.hasOwnProperty.call(t,r))}},Dr=class{apply(t,e){var r;const s=e;if(s.contains===void 0)return t;const n=$(s.contains),i=(r=s.minContains)!=null?r:1,a=s.maxContains;return t.refine(l=>{if(!Array.isArray(l))return!0;let d=0;for(const u of l)Se(n,u)&&d++;return!(d<i||a!==void 0&&d>a)},{message:"Array must contain required items matching the schema"})}},Vr=class{apply(t,e){const{default:r}=e;return r===void 0||!t.safeParse(r).success?t:t.default(r)}},Wr=[new cr,new ur,new lr,new dr,new fr,new wr,new Nr,new mr,new hr,new pr,new gr,new br,new yr,new xr,new vr,new Cr,new Sr,new jr,new _r,new Or,new Tr,new Er],qr=[new Br,new Ur,new $r,new Mr,new Ar,new Rr,new Lr,new Hr,new Dr,new Ir,new Pr,new Vr,new Fr];function $(t){if(typeof t=="boolean")return t?q():De();const e={};for(const n of Wr)n.apply(e,t);const r=[];if(e.string!==!1&&r.push(e.string||c()),e.number!==!1&&r.push(e.number||A()),e.boolean!==!1&&r.push(e.boolean||Y()),e.null!==!1&&r.push(e.null||Le()),e.array!==!1&&r.push(e.array||_(q())),e.tuple!==!1&&e.tuple!==void 0&&r.push(e.tuple),e.object!==!1)if(e.object)r.push(e.object);else{const n=it(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"Must be an object, not an array");r.push(n)}e.file!==!1&&e.file!==void 0&&r.push(e.file);let s;r.length===0?s=De():r.length===1?s=r[0]:Object.keys(t).some(i=>i!=="$schema"&&i!=="title"&&i!=="description")?s=pe(r):s=q();for(const n of qr)s=n.apply(s,t);return s}class qe extends Event{constructor(e,r){var s,n;super(e),this.code=(s=r?.code)!=null?s:void 0,this.message=(n=r?.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,s){return s(ze(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(ze(this),r)}}function zr(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function Oe(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(Oe).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${Oe(t.cause)}`:t.message:`${t}`}function ze(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var tt=t=>{throw TypeError(t)},Fe=(t,e,r)=>e.has(t)||tt("Cannot "+r),v=(t,e,r)=>(Fe(t,e,"read from private field"),r?r.call(t):e.get(t)),H=(t,e,r)=>e.has(t)?tt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),T=(t,e,r,s)=>(Fe(t,e,"write to private field"),e.set(t,r),r),J=(t,e,r)=>(Fe(t,e,"access private method"),r),D,X,se,ve,je,me,oe,he,Q,ne,ae,ie,de,z,Te,ke,Ie,Ge,Pe,Me,fe,Ae,Re;class we extends EventTarget{constructor(e,r){var s,n;super(),H(this,z),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,H(this,D),H(this,X),H(this,se),H(this,ve),H(this,je),H(this,me),H(this,oe),H(this,he,null),H(this,Q),H(this,ne),H(this,ae,null),H(this,ie,null),H(this,de,null),H(this,ke,async i=>{var a;v(this,ne).reset();const{body:l,redirected:d,status:u,headers:m}=i;if(u===204){J(this,z,fe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?T(this,se,new URL(i.url)):T(this,se,void 0),u!==200){J(this,z,fe).call(this,`Non-200 status code (${u})`,u);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){J(this,z,fe).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(v(this,D)===this.CLOSED)return;T(this,D,this.OPEN);const f=new Event("open");if((a=v(this,de))==null||a.call(this,f),this.dispatchEvent(f),typeof l!="object"||!l||!("getReader"in l)){J(this,z,fe).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,x=l.getReader();let y=!0;do{const{done:b,value:w}=await x.read();w&&v(this,ne).feed(h.decode(w,{stream:!b})),b&&(y=!1,v(this,ne).reset(),J(this,z,Ae).call(this))}while(y)}),H(this,Ie,i=>{T(this,Q,void 0),!(i.name==="AbortError"||i.type==="aborted")&&J(this,z,Ae).call(this,Oe(i))}),H(this,Pe,i=>{typeof i.id=="string"&&T(this,he,i.id);const a=new MessageEvent(i.event||"message",{data:i.data,origin:v(this,se)?v(this,se).origin:v(this,X).origin,lastEventId:i.id||""});v(this,ie)&&(!i.event||i.event==="message")&&v(this,ie).call(this,a),this.dispatchEvent(a)}),H(this,Me,i=>{T(this,me,i)}),H(this,Re,()=>{T(this,oe,void 0),v(this,D)===this.CONNECTING&&J(this,z,Te).call(this)});try{if(e instanceof URL)T(this,X,e);else if(typeof e=="string")T(this,X,new URL(e,Gr()));else throw new Error("Invalid URL")}catch{throw zr("An invalid or illegal string was specified")}T(this,ne,bt({onEvent:v(this,Pe),onRetry:v(this,Me)})),T(this,D,this.CONNECTING),T(this,me,3e3),T(this,je,(s=r?.fetch)!=null?s:globalThis.fetch),T(this,ve,(n=r?.withCredentials)!=null?n:!1),J(this,z,Te).call(this)}get readyState(){return v(this,D)}get url(){return v(this,X).href}get withCredentials(){return v(this,ve)}get onerror(){return v(this,ae)}set onerror(e){T(this,ae,e)}get onmessage(){return v(this,ie)}set onmessage(e){T(this,ie,e)}get onopen(){return v(this,de)}set onopen(e){T(this,de,e)}addEventListener(e,r,s){const n=r;super.addEventListener(e,n,s)}removeEventListener(e,r,s){const n=r;super.removeEventListener(e,n,s)}close(){v(this,oe)&&clearTimeout(v(this,oe)),v(this,D)!==this.CLOSED&&(v(this,Q)&&v(this,Q).abort(),T(this,D,this.CLOSED),T(this,Q,void 0))}}D=new WeakMap,X=new WeakMap,se=new WeakMap,ve=new WeakMap,je=new WeakMap,me=new WeakMap,oe=new WeakMap,he=new WeakMap,Q=new WeakMap,ne=new WeakMap,ae=new WeakMap,ie=new WeakMap,de=new WeakMap,z=new WeakSet,Te=function(){T(this,D,this.CONNECTING),T(this,Q,new AbortController),v(this,je)(v(this,X),J(this,z,Ge).call(this)).then(v(this,ke)).catch(v(this,Ie))},ke=new WeakMap,Ie=new WeakMap,Ge=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...v(this,he)?{"Last-Event-ID":v(this,he)}:void 0},cache:"no-store",signal:(t=v(this,Q))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Pe=new WeakMap,Me=new WeakMap,fe=function(t,e){var r;v(this,D)!==this.CLOSED&&T(this,D,this.CLOSED);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s)},Ae=function(t,e){var r;if(v(this,D)===this.CLOSED)return;T(this,D,this.CONNECTING);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s),T(this,oe,setTimeout(v(this,Re),v(this,me)))},Re=new WeakMap,we.CONNECTING=0,we.OPEN=1,we.CLOSED=2;function Gr(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}class Jr extends Error{constructor(e,r,s){super(`SSE error: ${r}`),this.code=e,this.event=s}}class Zr{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=yt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new ue("No auth provider");let e;try{e=await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new ue;return await this._startOrAuth()}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=xt(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){const e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,s)=>{this._eventSource=new we(this._url.href,{...this._eventSourceInit,fetch:async(n,i)=>{const a=await this._commonHeaders();a.set("Accept","text/event-stream");const l=await e(n,{...i,headers:a});if(l.status===401&&l.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:u}=We(l);this._resourceMetadataUrl=d,this._scope=u}return l}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{if(n.code===401&&this._authProvider){this._authThenStart().then(r,s);return}const i=new Jr(n.code,n.message,n);s(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{const i=n;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(a){s(a),this.onerror?.(a),this.close();return}r()}),this._eventSource.onmessage=n=>{const i=n;let a;try{a=Ye.parse(JSON.parse(i.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(a)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new ue("No auth provider");if(await Ne(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{const r=await this._commonHeaders();r.set("content-type","application/json");const s={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._endpoint,s);if(!n.ok){const i=await n.text().catch(()=>null);if(n.status===401&&this._authProvider){const{resourceMetadataUrl:a,scope:l}=We(n);if(this._resourceMetadataUrl=a,this._scope=l,await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${i}`)}await n.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}}const Kr="mcp";class Yr{constructor(e){this._url=e}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._socket=new WebSocket(this._url,Kr),this._socket.onerror=s=>{const n="error"in s?s.error:new Error(`WebSocket error: ${JSON.stringify(s)}`);r(n),this.onerror?.(n)},this._socket.onopen=()=>{e()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=s=>{let n;try{n=Ye.parse(JSON.parse(s.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(n)}})}async close(){this._socket?.close()}send(e){return new Promise((r,s)=>{if(!this._socket){s(new Error("Not connected"));return}this._socket?.send(JSON.stringify(e)),r()})}}class Qr extends vt{constructor(e,r){super(e,r)}send(e,r){const s=Xr(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,r)}}function Xr(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const r=e?.params?.protocolVersion;return r?{type:"emit",message:{result:{protocolVersion:r,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class es extends wt{constructor(e,r){super(e,{jsonSchemaValidator:ar,...r})}async listTools(e,r){return await this.request({method:"tools/list",params:e},ct,r)}}const ts=async(t,e,r)=>{const s=rs(t.connection,e,r);if(!s)throw new Error("Unknown MCP connection type");const n=new es({name:t?.name??"MCP Client",version:"1.0.0"});return await n.connect(s),{client:n}},rs=(t,e,r)=>{if(t.type==="Websocket")return new Yr(new URL(t.url));if(t.type!=="SSE"&&t.type!=="HTTP")return null;const n={...t.token?{authorization:`Bearer ${t.token}`}:{},...r??{},..."headers"in t?t.headers||{}:{}};if(t.type==="SSE"){const i={requestInit:{headers:n,signal:e}};return t.token&&(i.eventSourceInit={fetch:(a,l)=>fetch(a,{...l,headers:{...n,Accept:"text/event-stream"},signal:e})}),new Zr(new URL(t.url),i)}return new Qr(new URL(t.url),{requestInit:{headers:n,signal:e,credentials:"include"}})},Je=t=>{try{return JSON.parse(t)}catch{return t}},ye=new Map,Ze=(t,e)=>({...t,id:t.name,inputSchema:t.inputSchema?$(t.inputSchema):void 0,outputSchema:t.outputSchema?$(t.outputSchema):void 0,execute:r=>e(r.context,t.name)});function ss(t){const e=r=>"connection"in t?ts({connection:t.connection},void 0,r):t.client;return new Proxy({},{get(r,s){if(s==="toJSON")return null;if(typeof s!="string")throw new Error("Name must be a string");if(s==="listTools")return l;async function n(d,u=s){const m=t?.debugId?.(),f=m?{"x-trace-debug-id":m}:void 0,{client:h}=await e(f),{structuredContent:x,isError:y,content:b}=await h.callTool({name:String(u),arguments:d});if(y){const S=b?.[0]?.text,g=typeof S=="string"?Je(S):null,O=g?.code&&typeof t?.getErrorByStatusCode=="function"?t.getErrorByStatusCode(g.code,g.message,g.traceId):null;throw O||new Error(`Tool ${String(u)} returned an error: ${JSON.stringify(x??b)}`)}if(x!==void 0)return x;const w=b?.[0]?.text;return typeof w=="string"?Je(w):void 0}async function i(){const{client:d}=await e(),{tools:u}=await d.listTools();return u}async function a(){if(!("connection"in t))return i();const d=t.connection,u=JSON.stringify(d);try{return ye.has(u)||ye.set(u,i()),await ye.get(u)}catch(m){console.error("Failed to list tools",m),ye.delete(u);return}}async function l(){return(await a()??[]).map(u=>Ze(u,n))}return n.asTool=async()=>{const u=(await a()??[]).find(m=>m.name===s);if(!u)throw new Error(`Tool ${s} not found`);return Ze(u,n)},n}})}new Proxy({},{get(t,e){return e==="toJSON"?null:e==="forConnection"?r=>ns({connection:r}):global[e]}});function ns(t){return ss(t)}function is(t){return{isImplementedBy:e=>{for(const r of t){const s=typeof r.name=="string"?new RegExp(`^${r.name}$`):r.name,n=e.find(i=>s.test(i.name));if(!(!n&&r.opt)&&!n)return!1}return!0}}}const os=p({id:c().describe("Unique identifier for the entity"),title:c().describe("Human-readable title for the entity"),description:c().nullish().describe("Description of the entity"),created_at:c().datetime(),updated_at:c().datetime(),created_by:c().optional(),updated_by:c().optional()}),as=p({field:_(c()),operator:ee(["eq","gt","gte","lt","lte","in","like","contains"]),value:Z()}),rt=ut(()=>pe([as,p({operator:ee(["and","or","not"]),conditions:_(rt)})])),ls=p({field:_(c()),direction:ee(["asc","desc"]),nulls:ee(["first","last"]).optional()}),cs=p({where:rt.optional().describe("Filter expression"),orderBy:_(ls).optional().describe("Sort expressions"),limit:A().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:A().int().min(0).optional().describe("Number of items to skip")});function us(t){return p({items:_(t).describe("Array of collection items"),totalCount:A().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:Y().optional().describe("Whether there are more items available")})}const ds=p({id:c().describe("ID of the entity to retrieve")});function fs(t){return p({item:t.nullable().describe("The retrieved item, or null if not found")})}p({id:c().describe("ID of the entity to delete")});function ms(t,e,r){const s=t.toUpperCase();return[{name:`COLLECTION_${s}_LIST`,inputSchema:cs,outputSchema:us(e)},{name:`COLLECTION_${s}_GET`,inputSchema:ds,outputSchema:fs(e)}]}const hs=p({id:c(),name:c(),description:c().optional(),inputSchema:K(c(),Z()),outputSchema:K(c(),Z()).optional()}),ps=os.extend({_meta:p({"io.decocms":p({id:c(),verified:Y(),scopeName:c(),appName:c(),friendlyName:c().nullable().optional(),metadata:K(c(),Z()).nullable().optional(),publishedAt:c().datetime().optional(),updatedAt:c().datetime().optional(),tools:_(hs).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:p({$schema:c().optional(),_meta:K(c(),Z()).optional(),name:c().describe("The server name (scope/app)"),title:c().optional().describe("User-friendly title"),description:c().optional().describe("Server description"),icons:_(p({src:c(),mimeType:c().optional(),sizes:_(c()).optional(),theme:ee(["light","dark"]).optional()})).optional(),remotes:_(p({type:ee(["http","stdio","sse"]),url:c().optional(),headers:_(Z()).optional()})).optional(),packages:_(Z()).optional(),repository:p({url:c(),source:c().optional(),subfolder:c().optional()}).optional(),version:c().optional(),websiteUrl:c().optional()})});ms("registry_app",ps);const gs=p({specversion:G("1.0").describe("CloudEvents specification version"),id:c().describe("Unique identifier for this event (UUID recommended)"),source:c().describe("Connection ID of the event publisher"),type:c().describe("Event type (e.g., 'order.created', 'user.signup')"),time:c().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:c().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:c().optional().default("application/json").describe("Content type of the data attribute"),dataschema:c().url().optional().describe("URI to the schema for the data attribute"),data:Z().optional().describe("Event payload (any JSON value)")});p({events:_(gs).min(1).describe("Batch of CloudEvents to process")});const bs=p({success:Y().optional().describe("Whether this event was processed successfully"),error:c().optional().describe("Error message for this event"),retryAfter:A().int().positive().optional().describe("Re-deliver this event after this many ms")});p({success:Y().optional().describe("Batch success - applies to events not in results"),error:c().optional().describe("Batch error message - applies to events not in results"),processedCount:A().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:A().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:K(c(),bs).optional().describe("Per-event results keyed by event ID")});const ys=p({type:G("string"),enum:_(c()).optional(),description:c().optional()}),xs=p({type:c(),description:c(),paramsSchema:K(c(),ys)});p({});p({triggers:_(xs)});p({type:c(),params:K(c(),c()),enabled:Y(),callbackUrl:dt().optional(),callbackToken:c().min(1).optional()});p({success:Y()});p({prefix:c().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:A().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:c().optional().describe("Token for pagination from previous response"),delimiter:c().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});p({objects:_(p({key:c().describe("Object key/path"),size:A().describe("Object size in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object")})),nextContinuationToken:c().optional().describe("Token for fetching next page of results"),isTruncated:Y().describe("Whether there are more results available"),commonPrefixes:_(c()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});p({key:c().describe("Object key/path to get metadata for")});p({contentType:c().optional().describe("MIME type of the object"),contentLength:A().describe("Size of the object in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object"),metadata:K(c(),c()).optional().describe("Custom metadata key-value pairs")});p({key:c().describe("Object key/path to generate URL for"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});p({url:c().describe("Presigned URL for downloading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path for the upload"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:c().optional().describe("MIME type for the object being uploaded")});p({url:c().describe("Presigned URL for uploading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path to delete")});p({success:Y().describe("Whether the deletion was successful"),key:c().describe("The key that was deleted")});p({keys:_(c()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});p({deleted:_(c()).describe("Array of successfully deleted keys"),errors:_(p({key:c(),message:c()})).describe("Array of errors for failed deletions")});const vs=p({primary:c().optional().describe("Primary brand color (hex)"),secondary:c().optional().describe("Secondary brand color (hex)"),accent:c().optional().describe("Accent / highlight color (hex)"),background:c().optional().describe("Background color (hex)"),foreground:c().optional().describe("Foreground / text color (hex)")}),ws=p({heading:c().optional().describe("Font family for headings"),body:c().optional().describe("Font family for body text"),code:c().optional().describe("Font family for code / monospace")}),Ss=p({logo:c().optional().describe("Logo URL"),favicon:c().optional().describe("Favicon URL"),ogImage:c().optional().describe("Open Graph image URL")}),js=p({id:c(),name:c().describe("Brand / company name"),domain:c().optional().describe("Company domain (e.g. example.com)"),colors:vs.optional().describe("Semantic color palette"),fonts:ws.optional().describe("Font families by role"),assets:Ss.optional().describe("Visual identity assets"),overview:c().optional().describe("Company overview / description"),tagline:c().optional().describe("Brand tagline"),tone:c().optional().describe("Tone of voice description"),metadata:K(c(),Z()).optional().describe("Extra design tokens and metadata")});p({id:c().optional().describe("Brand ID. Omit to get the default brand.")});p({});p({items:_(js)});const _s={"@deco/llm":"LLMS","@deco/trigger":"TRIGGER","@deco/object-storage":"OBJECT_STORAGE","@deco/brand":"BRAND"};function Cs(t){if(t)return _s[t]}function Cn(t,e){const r=t.tools;if(!r||r.length===0)return!1;const s=r.map(a=>({name:a.name,inputSchema:a.inputSchema})),n=e.map(a=>({name:a.name,inputSchema:a.inputSchema,opt:a.opt}));return is(n).isImplementedBy(s)}const Be=F.createContext(null);function En(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.tabsEl)return null;let n;return e[0]!==r||e[1]!==s.tabsEl?(n=Qe.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=n):n=e[2],n}function Es(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.actionsEl)return null;let n;return e[0]!==r||e[1]!==s.actionsEl?(n=Qe.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=n):n=e[2],n}const Nn=Es;function On(t){const e=U.c(21),{children:r,breadcrumb:s,hideHeader:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={leftEl:null,tabsEl:null,actionsEl:null},e[0]=i):i=e[0];const[a,l]=F.useState(i),d=F.useRef(null),u=F.useRef(null),m=F.useRef(null);let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=j=>{d.current=j,j&&l(C=>C.leftEl===j?C:{...C,leftEl:j})},e[1]=f):f=e[1];const h=f;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=j=>{u.current=j,j&&l(C=>C.tabsEl===j?C:{...C,tabsEl:j})},e[2]=x):x=e[2];const y=x;let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=j=>{m.current=j,j&&l(C=>C.actionsEl===j?C:{...C,actionsEl:j})},e[3]=b):b=e[3];const w=b,S=n&&"hidden";let g;e[4]!==S?(g=_e(S),e[4]=S,e[5]=g):g=e[5];let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx("div",{ref:h,className:"flex items-center gap-2 min-w-0"}),e[6]=O):O=e[6];let R;e[7]!==s?(R=o.jsxs(ce.Header.Left,{children:[s,O]}),e[7]=s,e[8]=R):R=e[8];let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsxs(ce.Header.Right,{children:[o.jsx("div",{ref:y,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),o.jsx("div",{ref:w,className:"flex items-center gap-2 shrink-0"})]}),e[9]=L):L=e[9];let k;e[10]!==g||e[11]!==R?(k=o.jsxs(ce.Header,{className:g,children:[R,L]}),e[10]=g,e[11]=R,e[12]=k):k=e[12];let I;e[13]!==r?(I=o.jsx(ce.Content,{children:r}),e[13]=r,e[14]=I):I=e[14];let P;e[15]!==k||e[16]!==I?(P=o.jsxs(ce,{children:[k,I]}),e[15]=k,e[16]=I,e[17]=P):P=e[17];let N;return e[18]!==a||e[19]!==P?(N=o.jsx(Be,{value:a,children:P}),e[18]=a,e[19]=P,e[20]=N):N=e[20],N}function Ns(t){return t.startsWith("@")?t:`@${t}`}function Os(){const{org:t}=Ue(),{data:e}=ft.useSession(),r=Nt(),s=At(),n=Rt(),i=s.filter(l=>n(l.id));return{installByBinding:async l=>{if(!t||!e?.user?.id){xe.error("Not authenticated");return}const d=Ns(l),m=(await Promise.all(i.map(async b=>{const w=kt(b.id,t.id);try{const S=await It(b.id,t.id,t.slug,w,{where:{appName:d}});return Pt(S??[])[0]??null}catch{return null}}))).find(b=>b!==null);if(!m){xe.error(`MCP Server not found in registry: ${l}`);return}const f=Mt(m,t.id,e.user.id),h=f.connection_type==="STDIO",x=!!f.connection_url,y=h&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!x&&!y){xe.error("This MCP Server cannot be connected: no connection method available");return}return await r.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:r.create.isPending}}function Ts(t){const e=U.c(21),{virtualMcp:r,isSelected:s}=t,n=s&&"bg-accent";let i;e[0]!==n?(i=_e("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==r.icon||e[3]!==r.title?(a=o.jsx(et,{icon:r.icon,name:r.title,size:"sm"}),e[2]=r.icon,e[3]=r.title,e[4]=a):a=e[4];let l;e[5]!==r.title?(l=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.title}),e[5]=r.title,e[6]=l):l=e[6];let d;e[7]!==s?(d=s&&o.jsx(er,{size:16,className:"text-foreground shrink-0"}),e[7]=s,e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==d?(u=o.jsxs("div",{className:"flex items-center justify-between",children:[l,d]}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let m;e[12]!==r.description?(m=r.description&&o.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:r.description}),e[12]=r.description,e[13]=m):m=e[13];let f;e[14]!==u||e[15]!==m?(f=o.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[u,m]}),e[14]=u,e[15]=m,e[16]=f):f=e[16];let h;return e[17]!==i||e[18]!==a||e[19]!==f?(h=o.jsxs("div",{className:i,children:[a,f]}),e[17]=i,e[18]=a,e[19]=f,e[20]=h):h=e[20],h}function ks(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx($e,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function Is(t){const e=U.c(33),{selectedVirtualMcpId:r,onVirtualMcpChange:s,searchInputRef:n}=t,i=Xt(),[a,l]=F.useState(""),d=F.useRef(null),u=n??d;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={navigateOnCreate:!0},e[0]=m):m=e[0];const{createVirtualMCP:f,isCreating:h}=sr(m);let x,y,b,w;if(e[1]!==f||e[2]!==u||e[3]!==h||e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==i){let O;e:{const E=i.filter(Ps);if(!a.trim()){O=E;break e}const M=a.toLowerCase();O=E.filter(B=>B.title.toLowerCase().includes(M)||B.description?.toLowerCase().includes(M))}const R=O;let L;e[12]!==s?(L=E=>{s(E),l("")},e[12]=s,e[13]=L):L=e[13];const k=L;b="flex flex-col max-h-[min(400px,60dvh)]";let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(tr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[14]=I):I=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=E=>l(E.target.value),e[15]=P):P=e[15];let N;e[16]!==u||e[17]!==a?(N=o.jsx(Wt,{ref:u,type:"text",placeholder:"Search for an agent...",value:a,onChange:P,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[16]=u,e[17]=a,e[18]=N):N=e[18];const j=h?"Creating...":"Create Agent";let C;e[19]!==f||e[20]!==h||e[21]!==j?(C=o.jsx(Ce,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:h,children:j}),e[19]=f,e[20]=h,e[21]=j,e[22]=C):C=e[22],e[23]!==N||e[24]!==C?(w=o.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:o.jsxs("div",{className:"relative flex items-center gap-2",children:[I,N,C]})}),e[23]=N,e[24]=C,e[25]=w):w=e[25],x="overflow-y-auto p-1.5 flex-1 min-h-0 [touch-action:pan-y]",y=R.length>0?o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-0.5",children:R.map(E=>o.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(E.id),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),k(E.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:o.jsx(Ts,{virtualMcp:E,isSelected:E.id===r})},E.id))}):o.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[1]=f,e[2]=u,e[3]=h,e[4]=s,e[5]=a,e[6]=r,e[7]=i,e[8]=x,e[9]=y,e[10]=b,e[11]=w}else x=e[8],y=e[9],b=e[10],w=e[11];let S;e[26]!==x||e[27]!==y?(S=o.jsx("div",{className:x,children:y}),e[26]=x,e[27]=y,e[28]=S):S=e[28];let g;return e[29]!==b||e[30]!==w||e[31]!==S?(g=o.jsxs("div",{className:b,children:[w,S]}),e[29]=b,e[30]=w,e[31]=S,e[32]=g):g=e[32],g}function Ps(t){return!t.id||!St(t.id)}function Ms(t){const e=U.c(3);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(ks,{}),e[0]=r):r=e[0];let s;return e[1]!==t?(s=o.jsx(F.Suspense,{fallback:r,children:o.jsx(Is,{...t})}),e[1]=t,e[2]=s):s=e[2],s}function As(t){const e=U.c(32),{selectedVirtualMcpId:r,selectedVirtualMcp:s,onVirtualMcpChange:n,className:i,placeholder:a,showTooltip:l,disabled:d}=t,u=a===void 0?"Select Agent":a,m=l===void 0?!0:l,f=d===void 0?!1:d,[h,x]=F.useState(!1),y=F.useRef(null);let b;e[0]!==n?(b=W=>{n(W),x(!1)},e[0]=n,e[1]=b):b=e[1];const w=b,S=Jt();let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=W=>{x(W)},e[2]=g):g=e[2];const O=g;let R,L;e[3]!==S||e[4]!==h?(R=()=>{h&&!S&&setTimeout(()=>{y.current?.focus()},0)},L=[h,S],e[3]=S,e[4]=h,e[5]=R,e[6]=L):(R=e[5],L=e[6]),F.useEffect(R,L);const k=f?!1:h,I=f?void 0:O,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:text-muted-foreground";let N;e[7]!==i||e[8]!==P?(N=_e("relative flex items-center justify-center size-8 rounded-lg text-muted-foreground/75 transition-colors shrink-0",P,i),e[7]=i,e[8]=P,e[9]=N):N=e[9];let j;e[10]!==s?(j=s?o.jsx(et,{icon:s.icon,name:s.title,size:"sm",className:"absolute inset-0 size-full"}):o.jsxs(o.Fragment,{children:[o.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"agent-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[o.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),o.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),o.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),o.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"7.5",stroke:"url(#agent-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),o.jsx(rr,{size:16})]}),e[10]=s,e[11]=j):j=e[11];let C;e[12]!==f||e[13]!==u||e[14]!==N||e[15]!==j?(C=o.jsx(Kt,{asChild:!0,children:o.jsx(qt,{asChild:!0,children:o.jsx("button",{type:"button",disabled:f,className:N,"aria-label":u,children:j})})}),e[12]=f,e[13]=u,e[14]=N,e[15]=j,e[16]=C):C=e[16];let E;e[17]!==h||e[18]!==s?.title||e[19]!==m?(E=m&&!h&&o.jsx(Zt,{side:"top",className:"text-xs",children:s?.title??"Choose an agent to chat with"}),e[17]=h,e[18]=s?.title,e[19]=m,e[20]=E):E=e[20];let M;e[21]!==C||e[22]!==E?(M=o.jsx(Yt,{children:o.jsxs(Qt,{children:[C,E]})}),e[21]=C,e[22]=E,e[23]=M):M=e[23];let B;e[24]!==w||e[25]!==r?(B=o.jsx(zt,{className:"w-[min(550px,calc(100vw-2rem))] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,collisionPadding:16,children:o.jsx(Ms,{selectedVirtualMcpId:r,onVirtualMcpChange:w,searchInputRef:y})}),e[24]=w,e[25]=r,e[26]=B):B=e[26];let V;return e[27]!==M||e[28]!==B||e[29]!==k||e[30]!==I?(V=o.jsxs(Gt,{open:k,onOpenChange:I,children:[M,B]}),e[27]=M,e[28]=B,e[29]=k,e[30]=I,e[31]=V):V=e[31],V}function Rs(t){const e=t.properties;if(!e)return!1;const r=e.__type,s=e.__binding;return!!(r?.const||s?.const)}function Ls(t){const e=t.properties;if(!e)return{};const r=e.__type,s=e.__binding;return{bindingType:r?.const,bindingSchema:s?.const}}function Hs(t){const e=U.c(10),{bindingSchema:r,bindingType:s,currentValue:n,onValueChange:i,placeholder:a,onAddNew:l,className:d}=t;let u;e[0]!==s?(u=Cs(s),e[0]=s,e[1]=u):u=e[1];const f=u??(typeof r=="string"?r:r??void 0);let h;return e[2]!==s||e[3]!==d||e[4]!==n||e[5]!==l||e[6]!==i||e[7]!==a||e[8]!==f?(h=o.jsx(Us,{value:n,onValueChange:i,placeholder:a,binding:f,bindingType:s,onAddNew:l,className:d}),e[2]=s,e[3]=d,e[4]=n,e[5]=l,e[6]=i,e[7]=a,e[8]=f,e[9]=h):h=e[9],h}function Us({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:s,bindingType:n,onAddNew:i,className:a}){const[l,d]=F.useState(!1),{installByBinding:u,isInstalling:m}=Os(),f=l||m,h=s?void 0:n||void 0,x=Ot(s?{binding:s}:h?{filters:[{column:"app_name",value:h}]}:{}),y=Tt(t&&!x.some(g=>g.id===t)?t:void 0),b=y?[y,...x]:x,w=n?.startsWith("@"),S=async()=>{if(w&&n){d(!0);try{const g=await u(n);g&&e(g.id)}catch(g){const O=g instanceof Error?g.message:String(g);xe.error(`Failed to connect MCP: ${O}`)}finally{d(!1)}return}i?.()};return o.jsxs(Ht,{value:t,onValueChange:e,children:[o.jsx(Ut,{size:"sm",className:_e("w-[200px]",a),children:o.jsx($t,{placeholder:r})}),o.jsxs(Ft,{children:[b.length===0?o.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):b.map(g=>o.jsx(Bt,{value:g.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?o.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded"}):o.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:g.title.slice(0,1).toUpperCase()}),o.jsx("span",{children:g.title})]})},g.id)),(i||w)&&o.jsx("div",{className:"border-t border-border",children:o.jsx(Ce,{onClick:g=>{g.preventDefault(),g.stopPropagation(),S()},disabled:f,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?o.jsxs(o.Fragment,{children:[o.jsx($e,{size:16,className:"animate-spin"}),o.jsx("span",{children:"Connecting..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Lt,{size:16}),o.jsx("span",{children:"Custom Connection"})]})})})]})]})}function $s(t){const e=U.c(49),{schema:r,formData:s,title:n,description:i,registry:a}=t,l=a.formContext,d=n||"",u=n||"";if(Rs(r)){const h=r;let x;e[0]!==h?(x=Ls(h),e[0]=h,e[1]=x):x=e[1];const{bindingType:y,bindingSchema:b}=x,S=(l?.formData?.[d]?.value??s?.value)||"";let g;e[2]!==y||e[3]!==d||e[4]!==l||e[5]!==s?(g=V=>{const W={...s,value:V??"",...y&&{__type:y}};l?.onFieldChange(d,W)},e[2]=y,e[3]=d,e[4]=l,e[5]=s,e[6]=g):g=e[6];const O=g,R=Bs;let L;e[7]!==u||e[8]!==d||e[9]!==n?(L=R(n||u||d),e[7]=u,e[8]=d,e[9]=n,e[10]=L):L=e[10];const k=L;if(y==="@deco/agent"){let V;e[11]!==k?(V=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[11]=k,e[12]=V):V=e[12];let W;e[13]!==i?(W=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[13]=i,e[14]=W):W=e[14];let te;e[15]!==V||e[16]!==W?(te=o.jsxs("div",{className:"flex-1 min-w-0",children:[V,W]}),e[15]=V,e[16]=W,e[17]=te):te=e[17];const Ee=S||void 0;let re;e[18]!==O||e[19]!==Ee?(re=o.jsx(As,{selectedVirtualMcpId:Ee,onVirtualMcpChange:O,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[18]=O,e[19]=Ee,e[20]=re):re=e[20];let be;return e[21]!==te||e[22]!==re?(be=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[te,re]}),e[21]=te,e[22]=re,e[23]=be):be=e[23],be}let I;e[24]!==k?(I=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[24]=k,e[25]=I):I=e[25];let P;e[26]!==i?(P=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[26]=i,e[27]=P):P=e[27];let N;e[28]!==I||e[29]!==P?(N=o.jsxs("div",{className:"flex-1 min-w-0",children:[I,P]}),e[28]=I,e[29]=P,e[30]=N):N=e[30];let j;e[31]!==k?(j=k.toLowerCase(),e[31]=k,e[32]=j):j=e[32];const C=`Select ${j}...`;let E;e[33]!==l?(E=()=>l?.onAddNew(),e[33]=l,e[34]=E):E=e[34];let M;e[35]!==b||e[36]!==y||e[37]!==S||e[38]!==O||e[39]!==C||e[40]!==E?(M=o.jsx(Hs,{bindingSchema:b,bindingType:y,currentValue:S,onValueChange:O,placeholder:C,onAddNew:E,className:"w-[200px] shrink-0"}),e[35]=b,e[36]=y,e[37]=S,e[38]=O,e[39]=C,e[40]=E,e[41]=M):M=e[41];let B;return e[42]!==M||e[43]!==N?(B=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,M]}),e[42]=M,e[43]=N,e[44]=B):B=e[44],B}let m;e[45]!==t.properties?(m=t.properties.map(Fs),e[45]=t.properties,e[46]=m):m=e[46];let f;return e[47]!==m?(f=o.jsx("div",{className:"flex flex-col gap-4",children:m}),e[47]=m,e[48]=f):f=e[48],f}function Fs(t){return t.content}function Bs(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,Ds)}function Ds(t){return t.toUpperCase()}function Vs(t){const e=U.c(13),{label:r,children:s,description:n,id:i,schema:a}=t;if(i.includes("__type")||i.includes("__binding"))return null;if(a.type==="object")return s;let l;e[0]!==i||e[1]!==r?(l=r&&o.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:i,children:r}),e[0]=i,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==n?(d=n&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:n}),e[3]=n,e[4]=d):d=e[4];let u;e[5]!==l||e[6]!==d?(u=o.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[5]=l,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==s?(m=o.jsx("div",{className:"w-[200px] shrink-0",children:s}),e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==u||e[11]!==m?(f=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[u,m]}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f}const Ws={ObjectFieldTemplate:$s,FieldTemplate:Vs};function qs(t){const e=U.c(19),{formKey:r,formState:s,onFormStateChange:n,stateSchema:i}=t,{org:a}=Ue(),l=mt();let d;e[0]!==n?(d=g=>{g.formData&&n(g.formData)},e[0]=n,e[1]=d):d=e[1];const u=d;let m;e[2]!==s||e[3]!==n?(m=(g,O)=>{const R={...s,[g]:O};n(R)},e[2]=s,e[3]=n,e[4]=m):m=e[4];const f=m;let h;e[5]!==l||e[6]!==a?(h=()=>{l({to:"/$org/settings/connections",params:{org:a.slug},search:{action:"create"}})},e[5]=l,e[6]=a,e[7]=h):h=e[7];const x=h;let y;e[8]!==s||e[9]!==x||e[10]!==f?(y={onFieldChange:f,formData:s,onAddNew:x},e[8]=s,e[9]=x,e[10]=f,e[11]=y):y=e[11];const b=y;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(o.Fragment,{}),e[12]=w):w=e[12];let S;return e[13]!==b||e[14]!==r||e[15]!==s||e[16]!==u||e[17]!==i?(S=o.jsx("div",{className:"flex flex-col h-full overflow-auto",children:o.jsx(Dt,{schema:i,validator:Vt,formData:s,onChange:u,formContext:b,liveValidate:!1,showErrorList:!1,templates:Ws,children:w},r)}),e[13]=b,e[14]=r,e[15]=s,e[16]=u,e[17]=i,e[18]=S):S=e[18],S}function zs(t){const e=U.c(14),{org:r}=Ue();let s;e[0]!==t||e[1]!==r.id||e[2]!==r.slug?(s={connectionId:t,orgId:r.id,orgSlug:r.slug},e[0]=t,e[1]=r.id,e[2]=r.slug,e[3]=s):s=e[3];const n=jt(s);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i={},e[4]=i):i=e[4];let a;e[5]!==n?(a={client:n,toolName:"MCP_CONFIGURATION",toolArguments:i,select:Gs},e[5]=n,e[6]=a):a=e[6];const{data:l}=_t(a);let d;e[7]!==l.stateSchema?(d=l.stateSchema??{type:"object",properties:{}},e[7]=l.stateSchema,e[8]=d):d=e[8];const u=d;let m;e[9]!==l.scopes?(m=l.scopes??[],e[9]=l.scopes,e[10]=m):m=e[10];const f=m;let h;return e[11]!==f||e[12]!==u?(h={stateSchema:u,scopes:f},e[11]=f,e[12]=u,e[13]=h):h=e[13],h}function Gs(t){return t.structuredContent??t}function Js(t){const e=U.c(4),{onAuthenticate:r,buttonText:s}=t,n=s===void 0?"Authenticate":s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=i):i=e[0];let a;return e[1]!==n||e[2]!==r?(a=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,o.jsx(Ce,{onClick:r,size:"default",children:n})]})}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Zs(t){const e=U.c(7),{hasReadme:r,onViewReadme:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(Et,{size:36,className:"text-muted-foreground"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Manual Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=i):i=e[1];let a;e[2]!==r||e[3]!==s?(a=r&&s&&o.jsxs(Ce,{onClick:s,variant:"outline",size:"lg",children:[o.jsx(Ct,{size:18,className:"mr-2"}),"View README"]}),e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;return e[5]!==a?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[n,i,a]})}),e[5]=a,e[6]=l):l=e[6],l}function Ks(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=r):r=t[1],r}function Ys(t){const e=U.c(12),{connection:r,form:s}=t,{stateSchema:n}=zs(r.id);let i;e[0]!==s.control?(i={control:s.control,name:"configuration_state"},e[0]=s.control,e[1]=i):i=e[1];const a=pt(i);let l;e[2]!==s?(l=h=>{s.setValue("configuration_state",h,{shouldDirty:!0})},e[2]=s,e[3]=l):l=e[3];const d=l;if(!(n&&n.properties&&typeof n.properties=="object"&&Object.keys(n.properties).length>0)){let h;return e[4]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[4]=h):h=e[4],h}let m;e[5]!==a?(m=a??{},e[5]=a,e[6]=m):m=e[6];let f;return e[7]!==r.id||e[8]!==d||e[9]!==n||e[10]!==m?(f=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(qs,{formKey:r.id,stateSchema:n,formState:m,onFormStateChange:d})}),e[7]=r.id,e[8]=d,e[9]=n,e[10]=m,e[11]=f):f=e[11],f}function Qs(t){const e=U.c(11),{connection:r,form:s,hasMcpBinding:n,isMCPAuthenticated:i,supportsOAuth:a,isServerError:l,onAuthenticate:d,onViewReadme:u}=t,f=!!r?.metadata?.repository?.url;if(!i){if(l){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ks,{}),e[0]=b):b=e[0],b}if(a){let b;return e[1]!==d?(b=o.jsx(Js,{onAuthenticate:d}),e[1]=d,e[2]=b):b=e[2],b}let y;return e[3]!==f||e[4]!==u?(y=o.jsx(Zs,{hasReadme:f,onViewReadme:u}),e[3]=f,e[4]=u,e[5]=y):y=e[5],y}if(!n){let y;return e[6]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=y):y=e[6],y}let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),e[7]=h):h=e[7];let x;return e[8]!==r||e[9]!==s?(x=o.jsx(ht,{children:o.jsx(F.Suspense,{fallback:h,children:o.jsx(Ys,{connection:r,form:s})})}),e[8]=r,e[9]=s,e[10]=x):x=e[10],x}function Tn(t){const e=U.c(2);let r;return e[0]!==t?(r=o.jsx("div",{className:"flex-1 flex h-full",children:o.jsx(Qs,{...t})}),e[0]=t,e[1]=r):r=e[1],r}export{Zs as M,Js as O,Tn as S,On as V,Nn as a,En as b,Cn as c};
|
|
1
|
+
import{bg as st,bh as q,bi as De,C as c,ak as A,aF as Y,bj as Le,aC as _,bk as pe,bl as G,aD as ee,bm as le,z as p,bn as He,bo as Ve,bp as nt,bq as it,br as Ke,bs as ot,bt as at,bu as lt,bv as Ye,bw as ct,b6 as Z,bx as ut,aE as K,by as dt,c as U,r as F,l as _e,j as o,aP as Qe,w as Ue,a as ft,t as xe,B as Ce,i as $e,b as mt,E as ht,aa as pt}from"./index-CurNB2HG.js";import{P as ce}from"./index-qZ5-LmpP.js";import{E as Xe}from"./empty-state-Lmcbk0Zv.js";import{A as gt,f as bt,h as yt,n as xt,j as vt,k as wt,i as St,u as jt}from"./use-mcp-client-BbOUwA1H.js";import{c as _t}from"./use-mcp-tools-xGr1pN0n.js";import{c as Ct}from"./ZoomOut-ryBmf3S4.js";import{i as Et}from"./Key01-CZVV-ceU.js";import{b as Nt,u as Ot,a as Tt}from"./use-connection-Cvfufzsw.js";import{U as ue,a as Ne,e as We}from"./auth-xlfJjVrK.js";import{i as kt,c as It,d as Pt,e as Mt}from"./extract-connection-data-Bau_aQvM.js";import{u as At}from"./use-registry-connections-3CHe_VwJ.js";import{b as Rt}from"./use-organization-settings-B5L78CqV.js";import{s as Lt}from"./Plus-CQOl41pg.js";import{d as Ht,b as Ut,c as $t,S as Ft,a as Bt}from"./select-BePf1IJF.js";import{F as Dt,v as Vt}from"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import{A as et}from"./agent-icon-pz8iT5cD.js";import{I as Wt}from"./input-RRjvrcUF.js";import{a as qt,b as zt,P as Gt}from"./popover-D7BamlkK.js";import{u as Jt,a as Zt,T as Kt,c as Yt,b as Qt}from"./tooltip-CUlMaf5E.js";import{u as Xt}from"./use-virtual-mcp-CLJ6qnG1.js";import{i as er}from"./ChevronUp-CiXD4kQk.js";import{i as tr}from"./SearchMd-Da504yGV.js";import{a as rr}from"./Users03-CJuVy8Iz.js";import{u as sr}from"./use-create-virtual-mcp-CGofqNOQ.js";function nr(){const t=new gt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return st(t),t}class ir{#e=nr();#t=new Map;#r=new WeakMap;getValidator(e){const r=this.#r.get(e);if(r)return r;let s;const n=i=>{if(!s){const a=or(e);let l=this.#t.get(a);l||(l=this.#e.compile(e),this.#t.set(a,l)),s=l}return s(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)}};return this.#r.set(e,n),n}}function or(t){return JSON.stringify(t,(e,r)=>r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.keys(r).sort().map(s=>[s,r[s]])):r)}const ar=new ir;var lr=class{apply(t,e){if(!e.type)return;const r=Array.isArray(e.type)?e.type:[e.type],s=new Set(r);if(s.has("string")||(t.string=!1),!s.has("number")&&!s.has("integer")&&(t.number=!1),s.has("boolean")||(t.boolean=!1),s.has("null")||(t.null=!1),s.has("array")||(t.array=!1),s.has("object")||(t.object=!1),s.has("integer")&&t.number!==!1){const n=t.number||A();n instanceof le&&(t.number=n.int())}}},cr=class{apply(t,e){if(e.const===void 0)return;const r=e.const;t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1,typeof r=="string"?t.string=G(r):typeof r=="number"?t.number=G(r):typeof r=="boolean"?t.boolean=G(r):r===null?t.null=Le():Array.isArray(r)?t.array=void 0:typeof r=="object"&&(t.object=void 0)}},ur=class{apply(t,e){if(!e.enum)return;if(e.enum.length===0){e.type||(t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1);return}const r={string:e.enum.filter(s=>typeof s=="string"),number:e.enum.filter(s=>typeof s=="number"),boolean:e.enum.filter(s=>typeof s=="boolean"),null:e.enum.filter(s=>s===null),array:e.enum.filter(s=>Array.isArray(s)),object:e.enum.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s))};t.string=this.createTypeSchema(r.string,"string"),t.number=this.createTypeSchema(r.number,"number"),t.boolean=this.createTypeSchema(r.boolean,"boolean"),t.null=r.null.length>0?Le():!1,t.array=r.array.length>0?void 0:!1,t.object=r.object.length>0?void 0:!1}createTypeSchema(t,e){if(t.length===0)return!1;if(t.length===1)return G(t[0]);if(e==="string")return ee(t);if(e==="number"){const[r,s,...n]=t;return pe([G(r),G(s),...n.map(i=>G(i))])}return e==="boolean"?pe([G(!0),G(!1)]):!1}},dr=class{apply(t,e){const r=e;if(r.type==="string"&&r.format==="binary"&&r.contentEncoding==="binary"){let s=lt();r.minLength!==void 0&&(s=s.min(r.minLength)),r.maxLength!==void 0&&(s=s.max(r.maxLength)),r.contentMediaType!==void 0&&(s=s.mime(r.contentMediaType)),t.file=s,t.string=!1}}},fr=class{apply(t,e){const r=e;e.type===void 0&&(r.minLength!==void 0||r.maxLength!==void 0||r.pattern!==void 0)&&t.string===void 0&&(t.string=c())}},mr=class{apply(t,e){const r=e;if(r.minLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length>=r.minLength,{message:`String must be at least ${r.minLength} characters long`}))}}},hr=class{apply(t,e){const r=e;if(r.maxLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length<=r.maxLength,{message:`String must be at most ${r.maxLength} characters long`}))}}},pr=class{apply(t,e){const r=e;if(r.pattern&&t.string!==!1){const s=t.string||c();if(s instanceof He){const n=new RegExp(r.pattern);t.string=s.regex(n)}}}},gr=class{apply(t,e){const r=e;if(r.minimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.min(r.minimum))}}},br=class{apply(t,e){const r=e;if(r.maximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.max(r.maximum))}}},yr=class{apply(t,e){const r=e;if(r.exclusiveMinimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMinimum=="number"?t.number=s.gt(r.exclusiveMinimum):t.number=!1)}}},xr=class{apply(t,e){const r=e;if(r.exclusiveMaximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMaximum=="number"?t.number=s.lt(r.exclusiveMaximum):t.number=!1)}}},vr=class{apply(t,e){const r=e;if(r.multipleOf!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.refine(n=>{if(r.multipleOf===0)return!1;const i=n/r.multipleOf,a=Math.round(i),l=Math.min(Math.abs(n)*Number.EPSILON*10,Math.abs(r.multipleOf)*Number.EPSILON*10);return Math.abs(i-a)<=l/Math.abs(r.multipleOf)},{message:`Must be a multiple of ${r.multipleOf}`}))}}},wr=class{apply(t,e){const r=e;e.type===void 0&&(r.minItems!==void 0||r.maxItems!==void 0||r.items!==void 0||r.prefixItems!==void 0)&&t.array===void 0&&(t.array=_(q()))}},Sr=class{apply(t,e){const r=e;r.minItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).min(r.minItems))}},jr=class{apply(t,e){const r=e;r.maxItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).max(r.maxItems))}},_r=class{apply(t,e){const r=e;if(t.array!==!1)if(Array.isArray(r.items))t.array=t.array||_(q());else if(r.items&&typeof r.items!="boolean"&&!r.prefixItems){const s=$(r.items);let n=_(s);if(t.array&&t.array instanceof nt){const i=t.array._def;i.checks&&i.checks.forEach(a=>{if(a._zod&&a._zod.def){const l=a._zod.def;l.check==="min_length"&&l.minimum!==void 0?n=n.min(l.minimum):l.check==="max_length"&&l.maximum!==void 0&&(n=n.max(l.maximum))}})}t.array=n}else typeof r.items=="boolean"&&r.items===!1?r.prefixItems?t.array=t.array||_(q()):t.array=_(q()).max(0):typeof r.items=="boolean"&&r.items===!0?t.array=t.array||_(q()):r.prefixItems&&(t.array=t.array||_(q()))}},Cr=class{apply(t,e){if(e.type!=="array")return;const r=e;if(!Array.isArray(r.items)||t.array===!1)return;const s=r.items.map(i=>$(i));let n;s.length===0?n=Ve([]):n=Ve(s),r.minItems!==void 0&&r.minItems>s.length&&(n=!1),r.maxItems!==void 0&&r.maxItems<s.length&&(n=!1),t.tuple=n,t.array=!1}},Er=class{apply(t,e){const r=e;t.object!==!1&&(r.properties||r.required||r.additionalProperties!==void 0)&&(t.object=t.object||p({}).passthrough())}},Nr=class{apply(t,e){const r=e;e.type===void 0&&(r.maxProperties!==void 0||r.minProperties!==void 0)&&t.object===void 0&&(t.object=p({}).passthrough())}},Or=class{apply(t,e){const r=e;if(r.maxProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length<=r.maxProperties,{message:`Object must have at most ${r.maxProperties} properties`})}}},Tr=class{apply(t,e){const r=e;if(r.minProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length>=r.minProperties,{message:`Object must have at least ${r.minProperties} properties`})}}};function ge(t,e){if(t===e)return!0;if(t==null||e==null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((r,s)=>ge(r,e[s]));if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(n=>s.includes(n)&&ge(t[n],e[n]))}return!1}function kr(){return t=>{if(!Array.isArray(t))return!0;const e=[];return t.every(r=>e.some(n=>ge(r,n))?!1:(e.push(r),!0))}}function Se(t,e){return t.safeParse(e).success}var Ir=class{apply(t,e){if(!e.not)return t;const r=$(e.not);return t.refine(s=>!Se(r,s),{message:"Value must not match the 'not' schema"})}},Pr=class{apply(t,e){return e.uniqueItems!==!0?t:t.refine(kr(),{message:"Array items must be unique"})}},Mr=class{apply(t,e){return!e.allOf||e.allOf.length===0?t:e.allOf.map(s=>$(s)).reduce((s,n)=>Ke(s,n),t)}},Ar=class{apply(t,e){if(!e.anyOf||e.anyOf.length===0)return t;const r=e.anyOf.length===1?$(e.anyOf[0]):pe([$(e.anyOf[0]),$(e.anyOf[1]),...e.anyOf.slice(2).map(s=>$(s))]);return Ke(t,r)}},Rr=class{apply(t,e){if(!e.oneOf||e.oneOf.length===0)return t;const r=e.oneOf.map(s=>$(s));return t.refine(s=>{let n=0;for(const i of r)if(i.safeParse(s).success&&(n++,n>1))return!1;return n===1},{message:"Value must match exactly one of the oneOf schemas"})}},Lr=class{apply(t,e){const r=e;if(r.prefixItems&&Array.isArray(r.prefixItems)){const n=r.prefixItems.map(i=>$(i));return t.refine(i=>{if(!Array.isArray(i))return!0;for(let a=0;a<Math.min(i.length,n.length);a++)if(!Se(n[a],i[a]))return!1;if(i.length>n.length){if(typeof r.items=="boolean"&&r.items===!1)return!1;if(r.items&&typeof r.items=="object"&&!Array.isArray(r.items)){const a=$(r.items);for(let l=n.length;l<i.length;l++)if(!Se(a,i[l]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return t}},Hr=class{apply(t,e){const r=e;if(!r.properties&&!r.required&&r.additionalProperties!==!1)return t;if(t instanceof ot||t instanceof at){const s={};if(r.properties)for(const[n,i]of Object.entries(r.properties))i!==void 0&&(s[n]=$(i));if(r.required&&Array.isArray(r.required)){const n=new Set(r.required);for(const i of Object.keys(s))n.has(i)||(s[i]=s[i].optional())}else for(const n of Object.keys(s))s[n]=s[n].optional();return r.additionalProperties===!1?p(s):p(s).passthrough()}return t.refine(s=>{if(typeof s!="object"||s===null||Array.isArray(s))return!0;if(r.properties){for(const[n,i]of Object.entries(r.properties))if(i!==void 0&&Object.getOwnPropertyDescriptor(s,n)!==void 0&&!$(i).safeParse(s[n]).success)return!1}if(r.required&&Array.isArray(r.required)){for(const n of r.required)if(!(Object.getOwnPropertyDescriptor(s,n)!==void 0))return!1}if(r.additionalProperties===!1&&r.properties){const n=new Set(Object.keys(r.properties));for(const i in s)if(!n.has(i))return!1}return!0},{message:"Object constraints validation failed"})}},Ur=class{apply(t,e){if(!e.enum||e.enum.length===0)return t;const r=e.enum.filter(s=>Array.isArray(s)||typeof s=="object"&&s!==null);return r.length===0?t:t.refine(s=>typeof s!="object"||s===null?!0:r.some(n=>ge(s,n)),{message:"Value must match one of the enum values"})}},$r=class{apply(t,e){if(e.const===void 0)return t;const r=e.const;return typeof r!="object"||r===null?t:t.refine(s=>ge(s,r),{message:"Value must equal the const value"})}},Fr=class{apply(t,e){return e.description&&(t=t.describe(e.description)),t}},Br=class{apply(t,e){var r;const s=e;return!((r=s.required)!=null&&r.includes("__proto__"))||e.type!==void 0?t:q().refine(n=>this.validateRequired(n,s.required),{message:"Missing required properties"})}validateRequired(t,e){return typeof t!="object"||t===null||Array.isArray(t)?!0:e.every(r=>Object.prototype.hasOwnProperty.call(t,r))}},Dr=class{apply(t,e){var r;const s=e;if(s.contains===void 0)return t;const n=$(s.contains),i=(r=s.minContains)!=null?r:1,a=s.maxContains;return t.refine(l=>{if(!Array.isArray(l))return!0;let d=0;for(const u of l)Se(n,u)&&d++;return!(d<i||a!==void 0&&d>a)},{message:"Array must contain required items matching the schema"})}},Vr=class{apply(t,e){const{default:r}=e;return r===void 0||!t.safeParse(r).success?t:t.default(r)}},Wr=[new cr,new ur,new lr,new dr,new fr,new wr,new Nr,new mr,new hr,new pr,new gr,new br,new yr,new xr,new vr,new Cr,new Sr,new jr,new _r,new Or,new Tr,new Er],qr=[new Br,new Ur,new $r,new Mr,new Ar,new Rr,new Lr,new Hr,new Dr,new Ir,new Pr,new Vr,new Fr];function $(t){if(typeof t=="boolean")return t?q():De();const e={};for(const n of Wr)n.apply(e,t);const r=[];if(e.string!==!1&&r.push(e.string||c()),e.number!==!1&&r.push(e.number||A()),e.boolean!==!1&&r.push(e.boolean||Y()),e.null!==!1&&r.push(e.null||Le()),e.array!==!1&&r.push(e.array||_(q())),e.tuple!==!1&&e.tuple!==void 0&&r.push(e.tuple),e.object!==!1)if(e.object)r.push(e.object);else{const n=it(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"Must be an object, not an array");r.push(n)}e.file!==!1&&e.file!==void 0&&r.push(e.file);let s;r.length===0?s=De():r.length===1?s=r[0]:Object.keys(t).some(i=>i!=="$schema"&&i!=="title"&&i!=="description")?s=pe(r):s=q();for(const n of qr)s=n.apply(s,t);return s}class qe extends Event{constructor(e,r){var s,n;super(e),this.code=(s=r?.code)!=null?s:void 0,this.message=(n=r?.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,s){return s(ze(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(ze(this),r)}}function zr(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function Oe(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(Oe).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${Oe(t.cause)}`:t.message:`${t}`}function ze(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var tt=t=>{throw TypeError(t)},Fe=(t,e,r)=>e.has(t)||tt("Cannot "+r),v=(t,e,r)=>(Fe(t,e,"read from private field"),r?r.call(t):e.get(t)),H=(t,e,r)=>e.has(t)?tt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),T=(t,e,r,s)=>(Fe(t,e,"write to private field"),e.set(t,r),r),J=(t,e,r)=>(Fe(t,e,"access private method"),r),D,X,se,ve,je,me,oe,he,Q,ne,ae,ie,de,z,Te,ke,Ie,Ge,Pe,Me,fe,Ae,Re;class we extends EventTarget{constructor(e,r){var s,n;super(),H(this,z),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,H(this,D),H(this,X),H(this,se),H(this,ve),H(this,je),H(this,me),H(this,oe),H(this,he,null),H(this,Q),H(this,ne),H(this,ae,null),H(this,ie,null),H(this,de,null),H(this,ke,async i=>{var a;v(this,ne).reset();const{body:l,redirected:d,status:u,headers:m}=i;if(u===204){J(this,z,fe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?T(this,se,new URL(i.url)):T(this,se,void 0),u!==200){J(this,z,fe).call(this,`Non-200 status code (${u})`,u);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){J(this,z,fe).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(v(this,D)===this.CLOSED)return;T(this,D,this.OPEN);const f=new Event("open");if((a=v(this,de))==null||a.call(this,f),this.dispatchEvent(f),typeof l!="object"||!l||!("getReader"in l)){J(this,z,fe).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,x=l.getReader();let y=!0;do{const{done:b,value:w}=await x.read();w&&v(this,ne).feed(h.decode(w,{stream:!b})),b&&(y=!1,v(this,ne).reset(),J(this,z,Ae).call(this))}while(y)}),H(this,Ie,i=>{T(this,Q,void 0),!(i.name==="AbortError"||i.type==="aborted")&&J(this,z,Ae).call(this,Oe(i))}),H(this,Pe,i=>{typeof i.id=="string"&&T(this,he,i.id);const a=new MessageEvent(i.event||"message",{data:i.data,origin:v(this,se)?v(this,se).origin:v(this,X).origin,lastEventId:i.id||""});v(this,ie)&&(!i.event||i.event==="message")&&v(this,ie).call(this,a),this.dispatchEvent(a)}),H(this,Me,i=>{T(this,me,i)}),H(this,Re,()=>{T(this,oe,void 0),v(this,D)===this.CONNECTING&&J(this,z,Te).call(this)});try{if(e instanceof URL)T(this,X,e);else if(typeof e=="string")T(this,X,new URL(e,Gr()));else throw new Error("Invalid URL")}catch{throw zr("An invalid or illegal string was specified")}T(this,ne,bt({onEvent:v(this,Pe),onRetry:v(this,Me)})),T(this,D,this.CONNECTING),T(this,me,3e3),T(this,je,(s=r?.fetch)!=null?s:globalThis.fetch),T(this,ve,(n=r?.withCredentials)!=null?n:!1),J(this,z,Te).call(this)}get readyState(){return v(this,D)}get url(){return v(this,X).href}get withCredentials(){return v(this,ve)}get onerror(){return v(this,ae)}set onerror(e){T(this,ae,e)}get onmessage(){return v(this,ie)}set onmessage(e){T(this,ie,e)}get onopen(){return v(this,de)}set onopen(e){T(this,de,e)}addEventListener(e,r,s){const n=r;super.addEventListener(e,n,s)}removeEventListener(e,r,s){const n=r;super.removeEventListener(e,n,s)}close(){v(this,oe)&&clearTimeout(v(this,oe)),v(this,D)!==this.CLOSED&&(v(this,Q)&&v(this,Q).abort(),T(this,D,this.CLOSED),T(this,Q,void 0))}}D=new WeakMap,X=new WeakMap,se=new WeakMap,ve=new WeakMap,je=new WeakMap,me=new WeakMap,oe=new WeakMap,he=new WeakMap,Q=new WeakMap,ne=new WeakMap,ae=new WeakMap,ie=new WeakMap,de=new WeakMap,z=new WeakSet,Te=function(){T(this,D,this.CONNECTING),T(this,Q,new AbortController),v(this,je)(v(this,X),J(this,z,Ge).call(this)).then(v(this,ke)).catch(v(this,Ie))},ke=new WeakMap,Ie=new WeakMap,Ge=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...v(this,he)?{"Last-Event-ID":v(this,he)}:void 0},cache:"no-store",signal:(t=v(this,Q))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Pe=new WeakMap,Me=new WeakMap,fe=function(t,e){var r;v(this,D)!==this.CLOSED&&T(this,D,this.CLOSED);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s)},Ae=function(t,e){var r;if(v(this,D)===this.CLOSED)return;T(this,D,this.CONNECTING);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s),T(this,oe,setTimeout(v(this,Re),v(this,me)))},Re=new WeakMap,we.CONNECTING=0,we.OPEN=1,we.CLOSED=2;function Gr(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}class Jr extends Error{constructor(e,r,s){super(`SSE error: ${r}`),this.code=e,this.event=s}}class Zr{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=yt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new ue("No auth provider");let e;try{e=await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new ue;return await this._startOrAuth()}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=xt(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){const e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,s)=>{this._eventSource=new we(this._url.href,{...this._eventSourceInit,fetch:async(n,i)=>{const a=await this._commonHeaders();a.set("Accept","text/event-stream");const l=await e(n,{...i,headers:a});if(l.status===401&&l.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:u}=We(l);this._resourceMetadataUrl=d,this._scope=u}return l}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{if(n.code===401&&this._authProvider){this._authThenStart().then(r,s);return}const i=new Jr(n.code,n.message,n);s(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{const i=n;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(a){s(a),this.onerror?.(a),this.close();return}r()}),this._eventSource.onmessage=n=>{const i=n;let a;try{a=Ye.parse(JSON.parse(i.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(a)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new ue("No auth provider");if(await Ne(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{const r=await this._commonHeaders();r.set("content-type","application/json");const s={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._endpoint,s);if(!n.ok){const i=await n.text().catch(()=>null);if(n.status===401&&this._authProvider){const{resourceMetadataUrl:a,scope:l}=We(n);if(this._resourceMetadataUrl=a,this._scope=l,await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${i}`)}await n.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}}const Kr="mcp";class Yr{constructor(e){this._url=e}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._socket=new WebSocket(this._url,Kr),this._socket.onerror=s=>{const n="error"in s?s.error:new Error(`WebSocket error: ${JSON.stringify(s)}`);r(n),this.onerror?.(n)},this._socket.onopen=()=>{e()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=s=>{let n;try{n=Ye.parse(JSON.parse(s.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(n)}})}async close(){this._socket?.close()}send(e){return new Promise((r,s)=>{if(!this._socket){s(new Error("Not connected"));return}this._socket?.send(JSON.stringify(e)),r()})}}class Qr extends vt{constructor(e,r){super(e,r)}send(e,r){const s=Xr(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,r)}}function Xr(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const r=e?.params?.protocolVersion;return r?{type:"emit",message:{result:{protocolVersion:r,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class es extends wt{constructor(e,r){super(e,{jsonSchemaValidator:ar,...r})}async listTools(e,r){return await this.request({method:"tools/list",params:e},ct,r)}}const ts=async(t,e,r)=>{const s=rs(t.connection,e,r);if(!s)throw new Error("Unknown MCP connection type");const n=new es({name:t?.name??"MCP Client",version:"1.0.0"});return await n.connect(s),{client:n}},rs=(t,e,r)=>{if(t.type==="Websocket")return new Yr(new URL(t.url));if(t.type!=="SSE"&&t.type!=="HTTP")return null;const n={...t.token?{authorization:`Bearer ${t.token}`}:{},...r??{},..."headers"in t?t.headers||{}:{}};if(t.type==="SSE"){const i={requestInit:{headers:n,signal:e}};return t.token&&(i.eventSourceInit={fetch:(a,l)=>fetch(a,{...l,headers:{...n,Accept:"text/event-stream"},signal:e})}),new Zr(new URL(t.url),i)}return new Qr(new URL(t.url),{requestInit:{headers:n,signal:e,credentials:"include"}})},Je=t=>{try{return JSON.parse(t)}catch{return t}},ye=new Map,Ze=(t,e)=>({...t,id:t.name,inputSchema:t.inputSchema?$(t.inputSchema):void 0,outputSchema:t.outputSchema?$(t.outputSchema):void 0,execute:r=>e(r.context,t.name)});function ss(t){const e=r=>"connection"in t?ts({connection:t.connection},void 0,r):t.client;return new Proxy({},{get(r,s){if(s==="toJSON")return null;if(typeof s!="string")throw new Error("Name must be a string");if(s==="listTools")return l;async function n(d,u=s){const m=t?.debugId?.(),f=m?{"x-trace-debug-id":m}:void 0,{client:h}=await e(f),{structuredContent:x,isError:y,content:b}=await h.callTool({name:String(u),arguments:d});if(y){const S=b?.[0]?.text,g=typeof S=="string"?Je(S):null,O=g?.code&&typeof t?.getErrorByStatusCode=="function"?t.getErrorByStatusCode(g.code,g.message,g.traceId):null;throw O||new Error(`Tool ${String(u)} returned an error: ${JSON.stringify(x??b)}`)}if(x!==void 0)return x;const w=b?.[0]?.text;return typeof w=="string"?Je(w):void 0}async function i(){const{client:d}=await e(),{tools:u}=await d.listTools();return u}async function a(){if(!("connection"in t))return i();const d=t.connection,u=JSON.stringify(d);try{return ye.has(u)||ye.set(u,i()),await ye.get(u)}catch(m){console.error("Failed to list tools",m),ye.delete(u);return}}async function l(){return(await a()??[]).map(u=>Ze(u,n))}return n.asTool=async()=>{const u=(await a()??[]).find(m=>m.name===s);if(!u)throw new Error(`Tool ${s} not found`);return Ze(u,n)},n}})}new Proxy({},{get(t,e){return e==="toJSON"?null:e==="forConnection"?r=>ns({connection:r}):global[e]}});function ns(t){return ss(t)}function is(t){return{isImplementedBy:e=>{for(const r of t){const s=typeof r.name=="string"?new RegExp(`^${r.name}$`):r.name,n=e.find(i=>s.test(i.name));if(!(!n&&r.opt)&&!n)return!1}return!0}}}const os=p({id:c().describe("Unique identifier for the entity"),title:c().describe("Human-readable title for the entity"),description:c().nullish().describe("Description of the entity"),created_at:c().datetime(),updated_at:c().datetime(),created_by:c().optional(),updated_by:c().optional()}),as=p({field:_(c()),operator:ee(["eq","gt","gte","lt","lte","in","like","contains"]),value:Z()}),rt=ut(()=>pe([as,p({operator:ee(["and","or","not"]),conditions:_(rt)})])),ls=p({field:_(c()),direction:ee(["asc","desc"]),nulls:ee(["first","last"]).optional()}),cs=p({where:rt.optional().describe("Filter expression"),orderBy:_(ls).optional().describe("Sort expressions"),limit:A().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:A().int().min(0).optional().describe("Number of items to skip")});function us(t){return p({items:_(t).describe("Array of collection items"),totalCount:A().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:Y().optional().describe("Whether there are more items available")})}const ds=p({id:c().describe("ID of the entity to retrieve")});function fs(t){return p({item:t.nullable().describe("The retrieved item, or null if not found")})}p({id:c().describe("ID of the entity to delete")});function ms(t,e,r){const s=t.toUpperCase();return[{name:`COLLECTION_${s}_LIST`,inputSchema:cs,outputSchema:us(e)},{name:`COLLECTION_${s}_GET`,inputSchema:ds,outputSchema:fs(e)}]}const hs=p({id:c(),name:c(),description:c().optional(),inputSchema:K(c(),Z()),outputSchema:K(c(),Z()).optional()}),ps=os.extend({_meta:p({"io.decocms":p({id:c(),verified:Y(),scopeName:c(),appName:c(),friendlyName:c().nullable().optional(),metadata:K(c(),Z()).nullable().optional(),publishedAt:c().datetime().optional(),updatedAt:c().datetime().optional(),tools:_(hs).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:p({$schema:c().optional(),_meta:K(c(),Z()).optional(),name:c().describe("The server name (scope/app)"),title:c().optional().describe("User-friendly title"),description:c().optional().describe("Server description"),icons:_(p({src:c(),mimeType:c().optional(),sizes:_(c()).optional(),theme:ee(["light","dark"]).optional()})).optional(),remotes:_(p({type:ee(["http","stdio","sse"]),url:c().optional(),headers:_(Z()).optional()})).optional(),packages:_(Z()).optional(),repository:p({url:c(),source:c().optional(),subfolder:c().optional()}).optional(),version:c().optional(),websiteUrl:c().optional()})});ms("registry_app",ps);const gs=p({specversion:G("1.0").describe("CloudEvents specification version"),id:c().describe("Unique identifier for this event (UUID recommended)"),source:c().describe("Connection ID of the event publisher"),type:c().describe("Event type (e.g., 'order.created', 'user.signup')"),time:c().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:c().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:c().optional().default("application/json").describe("Content type of the data attribute"),dataschema:c().url().optional().describe("URI to the schema for the data attribute"),data:Z().optional().describe("Event payload (any JSON value)")});p({events:_(gs).min(1).describe("Batch of CloudEvents to process")});const bs=p({success:Y().optional().describe("Whether this event was processed successfully"),error:c().optional().describe("Error message for this event"),retryAfter:A().int().positive().optional().describe("Re-deliver this event after this many ms")});p({success:Y().optional().describe("Batch success - applies to events not in results"),error:c().optional().describe("Batch error message - applies to events not in results"),processedCount:A().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:A().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:K(c(),bs).optional().describe("Per-event results keyed by event ID")});const ys=p({type:G("string"),enum:_(c()).optional(),description:c().optional()}),xs=p({type:c(),description:c(),paramsSchema:K(c(),ys)});p({});p({triggers:_(xs)});p({type:c(),params:K(c(),c()),enabled:Y(),callbackUrl:dt().optional(),callbackToken:c().min(1).optional()});p({success:Y()});p({prefix:c().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:A().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:c().optional().describe("Token for pagination from previous response"),delimiter:c().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});p({objects:_(p({key:c().describe("Object key/path"),size:A().describe("Object size in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object")})),nextContinuationToken:c().optional().describe("Token for fetching next page of results"),isTruncated:Y().describe("Whether there are more results available"),commonPrefixes:_(c()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});p({key:c().describe("Object key/path to get metadata for")});p({contentType:c().optional().describe("MIME type of the object"),contentLength:A().describe("Size of the object in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object"),metadata:K(c(),c()).optional().describe("Custom metadata key-value pairs")});p({key:c().describe("Object key/path to generate URL for"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});p({url:c().describe("Presigned URL for downloading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path for the upload"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:c().optional().describe("MIME type for the object being uploaded")});p({url:c().describe("Presigned URL for uploading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path to delete")});p({success:Y().describe("Whether the deletion was successful"),key:c().describe("The key that was deleted")});p({keys:_(c()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});p({deleted:_(c()).describe("Array of successfully deleted keys"),errors:_(p({key:c(),message:c()})).describe("Array of errors for failed deletions")});const vs=p({primary:c().optional().describe("Primary brand color (hex)"),secondary:c().optional().describe("Secondary brand color (hex)"),accent:c().optional().describe("Accent / highlight color (hex)"),background:c().optional().describe("Background color (hex)"),foreground:c().optional().describe("Foreground / text color (hex)")}),ws=p({heading:c().optional().describe("Font family for headings"),body:c().optional().describe("Font family for body text"),code:c().optional().describe("Font family for code / monospace")}),Ss=p({logo:c().optional().describe("Logo URL"),favicon:c().optional().describe("Favicon URL"),ogImage:c().optional().describe("Open Graph image URL")}),js=p({id:c(),name:c().describe("Brand / company name"),domain:c().optional().describe("Company domain (e.g. example.com)"),colors:vs.optional().describe("Semantic color palette"),fonts:ws.optional().describe("Font families by role"),assets:Ss.optional().describe("Visual identity assets"),overview:c().optional().describe("Company overview / description"),tagline:c().optional().describe("Brand tagline"),tone:c().optional().describe("Tone of voice description"),metadata:K(c(),Z()).optional().describe("Extra design tokens and metadata")});p({id:c().optional().describe("Brand ID. Omit to get the default brand.")});p({});p({items:_(js)});const _s={"@deco/llm":"LLMS","@deco/trigger":"TRIGGER","@deco/object-storage":"OBJECT_STORAGE","@deco/brand":"BRAND"};function Cs(t){if(t)return _s[t]}function Cn(t,e){const r=t.tools;if(!r||r.length===0)return!1;const s=r.map(a=>({name:a.name,inputSchema:a.inputSchema})),n=e.map(a=>({name:a.name,inputSchema:a.inputSchema,opt:a.opt}));return is(n).isImplementedBy(s)}const Be=F.createContext(null);function En(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.tabsEl)return null;let n;return e[0]!==r||e[1]!==s.tabsEl?(n=Qe.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=n):n=e[2],n}function Es(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.actionsEl)return null;let n;return e[0]!==r||e[1]!==s.actionsEl?(n=Qe.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=n):n=e[2],n}const Nn=Es;function On(t){const e=U.c(21),{children:r,breadcrumb:s,hideHeader:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={leftEl:null,tabsEl:null,actionsEl:null},e[0]=i):i=e[0];const[a,l]=F.useState(i),d=F.useRef(null),u=F.useRef(null),m=F.useRef(null);let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=j=>{d.current=j,j&&l(C=>C.leftEl===j?C:{...C,leftEl:j})},e[1]=f):f=e[1];const h=f;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=j=>{u.current=j,j&&l(C=>C.tabsEl===j?C:{...C,tabsEl:j})},e[2]=x):x=e[2];const y=x;let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=j=>{m.current=j,j&&l(C=>C.actionsEl===j?C:{...C,actionsEl:j})},e[3]=b):b=e[3];const w=b,S=n&&"hidden";let g;e[4]!==S?(g=_e(S),e[4]=S,e[5]=g):g=e[5];let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx("div",{ref:h,className:"flex items-center gap-2 min-w-0"}),e[6]=O):O=e[6];let R;e[7]!==s?(R=o.jsxs(ce.Header.Left,{children:[s,O]}),e[7]=s,e[8]=R):R=e[8];let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsxs(ce.Header.Right,{children:[o.jsx("div",{ref:y,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),o.jsx("div",{ref:w,className:"flex items-center gap-2 shrink-0"})]}),e[9]=L):L=e[9];let k;e[10]!==g||e[11]!==R?(k=o.jsxs(ce.Header,{className:g,children:[R,L]}),e[10]=g,e[11]=R,e[12]=k):k=e[12];let I;e[13]!==r?(I=o.jsx(ce.Content,{children:r}),e[13]=r,e[14]=I):I=e[14];let P;e[15]!==k||e[16]!==I?(P=o.jsxs(ce,{children:[k,I]}),e[15]=k,e[16]=I,e[17]=P):P=e[17];let N;return e[18]!==a||e[19]!==P?(N=o.jsx(Be,{value:a,children:P}),e[18]=a,e[19]=P,e[20]=N):N=e[20],N}function Ns(t){return t.startsWith("@")?t:`@${t}`}function Os(){const{org:t}=Ue(),{data:e}=ft.useSession(),r=Nt(),s=At(),n=Rt(),i=s.filter(l=>n(l.id));return{installByBinding:async l=>{if(!t||!e?.user?.id){xe.error("Not authenticated");return}const d=Ns(l),m=(await Promise.all(i.map(async b=>{const w=kt(b.id,t.id);try{const S=await It(b.id,t.id,t.slug,w,{where:{appName:d}});return Pt(S??[])[0]??null}catch{return null}}))).find(b=>b!==null);if(!m){xe.error(`MCP Server not found in registry: ${l}`);return}const f=Mt(m,t.id,e.user.id),h=f.connection_type==="STDIO",x=!!f.connection_url,y=h&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!x&&!y){xe.error("This MCP Server cannot be connected: no connection method available");return}return await r.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:r.create.isPending}}function Ts(t){const e=U.c(21),{virtualMcp:r,isSelected:s}=t,n=s&&"bg-accent";let i;e[0]!==n?(i=_e("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==r.icon||e[3]!==r.title?(a=o.jsx(et,{icon:r.icon,name:r.title,size:"sm"}),e[2]=r.icon,e[3]=r.title,e[4]=a):a=e[4];let l;e[5]!==r.title?(l=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.title}),e[5]=r.title,e[6]=l):l=e[6];let d;e[7]!==s?(d=s&&o.jsx(er,{size:16,className:"text-foreground shrink-0"}),e[7]=s,e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==d?(u=o.jsxs("div",{className:"flex items-center justify-between",children:[l,d]}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let m;e[12]!==r.description?(m=r.description&&o.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:r.description}),e[12]=r.description,e[13]=m):m=e[13];let f;e[14]!==u||e[15]!==m?(f=o.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[u,m]}),e[14]=u,e[15]=m,e[16]=f):f=e[16];let h;return e[17]!==i||e[18]!==a||e[19]!==f?(h=o.jsxs("div",{className:i,children:[a,f]}),e[17]=i,e[18]=a,e[19]=f,e[20]=h):h=e[20],h}function ks(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx($e,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function Is(t){const e=U.c(33),{selectedVirtualMcpId:r,onVirtualMcpChange:s,searchInputRef:n}=t,i=Xt(),[a,l]=F.useState(""),d=F.useRef(null),u=n??d;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={navigateOnCreate:!0},e[0]=m):m=e[0];const{createVirtualMCP:f,isCreating:h}=sr(m);let x,y,b,w;if(e[1]!==f||e[2]!==u||e[3]!==h||e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==i){let O;e:{const E=i.filter(Ps);if(!a.trim()){O=E;break e}const M=a.toLowerCase();O=E.filter(B=>B.title.toLowerCase().includes(M)||B.description?.toLowerCase().includes(M))}const R=O;let L;e[12]!==s?(L=E=>{s(E),l("")},e[12]=s,e[13]=L):L=e[13];const k=L;b="flex flex-col max-h-[min(400px,60dvh)]";let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(tr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[14]=I):I=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=E=>l(E.target.value),e[15]=P):P=e[15];let N;e[16]!==u||e[17]!==a?(N=o.jsx(Wt,{ref:u,type:"text",placeholder:"Search for an agent...",value:a,onChange:P,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[16]=u,e[17]=a,e[18]=N):N=e[18];const j=h?"Creating...":"Create Agent";let C;e[19]!==f||e[20]!==h||e[21]!==j?(C=o.jsx(Ce,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:h,children:j}),e[19]=f,e[20]=h,e[21]=j,e[22]=C):C=e[22],e[23]!==N||e[24]!==C?(w=o.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:o.jsxs("div",{className:"relative flex items-center gap-2",children:[I,N,C]})}),e[23]=N,e[24]=C,e[25]=w):w=e[25],x="overflow-y-auto p-1.5 flex-1 min-h-0 [touch-action:pan-y]",y=R.length>0?o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-0.5",children:R.map(E=>o.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(E.id),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),k(E.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:o.jsx(Ts,{virtualMcp:E,isSelected:E.id===r})},E.id))}):o.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[1]=f,e[2]=u,e[3]=h,e[4]=s,e[5]=a,e[6]=r,e[7]=i,e[8]=x,e[9]=y,e[10]=b,e[11]=w}else x=e[8],y=e[9],b=e[10],w=e[11];let S;e[26]!==x||e[27]!==y?(S=o.jsx("div",{className:x,children:y}),e[26]=x,e[27]=y,e[28]=S):S=e[28];let g;return e[29]!==b||e[30]!==w||e[31]!==S?(g=o.jsxs("div",{className:b,children:[w,S]}),e[29]=b,e[30]=w,e[31]=S,e[32]=g):g=e[32],g}function Ps(t){return!t.id||!St(t.id)}function Ms(t){const e=U.c(3);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(ks,{}),e[0]=r):r=e[0];let s;return e[1]!==t?(s=o.jsx(F.Suspense,{fallback:r,children:o.jsx(Is,{...t})}),e[1]=t,e[2]=s):s=e[2],s}function As(t){const e=U.c(32),{selectedVirtualMcpId:r,selectedVirtualMcp:s,onVirtualMcpChange:n,className:i,placeholder:a,showTooltip:l,disabled:d}=t,u=a===void 0?"Select Agent":a,m=l===void 0?!0:l,f=d===void 0?!1:d,[h,x]=F.useState(!1),y=F.useRef(null);let b;e[0]!==n?(b=W=>{n(W),x(!1)},e[0]=n,e[1]=b):b=e[1];const w=b,S=Jt();let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=W=>{x(W)},e[2]=g):g=e[2];const O=g;let R,L;e[3]!==S||e[4]!==h?(R=()=>{h&&!S&&setTimeout(()=>{y.current?.focus()},0)},L=[h,S],e[3]=S,e[4]=h,e[5]=R,e[6]=L):(R=e[5],L=e[6]),F.useEffect(R,L);const k=f?!1:h,I=f?void 0:O,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:text-muted-foreground";let N;e[7]!==i||e[8]!==P?(N=_e("relative flex items-center justify-center size-8 rounded-lg text-muted-foreground/75 transition-colors shrink-0",P,i),e[7]=i,e[8]=P,e[9]=N):N=e[9];let j;e[10]!==s?(j=s?o.jsx(et,{icon:s.icon,name:s.title,size:"sm",className:"absolute inset-0 size-full"}):o.jsxs(o.Fragment,{children:[o.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"agent-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[o.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),o.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),o.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),o.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"7.5",stroke:"url(#agent-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),o.jsx(rr,{size:16})]}),e[10]=s,e[11]=j):j=e[11];let C;e[12]!==f||e[13]!==u||e[14]!==N||e[15]!==j?(C=o.jsx(Kt,{asChild:!0,children:o.jsx(qt,{asChild:!0,children:o.jsx("button",{type:"button",disabled:f,className:N,"aria-label":u,children:j})})}),e[12]=f,e[13]=u,e[14]=N,e[15]=j,e[16]=C):C=e[16];let E;e[17]!==h||e[18]!==s?.title||e[19]!==m?(E=m&&!h&&o.jsx(Zt,{side:"top",className:"text-xs",children:s?.title??"Choose an agent to chat with"}),e[17]=h,e[18]=s?.title,e[19]=m,e[20]=E):E=e[20];let M;e[21]!==C||e[22]!==E?(M=o.jsx(Yt,{children:o.jsxs(Qt,{children:[C,E]})}),e[21]=C,e[22]=E,e[23]=M):M=e[23];let B;e[24]!==w||e[25]!==r?(B=o.jsx(zt,{className:"w-[min(550px,calc(100vw-2rem))] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,collisionPadding:16,children:o.jsx(Ms,{selectedVirtualMcpId:r,onVirtualMcpChange:w,searchInputRef:y})}),e[24]=w,e[25]=r,e[26]=B):B=e[26];let V;return e[27]!==M||e[28]!==B||e[29]!==k||e[30]!==I?(V=o.jsxs(Gt,{open:k,onOpenChange:I,children:[M,B]}),e[27]=M,e[28]=B,e[29]=k,e[30]=I,e[31]=V):V=e[31],V}function Rs(t){const e=t.properties;if(!e)return!1;const r=e.__type,s=e.__binding;return!!(r?.const||s?.const)}function Ls(t){const e=t.properties;if(!e)return{};const r=e.__type,s=e.__binding;return{bindingType:r?.const,bindingSchema:s?.const}}function Hs(t){const e=U.c(10),{bindingSchema:r,bindingType:s,currentValue:n,onValueChange:i,placeholder:a,onAddNew:l,className:d}=t;let u;e[0]!==s?(u=Cs(s),e[0]=s,e[1]=u):u=e[1];const f=u??(typeof r=="string"?r:r??void 0);let h;return e[2]!==s||e[3]!==d||e[4]!==n||e[5]!==l||e[6]!==i||e[7]!==a||e[8]!==f?(h=o.jsx(Us,{value:n,onValueChange:i,placeholder:a,binding:f,bindingType:s,onAddNew:l,className:d}),e[2]=s,e[3]=d,e[4]=n,e[5]=l,e[6]=i,e[7]=a,e[8]=f,e[9]=h):h=e[9],h}function Us({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:s,bindingType:n,onAddNew:i,className:a}){const[l,d]=F.useState(!1),{installByBinding:u,isInstalling:m}=Os(),f=l||m,h=s?void 0:n||void 0,x=Ot(s?{binding:s}:h?{filters:[{column:"app_name",value:h}]}:{}),y=Tt(t&&!x.some(g=>g.id===t)?t:void 0),b=y?[y,...x]:x,w=n?.startsWith("@"),S=async()=>{if(w&&n){d(!0);try{const g=await u(n);g&&e(g.id)}catch(g){const O=g instanceof Error?g.message:String(g);xe.error(`Failed to connect MCP: ${O}`)}finally{d(!1)}return}i?.()};return o.jsxs(Ht,{value:t,onValueChange:e,children:[o.jsx(Ut,{size:"sm",className:_e("w-[200px]",a),children:o.jsx($t,{placeholder:r})}),o.jsxs(Ft,{children:[b.length===0?o.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):b.map(g=>o.jsx(Bt,{value:g.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?o.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded"}):o.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:g.title.slice(0,1).toUpperCase()}),o.jsx("span",{children:g.title})]})},g.id)),(i||w)&&o.jsx("div",{className:"border-t border-border",children:o.jsx(Ce,{onClick:g=>{g.preventDefault(),g.stopPropagation(),S()},disabled:f,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?o.jsxs(o.Fragment,{children:[o.jsx($e,{size:16,className:"animate-spin"}),o.jsx("span",{children:"Connecting..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Lt,{size:16}),o.jsx("span",{children:"Custom Connection"})]})})})]})]})}function $s(t){const e=U.c(49),{schema:r,formData:s,title:n,description:i,registry:a}=t,l=a.formContext,d=n||"",u=n||"";if(Rs(r)){const h=r;let x;e[0]!==h?(x=Ls(h),e[0]=h,e[1]=x):x=e[1];const{bindingType:y,bindingSchema:b}=x,S=(l?.formData?.[d]?.value??s?.value)||"";let g;e[2]!==y||e[3]!==d||e[4]!==l||e[5]!==s?(g=V=>{const W={...s,value:V??"",...y&&{__type:y}};l?.onFieldChange(d,W)},e[2]=y,e[3]=d,e[4]=l,e[5]=s,e[6]=g):g=e[6];const O=g,R=Bs;let L;e[7]!==u||e[8]!==d||e[9]!==n?(L=R(n||u||d),e[7]=u,e[8]=d,e[9]=n,e[10]=L):L=e[10];const k=L;if(y==="@deco/agent"){let V;e[11]!==k?(V=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[11]=k,e[12]=V):V=e[12];let W;e[13]!==i?(W=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[13]=i,e[14]=W):W=e[14];let te;e[15]!==V||e[16]!==W?(te=o.jsxs("div",{className:"flex-1 min-w-0",children:[V,W]}),e[15]=V,e[16]=W,e[17]=te):te=e[17];const Ee=S||void 0;let re;e[18]!==O||e[19]!==Ee?(re=o.jsx(As,{selectedVirtualMcpId:Ee,onVirtualMcpChange:O,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[18]=O,e[19]=Ee,e[20]=re):re=e[20];let be;return e[21]!==te||e[22]!==re?(be=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[te,re]}),e[21]=te,e[22]=re,e[23]=be):be=e[23],be}let I;e[24]!==k?(I=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[24]=k,e[25]=I):I=e[25];let P;e[26]!==i?(P=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[26]=i,e[27]=P):P=e[27];let N;e[28]!==I||e[29]!==P?(N=o.jsxs("div",{className:"flex-1 min-w-0",children:[I,P]}),e[28]=I,e[29]=P,e[30]=N):N=e[30];let j;e[31]!==k?(j=k.toLowerCase(),e[31]=k,e[32]=j):j=e[32];const C=`Select ${j}...`;let E;e[33]!==l?(E=()=>l?.onAddNew(),e[33]=l,e[34]=E):E=e[34];let M;e[35]!==b||e[36]!==y||e[37]!==S||e[38]!==O||e[39]!==C||e[40]!==E?(M=o.jsx(Hs,{bindingSchema:b,bindingType:y,currentValue:S,onValueChange:O,placeholder:C,onAddNew:E,className:"w-[200px] shrink-0"}),e[35]=b,e[36]=y,e[37]=S,e[38]=O,e[39]=C,e[40]=E,e[41]=M):M=e[41];let B;return e[42]!==M||e[43]!==N?(B=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,M]}),e[42]=M,e[43]=N,e[44]=B):B=e[44],B}let m;e[45]!==t.properties?(m=t.properties.map(Fs),e[45]=t.properties,e[46]=m):m=e[46];let f;return e[47]!==m?(f=o.jsx("div",{className:"flex flex-col gap-4",children:m}),e[47]=m,e[48]=f):f=e[48],f}function Fs(t){return t.content}function Bs(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,Ds)}function Ds(t){return t.toUpperCase()}function Vs(t){const e=U.c(13),{label:r,children:s,description:n,id:i,schema:a}=t;if(i.includes("__type")||i.includes("__binding"))return null;if(a.type==="object")return s;let l;e[0]!==i||e[1]!==r?(l=r&&o.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:i,children:r}),e[0]=i,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==n?(d=n&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:n}),e[3]=n,e[4]=d):d=e[4];let u;e[5]!==l||e[6]!==d?(u=o.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[5]=l,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==s?(m=o.jsx("div",{className:"w-[200px] shrink-0",children:s}),e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==u||e[11]!==m?(f=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[u,m]}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f}const Ws={ObjectFieldTemplate:$s,FieldTemplate:Vs};function qs(t){const e=U.c(19),{formKey:r,formState:s,onFormStateChange:n,stateSchema:i}=t,{org:a}=Ue(),l=mt();let d;e[0]!==n?(d=g=>{g.formData&&n(g.formData)},e[0]=n,e[1]=d):d=e[1];const u=d;let m;e[2]!==s||e[3]!==n?(m=(g,O)=>{const R={...s,[g]:O};n(R)},e[2]=s,e[3]=n,e[4]=m):m=e[4];const f=m;let h;e[5]!==l||e[6]!==a?(h=()=>{l({to:"/$org/settings/connections",params:{org:a.slug},search:{action:"create"}})},e[5]=l,e[6]=a,e[7]=h):h=e[7];const x=h;let y;e[8]!==s||e[9]!==x||e[10]!==f?(y={onFieldChange:f,formData:s,onAddNew:x},e[8]=s,e[9]=x,e[10]=f,e[11]=y):y=e[11];const b=y;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(o.Fragment,{}),e[12]=w):w=e[12];let S;return e[13]!==b||e[14]!==r||e[15]!==s||e[16]!==u||e[17]!==i?(S=o.jsx("div",{className:"flex flex-col h-full overflow-auto",children:o.jsx(Dt,{schema:i,validator:Vt,formData:s,onChange:u,formContext:b,liveValidate:!1,showErrorList:!1,templates:Ws,children:w},r)}),e[13]=b,e[14]=r,e[15]=s,e[16]=u,e[17]=i,e[18]=S):S=e[18],S}function zs(t){const e=U.c(14),{org:r}=Ue();let s;e[0]!==t||e[1]!==r.id||e[2]!==r.slug?(s={connectionId:t,orgId:r.id,orgSlug:r.slug},e[0]=t,e[1]=r.id,e[2]=r.slug,e[3]=s):s=e[3];const n=jt(s);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i={},e[4]=i):i=e[4];let a;e[5]!==n?(a={client:n,toolName:"MCP_CONFIGURATION",toolArguments:i,select:Gs},e[5]=n,e[6]=a):a=e[6];const{data:l}=_t(a);let d;e[7]!==l.stateSchema?(d=l.stateSchema??{type:"object",properties:{}},e[7]=l.stateSchema,e[8]=d):d=e[8];const u=d;let m;e[9]!==l.scopes?(m=l.scopes??[],e[9]=l.scopes,e[10]=m):m=e[10];const f=m;let h;return e[11]!==f||e[12]!==u?(h={stateSchema:u,scopes:f},e[11]=f,e[12]=u,e[13]=h):h=e[13],h}function Gs(t){return t.structuredContent??t}function Js(t){const e=U.c(4),{onAuthenticate:r,buttonText:s}=t,n=s===void 0?"Authenticate":s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=i):i=e[0];let a;return e[1]!==n||e[2]!==r?(a=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,o.jsx(Ce,{onClick:r,size:"default",children:n})]})}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Zs(t){const e=U.c(7),{hasReadme:r,onViewReadme:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(Et,{size:36,className:"text-muted-foreground"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Manual Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=i):i=e[1];let a;e[2]!==r||e[3]!==s?(a=r&&s&&o.jsxs(Ce,{onClick:s,variant:"outline",size:"lg",children:[o.jsx(Ct,{size:18,className:"mr-2"}),"View README"]}),e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;return e[5]!==a?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[n,i,a]})}),e[5]=a,e[6]=l):l=e[6],l}function Ks(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=r):r=t[1],r}function Ys(t){const e=U.c(12),{connection:r,form:s}=t,{stateSchema:n}=zs(r.id);let i;e[0]!==s.control?(i={control:s.control,name:"configuration_state"},e[0]=s.control,e[1]=i):i=e[1];const a=pt(i);let l;e[2]!==s?(l=h=>{s.setValue("configuration_state",h,{shouldDirty:!0})},e[2]=s,e[3]=l):l=e[3];const d=l;if(!(n&&n.properties&&typeof n.properties=="object"&&Object.keys(n.properties).length>0)){let h;return e[4]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[4]=h):h=e[4],h}let m;e[5]!==a?(m=a??{},e[5]=a,e[6]=m):m=e[6];let f;return e[7]!==r.id||e[8]!==d||e[9]!==n||e[10]!==m?(f=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(qs,{formKey:r.id,stateSchema:n,formState:m,onFormStateChange:d})}),e[7]=r.id,e[8]=d,e[9]=n,e[10]=m,e[11]=f):f=e[11],f}function Qs(t){const e=U.c(11),{connection:r,form:s,hasMcpBinding:n,isMCPAuthenticated:i,supportsOAuth:a,isServerError:l,onAuthenticate:d,onViewReadme:u}=t,f=!!r?.metadata?.repository?.url;if(!i){if(l){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ks,{}),e[0]=b):b=e[0],b}if(a){let b;return e[1]!==d?(b=o.jsx(Js,{onAuthenticate:d}),e[1]=d,e[2]=b):b=e[2],b}let y;return e[3]!==f||e[4]!==u?(y=o.jsx(Zs,{hasReadme:f,onViewReadme:u}),e[3]=f,e[4]=u,e[5]=y):y=e[5],y}if(!n){let y;return e[6]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=y):y=e[6],y}let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),e[7]=h):h=e[7];let x;return e[8]!==r||e[9]!==s?(x=o.jsx(ht,{children:o.jsx(F.Suspense,{fallback:h,children:o.jsx(Ys,{connection:r,form:s})})}),e[8]=r,e[9]=s,e[10]=x):x=e[10],x}function Tn(t){const e=U.c(2);let r;return e[0]!==t?(r=o.jsx("div",{className:"flex-1 flex h-full",children:o.jsx(Qs,{...t})}),e[0]=t,e[1]=r):r=e[1],r}export{Zs as M,Js as O,Tn as S,On as V,Nn as a,En as b,Cn as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,ag as R}from"./index-
|
|
1
|
+
import{r as a,ag as R}from"./index-CurNB2HG.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ne(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t){if(e==null)return{};var r,n,o=je(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function je(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Me(e,t){return me(e)||ye(e,t)||Ee(e,t)||we()}function Pe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Ee(e,t){if(e){if(typeof e=="string")return re(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ie(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function A(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function F(e){return{}.toString.call(e).includes("Object")}function Te(e){return!Object.keys(e).length}function D(e){return typeof e=="function"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Le(e,t){return F(t)||P("changeType"),Object.keys(t).some(function(r){return!Ce(e,r)})&&P("changeField"),t}function Ae(e){D(e)||P("selectorType")}function $e(e){D(e)||F(e)||P("handlerType"),F(e)&&Object.values(e).some(function(t){return!D(t)})&&P("handlersType")}function De(e){e||P("initialIsRequired"),F(e)||P("initialType"),Te(e)&&P("initialContent")}function Ve(e,t){throw new Error(e[t]||e.default)}var xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},P=A(Ve)(xe),q={changes:Le,selector:Ae,handler:$e,initial:De};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};q.initial(e),q.handler(t);var r={current:e},n=A(Fe)(r,t),o=A(ze)(r),i=A(q.changes)(e),c=A(qe)(r);function s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(j){return j};return q.selector(p),p(r.current)}function f(p){Ie(n,o,i,c)(p)}return[s,f]}function qe(e,t){return D(t)?t(e.current):t}function ze(e,t){return e.current=ae(ae({},e.current),t),t}function Fe(e,t,r){return D(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Ue={create:Ne},He={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function We(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||ue("configIsRequired"),Be(e)||ue("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(ce.deprecation)}function Ye(e,t){throw new Error(e[t]||e.default)}var ce={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,ai as L,a2 as B,j as d,bc as K,U as x,Z as E,ba as U,V as C,bb as _,Y as V,X as w,bK as q,bJ as T}from"./index-
|
|
1
|
+
import{r as s,ai as L,a2 as B,j as d,bc as K,U as x,Z as E,ba as U,V as C,bb as _,Y as V,X as w,bK as q,bJ as T}from"./index-CurNB2HG.js";var I="Radio",[z,P]=w(I),[H,X]=z(I),k=s.forwardRef((t,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:a,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((t,c)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=X(g,o);return d.jsx(V,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var Y="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:c,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=q(o),R=T(c);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=Y;function A(t){return t?"checked":"unchecked"}var J=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[W]=w(y,[_,P]),j=_(),N=P(),[Z,Q]=W(y),D=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Z,{scope:o,name:n,required:a,disabled:l,value:b,onValueChange:h,children:d.jsx(K,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Q(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{J.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(U,{asChild:!0,...l,focusable:!a,active:p,children:d.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return d.jsx(G,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as d,r as p,j as r}from"./index-
|
|
1
|
+
import{c as f,l as d,r as p,j as r}from"./index-CurNB2HG.js";import{m as w}from"./sidebar-DLCPSSnc.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,e as p,j as s,i as u,N as a}from"./index-
|
|
1
|
+
import{c as g,e as p,j as s,i as u,N as a}from"./index-CurNB2HG.js";import{a as x}from"./use-capability-DfdnXTfH.js";import{C as j}from"./capability-load-error-DgQyDsKl.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,l as a,j as d}from"./index-
|
|
1
|
+
import{c as s,l as a,j as d}from"./index-CurNB2HG.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as h,r as C,l as L}from"./index-
|
|
1
|
+
import{c as k,j as h,r as C,l as L}from"./index-CurNB2HG.js";import{n as Z}from"./XCircle-DFBcUexW.js";import{A as y}from"./agent-icon-pz8iT5cD.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as r,j as i,bI as p}from"./index-
|
|
1
|
+
import{c as n,l as r,j as i,bI as p}from"./index-CurNB2HG.js";function c(o){const e=n.c(8);let t,s;e[0]!==o?({className:t,...s}=o,e[0]=o,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==a?(l=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=l):l=e[7],l}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,u as f,j as o,S as g,N as p}from"./index-
|
|
1
|
+
import{a,u as f,j as o,S as g,N as p}from"./index-CurNB2HG.js";import{A as x}from"./auth-entry-BNYZmdvo.js";import{A as S}from"./auth-split-layout-DuCP9Fwl.js";import"./input-RRjvrcUF.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(e){if(!e.client_id||e.response_type!=="code")return null;const t=new URLSearchParams;return e.client_id&&t.set("client_id",e.client_id),e.redirect_uri&&t.set("redirect_uri",e.redirect_uri),e.response_type&&t.set("response_type",e.response_type),e.state&&t.set("state",e.state),e.scope&&t.set("scope",e.scope),e.code_challenge&&t.set("code_challenge",e.code_challenge),e.code_challenge_method&&t.set("code_challenge_method",e.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function L(){const e=a.useSession(),t=f({from:"/login"}),{next:i="/",client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_}=t,n=i.startsWith("/")&&!i.startsWith("//")?i:"/",c=y({client_id:r,redirect_uri:s,response_type:l,state:h,scope:u,code_challenge:d,code_challenge_method:_});return e.data?c?(window.location.href=c,o.jsx(g,{})):o.jsx(p,{to:n}):o.jsx(S,{children:o.jsx(x,{callbackUrl:n,redirectUrl:c})})}export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as x,b as N,c as z,a as D}from"./auth-
|
|
1
|
+
import{d as x,b as N,c as z,a as D}from"./auth-xlfJjVrK.js";function E(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}function H(){return window.location.origin}function C(){try{const t=window.location.hostname;return t==="localhost"||t.endsWith(".localhost")||t==="127.0.0.1"||t==="::1"}catch{return!1}}const M=new Map,R="mcp:oauth:callback:";class W{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${H()}/oauth/callback`,this._windowMode=e.windowMode??"popup";const n=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...n&&{scope:n}},M.set(E(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const o=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${o},top=${s},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){M.delete(E(this.serverUrl))}}async function G(t){const e=t.meshUrl??window.location.origin,n=t.orgSlug?`/api/${encodeURIComponent(t.orgSlug)}/mcp/${t.connectionId}`:`/mcp/${t.connectionId}`,r=new URL(n,e),o=new W({serverUrl:r.href,clientName:t.clientName,clientUri:t.clientUri,callbackUrl:t.callbackUrl,scope:t.scope,windowMode:t.windowMode}),s={fn:null};try{const i=new Promise((l,d)=>{const k=t.timeout||12e4;let b,p=!1;const L=o.state(),A=`${R}${L}`,h=()=>{window.removeEventListener("message",v),window.removeEventListener("storage",O),clearTimeout(b);try{localStorage.removeItem(A)}catch{}};s.fn=u=>{p||(p=!0,h(),d(u))};const U=async u=>{if(p)return;if(p=!0,!u.success){h(),d(new Error(u.error||"OAuth authentication failed"));return}const{code:m,state:$}=u;if(!m){h(),d(new Error("Missing authorization code"));return}if(o.getStoredState()!==$){h(),d(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const T=(await x(r))?.authorization_servers?.[0]||r,S=await N(T),g=o.clientInformation();if(!g){h(),d(new Error("Client information not found"));return}const P=o.codeVerifier(),V=await z(T,{metadata:S,clientInformation:g,authorizationCode:m,codeVerifier:P,redirectUri:o.redirectUrl,resource:new URL(r)});h(),l({tokens:V,clientId:g.client_id??null,clientSecret:"client_secret"in g?g.client_secret:null,tokenEndpoint:S?.token_endpoint??null,userinfoEndpoint:S?.userinfo_endpoint??null})}catch(I){h(),d(I)}},v=async u=>{!C()&&u.origin!==window.location.origin||u.data?.type==="mcp:oauth:callback"&&await U(u.data)},O=async u=>{if(!(u.key!==A||!u.newValue))try{const m=JSON.parse(u.newValue);await U(m)}catch{}};window.addEventListener("message",v),window.addEventListener("storage",O),b=setTimeout(()=>{p||(p=!0,h(),d(new Error("OAuth authentication timeout")))},k)});if(i.catch(()=>{}),await D(o,{serverUrl:r})==="REDIRECT"){const l=await i,d=l.tokens;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint,userinfoEndpoint:l.userinfoEndpoint,idToken:typeof d.id_token=="string"?d.id_token:null},error:null}}const a=o.tokens(),w=o.clientInformation(),f=a;return{token:a?.access_token||null,tokenInfo:a?{accessToken:a.access_token,refreshToken:a.refresh_token??null,expiresIn:a.expires_in??null,scope:a.scope??null,clientId:w?.client_id??null,clientSecret:w&&"client_secret"in w?w.client_secret:null,tokenEndpoint:null,userinfoEndpoint:null,idToken:f&&typeof f.id_token=="string"?f.id_token:null}:null,error:null}}catch(i){return s.fn&&s.fn(i instanceof Error?i:new Error(String(i))),{token:null,tokenInfo:null,error:i instanceof Error?i.message:String(i)}}finally{o.cleanup()}}function y(t,e){if(window.opener&&!window.opener.closed){const n=C()?"*":window.location.origin;return window.opener.postMessage(t,n),!0}if(e)try{const n=`${R}${e}`;return localStorage.setItem(n,JSON.stringify(t)),!0}catch{}return!1}async function X(){const t=new URLSearchParams(window.location.search),e=t.get("code");let n=t.get("state");const r=t.get("error"),o=t.get("error_description");let s=n;if(n)try{const c=atob(n),a=JSON.parse(c);a.clientState&&(s=a.clientState)}catch{}if(r){const c=o||r;return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}if(!e||!n){const c="Missing code or state parameter";return y({type:"mcp:oauth:callback",success:!1,error:c},s),{success:!1,error:c}}return n=s||n,y({type:"mcp:oauth:callback",success:!0,code:e,state:n},n)?{success:!0}:{success:!1,error:"Parent window not available"}}function _(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function j(t){try{const e=_(),n=e?new URL(t,e):new URL(t),r=n.pathname.match(/^\/api\/[^/]+\/mcp\/([^/]+)/);return r?r[1]??null:n.pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}function J(t){try{const e=_();return(e?new URL(t,e):new URL(t)).pathname.match(/^\/api\/([^/]+)\/mcp\//)?.[1]??null}catch{return null}}async function K(t,e,n){try{const r=`/api/${encodeURIComponent(e)}/connections/${t}/oauth-token/status`,o=n?new URL(r,n).href:r,s=_(),i=!n||new URL(n).origin===s,c=await fetch(o,{credentials:i?"include":"omit"});return c.ok?{hasToken:(await c.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function q({url:t,token:e,orgId:n,meshUrl:r}){try{const o=new Headers;o.set("Content-Type","application/json"),o.set("Accept","application/json, text/event-stream");const s=await fetch(t,{method:"POST",headers:o,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),i=j(t),c=J(t),a=_(),w=r??(a?new URL(t,a).origin:new URL(t).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(i&&c?await K(i,c,w):{hasToken:!1}).hasToken};let f;try{const k=await s.json();f=k.error||k.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:f||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:f||`HTTP ${s.status}`}}catch(o){return console.error("[isConnectionAuthenticated] Error:",o),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:o.message}}}export{G as a,X as h,q as i};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{C as $t,r as ce,w as he,m as De,a as kt,G as Dt,d as xe,s as ue,t as G,K as ie,j as s,B as fe,c as J,p as Ft,k as Tt,l as $e,i as Xe,E as Ot}from"./index-
|
|
1
|
+
import{C as $t,r as ce,w as he,m as De,a as kt,G as Dt,d as xe,s as ue,t as G,K as ie,j as s,B as fe,c as J,p as Ft,k as Tt,l as $e,i as Xe,E as Ot}from"./index-CurNB2HG.js";import{C as Lt}from"./collection-display-button-BgYBCk8T.js";import{S as qt}from"./search-input-CeqwXCv0.js";import{P as _e}from"./index-qZ5-LmpP.js";import{u as It,C as Bt}from"./use-organization-roles-tA96x-8d.js";import{E as We}from"./empty-state-Lmcbk0Zv.js";import{d as Kt,i as Vt,c as Qt,D as Ut,a as Gt,e as Jt}from"./dialog-BFjL_my-.js";import{a as Ht,F as rt,b as ct,c as Wt,d as mt,f as dt}from"./form-B6Nf7hvD.js";import{d as et,b as tt,c as st,S as nt,a as it}from"./select-BePf1IJF.js";import{T as Yt}from"./textarea-C7j7_npp.js";import{u as lt}from"./use-org-auth-client-oMz0ubhe.js";import{b as Zt,S as Xt,a as es}from"./settings-section-ELYurXQx.js";import{a as ts,u as ss}from"./use-join-requests-ByqDno7o.js";import{A as ke}from"./avatar-Bh53txVX.js";import{u as ns}from"./use-members-blURElyD.js";import{u as Fe}from"./studio-tools-BvQ8Bli1.js";import{T as is,a as as,c as ls,b as os}from"./tooltip-CUlMaf5E.js";import{a as ut,e as ft,g as ht,b as pt,c as gt,d as xt,A as bt,f as jt}from"./alert-dialog-CkCCiKt9.js";import{B as Ue}from"./badge-CdirlPdy.js";import{C as vt}from"./card-D_tApM0k.js";import{D as At,a as Pt,b as Mt,d as rs,e as cs,f as ms,c as at,g as ds}from"./dropdown-menu-B1DaP6vk.js";import{a as Et}from"./DotsVertical-Z_h1bSB3.js";import{i as us}from"./Key01-CZVV-ceU.js";import{i as fs}from"./Shield01-CYPtC_lA.js";import{b as hs}from"./SwitchHorizontal01-DXdcIz27.js";import{s as ps}from"./Trash01-z6De146C.js";import{s as _t}from"./XClose-BKWXOZkj.js";import{C as Ct}from"./checkbox-OtNKSART.js";import{e as Ye,a as Ze,g as yt,C as gs,c as xs,d as bs,b as js}from"./command-iFNWkWs6.js";import{b as vs,P as Cs,a as ys}from"./popover-D7BamlkK.js";import{t as Ss}from"./ChevronDown-CkcGr2qp.js";import{s as ws}from"./Plus-CQOl41pg.js";import{R as Ns}from"./require-capability-CBJ6cwe3.js";import"./ChevronUp-CiXD4kQk.js";import"./view-mode-toggle-CIiu6iGh.js";import"./SearchMd-Da504yGV.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./table-D_zHkpnq.js";import"./label-DrXdAtn0.js";import"./index-BdQq_4o_.js";import"./ArrowUpRight-CwVMUp5O.js";import"./use-capability-DfdnXTfH.js";import"./User01-Cvp121NC.js";import"./ChevronRight-DYe9AFXl.js";import"./index-BDyN-RAN.js";import"./access-gate-DvuwS2Bs.js";import"./capability-load-error-DgQyDsKl.js";const Ts=$t().email("Invalid email address");function Is(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function As({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=he(),i=lt(),a=De(),{data:r}=kt.useSession(),o=r?.user?.email,{roles:g,isLoading:x}=It(),j=g.filter(m=>m.role!=="owner"),p=Dt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),P=p.watch("role"),v=Is(b).filter(m=>{const c=Ts.safeParse(m).success,f=!o||m!==o.toLowerCase();return c&&f}),N=xe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await i.organization.inviteMember({email:w,role:c});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:c,role:f})=>{ue("member_invited",{count:c.length,role:f}),a.invalidateQueries({queryKey:ie.members(l)}),a.invalidateQueries({queryKey:ie.invitations(l)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{ue("member_invite_failed",{count:c.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!P;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Ht,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
|
|
2
2
|
e.g. user1@example.com, user2@example.com
|
|
3
3
|
or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(dt,{})]})}),s.jsx(rt,{control:p.control,name:"role",render:({field:m})=>s.jsxs(ct,{children:[s.jsx(mt,{children:s.jsxs(et,{value:m.value,onValueChange:m.onChange,disabled:N.isPending||x,children:[s.jsx(tt,{className:"w-full",children:s.jsx(st,{placeholder:"Select a role"})}),s.jsx(nt,{children:j.map(c=>{const f=[];return c.isBuiltin||(c.allowsAllStaticPermissions?f.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&f.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?f.push("All connections"):c.connectionCount&&c.connectionCount>0&&f.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?f.push("all tools"):c.toolCount&&c.toolCount>0&&f.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(it,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&f.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:f.join(", ")})]})},c.role)})})]})}),s.jsx(dt,{})]})}),s.jsxs(Jt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(fe,{type:"submit",disabled:N.isPending||!$,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ps(){const t=J.c(9),e=ts(),{approve:n,deny:l}=ss();if(e.length===0)return null;let i;if(t[0]!==n||t[1]!==l||t[2]!==e){let r;t[4]!==n||t[5]!==l?(r=o=>s.jsx(Zt,{icon:s.jsx(ke,{url:o.user?.image??void 0,fallback:(o.user?.name??o.user?.email??"?").charAt(0).toUpperCase(),shape:"circle",size:"sm"}),title:o.user?.name??o.user?.email??o.userId,description:o.user?.email,action:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fe,{size:"sm",variant:"outline",onClick:()=>l.mutate(o.id),disabled:l.isPending||n.isPending,children:"Deny"}),s.jsx(fe,{size:"sm",onClick:()=>n.mutate(o.id),disabled:n.isPending||l.isPending,children:"Approve"})]})},o.id),t[4]=n,t[5]=l,t[6]=r):r=t[6],i=e.map(r),t[0]=n,t[1]=l,t[2]=e,t[3]=i}else i=t[3];let a;return t[7]!==i?(a=s.jsx(Xt,{title:"Join requests",description:"People who requested to join via a domain in approval mode.",children:s.jsx(es,{children:i})}),t[7]=i,t[8]=a):a=t[8],a}function Ms(){const t=J.c(7),{locator:e}=he(),n=Fe();let l;t[0]!==e?(l=ie.invitations(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i},t[4]=l,t[5]=i,t[6]=a):a=t[6],Ft(a)}function Es(){const t=J.c(10),{locator:e}=he(),n=lt(),l=De();let i;t[0]!==n?(i=async x=>{const j=await n.organization.cancelInvitation({invitationId:x});if(j?.error)throw new Error(j.error.message);return j.data},t[0]=n,t[1]=i):i=t[1];let a;t[2]!==e||t[3]!==l?(a=()=>{l.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=a):a=t[4];let r;t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:_s},t[5]=i,t[6]=a,t[7]=r):r=t[7];const o=xe(r);let g;return t[8]!==o?(g={cancel:o},t[8]=o,t[9]=g):g=t[9],g}function _s(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}function Rs(){const t=J.c(7),{locator:e}=he(),n=Fe();let l;t[0]!==e?(l=ie.tags(e),t[0]=e,t[1]=l):l=t[1];let i;t[2]!==n?(i=async()=>{const{tags:r}=await n.call("TAGS_LIST",{});return r},t[2]=n,t[3]=i):i=t[3];let a;return t[4]!==l||t[5]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[4]=l,t[5]=i,t[6]=a):a=t[6],Tt(a)}function zs(){const t=J.c(8),e=De(),{locator:n}=he(),l=Fe();let i;t[0]!==l?(i=async o=>{const{tag:g}=await l.call("TAGS_CREATE",{name:o});return g},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=()=>{e.invalidateQueries({queryKey:ie.tags(n)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let r;return t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:$s},t[5]=i,t[6]=a,t[7]=r):r=t[7],xe(r)}function $s(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function ks(t){const e=J.c(10),{locator:n}=he(),l=Fe();let i;e[0]!==n||e[1]!==t?(i=ie.memberTags(n,t),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;e[3]!==t||e[4]!==l?(a=async()=>{const{tags:g}=await l.call("MEMBER_TAGS_GET",{memberId:t});return g},e[3]=t,e[4]=l,e[5]=a):a=e[5];const r=!!t;let o;return e[6]!==i||e[7]!==a||e[8]!==r?(o={queryKey:i,queryFn:a,staleTime:3e4,enabled:r},e[6]=i,e[7]=a,e[8]=r,e[9]=o):o=e[9],Tt(o)}function Ds(){const t=J.c(8),e=De(),{locator:n}=he(),l=Fe();let i;t[0]!==l?(i=async o=>{const{memberId:g,tagIds:x}=o;return await l.call("MEMBER_TAGS_SET",{memberId:g,tagIds:x})},t[0]=l,t[1]=i):i=t[1];let a;t[2]!==n||t[3]!==e?(a=(o,g)=>{e.invalidateQueries({queryKey:ie.memberTags(n,g.memberId)})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let r;return t[5]!==i||t[6]!==a?(r={mutationFn:i,onSuccess:a,onError:Fs},t[5]=i,t[6]=a,t[7]=r):r=t[7],xe(r)}function Fs(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function Rt(t){const e=J.c(44),{memberId:n,className:l,disabled:i,placeholder:a,maxDisplay:r}=t,o=i===void 0?!1:i,g=a===void 0?"Add tags...":a,x=r===void 0?2:r,[j,p]=ce.useState(!1),[b,P]=ce.useState(""),{data:R,isLoading:v}=Rs(),N=R===void 0?[]:R,{data:y,isLoading:$}=ks(n),m=y===void 0?[]:y,c=zs(),f=Ds(),I=v||$,w=m.map(Ls);let A;e[0]!==b?(A=S=>S.name.toLowerCase().includes(b.toLowerCase()),e[0]=b,e[1]=A):A=e[1];const z=N.filter(A);let T;e[2]!==b?(T=S=>S.name.toLowerCase()===b.toLowerCase(),e[2]=b,e[3]=T):T=e[3];const K=N.find(T),M=b.trim()&&!K,D=async S=>{const ge=w.includes(S.id)?w.filter(ve=>ve!==S.id):[...w,S.id];await f.mutateAsync({memberId:n,tagIds:ge})},E=async()=>{if(!b.trim())return;const S=await c.mutateAsync(b.trim());await f.mutateAsync({memberId:n,tagIds:[...w,S.id]}),P("")},d=async S=>{const ne=w.filter(ge=>ge!==S);await f.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||f.isPending,L=Cs;let k;e[4]!==j?(k=()=>p(!j),e[4]=j,e[5]=k):k=e[5];let F;e[6]!==l?(F=$e("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=F):F=e[7];const V=o||I,O=I?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):m.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[m.slice(0,x).map(Os),m.length>x&&s.jsxs(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",m.length-x]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:g});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(Ss,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let q;e[9]!==V||e[10]!==O||e[11]!==k||e[12]!==F?(q=s.jsx(ys,{asChild:!0,children:s.jsxs(fe,{variant:"ghost",size:"sm",onClick:k,className:F,disabled:V,children:[O,Q]})}),e[9]=V,e[10]=O,e[11]=k,e[12]=F,e[13]=q):q=e[13];const U=vs,H="w-56 p-0",W="start";let Y;e[14]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>p(!1),e[14]=Y):Y=e[14];const ae=bs,be=!1;let Z;e[15]!==b?(Z=s.jsx(js,{placeholder:"Search or create...",value:b,onValueChange:P,className:"h-9"}),e[15]=b,e[16]=Z):Z=e[16];const le=xs,me=m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:m.map(S=>s.jsx(Ze,{onSelect:()=>D(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),d(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(_t,{size:14})})]})},S.id))}),s.jsx(yt,{})]}),Re=Ye,je="Available",ze=z.length===0&&!M&&s.jsx(gs,{children:"No tags found."}),pe=z.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ze,{onSelect:()=>D(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==Re||e[18]!==ze||e[19]!==pe?(oe=s.jsxs(Re,{heading:je,children:[ze,pe]}),e[17]=Re,e[18]=ze,e[19]=pe,e[20]=oe):oe=e[20];let re;e[21]!==E||e[22]!==C||e[23]!==b||e[24]!==M?(re=M&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:E,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(ws,{size:14}),s.jsxs("span",{children:['Create "',b.trim(),'"']})]})})})]}),e[21]=E,e[22]=C,e[23]=b,e[24]=M,e[25]=re):re=e[25];let X;e[26]!==le||e[27]!==me||e[28]!==oe||e[29]!==re?(X=s.jsxs(le,{children:[me,oe,re]}),e[26]=le,e[27]=me,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==ae||e[32]!==Z||e[33]!==X?(ee=s.jsxs(ae,{shouldFilter:be,children:[Z,X]}),e[31]=ae,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==U||e[36]!==Y||e[37]!==ee?(te=s.jsx(U,{className:H,align:W,onEscapeKeyDown:Y,children:ee}),e[35]=U,e[36]=Y,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==L||e[40]!==j||e[41]!==q||e[42]!==te?(se=s.jsxs(L,{open:j,onOpenChange:p,children:[q,te]}),e[39]=L,e[40]=j,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function Os(t){return s.jsx(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Ls(t){return t.id}const St=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],qs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Bs(t){const e=new Map;for(const[n,l]of Object.entries(qs))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,St[n%St.length]??"bg-neutral-400")}return e}function Ks(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Ve(t){const e=J.c(79),{role:n,memberId:l,isOwner:i,roleColorMap:a,selectableRoles:r,onRoleChange:o,size:g,className:x}=t,j=g===void 0?"xs":g;let p,b,P,R,v,N,y,$,m,c,f;if(e[0]!==x||e[1]!==i||e[2]!==l||e[3]!==o||e[4]!==n||e[5]!==a||e[6]!==r||e[7]!==j){f=Symbol.for("react.early_return_sentinel");e:{const E=a.get(n)??"bg-neutral-400";if(i){let d;e[19]!==l||e[20]!==o?(d=H=>o(l,H),e[19]=l,e[20]=o,e[21]=d):d=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:$e("size-2 rounded-full shrink-0",E)}),C]});let k;e[24]!==L?(k=s.jsx(st,{children:L}),e[24]=L,e[25]=k):k=e[25];let F;e[26]!==x||e[27]!==j||e[28]!==k?(F=s.jsx(tt,{size:j,className:x,children:k}),e[26]=x,e[27]=j,e[28]=k,e[29]=F):F=e[29];let V;if(e[30]!==a||e[31]!==r){let H;e[33]!==a?(H=W=>{const Y=a.get(W.role)??"bg-neutral-400";return s.jsx(it,{value:W.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",Y)}),s.jsx("span",{className:"capitalize",children:W.label})]})},W.role)},e[33]=a,e[34]=H):H=e[34],V=r.map(H),e[30]=a,e[31]=r,e[32]=V}else V=e[32];let O;e[35]!==V?(O=s.jsx(nt,{children:V}),e[35]=V,e[36]=O):O=e[36];let Q;e[37]!==i||e[38]!==n||e[39]!==d||e[40]!==F||e[41]!==O?(Q=s.jsx(is,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(et,{value:n,onValueChange:d,disabled:i,children:[F,O]})})}),e[37]=i,e[38]=n,e[39]=d,e[40]=F,e[41]=O,e[42]=Q):Q=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(as,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let U;e[44]!==Q?(U=s.jsx(ls,{children:s.jsxs(os,{children:[Q,q]})}),e[44]=Q,e[45]=U):U=e[45],f=U;break e}P=et,$=n,e[46]!==l||e[47]!==o?(m=d=>o(l,d),e[46]=l,e[47]=o,e[48]=m):m=e[48],c=i,b=tt,N=j,y=x,p=st,v="flex items-center gap-2 min-w-0",R=$e("size-2 rounded-full shrink-0",E)}e[0]=x,e[1]=i,e[2]=l,e[3]=o,e[4]=n,e[5]=a,e[6]=r,e[7]=j,e[8]=p,e[9]=b,e[10]=P,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=$,e[16]=m,e[17]=c,e[18]=f}else p=e[8],b=e[9],P=e[10],R=e[11],v=e[12],N=e[13],y=e[14],$=e[15],m=e[16],c=e[17],f=e[18];if(f!==Symbol.for("react.early_return_sentinel"))return f;let I;e[49]!==R?(I=s.jsx("div",{className:R}),e[49]=R,e[50]=I):I=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let A;e[53]!==I||e[54]!==w||e[55]!==v?(A=s.jsxs("div",{className:v,children:[I,w]}),e[53]=I,e[54]=w,e[55]=v,e[56]=A):A=e[56];let z;e[57]!==p||e[58]!==A?(z=s.jsx(p,{children:A}),e[57]=p,e[58]=A,e[59]=z):z=e[59];let T;e[60]!==b||e[61]!==z||e[62]!==N||e[63]!==y?(T=s.jsx(b,{size:N,className:y,children:z}),e[60]=b,e[61]=z,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==a||e[66]!==r){let E;e[68]!==a?(E=d=>{const C=a.get(d.role)??"bg-neutral-400";return s.jsx(it,{value:d.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:d.label})]})},d.role)},e[68]=a,e[69]=E):E=e[69],K=r.map(E),e[65]=a,e[66]=r,e[67]=K}else K=e[67];let M;e[70]!==K?(M=s.jsx(nt,{children:K}),e[70]=K,e[71]=M):M=e[71];let D;return e[72]!==P||e[73]!==T||e[74]!==M||e[75]!==$||e[76]!==m||e[77]!==c?(D=s.jsxs(P,{value:$,onValueChange:m,disabled:c,children:[T,M]}),e[72]=P,e[73]=T,e[74]=M,e[75]=$,e[76]=m,e[77]=c,e[78]=D):D=e[78],D}function wt(t){const e=J.c(51),{member:n,roles:l,onChangeRole:i,onRemove:a,isUpdating:r}=t,o=r===void 0?!1:r,g=n.role==="owner";let x,j,p,b,P,R,v,N,y;if(e[0]!==g||e[1]!==o||e[2]!==n.id||e[3]!==n.role||e[4]!==i||e[5]!==l){let T;e[15]!==n.role?(T=d=>d.role!==n.role&&d.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=l.filter(T);b=At;let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Et,{size:20}),e[17]=M):M=e[17],e[18]!==g?(y=s.jsx(Pt,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:g,onClick:Qs,children:M})}),e[18]=g,e[19]=y):y=e[19],p=Mt,v="end",N=Vs,j=rs;let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(hs,{size:16}),e[20]=D):D=e[20],e[21]!==o?(R=s.jsxs(cs,{disabled:o,children:[D,"Change Role"]}),e[21]=o,e[22]=R):R=e[22],x=ms;let E;e[23]!==o||e[24]!==n.id||e[25]!==i?(E=d=>{const C=[];return d.isBuiltin||(d.allowsAllStaticPermissions?C.push("Full org access"):d.staticPermissionCount&&d.staticPermissionCount>0&&C.push(`${d.staticPermissionCount} org perm${d.staticPermissionCount!==1?"s":""}`),d.allowsAllConnections?C.push("All connections"):d.connectionCount&&d.connectionCount>0&&C.push(`${d.connectionCount} connection${d.connectionCount!==1?"s":""}`),(d.connectionCount!==0||d.allowsAllConnections)&&(d.allowsAllTools?C.push("all tools"):d.toolCount&&d.toolCount>0&&C.push(`${d.toolCount} tool${d.toolCount!==1?"s":""}`))),s.jsxs(at,{onClick:L=>{L.stopPropagation(),i(n.id,d.role)},disabled:o,children:[d.isBuiltin?s.jsx(fs,{size:16}):s.jsx(us,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:d.label}),!d.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},d.role)},e[23]=o,e[24]=n.id,e[25]=i,e[26]=E):E=e[26],P=K.map(E),e[0]=g,e[1]=o,e[2]=n.id,e[3]=n.role,e[4]=i,e[5]=l,e[6]=x,e[7]=j,e[8]=p,e[9]=b,e[10]=P,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else x=e[6],j=e[7],p=e[8],b=e[9],P=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let $;e[27]!==x||e[28]!==P?($=s.jsx(x,{children:P}),e[27]=x,e[28]=P,e[29]=$):$=e[29];let m;e[30]!==j||e[31]!==R||e[32]!==$?(m=s.jsxs(j,{children:[R,$]}),e[30]=j,e[31]=R,e[32]=$,e[33]=m):m=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ds,{}),e[34]=c):c=e[34];let f;e[35]!==n.id||e[36]!==a?(f=T=>{T.stopPropagation(),a(n.id)},e[35]=n.id,e[36]=a,e[37]=f):f=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ps,{size:16}),e[38]=I):I=e[38];let w;e[39]!==f?(w=s.jsxs(at,{variant:"destructive",onClick:f,children:[I,"Remove Member"]}),e[39]=f,e[40]=w):w=e[40];let A;e[41]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==m?(A=s.jsxs(p,{align:v,onClick:N,children:[m,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=m,e[46]=A):A=e[46];let z;return e[47]!==b||e[48]!==A||e[49]!==y?(z=s.jsxs(b,{children:[y,A]}),e[47]=b,e[48]=A,e[49]=y,e[50]=z):z=e[50],z}function Vs(t){return t.stopPropagation()}function Qs(t){return t.stopPropagation()}function Nt(t){const e=J.c(8),{invitationId:n,onCancel:l,isCancelling:i}=t,a=i===void 0?!1:i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Pt,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Gs,children:s.jsx(Et,{size:20})})}),e[0]=r):r=e[0];let o;e[1]!==n||e[2]!==l?(o=j=>{j.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=o):o=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(_t,{size:16}),e[4]=g):g=e[4];let x;return e[5]!==a||e[6]!==o?(x=s.jsxs(At,{children:[r,s.jsx(Mt,{align:"end",onClick:Us,children:s.jsxs(at,{variant:"destructive",onClick:o,disabled:a,children:[g,"Cancel Invitation"]})})]}),e[5]=a,e[6]=o,e[7]=x):x=e[7],x}function Us(t){return t.stopPropagation()}function Gs(t){return t.stopPropagation()}function Js(){const t=J.c(103),{data:e}=ns(),{data:n}=Ms(),l=Es(),i=De(),{locator:a}=he(),r=lt(),[o,g]=ce.useState(null),[x,j]=ce.useState(null),[p,b]=ce.useState(""),[P,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,$]=ce.useState("asc"),m=e?.data?.members;let c;t[0]!==v?(c=u=>{v===u?$(ln):(N(u),$("asc"))},t[0]=v,t[1]=c):c=t[1];const f=c;let I=m??[],w=n??[];if(p){const u=p.toLowerCase();I=I.filter(h=>h.user?.name?.toLowerCase().includes(u)||h.user?.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u)),w=w.filter(h=>h.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u))}if(v&&y){let u;t[2]!==y||t[3]!==v?(u=(h,_)=>{let B,de;e:switch(v){case"member":{B=h.user?.name||"",de=_.user?.name||"";break e}case"role":{B=h.role||"",de=_.role||"";break e}case"joined":{B=h.createdAt?typeof h.createdAt=="string"?h.createdAt:h.createdAt.toISOString():"",de=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=y,t[3]=v,t[4]=u):u=t[4],I=[...I].sort(u)}const A=I;let z;t[5]!==r?(z=async u=>{const h=await r.organization.removeMember({memberIdOrEmail:u});if(h?.error)throw new Error(h.error.message)},t[5]=r,t[6]=z):z=t[6];let T;t[7]!==a||t[8]!==i?(T=()=>{ue("member_removed"),i.invalidateQueries({queryKey:ie.members(a)}),G.success("Member has been removed from the organization"),g(null)},t[7]=a,t[8]=i,t[9]=T):T=t[9];let K;t[10]!==z||t[11]!==T?(K={mutationFn:z,onSuccess:T,onError:an},t[10]=z,t[11]=T,t[12]=K):K=t[12];const M=xe(K);let D;t[13]!==r?(D=async u=>{const{memberId:h,role:_}=u,B=await r.organization.updateMemberRole({memberId:h,role:[_]});if(B?.error)throw new Error(B.error.message)},t[13]=r,t[14]=D):D=t[14];let E;t[15]!==a||t[16]!==i?(E=(u,h)=>{ue("member_role_updated",{new_role:h.role}),i.invalidateQueries({queryKey:ie.members(a)}),G.success("Member's role has been updated")},t[15]=a,t[16]=i,t[17]=E):E=t[17];let d;t[18]!==D||t[19]!==E?(d={mutationFn:D,onSuccess:E,onError:nn},t[18]=D,t[19]=E,t[20]=d):d=t[20];const C=xe(d);let L;t[21]!==r?(L=async u=>{const{invitationId:h,role:_,email:B}=u,de=await r.organization.cancelInvitation({invitationId:h});if(de?.error)throw new Error(de.error.message);const ot=await r.organization.inviteMember({email:B,role:_});if(ot?.error)throw new Error(ot.error.message)},t[21]=r,t[22]=L):L=t[22];let k;t[23]!==a||t[24]!==i?(k=(u,h)=>{ue("invitation_role_updated",{new_role:h.role}),i.invalidateQueries({queryKey:ie.invitations(a)}),G.success("Invitation role has been updated")},t[23]=a,t[24]=i,t[25]=k):k=t[25];let F;t[26]!==L||t[27]!==k?(F={mutationFn:L,onSuccess:k,onError:sn},t[26]=L,t[27]=k,t[28]=F):F=t[28];const V=xe(F),{roles:O,customRoles:Q}=It();let q;t[29]!==Q?(q=Bs(Q),t[29]=Q,t[30]=q):q=t[30];const U=q;let H;t[31]!==O?(H=O.filter(tn),t[31]=O,t[32]=H):H=t[32];const W=H;let Y;t[33]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"member",header:"Member",render:en,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=Y):Y=t[33];let ae;t[34]!==U||t[35]!==W||t[36]!==V||t[37]!==C?(ae={id:"role",header:"Role",render:u=>u.type==="member"?s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:u.data.role==="owner",roleColorMap:U,selectableRoles:W,onRoleChange:(h,_)=>C.mutate({memberId:h,role:_}),className:"w-36"}):s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:W,onRoleChange:(h,_)=>V.mutate({invitationId:h,role:_,email:u.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=U,t[35]=W,t[36]=V,t[37]=C,t[38]=ae):ae=t[38];let be,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(be={id:"tags",header:"Tags",render:Xs,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Zs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=be,t[40]=Z):(be=t[39],Z=t[40]);let le;t[41]!==l.cancel.isPending||t[42]!==O||t[43]!==C?(le={id:"actions",header:"",render:u=>u.type==="member"?s.jsx(wt,{member:u.data,roles:O,onChangeRole:(h,_)=>C.mutate({memberId:h,role:_}),onRemove:g,isUpdating:C.isPending}):s.jsx(Nt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=O,t[43]=C,t[44]=le):le=t[44];let me;t[45]!==ae||t[46]!==le?(me=[Y,ae,be,Z,le],t[45]=ae,t[46]=le,t[47]=me):me=t[47];const Re=me;let je;t[48]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(As,{trigger:s.jsx(fe,{children:"Invite Member"})})}),t[48]=je):je=t[48];const ze=je,pe=[...A.map(Ys),...w.filter(Ws).map(Hs)],oe=_e,re=!!x;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>j(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(pt,{children:[s.jsx(gt,{children:"Cancel Invitation"}),s.jsx(xt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(bt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==l.cancel||t[53]!==x?(se=()=>{x&&(l.cancel.mutate(x),j(null))},t[52]=l.cancel,t[53]=x,t[54]=se):se=t[54];let S;t[55]!==l.cancel.isPending||t[56]!==se?(S=s.jsxs(ut,{children:[ee,s.jsxs(ft,{children:[te,s.jsx(ht,{onClick:se,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(jt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const ge=!!o;let ve;t[61]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>g(null),t[61]=ve):ve=t[61];let Oe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Oe=s.jsxs(pt,{children:[s.jsx(gt,{children:"Remove Member"}),s.jsx(xt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Oe):Oe=t[62];let Le;t[63]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(bt,{children:"Cancel"}),t[63]=Le):Le=t[63];let Ce;t[64]!==o||t[65]!==M?(Ce=()=>o&&M.mutate(o),t[64]=o,t[65]=M,t[66]=Ce):Ce=t[66];let ye;t[67]!==M.isPending||t[68]!==Ce?(ye=s.jsxs(ut,{children:[Oe,s.jsxs(ft,{children:[Le,s.jsx(ht,{onClick:Ce,disabled:M.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=M.isPending,t[68]=Ce,t[69]=ye):ye=t[69];let Se;t[70]!==ge||t[71]!==ye?(Se=s.jsx(jt,{open:ge,onOpenChange:ve,children:ye}),t[70]=ge,t[71]=ye,t[72]=Se):Se=t[72];const Ge=_e,Je=_e,zt="flex flex-col gap-6";let we,Ne;t[73]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsx(Ps,{}),Ne=s.jsx(_e.Title,{children:"Members"}),t[73]=we,t[74]=Ne):(we=t[73],Ne=t[74]);let qe;t[75]===Symbol.for("react.memo_cache_sentinel")?(qe=u=>{u.key==="Escape"&&(b(""),u.target.blur())},t[75]=qe):qe=t[75];let Te;t[76]!==p?(Te=s.jsx(qt,{value:p,onChange:b,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:qe}),t[76]=p,t[77]=Te):Te=t[77];let Be;t[78]===Symbol.for("react.memo_cache_sentinel")?(Be=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[78]=Be):Be=t[78];let Ie;t[79]!==f||t[80]!==y||t[81]!==v||t[82]!==P?(Ie=s.jsx(Lt,{viewMode:P,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:f,sortOptions:Be}),t[79]=f,t[80]=y,t[81]=v,t[82]=P,t[83]=Ie):Ie=t[83];let Ae;t[84]!==Te||t[85]!==Ie?(Ae=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Te,Ie]}),ze]}),t[84]=Te,t[85]=Ie,t[86]=Ae):Ae=t[86];const He=P==="cards"?s.jsx("div",{children:pe.length===0?s.jsx(We,{title:"No members found",description:p?`No members match "${p}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:pe.map(u=>{if(u.type==="invitation")return s.jsxs(vt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Nt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ke,{fallback:Qe(u.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:u.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ue,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ve,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:W,onRoleChange:(_,B)=>V.mutate({invitationId:_,role:B,email:u.data.email}),className:"w-fit"})]})]})]},`inv-${u.data.id}`);const h=u.data;return s.jsxs(vt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{member:h,roles:O,onChangeRole:(_,B)=>C.mutate({memberId:_,role:B}),onRemove:g,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(ke,{url:h.user?.image??void 0,fallback:Qe(h.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:h.user?.email}),s.jsx(Ve,{role:h.role,memberId:h.id,isOwner:h.role==="owner",roleColorMap:U,selectableRoles:W,onRoleChange:(_,B)=>C.mutate({memberId:_,role:B}),className:"w-fit"}),s.jsx(Rt,{memberId:h.id,maxDisplay:3})]})]})]},h.id)})})}):s.jsx(Bt,{columns:Re,data:pe,isLoading:!1,sortKey:v,sortDirection:y,onSort:f,emptyState:p?s.jsx(We,{title:"No members found",description:`No members match "${p}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let Pe;t[87]!==we||t[88]!==Ne||t[89]!==Ae||t[90]!==He?(Pe=s.jsxs("div",{className:zt,children:[we,Ne,Ae,He]}),t[87]=we,t[88]=Ne,t[89]=Ae,t[90]=He,t[91]=Pe):Pe=t[91];let Me;t[92]!==Je.Body||t[93]!==Pe?(Me=s.jsx(Je.Body,{children:Pe}),t[92]=Je.Body,t[93]=Pe,t[94]=Me):Me=t[94];let Ee;t[95]!==Ge.Content||t[96]!==Me?(Ee=s.jsx(Ge.Content,{children:Me}),t[95]=Ge.Content,t[96]=Me,t[97]=Ee):Ee=t[97];let Ke;return t[98]!==oe||t[99]!==ne||t[100]!==Se||t[101]!==Ee?(Ke=s.jsxs(oe,{children:[ne,Se,Ee]}),t[98]=oe,t[99]=ne,t[100]=Se,t[101]=Ee,t[102]=Ke):Ke=t[102],Ke}function Hs(t){return{type:"invitation",data:t}}function Ws(t){return t.status==="pending"}function Ys(t){return{type:"member",data:t}}function Zs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ks(t.data.createdAt):"N/A"}):s.jsx(Ue,{variant:"outline",children:"Pending"})}function Xs(t){return t.type==="member"?s.jsx(Rt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function en(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ke,{url:t.data.user?.image??void 0,fallback:Qe(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ke,{fallback:Qe(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function tn(t){return t.role!=="owner"}function sn(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function nn(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function an(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function ln(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function on(){const t=J.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(_e,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ot,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(_e,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Js,{})})}),t[1]=n):n=t[1],n}function ii(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ns,{capability:"members:manage",area:"members",children:s.jsx(on,{})}),t[0]=e):e=t[0],e}export{ii as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as L,j as f,r as p,al as O}from"./index-
|
|
1
|
+
import{c as L,j as f,r as p,al as O}from"./index-CurNB2HG.js";import{l as I,F as $}from"./index-ZANilAX7.js";import{S as N}from"./chat-context-Dz9rhizY.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
|
|
2
2
|
type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
|
|
3
3
|
? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
|
|
4
4
|
: T extends object
|