decocms 4.294.2 → 4.294.3
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-qZDg2e-H.js → AlertCircle-DLj-rBLn.js} +1 -1
- package/dist/client/assets/{AreaChart-D1rWRcUm.js → AreaChart-9FGrcqfj.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CatEVOI7.js → ArrowLeft-Bz-VyTFg.js} +1 -1
- package/dist/client/assets/{ArrowUp-DMDdMhAA.js → ArrowUp-C9wijSHC.js} +1 -1
- package/dist/client/assets/{Check-C5RWnyNL.js → Check-CTKt7DPp.js} +1 -1
- package/dist/client/assets/{CheckCircle-V0GvWvtd.js → CheckCircle-DOOBCpT9.js} +1 -1
- package/dist/client/assets/{ChevronDown-CeGZsBnS.js → ChevronDown-DCBuHd0m.js} +1 -1
- package/dist/client/assets/{ChevronRight-Dh8_6pj1.js → ChevronRight-CO9K42kJ.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-Im3Lz_4E.js → ChevronSelectorVertical-Iu37Jtvz.js} +1 -1
- package/dist/client/assets/{ChevronUp-DCx43qHY.js → ChevronUp-D6fZUTvM.js} +1 -1
- package/dist/client/assets/{Copy01-DhfruII6.js → Copy01-C-9zesbF.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cy0s6gAf.js → CreditCard01-CKM-Jz3x.js} +1 -1
- package/dist/client/assets/{DotsVertical-B39kxqbi.js → DotsVertical-CSkWlHZt.js} +1 -1
- package/dist/client/assets/{Download01-C1FmC7JV.js → Download01-DYsmBrAR.js} +1 -1
- package/dist/client/assets/{Eye-m8QZKf2Y.js → Eye-Bf1344cz.js} +1 -1
- package/dist/client/assets/{FilterLines-BBF-m2ZJ.js → FilterLines-D4VZo9JH.js} +1 -1
- package/dist/client/assets/{Globe01-C2F_PPuX.js → Globe01-Mlkbzavy.js} +1 -1
- package/dist/client/assets/{Globe04-CMCnFTSr.js → Globe04-CcZwBZDM.js} +1 -1
- package/dist/client/assets/{HardDrive-DmqNZKD8.js → HardDrive-rv6yXW9l.js} +1 -1
- package/dist/client/assets/{Key01-DbCU9LZF.js → Key01-C71Bncy8.js} +1 -1
- package/dist/client/assets/{LinkExternal01-kQnRXU4w.js → LinkExternal01-Bd5qXJx-.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-D5OpQeQe.js → LockUnlocked01-xUxyOLI6.js} +1 -1
- package/dist/client/assets/{LogOut01-BePTyd5L.js → LogOut01-CFPuWi87.js} +1 -1
- package/dist/client/assets/{Monitor01-DPqlemzQ.js → Monitor01-Db3wK3MU.js} +1 -1
- package/dist/client/assets/{Palette-DzT0S9Gl.js → Palette-Wf7ieWzf.js} +1 -1
- package/dist/client/assets/{Play-Btu3v5FX.js → Play-CTzOPD4i.js} +1 -1
- package/dist/client/assets/{Plus-B7vTVmKH.js → Plus-C20besyI.js} +1 -1
- package/dist/client/assets/{SearchLg-CAAIuTYj.js → SearchLg-BoAF9n4o.js} +1 -1
- package/dist/client/assets/{SearchMd-COQJLRw-.js → SearchMd-DbgBw9S_.js} +1 -1
- package/dist/client/assets/{Settings02-xEBQxvJD.js → Settings02-DVdySYD4.js} +1 -1
- package/dist/client/assets/{Share07-CLkT7SlV.js → Share07-TLJEQyW1.js} +1 -1
- package/dist/client/assets/{Shield01-C2USnj9G.js → Shield01-CVEumGx3.js} +1 -1
- package/dist/client/assets/{Stars01-DkoqcM4j.js → Stars01-BLlf5jfX.js} +1 -1
- package/dist/client/assets/{Stars02-4GZ9SjIq.js → Stars02-DSl09LS3.js} +1 -1
- package/dist/client/assets/{Sun-D0KW7MLF.js → Sun-D8Cz2KrR.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DwxljZOI.js → SwitchHorizontal01-DxrMcxk-.js} +1 -1
- package/dist/client/assets/{Tool01-tn2PFBHQ.js → Tool01-C-r-Zf-I.js} +1 -1
- package/dist/client/assets/{Tool02-BalBR7uK.js → Tool02-CQfhYBA-.js} +1 -1
- package/dist/client/assets/{Trash01-CwqV1gzD.js → Trash01-BaF7-rQA.js} +1 -1
- package/dist/client/assets/{TrendUp01-6TR_k_0Y.js → TrendUp01-DrIbuukS.js} +1 -1
- package/dist/client/assets/{Upload01-mqAHBbZV.js → Upload01-Eo8Y8gwt.js} +1 -1
- package/dist/client/assets/{User01-DWaPmCwS.js → User01-BmKTu46m.js} +1 -1
- package/dist/client/assets/{UserSquare-ClSByuB-.js → UserSquare-D5oHibl1.js} +1 -1
- package/dist/client/assets/{Users01-CFDNbxgJ.js → Users01-DdYj89q4.js} +1 -1
- package/dist/client/assets/{Users03-BT3gPqQL.js → Users03-BvmFpFso.js} +1 -1
- package/dist/client/assets/{XCircle-BOrCVYLf.js → XCircle-BLGxEUt7.js} +1 -1
- package/dist/client/assets/{XClose-DMSeuF30.js → XClose-KYQfxNAH.js} +1 -1
- package/dist/client/assets/{YAxis-CjueDU_j.js → YAxis-BzTUlY5S.js} +1 -1
- package/dist/client/assets/{Zap-CwYGo5D6.js → Zap-DSuzhrFd.js} +1 -1
- package/dist/client/assets/{ZapSquare-DkKtoQ7W.js → ZapSquare-B03SIXBG.js} +1 -1
- package/dist/client/assets/{access-gate-DXIgG9H-.js → access-gate-DXpndi2J.js} +1 -1
- package/dist/client/assets/{agent-icon-C9_7Msf7.js → agent-icon-LbhnjHwi.js} +1 -1
- package/dist/client/assets/{agents-list-CrYr2LdT.js → agents-list-BWtnoYa9.js} +1 -1
- package/dist/client/assets/{ai-providers-9B822Ytz.js → ai-providers-C9TvV_lY.js} +1 -1
- package/dist/client/assets/{alert-DeOSO_Ec.js → alert-Brn68O_I.js} +1 -1
- package/dist/client/assets/{alert-dialog-BWONJIzw.js → alert-dialog-CDXDBEVz.js} +1 -1
- package/dist/client/assets/{api-keys-BHGQjiZT.js → api-keys-C0YiI_0_.js} +1 -1
- package/dist/client/assets/{app-editor-GCmyfLNC.js → app-editor-ByjOzHF0.js} +1 -1
- package/dist/client/assets/{auth-BqxUQw-v.js → auth-CMC5pcXA.js} +1 -1
- package/dist/client/assets/{auth-catchall-q5v2tPZU.js → auth-catchall-C1obS0DM.js} +1 -1
- package/dist/client/assets/{auth-entry-Dx-_gZ2g.js → auth-entry-L4MYHhmA.js} +1 -1
- package/dist/client/assets/{auth-split-layout-YdeWuYN1.js → auth-split-layout-p8RpZGj-.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DRVU48ic.js → authenticate-and-persist-oauth-B1awg6G_.js} +1 -1
- package/dist/client/assets/{automation-list-row-BMiRTeOK.js → automation-list-row-DSW4dqyo.js} +1 -1
- package/dist/client/assets/{automation-runs-CzcGADVN.js → automation-runs-DwCd_zFP.js} +1 -1
- package/dist/client/assets/{automations-DDnrk0LJ.js → automations-C4N4GC8F.js} +1 -1
- package/dist/client/assets/{avatar-1XE5IjoT.js → avatar-DKKheiwZ.js} +1 -1
- package/dist/client/assets/{badge-CXIV4O-0.js → badge-BCfyeFAT.js} +1 -1
- package/dist/client/assets/{block-document-BufBxpL6.js → block-document-D9NoKYRN.js} +1 -1
- package/dist/client/assets/{breadcrumb-FUX_wv57.js → breadcrumb-DwyVLr-T.js} +1 -1
- package/dist/client/assets/{buckets-DQPGFSM3.js → buckets-NENIH_rY.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CNgfZPUK.js → bulk-category-panel-CWOO5lMW.js} +1 -1
- package/dist/client/assets/{capability-load-error-BKGEHfpt.js → capability-load-error-Bu5AJKz_.js} +1 -1
- package/dist/client/assets/{cards-DJSm_nho.js → cards-AP5XpAV6.js} +1 -1
- package/dist/client/assets/{category-editor-ByRsnfkE.js → category-editor-CAPnyo_p.js} +1 -1
- package/dist/client/assets/{chart-Bgue_7DQ.js → chart-D1jgldPO.js} +1 -1
- package/dist/client/assets/{chat-context-C-BdNZCf.js → chat-context-DQqAI1Uh.js} +1 -1
- package/dist/client/assets/{checkbox-DvC3nAT5.js → checkbox-BdDEdRtX.js} +1 -1
- package/dist/client/assets/{choose-editor-CFBXNqp3.js → choose-editor-d1jVshXq.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CUav6RQy.js → cli-auth-success-DZNcV7RU.js} +1 -1
- package/dist/client/assets/{collection-detail-LByozjyF.js → collection-detail-DCdfqXH6.js} +1 -1
- package/dist/client/assets/{collection-display-button-D4ItaSc8.js → collection-display-button-BkVeJ-Ht.js} +1 -1
- package/dist/client/assets/{collection-search-DBnGb4Zg.js → collection-search-swq3mYpH.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DCUZlFkx.js → collection-table-wrapper-BFeQBjk_.js} +1 -1
- package/dist/client/assets/{collection-tabs-CAUEdmSI.js → collection-tabs-B31Xr--3.js} +1 -1
- package/dist/client/assets/{command-Ct_4mokr.js → command-CtzJnf3P.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-C2UgJ-TR.js → commerce-onboarding-B6IdGbvD.js} +1 -1
- package/dist/client/assets/{config-DG69PD1X.js → config-CbfHHHdK.js} +1 -1
- package/dist/client/assets/{connect-DLRRtQi0.js → connect-28y6QTSQ.js} +1 -1
- package/dist/client/assets/{connection-Dg1mnPcO.js → connection-BuSysa2G.js} +1 -1
- package/dist/client/assets/{connection-card-CgUgSGsh.js → connection-card-BllYSe_U.js} +1 -1
- package/dist/client/assets/{connection-detail-CAhXUEiD.js → connection-detail-_XYLLvoB.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-gU6TF210.js → connection-form-helpers-C6PcVFY-.js} +1 -1
- package/dist/client/assets/{connections-tQk1fh_m.js → connections-Cu1bTJAX.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DDszDk42.js → decopilot-sse-pool-CvmARxhG.js} +1 -1
- package/dist/client/assets/{dialog-DYg0AoO0.js → dialog-D4htx8Dz.js} +1 -1
- package/dist/client/assets/{domain-settings-xR7ZmjBb.js → domain-settings-DEIyOLUp.js} +1 -1
- package/dist/client/assets/{drawer-DrqU_8fl.js → drawer-CuMUVmYp.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BGreHXNg.js → dropdown-menu-BE_ym3Aq.js} +1 -1
- package/dist/client/assets/{empty-state-DNKOHljA.js → empty-state-DANnu2Dm.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BI_gbc3h.js → extract-connection-data-BIGQQYkp.js} +1 -1
- package/dist/client/assets/{file-explorer-D9_-DWtI.js → file-explorer-DyEzRtBa.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cr_jiDFe.js → file-type-icon-BenR9kqm.js} +1 -1
- package/dist/client/assets/{form-DUYaeuN1.js → form-DxT0qd-2.js} +1 -1
- package/dist/client/assets/{general-CVMzbMNL.js → general-BgW26EXn.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BjTlfZRh.js → github-repo-picker-DuwsdpzE.js} +1 -1
- package/dist/client/assets/{hooks-DvV-YCly.js → hooks-rNJx2Yiz.js} +1 -1
- package/dist/client/assets/{index-Bk7mmffp.js → index-BNizG_r4.js} +1 -1
- package/dist/client/assets/{index-DHLutK6v.js → index-BWXyDl1J.js} +3 -3
- package/dist/client/assets/{index-pYJ2-T-r.js → index-BXn0NwIo.js} +1 -1
- package/dist/client/assets/{index-RXRS2M8q.js → index-CdvEA4gL.js} +1 -1
- package/dist/client/assets/{index-CXtbLiKC.js → index-ChcGUNSF.js} +1 -1
- package/dist/client/assets/{index-CxsfTXSQ.js → index-DeW3li9q.js} +1 -1
- package/dist/client/assets/{index-BOALwCeh.js → index-Dstu6oca.js} +1 -1
- package/dist/client/assets/{index-BWVLjCpL.js → index-eyTxS6Bz.js} +6 -6
- package/dist/client/assets/{index-CgA3qf5E.js → index-ke_XwP2X.js} +1 -1
- package/dist/client/assets/{index-redirect-CUFx5Ci3.js → index-redirect-BJVKALX7.js} +1 -1
- package/dist/client/assets/{infra-billing-C7HR_T7J.js → infra-billing-CcvA504_.js} +1 -1
- package/dist/client/assets/{input-zNG5Uz1T.js → input-BmuxVBRq.js} +1 -1
- package/dist/client/assets/{integration-icon-CVsQlE88.js → integration-icon-BIrESC5L.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BocroOxJ.js → invite-member-dialog-DIItbiti.js} +1 -1
- package/dist/client/assets/{label-CEq9oqa2.js → label-CpzYUQhx.js} +1 -1
- package/dist/client/assets/{layout-DFoH_xu7.js → layout-DUzsu4c4.js} +1 -1
- package/dist/client/assets/{login-DQ-omlrv.js → login-RKrGsWpi.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DGSZYZtZ.js → mcp-oauth-fsNn1czb.js} +1 -1
- package/dist/client/assets/{members-1vFWUjqy.js → members-BrDpNquF.js} +1 -1
- package/dist/client/assets/{monaco-editor-BIUU4YtT.js → monaco-editor-CMqzV6OC.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Drb7zrQ3.js → monitoring-stats-row-B-2cTzBQ.js} +1 -1
- package/dist/client/assets/{multi-select-CeA0LiDA.js → multi-select-BQDrB1yk.js} +1 -1
- package/dist/client/assets/{oauth-callback-BLBnsV0m.js → oauth-callback-Ba4XCWyw.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-_ZIgbe1k.js → oauth-callback-ai-provider-JZoeFXxW.js} +1 -1
- package/dist/client/assets/{onboarding-DHEpPKxX.js → onboarding-Bk8dPUg3.js} +1 -1
- package/dist/client/assets/{org-layout-CZwey9tp.js → org-layout-Di5sK1cd.js} +1 -1
- package/dist/client/assets/{organization-choice-CinweDu8.js → organization-choice-CHzFbea4.js} +1 -1
- package/dist/client/assets/{orgs-Cewt5f_m.js → orgs-CKI_JjMZ.js} +1 -1
- package/dist/client/assets/{page-seo-form-DCXZwoTq.js → page-seo-form-DC6yxtgW.js} +1 -1
- package/dist/client/assets/{popover-CPDUuAsK.js → popover-3-nXGxsG.js} +1 -1
- package/dist/client/assets/{post-calendar-B2MLz9zN.js → post-calendar-_RxbEjvs.js} +1 -1
- package/dist/client/assets/{post-editor-xPbcpUyS.js → post-editor-htgRFHsC.js} +1 -1
- package/dist/client/assets/{primitives-bdzFl9KQ.js → primitives-By-oabkM.js} +1 -1
- package/dist/client/assets/{profile-DRVuFWo1.js → profile-itQSWHS0.js} +1 -1
- package/dist/client/assets/{project-app-view-C0-tH6m6.js → project-app-view-BtD2dHc2.js} +1 -1
- package/dist/client/assets/{prompts-DHayAFpv.js → prompts-B4jycXmo.js} +1 -1
- package/dist/client/assets/record-editor-DmWjrMIo.js +1 -0
- package/dist/client/assets/{redirect-editor-OElGvzsY.js → redirect-editor-CyQNXT5k.js} +1 -1
- package/dist/client/assets/registry-BokCitrd.js +2 -0
- package/dist/client/assets/{registry-layout-BTzECwAf.js → registry-layout-BjtKfm0C.js} +1 -1
- package/dist/client/assets/{reports-BlhyDDdZ.js → reports-D2AnuGQl.js} +1 -1
- package/dist/client/assets/{require-capability-BJjD7GXa.js → require-capability-DYqEh_0t.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bi3hMcfQ.js → required-auth-layout-DPe5oune.js} +1 -1
- package/dist/client/assets/{reset-password-BLXOXnD3.js → reset-password-BcbVGV-U.js} +1 -1
- package/dist/client/assets/{review-settings-0bpnzbvB.js → review-settings-DET5Awcp.js} +1 -1
- package/dist/client/assets/{roles-C9DLuLWB.js → roles-Cm1qg0ow.js} +1 -1
- package/dist/client/assets/{scroll-area-Dw0578rC.js → scroll-area-BsxuvxbS.js} +1 -1
- package/dist/client/assets/{search-input-lOvS7ZZY.js → search-input-i6XUS8wH.js} +1 -1
- package/dist/client/assets/{secrets-DEtSas2W.js → secrets-DmB_3wh4.js} +1 -1
- package/dist/client/assets/{sections-editor-DDSHgrQf.js → sections-editor-CQaXh0aN.js} +1 -1
- package/dist/client/assets/{select-W8jorDji.js → select-OkaoLf52.js} +1 -1
- package/dist/client/assets/{select-model-CVJuTB71.js → select-model-DQ1JGbZ1.js} +1 -1
- package/dist/client/assets/{self-tool-result-DYCZ2dxI.js → self-tool-result-_Gq4fS8Q.js} +1 -1
- package/dist/client/assets/{seo-editor-CqSjFrJe.js → seo-editor-D3_wyic8.js} +1 -1
- package/dist/client/assets/{settings-layout-Cj60dDE0.js → settings-layout-ClrVUhfB.js} +1 -1
- package/dist/client/assets/{shell-controls-CcajpdEy.js → shell-controls-DkHGCWDm.js} +1 -1
- package/dist/client/assets/{shell-layout-BbKgiGKQ.js → shell-layout-H_tjyvHd.js} +1 -1
- package/dist/client/assets/{spinner-DEaGcbnH.js → spinner-BNsOVOLB.js} +1 -1
- package/dist/client/assets/{sso-DFyPw3S-.js → sso-CVRSygMq.js} +1 -1
- package/dist/client/assets/{store-B-DY1jsG.js → store-EFK86dJx.js} +1 -1
- package/dist/client/assets/store-registry-CAgXmIVJ.js +2 -0
- package/dist/client/assets/{super-agent-icon-DxowWKwv.js → super-agent-icon-uUxotzmO.js} +1 -1
- package/dist/client/assets/{switch-BsAR0Ue8.js → switch-jAw5NRFm.js} +1 -1
- package/dist/client/assets/{synced-repos-BxJ8BZWX.js → synced-repos-DHWcDJ5i.js} +1 -1
- package/dist/client/assets/{table-RKi74_kY.js → table-DSRHVWxU.js} +1 -1
- package/dist/client/assets/{tabs-DFRRVuh7.js → tabs-CkF_fW0Q.js} +1 -1
- package/dist/client/assets/{task-board-D9PHUZff.js → task-board-DmX2VpFs.js} +1 -1
- package/dist/client/assets/{tasks-CiijDgSs.js → tasks-C6LaWTXG.js} +1 -1
- package/dist/client/assets/{textarea-XbuS70jj.js → textarea-DzCWtryj.js} +1 -1
- package/dist/client/assets/{toggle-group-WZyFFujP.js → toggle-group-hvwloSYQ.js} +1 -1
- package/dist/client/assets/{toolbar-CmaLqa3-.js → toolbar-D9gkmlH9.js} +1 -1
- package/dist/client/assets/{track-BFh4WctH.js → track-CwWn2JFQ.js} +1 -1
- package/dist/client/assets/{types-CrdXjhQP.js → types-D8IG_8eU.js} +1 -1
- package/dist/client/assets/{use-ai-providers-WmO5B1wa.js → use-ai-providers-DZwpIJ4W.js} +1 -1
- package/dist/client/assets/{use-api-keys-CHuWewKt.js → use-api-keys-D39Ow3Yy.js} +1 -1
- package/dist/client/assets/{use-automations-g--nS4Go.js → use-automations-D--Rxx-_.js} +1 -1
- package/dist/client/assets/{use-autosave-BsqWx81g.js → use-autosave-BDzRVdw8.js} +1 -1
- package/dist/client/assets/{use-connection-D8j2CnOC.js → use-connection-tOCjDBfx.js} +1 -1
- package/dist/client/assets/{use-copy-lK-vhEre.js → use-copy-ICpw0Yw-.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bdpos1w0.js → use-create-virtual-mcp-DKiTnBa-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DsCulVkO.js → use-debounced-autosave-C706dtM7.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D5wCJf5h.js → use-debounced-value-DBMZQqKo.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CEhAvB_E.js → use-decopilot-events-DFaxDB0Z.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BAty9GWK.js → use-delete-connection-DY1dO96h.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CD-qM4Qw.js → use-deployment-admin-CwPi-zHy.js} +1 -1
- package/dist/client/assets/{use-destination-route-BMJNYrmL.js → use-destination-route-C8wZaTLq.js} +1 -1
- package/dist/client/assets/{use-file-configs-CEny8PB8.js → use-file-configs-rXyGhpyn.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DzHJHyr0.js → use-infinite-scroll-BUgjJwY5.js} +1 -1
- package/dist/client/assets/{use-join-requests-z_I5qiFl.js → use-join-requests-CbCMIasb.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-dyqIaOq0.js → use-mcp-auth-status-CyITsP1y.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bac4vccq.js → use-mcp-client-DHZ5WVmn.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-FenH0JaE.js → use-mcp-tools-C69l20dV.js} +1 -1
- package/dist/client/assets/{use-members-_2HCzEHc.js → use-members-CAd4YLUd.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-yAkGdje4.js → use-navigate-to-agent-BWgdcI3Z.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cb5lYh1t.js → use-org-auth-client-DPBNI0km.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DbzFw6wJ.js → use-org-repo-syncs-Df_iQEGc.js} +1 -1
- package/dist/client/assets/{use-org-sso-cefqXe6X.js → use-org-sso-Y-cX0M9u.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DA6OSxjH.js → use-organization-roles-Cazh8-rd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BsgcrCz-.js → use-organization-settings-CGbImq1L.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-C8-xot4V.js → use-panel-navigate-CzBWJmh4.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BoC6e9Ko.js → use-registry-connections--wEDOuCo.js} +1 -1
- package/dist/client/assets/{use-secrets-CNOFekf-.js → use-secrets-BUOK8Q3X.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CFAiIdAN.js → use-section-preview-base-CQ_HgNgO.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CdtGOM4G.js → use-status-sounds-BcDDyChz.js} +1 -1
- package/dist/client/assets/{use-tags-CnmdA4eJ.js → use-tags-DQhkcWVg.js} +1 -1
- package/dist/client/assets/{use-view-mode-DHrNQrCI.js → use-view-mode-DyvonuSr.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-X7MaI4-V.js → use-virtual-mcp-zkag_-cI.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CHJpyz-t.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-uqFTRGN7.js +1 -0
- package/dist/client/assets/{users-CNOqKONO.js → users-DBLID0_X.js} +1 -1
- package/dist/client/assets/{variant-calendar-DzbjSxwP.js → variant-calendar-pfbXNZPy.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C_beZllv.js → view-mode-toggle-ChPfg34r.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/record-editor-BabiokFj.js +0 -1
- package/dist/client/assets/registry-Bpp0Gik6.js +0 -2
- package/dist/client/assets/store-registry-CW8CS7Je.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CP11XfQS.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-vPet_vok.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as pe,b as me,j as o,x as Ie,c6 as De,c1 as Le,t as le,B as re,b7 as Te,H as we,p as Ee,a as Fe,r as Z,o as ke,K as ge,e as Pe,q as Y,I as Me,n as Ge,P as ce}from"./index-DHLutK6v.js";import{a as ee,b as ye,D as de,c as ue}from"./dropdown-menu-BGreHXNg.js";import{a as Oe}from"./Users03-BT3gPqQL.js";import{G as Se,b as ze,a as Be}from"./github-repo-picker-BjTlfZRh.js";import{b as _e,u as Ue,c as Re}from"./use-virtual-mcp-X7MaI4-V.js";import{i as $e}from"./DotsVertical-B39kxqbi.js";import{A as He,d as fe,a$ as Ve,b0 as Ke}from"./agent-icon-C9_7Msf7.js";import{a as qe}from"./Settings02-xEBQxvJD.js";import{s as Qe}from"./Trash01-CwqV1gzD.js";import{p as Je,f as he}from"./pt-BR-CLy76QW2.js";import{c as ve}from"./use-navigate-to-agent-yAkGdje4.js";import{f as Ye,i as We}from"./use-organization-settings-BsgcrCz-.js";import{h as Xe}from"./agent-capabilities-B52k7xCe.js";import{E as Ze}from"./empty-state-DNKOHljA.js";import{u as et}from"./use-create-virtual-mcp-Bdpos1w0.js";import{u as tt}from"./use-connection-D8j2CnOC.js";import{u as xe}from"./use-mcp-client-Bac4vccq.js";import{S as ot}from"./constants-dLUUoWH7.js";import{b as st,c as je}from"./session-runtime-wVXsCwcJ.js";import{g as it,f as nt,b as rt,G as lt,p as at}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as ct,d as mt,a as dt,b as ut,c as pt}from"./dialog-DYg0AoO0.js";import{i as gt}from"./ArrowLeft-CatEVOI7.js";import{C as ft}from"./collection-search-DBnGb4Zg.js";import{c as ht,d as xt,b as jt,f as Ct,g as bt,e as Dt,a as wt,A as yt}from"./alert-dialog-BWONJIzw.js";import{S as St}from"./search-input-lOvS7ZZY.js";import{s as Ce}from"./Plus-B7vTVmKH.js";import"./Check-C5RWnyNL.js";import"./ChevronRight-Dh8_6pj1.js";import"./use-debounced-value-D5wCJf5h.js";import"./authenticate-and-persist-oauth-DRVU48ic.js";import"./mcp-oauth-DGSZYZtZ.js";import"./auth-BqxUQw-v.js";import"./LinkExternal01-kQnRXU4w.js";import"./LockUnlocked01-D5OpQeQe.js";import"./use-mcp-tools-FenH0JaE.js";import"./extract-connection-data-BI_gbc3h.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-qZDg2e-H.js";import"./UserSquare-ClSByuB-.js";import"./Tool01-tn2PFBHQ.js";import"./ArrowUp-DMDdMhAA.js";import"./Tool02-BalBR7uK.js";import"./XCircle-BOrCVYLf.js";import"./TrendUp01-6TR_k_0Y.js";import"./ZapSquare-DkKtoQ7W.js";import"./CheckCircle-V0GvWvtd.js";import"./ChevronDown-CeGZsBnS.js";import"./ChevronSelectorVertical-Im3Lz_4E.js";import"./ChevronUp-DCx43qHY.js";import"./Stars02-4GZ9SjIq.js";import"./Copy01-DhfruII6.js";import"./CreditCard01-Cy0s6gAf.js";import"./Download01-C1FmC7JV.js";import"./Eye-m8QZKf2Y.js";import"./FilterLines-BBF-m2ZJ.js";import"./Share07-CLkT7SlV.js";import"./Globe01-C2F_PPuX.js";import"./Globe04-CMCnFTSr.js";import"./SwitchHorizontal01-DwxljZOI.js";import"./HardDrive-DmqNZKD8.js";import"./Key01-DbCU9LZF.js";import"./LogOut01-BePTyd5L.js";import"./Monitor01-DPqlemzQ.js";import"./Sun-D0KW7MLF.js";import"./Palette-DzT0S9Gl.js";import"./Play-Btu3v5FX.js";import"./SearchLg-CAAIuTYj.js";import"./SearchMd-COQJLRw-.js";import"./Shield01-C2USnj9G.js";import"./Stars01-DkoqcM4j.js";import"./Upload01-mqAHBbZV.js";import"./User01-DWaPmCwS.js";import"./Users01-CFDNbxgJ.js";import"./XClose-DMSeuF30.js";import"./Zap-CwYGo5D6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-destination-route-BMJNYrmL.js";import"./hooks-DvV-YCly.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DDszDk42.js";import"./task-board-D9PHUZff.js";function be(t){const e=pe.c(28),{onCreateFromScratch:s,onImportGitHub:n,onImportDeco:a,isCreating:g,align:r,side:R,showBetaBadge:h}=t,$=r===void 0?"end":r,d=me();let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx(Oe,{size:14}),e[0]=M):M=e[0];let c;e[1]!==d?(c=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=c):c=e[2];let D;e[3]!==g||e[4]!==s||e[5]!==c?(D=o.jsxs(ee,{disabled:g,onClick:s,children:[M,c]}),e[3]=g,e[4]=s,e[5]=c,e[6]=D):D=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Se,{className:"size-3.5"}),e[7]=x):x=e[7];let _;e[8]!==d?(_=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=_):_=e[9];let m;e[10]!==h?(m=h&&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]=h,e[11]=m):m=e[11];let l;e[12]!==n||e[13]!==_||e[14]!==m?(l=o.jsxs(ee,{onClick:n,children:[x,_,m]}),e[12]=n,e[13]=_,e[14]=m,e[15]=l):l=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=f):f=e[16];let v;e[17]!==d?(v=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=v):v=e[18];let w;e[19]!==a||e[20]!==v?(w=o.jsxs(ee,{onClick:a,children:[f,v]}),e[19]=a,e[20]=v,e[21]=w):w=e[21];let C;return e[22]!==$||e[23]!==R||e[24]!==w||e[25]!==D||e[26]!==l?(C=o.jsxs(ye,{side:R,align:$,className:"w-48",children:[D,l,w]}),e[22]=$,e[23]=R,e[24]=w,e[25]=D,e[26]=l,e[27]=C):C=e[27],C}function _t(t){const e=pe.c(78),{project:s,lastUsedAt:n,onDeleteClick:a}=t,g=ve(),r=me(),[R]=Ie(),h=R.language==="pt-BR"?Je:void 0,{mainAgentId:$}=Ye(),d=We(),{granted:M}=De("org:manage"),c=$===s.id,D=_e(),{isPrivileged:x}=Le();let _;e[0]!==x||e[1]!==s?(_=x&&Xe(s),e[0]=x,e[1]=s,e[2]=_):_=e[2];const m=_,l=!!s.pinned;let f;e[3]!==D.update||e[4]!==l||e[5]!==s.id?(f=()=>{D.update.mutate({id:s.id,data:{pinned:!l}})},e[3]=D.update,e[4]=l,e[5]=s.id,e[6]=f):f=e[6];const v=f;let w;e[7]!==c||e[8]!==s.id||e[9]!==s.title||e[10]!==d||e[11]!==r?(w=()=>{const E=c?null:s.id;d.mutate(E,{onSuccess:()=>le.success(c?r("home.projectCard.mainAgentUnset",{title:s.title}):r("home.projectCard.mainAgentSet",{title:s.title})),onError:()=>le.error(r("home.projectCard.mainAgentError"))})},e[7]=c,e[8]=s.id,e[9]=s.title,e[10]=d,e[11]=r,e[12]=w):w=e[12];const C=w;let V;e[13]!==g||e[14]!==s.id?(V=()=>g(s.id),e[13]=g,e[14]=s.id,e[15]=V):V=e[15];let G;e[16]!==s.title||e[17]!==V?(G=o.jsx("button",{type:"button",onClick:V,className:"absolute inset-0 z-0","aria-label":s.title}),e[16]=s.title,e[17]=V,e[18]=G):G=e[18];let K;e[19]!==s.icon||e[20]!==s.title?(K=o.jsx(He,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[19]=s.icon,e[20]=s.title,e[21]=K):K=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(de,{asChild:!0,children:o.jsx(re,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[22]=k):k=e[22];let N;e[23]!==g||e[24]!==s.id?(N=()=>g(s.id,{panel:"settings"}),e[23]=g,e[24]=s.id,e[25]=N):N=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx(qe,{size:16}),e[26]=O):O=e[26];let H;e[27]!==N?(H=o.jsxs(ee,{onClick:N,children:[O,"Settings"]}),e[27]=N,e[28]=H):H=e[28];let y;e[29]!==M||e[30]!==c||e[31]!==r||e[32]!==C?(y=M&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),C()},children:[o.jsx(fe,{size:16}),r(c?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[29]=M,e[30]=c,e[31]=r,e[32]=C,e[33]=y):y=e[33];let i;e[34]!==m||e[35]!==l||e[36]!==r||e[37]!==v?(i=m&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),v()},children:[o.jsx(Ve,{size:16}),r(l?"home.projectCard.unpinFromSidebar":"home.projectCard.pinToSidebar")]}),e[34]=m,e[35]=l,e[36]=r,e[37]=v,e[38]=i):i=e[38];let u;e[39]!==a?(u=a&&o.jsxs(ee,{variant:"destructive",onClick:E=>{E.stopPropagation(),a(E)},children:[o.jsx(Qe,{size:16}),"Delete"]}),e[39]=a,e[40]=u):u=e[40];let p;e[41]!==H||e[42]!==y||e[43]!==i||e[44]!==u?(p=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(ue,{children:[k,o.jsxs(ye,{align:"end",children:[H,y,i,u]})]})}),e[41]=H,e[42]=y,e[43]=i,e[44]=u,e[45]=p):p=e[45];let j;e[46]!==p||e[47]!==K?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[K,p]}),e[46]=p,e[47]=K,e[48]=j):j=e[48];let S;e[49]!==s.title?(S=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[49]=s.title,e[50]=S):S=e[50];let A;e[51]!==c||e[52]!==r?(A=c&&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}),r("home.projectCard.mainAgentBadge")]}),e[51]=c,e[52]=r,e[53]=A):A=e[53];let I;e[54]!==S||e[55]!==A?(I=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,A]}),e[54]=S,e[55]=A,e[56]=I):I=e[56];const U=s.description||"No description";let z;e[57]!==U?(z=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:U}),e[57]=U,e[58]=z):z=e[58];let b;e[59]!==I||e[60]!==z?(b=o.jsxs("div",{className:"flex flex-col gap-1",children:[I,z]}),e[59]=I,e[60]=z,e[61]=b):b=e[61];let L;e[62]!==j||e[63]!==b?(L=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,b]}),e[62]=j,e[63]=b,e[64]=L):L=e[64];let T;e[65]!==n||e[66]!==h||e[67]!==s.updated_at||e[68]!==r?(T=n?r("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:h})}):r("home.projectCard.updated",{time:he(new Date(s.updated_at),{addSuffix:!0,locale:h})}),e[65]=n,e[66]=h,e[67]=s.updated_at,e[68]=r,e[69]=T):T=e[69];let B;e[70]!==T?(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:T})})}),e[70]=T,e[71]=B):B=e[71];let P;e[72]!==L||e[73]!==B?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[L,B]}),e[72]=L,e[73]=B,e[74]=P):P=e[74];let q;return e[75]!==P||e[76]!==G?(q=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[G,P]}),e[75]=P,e[76]=G,e[77]=q):q=e[77],q}const vt="deco-sites";function Nt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,n=e.repo;return typeof s!="string"||typeof n!="string"||s.length===0||n.length===0?null:{owner:s,repo:n}}function At(t,e){const s=e?Nt(e):null,n=s?.owner??vt,a=s?.repo??t;return{owner:n,name:a,url:`https://github.com/${n}/${a}`}}function It(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const n=await fetch(t,e),a=await n.json().catch(()=>({}));if(!n.ok)throw new Error(a.error??`${s} (${n.status})`);return a}function Lt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Tt({open:t,onOpenChange:e,onBack:s}){const n=me(),{org:a}=we(),g=ve(),r=Ee(),{data:R}=Fe.useSession(),[h,$]=Z.useState(null),[d,M]=Z.useState(null),[c,D]=Z.useState(""),x=xe({connectionId:ot,orgId:a.id,orgSlug:a.slug}),_=tt({slug:"mcp-github"}),m=it(_),l=ze({enabled:t&&m.length===0}),f=m.length===1?m[0]??null:d,v=m.length>1&&!f,w=xe({connectionId:f?.id??"",orgId:a.id,orgSlug:a.slug}),C=t&&m.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:V,isLoading:G,error:K}=ke({queryKey:ge.decoSites(R?.user?.email),queryFn:()=>Lt(a.slug),enabled:t&&!!R?.user?.email,staleTime:6e4,retry:!1}),k=V?.sites??[],N=i=>{i||($(null),M(null),D("")),e(i)},O=k.filter(i=>i.name.toLowerCase().includes(c.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(c.toLowerCase())??!1)),H=!h||O.some(i=>i.name===h),y=Pe({mutationFn:async i=>{if(!f)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));Y("deco_site_import_started",{site_name:i});const{installations:u}=await nt(b=>x.callTool(b),f.id),p=k.find(b=>b.name===i);if(!p)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const j=At(i,p.metadata),S=rt(u,j.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:j.owner,installUrl:lt}));let A=null,I=null,U=null;const z=async()=>{U&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),I&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),A&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const b=await Ne(`/api/${a.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},n("common.importFromDecoDialog.failedToCreateConnection")),L=b.connId;if(!L)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=L;const{childConnectionId:T,reused:B}=await at({orgSlug:a.slug,sourceConnection:f,installationId:S.installationId,owner:j.owner,repo:j.name,githubCallTool:J=>w.callTool(J),selfCallTool:J=>x.callTool(J)});I=B?null:T;const P=b.icon??null,q=It(i),E=i.toLowerCase(),W=st(je(p.domains)),X=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:P??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:E,previewServerUrl:W,productionUrl:W,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:S.installationId,connectionId:T},ui:{banner:null,bannerColor:"#22C55E",icon:P,themeColor:"#22C55E",slug:q,pinnedViews:[{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:L},{connection_id:T}]}}}),Q=X.structuredContent??X;if(!Q.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return U=Q.item.id,{slug:q,virtualMcpId:Q.item.id,connId:L,item:Q.item}}catch(b){throw await z(),b}},onSuccess:({slug:i,virtualMcpId:u,item:p})=>{Y("deco_site_import_succeeded",{site_name:p.title,virtual_mcp_id:u,slug:i}),r.setQueryData(ge.collectionItem(x,a.id,"","VIRTUAL_MCP",u),{item:p}),r.invalidateQueries({predicate:j=>{const S=j.queryKey;return S[1]===a.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:i})),N(!1),localStorage.setItem(Me.sidebarOpen(),JSON.stringify(!1)),g(u)},onError:i=>{Y("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ct,{open:t,onOpenChange:N,children:o.jsxs(mt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(dt,{className:"sr-only",children:o.jsx(ut,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(gt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ft,{value:c,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.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(re,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),C&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),v&&!C&&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")})}),m.map(i=>o.jsxs("button",{type:"button",onClick:()=>M(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),G&&!C&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!G&&!C&&!v&&l.status!=="error"&&!K&&k.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!G&&!C&&!v&&l.status!=="error"&&k.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:[O.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:c})}),O.map(i=>{const u=je(i.domains),p=h===i.name;return o.jsxs("button",{type:"button",onClick:()=>$(i.name),className:Ge("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",p?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),u&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:u})]})]},i.name)})]})]}),o.jsxs(pt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(re,{variant:"outline",onClick:()=>N(!1),disabled:y.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(re,{disabled:!h||!H||y.isPending||G||C||v||!f||l.status==="error",onClick:()=>h&&y.mutate(h),children:y.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function as(){const t=pe.c(77),e=me(),{org:s}=we(),n=Ue(),a=_e(),[g,r]=Z.useState("");let R;t[0]===Symbol.for("react.memo_cache_sentinel")?(R={navigateOnCreate:!0},t[0]=R):R=t[0];const{createVirtualMCP:h,isCreating:$}=et(R),[d,M]=Z.useState(null),[c,D]=Z.useState(!1),[x,_]=Z.useState(!1),{granted:m}=De("agents:manage"),l=g.toLowerCase(),f=n.filter(F=>F.id!==s.id&&(F.title.toLowerCase().includes(l)||F.description?.toLowerCase().includes(l))),{data:v}=Re(f.map(Et));let w;t[1]!==a||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:F,title:Ae}=d;M(null);try{await a.delete.mutateAsync(F),Y("agent_deleted",{agent_id:F,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ae}))}catch{}},t[1]=a,t[2]=d,t[3]=e,t[4]=w):w=t[4];const C=w,V=ce,G=ce,K=ce;let k;t[5]!==e?(k=e("routes.agentsList.title"),t[5]=e,t[6]=k):k=t[6];let N;t[7]!==k?(N=o.jsx(ce.Title,{children:k}),t[7]=k,t[8]=N):N=t[8];let O;t[9]!==e?(O=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=O):O=t[10];let H;t[11]===Symbol.for("react.memo_cache_sentinel")?(H=F=>{F.key==="Escape"&&(r(""),F.target.blur())},t[11]=H):H=t[11];let y;t[12]!==g||t[13]!==O?(y=o.jsx(St,{value:g,onChange:r,placeholder:O,className:"w-full md:w-[375px]",onKeyDown:H}),t[12]=g,t[13]=O,t[14]=y):y=t[14];let i;t[15]!==m||t[16]!==h||t[17]!==$||t[18]!==e?(i=m&&o.jsxs(ue,{children:[o.jsx(de,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:$,align:"end"})]}),t[15]=m,t[16]=h,t[17]=$,t[18]=e,t[19]=i):i=t[19];let u;t[20]!==y||t[21]!==i?(u=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y,i]}),t[20]=y,t[21]=i,t[22]=u):u=t[22];let p;t[23]!==u||t[24]!==N?(p=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,u]}),t[23]=u,t[24]=N,t[25]=p):p=t[25];const j=f.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ze,{image:o.jsx(Ke,{size:48,className:"text-muted-foreground"}),title:e(g?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:g?e("routes.agentsList.noAgentsMatchSearch",{search:g}):e(m?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!g&&m&&o.jsxs(ue,{children:[o.jsx(de,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:$,align:"center",showBetaBadge:!0})]})})}),S=f.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:f.map(F=>o.jsx(_t,{project:F,lastUsedAt:v?.get(F.id)?.last_used_at,onDeleteClick:m?()=>M({id:F.id,title:F.title}):void 0},F.id))})]});let A;t[26]!==p||t[27]!==j||t[28]!==S||t[29]!==K.Body?(A=o.jsxs(K.Body,{children:[p,j,S]}),t[26]=p,t[27]=j,t[28]=S,t[29]=K.Body,t[30]=A):A=t[30];let I;t[31]!==A||t[32]!==G.Content?(I=o.jsx(G.Content,{children:A}),t[31]=A,t[32]=G.Content,t[33]=I):I=t[33];let U;t[34]!==x?(U=o.jsx(Be,{open:x,onOpenChange:_}),t[34]=x,t[35]=U):U=t[35];let z;t[36]!==c?(z=o.jsx(Tt,{open:c,onOpenChange:D}),t[36]=c,t[37]=z):z=t[37];const b=!!d;let L;t[38]===Symbol.for("react.memo_cache_sentinel")?(L=F=>!F&&M(null),t[38]=L):L=t[38];let T;t[39]!==e?(T=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=T):T=t[40];let B;t[41]!==T?(B=o.jsx(ht,{children:T}),t[41]=T,t[42]=B):B=t[42];let P;t[43]!==e?(P=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=P):P=t[44];const q=d?.title;let E;t[45]!==q?(E=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[45]=q,t[46]=E):E=t[46];let W;t[47]!==P||t[48]!==E?(W=o.jsxs(xt,{children:[P," ",E,"."]}),t[47]=P,t[48]=E,t[49]=W):W=t[49];let X;t[50]!==B||t[51]!==W?(X=o.jsxs(jt,{children:[B,W]}),t[50]=B,t[51]=W,t[52]=X):X=t[52];let Q;t[53]!==e?(Q=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=Q):Q=t[54];let J;t[55]!==Q?(J=o.jsx(Ct,{children:Q}),t[55]=Q,t[56]=J):J=t[56];let te;t[57]!==e?(te=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=te):te=t[58];let oe;t[59]!==C||t[60]!==te?(oe=o.jsx(bt,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:te}),t[59]=C,t[60]=te,t[61]=oe):oe=t[61];let se;t[62]!==J||t[63]!==oe?(se=o.jsxs(Dt,{children:[J,oe]}),t[62]=J,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==X||t[66]!==se?(ie=o.jsxs(wt,{children:[X,se]}),t[65]=X,t[66]=se,t[67]=ie):ie=t[67];let ne;t[68]!==b||t[69]!==ie?(ne=o.jsx(yt,{open:b,onOpenChange:L,children:ie}),t[68]=b,t[69]=ie,t[70]=ne):ne=t[70];let ae;return t[71]!==V||t[72]!==I||t[73]!==U||t[74]!==z||t[75]!==ne?(ae=o.jsxs(V,{children:[I,U,z,ne]}),t[71]=V,t[72]=I,t[73]=U,t[74]=z,t[75]=ne,t[76]=ae):ae=t[76],ae}function Et(t){return t.id}export{as as default};
|
|
1
|
+
import{c as pe,b as me,j as o,x as Ie,c6 as De,c1 as Le,t as le,B as re,b7 as Te,H as we,p as Ee,a as Fe,r as Z,o as ke,K as ge,e as Pe,q as Y,I as Me,n as Ge,P as ce}from"./index-BWXyDl1J.js";import{a as ee,b as ye,D as de,c as ue}from"./dropdown-menu-BE_ym3Aq.js";import{a as Oe}from"./Users03-BvmFpFso.js";import{G as Se,b as ze,a as Be}from"./github-repo-picker-DuwsdpzE.js";import{b as _e,u as Ue,c as Re}from"./use-virtual-mcp-zkag_-cI.js";import{i as $e}from"./DotsVertical-CSkWlHZt.js";import{A as He,d as fe,a$ as Ve,b0 as Ke}from"./agent-icon-LbhnjHwi.js";import{a as qe}from"./Settings02-DVdySYD4.js";import{s as Qe}from"./Trash01-BaF7-rQA.js";import{p as Je,f as he}from"./pt-BR-CLy76QW2.js";import{c as ve}from"./use-navigate-to-agent-BWgdcI3Z.js";import{f as Ye,i as We}from"./use-organization-settings-CGbImq1L.js";import{h as Xe}from"./agent-capabilities-B52k7xCe.js";import{E as Ze}from"./empty-state-DANnu2Dm.js";import{u as et}from"./use-create-virtual-mcp-DKiTnBa-.js";import{u as tt}from"./use-connection-tOCjDBfx.js";import{u as xe}from"./use-mcp-client-DHZ5WVmn.js";import{S as ot}from"./constants-dLUUoWH7.js";import{b as st,c as je}from"./session-runtime-wVXsCwcJ.js";import{g as it,f as nt,b as rt,G as lt,p as at}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as ct,d as mt,a as dt,b as ut,c as pt}from"./dialog-D4htx8Dz.js";import{i as gt}from"./ArrowLeft-Bz-VyTFg.js";import{C as ft}from"./collection-search-swq3mYpH.js";import{c as ht,d as xt,b as jt,f as Ct,g as bt,e as Dt,a as wt,A as yt}from"./alert-dialog-CDXDBEVz.js";import{S as St}from"./search-input-i6XUS8wH.js";import{s as Ce}from"./Plus-C20besyI.js";import"./Check-CTKt7DPp.js";import"./ChevronRight-CO9K42kJ.js";import"./use-debounced-value-DBMZQqKo.js";import"./authenticate-and-persist-oauth-B1awg6G_.js";import"./mcp-oauth-fsNn1czb.js";import"./auth-CMC5pcXA.js";import"./LinkExternal01-Bd5qXJx-.js";import"./LockUnlocked01-xUxyOLI6.js";import"./use-mcp-tools-C69l20dV.js";import"./extract-connection-data-BIGQQYkp.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-DLj-rBLn.js";import"./UserSquare-D5oHibl1.js";import"./Tool01-C-r-Zf-I.js";import"./ArrowUp-C9wijSHC.js";import"./Tool02-CQfhYBA-.js";import"./XCircle-BLGxEUt7.js";import"./TrendUp01-DrIbuukS.js";import"./ZapSquare-B03SIXBG.js";import"./CheckCircle-DOOBCpT9.js";import"./ChevronDown-DCBuHd0m.js";import"./ChevronSelectorVertical-Iu37Jtvz.js";import"./ChevronUp-D6fZUTvM.js";import"./Stars02-DSl09LS3.js";import"./Copy01-C-9zesbF.js";import"./CreditCard01-CKM-Jz3x.js";import"./Download01-DYsmBrAR.js";import"./Eye-Bf1344cz.js";import"./FilterLines-D4VZo9JH.js";import"./Share07-TLJEQyW1.js";import"./Globe01-Mlkbzavy.js";import"./Globe04-CcZwBZDM.js";import"./SwitchHorizontal01-DxrMcxk-.js";import"./HardDrive-rv6yXW9l.js";import"./Key01-C71Bncy8.js";import"./LogOut01-CFPuWi87.js";import"./Monitor01-Db3wK3MU.js";import"./Sun-D8Cz2KrR.js";import"./Palette-Wf7ieWzf.js";import"./Play-CTzOPD4i.js";import"./SearchLg-BoAF9n4o.js";import"./SearchMd-DbgBw9S_.js";import"./Shield01-CVEumGx3.js";import"./Stars01-BLlf5jfX.js";import"./Upload01-Eo8Y8gwt.js";import"./User01-BmKTu46m.js";import"./Users01-DdYj89q4.js";import"./XClose-KYQfxNAH.js";import"./Zap-DSuzhrFd.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-destination-route-C8wZaTLq.js";import"./hooks-rNJx2Yiz.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CvmARxhG.js";import"./task-board-DmX2VpFs.js";function be(t){const e=pe.c(28),{onCreateFromScratch:s,onImportGitHub:n,onImportDeco:a,isCreating:g,align:r,side:R,showBetaBadge:h}=t,$=r===void 0?"end":r,d=me();let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx(Oe,{size:14}),e[0]=M):M=e[0];let c;e[1]!==d?(c=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=c):c=e[2];let D;e[3]!==g||e[4]!==s||e[5]!==c?(D=o.jsxs(ee,{disabled:g,onClick:s,children:[M,c]}),e[3]=g,e[4]=s,e[5]=c,e[6]=D):D=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Se,{className:"size-3.5"}),e[7]=x):x=e[7];let _;e[8]!==d?(_=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=_):_=e[9];let m;e[10]!==h?(m=h&&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]=h,e[11]=m):m=e[11];let l;e[12]!==n||e[13]!==_||e[14]!==m?(l=o.jsxs(ee,{onClick:n,children:[x,_,m]}),e[12]=n,e[13]=_,e[14]=m,e[15]=l):l=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=f):f=e[16];let v;e[17]!==d?(v=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=v):v=e[18];let w;e[19]!==a||e[20]!==v?(w=o.jsxs(ee,{onClick:a,children:[f,v]}),e[19]=a,e[20]=v,e[21]=w):w=e[21];let C;return e[22]!==$||e[23]!==R||e[24]!==w||e[25]!==D||e[26]!==l?(C=o.jsxs(ye,{side:R,align:$,className:"w-48",children:[D,l,w]}),e[22]=$,e[23]=R,e[24]=w,e[25]=D,e[26]=l,e[27]=C):C=e[27],C}function _t(t){const e=pe.c(78),{project:s,lastUsedAt:n,onDeleteClick:a}=t,g=ve(),r=me(),[R]=Ie(),h=R.language==="pt-BR"?Je:void 0,{mainAgentId:$}=Ye(),d=We(),{granted:M}=De("org:manage"),c=$===s.id,D=_e(),{isPrivileged:x}=Le();let _;e[0]!==x||e[1]!==s?(_=x&&Xe(s),e[0]=x,e[1]=s,e[2]=_):_=e[2];const m=_,l=!!s.pinned;let f;e[3]!==D.update||e[4]!==l||e[5]!==s.id?(f=()=>{D.update.mutate({id:s.id,data:{pinned:!l}})},e[3]=D.update,e[4]=l,e[5]=s.id,e[6]=f):f=e[6];const v=f;let w;e[7]!==c||e[8]!==s.id||e[9]!==s.title||e[10]!==d||e[11]!==r?(w=()=>{const E=c?null:s.id;d.mutate(E,{onSuccess:()=>le.success(c?r("home.projectCard.mainAgentUnset",{title:s.title}):r("home.projectCard.mainAgentSet",{title:s.title})),onError:()=>le.error(r("home.projectCard.mainAgentError"))})},e[7]=c,e[8]=s.id,e[9]=s.title,e[10]=d,e[11]=r,e[12]=w):w=e[12];const C=w;let V;e[13]!==g||e[14]!==s.id?(V=()=>g(s.id),e[13]=g,e[14]=s.id,e[15]=V):V=e[15];let G;e[16]!==s.title||e[17]!==V?(G=o.jsx("button",{type:"button",onClick:V,className:"absolute inset-0 z-0","aria-label":s.title}),e[16]=s.title,e[17]=V,e[18]=G):G=e[18];let K;e[19]!==s.icon||e[20]!==s.title?(K=o.jsx(He,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[19]=s.icon,e[20]=s.title,e[21]=K):K=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(de,{asChild:!0,children:o.jsx(re,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[22]=k):k=e[22];let N;e[23]!==g||e[24]!==s.id?(N=()=>g(s.id,{panel:"settings"}),e[23]=g,e[24]=s.id,e[25]=N):N=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx(qe,{size:16}),e[26]=O):O=e[26];let H;e[27]!==N?(H=o.jsxs(ee,{onClick:N,children:[O,"Settings"]}),e[27]=N,e[28]=H):H=e[28];let y;e[29]!==M||e[30]!==c||e[31]!==r||e[32]!==C?(y=M&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),C()},children:[o.jsx(fe,{size:16}),r(c?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[29]=M,e[30]=c,e[31]=r,e[32]=C,e[33]=y):y=e[33];let i;e[34]!==m||e[35]!==l||e[36]!==r||e[37]!==v?(i=m&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),v()},children:[o.jsx(Ve,{size:16}),r(l?"home.projectCard.unpinFromSidebar":"home.projectCard.pinToSidebar")]}),e[34]=m,e[35]=l,e[36]=r,e[37]=v,e[38]=i):i=e[38];let u;e[39]!==a?(u=a&&o.jsxs(ee,{variant:"destructive",onClick:E=>{E.stopPropagation(),a(E)},children:[o.jsx(Qe,{size:16}),"Delete"]}),e[39]=a,e[40]=u):u=e[40];let p;e[41]!==H||e[42]!==y||e[43]!==i||e[44]!==u?(p=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(ue,{children:[k,o.jsxs(ye,{align:"end",children:[H,y,i,u]})]})}),e[41]=H,e[42]=y,e[43]=i,e[44]=u,e[45]=p):p=e[45];let j;e[46]!==p||e[47]!==K?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[K,p]}),e[46]=p,e[47]=K,e[48]=j):j=e[48];let S;e[49]!==s.title?(S=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[49]=s.title,e[50]=S):S=e[50];let A;e[51]!==c||e[52]!==r?(A=c&&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}),r("home.projectCard.mainAgentBadge")]}),e[51]=c,e[52]=r,e[53]=A):A=e[53];let I;e[54]!==S||e[55]!==A?(I=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,A]}),e[54]=S,e[55]=A,e[56]=I):I=e[56];const U=s.description||"No description";let z;e[57]!==U?(z=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:U}),e[57]=U,e[58]=z):z=e[58];let b;e[59]!==I||e[60]!==z?(b=o.jsxs("div",{className:"flex flex-col gap-1",children:[I,z]}),e[59]=I,e[60]=z,e[61]=b):b=e[61];let L;e[62]!==j||e[63]!==b?(L=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,b]}),e[62]=j,e[63]=b,e[64]=L):L=e[64];let T;e[65]!==n||e[66]!==h||e[67]!==s.updated_at||e[68]!==r?(T=n?r("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:h})}):r("home.projectCard.updated",{time:he(new Date(s.updated_at),{addSuffix:!0,locale:h})}),e[65]=n,e[66]=h,e[67]=s.updated_at,e[68]=r,e[69]=T):T=e[69];let B;e[70]!==T?(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:T})})}),e[70]=T,e[71]=B):B=e[71];let P;e[72]!==L||e[73]!==B?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[L,B]}),e[72]=L,e[73]=B,e[74]=P):P=e[74];let q;return e[75]!==P||e[76]!==G?(q=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[G,P]}),e[75]=P,e[76]=G,e[77]=q):q=e[77],q}const vt="deco-sites";function Nt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,n=e.repo;return typeof s!="string"||typeof n!="string"||s.length===0||n.length===0?null:{owner:s,repo:n}}function At(t,e){const s=e?Nt(e):null,n=s?.owner??vt,a=s?.repo??t;return{owner:n,name:a,url:`https://github.com/${n}/${a}`}}function It(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const n=await fetch(t,e),a=await n.json().catch(()=>({}));if(!n.ok)throw new Error(a.error??`${s} (${n.status})`);return a}function Lt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Tt({open:t,onOpenChange:e,onBack:s}){const n=me(),{org:a}=we(),g=ve(),r=Ee(),{data:R}=Fe.useSession(),[h,$]=Z.useState(null),[d,M]=Z.useState(null),[c,D]=Z.useState(""),x=xe({connectionId:ot,orgId:a.id,orgSlug:a.slug}),_=tt({slug:"mcp-github"}),m=it(_),l=ze({enabled:t&&m.length===0}),f=m.length===1?m[0]??null:d,v=m.length>1&&!f,w=xe({connectionId:f?.id??"",orgId:a.id,orgSlug:a.slug}),C=t&&m.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:V,isLoading:G,error:K}=ke({queryKey:ge.decoSites(R?.user?.email),queryFn:()=>Lt(a.slug),enabled:t&&!!R?.user?.email,staleTime:6e4,retry:!1}),k=V?.sites??[],N=i=>{i||($(null),M(null),D("")),e(i)},O=k.filter(i=>i.name.toLowerCase().includes(c.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(c.toLowerCase())??!1)),H=!h||O.some(i=>i.name===h),y=Pe({mutationFn:async i=>{if(!f)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));Y("deco_site_import_started",{site_name:i});const{installations:u}=await nt(b=>x.callTool(b),f.id),p=k.find(b=>b.name===i);if(!p)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const j=At(i,p.metadata),S=rt(u,j.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:j.owner,installUrl:lt}));let A=null,I=null,U=null;const z=async()=>{U&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),I&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),A&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const b=await Ne(`/api/${a.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},n("common.importFromDecoDialog.failedToCreateConnection")),L=b.connId;if(!L)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=L;const{childConnectionId:T,reused:B}=await at({orgSlug:a.slug,sourceConnection:f,installationId:S.installationId,owner:j.owner,repo:j.name,githubCallTool:J=>w.callTool(J),selfCallTool:J=>x.callTool(J)});I=B?null:T;const P=b.icon??null,q=It(i),E=i.toLowerCase(),W=st(je(p.domains)),X=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:P??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:E,previewServerUrl:W,productionUrl:W,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:S.installationId,connectionId:T},ui:{banner:null,bannerColor:"#22C55E",icon:P,themeColor:"#22C55E",slug:q,pinnedViews:[{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:L},{connection_id:T}]}}}),Q=X.structuredContent??X;if(!Q.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return U=Q.item.id,{slug:q,virtualMcpId:Q.item.id,connId:L,item:Q.item}}catch(b){throw await z(),b}},onSuccess:({slug:i,virtualMcpId:u,item:p})=>{Y("deco_site_import_succeeded",{site_name:p.title,virtual_mcp_id:u,slug:i}),r.setQueryData(ge.collectionItem(x,a.id,"","VIRTUAL_MCP",u),{item:p}),r.invalidateQueries({predicate:j=>{const S=j.queryKey;return S[1]===a.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:i})),N(!1),localStorage.setItem(Me.sidebarOpen(),JSON.stringify(!1)),g(u)},onError:i=>{Y("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ct,{open:t,onOpenChange:N,children:o.jsxs(mt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(dt,{className:"sr-only",children:o.jsx(ut,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(gt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ft,{value:c,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.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(re,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),C&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),v&&!C&&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")})}),m.map(i=>o.jsxs("button",{type:"button",onClick:()=>M(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),G&&!C&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!G&&!C&&!v&&l.status!=="error"&&!K&&k.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!G&&!C&&!v&&l.status!=="error"&&k.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:[O.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:c})}),O.map(i=>{const u=je(i.domains),p=h===i.name;return o.jsxs("button",{type:"button",onClick:()=>$(i.name),className:Ge("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",p?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),u&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:u})]})]},i.name)})]})]}),o.jsxs(pt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(re,{variant:"outline",onClick:()=>N(!1),disabled:y.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(re,{disabled:!h||!H||y.isPending||G||C||v||!f||l.status==="error",onClick:()=>h&&y.mutate(h),children:y.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function as(){const t=pe.c(77),e=me(),{org:s}=we(),n=Ue(),a=_e(),[g,r]=Z.useState("");let R;t[0]===Symbol.for("react.memo_cache_sentinel")?(R={navigateOnCreate:!0},t[0]=R):R=t[0];const{createVirtualMCP:h,isCreating:$}=et(R),[d,M]=Z.useState(null),[c,D]=Z.useState(!1),[x,_]=Z.useState(!1),{granted:m}=De("agents:manage"),l=g.toLowerCase(),f=n.filter(F=>F.id!==s.id&&(F.title.toLowerCase().includes(l)||F.description?.toLowerCase().includes(l))),{data:v}=Re(f.map(Et));let w;t[1]!==a||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:F,title:Ae}=d;M(null);try{await a.delete.mutateAsync(F),Y("agent_deleted",{agent_id:F,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ae}))}catch{}},t[1]=a,t[2]=d,t[3]=e,t[4]=w):w=t[4];const C=w,V=ce,G=ce,K=ce;let k;t[5]!==e?(k=e("routes.agentsList.title"),t[5]=e,t[6]=k):k=t[6];let N;t[7]!==k?(N=o.jsx(ce.Title,{children:k}),t[7]=k,t[8]=N):N=t[8];let O;t[9]!==e?(O=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=O):O=t[10];let H;t[11]===Symbol.for("react.memo_cache_sentinel")?(H=F=>{F.key==="Escape"&&(r(""),F.target.blur())},t[11]=H):H=t[11];let y;t[12]!==g||t[13]!==O?(y=o.jsx(St,{value:g,onChange:r,placeholder:O,className:"w-full md:w-[375px]",onKeyDown:H}),t[12]=g,t[13]=O,t[14]=y):y=t[14];let i;t[15]!==m||t[16]!==h||t[17]!==$||t[18]!==e?(i=m&&o.jsxs(ue,{children:[o.jsx(de,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:$,align:"end"})]}),t[15]=m,t[16]=h,t[17]=$,t[18]=e,t[19]=i):i=t[19];let u;t[20]!==y||t[21]!==i?(u=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y,i]}),t[20]=y,t[21]=i,t[22]=u):u=t[22];let p;t[23]!==u||t[24]!==N?(p=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,u]}),t[23]=u,t[24]=N,t[25]=p):p=t[25];const j=f.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ze,{image:o.jsx(Ke,{size:48,className:"text-muted-foreground"}),title:e(g?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:g?e("routes.agentsList.noAgentsMatchSearch",{search:g}):e(m?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!g&&m&&o.jsxs(ue,{children:[o.jsx(de,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:$,align:"center",showBetaBadge:!0})]})})}),S=f.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:f.map(F=>o.jsx(_t,{project:F,lastUsedAt:v?.get(F.id)?.last_used_at,onDeleteClick:m?()=>M({id:F.id,title:F.title}):void 0},F.id))})]});let A;t[26]!==p||t[27]!==j||t[28]!==S||t[29]!==K.Body?(A=o.jsxs(K.Body,{children:[p,j,S]}),t[26]=p,t[27]=j,t[28]=S,t[29]=K.Body,t[30]=A):A=t[30];let I;t[31]!==A||t[32]!==G.Content?(I=o.jsx(G.Content,{children:A}),t[31]=A,t[32]=G.Content,t[33]=I):I=t[33];let U;t[34]!==x?(U=o.jsx(Be,{open:x,onOpenChange:_}),t[34]=x,t[35]=U):U=t[35];let z;t[36]!==c?(z=o.jsx(Tt,{open:c,onOpenChange:D}),t[36]=c,t[37]=z):z=t[37];const b=!!d;let L;t[38]===Symbol.for("react.memo_cache_sentinel")?(L=F=>!F&&M(null),t[38]=L):L=t[38];let T;t[39]!==e?(T=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=T):T=t[40];let B;t[41]!==T?(B=o.jsx(ht,{children:T}),t[41]=T,t[42]=B):B=t[42];let P;t[43]!==e?(P=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=P):P=t[44];const q=d?.title;let E;t[45]!==q?(E=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[45]=q,t[46]=E):E=t[46];let W;t[47]!==P||t[48]!==E?(W=o.jsxs(xt,{children:[P," ",E,"."]}),t[47]=P,t[48]=E,t[49]=W):W=t[49];let X;t[50]!==B||t[51]!==W?(X=o.jsxs(jt,{children:[B,W]}),t[50]=B,t[51]=W,t[52]=X):X=t[52];let Q;t[53]!==e?(Q=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=Q):Q=t[54];let J;t[55]!==Q?(J=o.jsx(Ct,{children:Q}),t[55]=Q,t[56]=J):J=t[56];let te;t[57]!==e?(te=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=te):te=t[58];let oe;t[59]!==C||t[60]!==te?(oe=o.jsx(bt,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:te}),t[59]=C,t[60]=te,t[61]=oe):oe=t[61];let se;t[62]!==J||t[63]!==oe?(se=o.jsxs(Dt,{children:[J,oe]}),t[62]=J,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==X||t[66]!==se?(ie=o.jsxs(wt,{children:[X,se]}),t[65]=X,t[66]=se,t[67]=ie):ie=t[67];let ne;t[68]!==b||t[69]!==ie?(ne=o.jsx(yt,{open:b,onOpenChange:L,children:ie}),t[68]=b,t[69]=ie,t[70]=ne):ne=t[70];let ae;return t[71]!==V||t[72]!==I||t[73]!==U||t[74]!==z||t[75]!==ne?(ae=o.jsxs(V,{children:[I,U,z,ne]}),t[71]=V,t[72]=I,t[73]=U,t[74]=z,t[75]=ne,t[76]=ae):ae=t[76],ae}function Et(t){return t.id}export{as as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as G,b as se,ax as Qe,aw as Ye,r as Q,j as s,ay as gt,dw as Te,t as ee,dv as be,du as Ee,bb as We,dC as Ze,dD as xt,n as Pe,c6 as ht,H as ye,ac as le,K as J,o as De,B as X,k as $e,Y as Ie,p as Se,e as re,x as Xe,q as Fe,ak as vt,an as we,dy as bt}from"./index-DHLutK6v.js";import{i as yt}from"./AlertCircle-qZDg2e-H.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-WmO5B1wa.js";import{i as _t}from"./CheckCircle-V0GvWvtd.js";import{b as Pt,j as It}from"./use-organization-settings-BsgcrCz-.js";import{c as kt}from"./task-board-D9PHUZff.js";import{c as Dt,u as Ue,d as tt,P as Kt,C as Be}from"./select-model-CVJuTB71.js";import{u as wt}from"./use-debounced-autosave-DsCulVkO.js";import{i as ze}from"./CreditCard01-Cy0s6gAf.js";import{B as Ae}from"./badge-CXIV4O-0.js";import{I as je}from"./input-zNG5Uz1T.js";import{a as He,T as At}from"./toggle-group-WZyFFujP.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-BWONJIzw.js";import{s as Tt}from"./Plus-B7vTVmKH.js";import{p as Et,f as Rt}from"./pt-BR-CLy76QW2.js";import{b as Mt}from"./Tool01-tn2PFBHQ.js";import{s as Ot}from"./Trash01-CwqV1gzD.js";import{A as $t}from"./avatar-1XE5IjoT.js";import{P as Ft}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ut}from"./Settings02-xEBQxvJD.js";import{s as Bt}from"./Eye-m8QZKf2Y.js";import{b as zt,a as Ht,d as qt,e as Lt,c as Vt}from"./dialog-DYg0AoO0.js";import{S as Gt}from"./spinner-DEaGcbnH.js";import{R as Qt}from"./require-capability-BJjD7GXa.js";import"./constants-dLUUoWH7.js";import"./drawer-DrqU_8fl.js";import"./chat-context-C-BdNZCf.js";import"./use-panel-navigate-C8-xot4V.js";import"./Check-C5RWnyNL.js";import"./Copy01-DhfruII6.js";import"./Download01-C1FmC7JV.js";import"./use-destination-route-BMJNYrmL.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-DvV-YCly.js";import"./use-mcp-client-Bac4vccq.js";import"./auth-BqxUQw-v.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DDszDk42.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-X7MaI4-V.js";import"./use-decopilot-events-CEhAvB_E.js";import"./checkbox-DvC3nAT5.js";import"./select-W8jorDji.js";import"./ChevronDown-CeGZsBnS.js";import"./ChevronUp-DCx43qHY.js";import"./ArrowLeft-CatEVOI7.js";import"./ChevronSelectorVertical-Im3Lz_4E.js";import"./Key01-DbCU9LZF.js";import"./SearchMd-COQJLRw-.js";import"./Monitor01-DPqlemzQ.js";import"./ChevronRight-Dh8_6pj1.js";import"./Stars01-DkoqcM4j.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-DWaPmCwS.js";import"./access-gate-DXIgG9H-.js";import"./capability-load-error-BKGEHfpt.js";const Yt=e=>e.capabilities?.includes("image")===!0,Wt=e=>jt(e),Zt=e=>St(e),Xt=[{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:Zt}];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(kt),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:_}=It(),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,Z=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&&Z)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=Xt.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(Ze.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(Ze.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,ax as Qe,aw as Ye,r as Q,j as s,ay as gt,dw as Te,t as ee,dv as be,du as Ee,bb as We,dC as Ze,dD as xt,n as Pe,c6 as ht,H as ye,ac as le,K as J,o as De,B as X,k as $e,Y as Ie,p as Se,e as re,x as Xe,q as Fe,ak as vt,an as we,dy as bt}from"./index-BWXyDl1J.js";import{i as yt}from"./AlertCircle-DLj-rBLn.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-DZwpIJ4W.js";import{i as _t}from"./CheckCircle-DOOBCpT9.js";import{b as Pt,j as It}from"./use-organization-settings-CGbImq1L.js";import{c as kt}from"./task-board-DmX2VpFs.js";import{c as Dt,u as Ue,d as tt,P as Kt,C as Be}from"./select-model-DQ1JGbZ1.js";import{u as wt}from"./use-debounced-autosave-C706dtM7.js";import{i as ze}from"./CreditCard01-CKM-Jz3x.js";import{B as Ae}from"./badge-BCfyeFAT.js";import{I as je}from"./input-BmuxVBRq.js";import{a as He,T as At}from"./toggle-group-hvwloSYQ.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-CDXDBEVz.js";import{s as Tt}from"./Plus-C20besyI.js";import{p as Et,f as Rt}from"./pt-BR-CLy76QW2.js";import{b as Mt}from"./Tool01-C-r-Zf-I.js";import{s as Ot}from"./Trash01-BaF7-rQA.js";import{A as $t}from"./avatar-DKKheiwZ.js";import{P as Ft}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ut}from"./Settings02-DVdySYD4.js";import{s as Bt}from"./Eye-Bf1344cz.js";import{b as zt,a as Ht,d as qt,e as Lt,c as Vt}from"./dialog-D4htx8Dz.js";import{S as Gt}from"./spinner-BNsOVOLB.js";import{R as Qt}from"./require-capability-DYqEh_0t.js";import"./constants-dLUUoWH7.js";import"./drawer-CuMUVmYp.js";import"./chat-context-DQqAI1Uh.js";import"./use-panel-navigate-CzBWJmh4.js";import"./Check-CTKt7DPp.js";import"./Copy01-C-9zesbF.js";import"./Download01-DYsmBrAR.js";import"./use-destination-route-C8wZaTLq.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-rNJx2Yiz.js";import"./use-mcp-client-DHZ5WVmn.js";import"./auth-CMC5pcXA.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CvmARxhG.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-zkag_-cI.js";import"./use-decopilot-events-DFaxDB0Z.js";import"./checkbox-BdDEdRtX.js";import"./select-OkaoLf52.js";import"./ChevronDown-DCBuHd0m.js";import"./ChevronUp-D6fZUTvM.js";import"./ArrowLeft-Bz-VyTFg.js";import"./ChevronSelectorVertical-Iu37Jtvz.js";import"./Key01-C71Bncy8.js";import"./SearchMd-DbgBw9S_.js";import"./Monitor01-Db3wK3MU.js";import"./ChevronRight-CO9K42kJ.js";import"./Stars01-BLlf5jfX.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-BmKTu46m.js";import"./access-gate-DXpndi2J.js";import"./capability-load-error-Bu5AJKz_.js";const Yt=e=>e.capabilities?.includes("image")===!0,Wt=e=>jt(e),Zt=e=>St(e),Xt=[{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:Zt}];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(kt),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:_}=It(),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,Z=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&&Z)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=Xt.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(Ze.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(Ze.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,bJ as d}from"./index-
|
|
1
|
+
import{c as n,n as o,j as c,bJ as d}from"./index-BWXyDl1J.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,e5 as w,e6 as T,bv as m,ea as A,f8 as O,J as M,bx as I,e4 as z,f9 as v,e7 as F,fa as L,bt as G,e9 as k,e8 as B,c as n,n as p,bB as D}from"./index-
|
|
1
|
+
import{r as i,j as r,e5 as w,e6 as T,bv as m,ea as A,f8 as O,J as M,bx as I,e4 as z,f9 as v,e7 as F,fa as L,bt as G,e9 as k,e8 as B,c as n,n as p,bB as D}from"./index-BWXyDl1J.js";var x="AlertDialog",[H]=G(x,[v]),d=v(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...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(k,{...o,...a,ref:e})});W.displayName=V;var Y="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=Y;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(B,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[J,K]=H(f),Q=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,j as t,dy as se,b as F,r as L,B as N,t as R}from"./index-DHLutK6v.js";import{i as ie}from"./AlertCircle-qZDg2e-H.js";import{a as le}from"./Copy01-DhfruII6.js";import{i as J}from"./Key01-DbCU9LZF.js";import{s as M}from"./Plus-B7vTVmKH.js";import{s as ne}from"./Trash01-CwqV1gzD.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-BWONJIzw.js";import{b as Q,h as U,a as V,c as W,d as X,e as Y}from"./dialog-DYg0AoO0.js";import{I as Z}from"./input-zNG5Uz1T.js";import{L as ue}from"./label-CEq9oqa2.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-CHuWewKt.js";import{R as he}from"./require-capability-BJjD7GXa.js";import"./use-mcp-client-Bac4vccq.js";import"./constants-dLUUoWH7.js";import"./auth-BqxUQw-v.js";import"./access-gate-DXIgG9H-.js";import"./capability-load-error-BKGEHfpt.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,dy as se,b as F,r as L,B as N,t as R}from"./index-BWXyDl1J.js";import{i as ie}from"./AlertCircle-DLj-rBLn.js";import{a as le}from"./Copy01-C-9zesbF.js";import{i as J}from"./Key01-C71Bncy8.js";import{s as M}from"./Plus-C20besyI.js";import{s as ne}from"./Trash01-BaF7-rQA.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-CDXDBEVz.js";import{b as Q,h as U,a as V,c as W,d as X,e as Y}from"./dialog-D4htx8Dz.js";import{I as Z}from"./input-BmuxVBRq.js";import{L as ue}from"./label-CpzYUQhx.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-D39Ow3Yy.js";import{R as he}from"./require-capability-DYqEh_0t.js";import"./use-mcp-client-DHZ5WVmn.js";import"./constants-dLUUoWH7.js";import"./auth-CMC5pcXA.js";import"./access-gate-DXpndi2J.js";import"./capability-load-error-Bu5AJKz_.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-DHLutK6v.js";import{b as At}from"./chat-context-C-BdNZCf.js";import{i as Et}from"./ChevronRight-Dh8_6pj1.js";import{S as Nt}from"./scroll-area-Dw0578rC.js";import{u as Rt,A as Ct}from"./use-section-preview-base-CFAiIdAN.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-BWVLjCpL.js";import"./use-panel-navigate-C8-xot4V.js";import"./dialog-DYg0AoO0.js";import"./Check-C5RWnyNL.js";import"./Copy01-DhfruII6.js";import"./Download01-C1FmC7JV.js";import"./use-destination-route-BMJNYrmL.js";import"./constants-dLUUoWH7.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-DvV-YCly.js";import"./use-mcp-client-Bac4vccq.js";import"./auth-BqxUQw-v.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-DDszDk42.js";import"./task-board-D9PHUZff.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-X7MaI4-V.js";import"./use-ai-providers-WmO5B1wa.js";import"./use-decopilot-events-CEhAvB_E.js";import"./use-organization-settings-BsgcrCz-.js";import"./select-W8jorDji.js";import"./ChevronDown-CeGZsBnS.js";import"./ChevronUp-DCx43qHY.js";import"./agent-icon-C9_7Msf7.js";import"./AlertCircle-qZDg2e-H.js";import"./UserSquare-ClSByuB-.js";import"./Tool01-tn2PFBHQ.js";import"./ArrowUp-DMDdMhAA.js";import"./ArrowLeft-CatEVOI7.js";import"./Tool02-BalBR7uK.js";import"./XCircle-BOrCVYLf.js";import"./TrendUp01-6TR_k_0Y.js";import"./ZapSquare-DkKtoQ7W.js";import"./Users03-BT3gPqQL.js";import"./CheckCircle-V0GvWvtd.js";import"./ChevronSelectorVertical-Im3Lz_4E.js";import"./DotsVertical-B39kxqbi.js";import"./Stars02-4GZ9SjIq.js";import"./CreditCard01-Cy0s6gAf.js";import"./Settings02-xEBQxvJD.js";import"./Eye-m8QZKf2Y.js";import"./FilterLines-BBF-m2ZJ.js";import"./Share07-CLkT7SlV.js";import"./Globe01-C2F_PPuX.js";import"./Globe04-CMCnFTSr.js";import"./SwitchHorizontal01-DwxljZOI.js";import"./HardDrive-DmqNZKD8.js";import"./Key01-DbCU9LZF.js";import"./LinkExternal01-kQnRXU4w.js";import"./LockUnlocked01-D5OpQeQe.js";import"./LogOut01-BePTyd5L.js";import"./Monitor01-DPqlemzQ.js";import"./Sun-D0KW7MLF.js";import"./Palette-DzT0S9Gl.js";import"./Play-Btu3v5FX.js";import"./Plus-B7vTVmKH.js";import"./SearchLg-CAAIuTYj.js";import"./SearchMd-COQJLRw-.js";import"./Shield01-C2USnj9G.js";import"./Stars01-DkoqcM4j.js";import"./Trash01-CwqV1gzD.js";import"./Upload01-mqAHBbZV.js";import"./User01-DWaPmCwS.js";import"./Users01-CFDNbxgJ.js";import"./XClose-DMSeuF30.js";import"./Zap-CwYGo5D6.js";import"./input-zNG5Uz1T.js";import"./automation-runs-CzcGADVN.js";import"./useInfiniteQuery-CP11XfQS.js";import"./use-infinite-scroll-DzHJHyr0.js";import"./use-connection-D8j2CnOC.js";import"./table-RKi74_kY.js";import"./empty-state-DNKOHljA.js";import"./use-members-_2HCzEHc.js";import"./use-org-auth-client-Cb5lYh1t.js";import"./use-automations-g--nS4Go.js";import"./useSuspenseInfiniteQuery-vPet_vok.js";import"./avatar-1XE5IjoT.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-lK-vhEre.js";import"./monaco-editor-BIUU4YtT.js";import"./spinner-DEaGcbnH.js";import"./types-CrdXjhQP.js";import"./shell-layout-BbKgiGKQ.js";import"./required-auth-layout-Bi3hMcfQ.js";import"./use-org-sso-cefqXe6X.js";import"./integration-icon-CVsQlE88.js";import"./use-navigate-to-agent-yAkGdje4.js";import"./chart-Bgue_7DQ.js";import"./index-pYJ2-T-r.js";import"./form-DUYaeuN1.js";import"./label-CEq9oqa2.js";import"./file-type-icon-Cr_jiDFe.js";import"./drawer-DrqU_8fl.js";import"./collection-search-DBnGb4Zg.js";import"./tabs-DFRRVuh7.js";import"./toggle-group-WZyFFujP.js";import"./super-agent-icon-DxowWKwv.js";import"./self-tool-result-DYCZ2dxI.js";import"./alert-dialog-BWONJIzw.js";import"./extract-connection-data-BI_gbc3h.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-D5wCJf5h.js";import"./authenticate-and-persist-oauth-DRVU48ic.js";import"./mcp-oauth-DGSZYZtZ.js";import"./track-BFh4WctH.js";import"./popover-CPDUuAsK.js";import"./toolbar-CmaLqa3-.js";import"./github-repo-picker-BjTlfZRh.js";import"./use-mcp-tools-FenH0JaE.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-CgUgSGsh.js";import"./use-registry-connections-BoC6e9Ko.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-XbuS70jj.js";import"./connection-form-helpers-gU6TF210.js";import"./collection-tabs-CAUEdmSI.js";import"./badge-CXIV4O-0.js";import"./select-model-CVJuTB71.js";import"./checkbox-DvC3nAT5.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DJSm_nho.js";import"./dropdown-menu-BGreHXNg.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CdtGOM4G.js";import"./use-file-configs-CEny8PB8.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-DsCulVkO.js";import"./search-input-lOvS7ZZY.js";import"./use-mcp-auth-status-dyqIaOq0.js";import"./switch-BsAR0Ue8.js";import"./use-secrets-CNOFekf-.js";import"./AreaChart-D1rWRcUm.js";import"./config-DG69PD1X.js";import"./breadcrumb-FUX_wv57.js";import"./command-Ct_4mokr.js";import"./index-RXRS2M8q.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-CnmdA4eJ.js";import"./automation-list-row-BMiRTeOK.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-DbzFw6wJ.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 Pr(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{Pr 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-BWXyDl1J.js";import{b as At}from"./chat-context-DQqAI1Uh.js";import{i as Et}from"./ChevronRight-CO9K42kJ.js";import{S as Nt}from"./scroll-area-BsxuvxbS.js";import{u as Rt,A as Ct}from"./use-section-preview-base-CQ_HgNgO.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-eyTxS6Bz.js";import"./use-panel-navigate-CzBWJmh4.js";import"./dialog-D4htx8Dz.js";import"./Check-CTKt7DPp.js";import"./Copy01-C-9zesbF.js";import"./Download01-DYsmBrAR.js";import"./use-destination-route-C8wZaTLq.js";import"./constants-dLUUoWH7.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-rNJx2Yiz.js";import"./use-mcp-client-DHZ5WVmn.js";import"./auth-CMC5pcXA.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CvmARxhG.js";import"./task-board-DmX2VpFs.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-zkag_-cI.js";import"./use-ai-providers-DZwpIJ4W.js";import"./use-decopilot-events-DFaxDB0Z.js";import"./use-organization-settings-CGbImq1L.js";import"./select-OkaoLf52.js";import"./ChevronDown-DCBuHd0m.js";import"./ChevronUp-D6fZUTvM.js";import"./agent-icon-LbhnjHwi.js";import"./AlertCircle-DLj-rBLn.js";import"./UserSquare-D5oHibl1.js";import"./Tool01-C-r-Zf-I.js";import"./ArrowUp-C9wijSHC.js";import"./ArrowLeft-Bz-VyTFg.js";import"./Tool02-CQfhYBA-.js";import"./XCircle-BLGxEUt7.js";import"./TrendUp01-DrIbuukS.js";import"./ZapSquare-B03SIXBG.js";import"./Users03-BvmFpFso.js";import"./CheckCircle-DOOBCpT9.js";import"./ChevronSelectorVertical-Iu37Jtvz.js";import"./DotsVertical-CSkWlHZt.js";import"./Stars02-DSl09LS3.js";import"./CreditCard01-CKM-Jz3x.js";import"./Settings02-DVdySYD4.js";import"./Eye-Bf1344cz.js";import"./FilterLines-D4VZo9JH.js";import"./Share07-TLJEQyW1.js";import"./Globe01-Mlkbzavy.js";import"./Globe04-CcZwBZDM.js";import"./SwitchHorizontal01-DxrMcxk-.js";import"./HardDrive-rv6yXW9l.js";import"./Key01-C71Bncy8.js";import"./LinkExternal01-Bd5qXJx-.js";import"./LockUnlocked01-xUxyOLI6.js";import"./LogOut01-CFPuWi87.js";import"./Monitor01-Db3wK3MU.js";import"./Sun-D8Cz2KrR.js";import"./Palette-Wf7ieWzf.js";import"./Play-CTzOPD4i.js";import"./Plus-C20besyI.js";import"./SearchLg-BoAF9n4o.js";import"./SearchMd-DbgBw9S_.js";import"./Shield01-CVEumGx3.js";import"./Stars01-BLlf5jfX.js";import"./Trash01-BaF7-rQA.js";import"./Upload01-Eo8Y8gwt.js";import"./User01-BmKTu46m.js";import"./Users01-DdYj89q4.js";import"./XClose-KYQfxNAH.js";import"./Zap-DSuzhrFd.js";import"./input-BmuxVBRq.js";import"./automation-runs-DwCd_zFP.js";import"./useInfiniteQuery-CHJpyz-t.js";import"./use-infinite-scroll-BUgjJwY5.js";import"./use-connection-tOCjDBfx.js";import"./table-DSRHVWxU.js";import"./empty-state-DANnu2Dm.js";import"./use-members-CAd4YLUd.js";import"./use-org-auth-client-DPBNI0km.js";import"./use-automations-D--Rxx-_.js";import"./useSuspenseInfiniteQuery-uqFTRGN7.js";import"./avatar-DKKheiwZ.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ICpw0Yw-.js";import"./monaco-editor-CMqzV6OC.js";import"./spinner-BNsOVOLB.js";import"./types-D8IG_8eU.js";import"./shell-layout-H_tjyvHd.js";import"./required-auth-layout-DPe5oune.js";import"./use-org-sso-Y-cX0M9u.js";import"./integration-icon-BIrESC5L.js";import"./use-navigate-to-agent-BWgdcI3Z.js";import"./chart-D1jgldPO.js";import"./index-BXn0NwIo.js";import"./form-DxT0qd-2.js";import"./label-CpzYUQhx.js";import"./file-type-icon-BenR9kqm.js";import"./drawer-CuMUVmYp.js";import"./collection-search-swq3mYpH.js";import"./tabs-CkF_fW0Q.js";import"./toggle-group-hvwloSYQ.js";import"./super-agent-icon-uUxotzmO.js";import"./self-tool-result-_Gq4fS8Q.js";import"./alert-dialog-CDXDBEVz.js";import"./extract-connection-data-BIGQQYkp.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DBMZQqKo.js";import"./authenticate-and-persist-oauth-B1awg6G_.js";import"./mcp-oauth-fsNn1czb.js";import"./track-CwWn2JFQ.js";import"./popover-3-nXGxsG.js";import"./toolbar-D9gkmlH9.js";import"./github-repo-picker-DuwsdpzE.js";import"./use-mcp-tools-C69l20dV.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-BllYSe_U.js";import"./use-registry-connections--wEDOuCo.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DzCWtryj.js";import"./connection-form-helpers-C6PcVFY-.js";import"./collection-tabs-B31Xr--3.js";import"./badge-BCfyeFAT.js";import"./select-model-DQ1JGbZ1.js";import"./checkbox-BdDEdRtX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-AP5XpAV6.js";import"./dropdown-menu-BE_ym3Aq.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BcDDyChz.js";import"./use-file-configs-rXyGhpyn.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-C706dtM7.js";import"./search-input-i6XUS8wH.js";import"./use-mcp-auth-status-CyITsP1y.js";import"./switch-jAw5NRFm.js";import"./use-secrets-BUOK8Q3X.js";import"./AreaChart-9FGrcqfj.js";import"./config-CbfHHHdK.js";import"./breadcrumb-DwyVLr-T.js";import"./command-CtzJnf3P.js";import"./index-CdvEA4gL.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-DQhkcWVg.js";import"./automation-list-row-DSW4dqyo.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-Df_iQEGc.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 Pr(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{Pr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dO as $,dP as v,dQ as W,dR as T,dS as H,dT as V,dU as D,dV as x,dW as q,dX as j,dY as y,dZ as N,d_ as B,d$ as Z,e0 as F}from"./index-DHLutK6v.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 Q(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 X(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":K(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 K(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 L(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 V)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 M(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 k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}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 S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.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:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),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 M(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 $.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??T;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=T}={}){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"?v.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(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=Q(r,h);X(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await L(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await L(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,M as d,Ue as e};
|
|
1
|
+
import{dO as $,dP as v,dQ as W,dR as T,dS as H,dT as V,dU as D,dV as x,dW as q,dX as j,dY as y,dZ as N,d_ as B,d$ as Z,e0 as F}from"./index-BWXyDl1J.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 Q(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 X(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":K(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 K(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 L(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 V)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 M(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 k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}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 S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.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:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),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 M(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 $.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??T;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=T}={}){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"?v.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(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=Q(r,h);X(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await L(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await L(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,M 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-BWXyDl1J.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-DHLutK6v.js";import{I as ee}from"./input-zNG5Uz1T.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-DEaGcbnH.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-BWXyDl1J.js";import{I as ee}from"./input-BmuxVBRq.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-BNsOVOLB.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-BWXyDl1J.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-BWXyDl1J.js";import{i as u,a as p}from"./mcp-oauth-fsNn1czb.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};
|