decocms 4.92.0 → 4.92.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BtNVN6lT.js → AlertCircle-Cvc_10Uv.js} +1 -1
- package/dist/client/assets/{AreaChart-G7ca0KYF.js → AreaChart-D4PMIsMV.js} +1 -1
- package/dist/client/assets/{ArrowUp-SfmKmvG1.js → ArrowUp-Dq6JgHsq.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DPmhEMyl.js → ArrowUpRight-DgI9ki5h.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dqg_7udX.js → CheckCircle-B5oIKeSF.js} +1 -1
- package/dist/client/assets/{ChevronDown-CtpYRw0N.js → ChevronDown-D_W2bIqv.js} +1 -1
- package/dist/client/assets/{ChevronRight-DQFD5vOs.js → ChevronRight-BnIvJcIZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bu3KYaYp.js → ChevronUp-Ci-XiWb6.js} +1 -1
- package/dist/client/assets/{Copy01-B4AQ9voq.js → Copy01-Q4xZmPKp.js} +1 -1
- package/dist/client/assets/{DotsVertical-4fMK5hdE.js → DotsVertical-Bcfqjiks.js} +1 -1
- package/dist/client/assets/{Eye-7UpR5EsV.js → Eye-BuukW7MV.js} +1 -1
- package/dist/client/assets/{FilterLines-jo0eHglf.js → FilterLines-Do4UgzmV.js} +1 -1
- package/dist/client/assets/{Globe01-BEuNOgWE.js → Globe01-qjaQZUfN.js} +1 -1
- package/dist/client/assets/{Globe04-ezZLp1FH.js → Globe04-CqIGMVDi.js} +1 -1
- package/dist/client/assets/{HardDrive-Bx0yMIUr.js → HardDrive-DrLvUMYg.js} +1 -1
- package/dist/client/assets/{Image01-BemfbeRy.js → Image01-BWotytID.js} +1 -1
- package/dist/client/assets/{Key01-wlopeCn8.js → Key01-BPZUhUcV.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DgCOjEX2.js → LayoutLeft-COV7zlIC.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DjHN0DVc.js → LinkExternal01-CyMOdGfe.js} +1 -1
- package/dist/client/assets/{Monitor01-CvVGHJ2u.js → Monitor01-dLHbd0CB.js} +1 -1
- package/dist/client/assets/{Package-Dkg7P-qU.js → Package-B7Qii2Tl.js} +1 -1
- package/dist/client/assets/{Palette-DnEGtR5r.js → Palette-tVNOj7Ym.js} +1 -1
- package/dist/client/assets/{Play-pFWdRfmo.js → Play-BE8nTtBp.js} +1 -1
- package/dist/client/assets/{Plus-BhgoGeba.js → Plus-5VWQJEkS.js} +1 -1
- package/dist/client/assets/{SearchLg-D7iDyCtR.js → SearchLg-BiyFAMx0.js} +1 -1
- package/dist/client/assets/{SearchMd-DU7sZsGX.js → SearchMd-LbMkvaPD.js} +1 -1
- package/dist/client/assets/{Settings02-Kn3GUgY3.js → Settings02-CU2rilKq.js} +1 -1
- package/dist/client/assets/{Shield01-BF7nZR91.js → Shield01-7KT2UKvg.js} +1 -1
- package/dist/client/assets/{Star01-UbWAuLRP.js → Star01-D4LxiizA.js} +1 -1
- package/dist/client/assets/{Stars01-CKHcD24W.js → Stars01-HAbkffzq.js} +1 -1
- package/dist/client/assets/{Stars02-ByALJtc-.js → Stars02-CdgckoDr.js} +1 -1
- package/dist/client/assets/{Sun-ERdj2Ruh.js → Sun-Ca3eslhz.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B2hcs1rw.js → SwitchHorizontal01-DNcPUv7P.js} +1 -1
- package/dist/client/assets/{Tool01-DoTp9Ymb.js → Tool01-DBXzU6aR.js} +1 -1
- package/dist/client/assets/{Tool02-f6hCEEx5.js → Tool02-rl8XhSPG.js} +1 -1
- package/dist/client/assets/{Trash01-Dgm4FHaX.js → Trash01-DxXosbkh.js} +1 -1
- package/dist/client/assets/{TrendUp01-DdLolkHU.js → TrendUp01-BmzCTIbp.js} +1 -1
- package/dist/client/assets/{Upload01-DPgiWRF2.js → Upload01-CXsTipbe.js} +1 -1
- package/dist/client/assets/{User01-4oxhkWpc.js → User01-CZgThaZQ.js} +1 -1
- package/dist/client/assets/{Users01-CbDWoQDz.js → Users01-IdyAszrF.js} +1 -1
- package/dist/client/assets/{Users03-DQDFsIZA.js → Users03-3HXi1aia.js} +1 -1
- package/dist/client/assets/{X-BJznV24Z.js → X-CLG08ht8.js} +1 -1
- package/dist/client/assets/{XCircle-Mn7Ozb-Q.js → XCircle-pZ6nD22L.js} +1 -1
- package/dist/client/assets/{XClose-BYGQndp2.js → XClose-BYq2BBpT.js} +1 -1
- package/dist/client/assets/{Zap-SMAt3bB0.js → Zap-C6tkfs5m.js} +1 -1
- package/dist/client/assets/{ZapSquare-Chem9D1s.js → ZapSquare-DdKvM81Z.js} +1 -1
- package/dist/client/assets/{ZoomOut-znim4joS.js → ZoomOut-DAAhtu2Z.js} +1 -1
- package/dist/client/assets/{access-gate-CXUaT8Bg.js → access-gate-B8spscer.js} +1 -1
- package/dist/client/assets/add-section-modal-De0GxBTc.js +1 -0
- package/dist/client/assets/agent-icon-BIj6WxKp.js +1 -0
- package/dist/client/assets/{agents-list-CxMjWnYV.js → agents-list-Cc-986WT.js} +1 -1
- package/dist/client/assets/{ai-providers-V_ToPNx9.js → ai-providers-Ck_-NP1I.js} +1 -1
- package/dist/client/assets/{alert-DCHONWz2.js → alert-CI7flGPF.js} +1 -1
- package/dist/client/assets/{alert-dialog-9jx8jzEO.js → alert-dialog-D2oa47X8.js} +1 -1
- package/dist/client/assets/{app-editor-B5Y1RFnh.js → app-editor-Cn-tT-ug.js} +1 -1
- package/dist/client/assets/{auth-wA89jw5z.js → auth-Kymy4xkz.js} +1 -1
- package/dist/client/assets/{auth-catchall-gpLRqkDV.js → auth-catchall-B0gQyYvu.js} +1 -1
- package/dist/client/assets/{auth-entry-ByL0Zb6R.js → auth-entry-Crrd0hkP.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BoMjBMXD.js → auth-split-layout-BO4l9cCp.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CO2Dkq5Q.js → authenticate-and-persist-oauth-DAAmwSgR.js} +1 -1
- package/dist/client/assets/{automation-list-row-CZVotwYb.js → automation-list-row-D-cT9rxb.js} +1 -1
- package/dist/client/assets/{automation-runs-oeg4SZH2.js → automation-runs-_XAGR1m2.js} +1 -1
- package/dist/client/assets/{automations-kL1ULwau.js → automations-Bh1OF4xf.js} +1 -1
- package/dist/client/assets/{autosend-DFAdUSMh.js → autosend-D-JHJKNK.js} +1 -1
- package/dist/client/assets/{avatar-D2faXu9B.js → avatar-1o2VQKTj.js} +1 -1
- package/dist/client/assets/{badge-C22fJvJ9.js → badge-dHBIjKyY.js} +1 -1
- package/dist/client/assets/{block-document-F7Fz2w43.js → block-document-nemKITlN.js} +1 -1
- package/dist/client/assets/{brand-context-CwktNs2n.js → brand-context-DSZ7O9_c.js} +1 -1
- package/dist/client/assets/{buckets-BqmVHHty.js → buckets-BDkQllTH.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DEnhQv4x.js → bulk-category-panel-Cn58Io0u.js} +1 -1
- package/dist/client/assets/{calendar-C55pfZGp.js → calendar-C9b1I5Xh.js} +1 -1
- package/dist/client/assets/{capability-load-error-D-GHd7kt.js → capability-load-error-DI4Ww9LY.js} +1 -1
- package/dist/client/assets/{card-BZY4DqkC.js → card-CoG27DVs.js} +1 -1
- package/dist/client/assets/category-editor-BmpcIx1s.js +1 -0
- package/dist/client/assets/{chat-context-8zti4wkh.js → chat-context-glCfFIWX.js} +1 -1
- package/dist/client/assets/{checkbox-DvRekaoI.js → checkbox-BOAToSlJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BwJqzavM.js → cli-auth-success-CqzQrYb8.js} +1 -1
- package/dist/client/assets/collection-detail-I0O1ME9a.js +1 -0
- package/dist/client/assets/{collection-display-button-Su2JKz2G.js → collection-display-button-Bw2bFMNm.js} +1 -1
- package/dist/client/assets/{collection-search-B4ji9AjC.js → collection-search-DuPY-s4R.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DhT1Pcxz.js → collection-table-wrapper-BOKHq7cp.js} +1 -1
- package/dist/client/assets/{collection-tabs-DTWzD8v3.js → collection-tabs-CcN3J070.js} +1 -1
- package/dist/client/assets/{command-BeMVvNyF.js → command-BB6Oir8o.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-wd060R0w.js → commerce-onboarding-DejhsIyX.js} +1 -1
- package/dist/client/assets/{companions-core-D6ZCzGBn.js → companions-core-C-kZqiTC.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-ekgjUng_.js → connect-desktop-dialog-CUGIAU17.js} +1 -1
- package/dist/client/assets/{connection-card-7Jlr5ou8.js → connection-card-7gBTmFox.js} +1 -1
- package/dist/client/assets/{connection-detail-CVc89tOZ.js → connection-detail-BB0rtYjx.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BT4sViBb.js → connection-form-helpers-CJKig9hy.js} +1 -1
- package/dist/client/assets/{connections-U8gRLumN.js → connections-E7mextbc.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-us-M5mS8.js → decopilot-sse-pool-DEJZ4gJu.js} +1 -1
- package/dist/client/assets/{dialog-B_MtszrV.js → dialog-ChJw5xnr.js} +1 -1
- package/dist/client/assets/{domain-settings-C_FTyjE2.js → domain-settings-B6Co6UtW.js} +1 -1
- package/dist/client/assets/{drawer-BsQ2VY2t.js → drawer-_WfOhyRU.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CCf9b-Ue.js → dropdown-menu-B7HOgSu8.js} +1 -1
- package/dist/client/assets/{empty-state-uOmVY7AV.js → empty-state-kSEyPCAz.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B1PMDhhA.js → extract-connection-data-oUFnwuwD.js} +1 -1
- package/dist/client/assets/{file-explorer-Cq-sGwnZ.js → file-explorer-CnTvRnvj.js} +1 -1
- package/dist/client/assets/{file-type-icon-DLDSmTyC.js → file-type-icon-CeQVzqDu.js} +1 -1
- package/dist/client/assets/{files-CCiFVnRx.js → files-CCxNqj9u.js} +1 -1
- package/dist/client/assets/{form-CBH5rcB6.js → form-BUM27CLj.js} +1 -1
- package/dist/client/assets/{general-DnViTnDI.js → general-BjF2DfAd.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DWdab-4Y.js → github-repo-picker-4TIPzYjR.js} +1 -1
- package/dist/client/assets/{hooks-CQZHp8Dt.js → hooks-CJqrF4BQ.js} +1 -1
- package/dist/client/assets/{index-BfunopXO.js → index-BHqz24vm.js} +1 -1
- package/dist/client/assets/index-B_qFi_-_.js +519 -0
- package/dist/client/assets/{index-CodlhltM.js → index-BderZvBT.js} +1 -1
- package/dist/client/assets/{index-F-zmfSqw.js → index-Bj_MaVUP.js} +1 -1
- package/dist/client/assets/{index-QeeIyPD-.js → index-C8rlFaFO.js} +3 -3
- package/dist/client/assets/{index-d_66hXvz.js → index-CHWLrEqX.js} +1 -1
- package/dist/client/assets/{index-CmemNDJU.js → index-CQwS9Ezr.js} +1 -1
- package/dist/client/assets/{index-DWmvNX0u.js → index-CR0rMz7E.js} +1 -1
- package/dist/client/assets/{index-C1alCXBf.js → index-CWGwstEz.js} +3 -3
- package/dist/client/assets/{index-CAK7n_FO.js → index-CWlzI7M3.js} +2 -2
- package/dist/client/assets/{index-hhU2F3WQ.js → index-D6ixbRYa.js} +1 -1
- package/dist/client/assets/{index-DWS4NoqH.js → index-DVotD2Sm.js} +1 -1
- package/dist/client/assets/{index-B-kvMeNd.js → index-DyXd0E61.js} +1 -1
- package/dist/client/assets/{index-C_AuPrej.js → index-WDnleR3r.js} +1 -1
- package/dist/client/assets/{index-redirect-BRH-3ZCu.js → index-redirect-CZuVtK8Y.js} +1 -1
- package/dist/client/assets/{input-ksjqlSwm.js → input-CWExGH7j.js} +1 -1
- package/dist/client/assets/{integration-icon-nHJfLZDJ.js → integration-icon-BXEpLE2r.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-C6cxYu7U.js → invite-member-dialog-Cj35CA_W.js} +1 -1
- package/dist/client/assets/{label-B8xrTNKP.js → label-BbLr7wPS.js} +1 -1
- package/dist/client/assets/{layout-BJDwPfq0.js → layout-yKsHfaYu.js} +1 -1
- package/dist/client/assets/{login-DlJSNcQs.js → login-g6Yf2A86.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C_zNkYXB.js → mcp-oauth-B2KaqQoI.js} +1 -1
- package/dist/client/assets/{members-BM7Uqu1Q.js → members-yX31omZQ.js} +1 -1
- package/dist/client/assets/{monaco-editor-CAwKA7tN.js → monaco-editor-CJKnQM68.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CC7F0Phb.js → monitoring-stats-row-DTqvYy56.js} +1 -1
- package/dist/client/assets/{multi-select-5dvonfKB.js → multi-select-C9lH7lr4.js} +1 -1
- package/dist/client/assets/{oauth-callback-8qeP_w61.js → oauth-callback-DPu8Jv31.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BmIt9KYD.js → oauth-callback-ai-provider-DXhgROtl.js} +1 -1
- package/dist/client/assets/{onboarding-Cg0DtUJd.js → onboarding-b8UESLyK.js} +1 -1
- package/dist/client/assets/{org-install-CTi6z1kk.js → org-install-DFTAzRMO.js} +1 -1
- package/dist/client/assets/{org-layout-tdajFZ6u.js → org-layout-BbjFIQ-M.js} +1 -1
- package/dist/client/assets/{organization-choice-GMUL1NeO.js → organization-choice-DjVV9MCZ.js} +1 -1
- package/dist/client/assets/{orgs-6ZiXdiJ2.js → orgs-B1jGApXW.js} +1 -1
- package/dist/client/assets/{page-seo-form-CGZUz0ph.js → page-seo-form-DeD_2a8R.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BWnl0tVz.js +1 -0
- package/dist/client/assets/{popover-3l0deoOx.js → popover-kOy_asOa.js} +1 -1
- package/dist/client/assets/post-editor-BZQdhdwo.js +1 -0
- package/dist/client/assets/{primitives-DGvfP5N2.js → primitives-Cyz_TV23.js} +1 -1
- package/dist/client/assets/{profile-BjX7gD7e.js → profile-D5HUGTyF.js} +1 -1
- package/dist/client/assets/project-app-view-Bsaa-6LK.js +1 -0
- package/dist/client/assets/record-editor-Bjgurgfp.js +1 -0
- package/dist/client/assets/redirect-editor-DnT7ef0C.js +1 -0
- package/dist/client/assets/registry-DHjmo34d.js +2 -0
- package/dist/client/assets/{registry-layout-50Nc58LU.js → registry-layout-JPmaR-tb.js} +1 -1
- package/dist/client/assets/{reports-CMuw_Eim.js → reports-Btc-1oN-.js} +1 -1
- package/dist/client/assets/{require-capability-BMCPfqFj.js → require-capability-BBszzyH9.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BON6U2A_.js → required-auth-layout-CR5_YK6W.js} +1 -1
- package/dist/client/assets/{reset-password-CuQp3WxW.js → reset-password-u9Nbv0bS.js} +1 -1
- package/dist/client/assets/{roles-flCogJRV.js → roles-B7bUsR2h.js} +1 -1
- package/dist/client/assets/{search-input-UOEApV9M.js → search-input-B6akQV4Y.js} +1 -1
- package/dist/client/assets/{secrets-CUe-abV1.js → secrets-Dsj3iy5H.js} +1 -1
- package/dist/client/assets/sections-editor-CvIj0bPs.js +2 -0
- package/dist/client/assets/{select-BK6Fwx47.js → select-4-vdHbLT.js} +1 -1
- package/dist/client/assets/{select-model-FeZ2YvBx.js → select-model-CVcEVUsi.js} +1 -1
- package/dist/client/assets/{self-tool-result-BblMArR-.js → self-tool-result-Cwdk21K_.js} +1 -1
- package/dist/client/assets/{seo-editor-D48-7A97.js → seo-editor-B0_qMHl0.js} +1 -1
- package/dist/client/assets/{settings-layout-DEiZmbv4.js → settings-layout-BURikhtl.js} +1 -1
- package/dist/client/assets/{settings-section--wnksRdd.js → settings-section-DxqR9iml.js} +1 -1
- package/dist/client/assets/{shell-controls-6ZpSpxU3.js → shell-controls-DYq3DSuV.js} +1 -1
- package/dist/client/assets/{shell-layout-CGSn6NPr.js → shell-layout-DvMdeukx.js} +1 -1
- package/dist/client/assets/{sidebar-BjCGlNJL.js → sidebar-AfeWMY1r.js} +1 -1
- package/dist/client/assets/{skeleton-4wAys1SB.js → skeleton-DraYvTQP.js} +1 -1
- package/dist/client/assets/{sso-C8y4ysn5.js → sso-DWBNvY6X.js} +1 -1
- package/dist/client/assets/{store-EbX-J8BD.js → store-BFhYLhoT.js} +1 -1
- package/dist/client/assets/store-registry-C50_5LUp.js +2 -0
- package/dist/client/assets/{studio-tools-Dz5m3DDC.js → studio-tools-B3FHZXsQ.js} +1 -1
- package/dist/client/assets/{switch-BGTwAogo.js → switch-CyZjNvfZ.js} +1 -1
- package/dist/client/assets/{table-FWVzL2nm.js → table-iG6kCmeS.js} +1 -1
- package/dist/client/assets/{tabs-BovIXRni.js → tabs-C1LpzuaJ.js} +1 -1
- package/dist/client/assets/{textarea-B0BnrQRd.js → textarea-B8dhUfp9.js} +1 -1
- package/dist/client/assets/{toggle-group-DvzPCkJs.js → toggle-group-c5TjS6xS.js} +1 -1
- package/dist/client/assets/{toolbar-Dde3UP0K.js → toolbar-Daz4jqLs.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BGzii147.js → toolbar-icon-button-Bbbo7hyv.js} +1 -1
- package/dist/client/assets/{tooltip-CfmdP-aL.js → tooltip-DE_gqCm3.js} +1 -1
- package/dist/client/assets/{use-ai-providers-UWnZZKKY.js → use-ai-providers-CGzSWtp7.js} +1 -1
- package/dist/client/assets/{use-automations-URCauyn7.js → use-automations-Btiu7Z09.js} +1 -1
- package/dist/client/assets/{use-autosave-BjhwOY2t.js → use-autosave-DphOvxb9.js} +1 -1
- package/dist/client/assets/{use-capability-B2RpFGXs.js → use-capability-BNcFOggs.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CI9n9Iqh.js → use-clock-tick-Dw7sAB29.js} +1 -1
- package/dist/client/assets/{use-collections-CI5XorIY.js → use-collections-u5tkBX1a.js} +1 -1
- package/dist/client/assets/{use-connection-BlWYloF8.js → use-connection-CcmTBTY-.js} +1 -1
- package/dist/client/assets/{use-copy-CCSClSvL.js → use-copy-CveeH2p4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D97QNssr.js → use-create-virtual-mcp-jvSmQNTU.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DbO1S1EK.js → use-debounced-autosave-DFle-8Sb.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DuzsGBjb.js → use-debounced-value-D1xFGN32.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Bov6Ef1l.js → use-deco-credits-CV7sw9Em.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CqSDZlRU.js → use-decopilot-events-VInARyiN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B_AyED2-.js → use-delete-connection-DDV7XY4a.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CSBPrawc.js → use-deployment-admin-h9tth1Ey.js} +1 -1
- package/dist/client/assets/{use-file-configs-BsBJamST.js → use-file-configs-BEHJ-b8Q.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cylb4hyl.js → use-infinite-scroll-BI8YTyTt.js} +1 -1
- package/dist/client/assets/{use-join-requests-Cy4mJo9l.js → use-join-requests-V5rMqfIc.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D-mrOgSF.js → use-mcp-auth-status-DINFEYgi.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DXFWWHbs.js → use-mcp-client-PcphUWIj.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-ePfAnuof.js → use-mcp-tools-CakNulXp.js} +1 -1
- package/dist/client/assets/{use-members-C1OZBryu.js → use-members-JooO5O_z.js} +1 -1
- package/dist/client/assets/{use-mobile-CEVETdVq.js → use-mobile-C57pT7o9.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CflMFlHw.js → use-navigate-to-agent-DVHUkqpb.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFFpNQiA.js → use-org-auth-client-C0qPMRhc.js} +1 -1
- package/dist/client/assets/{use-org-sso-QrZAqFtN.js → use-org-sso-BaYh30WC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CYJSylgX.js → use-organization-roles-BG6jMK7e.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BpxUnud5.js → use-organization-settings-DBhnNnJm.js} +1 -1
- package/dist/client/assets/{use-registry-app-CkuNrX2M.js → use-registry-app-Dyfesgrg.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DWBXDDYI.js → use-registry-connections-CTtHQqlB.js} +1 -1
- package/dist/client/assets/{use-secrets-C8ssS7Ik.js → use-secrets-BYzFSfMf.js} +1 -1
- package/dist/client/assets/{use-status-sounds-2UIUBUS4.js → use-status-sounds-DJxvpKl9.js} +1 -1
- package/dist/client/assets/{use-t-BKpqHjpb.js → use-t-BeHordU2.js} +1 -1
- package/dist/client/assets/{use-view-mode-BEQ3VoIc.js → use-view-mode-C0yNdLzJ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D9jFTGjm.js → use-virtual-mcp-BtFe5DoR.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-mNPfD3Pk.js +1 -0
- package/dist/client/assets/{useRouterState-d9mo2HNv.js → useRouterState-C6jzqArr.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DIVSilzv.js +1 -0
- package/dist/client/assets/{users-B6WaBMxE.js → users-C0dY9LVq.js} +1 -1
- package/dist/client/assets/{variant-calendar-D4S-Oofs.js → variant-calendar-FpbApEV2.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CQ-IPomp.js → view-mode-toggle-DwdmtuKb.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-Bu0jJfTp.js +0 -1
- package/dist/client/assets/agent-icon-CMi9hXve.js +0 -1
- package/dist/client/assets/category-editor-DZf03BWu.js +0 -1
- package/dist/client/assets/collection-detail-BCNd0Ifz.js +0 -1
- package/dist/client/assets/index-D_TDrkT8.js +0 -519
- package/dist/client/assets/page-seo-sheet-DB06C8Zh.js +0 -1
- package/dist/client/assets/post-editor-Cf2q6koS.js +0 -1
- package/dist/client/assets/project-app-view-CInCPGOf.js +0 -1
- package/dist/client/assets/record-editor-C1rBRosQ.js +0 -1
- package/dist/client/assets/redirect-editor-DH3saw4e.js +0 -1
- package/dist/client/assets/registry-BIMV2dS4.js +0 -2
- package/dist/client/assets/sections-editor-BCCsHWJ1.js +0 -2
- package/dist/client/assets/store-registry-C4UWjh6m.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DvViU0Gq.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-COT_NVJE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ie,j as s,B as J,C as ce,n as fe,a as he,r as K,m as ge,K as ee,d as xe,p as $,t as te,l as je}from"./index-QeeIyPD-.js";import{d as Y,c as de,a as se,D as oe}from"./dropdown-menu-CCf9b-Ue.js";import{a as be}from"./Users03-DQDFsIZA.js";import{G as me}from"./use-registry-app-CkuNrX2M.js";import{u as Ce,b as ye,c as we}from"./use-virtual-mcp-D9jFTGjm.js";import{P as X}from"./index-F-zmfSqw.js";import{i as _e}from"./DotsVertical-4fMK5hdE.js";import{a as Ne,b as Se}from"./Settings02-Kn3GUgY3.js";import{s as ve}from"./Trash01-Dgm4FHaX.js";import{A as Ie,aJ as De}from"./agent-icon-CMi9hXve.js";import{c as ue}from"./use-navigate-to-agent-CflMFlHw.js";import{C as Ae}from"./card-BZY4DqkC.js";import{f as ne}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Ee}from"./use-capability-B2RpFGXs.js";import{E as Te}from"./empty-state-uOmVY7AV.js";import{u as ke}from"./use-create-virtual-mcp-D97QNssr.js";import{u as Ge}from"./use-connection-BlWYloF8.js";import{u as re,S as Le}from"./use-mcp-client-DXFWWHbs.js";import{u as Oe,G as Pe}from"./github-repo-picker-DWdab-4Y.js";import{g as ze}from"./github-repo-scope-DjMZbiKa.js";import{f as Me,a as $e,p as He}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{e as Fe,d as Re,D as Ue,a as Be,c as Ve}from"./dialog-B_MtszrV.js";import{C as Ke}from"./collection-search-B4ji9AjC.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-9jx8jzEO.js";import{S as tt}from"./search-input-UOEApV9M.js";import{s as le}from"./Plus-BhgoGeba.js";import"./ChevronUp-Bu3KYaYp.js";import"./ChevronRight-DQFD5vOs.js";import"./use-mcp-tools-ePfAnuof.js";import"./use-collections-CI5XorIY.js";import"./sidebar-BjCGlNJL.js";import"./LayoutLeft-DgCOjEX2.js";import"./use-mobile-CEVETdVq.js";import"./X-BJznV24Z.js";import"./tooltip-CfmdP-aL.js";import"./AlertCircle-BtNVN6lT.js";import"./Tool01-DoTp9Ymb.js";import"./ArrowUp-SfmKmvG1.js";import"./Tool02-f6hCEEx5.js";import"./XCircle-Mn7Ozb-Q.js";import"./ArrowUpRight-DPmhEMyl.js";import"./TrendUp01-DdLolkHU.js";import"./ZapSquare-Chem9D1s.js";import"./ZoomOut-znim4joS.js";import"./CheckCircle-Dqg_7udX.js";import"./ChevronDown-CtpYRw0N.js";import"./Stars02-ByALJtc-.js";import"./Copy01-B4AQ9voq.js";import"./Globe01-BEuNOgWE.js";import"./Eye-7UpR5EsV.js";import"./FilterLines-jo0eHglf.js";import"./Star01-UbWAuLRP.js";import"./Globe04-ezZLp1FH.js";import"./SwitchHorizontal01-B2hcs1rw.js";import"./HardDrive-Bx0yMIUr.js";import"./Image01-BemfbeRy.js";import"./Key01-wlopeCn8.js";import"./LinkExternal01-DjHN0DVc.js";import"./Monitor01-CvVGHJ2u.js";import"./Sun-ERdj2Ruh.js";import"./Package-Dkg7P-qU.js";import"./Palette-DnEGtR5r.js";import"./Play-pFWdRfmo.js";import"./SearchLg-D7iDyCtR.js";import"./SearchMd-DU7sZsGX.js";import"./Shield01-BF7nZR91.js";import"./Stars01-CKHcD24W.js";import"./Upload01-DPgiWRF2.js";import"./User01-4oxhkWpc.js";import"./Users01-CbDWoQDz.js";import"./XClose-BYGQndp2.js";import"./Zap-SMAt3bB0.js";import"./hooks-CQZHp8Dt.js";import"./decopilot-sse-pool-us-M5mS8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./auth-wA89jw5z.js";import"./use-debounced-value-DuzsGBjb.js";import"./authenticate-and-persist-oauth-CO2Dkq5Q.js";import"./mcp-oauth-C_zNkYXB.js";import"./extract-connection-data-B1PMDhhA.js";function ae(t){const e=ie.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:l,isCreating:b,align:C,side:d,showBetaBadge:g}=t,y=C===void 0?"end":C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==b||e[2]!==i?(m=s.jsxs(Y,{disabled:b,onClick:i,children:[x,"Create from scratch"]}),e[1]=b,e[2]=i,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{className:"size-3.5"}),e[4]=f):f=e[4];let a;e[5]!==g?(a=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=a):a=e[6];let h;e[7]!==n||e[8]!==a?(h=s.jsxs(Y,{onClick:n,children:[f,"Import from GitHub",a]}),e[7]=n,e[8]=a,e[9]=h):h=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=c):c=e[10];let r;e[11]!==l?(r=s.jsxs(Y,{onClick:l,children:[c,"Import from deco.cx"]}),e[11]=l,e[12]=r):r=e[12];let u;return e[13]!==y||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==r?(u=s.jsxs(de,{side:d,align:y,className:"w-48",children:[m,h,r]}),e[13]=y,e[14]=d,e[15]=m,e[16]=h,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:i,lastUsedAt:n,onDeleteClick:l}=t,b=ue();let C;e[0]!==b||e[1]!==i.id?(C=()=>b(i.id),e[0]=b,e[1]=i.id,e[2]=C):C=e[2];let d;e[3]!==i.title||e[4]!==C?(d=s.jsx("button",{type:"button",onClick:C,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=C,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ie,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(_e,{size:20})})}),e[9]=y):y=e[9];let x;e[10]!==b||e[11]!==i.id?(x=()=>b(i.id,{search:{main:"settings"}}),e[10]=b,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ne,{size:16}),e[13]=m):m=e[13];let f;e[14]!==x?(f=s.jsxs(Y,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=f):f=e[15];let a;e[16]!==l?(a=l&&s.jsxs(Y,{variant:"destructive",onClick:G=>{G.stopPropagation(),l(G)},children:[s.jsx(ve,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let h;e[18]!==f||e[19]!==a?(h=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(oe,{children:[y,s.jsxs(de,{align:"end",children:[f,a]})]})}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==g||e[22]!==h?(c=s.jsxs("div",{className:"flex items-start justify-between",children:[g,h]}),e[21]=g,e[22]=h,e[23]=c):c=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let w;e[31]!==c||e[32]!==D?(w=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,D]}),e[31]=c,e[32]=D,e[33]=w):w=e[33];let E;e[34]!==n||e[35]!==i.updated_at?(E=n?`Last used ${ne(new Date(n),{addSuffix:!0})}`:`Updated ${ne(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=E):E=e[36];let N;e[37]!==E?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})})}),e[37]=E,e[38]=N):N=e[38];let T;e[39]!==w||e[40]!==N?(T=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[w,N]}),e[39]=w,e[40]=N,e[41]=T):T=e[41];let S;return e[42]!==T||e[43]!==d?(S=s.jsxs(Ae,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,T]}),e[42]=T,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,l=i?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function pe(t,e,i){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${i} (${n.status})`);return l}function lt(t){return pe(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=ce(),l=ue(),b=fe(),{data:C}=he.useSession(),[d,g]=K.useState(null),[y,x]=K.useState(null),[m,f]=K.useState(""),a=re({connectionId:Le,orgId:n.id,orgSlug:n.slug}),h=Ge({slug:"mcp-github"}),c=ze(h),r=Oe({enabled:t&&c.length===0}),u=c.length===1?c[0]??null:y,I=c.length>1&&!u,D=re({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:E,isLoading:N,error:T}=ge({queryKey:ee.decoSites(C?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=E?.sites??[],G=o=>{o||(g(null),x(null),f("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),L=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:k,appSlug:v}=await Me(_=>a.callTool(_),u.id),A=S.find(_=>_.name===o);if(!A)throw new Error("Selected site is no longer available");const j=nt(o,A.metadata),z=$e(k,j.owner);if(!z){const _=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${_}`)}let V=null,U=null,B=null;const W=async()=>{B&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:B}}).catch(()=>{}),U&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:U,force:!0}}).catch(()=>{}),V&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const _=await pe(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})},"Failed to create connection"),O=_.connId;if(!O)throw new Error("Server did not return a connection ID");V=O;const{childConnectionId:M}=await He({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:Z=>D.callTool(Z),selfCallTool:Z=>a.callTool(Z)});U=M;const H=_.icon??null,F=rt(o),q=o.toLowerCase(),p=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:q,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:F,pinnedViews:[{connectionId:O,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:O,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:O},{connection_id:M}]}}}),Q=p.structuredContent??p;if(!Q.item?.id)throw new Error("Failed to create the imported agent");return B=Q.item.id,{slug:F,virtualMcpId:Q.item.id,connId:O,item:Q.item}}catch(_){throw await W(),_}},onSuccess:({slug:o,virtualMcpId:k,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:k,slug:o}),b.setQueryData(ee.collectionItem(a,n.id,"","VIRTUAL_MCP",k),{item:v}),b.invalidateQueries({predicate:A=>{const j=A.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),b.invalidateQueries({queryKey:ee.projects(n.id)}),te.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(k)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),te.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Fe,{open:t,onOpenChange:G,children:s.jsxs(Re,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Se,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:f,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&f("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(J,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!w&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),c.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(me,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!w&&!I&&r.status!=="error"&&!T&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!w&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const k=o.domains?.find(A=>A.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),k&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:k})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(J,{variant:"outline",onClick:()=>G(!1),disabled:L.isPending,children:"Cancel"}),s.jsx(J,{disabled:!d||!R||L.isPending||N||w||I||!u||r.status==="error",onClick:()=>d&&L.mutate(d),children:L.isPending?"Importing...":"Import"})]})]})})}function $s(){const t=ie.c(46),{org:e}=ce(),i=Ce(),n=ye(),[l,b]=K.useState("");let C;t[0]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},t[0]=C):C=t[0];const{createVirtualMCP:d,isCreating:g}=ke(C),[y,x]=K.useState(null),[m,f]=K.useState(!1),[a,h]=K.useState(!1),{granted:c}=Ee("agents:manage"),r=l.toLowerCase(),u=i.filter(p=>p.id!==e.id&&(p.title.toLowerCase().includes(r)||p.description?.toLowerCase().includes(r))),{data:I}=we(u.map(ct));let D;t[1]!==n||t[2]!==y?(D=async()=>{if(!y)return;const{id:p,title:Q}=y;x(null);try{await n.delete.mutateAsync(p),$("agent_deleted",{agent_id:p,source:"agents_list"}),te.success(`Deleted "${Q}"`)}catch{}},t[1]=n,t[2]=y,t[3]=D):D=t[3];const w=D,E=X,N=X,T=X;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(X.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=p=>{p.key==="Escape"&&(b(""),p.target.blur())},t[5]=G):G=t[5];let P;t[6]!==l?(P=s.jsx(tt,{value:l,onChange:b,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=l,t[7]=P):P=t[7];let R;t[8]!==c||t[9]!==d||t[10]!==g?(R=c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),f(!0)},isCreating:g,align:"end"})]}),t[8]=c,t[9]=d,t[10]=g,t[11]=R):R=t[11];let L;t[12]!==P||t[13]!==R?(L=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=L):L=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(De,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),f(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),k=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(p=>s.jsx(st,{project:p,lastUsedAt:I?.get(p.id)?.last_used_at,onDeleteClick:c?()=>x({id:p.id,title:p.title}):void 0},p.id))})]});let v;t[15]!==k||t[16]!==T.Body||t[17]!==L||t[18]!==o?(v=s.jsxs(T.Body,{children:[L,o,k]}),t[15]=k,t[16]=T.Body,t[17]=L,t[18]=o,t[19]=v):v=t[19];let A;t[20]!==v||t[21]!==N.Content?(A=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=A):A=t[22];let j;t[23]!==a?(j=s.jsx(Pe,{open:a,onOpenChange:h}),t[23]=a,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:f}),t[25]=m,t[26]=z):z=t[26];const V=!!y;let U;t[27]===Symbol.for("react.memo_cache_sentinel")?(U=p=>!p&&x(null),t[27]=U):U=t[27];let B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(qe,{children:"Delete Agent?"}),t[28]=B):B=t[28];const W=y?.title;let _;t[29]!==W?(_=s.jsxs(Qe,{children:[B,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),t[29]=W,t[30]=_):_=t[30];let O;t[31]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(We,{children:"Cancel"}),t[31]=O):O=t[31];let M;t[32]!==w?(M=s.jsxs(Ye,{children:[O,s.jsx(Xe,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=w,t[33]=M):M=t[33];let H;t[34]!==_||t[35]!==M?(H=s.jsxs(Ze,{children:[_,M]}),t[34]=_,t[35]=M,t[36]=H):H=t[36];let F;t[37]!==V||t[38]!==H?(F=s.jsx(et,{open:V,onOpenChange:U,children:H}),t[37]=V,t[38]=H,t[39]=F):F=t[39];let q;return t[40]!==E||t[41]!==A||t[42]!==j||t[43]!==z||t[44]!==F?(q=s.jsxs(E,{children:[A,j,z,F]}),t[40]=E,t[41]=A,t[42]=j,t[43]=z,t[44]=F,t[45]=q):q=t[45],q}function ct(t){return t.id}export{$s as default};
|
|
1
|
+
import{c as ie,j as s,B as J,C as ce,n as fe,a as he,r as K,m as ge,K as ee,d as xe,p as $,t as te,l as je}from"./index-C8rlFaFO.js";import{d as Y,c as de,a as se,D as oe}from"./dropdown-menu-B7HOgSu8.js";import{a as be}from"./Users03-3HXi1aia.js";import{G as me}from"./use-registry-app-Dyfesgrg.js";import{u as Ce,b as ye,c as we}from"./use-virtual-mcp-BtFe5DoR.js";import{P as X}from"./index-Bj_MaVUP.js";import{i as _e}from"./DotsVertical-Bcfqjiks.js";import{a as Ne,b as Se}from"./Settings02-CU2rilKq.js";import{s as ve}from"./Trash01-DxXosbkh.js";import{A as Ie,aK as De}from"./agent-icon-BIj6WxKp.js";import{c as ue}from"./use-navigate-to-agent-DVHUkqpb.js";import{C as Ae}from"./card-CoG27DVs.js";import{f as ne}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Ee}from"./use-capability-BNcFOggs.js";import{E as Te}from"./empty-state-kSEyPCAz.js";import{u as ke}from"./use-create-virtual-mcp-jvSmQNTU.js";import{u as Ge}from"./use-connection-CcmTBTY-.js";import{u as re,S as Le}from"./use-mcp-client-PcphUWIj.js";import{u as Oe,G as Pe}from"./github-repo-picker-4TIPzYjR.js";import{g as ze}from"./github-repo-scope-DjMZbiKa.js";import{f as Me,a as $e,p as He}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{e as Fe,d as Re,D as Ue,a as Be,c as Ve}from"./dialog-ChJw5xnr.js";import{C as Ke}from"./collection-search-DuPY-s4R.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-D2oa47X8.js";import{S as tt}from"./search-input-B6akQV4Y.js";import{s as le}from"./Plus-5VWQJEkS.js";import"./ChevronUp-Ci-XiWb6.js";import"./ChevronRight-BnIvJcIZ.js";import"./use-mcp-tools-CakNulXp.js";import"./use-collections-u5tkBX1a.js";import"./sidebar-AfeWMY1r.js";import"./LayoutLeft-COV7zlIC.js";import"./use-mobile-C57pT7o9.js";import"./X-CLG08ht8.js";import"./tooltip-DE_gqCm3.js";import"./AlertCircle-Cvc_10Uv.js";import"./Tool01-DBXzU6aR.js";import"./ArrowUp-Dq6JgHsq.js";import"./Tool02-rl8XhSPG.js";import"./XCircle-pZ6nD22L.js";import"./ArrowUpRight-DgI9ki5h.js";import"./TrendUp01-BmzCTIbp.js";import"./ZapSquare-DdKvM81Z.js";import"./ZoomOut-DAAhtu2Z.js";import"./CheckCircle-B5oIKeSF.js";import"./ChevronDown-D_W2bIqv.js";import"./Stars02-CdgckoDr.js";import"./Copy01-Q4xZmPKp.js";import"./Globe01-qjaQZUfN.js";import"./Eye-BuukW7MV.js";import"./FilterLines-Do4UgzmV.js";import"./Star01-D4LxiizA.js";import"./Globe04-CqIGMVDi.js";import"./SwitchHorizontal01-DNcPUv7P.js";import"./HardDrive-DrLvUMYg.js";import"./Image01-BWotytID.js";import"./Key01-BPZUhUcV.js";import"./LinkExternal01-CyMOdGfe.js";import"./Monitor01-dLHbd0CB.js";import"./Sun-Ca3eslhz.js";import"./Package-B7Qii2Tl.js";import"./Palette-tVNOj7Ym.js";import"./Play-BE8nTtBp.js";import"./SearchLg-BiyFAMx0.js";import"./SearchMd-LbMkvaPD.js";import"./Shield01-7KT2UKvg.js";import"./Stars01-HAbkffzq.js";import"./Upload01-CXsTipbe.js";import"./User01-CZgThaZQ.js";import"./Users01-IdyAszrF.js";import"./XClose-BYq2BBpT.js";import"./Zap-C6tkfs5m.js";import"./hooks-CJqrF4BQ.js";import"./decopilot-sse-pool-DEJZ4gJu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./auth-Kymy4xkz.js";import"./use-debounced-value-D1xFGN32.js";import"./authenticate-and-persist-oauth-DAAmwSgR.js";import"./mcp-oauth-B2KaqQoI.js";import"./extract-connection-data-oUFnwuwD.js";function ae(t){const e=ie.c(19),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:l,isCreating:b,align:C,side:d,showBetaBadge:g}=t,y=C===void 0?"end":C;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==b||e[2]!==i?(m=s.jsxs(Y,{disabled:b,onClick:i,children:[x,"Create from scratch"]}),e[1]=b,e[2]=i,e[3]=m):m=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(me,{className:"size-3.5"}),e[4]=f):f=e[4];let a;e[5]!==g?(a=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=a):a=e[6];let h;e[7]!==n||e[8]!==a?(h=s.jsxs(Y,{onClick:n,children:[f,"Import from GitHub",a]}),e[7]=n,e[8]=a,e[9]=h):h=e[9];let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=c):c=e[10];let r;e[11]!==l?(r=s.jsxs(Y,{onClick:l,children:[c,"Import from deco.cx"]}),e[11]=l,e[12]=r):r=e[12];let u;return e[13]!==y||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==r?(u=s.jsxs(de,{side:d,align:y,className:"w-48",children:[m,h,r]}),e[13]=y,e[14]=d,e[15]=m,e[16]=h,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:i,lastUsedAt:n,onDeleteClick:l}=t,b=ue();let C;e[0]!==b||e[1]!==i.id?(C=()=>b(i.id),e[0]=b,e[1]=i.id,e[2]=C):C=e[2];let d;e[3]!==i.title||e[4]!==C?(d=s.jsx("button",{type:"button",onClick:C,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=C,e[5]=d):d=e[5];let g;e[6]!==i.icon||e[7]!==i.title?(g=s.jsx(Ie,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=g):g=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(se,{asChild:!0,children:s.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(_e,{size:20})})}),e[9]=y):y=e[9];let x;e[10]!==b||e[11]!==i.id?(x=()=>b(i.id,{search:{main:"settings"}}),e[10]=b,e[11]=i.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ne,{size:16}),e[13]=m):m=e[13];let f;e[14]!==x?(f=s.jsxs(Y,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=f):f=e[15];let a;e[16]!==l?(a=l&&s.jsxs(Y,{variant:"destructive",onClick:G=>{G.stopPropagation(),l(G)},children:[s.jsx(ve,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let h;e[18]!==f||e[19]!==a?(h=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(oe,{children:[y,s.jsxs(de,{align:"end",children:[f,a]})]})}),e[18]=f,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==g||e[22]!==h?(c=s.jsxs("div",{className:"flex items-start justify-between",children:[g,h]}),e[21]=g,e[22]=h,e[23]=c):c=e[23];let r;e[24]!==i.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=r):r=e[25];const u=i.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let w;e[31]!==c||e[32]!==D?(w=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,D]}),e[31]=c,e[32]=D,e[33]=w):w=e[33];let E;e[34]!==n||e[35]!==i.updated_at?(E=n?`Last used ${ne(new Date(n),{addSuffix:!0})}`:`Updated ${ne(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=n,e[35]=i.updated_at,e[36]=E):E=e[36];let N;e[37]!==E?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})})}),e[37]=E,e[38]=N):N=e[38];let T;e[39]!==w||e[40]!==N?(T=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[w,N]}),e[39]=w,e[40]=N,e[41]=T):T=e[41];let S;return e[42]!==T||e[43]!==d?(S=s.jsxs(Ae,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,T]}),e[42]=T,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function it(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const i=e.owner,n=e.repo;return typeof i!="string"||typeof n!="string"||i.length===0||n.length===0?null:{owner:i,repo:n}}function nt(t,e){const i=e?it(e):null,n=i?.owner??ot,l=i?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function pe(t,e,i){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${i} (${n.status})`);return l}function lt(t){return pe(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function at({open:t,onOpenChange:e,onBack:i}){const{org:n}=ce(),l=ue(),b=fe(),{data:C}=he.useSession(),[d,g]=K.useState(null),[y,x]=K.useState(null),[m,f]=K.useState(""),a=re({connectionId:Le,orgId:n.id,orgSlug:n.slug}),h=Ge({slug:"mcp-github"}),c=ze(h),r=Oe({enabled:t&&c.length===0}),u=c.length===1?c[0]??null:y,I=c.length>1&&!u,D=re({connectionId:u?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:E,isLoading:N,error:T}=ge({queryKey:ee.decoSites(C?.user?.email),queryFn:()=>lt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=E?.sites??[],G=o=>{o||(g(null),x(null),f("")),e(o)},P=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||P.some(o=>o.name===d),L=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:k,appSlug:v}=await Me(_=>a.callTool(_),u.id),A=S.find(_=>_.name===o);if(!A)throw new Error("Selected site is no longer available");const j=nt(o,A.metadata),z=$e(k,j.owner);if(!z){const _=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${_}`)}let V=null,U=null,B=null;const W=async()=>{B&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:B}}).catch(()=>{}),U&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:U,force:!0}}).catch(()=>{}),V&&await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const _=await pe(`/api/${n.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})},"Failed to create connection"),O=_.connId;if(!O)throw new Error("Server did not return a connection ID");V=O;const{childConnectionId:M}=await He({orgSlug:n.slug,sourceConnection:u,installationId:z.installationId,owner:j.owner,repo:j.name,githubCallTool:Z=>D.callTool(Z),selfCallTool:Z=>a.callTool(Z)});U=M;const H=_.icon??null,F=rt(o),q=o.toLowerCase(),p=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:q,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:z.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:F,pinnedViews:[{connectionId:O,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:O,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:O},{connection_id:M}]}}}),Q=p.structuredContent??p;if(!Q.item?.id)throw new Error("Failed to create the imported agent");return B=Q.item.id,{slug:F,virtualMcpId:Q.item.id,connId:O,item:Q.item}}catch(_){throw await W(),_}},onSuccess:({slug:o,virtualMcpId:k,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:k,slug:o}),b.setQueryData(ee.collectionItem(a,n.id,"","VIRTUAL_MCP",k),{item:v}),b.invalidateQueries({predicate:A=>{const j=A.queryKey;return j[1]===n.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),b.invalidateQueries({queryKey:ee.projects(n.id)}),te.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),l(k)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),te.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Fe,{open:t,onOpenChange:G,children:s.jsxs(Re,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Se,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:f,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&f("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(J,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!w&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),c.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(me,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!w&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!w&&!I&&r.status!=="error"&&!T&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!w&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[P.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),P.map(o=>{const k=o.domains?.find(A=>A.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),k&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:k})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(J,{variant:"outline",onClick:()=>G(!1),disabled:L.isPending,children:"Cancel"}),s.jsx(J,{disabled:!d||!R||L.isPending||N||w||I||!u||r.status==="error",onClick:()=>d&&L.mutate(d),children:L.isPending?"Importing...":"Import"})]})]})})}function $s(){const t=ie.c(46),{org:e}=ce(),i=Ce(),n=ye(),[l,b]=K.useState("");let C;t[0]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},t[0]=C):C=t[0];const{createVirtualMCP:d,isCreating:g}=ke(C),[y,x]=K.useState(null),[m,f]=K.useState(!1),[a,h]=K.useState(!1),{granted:c}=Ee("agents:manage"),r=l.toLowerCase(),u=i.filter(p=>p.id!==e.id&&(p.title.toLowerCase().includes(r)||p.description?.toLowerCase().includes(r))),{data:I}=we(u.map(ct));let D;t[1]!==n||t[2]!==y?(D=async()=>{if(!y)return;const{id:p,title:Q}=y;x(null);try{await n.delete.mutateAsync(p),$("agent_deleted",{agent_id:p,source:"agents_list"}),te.success(`Deleted "${Q}"`)}catch{}},t[1]=n,t[2]=y,t[3]=D):D=t[3];const w=D,E=X,N=X,T=X;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(X.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=p=>{p.key==="Escape"&&(b(""),p.target.blur())},t[5]=G):G=t[5];let P;t[6]!==l?(P=s.jsx(tt,{value:l,onChange:b,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=l,t[7]=P):P=t[7];let R;t[8]!==c||t[9]!==d||t[10]!==g?(R=c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),f(!0)},isCreating:g,align:"end"})]}),t[8]=c,t[9]=d,t[10]=g,t[11]=R):R=t[11];let L;t[12]!==P||t[13]!==R?(L=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[P,R]})]}),t[12]=P,t[13]=R,t[14]=L):L=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(De,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(oe,{children:[s.jsx(se,{asChild:!0,children:s.jsxs(J,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),h(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),f(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),k=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(p=>s.jsx(st,{project:p,lastUsedAt:I?.get(p.id)?.last_used_at,onDeleteClick:c?()=>x({id:p.id,title:p.title}):void 0},p.id))})]});let v;t[15]!==k||t[16]!==T.Body||t[17]!==L||t[18]!==o?(v=s.jsxs(T.Body,{children:[L,o,k]}),t[15]=k,t[16]=T.Body,t[17]=L,t[18]=o,t[19]=v):v=t[19];let A;t[20]!==v||t[21]!==N.Content?(A=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=A):A=t[22];let j;t[23]!==a?(j=s.jsx(Pe,{open:a,onOpenChange:h}),t[23]=a,t[24]=j):j=t[24];let z;t[25]!==m?(z=s.jsx(at,{open:m,onOpenChange:f}),t[25]=m,t[26]=z):z=t[26];const V=!!y;let U;t[27]===Symbol.for("react.memo_cache_sentinel")?(U=p=>!p&&x(null),t[27]=U):U=t[27];let B;t[28]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(qe,{children:"Delete Agent?"}),t[28]=B):B=t[28];const W=y?.title;let _;t[29]!==W?(_=s.jsxs(Qe,{children:[B,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),t[29]=W,t[30]=_):_=t[30];let O;t[31]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(We,{children:"Cancel"}),t[31]=O):O=t[31];let M;t[32]!==w?(M=s.jsxs(Ye,{children:[O,s.jsx(Xe,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=w,t[33]=M):M=t[33];let H;t[34]!==_||t[35]!==M?(H=s.jsxs(Ze,{children:[_,M]}),t[34]=_,t[35]=M,t[36]=H):H=t[36];let F;t[37]!==V||t[38]!==H?(F=s.jsx(et,{open:V,onOpenChange:U,children:H}),t[37]=V,t[38]=H,t[39]=F):F=t[39];let q;return t[40]!==E||t[41]!==A||t[42]!==j||t[43]!==z||t[44]!==F?(q=s.jsxs(E,{children:[A,j,z,F]}),t[40]=E,t[41]=A,t[42]=j,t[43]=z,t[44]=F,t[45]=q):q=t[45],q}function ct(t){return t.id}export{$s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as se,I as D,ad as Ae,af as we,ag as Ue,ae as He,b3 as Fe,c as X,J as qe,M as ze,r as J,j as s,ah as rt,t as re,aL as Be,C as Ie,n as De,d as je,K as ie,m as Le,l as Te,B as te,p as Ve,E as ot}from"./index-QeeIyPD-.js";import{i as nt}from"./AlertCircle-BtNVN6lT.js";import{P as ke}from"./index-F-zmfSqw.js";import{S as Me}from"./skeleton-4wAys1SB.js";import{b as Qe,a as Ee,S as Re,c as at}from"./settings-section--wnksRdd.js";import{u as Se,a as Pe,b as Ge}from"./use-ai-providers-UWnZZKKY.js";import{i as ct}from"./CheckCircle-Dqg_7udX.js";import{n as dt,o as mt,q as ft,S as ut}from"./chat-context-8zti4wkh.js";import{e as pt,f as gt}from"./use-organization-settings-BpxUnud5.js";import{M as ht,b as Ye,P as xt,C as $e}from"./select-model-FeZ2YvBx.js";import{u as bt}from"./use-debounced-autosave-DbO1S1EK.js";import{u as oe}from"./use-t-BKpqHjpb.js";import{I as Ne}from"./input-ksjqlSwm.js";import{T as Oe,a as vt}from"./toggle-group-DvzPCkJs.js";import{c as We,d as Je,b as Xe,A as Ze,g as et,e as tt,a as st,f as it}from"./alert-dialog-9jx8jzEO.js";import{u as ye}from"./studio-tools-Dz5m3DDC.js";import{s as yt}from"./Plus-BhgoGeba.js";import{b as jt}from"./Tool01-DoTp9Ymb.js";import{s as St}from"./Trash01-Dgm4FHaX.js";import{A as _t}from"./avatar-D2faXu9B.js";import{i as Ct}from"./Settings02-Kn3GUgY3.js";import{s as kt}from"./Eye-7UpR5EsV.js";import{a as Pt,D as Nt,d as It,e as Dt,c as Kt}from"./dialog-B_MtszrV.js";import{f as wt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as At}from"./require-capability-BMCPfqFj.js";import"./sidebar-BjCGlNJL.js";import"./LayoutLeft-DgCOjEX2.js";import"./use-mobile-CEVETdVq.js";import"./X-BJznV24Z.js";import"./tooltip-CfmdP-aL.js";import"./card-BZY4DqkC.js";import"./ArrowUpRight-DPmhEMyl.js";import"./autosend-DFAdUSMh.js";import"./hooks-CQZHp8Dt.js";import"./use-mcp-client-DXFWWHbs.js";import"./auth-wA89jw5z.js";import"./decopilot-sse-pool-us-M5mS8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-D9jFTGjm.js";import"./use-collections-CI5XorIY.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-CqSDZlRU.js";import"./drawer-BsQ2VY2t.js";import"./checkbox-DvRekaoI.js";import"./ChevronUp-Bu3KYaYp.js";import"./select-BK6Fwx47.js";import"./ChevronDown-CtpYRw0N.js";import"./Key01-wlopeCn8.js";import"./SearchMd-DU7sZsGX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CvVGHJ2u.js";import"./ChevronRight-DQFD5vOs.js";import"./connect-desktop-dialog-ekgjUng_.js";import"./Copy01-B4AQ9voq.js";import"./Image01-BemfbeRy.js";import"./Stars01-CKHcD24W.js";import"./User01-4oxhkWpc.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-B2RpFGXs.js";import"./access-gate-CXUaT8Bg.js";import"./capability-load-error-D-GHd7kt.js";se({title:D(),url:D(),icon:D()});se({registries:we(D(),se({enabled:Ue()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const ve=se({keyId:D(),modelId:D(),title:D().optional()}).nullable();He(["fast","smart","thinking","image","web_search","deep_research"]);He(["fast","smart","thinking"]);const Mt=se({tiers:se({fast:ve,smart:ve,thinking:ve,image:ve,web_search:ve,deep_research:ve})});se({ids:Ae(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});se({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:se({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:se({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(we(D(),Fe())).nullable().optional().describe("Brand images"),metadata:we(D(),Fe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ue().optional().describe("Whether this is the default brand for the organization")});const Et=e=>e.capabilities?.includes("image")===!0,Rt=e=>dt(e),Ft=e=>mt(e),Tt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Et},{key:"web_search",filter:Rt},{key:"deep_research",filter:Ft}];function $t(e){const t=X.c(26),{slot:i,onSlotChange:r,filterModels:a,defaultKeyId:d}=e,n=Se(),[o,j]=J.useState(i?.keyId??d);let _;t[0]!==i?(_=()=>{i?.keyId&&j(i.keyId)},t[0]=i,t[1]=_):_=t[1];const S=i?.keyId;let l;t[2]!==S?(l=[S],t[2]=S,t[3]=l):l=t[3],J.useEffect(_,l);const c=o??d;let m;t[4]!==c||t[5]!==n?(m=c?n.find(x=>x.id===c):null,t[4]=c,t[5]=n,t[6]=m):m=t[6];const p=m,{models:f,isLoading:g}=Pe(a?c??void 0:void 0),k=a?g||f.some(a):!0;let h;t[7]!==i||t[8]!==p?.providerId?(h=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:p?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=p?.providerId,t[9]=h):h=t[9];const y=h,P=oe();if(a&&!k){let x;t[10]!==P?(x=P("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=P,t[11]=x):x=t[11];let K;return t[12]!==x?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:x}),t[12]=x,t[13]=K):K=t[13],K}let v;t[14]!==P?(v=P("settings.simpleModeSection.pickModel"),t[14]=P,t[15]=v):v=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=x=>j(x),t[16]=C):C=t[16];let u;t[17]!==c||t[18]!==r?(u=x=>{const K=x.keyId??c??"";j(K),r({keyId:K,modelId:x.modelId,title:x.title})},t[17]=c,t[18]=r,t[19]=u):u=t[19];let N;return t[20]!==c||t[21]!==a||t[22]!==y||t[23]!==v||t[24]!==u?(N=s.jsx(ht,{variant:"bordered",placeholder:v,model:y,credentialId:c,filterModels:a,onCredentialChange:C,onModelChange:u}),t[20]=c,t[21]=a,t[22]=y,t[23]=v,t[24]=u,t[25]=N):N=t[25],N}function Ot(e){const t=X.c(10),{isPending:i,showSaved:r}=e,a=oe();if(i){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=d):d=t[0];let n;t[1]!==a?(n=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=n):n=t[2];let o;return t[3]!==n?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d,n]}),t[3]=n,t[4]=o):o=t[4],o}if(r){let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ct,{size:12}),t[5]=d):d=t[5];let n;t[6]!==a?(n=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=n):n=t[7];let o;return t[8]!==n?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d,n]}),t[8]=n,t[9]=o):o=t[9],o}return null}function Ut(){const e=X.c(58),t=oe(),i=Se(),r=pt(),a=i.length>0;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=qe(Mt),e[0]=d):d=e[0];let n;e[1]!==r?(n={resolver:d,values:r,mode:"onChange"},e[1]=r,e[2]=n):n=e[2];const o=ze(n),{mutate:j,isPending:_,isSuccess:S}=gt(),l=o.formState.isDirty;let c;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==j?(c={delayMs:250,save:async()=>{const b=o.getValues();j(b,{onSuccess:()=>o.reset(b,{keepValues:!0}),onError:A=>{o.reset(r),re.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=j,e[7]=c):c=e[7];const{schedule:m}=bt(c),p=i[0],f=i[1],g=i[2],{models:k}=Pe(p?.id),{models:h}=Pe(f?.id),{models:y}=Pe(g?.id);let P,v;e[8]!==o||e[9]!==a?(P=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},v=[a,o],e[8]=o,e[9]=a,e[10]=P,e[11]=v):(P=e[10],v=e[11]),J.useEffect(P,v);let C;e[12]!==i||e[13]!==o||e[14]!==p||e[15]!==f||e[16]!==g||e[17]!==k||e[18]!==h||e[19]!==y?(C=()=>{const b=o.getValues(),A=new Set(i.map(Ht)),M={};p?.id&&(M[p.id]=k),f?.id&&(M[f.id]=h),g?.id&&(M[g.id]=y);const w=Q=>Q!=null&&!A.has(Q.keyId),I={fast:w(b.tiers.fast)?null:b.tiers.fast,smart:w(b.tiers.smart)?null:b.tiers.smart,thinking:w(b.tiers.thinking)?null:b.tiers.thinking,image:w(b.tiers.image)?null:b.tiers.image,web_search:w(b.tiers.web_search)?null:b.tiers.web_search,deep_research:w(b.tiers.deep_research)?null:b.tiers.deep_research},Y=!I.fast||!I.smart||!I.thinking||!I.image||!I.web_search||!I.deep_research,W=I.fast===b.tiers.fast&&I.smart===b.tiers.smart&&I.thinking===b.tiers.thinking&&I.image===b.tiers.image&&I.web_search===b.tiers.web_search&&I.deep_research===b.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);o.reset({tiers:{fast:I.fast??$.chat.fast,smart:I.smart??$.chat.smart,thinking:I.thinking??$.chat.thinking,image:I.image??$.image,web_search:I.web_search??$.webSearch,deep_research:I.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=p,e[15]=f,e[16]=g,e[17]=k,e[18]=h,e[19]=y,e[20]=C):C=e[20];const u=p?.id,N=f?.id,x=g?.id;let K;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==h||e[25]!==y||e[26]!==u||e[27]!==N||e[28]!==x?(K=[o,i,k,h,y,u,N,x],e[21]=i,e[22]=o,e[23]=k,e[24]=h,e[25]=y,e[26]=u,e[27]=N,e[28]=x,e[29]=K):K=e[29],J.useEffect(C,K);let V;e[30]!==t?(V=b=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[b]||b,e[30]=t,e[31]=V):V=e[31];const G=V;let O;e[32]!==t?(O=b=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[b]||"",e[32]=t,e[33]=O):O=e[33];const B=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let H;e[36]!==t?(H=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=H):H=e[37];let q;e[38]!==H?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:H}),e[38]=H,e[39]=q):q=e[39];const L=S&&!l;let E;e[40]!==_||e[41]!==L?(E=s.jsx(Ot,{isPending:_,showSaved:L}),e[40]=_,e[41]=L,e[42]=E):E=e[42];let R;e[43]!==q||e[44]!==E?(R=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,E]}),e[43]=q,e[44]=E,e[45]=R):R=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==B||e[49]!==G||e[50]!==m?(F=Tt.map(b=>s.jsx(rt,{control:o.control,name:`tiers.${b.key}`,render:A=>{const{field:M}=A;return s.jsx(Qe,{title:G(b.key),description:B(b.key),action:s.jsx($t,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:b.filter,onSlotChange:w=>{M.onChange(w),m()}})})}},b.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=B,e[49]=G,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Ee,{children:F}),e[52]=F,e[53]=T):T=e[53];let z;return e[54]!==U||e[55]!==R||e[56]!==T?(z=s.jsxs(Re,{title:U,headerClassName:"pl-0",children:[R,T]}),e[54]=U,e[55]=R,e[56]=T,e[57]=z):z=e[57],z}function Ht(e){return e.id}const qt={usd:[10,20,100],brl:[50,100,500]};function zt(){const e=X.c(30),t=oe(),i=ye(),[r,a]=J.useState(!1);let d;e[0]!==t?(d=u=>{re.error(t("settings.decoCreditsHero.topUpFailed",{message:u.message}))},e[0]=t,e[1]=d):d=e[1];const{mutate:n,isPending:o}=je({mutationFn:async u=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:u,currency:c});return N},onSuccess:Bt,onError:d}),[j,_]=J.useState(""),[S,l]=J.useState("usd"),c=S,m=parseFloat(j),p=!isNaN(m)&&m>=1,f=c==="brl"?"R$":"$";let g;e[2]!==l?(g=u=>{u&&l(u)},e[2]=l,e[3]=g):g=e[3];let k,h;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Oe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),h=s.jsx(Oe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=h):(k=e[4],h=e[5]);let y;e[6]!==c||e[7]!==g?(y=s.jsxs(vt,{type:"single",variant:"outline",size:"default",value:c,onValueChange:g,children:[k,h]}),e[6]=c,e[7]=g,e[8]=y):y=e[8];let P;e[9]!==c||e[10]!==f||e[11]!==r||e[12]!==o||e[13]!==t||e[14]!==n?(P=!r&&s.jsxs(s.Fragment,{children:[qt[c].map(u=>s.jsxs(te,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>n(u*100),children:[f,u]},u)),s.jsx(te,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=c,e[10]=f,e[11]=r,e[12]=o,e[13]=t,e[14]=n,e[15]=P):P=e[15];let v;e[16]!==f||e[17]!==j||e[18]!==m||e[19]!==r||e[20]!==p||e[21]!==o||e[22]!==_||e[23]!==t||e[24]!==n?(v=r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),s.jsx(Ne,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:j,onChange:u=>_(u.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(te,{className:"h-10",disabled:!p||o,onClick:()=>n(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(te,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),_("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=f,e[17]=j,e[18]=m,e[19]=r,e[20]=p,e[21]=o,e[22]=_,e[23]=t,e[24]=n,e[25]=v):v=e[25];let C;return e[26]!==y||e[27]!==P||e[28]!==v?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y,P,v]})}),e[26]=y,e[27]=P,e[28]=v,e[29]=C):C=e[29],C}function Bt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Lt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Vt(){const e=X.c(121),t=oe(),{org:i}=Ie(),r=ye(),a=De(),d=Se();let n;e[0]!==d?(n=d.find(Qt),e[0]=d,e[1]=n):n=e[1];const o=n,[j,_]=J.useState(!1);let S;e[2]!==o||e[3]!==r?(S=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=S):S=e[4];let l;e[5]!==i.id||e[6]!==a||e[7]!==t?(l=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:ie.aiProviders(i.id)}),re.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=a,e[7]=t,e[8]=l):l=e[8];let c;e[9]!==t?(c=lt=>{re.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=c):c=e[10];let m;e[11]!==S||e[12]!==l||e[13]!==c?(m={mutationFn:S,onSuccess:l,onError:c},e[11]=S,e[12]=l,e[13]=c,e[14]=m):m=e[14];const{mutate:p,isPending:f}=je(m);let g;e[15]!==i.id?(g=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let h;e[17]!==r?(h=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=h):h=e[18];let y;e[19]!==g||e[20]!==k||e[21]!==h?(y={queryKey:g,enabled:k,staleTime:6e4,queryFn:h},e[19]=g,e[20]=k,e[21]=h,e[22]=y):y=e[22];const{data:P,isLoading:v,refetch:C,isFetching:u}=Le(y);if(!o)return null;const N=P?.balanceCents!=null?P.balanceCents/100:null;let x;e[23]!==N?(x=N!=null?`$${N.toFixed(2)}`:"—",e[23]=N,e[24]=x):x=e[24];const K=x;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let G;e[27]!==t?(G=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=G):G=e[28];let O;e[29]!==G?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:G,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=G,e[30]=O):O=e[30];let B;e[31]!==t?(B=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=B):B=e[32];let U;e[33]!==B?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:B})}),e[33]=B,e[34]=U):U=e[34];let H;e[35]!==O||e[36]!==U?(H=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=H):H=e[37];let q;e[38]===Symbol.for("react.memo_cache_sentinel")?(q=()=>_(!0),e[38]=q):q=e[38];let L;e[39]!==t?(L=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=L):L=e[40];let E;e[41]!==f||e[42]!==L?(E=s.jsx(te,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:q,disabled:f,children:L}),e[41]=f,e[42]=L,e[43]=E):E=e[43];let R;e[44]!==H||e[45]!==E?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[H,E]}),e[44]=H,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let z;e[51]!==t?(z=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=z):z=e[52];let b;e[53]!==z?(b=s.jsx(Je,{children:z}),e[53]=z,e[54]=b):b=e[54];let A;e[55]!==T||e[56]!==b?(A=s.jsxs(Xe,{children:[T,b]}),e[55]=T,e[56]=b,e[57]=A):A=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let w;e[60]!==M?(w=s.jsx(Ze,{children:M}),e[60]=M,e[61]=w):w=e[61];let I;e[62]!==p?(I=()=>p(),e[62]=p,e[63]=I):I=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==I||e[67]!==Y?(W=s.jsx(et,{onClick:I,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=I,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==w||e[70]!==W?($=s.jsxs(tt,{children:[w,W]}),e[69]=w,e[70]=W,e[71]=$):$=e[71];let Q;e[72]!==A||e[73]!==$?(Q=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=Q):Q=e[74];let Z;e[75]!==j||e[76]!==Q?(Z=s.jsx(it,{open:j,onOpenChange:_,children:Q}),e[75]=j,e[76]=Q,e[77]=Z):Z=e[77];let le;e[78]!==N||e[79]!==K||e[80]!==u||e[81]!==v?(le=v||u?s.jsx(Me,{className:"h-9 w-24"}):s.jsx("span",{className:Te("text-3xl font-semibold tabular-nums tracking-tight",N!=null&&Lt(N)),children:K}),e[78]=N,e[79]=K,e[80]=u,e[81]=v,e[82]=le):le=e[82];let ee;e[83]!==C?(ee=()=>C(),e[83]=C,e[84]=ee):ee=e[84];let ne;e[85]!==t?(ne=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ne):ne=e[86];const Ke=u&&"animate-spin";let ae;e[87]!==Ke?(ae=Te(Ke),e[87]=Ke,e[88]=ae):ae=e[88];let ce;e[89]!==ae?(ce=s.jsx(Be,{size:14,className:ae}),e[89]=ae,e[90]=ce):ce=e[90];let de;e[91]!==u||e[92]!==ee||e[93]!==ne||e[94]!==ce?(de=s.jsx("button",{type:"button",onClick:ee,disabled:u,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ne,children:ce}),e[91]=u,e[92]=ee,e[93]=ne,e[94]=ce,e[95]=de):de=e[95];let me;e[96]!==le||e[97]!==de?(me=s.jsxs("div",{className:"flex items-baseline gap-2",children:[le,de]}),e[96]=le,e[97]=de,e[98]=me):me=e[98];let fe;e[99]!==t?(fe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=fe):fe=e[100];let ue;e[101]!==fe?(ue=s.jsx("p",{className:"text-xs text-muted-foreground",children:fe}),e[101]=fe,e[102]=ue):ue=e[102];let pe;e[103]!==me||e[104]!==ue?(pe=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[me,ue]}),e[103]=me,e[104]=ue,e[105]=pe):pe=e[105];let ge;e[106]!==t?(ge=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=ge):ge=e[107];let he;e[108]!==ge?(he=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:ge}),e[108]=ge,e[109]=he):he=e[109];let _e;e[110]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(zt,{}),e[110]=_e):_e=e[110];let xe;e[111]!==he?(xe=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[he,_e]}),e[111]=he,e[112]=xe):xe=e[112];let be;e[113]!==R||e[114]!==Z||e[115]!==pe||e[116]!==xe?(be=s.jsx(Ee,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,Z,pe,xe]})}),e[113]=R,e[114]=Z,e[115]=pe,e[116]=xe,e[117]=be):be=e[117];let Ce;return e[118]!==V||e[119]!==be?(Ce=s.jsx(Re,{title:V,children:be}),e[118]=V,e[119]=be,e[120]=Ce):Ce=e[120],Ce}function Qt(e){return e.providerId==="deco"}function Gt(){const e=X.c(8),{org:t}=Ie(),i=ye(),r=De();let a;e[0]!==i?(a=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=a):a=e[1];let d;e[2]!==t||e[3]!==r?(d=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:ie.aiProviders(t.id)}),re.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=r,e[4]=d):d=e[4];let n;return e[5]!==a||e[6]!==d?(n={mutationFn:a,onSuccess:d,onError:Yt},e[5]=a,e[6]=d,e[7]=n):n=e[7],je(n)}function Yt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),re.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Wt(){const e=X.c(37),t=oe(),{mutate:i,isPending:r}=Gt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=d):d=e[1];let n;e[2]!==t?(n=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=n):n=e[3];let o;e[4]!==n?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:n,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=n,e[5]=o):o=e[5];let j;e[6]!==t?(j=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=j):j=e[7];let _;e[8]!==j?(_=s.jsx("p",{className:"text-base font-semibold",children:j}),e[8]=j,e[9]=_):_=e[9];let S;e[10]!==t?(S=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=S):S=e[11];let l;e[12]!==S?(l=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:S}),e[12]=S,e[13]=l):l=e[13];let c;e[14]!==_||e[15]!==l?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,l]}),e[14]=_,e[15]=l,e[16]=c):c=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let p;e[19]!==m?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=p):p=e[20];let f;e[21]!==p||e[22]!==c?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,p]}),e[21]=p,e[22]=c,e[23]=f):f=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==r||e[27]!==t?(k=t(r?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=r,e[27]=t,e[28]=k):k=e[28];let h;e[29]!==r||e[30]!==g||e[31]!==k?(h=s.jsx(te,{variant:"outline",disabled:r,onClick:g,children:k}),e[29]=r,e[30]=g,e[31]=k,e[32]=h):h=e[32];let y;return e[33]!==f||e[34]!==h||e[35]!==o?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[d,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,f,h]})]}),e[33]=f,e[34]=h,e[35]=o,e[36]=y):y=e[36],y}const Jt=e=>se({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function Xt({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function Zt({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:a,currentBaseUrl:d,onCancel:n,onSuccess:o}){const{org:j}=Ie(),_=ye(),S=De(),l=oe(),[c,m]=J.useState(!1),p=t.id==="openai-compatible",f=t.supportedMethods.includes("api-key"),g=Jt(l),{register:k,handleSubmit:h,watch:y,setError:P,formState:{errors:v}}=ze({resolver:qe(g),defaultValues:{label:a,apiKey:"",baseUrl:d??""}}),C=y("apiKey")??"",{mutate:u,isPending:N}=je({mutationFn:async x=>{let K;x.apiKey&&(p?K=JSON.stringify({baseUrl:x.baseUrl||d||"",apiKey:x.apiKey}):K=x.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:x.label,...K!==void 0?{apiKey:K}:{}})},onSuccess:()=>{S.invalidateQueries({queryKey:ie.aiProviderKeys(j.id)}),S.invalidateQueries({queryKey:ie.aiProviders(j.id)}),re.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:x=>re.error(l("settings.editProviderDialog.failedToUpdate",{error:x.message}))});return s.jsxs("form",{onSubmit:h(x=>{if(Xt({isOpenAICompatible:p,baseUrl:x.baseUrl,currentBaseUrl:d,apiKey:x.apiKey})){P("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}u(x)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.label")}),s.jsx(Ne,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),v.label&&s.jsx("p",{className:"text-xs text-destructive",children:v.label.message})]}),p&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.baseUrl")}),s.jsx(Ne,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),f&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[l("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",l("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ne,{type:c&&C?"text":"password",placeholder:r,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),C&&s.jsx("button",{type:"button",onClick:()=>m(!c),"aria-label":l(c?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:c?s.jsx(Ct,{size:14}):s.jsx(kt,{size:14})})]}),v.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:v.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Kt,{children:[s.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:l("settings.editProviderDialog.cancel")}),s.jsx(te,{type:"submit",size:"sm",disabled:N,children:l(N?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function es(e){const t=X.c(31),{providerKey:i,provider:r,open:a,onOpenChange:d}=e,n=oe(),o=ye(),j=r.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,_=j?.name??r.name;let S;t[0]!==i.id?(S=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=S):S=t[1];let l;t[2]!==i.id||t[3]!==o?(l=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=l):l=t[4];let c;t[5]!==a||t[6]!==S||t[7]!==l?(c={queryKey:S,queryFn:l,enabled:a,staleTime:0},t[5]=a,t[6]=S,t[7]=l,t[8]=c):c=t[8];const{data:m,isLoading:p}=Le(c),f=Dt,g=It,k="sm:max-w-md",h=Nt,y=Pt,P=n("settings.editProviderDialog.editTitle",{name:_});let v;t[9]!==y||t[10]!==P?(v=s.jsx(y,{children:P}),t[9]=y,t[10]=P,t[11]=v):v=t[11];let C;t[12]!==h||t[13]!==v?(C=s.jsx(h,{children:v}),t[12]=h,t[13]=v,t[14]=C):C=t[14];let u;t[15]!==p||t[16]!==d||t[17]!==j||t[18]!==m||t[19]!==r||t[20]!==i?(u=p||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ut,{})}):s.jsx(Zt,{providerKey:i,provider:r,preset:j,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>d(!1),onSuccess:()=>d(!1)}),t[15]=p,t[16]=d,t[17]=j,t[18]=m,t[19]=r,t[20]=i,t[21]=u):u=t[21];let N;t[22]!==g||t[23]!==C||t[24]!==u?(N=s.jsxs(g,{className:k,children:[C,u]}),t[22]=g,t[23]=C,t[24]=u,t[25]=N):N=t[25];let x;return t[26]!==f||t[27]!==d||t[28]!==a||t[29]!==N?(x=s.jsx(f,{open:a,onOpenChange:d,children:N}),t[26]=f,t[27]=d,t[28]=a,t[29]=N,t[30]=x):x=t[30],x}function ts(e){const t=X.c(80),{providerKey:i,provider:r}=e,{org:a}=Ie(),d=ye(),n=De(),[o,j]=J.useState(!1),[_,S]=J.useState(!1),l=oe(),c=r.id==="openai-compatible";let m;t[0]!==c||t[1]!==i.presetId?(m=c&&i.presetId?Ye(i.presetId):void 0,t[0]=c,t[1]=i.presetId,t[2]=m):m=t[2];const p=m,f=p?p.name:c?"Custom OpenAI-compatible":r.name,g=p?.logo??r.logo;let k;e:{if(c){k=i.label;break e}const le=i.label;let ee;t[3]!==i.createdAt?(ee=wt(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=ee):ee=t[4],k=`${le} · added ${ee} ago`}const h=k;let y;t[5]!==i.id||t[6]!==d?(y=async()=>{await d.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=d,t[7]=y):y=t[7];let P;t[8]!==a||t[9]!==i.id||t[10]!==n||t[11]!==l?(P=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(a.id)}),n.invalidateQueries({queryKey:ie.aiProviders(a.id)}),n.invalidateQueries({queryKey:ie.aiProviderModels(a.id,i.id)}),re.success(l("settings.providerKeyRow.keyDeleted")),j(!1)},t[8]=a,t[9]=i.id,t[10]=n,t[11]=l,t[12]=P):P=t[12];let v;t[13]!==l?(v=le=>re.error(l("settings.providerKeyRow.failedToDeleteKey",{error:le.message})),t[13]=l,t[14]=v):v=t[14];let C;t[15]!==y||t[16]!==P||t[17]!==v?(C={mutationFn:y,onSuccess:P,onError:v},t[15]=y,t[16]=P,t[17]=v,t[18]=C):C=t[18];const{mutate:u,isPending:N}=je(C);let x;t[19]!==f||t[20]!==g?(x=g?s.jsx("img",{src:g,alt:f,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:f.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[19]=f,t[20]=g,t[21]=x):x=t[21];let K;t[22]!==l?(K=l("settings.providerKeyRow.editProviderKey"),t[22]=l,t[23]=K):K=t[23];let V,G;t[24]===Symbol.for("react.memo_cache_sentinel")?(G=()=>S(!0),V=s.jsx(jt,{size:14}),t[24]=V,t[25]=G):(V=t[24],G=t[25]);let O;t[26]!==K?(O=s.jsx(te,{variant:"ghost",size:"icon","aria-label":K,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:G,children:V}),t[26]=K,t[27]=O):O=t[27];let B;t[28]!==l?(B=l("settings.providerKeyRow.deleteProviderKey"),t[28]=l,t[29]=B):B=t[29];let U,H;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=()=>j(!0),H=s.jsx(St,{size:14}),t[30]=U,t[31]=H):(U=t[30],H=t[31]);let q;t[32]!==N||t[33]!==B?(q=s.jsx(te,{variant:"ghost",size:"icon","aria-label":B,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:N,onClick:U,children:H}),t[32]=N,t[33]=B,t[34]=q):q=t[34];let L;t[35]!==O||t[36]!==q?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,q]}),t[35]=O,t[36]=q,t[37]=L):L=t[37];let E;t[38]!==h||t[39]!==f||t[40]!==L||t[41]!==x?(E=s.jsx(Qe,{icon:x,title:f,description:h,action:L}),t[38]=h,t[39]=f,t[40]=L,t[41]=x,t[42]=E):E=t[42];let R;t[43]!==_||t[44]!==r||t[45]!==i?(R=s.jsx(es,{providerKey:i,provider:r,open:_,onOpenChange:S}),t[43]=_,t[44]=r,t[45]=i,t[46]=R):R=t[46];let F;t[47]!==l?(F=l("settings.providerKeyRow.deleteApiKey"),t[47]=l,t[48]=F):F=t[48];let T;t[49]!==F?(T=s.jsx(We,{children:F}),t[49]=F,t[50]=T):T=t[50];let z;t[51]!==i.label?(z=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[51]=i.label,t[52]=z):z=t[52];let b;t[53]!==T||t[54]!==z?(b=s.jsxs(Xe,{children:[T,z]}),t[53]=T,t[54]=z,t[55]=b):b=t[55];let A;t[56]!==l?(A=l("settings.providerKeyRow.cancel"),t[56]=l,t[57]=A):A=t[57];let M;t[58]!==A?(M=s.jsx(Ze,{children:A}),t[58]=A,t[59]=M):M=t[59];let w;t[60]!==u?(w=()=>u(),t[60]=u,t[61]=w):w=t[61];let I;t[62]!==l?(I=l("settings.providerKeyRow.delete"),t[62]=l,t[63]=I):I=t[63];let Y;t[64]!==w||t[65]!==I?(Y=s.jsx(et,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:I}),t[64]=w,t[65]=I,t[66]=Y):Y=t[66];let W;t[67]!==M||t[68]!==Y?(W=s.jsxs(tt,{children:[M,Y]}),t[67]=M,t[68]=Y,t[69]=W):W=t[69];let $;t[70]!==b||t[71]!==W?($=s.jsxs(st,{children:[b,W]}),t[70]=b,t[71]=W,t[72]=$):$=t[72];let Q;t[73]!==o||t[74]!==$?(Q=s.jsx(it,{open:o,onOpenChange:j,children:$}),t[73]=o,t[74]=$,t[75]=Q):Q=t[75];let Z;return t[76]!==E||t[77]!==R||t[78]!==Q?(Z=s.jsxs(s.Fragment,{children:[E,R,Q]}),t[76]=E,t[77]=R,t[78]=Q,t[79]=Z):Z=t[79],Z}function ss(e){const t=X.c(17),{onConnectClick:i}=e,r=oe(),a=Se(),d=Ge();let n;t[0]!==d?.providers?(n=d?.providers??[],t[0]=d?.providers,t[1]=n):n=t[1];const o=n;let j;if(t[2]!==a||t[3]!==i||t[4]!==o||t[5]!==r){let _;t[7]!==o?(_=f=>({key:f,provider:o.find(g=>g.id===f.providerId)}),t[7]=o,t[8]=_):_=t[8];const S=a.filter(rs).map(_).filter(ls);let l;t[9]!==r?(l=r("settings.connectedProvidersSection.sectionTitle"),t[9]=r,t[10]=l):l=t[10];let c;t[11]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(yt,{size:14}),t[11]=c):c=t[11];let m;t[12]!==r?(m=r("settings.connectedProvidersSection.connectButton"),t[12]=r,t[13]=m):m=t[13];let p;t[14]!==i||t[15]!==m?(p=s.jsxs(te,{size:"sm",onClick:i,children:[c,m]}),t[14]=i,t[15]=m,t[16]=p):p=t[16],j=s.jsx(Re,{title:l,headerClassName:"px-0",actions:p,children:S.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Ee,{children:S.map(is)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=r,t[6]=j}else j=t[6];return j}function is(e){const{key:t,provider:i}=e;return s.jsx(ts,{providerKey:t,provider:i},t.id)}function ls(e){return e.provider!==void 0}function rs(e){return e.providerId!=="deco"}function os(e){const t=X.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(nt,{size:16}),t[0]=r):r=t[0];let a;return t[1]!==i.message?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[r,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=a):a=t[2],a}function ns(){const e=X.c(23),t=Se();let i;e[0]!==t?(i=t.some(as),e[0]=t,e[1]=i):i=e[1];const r=i,a=t.length>0,[d,n]=J.useState(!1),[o,j]=J.useState(null),_=Ge();let S;e[2]!==_?.providers?(S=_?.providers??[],e[2]=_?.providers,e[3]=S):S=e[3];const l=S;if(!a){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>n(!0),e[4]=k):k=e[4];let h;e[5]!==l?(h=s.jsx(xt,{providers:l,onSelect:j,onShowAll:k}),e[5]=l,e[6]=h):h=e[6];const y=o!==null||d;let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=N=>{N||(j(null),n(!1))},e[7]=P):P=e[7];const v=o??void 0;let C;e[8]!==y||e[9]!==v?(C=s.jsx($e,{open:y,onOpenChange:P,initialProvider:v}),e[8]=y,e[9]=v,e[10]=C):C=e[10];let u;return e[11]!==h||e[12]!==C?(u=s.jsxs(s.Fragment,{children:[h,C]}),e[11]=h,e[12]=C,e[13]=u):u=e[13],u}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-16 w-full"}),children:s.jsx(Ut,{})}),e[14]=c):c=e[14];let m;e[15]!==r?(m=r?s.jsx(Vt,{}):s.jsx(Wt,{}),e[15]=r,e[16]=m):m=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ss,{onConnectClick:()=>n(!0)}),e[17]=p):p=e[17];let f;e[18]!==d?(f=s.jsx($e,{open:d,onOpenChange:n}),e[18]=d,e[19]=f):f=e[19];let g;return e[20]!==m||e[21]!==f?(g=s.jsxs(s.Fragment,{children:[c,m,p,f]}),e[20]=m,e[21]=f,e[22]=g):g=e[22],g}function as(e){return e.providerId==="deco"}function cs(){const e=X.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ke.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ke,{children:s.jsx(ke.Content,{children:s.jsx(ke.Body,{children:s.jsxs(at,{children:[t,s.jsx(ot,{fallback:ds,children:s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-64 w-full"}),children:s.jsx(ns,{})})})]})})})}),e[1]=i):i=e[1],i}function ds(e){const{error:t}=e;return s.jsx(os,{error:t??new Error("Failed to load AI providers")})}function yi(){const e=X.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(At,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(cs,{})}),e[0]=t):t=e[0],t}export{yi as default};
|
|
1
|
+
import{H as se,I as D,ad as Ae,af as we,ag as Ue,ae as He,b3 as Fe,c as X,J as qe,M as ze,r as J,j as s,ah as rt,t as re,aL as Be,C as Ie,n as De,d as je,K as ie,m as Le,l as Te,B as te,p as Ve,E as ot}from"./index-C8rlFaFO.js";import{i as nt}from"./AlertCircle-Cvc_10Uv.js";import{P as ke}from"./index-Bj_MaVUP.js";import{S as Me}from"./skeleton-DraYvTQP.js";import{b as Qe,a as Ee,S as Re,c as at}from"./settings-section-DxqR9iml.js";import{u as Se,a as Pe,b as Ge}from"./use-ai-providers-CGzSWtp7.js";import{i as ct}from"./CheckCircle-B5oIKeSF.js";import{n as dt,o as mt,q as ft,S as ut}from"./chat-context-glCfFIWX.js";import{e as pt,f as gt}from"./use-organization-settings-DBhnNnJm.js";import{M as ht,b as Ye,P as xt,C as $e}from"./select-model-CVcEVUsi.js";import{u as bt}from"./use-debounced-autosave-DFle-8Sb.js";import{u as oe}from"./use-t-BeHordU2.js";import{I as Ne}from"./input-CWExGH7j.js";import{T as Oe,a as vt}from"./toggle-group-c5TjS6xS.js";import{c as We,d as Je,b as Xe,A as Ze,g as et,e as tt,a as st,f as it}from"./alert-dialog-D2oa47X8.js";import{u as ye}from"./studio-tools-B3FHZXsQ.js";import{s as yt}from"./Plus-5VWQJEkS.js";import{b as jt}from"./Tool01-DBXzU6aR.js";import{s as St}from"./Trash01-DxXosbkh.js";import{A as _t}from"./avatar-1o2VQKTj.js";import{i as Ct}from"./Settings02-CU2rilKq.js";import{s as kt}from"./Eye-BuukW7MV.js";import{a as Pt,D as Nt,d as It,e as Dt,c as Kt}from"./dialog-ChJw5xnr.js";import{f as wt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as At}from"./require-capability-BBszzyH9.js";import"./sidebar-AfeWMY1r.js";import"./LayoutLeft-COV7zlIC.js";import"./use-mobile-C57pT7o9.js";import"./X-CLG08ht8.js";import"./tooltip-DE_gqCm3.js";import"./card-CoG27DVs.js";import"./ArrowUpRight-DgI9ki5h.js";import"./autosend-D-JHJKNK.js";import"./hooks-CJqrF4BQ.js";import"./use-mcp-client-PcphUWIj.js";import"./auth-Kymy4xkz.js";import"./decopilot-sse-pool-DEJZ4gJu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BtFe5DoR.js";import"./use-collections-u5tkBX1a.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-VInARyiN.js";import"./drawer-_WfOhyRU.js";import"./checkbox-BOAToSlJ.js";import"./ChevronUp-Ci-XiWb6.js";import"./select-4-vdHbLT.js";import"./ChevronDown-D_W2bIqv.js";import"./Key01-BPZUhUcV.js";import"./SearchMd-LbMkvaPD.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-dLHbd0CB.js";import"./ChevronRight-BnIvJcIZ.js";import"./connect-desktop-dialog-CUGIAU17.js";import"./Copy01-Q4xZmPKp.js";import"./Image01-BWotytID.js";import"./Stars01-HAbkffzq.js";import"./User01-CZgThaZQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BNcFOggs.js";import"./access-gate-B8spscer.js";import"./capability-load-error-DI4Ww9LY.js";se({title:D(),url:D(),icon:D()});se({registries:we(D(),se({enabled:Ue()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const ve=se({keyId:D(),modelId:D(),title:D().optional()}).nullable();He(["fast","smart","thinking","image","web_search","deep_research"]);He(["fast","smart","thinking"]);const Mt=se({tiers:se({fast:ve,smart:ve,thinking:ve,image:ve,web_search:ve,deep_research:ve})});se({ids:Ae(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});se({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:se({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:se({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(we(D(),Fe())).nullable().optional().describe("Brand images"),metadata:we(D(),Fe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:Ue().optional().describe("Whether this is the default brand for the organization")});const Et=e=>e.capabilities?.includes("image")===!0,Rt=e=>dt(e),Ft=e=>mt(e),Tt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Et},{key:"web_search",filter:Rt},{key:"deep_research",filter:Ft}];function $t(e){const t=X.c(26),{slot:i,onSlotChange:r,filterModels:a,defaultKeyId:d}=e,n=Se(),[o,j]=J.useState(i?.keyId??d);let _;t[0]!==i?(_=()=>{i?.keyId&&j(i.keyId)},t[0]=i,t[1]=_):_=t[1];const S=i?.keyId;let l;t[2]!==S?(l=[S],t[2]=S,t[3]=l):l=t[3],J.useEffect(_,l);const c=o??d;let m;t[4]!==c||t[5]!==n?(m=c?n.find(x=>x.id===c):null,t[4]=c,t[5]=n,t[6]=m):m=t[6];const p=m,{models:f,isLoading:g}=Pe(a?c??void 0:void 0),k=a?g||f.some(a):!0;let h;t[7]!==i||t[8]!==p?.providerId?(h=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:p?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=p?.providerId,t[9]=h):h=t[9];const y=h,P=oe();if(a&&!k){let x;t[10]!==P?(x=P("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[10]=P,t[11]=x):x=t[11];let K;return t[12]!==x?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:x}),t[12]=x,t[13]=K):K=t[13],K}let v;t[14]!==P?(v=P("settings.simpleModeSection.pickModel"),t[14]=P,t[15]=v):v=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=x=>j(x),t[16]=C):C=t[16];let u;t[17]!==c||t[18]!==r?(u=x=>{const K=x.keyId??c??"";j(K),r({keyId:K,modelId:x.modelId,title:x.title})},t[17]=c,t[18]=r,t[19]=u):u=t[19];let N;return t[20]!==c||t[21]!==a||t[22]!==y||t[23]!==v||t[24]!==u?(N=s.jsx(ht,{variant:"bordered",placeholder:v,model:y,credentialId:c,filterModels:a,onCredentialChange:C,onModelChange:u}),t[20]=c,t[21]=a,t[22]=y,t[23]=v,t[24]=u,t[25]=N):N=t[25],N}function Ot(e){const t=X.c(10),{isPending:i,showSaved:r}=e,a=oe();if(i){let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=d):d=t[0];let n;t[1]!==a?(n=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=n):n=t[2];let o;return t[3]!==n?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d,n]}),t[3]=n,t[4]=o):o=t[4],o}if(r){let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ct,{size:12}),t[5]=d):d=t[5];let n;t[6]!==a?(n=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=n):n=t[7];let o;return t[8]!==n?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[d,n]}),t[8]=n,t[9]=o):o=t[9],o}return null}function Ut(){const e=X.c(58),t=oe(),i=Se(),r=pt(),a=i.length>0;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=qe(Mt),e[0]=d):d=e[0];let n;e[1]!==r?(n={resolver:d,values:r,mode:"onChange"},e[1]=r,e[2]=n):n=e[2];const o=ze(n),{mutate:j,isPending:_,isSuccess:S}=gt(),l=o.formState.isDirty;let c;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==j?(c={delayMs:250,save:async()=>{const b=o.getValues();j(b,{onSuccess:()=>o.reset(b,{keepValues:!0}),onError:A=>{o.reset(r),re.error(t("settings.simpleModeSection.failedToSave",{error:A.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=j,e[7]=c):c=e[7];const{schedule:m}=bt(c),p=i[0],f=i[1],g=i[2],{models:k}=Pe(p?.id),{models:h}=Pe(f?.id),{models:y}=Pe(g?.id);let P,v;e[8]!==o||e[9]!==a?(P=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},v=[a,o],e[8]=o,e[9]=a,e[10]=P,e[11]=v):(P=e[10],v=e[11]),J.useEffect(P,v);let C;e[12]!==i||e[13]!==o||e[14]!==p||e[15]!==f||e[16]!==g||e[17]!==k||e[18]!==h||e[19]!==y?(C=()=>{const b=o.getValues(),A=new Set(i.map(Ht)),M={};p?.id&&(M[p.id]=k),f?.id&&(M[f.id]=h),g?.id&&(M[g.id]=y);const w=Q=>Q!=null&&!A.has(Q.keyId),I={fast:w(b.tiers.fast)?null:b.tiers.fast,smart:w(b.tiers.smart)?null:b.tiers.smart,thinking:w(b.tiers.thinking)?null:b.tiers.thinking,image:w(b.tiers.image)?null:b.tiers.image,web_search:w(b.tiers.web_search)?null:b.tiers.web_search,deep_research:w(b.tiers.deep_research)?null:b.tiers.deep_research},Y=!I.fast||!I.smart||!I.thinking||!I.image||!I.web_search||!I.deep_research,W=I.fast===b.tiers.fast&&I.smart===b.tiers.smart&&I.thinking===b.tiers.thinking&&I.image===b.tiers.image&&I.web_search===b.tiers.web_search&&I.deep_research===b.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);o.reset({tiers:{fast:I.fast??$.chat.fast,smart:I.smart??$.chat.smart,thinking:I.thinking??$.chat.thinking,image:I.image??$.image,web_search:I.web_search??$.webSearch,deep_research:I.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=p,e[15]=f,e[16]=g,e[17]=k,e[18]=h,e[19]=y,e[20]=C):C=e[20];const u=p?.id,N=f?.id,x=g?.id;let K;e[21]!==i||e[22]!==o||e[23]!==k||e[24]!==h||e[25]!==y||e[26]!==u||e[27]!==N||e[28]!==x?(K=[o,i,k,h,y,u,N,x],e[21]=i,e[22]=o,e[23]=k,e[24]=h,e[25]=y,e[26]=u,e[27]=N,e[28]=x,e[29]=K):K=e[29],J.useEffect(C,K);let V;e[30]!==t?(V=b=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[b]||b,e[30]=t,e[31]=V):V=e[31];const G=V;let O;e[32]!==t?(O=b=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[b]||"",e[32]=t,e[33]=O):O=e[33];const B=O;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let H;e[36]!==t?(H=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=H):H=e[37];let q;e[38]!==H?(q=s.jsx("p",{className:"text-sm text-muted-foreground",children:H}),e[38]=H,e[39]=q):q=e[39];const L=S&&!l;let E;e[40]!==_||e[41]!==L?(E=s.jsx(Ot,{isPending:_,showSaved:L}),e[40]=_,e[41]=L,e[42]=E):E=e[42];let R;e[43]!==q||e[44]!==E?(R=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[q,E]}),e[43]=q,e[44]=E,e[45]=R):R=e[45];let F;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==B||e[49]!==G||e[50]!==m?(F=Tt.map(b=>s.jsx(rt,{control:o.control,name:`tiers.${b.key}`,render:A=>{const{field:M}=A;return s.jsx(Qe,{title:G(b.key),description:B(b.key),action:s.jsx($t,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:b.filter,onSlotChange:w=>{M.onChange(w),m()}})})}},b.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=B,e[49]=G,e[50]=m,e[51]=F):F=e[51];let T;e[52]!==F?(T=s.jsx(Ee,{children:F}),e[52]=F,e[53]=T):T=e[53];let z;return e[54]!==U||e[55]!==R||e[56]!==T?(z=s.jsxs(Re,{title:U,headerClassName:"pl-0",children:[R,T]}),e[54]=U,e[55]=R,e[56]=T,e[57]=z):z=e[57],z}function Ht(e){return e.id}const qt={usd:[10,20,100],brl:[50,100,500]};function zt(){const e=X.c(30),t=oe(),i=ye(),[r,a]=J.useState(!1);let d;e[0]!==t?(d=u=>{re.error(t("settings.decoCreditsHero.topUpFailed",{message:u.message}))},e[0]=t,e[1]=d):d=e[1];const{mutate:n,isPending:o}=je({mutationFn:async u=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:u,currency:c});return N},onSuccess:Bt,onError:d}),[j,_]=J.useState(""),[S,l]=J.useState("usd"),c=S,m=parseFloat(j),p=!isNaN(m)&&m>=1,f=c==="brl"?"R$":"$";let g;e[2]!==l?(g=u=>{u&&l(u)},e[2]=l,e[3]=g):g=e[3];let k,h;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Oe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),h=s.jsx(Oe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=k,e[5]=h):(k=e[4],h=e[5]);let y;e[6]!==c||e[7]!==g?(y=s.jsxs(vt,{type:"single",variant:"outline",size:"default",value:c,onValueChange:g,children:[k,h]}),e[6]=c,e[7]=g,e[8]=y):y=e[8];let P;e[9]!==c||e[10]!==f||e[11]!==r||e[12]!==o||e[13]!==t||e[14]!==n?(P=!r&&s.jsxs(s.Fragment,{children:[qt[c].map(u=>s.jsxs(te,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:o,onClick:()=>n(u*100),children:[f,u]},u)),s.jsx(te,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:o,children:t("settings.decoCreditsHero.custom")})]}),e[9]=c,e[10]=f,e[11]=r,e[12]=o,e[13]=t,e[14]=n,e[15]=P):P=e[15];let v;e[16]!==f||e[17]!==j||e[18]!==m||e[19]!==r||e[20]!==p||e[21]!==o||e[22]!==_||e[23]!==t||e[24]!==n?(v=r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),s.jsx(Ne,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:j,onChange:u=>_(u.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(te,{className:"h-10",disabled:!p||o,onClick:()=>n(Math.round(m*100)),children:o?"...":t("settings.decoCreditsHero.add")}),s.jsx(te,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),_("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=f,e[17]=j,e[18]=m,e[19]=r,e[20]=p,e[21]=o,e[22]=_,e[23]=t,e[24]=n,e[25]=v):v=e[25];let C;return e[26]!==y||e[27]!==P||e[28]!==v?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y,P,v]})}),e[26]=y,e[27]=P,e[28]=v,e[29]=C):C=e[29],C}function Bt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Lt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Vt(){const e=X.c(121),t=oe(),{org:i}=Ie(),r=ye(),a=De(),d=Se();let n;e[0]!==d?(n=d.find(Qt),e[0]=d,e[1]=n):n=e[1];const o=n,[j,_]=J.useState(!1);let S;e[2]!==o||e[3]!==r?(S=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=S):S=e[4];let l;e[5]!==i.id||e[6]!==a||e[7]!==t?(l=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:ie.aiProviders(i.id)}),re.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=a,e[7]=t,e[8]=l):l=e[8];let c;e[9]!==t?(c=lt=>{re.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=c):c=e[10];let m;e[11]!==S||e[12]!==l||e[13]!==c?(m={mutationFn:S,onSuccess:l,onError:c},e[11]=S,e[12]=l,e[13]=c,e[14]=m):m=e[14];const{mutate:p,isPending:f}=je(m);let g;e[15]!==i.id?(g=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=g):g=e[16];const k=!!o;let h;e[17]!==r?(h=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=h):h=e[18];let y;e[19]!==g||e[20]!==k||e[21]!==h?(y={queryKey:g,enabled:k,staleTime:6e4,queryFn:h},e[19]=g,e[20]=k,e[21]=h,e[22]=y):y=e[22];const{data:P,isLoading:v,refetch:C,isFetching:u}=Le(y);if(!o)return null;const N=P?.balanceCents!=null?P.balanceCents/100:null;let x;e[23]!==N?(x=N!=null?`$${N.toFixed(2)}`:"—",e[23]=N,e[24]=x):x=e[24];const K=x;let V;e[25]!==t?(V=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=V):V=e[26];let G;e[27]!==t?(G=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=G):G=e[28];let O;e[29]!==G?(O=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:G,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=G,e[30]=O):O=e[30];let B;e[31]!==t?(B=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=B):B=e[32];let U;e[33]!==B?(U=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:B})}),e[33]=B,e[34]=U):U=e[34];let H;e[35]!==O||e[36]!==U?(H=s.jsxs("div",{className:"flex items-center gap-3",children:[O,U]}),e[35]=O,e[36]=U,e[37]=H):H=e[37];let q;e[38]===Symbol.for("react.memo_cache_sentinel")?(q=()=>_(!0),e[38]=q):q=e[38];let L;e[39]!==t?(L=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=L):L=e[40];let E;e[41]!==f||e[42]!==L?(E=s.jsx(te,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:q,disabled:f,children:L}),e[41]=f,e[42]=L,e[43]=E):E=e[43];let R;e[44]!==H||e[45]!==E?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[H,E]}),e[44]=H,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==t?(F=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=F):F=e[48];let T;e[49]!==F?(T=s.jsx(We,{children:F}),e[49]=F,e[50]=T):T=e[50];let z;e[51]!==t?(z=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=z):z=e[52];let b;e[53]!==z?(b=s.jsx(Je,{children:z}),e[53]=z,e[54]=b):b=e[54];let A;e[55]!==T||e[56]!==b?(A=s.jsxs(Xe,{children:[T,b]}),e[55]=T,e[56]=b,e[57]=A):A=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let w;e[60]!==M?(w=s.jsx(Ze,{children:M}),e[60]=M,e[61]=w):w=e[61];let I;e[62]!==p?(I=()=>p(),e[62]=p,e[63]=I):I=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==I||e[67]!==Y?(W=s.jsx(et,{onClick:I,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=I,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==w||e[70]!==W?($=s.jsxs(tt,{children:[w,W]}),e[69]=w,e[70]=W,e[71]=$):$=e[71];let Q;e[72]!==A||e[73]!==$?(Q=s.jsxs(st,{children:[A,$]}),e[72]=A,e[73]=$,e[74]=Q):Q=e[74];let Z;e[75]!==j||e[76]!==Q?(Z=s.jsx(it,{open:j,onOpenChange:_,children:Q}),e[75]=j,e[76]=Q,e[77]=Z):Z=e[77];let le;e[78]!==N||e[79]!==K||e[80]!==u||e[81]!==v?(le=v||u?s.jsx(Me,{className:"h-9 w-24"}):s.jsx("span",{className:Te("text-3xl font-semibold tabular-nums tracking-tight",N!=null&&Lt(N)),children:K}),e[78]=N,e[79]=K,e[80]=u,e[81]=v,e[82]=le):le=e[82];let ee;e[83]!==C?(ee=()=>C(),e[83]=C,e[84]=ee):ee=e[84];let ne;e[85]!==t?(ne=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ne):ne=e[86];const Ke=u&&"animate-spin";let ae;e[87]!==Ke?(ae=Te(Ke),e[87]=Ke,e[88]=ae):ae=e[88];let ce;e[89]!==ae?(ce=s.jsx(Be,{size:14,className:ae}),e[89]=ae,e[90]=ce):ce=e[90];let de;e[91]!==u||e[92]!==ee||e[93]!==ne||e[94]!==ce?(de=s.jsx("button",{type:"button",onClick:ee,disabled:u,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ne,children:ce}),e[91]=u,e[92]=ee,e[93]=ne,e[94]=ce,e[95]=de):de=e[95];let me;e[96]!==le||e[97]!==de?(me=s.jsxs("div",{className:"flex items-baseline gap-2",children:[le,de]}),e[96]=le,e[97]=de,e[98]=me):me=e[98];let fe;e[99]!==t?(fe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=fe):fe=e[100];let ue;e[101]!==fe?(ue=s.jsx("p",{className:"text-xs text-muted-foreground",children:fe}),e[101]=fe,e[102]=ue):ue=e[102];let pe;e[103]!==me||e[104]!==ue?(pe=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[me,ue]}),e[103]=me,e[104]=ue,e[105]=pe):pe=e[105];let ge;e[106]!==t?(ge=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=ge):ge=e[107];let he;e[108]!==ge?(he=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:ge}),e[108]=ge,e[109]=he):he=e[109];let _e;e[110]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(zt,{}),e[110]=_e):_e=e[110];let xe;e[111]!==he?(xe=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[he,_e]}),e[111]=he,e[112]=xe):xe=e[112];let be;e[113]!==R||e[114]!==Z||e[115]!==pe||e[116]!==xe?(be=s.jsx(Ee,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,Z,pe,xe]})}),e[113]=R,e[114]=Z,e[115]=pe,e[116]=xe,e[117]=be):be=e[117];let Ce;return e[118]!==V||e[119]!==be?(Ce=s.jsx(Re,{title:V,children:be}),e[118]=V,e[119]=be,e[120]=Ce):Ce=e[120],Ce}function Qt(e){return e.providerId==="deco"}function Gt(){const e=X.c(8),{org:t}=Ie(),i=ye(),r=De();let a;e[0]!==i?(a=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=a):a=e[1];let d;e[2]!==t||e[3]!==r?(d=()=>{Ve("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:ie.aiProviders(t.id)}),re.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=r,e[4]=d):d=e[4];let n;return e[5]!==a||e[6]!==d?(n={mutationFn:a,onSuccess:d,onError:Yt},e[5]=a,e[6]=d,e[7]=n):n=e[7],je(n)}function Yt(e){Ve("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),re.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Wt(){const e=X.c(37),t=oe(),{mutate:i,isPending:r}=Gt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=d):d=e[1];let n;e[2]!==t?(n=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=n):n=e[3];let o;e[4]!==n?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:n,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=n,e[5]=o):o=e[5];let j;e[6]!==t?(j=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=j):j=e[7];let _;e[8]!==j?(_=s.jsx("p",{className:"text-base font-semibold",children:j}),e[8]=j,e[9]=_):_=e[9];let S;e[10]!==t?(S=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=S):S=e[11];let l;e[12]!==S?(l=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:S}),e[12]=S,e[13]=l):l=e[13];let c;e[14]!==_||e[15]!==l?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,l]}),e[14]=_,e[15]=l,e[16]=c):c=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let p;e[19]!==m?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=p):p=e[20];let f;e[21]!==p||e[22]!==c?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,p]}),e[21]=p,e[22]=c,e[23]=f):f=e[23];let g;e[24]!==i?(g=()=>i(),e[24]=i,e[25]=g):g=e[25];let k;e[26]!==r||e[27]!==t?(k=t(r?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=r,e[27]=t,e[28]=k):k=e[28];let h;e[29]!==r||e[30]!==g||e[31]!==k?(h=s.jsx(te,{variant:"outline",disabled:r,onClick:g,children:k}),e[29]=r,e[30]=g,e[31]=k,e[32]=h):h=e[32];let y;return e[33]!==f||e[34]!==h||e[35]!==o?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[d,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,f,h]})]}),e[33]=f,e[34]=h,e[35]=o,e[36]=y):y=e[36],y}const Jt=e=>se({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function Xt({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function Zt({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:a,currentBaseUrl:d,onCancel:n,onSuccess:o}){const{org:j}=Ie(),_=ye(),S=De(),l=oe(),[c,m]=J.useState(!1),p=t.id==="openai-compatible",f=t.supportedMethods.includes("api-key"),g=Jt(l),{register:k,handleSubmit:h,watch:y,setError:P,formState:{errors:v}}=ze({resolver:qe(g),defaultValues:{label:a,apiKey:"",baseUrl:d??""}}),C=y("apiKey")??"",{mutate:u,isPending:N}=je({mutationFn:async x=>{let K;x.apiKey&&(p?K=JSON.stringify({baseUrl:x.baseUrl||d||"",apiKey:x.apiKey}):K=x.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:x.label,...K!==void 0?{apiKey:K}:{}})},onSuccess:()=>{S.invalidateQueries({queryKey:ie.aiProviderKeys(j.id)}),S.invalidateQueries({queryKey:ie.aiProviders(j.id)}),re.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:x=>re.error(l("settings.editProviderDialog.failedToUpdate",{error:x.message}))});return s.jsxs("form",{onSubmit:h(x=>{if(Xt({isOpenAICompatible:p,baseUrl:x.baseUrl,currentBaseUrl:d,apiKey:x.apiKey})){P("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}u(x)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.label")}),s.jsx(Ne,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...k("label"),className:"h-8 text-sm"}),v.label&&s.jsx("p",{className:"text-xs text-destructive",children:v.label.message})]}),p&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.baseUrl")}),s.jsx(Ne,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...k("baseUrl"),className:"h-8 text-sm"})]}),f&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[l("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",l("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ne,{type:c&&C?"text":"password",placeholder:r,...k("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),C&&s.jsx("button",{type:"button",onClick:()=>m(!c),"aria-label":l(c?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:c?s.jsx(Ct,{size:14}):s.jsx(kt,{size:14})})]}),v.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:v.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Kt,{children:[s.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:l("settings.editProviderDialog.cancel")}),s.jsx(te,{type:"submit",size:"sm",disabled:N,children:l(N?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function es(e){const t=X.c(31),{providerKey:i,provider:r,open:a,onOpenChange:d}=e,n=oe(),o=ye(),j=r.id==="openai-compatible"&&i.presetId?Ye(i.presetId):void 0,_=j?.name??r.name;let S;t[0]!==i.id?(S=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=S):S=t[1];let l;t[2]!==i.id||t[3]!==o?(l=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=l):l=t[4];let c;t[5]!==a||t[6]!==S||t[7]!==l?(c={queryKey:S,queryFn:l,enabled:a,staleTime:0},t[5]=a,t[6]=S,t[7]=l,t[8]=c):c=t[8];const{data:m,isLoading:p}=Le(c),f=Dt,g=It,k="sm:max-w-md",h=Nt,y=Pt,P=n("settings.editProviderDialog.editTitle",{name:_});let v;t[9]!==y||t[10]!==P?(v=s.jsx(y,{children:P}),t[9]=y,t[10]=P,t[11]=v):v=t[11];let C;t[12]!==h||t[13]!==v?(C=s.jsx(h,{children:v}),t[12]=h,t[13]=v,t[14]=C):C=t[14];let u;t[15]!==p||t[16]!==d||t[17]!==j||t[18]!==m||t[19]!==r||t[20]!==i?(u=p||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ut,{})}):s.jsx(Zt,{providerKey:i,provider:r,preset:j,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>d(!1),onSuccess:()=>d(!1)}),t[15]=p,t[16]=d,t[17]=j,t[18]=m,t[19]=r,t[20]=i,t[21]=u):u=t[21];let N;t[22]!==g||t[23]!==C||t[24]!==u?(N=s.jsxs(g,{className:k,children:[C,u]}),t[22]=g,t[23]=C,t[24]=u,t[25]=N):N=t[25];let x;return t[26]!==f||t[27]!==d||t[28]!==a||t[29]!==N?(x=s.jsx(f,{open:a,onOpenChange:d,children:N}),t[26]=f,t[27]=d,t[28]=a,t[29]=N,t[30]=x):x=t[30],x}function ts(e){const t=X.c(80),{providerKey:i,provider:r}=e,{org:a}=Ie(),d=ye(),n=De(),[o,j]=J.useState(!1),[_,S]=J.useState(!1),l=oe(),c=r.id==="openai-compatible";let m;t[0]!==c||t[1]!==i.presetId?(m=c&&i.presetId?Ye(i.presetId):void 0,t[0]=c,t[1]=i.presetId,t[2]=m):m=t[2];const p=m,f=p?p.name:c?"Custom OpenAI-compatible":r.name,g=p?.logo??r.logo;let k;e:{if(c){k=i.label;break e}const le=i.label;let ee;t[3]!==i.createdAt?(ee=wt(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=ee):ee=t[4],k=`${le} · added ${ee} ago`}const h=k;let y;t[5]!==i.id||t[6]!==d?(y=async()=>{await d.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=d,t[7]=y):y=t[7];let P;t[8]!==a||t[9]!==i.id||t[10]!==n||t[11]!==l?(P=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(a.id)}),n.invalidateQueries({queryKey:ie.aiProviders(a.id)}),n.invalidateQueries({queryKey:ie.aiProviderModels(a.id,i.id)}),re.success(l("settings.providerKeyRow.keyDeleted")),j(!1)},t[8]=a,t[9]=i.id,t[10]=n,t[11]=l,t[12]=P):P=t[12];let v;t[13]!==l?(v=le=>re.error(l("settings.providerKeyRow.failedToDeleteKey",{error:le.message})),t[13]=l,t[14]=v):v=t[14];let C;t[15]!==y||t[16]!==P||t[17]!==v?(C={mutationFn:y,onSuccess:P,onError:v},t[15]=y,t[16]=P,t[17]=v,t[18]=C):C=t[18];const{mutate:u,isPending:N}=je(C);let x;t[19]!==f||t[20]!==g?(x=g?s.jsx("img",{src:g,alt:f,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:f.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[19]=f,t[20]=g,t[21]=x):x=t[21];let K;t[22]!==l?(K=l("settings.providerKeyRow.editProviderKey"),t[22]=l,t[23]=K):K=t[23];let V,G;t[24]===Symbol.for("react.memo_cache_sentinel")?(G=()=>S(!0),V=s.jsx(jt,{size:14}),t[24]=V,t[25]=G):(V=t[24],G=t[25]);let O;t[26]!==K?(O=s.jsx(te,{variant:"ghost",size:"icon","aria-label":K,className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:G,children:V}),t[26]=K,t[27]=O):O=t[27];let B;t[28]!==l?(B=l("settings.providerKeyRow.deleteProviderKey"),t[28]=l,t[29]=B):B=t[29];let U,H;t[30]===Symbol.for("react.memo_cache_sentinel")?(U=()=>j(!0),H=s.jsx(St,{size:14}),t[30]=U,t[31]=H):(U=t[30],H=t[31]);let q;t[32]!==N||t[33]!==B?(q=s.jsx(te,{variant:"ghost",size:"icon","aria-label":B,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:N,onClick:U,children:H}),t[32]=N,t[33]=B,t[34]=q):q=t[34];let L;t[35]!==O||t[36]!==q?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[O,q]}),t[35]=O,t[36]=q,t[37]=L):L=t[37];let E;t[38]!==h||t[39]!==f||t[40]!==L||t[41]!==x?(E=s.jsx(Qe,{icon:x,title:f,description:h,action:L}),t[38]=h,t[39]=f,t[40]=L,t[41]=x,t[42]=E):E=t[42];let R;t[43]!==_||t[44]!==r||t[45]!==i?(R=s.jsx(es,{providerKey:i,provider:r,open:_,onOpenChange:S}),t[43]=_,t[44]=r,t[45]=i,t[46]=R):R=t[46];let F;t[47]!==l?(F=l("settings.providerKeyRow.deleteApiKey"),t[47]=l,t[48]=F):F=t[48];let T;t[49]!==F?(T=s.jsx(We,{children:F}),t[49]=F,t[50]=T):T=t[50];let z;t[51]!==i.label?(z=s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[51]=i.label,t[52]=z):z=t[52];let b;t[53]!==T||t[54]!==z?(b=s.jsxs(Xe,{children:[T,z]}),t[53]=T,t[54]=z,t[55]=b):b=t[55];let A;t[56]!==l?(A=l("settings.providerKeyRow.cancel"),t[56]=l,t[57]=A):A=t[57];let M;t[58]!==A?(M=s.jsx(Ze,{children:A}),t[58]=A,t[59]=M):M=t[59];let w;t[60]!==u?(w=()=>u(),t[60]=u,t[61]=w):w=t[61];let I;t[62]!==l?(I=l("settings.providerKeyRow.delete"),t[62]=l,t[63]=I):I=t[63];let Y;t[64]!==w||t[65]!==I?(Y=s.jsx(et,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:I}),t[64]=w,t[65]=I,t[66]=Y):Y=t[66];let W;t[67]!==M||t[68]!==Y?(W=s.jsxs(tt,{children:[M,Y]}),t[67]=M,t[68]=Y,t[69]=W):W=t[69];let $;t[70]!==b||t[71]!==W?($=s.jsxs(st,{children:[b,W]}),t[70]=b,t[71]=W,t[72]=$):$=t[72];let Q;t[73]!==o||t[74]!==$?(Q=s.jsx(it,{open:o,onOpenChange:j,children:$}),t[73]=o,t[74]=$,t[75]=Q):Q=t[75];let Z;return t[76]!==E||t[77]!==R||t[78]!==Q?(Z=s.jsxs(s.Fragment,{children:[E,R,Q]}),t[76]=E,t[77]=R,t[78]=Q,t[79]=Z):Z=t[79],Z}function ss(e){const t=X.c(17),{onConnectClick:i}=e,r=oe(),a=Se(),d=Ge();let n;t[0]!==d?.providers?(n=d?.providers??[],t[0]=d?.providers,t[1]=n):n=t[1];const o=n;let j;if(t[2]!==a||t[3]!==i||t[4]!==o||t[5]!==r){let _;t[7]!==o?(_=f=>({key:f,provider:o.find(g=>g.id===f.providerId)}),t[7]=o,t[8]=_):_=t[8];const S=a.filter(rs).map(_).filter(ls);let l;t[9]!==r?(l=r("settings.connectedProvidersSection.sectionTitle"),t[9]=r,t[10]=l):l=t[10];let c;t[11]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(yt,{size:14}),t[11]=c):c=t[11];let m;t[12]!==r?(m=r("settings.connectedProvidersSection.connectButton"),t[12]=r,t[13]=m):m=t[13];let p;t[14]!==i||t[15]!==m?(p=s.jsxs(te,{size:"sm",onClick:i,children:[c,m]}),t[14]=i,t[15]=m,t[16]=p):p=t[16],j=s.jsx(Re,{title:l,headerClassName:"px-0",actions:p,children:S.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Ee,{children:S.map(is)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=r,t[6]=j}else j=t[6];return j}function is(e){const{key:t,provider:i}=e;return s.jsx(ts,{providerKey:t,provider:i},t.id)}function ls(e){return e.provider!==void 0}function rs(e){return e.providerId!=="deco"}function os(e){const t=X.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(nt,{size:16}),t[0]=r):r=t[0];let a;return t[1]!==i.message?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[r,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=a):a=t[2],a}function ns(){const e=X.c(23),t=Se();let i;e[0]!==t?(i=t.some(as),e[0]=t,e[1]=i):i=e[1];const r=i,a=t.length>0,[d,n]=J.useState(!1),[o,j]=J.useState(null),_=Ge();let S;e[2]!==_?.providers?(S=_?.providers??[],e[2]=_?.providers,e[3]=S):S=e[3];const l=S;if(!a){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>n(!0),e[4]=k):k=e[4];let h;e[5]!==l?(h=s.jsx(xt,{providers:l,onSelect:j,onShowAll:k}),e[5]=l,e[6]=h):h=e[6];const y=o!==null||d;let P;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=N=>{N||(j(null),n(!1))},e[7]=P):P=e[7];const v=o??void 0;let C;e[8]!==y||e[9]!==v?(C=s.jsx($e,{open:y,onOpenChange:P,initialProvider:v}),e[8]=y,e[9]=v,e[10]=C):C=e[10];let u;return e[11]!==h||e[12]!==C?(u=s.jsxs(s.Fragment,{children:[h,C]}),e[11]=h,e[12]=C,e[13]=u):u=e[13],u}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-16 w-full"}),children:s.jsx(Ut,{})}),e[14]=c):c=e[14];let m;e[15]!==r?(m=r?s.jsx(Vt,{}):s.jsx(Wt,{}),e[15]=r,e[16]=m):m=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ss,{onConnectClick:()=>n(!0)}),e[17]=p):p=e[17];let f;e[18]!==d?(f=s.jsx($e,{open:d,onOpenChange:n}),e[18]=d,e[19]=f):f=e[19];let g;return e[20]!==m||e[21]!==f?(g=s.jsxs(s.Fragment,{children:[c,m,p,f]}),e[20]=m,e[21]=f,e[22]=g):g=e[22],g}function as(e){return e.providerId==="deco"}function cs(){const e=X.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ke.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ke,{children:s.jsx(ke.Content,{children:s.jsx(ke.Body,{children:s.jsxs(at,{children:[t,s.jsx(ot,{fallback:ds,children:s.jsx(J.Suspense,{fallback:s.jsx(Me,{className:"h-64 w-full"}),children:s.jsx(ns,{})})})]})})})}),e[1]=i):i=e[1],i}function ds(e){const{error:t}=e;return s.jsx(os,{error:t??new Error("Failed to load AI providers")})}function yi(){const e=X.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(At,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(cs,{})}),e[0]=t):t=e[0],t}export{yi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as o,j as c,bB as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,bB as d}from"./index-C8rlFaFO.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r,cL as w,r as i,aS as m,dG as O,F as T,aU as M,cK as I,cM as F,cO as A,dH as D,cN as L,cW as z,aQ as G,cY as H,cP as W,c as n,l as p,bP as v}from"./index-
|
|
1
|
+
import{j as r,cL as w,r as i,aS as m,dG as O,F as T,aU as M,cK as I,cM as F,cO as A,dH as D,cN as L,cW as z,aQ as G,cY as H,cP as W,c as n,l as p,bP as v}from"./index-C8rlFaFO.js";var x="AlertDialog",[Y]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var k="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});V.displayName=k;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(W,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[K,Q]=Y(f),U=z("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),S=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(K,{scope:t,cancelRef:u,children:r.jsxs(T,{role:"alertdialog",...s,...o,ref:S,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(U,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});R.displayName=E;var J="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=J;var $="AlertDialogCancel",P=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=Q($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});P.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-QeeIyPD-.js";import{i as jt}from"./ChevronRight-DQFD5vOs.js";import{m as kt}from"./automation-runs-oeg4SZH2.js";import{A as _t}from"./add-section-modal-Bu0jJfTp.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-D_TDrkT8.js";import"./select-BK6Fwx47.js";import"./tooltip-CfmdP-aL.js";import"./ChevronUp-Bu3KYaYp.js";import"./ChevronDown-CtpYRw0N.js";import"./useInfiniteQuery-DvViU0Gq.js";import"./use-infinite-scroll-Cylb4hyl.js";import"./use-connection-BlWYloF8.js";import"./use-collections-CI5XorIY.js";import"./use-mcp-client-DXFWWHbs.js";import"./auth-wA89jw5z.js";import"./use-virtual-mcp-D9jFTGjm.js";import"./card-BZY4DqkC.js";import"./sidebar-BjCGlNJL.js";import"./LayoutLeft-DgCOjEX2.js";import"./use-mobile-CEVETdVq.js";import"./X-BJznV24Z.js";import"./table-FWVzL2nm.js";import"./empty-state-uOmVY7AV.js";import"./use-members-C1OZBryu.js";import"./use-org-auth-client-BFFpNQiA.js";import"./use-clock-tick-CI9n9Iqh.js";import"./AlertCircle-BtNVN6lT.js";import"./CheckCircle-Dqg_7udX.js";import"./DotsVertical-4fMK5hdE.js";import"./agent-icon-CMi9hXve.js";import"./Tool01-DoTp9Ymb.js";import"./ArrowUp-SfmKmvG1.js";import"./Settings02-Kn3GUgY3.js";import"./Tool02-f6hCEEx5.js";import"./XCircle-Mn7Ozb-Q.js";import"./ArrowUpRight-DPmhEMyl.js";import"./TrendUp01-DdLolkHU.js";import"./ZapSquare-Chem9D1s.js";import"./ZoomOut-znim4joS.js";import"./Users03-DQDFsIZA.js";import"./Stars02-ByALJtc-.js";import"./Copy01-B4AQ9voq.js";import"./Globe01-BEuNOgWE.js";import"./Eye-7UpR5EsV.js";import"./FilterLines-jo0eHglf.js";import"./Star01-UbWAuLRP.js";import"./Globe04-ezZLp1FH.js";import"./SwitchHorizontal01-B2hcs1rw.js";import"./HardDrive-Bx0yMIUr.js";import"./Image01-BemfbeRy.js";import"./Key01-wlopeCn8.js";import"./LinkExternal01-DjHN0DVc.js";import"./Monitor01-CvVGHJ2u.js";import"./Sun-ERdj2Ruh.js";import"./Package-Dkg7P-qU.js";import"./Palette-DnEGtR5r.js";import"./Play-pFWdRfmo.js";import"./Plus-BhgoGeba.js";import"./SearchLg-D7iDyCtR.js";import"./SearchMd-DU7sZsGX.js";import"./Shield01-BF7nZR91.js";import"./Stars01-CKHcD24W.js";import"./Trash01-Dgm4FHaX.js";import"./Upload01-DPgiWRF2.js";import"./User01-4oxhkWpc.js";import"./Users01-CbDWoQDz.js";import"./XClose-BYGQndp2.js";import"./Zap-SMAt3bB0.js";import"./use-automations-URCauyn7.js";import"./studio-tools-Dz5m3DDC.js";import"./useSuspenseInfiniteQuery-COT_NVJE.js";import"./avatar-D2faXu9B.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CCSClSvL.js";import"./file-type-icon-DLDSmTyC.js";import"./dialog-B_MtszrV.js";import"./tab-id-BijBBRwE.js";import"./hooks-CQZHp8Dt.js";import"./decopilot-sse-pool-us-M5mS8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-8zti4wkh.js";import"./autosend-DFAdUSMh.js";import"./use-ai-providers-UWnZZKKY.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-CqSDZlRU.js";import"./use-organization-settings-BpxUnud5.js";import"./monaco-editor-CAwKA7tN.js";import"./index-B-kvMeNd.js";import"./index-d_66hXvz.js";import"./calendar-C55pfZGp.js";import"./shell-layout-CGSn6NPr.js";import"./use-t-BKpqHjpb.js";import"./required-auth-layout-BON6U2A_.js";import"./use-org-sso-QrZAqFtN.js";import"./integration-icon-nHJfLZDJ.js";import"./use-navigate-to-agent-CflMFlHw.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-G7ca0KYF.js";import"./form-CBH5rcB6.js";import"./label-B8xrTNKP.js";import"./input-ksjqlSwm.js";import"./drawer-BsQ2VY2t.js";import"./collection-search-B4ji9AjC.js";import"./index-CAK7n_FO.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-CkuNrX2M.js";import"./use-mcp-tools-ePfAnuof.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CO2Dkq5Q.js";import"./mcp-oauth-C_zNkYXB.js";import"./extract-connection-data-B1PMDhhA.js";import"./dropdown-menu-CCf9b-Ue.js";import"./popover-3l0deoOx.js";import"./command-BeMVvNyF.js";import"./index-DWmvNX0u.js";import"./companions-core-D6ZCzGBn.js";import"./tabs-BovIXRni.js";import"./toggle-group-DvzPCkJs.js";import"./use-deco-credits-Bov6Ef1l.js";import"./connection-card-7Jlr5ou8.js";import"./use-registry-connections-DWBXDDYI.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B0BnrQRd.js";import"./connection-form-helpers-BT4sViBb.js";import"./collection-tabs-DTWzD8v3.js";import"./badge-C22fJvJ9.js";import"./connect-desktop-dialog-ekgjUng_.js";import"./select-model-FeZ2YvBx.js";import"./checkbox-DvRekaoI.js";import"./skeleton-4wAys1SB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section--wnksRdd.js";import"./index-C1alCXBf.js";import"./alert-dialog-9jx8jzEO.js";import"./toolbar-Dde3UP0K.js";import"./use-debounced-value-DuzsGBjb.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-2UIUBUS4.js";import"./use-capability-B2RpFGXs.js";import"./toolbar-icon-button-BGzii147.js";import"./use-debounced-autosave-DbO1S1EK.js";import"./index-F-zmfSqw.js";import"./search-input-UOEApV9M.js";import"./use-mcp-auth-status-D-mrOgSF.js";import"./switch-BGTwAogo.js";import"./github-repo-picker-DWdab-4Y.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-C8ssS7Ik.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-BsBJamST.js";import"./automation-list-row-CZVotwYb.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Cr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Cr as AppEditor};
|
|
1
|
+
import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-C8rlFaFO.js";import{i as jt}from"./ChevronRight-BnIvJcIZ.js";import{m as kt}from"./automation-runs-_XAGR1m2.js";import{A as _t}from"./add-section-modal-De0GxBTc.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-B_qFi_-_.js";import"./select-4-vdHbLT.js";import"./tooltip-DE_gqCm3.js";import"./ChevronUp-Ci-XiWb6.js";import"./ChevronDown-D_W2bIqv.js";import"./useInfiniteQuery-mNPfD3Pk.js";import"./use-infinite-scroll-BI8YTyTt.js";import"./use-connection-CcmTBTY-.js";import"./use-collections-u5tkBX1a.js";import"./use-mcp-client-PcphUWIj.js";import"./auth-Kymy4xkz.js";import"./use-virtual-mcp-BtFe5DoR.js";import"./card-CoG27DVs.js";import"./sidebar-AfeWMY1r.js";import"./LayoutLeft-COV7zlIC.js";import"./use-mobile-C57pT7o9.js";import"./X-CLG08ht8.js";import"./table-iG6kCmeS.js";import"./empty-state-kSEyPCAz.js";import"./use-members-JooO5O_z.js";import"./use-org-auth-client-C0qPMRhc.js";import"./use-clock-tick-Dw7sAB29.js";import"./AlertCircle-Cvc_10Uv.js";import"./CheckCircle-B5oIKeSF.js";import"./DotsVertical-Bcfqjiks.js";import"./agent-icon-BIj6WxKp.js";import"./Tool01-DBXzU6aR.js";import"./ArrowUp-Dq6JgHsq.js";import"./Settings02-CU2rilKq.js";import"./Tool02-rl8XhSPG.js";import"./XCircle-pZ6nD22L.js";import"./ArrowUpRight-DgI9ki5h.js";import"./TrendUp01-BmzCTIbp.js";import"./ZapSquare-DdKvM81Z.js";import"./ZoomOut-DAAhtu2Z.js";import"./Users03-3HXi1aia.js";import"./Stars02-CdgckoDr.js";import"./Copy01-Q4xZmPKp.js";import"./Globe01-qjaQZUfN.js";import"./Eye-BuukW7MV.js";import"./FilterLines-Do4UgzmV.js";import"./Star01-D4LxiizA.js";import"./Globe04-CqIGMVDi.js";import"./SwitchHorizontal01-DNcPUv7P.js";import"./HardDrive-DrLvUMYg.js";import"./Image01-BWotytID.js";import"./Key01-BPZUhUcV.js";import"./LinkExternal01-CyMOdGfe.js";import"./Monitor01-dLHbd0CB.js";import"./Sun-Ca3eslhz.js";import"./Package-B7Qii2Tl.js";import"./Palette-tVNOj7Ym.js";import"./Play-BE8nTtBp.js";import"./Plus-5VWQJEkS.js";import"./SearchLg-BiyFAMx0.js";import"./SearchMd-LbMkvaPD.js";import"./Shield01-7KT2UKvg.js";import"./Stars01-HAbkffzq.js";import"./Trash01-DxXosbkh.js";import"./Upload01-CXsTipbe.js";import"./User01-CZgThaZQ.js";import"./Users01-IdyAszrF.js";import"./XClose-BYq2BBpT.js";import"./Zap-C6tkfs5m.js";import"./use-automations-Btiu7Z09.js";import"./studio-tools-B3FHZXsQ.js";import"./useSuspenseInfiniteQuery-DIVSilzv.js";import"./avatar-1o2VQKTj.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CveeH2p4.js";import"./file-type-icon-CeQVzqDu.js";import"./dialog-ChJw5xnr.js";import"./tab-id-BijBBRwE.js";import"./hooks-CJqrF4BQ.js";import"./decopilot-sse-pool-DEJZ4gJu.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-glCfFIWX.js";import"./autosend-D-JHJKNK.js";import"./use-ai-providers-CGzSWtp7.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-VInARyiN.js";import"./use-organization-settings-DBhnNnJm.js";import"./monaco-editor-CJKnQM68.js";import"./index-DyXd0E61.js";import"./index-CHWLrEqX.js";import"./calendar-C9b1I5Xh.js";import"./shell-layout-DvMdeukx.js";import"./use-t-BeHordU2.js";import"./required-auth-layout-CR5_YK6W.js";import"./use-org-sso-BaYh30WC.js";import"./integration-icon-BXEpLE2r.js";import"./use-navigate-to-agent-DVHUkqpb.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-D4PMIsMV.js";import"./form-BUM27CLj.js";import"./label-BbLr7wPS.js";import"./input-CWExGH7j.js";import"./drawer-_WfOhyRU.js";import"./collection-search-DuPY-s4R.js";import"./index-CWlzI7M3.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-Dyfesgrg.js";import"./use-mcp-tools-CakNulXp.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DAAmwSgR.js";import"./mcp-oauth-B2KaqQoI.js";import"./extract-connection-data-oUFnwuwD.js";import"./dropdown-menu-B7HOgSu8.js";import"./popover-kOy_asOa.js";import"./command-BB6Oir8o.js";import"./index-CR0rMz7E.js";import"./companions-core-C-kZqiTC.js";import"./tabs-C1LpzuaJ.js";import"./toggle-group-c5TjS6xS.js";import"./use-deco-credits-CV7sw9Em.js";import"./connection-card-7gBTmFox.js";import"./use-registry-connections-CTtHQqlB.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-B8dhUfp9.js";import"./connection-form-helpers-CJKig9hy.js";import"./collection-tabs-CcN3J070.js";import"./badge-dHBIjKyY.js";import"./connect-desktop-dialog-CUGIAU17.js";import"./select-model-CVcEVUsi.js";import"./checkbox-BOAToSlJ.js";import"./skeleton-DraYvTQP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DxqR9iml.js";import"./index-CWGwstEz.js";import"./alert-dialog-D2oa47X8.js";import"./toolbar-Daz4jqLs.js";import"./use-debounced-value-D1xFGN32.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DJxvpKl9.js";import"./use-capability-BNcFOggs.js";import"./toolbar-icon-button-Bbbo7hyv.js";import"./use-debounced-autosave-DFle-8Sb.js";import"./index-Bj_MaVUP.js";import"./search-input-B6akQV4Y.js";import"./use-mcp-auth-status-DINFEYgi.js";import"./switch-CyZjNvfZ.js";import"./github-repo-picker-4TIPzYjR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-BYzFSfMf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./use-file-configs-BEHJ-b8Q.js";import"./automation-list-row-D-cT9rxb.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Cr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Cr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cs as I,ct as $,cu as W,cv as L,cw as H,cx as D,cy as x,cz as V,cA as q,cB as j,cC as y,cD as N,cE as B,cF as F,cG as Z}from"./index-QeeIyPD-.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof x)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:v}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(b),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return I.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await 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 C(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return V.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=C(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=C(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,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{cs as I,ct as $,cu as W,cv as L,cw as H,cx as D,cy as x,cz as V,cA as q,cB as j,cC as y,cD as N,cE as B,cF as F,cG as Z}from"./index-C8rlFaFO.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof x)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const O=!e.redirectUrl;if(n!==void 0||O){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:v}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(b),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return I.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await 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 C(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return V.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=C(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=C(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,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,e as m,j as t,A as f,S as h,f as x,g as r,h as p,N as u}from"./index-
|
|
1
|
+
import{c as l,e as m,j as t,A as f,S as h,f as x,g as r,h as p,N as u}from"./index-C8rlFaFO.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as pe,r as f,d as J,p as I,a as _,j as e,l as u,B as ge,c as Pe,S as fe}from"./index-QeeIyPD-.js";import{I as U}from"./input-ksjqlSwm.js";import{r as Ce,R as Ae}from"./retry-CErkP7V6.js";const Q="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ie={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:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,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 _e({redirectUrl:r,callbackUrl:a="/",title:b,subtitle:x,brand:d,copy:v,variant:g="default",allowedSocialProviders:c,allowPassword:k=!0,onAuthEvent:W}){const{emailAndPassword:L,resetPassword:D,emailOtp:m,socialProviders:j}=pe(),l=t=>{try{W?.(t)}catch{}},h=g==="compact",z=c?j.providers.filter(t=>c.includes(t.name)):j.providers,H=j.enabled&&z.length>0,X=L.enabled&&(k||!m.enabled&&!H),$=j.enabled&&j.providers.length>0&&!H&&!m.enabled&&!X?j.providers:z,y=j.enabled&&$.length>0,w=L.enabled&&(k||!m.enabled&&!y),[n,G]=f.useState(""),[Y,xe]=f.useState(""),[Z,ne]=f.useState(""),[ee,te]=f.useState(""),[F,se]=f.useState(!1),[ae,be]=f.useState(()=>m.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[E,O]=f.useState(""),[re,oe]=f.useState(!1),s={...Ie,...v},p=ae==="signUp",P=ae==="forgotPassword",N=ae==="emailOtp",q=J({mutationFn:async({email:t,password:i,name:C})=>{try{if(p){const S=await _.signUp.email({email:t,password:i,name:C||""});if(S.error)throw new Error(S.error.message||s.signUpFailed);return S}else{const S=await _.signIn.email({email:t,password:i});if(S.error)throw new Error(S.error.message||s.signInFailed);return S}}catch(S){throw S instanceof Error?S:new Error(s.authenticationFailed)}},onMutate:()=>{l({type:"started",method:"email_password",mode:p?"sign_up":"sign_in"})},onSuccess:()=>{l({type:"succeeded",method:"email_password",mode:p?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=r??a},onError:t=>{l({type:"failed",method:"email_password",mode:p?"sign_up":"sign_in",stage:"authenticate",error:t instanceof Error?t.message:String(t)}),I(p?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),V=J({mutationFn:async({email:t})=>{const i=await _.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(i.error)throw new Error(i.error.message||s.resetEmailFailed);return i},onSuccess:()=>{I("password_reset_requested"),oe(!0)},onError:t=>{I("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),T=J({mutationFn:async({email:t})=>{const i=await _.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(i.error)throw new Error(i.error.message||s.otpSendFailed);return i},onMutate:()=>{l({type:"started",method:"email_otp"})},onSuccess:()=>{l({type:"otp_sent",method:"email_otp"}),I("email_otp_sent"),se(!0)},onError:t=>{l({type:"failed",method:"email_otp",stage:"send_otp",error:t instanceof Error?t.message:String(t)}),I("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),R=J({mutationFn:async({email:t,otp:i})=>{const C=await _.signIn.emailOtp({email:t,otp:i});if(C.error)throw new Error(C.error.message||s.invalidCode);return C},onMutate:()=>{l({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{l({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=r??a},onError:t=>{l({type:"failed",method:"email_otp",stage:"verify_otp",error:t instanceof Error?t.message:String(t)}),I("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),K=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),ie=()=>{n.trim()&&!K(n)&&O(s.invalidEmail)},ve=t=>{if(t.preventDefault(),!K(n)){O(s.invalidEmail),l({type:"failed",method:"email_password",mode:p?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}q.mutate({email:n,password:Y,name:Z})},ye=t=>{if(t.preventDefault(),!K(n)){O(s.invalidEmail);return}V.mutate({email:n})},we=t=>{if(t.preventDefault(),!K(n)){O(s.invalidEmail),l({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}T.mutate({email:n})},Ee=t=>{t.preventDefault(),R.mutate({email:n,otp:ee})},M=t=>i=>{t(i.target.value),le&&q.reset(),de&&V.reset(),ce&&(T.reset(),R.reset()),t===G&&E&&O("")},B=t=>{be(t),ne(""),te(""),se(!1),O(""),oe(!1),q.reset(),V.reset(),T.reset(),R.reset()},o=q.isPending||V.isPending||T.isPending||R.isPending,le=q.error,de=V.error,ce=T.error||R.error,A=p?n.trim()&&Y.trim()&&Z.trim():P?n.trim():N?F?ee.trim():n.trim():n.trim()&&Y.trim(),Se=t=>{if(!t)return null;const i=t.message.toLowerCase();return i.includes("unauthorized")||i.includes("401")?s.invalidEmailOrPassword:i.includes("already exists")||i.includes("409")?s.accountExists:i.includes("network")||i.includes("fetch")?s.networkError:i.includes("rate limit")||i.includes("429")?s.tooManyAttempts:i.includes("invalid")&&i.includes("otp")?s.invalidOrExpiredCode:t.message||s.genericError},me=le||de||ce,je=async t=>{l({type:"started",method:"social",provider:t});try{const i=await _.signIn.social({provider:t,callbackURL:r??a});if(i.error)throw new Error(i.error.message||s.authenticationFailed)}catch(i){const C=i instanceof Error?i.message:String(i);l({type:"failed",method:"social",provider:t,stage:"redirect",error:C}),I("social_signin_failed",{provider:t,error:C})}},Ne=P?s.resetPasswordTitle:N&&F?s.verificationCodeTitle:b??s.welcomeTitle,ue=P?s.resetPasswordSubtitle:N&&F?s.codeSentTo(n):x===void 0?s.defaultSubtitle:x;return e.jsxs("div",{className:u("grid w-full",h?"gap-5":"gap-10"),children:[d??e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:u("font-medium",h?"text-xl leading-7":"text-2xl leading-8"),children:Ne}),ue&&e.jsx("p",{className:u("text-muted-foreground",h?"text-sm leading-5":"text-base leading-6"),children:ue})]}),me&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:Se(me)}),re&&e.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:s.resetEmailSent}),!P&&!(N&&F)&&y&&e.jsx("div",{className:"grid gap-2",children:$.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{je(t.name)},className:u("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",h?"h-11 rounded-lg":"h-12 rounded-xl"),children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:u("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),s.continueWith(t.name.charAt(0).toUpperCase()+t.name.slice(1))]},t.name))}),!P&&!(N&&F)&&y&&(w||m.enabled)&&e.jsxs("div",{className:u("flex items-center gap-2.5",h?"my-0":"-my-4"),children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:u("text-muted-foreground",h?"text-sm":"text-base"),children:s.divider}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),N&&m.enabled&&e.jsx(e.Fragment,{children:F?e.jsxs("form",{onSubmit:Ee,className:u("grid gap-2",h&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:u("text-sm font-medium text-foreground",h&&"sr-only"),children:s.verificationCodeLabel}),e.jsx(U,{type:"text",placeholder:s.enterCodePlaceholder,value:ee,onChange:M(te),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!A,className:u("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",h?"h-11 sm:w-auto":"h-12 w-full"),children:o?s.verifying:s.verify}),e.jsx("button",{type:"button",onClick:()=>{se(!1),te(""),T.reset(),R.reset()},disabled:o,className:u("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",h&&"sm:col-span-2"),children:s.useDifferentEmail})]}):e.jsxs("form",{onSubmit:we,className:u("grid gap-2",h&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:u("text-sm font-medium text-foreground",h&&"sr-only"),children:s.emailLabel}),e.jsx(U,{type:"email",placeholder:s.emailPlaceholder,value:n,onChange:M(G),onBlur:ie,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive",children:E})]}),e.jsx("button",{type:"submit",disabled:o||!A,className:u("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",h?"h-11 sm:w-auto":"h-12 w-full"),children:o?s.sending:s.sendCode})]})}),P&&w&&!re&&e.jsxs("form",{onSubmit:ye,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(U,{type:"email",placeholder:"you@example.com",value:n,onChange:M(G),onBlur:ie,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:E})]}),e.jsx(ge,{type:"submit",disabled:o||!A,className:"w-full font-semibold",size:"xl",children:o?s.sending:s.sendResetLink})]}),!P&&!N&&w&&e.jsxs("form",{onSubmit:ve,className:"grid gap-5",children:[p&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.nameLabel}),e.jsx(U,{type:"text",placeholder:s.namePlaceholder,value:Z,onChange:M(ne),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(U,{type:"email",placeholder:"you@example.com",value:n,onChange:M(G),onBlur:ie,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:E})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:s.passwordLabel}),!p&&D.enabled&&e.jsx("button",{type:"button",onClick:()=>B("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:s.forgotPassword})]}),e.jsx(U,{type:"password",placeholder:"••••••••",value:Y,onChange:M(xe),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:u("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",A?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:u("p-1",!A&&"pointer-events-none"),children:e.jsx(ge,{type:"submit",disabled:o||!A,className:u("w-full font-semibold"),size:"xl","aria-hidden":!A,children:o?p?s.creatingAccount:s.signingIn:s.continue})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:P?e.jsx("button",{type:"button",onClick:()=>B("signIn"),disabled:o,className:Q,children:s.backToSignIn}):N&&w?e.jsx("button",{type:"button",onClick:()=>B("signIn"),disabled:o,className:Q,children:s.signInWithPassword}):!N&&w?e.jsxs(e.Fragment,{children:[p?s.alreadyHaveAccount:s.dontHaveAccount,e.jsx("button",{type:"button",onClick:()=>B(p?"signIn":"signUp"),disabled:o,className:Q,children:p?s.signIn:s.signUp}),m.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>B("emailOtp"),disabled:o,className:Q,children:s.signInWithEmailCode})]})]}):null})]})}class he{constructor(a){this.response=a}response}function ke(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function Le({redirectTo:r,onAuthEvent:a}){const[b,x]=f.useState(null),d=f.useEffectEvent(v=>{try{a?.(v)}catch{}});return f.useEffect(()=>{let v=!1;return(async()=>{d({type:"started",method:"local"});try{let g;try{g=await Ce(async()=>{const c=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(c.status>=500)throw new he(c);return c},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(c){if(c instanceof Ae&&c.cause instanceof he)g=c.cause.response;else throw c}if(!g.ok){const c=await g.json().catch(()=>({}));throw new Error(c?.error||"Auto-login failed")}v||(d({type:"succeeded",method:"local"}),window.location.href=ke(r))}catch(g){v||(d({type:"failed",method:"local",stage:"authenticate",error:g instanceof Error?g.message:String(g)}),x(g instanceof Error?g.message:"Auto-login failed"))}})(),()=>{v=!0}},[r]),b?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",b]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(fe,{})}function Fe({callbackURL:r,providerId:a,onAuthEvent:b}){const x=f.useEffectEvent(d=>{try{b?.(d)}catch{}});return f.useEffect(()=>{(async()=>{x({type:"started",method:"sso",provider:a});try{const d=await _.signIn.sso({providerId:a,callbackURL:r});if(d.error)throw new Error(d.error.message||"SSO redirect failed")}catch(d){x({type:"failed",method:"sso",provider:a,stage:"redirect",error:d instanceof Error?d.message:String(d)})}})()},[a,r]),e.jsx(fe,{})}function Me(r){const a=Pe.c(19),{callbackUrl:b,redirectUrl:x,allowAutoLogin:d,title:v,subtitle:g,brand:c,copy:k,variant:W,allowedSocialProviders:L,allowPassword:D,onAuthEvent:m}=r,j=d===void 0?!0:d,{sso:l,emailAndPassword:h,magicLink:z,emailOtp:H,socialProviders:X,localMode:$}=pe(),y=x||b;if($&&j){let n;return a[0]!==m||a[1]!==y?(n=e.jsx(Le,{redirectTo:y,onAuthEvent:m}),a[0]=m,a[1]=y,a[2]=n):n=a[2],n}if(l.enabled){let n;return a[3]!==m||a[4]!==y||a[5]!==l.providerId?(n=e.jsx(Fe,{callbackURL:y,providerId:l.providerId,onAuthEvent:m}),a[3]=m,a[4]=y,a[5]=l.providerId,a[6]=n):n=a[6],n}if(h.enabled||z.enabled||H.enabled||X.enabled){let n;return a[7]!==D||a[8]!==L||a[9]!==c||a[10]!==b||a[11]!==k||a[12]!==m||a[13]!==x||a[14]!==g||a[15]!==v||a[16]!==W?(n=e.jsx(_e,{redirectUrl:x,callbackUrl:b,title:v,subtitle:g,brand:c,copy:k,variant:W,allowedSocialProviders:L,allowPassword:D,onAuthEvent:m}),a[7]=D,a[8]=L,a[9]=c,a[10]=b,a[11]=k,a[12]=m,a[13]=x,a[14]=g,a[15]=v,a[16]=W,a[17]=n):n=a[17],n}let w;return a[18]===Symbol.for("react.memo_cache_sentinel")?(w=e.jsx("div",{children:"No login options available"}),a[18]=w):w=a[18],w}export{Me as A};
|
|
1
|
+
import{z as pe,r as f,d as J,p as I,a as _,j as e,l as u,B as ge,c as Pe,S as fe}from"./index-C8rlFaFO.js";import{I as U}from"./input-CWExGH7j.js";import{r as Ce,R as Ae}from"./retry-CErkP7V6.js";const Q="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ie={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:r=>`Code sent to ${r}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:r=>`Continue with ${r}`,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 _e({redirectUrl:r,callbackUrl:a="/",title:b,subtitle:x,brand:d,copy:v,variant:g="default",allowedSocialProviders:c,allowPassword:k=!0,onAuthEvent:W}){const{emailAndPassword:L,resetPassword:D,emailOtp:m,socialProviders:j}=pe(),l=t=>{try{W?.(t)}catch{}},h=g==="compact",z=c?j.providers.filter(t=>c.includes(t.name)):j.providers,H=j.enabled&&z.length>0,X=L.enabled&&(k||!m.enabled&&!H),$=j.enabled&&j.providers.length>0&&!H&&!m.enabled&&!X?j.providers:z,y=j.enabled&&$.length>0,w=L.enabled&&(k||!m.enabled&&!y),[n,G]=f.useState(""),[Y,xe]=f.useState(""),[Z,ne]=f.useState(""),[ee,te]=f.useState(""),[F,se]=f.useState(!1),[ae,be]=f.useState(()=>m.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[E,O]=f.useState(""),[re,oe]=f.useState(!1),s={...Ie,...v},p=ae==="signUp",P=ae==="forgotPassword",N=ae==="emailOtp",q=J({mutationFn:async({email:t,password:i,name:C})=>{try{if(p){const S=await _.signUp.email({email:t,password:i,name:C||""});if(S.error)throw new Error(S.error.message||s.signUpFailed);return S}else{const S=await _.signIn.email({email:t,password:i});if(S.error)throw new Error(S.error.message||s.signInFailed);return S}}catch(S){throw S instanceof Error?S:new Error(s.authenticationFailed)}},onMutate:()=>{l({type:"started",method:"email_password",mode:p?"sign_up":"sign_in"})},onSuccess:()=>{l({type:"succeeded",method:"email_password",mode:p?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=r??a},onError:t=>{l({type:"failed",method:"email_password",mode:p?"sign_up":"sign_in",stage:"authenticate",error:t instanceof Error?t.message:String(t)}),I(p?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),V=J({mutationFn:async({email:t})=>{const i=await _.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(i.error)throw new Error(i.error.message||s.resetEmailFailed);return i},onSuccess:()=>{I("password_reset_requested"),oe(!0)},onError:t=>{I("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),T=J({mutationFn:async({email:t})=>{const i=await _.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(i.error)throw new Error(i.error.message||s.otpSendFailed);return i},onMutate:()=>{l({type:"started",method:"email_otp"})},onSuccess:()=>{l({type:"otp_sent",method:"email_otp"}),I("email_otp_sent"),se(!0)},onError:t=>{l({type:"failed",method:"email_otp",stage:"send_otp",error:t instanceof Error?t.message:String(t)}),I("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),R=J({mutationFn:async({email:t,otp:i})=>{const C=await _.signIn.emailOtp({email:t,otp:i});if(C.error)throw new Error(C.error.message||s.invalidCode);return C},onMutate:()=>{l({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{l({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=r??a},onError:t=>{l({type:"failed",method:"email_otp",stage:"verify_otp",error:t instanceof Error?t.message:String(t)}),I("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),K=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),ie=()=>{n.trim()&&!K(n)&&O(s.invalidEmail)},ve=t=>{if(t.preventDefault(),!K(n)){O(s.invalidEmail),l({type:"failed",method:"email_password",mode:p?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}q.mutate({email:n,password:Y,name:Z})},ye=t=>{if(t.preventDefault(),!K(n)){O(s.invalidEmail);return}V.mutate({email:n})},we=t=>{if(t.preventDefault(),!K(n)){O(s.invalidEmail),l({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}T.mutate({email:n})},Ee=t=>{t.preventDefault(),R.mutate({email:n,otp:ee})},M=t=>i=>{t(i.target.value),le&&q.reset(),de&&V.reset(),ce&&(T.reset(),R.reset()),t===G&&E&&O("")},B=t=>{be(t),ne(""),te(""),se(!1),O(""),oe(!1),q.reset(),V.reset(),T.reset(),R.reset()},o=q.isPending||V.isPending||T.isPending||R.isPending,le=q.error,de=V.error,ce=T.error||R.error,A=p?n.trim()&&Y.trim()&&Z.trim():P?n.trim():N?F?ee.trim():n.trim():n.trim()&&Y.trim(),Se=t=>{if(!t)return null;const i=t.message.toLowerCase();return i.includes("unauthorized")||i.includes("401")?s.invalidEmailOrPassword:i.includes("already exists")||i.includes("409")?s.accountExists:i.includes("network")||i.includes("fetch")?s.networkError:i.includes("rate limit")||i.includes("429")?s.tooManyAttempts:i.includes("invalid")&&i.includes("otp")?s.invalidOrExpiredCode:t.message||s.genericError},me=le||de||ce,je=async t=>{l({type:"started",method:"social",provider:t});try{const i=await _.signIn.social({provider:t,callbackURL:r??a});if(i.error)throw new Error(i.error.message||s.authenticationFailed)}catch(i){const C=i instanceof Error?i.message:String(i);l({type:"failed",method:"social",provider:t,stage:"redirect",error:C}),I("social_signin_failed",{provider:t,error:C})}},Ne=P?s.resetPasswordTitle:N&&F?s.verificationCodeTitle:b??s.welcomeTitle,ue=P?s.resetPasswordSubtitle:N&&F?s.codeSentTo(n):x===void 0?s.defaultSubtitle:x;return e.jsxs("div",{className:u("grid w-full",h?"gap-5":"gap-10"),children:[d??e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:u("font-medium",h?"text-xl leading-7":"text-2xl leading-8"),children:Ne}),ue&&e.jsx("p",{className:u("text-muted-foreground",h?"text-sm leading-5":"text-base leading-6"),children:ue})]}),me&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:Se(me)}),re&&e.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:s.resetEmailSent}),!P&&!(N&&F)&&y&&e.jsx("div",{className:"grid gap-2",children:$.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{je(t.name)},className:u("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",h?"h-11 rounded-lg":"h-12 rounded-xl"),children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:u("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),s.continueWith(t.name.charAt(0).toUpperCase()+t.name.slice(1))]},t.name))}),!P&&!(N&&F)&&y&&(w||m.enabled)&&e.jsxs("div",{className:u("flex items-center gap-2.5",h?"my-0":"-my-4"),children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:u("text-muted-foreground",h?"text-sm":"text-base"),children:s.divider}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),N&&m.enabled&&e.jsx(e.Fragment,{children:F?e.jsxs("form",{onSubmit:Ee,className:u("grid gap-2",h&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:u("text-sm font-medium text-foreground",h&&"sr-only"),children:s.verificationCodeLabel}),e.jsx(U,{type:"text",placeholder:s.enterCodePlaceholder,value:ee,onChange:M(te),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!A,className:u("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",h?"h-11 sm:w-auto":"h-12 w-full"),children:o?s.verifying:s.verify}),e.jsx("button",{type:"button",onClick:()=>{se(!1),te(""),T.reset(),R.reset()},disabled:o,className:u("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",h&&"sm:col-span-2"),children:s.useDifferentEmail})]}):e.jsxs("form",{onSubmit:we,className:u("grid gap-2",h&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:u("text-sm font-medium text-foreground",h&&"sr-only"),children:s.emailLabel}),e.jsx(U,{type:"email",placeholder:s.emailPlaceholder,value:n,onChange:M(G),onBlur:ie,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive",children:E})]}),e.jsx("button",{type:"submit",disabled:o||!A,className:u("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",h?"h-11 sm:w-auto":"h-12 w-full"),children:o?s.sending:s.sendCode})]})}),P&&w&&!re&&e.jsxs("form",{onSubmit:ye,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(U,{type:"email",placeholder:"you@example.com",value:n,onChange:M(G),onBlur:ie,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:E})]}),e.jsx(ge,{type:"submit",disabled:o||!A,className:"w-full font-semibold",size:"xl",children:o?s.sending:s.sendResetLink})]}),!P&&!N&&w&&e.jsxs("form",{onSubmit:ve,className:"grid gap-5",children:[p&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.nameLabel}),e.jsx(U,{type:"text",placeholder:s.namePlaceholder,value:Z,onChange:M(ne),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(U,{type:"email",placeholder:"you@example.com",value:n,onChange:M(G),onBlur:ie,required:!0,disabled:o,"aria-invalid":!!E,className:"h-11 rounded-lg"}),E&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:E})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:s.passwordLabel}),!p&&D.enabled&&e.jsx("button",{type:"button",onClick:()=>B("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:s.forgotPassword})]}),e.jsx(U,{type:"password",placeholder:"••••••••",value:Y,onChange:M(xe),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:u("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",A?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:u("p-1",!A&&"pointer-events-none"),children:e.jsx(ge,{type:"submit",disabled:o||!A,className:u("w-full font-semibold"),size:"xl","aria-hidden":!A,children:o?p?s.creatingAccount:s.signingIn:s.continue})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:P?e.jsx("button",{type:"button",onClick:()=>B("signIn"),disabled:o,className:Q,children:s.backToSignIn}):N&&w?e.jsx("button",{type:"button",onClick:()=>B("signIn"),disabled:o,className:Q,children:s.signInWithPassword}):!N&&w?e.jsxs(e.Fragment,{children:[p?s.alreadyHaveAccount:s.dontHaveAccount,e.jsx("button",{type:"button",onClick:()=>B(p?"signIn":"signUp"),disabled:o,className:Q,children:p?s.signIn:s.signUp}),m.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>B("emailOtp"),disabled:o,className:Q,children:s.signInWithEmailCode})]})]}):null})]})}class he{constructor(a){this.response=a}response}function ke(r){return r.startsWith("/")&&!r.startsWith("//")?r:"/"}function Le({redirectTo:r,onAuthEvent:a}){const[b,x]=f.useState(null),d=f.useEffectEvent(v=>{try{a?.(v)}catch{}});return f.useEffect(()=>{let v=!1;return(async()=>{d({type:"started",method:"local"});try{let g;try{g=await Ce(async()=>{const c=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(c.status>=500)throw new he(c);return c},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(c){if(c instanceof Ae&&c.cause instanceof he)g=c.cause.response;else throw c}if(!g.ok){const c=await g.json().catch(()=>({}));throw new Error(c?.error||"Auto-login failed")}v||(d({type:"succeeded",method:"local"}),window.location.href=ke(r))}catch(g){v||(d({type:"failed",method:"local",stage:"authenticate",error:g instanceof Error?g.message:String(g)}),x(g instanceof Error?g.message:"Auto-login failed"))}})(),()=>{v=!0}},[r]),b?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",b]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(fe,{})}function Fe({callbackURL:r,providerId:a,onAuthEvent:b}){const x=f.useEffectEvent(d=>{try{b?.(d)}catch{}});return f.useEffect(()=>{(async()=>{x({type:"started",method:"sso",provider:a});try{const d=await _.signIn.sso({providerId:a,callbackURL:r});if(d.error)throw new Error(d.error.message||"SSO redirect failed")}catch(d){x({type:"failed",method:"sso",provider:a,stage:"redirect",error:d instanceof Error?d.message:String(d)})}})()},[a,r]),e.jsx(fe,{})}function Me(r){const a=Pe.c(19),{callbackUrl:b,redirectUrl:x,allowAutoLogin:d,title:v,subtitle:g,brand:c,copy:k,variant:W,allowedSocialProviders:L,allowPassword:D,onAuthEvent:m}=r,j=d===void 0?!0:d,{sso:l,emailAndPassword:h,magicLink:z,emailOtp:H,socialProviders:X,localMode:$}=pe(),y=x||b;if($&&j){let n;return a[0]!==m||a[1]!==y?(n=e.jsx(Le,{redirectTo:y,onAuthEvent:m}),a[0]=m,a[1]=y,a[2]=n):n=a[2],n}if(l.enabled){let n;return a[3]!==m||a[4]!==y||a[5]!==l.providerId?(n=e.jsx(Fe,{callbackURL:y,providerId:l.providerId,onAuthEvent:m}),a[3]=m,a[4]=y,a[5]=l.providerId,a[6]=n):n=a[6],n}if(h.enabled||z.enabled||H.enabled||X.enabled){let n;return a[7]!==D||a[8]!==L||a[9]!==c||a[10]!==b||a[11]!==k||a[12]!==m||a[13]!==x||a[14]!==g||a[15]!==v||a[16]!==W?(n=e.jsx(_e,{redirectUrl:x,callbackUrl:b,title:v,subtitle:g,brand:c,copy:k,variant:W,allowedSocialProviders:L,allowPassword:D,onAuthEvent:m}),a[7]=D,a[8]=L,a[9]=c,a[10]=b,a[11]=k,a[12]=m,a[13]=x,a[14]=g,a[15]=v,a[16]=W,a[17]=n):n=a[17],n}let w;return a[18]===Symbol.for("react.memo_cache_sentinel")?(w=e.jsx("div",{children:"No login options available"}),a[18]=w):w=a[18],w}export{Me as A};
|
|
@@ -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-C8rlFaFO.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};
|