decocms 4.348.0 → 4.350.1
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-U9pv2NJQ.js → AlertCircle-BMk6q2FA.js} +1 -1
- package/dist/client/assets/{AreaChart-CC-EQfkr.js → AreaChart-BLsqA7uB.js} +1 -1
- package/dist/client/assets/{ArrowLeft-FEKnVEE6.js → ArrowLeft-CBdaifdY.js} +1 -1
- package/dist/client/assets/{ArrowRight-YeNm0TCu.js → ArrowRight-k7OlY3ZV.js} +1 -1
- package/dist/client/assets/{ArrowUp-zrcAFzEu.js → ArrowUp-BrUqWSUA.js} +1 -1
- package/dist/client/assets/{Check-H7Mmr0MJ.js → Check-BRo4TcYL.js} +1 -1
- package/dist/client/assets/{CheckCircle-DA8ScrFC.js → CheckCircle-ByifJ5DN.js} +1 -1
- package/dist/client/assets/{ChevronRight-DO3RC1pd.js → ChevronRight-CL-1AW54.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical--A8HrUqB.js → ChevronSelectorVertical-D89G1wQX.js} +1 -1
- package/dist/client/assets/{ChevronUp-BP8TOpcT.js → ChevronUp-DRrtPFPU.js} +1 -1
- package/dist/client/assets/{Copy01-C3i-U8ZG.js → Copy01-Cz84dNWo.js} +1 -1
- package/dist/client/assets/{CreditCard01-CNl0cUX6.js → CreditCard01-16ccuHl7.js} +1 -1
- package/dist/client/assets/{DotsVertical-Bt-VkXeN.js → DotsVertical-CUeujFxe.js} +1 -1
- package/dist/client/assets/{Download01-B_WTEIkC.js → Download01-BY5nFlV8.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DXwUT8Pm.js → ErrorBarContext-laRz9pMB.js} +1 -1
- package/dist/client/assets/{Eye-ikYAyCJB.js → Eye-DSfFTZ0l.js} +1 -1
- package/dist/client/assets/{GitBranch01-ClVrLal8.js → GitBranch01-CzoRmimO.js} +1 -1
- package/dist/client/assets/{Globe01-BwbIv0-p.js → Globe01-DhXQEmKy.js} +1 -1
- package/dist/client/assets/{HardDrive-CXyeDYVm.js → HardDrive-Dz1jdiPQ.js} +1 -1
- package/dist/client/assets/{Image01-EEtalrwj.js → Image01-ChEQz8oh.js} +1 -1
- package/dist/client/assets/{Key01-Dfc1sl9E.js → Key01-BOmG8BKE.js} +1 -1
- package/dist/client/assets/{Link01-BjYhVWwh.js → Link01-DkfXBBhQ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D79zgSZj.js → LinkExternal01-CbmJH8Oa.js} +1 -1
- package/dist/client/assets/{Monitor01-CcAhoL31.js → Monitor01-D0BOdaeR.js} +1 -1
- package/dist/client/assets/{Package-1FrUQ_EG.js → Package-BtdRPN0k.js} +1 -1
- package/dist/client/assets/{Palette-BixW1ssS.js → Palette-D3howidE.js} +1 -1
- package/dist/client/assets/{Play-DZ4DLqc8.js → Play-BRZZbBP9.js} +1 -1
- package/dist/client/assets/{Plus-DeGsbqDF.js → Plus-CHPz10Kd.js} +1 -1
- package/dist/client/assets/SearchLg-B8u5Z_-p.js +1 -0
- package/dist/client/assets/{SearchMd-BNuJvIQD.js → SearchMd-BfOW0ihr.js} +1 -1
- package/dist/client/assets/{Sector-oNzpp3He.js → Sector-C7O4njZA.js} +3 -3
- package/dist/client/assets/{Settings02-DrHeXPDm.js → Settings02-5Mu_nYD8.js} +1 -1
- package/dist/client/assets/{Share07-BDAimDHi.js → Share07-B8Aw6CDi.js} +1 -1
- package/dist/client/assets/{Shield01-DnbggGAu.js → Shield01-BCG_3DYj.js} +1 -1
- package/dist/client/assets/{Stars01-DoidW0k0.js → Stars01-foIfuOVN.js} +1 -1
- package/dist/client/assets/{Sun-bCSbt1Ff.js → Sun-BzWxkbN5.js} +1 -1
- package/dist/client/assets/{Tool01-CyDReH3q.js → Tool01-BEvJ_YW1.js} +1 -1
- package/dist/client/assets/{Tool02-CtNw7bNe.js → Tool02-BJ6DrdG_.js} +1 -1
- package/dist/client/assets/{Trash01-DcTV6bg0.js → Trash01-BV_RW_ot.js} +1 -1
- package/dist/client/assets/{TrendUp01-ClNnKXkn.js → TrendUp01-BQU61XVU.js} +1 -1
- package/dist/client/assets/{Upload01-Ct4yKwsS.js → Upload01-CzJgAWQf.js} +1 -1
- package/dist/client/assets/{User01-QYqaP7k3.js → User01-BYo154It.js} +1 -1
- package/dist/client/assets/{UserSquare-B1psP4hc.js → UserSquare-B8muuAeC.js} +1 -1
- package/dist/client/assets/{Users01-CiWVH62V.js → Users01-CCJxFqcF.js} +1 -1
- package/dist/client/assets/{Users03-D6zVISLF.js → Users03-B3GcmkAW.js} +1 -1
- package/dist/client/assets/{XCircle-DyKp194a.js → XCircle-B00jwioD.js} +1 -1
- package/dist/client/assets/{XClose-McE2ySi-.js → XClose-BSY1lYTG.js} +1 -1
- package/dist/client/assets/{Zap-nYGNb9hC.js → Zap-u6tF2K1C.js} +1 -1
- package/dist/client/assets/{ZoomOut-CqfoYky-.js → ZoomOut-GAT73I28.js} +1 -1
- package/dist/client/assets/{access-gate-CH5FSeIV.js → access-gate-BUfTolQd.js} +1 -1
- package/dist/client/assets/agent-icon-CaI0ggpq.js +1 -0
- package/dist/client/assets/agents-list-DLUa5_h5.js +1 -0
- package/dist/client/assets/{ai-providers-BFaxW6kI.js → ai-providers-CpT_7AV2.js} +1 -1
- package/dist/client/assets/{alert-6i_2sx2u.js → alert-BG7MpKMj.js} +1 -1
- package/dist/client/assets/{alert-dialog-BIwJfWwl.js → alert-dialog-BJoAnvTa.js} +2 -2
- package/dist/client/assets/analytics-tab-CVYQKeUX.js +2 -0
- package/dist/client/assets/{api-keys-U9NJedFL.js → api-keys-C1X3ZED1.js} +1 -1
- package/dist/client/assets/api-keys-CgATwrHZ.js +1 -0
- package/dist/client/assets/app-editor-CLUQ5UuG.js +1 -0
- package/dist/client/assets/{auth-BVYw4FRF.js → auth-DrTXT3NH.js} +1 -1
- package/dist/client/assets/{auth-catchall-DG1z4Yrp.js → auth-catchall--kEE8BrW.js} +1 -1
- package/dist/client/assets/{auth-entry-65gjdT0Q.js → auth-entry-Bypdb_OP.js} +1 -1
- package/dist/client/assets/{auth-split-layout--QyhC9AU.js → auth-split-layout-C9p5qokp.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B1Xd_JVd.js → authenticate-and-persist-oauth-BSOO7-Ru.js} +1 -1
- package/dist/client/assets/{automation-list-row-qgJpJ0m6.js → automation-list-row-CUdrE7CI.js} +1 -1
- package/dist/client/assets/{automation-runs-DI-xL2M5.js → automation-runs-staCAMV3.js} +27 -27
- package/dist/client/assets/automations-BblO5Bed.js +1 -0
- package/dist/client/assets/{autosend-CxKrnLl5.js → autosend-BLWBLlQp.js} +1 -1
- package/dist/client/assets/{avatar-C8Mb6TNg.js → avatar-8wWRKAWW.js} +1 -1
- package/dist/client/assets/{badge-DaEVG-87.js → badge-Dc8kcV5t.js} +1 -1
- package/dist/client/assets/{block-document-D8nzQnLu.js → block-document-0d7k0rKQ.js} +1 -1
- package/dist/client/assets/{breadcrumb-DCFVI-vF.js → breadcrumb-DTve-fNU.js} +1 -1
- package/dist/client/assets/{buckets-nyX_HxUQ.js → buckets-Bgjegid2.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BQukMuKz.js → bulk-category-panel-BXxBWLb6.js} +1 -1
- package/dist/client/assets/{capability-load-error-D2g3S_3R.js → capability-load-error-Bt-0_xjM.js} +1 -1
- package/dist/client/assets/{cards-CTM3PZ_9.js → cards-C2rTb-Sr.js} +1 -1
- package/dist/client/assets/category-editor-DTJMv5Az.js +1 -0
- package/dist/client/assets/{cdn-tab-B8_LIanh.js → cdn-tab-DKXQ2vhA.js} +1 -1
- package/dist/client/assets/{chart-DA0R9QFL.js → chart-DmKqaSZG.js} +1 -1
- package/dist/client/assets/{chat-context-BvcjAKGC.js → chat-context-C48t2Pu7.js} +5 -5
- package/dist/client/assets/{checkbox-E8AiLxWP.js → checkbox-CNie4rus.js} +1 -1
- package/dist/client/assets/choose-editor-De8eese3.js +1 -0
- package/dist/client/assets/{cli-auth-success-C1hdea_C.js → cli-auth-success-2KTVF2ia.js} +1 -1
- package/dist/client/assets/{client-icons-BiGI-rVs.js → client-icons-DJ5EKjKX.js} +1 -1
- package/dist/client/assets/collection-detail-CIWvltBQ.js +1 -0
- package/dist/client/assets/{collection-display-button-p1WL8L5A.js → collection-display-button-CueahYcm.js} +1 -1
- package/dist/client/assets/{collection-search-BFuAKML3.js → collection-search-C-vZtduC.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B3leyUk1.js → collection-table-wrapper-BapDNTsG.js} +1 -1
- package/dist/client/assets/{collection-tabs-jnYmxyBx.js → collection-tabs-BnDECkbQ.js} +1 -1
- package/dist/client/assets/{command-BTB0umeF.js → command-Dodm-w8K.js} +1 -1
- package/dist/client/assets/commerce-onboarding-DXMBUTDz.js +1 -0
- package/dist/client/assets/{connect-CiClwP-h.js → connect-j2mlrPiR.js} +2 -2
- package/dist/client/assets/{connect-layout-B8tnAWgZ.js → connect-layout-DiecLu9A.js} +1 -1
- package/dist/client/assets/{connection-lcMS2LdS.js → connection-BT2Nvm5b.js} +1 -1
- package/dist/client/assets/{connection-card-Elfgtygk.js → connection-card-DoxPiAfH.js} +1 -1
- package/dist/client/assets/connection-detail-DV4_FKFy.js +1 -0
- package/dist/client/assets/{connection-form-helpers-M1vgWgMZ.js → connection-form-helpers-422OHKLl.js} +1 -1
- package/dist/client/assets/connections-CRaA-93j.js +1 -0
- package/dist/client/assets/{create-organization-dialog-Csth32xO.js → create-organization-dialog-D8vhxdyz.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-AajGLnoQ.js → decopilot-sse-pool-CC8xuhpc.js} +1 -1
- package/dist/client/assets/{dialog-DTWAhfaj.js → dialog-Cz0TyjbB.js} +1 -1
- package/dist/client/assets/{domain-settings-DENjXXRv.js → domain-settings-4DGH3ghA.js} +1 -1
- package/dist/client/assets/{drawer-BksB5Qvf.js → drawer-BJF-pfh2.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BPZS68Mf.js → dropdown-menu-BNXoL43E.js} +1 -1
- package/dist/client/assets/e2e-tab-Cn2FXk4V.js +1 -0
- package/dist/client/assets/{editor-D74qHqnA.js → editor-COagHbmc.js} +1 -1
- package/dist/client/assets/{empty-state-2QI0GDcc.js → empty-state-BcShOK8y.js} +1 -1
- package/dist/client/assets/{empty-state-5b6uGere.js → empty-state-R3Gf1cup.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CTWz8EOk.js → extract-connection-data-WnP-t00f.js} +1 -1
- package/dist/client/assets/file-explorer-DoJ3JAGu.js +2 -0
- package/dist/client/assets/{file-type-icon-CKa9k4Eo.js → file-type-icon-CkFKND12.js} +1 -1
- package/dist/client/assets/{folder-icon-EabOWuN5.js → folder-icon-B_G8NPBM.js} +1 -1
- package/dist/client/assets/{form-BbWAigc0.js → form-BI8lXaWf.js} +1 -1
- package/dist/client/assets/general-DpFlP6Mv.js +1 -0
- package/dist/client/assets/{github-icon-D3DXPILS.js → github-icon-Bh8cYN11.js} +1 -1
- package/dist/client/assets/{hooks-Bj0aWBZV.js → hooks-DQxSpV5B.js} +1 -1
- package/dist/client/assets/hosting-tab-c114uUEI.js +1 -0
- package/dist/client/assets/{index-bZJ_OWgL.js → index-B4q20JqK.js} +1 -1
- package/dist/client/assets/{index-I0fSGHxP.js → index-BPQ0yfn_.js} +1 -1
- package/dist/client/assets/{index-TOMs0gOM.js → index-BQndpmm6.js} +2 -2
- package/dist/client/assets/index-Bsw_h-fN.js +1 -0
- package/dist/client/assets/{index-CttZrzIJ.js → index-CHwEdqc6.js} +1 -1
- package/dist/client/assets/{index-CcEKn9GL.js → index-CS7wGNbF.js} +1 -1
- package/dist/client/assets/index-Cj0gEWsO.css +1 -0
- package/dist/client/assets/{index-D3DIhOCa.js → index-D7c3ENS3.js} +1 -1
- package/dist/client/assets/{index-DZsx-GLV.js → index-DJQUO_5F.js} +25 -25
- package/dist/client/assets/{index-pnchsg3N.js → index-DUxHsoB3.js} +1 -1
- package/dist/client/assets/index-DfKKmgLE.js +827 -0
- package/dist/client/assets/{index-NlvkyqXy.js → index-SlLtg_R2.js} +1 -1
- package/dist/client/assets/index-redirect-CMnNA3cO.js +1 -0
- package/dist/client/assets/{infiniteQueryObserver-CN-Yb9Nr.js → infiniteQueryObserver-Dz5k81cL.js} +1 -1
- package/dist/client/assets/{infra-billing-CCYPhVJl.js → infra-billing-38iVSWLx.js} +1 -1
- package/dist/client/assets/{input-DBkq-ui7.js → input-DAq8Cogd.js} +1 -1
- package/dist/client/assets/{integration-icon-CoQDsKMQ.js → integration-icon-eQHWUfyl.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DHhflO7x.js → invite-member-dialog-BOj3Gkcq.js} +1 -1
- package/dist/client/assets/{label-XljGvqhv.js → label-C5IuR8oP.js} +1 -1
- package/dist/client/assets/{layout-DMMEJgp_.js → layout-BpEmheyC.js} +1 -1
- package/dist/client/assets/{login-DSFqd2Cw.js → login-DUbU__Dn.js} +1 -1
- package/dist/client/assets/{markdown-C6BHxHIr.js → markdown-gi_MNGvw.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BhcjOn-v.js → mcp-app-renderer-DAhokX0e.js} +2 -2
- package/dist/client/assets/{mcp-oauth-CkCOYpGa.js → mcp-oauth-H1nDAtgI.js} +1 -1
- package/dist/client/assets/{members-BRMS-z8-.js → members-DjEJdLt1.js} +1 -1
- package/dist/client/assets/{monaco-editor-DUfjWmCH.js → monaco-editor-s5nxaT6J.js} +2 -2
- package/dist/client/assets/{monitoring-stats-row-CNGtiW-V.js → monitoring-stats-row-CaLy4Ryh.js} +1 -1
- package/dist/client/assets/{multi-select-D2NZR3Je.js → multi-select-CFqy5bas.js} +1 -1
- package/dist/client/assets/{oauth-callback-_iMiiQ6O.js → oauth-callback-Jvfg7sIW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DWJ3tDti.js → oauth-callback-ai-provider-D5EPLu-K.js} +1 -1
- package/dist/client/assets/{onboarding-b4vqNQcH.js → onboarding-Zr_p1vAb.js} +1 -1
- package/dist/client/assets/org-layout-C9lwccdN.js +1 -0
- package/dist/client/assets/{organization-choice-B5jL_4VB.js → organization-choice-CTABkZvs.js} +1 -1
- package/dist/client/assets/{orgs-CxYHNmZz.js → orgs-Do50-Jd8.js} +1 -1
- package/dist/client/assets/{page-seo-form-D1zgMMO5.js → page-seo-form-B97SOeU5.js} +1 -1
- package/dist/client/assets/{popover-CugUBL2K.js → popover-CRp4G2Z6.js} +1 -1
- package/dist/client/assets/post-calendar-DPPABLzV.js +1 -0
- package/dist/client/assets/post-editor-DSvtP40e.js +1 -0
- package/dist/client/assets/{primitives-D5ZpBmDc.js → primitives-C7BIiVVo.js} +1 -1
- package/dist/client/assets/{profile-CR5LBckw.js → profile-BLTCJe7b.js} +1 -1
- package/dist/client/assets/project-app-view-Blu2IsZ3.js +1 -0
- package/dist/client/assets/{project-icon-D9jBx1Lh.js → project-icon-sXGV0X2Q.js} +1 -1
- package/dist/client/assets/{prompts-AYoj9J5J.js → prompts-3ZqIJFDd.js} +1 -1
- package/dist/client/assets/record-editor-CsxPBrFI.js +1 -0
- package/dist/client/assets/redirect-editor-Br7pXUqD.js +1 -0
- package/dist/client/assets/registry-BOCis5ep.js +2 -0
- package/dist/client/assets/{registry-layout-DS0JrRJJ.js → registry-layout-ED4OGMt2.js} +1 -1
- package/dist/client/assets/{reports-BPeWGcnC.js → reports-BdX-p26G.js} +2 -2
- package/dist/client/assets/{repositories-DDxpnac9.js → repositories-uAK6PGQO.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DRmwXY_Z.js → repository-import-picker-BOqZjy75.js} +1 -1
- package/dist/client/assets/{repository-picker-BVGd2Z5t.js → repository-picker-Dg2kea9_.js} +1 -1
- package/dist/client/assets/{require-capability-BAWColZy.js → require-capability-DZaP9GRG.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D_4lUDFj.js → required-auth-layout-BeMcQPLp.js} +1 -1
- package/dist/client/assets/{reset-password-Muwzg6q6.js → reset-password-HtxIFDKb.js} +1 -1
- package/dist/client/assets/review-settings-D7iT6mdL.js +1 -0
- package/dist/client/assets/roles-BoykZStL.js +1 -0
- package/dist/client/assets/{schema-K0VPsDN5.js → schema-CXWi7OUE.js} +1 -1
- package/dist/client/assets/{scroll-area-BtEw-0mL.js → scroll-area-DIILjYAD.js} +1 -1
- package/dist/client/assets/{search-input-DVFSQDiL.js → search-input-BnJ22pqo.js} +1 -1
- package/dist/client/assets/{secrets-RFx7imRf.js → secrets-Be4aGdkk.js} +1 -1
- package/dist/client/assets/{sections-editor-DnYOtohw.js → sections-editor-BQDRzdu2.js} +2 -2
- package/dist/client/assets/{select-model-aeACLtyd.js → select-model-BS741VWv.js} +1 -1
- package/dist/client/assets/{select-TX0TM16h.js → select-zsrd2RiW.js} +1 -1
- package/dist/client/assets/{self-tool-result-Bbk6LNdT.js → self-tool-result-UHlGJAZm.js} +1 -1
- package/dist/client/assets/seo-editor-B4chp4Nv.js +1 -0
- package/dist/client/assets/settings-layout-DdFAcCKC.js +1 -0
- package/dist/client/assets/{settings-sidebar-DDdLTxRO.js → settings-sidebar-qKQ2rd4i.js} +1 -1
- package/dist/client/assets/{shell-controls-BXEtXK0P.js → shell-controls-DwOzdtxQ.js} +1 -1
- package/dist/client/assets/shell-layout-D38a2ilI.js +1 -0
- package/dist/client/assets/{skill-preview-DmcbNeFW.js → skill-preview-BH1OTEDh.js} +1 -1
- package/dist/client/assets/{skills-D5ThPL4T.js → skills-B9ZpA0KI.js} +1 -1
- package/dist/client/assets/{sso-DIv3IfcX.js → sso-DIok2qyj.js} +1 -1
- package/dist/client/assets/{store-D4mWXY1Z.js → store-BnWD-sX4.js} +1 -1
- package/dist/client/assets/store-registry-Bs_SblgK.js +2 -0
- package/dist/client/assets/{switch-BSQsnixt.js → switch-wRuzhZCP.js} +1 -1
- package/dist/client/assets/{synced-repos-BksI9Fmi.js → synced-repos-BK1T5QWT.js} +1 -1
- package/dist/client/assets/{table-CSLvM8dI.js → table-DMgVyVQS.js} +1 -1
- package/dist/client/assets/{tabs-BvOQpnly.js → tabs-C9rYvTFN.js} +1 -1
- package/dist/client/assets/{task-board-C6hevS_c.js → task-board-D0cF49Rr.js} +1 -1
- package/dist/client/assets/{task-route-Dl0AbbvO.js → task-route-Dyvp3vwK.js} +1 -1
- package/dist/client/assets/tasks-DssW8rYC.js +1 -0
- package/dist/client/assets/{textarea-NzT1ozxc.js → textarea-NYvkjUAn.js} +1 -1
- package/dist/client/assets/{thread-intent-CRKQoXCi.js → thread-intent-CgKd5Wx-.js} +1 -1
- package/dist/client/assets/{thread-route-BVfQR44p.js → thread-route-BgI1RAgC.js} +1 -1
- package/dist/client/assets/{toggle-group-DOqWV4T2.js → toggle-group-It3hRo8l.js} +1 -1
- package/dist/client/assets/{toolbar-DU14MGQo.js → toolbar-SMhPqa2y.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-5CxdQ2TT.js → toolbar-icon-button-C4gmxVIe.js} +1 -1
- package/dist/client/assets/{track-CGYLX8Er.js → track-ByEKyB4m.js} +1 -1
- package/dist/client/assets/{types-DTNV26Po.js → types-DRS7wX8l.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BSKIayEv.js → use-ai-providers-Mptwa2nu.js} +1 -1
- package/dist/client/assets/{use-automations-DIpGUZTg.js → use-automations-xybTlCwA.js} +1 -1
- package/dist/client/assets/{use-autosave-J1-_cCzS.js → use-autosave-DKENIaWw.js} +1 -1
- package/dist/client/assets/{use-connection-BJuR4u4_.js → use-connection-Cj6jhInv.js} +1 -1
- package/dist/client/assets/{use-copy-BjXr_pKM.js → use-copy-PCW_eaa6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D04e0Bk1.js → use-create-virtual-mcp-2La6_4nW.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DQ9VKYwt.js → use-date-fns-locale-DFrNlcdk.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-RrEYWg_V.js → use-debounced-autosave-CyQ6phI-.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B_8t2ZDh.js → use-debounced-value-DTG_WVYT.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DWrIyAdA.js → use-decopilot-events-DnaHPSLF.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DtkuuBez.js → use-delete-connection-8l-RyDdH.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CFMU-XcS.js → use-deployment-admin-CShZ060R.js} +1 -1
- package/dist/client/assets/{use-destination-route-DE7DNG84.js → use-destination-route-BS5_9jNo.js} +1 -1
- package/dist/client/assets/{use-file-configs-B12Bgu3Z.js → use-file-configs-BvqhugH-.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BXr_u2X1.js → use-infinite-scroll-DU0M3enW.js} +1 -1
- package/dist/client/assets/{use-join-requests-D-KCRo7_.js → use-join-requests-lrCf0PQt.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BPLGrU-q.js → use-mcp-auth-status-CM0X2Q6P.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CT68MaZf.js → use-mcp-client-DOjgXsoM.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-Bfyb41qd.js → use-mcp-prompts-BKEcBOIJ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DeRZ-3eb.js → use-mcp-tools-Bjz_51W4.js} +1 -1
- package/dist/client/assets/{use-members-DJJCMnU7.js → use-members-BB7OB8zH.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-COZVNK2u.js → use-navigate-to-agent-BX5Ov16Z.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DzA-vkZA.js → use-org-auth-client-Dv5ggRPD.js} +1 -1
- package/dist/client/assets/{use-org-notice-DJYgAFPy.js → use-org-notice-Bb3hmM0X.js} +1 -1
- package/dist/client/assets/{use-org-sso-CzPpWIQr.js → use-org-sso-qVsnd7nU.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C0nmTCQ9.js → use-organization-roles-c807ZNwQ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DrMHeBOr.js → use-organization-settings-Duntu8dc.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DscHtGsE.js → use-panel-navigate-lJXqYoE8.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CFql8C6x.js → use-registry-connections-Q445kfkp.js} +1 -1
- package/dist/client/assets/{use-secrets-CNGepf_x.js → use-secrets-D_yQvvYk.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BtG237cA.js → use-section-preview-base-CQBGEP31.js} +1 -1
- package/dist/client/assets/{use-status-sounds-L30GUs7u.js → use-status-sounds-Dg3N4ijY.js} +1 -1
- package/dist/client/assets/{use-tags-O7Ozj_kd.js → use-tags-D9wANkyQ.js} +1 -1
- package/dist/client/assets/{use-view-mode-lhEpmryw.js → use-view-mode-D37EDMuR.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BXbxVipJ.js → use-virtual-mcp-9JWM1UZv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BCgs6-zI.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BFXkdPJm.js +1 -0
- package/dist/client/assets/{users-CkRr5SvX.js → users-D6I_Ulcy.js} +1 -1
- package/dist/client/assets/variant-calendar-OloQMR7L.js +1 -0
- package/dist/client/assets/{view-mode-toggle-Djyfw1v1.js → view-mode-toggle-DUf-vSHP.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-CnnQSswm.js +0 -1
- package/dist/client/assets/agents-list-Be9vygo-.js +0 -1
- package/dist/client/assets/analytics-tab-CbgXJ0tW.js +0 -2
- package/dist/client/assets/api-keys-CD9aqPus.js +0 -1
- package/dist/client/assets/app-editor-QPD1L4OP.js +0 -1
- package/dist/client/assets/automations-BS56l2F-.js +0 -1
- package/dist/client/assets/category-editor-Vq1v0CXB.js +0 -1
- package/dist/client/assets/choose-editor-BdTQxBij.js +0 -1
- package/dist/client/assets/collection-detail-CnCqIfnk.js +0 -1
- package/dist/client/assets/commerce-onboarding-B4F0Tnl7.js +0 -1
- package/dist/client/assets/connection-detail-L68FjDUB.js +0 -1
- package/dist/client/assets/connections-Cq6QnpjJ.js +0 -1
- package/dist/client/assets/e2e-tab-DUREhAJG.js +0 -1
- package/dist/client/assets/file-explorer-DEF_0jI4.js +0 -2
- package/dist/client/assets/general-DWhviXPW.js +0 -1
- package/dist/client/assets/hosting-tab-CAb80WXs.js +0 -1
- package/dist/client/assets/index-BT-75k1L.js +0 -1
- package/dist/client/assets/index-DhYXykaq.js +0 -827
- package/dist/client/assets/index-bWqcZ8bk.css +0 -1
- package/dist/client/assets/index-redirect-StIyTln4.js +0 -1
- package/dist/client/assets/org-layout-ByyP_m92.js +0 -1
- package/dist/client/assets/post-calendar-CNLjTDlA.js +0 -1
- package/dist/client/assets/post-editor-CecVUF8d.js +0 -1
- package/dist/client/assets/project-app-view-D7LtFUZ4.js +0 -1
- package/dist/client/assets/record-editor-vTG2nsSZ.js +0 -1
- package/dist/client/assets/redirect-editor-k_ZJZYUp.js +0 -1
- package/dist/client/assets/registry-CfSc7pmv.js +0 -2
- package/dist/client/assets/review-settings-Cu5Kl-yB.js +0 -1
- package/dist/client/assets/roles-bkDNCeem.js +0 -1
- package/dist/client/assets/seo-editor-CvfZpri2.js +0 -1
- package/dist/client/assets/settings-layout-BrG6I0Uc.js +0 -1
- package/dist/client/assets/shell-layout-jfh4uwOT.js +0 -1
- package/dist/client/assets/store-registry-DhHtNP8N.js +0 -2
- package/dist/client/assets/tasks-CxrKZF9u.js +0 -1
- package/dist/client/assets/useInfiniteQuery-a-wpM9y3.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-WUmm_LeP.js +0 -1
- package/dist/client/assets/variant-calendar-CkeoT_kl.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as jt,b as Bt,r as A,j as o,l as _t,h as wt,t as ht}from"./index-DJQUO_5F.js";import{b as At}from"./chat-context-C48t2Pu7.js";import{i as Et}from"./ChevronRight-CL-1AW54.js";import{S as Nt}from"./scroll-area-DIILjYAD.js";import{u as Rt,A as Tt}from"./use-section-preview-base-CQBGEP31.js";import{n as Ct,r as Kt,c as Pt,d as Ft,e as Ot,g as Ut,h as $t,S as It,i as zt,j as Lt}from"./index-DfKKmgLE.js";import"./use-panel-navigate-lJXqYoE8.js";import"./use-destination-route-BS5_9jNo.js";import"./autosend-BLWBLlQp.js";import"./thread-intent-CgKd5Wx-.js";import"./slugify-CEUa2lfQ.js";import"./hooks-DQxSpV5B.js";import"./use-mcp-client-DOjgXsoM.js";import"./auth-DrTXT3NH.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CC8xuhpc.js";import"./task-board-D0cF49Rr.js";import"./schema-CXWi7OUE.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-9JWM1UZv.js";import"./use-ai-providers-Mptwa2nu.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DnaHPSLF.js";import"./thread-route-BgI1RAgC.js";import"./dialog-Cz0TyjbB.js";import"./Check-BRo4TcYL.js";import"./Copy01-Cz84dNWo.js";import"./Download01-BY5nFlV8.js";import"./use-organization-settings-Duntu8dc.js";import"./select-zsrd2RiW.js";import"./ChevronUp-DRrtPFPU.js";import"./agent-icon-CaI0ggpq.js";import"./AlertCircle-BMk6q2FA.js";import"./Tool01-BEvJ_YW1.js";import"./ArrowUp-BrUqWSUA.js";import"./ArrowLeft-CBdaifdY.js";import"./Tool02-BJ6DrdG_.js";import"./ArrowRight-k7OlY3ZV.js";import"./TrendUp01-BQU61XVU.js";import"./ZoomOut-GAT73I28.js";import"./Users03-B3GcmkAW.js";import"./CheckCircle-ByifJ5DN.js";import"./ChevronSelectorVertical-D89G1wQX.js";import"./DotsVertical-CUeujFxe.js";import"./UserSquare-B8muuAeC.js";import"./CreditCard01-16ccuHl7.js";import"./Settings02-5Mu_nYD8.js";import"./Eye-DSfFTZ0l.js";import"./Share07-B8Aw6CDi.js";import"./GitBranch01-CzoRmimO.js";import"./Globe01-DhXQEmKy.js";import"./XClose-BSY1lYTG.js";import"./HardDrive-Dz1jdiPQ.js";import"./Image01-ChEQz8oh.js";import"./Key01-BOmG8BKE.js";import"./Link01-DkfXBBhQ.js";import"./LinkExternal01-CbmJH8Oa.js";import"./Monitor01-D0BOdaeR.js";import"./Sun-BzWxkbN5.js";import"./Package-BtdRPN0k.js";import"./Palette-D3howidE.js";import"./Play-BRZZbBP9.js";import"./Plus-CHPz10Kd.js";import"./SearchLg-B8u5Z_-p.js";import"./SearchMd-BfOW0ihr.js";import"./Shield01-BCG_3DYj.js";import"./Stars01-foIfuOVN.js";import"./Trash01-BV_RW_ot.js";import"./Upload01-CzJgAWQf.js";import"./User01-BYo154It.js";import"./Users01-CCJxFqcF.js";import"./XCircle-B00jwioD.js";import"./Zap-u6tF2K1C.js";import"./input-DAq8Cogd.js";import"./automation-runs-staCAMV3.js";import"./useInfiniteQuery-BCgs6-zI.js";import"./infiniteQueryObserver-Dz5k81cL.js";import"./use-connection-Cj6jhInv.js";import"./table-DMgVyVQS.js";import"./empty-state-R3Gf1cup.js";import"./use-infinite-scroll-DU0M3enW.js";import"./use-members-BB7OB8zH.js";import"./use-org-auth-client-Dv5ggRPD.js";import"./use-automations-xybTlCwA.js";import"./useSuspenseInfiniteQuery-BFXkdPJm.js";import"./avatar-8wWRKAWW.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-PCW_eaa6.js";import"./markdown-gi_MNGvw.js";import"./monaco-editor-s5nxaT6J.js";import"./editor-COagHbmc.js";import"./mcp-app-renderer-DAhokX0e.js";import"./types-DRS7wX8l.js";import"./shell-layout-D38a2ilI.js";import"./project-icon-sXGV0X2Q.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-Dodm-w8K.js";import"./index-D7c3ENS3.js";import"./required-auth-layout-BeMcQPLp.js";import"./use-org-sso-qVsnd7nU.js";import"./use-org-notice-Bb3hmM0X.js";import"./integration-icon-eQHWUfyl.js";import"./use-navigate-to-agent-BX5Ov16Z.js";import"./use-mcp-prompts-BKEcBOIJ.js";import"./form-BI8lXaWf.js";import"./label-C5IuR8oP.js";import"./file-type-icon-CkFKND12.js";import"./drawer-BJF-pfh2.js";import"./collection-search-C-vZtduC.js";import"./tabs-C9rYvTFN.js";import"./toggle-group-It3hRo8l.js";import"./task-route-Dyvp3vwK.js";import"./extract-connection-data-WnP-t00f.js";import"./metadata-dUsYcpuu.js";import"./connection-BT2Nvm5b.js";import"./connection-card-DoxPiAfH.js";import"./use-registry-connections-Q445kfkp.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-NYvkjUAn.js";import"./connection-form-helpers-422OHKLl.js";import"./authenticate-and-persist-oauth-BSOO7-Ru.js";import"./mcp-oauth-H1nDAtgI.js";import"./collection-tabs-BnDECkbQ.js";import"./badge-Dc8kcV5t.js";import"./use-file-configs-BvqhugH-.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-BNXoL43E.js";import"./popover-CRp4G2Z6.js";import"./github-icon-Bh8cYN11.js";import"./get-initials-D-f_fDFw.js";import"./select-model-BS741VWv.js";import"./checkbox-CNie4rus.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-B_G8NPBM.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Dg3N4ijY.js";import"./toolbar-SMhPqa2y.js";import"./use-mcp-tools-Bjz_51W4.js";import"./skill-preview-BH1OTEDh.js";import"./use-date-fns-locale-DFrNlcdk.js";import"./alert-dialog-BJoAnvTa.js";import"./use-debounced-autosave-CyQ6phI-.js";import"./search-input-BnJ22pqo.js";import"./use-mcp-auth-status-CM0X2Q6P.js";import"./switch-wRuzhZCP.js";import"./breadcrumb-DTve-fNU.js";import"./repository-import-picker-BOqZjy75.js";import"./repository-picker-Dg2kea9_.js";import"./use-debounced-value-DTG_WVYT.js";import"./use-secrets-D_yQvvYk.js";import"./client-icons-DJ5EKjKX.js";import"./connect-layout-DiecLu9A.js";import"./self-tool-result-UHlGJAZm.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-ByEKyB4m.js";import"./use-tags-D9wANkyQ.js";import"./toolbar-icon-button-C4gmxVIe.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-CUdrE7CI.js";import"./site-error--i37Vnuw.js";import"./cards-C2rTb-Sr.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=Ct(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Jr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Kt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Pt(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Ft(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Ot(K);let P;t[17]!==S?(P=zt((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;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=>{O.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const 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=Ut(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?[]:$t(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 j;t[42]!==W?(j=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let _;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=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(It,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=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(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.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 M;return t[75]!==B||t[76]!==_||t[77]!==w?(M=o.jsxs("div",{className:gt,children:[B,_,w]}),t[75]=B,t[76]=_,t[77]=w,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{Jr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dC as v,dD as $,dE as W,dF as L,dG as H,dH as D,dI as V,dJ as x,dK as q,dL as j,dM as y,dN as N,dO as B,dP as F,dQ as Z}from"./index-DZsx-GLV.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
1
|
+
import{dD as v,dE as $,dF as W,dG as L,dH as H,dI as D,dJ as V,dK as x,dL as q,dM as j,dN as y,dO as N,dP as B,dQ as F,dR as Z}from"./index-DJQUO_5F.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-
|
|
1
|
+
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-DJQUO_5F.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,F as Fe,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as _e}from"./index-DZsx-GLV.js";import{I as ee}from"./input-DBkq-ui7.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="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:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,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 Ye({redirectUrl:n,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,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({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?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.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(n??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)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.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(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){H(i.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:$})},De=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{q(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.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")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.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:$e}),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:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(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"}),i.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:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,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:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.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||!B,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?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.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:i.useDifferentEmail})]}):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:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,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?i.sending:i.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:De,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:i.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?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Re,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:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,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:i.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?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,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:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),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)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.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:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).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,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.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 fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}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();n.setQueryData(ue.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(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,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(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_e,{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(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,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 Qe(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(n))}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}},[n]),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(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,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:n});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,n]),t.jsx(Oe,{})}function ot(n){const e=oe.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}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=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 Q;e[2]!==_||e[3]!==L?(Q={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const $=Q;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(de&&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]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,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||le.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(Ye,{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 W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,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{Oe as A,ot as a,Ge as u};
|
|
1
|
+
import{a as V,F as Fe,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as _e}from"./index-DJQUO_5F.js";import{I as ee}from"./input-DAq8Cogd.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="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:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,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 Ye({redirectUrl:n,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,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({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?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.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(n??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)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.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(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){H(i.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:$})},De=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{q(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.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")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.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:$e}),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:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(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"}),i.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:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,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:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.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||!B,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?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.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:i.useDifferentEmail})]}):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:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,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?i.sending:i.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:De,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:i.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?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Re,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:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,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:i.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?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,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:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),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)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.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:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).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,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.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 fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}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();n.setQueryData(ue.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(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,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(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_e,{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(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,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 Qe(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(n))}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}},[n]),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(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,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:n});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,n]),t.jsx(Oe,{})}function ot(n){const e=oe.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}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=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 Q;e[2]!==_||e[3]!==L?(Q={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const $=Q;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(de&&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]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,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||le.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(Ye,{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 W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,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{Oe as A,ot as a,Ge as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,l as p,j as f}from"./index-
|
|
1
|
+
import{c as g,l as p,j as f}from"./index-DJQUO_5F.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-DJQUO_5F.js";import{i as u,a as p}from"./mcp-oauth-H1nDAtgI.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};
|
package/dist/client/assets/{automation-list-row-qgJpJ0m6.js → automation-list-row-CUdrE7CI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-
|
|
1
|
+
import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-DJQUO_5F.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-BJoAnvTa.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-BNXoL43E.js";import{A as me,aD as ue}from"./agent-icon-CaI0ggpq.js";import{i as de}from"./DotsVertical-CUeujFxe.js";import{s as fe}from"./Trash01-BV_RW_ot.js";import{i as ge}from"./Zap-u6tF2K1C.js";import{u as xe}from"./use-virtual-mcp-9JWM1UZv.js";import{u as pe}from"./use-automations-xybTlCwA.js";function Le(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let D;e[37]!==v?(D=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=D):D=e[38];let _;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==D||e[43]!==f||e[44]!==g?(_=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,D]}),e[39]=H,e[40]=n,e[41]=w,e[42]=D,e[43]=f,e[44]=g,e[45]=_):_=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let A;e[48]!==b?(A=t.jsx(Y,{children:b}),e[48]=b,e[49]=A):A=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==A||e[56]!==R?(y=t.jsxs(ee,{children:[A,R]}),e[55]=A,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==_||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[_,M]}),e[77]=_,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Le as A};
|