decocms 4.367.0 → 4.367.2
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-lddbBWh0.js → AlertCircle-rRQrnsQT.js} +1 -1
- package/dist/client/assets/{AreaChart-DKAyw_K7.js → AreaChart-CfdWNyEQ.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DDPJQXhG.js → ArrowLeft-BZ_V0Q9t.js} +1 -1
- package/dist/client/assets/{ArrowRight-Cm4rUCam.js → ArrowRight-DLmMx1GH.js} +1 -1
- package/dist/client/assets/{ArrowUp-BlHEAyyd.js → ArrowUp-DhMsgJkj.js} +1 -1
- package/dist/client/assets/{Check-B2FZLF1O.js → Check-jwHdO8X-.js} +1 -1
- package/dist/client/assets/{CheckCircle-2GspG_XT.js → CheckCircle-BXhLNUG6.js} +1 -1
- package/dist/client/assets/{ChevronRight-byX-3L9r.js → ChevronRight-qjdwy3ht.js} +1 -1
- package/dist/client/assets/{ChevronUp-DgIot4i7.js → ChevronUp-DUyCnbNx.js} +1 -1
- package/dist/client/assets/{Copy01-DN3tqM8L.js → Copy01-Ba_DXyYG.js} +1 -1
- package/dist/client/assets/{CreditCard01-wo9mx3CN.js → CreditCard01-D8ve3i2_.js} +1 -1
- package/dist/client/assets/{Database01-BsiMLwmb.js → Database01-CKtQnfwM.js} +1 -1
- package/dist/client/assets/{DotsVertical-BFzwtdUn.js → DotsVertical-2ZMqd-18.js} +1 -1
- package/dist/client/assets/{Download01-DzANKKkw.js → Download01-CoH-UuQa.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CFHTziNp.js → ErrorBarContext-B_FyGPF3.js} +1 -1
- package/dist/client/assets/{Eye-DFJEK6aw.js → Eye-BpslXSuU.js} +1 -1
- package/dist/client/assets/{File02-BE1-Eszh.js → File02-aDup41Qr.js} +1 -1
- package/dist/client/assets/{GitBranch01-CI-WDVa2.js → GitBranch01-DzU0sPJc.js} +1 -1
- package/dist/client/assets/{Globe01-BkG0TYp3.js → Globe01-CDkkg2Cy.js} +1 -1
- package/dist/client/assets/{HardDrive-DuIbEWGl.js → HardDrive-DNp6sr7j.js} +1 -1
- package/dist/client/assets/{Image01-CUco8f4C.js → Image01-DZX0wWyU.js} +1 -1
- package/dist/client/assets/{Key01-Ctr214Q3.js → Key01-D2uCgYpN.js} +1 -1
- package/dist/client/assets/{Link01-CyA36bfv.js → Link01-B6QrVU3H.js} +1 -1
- package/dist/client/assets/{LinkExternal01-EKFZjMJY.js → LinkExternal01-CKgmWkkp.js} +1 -1
- package/dist/client/assets/{MessageCircle01-BMp3tiX2.js → MessageCircle01-DOh30ucD.js} +1 -1
- package/dist/client/assets/{Monitor01-C8W3wbFB.js → Monitor01-DT1NSOaN.js} +1 -1
- package/dist/client/assets/{Package-CpB6vYlT.js → Package-DZFJNJtq.js} +1 -1
- package/dist/client/assets/{Palette-CBU77GJ1.js → Palette-D9x-keux.js} +1 -1
- package/dist/client/assets/{Play-Uhe4ebTG.js → Play-nvjmkgl9.js} +1 -1
- package/dist/client/assets/{Plus-BiYlKLxl.js → Plus-p771xfxl.js} +1 -1
- package/dist/client/assets/{Printer-CSBhu2Re.js → Printer-CEzVuZMa.js} +1 -1
- package/dist/client/assets/{SearchLg-CN4JJES9.js → SearchLg-C5H_nx3W.js} +1 -1
- package/dist/client/assets/{SearchMd-C6NFUW36.js → SearchMd-BnbGkmUb.js} +1 -1
- package/dist/client/assets/{Sector-UzdbcO_5.js → Sector-B0EhClQm.js} +1 -1
- package/dist/client/assets/{Settings02-CqMjj8Oq.js → Settings02-CFq2ETVr.js} +1 -1
- package/dist/client/assets/{Share07-DH92YWbU.js → Share07-hoEgdikb.js} +1 -1
- package/dist/client/assets/{Shield01-Cm4rFm8N.js → Shield01-C_kVJsrZ.js} +1 -1
- package/dist/client/assets/{Stars01-BxBiTUsk.js → Stars01-jOH0yCKk.js} +1 -1
- package/dist/client/assets/{Sun-sJn8WeT-.js → Sun-BvckUZh0.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BT-naaH0.js → SwitchHorizontal01-DVbyXy1C.js} +1 -1
- package/dist/client/assets/{Tool01-0YKAjW__.js → Tool01-Co_K8urR.js} +1 -1
- package/dist/client/assets/{Tool02-Bco71KeO.js → Tool02-BHzOpk5z.js} +1 -1
- package/dist/client/assets/{Trash01-Dp2yrMxt.js → Trash01-B1H2nTDv.js} +1 -1
- package/dist/client/assets/{TrendUp01-D1K9L0xP.js → TrendUp01-Cxcr4-0l.js} +1 -1
- package/dist/client/assets/{Upload01-BUf7qRrI.js → Upload01-CiNRxnSv.js} +1 -1
- package/dist/client/assets/{User01-Da1WckIS.js → User01-_uMnR0k7.js} +1 -1
- package/dist/client/assets/{UserSquare-XPgiOUWe.js → UserSquare-SK2C9JwY.js} +1 -1
- package/dist/client/assets/{Users01-BsVs6-8w.js → Users01-C8QAjTFh.js} +1 -1
- package/dist/client/assets/{Users03-DL_upBh-.js → Users03-BsQdFF8i.js} +1 -1
- package/dist/client/assets/{X-D6lVPJzO.js → X-MotBpvxg.js} +1 -1
- package/dist/client/assets/{XCircle-DReUcNBS.js → XCircle-mKrW5aBV.js} +1 -1
- package/dist/client/assets/{XClose-DYRx__Hg.js → XClose-nT83baSx.js} +1 -1
- package/dist/client/assets/{Zap-CCglgveU.js → Zap-DlMFCTS-.js} +1 -1
- package/dist/client/assets/{ZoomOut-BlidBzgG.js → ZoomOut-DbeadNC9.js} +1 -1
- package/dist/client/assets/{access-gate-BYH1blGF.js → access-gate-DB08KYAT.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BBa9lb3g.js → add-connection-dialog-COIUcaiE.js} +1 -1
- package/dist/client/assets/{agent-analytics-CBzZ6fW4.js → agent-analytics-ByqAUaQE.js} +1 -1
- package/dist/client/assets/agent-app-BKrsF-WP.js +1 -0
- package/dist/client/assets/{agent-assets-1uSvOIMs.js → agent-assets-DnGvnA0Q.js} +1 -1
- package/dist/client/assets/{agent-automation-DlziYH2t.js → agent-automation-iBayfasb.js} +1 -1
- package/dist/client/assets/{agent-automations-qFcyvr7g.js → agent-automations-DHGdzWCZ.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-BT8vowWZ.js → agent-connect-sources-bgjFIcuF.js} +1 -1
- package/dist/client/assets/agent-deck-UyiKhWO_.js +1 -0
- package/dist/client/assets/{agent-e2e-W6x_fKn9.js → agent-e2e-AC5zIMUC.js} +1 -1
- package/dist/client/assets/agent-file-B4OnBR_y.js +1 -0
- package/dist/client/assets/{agent-git-CMGleuHk.js → agent-git-DAYDiQ9u.js} +1 -1
- package/dist/client/assets/{agent-hosting-Bs-VQ5Tn.js → agent-hosting-Cf3SmUBN.js} +1 -1
- package/dist/client/assets/{agent-icon-ByB43Wsk.js → agent-icon-DEBX0Uac.js} +1 -1
- package/dist/client/assets/agent-library-file-DdleqgF9.js +1 -0
- package/dist/client/assets/{agent-monitor-BU7G1axZ.js → agent-monitor-d85zzawa.js} +1 -1
- package/dist/client/assets/{agent-overview-7sMywsGa.js → agent-overview-Csd64fRN.js} +1 -1
- package/dist/client/assets/agent-settings-CplZAGJ4.js +1 -0
- package/dist/client/assets/{agent-site-editor-Dl6mOkZF.js → agent-site-editor-BcVdz-Ob.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-7lKpRg2_.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-rdCLpJuB.js → agent-site-editor-content-B5eM-F4q.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-D--whZiK.js → agent-site-editor-preview-CMLkSP5C.js} +20 -6
- package/dist/client/assets/agent-view-_FqH7P3W.js +1 -0
- package/dist/client/assets/{agent-view-guard-D33PMiXB.js → agent-view-guard-DFIgCPk2.js} +1 -1
- package/dist/client/assets/{agents-list-DIdvmd8H.js → agents-list-z4xSfcE9.js} +1 -1
- package/dist/client/assets/{ai-providers-CA1xaqJ_.js → ai-providers-DcQSO7lc.js} +1 -1
- package/dist/client/assets/{alert-DU6nnBIl.js → alert-CpXgpduJ.js} +1 -1
- package/dist/client/assets/{alert-dialog-OWb4AclI.js → alert-dialog-jSpWtFPv.js} +1 -1
- package/dist/client/assets/{api-keys-BriZrFLd.js → api-keys-DYNE9_r9.js} +1 -1
- package/dist/client/assets/api-keys-DqcXXCDi.js +1 -0
- package/dist/client/assets/app-editor-IwdF7Nlj.js +1 -0
- package/dist/client/assets/{asset-utils-C0vjSwsk.js → asset-utils-CvLbIoHR.js} +1 -1
- package/dist/client/assets/{auth-CJPyBAbS.js → auth-DekSX5bd.js} +1 -1
- package/dist/client/assets/{auth-catchall-BILSMXXP.js → auth-catchall-BsRxFmiX.js} +1 -1
- package/dist/client/assets/{auth-entry-7DJ--D3o.js → auth-entry-C-RAgds2.js} +1 -1
- package/dist/client/assets/{auth-split-layout-fmBItRen.js → auth-split-layout-CuV5bVjY.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B8kXJK6h.js → authenticate-and-persist-oauth-3J_jvNQZ.js} +1 -1
- package/dist/client/assets/{automation-list-row-BUB2WmQy.js → automation-list-row-BDwOWXYr.js} +1 -1
- package/dist/client/assets/{automation-runs-CQxYoSpJ.js → automation-runs-BXCUbDGI.js} +1 -1
- package/dist/client/assets/{automations-DxWDAERW.js → automations-BAHyqM26.js} +1 -1
- package/dist/client/assets/{autosend-CB-A5Oif.js → autosend-Cp5vfPIB.js} +1 -1
- package/dist/client/assets/{avatar-Dr6RkrBb.js → avatar-Db6Ad7E2.js} +1 -1
- package/dist/client/assets/{badge-o8ORXLbv.js → badge-cq278MQI.js} +1 -1
- package/dist/client/assets/{block-document-CWUKuN2J.js → block-document-C2UBIqOL.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-yyXFM1pu.js → blocks-preview-workspace-context-E_vt1Y-f.js} +1 -1
- package/dist/client/assets/{breadcrumb-DjBKZboG.js → breadcrumb-CHaXT_pT.js} +1 -1
- package/dist/client/assets/{buckets-D3fP10lQ.js → buckets-D5G_Ai7S.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-D6CNE90Q.js → build-improve-prompt-doc-sYHKN5HP.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DlUo9-SK.js → bulk-category-panel-D_9ku8X6.js} +1 -1
- package/dist/client/assets/{calendar-jFNLP3nP.js → calendar-DnxVN00Q.js} +1 -1
- package/dist/client/assets/{capability-load-error-3FwAUk2n.js → capability-load-error-DIrZadSW.js} +1 -1
- package/dist/client/assets/{cards-Lh-AxhUg.js → cards-BHWXUZZV.js} +1 -1
- package/dist/client/assets/category-editor-DwuLsa5M.js +1 -0
- package/dist/client/assets/{chart-C3EhY9Id.js → chart-C4HFqNub.js} +1 -1
- package/dist/client/assets/{chat-context-BmwCoPvA.js → chat-context-g3Ysek-D.js} +1 -1
- package/dist/client/assets/{chat-draft-Bpg7GYsG.js → chat-draft-DZWcf9MH.js} +1 -1
- package/dist/client/assets/{checkbox-rssR-x4C.js → checkbox-CtSIa9d0.js} +1 -1
- package/dist/client/assets/{choose-editor-BoaRUynl.js → choose-editor-DSx37Ddq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DoXjcGUB.js → cli-auth-success-CLpiF4Ff.js} +1 -1
- package/dist/client/assets/{client-icons-CsD5fxts.js → client-icons-CQ0ZvrpV.js} +1 -1
- package/dist/client/assets/{collapsible-MEYp44rr.js → collapsible-S74ix7rA.js} +1 -1
- package/dist/client/assets/{collection-detail-BTrYASGj.js → collection-detail-W3NJKwhu.js} +1 -1
- package/dist/client/assets/{collection-display-button-B9zzr0DV.js → collection-display-button-saVrgyWc.js} +1 -1
- package/dist/client/assets/{collection-search-Cp-PQjLX.js → collection-search-Cw88RONI.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BX-5C3VA.js → collection-table-wrapper-syS0MeUq.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bhq66UPx.js → collection-tabs-DjIYbOQ5.js} +1 -1
- package/dist/client/assets/{command-CuPZrFd2.js → command-Cnr_FK8b.js} +1 -1
- package/dist/client/assets/{command-palette-store-CQCOE6E9.js → command-palette-store-DQWkqX24.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-ChtNCiV-.js → commerce-onboarding-BKBw1cRC.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-JuBB0H1F.js → companion-mcps-section-QuNNjI2b.js} +1 -1
- package/dist/client/assets/{connect-AnJHgcIC.js → connect-CBV8hDBb.js} +1 -1
- package/dist/client/assets/{connect-layout-uMSVoZmd.js → connect-layout-Cj9Ty8o6.js} +1 -1
- package/dist/client/assets/{connection-_wLcpevb.js → connection-Cl0tFuDE.js} +1 -1
- package/dist/client/assets/{connection-card-BD4O904L.js → connection-card-CtC01b_S.js} +1 -1
- package/dist/client/assets/{connection-detail-Dq9rhx2O.js → connection-detail-COtd6Ff1.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CHUbN92C.js → connection-form-helpers-BGax9Typ.js} +1 -1
- package/dist/client/assets/{connections-C-e6hoJv.js → connections-Cxr9eDlU.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-AyZ1qfrO.js → create-organization-dialog-B4v62Y0V.js} +1 -1
- package/dist/client/assets/{decofile-api-f5Z3Fh46.js → decofile-api-epQGqIXQ.js} +1 -1
- package/dist/client/assets/{decopilot-DmAS8lky.js → decopilot-D-EmElSn.js} +1 -1
- package/dist/client/assets/{dialog-CDr-V9u8.js → dialog-BbF8R0Rt.js} +1 -1
- package/dist/client/assets/{discover-CRB51pJ_.js → discover-CkgfHo2F.js} +1 -1
- package/dist/client/assets/{domain-settings-gVa1mMOx.js → domain-settings-D5auGtqN.js} +1 -1
- package/dist/client/assets/{download-app-dialog-rP5j-4Hl.js → download-app-dialog-CTBm_E5V.js} +1 -1
- package/dist/client/assets/{drawer-DCRH2Qpg.js → drawer-BBk33oYJ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CvTP8MXO.js → dropdown-menu-BS01WOe-.js} +1 -1
- package/dist/client/assets/{editor-BXo85dw5.js → editor-DS43SgZS.js} +1 -1
- package/dist/client/assets/{empty-state-0Ti4PZnG.js → empty-state-BFgGw8Jd.js} +1 -1
- package/dist/client/assets/{empty-state-3JGStYdL.js → empty-state-CNNGduB2.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DfDSW6rF.js → extract-connection-data-CulqgUEu.js} +1 -1
- package/dist/client/assets/{feature-gate-_qHluhhA.js → feature-gate-Bjx-4ie7.js} +1 -1
- package/dist/client/assets/{feature-paywall-C0IUXXGE.js → feature-paywall-BFqNEmgI.js} +1 -1
- package/dist/client/assets/{file-explorer-DIqSzJnZ.js → file-explorer-DKmwRzTp.js} +1 -1
- package/dist/client/assets/{file-preview-4BjNg9D7.js → file-preview-ivFLf1WP.js} +1 -1
- package/dist/client/assets/{file-share-button-CKeISPD2.js → file-share-button-DvzGz33j.js} +1 -1
- package/dist/client/assets/{file-type-icon-B5ajUaH0.js → file-type-icon-B-E6HvV1.js} +1 -1
- package/dist/client/assets/{folder-icon-DhN6dyAf.js → folder-icon-Bjly98Qc.js} +1 -1
- package/dist/client/assets/{form-DxDjuvl5.js → form-Cq6wKFPC.js} +1 -1
- package/dist/client/assets/{gateway-client-DboI1W5S.js → gateway-client-BrWtEU1u.js} +1 -1
- package/dist/client/assets/{general-CJYuoUO5.js → general-CbF61Hyu.js} +1 -1
- package/dist/client/assets/{github-icon-D8EPSRUD.js → github-icon--lTAh1jj.js} +1 -1
- package/dist/client/assets/{home-EmaTOsm4.js → home-uOOuFeme.js} +1 -1
- package/dist/client/assets/{hooks-DWxJwjQc.js → hooks-BECLyGBb.js} +1 -1
- package/dist/client/assets/{hooks-Rl0qRFjy.js → hooks-BU6oBSHV.js} +1 -1
- package/dist/client/assets/{index-BoL7Aq4U.js → index-8f5lsphO.js} +1 -1
- package/dist/client/assets/{index-C2k5rbY0.js → index-BOZLd_mz.js} +1 -1
- package/dist/client/assets/{index-Bt0u5D-K.js → index-BSRzECMD.js} +1 -1
- package/dist/client/assets/{index-CLlne17T.js → index-C6mMoKV9.js} +2 -2
- package/dist/client/assets/{index-CGenpwLF.js → index-CAThN-6U.js} +1 -1
- package/dist/client/assets/{index-Cir1rvR_.js → index-CbsAifRT.js} +1 -1
- package/dist/client/assets/{index-BYBuvEpZ.js → index-CexxzinB.js} +1 -1
- package/dist/client/assets/{index-TJxYXD6j.js → index-D-LZ1OFU.js} +1 -1
- package/dist/client/assets/{index-Dy8qHvsj.js → index-D05N9gl5.js} +1 -1
- package/dist/client/assets/{index-Bo7i1ufS.js → index-D7nIUPsf.js} +1 -1
- package/dist/client/assets/{index-1nNyw18J.js → index-DQY7PyCl.js} +1 -1
- package/dist/client/assets/{index-Ccua9zYy.js → index-DWaEFd6i.js} +1 -1
- package/dist/client/assets/{index-Do5lCsEj.js → index-Dnovg-Ty.js} +1 -1
- package/dist/client/assets/{index-DTkDXM1A.js → index-Dq-6H-UD.js} +1 -1
- package/dist/client/assets/{index-Biw-u0ne.js → index-eO9HPkdF.js} +1 -1
- package/dist/client/assets/{index-redirect-C-LJ2IxB.js → index-redirect-BJFYUP0H.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Q0vfsI8m.js → infiniteQueryObserver-8SjYC_ek.js} +1 -1
- package/dist/client/assets/{infra-billing-C3BRkhFd.js → infra-billing-DfO1Oemo.js} +1 -1
- package/dist/client/assets/{input-CP_e0ZMg.js → input-CZquufhh.js} +1 -1
- package/dist/client/assets/{input-DaHZvHYb.js → input-Dm5tdFv-.js} +1 -1
- package/dist/client/assets/{input-dbYO6Ois.js → input-LjvMOQDt.js} +1 -1
- package/dist/client/assets/{integration-icon-Bd7DOoer.js → integration-icon-Xt_LxCp3.js} +1 -1
- package/dist/client/assets/{label-Lvgg69zF.js → label-BdNnPzHo.js} +1 -1
- package/dist/client/assets/{last-preview-page-Dmtdjb2d.js → last-preview-page-BZLtgGkm.js} +1 -1
- package/dist/client/assets/{layout-C0CNJ4xY.js → layout-B1u4t30k.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CfMH707B.js → legacy-agents-deep-H0Rp20sO.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BsB8qBiK.js → legacy-main-redirect-DIKp0kQl.js} +1 -1
- package/dist/client/assets/{library-CMXpCscl.js → library-Dh6WH95I.js} +1 -1
- package/dist/client/assets/{login-BGgwQ8Ty.js → login-hW6Rr0Lp.js} +1 -1
- package/dist/client/assets/{markdown-B0HtiDwM.js → markdown-COVWapDi.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-qnfatYvU.js → mcp-app-renderer-CI5q52w8.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BKPj-D9q.js → mcp-oauth-DZAKWi1a.js} +1 -1
- package/dist/client/assets/{members-DEVgt_I_.js → members-BgKBsFZn.js} +1 -1
- package/dist/client/assets/{message-templates-Db9KMnea.js → message-templates-DniWMJBm.js} +1 -1
- package/dist/client/assets/{mini-report-page-BiDLml8V.js → mini-report-page-DsuczQQS.js} +1 -1
- package/dist/client/assets/{mock-board-DE899Anf.js → mock-board-C8czbdf7.js} +3 -3
- package/dist/client/assets/{monaco-editor-DI4bGJ1L.js → monaco-editor-BoDXf1bj.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C-A-ogsB.js → monitoring-stats-row-ChtEPHtm.js} +1 -1
- package/dist/client/assets/{multi-select-D7KHOgJh.js → multi-select-D7hN0Qm5.js} +1 -1
- package/dist/client/assets/{mustache-D0PR-jG1.js → mustache-DX19G3kt.js} +1 -1
- package/dist/client/assets/{oauth-callback-BU4_oSma.js → oauth-callback-BZE2EwPT.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DTD6AsuQ.js → oauth-callback-ai-provider-sipE83AE.js} +1 -1
- package/dist/client/assets/{onboarding-hmcqGfvZ.js → onboarding-CiPKh68r.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CwCqyNNZ.js → optimistic-project-sidebar-views-ZTcPooMv.js} +1 -1
- package/dist/client/assets/{organization-choice-Dmu0-74y.js → organization-choice-D-oi84RO.js} +1 -1
- package/dist/client/assets/{orgs-DrLboKbj.js → orgs-DRAiPJB7.js} +1 -1
- package/dist/client/assets/{page-seo-form-CPacwdAv.js → page-seo-form-BuUhQyS6.js} +1 -1
- package/dist/client/assets/{pair-CEyOVwXU.js → pair-BSoDGPcF.js} +1 -1
- package/dist/client/assets/{plan-ladder-D0ghMEom.js → plan-ladder-BasR5sqC.js} +1 -1
- package/dist/client/assets/{popover-CvNYvXj5.js → popover-DsPp8JNb.js} +1 -1
- package/dist/client/assets/{post-calendar-12hOW48s.js → post-calendar-DYJg8aHS.js} +1 -1
- package/dist/client/assets/{post-editor-Bx6vNsJq.js → post-editor-uz9JDFPY.js} +1 -1
- package/dist/client/assets/{preview-content-DSrgT3Dg.js → preview-content-WSVxEL_f.js} +1 -1
- package/dist/client/assets/{preview-dialog-BigpJ-wP.js → preview-dialog-C7MVz9-R.js} +1 -1
- package/dist/client/assets/{primitives-CYYl5pry.js → primitives-7kD9L60b.js} +1 -1
- package/dist/client/assets/{profile-DSIrGgr7.js → profile-BXsHvHMb.js} +1 -1
- package/dist/client/assets/{project-app-view-CxnHBgZr.js → project-app-view-CjrslCgD.js} +1 -1
- package/dist/client/assets/{project-feed-DYdRscqS.js → project-feed-C4HxbzNr.js} +1 -1
- package/dist/client/assets/{project-icon-W8WrTXup.js → project-icon-DZXi7sAH.js} +1 -1
- package/dist/client/assets/project-reports-CNKYAaup.js +1 -0
- package/dist/client/assets/project-tasks-CMDg0YDK.js +1 -0
- package/dist/client/assets/{prompts-Dxmn6DzV.js → prompts-BoViURa3.js} +1 -1
- package/dist/client/assets/record-editor-D8q1_FVg.js +1 -0
- package/dist/client/assets/{redirect-editor-BicSD98z.js → redirect-editor-urSJYZih.js} +1 -1
- package/dist/client/assets/registry-CfKndDp8.js +2 -0
- package/dist/client/assets/{registry-layout-SAOVarb5.js → registry-layout-DnAQGV3j.js} +1 -1
- package/dist/client/assets/reports-BQYFQSFf.js +1 -0
- package/dist/client/assets/{reports-vY0C9O6P.js → reports-ILQ519eV.js} +1 -1
- package/dist/client/assets/{reports-tab-L9i_aDYL.js → reports-tab-BHiPO-Yt.js} +2 -2
- package/dist/client/assets/{repositories-CfMNwm6d.js → repositories-BQcksodE.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Dj8ScZou.js → repository-import-picker-DysBPsrE.js} +1 -1
- package/dist/client/assets/{repository-picker-Bu500wwQ.js → repository-picker-DJL8W4-t.js} +1 -1
- package/dist/client/assets/{require-capability-w06E-xRt.js → require-capability-B2v3wdWj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CClBZN5w.js → required-auth-layout-CIegJY7n.js} +1 -1
- package/dist/client/assets/{reset-password-D5reLCMr.js → reset-password-Cv_pw9qG.js} +1 -1
- package/dist/client/assets/{resizable-BEe23Qjj.js → resizable-DrI2TVoh.js} +1 -1
- package/dist/client/assets/{review-settings-Bzb1wEUt.js → review-settings-DsMk5rhJ.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-D9zHtwKH.js → rich-text-link-control-Bh8SMhbX.js} +1 -1
- package/dist/client/assets/{roles-BYxRS6nZ.js → roles-BaQnKFl-.js} +1 -1
- package/dist/client/assets/{route-Fz81W799.js → route-B51TExGQ.js} +1 -1
- package/dist/client/assets/{route-C0b8KT9l.js → route-CDvOzABP.js} +1 -1
- package/dist/client/assets/{route-Bli9iRli.js → route-CV4jYjd5.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-Cf0uletx.js → runnable-block-editor-Bd1lE8Yl.js} +3 -3
- package/dist/client/assets/{sandbox-lifecycle-context-D2W8d_qX.js → sandbox-lifecycle-context-D0cxi8em.js} +1 -1
- package/dist/client/assets/{schema-Brgh1n5m.js → schema-WP2X1X1Z.js} +1 -1
- package/dist/client/assets/{scroll-area-zDkh0OU8.js → scroll-area-B5uAtJE9.js} +1 -1
- package/dist/client/assets/{search-input-CLI3bW2v.js → search-input-vrIAmgoh.js} +1 -1
- package/dist/client/assets/{secrets-BhfHpWkv.js → secrets-CDE7HDDb.js} +1 -1
- package/dist/client/assets/{sections-editor-BwtdYc1z.js → sections-editor-rEdLlc_u.js} +1 -1
- package/dist/client/assets/{select-dS1ZvUUC.js → select-DPtaqnbY.js} +1 -1
- package/dist/client/assets/{select-model-B-XEXZYZ.js → select-model-GkNjuCgL.js} +1 -1
- package/dist/client/assets/{seo-editor-BOejkPTg.js → seo-editor-BySdX6vM.js} +1 -1
- package/dist/client/assets/{settings-tab-0wITPKID.js → settings-tab-DWyBmp9C.js} +1 -1
- package/dist/client/assets/{sheet-D8oc8gwN.js → sheet-7dqWERZ-.js} +1 -1
- package/dist/client/assets/{shell-layout-ZE4ZeZq_.js → shell-layout-DlWVwnY3.js} +1 -1
- package/dist/client/assets/{sidebar-DulDmOuQ.js → sidebar-CSLIo5wG.js} +1 -1
- package/dist/client/assets/{skill-preview-C43g2jxT.js → skill-preview-CLQ6hpRU.js} +1 -1
- package/dist/client/assets/{skills-Du2wIHgh.js → skills-B0DlqgoY.js} +1 -1
- package/dist/client/assets/{sso-Cw7-rQ6R.js → sso-Dv7aOBLL.js} +1 -1
- package/dist/client/assets/{store-D_25PptJ.js → store-Sh4jPZ0Y.js} +1 -1
- package/dist/client/assets/store-registry-pejOBHcx.js +2 -0
- package/dist/client/assets/{switch-BJDpH17-.js → switch-CEhYE68G.js} +1 -1
- package/dist/client/assets/{synced-repos-f5wwGE-G.js → synced-repos-_Nkfv1T8.js} +1 -1
- package/dist/client/assets/{table-CzYba_wo.js → table-D5pPenOV.js} +1 -1
- package/dist/client/assets/{tabs-BH0t-Qit.js → tabs-C7ptBuB8.js} +1 -1
- package/dist/client/assets/{task-board-DlaQdjME.js → task-board-D_f-LuAE.js} +1 -1
- package/dist/client/assets/{task-route-BLgjDNsc.js → task-route-DyX9s2aH.js} +1 -1
- package/dist/client/assets/{task-status-B6cn6__r.js → task-status-DAaJYuJC.js} +1 -1
- package/dist/client/assets/{tasks-DyFKgkmx.js → tasks-BYBzCFtN.js} +1 -1
- package/dist/client/assets/tasks-Dsb1PXv5.js +1 -0
- package/dist/client/assets/{textarea-BztNtiTQ.js → textarea-BPcKOU7a.js} +1 -1
- package/dist/client/assets/{thread-intent-DzYbKhDO.js → thread-intent-CqreAI8n.js} +1 -1
- package/dist/client/assets/{thread-route-CTWLcToH.js → thread-route-DNVTuSKD.js} +1 -1
- package/dist/client/assets/{thread-route-CHuHE7Ay.js → thread-route-DxXQ46K1.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-HNIw97fV.js → thread-sheet-body-B21HbiTN.js} +1 -1
- package/dist/client/assets/{toggle-group-DHEZ824d.js → toggle-group-_I41ei63.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-SyfxXpxQ.js → toolbar-icon-button-BhlTbEE9.js} +1 -1
- package/dist/client/assets/{tooltip-Cg0iEw6_.js → tooltip-CYhjJgVA.js} +1 -1
- package/dist/client/assets/{track-CiOLlkxc.js → track-CWiVykNy.js} +1 -1
- package/dist/client/assets/{types-BQ0XHiBr.js → types-Bgn578U0.js} +1 -1
- package/dist/client/assets/{usage-stats-BHRSI5Ar.js → usage-stats-lU60GCl7.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DXXr4ex9.js → use-ai-providers-Cotfg7SS.js} +1 -1
- package/dist/client/assets/{use-automations-CtSWH9Gm.js → use-automations-BWbEauvr.js} +1 -1
- package/dist/client/assets/{use-autosave-CLkEbl1C.js → use-autosave-DWTyxx6Q.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-DSqBK8vF.js → use-commerce-diagnostic-ByTG1aVP.js} +1 -1
- package/dist/client/assets/{use-connect-companion-D42lIu9-.js → use-connect-companion-C5E889gV.js} +1 -1
- package/dist/client/assets/{use-connection-DnMnsTE-.js → use-connection-TGwBsBZ6.js} +1 -1
- package/dist/client/assets/{use-copy-ya7aFfBC.js → use-copy-D7Iw1LrJ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DEQ3sE6r.js → use-create-virtual-mcp-DmXpf3QG.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-m9kXRT36.js → use-date-fns-locale-rgfXEg1T.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BWXcEqzZ.js → use-debounced-autosave-BZKMq5sx.js} +1 -1
- package/dist/client/assets/{use-debounced-value-FVaTkLaF.js → use-debounced-value-DGsEitJX.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DWdd9zLS.js → use-deco-credits-zGfUt8ra.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BCNV6ibO.js → use-decopilot-events-QHgLexrJ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-YAR5H2YF.js → use-delete-connection-D4tGHNgD.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-B_U4o3d8.js → use-deployment-admin-C8IvUlh8.js} +1 -1
- package/dist/client/assets/{use-entitlements-CVFQAC4Y.js → use-entitlements-B4c1c87k.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-BNr78t_k.js → use-fast-preview-draft-url-eUMqGqhz.js} +1 -1
- package/dist/client/assets/{use-file-configs-CL8MhWZX.js → use-file-configs-5YZVd1Le.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BE00Qe2y.js → use-infinite-scroll-BcvDIGP6.js} +1 -1
- package/dist/client/assets/{use-join-requests-BfYhVugX.js → use-join-requests-BkX600q-.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-jGwhFlPh.js → use-main-panel-tabs-BHJmXQos.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dGV2RcmM.js → use-mcp-auth-status-CDs5_VuQ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B-bmV-eU.js → use-mcp-client-B8avk6p1.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DwCio0Xs.js → use-mcp-prompts-C35IeKKU.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CaJdkF9p.js → use-mcp-tools-BX_9PtQS.js} +1 -1
- package/dist/client/assets/{use-members-Dy9zZpXX.js → use-members-DpENbm_3.js} +1 -1
- package/dist/client/assets/{use-mobile-DmHecFjh.js → use-mobile-RHIQOVil.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DE31VYsQ.js → use-navigate-to-agent-BsGybLOl.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BHFODZxq.js → use-open-billing-url-V4LAVsZZ.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DuCptBd8.js → use-org-auth-client-WNBip5me.js} +1 -1
- package/dist/client/assets/{use-org-fs-aqzk40Pl.js → use-org-fs-Dvfg7DBA.js} +1 -1
- package/dist/client/assets/{use-org-notice-CPsPmLRD.js → use-org-notice-BDJtNsoi.js} +1 -1
- package/dist/client/assets/{use-org-sso-D8APIoa8.js → use-org-sso-B_DIN1FR.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CNPGuhUA.js → use-organization-roles-C44BiWk2.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CKJ6hB3u.js → use-organization-settings-D0M2z89A.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-D0KroJxZ.js → use-panel-navigate-VJU3jAVP.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-SUH-E6N_.js → use-project-native-view-presence-DsW3Hqqc.js} +1 -1
- package/dist/client/assets/{use-project-scope-BzLiG5Sw.js → use-project-scope-BCYsjRUp.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Byi4BCrC.js → use-registry-connections-C1VQdjvR.js} +1 -1
- package/dist/client/assets/{use-releases-DZzTh-C4.js → use-releases-BRVhx5jV.js} +1 -1
- package/dist/client/assets/{use-route-default-main-L5fisYjs.js → use-route-default-main-D5obmIIM.js} +1 -1
- package/dist/client/assets/{use-secrets-BAMuePEI.js → use-secrets-CmMeSYxT.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BOQVHncG.js → use-section-preview-base-DxAPy40-.js} +1 -1
- package/dist/client/assets/{use-session-runtime-DXY6Lube.js → use-session-runtime-Dl206Bga.js} +1 -1
- package/dist/client/assets/{use-tags-B7zGz5EU.js → use-tags-Bx2BF4Ke.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CVUabh4r.js → use-task-metadata-2SHzp2HZ.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-3ycn6tX8.js → use-thread-outputs-TjNPQ11p.js} +1 -1
- package/dist/client/assets/{use-view-mode-CcO0vm3d.js → use-view-mode-CxLDv3cx.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-oRiYDLbO.js → use-virtual-mcp-2feYNqBo.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Br9KmFLf.js +1 -0
- package/dist/client/assets/{useQueries-DETG9PJR.js → useQueries-Bq52TmOw.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-zJ2PG_QY.js +1 -0
- package/dist/client/assets/{users-CMAbB3Qz.js → users-Cmnw5TH5.js} +1 -1
- package/dist/client/assets/{utils-DuFbetE2.js → utils-DUD_ZrVn.js} +1 -1
- package/dist/client/assets/{variant-calendar-CknIseH6.js → variant-calendar-BcGUj9x1.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-JFVRJ7oL.js → variant-matcher-override-CMpCnI5C.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B2YdDaMp.js → view-mode-toggle-C5wJufOT.js} +1 -1
- package/dist/client/assets/{virtual-mcp-C4_P0xXR.js → virtual-mcp-DCGU1nRB.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/agent-app-DGCD93Vx.js +0 -1
- package/dist/client/assets/agent-deck-CyvSbus-.js +0 -1
- package/dist/client/assets/agent-file-CXkQKVDt.js +0 -1
- package/dist/client/assets/agent-library-file-DW8DzCgD.js +0 -1
- package/dist/client/assets/agent-settings-mefV_YtU.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DD5tKDCm.js +0 -2
- package/dist/client/assets/agent-view-ebzx1vyF.js +0 -1
- package/dist/client/assets/api-keys-DhuHR0tx.js +0 -1
- package/dist/client/assets/app-editor-CaGUmHu7.js +0 -1
- package/dist/client/assets/category-editor-DJs_8pc1.js +0 -1
- package/dist/client/assets/project-reports-CVNdDbXr.js +0 -1
- package/dist/client/assets/project-tasks-De-26kaC.js +0 -1
- package/dist/client/assets/record-editor-b-fde42v.js +0 -1
- package/dist/client/assets/registry-BN9FgxEJ.js +0 -2
- package/dist/client/assets/reports-CI88jReb.js +0 -1
- package/dist/client/assets/store-registry-DTZL5u8o.js +0 -2
- package/dist/client/assets/tasks-wsieNYYy.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BquFrdik.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-430FeaXt.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ue,b as pe,j as o,a5 as Ae,B as le,eD as Te,M as ge,W as Le,a as we,n as Se,r as O,d8 as Ee,m as Fe,K as je,e as ke,o as U,t as fe,l as Pe,x as Ge,ao as Me,P as de}from"./index-CLlne17T.js";import{a as ce,b as _e,D as he,c as xe}from"./dropdown-menu-CvTP8MXO.js";import{i as Oe}from"./GitBranch01-CI-WDVa2.js";import{b as Re}from"./Users03-DL_upBh-.js";import{b as ze,c as Ue,g as $e}from"./use-virtual-mcp-oRiYDLbO.js";import{i as Be}from"./DotsVertical-BFzwtdUn.js";import{a as Ve}from"./Settings02-CqMjj8Oq.js";import{s as He}from"./Trash01-Dp2yrMxt.js";import{A as Ke,bc as Qe}from"./agent-icon-ByB43Wsk.js";import{u as qe,f as Ce}from"./use-date-fns-locale-m9kXRT36.js";import{u as ve}from"./use-navigate-to-agent-DE31VYsQ.js";import{n as Ye}from"./use-organization-settings-CKJ6hB3u.js";import{E as We}from"./empty-state-3JGStYdL.js";import{u as Je}from"./use-create-virtual-mcp-DEQ3sE6r.js";import{b as Xe,u as Ze}from"./use-connection-DnMnsTE-.js";import{u as be}from"./use-mcp-client-B-bmV-eU.js";import{a as et}from"./authenticate-and-persist-oauth-B8kXJK6h.js";import{c as tt}from"./use-mcp-tools-CaJdkF9p.js";import{e as ot}from"./extract-connection-data-DfDSW6rF.js";import{f as st,g as rt}from"./thread-intent-DzYbKhDO.js";import{a as it}from"./github-repo-scope-C8GSbvaz.js";import{f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-CDr-V9u8.js";import{i as ft}from"./ArrowLeft-DDPJQXhG.js";import{C as ht}from"./collection-search-Cp-PQjLX.js";import{G as xt}from"./github-icon-D8EPSRUD.js";import{A as bt,a as jt,b as Ct,c as Dt,g as yt,d as wt,e as St,f as _t}from"./alert-dialog-OWb4AclI.js";import{S as vt}from"./search-input-CLI3bW2v.js";import{s as De}from"./Plus-BiYlKLxl.js";import{R as Nt}from"./repository-import-picker-Dj8ScZou.js";import{u as It}from"./use-debounced-value-FVaTkLaF.js";import"./Check-B2FZLF1O.js";import"./ChevronRight-byX-3L9r.js";import"./AlertCircle-lddbBWh0.js";import"./Tool01-0YKAjW__.js";import"./ArrowUp-BlHEAyyd.js";import"./Tool02-Bco71KeO.js";import"./ArrowRight-Cm4rUCam.js";import"./TrendUp01-D1K9L0xP.js";import"./ZoomOut-BlidBzgG.js";import"./CheckCircle-2GspG_XT.js";import"./ChevronUp-DgIot4i7.js";import"./UserSquare-XPgiOUWe.js";import"./Copy01-DN3tqM8L.js";import"./CreditCard01-wo9mx3CN.js";import"./Database01-BsiMLwmb.js";import"./MessageCircle01-BMp3tiX2.js";import"./Download01-DzANKKkw.js";import"./Printer-CSBhu2Re.js";import"./Eye-DFJEK6aw.js";import"./File02-BE1-Eszh.js";import"./Share07-DH92YWbU.js";import"./Globe01-BkG0TYp3.js";import"./SwitchHorizontal01-BT-naaH0.js";import"./HardDrive-DuIbEWGl.js";import"./Image01-CUco8f4C.js";import"./Key01-Ctr214Q3.js";import"./Link01-CyA36bfv.js";import"./LinkExternal01-EKFZjMJY.js";import"./Monitor01-C8W3wbFB.js";import"./Sun-sJn8WeT-.js";import"./Package-CpB6vYlT.js";import"./Palette-CBU77GJ1.js";import"./Play-Uhe4ebTG.js";import"./SearchLg-CN4JJES9.js";import"./SearchMd-C6NFUW36.js";import"./Shield01-Cm4rFm8N.js";import"./Stars01-BxBiTUsk.js";import"./Upload01-BUf7qRrI.js";import"./User01-Da1WckIS.js";import"./Users01-BsVs6-8w.js";import"./XCircle-DReUcNBS.js";import"./XClose-DYRx__Hg.js";import"./X-D6lVPJzO.js";import"./Zap-CCglgveU.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-Rl0qRFjy.js";import"./backoff-8mStPHYB.js";import"./task-board-DlaQdjME.js";import"./schema-Brgh1n5m.js";import"./github-repo-BknN0SVI.js";import"./auth-CJPyBAbS.js";import"./mcp-oauth-BKPj-D9q.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-_wLcpevb.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-Bu500wwQ.js";import"./tooltip-Cg0iEw6_.js";import"./index-CGenpwLF.js";import"./input-CP_e0ZMg.js";import"./label-Lvgg69zF.js";import"./useInfiniteQuery-BquFrdik.js";import"./infiniteQueryObserver-Q0vfsI8m.js";import"./avatar-Dr6RkrBb.js";function ye(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:h,align:p,side:y,showBetaBadge:m,showDecoImport:b}=t,j=p===void 0?"end":p,u=pe();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Re,{size:14}),e[0]=g):g=e[0];let f;e[1]!==u?(f=u("common.createAgentDropdown.createFromScratch"),e[1]=u,e[2]=f):f=e[2];let x;e[3]!==h||e[4]!==s||e[5]!==f?(x=o.jsxs(ce,{disabled:h,onClick:s,children:[g,f]}),e[3]=h,e[4]=s,e[5]=f,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Oe,{className:"size-3.5"}),e[7]=C):C=e[7];let c;e[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),e[8]=u,e[9]=c):c=e[9];let l;e[10]!==m?(l=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=l):l=e[11];let a;e[12]!==r||e[13]!==c||e[14]!==l?(a=o.jsxs(ce,{onClick:r,children:[C,c,l]}),e[12]=r,e[13]=c,e[14]=l,e[15]=a):a=e[15];let d;e[16]!==n||e[17]!==b||e[18]!==u?(d=b&&o.jsxs(ce,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=b,e[18]=u,e[19]=d):d=e[19];let D;return e[20]!==j||e[21]!==y||e[22]!==x||e[23]!==a||e[24]!==d?(D=o.jsxs(_e,{side:y,align:j,className:"w-48",children:[x,a,d]}),e[20]=j,e[21]=y,e[22]=x,e[23]=a,e[24]=d,e[25]=D):D=e[25],D}function At(t){const e=ue.c(50),{project:s,lastUsedAt:r,onDeleteClick:n}=t,h=ve(),p=pe(),y=qe(),m=s.metadata?.ui?.layout;let b;e[0]!==m?(b=Ae(m),e[0]=m,e[1]=b):b=e[1];const j=b;let u;e[2]!==j||e[3]!==h||e[4]!==s.id?(u=()=>h(s.id,{panel:j}),e[2]=j,e[3]=h,e[4]=s.id,e[5]=u):u=e[5];let g;e[6]!==s.title||e[7]!==u?(g=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),e[6]=s.title,e[7]=u,e[8]=g):g=e[8];let f;e[9]!==s.icon||e[10]!==s.title?(f=o.jsx(Ke,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[9]=s.icon,e[10]=s.title,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(he,{asChild:!0,children:o.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Be,{size:20})})}),e[12]=x):x=e[12];let C;e[13]!==h||e[14]!==s.id?(C=()=>h(s.id,{panel:"settings"}),e[13]=h,e[14]=s.id,e[15]=C):C=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ve,{size:16}),e[16]=c):c=e[16];let l;e[17]!==C?(l=o.jsxs(ce,{onClick:C,children:[c,"Settings"]}),e[17]=C,e[18]=l):l=e[18];let a;e[19]!==n?(a=n&&o.jsxs(ce,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[19]=n,e[20]=a):a=e[20];let d;e[21]!==a||e[22]!==l?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(xe,{children:[x,o.jsxs(_e,{align:"end",children:[l,a]})]})}),e[21]=a,e[22]=l,e[23]=d):d=e[23];let D;e[24]!==d||e[25]!==f?(D=o.jsxs("div",{className:"flex items-start justify-between",children:[f,d]}),e[24]=d,e[25]=f,e[26]=D):D=e[26];let w;e[27]!==s.title?(w=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[27]=s.title,e[28]=w):w=e[28];const K=s.description||"No description";let S;e[29]!==K?(S=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:K}),e[29]=K,e[30]=S):S=e[30];let G;e[31]!==w||e[32]!==S?(G=o.jsxs("div",{className:"flex flex-col gap-1",children:[w,S]}),e[31]=w,e[32]=S,e[33]=G):G=e[33];let N;e[34]!==D||e[35]!==G?(N=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[D,G]}),e[34]=D,e[35]=G,e[36]=N):N=e[36];let T;e[37]!==r||e[38]!==y||e[39]!==s.updated_at||e[40]!==p?(T=r?p("home.projectCard.lastUsed",{time:Ce(new Date(r),{addSuffix:!0,locale:y})}):p("home.projectCard.updated",{time:Ce(new Date(s.updated_at),{addSuffix:!0,locale:y})}),e[37]=r,e[38]=y,e[39]=s.updated_at,e[40]=p,e[41]=T):T=e[41];let L;e[42]!==T?(L=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[42]=T,e[43]=L):L=e[43];let I;e[44]!==N||e[45]!==L?(I=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[N,L]}),e[44]=N,e[45]=L,e[46]=I):I=e[46];let _;return e[47]!==I||e[48]!==g?(_=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[g,I]}),e[47]=I,e[48]=g,e[49]=_):_=e[49],_}function Tt(t,e){const s=ue.c(12),{org:r}=ge();let n;s[0]!==r.id?(n=Le.REGISTRY(r.id),s[0]=r.id,s[1]=n):n=s[1];const h=n;let p;s[2]!==r.id||s[3]!==r.slug||s[4]!==h?(p={connectionId:h,orgId:r.id,orgSlug:r.slug},s[2]=r.id,s[3]=r.slug,s[4]=h,s[5]=p):p=s[5];const y=be(p);let m;s[6]!==t?(m={name:t},s[6]=t,s[7]=m):m=s[7];const b=e?.enabled??!0;let j;return s[8]!==y||s[9]!==m||s[10]!==b?(j={client:y,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:b,staleTime:3e5,select:Lt},s[8]=y,s[9]=m,s[10]=b,s[11]=j):j=s[11],tt(j)}function Lt(t){return t.structuredContent?.item??null}const Et="deco/mcp-github";function Ft(t){const{org:e}=ge(),{data:s}=we.useSession(),r=Xe(),n=Se(),[h,p]=O.useState("idle"),[y,m]=O.useState(null),[b,j]=O.useState(null),{data:u,isLoading:g}=Tt(Et,{enabled:t.enabled}),f=O.useRef(!1);t.enabled&&u&&!g&&!f.current&&s?.user?.id&&h==="idle"&&(f.current=!0,x());async function x(){if(!(!u||!s?.user?.id||!e))try{p("installing"),m(null);const c=ot(u,e.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:a}=await r.create.mutateAsync(c);p("authenticating");const d=await et({connectionId:a,orgId:e.id,orgSlug:e.slug,persistFallback:D=>r.update.mutateAsync({id:a,data:{connection_token:D}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(a)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(n,e.id),j(c),p("ready")}catch(c){m(c instanceof Error?c.message:String(c)),p("error")}}function C(){p("idle"),m(null),j(null),f.current=!1}return t.enabled&&g&&h==="idle"?{status:"installing",error:null,connection:null,retry:C}:{status:h,error:y,connection:b,retry:C}}const kt="deco-sites";function Pt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,r=e.repo;return typeof s!="string"||typeof r!="string"||s.length===0||r.length===0?null:{owner:s,repo:r}}function Gt(t,e){const s=e?Pt(e):null,r=s?.owner??kt,n=s?.repo??t;return{owner:r,name:n,url:`https://github.com/${r}/${n}`}}function Mt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Ot(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Rt({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),h=ve(),p=Se(),{data:y}=we.useSession(),[m,b]=O.useState(null),[j,u]=O.useState(null),[g,f]=O.useState(""),x=be({connectionId:Ge,orgId:n.id,orgSlug:n.slug}),C=Ze({slug:"mcp-github"}),c=it(C),l=Ft({enabled:t&&c.length===0}),a=c.length===1?c[0]??null:j,d=c.length>1&&!a,D=be({connectionId:a?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:K,isLoading:S,error:G}=Fe({queryKey:je.decoSites(y?.user?.email),queryFn:()=>Ot(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),N=K?.sites??[],T=i=>{i||(b(null),u(null),f("")),e(i)},L=N.filter(i=>i.name.toLowerCase().includes(g.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(g.toLowerCase())??!1)),I=!m||L.some(i=>i.name===m),_=ke({mutationFn:async i=>{if(!a)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));U("deco_site_import_started",{site_name:i});const{installations:P}=await nt(k=>x.callTool(k),a.id),E=N.find(k=>k.name===i);if(!E)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Gt(i,E.metadata),F=lt(P,v.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:at}));let R=null,Q=null;const ae=async()=>{Q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:Q}}).catch(()=>{}),R&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:z,reused:H}=await ct({orgSlug:n.slug,sourceConnection:a,installationId:F.installationId,owner:v.owner,repo:v.name,githubCallTool:q=>D.callTool(q),selfCallTool:q=>x.callTool(q)});R=H?null:z;const $=k.icon??null,Y=Mt(i),W=i.toLowerCase(),B=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:$??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:B,productionUrl:B,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:F.installationId,connectionId:z},ui:{banner:null,bannerColor:"#22C55E",icon:$,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:z}]}}}),M=V.structuredContent??V;if(!M.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return Q=M.item.id,{slug:Y,virtualMcpId:M.item.id,item:M.item}}catch(k){throw await ae(),k}},onSuccess:({slug:i,virtualMcpId:P,item:E})=>{U("deco_site_import_succeeded",{site_name:E.title,virtual_mcp_id:P,slug:i}),p.setQueryData(je.collectionItem(x,n.id,"","VIRTUAL_MCP",P),{item:E}),p.invalidateQueries({predicate:v=>{const F=v.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),fe.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),T(!1),h(P)},onError:i=>{U("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),fe.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:T,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.importFromDecoDialog.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:g,onChange:f,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&f("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(le,{variant:"outline",size:"sm",onClick:l.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!w&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),c.map(i=>o.jsxs("button",{type:"button",onClick:()=>u(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(xt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),S&&!w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!S&&!w&&!d&&l.status!=="error"&&!G&&N.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!S&&!w&&!d&&l.status!=="error"&&N.length>0&&o.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:[L.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:g})}),L.map(i=>{const P=rt(i.domains),E=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>b(i.name),className:Pe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",E?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),P&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(le,{variant:"outline",onClick:()=>T(!1),disabled:_.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(le,{disabled:!m||!I||_.isPending||S||w||d||!a||l.status==="error",onClick:()=>m&&_.mutate(m),children:_.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function As(){const t=ue.c(82),e=pe(),{org:s}=ge(),[r,n]=O.useState(""),h=It(r,300);let p;t[0]!==h?(p={searchTerm:h},t[0]=h,t[1]=p):p=t[1];const y=ze(p),m=Ue();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={navigateOnCreate:!0},t[2]=b):b=t[2];const{createVirtualMCP:j,isCreating:u}=Je(b),[g,f]=O.useState(null),[x,C]=O.useState(!1),[c,l]=O.useState(!1),{granted:a}=Me("agents:manage"),d=Ye();let D;t[3]!==s?(D=A=>A.id!==s.id,t[3]=s,t[4]=D):D=t[4];const w=y.filter(D),{data:K}=$e(w.map(zt));let S;t[5]!==m||t[6]!==g||t[7]!==e?(S=async()=>{if(!g)return;const{id:A,title:Ie}=g;f(null);try{await m.delete.mutateAsync(A),U("agent_deleted",{agent_id:A,source:"agents_list"}),fe.success(e("routes.agentsList.deletedAgent",{title:Ie}))}catch{}},t[5]=m,t[6]=g,t[7]=e,t[8]=S):S=t[8];const G=S,N=de,T=de,L=de;let I;t[9]!==e?(I=e("routes.agentsList.title"),t[9]=e,t[10]=I):I=t[10];let _;t[11]!==I?(_=o.jsx(de.Title,{children:I}),t[11]=I,t[12]=_):_=t[12];let i;t[13]!==e?(i=e("routes.agentsList.searchPlaceholder"),t[13]=e,t[14]=i):i=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=A=>{A.key==="Escape"&&(n(""),A.target.blur())},t[15]=P):P=t[15];let E;t[16]!==r||t[17]!==i?(E=o.jsx(vt,{value:r,onChange:n,placeholder:i,className:"w-full md:w-[375px]",onKeyDown:P}),t[16]=r,t[17]=i,t[18]=E):E=t[18];let v;t[19]!==a||t[20]!==j||t[21]!==u||t[22]!==d||t[23]!==e?(v=a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list",method:"deco"}),C(!0)},isCreating:u,align:"end",showDecoImport:d})]}),t[19]=a,t[20]=j,t[21]=u,t[22]=d,t[23]=e,t[24]=v):v=t[24];let F;t[25]!==E||t[26]!==v?(F=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,v]}),t[25]=E,t[26]=v,t[27]=F):F=t[27];let R;t[28]!==F||t[29]!==_?(R=o.jsxs("div",{className:"flex flex-col gap-6",children:[_,F]}),t[28]=F,t[29]=_,t[30]=R):R=t[30];const Q=w.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(We,{image:o.jsx(Qe,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!r&&a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),C(!0)},isCreating:u,align:"center",showBetaBadge:!0,showDecoImport:d})]})})}),ae=w.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:w.map(A=>o.jsx(At,{project:A,lastUsedAt:K?.get(A.id)?.last_used_at,onDeleteClick:a?()=>f({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[31]!==R||t[32]!==Q||t[33]!==ae||t[34]!==L.Container?(k=o.jsxs(L.Container,{children:[R,Q,ae]}),t[31]=R,t[32]=Q,t[33]=ae,t[34]=L.Container,t[35]=k):k=t[35];let z;t[36]!==k||t[37]!==T.Content?(z=o.jsx(T.Content,{children:k}),t[36]=k,t[37]=T.Content,t[38]=z):z=t[38];let H;t[39]!==c?(H=o.jsx(Nt,{open:c,onOpenChange:l}),t[39]=c,t[40]=H):H=t[40];let $;t[41]!==x?($=o.jsx(Rt,{open:x,onOpenChange:C}),t[41]=x,t[42]=$):$=t[42];const Y=!!g;let W;t[43]===Symbol.for("react.memo_cache_sentinel")?(W=A=>!A&&f(null),t[43]=W):W=t[43];let B;t[44]!==e?(B=e("routes.agentsList.deleteAgentTitle"),t[44]=e,t[45]=B):B=t[45];let V;t[46]!==B?(V=o.jsx(bt,{children:B}),t[46]=B,t[47]=V):V=t[47];let M;t[48]!==e?(M=e("routes.agentsList.deleteAgentDescription"),t[48]=e,t[49]=M):M=t[49];const q=g?.title;let J;t[50]!==q?(J=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[50]=q,t[51]=J):J=t[51];let X;t[52]!==M||t[53]!==J?(X=o.jsxs(jt,{children:[M," ",J,"."]}),t[52]=M,t[53]=J,t[54]=X):X=t[54];let Z;t[55]!==V||t[56]!==X?(Z=o.jsxs(Ct,{children:[V,X]}),t[55]=V,t[56]=X,t[57]=Z):Z=t[57];let ee;t[58]!==e?(ee=e("routes.agentsList.cancelButton"),t[58]=e,t[59]=ee):ee=t[59];let te;t[60]!==ee?(te=o.jsx(Dt,{children:ee}),t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==e?(oe=e("routes.agentsList.deleteButton"),t[62]=e,t[63]=oe):oe=t[63];let se;t[64]!==G||t[65]!==oe?(se=o.jsx(yt,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[64]=G,t[65]=oe,t[66]=se):se=t[66];let re;t[67]!==te||t[68]!==se?(re=o.jsxs(wt,{children:[te,se]}),t[67]=te,t[68]=se,t[69]=re):re=t[69];let ie;t[70]!==Z||t[71]!==re?(ie=o.jsxs(St,{children:[Z,re]}),t[70]=Z,t[71]=re,t[72]=ie):ie=t[72];let ne;t[73]!==Y||t[74]!==ie?(ne=o.jsx(_t,{open:Y,onOpenChange:W,children:ie}),t[73]=Y,t[74]=ie,t[75]=ne):ne=t[75];let me;return t[76]!==N||t[77]!==z||t[78]!==H||t[79]!==$||t[80]!==ne?(me=o.jsxs(N,{children:[z,H,$,ne]}),t[76]=N,t[77]=z,t[78]=H,t[79]=$,t[80]=ne,t[81]=me):me=t[81],me}function zt(t){return t.id}export{As as default};
|
|
1
|
+
import{c as ue,b as pe,j as o,a5 as Ae,B as le,eD as Te,M as ge,W as Le,a as we,n as Se,r as O,d8 as Ee,m as Fe,K as je,e as ke,o as U,t as fe,l as Pe,x as Ge,ao as Me,P as de}from"./index-C6mMoKV9.js";import{a as ce,b as _e,D as he,c as xe}from"./dropdown-menu-BS01WOe-.js";import{i as Oe}from"./GitBranch01-DzU0sPJc.js";import{b as Re}from"./Users03-BsQdFF8i.js";import{b as ze,c as Ue,g as $e}from"./use-virtual-mcp-2feYNqBo.js";import{i as Be}from"./DotsVertical-2ZMqd-18.js";import{a as Ve}from"./Settings02-CFq2ETVr.js";import{s as He}from"./Trash01-B1H2nTDv.js";import{A as Ke,bc as Qe}from"./agent-icon-DEBX0Uac.js";import{u as qe,f as Ce}from"./use-date-fns-locale-rgfXEg1T.js";import{u as ve}from"./use-navigate-to-agent-BsGybLOl.js";import{n as Ye}from"./use-organization-settings-D0M2z89A.js";import{E as We}from"./empty-state-CNNGduB2.js";import{u as Je}from"./use-create-virtual-mcp-DmXpf3QG.js";import{b as Xe,u as Ze}from"./use-connection-TGwBsBZ6.js";import{u as be}from"./use-mcp-client-B8avk6p1.js";import{a as et}from"./authenticate-and-persist-oauth-3J_jvNQZ.js";import{c as tt}from"./use-mcp-tools-BX_9PtQS.js";import{e as ot}from"./extract-connection-data-CulqgUEu.js";import{f as st,g as rt}from"./thread-intent-CqreAI8n.js";import{a as it}from"./github-repo-scope-C8GSbvaz.js";import{f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-BbF8R0Rt.js";import{i as ft}from"./ArrowLeft-BZ_V0Q9t.js";import{C as ht}from"./collection-search-Cw88RONI.js";import{G as xt}from"./github-icon--lTAh1jj.js";import{A as bt,a as jt,b as Ct,c as Dt,g as yt,d as wt,e as St,f as _t}from"./alert-dialog-jSpWtFPv.js";import{S as vt}from"./search-input-vrIAmgoh.js";import{s as De}from"./Plus-p771xfxl.js";import{R as Nt}from"./repository-import-picker-DysBPsrE.js";import{u as It}from"./use-debounced-value-DGsEitJX.js";import"./Check-jwHdO8X-.js";import"./ChevronRight-qjdwy3ht.js";import"./AlertCircle-rRQrnsQT.js";import"./Tool01-Co_K8urR.js";import"./ArrowUp-DhMsgJkj.js";import"./Tool02-BHzOpk5z.js";import"./ArrowRight-DLmMx1GH.js";import"./TrendUp01-Cxcr4-0l.js";import"./ZoomOut-DbeadNC9.js";import"./CheckCircle-BXhLNUG6.js";import"./ChevronUp-DUyCnbNx.js";import"./UserSquare-SK2C9JwY.js";import"./Copy01-Ba_DXyYG.js";import"./CreditCard01-D8ve3i2_.js";import"./Database01-CKtQnfwM.js";import"./MessageCircle01-DOh30ucD.js";import"./Download01-CoH-UuQa.js";import"./Printer-CEzVuZMa.js";import"./Eye-BpslXSuU.js";import"./File02-aDup41Qr.js";import"./Share07-hoEgdikb.js";import"./Globe01-CDkkg2Cy.js";import"./SwitchHorizontal01-DVbyXy1C.js";import"./HardDrive-DNp6sr7j.js";import"./Image01-DZX0wWyU.js";import"./Key01-D2uCgYpN.js";import"./Link01-B6QrVU3H.js";import"./LinkExternal01-CKgmWkkp.js";import"./Monitor01-DT1NSOaN.js";import"./Sun-BvckUZh0.js";import"./Package-DZFJNJtq.js";import"./Palette-D9x-keux.js";import"./Play-nvjmkgl9.js";import"./SearchLg-C5H_nx3W.js";import"./SearchMd-BnbGkmUb.js";import"./Shield01-C_kVJsrZ.js";import"./Stars01-jOH0yCKk.js";import"./Upload01-CiNRxnSv.js";import"./User01-_uMnR0k7.js";import"./Users01-C8QAjTFh.js";import"./XCircle-mKrW5aBV.js";import"./XClose-nT83baSx.js";import"./X-MotBpvxg.js";import"./Zap-DlMFCTS-.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-BU6oBSHV.js";import"./backoff-8mStPHYB.js";import"./task-board-D_f-LuAE.js";import"./schema-WP2X1X1Z.js";import"./github-repo-BknN0SVI.js";import"./auth-DekSX5bd.js";import"./mcp-oauth-DZAKWi1a.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-Cl0tFuDE.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-DJL8W4-t.js";import"./tooltip-CYhjJgVA.js";import"./index-CAThN-6U.js";import"./input-CZquufhh.js";import"./label-BdNnPzHo.js";import"./useInfiniteQuery-Br9KmFLf.js";import"./infiniteQueryObserver-8SjYC_ek.js";import"./avatar-Db6Ad7E2.js";function ye(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:h,align:p,side:y,showBetaBadge:m,showDecoImport:b}=t,j=p===void 0?"end":p,u=pe();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Re,{size:14}),e[0]=g):g=e[0];let f;e[1]!==u?(f=u("common.createAgentDropdown.createFromScratch"),e[1]=u,e[2]=f):f=e[2];let x;e[3]!==h||e[4]!==s||e[5]!==f?(x=o.jsxs(ce,{disabled:h,onClick:s,children:[g,f]}),e[3]=h,e[4]=s,e[5]=f,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Oe,{className:"size-3.5"}),e[7]=C):C=e[7];let c;e[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),e[8]=u,e[9]=c):c=e[9];let l;e[10]!==m?(l=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=l):l=e[11];let a;e[12]!==r||e[13]!==c||e[14]!==l?(a=o.jsxs(ce,{onClick:r,children:[C,c,l]}),e[12]=r,e[13]=c,e[14]=l,e[15]=a):a=e[15];let d;e[16]!==n||e[17]!==b||e[18]!==u?(d=b&&o.jsxs(ce,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=b,e[18]=u,e[19]=d):d=e[19];let D;return e[20]!==j||e[21]!==y||e[22]!==x||e[23]!==a||e[24]!==d?(D=o.jsxs(_e,{side:y,align:j,className:"w-48",children:[x,a,d]}),e[20]=j,e[21]=y,e[22]=x,e[23]=a,e[24]=d,e[25]=D):D=e[25],D}function At(t){const e=ue.c(50),{project:s,lastUsedAt:r,onDeleteClick:n}=t,h=ve(),p=pe(),y=qe(),m=s.metadata?.ui?.layout;let b;e[0]!==m?(b=Ae(m),e[0]=m,e[1]=b):b=e[1];const j=b;let u;e[2]!==j||e[3]!==h||e[4]!==s.id?(u=()=>h(s.id,{panel:j}),e[2]=j,e[3]=h,e[4]=s.id,e[5]=u):u=e[5];let g;e[6]!==s.title||e[7]!==u?(g=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),e[6]=s.title,e[7]=u,e[8]=g):g=e[8];let f;e[9]!==s.icon||e[10]!==s.title?(f=o.jsx(Ke,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[9]=s.icon,e[10]=s.title,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(he,{asChild:!0,children:o.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Be,{size:20})})}),e[12]=x):x=e[12];let C;e[13]!==h||e[14]!==s.id?(C=()=>h(s.id,{panel:"settings"}),e[13]=h,e[14]=s.id,e[15]=C):C=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ve,{size:16}),e[16]=c):c=e[16];let l;e[17]!==C?(l=o.jsxs(ce,{onClick:C,children:[c,"Settings"]}),e[17]=C,e[18]=l):l=e[18];let a;e[19]!==n?(a=n&&o.jsxs(ce,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[19]=n,e[20]=a):a=e[20];let d;e[21]!==a||e[22]!==l?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(xe,{children:[x,o.jsxs(_e,{align:"end",children:[l,a]})]})}),e[21]=a,e[22]=l,e[23]=d):d=e[23];let D;e[24]!==d||e[25]!==f?(D=o.jsxs("div",{className:"flex items-start justify-between",children:[f,d]}),e[24]=d,e[25]=f,e[26]=D):D=e[26];let w;e[27]!==s.title?(w=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[27]=s.title,e[28]=w):w=e[28];const K=s.description||"No description";let S;e[29]!==K?(S=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:K}),e[29]=K,e[30]=S):S=e[30];let G;e[31]!==w||e[32]!==S?(G=o.jsxs("div",{className:"flex flex-col gap-1",children:[w,S]}),e[31]=w,e[32]=S,e[33]=G):G=e[33];let N;e[34]!==D||e[35]!==G?(N=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[D,G]}),e[34]=D,e[35]=G,e[36]=N):N=e[36];let T;e[37]!==r||e[38]!==y||e[39]!==s.updated_at||e[40]!==p?(T=r?p("home.projectCard.lastUsed",{time:Ce(new Date(r),{addSuffix:!0,locale:y})}):p("home.projectCard.updated",{time:Ce(new Date(s.updated_at),{addSuffix:!0,locale:y})}),e[37]=r,e[38]=y,e[39]=s.updated_at,e[40]=p,e[41]=T):T=e[41];let L;e[42]!==T?(L=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[42]=T,e[43]=L):L=e[43];let I;e[44]!==N||e[45]!==L?(I=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[N,L]}),e[44]=N,e[45]=L,e[46]=I):I=e[46];let _;return e[47]!==I||e[48]!==g?(_=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[g,I]}),e[47]=I,e[48]=g,e[49]=_):_=e[49],_}function Tt(t,e){const s=ue.c(12),{org:r}=ge();let n;s[0]!==r.id?(n=Le.REGISTRY(r.id),s[0]=r.id,s[1]=n):n=s[1];const h=n;let p;s[2]!==r.id||s[3]!==r.slug||s[4]!==h?(p={connectionId:h,orgId:r.id,orgSlug:r.slug},s[2]=r.id,s[3]=r.slug,s[4]=h,s[5]=p):p=s[5];const y=be(p);let m;s[6]!==t?(m={name:t},s[6]=t,s[7]=m):m=s[7];const b=e?.enabled??!0;let j;return s[8]!==y||s[9]!==m||s[10]!==b?(j={client:y,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:b,staleTime:3e5,select:Lt},s[8]=y,s[9]=m,s[10]=b,s[11]=j):j=s[11],tt(j)}function Lt(t){return t.structuredContent?.item??null}const Et="deco/mcp-github";function Ft(t){const{org:e}=ge(),{data:s}=we.useSession(),r=Xe(),n=Se(),[h,p]=O.useState("idle"),[y,m]=O.useState(null),[b,j]=O.useState(null),{data:u,isLoading:g}=Tt(Et,{enabled:t.enabled}),f=O.useRef(!1);t.enabled&&u&&!g&&!f.current&&s?.user?.id&&h==="idle"&&(f.current=!0,x());async function x(){if(!(!u||!s?.user?.id||!e))try{p("installing"),m(null);const c=ot(u,e.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:a}=await r.create.mutateAsync(c);p("authenticating");const d=await et({connectionId:a,orgId:e.id,orgSlug:e.slug,persistFallback:D=>r.update.mutateAsync({id:a,data:{connection_token:D}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(a)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(n,e.id),j(c),p("ready")}catch(c){m(c instanceof Error?c.message:String(c)),p("error")}}function C(){p("idle"),m(null),j(null),f.current=!1}return t.enabled&&g&&h==="idle"?{status:"installing",error:null,connection:null,retry:C}:{status:h,error:y,connection:b,retry:C}}const kt="deco-sites";function Pt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,r=e.repo;return typeof s!="string"||typeof r!="string"||s.length===0||r.length===0?null:{owner:s,repo:r}}function Gt(t,e){const s=e?Pt(e):null,r=s?.owner??kt,n=s?.repo??t;return{owner:r,name:n,url:`https://github.com/${r}/${n}`}}function Mt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Ot(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Rt({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),h=ve(),p=Se(),{data:y}=we.useSession(),[m,b]=O.useState(null),[j,u]=O.useState(null),[g,f]=O.useState(""),x=be({connectionId:Ge,orgId:n.id,orgSlug:n.slug}),C=Ze({slug:"mcp-github"}),c=it(C),l=Ft({enabled:t&&c.length===0}),a=c.length===1?c[0]??null:j,d=c.length>1&&!a,D=be({connectionId:a?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:K,isLoading:S,error:G}=Fe({queryKey:je.decoSites(y?.user?.email),queryFn:()=>Ot(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),N=K?.sites??[],T=i=>{i||(b(null),u(null),f("")),e(i)},L=N.filter(i=>i.name.toLowerCase().includes(g.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(g.toLowerCase())??!1)),I=!m||L.some(i=>i.name===m),_=ke({mutationFn:async i=>{if(!a)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));U("deco_site_import_started",{site_name:i});const{installations:P}=await nt(k=>x.callTool(k),a.id),E=N.find(k=>k.name===i);if(!E)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Gt(i,E.metadata),F=lt(P,v.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:at}));let R=null,Q=null;const ae=async()=>{Q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:Q}}).catch(()=>{}),R&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:z,reused:H}=await ct({orgSlug:n.slug,sourceConnection:a,installationId:F.installationId,owner:v.owner,repo:v.name,githubCallTool:q=>D.callTool(q),selfCallTool:q=>x.callTool(q)});R=H?null:z;const $=k.icon??null,Y=Mt(i),W=i.toLowerCase(),B=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:$??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:B,productionUrl:B,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:F.installationId,connectionId:z},ui:{banner:null,bannerColor:"#22C55E",icon:$,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:z}]}}}),M=V.structuredContent??V;if(!M.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return Q=M.item.id,{slug:Y,virtualMcpId:M.item.id,item:M.item}}catch(k){throw await ae(),k}},onSuccess:({slug:i,virtualMcpId:P,item:E})=>{U("deco_site_import_succeeded",{site_name:E.title,virtual_mcp_id:P,slug:i}),p.setQueryData(je.collectionItem(x,n.id,"","VIRTUAL_MCP",P),{item:E}),p.invalidateQueries({predicate:v=>{const F=v.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),fe.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),T(!1),h(P)},onError:i=>{U("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),fe.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:T,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.importFromDecoDialog.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:g,onChange:f,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&f("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(le,{variant:"outline",size:"sm",onClick:l.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!w&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),c.map(i=>o.jsxs("button",{type:"button",onClick:()=>u(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(xt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),S&&!w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!S&&!w&&!d&&l.status!=="error"&&!G&&N.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!S&&!w&&!d&&l.status!=="error"&&N.length>0&&o.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:[L.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:g})}),L.map(i=>{const P=rt(i.domains),E=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>b(i.name),className:Pe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",E?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),P&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(le,{variant:"outline",onClick:()=>T(!1),disabled:_.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(le,{disabled:!m||!I||_.isPending||S||w||d||!a||l.status==="error",onClick:()=>m&&_.mutate(m),children:_.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function As(){const t=ue.c(82),e=pe(),{org:s}=ge(),[r,n]=O.useState(""),h=It(r,300);let p;t[0]!==h?(p={searchTerm:h},t[0]=h,t[1]=p):p=t[1];const y=ze(p),m=Ue();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={navigateOnCreate:!0},t[2]=b):b=t[2];const{createVirtualMCP:j,isCreating:u}=Je(b),[g,f]=O.useState(null),[x,C]=O.useState(!1),[c,l]=O.useState(!1),{granted:a}=Me("agents:manage"),d=Ye();let D;t[3]!==s?(D=A=>A.id!==s.id,t[3]=s,t[4]=D):D=t[4];const w=y.filter(D),{data:K}=$e(w.map(zt));let S;t[5]!==m||t[6]!==g||t[7]!==e?(S=async()=>{if(!g)return;const{id:A,title:Ie}=g;f(null);try{await m.delete.mutateAsync(A),U("agent_deleted",{agent_id:A,source:"agents_list"}),fe.success(e("routes.agentsList.deletedAgent",{title:Ie}))}catch{}},t[5]=m,t[6]=g,t[7]=e,t[8]=S):S=t[8];const G=S,N=de,T=de,L=de;let I;t[9]!==e?(I=e("routes.agentsList.title"),t[9]=e,t[10]=I):I=t[10];let _;t[11]!==I?(_=o.jsx(de.Title,{children:I}),t[11]=I,t[12]=_):_=t[12];let i;t[13]!==e?(i=e("routes.agentsList.searchPlaceholder"),t[13]=e,t[14]=i):i=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=A=>{A.key==="Escape"&&(n(""),A.target.blur())},t[15]=P):P=t[15];let E;t[16]!==r||t[17]!==i?(E=o.jsx(vt,{value:r,onChange:n,placeholder:i,className:"w-full md:w-[375px]",onKeyDown:P}),t[16]=r,t[17]=i,t[18]=E):E=t[18];let v;t[19]!==a||t[20]!==j||t[21]!==u||t[22]!==d||t[23]!==e?(v=a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list",method:"deco"}),C(!0)},isCreating:u,align:"end",showDecoImport:d})]}),t[19]=a,t[20]=j,t[21]=u,t[22]=d,t[23]=e,t[24]=v):v=t[24];let F;t[25]!==E||t[26]!==v?(F=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,v]}),t[25]=E,t[26]=v,t[27]=F):F=t[27];let R;t[28]!==F||t[29]!==_?(R=o.jsxs("div",{className:"flex flex-col gap-6",children:[_,F]}),t[28]=F,t[29]=_,t[30]=R):R=t[30];const Q=w.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(We,{image:o.jsx(Qe,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!r&&a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),C(!0)},isCreating:u,align:"center",showBetaBadge:!0,showDecoImport:d})]})})}),ae=w.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:w.map(A=>o.jsx(At,{project:A,lastUsedAt:K?.get(A.id)?.last_used_at,onDeleteClick:a?()=>f({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[31]!==R||t[32]!==Q||t[33]!==ae||t[34]!==L.Container?(k=o.jsxs(L.Container,{children:[R,Q,ae]}),t[31]=R,t[32]=Q,t[33]=ae,t[34]=L.Container,t[35]=k):k=t[35];let z;t[36]!==k||t[37]!==T.Content?(z=o.jsx(T.Content,{children:k}),t[36]=k,t[37]=T.Content,t[38]=z):z=t[38];let H;t[39]!==c?(H=o.jsx(Nt,{open:c,onOpenChange:l}),t[39]=c,t[40]=H):H=t[40];let $;t[41]!==x?($=o.jsx(Rt,{open:x,onOpenChange:C}),t[41]=x,t[42]=$):$=t[42];const Y=!!g;let W;t[43]===Symbol.for("react.memo_cache_sentinel")?(W=A=>!A&&f(null),t[43]=W):W=t[43];let B;t[44]!==e?(B=e("routes.agentsList.deleteAgentTitle"),t[44]=e,t[45]=B):B=t[45];let V;t[46]!==B?(V=o.jsx(bt,{children:B}),t[46]=B,t[47]=V):V=t[47];let M;t[48]!==e?(M=e("routes.agentsList.deleteAgentDescription"),t[48]=e,t[49]=M):M=t[49];const q=g?.title;let J;t[50]!==q?(J=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[50]=q,t[51]=J):J=t[51];let X;t[52]!==M||t[53]!==J?(X=o.jsxs(jt,{children:[M," ",J,"."]}),t[52]=M,t[53]=J,t[54]=X):X=t[54];let Z;t[55]!==V||t[56]!==X?(Z=o.jsxs(Ct,{children:[V,X]}),t[55]=V,t[56]=X,t[57]=Z):Z=t[57];let ee;t[58]!==e?(ee=e("routes.agentsList.cancelButton"),t[58]=e,t[59]=ee):ee=t[59];let te;t[60]!==ee?(te=o.jsx(Dt,{children:ee}),t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==e?(oe=e("routes.agentsList.deleteButton"),t[62]=e,t[63]=oe):oe=t[63];let se;t[64]!==G||t[65]!==oe?(se=o.jsx(yt,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[64]=G,t[65]=oe,t[66]=se):se=t[66];let re;t[67]!==te||t[68]!==se?(re=o.jsxs(wt,{children:[te,se]}),t[67]=te,t[68]=se,t[69]=re):re=t[69];let ie;t[70]!==Z||t[71]!==re?(ie=o.jsxs(St,{children:[Z,re]}),t[70]=Z,t[71]=re,t[72]=ie):ie=t[72];let ne;t[73]!==Y||t[74]!==ie?(ne=o.jsx(_t,{open:Y,onOpenChange:W,children:ie}),t[73]=Y,t[74]=ie,t[75]=ne):ne=t[75];let me;return t[76]!==N||t[77]!==z||t[78]!==H||t[79]!==$||t[80]!==ne?(me=o.jsxs(N,{children:[z,H,$,ne]}),t[76]=N,t[77]=z,t[78]=H,t[79]=$,t[80]=ne,t[81]=me):me=t[81],me}function zt(t){return t.id}export{As as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as V,b as Q,ac as Oe,ad as Fe,r as G,j as s,az as st,dR as Le,t as Z,dQ as de,dP as ae,as as Be,M as se,_ as te,n as oe,e as ie,v as he,B as W,K as X,m as pe,ax as ue,l as re,cN as He,fj as it,eD as ve,ao as lt,L as rt,o as Ke,h as nt,aa as at,ab as xe,fi as ot}from"./index-CLlne17T.js";import{i as ct}from"./AlertCircle-lddbBWh0.js";import{u as qe,a as me,i as dt,b as ut,p as mt,e as be,f as ft,d as ze}from"./use-ai-providers-DXXr4ex9.js";import{i as pt}from"./CheckCircle-2GspG_XT.js";import{d as gt,l as xt}from"./use-organization-settings-CKJ6hB3u.js";import{S as ht}from"./schema-Brgh1n5m.js";import{M as vt}from"./select-model-B-XEXZYZ.js";import{u as bt}from"./use-debounced-autosave-BWXcEqzZ.js";import{I as ce}from"./input-CP_e0ZMg.js";import{T as Ae,a as jt}from"./toggle-group-DHEZ824d.js";import{A as je,a as ye,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-OWb4AclI.js";import{u as ge,d as we,a as Ve,e as yt}from"./use-entitlements-CVFQAC4Y.js";import{i as Nt}from"./ChevronRight-byX-3L9r.js";import{u as Ge}from"./use-open-billing-url-BHFODZxq.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-D0ghMEom.js";import{i as It}from"./Check-B2FZLF1O.js";import{b as wt,a as kt}from"./Tool01-0YKAjW__.js";import{s as Dt}from"./Plus-BiYlKLxl.js";import{s as Kt}from"./Trash01-Dp2yrMxt.js";import{A as At}from"./avatar-Dr6RkrBb.js";import{u as Et,f as Rt}from"./use-date-fns-locale-m9kXRT36.js";import{c as We,P as Tt,C as Ee}from"./decopilot-DmAS8lky.js";import{P as Ut}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Settings02-CqMjj8Oq.js";import{s as $t}from"./Eye-DFJEK6aw.js";import{d as Ot,c as Ft,b as Lt,D as Bt,e as Ht}from"./dialog-CDr-V9u8.js";import{R as qt}from"./require-capability-w06E-xRt.js";import"./task-board-DlaQdjME.js";import"./drawer-DCRH2Qpg.js";import"./use-mobile-DmHecFjh.js";import"./chat-context-BmwCoPvA.js";import"./use-panel-navigate-D0KroJxZ.js";import"./thread-route-CTWLcToH.js";import"./use-project-scope-BzLiG5Sw.js";import"./use-virtual-mcp-oRiYDLbO.js";import"./use-mcp-client-B-bmV-eU.js";import"./auth-CJPyBAbS.js";import"./github-repo-BknN0SVI.js";import"./autosend-CB-A5Oif.js";import"./thread-intent-DzYbKhDO.js";import"./slugify-CEUa2lfQ.js";import"./hooks-Rl0qRFjy.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-BCNV6ibO.js";import"./index-BYBuvEpZ.js";import"./User01-Da1WckIS.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-rssR-x4C.js";import"./select-dS1ZvUUC.js";import"./index-CGenpwLF.js";import"./ChevronUp-DgIot4i7.js";import"./ArrowLeft-DDPJQXhG.js";import"./Key01-Ctr214Q3.js";import"./SearchMd-C6NFUW36.js";import"./Monitor01-C8W3wbFB.js";import"./download-app-dialog-rP5j-4Hl.js";import"./Copy01-DN3tqM8L.js";import"./Download01-DzANKKkw.js";import"./Image01-CUco8f4C.js";import"./Stars01-BxBiTUsk.js";import"./X-D6lVPJzO.js";import"./access-gate-BYH1blGF.js";import"./capability-load-error-3FwAUk2n.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>dt(e),Gt=e=>ut(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(30),{slot:i,onSlotChange:r,filterModels:o,defaultKeyId:n}=e,c=qe(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??n);let f,a;t[0]!==l?(f=()=>{l&&g(l)},a=[l],t[0]=l,t[1]=f,t[2]=a):(f=t[1],a=t[2]),G.useEffect(f,a);let x;t[3]!==c||t[4]!==n||t[5]!==d?(x=c.some(I=>I.id===d)?d:n,t[3]=c,t[4]=n,t[5]=d,t[6]=x):x=t[6];const u=x;let v;t[7]!==u||t[8]!==c?(v=u?c.find(I=>I.id===u):null,t[7]=u,t[8]=c,t[9]=v):v=t[9];const C=v,{models:y,isLoading:h}=me(o?u??void 0:void 0),j=o?h||y.some(o):!0;let N;t[10]!==i||t[11]!==C?.providerId||t[12]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=C?.providerId,t[12]=l,t[13]=N):N=t[13];const w=N,m=Q();if(o&&!j){let I;t[14]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=m,t[15]=I):I=t[15];let k;return t[16]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[16]=I,t[17]=k):k=t[17],k}let b;t[18]!==m?(b=m("settings.simpleModeSection.pickModel"),t[18]=m,t[19]=b):b=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[20]=S):S=t[20];let p;t[21]!==u||t[22]!==r?(p=I=>{const k=I.keyId??u??"";g(k),r({keyId:k,modelId:I.modelId,title:I.title})},t[21]=u,t[22]=r,t[23]=p):p=t[23];let P;return t[24]!==u||t[25]!==o||t[26]!==w||t[27]!==b||t[28]!==p?(P=s.jsx(vt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:o,onCredentialChange:S,onModelChange:p}),t[24]=u,t[25]=o,t[26]=w,t[27]=b,t[28]=p,t[29]=P):P=t[29],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:r}=e,o=Q();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pt,{size:12}),t[5]=n):n=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=qe(),r=gt(),o=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Oe(ht),e[0]=n):n=e[0];let c;e[1]!==r?(c={resolver:n,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=xt(),a=l.formState.isDirty;let x;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(r),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=bt(x),v=i[0],C=i[1],y=i[2],{models:h}=me(v?.id),{models:j}=me(C?.id),{models:N}=me(y?.id);let w,m;e[8]!==l||e[9]!==o?(w=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[o,l],e[8]=l,e[9]=o,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==y||e[17]!==h||e[18]!==j||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),H={};v?.id&&(H[v.id]=h),C?.id&&(H[C.id]=j),y?.id&&(H[y.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=mt(i,H);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=y,e[17]=h,e[18]=j,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=y?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==j||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,j,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=j,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[_]||_,e[30]=t,e[31]=k):k=e[31];const R=k;let A;e[32]!==t?(A=_=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let T;e[36]!==t?(T=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=T):T=e[37];let $;e[38]!==T?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:T}),e[38]=T,e[39]=$):$=e[39];const B=f&&!a;let O;e[40]!==g||e[41]!==B?(O=s.jsx(Wt,{isPending:g,showSaved:B}),e[40]=g,e[41]=B,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==R||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:H}=M;return s.jsx(Le,{title:R(_.key),description:U(_.key),action:s.jsx(Yt,{slot:H.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{H.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=R,e[50]=u,e[51]=L):L=e[51];let q;e[52]!==L?(q=s.jsx(de,{children:L}),e[52]=L,e[53]=q):q=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==q?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,q]}),e[54]=E,e[55]=F,e[56]=q,e[57]=D):D=e[57],D}function Xt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Ze(){const e=V.c(30),t=Q(),i=te(),[r]=he(),[o,n]=G.useState(!1);let c;e[0]!==t?(c=p=>{Z.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[a,x]=G.useState(r.language==="pt-BR"?"brl":"usd"),u=a,v=parseFloat(g),C=!isNaN(v)&&v>=1,y=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let j,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=j,e[5]=N):(j=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[j,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==y||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(m=!o&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[y,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>n(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=y,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==y||e[17]!==g||e[18]!==v||e[19]!==o||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:y}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{n(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=y,e[17]=g,e[18]=v,e[19]=o,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,r=Q(),{org:o}=se(),n=te();let c;t[0]!==o.id?(c=X.aiProviderCredits(o.id,"deco"),t[0]=o.id,t[1]=c):c=t[1];let l;t[2]!==n?(l=async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=n,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:a,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let y;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(y=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:re("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=y):y=t[14];let h;t[15]!==a?(h=()=>a(),t[15]=a,t[16]=h):h=t[16];let j;t[17]!==r?(j=r("settings.decoCreditsHero.refreshBalance"),t[17]=r,t[18]=j):j=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=re(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(Be,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==j?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":j,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=j,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==y?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[y,b]}),t[28]=b,t[29]=y,t[30]=S):S=t[30];let p;t[31]!==r?(p=r("settings.decoCreditsHero.availableBalance"),t[31]=r,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),r=te(),o=oe(),n=be();let c;e[0]!==n?(c=n.find(ls),e[0]=n,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,a]=G.useState(!1);let x;e[2]!==l||e[3]!==r?(x=async()=>{l&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=r,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{Z.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:y,isPending:h}=ie(C);if(!l)return null;let j;e[15]!==t?(j=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=j):j=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(je,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let R;e[36]!==k?(R=s.jsx(ye,{children:k}),e[36]=k,e[37]=R):R=e[37];let A;e[38]!==I||e[39]!==R?(A=s.jsxs(Ne,{children:[I,R]}),e[38]=I,e[39]=R,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let T;e[45]!==y?(T=()=>y(),e[45]=y,e[46]=T):T=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let B;e[49]!==T||e[50]!==$?(B=s.jsx(Ce,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=T,e[50]=$,e[51]=B):B=e[51];let O;e[52]!==E||e[53]!==B?(O=s.jsxs(Pe,{children:[E,B]}),e[52]=E,e[53]=B,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:a,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const q=!d;let D;e[61]!==q?(D=s.jsx(ss,{enabled:q}),e[61]=q,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?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:t("settings.decoCreditsHero.addCredits")}),s.jsx(Ze,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let H;return e[71]!==M||e[72]!==j?(H=s.jsx(ae,{title:j,children:M}),e[71]=M,e[72]=j,e[73]=H):H=e[73],H}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[rs]=it(ke),[ns,as]=rs(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:o,getValueLabel:n=os,...c}=e;(o||o===0)&&!Re(o)&&console.error(cs(`${o}`,"Progress"));const l=Re(o)?o:De;r!==null&&!Te(r,l)&&console.error(ds(`${r}`,"Progress"));const d=Te(r,l)?r:null,g=fe(d)?n(d,l):void 0;return s.jsx(ns,{scope:i,value:d,max:l,children:s.jsx(He.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Xe.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,o=as(Je,i);return s.jsx(He.div,{"data-state":tt(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Re(e){return fe(e)&&!isNaN(e)&&e>0}function Te(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
1
|
+
import{c as V,b as Q,ac as Oe,ad as Fe,r as G,j as s,az as st,dR as Le,t as Z,dQ as de,dP as ae,as as Be,M as se,_ as te,n as oe,e as ie,v as he,B as W,K as X,m as pe,ax as ue,l as re,cN as He,fj as it,eD as ve,ao as lt,L as rt,o as Ke,h as nt,aa as at,ab as xe,fi as ot}from"./index-C6mMoKV9.js";import{i as ct}from"./AlertCircle-rRQrnsQT.js";import{u as qe,a as me,i as dt,b as ut,p as mt,e as be,f as ft,d as ze}from"./use-ai-providers-Cotfg7SS.js";import{i as pt}from"./CheckCircle-BXhLNUG6.js";import{d as gt,l as xt}from"./use-organization-settings-D0M2z89A.js";import{S as ht}from"./schema-WP2X1X1Z.js";import{M as vt}from"./select-model-GkNjuCgL.js";import{u as bt}from"./use-debounced-autosave-BZKMq5sx.js";import{I as ce}from"./input-CZquufhh.js";import{T as Ae,a as jt}from"./toggle-group-_I41ei63.js";import{A as je,a as ye,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-jSpWtFPv.js";import{u as ge,d as we,a as Ve,e as yt}from"./use-entitlements-B4c1c87k.js";import{i as Nt}from"./ChevronRight-qjdwy3ht.js";import{u as Ge}from"./use-open-billing-url-V4LAVsZZ.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-BasR5sqC.js";import{i as It}from"./Check-jwHdO8X-.js";import{b as wt,a as kt}from"./Tool01-Co_K8urR.js";import{s as Dt}from"./Plus-p771xfxl.js";import{s as Kt}from"./Trash01-B1H2nTDv.js";import{A as At}from"./avatar-Db6Ad7E2.js";import{u as Et,f as Rt}from"./use-date-fns-locale-rgfXEg1T.js";import{c as We,P as Tt,C as Ee}from"./decopilot-D-EmElSn.js";import{P as Ut}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Settings02-CFq2ETVr.js";import{s as $t}from"./Eye-BpslXSuU.js";import{d as Ot,c as Ft,b as Lt,D as Bt,e as Ht}from"./dialog-BbF8R0Rt.js";import{R as qt}from"./require-capability-B2v3wdWj.js";import"./task-board-D_f-LuAE.js";import"./drawer-BBk33oYJ.js";import"./use-mobile-RHIQOVil.js";import"./chat-context-g3Ysek-D.js";import"./use-panel-navigate-VJU3jAVP.js";import"./thread-route-DNVTuSKD.js";import"./use-project-scope-BCYsjRUp.js";import"./use-virtual-mcp-2feYNqBo.js";import"./use-mcp-client-B8avk6p1.js";import"./auth-DekSX5bd.js";import"./github-repo-BknN0SVI.js";import"./autosend-Cp5vfPIB.js";import"./thread-intent-CqreAI8n.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BU6oBSHV.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-QHgLexrJ.js";import"./index-CexxzinB.js";import"./User01-_uMnR0k7.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-CtSIa9d0.js";import"./select-DPtaqnbY.js";import"./index-CAThN-6U.js";import"./ChevronUp-DUyCnbNx.js";import"./ArrowLeft-BZ_V0Q9t.js";import"./Key01-D2uCgYpN.js";import"./SearchMd-BnbGkmUb.js";import"./Monitor01-DT1NSOaN.js";import"./download-app-dialog-CTBm_E5V.js";import"./Copy01-Ba_DXyYG.js";import"./Download01-CoH-UuQa.js";import"./Image01-DZX0wWyU.js";import"./Stars01-jOH0yCKk.js";import"./X-MotBpvxg.js";import"./access-gate-DB08KYAT.js";import"./capability-load-error-DIrZadSW.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>dt(e),Gt=e=>ut(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(30),{slot:i,onSlotChange:r,filterModels:o,defaultKeyId:n}=e,c=qe(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??n);let f,a;t[0]!==l?(f=()=>{l&&g(l)},a=[l],t[0]=l,t[1]=f,t[2]=a):(f=t[1],a=t[2]),G.useEffect(f,a);let x;t[3]!==c||t[4]!==n||t[5]!==d?(x=c.some(I=>I.id===d)?d:n,t[3]=c,t[4]=n,t[5]=d,t[6]=x):x=t[6];const u=x;let v;t[7]!==u||t[8]!==c?(v=u?c.find(I=>I.id===u):null,t[7]=u,t[8]=c,t[9]=v):v=t[9];const C=v,{models:y,isLoading:h}=me(o?u??void 0:void 0),j=o?h||y.some(o):!0;let N;t[10]!==i||t[11]!==C?.providerId||t[12]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=C?.providerId,t[12]=l,t[13]=N):N=t[13];const w=N,m=Q();if(o&&!j){let I;t[14]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=m,t[15]=I):I=t[15];let k;return t[16]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[16]=I,t[17]=k):k=t[17],k}let b;t[18]!==m?(b=m("settings.simpleModeSection.pickModel"),t[18]=m,t[19]=b):b=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[20]=S):S=t[20];let p;t[21]!==u||t[22]!==r?(p=I=>{const k=I.keyId??u??"";g(k),r({keyId:k,modelId:I.modelId,title:I.title})},t[21]=u,t[22]=r,t[23]=p):p=t[23];let P;return t[24]!==u||t[25]!==o||t[26]!==w||t[27]!==b||t[28]!==p?(P=s.jsx(vt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:o,onCredentialChange:S,onModelChange:p}),t[24]=u,t[25]=o,t[26]=w,t[27]=b,t[28]=p,t[29]=P):P=t[29],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:r}=e,o=Q();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pt,{size:12}),t[5]=n):n=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=qe(),r=gt(),o=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Oe(ht),e[0]=n):n=e[0];let c;e[1]!==r?(c={resolver:n,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=xt(),a=l.formState.isDirty;let x;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(r),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=bt(x),v=i[0],C=i[1],y=i[2],{models:h}=me(v?.id),{models:j}=me(C?.id),{models:N}=me(y?.id);let w,m;e[8]!==l||e[9]!==o?(w=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[o,l],e[8]=l,e[9]=o,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==y||e[17]!==h||e[18]!==j||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),H={};v?.id&&(H[v.id]=h),C?.id&&(H[C.id]=j),y?.id&&(H[y.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=mt(i,H);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=y,e[17]=h,e[18]=j,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=y?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==j||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,j,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=j,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[_]||_,e[30]=t,e[31]=k):k=e[31];const R=k;let A;e[32]!==t?(A=_=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let T;e[36]!==t?(T=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=T):T=e[37];let $;e[38]!==T?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:T}),e[38]=T,e[39]=$):$=e[39];const B=f&&!a;let O;e[40]!==g||e[41]!==B?(O=s.jsx(Wt,{isPending:g,showSaved:B}),e[40]=g,e[41]=B,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==R||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:H}=M;return s.jsx(Le,{title:R(_.key),description:U(_.key),action:s.jsx(Yt,{slot:H.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{H.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=R,e[50]=u,e[51]=L):L=e[51];let q;e[52]!==L?(q=s.jsx(de,{children:L}),e[52]=L,e[53]=q):q=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==q?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,q]}),e[54]=E,e[55]=F,e[56]=q,e[57]=D):D=e[57],D}function Xt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Ze(){const e=V.c(30),t=Q(),i=te(),[r]=he(),[o,n]=G.useState(!1);let c;e[0]!==t?(c=p=>{Z.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[a,x]=G.useState(r.language==="pt-BR"?"brl":"usd"),u=a,v=parseFloat(g),C=!isNaN(v)&&v>=1,y=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let j,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=j,e[5]=N):(j=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[j,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==y||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(m=!o&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[y,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>n(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=y,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==y||e[17]!==g||e[18]!==v||e[19]!==o||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:y}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{n(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=y,e[17]=g,e[18]=v,e[19]=o,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,r=Q(),{org:o}=se(),n=te();let c;t[0]!==o.id?(c=X.aiProviderCredits(o.id,"deco"),t[0]=o.id,t[1]=c):c=t[1];let l;t[2]!==n?(l=async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=n,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:a,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let y;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(y=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:re("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=y):y=t[14];let h;t[15]!==a?(h=()=>a(),t[15]=a,t[16]=h):h=t[16];let j;t[17]!==r?(j=r("settings.decoCreditsHero.refreshBalance"),t[17]=r,t[18]=j):j=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=re(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(Be,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==j?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":j,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=j,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==y?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[y,b]}),t[28]=b,t[29]=y,t[30]=S):S=t[30];let p;t[31]!==r?(p=r("settings.decoCreditsHero.availableBalance"),t[31]=r,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),r=te(),o=oe(),n=be();let c;e[0]!==n?(c=n.find(ls),e[0]=n,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,a]=G.useState(!1);let x;e[2]!==l||e[3]!==r?(x=async()=>{l&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=r,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{Z.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:y,isPending:h}=ie(C);if(!l)return null;let j;e[15]!==t?(j=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=j):j=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(je,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let R;e[36]!==k?(R=s.jsx(ye,{children:k}),e[36]=k,e[37]=R):R=e[37];let A;e[38]!==I||e[39]!==R?(A=s.jsxs(Ne,{children:[I,R]}),e[38]=I,e[39]=R,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let T;e[45]!==y?(T=()=>y(),e[45]=y,e[46]=T):T=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let B;e[49]!==T||e[50]!==$?(B=s.jsx(Ce,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=T,e[50]=$,e[51]=B):B=e[51];let O;e[52]!==E||e[53]!==B?(O=s.jsxs(Pe,{children:[E,B]}),e[52]=E,e[53]=B,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:a,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const q=!d;let D;e[61]!==q?(D=s.jsx(ss,{enabled:q}),e[61]=q,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?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:t("settings.decoCreditsHero.addCredits")}),s.jsx(Ze,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let H;return e[71]!==M||e[72]!==j?(H=s.jsx(ae,{title:j,children:M}),e[71]=M,e[72]=j,e[73]=H):H=e[73],H}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[rs]=it(ke),[ns,as]=rs(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:o,getValueLabel:n=os,...c}=e;(o||o===0)&&!Re(o)&&console.error(cs(`${o}`,"Progress"));const l=Re(o)?o:De;r!==null&&!Te(r,l)&&console.error(ds(`${r}`,"Progress"));const d=Te(r,l)?r:null,g=fe(d)?n(d,l):void 0;return s.jsx(ns,{scope:i,value:d,max:l,children:s.jsx(He.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Xe.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,o=as(Je,i);return s.jsx(He.div,{"data-state":tt(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Re(e){return fe(e)&&!isNaN(e)&&e>0}function Te(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
2
|
- a positive number
|
|
3
3
|
- less than the value passed to \`max\` (or ${De} if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as o,j as c,aq as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,aq as d}from"./index-C6mMoKV9.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r,aW as w,r as i,b5 as m,d1 as T,ae as O,b8 as M,aX as I,aY as z,b0 as A,d2 as D,aZ as F,d3 as L,bk as k,a$ as G,a_ as W,c as n,l as p,ah as v}from"./index-
|
|
1
|
+
import{j as r,aW as w,r as i,b5 as m,d1 as T,ae as O,b8 as M,aX as I,aY as z,b0 as A,d2 as D,aZ as F,d3 as L,bk as k,a$ as G,a_ as W,c as n,l as p,ah as v}from"./index-C6mMoKV9.js";var x="AlertDialog",[Y]=k(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});V.displayName=H;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(W,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[X,Z]=Y(f),J=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(T,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(X,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(J,{children:a}),r.jsx(Q,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});R.displayName=E;var K="AlertDialogAction",$=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});$.displayName=K;var C="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=Z(C,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=C;var Q=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,M as Q,x as R,K as Y,m as ce,n as U,e as V,j as i,fi as de,b as F,r as O,dP as me,eD as J,B as v,t as q}from"./index-CLlne17T.js";import{i as fe}from"./AlertCircle-lddbBWh0.js";import{a as ue}from"./Copy01-DN3tqM8L.js";import{i as W}from"./Key01-Ctr214Q3.js";import{s as X}from"./Plus-BiYlKLxl.js";import{s as ge}from"./Trash01-Dp2yrMxt.js";import{f as pe,e as xe,b as ye,A as he,a as je,d as Ke,c as Ce,g as De}from"./alert-dialog-OWb4AclI.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-CDr-V9u8.js";import{I as le}from"./input-CP_e0ZMg.js";import{L as be}from"./label-Lvgg69zF.js";import{u as M}from"./use-mcp-client-B-bmV-eU.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=M(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let x;e[18]!==l?(x=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=x):x=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let y;e[21]!==p||e[22]!==x?(y=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":x,children:C}),e[21]=p,e[22]=x,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,y]}),e[24]=y,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let D;e[32]!==h||e[33]!==K||e[34]!==u?(D=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=D):D=e[35];let b;return e[36]!==s||e[37]!==D||e[38]!==n?(b=i.jsx(ne,{open:s,onOpenChange:n,children:D}),e[36]=s,e[37]=D,e[38]=n,e[39]=b):b=e[39],b}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==p?(x=i.jsx(Z,{children:p}),e[13]=p,e[14]=x):x=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let y;e[17]!==C?(y=i.jsx(ee,{children:C}),e[17]=C,e[18]=y):y=e[18];let h;e[19]!==x||e[20]!==y?(h=i.jsxs(te,{children:[x,y]}),e[19]=x,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(be,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=z=>c(z.target.value),e[26]=D):D=e[26];let b;e[27]!==s?(b=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=b):b=e[28];let S;e[29]!==n||e[30]!==b?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:D,placeholder:b,autoComplete:"off",required:!0}),e[29]=n,e[30]=b,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(xe,{children:[i.jsxs(ye,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(De,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
1
|
+
import{c as A,M as Q,x as R,K as Y,m as ce,n as U,e as V,j as i,fi as de,b as F,r as O,dP as me,eD as J,B as v,t as q}from"./index-C6mMoKV9.js";import{i as fe}from"./AlertCircle-rRQrnsQT.js";import{a as ue}from"./Copy01-Ba_DXyYG.js";import{i as W}from"./Key01-D2uCgYpN.js";import{s as X}from"./Plus-p771xfxl.js";import{s as ge}from"./Trash01-B1H2nTDv.js";import{f as pe,e as xe,b as ye,A as he,a as je,d as Ke,c as Ce,g as De}from"./alert-dialog-jSpWtFPv.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-BbF8R0Rt.js";import{I as le}from"./input-CZquufhh.js";import{L as be}from"./label-BdNnPzHo.js";import{u as M}from"./use-mcp-client-B8avk6p1.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=M(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let x;e[18]!==l?(x=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=x):x=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let y;e[21]!==p||e[22]!==x?(y=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":x,children:C}),e[21]=p,e[22]=x,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,y]}),e[24]=y,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let D;e[32]!==h||e[33]!==K||e[34]!==u?(D=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=D):D=e[35];let b;return e[36]!==s||e[37]!==D||e[38]!==n?(b=i.jsx(ne,{open:s,onOpenChange:n,children:D}),e[36]=s,e[37]=D,e[38]=n,e[39]=b):b=e[39],b}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==p?(x=i.jsx(Z,{children:p}),e[13]=p,e[14]=x):x=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let y;e[17]!==C?(y=i.jsx(ee,{children:C}),e[17]=C,e[18]=y):y=e[18];let h;e[19]!==x||e[20]!==y?(h=i.jsxs(te,{children:[x,y]}),e[19]=x,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(be,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=z=>c(z.target.value),e[26]=D):D=e[26];let b;e[27]!==s?(b=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=b):b=e[28];let S;e[29]!==n||e[30]!==b?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:D,placeholder:b,autoComplete:"off",required:!0}),e[29]=n,e[30]=b,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(xe,{children:[i.jsxs(ye,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(De,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,j as r}from"./index-C6mMoKV9.js";import{O as m}from"./api-keys-DYNE9_r9.js";import{R as p}from"./require-capability-B2v3wdWj.js";import"./AlertCircle-rRQrnsQT.js";import"./Copy01-Ba_DXyYG.js";import"./Key01-D2uCgYpN.js";import"./Plus-p771xfxl.js";import"./Trash01-B1H2nTDv.js";import"./alert-dialog-jSpWtFPv.js";import"./dialog-BbF8R0Rt.js";import"./X-MotBpvxg.js";import"./input-CZquufhh.js";import"./label-BdNnPzHo.js";import"./use-mcp-client-B8avk6p1.js";import"./auth-DekSX5bd.js";import"./access-gate-DB08KYAT.js";import"./capability-load-error-DIrZadSW.js";function A(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as jt,b as Bt,r as A,j as o,l as wt,h as _t,t as ht}from"./index-C6mMoKV9.js";import{u as At}from"./chat-context-g3Ysek-D.js";import{i as Et}from"./ChevronRight-qjdwy3ht.js";import{S as Nt}from"./scroll-area-B5uAtJE9.js";import{u as Rt,A as Kt}from"./use-section-preview-base-DxAPy40-.js";import{o as Tt}from"./claim-phase-copy-0btUuJoC.js";import{h as Ct,u as Pt,w as Ft,aK as Ot,x as Ut,d as $t,aL as It}from"./runnable-block-editor-Bd1lE8Yl.js";import{n as Lt,r as zt}from"./agent-site-editor-content-B5eM-F4q.js";import"./use-panel-navigate-VJU3jAVP.js";import"./thread-route-DNVTuSKD.js";import"./use-project-scope-BCYsjRUp.js";import"./use-virtual-mcp-2feYNqBo.js";import"./use-mcp-client-B8avk6p1.js";import"./auth-DekSX5bd.js";import"./github-repo-BknN0SVI.js";import"./autosend-Cp5vfPIB.js";import"./thread-intent-CqreAI8n.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BU6oBSHV.js";import"./backoff-8mStPHYB.js";import"./task-board-D_f-LuAE.js";import"./schema-WP2X1X1Z.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-B4c1c87k.js";import"./use-ai-providers-Cotfg7SS.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-QHgLexrJ.js";import"./use-organization-settings-D0M2z89A.js";import"./select-DPtaqnbY.js";import"./index-CAThN-6U.js";import"./Check-jwHdO8X-.js";import"./ChevronUp-DUyCnbNx.js";import"./agent-icon-DEBX0Uac.js";import"./AlertCircle-rRQrnsQT.js";import"./Tool01-Co_K8urR.js";import"./ArrowUp-DhMsgJkj.js";import"./ArrowLeft-BZ_V0Q9t.js";import"./Tool02-BHzOpk5z.js";import"./ArrowRight-DLmMx1GH.js";import"./TrendUp01-Cxcr4-0l.js";import"./ZoomOut-DbeadNC9.js";import"./Users03-BsQdFF8i.js";import"./CheckCircle-BXhLNUG6.js";import"./DotsVertical-2ZMqd-18.js";import"./UserSquare-SK2C9JwY.js";import"./Copy01-Ba_DXyYG.js";import"./CreditCard01-D8ve3i2_.js";import"./Database01-CKtQnfwM.js";import"./MessageCircle01-DOh30ucD.js";import"./Download01-CoH-UuQa.js";import"./Printer-CEzVuZMa.js";import"./Settings02-CFq2ETVr.js";import"./Eye-BpslXSuU.js";import"./File02-aDup41Qr.js";import"./Share07-hoEgdikb.js";import"./GitBranch01-DzU0sPJc.js";import"./Globe01-CDkkg2Cy.js";import"./SwitchHorizontal01-DVbyXy1C.js";import"./HardDrive-DNp6sr7j.js";import"./Image01-DZX0wWyU.js";import"./Key01-D2uCgYpN.js";import"./Link01-B6QrVU3H.js";import"./LinkExternal01-CKgmWkkp.js";import"./Monitor01-DT1NSOaN.js";import"./Sun-BvckUZh0.js";import"./Package-DZFJNJtq.js";import"./Palette-D9x-keux.js";import"./Play-nvjmkgl9.js";import"./Plus-p771xfxl.js";import"./SearchLg-C5H_nx3W.js";import"./SearchMd-BnbGkmUb.js";import"./Shield01-C_kVJsrZ.js";import"./Stars01-jOH0yCKk.js";import"./Trash01-B1H2nTDv.js";import"./Upload01-CiNRxnSv.js";import"./User01-_uMnR0k7.js";import"./Users01-C8QAjTFh.js";import"./XCircle-mKrW5aBV.js";import"./XClose-nT83baSx.js";import"./X-MotBpvxg.js";import"./Zap-DlMFCTS-.js";import"./dialog-BbF8R0Rt.js";import"./input-CZquufhh.js";import"./section-preview-url-Csj0_ZDg.js";import"./use-session-runtime-Dl206Bga.js";import"./decofile-api-epQGqIXQ.js";import"./utils-DUD_ZrVn.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-lifecycle-context-D0cxi8em.js";import"./pair-BSoDGPcF.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-S74ix7rA.js";import"./use-copy-D7Iw1LrJ.js";import"./usage-stats-lU60GCl7.js";import"./markdown-COVWapDi.js";import"./use-mobile-RHIQOVil.js";import"./tooltip-CYhjJgVA.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CI5q52w8.js";import"./types-Bgn578U0.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-BrWtEU1u.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./shell-layout-DlWVwnY3.js";import"./avatar-Db6Ad7E2.js";import"./download-app-dialog-CTBm_E5V.js";import"./anchors-yqDzZN4K.js";import"./use-org-notice-BDJtNsoi.js";import"./command-palette-store-DQWkqX24.js";import"./command-Cnr_FK8b.js";import"./index-BOZLd_mz.js";import"./integration-icon-Xt_LxCp3.js";import"./project-icon-DZXi7sAH.js";import"./required-auth-layout-CIegJY7n.js";import"./use-org-sso-B_DIN1FR.js";import"./sheet-7dqWERZ-.js";import"./use-connection-TGwBsBZ6.js";import"./use-navigate-to-agent-BsGybLOl.js";import"./use-mcp-prompts-C35IeKKU.js";import"./index-Dnovg-Ty.js";import"./form-Cq6wKFPC.js";import"./label-BdNnPzHo.js";import"./use-thread-outputs-TjNPQ11p.js";import"./file-type-icon-B-E6HvV1.js";import"./popover-DsPp8JNb.js";import"./monaco-editor-BoDXf1bj.js";import"./editor-DS43SgZS.js";import"./calendar-DnxVN00Q.js";import"./textarea-BPcKOU7a.js";import"./rich-text-link-control-Bh8SMhbX.js";import"./switch-CEhYE68G.js";import"./safe-image-url-D5z803Ot.js";import"./dropdown-menu-BS01WOe-.js";import"./search-input-vrIAmgoh.js";import"./tabs-C7ptBuB8.js";import"./use-debounced-value-DGsEitJX.js";import"./use-file-configs-5YZVd1Le.js";import"./asset-utils-CvLbIoHR.js";import"./useInfiniteQuery-Br9KmFLf.js";import"./infiniteQueryObserver-8SjYC_ek.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-_I41ei63.js";import"./alert-dialog-jSpWtFPv.js";import"./sandbox-git-api-CMdpE2TE.js";import"./agent-view-guard-DFIgCPk2.js";import"./use-main-panel-tabs-BHJmXQos.js";import"./use-route-default-main-D5obmIIM.js";import"./use-mcp-tools-BX_9PtQS.js";import"./index-Dq-6H-UD.js";import"./drawer-BBk33oYJ.js";import"./collection-search-Cw88RONI.js";import"./input-Dm5tdFv-.js";import"./chat-draft-DZWcf9MH.js";import"./use-deco-credits-zGfUt8ra.js";import"./use-open-billing-url-V4LAVsZZ.js";import"./decopilot-D-EmElSn.js";import"./checkbox-CtSIa9d0.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-CexxzinB.js";import"./input-LjvMOQDt.js";import"./hooks-BECLyGBb.js";import"./use-org-fs-Dvfg7DBA.js";import"./question-004-sINsf4GQ.js";import"./use-members-DpENbm_3.js";import"./use-org-auth-client-WNBip5me.js";import"./feature-paywall-BFqNEmgI.js";import"./plan-ladder-BasR5sqC.js";import"./add-connection-dialog-COIUcaiE.js";import"./extract-connection-data-CulqgUEu.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-Cl0tFuDE.js";import"./connection-card-CtC01b_S.js";import"./use-registry-connections-C1VQdjvR.js";import"./retry-i8LvYSZg.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-BGax9Typ.js";import"./authenticate-and-persist-oauth-3J_jvNQZ.js";import"./mcp-oauth-DZAKWi1a.js";import"./collection-tabs-DjIYbOQ5.js";import"./badge-cq278MQI.js";import"./use-infinite-scroll-BcvDIGP6.js";import"./useSuspenseInfiniteQuery-zJ2PG_QY.js";import"./use-task-metadata-2SHzp2HZ.js";import"./use-project-native-view-presence-DsW3Hqqc.js";import"./site-slug-uya6Wp4-.js";import"./virtual-mcp-DCGU1nRB.js";import"./feature-gate-Bjx-4ie7.js";import"./mustache-DX19G3kt.js";import"./empty-state-CNNGduB2.js";import"./github-icon--lTAh1jj.js";import"./repository-import-picker-DysBPsrE.js";import"./repository-picker-DJL8W4-t.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",p=Lt(t,i);return{blockKey:p,data:{__resolveType:n.resolveType,name:p}}}function wi(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:p,blockKey:s,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=zt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let K;t[7]!==b?(K=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=K):K=t[8];const J=K,dt=bt??(x?Tt(s,x,a):s);let T;t[9]!==p||t[10]!==m||t[11]!==i?(T={orgSlug:m,virtualMcpId:i,branch:p},t[9]=p,t[10]=m,t[11]=i,t[12]=T):T=t[12];const{save:S,flush:Q,isPending:W}=Ct(T);let C;t[13]!==p||t[14]!==m||t[15]!==i?(C={orgSlug:m,virtualMcpId:i,branch:p},t[13]=p,t[14]=m,t[15]=i,t[16]=C):C=t[16];const X=Pt(C);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(s),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==s&&(St(s),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==s||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(s,{...r,__resolveType:v})},t[27]=s,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let L;t[31]===Symbol.for("react.memo_cache_sentinel")?(L=e=>{xt(e)},t[31]=L):L=t[31];const E=L;let z;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(z=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=z):z=t[36];const k=z;let V;t[37]!==d?(V=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const pt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const st=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ft(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(qt)},title:f,className:wt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(It,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let w;t[47]!==s||t[48]!==p||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==pt||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(w=o.jsx(Nt,{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(Ut,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:pt,sandbox:{orgSlug:m,virtualMcpId:i,branch:p,threadId:G}},`${s}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=s,t[48]=p,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=pt,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=w):w=t[67];let _;t[68]!==ot||t[69]!==l||t[70]!==st||t[71]!==a||t[72]!==h||t[73]!==d?(_=h&&o.jsx(Kt,{open:ot,onOpenChange:e=>{d(e),e||(O.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{st(e)}}),t[68]=ot,t[69]=l,t[70]=st,t[71]=a,t[72]=h,t[73]=d,t[74]=_):_=t[74];let M;return t[75]!==B||t[76]!==w||t[77]!==_?(M=o.jsxs("div",{className:gt,children:[B,w,_]}),t[75]=B,t[76]=w,t[77]=_,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{wi as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,M as d,e as g,_ as m,K as I,n as O}from"./index-
|
|
1
|
+
import{c as u,M as d,e as g,_ as m,K as I,n as O}from"./index-C6mMoKV9.js";import{u as $}from"./useInfiniteQuery-Br9KmFLf.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function _(e){const t=e.split("/");return t[t.length-1]??e}function v(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,_ as b,F as c,S as e,v as f,w as i,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aC as v,aD as $,aE as W,aF as L,aG as H,aH as D,aI as V,aJ as x,aK as q,aL as j,aM as y,aN as N,aO as B,aP as F,aQ as Z}from"./index-CLlne17T.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
|
|
1
|
+
import{aC as v,aD as $,aE as W,aF as L,aG as H,aH as D,aI as V,aJ as x,aK as q,aL as j,aM as y,aN as N,aO as B,aP as F,aQ as Z}from"./index-C6mMoKV9.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-
|
|
1
|
+
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-C6mMoKV9.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
|