decocms 4.263.0 → 4.263.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-d_jYW-pF.js → AlertCircle-DL3U1yq7.js} +1 -1
- package/dist/client/assets/{AreaChart-6ExM5C57.js → AreaChart-DTwkuP_y.js} +1 -1
- package/dist/client/assets/{ArrowLeft-B5SdDJS5.js → ArrowLeft-BDtQVDZJ.js} +1 -1
- package/dist/client/assets/{ArrowUp-DmYjuyWi.js → ArrowUp-DUua93WQ.js} +1 -1
- package/dist/client/assets/{Check-KqwAmcDj.js → Check-CFdAuLVR.js} +1 -1
- package/dist/client/assets/{CheckCircle-DuO-pGO-.js → CheckCircle-Ccs86bUg.js} +1 -1
- package/dist/client/assets/{ChevronDown-BQZF9Af9.js → ChevronDown-Bh9AZv82.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bq8eLOWM.js → ChevronRight-Bt0Ps5hy.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DrHEbUrw.js → ChevronSelectorVertical-CbP69kXl.js} +1 -1
- package/dist/client/assets/{ChevronUp-BnjYp300.js → ChevronUp-CYbM4ZwP.js} +1 -1
- package/dist/client/assets/{Copy01-DQMklNBZ.js → Copy01-CKmyRUyl.js} +1 -1
- package/dist/client/assets/{CreditCard01-ayJva4-L.js → CreditCard01-DXJKk1Wt.js} +1 -1
- package/dist/client/assets/{DotsVertical-DmFi_5m5.js → DotsVertical-C5qhPHKZ.js} +1 -1
- package/dist/client/assets/{Download01-BCA2ING7.js → Download01-DZdiDQUS.js} +1 -1
- package/dist/client/assets/{Eye-CRgVrt0h.js → Eye-DFHNhYtx.js} +1 -1
- package/dist/client/assets/{FilterLines-D6T5uoZ8.js → FilterLines-C01-F8gV.js} +1 -1
- package/dist/client/assets/{Globe01-KXkuiG0o.js → Globe01-qBOiIpcJ.js} +1 -1
- package/dist/client/assets/{Globe04-kFCzhDtq.js → Globe04-DyPo8R4R.js} +1 -1
- package/dist/client/assets/{HardDrive-IGVDCiH-.js → HardDrive-DMA6WwJi.js} +1 -1
- package/dist/client/assets/{Key01-zoXnVGpi.js → Key01-CQ2Pckpa.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DY154voS.js → LinkExternal01-CDWxDAhW.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-BUPOcE7Q.js → LockUnlocked01-BJDlnHNP.js} +1 -1
- package/dist/client/assets/{LogOut01-vFXcKA44.js → LogOut01-DYTwrIyB.js} +1 -1
- package/dist/client/assets/{Monitor01-IMrl8-Sz.js → Monitor01-CW9D8oQR.js} +1 -1
- package/dist/client/assets/{Palette-CO-9fV73.js → Palette-CYMwYnzJ.js} +1 -1
- package/dist/client/assets/{Play-Cnds4faY.js → Play-D5VBgg81.js} +1 -1
- package/dist/client/assets/{Plus-DeCuWgpG.js → Plus-DJBOKCXM.js} +1 -1
- package/dist/client/assets/{SearchLg-LSbMLZI6.js → SearchLg-D05XfMH4.js} +1 -1
- package/dist/client/assets/{SearchMd-C6SjxYyL.js → SearchMd-Bvk6cmtM.js} +1 -1
- package/dist/client/assets/{Settings02-CDWROrkG.js → Settings02-BXfVk1mb.js} +1 -1
- package/dist/client/assets/{Share07-rauAL5Pr.js → Share07-DRhhhSu7.js} +1 -1
- package/dist/client/assets/{Shield01-CJQrmrbA.js → Shield01--vYJckXn.js} +1 -1
- package/dist/client/assets/{Stars01-DqVhL0wf.js → Stars01-Cfn7XpKF.js} +1 -1
- package/dist/client/assets/{Stars02-NRIRt4tn.js → Stars02-BEZaBHTc.js} +1 -1
- package/dist/client/assets/{Sun-BDdwc-Zh.js → Sun-CxlEqCDi.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BLilv7ln.js → SwitchHorizontal01-BPoIdNhd.js} +1 -1
- package/dist/client/assets/{Tool01-TcrXKmnF.js → Tool01-D15DzDIB.js} +1 -1
- package/dist/client/assets/{Tool02-DWE9dUHc.js → Tool02-DcVuymPV.js} +1 -1
- package/dist/client/assets/{Trash01-DoWKJDZO.js → Trash01-rd-vb1MA.js} +1 -1
- package/dist/client/assets/{TrendUp01-DehiMCpc.js → TrendUp01-BBA3UF71.js} +1 -1
- package/dist/client/assets/{Upload01-DROOnA_X.js → Upload01-CURnTiOx.js} +1 -1
- package/dist/client/assets/{User01-DBp5CtcM.js → User01-CGWss5jM.js} +1 -1
- package/dist/client/assets/{UserSquare-CYgbi1K9.js → UserSquare-DNzPXyDT.js} +1 -1
- package/dist/client/assets/{Users01-D845Yde-.js → Users01-B043Q3B_.js} +1 -1
- package/dist/client/assets/{Users03-C_Br2__w.js → Users03-CeFJXyBc.js} +1 -1
- package/dist/client/assets/{XCircle-CJ79pnxP.js → XCircle-vpb-OIYV.js} +1 -1
- package/dist/client/assets/{XClose-BOvSf6KB.js → XClose-Ca1B07wN.js} +1 -1
- package/dist/client/assets/{YAxis-Db5uj_c4.js → YAxis-CEmbkD2K.js} +1 -1
- package/dist/client/assets/{Zap-CYPfTI6g.js → Zap-DoBPpnDg.js} +1 -1
- package/dist/client/assets/{ZapSquare-Cx_Z2jAm.js → ZapSquare-B52zBMI0.js} +1 -1
- package/dist/client/assets/{access-gate-nqfyC3Gn.js → access-gate-BT3_V_pA.js} +1 -1
- package/dist/client/assets/{agent-icon-BM9CQspm.js → agent-icon-Dt8TTBNR.js} +1 -1
- package/dist/client/assets/{agents-list-SA81MynM.js → agents-list-BVmLhzQp.js} +1 -1
- package/dist/client/assets/{ai-providers-D2GbZlGj.js → ai-providers-nCIA03hu.js} +1 -1
- package/dist/client/assets/{alert-BIAyvh7L.js → alert-CVrfLuO_.js} +1 -1
- package/dist/client/assets/{alert-dialog-CJVL1k9x.js → alert-dialog-COKsRPdB.js} +1 -1
- package/dist/client/assets/{api-keys-CXhaSQ6j.js → api-keys-B2kzULLm.js} +1 -1
- package/dist/client/assets/{app-editor-B9KTkNWs.js → app-editor-Bq3jQAI6.js} +1 -1
- package/dist/client/assets/{auth-D0FayD-s.js → auth-Dff1xvcy.js} +1 -1
- package/dist/client/assets/{auth-catchall-QibEwR3X.js → auth-catchall-BXu-XwcE.js} +1 -1
- package/dist/client/assets/{auth-entry-BtLGTg0e.js → auth-entry-BjUIXBC9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DYtiT43v.js → auth-split-layout-DyTFtZvs.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-t3Fvmhc7.js → authenticate-and-persist-oauth-BpXFlbw1.js} +1 -1
- package/dist/client/assets/{automation-list-row-C9Xx9zFJ.js → automation-list-row-BcptvIDe.js} +1 -1
- package/dist/client/assets/{automation-runs-BwVIBljL.js → automation-runs-l52V2CDe.js} +1 -1
- package/dist/client/assets/{automations-aoyy5Tgb.js → automations-A1r9cPLm.js} +1 -1
- package/dist/client/assets/{avatar-CqQE-eFC.js → avatar-CKLVepem.js} +1 -1
- package/dist/client/assets/{badge-D3zUUYug.js → badge-B2mtA9Oj.js} +1 -1
- package/dist/client/assets/{block-document-IwRwz7ED.js → block-document-CTUlzaXj.js} +1 -1
- package/dist/client/assets/{buckets-B3b8N6K4.js → buckets-CqwW0fPK.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BLNvVNKk.js → bulk-category-panel-DOf0qDJu.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bc2xBDB9.js → capability-load-error-Bu1DMqyM.js} +1 -1
- package/dist/client/assets/{cards-B6201d9G.js → cards-CnXEidEU.js} +1 -1
- package/dist/client/assets/{category-editor-BHIciUgg.js → category-editor-C2Penmxb.js} +1 -1
- package/dist/client/assets/{chart-wUtBUsj3.js → chart-mQfq8dm_.js} +1 -1
- package/dist/client/assets/{chat-context-PKiduEXT.js → chat-context-IctGRlpl.js} +1 -1
- package/dist/client/assets/{checkbox-BZ02x3Tw.js → checkbox-DjvUsSry.js} +1 -1
- package/dist/client/assets/{choose-editor-BtzA0fpx.js → choose-editor-D2hlr7Vq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B4esG6lN.js → cli-auth-success-odBhJDfC.js} +1 -1
- package/dist/client/assets/{collection-detail-BS7drL1-.js → collection-detail-EdlXGuH5.js} +1 -1
- package/dist/client/assets/{collection-display-button-B8yEu5fQ.js → collection-display-button-BeWwcB8v.js} +1 -1
- package/dist/client/assets/{collection-search-CksSLFKw.js → collection-search-BcNT9wqV.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B1nDVamJ.js → collection-table-wrapper-DEX-95qA.js} +1 -1
- package/dist/client/assets/{collection-tabs-Lyg-Hx2-.js → collection-tabs-QBx9fiO8.js} +1 -1
- package/dist/client/assets/{command-UPps-OHa.js → command-Bciip2fK.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-DLZSaK6E.js → commerce-onboarding-BrgV_E6e.js} +1 -1
- package/dist/client/assets/{connect-Dl1amKXS.js → connect-CJeRXYpO.js} +1 -1
- package/dist/client/assets/{connection-eRnJdwGa.js → connection-CIVlVP4z.js} +1 -1
- package/dist/client/assets/{connection-card-CmsTkv4b.js → connection-card-DLmi_xFL.js} +1 -1
- package/dist/client/assets/{connection-detail-Bu9QL2mf.js → connection-detail-DLHrsg7S.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BP-W1_HA.js → connection-form-helpers-Bd1zJpcE.js} +1 -1
- package/dist/client/assets/{connections-PrZkDDXx.js → connections-CaZTNlzO.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CzhRRg62.js → decopilot-sse-pool-0EWVughz.js} +1 -1
- package/dist/client/assets/{dialog-BQ-t4CF4.js → dialog-BVOhf6JL.js} +1 -1
- package/dist/client/assets/{domain-settings-BE1sHvud.js → domain-settings-1pFiPcDs.js} +1 -1
- package/dist/client/assets/{drawer-Db54djTH.js → drawer-ygpURzdE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dl9RzbmM.js → dropdown-menu-BpdWhSA7.js} +1 -1
- package/dist/client/assets/{empty-state-Z6jBJyBE.js → empty-state-CMCoRH7w.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B6RBsrzJ.js → extract-connection-data-BRWpOoZu.js} +1 -1
- package/dist/client/assets/{file-explorer-Dal-wJwB.js → file-explorer-DLBtkOjU.js} +1 -1
- package/dist/client/assets/{file-type-icon-k6QIypVu.js → file-type-icon-DQDAdTqu.js} +1 -1
- package/dist/client/assets/{form-WUWViVui.js → form-DJoSkHk7.js} +1 -1
- package/dist/client/assets/{general-DujFYF7x.js → general-CBRT6s1c.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CntGYv-N.js → github-repo-picker-CPPjWOCA.js} +1 -1
- package/dist/client/assets/{hooks-APRq5B-N.js → hooks-CtnSCLIe.js} +1 -1
- package/dist/client/assets/{index-HRPiQFML.js → index-AZvP0lkz.js} +1 -1
- package/dist/client/assets/{index-ChJw-ECJ.js → index-BJiFP4oP.js} +1 -1
- package/dist/client/assets/{index-CzegzpSG.js → index-BeW-gOXM.js} +1 -1
- package/dist/client/assets/{index-C9ncfe5m.js → index-Bks1FS3f.js} +1 -1
- package/dist/client/assets/{index-C6_zR0Yd.js → index-CVkGlHYs.js} +1 -1
- package/dist/client/assets/{index-PlC49IUs.js → index-D9nsJyXn.js} +49 -49
- package/dist/client/assets/{index-CCWpCA-G.js → index-DTM9lZbn.js} +1 -1
- package/dist/client/assets/{index-CHh53Mp2.js → index-DZsKkAKU.js} +1 -1
- package/dist/client/assets/{index-B5R-ECHm.js → index-fZpMDfe6.js} +6 -6
- package/dist/client/assets/{index-redirect-Bt9f84nm.js → index-redirect-iRkpwVGO.js} +1 -1
- package/dist/client/assets/{index-D_lsHUtB.js → index-xXm-vpSs.js} +1 -1
- package/dist/client/assets/{infra-billing-BycQSWPo.js → infra-billing-DFpE7R9j.js} +1 -1
- package/dist/client/assets/{input-DSE7gQf1.js → input-v4c8p5Ob.js} +1 -1
- package/dist/client/assets/{integration-icon-BNk_AQRx.js → integration-icon-DKqG-Mpx.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CGe2Esmt.js → invite-member-dialog-3-Aihs7O.js} +1 -1
- package/dist/client/assets/{label-bKnld9-e.js → label-DOL_dkX5.js} +1 -1
- package/dist/client/assets/{layout-C3s_EyAE.js → layout-DHLrZup9.js} +1 -1
- package/dist/client/assets/{login-DgncbZDD.js → login-BAB1aLje.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CIUwYU01.js → mcp-oauth-MtFdjicX.js} +1 -1
- package/dist/client/assets/{members-fD3fuIPu.js → members-jHzwIadJ.js} +1 -1
- package/dist/client/assets/{monaco-editor-DfjGwIkC.js → monaco-editor-DOnHAZIR.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DbN6Nmjk.js → monitoring-stats-row-8XgEvO3D.js} +1 -1
- package/dist/client/assets/{multi-select-CbMJAEZF.js → multi-select-DxScFuSI.js} +1 -1
- package/dist/client/assets/{oauth-callback-WOxNsdHY.js → oauth-callback-DTWHq_Fr.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Bu-7l7W1.js → oauth-callback-ai-provider-DjoClVq8.js} +1 -1
- package/dist/client/assets/{onboarding-GV1YOUZx.js → onboarding-CyYYA_IO.js} +1 -1
- package/dist/client/assets/{org-layout-KMgFYnEn.js → org-layout-DsGm5b87.js} +1 -1
- package/dist/client/assets/{organization-choice-BdlZTNZ2.js → organization-choice-WY-H2NEY.js} +1 -1
- package/dist/client/assets/{orgs-DpFCZKGa.js → orgs-DggiyP30.js} +1 -1
- package/dist/client/assets/{page-seo-form-yEkuPmLs.js → page-seo-form-BoZrAFLO.js} +1 -1
- package/dist/client/assets/{popover-DH9TTdnh.js → popover-DSZP75un.js} +1 -1
- package/dist/client/assets/{post-calendar-_wAnd4hS.js → post-calendar-BTuD64kJ.js} +1 -1
- package/dist/client/assets/{post-editor-DmIGTBNC.js → post-editor-Dwh3Mrlh.js} +1 -1
- package/dist/client/assets/{primitives-ryVKph93.js → primitives-aZbwao0Z.js} +1 -1
- package/dist/client/assets/{profile-C8UuIsP3.js → profile-B_6pDwzu.js} +1 -1
- package/dist/client/assets/{project-app-view-MsPnD9gX.js → project-app-view-LijoL6le.js} +1 -1
- package/dist/client/assets/record-editor-BJycqOk0.js +1 -0
- package/dist/client/assets/{redirect-editor-Bd2rrLYO.js → redirect-editor-bt0UR5sd.js} +1 -1
- package/dist/client/assets/registry-D7lhOlQc.js +2 -0
- package/dist/client/assets/{registry-layout-Dc0H0ATx.js → registry-layout-Da3tVRcY.js} +1 -1
- package/dist/client/assets/{reports-CiLAvKnY.js → reports-DjBTZdT2.js} +1 -1
- package/dist/client/assets/{require-capability-BwuG9o3e.js → require-capability-CF9r_mzF.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DoToYqRI.js → required-auth-layout-XqEbPK8M.js} +1 -1
- package/dist/client/assets/{reset-password-tKjrzuH3.js → reset-password-DEL_G7hS.js} +1 -1
- package/dist/client/assets/{roles-zeeKTIgv.js → roles-DDOKq874.js} +1 -1
- package/dist/client/assets/{search-input-Bghs_Bjp.js → search-input-4SLm_iMt.js} +1 -1
- package/dist/client/assets/{secrets-BGwFAxtw.js → secrets-CJLKcRa3.js} +1 -1
- package/dist/client/assets/{sections-editor-g-gezo78.js → sections-editor-CLwG1W2k.js} +1 -1
- package/dist/client/assets/{select-D5jnyj0l.js → select-D9OtHuoQ.js} +1 -1
- package/dist/client/assets/{select-model-DPpBxnrS.js → select-model-pYcHYqNY.js} +1 -1
- package/dist/client/assets/{self-tool-result-CIZIi6Il.js → self-tool-result-C2SaSBOS.js} +1 -1
- package/dist/client/assets/{seo-editor-DNcffLdI.js → seo-editor-DGd5xF_D.js} +1 -1
- package/dist/client/assets/{settings-layout-CLBsNOrx.js → settings-layout-UMPp-PK8.js} +1 -1
- package/dist/client/assets/{shell-controls-B3oa4qQr.js → shell-controls-CEjTnZRA.js} +1 -1
- package/dist/client/assets/{shell-layout-CAm70xM1.js → shell-layout-0_Y9WTC5.js} +1 -1
- package/dist/client/assets/{spinner-ClifCs3i.js → spinner-DnK6LAO-.js} +1 -1
- package/dist/client/assets/{sprints-C1R8b2UK.js → sprints-DTKQS9tP.js} +1 -1
- package/dist/client/assets/{sso-EV6PU76G.js → sso-Bj9k9yp_.js} +1 -1
- package/dist/client/assets/{store-DCevyKVu.js → store-DofhpRf4.js} +1 -1
- package/dist/client/assets/store-registry-Cuo4Kfxl.js +2 -0
- package/dist/client/assets/{switch-DXyXcz0k.js → switch-Dd8SWBtK.js} +1 -1
- package/dist/client/assets/{synced-repos-Db2YEWLj.js → synced-repos-0UH9NuJE.js} +1 -1
- package/dist/client/assets/{tab-id-C7NSeDZO.js → tab-id-W4sfonX1.js} +1 -1
- package/dist/client/assets/{table-BdiZmxkC.js → table-B28U6WCV.js} +1 -1
- package/dist/client/assets/{tabs-B1m4e_Lf.js → tabs-CNvz9wkq.js} +1 -1
- package/dist/client/assets/{task-key-DzvP3l3i.js → task-key-CTiJU5_h.js} +1 -1
- package/dist/client/assets/tasks-BsRXKJkD.js +1 -0
- package/dist/client/assets/{textarea-C8A1NtUt.js → textarea-BmWik9O5.js} +1 -1
- package/dist/client/assets/{toggle-group-B9nynTTu.js → toggle-group-B1ujv-Tj.js} +1 -1
- package/dist/client/assets/{toolbar-Dn87lyB_.js → toolbar-Cos-gS1a.js} +1 -1
- package/dist/client/assets/{track-BeWveGxs.js → track-Cth4u5b_.js} +1 -1
- package/dist/client/assets/{types-qEmgOr-R.js → types-Da-6shE5.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BWG1j4R3.js → use-ai-providers-bDkOAByr.js} +1 -1
- package/dist/client/assets/{use-api-keys-DpclRP6H.js → use-api-keys-Bi2l36nz.js} +1 -1
- package/dist/client/assets/{use-automations-CESfm05a.js → use-automations-BeKjYp7F.js} +1 -1
- package/dist/client/assets/{use-autosave-BRWbTp2x.js → use-autosave-ImljMikW.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BmMJ4C9l.js → use-clock-tick-BIn9fxJl.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-Ll9Jxlc1.js → use-commerce-diagnostic-UqRl5JGR.js} +1 -1
- package/dist/client/assets/{use-connection-CFAFM3Yj.js → use-connection-DJ5BvXkS.js} +1 -1
- package/dist/client/assets/{use-copy-Du-_RwSH.js → use-copy-BHeXFKUG.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DR7i4x1_.js → use-create-virtual-mcp-CTghZh27.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-44xRW5_u.js → use-debounced-autosave-BEoE5zu3.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D7E7obaB.js → use-debounced-value-d2xvAJAf.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-0HarKwn7.js → use-decopilot-events-U00f_DNo.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BUhVI2Tk.js → use-delete-connection-KttG6pDD.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CgvO-LhO.js → use-deployment-admin-BxGtVq0R.js} +1 -1
- package/dist/client/assets/{use-file-configs-BxpfXHj_.js → use-file-configs-ivKLtwVT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DSYZfzYp.js → use-infinite-scroll-C3woVgJJ.js} +1 -1
- package/dist/client/assets/{use-join-requests-BPFfkf2j.js → use-join-requests-Ce2D10xE.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bu-g594J.js → use-mcp-client-BixLZLmc.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dtn2uWjv.js → use-mcp-tools-DhYUR3cu.js} +1 -1
- package/dist/client/assets/{use-members-yMUdTS3F.js → use-members-DqBCB9wB.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CioCH7VJ.js → use-navigate-to-agent-COcz3Nee.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DZGh6wmi.js → use-org-auth-client-Bm7ydyvS.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CwiMJzn0.js → use-org-repo-syncs-B_4SIVWY.js} +1 -1
- package/dist/client/assets/{use-org-sso-CmTeA9vF.js → use-org-sso-9a_THghN.js} +1 -1
- package/dist/client/assets/{use-organization-roles-fAKqyPgr.js → use-organization-roles-CNEl3NFe.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DeS0wGS3.js → use-organization-settings-B4nKr0f2.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DENDz1rF.js → use-registry-connections-C7LyRS1M.js} +1 -1
- package/dist/client/assets/{use-secrets-7WKBJtby.js → use-secrets-Chh3ojOY.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Dy0el1qx.js → use-section-preview-base-Db24sM6t.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Dk4EoSoR.js → use-status-sounds-DFis4MWx.js} +1 -1
- package/dist/client/assets/{use-tags-CrW3MALx.js → use-tags-DSiXReOW.js} +1 -1
- package/dist/client/assets/{use-view-mode-D5UH6KwN.js → use-view-mode-5S7L8whl.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DKc17TzC.js → use-virtual-mcp-CxECG99q.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D6nR9UJf.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BfIWoPo8.js +1 -0
- package/dist/client/assets/{users-CSsRTguV.js → users-DegqgBxw.js} +1 -1
- package/dist/client/assets/{variant-calendar-CBFu2wjk.js → variant-calendar-Ca_JbtN7.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-NiXmRgSR.js → view-mode-toggle-rkJlH4vl.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +506 -506
- package/dist/server/server.js +344 -344
- package/package.json +1 -1
- package/dist/client/assets/record-editor-C-RsaIun.js +0 -1
- package/dist/client/assets/registry-DN_clZPu.js +0 -2
- package/dist/client/assets/store-registry--a7H-Hfk.js +0 -2
- package/dist/client/assets/tasks-DEqOIdPE.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CtQupOcz.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DsYLPBXT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,x as Ae,aR as De,t as le,B as ne,aT as Ie,H as ye,p as Le,a as Te,r as X,o as Ee,K as de,e as Fe,q as V,I as ke,n as Me,P as ce}from"./index-B5R-ECHm.js";import{a as re,b as we,D as ue,c as pe}from"./dropdown-menu-Dl9RzbmM.js";import{a as Pe}from"./Users03-C_Br2__w.js";import{G as Se,b as Ge,a as Oe}from"./github-repo-picker-CntGYv-N.js";import{u as ze,b as Be,c as Ue}from"./use-virtual-mcp-DKc17TzC.js";import{a as Re}from"./DotsVertical-DmFi_5m5.js";import{A as $e,f as fe,b0 as He}from"./agent-icon-BM9CQspm.js";import{a as Ve}from"./Settings02-CDWROrkG.js";import{s as Ke}from"./Trash01-DoWKJDZO.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-CioCH7VJ.js";import{g as Qe,j as Je}from"./use-organization-settings-DeS0wGS3.js";import{E as Ye}from"./empty-state-Z6jBJyBE.js";import{u as We}from"./use-create-virtual-mcp-DR7i4x1_.js";import{u as Xe}from"./use-connection-CFAFM3Yj.js";import{u as xe}from"./use-mcp-client-Bu-g594J.js";import{S as Ze}from"./constants-_08zpzmT.js";import{b as et,c as je}from"./session-runtime-wVXsCwcJ.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-BQ-t4CF4.js";import{i as dt}from"./ArrowLeft-B5SdDJS5.js";import{C as ut}from"./collection-search-CksSLFKw.js";import{c as pt,d as gt,b as ft,f as ht,g as xt,e as jt,a as Ct,A as bt}from"./alert-dialog-CJVL1k9x.js";import{S as Dt}from"./search-input-Bghs_Bjp.js";import{s as Ce}from"./Plus-DeCuWgpG.js";import"./Check-KqwAmcDj.js";import"./ChevronRight-Bq8eLOWM.js";import"./use-debounced-value-D7E7obaB.js";import"./authenticate-and-persist-oauth-t3Fvmhc7.js";import"./mcp-oauth-CIUwYU01.js";import"./auth-D0FayD-s.js";import"./LinkExternal01-DY154voS.js";import"./LockUnlocked01-BUPOcE7Q.js";import"./use-mcp-tools-Dtn2uWjv.js";import"./extract-connection-data-B6RBsrzJ.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-d_jYW-pF.js";import"./Tool01-TcrXKmnF.js";import"./ArrowUp-DmYjuyWi.js";import"./Tool02-DWE9dUHc.js";import"./XCircle-CJ79pnxP.js";import"./TrendUp01-DehiMCpc.js";import"./ZapSquare-Cx_Z2jAm.js";import"./UserSquare-CYgbi1K9.js";import"./CheckCircle-DuO-pGO-.js";import"./ChevronDown-BQZF9Af9.js";import"./ChevronSelectorVertical-DrHEbUrw.js";import"./ChevronUp-BnjYp300.js";import"./Stars02-NRIRt4tn.js";import"./Copy01-DQMklNBZ.js";import"./CreditCard01-ayJva4-L.js";import"./Download01-BCA2ING7.js";import"./Eye-CRgVrt0h.js";import"./FilterLines-D6T5uoZ8.js";import"./Share07-rauAL5Pr.js";import"./Globe01-KXkuiG0o.js";import"./Globe04-kFCzhDtq.js";import"./SwitchHorizontal01-BLilv7ln.js";import"./HardDrive-IGVDCiH-.js";import"./Key01-zoXnVGpi.js";import"./LogOut01-vFXcKA44.js";import"./Monitor01-IMrl8-Sz.js";import"./Sun-BDdwc-Zh.js";import"./Palette-CO-9fV73.js";import"./Play-Cnds4faY.js";import"./SearchLg-LSbMLZI6.js";import"./SearchMd-C6SjxYyL.js";import"./Shield01-CJQrmrbA.js";import"./Stars01-DqVhL0wf.js";import"./Upload01-DROOnA_X.js";import"./User01-DBp5CtcM.js";import"./Users01-D845Yde-.js";import"./XClose-BOvSf6KB.js";import"./Zap-CYPfTI6g.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-APRq5B-N.js";import"./decopilot-sse-pool-CzhRRg62.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CzvRy4Pe.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:M,showBetaBadge:x}=t,P=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Pe,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Se,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&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]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==P||e[23]!==M||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(we,{side:M,align:P,className:"w-48",children:[D,l,w]}),e[22]=P,e[23]=M,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[M]=Ae(),x=M.language==="pt-BR"?qe:void 0,{mainAgentId:P}=Qe(),d=Je(),{granted:T}=De("org:manage"),m=P===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx($e,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Re,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(Ve,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(we,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=N):N=e[40];let G;e[41]!==v||e[42]!==N?(G=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,e[43]=G):G=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==G||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[G,s]}),e[46]=G,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let _;e[57]!==b?(_=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:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Ie,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function St(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function Nt(t){return ve(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=ye(),f=_e(),c=Le(),{data:M}=Te.useSession(),[x,P]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Ge({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Ee({queryKey:de.decoSites(M?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!M?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(P(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),G=!x||N.some(s=>s.name===x),F=Fe({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),R=B.connId;if(!R)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=R;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:R,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:R},{connection_id:$}]}}}),U=Q.structuredContent??Q;if(!U.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=U.item.id,{slug:Z,virtualMcpId:U.item.id,connId:R,item:U.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),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??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&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:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.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(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&S.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:[N.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>P(s.name),className:Me("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"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:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.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:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!G||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ss(){const t=ge.c(77),e=me(),{org:i}=ye(),n=ze(),r=Be(),[f,c]=X.useState("");let M;t[0]===Symbol.for("react.memo_cache_sentinel")?(M={navigateOnCreate:!0},t[0]=M):M=t[0];const{createVirtualMCP:x,isCreating:P}=We(M),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=De("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Ue(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:Ne}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ne}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=t[10];let G;t[11]===Symbol.for("react.memo_cache_sentinel")?(G=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=G):G=t[11];let F;t[12]!==f||t[13]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:G}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==P||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:P,align:"end"})]}),t[15]=a,t[16]=x,t[17]=P,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx(He,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:P,align:"center",showBetaBadge:!0})]})})}),_=h.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:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Oe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let R;t[38]===Symbol.for("react.memo_cache_sentinel")?(R=L=>!L&&T(null),t[38]=R):R=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let U;t[53]!==e?(U=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=U):U=t[54];let H;t[55]!==U?(H=o.jsx(ht,{children:U}),t[55]=U,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:R,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ss as default};
|
|
1
|
+
import{c as ge,b as me,j as o,x as Ae,aR as De,t as le,B as ne,aT as Ie,H as ye,p as Le,a as Te,r as X,o as Ee,K as de,e as Fe,q as V,I as ke,n as Me,P as ce}from"./index-fZpMDfe6.js";import{a as re,b as we,D as ue,c as pe}from"./dropdown-menu-BpdWhSA7.js";import{a as Pe}from"./Users03-CeFJXyBc.js";import{G as Se,b as Ge,a as Oe}from"./github-repo-picker-CPPjWOCA.js";import{u as ze,b as Be,c as Ue}from"./use-virtual-mcp-CxECG99q.js";import{a as Re}from"./DotsVertical-C5qhPHKZ.js";import{A as $e,f as fe,b0 as He}from"./agent-icon-Dt8TTBNR.js";import{a as Ve}from"./Settings02-BXfVk1mb.js";import{s as Ke}from"./Trash01-rd-vb1MA.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-COcz3Nee.js";import{g as Qe,j as Je}from"./use-organization-settings-B4nKr0f2.js";import{E as Ye}from"./empty-state-CMCoRH7w.js";import{u as We}from"./use-create-virtual-mcp-CTghZh27.js";import{u as Xe}from"./use-connection-DJ5BvXkS.js";import{u as xe}from"./use-mcp-client-BixLZLmc.js";import{S as Ze}from"./constants-_08zpzmT.js";import{b as et,c as je}from"./session-runtime-wVXsCwcJ.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-BVOhf6JL.js";import{i as dt}from"./ArrowLeft-BDtQVDZJ.js";import{C as ut}from"./collection-search-BcNT9wqV.js";import{c as pt,d as gt,b as ft,f as ht,g as xt,e as jt,a as Ct,A as bt}from"./alert-dialog-COKsRPdB.js";import{S as Dt}from"./search-input-4SLm_iMt.js";import{s as Ce}from"./Plus-DJBOKCXM.js";import"./Check-CFdAuLVR.js";import"./ChevronRight-Bt0Ps5hy.js";import"./use-debounced-value-d2xvAJAf.js";import"./authenticate-and-persist-oauth-BpXFlbw1.js";import"./mcp-oauth-MtFdjicX.js";import"./auth-Dff1xvcy.js";import"./LinkExternal01-CDWxDAhW.js";import"./LockUnlocked01-BJDlnHNP.js";import"./use-mcp-tools-DhYUR3cu.js";import"./extract-connection-data-BRWpOoZu.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-DL3U1yq7.js";import"./Tool01-D15DzDIB.js";import"./ArrowUp-DUua93WQ.js";import"./Tool02-DcVuymPV.js";import"./XCircle-vpb-OIYV.js";import"./TrendUp01-BBA3UF71.js";import"./ZapSquare-B52zBMI0.js";import"./UserSquare-DNzPXyDT.js";import"./CheckCircle-Ccs86bUg.js";import"./ChevronDown-Bh9AZv82.js";import"./ChevronSelectorVertical-CbP69kXl.js";import"./ChevronUp-CYbM4ZwP.js";import"./Stars02-BEZaBHTc.js";import"./Copy01-CKmyRUyl.js";import"./CreditCard01-DXJKk1Wt.js";import"./Download01-DZdiDQUS.js";import"./Eye-DFHNhYtx.js";import"./FilterLines-C01-F8gV.js";import"./Share07-DRhhhSu7.js";import"./Globe01-qBOiIpcJ.js";import"./Globe04-DyPo8R4R.js";import"./SwitchHorizontal01-BPoIdNhd.js";import"./HardDrive-DMA6WwJi.js";import"./Key01-CQ2Pckpa.js";import"./LogOut01-DYTwrIyB.js";import"./Monitor01-CW9D8oQR.js";import"./Sun-CxlEqCDi.js";import"./Palette-CYMwYnzJ.js";import"./Play-D5VBgg81.js";import"./SearchLg-D05XfMH4.js";import"./SearchMd-Bvk6cmtM.js";import"./Shield01--vYJckXn.js";import"./Stars01-Cfn7XpKF.js";import"./Upload01-CURnTiOx.js";import"./User01-CGWss5jM.js";import"./Users01-B043Q3B_.js";import"./XClose-Ca1B07wN.js";import"./Zap-DoBPpnDg.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-CtnSCLIe.js";import"./decopilot-sse-pool-0EWVughz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CzvRy4Pe.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:M,showBetaBadge:x}=t,P=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Pe,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Se,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&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]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==P||e[23]!==M||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(we,{side:M,align:P,className:"w-48",children:[D,l,w]}),e[22]=P,e[23]=M,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[M]=Ae(),x=M.language==="pt-BR"?qe:void 0,{mainAgentId:P}=Qe(),d=Je(),{granted:T}=De("org:manage"),m=P===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx($e,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Re,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(Ve,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(we,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=N):N=e[40];let G;e[41]!==v||e[42]!==N?(G=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,e[43]=G):G=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==G||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[G,s]}),e[46]=G,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let _;e[57]!==b?(_=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:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Ie,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function St(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function Nt(t){return ve(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=ye(),f=_e(),c=Le(),{data:M}=Te.useSession(),[x,P]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Ge({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Ee({queryKey:de.decoSites(M?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!M?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(P(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),G=!x||N.some(s=>s.name===x),F=Fe({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),R=B.connId;if(!R)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=R;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:R,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:R},{connection_id:$}]}}}),U=Q.structuredContent??Q;if(!U.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=U.item.id,{slug:Z,virtualMcpId:U.item.id,connId:R,item:U.item}}catch(B){throw await J(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(ke.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),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??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&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:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.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(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&S.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:[N.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>P(s.name),className:Me("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"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:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.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:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!G||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ss(){const t=ge.c(77),e=me(),{org:i}=ye(),n=ze(),r=Be(),[f,c]=X.useState("");let M;t[0]===Symbol.for("react.memo_cache_sentinel")?(M={navigateOnCreate:!0},t[0]=M):M=t[0];const{createVirtualMCP:x,isCreating:P}=We(M),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=De("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Ue(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:Ne}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ne}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=t[10];let G;t[11]===Symbol.for("react.memo_cache_sentinel")?(G=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=G):G=t[11];let F;t[12]!==f||t[13]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:G}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==P||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:P,align:"end"})]}),t[15]=a,t[16]=x,t[17]=P,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx(He,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:P,align:"center",showBetaBadge:!0})]})})}),_=h.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:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Oe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=t[37];const B=!!d;let R;t[38]===Symbol.for("react.memo_cache_sentinel")?(R=L=>!L&&T(null),t[38]=R):R=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let U;t[53]!==e?(U=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=U):U=t[54];let H;t[55]!==U?(H=o.jsx(ht,{children:U}),t[55]=U,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:R,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ss as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as G,b as se,ap as Qe,ao as Ye,r as Q,j as s,as as gt,d8 as Te,t as ee,d7 as be,d6 as Ee,aX as We,db as Xe,dc as xt,n as Pe,aR as ht,H as ye,av as le,K as J,o as De,B as Z,k as $e,Y as Ie,p as Se,e as re,x as Ze,q as Fe,ak as vt,am as we,da as bt}from"./index-B5R-ECHm.js";import{i as yt}from"./AlertCircle-d_jYW-pF.js";import{u as Je,b as _e,i as jt,c as St,p as Nt,d as Re,e as Ct,f as et}from"./use-ai-providers-BWG1j4R3.js";import{i as _t}from"./CheckCircle-DuO-pGO-.js";import{c as Pt,S as It,l as kt}from"./use-organization-settings-DeS0wGS3.js";import{c as Dt,u as Ue,d as tt,P as Kt,C as Be}from"./select-model-DPpBxnrS.js";import{u as wt}from"./use-debounced-autosave-44xRW5_u.js";import{i as ze}from"./CreditCard01-ayJva4-L.js";import{B as Ae}from"./badge-D3zUUYug.js";import{I as je}from"./input-DSE7gQf1.js";import{a as He,T as At}from"./toggle-group-B9nynTTu.js";import{c as st,d as it,b as lt,f as rt,g as nt,e as ot,a as at,A as ct}from"./alert-dialog-CJVL1k9x.js";import{s as Tt}from"./Plus-DeCuWgpG.js";import{p as Et,f as Rt}from"./pt-BR-CLy76QW2.js";import{b as Mt}from"./Tool01-TcrXKmnF.js";import{s as Ot}from"./Trash01-DoWKJDZO.js";import{A as $t}from"./avatar-CqQE-eFC.js";import{P as Ft}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ut}from"./Settings02-CDWROrkG.js";import{s as Bt}from"./Eye-CRgVrt0h.js";import{b as zt,a as Ht,d as qt,e as Lt,c as Vt}from"./dialog-BQ-t4CF4.js";import{S as Gt}from"./spinner-ClifCs3i.js";import{R as Qt}from"./require-capability-BwuG9o3e.js";import"./constants-_08zpzmT.js";import"./drawer-Db54djTH.js";import"./chat-context-PKiduEXT.js";import"./tab-id-C7NSeDZO.js";import"./Check-KqwAmcDj.js";import"./Copy01-DQMklNBZ.js";import"./Download01-BCA2ING7.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-APRq5B-N.js";import"./use-mcp-client-Bu-g594J.js";import"./auth-D0FayD-s.js";import"./decopilot-sse-pool-CzhRRg62.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DKc17TzC.js";import"./use-decopilot-events-0HarKwn7.js";import"./checkbox-BZ02x3Tw.js";import"./select-D5jnyj0l.js";import"./ChevronDown-BQZF9Af9.js";import"./ChevronUp-BnjYp300.js";import"./ArrowLeft-B5SdDJS5.js";import"./ChevronSelectorVertical-DrHEbUrw.js";import"./Key01-zoXnVGpi.js";import"./SearchMd-C6SjxYyL.js";import"./Monitor01-IMrl8-Sz.js";import"./ChevronRight-Bq8eLOWM.js";import"./Stars01-DqVhL0wf.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-DBp5CtcM.js";import"./access-gate-nqfyC3Gn.js";import"./capability-load-error-Bc2xBDB9.js";const Yt=e=>e.capabilities?.includes("image")===!0,Wt=e=>jt(e),Xt=e=>St(e),Zt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Yt},{key:"web_search",filter:Wt},{key:"deep_research",filter:Xt}];function Jt(e){const t=G.c(30),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Je(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,h]=Q.useState(l??a);let _,o;t[0]!==l?(_=()=>{l&&h(l)},o=[l],t[0]=l,t[1]=_,t[2]=o):(_=t[1],o=t[2]),Q.useEffect(_,o);let u;t[3]!==c||t[4]!==a||t[5]!==d?(u=c.some(b=>b.id===d)?d:a,t[3]=c,t[4]=a,t[5]=d,t[6]=u):u=t[6];const f=u;let p;t[7]!==f||t[8]!==c?(p=f?c.find(b=>b.id===f):null,t[7]=f,t[8]=c,t[9]=p):p=t[9];const y=p,{models:j,isLoading:P}=_e(n?f??void 0:void 0),x=n?P||j.some(n):!0;let C;t[10]!==i||t[11]!==y?.providerId||t[12]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:y?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=y?.providerId,t[12]=l,t[13]=C):C=t[13];const k=C,g=se();if(n&&!x){let b;t[14]!==g?(b=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=b):b=t[15];let D;return t[16]!==b?(D=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[16]=b,t[17]=D):D=t[17],D}let v;t[18]!==g?(v=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=v):v=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=b=>h(b),t[20]=S):S=t[20];let m;t[21]!==f||t[22]!==r?(m=b=>{const D=b.keyId??f??"";h(D),r({keyId:D,modelId:b.modelId,title:b.title})},t[21]=f,t[22]=r,t[23]=m):m=t[23];let N;return t[24]!==f||t[25]!==n||t[26]!==k||t[27]!==v||t[28]!==m?(N=s.jsx(Dt,{variant:"bordered",placeholder:v,model:k,credentialId:f,filterModels:n,onCredentialChange:S,onModelChange:m}),t[24]=f,t[25]=n,t[26]=k,t[27]=v,t[28]=m,t[29]=N):N=t[29],N}function es(e){const t=G.c(10),{isPending:i,showSaved:r}=e,n=se();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(We,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,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:[a,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(_t,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,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:[a,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function ts(){const e=G.c(58),t=se(),i=Je(),r=Pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Qe(It),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Ye(c),{mutate:d,isPending:h,isSuccess:_}=kt(),o=l.formState.isDirty;let u;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(u={delayMs:250,save:async()=>{const I=l.getValues();d(I,{onSuccess:()=>l.reset(I,{keepValues:!0}),onError:T=>{l.reset(r),ee.error(t("settings.simpleModeSection.failedToSave",{error:T.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=u):u=e[7];const{schedule:f}=wt(u),p=i[0],y=i[1],j=i[2],{models:P}=_e(p?.id),{models:x}=_e(y?.id),{models:C}=_e(j?.id);let k,g;e[8]!==l||e[9]!==n?(k=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[n,l],e[8]=l,e[9]=n,e[10]=k,e[11]=g):(k=e[10],g=e[11]),Q.useEffect(k,g);let v;e[12]!==i||e[13]!==l||e[14]!==p||e[15]!==y||e[16]!==j||e[17]!==P||e[18]!==x||e[19]!==C?(v=()=>{const I=l.getValues(),T=new Set(i.map(ss)),O={};p?.id&&(O[p.id]=P),y?.id&&(O[y.id]=x),j?.id&&(O[j.id]=C);const R=Y=>Y!=null&&!T.has(Y.keyId),K={fast:R(I.tiers.fast)?null:I.tiers.fast,smart:R(I.tiers.smart)?null:I.tiers.smart,thinking:R(I.tiers.thinking)?null:I.tiers.thinking,image:R(I.tiers.image)?null:I.tiers.image,web_search:R(I.tiers.web_search)?null:I.tiers.web_search,deep_research:R(I.tiers.deep_research)?null:I.tiers.deep_research},W=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,X=K.fast===I.tiers.fast&&K.smart===I.tiers.smart&&K.thinking===I.tiers.thinking&&K.image===I.tiers.image&&K.web_search===I.tiers.web_search&&K.deep_research===I.tiers.deep_research;if(!W&&X)return;const V=Nt(i,O);l.reset({tiers:{fast:K.fast??V.chat.fast,smart:K.smart??V.chat.smart,thinking:K.thinking??V.chat.thinking,image:K.image??V.image,web_search:K.web_search??V.webSearch,deep_research:K.deep_research??V.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=p,e[15]=y,e[16]=j,e[17]=P,e[18]=x,e[19]=C,e[20]=v):v=e[20];const S=p?.id,m=y?.id,N=j?.id;let b;e[21]!==i||e[22]!==l||e[23]!==P||e[24]!==x||e[25]!==C||e[26]!==S||e[27]!==m||e[28]!==N?(b=[l,i,P,x,C,S,m,N],e[21]=i,e[22]=l,e[23]=P,e[24]=x,e[25]=C,e[26]=S,e[27]=m,e[28]=N,e[29]=b):b=e[29],Q.useEffect(v,b);let D;e[30]!==t?(D=I=>({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")})[I]||I,e[30]=t,e[31]=D):D=e[31];const w=D;let A;e[32]!==t?(A=I=>({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")})[I]||"",e[32]=t,e[33]=A):A=e[33];const M=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let $;e[36]!==t?($=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=$):$=e[37];let H;e[38]!==$?(H=s.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=H):H=e[39];const L=_&&!o;let F;e[40]!==h||e[41]!==L?(F=s.jsx(es,{isPending:h,showSaved:L}),e[40]=h,e[41]=L,e[42]=F):F=e[42];let U;e[43]!==H||e[44]!==F?(U=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[H,F]}),e[43]=H,e[44]=F,e[45]=U):U=e[45];let B;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==M||e[49]!==w||e[50]!==f?(B=Zt.map(I=>s.jsx(gt,{control:l.control,name:`tiers.${I.key}`,render:T=>{const{field:O}=T;return s.jsx(Te,{title:w(I.key),description:M(I.key),action:s.jsx(Jt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:I.filter,onSlotChange:R=>{O.onChange(R),f()}})})}},I.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=M,e[49]=w,e[50]=f,e[51]=B):B=e[51];let z;e[52]!==B?(z=s.jsx(be,{children:B}),e[52]=B,e[53]=z):z=e[53];let q;return e[54]!==E||e[55]!==U||e[56]!==z?(q=s.jsxs(Ee,{title:E,headerClassName:"pl-0",children:[U,z]}),e[54]=E,e[55]=U,e[56]=z,e[57]=q):q=e[57],q}function ss(e){return e.id}var Me="Progress",Oe=100,[is]=xt(Me),[ls,rs]=is(Me),dt=Q.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:n,getValueLabel:a=ns,...c}=e;(n||n===0)&&!qe(n)&&console.error(os(`${n}`,"Progress"));const l=qe(n)?n:Oe;r!==null&&!Le(r,l)&&console.error(as(`${r}`,"Progress"));const d=Le(r,l)?r:null,h=ke(d)?a(d,l):void 0;return s.jsx(ls,{scope:i,value:d,max:l,children:s.jsx(Xe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ke(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":ft(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});dt.displayName=Me;var mt="ProgressIndicator",ut=Q.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,n=rs(mt,i);return s.jsx(Xe.div,{"data-state":ft(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...r,ref:t})});ut.displayName=mt;function ns(e,t){return`${Math.round(e/t*100)}%`}function ft(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ke(e){return typeof e=="number"}function qe(e){return ke(e)&&!isNaN(e)&&e>0}function Le(e,t){return ke(e)&&!isNaN(e)&&e<=t&&e>=0}function os(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Oe}\`.`}function as(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
1
|
+
import{c as G,b as se,ap as Qe,ao as Ye,r as Q,j as s,as as gt,d8 as Te,t as ee,d7 as be,d6 as Ee,aX as We,db as Xe,dc as xt,n as Pe,aR as ht,H as ye,av as le,K as J,o as De,B as Z,k as $e,Y as Ie,p as Se,e as re,x as Ze,q as Fe,ak as vt,am as we,da as bt}from"./index-fZpMDfe6.js";import{i as yt}from"./AlertCircle-DL3U1yq7.js";import{u as Je,b as _e,i as jt,c as St,p as Nt,d as Re,e as Ct,f as et}from"./use-ai-providers-bDkOAByr.js";import{i as _t}from"./CheckCircle-Ccs86bUg.js";import{c as Pt,S as It,l as kt}from"./use-organization-settings-B4nKr0f2.js";import{c as Dt,u as Ue,d as tt,P as Kt,C as Be}from"./select-model-pYcHYqNY.js";import{u as wt}from"./use-debounced-autosave-BEoE5zu3.js";import{i as ze}from"./CreditCard01-DXJKk1Wt.js";import{B as Ae}from"./badge-B2mtA9Oj.js";import{I as je}from"./input-v4c8p5Ob.js";import{a as He,T as At}from"./toggle-group-B1ujv-Tj.js";import{c as st,d as it,b as lt,f as rt,g as nt,e as ot,a as at,A as ct}from"./alert-dialog-COKsRPdB.js";import{s as Tt}from"./Plus-DJBOKCXM.js";import{p as Et,f as Rt}from"./pt-BR-CLy76QW2.js";import{b as Mt}from"./Tool01-D15DzDIB.js";import{s as Ot}from"./Trash01-rd-vb1MA.js";import{A as $t}from"./avatar-CKLVepem.js";import{P as Ft}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ut}from"./Settings02-BXfVk1mb.js";import{s as Bt}from"./Eye-DFHNhYtx.js";import{b as zt,a as Ht,d as qt,e as Lt,c as Vt}from"./dialog-BVOhf6JL.js";import{S as Gt}from"./spinner-DnK6LAO-.js";import{R as Qt}from"./require-capability-CF9r_mzF.js";import"./constants-_08zpzmT.js";import"./drawer-ygpURzdE.js";import"./chat-context-IctGRlpl.js";import"./tab-id-W4sfonX1.js";import"./Check-CFdAuLVR.js";import"./Copy01-CKmyRUyl.js";import"./Download01-DZdiDQUS.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-CtnSCLIe.js";import"./use-mcp-client-BixLZLmc.js";import"./auth-Dff1xvcy.js";import"./decopilot-sse-pool-0EWVughz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CxECG99q.js";import"./use-decopilot-events-U00f_DNo.js";import"./checkbox-DjvUsSry.js";import"./select-D9OtHuoQ.js";import"./ChevronDown-Bh9AZv82.js";import"./ChevronUp-CYbM4ZwP.js";import"./ArrowLeft-BDtQVDZJ.js";import"./ChevronSelectorVertical-CbP69kXl.js";import"./Key01-CQ2Pckpa.js";import"./SearchMd-Bvk6cmtM.js";import"./Monitor01-CW9D8oQR.js";import"./ChevronRight-Bt0Ps5hy.js";import"./Stars01-Cfn7XpKF.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-CGWss5jM.js";import"./access-gate-BT3_V_pA.js";import"./capability-load-error-Bu1DMqyM.js";const Yt=e=>e.capabilities?.includes("image")===!0,Wt=e=>jt(e),Xt=e=>St(e),Zt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Yt},{key:"web_search",filter:Wt},{key:"deep_research",filter:Xt}];function Jt(e){const t=G.c(30),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Je(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,h]=Q.useState(l??a);let _,o;t[0]!==l?(_=()=>{l&&h(l)},o=[l],t[0]=l,t[1]=_,t[2]=o):(_=t[1],o=t[2]),Q.useEffect(_,o);let u;t[3]!==c||t[4]!==a||t[5]!==d?(u=c.some(b=>b.id===d)?d:a,t[3]=c,t[4]=a,t[5]=d,t[6]=u):u=t[6];const f=u;let p;t[7]!==f||t[8]!==c?(p=f?c.find(b=>b.id===f):null,t[7]=f,t[8]=c,t[9]=p):p=t[9];const y=p,{models:j,isLoading:P}=_e(n?f??void 0:void 0),x=n?P||j.some(n):!0;let C;t[10]!==i||t[11]!==y?.providerId||t[12]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:y?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=y?.providerId,t[12]=l,t[13]=C):C=t[13];const k=C,g=se();if(n&&!x){let b;t[14]!==g?(b=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=b):b=t[15];let D;return t[16]!==b?(D=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[16]=b,t[17]=D):D=t[17],D}let v;t[18]!==g?(v=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=v):v=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=b=>h(b),t[20]=S):S=t[20];let m;t[21]!==f||t[22]!==r?(m=b=>{const D=b.keyId??f??"";h(D),r({keyId:D,modelId:b.modelId,title:b.title})},t[21]=f,t[22]=r,t[23]=m):m=t[23];let N;return t[24]!==f||t[25]!==n||t[26]!==k||t[27]!==v||t[28]!==m?(N=s.jsx(Dt,{variant:"bordered",placeholder:v,model:k,credentialId:f,filterModels:n,onCredentialChange:S,onModelChange:m}),t[24]=f,t[25]=n,t[26]=k,t[27]=v,t[28]=m,t[29]=N):N=t[29],N}function es(e){const t=G.c(10),{isPending:i,showSaved:r}=e,n=se();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(We,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,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:[a,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(_t,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,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:[a,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function ts(){const e=G.c(58),t=se(),i=Je(),r=Pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Qe(It),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Ye(c),{mutate:d,isPending:h,isSuccess:_}=kt(),o=l.formState.isDirty;let u;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(u={delayMs:250,save:async()=>{const I=l.getValues();d(I,{onSuccess:()=>l.reset(I,{keepValues:!0}),onError:T=>{l.reset(r),ee.error(t("settings.simpleModeSection.failedToSave",{error:T.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=u):u=e[7];const{schedule:f}=wt(u),p=i[0],y=i[1],j=i[2],{models:P}=_e(p?.id),{models:x}=_e(y?.id),{models:C}=_e(j?.id);let k,g;e[8]!==l||e[9]!==n?(k=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[n,l],e[8]=l,e[9]=n,e[10]=k,e[11]=g):(k=e[10],g=e[11]),Q.useEffect(k,g);let v;e[12]!==i||e[13]!==l||e[14]!==p||e[15]!==y||e[16]!==j||e[17]!==P||e[18]!==x||e[19]!==C?(v=()=>{const I=l.getValues(),T=new Set(i.map(ss)),O={};p?.id&&(O[p.id]=P),y?.id&&(O[y.id]=x),j?.id&&(O[j.id]=C);const R=Y=>Y!=null&&!T.has(Y.keyId),K={fast:R(I.tiers.fast)?null:I.tiers.fast,smart:R(I.tiers.smart)?null:I.tiers.smart,thinking:R(I.tiers.thinking)?null:I.tiers.thinking,image:R(I.tiers.image)?null:I.tiers.image,web_search:R(I.tiers.web_search)?null:I.tiers.web_search,deep_research:R(I.tiers.deep_research)?null:I.tiers.deep_research},W=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,X=K.fast===I.tiers.fast&&K.smart===I.tiers.smart&&K.thinking===I.tiers.thinking&&K.image===I.tiers.image&&K.web_search===I.tiers.web_search&&K.deep_research===I.tiers.deep_research;if(!W&&X)return;const V=Nt(i,O);l.reset({tiers:{fast:K.fast??V.chat.fast,smart:K.smart??V.chat.smart,thinking:K.thinking??V.chat.thinking,image:K.image??V.image,web_search:K.web_search??V.webSearch,deep_research:K.deep_research??V.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=p,e[15]=y,e[16]=j,e[17]=P,e[18]=x,e[19]=C,e[20]=v):v=e[20];const S=p?.id,m=y?.id,N=j?.id;let b;e[21]!==i||e[22]!==l||e[23]!==P||e[24]!==x||e[25]!==C||e[26]!==S||e[27]!==m||e[28]!==N?(b=[l,i,P,x,C,S,m,N],e[21]=i,e[22]=l,e[23]=P,e[24]=x,e[25]=C,e[26]=S,e[27]=m,e[28]=N,e[29]=b):b=e[29],Q.useEffect(v,b);let D;e[30]!==t?(D=I=>({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")})[I]||I,e[30]=t,e[31]=D):D=e[31];const w=D;let A;e[32]!==t?(A=I=>({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")})[I]||"",e[32]=t,e[33]=A):A=e[33];const M=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let $;e[36]!==t?($=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=$):$=e[37];let H;e[38]!==$?(H=s.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=H):H=e[39];const L=_&&!o;let F;e[40]!==h||e[41]!==L?(F=s.jsx(es,{isPending:h,showSaved:L}),e[40]=h,e[41]=L,e[42]=F):F=e[42];let U;e[43]!==H||e[44]!==F?(U=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[H,F]}),e[43]=H,e[44]=F,e[45]=U):U=e[45];let B;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==M||e[49]!==w||e[50]!==f?(B=Zt.map(I=>s.jsx(gt,{control:l.control,name:`tiers.${I.key}`,render:T=>{const{field:O}=T;return s.jsx(Te,{title:w(I.key),description:M(I.key),action:s.jsx(Jt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:I.filter,onSlotChange:R=>{O.onChange(R),f()}})})}},I.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=M,e[49]=w,e[50]=f,e[51]=B):B=e[51];let z;e[52]!==B?(z=s.jsx(be,{children:B}),e[52]=B,e[53]=z):z=e[53];let q;return e[54]!==E||e[55]!==U||e[56]!==z?(q=s.jsxs(Ee,{title:E,headerClassName:"pl-0",children:[U,z]}),e[54]=E,e[55]=U,e[56]=z,e[57]=q):q=e[57],q}function ss(e){return e.id}var Me="Progress",Oe=100,[is]=xt(Me),[ls,rs]=is(Me),dt=Q.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:n,getValueLabel:a=ns,...c}=e;(n||n===0)&&!qe(n)&&console.error(os(`${n}`,"Progress"));const l=qe(n)?n:Oe;r!==null&&!Le(r,l)&&console.error(as(`${r}`,"Progress"));const d=Le(r,l)?r:null,h=ke(d)?a(d,l):void 0;return s.jsx(ls,{scope:i,value:d,max:l,children:s.jsx(Xe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ke(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":ft(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});dt.displayName=Me;var mt="ProgressIndicator",ut=Q.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,n=rs(mt,i);return s.jsx(Xe.div,{"data-state":ft(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...r,ref:t})});ut.displayName=mt;function ns(e,t){return`${Math.round(e/t*100)}%`}function ft(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ke(e){return typeof e=="number"}function qe(e){return ke(e)&&!isNaN(e)&&e>0}function Le(e,t){return ke(e)&&!isNaN(e)&&e<=t&&e>=0}function os(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Oe}\`.`}function as(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 ${Oe} if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,n as o,j as c,bo as d}from"./index-
|
|
1
|
+
import{c as n,n as o,j as c,bo as d}from"./index-fZpMDfe6.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as r,dE as w,dF as T,bh as m,dJ as A,eH as O,J as I,bj as M,dD as F,eI as D,dG as z,eJ as G,bf as H,dI as L,dH as J,c as n,n as p,bn as v}from"./index-
|
|
1
|
+
import{r as i,j as r,dE as w,dF as T,bh as m,dJ as A,eH as O,J as I,bj as M,dD as F,eI as D,dG as z,eJ as G,bf as H,dI as L,dH as J,c as n,n as p,bn as v}from"./index-fZpMDfe6.js";var x="AlertDialog",[k]=H(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",W=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(L,{...o,...a,ref:e})});W.displayName=V;var Y="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=Y;var q="AlertDialogOverlay",j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(J,{...o,...a,ref:e})});j.displayName=q;var f="AlertDialogContent",[B,K]=k(f),Q=G("AlertDialogContent"),_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(B,{scope:t,cancelRef:u,children:r.jsxs(I,{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(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});_.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,j as t,da as se,b as F,r as L,B as N,t as R}from"./index-B5R-ECHm.js";import{i as ie}from"./AlertCircle-d_jYW-pF.js";import{a as le}from"./Copy01-DQMklNBZ.js";import{i as J}from"./Key01-zoXnVGpi.js";import{s as M}from"./Plus-DeCuWgpG.js";import{s as ne}from"./Trash01-DoWKJDZO.js";import{A as ae,a as re,b as oe,c as ce,d as de,e as me,f as fe,g as pe}from"./alert-dialog-CJVL1k9x.js";import{b as Q,h as U,a as V,c as W,d as X,e as Y}from"./dialog-BQ-t4CF4.js";import{I as Z}from"./input-DSE7gQf1.js";import{L as ue}from"./label-bKnld9-e.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-DpclRP6H.js";import{R as he}from"./require-capability-BwuG9o3e.js";import"./use-mcp-client-Bu-g594J.js";import"./constants-_08zpzmT.js";import"./auth-D0FayD-s.js";import"./access-gate-nqfyC3Gn.js";import"./capability-load-error-Bc2xBDB9.js";function je(c){const e=v.c(6),{error:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{size:16}),e[0]=i):i=e[0];let s;e[1]!==d.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:d.message}),e[1]=d.message,e[2]=r,e[3]=s):s=e[3];let l;return e[4]!==s?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=l):l=e[5],l}function Ke(c){const e=v.c(20),{apiKey:d,onDelete:r}=c,i=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(J,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let l;e[1]!==d.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:d.name}),e[1]=d.name,e[2]=l):l=e[2];let o;e[3]!==d.createdAt||e[4]!==i?(o=i("settings.apiKeys.createdAt",{date:new Date(d.createdAt).toLocaleDateString()}),e[3]=d.createdAt,e[4]=i,e[5]=o):o=e[5];let n;e[6]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),e[6]=o,e[7]=n):n=e[7];let m;e[8]!==l||e[9]!==n?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=m):m=e[10];let a;e[11]!==i?(a=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=a):a=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ne,{size:14}),e[13]=f):f=e[13];let u;e[14]!==r||e[15]!==a?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":a,children:f}),e[14]=r,e[15]=a,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function be(c){const e=v.c(21),{onCreate:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(J,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let o;e[5]!==r?(o=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=o):o=e[6];let n;e[7]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=n):n=e[8];let m;e[9]!==l||e[10]!==n?(m=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=m):m=e[11];let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(M,{size:14}),e[12]=a):a=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let u;e[15]!==d||e[16]!==f?(u=t.jsxs(N,{onClick:d,size:"sm",className:"mt-2",children:[a,f]}),e[15]=d,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.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:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function H(c){const e=v.c(40),{createdKey:d,onClose:r}=c,i=F(),s=d!==null;let l;e[0]!==r?(l=A=>!A&&r(),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=o):o=e[3];let n;e[4]!==o?(n=t.jsx(Q,{children:o}),e[4]=o,e[5]=n):n=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let a;e[8]!==m?(a=t.jsx(U,{children:m}),e[8]=m,e[9]=a):a=e[9];let f;e[10]!==n||e[11]!==a?(f=t.jsxs(V,{children:[n,a]}),e[10]=n,e[11]=a,e[12]=f):f=e[12];const u=d?.key??"";let p;e[13]!==u?(p=t.jsx(Z,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==d||e[16]!==i?(x=()=>{d&&(navigator.clipboard?.writeText(d.key),R.success(i("settings.apiKeys.copied")))},e[15]=d,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=t.jsx(W,{children:t.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(X,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Y,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function G(c){const e=v.c(64),{open:d,onOpenChange:r,onCreated:i}=c,s=F(),[l,o]=L.useState(""),n=ye();let m;e[0]!==r?(m=function(){o(""),r(!1)},e[0]=r,e[1]=m):m=e[1];const a=m;let f;e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(te){if(te.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});a(),i(I)}catch(I){const q=I;R.error(q instanceof Error?q.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=a,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==a||e[9]!==r?(p=$=>{$?r($):a()},e[8]=a,e[9]=r,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Q,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(U,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(V,{children:[g,y]}),e[19]=g,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=t.jsx(ue,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>o($.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==l||e[30]!==D?(A=t.jsx(Z,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let k;e[32]!==K||e[33]!==A?(k=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=k):k=e[34];const ee=n.isPending;let S;e[35]!==s?(S=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=S):S=e[36];let _;e[37]!==n.isPending||e[38]!==a||e[39]!==S?(_=t.jsx(N,{type:"button",variant:"outline",onClick:a,disabled:ee,children:S}),e[37]=n.isPending,e[38]=a,e[39]=S,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let T;e[50]!==_||e[51]!==z?(T=t.jsxs(W,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=T):T=e[52];let O;e[53]!==u||e[54]!==k||e[55]!==T?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[k,T]}),e[53]=u,e[54]=k,e[55]=T,e[56]=O):O=e[56];let E;e[57]!==O||e[58]!==h?(E=t.jsxs(X,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=E):E=e[59];let B;return e[60]!==d||e[61]!==E||e[62]!==p?(B=t.jsx(Y,{open:d,onOpenChange:p,children:E}),e[60]=d,e[61]=E,e[62]=p,e[63]=B):B=e[63],B}function Ce(){const c=F(),{data:e=[]}=xe(),d=ge(),[r,i]=L.useState(!1),[s,l]=L.useState(null),[o,n]=L.useState(null);async function m(){if(o)try{await d.mutateAsync(o.id),R.success(c("settings.apiKeys.keyDeleted",{name:o.name}))}catch(a){R.error(a instanceof Error?a.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(be,{onCreate:()=>i(!0)}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:c(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(M,{size:14}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(a=>t.jsx(Ke,{apiKey:a,onDelete:()=>n(a)},a.id))})}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:o!==null,onOpenChange:a=>{a||n(null)},children:t.jsxs(re,{children:[t.jsxs(oe,{children:[t.jsx(ce,{children:c("settings.apiKeys.deleteTitle",{name:o?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(me,{children:[t.jsx(fe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(pe,{onClick:m,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function De(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(se,{group:"connect",errorFallback:Ae,children:t.jsx(Ce,{})}),c[0]=e):e=c[0],e}function Ae(c){const{error:e}=c;return t.jsx(je,{error:e??new Error("Failed to load API keys")})}function qe(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(he,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(De,{})}),c[0]=e):e=c[0],e}export{qe as default};
|
|
1
|
+
import{c as v,j as t,da as se,b as F,r as L,B as N,t as R}from"./index-fZpMDfe6.js";import{i as ie}from"./AlertCircle-DL3U1yq7.js";import{a as le}from"./Copy01-CKmyRUyl.js";import{i as J}from"./Key01-CQ2Pckpa.js";import{s as M}from"./Plus-DJBOKCXM.js";import{s as ne}from"./Trash01-rd-vb1MA.js";import{A as ae,a as re,b as oe,c as ce,d as de,e as me,f as fe,g as pe}from"./alert-dialog-COKsRPdB.js";import{b as Q,h as U,a as V,c as W,d as X,e as Y}from"./dialog-BVOhf6JL.js";import{I as Z}from"./input-v4c8p5Ob.js";import{L as ue}from"./label-DOL_dkX5.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-Bi2l36nz.js";import{R as he}from"./require-capability-CF9r_mzF.js";import"./use-mcp-client-BixLZLmc.js";import"./constants-_08zpzmT.js";import"./auth-Dff1xvcy.js";import"./access-gate-BT3_V_pA.js";import"./capability-load-error-Bu1DMqyM.js";function je(c){const e=v.c(6),{error:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{size:16}),e[0]=i):i=e[0];let s;e[1]!==d.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:d.message}),e[1]=d.message,e[2]=r,e[3]=s):s=e[3];let l;return e[4]!==s?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=l):l=e[5],l}function Ke(c){const e=v.c(20),{apiKey:d,onDelete:r}=c,i=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(J,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let l;e[1]!==d.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:d.name}),e[1]=d.name,e[2]=l):l=e[2];let o;e[3]!==d.createdAt||e[4]!==i?(o=i("settings.apiKeys.createdAt",{date:new Date(d.createdAt).toLocaleDateString()}),e[3]=d.createdAt,e[4]=i,e[5]=o):o=e[5];let n;e[6]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),e[6]=o,e[7]=n):n=e[7];let m;e[8]!==l||e[9]!==n?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=m):m=e[10];let a;e[11]!==i?(a=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=a):a=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ne,{size:14}),e[13]=f):f=e[13];let u;e[14]!==r||e[15]!==a?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":a,children:f}),e[14]=r,e[15]=a,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function be(c){const e=v.c(21),{onCreate:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(J,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let o;e[5]!==r?(o=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=o):o=e[6];let n;e[7]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=n):n=e[8];let m;e[9]!==l||e[10]!==n?(m=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=m):m=e[11];let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(M,{size:14}),e[12]=a):a=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let u;e[15]!==d||e[16]!==f?(u=t.jsxs(N,{onClick:d,size:"sm",className:"mt-2",children:[a,f]}),e[15]=d,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.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:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function H(c){const e=v.c(40),{createdKey:d,onClose:r}=c,i=F(),s=d!==null;let l;e[0]!==r?(l=A=>!A&&r(),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=o):o=e[3];let n;e[4]!==o?(n=t.jsx(Q,{children:o}),e[4]=o,e[5]=n):n=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let a;e[8]!==m?(a=t.jsx(U,{children:m}),e[8]=m,e[9]=a):a=e[9];let f;e[10]!==n||e[11]!==a?(f=t.jsxs(V,{children:[n,a]}),e[10]=n,e[11]=a,e[12]=f):f=e[12];const u=d?.key??"";let p;e[13]!==u?(p=t.jsx(Z,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==d||e[16]!==i?(x=()=>{d&&(navigator.clipboard?.writeText(d.key),R.success(i("settings.apiKeys.copied")))},e[15]=d,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=t.jsx(W,{children:t.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(X,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Y,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function G(c){const e=v.c(64),{open:d,onOpenChange:r,onCreated:i}=c,s=F(),[l,o]=L.useState(""),n=ye();let m;e[0]!==r?(m=function(){o(""),r(!1)},e[0]=r,e[1]=m):m=e[1];const a=m;let f;e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(te){if(te.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});a(),i(I)}catch(I){const q=I;R.error(q instanceof Error?q.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=a,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==a||e[9]!==r?(p=$=>{$?r($):a()},e[8]=a,e[9]=r,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Q,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(U,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(V,{children:[g,y]}),e[19]=g,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=t.jsx(ue,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>o($.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==l||e[30]!==D?(A=t.jsx(Z,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let k;e[32]!==K||e[33]!==A?(k=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=k):k=e[34];const ee=n.isPending;let S;e[35]!==s?(S=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=S):S=e[36];let _;e[37]!==n.isPending||e[38]!==a||e[39]!==S?(_=t.jsx(N,{type:"button",variant:"outline",onClick:a,disabled:ee,children:S}),e[37]=n.isPending,e[38]=a,e[39]=S,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let T;e[50]!==_||e[51]!==z?(T=t.jsxs(W,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=T):T=e[52];let O;e[53]!==u||e[54]!==k||e[55]!==T?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[k,T]}),e[53]=u,e[54]=k,e[55]=T,e[56]=O):O=e[56];let E;e[57]!==O||e[58]!==h?(E=t.jsxs(X,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=E):E=e[59];let B;return e[60]!==d||e[61]!==E||e[62]!==p?(B=t.jsx(Y,{open:d,onOpenChange:p,children:E}),e[60]=d,e[61]=E,e[62]=p,e[63]=B):B=e[63],B}function Ce(){const c=F(),{data:e=[]}=xe(),d=ge(),[r,i]=L.useState(!1),[s,l]=L.useState(null),[o,n]=L.useState(null);async function m(){if(o)try{await d.mutateAsync(o.id),R.success(c("settings.apiKeys.keyDeleted",{name:o.name}))}catch(a){R.error(a instanceof Error?a.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(be,{onCreate:()=>i(!0)}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:c(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(M,{size:14}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(a=>t.jsx(Ke,{apiKey:a,onDelete:()=>n(a)},a.id))})}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:o!==null,onOpenChange:a=>{a||n(null)},children:t.jsxs(re,{children:[t.jsxs(oe,{children:[t.jsx(ce,{children:c("settings.apiKeys.deleteTitle",{name:o?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(me,{children:[t.jsx(fe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(pe,{onClick:m,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function De(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(se,{group:"connect",errorFallback:Ae,children:t.jsx(Ce,{})}),c[0]=e):e=c[0],e}function Ae(c){const{error:e}=c;return t.jsx(je,{error:e??new Error("Failed to load API keys")})}function qe(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(he,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(De,{})}),c[0]=e):e=c[0],e}export{qe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Bt,b as jt,r as A,j as o,n as _t,k as wt,t as ht}from"./index-B5R-ECHm.js";import{b as At}from"./chat-context-PKiduEXT.js";import{i as Et}from"./ChevronRight-Bq8eLOWM.js";import{B as Nt}from"./automation-runs-BwVIBljL.js";import{u as Rt,A as Ct}from"./use-section-preview-base-Dy0el1qx.js";import{B as Kt,C as Tt,D as Ft,F as Pt,G as $t,H as It,I as Ot,S as Ut,J as zt,K as Lt}from"./index-PlC49IUs.js";import"./tab-id-C7NSeDZO.js";import"./dialog-BQ-t4CF4.js";import"./Check-KqwAmcDj.js";import"./Copy01-DQMklNBZ.js";import"./Download01-BCA2ING7.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-APRq5B-N.js";import"./use-mcp-client-Bu-g594J.js";import"./constants-_08zpzmT.js";import"./auth-D0FayD-s.js";import"./decopilot-sse-pool-CzhRRg62.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DKc17TzC.js";import"./use-ai-providers-BWG1j4R3.js";import"./use-decopilot-events-0HarKwn7.js";import"./use-organization-settings-DeS0wGS3.js";import"./select-D5jnyj0l.js";import"./ChevronDown-BQZF9Af9.js";import"./ChevronUp-BnjYp300.js";import"./agent-icon-BM9CQspm.js";import"./AlertCircle-d_jYW-pF.js";import"./Tool01-TcrXKmnF.js";import"./ArrowUp-DmYjuyWi.js";import"./ArrowLeft-B5SdDJS5.js";import"./Tool02-DWE9dUHc.js";import"./XCircle-CJ79pnxP.js";import"./TrendUp01-DehiMCpc.js";import"./ZapSquare-Cx_Z2jAm.js";import"./Users03-C_Br2__w.js";import"./UserSquare-CYgbi1K9.js";import"./CheckCircle-DuO-pGO-.js";import"./ChevronSelectorVertical-DrHEbUrw.js";import"./DotsVertical-DmFi_5m5.js";import"./Stars02-NRIRt4tn.js";import"./CreditCard01-ayJva4-L.js";import"./Settings02-CDWROrkG.js";import"./Eye-CRgVrt0h.js";import"./FilterLines-D6T5uoZ8.js";import"./Share07-rauAL5Pr.js";import"./Globe01-KXkuiG0o.js";import"./Globe04-kFCzhDtq.js";import"./SwitchHorizontal01-BLilv7ln.js";import"./HardDrive-IGVDCiH-.js";import"./Key01-zoXnVGpi.js";import"./LinkExternal01-DY154voS.js";import"./LockUnlocked01-BUPOcE7Q.js";import"./LogOut01-vFXcKA44.js";import"./Monitor01-IMrl8-Sz.js";import"./Sun-BDdwc-Zh.js";import"./Palette-CO-9fV73.js";import"./Play-Cnds4faY.js";import"./Plus-DeCuWgpG.js";import"./SearchLg-LSbMLZI6.js";import"./SearchMd-C6SjxYyL.js";import"./Shield01-CJQrmrbA.js";import"./Stars01-DqVhL0wf.js";import"./Trash01-DoWKJDZO.js";import"./Upload01-DROOnA_X.js";import"./User01-DBp5CtcM.js";import"./Users01-D845Yde-.js";import"./XClose-BOvSf6KB.js";import"./Zap-CYPfTI6g.js";import"./useInfiniteQuery-CtQupOcz.js";import"./use-infinite-scroll-DSYZfzYp.js";import"./use-connection-CFAFM3Yj.js";import"./table-BdiZmxkC.js";import"./empty-state-Z6jBJyBE.js";import"./use-members-yMUdTS3F.js";import"./use-org-auth-client-DZGh6wmi.js";import"./use-clock-tick-BmMJ4C9l.js";import"./use-automations-CESfm05a.js";import"./useSuspenseInfiniteQuery-DsYLPBXT.js";import"./avatar-CqQE-eFC.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Du-_RwSH.js";import"./monaco-editor-DfjGwIkC.js";import"./spinner-ClifCs3i.js";import"./types-qEmgOr-R.js";import"./shell-layout-CAm70xM1.js";import"./required-auth-layout-DoToYqRI.js";import"./use-org-sso-CmTeA9vF.js";import"./integration-icon-BNk_AQRx.js";import"./use-navigate-to-agent-CioCH7VJ.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-wUtBUsj3.js";import"./index-CCWpCA-G.js";import"./form-WUWViVui.js";import"./label-bKnld9-e.js";import"./input-DSE7gQf1.js";import"./file-type-icon-k6QIypVu.js";import"./drawer-Db54djTH.js";import"./collection-search-CksSLFKw.js";import"./tabs-B1m4e_Lf.js";import"./toggle-group-B9nynTTu.js";import"./use-commerce-diagnostic-Ll9Jxlc1.js";import"./popover-DH9TTdnh.js";import"./self-tool-result-CIZIi6Il.js";import"./alert-dialog-CJVL1k9x.js";import"./extract-connection-data-B6RBsrzJ.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-D7E7obaB.js";import"./authenticate-and-persist-oauth-t3Fvmhc7.js";import"./mcp-oauth-CIUwYU01.js";import"./track-BeWveGxs.js";import"./toolbar-Dn87lyB_.js";import"./github-repo-picker-CntGYv-N.js";import"./use-mcp-tools-Dtn2uWjv.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-CmsTkv4b.js";import"./use-registry-connections-DENDz1rF.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-C8A1NtUt.js";import"./connection-form-helpers-BP-W1_HA.js";import"./collection-tabs-Lyg-Hx2-.js";import"./badge-D3zUUYug.js";import"./command-UPps-OHa.js";import"./index-ChJw-ECJ.js";import"./select-model-DPpBxnrS.js";import"./checkbox-BZ02x3Tw.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-B6201d9G.js";import"./dropdown-menu-Dl9RzbmM.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Dk4EoSoR.js";import"./use-file-configs-BxpfXHj_.js";import"./pt-BR-CLy76QW2.js";import"./switch-DXyXcz0k.js";import"./use-debounced-autosave-44xRW5_u.js";import"./search-input-Bghs_Bjp.js";import"./index-C6_zR0Yd.js";import"./use-secrets-7WKBJtby.js";import"./AreaChart-6ExM5C57.js";import"./task-key-DzvP3l3i.js";import"./sprints-C1R8b2UK.js";import"./use-tags-CrW3MALx.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-C9Xx9zFJ.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-CwiMJzn0.js";function Vt(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Kt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Fr(n){const t=Bt.c(79),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:H,schemaPending:lt,previewBaseUrl:ct}=n,M=lt===void 0?!1:lt,Z=ct===void 0?null:ct,G=At()?.taskId??null,c=jt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Tt(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const J=C,dt=bt??(x?Ft(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:Q,isPending:W}=Pt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const X=$t(T);let F;t[17]!==S?(F=zt((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const Y=F,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,xt]=A.useState(P),[ot,d]=A.useState(!1),$=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Dt),xt([]));let I;t[20]!==x?(I=x??{},t[20]=x,t[21]=I):I=t[21];const rt=I;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let O;t[24]!==rt||t[25]!==y?(O={...rt,...y},t[24]=rt,t[25]=y,t[26]=O):O=t[26];const it=O;let U;t[27]!==p||t[28]!==v||t[29]!==S?(U=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=U):U=t[30];const st=U;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=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]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const mt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await k(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=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=It(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:_t("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 B;t[42]!==W?(B=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=B):B=t[43];let j;t[44]!==nt||t[45]!==B?(j=o.jsxs("div",{className:yt,children:[nt,B]}),t[44]=nt,t[45]=B,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==st||t[56]!==mt||t[57]!==J||t[58]!==a||t[59]!==s||t[60]!==Y||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=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:st,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:mt,sandbox:{orgSlug:s,virtualMcpId:i,branch:m,threadId:G}},`${p}:${et}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=st,t[56]=mt,t[57]=J,t[58]=a,t[59]=s,t[60]=Y,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Ct,{open:ot,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let D;return t[75]!==j||t[76]!==_||t[77]!==w?(D=o.jsxs("div",{className:gt,children:[j,_,w]}),t[75]=j,t[76]=_,t[77]=w,t[78]=D):D=t[78],D}function qt(n){return n+1}function Dt(n){return n+1}export{Fr as AppEditor};
|
|
1
|
+
import{c as Bt,b as jt,r as A,j as o,n as _t,k as wt,t as ht}from"./index-fZpMDfe6.js";import{b as At}from"./chat-context-IctGRlpl.js";import{i as Et}from"./ChevronRight-Bt0Ps5hy.js";import{B as Nt}from"./automation-runs-l52V2CDe.js";import{u as Rt,A as Ct}from"./use-section-preview-base-Db24sM6t.js";import{B as Kt,C as Tt,D as Ft,F as Pt,G as $t,H as It,I as Ot,S as Ut,J as zt,K as Lt}from"./index-D9nsJyXn.js";import"./tab-id-W4sfonX1.js";import"./dialog-BVOhf6JL.js";import"./Check-CFdAuLVR.js";import"./Copy01-CKmyRUyl.js";import"./Download01-DZdiDQUS.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-CtnSCLIe.js";import"./use-mcp-client-BixLZLmc.js";import"./constants-_08zpzmT.js";import"./auth-Dff1xvcy.js";import"./decopilot-sse-pool-0EWVughz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CxECG99q.js";import"./use-ai-providers-bDkOAByr.js";import"./use-decopilot-events-U00f_DNo.js";import"./use-organization-settings-B4nKr0f2.js";import"./select-D9OtHuoQ.js";import"./ChevronDown-Bh9AZv82.js";import"./ChevronUp-CYbM4ZwP.js";import"./agent-icon-Dt8TTBNR.js";import"./AlertCircle-DL3U1yq7.js";import"./Tool01-D15DzDIB.js";import"./ArrowUp-DUua93WQ.js";import"./ArrowLeft-BDtQVDZJ.js";import"./Tool02-DcVuymPV.js";import"./XCircle-vpb-OIYV.js";import"./TrendUp01-BBA3UF71.js";import"./ZapSquare-B52zBMI0.js";import"./Users03-CeFJXyBc.js";import"./UserSquare-DNzPXyDT.js";import"./CheckCircle-Ccs86bUg.js";import"./ChevronSelectorVertical-CbP69kXl.js";import"./DotsVertical-C5qhPHKZ.js";import"./Stars02-BEZaBHTc.js";import"./CreditCard01-DXJKk1Wt.js";import"./Settings02-BXfVk1mb.js";import"./Eye-DFHNhYtx.js";import"./FilterLines-C01-F8gV.js";import"./Share07-DRhhhSu7.js";import"./Globe01-qBOiIpcJ.js";import"./Globe04-DyPo8R4R.js";import"./SwitchHorizontal01-BPoIdNhd.js";import"./HardDrive-DMA6WwJi.js";import"./Key01-CQ2Pckpa.js";import"./LinkExternal01-CDWxDAhW.js";import"./LockUnlocked01-BJDlnHNP.js";import"./LogOut01-DYTwrIyB.js";import"./Monitor01-CW9D8oQR.js";import"./Sun-CxlEqCDi.js";import"./Palette-CYMwYnzJ.js";import"./Play-D5VBgg81.js";import"./Plus-DJBOKCXM.js";import"./SearchLg-D05XfMH4.js";import"./SearchMd-Bvk6cmtM.js";import"./Shield01--vYJckXn.js";import"./Stars01-Cfn7XpKF.js";import"./Trash01-rd-vb1MA.js";import"./Upload01-CURnTiOx.js";import"./User01-CGWss5jM.js";import"./Users01-B043Q3B_.js";import"./XClose-Ca1B07wN.js";import"./Zap-DoBPpnDg.js";import"./useInfiniteQuery-D6nR9UJf.js";import"./use-infinite-scroll-C3woVgJJ.js";import"./use-connection-DJ5BvXkS.js";import"./table-B28U6WCV.js";import"./empty-state-CMCoRH7w.js";import"./use-members-DqBCB9wB.js";import"./use-org-auth-client-Bm7ydyvS.js";import"./use-clock-tick-BIn9fxJl.js";import"./use-automations-BeKjYp7F.js";import"./useSuspenseInfiniteQuery-BfIWoPo8.js";import"./avatar-CKLVepem.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BHeXFKUG.js";import"./monaco-editor-DOnHAZIR.js";import"./spinner-DnK6LAO-.js";import"./types-Da-6shE5.js";import"./shell-layout-0_Y9WTC5.js";import"./required-auth-layout-XqEbPK8M.js";import"./use-org-sso-9a_THghN.js";import"./integration-icon-DKqG-Mpx.js";import"./use-navigate-to-agent-COcz3Nee.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-mQfq8dm_.js";import"./index-DTM9lZbn.js";import"./form-DJoSkHk7.js";import"./label-DOL_dkX5.js";import"./input-v4c8p5Ob.js";import"./file-type-icon-DQDAdTqu.js";import"./drawer-ygpURzdE.js";import"./collection-search-BcNT9wqV.js";import"./tabs-CNvz9wkq.js";import"./toggle-group-B1ujv-Tj.js";import"./use-commerce-diagnostic-UqRl5JGR.js";import"./popover-DSZP75un.js";import"./self-tool-result-C2SaSBOS.js";import"./alert-dialog-COKsRPdB.js";import"./extract-connection-data-BRWpOoZu.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-d2xvAJAf.js";import"./authenticate-and-persist-oauth-BpXFlbw1.js";import"./mcp-oauth-MtFdjicX.js";import"./track-Cth4u5b_.js";import"./toolbar-Cos-gS1a.js";import"./github-repo-picker-CPPjWOCA.js";import"./use-mcp-tools-DhYUR3cu.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-DLmi_xFL.js";import"./use-registry-connections-C7LyRS1M.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BmWik9O5.js";import"./connection-form-helpers-Bd1zJpcE.js";import"./collection-tabs-QBx9fiO8.js";import"./badge-B2mtA9Oj.js";import"./command-Bciip2fK.js";import"./index-BJiFP4oP.js";import"./select-model-pYcHYqNY.js";import"./checkbox-DjvUsSry.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-CnXEidEU.js";import"./dropdown-menu-BpdWhSA7.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DFis4MWx.js";import"./use-file-configs-ivKLtwVT.js";import"./pt-BR-CLy76QW2.js";import"./switch-Dd8SWBtK.js";import"./use-debounced-autosave-BEoE5zu3.js";import"./search-input-4SLm_iMt.js";import"./index-CVkGlHYs.js";import"./use-secrets-Chh3ojOY.js";import"./AreaChart-DTwkuP_y.js";import"./task-key-CTiJU5_h.js";import"./sprints-DTKQS9tP.js";import"./use-tags-DSiXReOW.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-BcptvIDe.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-B_4SIVWY.js";function Vt(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Kt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Fr(n){const t=Bt.c(79),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:H,schemaPending:lt,previewBaseUrl:ct}=n,M=lt===void 0?!1:lt,Z=ct===void 0?null:ct,G=At()?.taskId??null,c=jt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Tt(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const J=C,dt=bt??(x?Ft(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:Q,isPending:W}=Pt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const X=$t(T);let F;t[17]!==S?(F=zt((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const Y=F,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,xt]=A.useState(P),[ot,d]=A.useState(!1),$=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Dt),xt([]));let I;t[20]!==x?(I=x??{},t[20]=x,t[21]=I):I=t[21];const rt=I;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let O;t[24]!==rt||t[25]!==y?(O={...rt,...y},t[24]=rt,t[25]=y,t[26]=O):O=t[26];const it=O;let U;t[27]!==p||t[28]!==v||t[29]!==S?(U=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=U):U=t[30];const st=U;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=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]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const mt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await k(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=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=It(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:_t("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 B;t[42]!==W?(B=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=B):B=t[43];let j;t[44]!==nt||t[45]!==B?(j=o.jsxs("div",{className:yt,children:[nt,B]}),t[44]=nt,t[45]=B,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==st||t[56]!==mt||t[57]!==J||t[58]!==a||t[59]!==s||t[60]!==Y||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=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:st,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:mt,sandbox:{orgSlug:s,virtualMcpId:i,branch:m,threadId:G}},`${p}:${et}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=st,t[56]=mt,t[57]=J,t[58]=a,t[59]=s,t[60]=Y,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Ct,{open:ot,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let D;return t[75]!==j||t[76]!==_||t[77]!==w?(D=o.jsxs("div",{className:gt,children:[j,_,w]}),t[75]=j,t[76]=_,t[77]=w,t[78]=D):D=t[78],D}function qt(n){return n+1}function Dt(n){return n+1}export{Fr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dk as I,dl as $,dm as W,dn as L,dp as H,dq as x,dr as D,ds as V,dt as q,du as j,dv as y,dw as N,dx as B,dy as Z,dz as F}from"./index-B5R-ECHm.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 Q(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 x)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)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 P(c,{fetchFn:i}),!o)try{o=await T(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:b,codeVerifier:v}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(b),"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 T(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 I.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 P(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 T(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 P(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 F(),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=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return V.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 Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{dk as I,dl as $,dm as W,dn as L,dp as H,dq as x,dr as D,ds as V,dt as q,du as j,dv as y,dw as N,dx as B,dy as Z,dz as F}from"./index-fZpMDfe6.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 Q(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 x)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)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 P(c,{fetchFn:i}),!o)try{o=await T(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:b,codeVerifier:v}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(b),"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 T(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 I.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 P(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 T(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 P(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 F(),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=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return V.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 Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-
|
|
1
|
+
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-fZpMDfe6.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,G as Fe,r as v,e as ce,q as Q,j as t,n as N,B as xe,p as Be,o as $e,K as me,c as fe,b as be,S as _e}from"./index-B5R-ECHm.js";import{I as ee}from"./input-DSE7gQf1.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-ClifCs3i.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ge({redirectUrl:i,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,G=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}Y.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(Y.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),Y.reset(),J.reset()},E=ie.isPending||re.isPending||Y.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=Y.error||J.error,$=I?b.trim()&&L.trim()&&B.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),Y.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ye(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ye(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await ze(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(i))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(_e,{})}function st({callbackURL:i,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(_e,{})}function lt(i){const e=fe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ge,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{lt as A,Ye as u};
|
|
1
|
+
import{a as V,G as Fe,r as v,e as ce,q as Q,j as t,n as N,B as xe,p as Be,o as $e,K as me,c as fe,b as be,S as _e}from"./index-fZpMDfe6.js";import{I as ee}from"./input-v4c8p5Ob.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-DnK6LAO-.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ge({redirectUrl:i,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,G=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}Y.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(Y.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),Y.reset(),J.reset()},E=ie.isPending||re.isPending||Y.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=Y.error||J.error,$=I?b.trim()&&L.trim()&&B.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),Y.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ye(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ye(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await ze(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(i))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(_e,{})}function st({callbackURL:i,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(_e,{})}function lt(i){const e=fe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ge,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{lt as A,Ye as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,n as p,j as f}from"./index-
|
|
1
|
+
import{c as g,n as p,j as f}from"./index-fZpMDfe6.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-fZpMDfe6.js";import{i as u,a as p}from"./mcp-oauth-MtFdjicX.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
|