decocms 4.76.70 → 4.76.72
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-sDfzMQz-.js → AlertCircle-DEC9MSli.js} +1 -1
- package/dist/client/assets/{AreaChart-BbF7HkuD.js → AreaChart-DTG-5b5r.js} +1 -1
- package/dist/client/assets/{ArrowUp-5EMoK-0z.js → ArrowUp-Bv0D2eRZ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BCg_ek3r.js → ArrowUpRight-CYh_XgMl.js} +1 -1
- package/dist/client/assets/{Check-DW_CJo9x.js → Check-e0NpaqDI.js} +1 -1
- package/dist/client/assets/{CheckCircle-CvckcHSW.js → CheckCircle-Dx8PlP_2.js} +1 -1
- package/dist/client/assets/{ChevronDown-CyPL9p3K.js → ChevronDown-_14-4vSC.js} +1 -1
- package/dist/client/assets/{ChevronRight-jGxYypbD.js → ChevronRight-DbSu3dHh.js} +1 -1
- package/dist/client/assets/{ChevronUp-D1wkSkA0.js → ChevronUp-B37nF1fQ.js} +1 -1
- package/dist/client/assets/{Circle-XeFXmZfO.js → Circle-BRedzDGU.js} +1 -1
- package/dist/client/assets/{Copy01-AsmF-oFM.js → Copy01-By6PMNLM.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dk5Xdxve.js → DotsVertical-BnGH5h2q.js} +1 -1
- package/dist/client/assets/{Eye-DF50O1Ue.js → Eye-SeG_sslr.js} +1 -1
- package/dist/client/assets/{FilterLines-C_jjXfkg.js → FilterLines-DgL56yQR.js} +1 -1
- package/dist/client/assets/{Flag01-B5gDwl3Q.js → Flag01-D30atYPD.js} +1 -1
- package/dist/client/assets/{Globe01-DOhXvJ4f.js → Globe01-CGrBb2vX.js} +1 -1
- package/dist/client/assets/{Globe04-c8g2iyUk.js → Globe04-CfZZGfkA.js} +1 -1
- package/dist/client/assets/{HardDrive-Ddg1UJlN.js → HardDrive-But4kF8X.js} +1 -1
- package/dist/client/assets/Image01-DmnY7rUZ.js +1 -0
- package/dist/client/assets/{Key01-BOZ45ZZP.js → Key01-CTvn2ZzI.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BkVB2IbZ.js → LayoutLeft-BgPQbC33.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DdU7WoMF.js → LinkExternal01-P3P-mbSS.js} +1 -1
- package/dist/client/assets/{List-D9CCEPJ3.js → List-BSS9biwy.js} +1 -1
- package/dist/client/assets/{Monitor01-sX1pwHXM.js → Monitor01-CJoylRhB.js} +1 -1
- package/dist/client/assets/{Package-CfSQbtDl.js → Package-CZ8HIJPE.js} +1 -1
- package/dist/client/assets/{Palette-C7yix6_T.js → Palette-BqxIzEcM.js} +1 -1
- package/dist/client/assets/{Play-BlRk613P.js → Play-BjvHD3Bw.js} +1 -1
- package/dist/client/assets/{Plus-o1s3J9RF.js → Plus-CODnQ6Q6.js} +1 -1
- package/dist/client/assets/{SearchLg-M-hd_gai.js → SearchLg-BaxA63pq.js} +1 -1
- package/dist/client/assets/{SearchMd-CxWfDzx_.js → SearchMd-D40sWBRu.js} +1 -1
- package/dist/client/assets/{Settings02-CXx65ABV.js → Settings02-DQJFAffZ.js} +1 -1
- package/dist/client/assets/{Shield01-CWQHp-7f.js → Shield01-CjRpjR_E.js} +1 -1
- package/dist/client/assets/{Star01-D8wrCAnP.js → Star01-_3pK6eyk.js} +1 -1
- package/dist/client/assets/{Stars01-Cmtkyg7-.js → Stars01-DdwQA6ep.js} +1 -1
- package/dist/client/assets/{Stars02-CyV0ls88.js → Stars02-D4MIgE30.js} +1 -1
- package/dist/client/assets/{Sun-CE2mYjYy.js → Sun-BPUPfxdb.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C7qYtxDX.js → SwitchHorizontal01-KFFv0SYH.js} +1 -1
- package/dist/client/assets/Tool01-YMJ1AQ7b.js +1 -0
- package/dist/client/assets/{Tool02-B6UqyM_J.js → Tool02-CQKaIo5U.js} +1 -1
- package/dist/client/assets/{Trash01-BhHYhKqt.js → Trash01-YzxIFPEh.js} +1 -1
- package/dist/client/assets/{TrendUp01-ytIvysU7.js → TrendUp01-e6qVgaWu.js} +1 -1
- package/dist/client/assets/{Upload01-MLXfWlY_.js → Upload01-CjzKM9B1.js} +1 -1
- package/dist/client/assets/{User01-DyqXRcED.js → User01-DKdTYNBE.js} +1 -1
- package/dist/client/assets/{UserPlus01-CiUhK_7V.js → UserPlus01-C6rHXPgw.js} +1 -1
- package/dist/client/assets/{Users01-C2chq_s1.js → Users01-B1f-a-8q.js} +1 -1
- package/dist/client/assets/{Users03-B522am55.js → Users03-JOazr1ri.js} +1 -1
- package/dist/client/assets/{X-BWPJzkP7.js → X-DOYte4FY.js} +1 -1
- package/dist/client/assets/{XCircle-D0AQsXiF.js → XCircle-BujJTW-u.js} +1 -1
- package/dist/client/assets/{XClose-C6R6Hrmn.js → XClose-D2J197LD.js} +1 -1
- package/dist/client/assets/{Zap-DJjVd0ns.js → Zap-5x1m3kYf.js} +1 -1
- package/dist/client/assets/{ZapSquare-D-7d5mNS.js → ZapSquare-CzB0XDWh.js} +1 -1
- package/dist/client/assets/ZoomOut-BpXvy-WE.js +1 -0
- package/dist/client/assets/{access-gate--y6i1h5d.js → access-gate-DXPMLlBG.js} +1 -1
- package/dist/client/assets/{add-section-modal-DaLIpWVo.js → add-section-modal-DXtJ-8Vn.js} +1 -1
- package/dist/client/assets/agent-icon-gJGKPGRw.js +1 -0
- package/dist/client/assets/agents-list-O3_wFc4B.js +1 -0
- package/dist/client/assets/ai-providers-G88BQka1.js +1 -0
- package/dist/client/assets/{alert-Cofu8c-C.js → alert-Dc_gaUf6.js} +1 -1
- package/dist/client/assets/{alert-dialog-DJa8hr5P.js → alert-dialog-aBhDZKiu.js} +1 -1
- package/dist/client/assets/app-editor-1x_hThf7.js +1 -0
- package/dist/client/assets/{auth-0M1DqVYt.js → auth-D0u-sXdR.js} +1 -1
- package/dist/client/assets/{auth-catchall-Esw-EfKA.js → auth-catchall-Ho9vBgJg.js} +1 -1
- package/dist/client/assets/{auth-entry-BRqC2psi.js → auth-entry-CeMJZPYU.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CvH5-Yt4.js → auth-split-layout-CXbU0Pxf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-D-6WsL4Q.js → authenticate-and-persist-oauth-C1F-Ib2x.js} +1 -1
- package/dist/client/assets/{automation-list-row-B0m5PJDd.js → automation-list-row-RVZQ1tzS.js} +1 -1
- package/dist/client/assets/{automation-runs-NZWy5naJ.js → automation-runs-BAUPpPsN.js} +6 -6
- package/dist/client/assets/automations-DdvI7mpY.js +1 -0
- package/dist/client/assets/{autosend-8dyE67rr.js → autosend-BA5B1p8b.js} +1 -1
- package/dist/client/assets/{avatar-BpWo990_.js → avatar-DhzJ7Zvn.js} +1 -1
- package/dist/client/assets/{badge-J8Dmk1J0.js → badge-CU7Ybb4s.js} +1 -1
- package/dist/client/assets/{block-document-Fj80zG4o.js → block-document-CDGFLVI9.js} +1 -1
- package/dist/client/assets/{brand-context-VaUYeOuK.js → brand-context-CtoaVJwL.js} +1 -1
- package/dist/client/assets/{buckets-DpH0N-d9.js → buckets-KILbd-nI.js} +1 -1
- package/dist/client/assets/bulk-category-panel-DtWIgxRZ.js +1 -0
- package/dist/client/assets/{calendar-CiyIJkJP.js → calendar-BKUPgHWb.js} +1 -1
- package/dist/client/assets/{capability-load-error-rAKAVL0-.js → capability-load-error-1uM7cYTS.js} +1 -1
- package/dist/client/assets/{card-aa3oAwSK.js → card-Cx6wrdfw.js} +1 -1
- package/dist/client/assets/category-editor-C739ZvBd.js +1 -0
- package/dist/client/assets/{chat-context-BwMjJizF.js → chat-context-B5ZQ1YfK.js} +1 -1
- package/dist/client/assets/{checkbox-CeBf25NN.js → checkbox-B7TbfwYP.js} +1 -1
- package/dist/client/assets/{cli-auth-success-E6DKGZbo.js → cli-auth-success-CBSRlsxB.js} +1 -1
- package/dist/client/assets/collection-detail-B4w3rR_M.js +1 -0
- package/dist/client/assets/{collection-display-button-DnS3_1nt.js → collection-display-button-0-Hst3O8.js} +1 -1
- package/dist/client/assets/{collection-search-6KQEdQV-.js → collection-search-AKNFTM-D.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BLcba9z6.js → collection-table-wrapper-CEqEmtDG.js} +1 -1
- package/dist/client/assets/{collection-tabs-MCaOG9FY.js → collection-tabs--bEwcm53.js} +1 -1
- package/dist/client/assets/{command-CRuC_jNJ.js → command-B7XTl9tP.js} +1 -1
- package/dist/client/assets/commerce-onboarding-m8aal-Ok.js +1 -0
- package/dist/client/assets/{companions-core-BM5TG5dO.js → companions-core-kxCoM-si.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-Bf9qr6oz.js → connect-desktop-dialog-DxF0k8Db.js} +1 -1
- package/dist/client/assets/{connection-card-DEI5eOI5.js → connection-card-d5eTvTiU.js} +1 -1
- package/dist/client/assets/connection-detail-WDGkMUzt.js +1 -0
- package/dist/client/assets/{connection-form-helpers-n5fp7W7B.js → connection-form-helpers-DbDFNXLq.js} +1 -1
- package/dist/client/assets/connections-D1N1XzHS.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-B49XBmc3.js → decopilot-sse-pool-Dsaw7oxy.js} +1 -1
- package/dist/client/assets/{dialog-BU5DFH5W.js → dialog-BPAdfoaH.js} +1 -1
- package/dist/client/assets/{domain-settings-DLl-p3Oy.js → domain-settings-L_qtUFf4.js} +1 -1
- package/dist/client/assets/{drawer-BIAuey25.js → drawer-BiJB3f_K.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B4BZdUdJ.js → dropdown-menu-BgVBdzgn.js} +1 -1
- package/dist/client/assets/{empty-state-BW-NUX3e.js → empty-state-BD2XpatK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-G-Bpyqkw.js → extract-connection-data-Bb4ouwkr.js} +1 -1
- package/dist/client/assets/file-explorer-xlajTm22.js +2 -0
- package/dist/client/assets/{file-type-icon-BRTxz-sQ.js → file-type-icon-BSIaVdXl.js} +1 -1
- package/dist/client/assets/{files-_6sFjnpA.js → files-VX1EwHro.js} +1 -1
- package/dist/client/assets/{form-CJt6q_5g.js → form-CH35sWOt.js} +1 -1
- package/dist/client/assets/{general-Bhr1Q8lJ.js → general-CuQ7F01F.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CAwFwGMb.js → github-repo-picker-C8uMgVuF.js} +1 -1
- package/dist/client/assets/{hooks-DiiS8_mX.js → hooks-BYwJXzbJ.js} +1 -1
- package/dist/client/assets/{index-EdxKZ7EU.js → index--6OJQKLs.js} +1 -1
- package/dist/client/assets/{index-C4SF_sj-.js → index-BDbyCous.js} +1 -1
- package/dist/client/assets/index-BWbNoA4-.js +173 -0
- package/dist/client/assets/{index-Bma6OLIT.js → index-C02FCcQV.js} +1 -1
- package/dist/client/assets/{index-CfhAOeJp.js → index-CUBg3a-0.js} +1 -1
- package/dist/client/assets/{index-0h6CbAzf.js → index-CbmZLGvf.js} +1 -1
- package/dist/client/assets/{index-DRBP5o7G.js → index-CkseNUY3.js} +1 -1
- package/dist/client/assets/{index-BYupzQX1.js → index-DE9bsiH9.js} +3 -3
- package/dist/client/assets/{index-CZLoUT5P.js → index-DR3_Zkfu.js} +2 -2
- package/dist/client/assets/index-DtS6J0cK.js +1 -0
- package/dist/client/assets/{index-DBqvK62_.js → index-DuqgHh6W.js} +1 -1
- package/dist/client/assets/{index-Bj1sd40L.js → index-SFE6Rfyj.js} +25 -25
- package/dist/client/assets/{index-BQID7zjJ.js → index-pk1nt4x0.js} +1 -1
- package/dist/client/assets/{index-redirect-DjRNCHvn.js → index-redirect-BL5XXZtW.js} +1 -1
- package/dist/client/assets/{index-DZX7qGop.js → index-y0cucw2j.js} +2 -2
- package/dist/client/assets/{input-Bc-7wRHw.js → input-DovBF_6H.js} +1 -1
- package/dist/client/assets/{integration-icon-DzWTEjUs.js → integration-icon-NCY_y5rt.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-jSv6XLHk.js → invite-member-dialog-aUdxLnOl.js} +1 -1
- package/dist/client/assets/{label-xvuN6YsE.js → label-BWlR6vAl.js} +1 -1
- package/dist/client/assets/{layout-DF3M0vBy.js → layout-yrkPETvd.js} +1 -1
- package/dist/client/assets/{login-BTGqkwVc.js → login-BHVoN3Dl.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BEeJhwCj.js → mcp-oauth-Ok6tUSLD.js} +1 -1
- package/dist/client/assets/{members-BQEf05em.js → members-MMn0cVOt.js} +1 -1
- package/dist/client/assets/{monaco-editor-BsSWWkts.js → monaco-editor-BDgsF20v.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CH9IWyLZ.js → monitoring-stats-row-CSFFT8zk.js} +1 -1
- package/dist/client/assets/{multi-select-CDwZWqOE.js → multi-select-BReKMl3F.js} +1 -1
- package/dist/client/assets/{oauth-callback-37gHZ6lO.js → oauth-callback-M90Y0nJQ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BkIq5JY3.js → oauth-callback-ai-provider-CLeRWyoD.js} +1 -1
- package/dist/client/assets/{onboarding-tm-uqfgS.js → onboarding-BHH0YB9S.js} +1 -1
- package/dist/client/assets/{org-install-Dpbib2cD.js → org-install-Dx44ltxQ.js} +1 -1
- package/dist/client/assets/{org-layout-DXAPbbXS.js → org-layout-fi4AQOsf.js} +1 -1
- package/dist/client/assets/{organization-choice-BnkT96vQ.js → organization-choice-DGLh4y7b.js} +1 -1
- package/dist/client/assets/{orgs-I-CVQCmn.js → orgs-BI6oXNnp.js} +1 -1
- package/dist/client/assets/{page-seo-form-BIbiHKTD.js → page-seo-form-BL8Xxslp.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CmyMK4Jf.js +1 -0
- package/dist/client/assets/{popover-B_wVGt8-.js → popover-DbmxDQo8.js} +1 -1
- package/dist/client/assets/post-editor-CBMYgfKM.js +1 -0
- package/dist/client/assets/{primitives-D3_sxcZZ.js → primitives-DQp5QZlZ.js} +1 -1
- package/dist/client/assets/{profile-C1KRfvOr.js → profile-MZin5Sq8.js} +1 -1
- package/dist/client/assets/project-app-view-Cd-BIsC7.js +1 -0
- package/dist/client/assets/record-editor-CDKws8al.js +1 -0
- package/dist/client/assets/redirect-editor-iPcJvy11.js +1 -0
- package/dist/client/assets/registry-DoKzGyyE.js +2 -0
- package/dist/client/assets/{registry-layout--Isk8ky4.js → registry-layout-70W_rTpj.js} +1 -1
- package/dist/client/assets/{reports-DfNdK2o2.js → reports-BW3jotlV.js} +1 -1
- package/dist/client/assets/{require-capability-BAqkM-uu.js → require-capability-q2k4vgrL.js} +1 -1
- package/dist/client/assets/{required-auth-layout-2LZKzk9v.js → required-auth-layout-EGqwZ6se.js} +1 -1
- package/dist/client/assets/{reset-password-Bv9UTsvJ.js → reset-password-C9cKsUOP.js} +1 -1
- package/dist/client/assets/roles-D7FYoVgP.js +1 -0
- package/dist/client/assets/{search-input-DdYHUEaZ.js → search-input-DNBSW_V4.js} +1 -1
- package/dist/client/assets/{secrets-CDtOUZTQ.js → secrets-CLdgv5Bt.js} +1 -1
- package/dist/client/assets/{sections-editor-D5jA4BpW.js → sections-editor-kh_mdITm.js} +2 -2
- package/dist/client/assets/{select-D6eS9wfi.js → select-aBCLkiqI.js} +1 -1
- package/dist/client/assets/{select-model-Cg_ZkTF2.js → select-model-muHB6mNx.js} +2 -2
- package/dist/client/assets/{self-tool-result-CxF5glyU.js → self-tool-result-59x0oxLl.js} +1 -1
- package/dist/client/assets/seo-editor-DNKNpBlP.js +1 -0
- package/dist/client/assets/{settings-layout-BcfFpOXC.js → settings-layout-BeRwpMiS.js} +1 -1
- package/dist/client/assets/{settings-section-CbH-EVpR.js → settings-section-5TQzN23l.js} +1 -1
- package/dist/client/assets/{shell-controls-B7pKd0_S.js → shell-controls-obTHmMmn.js} +1 -1
- package/dist/client/assets/{shell-layout-C6pck1jN.js → shell-layout-DUOq8-Mi.js} +1 -1
- package/dist/client/assets/{sidebar-BqxKhHd4.js → sidebar-KfZUHaZ3.js} +1 -1
- package/dist/client/assets/{skeleton-FGugFtDG.js → skeleton-oM88nII8.js} +1 -1
- package/dist/client/assets/{sso-0jng4uBf.js → sso-Bkfs_4Hf.js} +1 -1
- package/dist/client/assets/{store-D-gFvpTE.js → store-CKHAhHTW.js} +1 -1
- package/dist/client/assets/store-registry-lt8F8AQy.js +2 -0
- package/dist/client/assets/{studio-tools-lcCHZe1J.js → studio-tools-CLlC8XC0.js} +1 -1
- package/dist/client/assets/{switch-DWcd-95y.js → switch-wc-JMrJW.js} +1 -1
- package/dist/client/assets/{table-Dm_-hO-V.js → table-DnmayFDg.js} +1 -1
- package/dist/client/assets/{tabs-D4A5jRT4.js → tabs-p5oGER-3.js} +1 -1
- package/dist/client/assets/{textarea-fiC9rZ0h.js → textarea-CKVUE152.js} +1 -1
- package/dist/client/assets/{toggle-group-CbmsoRH8.js → toggle-group-Bq_kOy1h.js} +1 -1
- package/dist/client/assets/{toolbar-rhMa_4Hk.js → toolbar-BSiYnqoL.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DlMzf0l2.js → toolbar-icon-button-Lw9n0_WR.js} +1 -1
- package/dist/client/assets/{tooltip-B3_TInpd.js → tooltip-gbjR2jqB.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dl25_ErA.js → use-ai-providers-_qS2qx6u.js} +1 -1
- package/dist/client/assets/{use-automations-BWfz7gg-.js → use-automations-Cg19EnMj.js} +1 -1
- package/dist/client/assets/{use-autosave-D3QcZOpu.js → use-autosave-C0k8vm8D.js} +1 -1
- package/dist/client/assets/{use-capability-CVJR07VY.js → use-capability-B-IX_soF.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B_Z5346Q.js → use-clock-tick-BkGGOkbb.js} +1 -1
- package/dist/client/assets/{use-collections-BgBopunk.js → use-collections-DKaN9Van.js} +1 -1
- package/dist/client/assets/{use-connection-ecP-LOlu.js → use-connection-3hoAyxR0.js} +1 -1
- package/dist/client/assets/{use-copy-jCInK_V1.js → use-copy-Bj5N25Og.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DRKKu78t.js → use-create-virtual-mcp-BPw8BNDm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CH0JFgRx.js → use-debounced-autosave-BR6AvYxX.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Uuon3S9W.js → use-debounced-value-DFX3-h9r.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DvcverbC.js → use-deco-credits-DYBJ8MJK.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BEZ72Jkb.js → use-decopilot-events-DoOrs7Jp.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BhvCEJxJ.js → use-delete-connection-BtsfohMK.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CAq5dAWn.js → use-deployment-admin-w2nqdf2W.js} +1 -1
- package/dist/client/assets/{use-file-configs-eN7OWZ8v.js → use-file-configs-BU6poq2e.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BglRZ1QB.js → use-infinite-scroll-D7ow0UWK.js} +1 -1
- package/dist/client/assets/{use-join-requests-CWHqzMas.js → use-join-requests-C_WcbOxJ.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CldVeTAa.js → use-mcp-auth-status-Cc5P5YPy.js} +1 -1
- package/dist/client/assets/{use-mcp-client-1txAl4Nn.js → use-mcp-client-BtzK1kSd.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Df6cIGEM.js → use-mcp-tools-CfMvkYlJ.js} +1 -1
- package/dist/client/assets/{use-members-BK20_T6U.js → use-members-CbyW23vN.js} +1 -1
- package/dist/client/assets/{use-mobile-BlbBUtbB.js → use-mobile-CQnz-qO9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D-NxwfzS.js → use-navigate-to-agent-CB5dVqMu.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BOJU8IRV.js → use-org-auth-client-C9_EVR6o.js} +1 -1
- package/dist/client/assets/{use-org-sso-QrDBjlyp.js → use-org-sso-Cq6_NWho.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DBo7q2aS.js → use-organization-roles-gQwIKDF6.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CVVov6IL.js → use-organization-settings-De7_zsu2.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BcaQ0klr.js → use-registry-connections-EA7l6B_t.js} +1 -1
- package/dist/client/assets/{use-secrets-_jh0wX2R.js → use-secrets-2R9rPimZ.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Da71KV1f.js → use-status-sounds-D5DSSwdi.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bq3eiyd9.js → use-view-mode-Dfn6ZzsY.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BD6WMdRh.js → use-virtual-mcp-BtoQe4jO.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BYBonOR0.js +1 -0
- package/dist/client/assets/{useRouterState-kMjAtZA2.js → useRouterState-oXjMqXoY.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-FBzK59jx.js +1 -0
- package/dist/client/assets/{users-enMu8cIr.js → users-BNdsP3mj.js} +1 -1
- package/dist/client/assets/variant-calendar-BkGz0Z87.js +1 -0
- package/dist/client/assets/{view-mode-toggle-BnPQS-qD.js → view-mode-toggle-C22jBG_O.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/Tool01-BpjlKODL.js +0 -1
- package/dist/client/assets/ZoomOut-DmQxsrD_.js +0 -1
- package/dist/client/assets/agent-icon-BG0nMkZr.js +0 -1
- package/dist/client/assets/agents-list-DAkge_FU.js +0 -1
- package/dist/client/assets/ai-providers-CZxLeh4U.js +0 -1
- package/dist/client/assets/app-editor-B92-8O14.js +0 -1
- package/dist/client/assets/automations-CdFH77ob.js +0 -1
- package/dist/client/assets/bulk-category-panel-Bo6PNXxW.js +0 -1
- package/dist/client/assets/category-editor-BCksG4vZ.js +0 -1
- package/dist/client/assets/collection-detail-DrAOoYa4.js +0 -1
- package/dist/client/assets/commerce-onboarding-DPZX3TeB.js +0 -1
- package/dist/client/assets/connection-detail-QqxgAxuk.js +0 -1
- package/dist/client/assets/connections-Wz-GGYoK.js +0 -1
- package/dist/client/assets/file-explorer-DJp95aPy.js +0 -2
- package/dist/client/assets/index-BTcUFe8i.js +0 -173
- package/dist/client/assets/index-BwtuxIqC.js +0 -1
- package/dist/client/assets/page-seo-sheet-DxQvuYUZ.js +0 -1
- package/dist/client/assets/post-editor-DeQyUTZw.js +0 -1
- package/dist/client/assets/project-app-view-CCUtUft0.js +0 -1
- package/dist/client/assets/record-editor-CQHtKTtS.js +0 -1
- package/dist/client/assets/redirect-editor-CRYW1YQA.js +0 -1
- package/dist/client/assets/registry-jvrbrcVc.js +0 -2
- package/dist/client/assets/roles-C5D5x740.js +0 -1
- package/dist/client/assets/seo-editor-CPFYQVg5.js +0 -1
- package/dist/client/assets/store-registry-DkMl0DLm.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BZq6rADh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BeVtNfUB.js +0 -1
- package/dist/client/assets/variant-calendar-injdT8F_.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ie,j as s,B as J,C as ce,n as fe,a as he,r as K,m as ge,K as ee,d as xe,p as $,t as te,l as je}from"./index-BYupzQX1.js";import{d as Y,c as de,a as se,D as oe}from"./dropdown-menu-B4BZdUdJ.js";import{a as be}from"./Users03-B522am55.js";import{a as me,b as Ce,G as ye}from"./github-repo-picker-CAwFwGMb.js";import{u as we,b as _e,c as Ne}from"./use-virtual-mcp-BD6WMdRh.js";import{P as X}from"./index-0h6CbAzf.js";import{i as Se}from"./DotsVertical-Dk5Xdxve.js";import{a as ve,b as Ie}from"./Settings02-CXx65ABV.js";import{s as De}from"./Trash01-BhHYhKqt.js";import{A as Ae,ax as Ee}from"./agent-icon-BG0nMkZr.js";import{c as ue}from"./use-navigate-to-agent-D-NxwfzS.js";import{C as Te}from"./card-aa3oAwSK.js";import{f as ne}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-CVJR07VY.js";import{E as Le}from"./empty-state-BW-NUX3e.js";import{u as Ge}from"./use-create-virtual-mcp-DRKKu78t.js";import{u as Oe}from"./use-connection-ecP-LOlu.js";import{u as re}from"./use-mcp-client-1txAl4Nn.js";import{S as Pe}from"./constants-D_FQAPnt.js";import{g as ze,f as Me,a as $e,p as He}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";import{e as Fe,d as Re,D as Ue,a as Be,c as Ve}from"./dialog-BU5DFH5W.js";import{C as Ke}from"./collection-search-6KQEdQV-.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-DJa8hr5P.js";import{S as tt}from"./search-input-DdYHUEaZ.js";import{s as le}from"./Plus-o1s3J9RF.js";import"./Check-DW_CJo9x.js";import"./ChevronRight-jGxYypbD.js";import"./Circle-XeFXmZfO.js";import"./use-debounced-value-Uuon3S9W.js";import"./authenticate-and-persist-oauth-D-6WsL4Q.js";import"./mcp-oauth-BEeJhwCj.js";import"./auth-0M1DqVYt.js";import"./use-mcp-tools-Df6cIGEM.js";import"./extract-connection-data-G-Bpyqkw.js";import"./use-collections-BgBopunk.js";import"./sidebar-BqxKhHd4.js";import"./LayoutLeft-BkVB2IbZ.js";import"./use-mobile-BlbBUtbB.js";import"./X-BWPJzkP7.js";import"./tooltip-B3_TInpd.js";import"./AlertCircle-sDfzMQz-.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Tool02-B6UqyM_J.js";import"./XCircle-D0AQsXiF.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./CheckCircle-CvckcHSW.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronUp-D1wkSkA0.js";import"./Stars02-CyV0ls88.js";import"./Copy01-AsmF-oFM.js";import"./ZoomOut-DmQxsrD_.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./Key01-BOZ45ZZP.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./SearchLg-M-hd_gai.js";import"./SearchMd-CxWfDzx_.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./Zap-DJjVd0ns.js";import"./hooks-DiiS8_mX.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=ie.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:l,isCreating:b,align:C,side:d,showBetaBadge:g}=t,y=C===void 0?"end":C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==b||e[2]!==i?(m=s.jsxs(Y,{disabled:b,onClick:i,children:[x,"Create from scratch"]}),e[1]=b,e[2]=i,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{className:"size-3.5"}),e[4]=f):f=e[4];let a;e[5]!==g?(a=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=a):a=e[6];let h;e[7]!==n||e[8]!==a?(h=s.jsxs(Y,{onClick:n,children:[f,"Import from GitHub",a]}),e[7]=n,e[8]=a,e[9]=h):h=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=c):c=e[10];let r;e[11]!==l?(r=s.jsxs(Y,{onClick:l,children:[c,"Import from deco.cx"]}),e[11]=l,e[12]=r):r=e[12];let u;return e[13]!==y||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==r?(u=s.jsxs(de,{side:d,align:y,className:"w-48",children:[m,h,r]}),e[13]=y,e[14]=d,e[15]=m,e[16]=h,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:i,lastUsedAt:n,onDeleteClick:l}=t,b=ue();let C;e[0]!==b||e[1]!==i.id?(C=()=>b(i.id),e[0]=b,e[1]=i.id,e[2]=C):C=e[2];let d;e[3]!==i.title||e[4]!==C?(d=s.jsx("button",{type:"button",onClick:C,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=C,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ae,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(Se,{size:20})})}),e[9]=y):y=e[9];let x;e[10]!==b||e[11]!==i.id?(x=()=>b(i.id,{search:{main:"settings"}}),e[10]=b,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ve,{size:16}),e[13]=m):m=e[13];let f;e[14]!==x?(f=s.jsxs(Y,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=f):f=e[15];let a;e[16]!==l?(a=l&&s.jsxs(Y,{variant:"destructive",onClick:L=>{L.stopPropagation(),l(L)},children:[s.jsx(De,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let h;e[18]!==f||e[19]!==a?(h=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(oe,{children:[y,s.jsxs(de,{align:"end",children:[f,a]})]})}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==g||e[22]!==h?(c=s.jsxs("div",{className:"flex items-start justify-between",children:[g,h]}),e[21]=g,e[22]=h,e[23]=c):c=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let w;e[31]!==c||e[32]!==D?(w=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,D]}),e[31]=c,e[32]=D,e[33]=w):w=e[33];let E;e[34]!==n||e[35]!==i.updated_at?(E=n?`Last used ${ne(new Date(n),{addSuffix:!0})}`:`Updated ${ne(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=E):E=e[36];let N;e[37]!==E?(N=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:E})})}),e[37]=E,e[38]=N):N=e[38];let T;e[39]!==w||e[40]!==N?(T=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[w,N]}),e[39]=w,e[40]=N,e[41]=T):T=e[41];let S;return e[42]!==T||e[43]!==d?(S=s.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,T]}),e[42]=T,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,l=i?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function pe(t,e,i){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${i} (${n.status})`);return l}function lt(t){return pe(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=ce(),l=ue(),b=fe(),{data:C}=he.useSession(),[d,g]=K.useState(null),[y,x]=K.useState(null),[m,f]=K.useState(""),a=re({connectionId:Pe,orgId:n.id,orgSlug:n.slug}),h=Oe({slug:"mcp-github"}),c=ze(h),r=Ce({enabled:t&&c.length===0}),u=c.length===1?c[0]??null:y,I=c.length>1&&!u,D=re({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:E,isLoading:N,error:T}=ge({queryKey:ee.decoSites(C?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=E?.sites??[],L=o=>{o||(g(null),x(null),f("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),G=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:k,appSlug:v}=await Me(_=>a.callTool(_),u.id),A=S.find(_=>_.name===o);if(!A)throw new Error("Selected site is no longer available");const j=nt(o,A.metadata),z=$e(k,j.owner);if(!z){const _=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${_}`)}let V=null,U=null,B=null;const W=async()=>{B&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:B}}).catch(()=>{}),U&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:U,force:!0}}).catch(()=>{}),V&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const _=await pe(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})},"Failed to create connection"),O=_.connId;if(!O)throw new Error("Server did not return a connection ID");V=O;const{childConnectionId:M}=await He({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:Z=>D.callTool(Z),selfCallTool:Z=>a.callTool(Z)});U=M;const H=_.icon??null,F=rt(o),q=o.toLowerCase(),p=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:q,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:F,pinnedViews:[{connectionId:O,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:O,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:O},{connection_id:M}]}}}),Q=p.structuredContent??p;if(!Q.item?.id)throw new Error("Failed to create the imported agent");return B=Q.item.id,{slug:F,virtualMcpId:Q.item.id,connId:O,item:Q.item}}catch(_){throw await W(),_}},onSuccess:({slug:o,virtualMcpId:k,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:k,slug:o}),b.setQueryData(ee.collectionItem(a,n.id,"","VIRTUAL_MCP",k),{item:v}),b.invalidateQueries({predicate:A=>{const j=A.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),b.invalidateQueries({queryKey:ee.projects(n.id)}),te.success(`Imported ${o} from deco.cx`),L(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(k)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),te.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Fe,{open:t,onOpenChange:L,children:s.jsxs(Re,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Ie,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:f,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&f("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(J,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!w&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),c.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(me,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!w&&!I&&r.status!=="error"&&!T&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!w&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const k=o.domains?.find(A=>A.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),k&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:k})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(J,{variant:"outline",onClick:()=>L(!1),disabled:G.isPending,children:"Cancel"}),s.jsx(J,{disabled:!d||!R||G.isPending||N||w||I||!u||r.status==="error",onClick:()=>d&&G.mutate(d),children:G.isPending?"Importing...":"Import"})]})]})})}function Rs(){const t=ie.c(46),{org:e}=ce(),i=we(),n=_e(),[l,b]=K.useState("");let C;t[0]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},t[0]=C):C=t[0];const{createVirtualMCP:d,isCreating:g}=Ge(C),[y,x]=K.useState(null),[m,f]=K.useState(!1),[a,h]=K.useState(!1),{granted:c}=ke("agents:manage"),r=l.toLowerCase(),u=i.filter(p=>p.id!==e.id&&(p.title.toLowerCase().includes(r)||p.description?.toLowerCase().includes(r))),{data:I}=Ne(u.map(ct));let D;t[1]!==n||t[2]!==y?(D=async()=>{if(!y)return;const{id:p,title:Q}=y;x(null);try{await n.delete.mutateAsync(p),$("agent_deleted",{agent_id:p,source:"agents_list"}),te.success(`Deleted "${Q}"`)}catch{}},t[1]=n,t[2]=y,t[3]=D):D=t[3];const w=D,E=X,N=X,T=X;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(X.Title,{children:"Agents"}),t[4]=S):S=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=p=>{p.key==="Escape"&&(b(""),p.target.blur())},t[5]=L):L=t[5];let P;t[6]!==l?(P=s.jsx(tt,{value:l,onChange:b,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=P):P=t[7];let R;t[8]!==c||t[9]!==d||t[10]!==g?(R=c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),f(!0)},isCreating:g,align:"end"})]}),t[8]=c,t[9]=d,t[10]=g,t[11]=R):R=t[11];let G;t[12]!==P||t[13]!==R?(G=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=G):G=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Le,{image:s.jsx(Ee,{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(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),f(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),k=u.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:u.map(p=>s.jsx(st,{project:p,lastUsedAt:I?.get(p.id)?.last_used_at,onDeleteClick:c?()=>x({id:p.id,title:p.title}):void 0},p.id))})]});let v;t[15]!==k||t[16]!==T.Body||t[17]!==G||t[18]!==o?(v=s.jsxs(T.Body,{children:[G,o,k]}),t[15]=k,t[16]=T.Body,t[17]=G,t[18]=o,t[19]=v):v=t[19];let A;t[20]!==v||t[21]!==N.Content?(A=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=A):A=t[22];let j;t[23]!==a?(j=s.jsx(ye,{open:a,onOpenChange:h}),t[23]=a,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:f}),t[25]=m,t[26]=z):z=t[26];const V=!!y;let U;t[27]===Symbol.for("react.memo_cache_sentinel")?(U=p=>!p&&x(null),t[27]=U):U=t[27];let B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(qe,{children:"Delete Agent?"}),t[28]=B):B=t[28];const W=y?.title;let _;t[29]!==W?(_=s.jsxs(Qe,{children:[B,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),t[29]=W,t[30]=_):_=t[30];let O;t[31]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(We,{children:"Cancel"}),t[31]=O):O=t[31];let M;t[32]!==w?(M=s.jsxs(Ye,{children:[O,s.jsx(Xe,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=w,t[33]=M):M=t[33];let H;t[34]!==_||t[35]!==M?(H=s.jsxs(Ze,{children:[_,M]}),t[34]=_,t[35]=M,t[36]=H):H=t[36];let F;t[37]!==V||t[38]!==H?(F=s.jsx(et,{open:V,onOpenChange:U,children:H}),t[37]=V,t[38]=H,t[39]=F):F=t[39];let q;return t[40]!==E||t[41]!==A||t[42]!==j||t[43]!==z||t[44]!==F?(q=s.jsxs(E,{children:[A,j,z,F]}),t[40]=E,t[41]=A,t[42]=j,t[43]=z,t[44]=F,t[45]=q):q=t[45],q}function ct(t){return t.id}export{Rs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as B,I as N,ad as ae,af as le,ag as he,ae as xe,b3 as me,c as U,J as ge,M as be,r as M,j as s,ah as Ee,t as G,aL as ye,C as re,n as oe,d as J,K as Q,m as ve,l as ue,B as V,p as je,E as $e}from"./index-BYupzQX1.js";import{i as Re}from"./AlertCircle-sDfzMQz-.js";import{P as te}from"./index-0h6CbAzf.js";import{S as ne}from"./skeleton-FGugFtDG.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-CbH-EVpR.js";import{u as X,a as se,b as Se}from"./use-ai-providers-Dl25_ErA.js";import{i as Me}from"./CheckCircle-CvckcHSW.js";import{n as Oe,o as Te,q as Ue,S as ze}from"./chat-context-BwMjJizF.js";import{g as qe,h as Le}from"./use-organization-settings-CVVov6IL.js";import{M as Ve,O as ke,P as Be,C as pe}from"./select-model-Cg_ZkTF2.js";import{u as Qe}from"./use-debounced-autosave-CH0JFgRx.js";import{I as ie}from"./input-Bc-7wRHw.js";import{T as fe,a as Ge}from"./toggle-group-CbmsoRH8.js";import{b as Ie,c as Ce,d as Ne,A as Pe,a as we,e as De,g as Ae,f as Ke}from"./alert-dialog-DJa8hr5P.js";import{u as H}from"./studio-tools-lcCHZe1J.js";import{s as Ye}from"./Plus-o1s3J9RF.js";import{c as We}from"./Tool01-BpjlKODL.js";import{s as He}from"./Trash01-BhHYhKqt.js";import{A as Je}from"./avatar-BpWo990_.js";import{i as Xe}from"./Settings02-CXx65ABV.js";import{s as Ze}from"./Eye-DF50O1Ue.js";import{c as et,D as tt,a as st,d as it,e as rt}from"./dialog-BU5DFH5W.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-BAqkM-uu.js";import"./sidebar-BqxKhHd4.js";import"./LayoutLeft-BkVB2IbZ.js";import"./use-mobile-BlbBUtbB.js";import"./X-BWPJzkP7.js";import"./tooltip-B3_TInpd.js";import"./card-aa3oAwSK.js";import"./ArrowUpRight-BCg_ek3r.js";import"./autosend-8dyE67rr.js";import"./hooks-DiiS8_mX.js";import"./use-mcp-client-1txAl4Nn.js";import"./constants-D_FQAPnt.js";import"./auth-0M1DqVYt.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BD6WMdRh.js";import"./use-collections-BgBopunk.js";import"./use-decopilot-events-BEZ72Jkb.js";import"./tab-id-BijBBRwE.js";import"./drawer-BIAuey25.js";import"./checkbox-CeBf25NN.js";import"./Check-DW_CJo9x.js";import"./select-D6eS9wfi.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronUp-D1wkSkA0.js";import"./Key01-BOZ45ZZP.js";import"./SearchMd-CxWfDzx_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-sX1pwHXM.js";import"./ChevronRight-jGxYypbD.js";import"./connect-desktop-dialog-Bf9qr6oz.js";import"./Copy01-AsmF-oFM.js";import"./Stars01-Cmtkyg7-.js";import"./User01-DyqXRcED.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-CVJR07VY.js";import"./access-gate--y6i1h5d.js";import"./capability-load-error-rAKAVL0-.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Oe(e),dt=e=>Te(e),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:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=M.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],M.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const k=p;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const R=y.keyId??m??"";S(R),a({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=f):f=t[19],f}function pt(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Me,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function ft(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),G.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Qe(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:p}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),M.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==p?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=p);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,$);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,R=g?.id;let O;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==R?(O=[o,t,j,_,p,f,y,R],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=R,e[28]=O):O=e[28],M.useEffect(h,O);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const F=b&&!d;let D;e[30]!==S||e[31]!==F?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:F})]}),e[30]=S,e[31]=F,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=M.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},onSuccess:yt,onError:bt}),[o,x]=M.useState(""),[S,b]=M.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=p):p=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&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:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==p||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){G.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-warning":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=M.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=Q.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const R=y;let O;e[21]===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[21]=O):O=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let F;e[23]!==c?(F=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:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=F):F=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ie,{children:[s.jsx(Ce,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ne,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Pe,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(we,{children:[D,s.jsxs(De,{children:[A,s.jsx(Ae,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ke,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==f||e[33]!==R||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",f!=null&&vt(f)),children:R}),e[32]=f,e[33]=R,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,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:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=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(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,E,Y,Z]})})}),e[54]=F,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){G.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),G.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["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]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=M.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:Q.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:Q.aiProviders(S.id)}),G.success("Provider updated"),x()},onError:f=>G.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(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(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.label.message})]}),c&&!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(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&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(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?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:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=Q.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=M.useState(!1),[b,d]=M.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:Q.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:Q.aiProviders(r.id)}),o.invalidateQueries({queryKey:Q.aiProviderModels(r.id,i.id)}),G.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Je,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(We,{size:14})}),t[18]=R):R=t[18];let O,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(O=()=>S(!0),T=s.jsx(He,{size:14}),t[19]=O,t[20]=T):(O=t[19],T=t[20]);let F;t[21]!==f?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:O,children:T})]}),t[21]=f,t[22]=F):F=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==F||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:F}),t[23]=_,t[24]=u,t[25]=F,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ce,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(Ie,{children:[K,s.jsxs(Ne,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Pe,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(De,{children:[v,s.jsx(Ae,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(we,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ke,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return G.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Rt).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.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(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function Ft(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Re,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Mt(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=M.useState(!1),[x,S]=M.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let p;e[5]!==n?(p=s.jsx(Be,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Ot(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Fe,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(M.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Mt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Ft,{error:t??new Error("Failed to load AI providers")})}function Ws(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Ws as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-BYupzQX1.js";import{i as jt}from"./ChevronRight-jGxYypbD.js";import{A as kt}from"./automation-runs-NZWy5naJ.js";import{A as _t}from"./add-section-modal-DaLIpWVo.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-Bj1sd40L.js";import"./select-D6eS9wfi.js";import"./tooltip-B3_TInpd.js";import"./Check-DW_CJo9x.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronUp-D1wkSkA0.js";import"./useInfiniteQuery-BZq6rADh.js";import"./use-infinite-scroll-BglRZ1QB.js";import"./use-connection-ecP-LOlu.js";import"./use-collections-BgBopunk.js";import"./use-mcp-client-1txAl4Nn.js";import"./constants-D_FQAPnt.js";import"./auth-0M1DqVYt.js";import"./use-virtual-mcp-BD6WMdRh.js";import"./card-aa3oAwSK.js";import"./sidebar-BqxKhHd4.js";import"./LayoutLeft-BkVB2IbZ.js";import"./use-mobile-BlbBUtbB.js";import"./X-BWPJzkP7.js";import"./table-Dm_-hO-V.js";import"./empty-state-BW-NUX3e.js";import"./use-members-BK20_T6U.js";import"./use-org-auth-client-BOJU8IRV.js";import"./use-clock-tick-B_Z5346Q.js";import"./AlertCircle-sDfzMQz-.js";import"./CheckCircle-CvckcHSW.js";import"./Circle-XeFXmZfO.js";import"./agent-icon-BG0nMkZr.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Settings02-CXx65ABV.js";import"./Tool02-B6UqyM_J.js";import"./XCircle-D0AQsXiF.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./Users03-B522am55.js";import"./Stars02-CyV0ls88.js";import"./Copy01-AsmF-oFM.js";import"./ZoomOut-DmQxsrD_.js";import"./DotsVertical-Dk5Xdxve.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./Key01-BOZ45ZZP.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./Plus-o1s3J9RF.js";import"./SearchLg-M-hd_gai.js";import"./SearchMd-CxWfDzx_.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Trash01-BhHYhKqt.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./Zap-DJjVd0ns.js";import"./use-automations-BWfz7gg-.js";import"./studio-tools-lcCHZe1J.js";import"./useSuspenseInfiniteQuery-BeVtNfUB.js";import"./avatar-BpWo990_.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-jCInK_V1.js";import"./file-type-icon-BRTxz-sQ.js";import"./dialog-BU5DFH5W.js";import"./tab-id-BijBBRwE.js";import"./hooks-DiiS8_mX.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-BwMjJizF.js";import"./autosend-8dyE67rr.js";import"./use-ai-providers-Dl25_ErA.js";import"./use-decopilot-events-BEZ72Jkb.js";import"./use-organization-settings-CVVov6IL.js";import"./monaco-editor-BsSWWkts.js";import"./index-CfhAOeJp.js";import"./index-DBqvK62_.js";import"./shell-layout-C6pck1jN.js";import"./alert-dialog-DJa8hr5P.js";import"./required-auth-layout-2LZKzk9v.js";import"./use-org-sso-QrDBjlyp.js";import"./integration-icon-DzWTEjUs.js";import"./use-navigate-to-agent-D-NxwfzS.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BbF7HkuD.js";import"./form-CJt6q_5g.js";import"./label-xvuN6YsE.js";import"./input-Bc-7wRHw.js";import"./drawer-BIAuey25.js";import"./collection-search-6KQEdQV-.js";import"./tabs-D4A5jRT4.js";import"./toggle-group-CbmsoRH8.js";import"./use-deco-credits-DvcverbC.js";import"./extract-connection-data-G-Bpyqkw.js";import"./connection-card-DEI5eOI5.js";import"./use-registry-connections-BcaQ0klr.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-fiC9rZ0h.js";import"./connection-form-helpers-n5fp7W7B.js";import"./authenticate-and-persist-oauth-D-6WsL4Q.js";import"./mcp-oauth-BEeJhwCj.js";import"./collection-tabs-MCaOG9FY.js";import"./badge-J8Dmk1J0.js";import"./connect-desktop-dialog-Bf9qr6oz.js";import"./select-model-Cg_ZkTF2.js";import"./checkbox-CeBf25NN.js";import"./skeleton-FGugFtDG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CbH-EVpR.js";import"./command-CRuC_jNJ.js";import"./index-Bma6OLIT.js";import"./popover-B_wVGt8-.js";import"./dropdown-menu-B4BZdUdJ.js";import"./index-BTcUFe8i.js";import"./toolbar-rhMa_4Hk.js";import"./use-debounced-value-Uuon3S9W.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Da71KV1f.js";import"./use-mcp-tools-Df6cIGEM.js";import"./use-capability-CVJR07VY.js";import"./use-debounced-autosave-CH0JFgRx.js";import"./index-0h6CbAzf.js";import"./search-input-DdYHUEaZ.js";import"./use-mcp-auth-status-CldVeTAa.js";import"./switch-DWcd-95y.js";import"./github-repo-picker-CAwFwGMb.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-_jh0wX2R.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-BM5TG5dO.js";import"./index-DZX7qGop.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CiyIJkJP.js";import"./toolbar-icon-button-DlMzf0l2.js";import"./use-file-configs-eN7OWZ8v.js";import"./automation-list-row-B0m5PJDd.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Er(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 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:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{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[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Er as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,C as L,b as T,r as $,B as M,p as N}from"./index-BYupzQX1.js";import{s as q}from"./Plus-o1s3J9RF.js";import{i as S}from"./Zap-DJjVd0ns.js";import{S as D}from"./search-input-DdYHUEaZ.js";import{P as l}from"./index-0h6CbAzf.js";import{E as b}from"./empty-state-BW-NUX3e.js";import{c as O}from"./use-automations-BWfz7gg-.js";import{c as V}from"./use-navigate-to-agent-D-NxwfzS.js";import{A as F}from"./automation-list-row-B0m5PJDd.js";import{f as G}from"./constants-D_FQAPnt.js";import{u as H}from"./use-virtual-mcp-BD6WMdRh.js";import{R as J}from"./require-capability-BAqkM-uu.js";import"./SearchMd-CxWfDzx_.js";import"./sidebar-BqxKhHd4.js";import"./LayoutLeft-BkVB2IbZ.js";import"./use-mobile-BlbBUtbB.js";import"./X-BWPJzkP7.js";import"./tooltip-B3_TInpd.js";import"./use-mcp-client-1txAl4Nn.js";import"./auth-0M1DqVYt.js";import"./studio-tools-lcCHZe1J.js";import"./hooks-DiiS8_mX.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-DJa8hr5P.js";import"./dropdown-menu-B4BZdUdJ.js";import"./Check-DW_CJo9x.js";import"./ChevronRight-jGxYypbD.js";import"./Circle-XeFXmZfO.js";import"./Stars02-CyV0ls88.js";import"./DotsVertical-Dk5Xdxve.js";import"./Trash01-BhHYhKqt.js";import"./agent-icon-BG0nMkZr.js";import"./AlertCircle-sDfzMQz-.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Settings02-CXx65ABV.js";import"./Tool02-B6UqyM_J.js";import"./XCircle-D0AQsXiF.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./Users03-B522am55.js";import"./CheckCircle-CvckcHSW.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronUp-D1wkSkA0.js";import"./Copy01-AsmF-oFM.js";import"./ZoomOut-DmQxsrD_.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./Key01-BOZ45ZZP.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./SearchLg-M-hd_gai.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./use-collections-BgBopunk.js";import"./use-capability-CVJR07VY.js";import"./access-gate--y6i1h5d.js";import"./capability-load-error-rAKAVL0-.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(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 m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function _o(){const t=B.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{_o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,l as Y,j as t,r as W,B as J,i as le}from"./index-BYupzQX1.js";import{a0 as Z}from"./agent-icon-BG0nMkZr.js";import{i as ie}from"./X-BWPJzkP7.js";import{L as O}from"./label-xvuN6YsE.js";import{I as oe,R as re,a as ae}from"./index-C4SF_sj-.js";import{i as ce}from"./Circle-XeFXmZfO.js";import{S as ne,a as me,b as de,c as pe,d as xe}from"./select-D6eS9wfi.js";import{T as fe,a as ue,b as he}from"./tooltip-B3_TInpd.js";import"./AlertCircle-sDfzMQz-.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Settings02-CXx65ABV.js";import"./Tool02-B6UqyM_J.js";import"./XCircle-D0AQsXiF.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./Users03-B522am55.js";import"./CheckCircle-CvckcHSW.js";import"./Check-DW_CJo9x.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronRight-jGxYypbD.js";import"./ChevronUp-D1wkSkA0.js";import"./Stars02-CyV0ls88.js";import"./Copy01-AsmF-oFM.js";import"./ZoomOut-DmQxsrD_.js";import"./DotsVertical-Dk5Xdxve.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./Key01-BOZ45ZZP.js";import"./LayoutLeft-BkVB2IbZ.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./Plus-o1s3J9RF.js";import"./SearchLg-M-hd_gai.js";import"./SearchMd-CxWfDzx_.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Trash01-BhHYhKqt.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./Zap-DJjVd0ns.js";function ge(i){const e=Q.c(8);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=Y("grid gap-3",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=t.jsx(re,{"data-slot":"radio-group",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function X(i){const e=Q.c(9);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=Y("border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",o),e[3]=o,e[4]=r):r=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==r?(c=t.jsx(oe,{"data-slot":"radio-group-item",className:r,...s,children:l}),e[6]=s,e[7]=r,e[8]=c):c=e[8],c}function vt(i){const e=Q.c(69),{posts:o,categories:s,initialSlug:r,isPending:l,onApply:c,onClose:d}=i,[n,ee]=W.useState(r&&s.some(m=>m.slug===r)?r:s[0]?.slug??""),[p,te]=W.useState("add");let T;if(e[0]!==s||e[1]!==n){let m;e[3]!==n?(m=se=>se.slug===n,e[3]=n,e[4]=m):m=e[4],T=s.find(m),e[0]=s,e[1]=n,e[2]=T}else T=e[2];const x=T,a=o.length,K=a===1?"post":"posts";let f;e[5]!==a||e[6]!==K?(f=t.jsxs("span",{className:"truncate text-sm font-medium",children:[a," ",K," selected"]}),e[5]=a,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ie,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==d?(u=t.jsx(fe,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:d,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=t.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=a===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${a} ${a===1?"post":"posts"}.`;let j;e[19]!==M?(j=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==s||e[23]!==n?(b=t.jsxs("div",{className:"space-y-2",children:[B,s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):t.jsxs(ne,{value:n,onValueChange:ee,children:[t.jsx(me,{className:"w-full",children:t.jsx(de,{placeholder:"Select a category"})}),t.jsx(pe,{children:s.map(be)})]})]}),e[22]=s,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=m=>te(m),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==p?(y=t.jsxs(ge,{value:p,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=p,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==d?(N=t.jsx(J,{type:"button",variant:"outline",onClick:d,disabled:l,children:"Cancel"}),e[32]=l,e[33]=d,e[34]=N):N=e[34];const D=!x||l||a===0;let v;e[35]!==p||e[36]!==c||e[37]!==x?(v=()=>x&&c(p,{name:x.name,slug:x.slug}),e[35]=p,e[36]=c,e[37]=x,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?t.jsxs(t.Fragment,{children:[t.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=t.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=t.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=t.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=a===1?"post":"posts";let w;e[53]!==a||e[54]!==H?(w=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,t.jsxs("span",{className:"text-sm",children:[a," selected ",H]})]}),e[53]=a,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==a||e[57]!==o?(R=a===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):t.jsx("ul",{className:"divide-y border-t bg-background",children:o.map(je)}),e[56]=a,e[57]=o,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function be(i){return t.jsx(xe,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{vt as BulkCategoryPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,r as S,l as G,j as t,B as I,i as Q,t as U}from"./index-BYupzQX1.js";import{i as X}from"./XCircle-D0AQsXiF.js";import{aC as Y,a0 as T}from"./agent-icon-BG0nMkZr.js";import{n as Z}from"./LinkExternal01-DdU7WoMF.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DJa8hr5P.js";import{I as M}from"./input-Bc-7wRHw.js";import{L}from"./label-xvuN6YsE.js";import{v as at,w as mt,V as nt,o as lt,x as R,A as pt,W as ct,y as dt}from"./index-Bj1sd40L.js";import{c as ut,B as gt,a as xt}from"./block-document-Fj80zG4o.js";import{u as ft}from"./use-autosave-D3QcZOpu.js";import{t as ht}from"./ChevronDown-CyPL9p3K.js";import{J as yt,K as jt,I as vt}from"./automation-runs-NZWy5naJ.js";import{s as v,E as bt}from"./primitives-D3_sxcZZ.js";import"./AlertCircle-sDfzMQz-.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Settings02-CXx65ABV.js";import"./Tool02-B6UqyM_J.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./Users03-B522am55.js";import"./CheckCircle-CvckcHSW.js";import"./Check-DW_CJo9x.js";import"./ChevronRight-jGxYypbD.js";import"./ChevronUp-D1wkSkA0.js";import"./Circle-XeFXmZfO.js";import"./Stars02-CyV0ls88.js";import"./Copy01-AsmF-oFM.js";import"./ZoomOut-DmQxsrD_.js";import"./DotsVertical-Dk5Xdxve.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./Key01-BOZ45ZZP.js";import"./LayoutLeft-BkVB2IbZ.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./Plus-o1s3J9RF.js";import"./SearchLg-M-hd_gai.js";import"./SearchMd-CxWfDzx_.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Trash01-BhHYhKqt.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./X-BWPJzkP7.js";import"./Zap-DJjVd0ns.js";import"./chat-context-BwMjJizF.js";import"./autosend-8dyE67rr.js";import"./hooks-DiiS8_mX.js";import"./use-mcp-client-1txAl4Nn.js";import"./constants-D_FQAPnt.js";import"./auth-0M1DqVYt.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-lcCHZe1J.js";import"./use-virtual-mcp-BD6WMdRh.js";import"./use-collections-BgBopunk.js";import"./use-ai-providers-Dl25_ErA.js";import"./use-decopilot-events-BEZ72Jkb.js";import"./tab-id-BijBBRwE.js";import"./use-organization-settings-CVVov6IL.js";import"./tooltip-B3_TInpd.js";import"./dialog-BU5DFH5W.js";import"./drawer-BIAuey25.js";import"./collection-search-6KQEdQV-.js";import"./use-mobile-BlbBUtbB.js";import"./AreaChart-BbF7HkuD.js";import"./index-DBqvK62_.js";import"./shell-layout-C6pck1jN.js";import"./avatar-BpWo990_.js";import"./required-auth-layout-2LZKzk9v.js";import"./use-org-sso-QrDBjlyp.js";import"./form-CJt6q_5g.js";import"./select-D6eS9wfi.js";import"./tabs-D4A5jRT4.js";import"./toggle-group-CbmsoRH8.js";import"./use-deco-credits-DvcverbC.js";import"./extract-connection-data-G-Bpyqkw.js";import"./connection-card-DEI5eOI5.js";import"./use-registry-connections-BcaQ0klr.js";import"./use-connection-ecP-LOlu.js";import"./useInfiniteQuery-BZq6rADh.js";import"./use-infinite-scroll-BglRZ1QB.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-aa3oAwSK.js";import"./integration-icon-DzWTEjUs.js";import"./textarea-fiC9rZ0h.js";import"./connection-form-helpers-n5fp7W7B.js";import"./authenticate-and-persist-oauth-D-6WsL4Q.js";import"./mcp-oauth-BEeJhwCj.js";import"./collection-tabs-MCaOG9FY.js";import"./badge-J8Dmk1J0.js";import"./useSuspenseInfiniteQuery-BeVtNfUB.js";import"./connect-desktop-dialog-Bf9qr6oz.js";import"./select-model-Cg_ZkTF2.js";import"./checkbox-CeBf25NN.js";import"./skeleton-FGugFtDG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CbH-EVpR.js";import"./command-CRuC_jNJ.js";import"./index-Bma6OLIT.js";import"./popover-B_wVGt8-.js";import"./dropdown-menu-B4BZdUdJ.js";import"./index-BTcUFe8i.js";import"./file-type-icon-BRTxz-sQ.js";import"./toolbar-rhMa_4Hk.js";import"./use-debounced-value-Uuon3S9W.js";import"./index-CfhAOeJp.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Da71KV1f.js";import"./empty-state-BW-NUX3e.js";import"./use-mcp-tools-Df6cIGEM.js";import"./use-capability-CVJR07VY.js";import"./use-debounced-autosave-CH0JFgRx.js";import"./index-0h6CbAzf.js";import"./sidebar-BqxKhHd4.js";import"./search-input-DdYHUEaZ.js";import"./use-mcp-auth-status-CldVeTAa.js";import"./switch-DWcd-95y.js";import"./github-repo-picker-CAwFwGMb.js";import"./use-navigate-to-agent-D-NxwfzS.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-_jh0wX2R.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./companions-core-BM5TG5dO.js";import"./format-time-BnbuEtat.js";import"./use-members-BK20_T6U.js";import"./use-org-auth-client-BOJU8IRV.js";import"./index-DZX7qGop.js";import"./get-initials-D-f_fDFw.js";import"./calendar-CiyIJkJP.js";import"./use-copy-jCInK_V1.js";import"./toolbar-icon-button-DlMzf0l2.js";import"./monaco-editor-BsSWWkts.js";import"./use-file-configs-eN7OWZ8v.js";import"./use-automations-BWfz7gg-.js";import"./automation-list-row-B0m5PJDd.js";import"./table-Dm_-hO-V.js";import"./use-clock-tick-B_Z5346Q.js";function Ct(k){const e=q.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,A=b===void 0?!1:b,[x,D]=S.useState(A);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=G("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function jr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:A,onManagePosts:x,onOpenPost:D,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=ft(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=ut({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,P]=S.useState(!1),$=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=$.length,W=o=>s("slug",o),H=async(o,w)=>{const V=v(r.name);P(!0);try{let g=0;for(const{key:E,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:V,slug:w});F!==O&&(await i.mutateAsync({blockKey:E,data:R(E,"posts",dt(F))}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",z)}),c(z),U.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),U.error(g instanceof Error?g.message:"Rename failed")}finally{P(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){W(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(I,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(bt,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Ct,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(gt,{value:xt(r.sections),onChange:o=>s("sections",o),meta:A,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&H(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{jr as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as Z,H as Qe,I as se,E as Pe,r as T,C as le,M as Ge,l as V,bd as Ye,u as Ze,L as Q,t as Xe,e as ae,aZ as ke}from"./index-BYupzQX1.js";import{E as Ee}from"./empty-state-BW-NUX3e.js";import{u as et,a as Ae}from"./use-collections-BgBopunk.js";import{u as ce}from"./use-mcp-client-1txAl4Nn.js";import{F as ne,a as tt,b as de,d as me}from"./form-CJt6q_5g.js";import{I as ue}from"./input-Bc-7wRHw.js";import{T as re}from"./textarea-fiC9rZ0h.js";import{a as st,b as nt,V as pe,O as ot,M as it}from"./index-DRBP5o7G.js";import{am as rt,L as lt,ai as at,Q as ct,$ as dt,an as mt,U as be}from"./agent-icon-BG0nMkZr.js";import{g as ut,M as pt,a as Ne}from"./index-DBqvK62_.js";import{A as xt,a as ft,b as ht}from"./alert-Cofu8c-C.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-D6eS9wfi.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-B3_TInpd.js";import{i as jt}from"./AlertCircle-sDfzMQz-.js";import{s as bt}from"./Stars02-CyV0ls88.js";import{a as Nt}from"./Copy01-AsmF-oFM.js";import{i as vt}from"./Play-BlRk613P.js";import{i as St}from"./ChevronRight-jGxYypbD.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./use-mcp-auth-status-CldVeTAa.js";import{a as Oe,u as Re}from"./use-connection-ecP-LOlu.js";import{a as It}from"./use-mcp-tools-Df6cIGEM.js";import{M as $t,c as Tt}from"./monaco-editor-BsSWWkts.js";import{I as Te}from"./integration-icon-DzWTEjUs.js";import{h as Pt,m as kt}from"./chat-context-BwMjJizF.js";import{u as Et}from"./shell-layout-C6pck1jN.js";import{n as At}from"./Tool02-B6UqyM_J.js";import"./constants-D_FQAPnt.js";import"./auth-0M1DqVYt.js";import"./label-xvuN6YsE.js";import"./index-0h6CbAzf.js";import"./sidebar-BqxKhHd4.js";import"./LayoutLeft-BkVB2IbZ.js";import"./use-mobile-BlbBUtbB.js";import"./X-BWPJzkP7.js";import"./ZoomOut-DmQxsrD_.js";import"./Key01-BOZ45ZZP.js";import"./extract-connection-data-G-Bpyqkw.js";import"./use-registry-connections-BcaQ0klr.js";import"./use-organization-settings-CVVov6IL.js";import"./studio-tools-lcCHZe1J.js";import"./Plus-o1s3J9RF.js";import"./index-C4SF_sj-.js";import"./index-Bma6OLIT.js";import"./popover-B_wVGt8-.js";import"./use-virtual-mcp-BD6WMdRh.js";import"./Check-DW_CJo9x.js";import"./SearchMd-CxWfDzx_.js";import"./Users03-B522am55.js";import"./use-create-virtual-mcp-DRKKu78t.js";import"./use-navigate-to-agent-D-NxwfzS.js";import"./hooks-DiiS8_mX.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Settings02-CXx65ABV.js";import"./XCircle-D0AQsXiF.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./CheckCircle-CvckcHSW.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronUp-D1wkSkA0.js";import"./Circle-XeFXmZfO.js";import"./DotsVertical-Dk5Xdxve.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./SearchLg-M-hd_gai.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Trash01-BhHYhKqt.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./Zap-DJjVd0ns.js";import"./badge-J8Dmk1J0.js";import"./mcp-oauth-BEeJhwCj.js";import"./index-CfhAOeJp.js";import"./autosend-8dyE67rr.js";import"./use-ai-providers-Dl25_ErA.js";import"./use-decopilot-events-BEZ72Jkb.js";import"./tab-id-BijBBRwE.js";import"./avatar-BpWo990_.js";import"./dialog-BU5DFH5W.js";import"./alert-dialog-DJa8hr5P.js";import"./required-auth-layout-2LZKzk9v.js";import"./use-org-sso-QrDBjlyp.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:i,isSaving:r,saveLabel:a,undoLabel:c}=s,l=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!i)return null;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(rt,{size:14}),e[0]=p):p=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[p,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let x;e[5]!==r?(x=r?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(lt,{size:14}),e[5]=r,e[6]=x):x=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==x?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":l,children:[x,l]}),e[7]=r,e[8]=o,e[9]=l,e[10]=x,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Qe({title:se().min(1),description:se().nullable(),body:se()});function ie(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let i;e[1]!==o.control?(i=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=i):i=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsx(tt,{...o,children:l}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:i}=le(),r=o||null;let a;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(a={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),l=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),p=u.update.isPending;let m;e[4]!==l?(m=l?{title:l.title,description:l.description??null,body:ie(l)}:void 0,e[4]=l,e[5]=m):m=e[5];let x;e[6]!==m?(x={values:m},e[6]=m,e[7]=x):x=e[7];const f=Ge(x);let g;e[8]!==f||e[9]!==l?(g=()=>{l&&f.reset({title:l.title,description:l.description??null,body:ie(l)})},e[8]=f,e[9]=l,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:ie(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!l){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==l.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:l.title}),e[16]=l.title,e[17]=$):$=e[17];let E;e[18]!==l.description?(E=l.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:l.description})]}):null,e[18]=l.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==p||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:p})}),e[25]=f.formState.isDirty,e[26]=p,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(pe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const i=n;if(!i){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:i,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function G(s){const e=y.c(10);let o,n,i;e[0]!==s?({asChild:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==i||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...i}),e[6]=r,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,i;e[0]!==s?({children:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==i||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...i,children:a}),e[8]=i,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:i,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const l=wt(c);if(!l.isAuthenticated){let m;return e[2]!==l.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(it,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let p;return e[5]!==n||e[6]!==r||e[7]!==i||e[8]!==u||e[9]!==o?(p=t.jsx(Vt,{toolName:o,connectionId:n,siblings:i,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=i,e[8]=u,e[9]=o,e[10]=p):p=e[10],p}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:i}=Ze({strict:!1}),r=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,l]=T.useState(a??{}),[u,p]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,x]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=le(),k=Oe(e),N=Pt(),A=kt(),{openSidePanel:U}=Et(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=Tt(d.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,X]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,fe=xe?Object.keys(xe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),x(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);x(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{l(v=>({...v,[d]:h}))},Be=()=>{x(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>p(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(pt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx($t,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):L.isLoading?t.jsx(Z,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:i}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(x=>x.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const l=c;if(!Oe(l||void 0)||!l){let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=x):x=e[3],x}let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=p):p=e[4];let m;return e[5]!==l||e[6]!==i||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:p,children:t.jsx(Ft,{toolName:o,connectionId:l,siblings:n,onSelectInstance:a,onBack:i})}),e[5]=l,e[6]=i,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:i,description:r,buttonProps:a,buttonComponent:c,className:l,children:u}=s;let p;e[0]!==l?(p=V("flex flex-col items-center justify-center py-16 text-center",l),e[0]=l,e[1]=p):p=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let x;e[5]!==i?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:i}),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==x||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[x,f]}),e[9]=x,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:p,children:[m,g,S,u]}),e[15]=u,e[16]=p,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const l=c,u=Wt;let p;return s[5]!==l||s[6]!==i||s[7]!==a?(p=t.jsx(Jt,{itemId:i,siblings:a,onBack:l,onUpdate:u}),s[5]=l,s[6]=i,s[7]=a,s[8]=p):p=s[8],p}async function Wt(s){return Promise.resolve()}function Qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Gt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:l}=le();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,x=m?.id??"",f=x||"no-connection",g=x??null;let S;s[5]!==l.id||s[6]!==l.slug||s[7]!==g?(S={connectionId:g,orgId:l.id,orgSlug:l.slug},s[5]=l.id,s[6]=l.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,i,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==i?(P=i?.toLowerCase(),s[12]=i,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==i?(C=Qt(i),s[14]=i,s[15]=C):C=s[15];const k=C;let N;s[16]!==l.slug?(N=t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:l.slug},children:"Connections"})})}),s[16]=l.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==i||s[20]!==m||s[21]!==l.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:n.appSlug},search:{tab:i},children:m.title})})}),t.jsx(Y,{})]}),s[19]=i,s[20]=m,s[21]=l.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(pe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Gt,{}),s[2]=r):r=s[2],r}function Qn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Qn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as E,j as n,u as Ie,o as De,p as se,r as M,a as Se,b as Fe,q as qe,d as Te,s as Le,Q as He,E as Ve,K as _e,v as Ue,B as je,N as Be}from"./index-BYupzQX1.js";import{L as Ke,s as ve,S as Pe,a as Ne,b as Ce,c as be,i as Qe,n as pe,C as we,p as xe}from"./self-tool-result-CxF5glyU.js";import{A as We}from"./auth-entry-BRqC2psi.js";import{A as Ge}from"./auth-split-layout-CvH5-Yt4.js";import{O as Re}from"./organization-choice-BnkT96vQ.js";import{I as Ye}from"./input-Bc-7wRHw.js";import{u as Je}from"./use-mcp-client-1txAl4Nn.js";import{S as Xe,W as Ze,g as et,a as tt}from"./constants-D_FQAPnt.js";import{i as it}from"./XCircle-D0AQsXiF.js";import"./integration-icon-DzWTEjUs.js";import"./Tool02-B6UqyM_J.js";import"./agent-icon-BG0nMkZr.js";import"./AlertCircle-sDfzMQz-.js";import"./UserPlus01-CiUhK_7V.js";import"./Tool01-BpjlKODL.js";import"./ArrowUp-5EMoK-0z.js";import"./Settings02-CXx65ABV.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ZapSquare-D-7d5mNS.js";import"./Users03-B522am55.js";import"./CheckCircle-CvckcHSW.js";import"./Check-DW_CJo9x.js";import"./ChevronDown-CyPL9p3K.js";import"./ChevronRight-jGxYypbD.js";import"./ChevronUp-D1wkSkA0.js";import"./Circle-XeFXmZfO.js";import"./Stars02-CyV0ls88.js";import"./Copy01-AsmF-oFM.js";import"./ZoomOut-DmQxsrD_.js";import"./DotsVertical-Dk5Xdxve.js";import"./Globe01-DOhXvJ4f.js";import"./Eye-DF50O1Ue.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Star01-D8wrCAnP.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./Key01-BOZ45ZZP.js";import"./LayoutLeft-BkVB2IbZ.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./Plus-o1s3J9RF.js";import"./SearchLg-M-hd_gai.js";import"./SearchMd-CxWfDzx_.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Trash01-BhHYhKqt.js";import"./Upload01-MLXfWlY_.js";import"./User01-DyqXRcED.js";import"./Users01-C2chq_s1.js";import"./XClose-C6R6Hrmn.js";import"./X-BWPJzkP7.js";import"./Zap-DJjVd0ns.js";import"./dialog-BU5DFH5W.js";import"./tooltip-B3_TInpd.js";import"./companions-core-BM5TG5dO.js";import"./extract-connection-data-G-Bpyqkw.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./form-CJt6q_5g.js";import"./label-xvuN6YsE.js";import"./use-debounced-value-Uuon3S9W.js";import"./authenticate-and-persist-oauth-D-6WsL4Q.js";import"./mcp-oauth-BEeJhwCj.js";import"./auth-0M1DqVYt.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-BpWo990_.js";const nt={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ot(l){return nt[l]}function ye(l){const e=E.c(4),{variant:i}=l;let t;e[0]!==i?(t=ot(i),e[0]=i,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:n.jsx(Ke,{label:t,className:"text-muted-foreground"})}),e[2]=t,e[3]=s):s=e[3],s}function Mi(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(st,{}),l[0]=e):e=l[0],e}const Me=M.createContext(null),$e=()=>M.useContext(Me);function R(l){const e=E.c(13);let i,t;e[0]!==l?({visual:t,...i}=l,e[0]=l,e[1]=i,e[2]=t):(i=e[1],t=e[2]);let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/commerce-onboarding"},e[3]=s):s=e[3];const c=Ie(s),{data:a}=Se.useSession(),o=a?.user?.email;let m;e[4]!==c.siteUrl||e[5]!==o?(m=Ce({siteUrl:c.siteUrl,email:o}),e[4]=c.siteUrl,e[5]=o,e[6]=m):m=e[6];const d=m;let u;e[7]!==d||e[8]!==t?(u=t??n.jsx(be,{href:d}),e[7]=d,e[8]=t,e[9]=u):u=e[9];let v;return e[10]!==i||e[11]!==u?(v=n.jsx(Ge,{...i,visual:u}),e[10]=i,e[11]=u,e[12]=v):v=e[12],v}const rt={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:l=>`Código enviado para ${l}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:l=>`Continuar com ${l}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function Oe(l){switch(l){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return l}}let ze=!1;function st(){const l=Ie({from:"/commerce-onboarding"}),{org:e,siteUrl:i}=l,t=ve(i);return!ze&&De()&&(ze=!0,se("commerce_onboarding_viewed",{site_url:i,domain:t??void 0,...t?{$set:{last_scanned_domain:t}}:{}})),n.jsx(Me.Provider,{value:t,children:n.jsx(at,{requestedOrgSlug:e,siteUrl:i})})}function at(l){const e=E.c(8),{requestedOrgSlug:i,siteUrl:t}=l,{data:s,isPending:c}=Se.useSession(),a=$e();if(c){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(R,{children:n.jsx(ye,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!s){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==a?(d=a?n.jsx(Pe,{host:a}):void 0,e[1]=a,e[2]=d):d=e[2];let u;return e[3]!==d?(u=n.jsx(R,{children:n.jsx(We,{callbackUrl:m,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:d,copy:rt})}),e[3]=d,e[4]=u):u=e[4],u}let o;return e[5]!==i||e[6]!==t?(o=n.jsx(lt,{requestedOrgSlug:i,siteUrl:t}),e[5]=i,e[6]=t,e[7]=o):o=e[7],o}function lt(l){const e=E.c(43),{requestedOrgSlug:i,siteUrl:t}=l,s=Fe(),c=qe(),[a,o]=M.useState(null),[m,d]=M.useState(null),u=c.data?.map(mt)??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:ct,retry:!1,onSuccess:r=>{d(r)}},e[0]=v):v=e[0];const p=Te(v);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(R,{children:n.jsx(ye,{variant:"workspace"})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=n.jsx(ae,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const j=i?u.find(r=>r.slug===i):null;if(j){let r;return e[4]!==j||e[5]!==t?(r=n.jsx(re,{org:j,initialSiteUrl:t}),e[4]=j,e[5]=t,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=n.jsx(ae,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(a){let r;return e[9]!==a||e[10]!==t?(r=n.jsx(re,{org:a,initialSiteUrl:t}),e[9]=a,e[10]=t,e[11]=r):r=e[11],r}if(u.length===1&&u[0]){let r;return e[12]!==u[0]||e[13]!==t?(r=n.jsx(re,{org:u[0],initialSiteUrl:t}),e[12]=u[0],e[13]=t,e[14]=r):r=e[14],r}if(u.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=r):r=e[15];let h;e[16]!==s||e[17]!==t?(h=O=>s({to:"/commerce-onboarding",search:{org:O.slug,siteUrl:t}}),e[16]=s,e[17]=t,e[18]=h):h=e[18];let C;return e[19]!==u||e[20]!==h?(C=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:u,selectLabel:"Continuar",onSelected:h})})]})}),e[19]=u,e[20]=h,e[21]=C):C=e[21],C}if(!m){let r;e[22]!==p?(r=()=>{p.reset(),p.mutate()},e[22]=p,e[23]=r):r=e[23];let h;return e[24]!==p||e[25]!==r?(h=n.jsx(dt,{mutation:p,onRetry:r}),e[24]=p,e[25]=r,e[26]=h):h=e[26],h}const g=m;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let r;return e[27]!==g.organization||e[28]!==t?(r=n.jsx(re,{org:g.organization,initialSiteUrl:t}),e[27]=g.organization,e[28]=t,e[29]=r):r=e[29],r}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let r;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(k,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[30]=r):r=e[30];const h=g.domain??void 0;let C;e[31]!==s||e[32]!==t?(C=($,P)=>{Le(),o({...$,slug:P}),s({to:"/commerce-onboarding",search:{org:P,siteUrl:t}})},e[31]=s,e[32]=t,e[33]=C):C=e[33];let O;return e[34]!==g.organizations||e[35]!==h||e[36]!==C?(O=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[r,n.jsx(Ne,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:n.jsx(Re,{organizations:g.organizations,domain:h,onJoined:C})})]})}),e[34]=g.organizations,e[35]=h,e[36]=C,e[37]=O):O=e[37],O}const S=g?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let _;e[38]!==p?(_=()=>{d(null),p.reset()},e[38]=p,e[39]=_):_=e[39];let I;return e[40]!==S||e[41]!==_?(I=n.jsx(ae,{title:"O onboarding de commerce precisa de suporte",description:S,actionLabel:"Tentar novamente",onRetry:_}),e[40]=S,e[41]=_,e[42]=I):I=e[42],I}async function ct(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Le(),e}function mt(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function dt(l){const e=E.c(7),{mutation:i,onRetry:t}=l,s=M.useRef(!1);let c;e[0]!==i?(c=d=>{!d||s.current||(s.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const a=c;if(i.error){let d;return e[2]!==t?(d=n.jsx(ae,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:t}),e[2]=t,e[3]=d):d=e[3],d}let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ye,{variant:"generic"}),e[4]=o):o=e[4];let m;return e[5]!==a?(m=n.jsx(R,{children:n.jsx("div",{ref:a,children:o})}),e[5]=a,e[6]=m):m=e[6],m}function k(l){const e=E.c(8),{title:i,description:t}=l,s=$e();let c;e[0]!==s?(c=s?n.jsx(Pe,{host:s}):n.jsxs("div",{children:[n.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),n.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=s,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==i?(a=(i||t)&&n.jsxs("div",{className:"space-y-2",children:[i&&n.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),t&&n.jsx("p",{className:"text-base text-muted-foreground leading-6",children:t})]}),e[2]=t,e[3]=i,e[4]=a):a=e[4];let o;return e[5]!==c||e[6]!==a?(o=n.jsxs("div",{className:"grid gap-10",children:[c,a]}),e[5]=c,e[6]=a,e[7]=o):o=e[7],o}function ae(l){const e=E.c(9),{title:i,description:t,actionLabel:s,onRetry:c}=l;let a;e[0]!==t||e[1]!==i?(a=n.jsx(k,{title:i,description:t}),e[0]=t,e[1]=i,e[2]=a):a=e[2];let o;e[3]!==s||e[4]!==c?(o=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:c,children:s}),e[3]=s,e[4]=c,e[5]=o):o=e[5];let m;return e[6]!==a||e[7]!==o?(m=n.jsx(R,{children:n.jsxs("div",{className:"grid gap-10",children:[a,o]})}),e[6]=a,e[7]=o,e[8]=m):m=e[8],m}function re(l){const e=E.c(11),{org:i,initialSiteUrl:t}=l,{data:s}=Se.useSession(),c=s?.user?.email;let a;e[0]!==t||e[1]!==c?(a=Ce({siteUrl:t,email:c}),e[0]=t,e[1]=c,e[2]=a):a=e[2];const o=a;let m;e[3]!==o||e[4]!==i.id?(m=n.jsx(be,{href:o,orgId:i.id}),e[3]=o,e[4]=i.id,e[5]=m):m=e[5];const d=m;let u;return e[6]!==t||e[7]!==d||e[8]!==i||e[9]!==s?.user?.email?(u=n.jsx(He,{children:v=>{const{reset:p}=v;return n.jsx(Ve,{fallback:j=>{const{error:g,resetError:S}=j;return n.jsx(R,{visual:d,children:n.jsx(ut,{orgName:i.name,message:g instanceof Error?g.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{p(),S()}})})},children:n.jsx(M.Suspense,{fallback:n.jsx(ke,{visual:d}),children:n.jsx(ft,{org:i,initialSiteUrl:t,sessionEmail:s?.user?.email},`${i.id}:${t??""}`)})})}}),e[6]=t,e[7]=d,e[8]=i,e[9]=s?.user?.email,e[10]=u):u=e[10],u}function ke(l){const e=E.c(3),{visual:i}=l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[n.jsx(k,{}),n.jsx(we,{})]}),e[0]=t):t=e[0];let s;return e[1]!==i?(s=n.jsx(R,{align:"fill",visual:i,children:t}),e[1]=i,e[2]=s):s=e[2],s}function ut(l){const e=E.c(10),{orgName:i,message:t,onRetry:s}=l,c=`A configuração de commerce continuará em ${i}.`;let a;e[0]!==c?(a=n.jsx(k,{title:"Diagnóstico de commerce",description:c}),e[0]=c,e[1]=a):a=e[1];let o;e[2]!==t?(o=n.jsx(le,{message:t}),e[2]=t,e[3]=o):o=e[3];let m;e[4]!==s?(m=n.jsx(je,{type:"button",size:"xl",className:"w-full",onClick:s,children:"Tentar novamente"}),e[4]=s,e[5]=m):m=e[5];let d;return e[6]!==a||e[7]!==o||e[8]!==m?(d=n.jsxs("div",{className:"grid gap-10",children:[a,o,m]}),e[6]=a,e[7]=o,e[8]=m,e[9]=d):d=e[9],d}function ft(l){const e=E.c(109),{org:i,initialSiteUrl:t,sessionEmail:s}=l;let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Xe,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const a=Je(c),[o,m]=M.useState(t??""),[d,u]=M.useState(null),v=M.useRef(!1),p=Ze.COMMERCE_DISCOVERY(i.id),j=et(i.id),g=_e.commerceDiscoveryConnection(i.id,p);let S;e[3]!==p||e[4]!==a?(S=async()=>{const f=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(f)},e[3]=p,e[4]=a,e[5]=S):S=e[5];let _;e[6]!==g||e[7]!==S?(_={queryKey:g,queryFn:S,retry:!1},e[6]=g,e[7]=S,e[8]=_):_=e[8];const I=Ue(_),r=_e.commerceDiscoveryVirtualMcp(i.id,j);let h;e[9]!==a||e[10]!==j?(h=async()=>{const f=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:j}});return xe(f)},e[9]=a,e[10]=j,e[11]=h):h=e[11];let C;e[12]!==r||e[13]!==h?(C={queryKey:r,queryFn:h,retry:!1},e[12]=r,e[13]=h,e[14]=C):C=e[14];const O=Ue(C);let $;e[15]!==a?($=async f=>{const x=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:f}});return xe(x)},e[15]=a,e[16]=$):$=e[16];let P;e[17]!==I||e[18]!==i.id||e[19]!==O?(P=(f,x)=>{se("commerce_onboarding_setup_succeeded",{domain:ve(x)??void 0,organization_id:i.id}),u(null),I.refetch(),O.refetch()},e[17]=I,e[18]=i.id,e[19]=O,e[20]=P):P=e[20];let A;e[21]!==i.id?(A=(f,x)=>{se("commerce_onboarding_setup_failed",{domain:ve(x)??void 0,organization_id:i.id,error:f instanceof Error?f.message:String(f)}),u(f instanceof Error?f.message:"A configuração do Commerce Discovery falhou.")},e[21]=i.id,e[22]=A):A=e[22];let Q;e[23]!==A||e[24]!==$||e[25]!==P?(Q={mutationFn:$,retry:!1,onSuccess:P,onError:A},e[23]=A,e[24]=$,e[25]=P,e[26]=Q):Q=e[26];const b=Te(Q),Ae=!!I.data.item&&!!O.data.item,Ee=I.data.item,W=typeof Ee?.metadata?.siteUrl=="string"?Ee.metadata.siteUrl:void 0,ce=t||o||"";let G;e[27]!==W||e[28]!==ce?(G=Qe(ce,W),e[27]=W,e[28]=ce,e[29]=G):G=e[29];const Y=Ae&&G,J=t||o||W||"";let X;e[30]!==J||e[31]!==s?(X=Ce({siteUrl:J,email:s}),e[30]=J,e[31]=s,e[32]=X):X=e[32];const me=X;let Z;e[33]!==me||e[34]!==i.id?(Z=n.jsx(be,{href:me,orgId:i.id}),e[33]=me,e[34]=i.id,e[35]=Z):Z=e[35];const y=Z;let ee;e[36]!==b?(ee=f=>{const x=pe(f);if(!x.ok){u(Oe(x.error));return}u(null),b.mutate(x.value)},e[36]=b,e[37]=ee):ee=e[37];const D=ee;let te;e[38]!==t||e[39]!==D||e[40]!==Y?(te=f=>{!f||v.current||Y||!t||(v.current=!0,D(t))},e[38]=t,e[39]=D,e[40]=Y,e[41]=te):te=e[41];const de=te;let ie;e[42]!==i.id||e[43]!==D||e[44]!==o?(ie=f=>{f.preventDefault();const x=pe(o);x.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(x.value).hostname,organization_id:i.id}),D(o)},e[42]=i.id,e[43]=D,e[44]=o,e[45]=ie):ie=e[45];const z=ie;if(Y){const f=i.slug;let x;e[46]===Symbol.for("react.memo_cache_sentinel")?(x=crypto.randomUUID(),e[46]=x):x=e[46];let T;e[47]!==i.slug?(T={org:f,taskId:x},e[47]=i.slug,e[48]=T):T=e[48];let U;e[49]!==i.id?(U=tt(i.id),e[49]=i.id,e[50]=U):U=e[50];const L=J||void 0;let N;e[51]!==U.id||e[52]!==L?(N={virtualmcpid:U.id,connect:"1",siteUrl:L},e[51]=U.id,e[52]=L,e[53]=N):N=e[53];let w;return e[54]!==T||e[55]!==N?(w=n.jsx(Be,{to:"/$org/$taskId",params:T,search:N,replace:!0}),e[54]=T,e[55]=N,e[56]=w):w=e[56],w}if(b.isPending){let f;return e[57]!==y?(f=n.jsx(ke,{visual:y}),e[57]=y,e[58]=f):f=e[58],f}if(t){let f,x;if(e[59]!==y||e[60]!==z||e[61]!==t||e[62]!==d||e[63]!==i.name||e[64]!==b.isPending||e[65]!==o){x=Symbol.for("react.early_return_sentinel");e:if(f=pe(t),!f.ok){const fe=`A configuração de commerce continuará em ${i.name}.`;let V;e[68]!==fe?(V=n.jsx(k,{title:"Diagnóstico de commerce",description:fe}),e[68]=fe,e[69]=V):V=e[69];const ge=n.jsx(le,{message:Oe(f.error)});let B;e[70]!==z||e[71]!==d||e[72]!==b.isPending||e[73]!==o?(B=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[70]=z,e[71]=d,e[72]=b.isPending,e[73]=o,e[74]=B):B=e[74];let K;e[75]!==V||e[76]!==ge||e[77]!==B?(K=n.jsxs("div",{className:"grid gap-10",children:[V,ge,B]}),e[75]=V,e[76]=ge,e[77]=B,e[78]=K):K=e[78];let oe;e[79]!==y||e[80]!==K?(oe=n.jsx(R,{visual:y,children:K}),e[79]=y,e[80]=K,e[81]=oe):oe=e[81],x=oe;break e}e[59]=y,e[60]=z,e[61]=t,e[62]=d,e[63]=i.name,e[64]=b.isPending,e[65]=o,e[66]=f,e[67]=x}else f=e[66],x=e[67];if(x!==Symbol.for("react.early_return_sentinel"))return x;const T=`O Commerce Discovery está sendo preparado para ${f.value}.`;let U;e[82]!==T?(U=n.jsx(k,{title:"Diagnóstico de commerce",description:T}),e[82]=T,e[83]=U):U=e[83];let L;e[84]!==z||e[85]!==d||e[86]!==b.isPending||e[87]!==o?(L=d?n.jsxs(n.Fragment,{children:[n.jsx(le,{message:d}),n.jsx(he,{siteUrl:o,error:null,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z})]}):n.jsx(we,{}),e[84]=z,e[85]=d,e[86]=b.isPending,e[87]=o,e[88]=L):L=e[88];let N;e[89]!==U||e[90]!==L||e[91]!==de?(N=n.jsxs("div",{ref:de,className:"grid gap-10",children:[U,L]}),e[89]=U,e[90]=L,e[91]=de,e[92]=N):N=e[92];let w;return e[93]!==y||e[94]!==N?(w=n.jsx(R,{visual:y,children:N}),e[93]=y,e[94]=N,e[95]=w):w=e[95],w}const ue=`A configuração de commerce continuará em ${i.name}.`;let F;e[96]!==ue?(F=n.jsx(k,{title:"Diagnóstico de commerce",description:ue}),e[96]=ue,e[97]=F):F=e[97];let q;e[98]!==z||e[99]!==d||e[100]!==b.isPending||e[101]!==o?(q=n.jsx(he,{siteUrl:o,error:d,isSubmitting:b.isPending,onSiteUrlChange:m,onSubmit:z}),e[98]=z,e[99]=d,e[100]=b.isPending,e[101]=o,e[102]=q):q=e[102];let H;e[103]!==F||e[104]!==q?(H=n.jsxs("div",{className:"grid gap-10",children:[F,q]}),e[103]=F,e[104]=q,e[105]=H):H=e[105];let ne;return e[106]!==y||e[107]!==H?(ne=n.jsx(R,{visual:y,children:H}),e[106]=y,e[107]=H,e[108]=ne):ne=e[108],ne}function he(l){const e=E.c(20),{siteUrl:i,error:t,isSubmitting:s,onSiteUrlChange:c,onSubmit:a}=l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=o):o=e[0];let m;e[1]!==c?(m=_=>c(_.target.value),e[1]=c,e[2]=m):m=e[2];const d=!!t;let u;e[3]!==s||e[4]!==i||e[5]!==m||e[6]!==d?(u=n.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":d,disabled:s}),e[3]=s,e[4]=i,e[5]=m,e[6]=d,e[7]=u):u=e[7];let v;e[8]!==t?(v=t?n.jsx(le,{message:t}):null,e[8]=t,e[9]=v):v=e[9];let p;e[10]!==u||e[11]!==v?(p=n.jsxs("div",{className:"grid gap-2",children:[o,u,v]}),e[10]=u,e[11]=v,e[12]=p):p=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(it,{size:16}),e[13]=j):j=e[13];let g;e[14]!==s?(g=n.jsxs(je,{type:"submit",size:"xl",className:"w-full",disabled:s,children:["Continuar",j]}),e[14]=s,e[15]=g):g=e[15];let S;return e[16]!==a||e[17]!==p||e[18]!==g?(S=n.jsxs("form",{className:"grid gap-4",onSubmit:a,children:[p,g]}),e[16]=a,e[17]=p,e[18]=g,e[19]=S):S=e[19],S}function le(l){const e=E.c(2),{message:i}=l;let t;return e[0]!==i?(t=n.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=t):t=e[1],t}export{Mi as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as he,af as Ie,b3 as Ae,I as le,ad as $e,c as P,j as t,i as ge,B as V,r as G,l as je,C as J,v as De,K as ne,b as Y,aI as ce,z as Pe,b4 as Oe,E as Me,e as ze,b5 as Ee,n as Ve,M as Ue,J as Re,t as q,b6 as Fe}from"./index-BYupzQX1.js";import{g as Le}from"./extract-connection-data-G-Bpyqkw.js";import{E as ve}from"./empty-state-BW-NUX3e.js";import{E as He,c as Be,r as We,b as Xe,d as qe}from"./connection-form-helpers-n5fp7W7B.js";import{c as Ge,S as Ke,V as Qe}from"./index-DRBP5o7G.js";import{u as be,T as Je}from"./use-mcp-auth-status-CldVeTAa.js";import{u as Ye}from"./use-members-BK20_T6U.js";import{A as Ze}from"./avatar-BpWo990_.js";import{a as Ne,b as ye,u as et}from"./use-connection-ecP-LOlu.js";import{u as _e}from"./use-mcp-client-1txAl4Nn.js";import{a as tt}from"./use-mcp-tools-Df6cIGEM.js";import{c as st,C as nt,a as ot,d as it}from"./AreaChart-BbF7HkuD.js";import{i as rt,a as at}from"./mcp-oauth-BEeJhwCj.js";import{I as oe}from"./integration-icon-DzWTEjUs.js";import{s as lt}from"./Plus-o1s3J9RF.js";import{J as ct,K as dt,al as mt,ah as ut}from"./agent-icon-BG0nMkZr.js";import{a as Ce,s as xt}from"./Settings02-CXx65ABV.js";import{s as re}from"./Trash01-BhHYhKqt.js";import{q as pt,p as ft,o as ht,m as gt,n as jt}from"./sidebar-BqxKhHd4.js";import{F as L,b as H,c as B,d as E,f as W,e as vt,a as bt}from"./form-CJt6q_5g.js";import{I as X}from"./input-Bc-7wRHw.js";import{u as Nt,D as yt}from"./use-delete-connection-BhvCEJxJ.js";import{c as _t,B as Ct,a as St,C as wt}from"./monitoring-stats-row-CH9IWyLZ.js";import{u as kt}from"./studio-tools-lcCHZe1J.js";import{u as Tt}from"./use-virtual-mcp-BD6WMdRh.js";import{i as Se}from"./ChevronRight-jGxYypbD.js";import{a as we}from"./Users03-B522am55.js";import{b as ee,c as It,T as te,a as At}from"./tabs-D4A5jRT4.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-D-7d5mNS.js";import{d as Dt}from"./Tool01-BpjlKODL.js";import{g as ae,M as Pt}from"./index-DBqvK62_.js";import{C as Ot}from"./collection-search-6KQEdQV-.js";import{C as Mt}from"./card-aa3oAwSK.js";import{B as zt}from"./badge-J8Dmk1J0.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-B4BZdUdJ.js";import{S as me,a as ue,b as xe,c as pe,d as F}from"./select-D6eS9wfi.js";import{i as Rt}from"./CheckCircle-CvckcHSW.js";import{t as Ft}from"./ChevronDown-CyPL9p3K.js";import{n as Lt}from"./Tool02-B6UqyM_J.js";import{s as se}from"./Star01-D8wrCAnP.js";import{s as Ht}from"./XClose-C6R6Hrmn.js";import"./constants-D_FQAPnt.js";import"./index-0h6CbAzf.js";import"./ZoomOut-DmQxsrD_.js";import"./Key01-BOZ45ZZP.js";import"./auth-0M1DqVYt.js";import"./use-registry-connections-BcaQ0klr.js";import"./use-organization-settings-CVVov6IL.js";import"./index-C4SF_sj-.js";import"./index-Bma6OLIT.js";import"./popover-B_wVGt8-.js";import"./tooltip-B3_TInpd.js";import"./Check-DW_CJo9x.js";import"./SearchMd-CxWfDzx_.js";import"./use-mobile-BlbBUtbB.js";import"./use-create-virtual-mcp-DRKKu78t.js";import"./use-navigate-to-agent-D-NxwfzS.js";import"./hooks-DiiS8_mX.js";import"./decopilot-sse-pool-B49XBmc3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-DF50O1Ue.js";import"./use-org-auth-client-BOJU8IRV.js";import"./User01-DyqXRcED.js";import"./use-collections-BgBopunk.js";import"./AlertCircle-sDfzMQz-.js";import"./UserPlus01-CiUhK_7V.js";import"./ArrowUp-5EMoK-0z.js";import"./XCircle-D0AQsXiF.js";import"./ArrowUpRight-BCg_ek3r.js";import"./TrendUp01-ytIvysU7.js";import"./ChevronUp-D1wkSkA0.js";import"./Circle-XeFXmZfO.js";import"./Stars02-CyV0ls88.js";import"./Copy01-AsmF-oFM.js";import"./DotsVertical-Dk5Xdxve.js";import"./Globe01-DOhXvJ4f.js";import"./FilterLines-C_jjXfkg.js";import"./Flag01-B5gDwl3Q.js";import"./Globe04-c8g2iyUk.js";import"./SwitchHorizontal01-C7qYtxDX.js";import"./HardDrive-Ddg1UJlN.js";import"./LayoutLeft-BkVB2IbZ.js";import"./LinkExternal01-DdU7WoMF.js";import"./List-D9CCEPJ3.js";import"./Monitor01-sX1pwHXM.js";import"./Sun-CE2mYjYy.js";import"./Package-CfSQbtDl.js";import"./Palette-C7yix6_T.js";import"./Play-BlRk613P.js";import"./SearchLg-M-hd_gai.js";import"./Shield01-CWQHp-7f.js";import"./Stars01-Cmtkyg7-.js";import"./Upload01-MLXfWlY_.js";import"./Users01-C2chq_s1.js";import"./X-BWPJzkP7.js";import"./Zap-DJjVd0ns.js";import"./label-xvuN6YsE.js";import"./alert-dialog-DJa8hr5P.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(ct,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(dt,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:i}),children:t.jsx(Xt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=_t(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(st,{config:Yt,className:"h-16 w-full",children:t.jsxs(Ct,{data:u,barCategoryGap:"4%",children:[t.jsx(nt,{content:t.jsx(ot,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})}),p.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function as(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function us(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Rt,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(xt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(vt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=Nt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),f=Ue({resolver:Re(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),R=h?.id??e;await x.update.mutateAsync({id:R,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:R}=await at({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(R||!$){q.error(`Authentication failed: ${R}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...c}),t.jsx(pt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ft,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ht,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(gt,{className:"text-base",children:h?.title??s.title}),t.jsx(jt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(bt,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),q.success($==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,R=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:R,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await rt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const R of D)z.has(R.name)||(z.add(R.name),U.push(R))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=it(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function Co(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{Co as default};
|