decocms 3.19.1 → 3.20.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-CfP2ydlK.js → AlertCircle-B-p2hhbf.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BG7K2o4g.js → ArrowUpRight-Bq-dJGgn.js} +1 -1
- package/dist/client/assets/{Check-Rzhysg8v.js → Check-CSixRgqh.js} +1 -1
- package/dist/client/assets/{CheckCircle-ByVfCd_z.js → CheckCircle-CqLcOI7o.js} +1 -1
- package/dist/client/assets/{ChevronDown-DgAQraB9.js → ChevronDown-BptXi8Ef.js} +1 -1
- package/dist/client/assets/{ChevronLeft-hIkmA-06.js → ChevronLeft-Bq6F--2K.js} +1 -1
- package/dist/client/assets/{ChevronRight-C-1GbVi6.js → ChevronRight-CtziSifX.js} +1 -1
- package/dist/client/assets/{ChevronUp-D95kdAWS.js → ChevronUp-DChs66VU.js} +1 -1
- package/dist/client/assets/{Container-EsK9R8Cs.js → Container-DIwdobum.js} +1 -1
- package/dist/client/assets/{DotsVertical--nxfulT_.js → DotsVertical-DQ3UGDDE.js} +1 -1
- package/dist/client/assets/{Eye-0u1NnyPn.js → Eye-DepFjUJE.js} +1 -1
- package/dist/client/assets/{FilterLines-lN6ZYEU6.js → FilterLines-CIJgiiLT.js} +1 -1
- package/dist/client/assets/{Globe01-CYJ5akFo.js → Globe01-BayTDYGC.js} +1 -1
- package/dist/client/assets/{HardDrive-Bi11tZlO.js → HardDrive-OwnJRrIS.js} +1 -1
- package/dist/client/assets/{Key01-ETI9VuA0.js → Key01-CR8zfCdU.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D5P3SyL5.js → LayoutLeft-6fPyjOVd.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CMTN51kD.js → LinkExternal01-B2YZgRTN.js} +1 -1
- package/dist/client/assets/{Monitor01-B9COEs1V.js → Monitor01-BNXW6pu5.js} +1 -1
- package/dist/client/assets/{Palette-CvBtCHX7.js → Palette-siqkt4cQ.js} +1 -1
- package/dist/client/assets/{Play-zcNTCzY3.js → Play-CBt0NeLA.js} +1 -1
- package/dist/client/assets/{Plus-BVt3gf6N.js → Plus-gXoAw_mX.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Do9uT8r5.js → RefreshCcw01-DlKjMM-5.js} +1 -1
- package/dist/client/assets/{SearchMd-Ckbe6j0d.js → SearchMd-z6b-QOmX.js} +1 -1
- package/dist/client/assets/{Settings02-BFHOCA5h.js → Settings02-C7YqxsZL.js} +1 -1
- package/dist/client/assets/{Shield01-ebA_Mmqa.js → Shield01-BT66FEMI.js} +1 -1
- package/dist/client/assets/{Star01-DinMZEQp.js → Star01-q6EhXttt.js} +1 -1
- package/dist/client/assets/{Stars01-cUHrtzm6.js → Stars01-DcMeK1n0.js} +1 -1
- package/dist/client/assets/{Stars02-CovFPupV.js → Stars02-DJ4Y5TfK.js} +1 -1
- package/dist/client/assets/{Sun-D5MzBxyK.js → Sun-CeFpMHQU.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CLmvgZdy.js → SwitchHorizontal01-__hAuhZa.js} +1 -1
- package/dist/client/assets/{Tool01-D6Ixmgxm.js → Tool01-DXWYgeBe.js} +1 -1
- package/dist/client/assets/{Trash01-C6sXu2xm.js → Trash01-B91-1KNk.js} +1 -1
- package/dist/client/assets/{Upload01-DslYY_N3.js → Upload01-CcwGyBRP.js} +1 -1
- package/dist/client/assets/{User01-9CJ-p7XF.js → User01-JR_76gHl.js} +1 -1
- package/dist/client/assets/{Users01-Ds5_zubO.js → Users01-BM2QLqUJ.js} +1 -1
- package/dist/client/assets/{Users03-C3j_vENk.js → Users03-D5pU3_ql.js} +1 -1
- package/dist/client/assets/{X-Dzpu-bw3.js → X-DCWlm9Ta.js} +1 -1
- package/dist/client/assets/{XCircle-gezQrKJB.js → XCircle-CEKwTNMD.js} +1 -1
- package/dist/client/assets/{XClose-dfaecXcF.js → XClose-DhQ5V0ST.js} +1 -1
- package/dist/client/assets/{Zap-ZCJiHFB8.js → Zap-BLBAeivN.js} +1 -1
- package/dist/client/assets/{ZapSquare-Doe97qp7.js → ZapSquare-DSdwG_FE.js} +1 -1
- package/dist/client/assets/{ZoomOut-u9z9zRXH.js → ZoomOut-CCPaeWry.js} +1 -1
- package/dist/client/assets/{access-gate-CLs4hv6_.js → access-gate-DXlQ8iVy.js} +1 -1
- package/dist/client/assets/{accordion-y8ERtqeD.js → accordion-CsQ2TTIf.js} +1 -1
- package/dist/client/assets/add-section-modal-ilTOPIUe.js +1 -0
- package/dist/client/assets/{agent-capabilities-C4HO1AsU.js → agent-capabilities-CuNGQogd.js} +1 -1
- package/dist/client/assets/{agent-icon-atw8dEpB.js → agent-icon-Lc1AgwlE.js} +1 -1
- package/dist/client/assets/{agent-icons-BO9U458u.js → agent-icons-Cprwkzhw.js} +1 -1
- package/dist/client/assets/agents-list--b7dVWdV.js +1 -0
- package/dist/client/assets/ai-providers-Dw2EV4N6.js +1 -0
- package/dist/client/assets/{alert-f3LQH8ql.js → alert-HSAarVhN.js} +1 -1
- package/dist/client/assets/{alert-dialog-BDuu9Vea.js → alert-dialog-DJLxSS_E.js} +1 -1
- package/dist/client/assets/app-editor-ZPlbW7dI.js +1 -0
- package/dist/client/assets/{auth-catchall-kvc8ufSV.js → auth-catchall-DeBOSldf.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CJrIhcxn.js → auth-split-layout-DKKncNKx.js} +1 -1
- package/dist/client/assets/{automation-list-row-DCGCyvJL.js → automation-list-row-C8yWYA2H.js} +1 -1
- package/dist/client/assets/automation-runs-D-WPNg7m.js +1 -0
- package/dist/client/assets/automations-C0KOU0yb.js +1 -0
- package/dist/client/assets/{avatar-DiepLBEZ.js → avatar-3vQWE5Hu.js} +1 -1
- package/dist/client/assets/{badge-Cosh8Jv6.js → badge-DF6gVmsi.js} +1 -1
- package/dist/client/assets/brand-context-EmCiQUXD.js +1 -0
- package/dist/client/assets/buckets-SH6KUYAQ.js +1 -0
- package/dist/client/assets/{calendar-D85iiJjZ.js → calendar-CCqv5TgR.js} +1 -1
- package/dist/client/assets/{capability-load-error-h6odhJ2k.js → capability-load-error-Dn3qy9VI.js} +1 -1
- package/dist/client/assets/{card-B2dT-2ts.js → card-CeH_PUFE.js} +1 -1
- package/dist/client/assets/{chat-context-7nRfVaxU.js → chat-context-BIie9ysT.js} +1 -1
- package/dist/client/assets/{checkbox-B2YbUc0m.js → checkbox-DFFY_m2B.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BLeVCI6_.js → cli-auth-success-CKQ9nJ3v.js} +1 -1
- package/dist/client/assets/collection-detail-BVeEbzxz.js +1 -0
- package/dist/client/assets/{collection-display-button-COhijorf.js → collection-display-button-_le1JW4q.js} +1 -1
- package/dist/client/assets/{collection-search-C0bvNtM9.js → collection-search-Bryj5VYk.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C_B1r31J.js → collection-table-wrapper-DoTnvoII.js} +1 -1
- package/dist/client/assets/{collection-tabs-BN4In63u.js → collection-tabs-Y3w8w2D4.js} +1 -1
- package/dist/client/assets/{collections-BUCuRVxl.js → collections-B-UBhIxv.js} +1 -1
- package/dist/client/assets/{command-BjqkQYxa.js → command-KyGHPzm4.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-BeLm4wl6.js +1 -0
- package/dist/client/assets/connection-card-Dug8PvM2.js +1 -0
- package/dist/client/assets/connection-detail-BXK_93LF.js +1 -0
- package/dist/client/assets/{connection-form-helpers-B093QOVj.js → connection-form-helpers-Ce4ZXQGG.js} +1 -1
- package/dist/client/assets/connections-CVEBwrj4.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-DYhlxmFV.js → decopilot-sse-pool-vfZK3kan.js} +1 -1
- package/dist/client/assets/{dialog-CvJmXij7.js → dialog-nXKceTRB.js} +1 -1
- package/dist/client/assets/domain-settings-OHWjjHlQ.js +1 -0
- package/dist/client/assets/{drawer-Cm2a8ouX.js → drawer-lSnonzW3.js} +1 -1
- package/dist/client/assets/{dropdown-menu-jK5-EocK.js → dropdown-menu-DpfpR4kx.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-BYQB-ubA.js +1 -0
- package/dist/client/assets/{empty-state-BvMn8pb-.js → empty-state-BJuYi96S.js} +1 -1
- package/dist/client/assets/{empty-state-CZ6jnWLa.js → empty-state-CY7XUbo0.js} +1 -1
- package/dist/client/assets/extract-connection-data-DxtHEsy3.js +1 -0
- package/dist/client/assets/features-DeiC9LXr.js +1 -0
- package/dist/client/assets/file-explorer-Ch6ZQfZO.js +2 -0
- package/dist/client/assets/{file-type-icon-B565DmsG.js → file-type-icon-B2skJERp.js} +1 -1
- package/dist/client/assets/{files-DDtaNJV8.js → files-CZNNukx-.js} +1 -1
- package/dist/client/assets/{form-DAahwl9B.js → form-BM4RuTjX.js} +1 -1
- package/dist/client/assets/general-sYzqMtl5.js +1 -0
- package/dist/client/assets/{generate-id-CnLzNGg6.js → generate-id-DvX29Me7.js} +1 -1
- package/dist/client/assets/{github-repo-picker-qDFzaGLa.js → github-repo-picker-Dlio4Q6_.js} +1 -1
- package/dist/client/assets/{header-tab-button-sg2Bkh9m.js → header-tab-button-BY6bk4Fs.js} +1 -1
- package/dist/client/assets/{hover-card-DyNloM84.js → hover-card-DASEEDYA.js} +1 -1
- package/dist/client/assets/image-field-BTCmGBNs.js +1 -0
- package/dist/client/assets/{index-DaTDomcZ.js → index-1xoY7YJX.js} +1 -1
- package/dist/client/assets/{index-DU03U45c.js → index-BXzjL9VS.js} +4 -4
- package/dist/client/assets/{index-RoHcRkq0.js → index-BfzqpoYd.js} +3 -3
- package/dist/client/assets/{index-Dhy2A-ml.js → index-CVPVNlMM.js} +1 -1
- package/dist/client/assets/{index-BlWGRwfE.js → index-CaqKcth7.js} +1 -1
- package/dist/client/assets/{index-B2iHTL-o.js → index-CnLAq3ph.js} +1 -1
- package/dist/client/assets/{index-BloRy46B.js → index-D3hStv8f.js} +1 -1
- package/dist/client/assets/{index-BFIoANt_.js → index-D4BxVbG6.js} +1 -1
- package/dist/client/assets/index-DFmAjKzK.js +1 -0
- package/dist/client/assets/{index-nS3rTKOQ.js → index-DOW4VN4f.js} +1 -1
- package/dist/client/assets/{index-Dw66yPMC.js → index-DcxEaxY4.js} +1 -1
- package/dist/client/assets/index-Dey5W81J.js +1 -0
- package/dist/client/assets/index-e3NOZKNP.js +1 -0
- package/dist/client/assets/{index-BDzZll30.js → index-nkMA7ZNv.js} +1 -1
- package/dist/client/assets/{index-redirect-DNU9Ckad.js → index-redirect-Dz1DdiHC.js} +1 -1
- package/dist/client/assets/{index-3Euwx3bh.js → index-uO0JijnU.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-GkUb2zKT.js → infiniteQueryObserver-CvEVG_TM.js} +1 -1
- package/dist/client/assets/{input-DsRHjNfg.js → input-BGQcwAaL.js} +1 -1
- package/dist/client/assets/{integration-icon-BOg4uSLi.js → integration-icon-B-zr5uGs.js} +1 -1
- package/dist/client/assets/{label-WCbT5R_C.js → label-zIig0cjv.js} +1 -1
- package/dist/client/assets/{layout-B9kVRgC4.js → layout-VuI1aPBj.js} +1 -1
- package/dist/client/assets/{login-B2dT1ex9.js → login-DgI1VcxE.js} +1 -1
- package/dist/client/assets/members-BdlFzlWX.js +3 -0
- package/dist/client/assets/{monaco-editor-BleU3J2F.js → monaco-editor-DQviDtyP.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CwPKi62k.js → monitoring-stats-row-Bsjs_3xk.js} +1 -1
- package/dist/client/assets/{oauth-callback-D_06ga7T.js → oauth-callback-CuHVTba4.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-kq_yOJkf.js → oauth-callback-ai-provider-B-N2lOyI.js} +1 -1
- package/dist/client/assets/{onboarding-CFkZhYek.js → onboarding-CqGFHsnX.js} +1 -1
- package/dist/client/assets/{org-install-BNh6vn9t.js → org-install-B0qdlOKM.js} +1 -1
- package/dist/client/assets/{org-layout-3aD45RuC.js → org-layout-CMGneEfe.js} +1 -1
- package/dist/client/assets/org-plugin-layout-DGdROiZB.js +1 -0
- package/dist/client/assets/{page-seo-form-CtJ-H1-o.js → page-seo-form-C3bI8Neh.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Cs2jXSnd.js +1 -0
- package/dist/client/assets/{pair-DPmFvoFZ.js → pair-NC4sCATE.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-m3Z19NWv.js → plugin-empty-state-FQw8SLzO.js} +1 -1
- package/dist/client/assets/{plugin-header-CeEbbzl3.js → plugin-header-D-cxTW9a.js} +1 -1
- package/dist/client/assets/plugin-layout-DECTyQVg.js +1 -0
- package/dist/client/assets/{popover-00xsE00R.js → popover-B1xAxEac.js} +1 -1
- package/dist/client/assets/{post-editor-DHpEWcQc.js → post-editor-BXy1yxCV.js} +1 -1
- package/dist/client/assets/{primitives-DpFr-gq2.js → primitives-CANqy_LE.js} +1 -1
- package/dist/client/assets/{profile-BJCcQ1KU.js → profile-UNuXVjVg.js} +1 -1
- package/dist/client/assets/project-app-view-7DW_WhHA.js +1 -0
- package/dist/client/assets/record-editor-D9aMJ7nl.js +1 -0
- package/dist/client/assets/registry-Ddq3KnAW.js +2 -0
- package/dist/client/assets/{registry-layout-DfY363OJ.js → registry-layout-DH7-iD95.js} +1 -1
- package/dist/client/assets/{require-capability-USY4c6Pw.js → require-capability-Bi88Fg3q.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BTqABC6o.js → required-auth-layout-3IQyeREK.js} +1 -1
- package/dist/client/assets/{reset-password-DAzKe1m4.js → reset-password-Dstl0VXR.js} +1 -1
- package/dist/client/assets/{resizable-tvU32_PL.js → resizable-Cx-Y9zvP.js} +1 -1
- package/dist/client/assets/roles-BrYnRIt_.js +1 -0
- package/dist/client/assets/{save-status-c_gSkXRz.js → save-status-DSB279Mq.js} +1 -1
- package/dist/client/assets/{schema-form-DC8-fGrX.js → schema-form-f_EsRXt1.js} +1 -1
- package/dist/client/assets/{scroll-area-DjlF9Nhh.js → scroll-area-BYy84ztj.js} +1 -1
- package/dist/client/assets/{search-input-BIE6clnk.js → search-input-C3i2qrnL.js} +1 -1
- package/dist/client/assets/secrets-CAO0zPct.js +1 -0
- package/dist/client/assets/{sections-editor-S-fGjWCd.js → sections-editor-Dq0mEIsn.js} +1 -1
- package/dist/client/assets/{select-DzGY5lz9.js → select-DpYu937I.js} +1 -1
- package/dist/client/assets/{select-model-dzURvkLU.js → select-model-B8gz_8C_.js} +1 -1
- package/dist/client/assets/seo-editor-DCppyDVT.js +1 -0
- package/dist/client/assets/{settings-layout-B12mDVFK.js → settings-layout-BYi6Agz-.js} +1 -1
- package/dist/client/assets/{settings-section-DWjadbjH.js → settings-section-pgSq0Nbi.js} +1 -1
- package/dist/client/assets/{sheet-D-hNRlw_.js → sheet-y2Nja_Ue.js} +1 -1
- package/dist/client/assets/{shell-controls-BGifAFuQ.js → shell-controls-DyDfxDen.js} +1 -1
- package/dist/client/assets/shell-layout-D8qm1N5L.js +1 -0
- package/dist/client/assets/shell-route-loading-DQ0B9hX1.js +1 -0
- package/dist/client/assets/{sidebar-3Sp07kli.js → sidebar-B3S1MC-b.js} +1 -1
- package/dist/client/assets/{skeleton-CQGVA-Lx.js → skeleton-thGJKlMg.js} +1 -1
- package/dist/client/assets/{sortable.esm-DR5iV7W2.js → sortable.esm-DYE94iJD.js} +1 -1
- package/dist/client/assets/{spinner-CCf2Lbex.js → spinner-j70e5pPL.js} +1 -1
- package/dist/client/assets/sso-DUhv1jLf.js +1 -0
- package/dist/client/assets/store-DxrJkSaq.js +1 -0
- package/dist/client/assets/store-registry-B_QywLhG.js +2 -0
- package/dist/client/assets/{switch-DhDeb5VA.js → switch-BZi96ipJ.js} +1 -1
- package/dist/client/assets/{tab-id-BNsa7AXA.js → tab-id-CjkvF5Bz.js} +1 -1
- package/dist/client/assets/{table-BMoC5dcf.js → table-C3TjNbDC.js} +1 -1
- package/dist/client/assets/{tabs-DiVDzsDA.js → tabs-sqzEAKlk.js} +1 -1
- package/dist/client/assets/{task-status-DJjK_vX7.js → task-status-CgfEdw1R.js} +1 -1
- package/dist/client/assets/{textarea-Cq68Cg3C.js → textarea-Bo_ElpPh.js} +1 -1
- package/dist/client/assets/{toggle-group-CVuIqYb9.js → toggle-group-jYWXBndg.js} +1 -1
- package/dist/client/assets/{toolbar-CKVgGEMh.js → toolbar-BIjePcgn.js} +1 -1
- package/dist/client/assets/{tools-list-6s8Pp55V.js → tools-list-9Kj7tcM0.js} +1 -1
- package/dist/client/assets/{tooltip-CLHWv9z-.js → tooltip-CC_mfaKY.js} +1 -1
- package/dist/client/assets/{types-Cxg1qjf9.js → types-btWFnXlQ.js} +1 -1
- package/dist/client/assets/use-ai-providers-D2jZ5H5p.js +1 -0
- package/dist/client/assets/use-automations-B6ZTT5n1.js +1 -0
- package/dist/client/assets/{use-capability-DGItFWVB.js → use-capability-aJI8msnV.js} +1 -1
- package/dist/client/assets/{use-collections-DxWiIX9G.js → use-collections-vRlJo8MD.js} +1 -1
- package/dist/client/assets/use-connection-MP_sOdrQ.js +1 -0
- package/dist/client/assets/{use-copy-N9gIT0E2.js → use-copy-BkzArvj8.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DilrGBsI.js → use-create-virtual-mcp-C88u5wPn.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B43AQzLm.js → use-debounced-autosave-C2TtzjZB.js} +1 -1
- package/dist/client/assets/use-delete-connection-D8ryW-Gn.js +1 -0
- package/dist/client/assets/use-file-configs-DGSgkVs8.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-DVN8HYM6.js → use-infinite-scroll-BYw2UY-G.js} +1 -1
- package/dist/client/assets/{use-list-state-VA1tpljN.js → use-list-state-CyVLGIWk.js} +1 -1
- package/dist/client/assets/use-mcp-client-Brxiewn2.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-CY9OUQZa.js → use-mcp-prompts-CKvrvNSD.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DXY52I1e.js → use-mcp-tools-DFeiBffX.js} +1 -1
- package/dist/client/assets/{use-members-9msf87Qx.js → use-members-D6H6sd8q.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B_6LJV9r.js → use-navigate-to-agent-BRFls8tQ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-5h3UhfD-.js → use-org-auth-client-IT7XMFB9.js} +1 -1
- package/dist/client/assets/{use-org-sso-BTJacuR9.js → use-org-sso-BWWAvGBF.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D4RU1UCZ.js → use-organization-roles-S9xtJ6m2.js} +1 -1
- package/dist/client/assets/use-organization-settings-DjvlRnDe.js +1 -0
- package/dist/client/assets/use-registry-connections-BQfixYFV.js +1 -0
- package/dist/client/assets/use-secrets-DEcBibJG.js +1 -0
- package/dist/client/assets/{use-status-sounds-CFOYqswl.js → use-status-sounds-BJZxFfhN.js} +1 -1
- package/dist/client/assets/{use-view-mode-lzqGiNUo.js → use-view-mode-DXlui5dm.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-DDTG_-f6.js +1 -0
- package/dist/client/assets/useInfiniteQuery-BEouccKd.js +1 -0
- package/dist/client/assets/{useRouterState-mAFXQkAT.js → useRouterState-xsU2zFoM.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-wDDb-pw7.js +1 -0
- package/dist/client/assets/user-BZco0YX9.js +1 -0
- package/dist/client/assets/{view-mode-toggle-PpUBwSzB.js → view-mode-toggle-BN8FgH0K.js} +1 -1
- package/dist/client/assets/workflow-BxGrEeHN.js +1 -0
- package/dist/client/assets/workflow-detail-QkGhQ2hI.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +489 -488
- package/dist/server/migrate.js +59 -59
- package/dist/server/server.js +311 -310
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-MSG0lE-F.js +0 -1
- package/dist/client/assets/agents-list-BjNtpZI5.js +0 -1
- package/dist/client/assets/ai-providers-DzY2b1ST.js +0 -1
- package/dist/client/assets/app-editor-BOf1C0bR.js +0 -1
- package/dist/client/assets/automation-runs-BPWO4Oxo.js +0 -1
- package/dist/client/assets/automations-BzMfwiu_.js +0 -1
- package/dist/client/assets/brand-context-fK95FTJj.js +0 -1
- package/dist/client/assets/buckets-C3L_6HTA.js +0 -1
- package/dist/client/assets/collection-detail-CindHN_k.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-Cd86_kfs.js +0 -1
- package/dist/client/assets/connection-card-DEJjtCgn.js +0 -1
- package/dist/client/assets/connection-detail-ChUQp5-t.js +0 -1
- package/dist/client/assets/connections-DN6XHtGB.js +0 -1
- package/dist/client/assets/constants-DDZG6Edw.js +0 -10
- package/dist/client/assets/domain-settings-BfbT9yk-.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-DLdasNw1.js +0 -1
- package/dist/client/assets/extract-connection-data-uGXsWpo7.js +0 -1
- package/dist/client/assets/features-Dr9Pp0WS.js +0 -1
- package/dist/client/assets/file-explorer-VM_XUNbz.js +0 -2
- package/dist/client/assets/general-DwCAWtBz.js +0 -1
- package/dist/client/assets/image-field-BaHZoCuZ.js +0 -1
- package/dist/client/assets/index-CEv88FJY.js +0 -1
- package/dist/client/assets/index-CPhDomOg.js +0 -1
- package/dist/client/assets/index-CW47dQON.js +0 -1
- package/dist/client/assets/members-CNZCKoI1.js +0 -3
- package/dist/client/assets/org-plugin-layout-BZ9dFRVl.js +0 -1
- package/dist/client/assets/page-seo-sheet-EUvWIgmh.js +0 -1
- package/dist/client/assets/plugin-layout-Bi-w5408.js +0 -1
- package/dist/client/assets/project-app-view-I1ua83t6.js +0 -1
- package/dist/client/assets/record-editor-B1-ONBrf.js +0 -1
- package/dist/client/assets/registry-CbWwvuqp.js +0 -2
- package/dist/client/assets/roles-B2-ESfgD.js +0 -1
- package/dist/client/assets/secrets-Dx_3aWOf.js +0 -1
- package/dist/client/assets/seo-editor-II_27c8U.js +0 -1
- package/dist/client/assets/shell-layout-DSHLjHdv.js +0 -1
- package/dist/client/assets/shell-route-loading-BMFmixVz.js +0 -1
- package/dist/client/assets/sso-qnvxODbb.js +0 -1
- package/dist/client/assets/store-DDT_HXod.js +0 -1
- package/dist/client/assets/store-registry-IbxDOVas.js +0 -2
- package/dist/client/assets/use-ai-providers-BUmRVTXM.js +0 -1
- package/dist/client/assets/use-automations-BQsS5jcL.js +0 -1
- package/dist/client/assets/use-connection-BKakpvkk.js +0 -1
- package/dist/client/assets/use-delete-connection-Sa9GqDFj.js +0 -1
- package/dist/client/assets/use-file-configs-BSxIo3R0.js +0 -1
- package/dist/client/assets/use-organization-settings-DeuE04BS.js +0 -1
- package/dist/client/assets/use-registry-connections-BFubWEDK.js +0 -1
- package/dist/client/assets/use-secrets-CEE2TPN5.js +0 -1
- package/dist/client/assets/use-virtual-mcp-wf8itLFJ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-FaewV0Uc.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DzO-0tti.js +0 -1
- package/dist/client/assets/user-ujRRaChx.js +0 -1
- package/dist/client/assets/workflow-BQljQVTn.js +0 -1
- package/dist/client/assets/workflow-detail-BK_EcA2N.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as P,aU as Qe,e as W,j as s,T as Te,W as re,q as le,G as fe,I as ze,H as Re,a as de,K as te,o as Q,B as ee,t as X,u as Je,c as ue,n as Ze,f as et,E as tt,v as st}from"./index-
|
|
1
|
+
import{r as P,aU as Qe,e as W,j as s,T as Te,W as re,q as le,G as fe,I as ze,H as Re,a as de,K as te,o as Q,B as ee,t as X,u as Je,c as ue,n as Ze,f as et,E as tt,v as st}from"./index-BfzqpoYd.js";import{C as it}from"./checkbox-DFFY_m2B.js";import{I as ne}from"./input-BGQcwAaL.js";import{d as nt,S as lt,a as ot,b as rt,c as at}from"./select-DpYu937I.js";import{S as q}from"./skeleton-thGJKlMg.js";import{a as Le,i as Pe,b as ct,s as dt}from"./RefreshCcw01-DlKjMM-5.js";import{b as ut,a as mt,c as ht,d as ft}from"./Tool01-DXWYgeBe.js";import{i as pt}from"./Key01-CR8zfCdU.js";import{i as $e}from"./SearchMd-z6b-QOmX.js";import{a as xt}from"./Settings02-C7YqxsZL.js";import{c as pe,u as gt,b as vt}from"./use-ai-providers-D2jZ5H5p.js";import{u as bt,c as yt}from"./chat-context-BIie9ysT.js";import{g as xe}from"./ai-providers-logos-DD3qZ33J.js";import{i as jt}from"./Monitor01-BNXW6pu5.js";import{i as St}from"./AlertCircle-B-p2hhbf.js";import{d as Fe,D as Nt,a as kt,b as wt,c as _t,e as Ct}from"./dialog-nXKceTRB.js";import{S as be}from"./spinner-j70e5pPL.js";import{S as me,u as he}from"./use-mcp-client-Brxiewn2.js";import{i as It}from"./ChevronRight-CtziSifX.js";import{A as Mt}from"./avatar-3vQWE5Hu.js";import{S as ye,a as je,b as Ke}from"./settings-section-pgSq0Nbi.js";import{s as De}from"./Eye-DepFjUJE.js";import{u as Et}from"./unwrap-tool-result-BYXdCQMg.js";import{C as Ot}from"./connect-desktop-dialog-BeLm4wl6.js";import{t as Se}from"./ChevronDown-BptXi8Ef.js";import{t as At}from"./Stars01-DcMeK1n0.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const p=i();if(!(p.length!==n.length||p.some((v,g)=>n[g]!==v)))return l;n=p;let h;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(h=Date.now()),l=e(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const v=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,S=g/16,j=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${j(g,5)} /${j(v,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function Ne(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Tt=(i,e)=>Math.abs(i-e)<1.01,zt=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},ke=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Rt=i=>i,Lt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},Pt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(ke(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){l({width:d.inlineSize,height:d.blockSize});return}}l(ke(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},we={passive:!0},_e=typeof window>"u"?!0:"onscrollend"in window,$t=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&_e?()=>{}:zt(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:p,isRtl:f}=i.options;l=p?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(l,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,we);const d=i.options.useScrollendEvent&&_e;return d&&t.addEventListener("scrollend",c,we),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Ft=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Kt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class Dt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rt,rangeExtractor:Lt,onChange:()=>{},measureElement:Ft,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let h=0;h<u;h++){const v=p[h];v&&(f[v.lane]=h)}for(let h=u;h<t;h++){const v=o(h),g=this.laneAssignments.get(h);let S,j;const w=c==="estimate"||d.has(v);if(g!==void 0&&this.options.lanes>1){S=g;const x=f[S],N=x!==void 0?p[x]:void 0;j=N?N.end+this.options.gap:n+l}else{const x=this.options.lanes===1?p[h-1]:this.getFurthestMeasurement(p,h);j=x?x.end+this.options.gap:n+l,S=x?x.lane:h%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(h,S)}const _=d.get(v),k=typeof _=="number"?_:this.options.estimateSize(h),T=j+k;p[h]={index:h,start:j,size:k,end:T,key:v,lane:S},f[S]=h}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ut({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return Ne(n[Ue(0,n.length-1,l=>Ne(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Tt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ue=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ut({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ue(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(n).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const Ce=typeof document<"u"?P.useLayoutEffect:P.useEffect;function Bt({useFlushSync:i=!0,...e}){const t=P.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Qe.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=P.useState(()=>new Dt(n));return l.setOptions(n),Ce(()=>l._didMount(),[]),Ce(()=>l._willUpdate()),l}function Wt(i){return Bt({observeElementRect:Pt,observeElementOffset:$t,scrollToFn:Kt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Ie(i){if(i)return ae.find(e=>e.id===i)}const Me=4;function oe(i){const e=W.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Mt,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(Ke,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Be(i){const e=W.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Yt),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,anthropic:1,google:2},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==n||e[4]!==t){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(b,A)=>{const M=c[b.id]??Number.MAX_SAFE_INTEGER,O=c[A.id]??Number.MAX_SAFE_INTEGER;return M-O},e[6]=_):_=e[6];const k=t.filter(Gt).sort(_);let T;e[7]!==t?(T=t.find(qt),e[7]=t,e[8]=T):T=e[8];const x=T;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ae.find(Ht),e[9]=N):N=e[9];const C=N;let I;e[10]!==n?(I=b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"provider",provider:b})},b.id),e[10]=n,e[11]=I):I=e[11];let m,y;e[12]!==n||e[13]!==x?(m=x&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],y=x?[...ae.filter(Vt).map(b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:b})},b.id)),s.jsx(oe,{logo:x.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[12]=n,e[13]=x,e[14]=m,e[15]=y):(m=e[14],y=e[15]),d=[...k.map(I),...m,...y],e[3]=n,e[4]=t,e[5]=d}else d=e[5];const u=d,p=u.length-Me,f=!!l&&p>0;let h;e[16]!==u||e[17]!==f?(h=f?u.slice(0,Me):u,e[16]=u,e[17]=f,e[18]=h):h=e[18];const v=h;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ye,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(je,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let S;e[22]!==p||e[23]!==l||e[24]!==f?(S=f&&s.jsx(Ke,{onClick:l,title:`${p} more provider${p===1?"":"s"}`,action:s.jsx(It,{size:16,className:"text-muted-foreground"})}),e[22]=p,e[23]=l,e[24]=f,e[25]=S):S=e[25];let j;e[26]!==S||e[27]!==v?(j=s.jsx(ye,{children:s.jsxs(je,{children:[v,S]})}),e[26]=S,e[27]=v,e[28]=j):j=e[28];let w;return e[29]!==g||e[30]!==j?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=w):w=e[31],w}function Vt(i){return i.id!=="openai"}function Ht(i){return i.id==="openai"}function qt(i){return i.id==="openai-compatible"}function Gt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Yt(i){return i.id==="deco"}const Xt=Te({label:re().optional(),apiKey:re().min(1,"API key is required")});function Qt(i){const e=W.c(62),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:me,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=he(r),c=fe(),[d,u]=P.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={resolver:ze(Xt),defaultValues:{label:"",apiKey:""}},e[3]=p):p=e[3];const{register:f,handleSubmit:h,formState:v}=Re(p),{errors:g}=v;let S;e[4]!==a||e[5]!==t?(S=async H=>{await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:t,label:H.label||"Personal key",apiKey:H.apiKey}})},e[4]=a,e[5]=t,e[6]=S):S=e[6];let j;e[7]!==l||e[8]!==o.id||e[9]!==c?(j=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Key saved successfully"),l()},e[7]=l,e[8]=o.id,e[9]=c,e[10]=j):j=e[10];let w;e[11]!==S||e[12]!==j?(w={mutationFn:S,onSuccess:j,onError:Jt},e[11]=S,e[12]=j,e[13]=w):w=e[13];const{mutate:_,isPending:k,error:T}=de(w);let x;e[14]!==_?(x=H=>_(H),e[14]=_,e[15]=x):x=e[15];let N;e[16]!==h||e[17]!==x?(N=h(x),e[16]=h,e[17]=x,e[18]=N):N=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=C):C=e[19];let I;e[20]!==f?(I=f("label"),e[20]=f,e[21]=I):I=e[21];let m;e[22]!==I?(m=s.jsxs("div",{className:"space-y-1",children:[C,s.jsx(ne,{placeholder:"e.g. Personal key",...I,className:"h-8 text-sm"})]}),e[22]=I,e[23]=m):m=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=y):y=e[24];const b=d?"text":"password";let A;e[25]!==f?(A=f("apiKey"),e[25]=f,e[26]=A):A=e[26];let M;e[27]!==b||e[28]!==A?(M=s.jsx(ne,{type:b,placeholder:"sk-...",...A,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=b,e[28]=A,e[29]=M):M=e[29];let O;e[30]!==d?(O=()=>u(!d),e[30]=d,e[31]=O):O=e[31];let z;e[32]!==d?(z=d?s.jsx(Le,{size:14}):s.jsx(De,{size:14}),e[32]=d,e[33]=z):z=e[33];let F;e[34]!==O||e[35]!==z?(F=s.jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[34]=O,e[35]=z,e[36]=F):F=e[36];let B;e[37]!==M||e[38]!==F?(B=s.jsxs("div",{className:"relative",children:[M,F]}),e[37]=M,e[38]=F,e[39]=B):B=e[39];let R;e[40]!==g.apiKey?(R=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[40]=g.apiKey,e[41]=R):R=e[41];let K;e[42]!==B||e[43]!==R?(K=s.jsxs("div",{className:"space-y-1",children:[y,B,R]}),e[42]=B,e[43]=R,e[44]=K):K=e[44];let $;e[45]!==T?($=T&&s.jsx("p",{className:"text-xs text-destructive",children:T.message}),e[45]=T,e[46]=$):$=e[46];let D;e[47]!==k||e[48]!==n?(D=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:k,children:"Cancel"}),e[47]=k,e[48]=n,e[49]=D):D=e[49];const V=k?"Saving...":"Save Key";let L;e[50]!==k||e[51]!==V?(L=s.jsx(ee,{type:"submit",size:"sm",disabled:k,children:V}),e[50]=k,e[51]=V,e[52]=L):L=e[52];let U;e[53]!==D||e[54]!==L?(U=s.jsxs(Fe,{children:[D,L]}),e[53]=D,e[54]=L,e[55]=U):U=e[55];let E;return e[56]!==m||e[57]!==K||e[58]!==$||e[59]!==U||e[60]!==N?(E=s.jsxs("form",{onSubmit:N,className:"space-y-3",children:[m,K,$,U]}),e[56]=m,e[57]=K,e[58]=$,e[59]=U,e[60]=N,e[61]=E):E=e[61],E}function Jt(i){Q.error(`Failed to save key: ${i.message}`)}const Zt=Te({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function es(i){const e=W.c(73),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:me,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=he(r),c=fe(),[d,u]=P.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=ze(Zt),e[3]=p):p=e[3];const f=t?.defaultBaseUrl??"";let h;e[4]!==f?(h={resolver:p,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[4]=f,e[5]=h):h=e[5];const{register:v,handleSubmit:g,formState:S}=Re(h),{errors:j}=S;let w;e[6]!==a||e[7]!==t?(w=async se=>{const Xe=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Xe,...t?{presetId:t.id}:{}}})},e[6]=a,e[7]=t,e[8]=w):w=e[8];let _;e[9]!==l||e[10]!==o.id||e[11]!==c?(_=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Connection saved successfully"),l()},e[9]=l,e[10]=o.id,e[11]=c,e[12]=_):_=e[12];let k;e[13]!==w||e[14]!==_?(k={mutationFn:w,onSuccess:_,onError:ts},e[13]=w,e[14]=_,e[15]=k):k=e[15];const{mutate:T,isPending:x,error:N}=de(k),C=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",I=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let m;e[16]!==T?(m=se=>T(se),e[16]=T,e[17]=m):m=e[17];let y;e[18]!==g||e[19]!==m?(y=g(m),e[18]=g,e[19]=m,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[21]=b):b=e[21];let A;e[22]!==v?(A=v("label"),e[22]=v,e[23]=A):A=e[23];let M;e[24]!==C||e[25]!==A?(M=s.jsxs("div",{className:"space-y-1",children:[b,s.jsx(ne,{placeholder:C,...A,className:"h-8 text-sm"})]}),e[24]=C,e[25]=A,e[26]=M):M=e[26];let O;e[27]!==I||e[28]!==j||e[29]!==t?.defaultBaseUrl||e[30]!==v?(O=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...v("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:I,...v("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[27]=I,e[28]=j,e[29]=t?.defaultBaseUrl,e[30]=v,e[31]=O):O=e[31];const z=t?.apiKeyRecommended?"recommended":"optional";let F;e[32]!==z?(F=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[32]=z,e[33]=F):F=e[33];const B=d?"text":"password";let R;e[34]!==v?(R=v("apiKey"),e[34]=v,e[35]=R):R=e[35];let K;e[36]!==B||e[37]!==R?(K=s.jsx(ne,{type:B,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[36]=B,e[37]=R,e[38]=K):K=e[38];let $;e[39]!==d?($=()=>u(!d),e[39]=d,e[40]=$):$=e[40];let D;e[41]!==d?(D=d?s.jsx(Le,{size:14}):s.jsx(De,{size:14}),e[41]=d,e[42]=D):D=e[42];let V;e[43]!==$||e[44]!==D?(V=s.jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:D}),e[43]=$,e[44]=D,e[45]=V):V=e[45];let L;e[46]!==K||e[47]!==V?(L=s.jsxs("div",{className:"relative",children:[K,V]}),e[46]=K,e[47]=V,e[48]=L):L=e[48];let U;e[49]!==F||e[50]!==L?(U=s.jsxs("div",{className:"space-y-1",children:[F,L]}),e[49]=F,e[50]=L,e[51]=U):U=e[51];let E;e[52]!==t?(E=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[52]=t,e[53]=E):E=e[53];let H;e[54]!==N?(H=N&&s.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[54]=N,e[55]=H):H=e[55];let G;e[56]!==x||e[57]!==n?(G=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:x,children:"Cancel"}),e[56]=x,e[57]=n,e[58]=G):G=e[58];const J=x?"Saving...":"Save Connection";let Y;e[59]!==x||e[60]!==J?(Y=s.jsx(ee,{type:"submit",size:"sm",disabled:x,children:J}),e[59]=x,e[60]=J,e[61]=Y):Y=e[61];let Z;e[62]!==G||e[63]!==Y?(Z=s.jsxs(Fe,{children:[G,Y]}),e[62]=G,e[63]=Y,e[64]=Z):Z=e[64];let ce;return e[65]!==y||e[66]!==M||e[67]!==O||e[68]!==U||e[69]!==E||e[70]!==H||e[71]!==Z?(ce=s.jsxs("form",{onSubmit:y,className:"space-y-3",children:[M,O,U,E,H,Z]}),e[65]=y,e[66]=M,e[67]=O,e[68]=U,e[69]=E,e[70]=H,e[71]=Z,e[72]=ce):ce=e[72],ce}function ts(i){Q.error(`Failed to save connection: ${i.message}`)}const ss={kind:"closed"};function is(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ns(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ls({open:i,onOpenChange:e,initialProvider:t}){const l=pe()?.providers??[],{org:o}=le(),r=he({connectionId:me,orgId:o.id,orgSlug:o.slug}),a=fe(),[c,d]=P.useReducer(is,ss),u=P.useRef(!1);P.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const p=()=>{u.current=!1,d({type:"close"}),e(!1)},f=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:h}=de({mutationFn:async({providerId:m,code:y,stateToken:b,label:A})=>{const M=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:m,code:y,stateToken:b,label:A}});if(M?.isError)throw new Error(M.content?.[0]?.text??"OAuth exchange failed");return m},onSuccess:m=>{X("ai_provider_oauth_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_oauth_failed",{provider_id:y.providerId,error:m.message}),Q.error(`OAuth connection failed: ${m.message}`),d({type:"oauth-failed"})}}),{mutate:v}=de({mutationFn:async m=>{const y=await r.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:m}});if(y?.isError)throw new Error(y.content?.[0]?.text??"Key provisioning failed");return m},onSuccess:m=>{X("ai_provider_provision_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_provision_failed",{provider_id:y,error:m.message}),d({type:"provision-error",error:m.message})}}),g=async m=>{const{provider:y}=m,b=m.kind==="openai-compatible"?m.preset?.id??null:null,A=y.supportedMethods.includes("oauth-pkce"),M=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){X("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),v(y.id);return}if(A){X("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const z=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(!z.structuredContent)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:z.structuredContent.stateToken}),window.open(z.structuredContent.url,"AiProviderOAuth","width=600,height=700")}catch(z){Q.error(`Failed to start OAuth: ${z instanceof Error?z.message:String(z)}`)}return}M&&(X("ai_provider_connect_clicked",{provider_id:y.id,...b!==null?{preset_id:b}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:b}))},S=P.useRef(g);S.current=g;const j=P.useRef(t);j.current=t,P.useEffect(()=>{!j.current||c.kind!=="grid"||u.current||(u.current=!0,S.current(j.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,_=c.kind==="oauth-pending"?c.providerId:null;P.useEffect(()=>{if(c.kind!=="oauth-pending")return;let m=!1;const y=c.stateToken,b=c.providerId,A=O=>{if(O.origin!==window.location.origin||O.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:z,stateToken:F}=O.data;if(F!==y){Q.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}m=!0;const B=l.find(R=>R.id===b);h({providerId:b,code:z,stateToken:y,label:B?.name??b})};window.addEventListener("message",A);const M=setTimeout(()=>{m||(X("ai_provider_oauth_timeout",{provider_id:b}),d({type:"oauth-failed"}),Q.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",A),clearTimeout(M)}},[c.kind,w,_,h]);const k=ns(c),T=k?l.find(m=>m.id===k):null,N=(c.kind==="form"&&c.presetId?ae.find(m=>m.id===c.presetId):null)?.name??T?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",I=()=>{t?p():d({type:"back"})};return s.jsx(Nt,{open:c.kind!=="closed",onOpenChange:m=>!m&&p(),children:s.jsxs(kt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(wt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:I,children:s.jsx(Pe,{size:16})}),s.jsx(_t,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(Ct,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Be,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(es,{preset:c.presetId?ae.find(m=>m.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}}):s.jsx(Qt,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(St,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),v(c.providerId)},children:"Retry"})]})]})]})})}function os(){const i=W.c(10),{org:e}=le();let t;i[0]!==e.id||i[1]!==e.slug?(t={connectionId:me,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=t):t=i[2];const n=he(t);let l;i[3]!==e.id?(l=te.defaultBrand(e.id),i[3]=e.id,i[4]=l):l=i[4];let o;i[5]!==n?(o=async()=>{const c=await n.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),d=Et(c);return(Array.isArray(d?.items)?d.items:[]).find(rs)??null},i[5]=n,i[6]=o):o=i[6];let r;i[7]!==l||i[8]!==o?(r={queryKey:l,queryFn:o},i[7]=l,i[8]=o,i[9]=r):r=i[9];const{data:a}=Ze(r);return a??null}function rs(i){return i.isDefault&&!i.archivedAt}function as(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function cs(i){const e=W.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Je(),a=os(),c=bt(),[d,u]=P.useState(null),[p,f]=P.useState(!1),[h,v]=P.useState(!1),g=pe();let S;e[2]!==g?.providers?(S=g?.providers??[],e[2]=g?.providers,e[3]=S):S=e[3];const j=S,w=o.name;let _;e[4]!==a?(_=a?as(a):null,e[4]=a,e[5]=_):_=e[5];const k=_,T=a?.favicon??a?.logo??null,x=n??(w?`${w} is ready for agents`:"Your agents are almost ready"),N=l??(r?"Connect a provider, or run `bunx decocms link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(T||k);let I;e[6]!==k?(I=k?{backgroundColor:`${k}18`,borderColor:`${k}30`}:void 0,e[6]=k,e[7]=I):I=e[7];const m=I,y=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let b;e[8]!==y||e[9]!==m||e[10]!==T||e[11]!==c||e[12]!==k?(b=T?s.jsx("div",{className:y,style:m,children:s.jsx("img",{src:T,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>v(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:ue(y,"cursor-pointer transition-colors hover:bg-accent"),style:m,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(jt,{size:24,style:k?{color:k}:void 0,className:ue(!k&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=y,e[9]=m,e[10]=T,e[11]=c,e[12]=k,e[13]=b):b=e[13];let A;e[14]!==x?(A=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:x}),e[14]=x,e[15]=A):A=e[15];let M;e[16]!==N?(M=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:N}),e[16]=N,e[17]=M):M=e[17];let O;e[18]!==A||e[19]!==M?(O=s.jsxs("div",{className:"space-y-2",children:[A,M]}),e[18]=A,e[19]=M,e[20]=O):O=e[20];let z;e[21]!==b||e[22]!==O?(z=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[b,O]}),e[21]=b,e[22]=O,e[23]=z):z=e[23];let F,B;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=E=>u(E),B=()=>f(!0),e[24]=F,e[25]=B):(F=e[24],B=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(Be,{providers:j,onSelect:F,onShowAll:B})}),e[26]=j,e[27]=R):R=e[27];const K=d!==null||p;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=E=>{E||(u(null),f(!1))},e[28]=$):$=e[28];const D=d??void 0;let V;e[29]!==K||e[30]!==D?(V=s.jsx(ls,{open:K,onOpenChange:$,initialProvider:D}),e[29]=K,e[30]=D,e[31]=V):V=e[31];let L;e[32]!==h?(L=s.jsx(Ot,{open:h,onOpenChange:v}),e[32]=h,e[33]=L):L=e[33];let U;return e[34]!==R||e[35]!==V||e[36]!==L||e[37]!==z?(U=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[z,R,V,L]}),e[34]=R,e[35]=V,e[36]=L,e[37]=z,e[38]=U):U=e[38],U}function ge(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function ds(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const us=["bg-destructive","bg-warning","bg-success","bg-success"],ms=["text-success","text-warning","text-warning","text-destructive"];function hs(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function fs(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ps={text:{icon:s.jsx(ht,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(ct,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(At,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx($e,{className:"size-3.5"}),label:"Web search"}};function xs(i){const e=W.c(5),{capability:t}=i;let n;e[0]!==t?(n=ps[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function gs(i){const e=W.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=x):x=e[0],x}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=ge(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(l){let x;e[3]!==t.limits?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=x):x=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let I;e[9]!==t.limits?(I=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=I):I=e[10];let m;return e[11]!==x||e[12]!==N||e[13]!==C||e[14]!==I?(m=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,N,C,I]}),e[11]=x,e[12]=N,e[13]=C,e[14]=I,e[15]=m):m=e[15],m}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let p;e[18]!==t.logo||e[19]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=p):p=e[20];let f;e[21]!==d?(f=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=f):f=e[22];let h;e[23]!==p||e[24]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,f]}),e[23]=p,e[24]=f,e[25]=h):h=e[25];let v;e[26]!==t.modelId?(v=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=v):v=e[27];let g;e[28]!==u||e[29]!==h||e[30]!==v?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,h,v]}),e[28]=u,e[29]=h,e[30]=v,e[31]=g):g=e[31];let S;e[32]!==t.capabilities?(S=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(vs)}),e[32]=t.capabilities,e[33]=S):S=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:x,label:N,description:C}=ds(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(I=>s.jsx("div",{className:ue("w-2 h-2 rounded-full",I<=x?us[x-1]:"bg-muted")},I))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:hs(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let _;e[38]!==o||e[39]!==r?(_=(o!=null||r!=null)&&(()=>{const{level:x,label:N}=o!=null?fs(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:ue("text-sm font-bold leading-none",C<=x?ms[x-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=_):_=e[40];let k;e[41]!==j||e[42]!==w||e[43]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,w,_]}),e[41]=j,e[42]=w,e[43]=_,e[44]=k):k=e[44];let T;return e[45]!==k||e[46]!==g||e[47]!==S?(T=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,S,k]}),e[45]=k,e[46]=g,e[47]=S,e[48]=T):T=e[48],T}function vs(i){return s.jsx(xs,{capability:i},i)}function fi(i){const e=W.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(q,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(q,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=S):S=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,S]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=ge(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=xe(t),e[8]=t,e[9]=d):d=e[9];const u=d;let p;e[10]!==t.title||e[11]!==u?(p=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=p):p=e[12];let f;e[13]!==c?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=f):f=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=h):h=e[15];let v;return e[16]!==p||e[17]!==f?(v=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[p,f,h]}),e[16]=p,e[17]=f,e[18]=v):v=e[18],v}const bs=["vision","image","file","audio","video"],We=["image/png","image/jpeg","image/gif","image/webp"],Ve=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ve(i){const e=i?.capabilities;return e?bs.some(t=>e.includes(t)):!1}function pi(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&We.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||ve(e)&&Ve.includes(i))}function xi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...We),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ve(i)&&t.push(...Ve),t.join(",")}function gi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),ve(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const He=["smarter","faster","cheaper"],qe={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},ys=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],js=ys.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ss=new Set(["google/gemini-2.5-pro"]),Ee=new Map;function Ns(i){const e=Ee.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else e:for(const{tier:n,prefix:l}of js)if(i.startsWith(l)){if(Ss.has(l)&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue e}t=n;break}return Ee.set(i,t),t}function Oe(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=Ns(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const Ge="mesh:model-shortlist:",ks=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function ws(i){try{const e=localStorage.getItem(Ge+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function _s(i,e){localStorage.setItem(Ge+i,JSON.stringify([...e]))}function Cs(i){const e=W.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=ge(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=xe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==n?(d=()=>n(t),e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let p;e[10]!==o?(p=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=p):p=e[11];let f;e[12]!==r?(f=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=f):f=e[13];let h;e[14]!==p||e[15]!==f?(h=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[p,f]}),e[14]=p,e[15]=f,e[16]=h):h=e[16];let v;return e[17]!==d||e[18]!==u||e[19]!==h?(v=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,h]}),e[17]=d,e[18]=u,e[19]=h,e[20]=v):v=e[20],v}function Is(i){const e=W.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(st,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(dt,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==n?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ms(){const i=W.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Es)}),i[0]=e):e=i[0],e}function Es(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ae(i){const e=W.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let d;e[6]!==o||e[7]!==l?(d=u=>s.jsx("div",{onClick:()=>l(u),className:"cursor-pointer",children:s.jsx(Cs,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=l,e[8]=d):d=e[8],a=n.map(d),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Os(i){const e=W.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=P.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=xe(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let p;e[5]!==t.modelId||e[6]!==l?(p=()=>{a(As),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==r||e[9]!==p?(f=s.jsx(it,{checked:r,onCheckedChange:p}),e[8]=r,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==d||e[12]!==t.title?(h=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=h):h=e[13];let v;e[14]!==t.title?(v=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=v):v=e[15];let g;return e[16]!==u||e[17]!==f||e[18]!==h||e[19]!==v?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[f,h,v]}),e[16]=u,e[17]=f,e[18]=h,e[19]=v,e[20]=g):g=e[20],g}function As(i){return!i}function Ts(i){const e=[];for(const t of He)if(i[t].length>0){e.push({type:"header",label:qe[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function zs({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=P.useRef(null),o=Wt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Os,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function Rs(i){const e=W.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=vt(t),u=c?d.filter(c):d.filter(Ls);let p;e[0]!==t?(p=()=>(t?ws(t):null)??ks,e[0]=t,e[1]=p):p=e[1];const[f,h]=P.useState(p),[,v]=P.useTransition();let g;e[2]!==t||e[3]!==v?(g=m=>{t&&v(()=>{h(y=>{const b=new Set(y);return b.has(m)?b.delete(m):b.add(m),_s(t,b),b})})},e[2]=t,e[3]=v,e[4]=g):g=e[4];const S=g,j=n.toLowerCase().trim(),w=m=>j?m.filter(y=>y.title.toLowerCase().includes(j)||y.modelId.toLowerCase().includes(j)):m;if(r){const m=Oe(w(u)),y=Ts(m);let b;e[5]!==f?(b=z=>f.has(z.modelId),e[5]=f,e[6]=b):b=e[6];const A=u.filter(b).length;let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Pe,{size:14}),e[7]=M):M=e[7];let O;return e[8]!==a?(O=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[M,"Back"]}),e[8]=a,e[9]=O):O=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[O,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[A," selected"]})]}),s.jsx(zs,{items:y,shortlistSet:f,onToggle:S,onHover:l})]})}let _;e[10]!==f?(_=m=>f.has(m.modelId),e[10]=f,e[11]=_):_=e[11];const k=u.filter(_),T=k.length>0?k:u,x=Oe(w(T));let N;e[12]!==x||e[13]!==l||e[14]!==o?(N=He.map(m=>s.jsx(Ae,{label:qe[m],models:x[m],onSelect:o,onHover:l},m)),e[12]=x,e[13]=l,e[14]=o,e[15]=N):N=e[15];let C;e[16]!==x.other||e[17]!==l||e[18]!==o?(C=s.jsx(Ae,{label:"Other",models:x.other,onSelect:o,onHover:l}),e[16]=x.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let I;return e[20]!==N||e[21]!==C?(I=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,C]}),e[20]=N,e[21]=C,e[22]=I):I=e[22],I}function Ls(i){return i.asyncResearch!==!0}function vi(){const i=W.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(q,{className:"size-4 shrink-0"}),s.jsx(q,{className:"flex-1 h-6"}),s.jsx(q,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Ps)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(q,{className:"size-6 shrink-0"}),s.jsx(q,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q,{className:"h-6 w-20 rounded-md"}),s.jsx(q,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-24"}),s.jsx(q,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-16"}),s.jsx(q,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Ps(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ye(i){const e=W.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=P.useState(null),[u,p]=P.useState(""),[f,h]=P.useState(!1),v=P.useRef(null),g=pe(),S=gt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ks)),e[0]=g?.providers,e[1]=j):j=e[1];const w=j,_=et(),{org:k}=le();let T;e[2]!==l?(T=E=>{l(E),d(null)},e[2]=l,e[3]=T):T=e[3];const x=T;let N;e[4]!==n||e[5]!==t||e[6]!==r?(N=E=>{n&&(r(E),p(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=N):N=e[7];const C=N;if(S.length===0){let E;return e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(cs,{})}),e[8]=E):E=e[8],E}let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx($e,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=I):I=e[9];const m=f?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=E=>p(E.target.value),e[10]=y):y=e[10];let b;e[11]!==u||e[12]!==m?(b=s.jsx(ne,{ref:v,type:"text",placeholder:m,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=m,e[13]=b):b=e[13];let A;e[14]!==n||e[15]!==x||e[16]!==S||e[17]!==w?(A=S.length>0&&s.jsxs(nt,{value:n??"",onValueChange:x,children:[s.jsxs(lt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Fs,children:[s.jsx(ot,{placeholder:"Key",children:(()=>{const E=S.find(Z=>Z.id===n),H=E?w[E.providerId]:void 0,G=Ie(E?.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??E?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Y.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:Y})]})})()}),s.jsx(ft,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(rt,{children:S.map(E=>{const H=w[E.providerId],G=Ie(E.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??E.providerId;return s.jsx(at,{value:E.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Y.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[Y," — ",E.label]})]})},E.id)})})]}),e[14]=n,e[15]=x,e[16]=S,e[17]=w,e[18]=A):A=e[18];let M;e[19]!==b||e[20]!==A?(M=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[I,b,A]})}),e[19]=b,e[20]=A,e[21]=M):M=e[21];let O;e[22]!==n?(O=E=>{const{error:H,resetError:G}=E;return s.jsx(Is,{error:H,onRetry:G,credentialId:n??void 0})},e[22]=n,e[23]=O):O=e[23];let z;e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ms,{}),e[24]=z):z=e[24];const F=n??void 0;let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=()=>h($s),e[25]=B):B=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==f||e[29]!==u||e[30]!==F?(R=s.jsx(P.Suspense,{fallback:z,children:s.jsx(Rs,{keyId:F,searchTerm:u,onHover:d,onModelSelect:C,managing:f,onToggleManage:B,filterModels:a})}),e[26]=a,e[27]=C,e[28]=f,e[29]=u,e[30]=F,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==O||e[34]!==R?(K=s.jsx(tt,{fallback:O,children:R},n),e[32]=n,e[33]=O,e[34]=R,e[35]=K):K=e[35];let $;e[36]!==f||e[37]!==_||e[38]!==k?($=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>P.startTransition(()=>h(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(xt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({to:"/$org/settings/ai-providers",params:{org:k.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(pt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=f,e[37]=_,e[38]=k,e[39]=$):$=e[39];let D;e[40]!==K||e[41]!==$||e[42]!==M?(D=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[M,K,$]}),e[40]=K,e[41]=$,e[42]=M,e[43]=D):D=e[43];const V=c??o??null;let L;e[44]!==V?(L=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(gs,{model:V})}),e[44]=V,e[45]=L):L=e[45];let U;return e[46]!==D||e[47]!==L?(U=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[D,L]}),e[46]=D,e[47]=L,e[48]=U):U=e[48],U}function $s(i){return!i}function Fs(i){return i.stopPropagation()}function Ks(i){return[i.id,i]}function Ds(i){const e=W.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=yt();let a;e[0]!==l?(a=u=>{X("chat_credential_changed",{credential_id:u}),l(u)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=u=>{n&&(X("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:n}),r({...u,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(Ye,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function bi(i){const e=W.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx(Ds,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function yi(i){const e=W.c(2);let t;return e[0]!==i?(t=s.jsx(Ye,{...i}),e[0]=i,e[1]=t):t=e[1],t}function ji(i){const e=W.c(3),{size:t}=i,n=t===void 0?16:t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=l):l=e[0];let o;return e[1]!==n?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:n,height:n,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l}),e[1]=n,e[2]=o):o=e[2],o}function Si(i){const e=W.c(3),{size:t}=i,n=t===void 0?16:t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=l):l=e[0];let o;return e[1]!==n?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:n,height:n,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:l}),e[1]=n,e[2]=o):o=e[2],o}export{ji as C,yi as D,vi as M,cs as N,ae as O,Be as P,fi as S,Si as a,xi as b,ls as c,bi as d,gi as g,pi as i,ve as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as se,j as s,B as Z,q as me,r as Y,t as v,o as de}from"./index-BfzqpoYd.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-DpfpR4kx.js";import{s as pe}from"./Star01-q6EhXttt.js";import{a as fe}from"./Users03-D5pU3_ql.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-Dlio4Q6_.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-DDTG_-f6.js";import{P as q}from"./index-CVPVNlMM.js";import{i as ye}from"./DotsVertical-DQ3UGDDE.js";import{a as Ne}from"./Settings02-C7YqxsZL.js";import{s as Se}from"./Trash01-B91-1KNk.js";import{A as De,ao as ve}from"./agent-icon-Lc1AgwlE.js";import{k as Ae}from"./use-navigate-to-agent-BRFls8tQ.js";import{C as ke}from"./card-CeH_PUFE.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-aJI8msnV.js";import{E as Te}from"./empty-state-BJuYi96S.js";import{u as ze}from"./use-create-virtual-mcp-C88u5wPn.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-DJLxSS_E.js";import{S as $e}from"./search-input-C3i2qrnL.js";import{s as le}from"./Plus-gXoAw_mX.js";import"./Check-CSixRgqh.js";import"./ChevronRight-CtziSifX.js";import"./use-connection-MP_sOdrQ.js";import"./use-collections-vRlJo8MD.js";import"./use-mcp-client-Brxiewn2.js";import"./dialog-nXKceTRB.js";import"./X-DCWlm9Ta.js";import"./RefreshCcw01-DlKjMM-5.js";import"./collection-search-Bryj5VYk.js";import"./SearchMd-z6b-QOmX.js";import"./checkbox-DFFY_m2B.js";import"./use-mcp-tools-DFeiBffX.js";import"./extract-connection-data-DxtHEsy3.js";import"./generate-id-DvX29Me7.js";import"./collections-B-UBhIxv.js";import"./sidebar-B3S1MC-b.js";import"./LayoutLeft-6fPyjOVd.js";import"./tooltip-CC_mfaKY.js";import"./sheet-y2Nja_Ue.js";import"./AlertCircle-B-p2hhbf.js";import"./Tool01-DXWYgeBe.js";import"./SwitchHorizontal01-__hAuhZa.js";import"./XCircle-CEKwTNMD.js";import"./ArrowUpRight-Bq-dJGgn.js";import"./ZapSquare-DSdwG_FE.js";import"./CheckCircle-CqLcOI7o.js";import"./ChevronDown-BptXi8Ef.js";import"./ChevronLeft-Bq6F--2K.js";import"./ChevronUp-DChs66VU.js";import"./Container-DIwdobum.js";import"./Eye-DepFjUJE.js";import"./ZoomOut-CCPaeWry.js";import"./Globe01-BayTDYGC.js";import"./FilterLines-CIJgiiLT.js";import"./Palette-siqkt4cQ.js";import"./HardDrive-OwnJRrIS.js";import"./Stars02-DJ4Y5TfK.js";import"./Key01-CR8zfCdU.js";import"./LinkExternal01-B2YZgRTN.js";import"./Monitor01-BNXW6pu5.js";import"./Sun-CeFpMHQU.js";import"./Play-CBt0NeLA.js";import"./Shield01-BT66FEMI.js";import"./Stars01-DcMeK1n0.js";import"./Upload01-CcwGyBRP.js";import"./User01-JR_76gHl.js";import"./Users01-BM2QLqUJ.js";import"./XClose-DhQ5V0ST.js";import"./Zap-BLBAeivN.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:ge,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function rs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=he(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const K=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(xe,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{rs as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as B,W as C,aH as ce,aJ as ae,aK as be,aI as ye,ba as pe,e as M,I as ve,H as je,r as T,j as s,D as $e,o as Q,C as _e,q as H,G as ne,a as ee,K as G,n as Ie,c as ge,B as V,t as Se,E as Te}from"./index-BfzqpoYd.js";import{i as Oe}from"./AlertCircle-B-p2hhbf.js";import{P as oe}from"./index-CVPVNlMM.js";import{S as de}from"./skeleton-thGJKlMg.js";import{b as ke,a as me,S as ue,c as Me}from"./settings-section-pgSq0Nbi.js";import{u as te,b as re,c as Ce}from"./use-ai-providers-D2jZ5H5p.js";import{i as Ue}from"./CheckCircle-CqLcOI7o.js";import{p as ze}from"./chat-context-BIie9ysT.js";import{e as Le,f as qe}from"./use-organization-settings-DjvlRnDe.js";import{M as Ve}from"./select-model-B8gz_8C_.js";import{u as Be}from"./use-debounced-autosave-C2TtzjZB.js";import{I as le}from"./input-BGQcwAaL.js";import{a as he,T as Ge}from"./toggle-group-jYWXBndg.js";import{b as Ne,c as we,d as Pe,f as Ae,a as De,e as Ke,g as Ee,A as Fe}from"./alert-dialog-DJLxSS_E.js";import{S as J,u as X}from"./use-mcp-client-Brxiewn2.js";import{s as Qe}from"./Plus-gXoAw_mX.js";import{i as We}from"./Tool01-DXWYgeBe.js";import{s as Ye}from"./Trash01-B91-1KNk.js";import{A as He}from"./avatar-3vQWE5Hu.js";import{O as Re,P as Je,c as xe}from"./agent-icons-Cprwkzhw.js";import{a as Xe}from"./RefreshCcw01-DlKjMM-5.js";import{s as Ze}from"./Eye-DepFjUJE.js";import{d as et,b as tt,c as st,a as it,D as ot}from"./dialog-nXKceTRB.js";import{S as rt}from"./spinner-j70e5pPL.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as nt}from"./require-capability-Bi88Fg3q.js";import"./sidebar-B3S1MC-b.js";import"./LayoutLeft-6fPyjOVd.js";import"./tooltip-CC_mfaKY.js";import"./sheet-y2Nja_Ue.js";import"./X-DCWlm9Ta.js";import"./card-CeH_PUFE.js";import"./ArrowUpRight-Bq-dJGgn.js";import"./tab-id-CjkvF5Bz.js";import"./decopilot-sse-pool-vfZK3kan.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-DDTG_-f6.js";import"./use-collections-vRlJo8MD.js";import"./drawer-lSnonzW3.js";import"./User01-JR_76gHl.js";import"./checkbox-DFFY_m2B.js";import"./Check-CSixRgqh.js";import"./select-DpYu937I.js";import"./ChevronDown-BptXi8Ef.js";import"./ChevronUp-DChs66VU.js";import"./Key01-CR8zfCdU.js";import"./SearchMd-z6b-QOmX.js";import"./Settings02-C7YqxsZL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BNXW6pu5.js";import"./ChevronRight-CtziSifX.js";import"./connect-desktop-dialog-BeLm4wl6.js";import"./Stars01-DcMeK1n0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-aJI8msnV.js";import"./access-gate-DXlQ8iVy.js";import"./capability-load-error-Dn3qy9VI.js";B({title:C(),url:C(),icon:C()});B({registries:ae(C(),B({enabled:be()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ce(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const Z=B({keyId:C(),modelId:C(),title:C().optional()}).nullable();ye(["fast","smart","thinking","image","web_research"]);ye(["fast","smart","thinking"]);const at=B({tiers:B({fast:Z,smart:Z,thinking:Z,image:Z,web_research:Z})});B({ids:ce(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:B({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")}).nullable().optional().describe("Font families by semantic role"),colors:B({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)")}).nullable().optional().describe("Semantic color palette"),images:ce(ae(C(),pe())).nullable().optional().describe("Brand images"),metadata:ae(C(),pe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:be().optional().describe("Whether this is the default brand for the organization")});const ct=e=>e.capabilities?.includes("image")===!0,dt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:ct},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:dt}];function ut(e){const t=M.c(20),{slot:i,onSlotChange:l,filterModels:o,defaultKeyId:a}=e,r=te(),[n,p]=T.useState(i?.keyId??a);let y;t[0]!==i?(y=()=>{i?.keyId&&p(i.keyId)},t[0]=i,t[1]=y):y=t[1];const I=i?.keyId;let h;t[2]!==I?(h=[I],t[2]=I,t[3]=h):h=t[3],T.useEffect(y,h);const c=n??a;let u;t[4]!==c||t[5]!==r?(u=c?r.find(d=>d.id===c):null,t[4]=c,t[5]=r,t[6]=u):u=t[6];const k=u,{models:m,isLoading:S}=re(o?c??void 0:void 0),v=o?S||m.some(o):!0;let g;t[7]!==i||t[8]!==k?.providerId?(g=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=k?.providerId,t[9]=g):g=t[9];const x=g;if(o&&!v){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=d):d=t[10],d}let b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=d=>p(d),t[11]=b):b=t[11];let j;t[12]!==c||t[13]!==l?(j=d=>{const w=d.keyId??c??"";p(w),l({keyId:w,modelId:d.modelId,title:d.title})},t[12]=c,t[13]=l,t[14]=j):j=t[14];let f;return t[15]!==c||t[16]!==o||t[17]!==x||t[18]!==j?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:x,credentialId:c,filterModels:o,onCredentialChange:b,onModelChange:j}),t[15]=c,t[16]=o,t[17]=x,t[18]=j,t[19]=f):f=t[19],f}function ft(e){const t=M.c(2),{isPending:i,showSaved:l}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(_e,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(l){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ue,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function pt(){const e=M.c(42),t=te(),i=Le(),l=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ve(at),e[0]=o):o=e[0];let a;e[1]!==i?(a={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=a):a=e[2];const r=je(a),{mutate:n,isPending:p,isSuccess:y}=qe(),I=r.formState.isDirty;let h;e[3]!==r||e[4]!==i||e[5]!==n?(h={delayMs:250,save:async()=>{const _=r.getValues();n(_,{onSuccess:()=>r.reset(_,{keepValues:!0}),onError:F=>{r.reset(i),Q.error(`Failed to save: ${F.message}`)}})}},e[3]=r,e[4]=i,e[5]=n,e[6]=h):h=e[6];const{schedule:c}=Be(h),u=t[0],k=t[1],m=t[2],{models:S}=re(u?.id),{models:v}=re(k?.id),{models:g}=re(m?.id);let x,b;e[7]!==r||e[8]!==l?(x=()=>{l||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},b=[l,r],e[7]=r,e[8]=l,e[9]=x,e[10]=b):(x=e[9],b=e[10]),T.useEffect(x,b);let j;e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==k||e[15]!==m||e[16]!==S||e[17]!==v||e[18]!==g?(j=()=>{const _=r.getValues(),F=new Set(t.map(gt)),P={};u?.id&&(P[u.id]=S),k?.id&&(P[k.id]=v),m?.id&&(P[m.id]=g);const E=W=>W!=null&&!F.has(W.keyId),N={fast:E(_.tiers.fast)?null:_.tiers.fast,smart:E(_.tiers.smart)?null:_.tiers.smart,thinking:E(_.tiers.thinking)?null:_.tiers.thinking,image:E(_.tiers.image)?null:_.tiers.image,web_research:E(_.tiers.web_research)?null:_.tiers.web_research},L=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,q=N.fast===_.tiers.fast&&N.smart===_.tiers.smart&&N.thinking===_.tiers.thinking&&N.image===_.tiers.image&&N.web_research===_.tiers.web_research;if(!L&&q)return;const R=ze(t,P);r.reset({tiers:{fast:N.fast??R.chat.fast,smart:N.smart??R.chat.smart,thinking:N.thinking??R.chat.thinking,image:N.image??R.image,web_research:N.web_research??R.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=u,e[14]=k,e[15]=m,e[16]=S,e[17]=v,e[18]=g,e[19]=j):j=e[19];const f=u?.id,d=k?.id,w=m?.id;let U;e[20]!==t||e[21]!==r||e[22]!==S||e[23]!==v||e[24]!==g||e[25]!==f||e[26]!==d||e[27]!==w?(U=[r,t,S,v,g,f,d,w],e[20]=t,e[21]=r,e[22]=S,e[23]=v,e[24]=g,e[25]=f,e[26]=d,e[27]=w,e[28]=U):U=e[28],T.useEffect(j,U);let O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=O):O=e[29];const z=y&&!I;let A;e[30]!==p||e[31]!==z?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[O,s.jsx(ft,{isPending:p,showSaved:z})]}),e[30]=p,e[31]=z,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(D=mt.map(_=>s.jsx($e,{control:r.control,name:`tiers.${_.key}`,render:F=>{const{field:P}=F;return s.jsx(ke,{title:_.label,description:_.description,action:s.jsx(ut,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:_.filter,onSlotChange:E=>{P.onChange(E),c()}})})}},_.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(me,{children:D}),e[37]=D,e[38]=K):K=e[38];let $;return e[39]!==A||e[40]!==K?($=s.jsxs(ue,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=$):$=e[41],$}function gt(e){return e.id}const ht={usd:[10,20,100],brl:[50,100,500]};function xt(){const e=M.c(29),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),[o,a]=T.useState(!1),{mutate:r,isPending:n}=ee({mutationFn:async d=>{const w=await l.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:d,currency:c}});if(w?.isError)throw new Error(w.content?.[0]?.text??"Failed to get top-up URL");return w.structuredContent?.url},onSuccess:yt,onError:bt}),[p,y]=T.useState(""),[I,h]=T.useState("usd"),c=I,u=parseFloat(p),k=!isNaN(u)&&u>=1,m=c==="brl"?"R$":"$";let S;e[3]!==h?(S=d=>{d&&h(d)},e[3]=h,e[4]=S):S=e[4];let v,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(he,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(he,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=v,e[6]=g):(v=e[5],g=e[6]);let x;e[7]!==c||e[8]!==S?(x=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:c,onValueChange:S,children:[v,g]}),e[7]=c,e[8]=S,e[9]=x):x=e[9];let b;e[10]!==c||e[11]!==m||e[12]!==o||e[13]!==n||e[14]!==r?(b=!o&&s.jsxs(s.Fragment,{children:[ht[c].map(d=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:n,onClick:()=>r(d*100),children:[m,d]},d)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:n,children:"Custom"})]}),e[10]=c,e[11]=m,e[12]=o,e[13]=n,e[14]=r,e[15]=b):b=e[15];let j;e[16]!==m||e[17]!==p||e[18]!==u||e[19]!==o||e[20]!==k||e[21]!==n||e[22]!==y||e[23]!==r?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(le,{type:"number",min:"1",step:"1",placeholder:"50",value:p,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!k||n,onClick:()=>r(Math.round(u*100)),children:n?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:"Cancel"})]}),e[16]=m,e[17]=p,e[18]=u,e[19]=o,e[20]=k,e[21]=n,e[22]=y,e[23]=r,e[24]=j):j=e[24];let f;return e[25]!==x||e[26]!==b||e[27]!==j?(f=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x,b,j]})}),e[25]=x,e[26]=b,e[27]=j,e[28]=f):f=e[28],f}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=M.c(61),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne(),a=te();let r;e[3]!==a?(r=a.find(It),e[3]=a,e[4]=r):r=e[4];const n=r,[p,y]=T.useState(!1);let I;e[5]!==l||e[6]!==n?(I=async()=>{n&&await l.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:n.id}})},e[5]=l,e[6]=n,e[7]=I):I=e[7];let h;e[8]!==t.id||e[9]!==o?(h=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),y(!1)},e[8]=t.id,e[9]=o,e[10]=h):h=e[10];let c;e[11]!==I||e[12]!==h?(c={mutationFn:I,onSuccess:h,onError:_t},e[11]=I,e[12]=h,e[13]=c):c=e[13];const{mutate:u,isPending:k}=ee(c);let m;e[14]!==t.id?(m=G.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=m):m=e[15];const S=!!n;let v;e[16]!==l?(v=async()=>{const fe=await l.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return fe?.isError?null:fe.structuredContent??null},e[16]=l,e[17]=v):v=e[17];let g;e[18]!==m||e[19]!==S||e[20]!==v?(g={queryKey:m,enabled:S,staleTime:6e4,queryFn:v},e[18]=m,e[19]=S,e[20]=v,e[21]=g):g=e[21];const{data:x,isLoading:b,refetch:j,isFetching:f}=Ie(g);if(!n)return null;const d=x?.balanceCents!=null?x.balanceCents/100:null;let w;e[22]!==d?(w=d!=null?`$${d.toFixed(2)}`:"—",e[22]=d,e[23]=w):w=e[23];const U=w;let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=O):O=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),e[25]=z):z=e[25];let A;e[26]!==k?(A=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:k,children:"Disconnect"})]}),e[26]=k,e[27]=A):A=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ne,{children:[s.jsx(we,{children:"Disconnect Deco AI Gateway"}),s.jsx(Pe,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=D):D=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ae,{children:"Cancel"}),e[29]=K):K=e[29];let $;e[30]!==u?($=s.jsxs(De,{children:[D,s.jsxs(Ke,{children:[K,s.jsx(Ee,{onClick:()=>u(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=u,e[31]=$):$=e[31];let _;e[32]!==p||e[33]!==$?(_=s.jsx(Fe,{open:p,onOpenChange:y,children:$}),e[32]=p,e[33]=$,e[34]=_):_=e[34];let F;e[35]!==d||e[36]!==U||e[37]!==f||e[38]!==b?(F=b||f?s.jsx(de,{className:"h-9 w-24"}):s.jsx("span",{className:ge("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&vt(d)),children:U}),e[35]=d,e[36]=U,e[37]=f,e[38]=b,e[39]=F):F=e[39];let P;e[40]!==j?(P=()=>j(),e[40]=j,e[41]=P):P=e[41];const E=f&&"animate-spin";let N;e[42]!==E?(N=ge(E),e[42]=E,e[43]=N):N=e[43];let L;e[44]!==N?(L=s.jsx(_e,{size:14,className:N}),e[44]=N,e[45]=L):L=e[45];let q;e[46]!==f||e[47]!==P||e[48]!==L?(q=s.jsx("button",{type:"button",onClick:P,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:L}),e[46]=f,e[47]=P,e[48]=L,e[49]=q):q=e[49];let R;e[50]!==F||e[51]!==q?(R=s.jsxs("div",{className:"flex items-baseline gap-2",children:[F,q]}),e[50]=F,e[51]=q,e[52]=R):R=e[52];let W;e[53]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=W):W=e[53];let Y;e[54]!==R?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[R,W]}),e[54]=R,e[55]=Y):Y=e[55];let se;e[56]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(xt,{})]}),e[56]=se):se=e[56];let ie;return e[57]!==A||e[58]!==_||e[59]!==Y?(ie=s.jsx(ue,{title:"Deco AI Gateway",children:s.jsx(me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[A,_,Y,se]})})}),e[57]=A,e[58]=_,e[59]=Y,e[60]=ie):ie=e[60],ie}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function It(e){return e.providerId==="deco"}function St(){const e=M.c(11),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne();let a;e[3]!==l?(a=async()=>{const p=await l.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(p?.isError)throw new Error(p.content?.[0]?.text??"Key provisioning failed")},e[3]=l,e[4]=a):a=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Se("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let n;return e[8]!==a||e[9]!==r?(n={mutationFn:a,onSuccess:r,onError:kt},e[8]=a,e[9]=r,e[10]=n):n=e[10],ee(n)}function kt(e){Se("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=M.c(10),{mutate:t,isPending:i}=St();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:l.join(", ")}}),e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let n;e[4]!==t?(n=()=>t(),e[4]=t,e[5]=n):n=e[5];const p=i?"Connecting…":"Connect Deco";let y;return e[6]!==i||e[7]!==n||e[8]!==p?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[a,r,s.jsx(V,{variant:"outline",disabled:i,onClick:n,children:p})]})]}),e[6]=i,e[7]=n,e[8]=p,e[9]=y):y=e[9],y}const Nt=B({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function wt({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:o,currentBaseUrl:a,onCancel:r,onSuccess:n}){const{org:p}=H(),y=X({connectionId:J,orgId:p.id,orgSlug:p.slug}),I=ne(),[h,c]=T.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),{register:m,handleSubmit:S,watch:v,formState:{errors:g}}=je({resolver:ve(Nt),defaultValues:{label:o,apiKey:"",baseUrl:a??""}}),x=v("apiKey")??"",{mutate:b,isPending:j}=ee({mutationFn:async f=>{let d;f.apiKey?u?d=JSON.stringify({baseUrl:f.baseUrl||a||"",apiKey:f.apiKey}):d=f.apiKey:u&&f.baseUrl&&f.baseUrl!==a&&(d=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await y.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:e.id,label:f.label,...d!==void 0?{apiKey:d}:{}}})},onSuccess:()=>{I.invalidateQueries({queryKey:G.aiProviderKeys(p.id)}),I.invalidateQueries({queryKey:G.aiProviders(p.id)}),Q.success("Provider updated"),n()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:S(f=>b(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(le,{placeholder:"e.g. Personal key",...m("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...m("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(le,{type:h&&x?"text":"password",placeholder:l,...m("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),x&&s.jsx("button",{type:"button",onClick:()=>c(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:h?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:j,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:j,children:j?"Saving...":"Save"})]})]})}function Pt(e){const t=M.c(31),{providerKey:i,provider:l,open:o,onOpenChange:a}=e,{org:r}=H();let n;t[0]!==r.id||t[1]!==r.slug?(n={connectionId:J,orgId:r.id,orgSlug:r.slug},t[0]=r.id,t[1]=r.slug,t[2]=n):n=t[2];const p=X(n);let y;t[3]!==l.id||t[4]!==i.presetId?(y=l.id==="openai-compatible"&&i.presetId?Re.find(j=>j.id===i.presetId):void 0,t[3]=l.id,t[4]=i.presetId,t[5]=y):y=t[5];const I=y,h=I?.name??l.name;let c;t[6]!==i.id?(c=G.aiProviderKeyPreview(i.id),t[6]=i.id,t[7]=c):c=t[7];let u;t[8]!==p||t[9]!==i.id?(u=async()=>(await p.callTool({name:"AI_PROVIDER_KEY_PREVIEW",arguments:{keyId:i.id}})).structuredContent,t[8]=p,t[9]=i.id,t[10]=u):u=t[10];let k;t[11]!==o||t[12]!==c||t[13]!==u?(k={queryKey:c,queryFn:u,enabled:o,staleTime:0},t[11]=o,t[12]=c,t[13]=u,t[14]=k):k=t[14];const{data:m,isLoading:S}=Ie(k);let v;t[15]!==h?(v=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",h]})}),t[15]=h,t[16]=v):v=t[16];let g;t[17]!==S||t[18]!==a||t[19]!==I||t[20]!==m||t[21]!==l||t[22]!==i?(g=S||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(rt,{})}):s.jsx(wt,{providerKey:i,provider:l,preset:I,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[17]=S,t[18]=a,t[19]=I,t[20]=m,t[21]=l,t[22]=i,t[23]=g):g=t[23];let x;t[24]!==v||t[25]!==g?(x=s.jsxs(it,{className:"sm:max-w-md",children:[v,g]}),t[24]=v,t[25]=g,t[26]=x):x=t[26];let b;return t[27]!==a||t[28]!==o||t[29]!==x?(b=s.jsx(ot,{open:o,onOpenChange:a,children:x}),t[27]=a,t[28]=o,t[29]=x,t[30]=b):b=t[30],b}function At(e){const t=M.c(51),{providerKey:i,provider:l}=e,{org:o}=H();let a;t[0]!==o.id||t[1]!==o.slug?(a={connectionId:J,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=a):a=t[2];const r=X(a),n=ne(),[p,y]=T.useState(!1),[I,h]=T.useState(!1),c=l.id==="openai-compatible";let u;t[3]!==c||t[4]!==i.presetId?(u=c&&i.presetId?Re.find(q=>q.id===i.presetId):void 0,t[3]=c,t[4]=i.presetId,t[5]=u):u=t[5];const k=u,m=k?k.name:c?"Custom OpenAI-compatible":l.name,S=k?.logo??l.logo;let v;e:{if(c){v=i.label;break e}const q=i.label;let R;t[6]!==i.createdAt?(R=lt(new Date(i.createdAt)),t[6]=i.createdAt,t[7]=R):R=t[7],v=`${q} · added ${R} ago`}const g=v;let x;t[8]!==r||t[9]!==i.id?(x=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[8]=r,t[9]=i.id,t[10]=x):x=t[10];let b;t[11]!==o.id||t[12]!==i.id||t[13]!==n?(b=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),n.invalidateQueries({queryKey:G.aiProviders(o.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),y(!1)},t[11]=o.id,t[12]=i.id,t[13]=n,t[14]=b):b=t[14];let j;t[15]!==x||t[16]!==b?(j={mutationFn:x,onSuccess:b,onError:Dt},t[15]=x,t[16]=b,t[17]=j):j=t[17];const{mutate:f,isPending:d}=ee(j);let w;t[18]!==m||t[19]!==S?(w=S?s.jsx("img",{src:S,alt:m,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:m.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[18]=m,t[19]=S,t[20]=w):w=t[20];let U;t[21]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>h(!0),children:s.jsx(We,{size:14})}),t[21]=U):U=t[21];let O,z;t[22]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),O=s.jsx(Ye,{size:14}),t[22]=O,t[23]=z):(O=t[22],z=t[23]);let A;t[24]!==d?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:d,onClick:z,children:O})]}),t[24]=d,t[25]=A):A=t[25];let D;t[26]!==g||t[27]!==m||t[28]!==A||t[29]!==w?(D=s.jsx(ke,{icon:w,title:m,description:g,action:A}),t[26]=g,t[27]=m,t[28]=A,t[29]=w,t[30]=D):D=t[30];let K;t[31]!==I||t[32]!==l||t[33]!==i?(K=s.jsx(Pt,{providerKey:i,provider:l,open:I,onOpenChange:h}),t[31]=I,t[32]=l,t[33]=i,t[34]=K):K=t[34];let $;t[35]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(we,{children:"Delete API key"}),t[35]=$):$=t[35];let _;t[36]!==i.label?(_=s.jsxs(Ne,{children:[$,s.jsxs(Pe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[36]=i.label,t[37]=_):_=t[37];let F;t[38]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ae,{children:"Cancel"}),t[38]=F):F=t[38];let P;t[39]!==f?(P=s.jsxs(Ke,{children:[F,s.jsx(Ee,{onClick:()=>f(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[39]=f,t[40]=P):P=t[40];let E;t[41]!==_||t[42]!==P?(E=s.jsxs(De,{children:[_,P]}),t[41]=_,t[42]=P,t[43]=E):E=t[43];let N;t[44]!==p||t[45]!==E?(N=s.jsx(Fe,{open:p,onOpenChange:y,children:E}),t[44]=p,t[45]=E,t[46]=N):N=t[46];let L;return t[47]!==D||t[48]!==K||t[49]!==N?(L=s.jsxs(s.Fragment,{children:[D,K,N]}),t[47]=D,t[48]=K,t[49]=N,t[50]=L):L=t[50],L}function Dt(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=M.c(11),{onConnectClick:i}=e,l=te(),o=Ce();let a;t[0]!==o?.providers?(a=o?.providers??[],t[0]=o?.providers,t[1]=a):a=t[1];const r=a;let n;if(t[2]!==l||t[3]!==i||t[4]!==r){let p;t[6]!==r?(p=c=>({key:c,provider:r.find(u=>u.id===c.providerId)}),t[6]=r,t[7]=p):p=t[7];const y=l.filter(Rt).map(p).filter(Ft);let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Qe,{size:14}),t[8]=I):I=t[8];let h;t[9]!==i?(h=s.jsxs(V,{size:"sm",onClick:i,children:[I,"Connect provider"]}),t[9]=i,t[10]=h):h=t[10],n=s.jsx(ue,{title:"Connected providers",headerClassName:"px-0",actions:h,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(me,{children:y.map(Et)})}),t[2]=l,t[3]=i,t[4]=r,t[5]=n}else n=t[5];return n}function Et(e){const{key:t,provider:i}=e;return s.jsx(At,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function $t(e){const t=M.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{size:16}),t[0]=l):l=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Tt(){const e=M.c(23),t=te();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const l=i,o=t.length>0,[a,r]=T.useState(!1),[n,p]=T.useState(null),y=Ce();let I;e[2]!==y?.providers?(I=y?.providers??[],e[2]=y?.providers,e[3]=I):I=e[3];const h=I;if(!o){let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>r(!0),e[4]=v):v=e[4];let g;e[5]!==h?(g=s.jsx(Je,{providers:h,onSelect:p,onShowAll:v}),e[5]=h,e[6]=g):g=e[6];const x=n!==null||a;let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=w=>{w||(p(null),r(!1))},e[7]=b):b=e[7];const j=n??void 0;let f;e[8]!==x||e[9]!==j?(f=s.jsx(xe,{open:x,onOpenChange:b,initialProvider:j}),e[8]=x,e[9]=j,e[10]=f):f=e[10];let d;return e[11]!==g||e[12]!==f?(d=s.jsxs(s.Fragment,{children:[g,f]}),e[11]=g,e[12]=f,e[13]=d):d=e[13],d}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=c):c=e[14];let u;e[15]!==l?(u=l?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=l,e[16]=u):u=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Kt,{onConnectClick:()=>r(!0)}),e[17]=k):k=e[17];let m;e[18]!==a?(m=s.jsx(xe,{open:a,onOpenChange:r}),e[18]=a,e[19]=m):m=e[19];let S;return e[20]!==u||e[21]!==m?(S=s.jsxs(s.Fragment,{children:[c,u,k,m]}),e[20]=u,e[21]=m,e[22]=S):S=e[22],S}function Ot(e){return e.providerId==="deco"}function Mt(){const e=M.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(oe.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Body,{children:s.jsxs(Me,{children:[t,s.jsx(Te,{fallback:Ut,children:s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-64 w-full"}),children:s.jsx(Tt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx($t,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(nt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Mt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as n,c as o,j as c,bt as d}from"./index-
|
|
1
|
+
import{e as n,c as o,j as c,bt as d}from"./index-BfzqpoYd.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,bx as m,j as r,de as A,dc as w,dd as T,dz as O,bE as M,a8 as I,cx as z,dA as D,cy as F,dq as L,ag as G,df as k,cz as q,e as n,c as p,dB as v}from"./index-
|
|
1
|
+
import{r as i,bx as m,j as r,de as A,dc as w,dd as T,dz as O,bE as M,a8 as I,cx as z,dA as D,cy as F,dq as L,ag as G,df as k,cz as q,e as n,c as p,dB as v}from"./index-BfzqpoYd.js";var x="AlertDialog",[B]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});V.displayName=H;var W="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=W;var Y="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(q,{...o,...a,ref:e})});_.displayName=Y;var f="AlertDialogContent",[J,K]=B(f),Q=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as M,r as S,j as o,l as q}from"./index-BfzqpoYd.js";import{S as G}from"./scroll-area-BYy84ztj.js";import{j as H,a4 as J,d as Q}from"./index-BXzjL9VS.js";import{S as U}from"./schema-form-f_EsRXt1.js";import{S as W}from"./save-status-DSB279Mq.js";import"./select-DpYu937I.js";import"./tooltip-CC_mfaKY.js";import"./Check-CSixRgqh.js";import"./ChevronDown-BptXi8Ef.js";import"./ChevronUp-DChs66VU.js";import"./agent-capabilities-CuNGQogd.js";import"./chat-context-BIie9ysT.js";import"./tab-id-CjkvF5Bz.js";import"./use-mcp-client-Brxiewn2.js";import"./decopilot-sse-pool-vfZK3kan.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-DDTG_-f6.js";import"./use-collections-vRlJo8MD.js";import"./use-ai-providers-D2jZ5H5p.js";import"./use-organization-settings-DjvlRnDe.js";import"./pair-NC4sCATE.js";import"./agent-icon-Lc1AgwlE.js";import"./AlertCircle-B-p2hhbf.js";import"./Tool01-DXWYgeBe.js";import"./SwitchHorizontal01-__hAuhZa.js";import"./RefreshCcw01-DlKjMM-5.js";import"./XCircle-CEKwTNMD.js";import"./ArrowUpRight-Bq-dJGgn.js";import"./ZapSquare-DSdwG_FE.js";import"./Users03-D5pU3_ql.js";import"./CheckCircle-CqLcOI7o.js";import"./ChevronLeft-Bq6F--2K.js";import"./ChevronRight-CtziSifX.js";import"./DotsVertical-DQ3UGDDE.js";import"./Container-DIwdobum.js";import"./Eye-DepFjUJE.js";import"./ZoomOut-CCPaeWry.js";import"./Globe01-BayTDYGC.js";import"./FilterLines-CIJgiiLT.js";import"./Star01-q6EhXttt.js";import"./Palette-siqkt4cQ.js";import"./HardDrive-OwnJRrIS.js";import"./Stars02-DJ4Y5TfK.js";import"./Key01-CR8zfCdU.js";import"./LayoutLeft-6fPyjOVd.js";import"./LinkExternal01-B2YZgRTN.js";import"./Monitor01-BNXW6pu5.js";import"./Sun-CeFpMHQU.js";import"./Play-CBt0NeLA.js";import"./Plus-gXoAw_mX.js";import"./SearchMd-z6b-QOmX.js";import"./Settings02-C7YqxsZL.js";import"./Shield01-BT66FEMI.js";import"./Stars01-DcMeK1n0.js";import"./Trash01-B91-1KNk.js";import"./Upload01-CcwGyBRP.js";import"./User01-JR_76gHl.js";import"./Users01-BM2QLqUJ.js";import"./XClose-DhQ5V0ST.js";import"./X-DCWlm9Ta.js";import"./Zap-BLBAeivN.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BkzArvj8.js";import"./file-type-icon-B2skJERp.js";import"./dialog-nXKceTRB.js";import"./content-blocks-o63cs2vh.js";import"./types-btWFnXlQ.js";import"./shell-layout-D8qm1N5L.js";import"./avatar-3vQWE5Hu.js";import"./required-auth-layout-3IQyeREK.js";import"./useRouterState-xsU2zFoM.js";import"./use-org-sso-BWWAvGBF.js";import"./integration-icon-B-zr5uGs.js";import"./use-navigate-to-agent-BRFls8tQ.js";import"./use-connection-MP_sOdrQ.js";import"./use-mcp-prompts-CKvrvNSD.js";import"./form-BM4RuTjX.js";import"./label-zIig0cjv.js";import"./input-BGQcwAaL.js";import"./spinner-j70e5pPL.js";import"./drawer-lSnonzW3.js";import"./collection-search-Bryj5VYk.js";import"./tabs-sqzEAKlk.js";import"./toggle-group-jYWXBndg.js";import"./connect-desktop-dialog-BeLm4wl6.js";import"./agent-icons-Cprwkzhw.js";import"./checkbox-DFFY_m2B.js";import"./skeleton-thGJKlMg.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-pgSq0Nbi.js";import"./card-CeH_PUFE.js";import"./popover-B1xAxEac.js";import"./command-KyGHPzm4.js";import"./index-CnLAq3ph.js";import"./useInfiniteQuery-BEouccKd.js";import"./infiniteQueryObserver-CvEVG_TM.js";import"./sortable.esm-DYE94iJD.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dug8PvM2.js";import"./use-registry-connections-BQfixYFV.js";import"./extract-connection-data-DxtHEsy3.js";import"./generate-id-DvX29Me7.js";import"./collections-B-UBhIxv.js";import"./collection-tabs-Y3w8w2D4.js";import"./badge-DF6gVmsi.js";import"./textarea-Bo_ElpPh.js";import"./connection-form-helpers-Ce4ZXQGG.js";import"./use-infinite-scroll-BYw2UY-G.js";import"./useSuspenseInfiniteQuery-wDDb-pw7.js";import"./index-1xoY7YJX.js";import"./dropdown-menu-DpfpR4kx.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DQ0B9hX1.js";import"./sidebar-B3S1MC-b.js";import"./sheet-y2Nja_Ue.js";import"./toolbar-BIjePcgn.js";import"./use-create-virtual-mcp-C88u5wPn.js";import"./github-repo-picker-Dlio4Q6_.js";import"./use-mcp-tools-DFeiBffX.js";import"./alert-dialog-DJLxSS_E.js";import"./index-DOW4VN4f.js";import"./use-org-auth-client-IT7XMFB9.js";import"./hover-card-DASEEDYA.js";import"./task-status-CgfEdw1R.js";import"./use-status-sounds-BJZxFfhN.js";import"./empty-state-BJuYi96S.js";import"./resizable-Cx-Y9zvP.js";import"./use-capability-aJI8msnV.js";import"./header-tab-button-BY6bk4Fs.js";import"./index-DcxEaxY4.js";import"./user-BZco0YX9.js";import"./tools-list-9Kj7tcM0.js";import"./switch-BZi96ipJ.js";import"./use-debounced-autosave-C2TtzjZB.js";import"./index-CVPVNlMM.js";import"./search-input-C3i2qrnL.js";import"./use-secrets-DEcBibJG.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-CsQ2TTIf.js";import"./view-mode-toggle-BN8FgH0K.js";import"./select-model-B8gz_8C_.js";import"./use-automations-B6ZTT5n1.js";import"./monaco-editor-DQviDtyP.js";import"./automation-runs-D-WPNg7m.js";import"./table-C3TjNbDC.js";import"./use-members-D6H6sd8q.js";import"./automation-list-row-C8yWYA2H.js";import"./calendar-CCqv5TgR.js";import"./image-field-BTCmGBNs.js";import"./use-file-configs-DGSgkVs8.js";function qo(g){const t=M.c(38),{orgSlug:N,virtualMcpId:_,branch:k,blockKey:r,block:i,meta:m,title:E,excludeFields:n,schemaPending:C}=g,P=C===void 0?!1:C,e=typeof i?.__resolveType=="string"?i.__resolveType:"";let d;if(t[0]!==n||t[1]!==m||t[2]!==e){const c=e?H(e,m):null;d=c&&n?.length?{...c,properties:Object.fromEntries(Object.entries(c.properties??{}).filter(y=>{const[I]=y;return!n.includes(I)}))}:c,t[0]=n,t[1]=m,t[2]=e,t[3]=d}else d=t[3];const f=d;let u;t[4]!==i||t[5]!==r||t[6]!==m||t[7]!==E?(u=E??(i?J(r,i,m):r),t[4]=i,t[5]=r,t[6]=m,t[7]=E,t[8]=u):u=t[8];const B=u;let x;t[9]!==k||t[10]!==N||t[11]!==_?(x={orgSlug:N,virtualMcpId:_,branch:k},t[9]=k,t[10]=N,t[11]=_,t[12]=x):x=t[12];const{save:K,isPending:R}=Q(x),[A,L]=S.useState(r),[z,O]=S.useState(null),[V,D]=S.useState(0);let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[13]=h):h=t[13];const[w,$]=S.useState(h);A!==r&&(L(r),O(null),D(X),$([]));let v;t[14]!==i?(v=i??{},t[14]=i,t[15]=v):v=t[15];const F=z??v;let b;t[16]!==r||t[17]!==e||t[18]!==K?(b=c=>{const y=c;O(y),K(r,{...y,__resolveType:e})},t[16]=r,t[17]=e,t[18]=K,t[19]=b):b=t[19];const T=b;let p;t[20]!==B?(p=o.jsx("span",{className:"text-sm font-medium",children:B}),t[20]=B,t[21]=p):p=t[21];let s;t[22]!==R?(s=o.jsx(W,{isPending:R,isError:!1}),t[22]=R,t[23]=s):s=t[23];let l;t[24]!==p||t[25]!==s?(l=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[p,s]}),t[24]=p,t[25]=s,t[26]=l):l=t[26];let a;t[27]!==r||t[28]!==w||t[29]!==F||t[30]!==V||t[31]!==T||t[32]!==f||t[33]!==P?(a=o.jsx(G,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:f?o.jsx(U,{schema:f,value:F,onChange:T,basePath:"",breadcrumbPath:w,onBreadcrumbChange:$},`${r}:${V}`):P?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(q,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[27]=r,t[28]=w,t[29]=F,t[30]=V,t[31]=T,t[32]=f,t[33]=P,t[34]=a):a=t[34];let j;return t[35]!==l||t[36]!==a?(j=o.jsxs("div",{className:"flex h-full flex-col",children:[l,a]}),t[35]=l,t[36]=a,t[37]=j):j=t[37],j}function X(g){return g+1}export{qo as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-
|
|
1
|
+
import{e as l,g as m,j as t,A as f,S as h,h as x,i as r,k as p,N as u}from"./index-BfzqpoYd.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as o,j as i}from"./index-
|
|
1
|
+
import{e as o,j as i}from"./index-BfzqpoYd.js";function f(r){const e=o.c(9),{children:n,visual:c}=r;let l;e[0]!==n?(l=i.jsx("section",{className:"flex flex-1 items-center justify-center bg-sidebar p-6 md:p-10",children:i.jsx("div",{className:"w-full max-w-[440px]",children:n})}),e[0]=n,e[1]=l):l=e[1];let s;e[2]!==c?(s=c??i.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[2]=c,e[3]=s):s=e[3];let t;e[4]!==s?(t=i.jsx("aside",{className:"relative hidden md:flex flex-1 overflow-hidden bg-muted",children:s}),e[4]=s,e[5]=t):t=e[5];let a;return e[6]!==l||e[7]!==t?(a=i.jsxs("main",{className:"flex min-h-screen w-full",children:[l,t]}),e[6]=l,e[7]=t,e[8]=a):a=e[8],a}export{f as A};
|
package/dist/client/assets/{automation-list-row-DCGCyvJL.js → automation-list-row-C8yWYA2H.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as E,r as F,c as $,j as t,B as K}from"./index-
|
|
1
|
+
import{e as E,r as F,c as $,j as t,B as K}from"./index-BfzqpoYd.js";import{b as O,d as B,e as I,g as L,c as H,f as Q,a as V,A as q}from"./alert-dialog-DJLxSS_E.js";import{a as G,D as J,b as U,c as W}from"./dropdown-menu-DpfpR4kx.js";import{A as X,Q as Y}from"./agent-icon-Lc1AgwlE.js";import{i as Z}from"./DotsVertical-DQ3UGDDE.js";import{s as ee}from"./Trash01-B91-1KNk.js";import{i as te}from"./Zap-BLBAeivN.js";import{u as se}from"./use-virtual-mcp-DDTG_-f6.js";import{u as ne}from"./use-automations-B6ZTT5n1.js";function pe(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=se(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const T=A,M=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let c;e[5]!==M?(c=$("inline-block size-2 rounded-full shrink-0",M),e[5]=M,e[6]=c):c=e[6];const R=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==R?(m=t.jsx("span",{className:c,"aria-label":R}),e[7]=c,e[8]=R,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(X,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(G,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Z,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(J,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(ee,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==T||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:T,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=T,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Q,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(V,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(q,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(Y,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(te,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{pe as A};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as le,r as oe,c as be,j as t,B as fe,K as xe,n as Ve,E as tt,q as st}from"./index-BfzqpoYd.js";import{u as ze}from"./useInfiniteQuery-BEouccKd.js";import{u as lt}from"./use-connection-MP_sOdrQ.js";import{i as nt,g as at,S as rt,u as it}from"./use-mcp-client-Brxiewn2.js";import{a as ot}from"./use-virtual-mcp-DDTG_-f6.js";import{C as ct}from"./card-CeH_PUFE.js";import{a as Ke,b as qe,S as dt,d as mt}from"./sheet-y2Nja_Ue.js";import{c as Ge,d as He,a as Ne,e as te,b as Be,T as se}from"./table-C3TjNbDC.js";import{E as Se}from"./empty-state-BJuYi96S.js";import{u as ke}from"./use-infinite-scroll-BYw2UY-G.js";import{u as ut}from"./use-members-D6H6sd8q.js";import{S as ue}from"./task-status-CgfEdw1R.js";import{e as ft}from"./use-automations-B6ZTT5n1.js";import{u as xt}from"./useSuspenseInfiniteQuery-wDDb-pw7.js";import{B as je}from"./badge-DF6gVmsi.js";import{S as ht,a as gt,b as pt,c as ge,d as jt}from"./select-DpYu937I.js";import{C as Le}from"./checkbox-DFFY_m2B.js";import{t as he}from"./ChevronDown-BptXi8Ef.js";import{c as bt,C as Nt,e as Fe,d as vt,a as St,b as yt}from"./command-KyGHPzm4.js";import{a as Je,b as Qe,P as Ze}from"./popover-B1xAxEac.js";import{A as We}from"./avatar-3vQWE5Hu.js";import{n as ye}from"./ChevronUp-DChs66VU.js";import{n as Ie}from"./Container-DIwdobum.js";import{i as wt}from"./FilterLines-CIJgiiLT.js";import{m as Ct,n as _t}from"./pair-NC4sCATE.js";import{I as Pe}from"./integration-icon-B-zr5uGs.js";function Ue(l){const e=le.c(74),{options:s,onValueChange:n,defaultValue:r,placeholder:i,variant:a,animation:m,maxCount:c,modalPopover:o,asChild:b,className:v,disabled:x,onSearchChange:h}=l;let N;e[0]!==r?(N=r===void 0?[]:r,e[0]=r,e[1]=N):N=e[1];const u=N,p=i===void 0?"Select items":i,j=a===void 0?"default":a,g=m===void 0?0:m,S=c===void 0?3:c,f=o===void 0?!1:o,y=b===void 0?!1:b,_=x===void 0?!1:x,[d,C]=oe.useState(u),[T,w]=oe.useState(!1);let I,k;e[2]!==u||e[3]!==d?(I=()=>{JSON.stringify(d)!==JSON.stringify(u)&&C(u)},k=[u,d],e[2]=u,e[3]=d,e[4]=I,e[5]=k):(I=e[4],k=e[5]),oe.useEffect(I,k);let P;e[6]!==n||e[7]!==d?(P=E=>{if(E.key==="Enter")w(!0);else if(E.key==="Backspace"&&!E.currentTarget.value){const H=[...d];H.pop(),C(H),n(H)}},e[6]=n,e[7]=d,e[8]=P):P=e[8];const D=P;let M;e[9]!==n||e[10]!==d?(M=E=>{const H=d.includes(E.value)?d.filter(me=>me!==E.value):[...d,E.value];C(H),n(H)},e[9]=n,e[10]=d,e[11]=M):M=e[11];const A=M;let $;e[12]!==n?($=()=>{C([]),n([])},e[12]=n,e[13]=$):$=e[13];const B=$;let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{w(Pt)},e[14]=F):F=e[14];const Z=F;let q;e[15]!==B||e[16]!==n||e[17]!==s||e[18]!==d.length?(q=()=>{if(d.length===s.length)B();else{const E=s.map(It);C(E),n(E)}},e[15]=B,e[16]=n,e[17]=s,e[18]=d.length,e[19]=q):q=e[19];const U=q;let O;e[20]!==y?(O=y?{}:{variant:"outline"},e[20]=y,e[21]=O):O=e[21];let L;e[22]!==v?(L=be("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",v),e[22]=v,e[23]=L):L=e[23];let K;e[24]!==g||e[25]!==S||e[26]!==s||e[27]!==p||e[28]!==d||e[29]!==j?(K=d.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[d.slice(0,S).map(E=>{const H=s.find(ve=>ve.value===E),me=H?.icon;return t.jsxs(je,{variant:j==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${g}s`},children:[me&&t.jsx(me,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:H?.label})]},E)}),d.length>S&&t.jsxs(je,{variant:j==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${g}s`},children:["+",d.length-S]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(he,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:p}),t.jsx(he,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=g,e[25]=S,e[26]=s,e[27]=p,e[28]=d,e[29]=j,e[30]=K):K=e[30];let V;e[31]!==_||e[32]!==O||e[33]!==L||e[34]!==K?(V=t.jsx(Je,{asChild:!0,children:t.jsx(fe,{ref:null,...O,onClick:Z,className:L,disabled:_,children:K})}),e[31]=_,e[32]=O,e[33]=L,e[34]=K,e[35]=V):V=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=()=>w(!1),e[36]=J):J=e[36];const z=!h;let Q;e[37]!==D||e[38]!==h?(Q=t.jsx(bt,{placeholder:"Search...",onKeyDown:D,onValueChange:h,className:"rounded-t-xl"}),e[37]=D,e[38]=h,e[39]=Q):Q=e[39];let ce;e[40]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx(Nt,{children:"No results found."}),e[40]=ce):ce=e[40];let W;e[41]!==U?(W=()=>{U()},e[41]=U,e[42]=W):W=e[42];let Y;e[43]!==U?(Y=E=>{E.stopPropagation(),U()},e[43]=U,e[44]=Y):Y=e[44];const de=d.length===s.length&&s.length>0;let ne;e[45]!==de||e[46]!==U?(ne=t.jsx(Le,{checked:de,onCheckedChange:U,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:kt}),e[45]=de,e[46]=U,e[47]=ne):ne=e[47];let ae;e[48]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx("span",{children:"(Select All)"}),e[48]=ae):ae=e[48];let X;e[49]!==Y||e[50]!==ne?(X=t.jsxs("div",{className:"flex items-center w-full",onClick:Y,children:[ne,ae]}),e[49]=Y,e[50]=ne,e[51]=X):X=e[51];let ee;e[52]!==W||e[53]!==X?(ee=t.jsx(Fe,{onSelect:W,className:"cursor-pointer",children:X},"all"),e[52]=W,e[53]=X,e[54]=ee):ee=e[54];let re;if(e[55]!==s||e[56]!==d||e[57]!==A){let E;e[59]!==d||e[60]!==A?(E=H=>{const me=d.includes(H.value);return t.jsx(Fe,{onSelect:()=>{A(H)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ve=>{ve.stopPropagation(),A(H)},children:[t.jsx(Le,{checked:me,onCheckedChange:()=>{A(H)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Tt}),H.icon&&t.jsx(H.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:H.label})]})},H.value)},e[59]=d,e[60]=A,e[61]=E):E=e[61],re=s.map(E),e[55]=s,e[56]=d,e[57]=A,e[58]=re}else re=e[58];let R;e[62]!==ee||e[63]!==re?(R=t.jsxs(vt,{className:"rounded-b-xl",children:[ce,t.jsxs(St,{children:[ee,re]})]}),e[62]=ee,e[63]=re,e[64]=R):R=e[64];let G;e[65]!==z||e[66]!==Q||e[67]!==R?(G=t.jsx(Qe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:J,children:t.jsxs(yt,{shouldFilter:z,className:"rounded-xl",children:[Q,R]})}),e[65]=z,e[66]=Q,e[67]=R,e[68]=G):G=e[68];let ie;return e[69]!==T||e[70]!==f||e[71]!==V||e[72]!==G?(ie=t.jsxs(Ze,{open:T,onOpenChange:w,modal:f,children:[V,G]}),e[69]=T,e[70]=f,e[71]=V,e[72]=G,e[73]=ie):ie=e[73],ie}function Tt(l){return l.stopPropagation()}function kt(l){return l.stopPropagation()}function It(l){return l.value}function Pt(l){return!l}const Ye=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],Mt=40;function Cs(l){const s=(l.endDate.getTime()-l.startDate.getTime())/Mt;return Ye.find(r=>r.ms>=s)?.label??"1d"}function Me(l){const e=Ye.find(i=>i.label===l);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(l);if(!s)return 6e4;const n=parseInt(s[1],10),r=s[2];return r==="h"?n*36e5:r==="d"?n*864e5:n*6e4}function Dt(l,e){const s=new Date(l);return Me(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Oe(l,e){const s=Me(e);return new Date(Math.floor(l.getTime()/s)*s)}function Rt(l){return l>=1e4?`${(l/1e3).toFixed(1)}s`:`${Math.round(l)}ms`}function De(l){return Number.isFinite(l)?l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:Math.round(l).toLocaleString():"0"}function Re(l){return Number.isFinite(l)?`$${l.toFixed(l<1?4:2)}`:"$0.00"}function _s(l,e,s){const n=Me(s),r=Oe(e.startDate,s).getTime(),i=e.endDate.getTime(),a=new Map(l.map(c=>[Oe(new Date(c.timestamp),s).getTime(),c])),m=[];for(let c=r;c<=i;c+=n){const o=a.get(c),b=new Date(c).toISOString();m.push({t:b,ts:c,label:Dt(b,s),calls:o?.calls??0,errors:o?.errors??0,errorRate:o?.errorRate??0,avg:o?.avg??0,p50:o?.p50??0,p95:o?.p95??0,inputTokens:o?.inputTokens??0,outputTokens:o?.outputTokens??0,totalTokens:o?.totalTokens??0,costUsd:o?.costUsd??0})}return m}function Ts(l,e){return e==="requests"?l.calls:e==="errors"?l.errorRate:l.avgDurationMs}function ks(l,e){return e==="requests"?l.calls.toLocaleString():e==="errors"?`${l.errorRate.toFixed(1)}%`:Rt(l.avgDurationMs)}function Ae(l){return(l.run_config??{}).agent?.id??(l.virtual_mcp_id||null)}function Ee(l,e,s,n){if(!l)return n;const r=e.find(a=>a.id===l)??s?.find(a=>a.id===l);if(r?.title)return r.title;const i=nt(l);return i?at(i).title??n:l}function $e(l,e,s){return l?(e.find(r=>r.id===l)??s?.find(r=>r.id===l))?.icon??null:null}function Xe(l){return l?.data?.members??[]}function we(l){const e=le.c(33),{thread:s,connections:n,virtualMcps:r,selectedIndex:i,total:a,onPrev:m,onNext:c}=l;let o,b;if(e[0]!==n||e[1]!==s||e[2]!==r){const I=Ae(s);o=Ee(I,r,n,""),b=$e(I,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=b}else o=e[3],b=e[4];const v=b,x=o||s.title;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ie,{}),e[5]=h):h=e[5];let N;e[6]!==v||e[7]!==x?(N=t.jsx(Pe,{icon:v,name:x,size:"sm",fallbackIcon:h,className:"shadow-sm shrink-0 rounded-md"}),e[6]=v,e[7]=x,e[8]=N):N=e[8];let u;e[9]!==s.title?(u=t.jsx(dt,{className:"text-sm leading-snug truncate",children:s.title}),e[9]=s.title,e[10]=u):u=e[10];let p;e[11]!==o?(p=o&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:o}),e[11]=o,e[12]=p):p=e[12];let j;e[13]!==u||e[14]!==p?(j=t.jsxs("div",{className:"min-w-0",children:[u,p]}),e[13]=u,e[14]=p,e[15]=j):j=e[15];let g;e[16]!==N||e[17]!==j?(g=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[N,j]}),e[16]=N,e[17]=j,e[18]=g):g=e[18];const S=i===0;let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ye,{size:14}),e[19]=f):f=e[19];let y;e[20]!==m||e[21]!==S?(y=t.jsx(fe,{size:"icon",variant:"ghost",onClick:m,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:f}),e[20]=m,e[21]=S,e[22]=y):y=e[22];const _=i===a-1;let d;e[23]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(he,{size:14}),e[23]=d):d=e[23];let C;e[24]!==c||e[25]!==_?(C=t.jsx(fe,{size:"icon",variant:"ghost",onClick:c,disabled:_,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:d}),e[24]=c,e[25]=_,e[26]=C):C=e[26];let T;e[27]!==y||e[28]!==C?(T=t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[y,C]}),e[27]=y,e[28]=C,e[29]=T):T=e[29];let w;return e[30]!==T||e[31]!==g?(w=t.jsx(mt,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[g,T]})}),e[30]=T,e[31]=g,e[32]=w):w=e[32],w}function At(l){const e=le.c(48),{thread:s,connections:n,virtualMcps:r,members:i}=l;let a,m;if(e[0]!==n||e[1]!==s||e[2]!==r){const M=Ae(s);a=Ee(M,r,n,""),m=$e(M,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=m}else a=e[3],m=e[4];const c=m;let o;if(e[5]!==i||e[6]!==s.created_by){const M=Xe(i);let A;e[8]!==s.created_by?(A=$=>$.userId===s.created_by,e[8]=s.created_by,e[9]=A):A=e[9],o=M.find(A),e[5]=i,e[6]=s.created_by,e[7]=o}else o=e[7];const b=o;let v;e[10]!==b?.user.email||e[11]!==b?.user.name||e[12]!==s.created_by?(v=b?.user.name??b?.user.email??s.created_by?.substring(0,8)??"—",e[10]=b?.user.email,e[11]=b?.user.name,e[12]=s.created_by,e[13]=v):v=e[13];const x=v,h=b?.user.image??void 0;let N;e[14]!==s.created_at?(N=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=N):N=e[15];const u=N,p=ue[s.status]??ue.completed,j=p.icon;let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=g):g=e[16];let S;e[17]!==j||e[18]!==p.iconClassName?(S=t.jsx(j,{size:13,className:p.iconClassName}),e[17]=j,e[18]=p.iconClassName,e[19]=S):S=e[19];let f;e[20]!==p.labelColor?(f=be("text-sm",p.labelColor),e[20]=p.labelColor,e[21]=f):f=e[21];let y;e[22]!==p.label||e[23]!==f?(y=t.jsx("span",{className:f,children:p.label}),e[22]=p.label,e[23]=f,e[24]=y):y=e[24];let _;e[25]!==S||e[26]!==y?(_=t.jsxs("div",{children:[g,t.jsxs("div",{className:"flex items-center gap-1.5",children:[S,y]})]}),e[25]=S,e[26]=y,e[27]=_):_=e[27];let d;e[28]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=d):d=e[28];let C;e[29]!==u?(C=t.jsxs("div",{children:[d,t.jsx("div",{className:"text-sm text-foreground",children:u})]}),e[29]=u,e[30]=C):C=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=T):T=e[31];let w;e[32]!==h||e[33]!==x?(w=t.jsx(We,{url:h,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=h,e[33]=x,e[34]=w):w=e[34];let I;e[35]!==x?(I=t.jsx("span",{className:"text-sm text-foreground",children:x}),e[35]=x,e[36]=I):I=e[36];let k;e[37]!==w||e[38]!==I?(k=t.jsxs("div",{children:[T,t.jsxs("div",{className:"flex items-center gap-2",children:[w,I]})]}),e[37]=w,e[38]=I,e[39]=k):k=e[39];let P;e[40]!==c||e[41]!==a?(P=a&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pe,{icon:c,name:a,size:"xs",fallbackIcon:t.jsx(Ie,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"text-sm text-foreground",children:a})]})]}),e[40]=c,e[41]=a,e[42]=P):P=e[42];let D;return e[43]!==C||e[44]!==k||e[45]!==P||e[46]!==_?(D=t.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[_,C,k,P]}),e[43]=C,e[44]=k,e[45]=P,e[46]=_,e[47]=D):D=e[47],D}function Et(l){const e=le.c(72),{thread:s,usage:n,members:r,connections:i,virtualMcps:a,onClick:m,lastRowRef:c}=l;let o,b;if(e[0]!==i||e[1]!==s||e[2]!==a){const V=Ae(s);o=Ee(V,a,i,"—"),b=$e(V,a,i),e[0]=i,e[1]=s,e[2]=a,e[3]=o,e[4]=b}else o=e[3],b=e[4];const v=b;let x;if(e[5]!==r||e[6]!==s.created_by){const V=Xe(r);let J;e[8]!==s.created_by?(J=z=>z.userId===s.created_by,e[8]=s.created_by,e[9]=J):J=e[9],x=V.find(J),e[5]=r,e[6]=s.created_by,e[7]=x}else x=e[7];const h=x;let N;e[10]!==h?.user.email||e[11]!==h?.user.name||e[12]!==s.created_by?(N=h?.user.name??h?.user.email??s.created_by?.substring(0,8)??"—",e[10]=h?.user.email,e[11]=h?.user.name,e[12]=s.created_by,e[13]=N):N=e[13];const u=N,p=h?.user.image??void 0;let j,g;if(e[14]!==s.created_at){const V=new Date(s.created_at);j=V.toLocaleDateString("en-US",{month:"short",day:"numeric"}),g=V.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=s.created_at,e[15]=j,e[16]=g}else j=e[15],g=e[16];const S=g,f=ue[s.status]??ue.completed,y=f.icon;let _;e[17]!==s.title?(_=t.jsx(se,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[17]=s.title,e[18]=_):_=e[18];let d;e[19]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ie,{}),e[19]=d):d=e[19];let C;e[20]!==v||e[21]!==o?(C=t.jsx(Pe,{icon:v,name:o,size:"xs",fallbackIcon:d,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=v,e[21]=o,e[22]=C):C=e[22];let T;e[23]!==o?(T=t.jsx("span",{className:"truncate",children:o}),e[23]=o,e[24]=T):T=e[24];let w;e[25]!==C||e[26]!==T?(w=t.jsx(se,{className:"w-36 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,T]})}),e[25]=C,e[26]=T,e[27]=w):w=e[27];let I;e[28]!==p||e[29]!==u?(I=t.jsx(We,{url:p,fallback:u,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=p,e[29]=u,e[30]=I):I=e[30];let k;e[31]!==u?(k=t.jsx("span",{className:"truncate",children:u}),e[31]=u,e[32]=k):k=e[32];let P;e[33]!==I||e[34]!==k?(P=t.jsx(se,{className:"w-28 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[33]=I,e[34]=k,e[35]=P):P=e[35];let D;e[36]!==y||e[37]!==f.iconClassName?(D=t.jsx(y,{size:14,className:f.iconClassName}),e[36]=y,e[37]=f.iconClassName,e[38]=D):D=e[38];let M;e[39]!==f.labelColor?(M=be("text-sm",f.labelColor),e[39]=f.labelColor,e[40]=M):M=e[40];let A;e[41]!==f.label||e[42]!==M?(A=t.jsx("span",{className:M,children:f.label}),e[41]=f.label,e[42]=M,e[43]=A):A=e[43];let $;e[44]!==D||e[45]!==A?($=t.jsx(se,{className:"w-24 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[D,A]})}),e[44]=D,e[45]=A,e[46]=$):$=e[46];let B;e[47]!==n?(B=n?De(n.totalTokens):"—",e[47]=n,e[48]=B):B=e[48];let F;e[49]!==B?(F=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:B}),e[49]=B,e[50]=F):F=e[50];let Z;e[51]!==n?(Z=n&&n.costUsd>0?Re(n.costUsd):"—",e[51]=n,e[52]=Z):Z=e[52];let q;e[53]!==Z?(q=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:Z}),e[53]=Z,e[54]=q):q=e[54];let U;e[55]!==j?(U=t.jsx("div",{children:j}),e[55]=j,e[56]=U):U=e[56];let O;e[57]!==S?(O=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:S}),e[57]=S,e[58]=O):O=e[58];let L;e[59]!==U||e[60]!==O?(L=t.jsxs(se,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[U,O]}),e[59]=U,e[60]=O,e[61]=L):L=e[61];let K;return e[62]!==c||e[63]!==m||e[64]!==P||e[65]!==$||e[66]!==F||e[67]!==q||e[68]!==L||e[69]!==_||e[70]!==w?(K=t.jsxs(Ne,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:m,children:[_,w,P,$,F,q,L]}),e[62]=c,e[63]=m,e[64]=P,e[65]=$,e[66]=F,e[67]=q,e[68]=L,e[69]=_,e[70]=w,e[71]=K):K=e[71],K}const Ce=100;function $t(l){const e=le.c(37),{client:s,locator:n,thread:r,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}=l;let x;e[0]!==n||e[1]!==r.id?(x=xe.threadMessages(n,r.id),e[0]=n,e[1]=r.id,e[2]=x):x=e[2];let h;e[3]!==s||e[4]!==r.id?(h=async k=>{const{pageParam:P}=k,D=P===void 0?0:P;if(!s)throw new Error("MCP client is not available");const M=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:Ce,offset:D}});return M.structuredContent??M},e[3]=s,e[4]=r.id,e[5]=h):h=e[5];let N;e[6]!==x||e[7]!==h?(N={queryKey:x,queryFn:h,initialPageParam:0,getNextPageParam:Ut,staleTime:6e4},e[6]=x,e[7]=h,e[8]=N):N=e[8];const{data:u,fetchNextPage:p,hasNextPage:j,isFetchingNextPage:g}=xt(N);let S;e[9]!==u.pages?(S=u.pages.flatMap(Ft).filter(Lt),e[9]=u.pages,e[10]=S):S=e[10];const f=S,y=Ct(f);let _;e[11]!==p||e[12]!==j||e[13]!==g?(_=()=>{j&&!g&&p()},e[11]=p,e[12]=j,e[13]=g,e[14]=_):_=e[14];const d=ke(_,j??!1,g);let C;e[15]!==i||e[16]!==v||e[17]!==b||e[18]!==c||e[19]!==r||e[20]!==o||e[21]!==a?(C=t.jsx(we,{thread:r,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[15]=i,e[16]=v,e[17]=b,e[18]=c,e[19]=r,e[20]=o,e[21]=a,e[22]=C):C=e[22];let T;e[23]!==i||e[24]!==m||e[25]!==r||e[26]!==a?(T=t.jsx(At,{thread:r,connections:i,virtualMcps:a,members:m}),e[23]=i,e[24]=m,e[25]=r,e[26]=a,e[27]=T):T=e[27];let w;e[28]!==g||e[29]!==d||e[30]!==y||e[31]!==f.length?(w=f.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this thread"}):t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:t.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[y.map((k,P)=>t.jsx("div",{ref:P===y.length-1?d:void 0,children:t.jsx(_t,{pair:k,isLastPair:P===y.length-1,status:"ready"})},`pair-${k.user?.id??k.assistant?.id}`)),g&&t.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=g,e[29]=d,e[30]=y,e[31]=f.length,e[32]=w):w=e[32];let I;return e[33]!==C||e[34]!==T||e[35]!==w?(I=t.jsxs(t.Fragment,{children:[C,T,w]}),e[33]=C,e[34]=T,e[35]=w,e[36]=I):I=e[36],I}function Lt(l){return l.role==="user"||l.role==="assistant"}function Ft(l){return l.items??[]}function Ut(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Ce))return n.length*Ce}function et(l){const e=le.c(39),{thread:s,client:n,locator:r,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}=l;let x;e[0]!==i||e[1]!==v||e[2]!==b||e[3]!==c||e[4]!==s||e[5]!==o||e[6]!==a?(x=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[0]=i,e[1]=v,e[2]=b,e[3]=c,e[4]=s,e[5]=o,e[6]=a,e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=h):h=e[8];let N;e[9]!==x?(N=t.jsxs(t.Fragment,{children:[x,h]}),e[9]=x,e[10]=N):N=e[10];let u;e[11]!==i||e[12]!==v||e[13]!==b||e[14]!==c||e[15]!==s||e[16]!==o||e[17]!==a?(u=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[11]=i,e[12]=v,e[13]=b,e[14]=c,e[15]=s,e[16]=o,e[17]=a,e[18]=u):u=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=p):p=e[19];let j;e[20]!==u?(j=t.jsxs(t.Fragment,{children:[u,p]}),e[20]=u,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i||e[24]!==r||e[25]!==m||e[26]!==v||e[27]!==b||e[28]!==c||e[29]!==s||e[30]!==o||e[31]!==a?(g=t.jsx($t,{client:n,locator:r,thread:s,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[22]=n,e[23]=i,e[24]=r,e[25]=m,e[26]=v,e[27]=b,e[28]=c,e[29]=s,e[30]=o,e[31]=a,e[32]=g):g=e[32];let S;e[33]!==j||e[34]!==g?(S=t.jsx(oe.Suspense,{fallback:j,children:g}),e[33]=j,e[34]=g,e[35]=S):S=e[35];let f;return e[36]!==N||e[37]!==S?(f=t.jsx(tt,{fallback:N,children:S}),e[36]=N,e[37]=S,e[38]=f):f=e[38],f}function Is(l){const e=le.c(43),{filterAgentIds:s,filterUserIds:n,filterStatus:r,virtualMcpOptions:i,memberOptions:a,activeFiltersCount:m,onUpdateFilters:c}=l,[o,b]=oe.useState(!1);let v,x;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(wt,{size:16}),x=t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=v,e[1]=x):(v=e[0],x=e[1]);let h;e[2]!==m?(h=m>0&&t.jsxs(t.Fragment,{children:[t.jsx(je,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:m}),t.jsx(je,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:m})]}),e[2]=m,e[3]=h):h=e[3];let N;e[4]!==h?(N=t.jsx(Je,{asChild:!0,children:t.jsxs(fe,{variant:"outline",className:"relative",children:[v,x,h]})}),e[4]=h,e[5]=N):N=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=u):u=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agent"}),e[7]=p):p=e[7];let j;e[8]!==c?(j=M=>c({filterAgentIds:M.slice(0,1)}),e[8]=c,e[9]=j):j=e[9];let g;e[10]!==s||e[11]!==j||e[12]!==i?(g=t.jsxs("div",{children:[p,t.jsx(Ue,{options:i,defaultValue:s,onValueChange:j,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=s,e[11]=j,e[12]=i,e[13]=g):g=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"User"}),e[14]=S):S=e[14];let f;e[15]!==c?(f=M=>c({filterUserIds:M.slice(0,1)}),e[15]=c,e[16]=f):f=e[16];let y;e[17]!==n||e[18]!==a||e[19]!==f?(y=t.jsxs("div",{children:[S,t.jsx(Ue,{options:a,defaultValue:n,onValueChange:f,placeholder:"All users",variant:"secondary",className:"w-full",maxCount:1})]}),e[17]=n,e[18]=a,e[19]=f,e[20]=y):y=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=_):_=e[21];let d;e[22]!==c?(d=M=>c({filterStatus:M}),e[22]=c,e[23]=d):d=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ht,{className:"w-full",children:t.jsx(gt,{})}),e[24]=C):C=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(pt,{children:[t.jsx(ge,{value:"all",children:"All statuses"}),t.jsx(ge,{value:"completed",children:"Completed"}),t.jsx(ge,{value:"active",children:"Active"}),t.jsx(ge,{value:"failed",children:"Failed"})]}),e[25]=T):T=e[25];let w;e[26]!==r||e[27]!==d?(w=t.jsxs("div",{children:[_,t.jsxs(jt,{value:r,onValueChange:d,children:[C,T]})]}),e[26]=r,e[27]=d,e[28]=w):w=e[28];let I;e[29]!==y||e[30]!==w||e[31]!==g?(I=t.jsxs("div",{className:"space-y-3",children:[g,y,w]}),e[29]=y,e[30]=w,e[31]=g,e[32]=I):I=e[32];let k;e[33]!==m||e[34]!==c?(k=m>0&&t.jsx(fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),b(!1)},children:"Clear all filters"}),e[33]=m,e[34]=c,e[35]=k):k=e[35];let P;e[36]!==I||e[37]!==k?(P=t.jsx(Qe,{align:"end",className:"w-[280px]",children:t.jsxs("div",{className:"space-y-4",children:[u,I,k]})}),e[36]=I,e[37]=k,e[38]=P):P=e[38];let D;return e[39]!==o||e[40]!==P||e[41]!==N?(D=t.jsxs(Ze,{open:o,onOpenChange:b,children:[N,P]}),e[39]=o,e[40]=P,e[41]=N,e[42]=D):D=e[42],D}const _e=50;function Ps(l){const e=le.c(29),{client:s,locator:n,membersData:r,allConnections:i,allVirtualMcps:a,dateRange:m,searchQuery:c,filterAgentIds:o,filterUserIds:b,filterStatus:v}=l,[x,h]=oe.useState(null),N=m.startDate.toISOString(),u=m.endDate.toISOString(),p=JSON.stringify({startDate:N,endDate:u,search:c,agentIds:o,userIds:b,status:v}),{data:j,fetchNextPage:g,hasNextPage:S,isFetchingNextPage:f,isLoading:y}=ze({queryKey:xe.threadsInfinite(n,p),queryFn:async R=>{const{pageParam:G}=R,ie=G===void 0?0:G;if(!s)throw new Error("MCP client is not available");const E=await s.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:_e,offset:ie,startDate:N,endDate:u,...c?{search:c}:{},...o&&o.length>0?{agentId:o[0]}:{},...b&&b.length>0?{userId:b[0]}:{},...v&&v!=="all"?{status:v}:{}}});return E.structuredContent??E},initialPageParam:0,getNextPageParam:Gt,staleTime:3e4}),_=(j?.pages??[]).flatMap(qt),d=_.map(Kt),{data:C}=Ve({queryKey:xe.monitoringThreadUsage(n,JSON.stringify({ids:d,startDate:N,endDate:u})),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const R=await s.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:d,startDate:N,endDate:u}});return R.structuredContent??R},enabled:!!s&&d.length>0,staleTime:3e4}),T=new Map((C?.items??[]).map(zt)),[w,I]=oe.useState(null),[k,P]=oe.useState("desc");let D;e[0]!==w?(D=R=>{w===R?P(Vt):(I(R),P("desc"))},e[0]=w,e[1]=D):D=e[1];const M=D,A=R=>{const G=T.get(R);return G?w==="cost"?G.costUsd:G.totalTokens:0},$=w?[..._].sort((R,G)=>{const ie=A(R.id),E=A(G.id);return k==="desc"?E-ie:ie-E}):_,B=x!==null?$[x]??null:null;let F;e[2]!==g||e[3]!==S||e[4]!==f?(F=()=>{S&&!f&&g()},e[2]=g,e[3]=S,e[4]=f,e[5]=F):F=e[5];const q=ke(F,S??!1,f),U=!!c||(o?.length??0)>0||(b?.length??0)>0||v&&v!=="all";let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=()=>h(Ot),e[6]=O):O=e[6];const L=O,K=()=>h(R=>R!==null&&R<$.length-1?R+1:R),V="flex-1 flex flex-col overflow-auto min-w-0",J="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",z="flex-1 flex flex-col min-w-0",Q="flex-1 min-w-0 pt-1",ce="min-w-0",W=y?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):_.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx(Se,{title:U?"No matching threads":"No threads in this time range",description:U?"Try adjusting your filters or search query.":"Try expanding the time range to see older threads."})}):t.jsxs(t.Fragment,{children:[t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0 z-20",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(te,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),t.jsx(te,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(te,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",w==="tokens"&&(k==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",w==="cost"&&(k==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(te,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),t.jsx(Be,{children:$.map((R,G)=>t.jsx(Et,{thread:R,usage:T.get(R.id),members:r,connections:i,virtualMcps:a,onClick:()=>h(G),lastRowRef:G===$.length-1?q:void 0},R.id))})]}),f&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let Y;e[7]!==W?(Y=t.jsx("div",{className:J,children:t.jsx("div",{className:z,children:t.jsx("div",{className:Q,children:t.jsx("div",{className:ce,children:W})})})}),e[7]=W,e[8]=Y):Y=e[8];const de=x!==null;let ne;e[9]===Symbol.for("react.memo_cache_sentinel")?(ne=R=>{R||h(null)},e[9]=ne):ne=e[9];let ae;e[10]!==i||e[11]!==a||e[12]!==s||e[13]!==$||e[14]!==K||e[15]!==L||e[16]!==n||e[17]!==r||e[18]!==B||e[19]!==x?(ae=B&&x!==null&&t.jsx(et,{thread:B,client:s,locator:n,connections:i,virtualMcps:a,members:r,selectedIndex:x,total:$.length,onPrev:L,onNext:K}),e[10]=i,e[11]=a,e[12]=s,e[13]=$,e[14]=K,e[15]=L,e[16]=n,e[17]=r,e[18]=B,e[19]=x,e[20]=ae):ae=e[20];let X;e[21]!==ae?(X=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:ae}),e[21]=ae,e[22]=X):X=e[22];let ee;e[23]!==de||e[24]!==X?(ee=t.jsx(qe,{open:de,onOpenChange:ne,children:X}),e[23]=de,e[24]=X,e[25]=ee):ee=e[25];let re;return e[26]!==Y||e[27]!==ee?(re=t.jsxs("div",{className:V,children:[Y,ee]}),e[26]=Y,e[27]=ee,e[28]=re):re=e[28],re}function Ot(l){return l!==null&&l>0?l-1:l}function Vt(l){return l==="desc"?"asc":"desc"}function zt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Kt(l){return l.id}function qt(l){return l.items??[]}function Gt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<_e))return n.length*_e}const Te=50;function pe(l){const e=le.c(10),{title:s,value:n,subtitle:r}=l;let i;e[0]!==s?(i=t.jsx("span",{className:"text-sm text-foreground/70",children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=t.jsx("span",{className:"text-3xl font-normal tabular-nums",children:n}),e[2]=n,e[3]=a):a=e[3];let m;e[4]!==r?(m=r&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=m):m=e[5];let c;return e[6]!==i||e[7]!==a||e[8]!==m?(c=t.jsxs(ct,{className:"pt-4 px-4 pb-5 gap-1",children:[i,a,m]}),e[6]=i,e[7]=a,e[8]=m,e[9]=c):c=e[9],c}function Ht(l){const e=le.c(27),{automationId:s,range:n}=l,{data:r,isLoading:i}=ft(s,n),a=r?.runs,m=r?.usage;let c;e[0]!==a?(c=a&&a.total>0?`${Math.round(a.completed/a.total*100)}%`:"—",e[0]=a,e[1]=c):c=e[1];const o=c,b=m&&m.truncated?`last ${m.sampledRuns} runs`:void 0;let v;e[2]!==i||e[3]!==a?.total?(v=i?"…":a?.total.toLocaleString()??"0",e[2]=i,e[3]=a?.total,e[4]=v):v=e[4];const x=a?`${a.completed} ok · ${a.failed} failed${a.inProgress>0?` · ${a.inProgress} running`:""}`:void 0;let h;e[5]!==v||e[6]!==x?(h=t.jsx(pe,{title:"Runs",value:v,subtitle:x}),e[5]=v,e[6]=x,e[7]=h):h=e[7];const N=i?"…":o;let u;e[8]!==N?(u=t.jsx(pe,{title:"Success rate",value:N}),e[8]=N,e[9]=u):u=e[9];let p;e[10]!==i||e[11]!==m?.totalTokens?(p=i?"…":De(m?.totalTokens??0),e[10]=i,e[11]=m?.totalTokens,e[12]=p):p=e[12];let j;e[13]!==p||e[14]!==b?(j=t.jsx(pe,{title:"Tokens",value:p,subtitle:b}),e[13]=p,e[14]=b,e[15]=j):j=e[15];let g;e[16]!==i||e[17]!==m?(g=i?"…":m&&m.costUsd>0?Re(m.costUsd):"—",e[16]=i,e[17]=m,e[18]=g):g=e[18];let S;e[19]!==g||e[20]!==b?(S=t.jsx(pe,{title:"Cost",value:g,subtitle:b}),e[19]=g,e[20]=b,e[21]=S):S=e[21];let f;return e[22]!==S||e[23]!==h||e[24]!==u||e[25]!==j?(f=t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[h,u,j,S]}),e[22]=S,e[23]=h,e[24]=u,e[25]=j,e[26]=f):f=e[26],f}function Bt(l){const e=le.c(39),{run:s,usage:n,onClick:r,lastRowRef:i}=l;let a,m;if(e[0]!==s.created_at){const C=new Date(s.created_at);a=C.toLocaleDateString("en-US",{month:"short",day:"numeric"}),m=C.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=s.created_at,e[1]=a,e[2]=m}else a=e[1],m=e[2];const c=m,o=ue[s.status]??ue.completed,b=o.icon;let v;e[3]!==s.title?(v=t.jsx(se,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[3]=s.title,e[4]=v):v=e[4];let x;e[5]!==b||e[6]!==o.iconClassName?(x=t.jsx(b,{size:14,className:o.iconClassName}),e[5]=b,e[6]=o.iconClassName,e[7]=x):x=e[7];let h;e[8]!==o.labelColor?(h=be("text-sm",o.labelColor),e[8]=o.labelColor,e[9]=h):h=e[9];let N;e[10]!==o.label||e[11]!==h?(N=t.jsx("span",{className:h,children:o.label}),e[10]=o.label,e[11]=h,e[12]=N):N=e[12];let u;e[13]!==x||e[14]!==N?(u=t.jsx(se,{className:"w-28 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[x,N]})}),e[13]=x,e[14]=N,e[15]=u):u=e[15];let p;e[16]!==n?(p=n?De(n.totalTokens):"—",e[16]=n,e[17]=p):p=e[17];let j;e[18]!==p?(j=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[18]=p,e[19]=j):j=e[19];let g;e[20]!==n?(g=n&&n.costUsd>0?Re(n.costUsd):"—",e[20]=n,e[21]=g):g=e[21];let S;e[22]!==g?(S=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:g}),e[22]=g,e[23]=S):S=e[23];let f;e[24]!==a?(f=t.jsx("div",{children:a}),e[24]=a,e[25]=f):f=e[25];let y;e[26]!==c?(y=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=y):y=e[27];let _;e[28]!==f||e[29]!==y?(_=t.jsxs(se,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[f,y]}),e[28]=f,e[29]=y,e[30]=_):_=e[30];let d;return e[31]!==i||e[32]!==r||e[33]!==S||e[34]!==_||e[35]!==v||e[36]!==u||e[37]!==j?(d=t.jsxs(Ne,{ref:i,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[v,u,j,S,_]}),e[31]=i,e[32]=r,e[33]=S,e[34]=_,e[35]=v,e[36]=u,e[37]=j,e[38]=d):d=e[38],d}function Ms(l){const e=le.c(48),{automationId:s,triggerIds:n,range:r}=l,{org:i,locator:a}=st();let m;e[0]!==i.id||e[1]!==i.slug?(m={connectionId:rt,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=m):m=e[2];const c=it(m),o=lt(),b=ot(),{data:v}=ut(),[x,h]=oe.useState(null),N=n.length>0;let u;e[3]!==s||e[4]!==i.id||e[5]!==n?(u=xe.automationRuns(i.id,s,n),e[3]=s,e[4]=i.id,e[5]=n,e[6]=u):u=e[6];let p;e[7]!==c||e[8]!==n?(p=async z=>{const{pageParam:Q}=z,ce=Q===void 0?0:Q,W=await c.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:Te,offset:ce,where:{trigger_ids:n}}});return W.structuredContent??W},e[7]=c,e[8]=n,e[9]=p):p=e[9];let j;e[10]!==N||e[11]!==u||e[12]!==p?(j={queryKey:u,queryFn:p,initialPageParam:0,getNextPageParam:Yt,enabled:N,staleTime:3e4},e[10]=N,e[11]=u,e[12]=p,e[13]=j):j=e[13];const{data:g,fetchNextPage:S,hasNextPage:f,isFetchingNextPage:y,isLoading:_}=ze(j),d=(g?.pages??[]).flatMap(Wt),C=d.map(Zt),{data:T}=Ve({queryKey:xe.monitoringThreadUsage(a,JSON.stringify({ids:C,...r})),queryFn:async()=>{const z=await c.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:C,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}});return z.structuredContent??z},enabled:C.length>0,staleTime:3e4});let w;e[14]!==T?.items?(w=new Map((T?.items??[]).map(Qt)),e[14]=T?.items,e[15]=w):w=e[15];const I=w;let k;e[16]!==S||e[17]!==f||e[18]!==y?(k=()=>{f&&!y&&S()},e[16]=S,e[17]=f,e[18]=y,e[19]=k):k=e[19];const P=ke(k,f??!1,y),D=x!==null?d[x]??null:null;let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=()=>h(Jt),e[20]=M):M=e[20];const A=M,$=()=>h(z=>z!==null&&z<d.length-1?z+1:z),B="flex flex-col gap-5";let F;e[21]!==s||e[22]!==r?(F=t.jsx(Ht,{automationId:s,range:r}),e[21]=s,e[22]=r,e[23]=F):F=e[23];const Z=N?_?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):d.length===0?t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(te,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),t.jsx(te,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),t.jsx(te,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),t.jsx(Be,{children:d.map((z,Q)=>t.jsx(Bt,{run:z,usage:I.get(z.id),onClick:()=>h(Q),lastRowRef:Q===d.length-1?P:void 0},z.id))})]}):t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let q;e[24]!==y?(q=y&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=y,e[25]=q):q=e[25];const U=x!==null;let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=z=>{z||h(null)},e[26]=O):O=e[26];let L;e[27]!==o||e[28]!==b||e[29]!==c||e[30]!==$||e[31]!==A||e[32]!==a||e[33]!==v||e[34]!==d||e[35]!==D||e[36]!==x?(L=D&&x!==null&&t.jsx(et,{thread:D,client:c,locator:a,connections:o,virtualMcps:b,members:v,selectedIndex:x,total:d.length,onPrev:A,onNext:$}),e[27]=o,e[28]=b,e[29]=c,e[30]=$,e[31]=A,e[32]=a,e[33]=v,e[34]=d,e[35]=D,e[36]=x,e[37]=L):L=e[37];let K;e[38]!==L?(K=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:L}),e[38]=L,e[39]=K):K=e[39];let V;e[40]!==U||e[41]!==K?(V=t.jsx(qe,{open:U,onOpenChange:O,children:K}),e[40]=U,e[41]=K,e[42]=V):V=e[42];let J;return e[43]!==Z||e[44]!==q||e[45]!==V||e[46]!==F?(J=t.jsxs("div",{className:B,children:[F,Z,q,V]}),e[43]=Z,e[44]=q,e[45]=V,e[46]=F,e[47]=J):J=e[47],J}function Jt(l){return l!==null&&l>0?l-1:l}function Qt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Zt(l){return l.id}function Wt(l){return l.items??[]}function Yt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Te))return n.length*Te}export{Ms as A,Ue as M,Is as T,Re as a,_s as b,Rt as c,ks as d,Ts as e,De as f,Cs as g,Xe as h,Ps as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as k,j as o,q as L,f as T,r as $,B as M,t as N}from"./index-BfzqpoYd.js";import{s as q}from"./Plus-gXoAw_mX.js";import{i as S}from"./Zap-BLBAeivN.js";import{S as D}from"./search-input-C3i2qrnL.js";import{P as l}from"./index-CVPVNlMM.js";import{E as b}from"./empty-state-BJuYi96S.js";import{c as O}from"./use-automations-B6ZTT5n1.js";import{k as V}from"./use-navigate-to-agent-BRFls8tQ.js";import{A as F}from"./automation-list-row-C8yWYA2H.js";import{h as G}from"./use-mcp-client-Brxiewn2.js";import{a as H}from"./use-virtual-mcp-DDTG_-f6.js";import{R as J}from"./require-capability-Bi88Fg3q.js";import"./SearchMd-z6b-QOmX.js";import"./sidebar-B3S1MC-b.js";import"./LayoutLeft-6fPyjOVd.js";import"./tooltip-CC_mfaKY.js";import"./sheet-y2Nja_Ue.js";import"./X-DCWlm9Ta.js";import"./alert-dialog-DJLxSS_E.js";import"./dropdown-menu-DpfpR4kx.js";import"./Check-CSixRgqh.js";import"./ChevronRight-CtziSifX.js";import"./DotsVertical-DQ3UGDDE.js";import"./agent-icon-Lc1AgwlE.js";import"./AlertCircle-B-p2hhbf.js";import"./Tool01-DXWYgeBe.js";import"./SwitchHorizontal01-__hAuhZa.js";import"./RefreshCcw01-DlKjMM-5.js";import"./XCircle-CEKwTNMD.js";import"./ArrowUpRight-Bq-dJGgn.js";import"./ZapSquare-DSdwG_FE.js";import"./Users03-D5pU3_ql.js";import"./CheckCircle-CqLcOI7o.js";import"./ChevronDown-BptXi8Ef.js";import"./ChevronLeft-Bq6F--2K.js";import"./ChevronUp-DChs66VU.js";import"./Container-DIwdobum.js";import"./Eye-DepFjUJE.js";import"./ZoomOut-CCPaeWry.js";import"./Globe01-BayTDYGC.js";import"./FilterLines-CIJgiiLT.js";import"./Star01-q6EhXttt.js";import"./Palette-siqkt4cQ.js";import"./HardDrive-OwnJRrIS.js";import"./Stars02-DJ4Y5TfK.js";import"./Key01-CR8zfCdU.js";import"./LinkExternal01-B2YZgRTN.js";import"./Monitor01-BNXW6pu5.js";import"./Sun-CeFpMHQU.js";import"./Play-CBt0NeLA.js";import"./Settings02-C7YqxsZL.js";import"./Shield01-BT66FEMI.js";import"./Stars01-DcMeK1n0.js";import"./Trash01-B91-1KNk.js";import"./Upload01-CcwGyBRP.js";import"./User01-JR_76gHl.js";import"./Users01-BM2QLqUJ.js";import"./XClose-DhQ5V0ST.js";import"./use-collections-vRlJo8MD.js";import"./use-capability-aJI8msnV.js";import"./access-gate-DXlQ8iVy.js";import"./capability-load-error-Dn3qy9VI.js";function K(){const t=k.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,B=H(),R=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(B.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const m=y.get(e.virtual_mcp_id);if(m&&m.title.toLowerCase().includes(g))return!0}return!1}),P=(e,m)=>{const A=m&&y.has(m)?m:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),R(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let a;t[10]!==h.Content||t[11]!==s?(a=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=a):a=t[12];let c;return t[13]!==x||t[14]!==a?(c=o.jsx(x,{children:a}),t[13]=x,t[14]=a,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function eo(){const t=k.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{eo as default};
|