decocms 4.200.2 → 4.201.0
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-WwYKI5Qb.js → AlertCircle-Bj0VV7up.js} +1 -1
- package/dist/client/assets/{AreaChart-DF9gicSk.js → AreaChart-CeR7jziX.js} +1 -1
- package/dist/client/assets/{ArrowLeft-aA-FzaCr.js → ArrowLeft-BqlCFBY7.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dl3cQVzC.js → ArrowUp-D_w2qey6.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BZW220i4.js → ArrowUpRight-DZ8WfL-N.js} +1 -1
- package/dist/client/assets/{Check-CQsEmdtb.js → Check-BuqR_Kwe.js} +1 -1
- package/dist/client/assets/{CheckCircle-DR3Li8PK.js → CheckCircle-Bp_VEEVz.js} +1 -1
- package/dist/client/assets/{ChevronDown-l4iG0p-P.js → ChevronDown-65wLzJTw.js} +1 -1
- package/dist/client/assets/{ChevronRight-BgMlkNeC.js → ChevronRight-EyYVLyQY.js} +1 -1
- package/dist/client/assets/{ChevronUp-DOlZYOVw.js → ChevronUp-BNz5kAIR.js} +1 -1
- package/dist/client/assets/{Copy01-CKF7O5eT.js → Copy01-CC0Hd3xm.js} +1 -1
- package/dist/client/assets/{CpuChip01-rrqN9f4p.js → CpuChip01-AFiwguFW.js} +1 -1
- package/dist/client/assets/{CreditCard01-DD6aW3wk.js → CreditCard01-Crsjk2NQ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CowCWATW.js → DotsVertical-DlkoNOjo.js} +1 -1
- package/dist/client/assets/{Eye-DoysLbE1.js → Eye-DA0zzgps.js} +1 -1
- package/dist/client/assets/{FilterLines-CXcCTqQu.js → FilterLines-URZsEuaM.js} +1 -1
- package/dist/client/assets/{Globe01-Bl9pBdBK.js → Globe01-BzoxFmTs.js} +1 -1
- package/dist/client/assets/{Globe04-Ccsw_B8c.js → Globe04-3sGIF22h.js} +1 -1
- package/dist/client/assets/{HardDrive-D30Gjyo8.js → HardDrive-Do13Gda6.js} +1 -1
- package/dist/client/assets/{Key01-Ch_IQKvS.js → Key01-f9O3oH8b.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CV2T0vO3.js → LayoutLeft-Dve3wTbL.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DLPXVHWD.js → LinkExternal01-BT1cKht3.js} +1 -1
- package/dist/client/assets/{LogOut01-BtWQrKvN.js → LogOut01-BUyEI5Ky.js} +1 -1
- package/dist/client/assets/{Monitor01-BT8u7fos.js → Monitor01-CvmVoJ-i.js} +1 -1
- package/dist/client/assets/{Palette-CZ3inffY.js → Palette--hypnXQO.js} +1 -1
- package/dist/client/assets/{Play-D7O034DB.js → Play-xBu_rWbV.js} +1 -1
- package/dist/client/assets/{Plus-tOluSbOt.js → Plus-D4rlrlLr.js} +1 -1
- package/dist/client/assets/{SearchLg-C67h3xK8.js → SearchLg-DxcRs5em.js} +1 -1
- package/dist/client/assets/{SearchMd-P-qGR4xa.js → SearchMd-CGwyuA_K.js} +1 -1
- package/dist/client/assets/{Settings02-DrpZgC_J.js → Settings02-C6kyxW7G.js} +1 -1
- package/dist/client/assets/{Share07-DGsuXOEY.js → Share07-q1slgvW5.js} +1 -1
- package/dist/client/assets/{Shield01-DVvWyA23.js → Shield01-CYrRKcNn.js} +1 -1
- package/dist/client/assets/{Star01-BYdY-DAR.js → Star01-DSgMIlZH.js} +1 -1
- package/dist/client/assets/{Stars01-DsD31Ln0.js → Stars01-Cv4Wame5.js} +1 -1
- package/dist/client/assets/{Stars02-CV1jiWYO.js → Stars02-B6VMIlyW.js} +1 -1
- package/dist/client/assets/{Sun-C9UnoqJl.js → Sun-BhbPIZVi.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-44Mb4crN.js → SwitchHorizontal01-OZQMkGRb.js} +1 -1
- package/dist/client/assets/{Tool01-Dc3mraKQ.js → Tool01-CEpJ1e8Z.js} +1 -1
- package/dist/client/assets/{Tool02-Br6dtRR1.js → Tool02-Cn87iqZi.js} +1 -1
- package/dist/client/assets/{Trash01-CCc2xaoD.js → Trash01-CBJEu1qv.js} +1 -1
- package/dist/client/assets/{TrendUp01-Drrs9no-.js → TrendUp01-B5Y95ssn.js} +1 -1
- package/dist/client/assets/{Upload01-pkxuOolK.js → Upload01-BtHH4hys.js} +1 -1
- package/dist/client/assets/{User01-DQvk8cF7.js → User01-wzGmobUI.js} +1 -1
- package/dist/client/assets/{Users01-BTeOoP3Y.js → Users01-JAFRD8ie.js} +1 -1
- package/dist/client/assets/{Users03-BJlJhI3u.js → Users03-BAonmOfw.js} +1 -1
- package/dist/client/assets/{X-Db6CXFPy.js → X-Co0bDnHw.js} +1 -1
- package/dist/client/assets/{XCircle-u_MUCjn5.js → XCircle-C2qoD1I-.js} +1 -1
- package/dist/client/assets/{XClose-C0MPTyCv.js → XClose-BZUFm2pl.js} +1 -1
- package/dist/client/assets/{Zap-DW4Pf0JH.js → Zap-B7cBqfTM.js} +1 -1
- package/dist/client/assets/{ZapSquare-CATFBr1V.js → ZapSquare-Cois6M8k.js} +1 -1
- package/dist/client/assets/{access-gate-CVnQdqcu.js → access-gate-68wkTQqm.js} +1 -1
- package/dist/client/assets/{agent-icon-BHmHLR-n.js → agent-icon-BwZmxZXB.js} +1 -1
- package/dist/client/assets/{agents-list-D9pwGkMm.js → agents-list-DZ2-ECSa.js} +1 -1
- package/dist/client/assets/{ai-providers-CDX8gwKf.js → ai-providers-DxhKtWB7.js} +1 -1
- package/dist/client/assets/{alert-NZgy_rHY.js → alert-BGGhmUxc.js} +1 -1
- package/dist/client/assets/{alert-dialog-6X4VWLwP.js → alert-dialog-Dw-FseSS.js} +1 -1
- package/dist/client/assets/{app-editor-DtRvevzC.js → app-editor-RBN0Dgx1.js} +1 -1
- package/dist/client/assets/{auth-CHfV0PAM.js → auth-BN6YAe4k.js} +1 -1
- package/dist/client/assets/{auth-catchall-BHKlxCjP.js → auth-catchall-BLaRDm_O.js} +1 -1
- package/dist/client/assets/{auth-entry-CCsrgRKl.js → auth-entry-BwMLOarS.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D3I9GWqu.js → auth-split-layout-CJX8EGRs.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-2C0xJmA1.js → authenticate-and-persist-oauth-C7D93rUY.js} +1 -1
- package/dist/client/assets/{automation-list-row-CRYE-69o.js → automation-list-row-wSuBQBzW.js} +1 -1
- package/dist/client/assets/{automation-runs-BPvY5e0p.js → automation-runs-Cdra6s3F.js} +2 -2
- package/dist/client/assets/{automations-h9Z-3w97.js → automations-BqtiRNOo.js} +1 -1
- package/dist/client/assets/{avatar-z-df-Tey.js → avatar-BoobWyQ-.js} +1 -1
- package/dist/client/assets/{badge-CSetiRsF.js → badge-Be6ykVtM.js} +1 -1
- package/dist/client/assets/{billing-D0B10PsD.js → billing-DV9Pq5tO.js} +1 -1
- package/dist/client/assets/{block-document-PFKgUD2p.js → block-document-BfglFSmv.js} +1 -1
- package/dist/client/assets/{brand-context-BRvh-5Aa.js → brand-context-BS2GSGgR.js} +1 -1
- package/dist/client/assets/{buckets-CJ_17CzK.js → buckets-B54fSv7r.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C-sv_cyv.js → bulk-category-panel-Zs7soiIs.js} +1 -1
- package/dist/client/assets/{capability-load-error-CxtjMYLj.js → capability-load-error-1c_U2BKc.js} +1 -1
- package/dist/client/assets/{card-BvQeGTaA.js → card-Bits-eBf.js} +1 -1
- package/dist/client/assets/{cards-DM50BBl9.js → cards-PKu1jg4N.js} +1 -1
- package/dist/client/assets/{category-editor-oTeE4PRw.js → category-editor-DCYOljVX.js} +1 -1
- package/dist/client/assets/{chat-context-WBuSodUL.js → chat-context-IReX7DMx.js} +1 -1
- package/dist/client/assets/{checkbox-CHPu3dI7.js → checkbox-BQcYZZpc.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CS9cPK3T.js → cli-auth-success-cI7Przfq.js} +1 -1
- package/dist/client/assets/{collection-detail-D6slJdD_.js → collection-detail-iwlIHn3x.js} +1 -1
- package/dist/client/assets/{collection-display-button-CqSLKnip.js → collection-display-button-C5p4lTil.js} +1 -1
- package/dist/client/assets/{collection-search-TJMJz_8d.js → collection-search-DhMY4ddj.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C9Ckz61d.js → collection-table-wrapper-CmI6XIvY.js} +1 -1
- package/dist/client/assets/{collection-tabs-DOWoAX_i.js → collection-tabs-ByKLfy-a.js} +1 -1
- package/dist/client/assets/{command-B1gQ3Abx.js → command-BszbaY2I.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Dd6p5vHW.js → commerce-onboarding-eTGVyKe3.js} +1 -1
- package/dist/client/assets/{connect-D3GOYcEb.js → connect-BuV5jO6T.js} +1 -1
- package/dist/client/assets/{connection-Rt2sx7Mg.js → connection-BZoUH2M3.js} +1 -1
- package/dist/client/assets/{connection-card-Cetubrum.js → connection-card-DzP8uvoS.js} +1 -1
- package/dist/client/assets/{connection-detail-CTqRZboh.js → connection-detail-D8wCWQqw.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BVEb50_K.js → connection-form-helpers-RsEw84Yh.js} +1 -1
- package/dist/client/assets/{connections-4kZSQ3Gu.js → connections-BHKreEGm.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DEYtntVd.js → decopilot-sse-pool-gVDOcCp6.js} +1 -1
- package/dist/client/assets/{dialog-dwIz7L83.js → dialog-Ct9Ey8Rj.js} +1 -1
- package/dist/client/assets/{domain-settings-D3Jm6_73.js → domain-settings-bEyA-5zE.js} +1 -1
- package/dist/client/assets/{drawer-CgKwyvsH.js → drawer-GYAwqNoq.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DBTeEfEp.js → dropdown-menu-BggRvEh9.js} +1 -1
- package/dist/client/assets/{empty-state-DIZU59YF.js → empty-state-Cp2wPJZ8.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CW-wL2c1.js → extract-connection-data-Da3hmofn.js} +1 -1
- package/dist/client/assets/{file-explorer-BbbNchTa.js → file-explorer-DmldxqX4.js} +1 -1
- package/dist/client/assets/{file-type-icon-BkqsbMIs.js → file-type-icon-_hn3I6uX.js} +1 -1
- package/dist/client/assets/{form-Z85glc_u.js → form-ahiIaHkC.js} +1 -1
- package/dist/client/assets/{general-B3H0CGgb.js → general-CUYY-Vdi.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CgqrZDpc.js → github-repo-picker-CzqkmjKN.js} +1 -1
- package/dist/client/assets/{hooks-C786cEpP.js → hooks-B2o1BQtV.js} +1 -1
- package/dist/client/assets/index-BEdBSIIA.css +1 -0
- package/dist/client/assets/{index-DrnLfJO7.js → index-BJ7Ko_7e.js} +1 -1
- package/dist/client/assets/{index-BHdTRFZE.js → index-BY10LBdj.js} +1 -1
- package/dist/client/assets/index-BeO9MUAr.js +5 -0
- package/dist/client/assets/{index-cjWVUbYe.js → index-Byd_5VBR.js} +1 -1
- package/dist/client/assets/{index-D6mIw648.js → index-CNhpdWse.js} +1 -1
- package/dist/client/assets/{index-DrMtZH3n.js → index-DDNkkWLs.js} +4 -4
- package/dist/client/assets/{index-Dk3Vbw6f.js → index-DKOI2-fs.js} +1 -1
- package/dist/client/assets/{index-DBCVpCmb.js → index-DLk8Iv0l.js} +1 -1
- package/dist/client/assets/{index-5uJTtKF7.js → index-DUS53ufg.js} +35 -35
- package/dist/client/assets/{index-BWnlSPNF.js → index-DwQehU15.js} +1 -1
- package/dist/client/assets/{index-redirect-BJZztwOf.js → index-redirect-TNlyrx_q.js} +1 -1
- package/dist/client/assets/{input-B8CuwYhS.js → input-B6Ue8Gtq.js} +1 -1
- package/dist/client/assets/{integration-icon-CyGR5k8y.js → integration-icon-WlgJZAAr.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-Cs9yQPe7.js → invite-member-dialog-DD0wDOJp.js} +1 -1
- package/dist/client/assets/{label-mbqBY0TT.js → label-ByQVKXpC.js} +1 -1
- package/dist/client/assets/{layout-CRcIcX3z.js → layout-BVvRMohF.js} +1 -1
- package/dist/client/assets/{login-B3BCqwfk.js → login-CwYGauog.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Bh4D_1yr.js → mcp-oauth-upBlM6GN.js} +1 -1
- package/dist/client/assets/{members-Bt4tVUpE.js → members-B_Jhbrbd.js} +1 -1
- package/dist/client/assets/{monaco-editor-BEE54e2X.js → monaco-editor-B8kAUX7x.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CZBQe1J_.js → monitoring-stats-row-NGkVTGPZ.js} +1 -1
- package/dist/client/assets/{multi-select-5v4y46yQ.js → multi-select-DfdiRGzA.js} +1 -1
- package/dist/client/assets/{oauth-callback-C8tO2ViQ.js → oauth-callback-BpM_vE_w.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BlyuICqa.js → oauth-callback-ai-provider-DQIszpko.js} +1 -1
- package/dist/client/assets/{onboarding-C_77UeCV.js → onboarding-DvTU1LUv.js} +1 -1
- package/dist/client/assets/{org-layout-tSw8Hzo6.js → org-layout-Csca47cZ.js} +1 -1
- package/dist/client/assets/{organization-choice-ClTFwbDy.js → organization-choice-COSQhsCq.js} +1 -1
- package/dist/client/assets/{orgs-B5Bbgmvk.js → orgs-DR2Di9NE.js} +1 -1
- package/dist/client/assets/{page-seo-form-CoUiXlS_.js → page-seo-form-tKqIF-y-.js} +1 -1
- package/dist/client/assets/{popover-jpJstolX.js → popover-C4xldx8X.js} +1 -1
- package/dist/client/assets/{post-editor-Ddr_6Fac.js → post-editor-D0E8JoBe.js} +1 -1
- package/dist/client/assets/{primitives-FhnYAl6u.js → primitives-BaWGwJqw.js} +1 -1
- package/dist/client/assets/{profile-BZc7LzYW.js → profile-BbdnyzH1.js} +1 -1
- package/dist/client/assets/{project-app-view-DzeT8LJu.js → project-app-view-6rbxnT-3.js} +1 -1
- package/dist/client/assets/record-editor-C7AV-kwd.js +1 -0
- package/dist/client/assets/{redirect-editor-DKvHrWmX.js → redirect-editor-D1X-LItd.js} +1 -1
- package/dist/client/assets/registry-BGzmQpf5.js +2 -0
- package/dist/client/assets/{registry-layout-Bmt_KMV2.js → registry-layout-CVgJH-tf.js} +1 -1
- package/dist/client/assets/{reports-BvAVG37q.js → reports-uTUZayik.js} +1 -1
- package/dist/client/assets/{require-capability-DOx9AETn.js → require-capability-D8V-K-Ln.js} +1 -1
- package/dist/client/assets/{required-auth-layout-088Qrhua.js → required-auth-layout-QkQ_LFn1.js} +1 -1
- package/dist/client/assets/{reset-password-DMec7zHu.js → reset-password-JK0bR-tQ.js} +1 -1
- package/dist/client/assets/{roles-DfRoUUPR.js → roles-BNGONjav.js} +1 -1
- package/dist/client/assets/{search-input-yzjarZOy.js → search-input-kBCGvCld.js} +1 -1
- package/dist/client/assets/{secrets-EaPte9tu.js → secrets-Bys27HEe.js} +1 -1
- package/dist/client/assets/{sections-editor-CPtZM9nP.js → sections-editor-g-030qn4.js} +1 -1
- package/dist/client/assets/{select-DwoG3i35.js → select-Bn2gd7PP.js} +1 -1
- package/dist/client/assets/{select-model-BJcNU1LC.js → select-model-2-cyvNOe.js} +1 -1
- package/dist/client/assets/{self-tool-result-BIcvrUov.js → self-tool-result-PcOApdBI.js} +1 -1
- package/dist/client/assets/{seo-editor-BCBdG81E.js → seo-editor-C1PaWNCw.js} +1 -1
- package/dist/client/assets/{settings-layout-D5Vqc4xw.js → settings-layout-BLCffzES.js} +1 -1
- package/dist/client/assets/{settings-section-BaQE1wG9.js → settings-section-rIBQA49t.js} +1 -1
- package/dist/client/assets/{shell-controls-CBnHbN6H.js → shell-controls-D9MoX2ZP.js} +1 -1
- package/dist/client/assets/{shell-layout-B5fO0Zra.js → shell-layout-DvrKfubx.js} +1 -1
- package/dist/client/assets/{sidebar-DgQgb5sn.js → sidebar-6Pwgqwg8.js} +1 -1
- package/dist/client/assets/{skeleton-BAWjjFCN.js → skeleton-BAcj33ku.js} +1 -1
- package/dist/client/assets/{spinner-DGBqgXCx.js → spinner-ws5yutkc.js} +1 -1
- package/dist/client/assets/{sso-ZyfgZDXz.js → sso-Cvp5Ol5f.js} +1 -1
- package/dist/client/assets/{store-CDmxLg6b.js → store-CQEGPQV9.js} +1 -1
- package/dist/client/assets/store-registry-F2nsDsGp.js +2 -0
- package/dist/client/assets/{studio-tools-Cl_MnIvi.js → studio-tools-DM5QBHCQ.js} +1 -1
- package/dist/client/assets/{switch-BkAM2D0l.js → switch-DkU4M0dt.js} +1 -1
- package/dist/client/assets/{synced-repos-DEOggDSZ.js → synced-repos-QtDUxULK.js} +1 -1
- package/dist/client/assets/{tab-id-Bxlhy6J5.js → tab-id-CiGWDuEk.js} +1 -1
- package/dist/client/assets/{table-wkh9heo2.js → table-la-GCDtJ.js} +1 -1
- package/dist/client/assets/{tabs-CEYHI8Md.js → tabs-CA2r-tm8.js} +1 -1
- package/dist/client/assets/{textarea-1wjTSY40.js → textarea-Cgxpb5eg.js} +1 -1
- package/dist/client/assets/{toggle-group-2FXdfAeH.js → toggle-group-BEWMY4aK.js} +1 -1
- package/dist/client/assets/{toolbar-DJeYjzbm.js → toolbar-DOAlJJnD.js} +1 -1
- package/dist/client/assets/{tooltip-H0fhJGAw.js → tooltip-11Yrt4wp.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BHJZGUc0.js → use-ai-providers-CUHFWYci.js} +1 -1
- package/dist/client/assets/{use-automations-CUmyAWfM.js → use-automations-iQtt0rLd.js} +1 -1
- package/dist/client/assets/{use-autosave-DlIf0aXm.js → use-autosave-jWI3co6x.js} +1 -1
- package/dist/client/assets/{use-capability-wtjHty-j.js → use-capability-DcMyBnS4.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CxYlu2Gq.js → use-clock-tick-QY57Oj13.js} +1 -1
- package/dist/client/assets/{use-connection-C06aQf36.js → use-connection-DVLPDTuB.js} +1 -1
- package/dist/client/assets/{use-copy-gW0QHo8P.js → use-copy-D-GM29SE.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-f_SJloId.js → use-create-virtual-mcp-BBFP4Vw4.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-JjCfq5kj.js → use-debounced-autosave-yTGUa49y.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Dp6sftMR.js → use-debounced-value-CkNYo5YL.js} +1 -1
- package/dist/client/assets/{use-deco-credits-g0IlK0Pn.js → use-deco-credits-Cthvsr_H.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-a7Wk8Vas.js → use-decopilot-events-BcjIJdRs.js} +1 -1
- package/dist/client/assets/{use-delete-connection-gv8RXinn.js → use-delete-connection-e1S0S9Xr.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BNsEQ5Jb.js → use-deployment-admin-DbpLqnqh.js} +1 -1
- package/dist/client/assets/{use-file-configs-BXAOsCuo.js → use-file-configs-CpKyEHH5.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CbzOsGKa.js → use-infinite-scroll-B52yZeYp.js} +1 -1
- package/dist/client/assets/{use-join-requests-BihL-Sex.js → use-join-requests-CRtQD5St.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BYQZ09jw.js → use-mcp-client-B1vuae8u.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-1zzjIAwR.js → use-mcp-tools-DwnvrfSJ.js} +1 -1
- package/dist/client/assets/{use-members-hO-mw4Hb.js → use-members-Cu4tim8h.js} +1 -1
- package/dist/client/assets/{use-mobile-BpvQFpHJ.js → use-mobile-Cavq-ZyH.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BqIzfs1W.js → use-navigate-to-agent-CO828s2W.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-DhJWA6Ab.js → use-open-billing-url-Cq6CFoOt.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BemR7rGU.js → use-org-auth-client-BQJU69BH.js} +1 -1
- package/dist/client/assets/{use-org-sso-BCOboyXc.js → use-org-sso-Bv_JE25K.js} +1 -1
- package/dist/client/assets/{use-organization-roles-KuqucuwR.js → use-organization-roles-DwEMIze7.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DO-5TCG5.js → use-organization-settings-B2Gux989.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DAUYDjwC.js → use-registry-connections-B30kwQ-D.js} +1 -1
- package/dist/client/assets/{use-secrets-DbAKuIqf.js → use-secrets-DVBgSmhl.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DadVPpps.js → use-section-preview-base-D_sClGro.js} +1 -1
- package/dist/client/assets/{use-status-sounds-B7jzN0nF.js → use-status-sounds-CT1tk-BS.js} +1 -1
- package/dist/client/assets/{use-tags-C70JhIII.js → use-tags-CzUPzpBT.js} +1 -1
- package/dist/client/assets/{use-view-mode-E1cNgKEH.js → use-view-mode-xMHcPi5K.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Cfa_s6xG.js → use-virtual-mcp-DrXsz2Gh.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CpFXCemx.js +1 -0
- package/dist/client/assets/{useRouterState-dnxSkJ3B.js → useRouterState-DfJ79l1w.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BSnce96W.js +1 -0
- package/dist/client/assets/{users-DC66nhJN.js → users-DY2kfXVp.js} +1 -1
- package/dist/client/assets/{variant-calendar-HycG7TtG.js → variant-calendar-CPISZecu.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BqYvPkBg.js → view-mode-toggle-CoAzgunL.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-9SfcAKRH.css +0 -1
- package/dist/client/assets/index-BTa_wQw_.js +0 -5
- package/dist/client/assets/record-editor-pWAfV-bV.js +0 -1
- package/dist/client/assets/registry-6xLfaylj.js +0 -2
- package/dist/client/assets/store-registry-1BNfPgeY.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BSP--nFF.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CrU4YP2H.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,v as Ae,t as le,B as ne,F as De,o as Ie,a as Le,r as X,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-DrMtZH3n.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-DBTeEfEp.js";import{a as Ge}from"./Users03-BJlJhI3u.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-CgqrZDpc.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-Cfa_s6xG.js";import{P as ce}from"./index-BHdTRFZE.js";import{a as Ue}from"./DotsVertical-CowCWATW.js";import{A as Re,C as fe,aW as $e}from"./agent-icon-BHmHLR-n.js";import{a as He}from"./Settings02-DrpZgC_J.js";import{s as Ve}from"./Trash01-CCc2xaoD.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-BqIzfs1W.js";import{e as qe,h as Qe}from"./use-organization-settings-DO-5TCG5.js";import{u as Se}from"./use-capability-wtjHty-j.js";import{C as Je}from"./card-BvQeGTaA.js";import{E as Ye}from"./empty-state-DIZU59YF.js";import{u as We}from"./use-create-virtual-mcp-f_SJloId.js";import{u as Xe}from"./use-connection-C06aQf36.js";import{u as xe,S as Ze}from"./use-mcp-client-BYQZ09jw.js";import{p as et,a as je}from"./deco-site-production-url-CaKZ7xBn.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-ufuvpGD9.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-dwIz7L83.js";import{i as dt}from"./ArrowLeft-aA-FzaCr.js";import{C as ut}from"./collection-search-TJMJz_8d.js";import{A as pt,a as gt,b as ft,c as ht,d as xt,e as jt,f as Ct,g as bt}from"./alert-dialog-6X4VWLwP.js";import{S as Dt}from"./search-input-yzjarZOy.js";import{s as Ce}from"./Plus-tOluSbOt.js";import"./Check-CQsEmdtb.js";import"./ChevronRight-BgMlkNeC.js";import"./use-debounced-value-Dp6sftMR.js";import"./authenticate-and-persist-oauth-2C0xJmA1.js";import"./mcp-oauth-Bh4D_1yr.js";import"./auth-CHfV0PAM.js";import"./LinkExternal01-DLPXVHWD.js";import"./Share07-DGsuXOEY.js";import"./use-mcp-tools-1zzjIAwR.js";import"./extract-connection-data-CW-wL2c1.js";import"./metadata-dUsYcpuu.js";import"./sidebar-DgQgb5sn.js";import"./LayoutLeft-CV2T0vO3.js";import"./use-mobile-BpvQFpHJ.js";import"./X-Db6CXFPy.js";import"./tooltip-H0fhJGAw.js";import"./AlertCircle-WwYKI5Qb.js";import"./Tool01-Dc3mraKQ.js";import"./ArrowUp-Dl3cQVzC.js";import"./Tool02-Br6dtRR1.js";import"./XCircle-u_MUCjn5.js";import"./ArrowUpRight-BZW220i4.js";import"./TrendUp01-Drrs9no-.js";import"./ZapSquare-CATFBr1V.js";import"./CheckCircle-DR3Li8PK.js";import"./ChevronDown-l4iG0p-P.js";import"./ChevronUp-DOlZYOVw.js";import"./Stars02-CV1jiWYO.js";import"./Copy01-CKF7O5eT.js";import"./CpuChip01-rrqN9f4p.js";import"./CreditCard01-DD6aW3wk.js";import"./Globe01-Bl9pBdBK.js";import"./Eye-DoysLbE1.js";import"./FilterLines-CXcCTqQu.js";import"./Star01-BYdY-DAR.js";import"./Globe04-Ccsw_B8c.js";import"./SwitchHorizontal01-44Mb4crN.js";import"./HardDrive-D30Gjyo8.js";import"./Key01-Ch_IQKvS.js";import"./LogOut01-BtWQrKvN.js";import"./Monitor01-BT8u7fos.js";import"./Sun-C9UnoqJl.js";import"./Palette-CZ3inffY.js";import"./Play-D7O034DB.js";import"./SearchLg-C67h3xK8.js";import"./SearchMd-P-qGR4xa.js";import"./Shield01-DVvWyA23.js";import"./Stars01-DsD31Ln0.js";import"./Upload01-pkxuOolK.js";import"./User01-DQvk8cF7.js";import"./Users01-BTeOoP3Y.js";import"./XClose-C0MPTyCv.js";import"./Zap-DW4Pf0JH.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-C786cEpP.js";import"./decopilot-sse-pool-DEYtntVd.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-Cl_MnIvi.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?Ke:void 0,{mainAgentId:M}=qe(),d=Qe(),{granted:T}=Se("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ve,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let _;e[33]!==z||e[34]!==l?(_=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=_):_=e[35];let N;e[36]!==i.title?(N=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=N):N=e[37];let v;e[38]!==m||e[39]!==c?(v=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==v?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[N,v]}),e[41]=N,e[42]=v,e[43]=P):P=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==P||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[P,s]}),e[46]=P,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==_||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[_,p]}),e[49]=_,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let S;e[57]!==b?(S=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=S):S=e[58];let A;e[59]!==g||e[60]!==S?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,S]}),e[59]=g,e[60]=S,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Je,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function _t(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 St(t,e){const i=e?_t(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function Nt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function vt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=De(),f=_e(),c=Ie(),{data:G}=Le.useSession(),[x,M]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>vt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),_=O?.sites??[],N=s=>{s||(M(null),T(null),D("")),e(s)},v=_.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||v.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=_.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=St(s,g.metadata),S=st(p,b.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const Q=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await Ne(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$,reused:J}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:S.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=J?null:$;const K=B.icon??null,Z=Nt(s),Y=s.toLowerCase(),W=et(je(g.domains)),q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:Y,productionUrl:W,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:S.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=q.structuredContent??q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:Z,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await Q(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const S=b.queryKey;return S[1]===r.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),N(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:N,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&_.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&_.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),v.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>N(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ms(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=X.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=We(G),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=Se("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Be(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:ve}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:ve}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let _;t[5]!==e?(_=e("routes.agentsList.title"),t[5]=e,t[6]=_):_=t[6];let N;t[7]!==_?(N=o.jsx(ce.Title,{children:_}),t[7]=_,t[8]=N):N=t[8];let v;t[9]!==e?(v=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=v):v=t[10];let P;t[11]===Symbol.for("react.memo_cache_sentinel")?(P=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=P):P=t[11];let F;t[12]!==f||t[13]!==v?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:v,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=v,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==N?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,p]}),t[23]=p,t[24]=N,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),S=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==S||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,S]}),t[26]=g,t[27]=b,t[28]=S,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Pe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let Q;t[36]!==m?(Q=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=Q):Q=t[37];const B=!!d;let U;t[38]===Symbol.for("react.memo_cache_sentinel")?(U=L=>!L&&T(null),t[38]=U):U=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let J;t[41]!==$?(J=o.jsx(pt,{children:$}),t[41]=$,t[42]=J):J=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let Y;t[45]!==Z?(Y=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=Y):Y=t[46];let W;t[47]!==K||t[48]!==Y?(W=o.jsxs(gt,{children:[K," ",Y,"."]}),t[47]=K,t[48]=Y,t[49]=W):W=t[49];let q;t[50]!==J||t[51]!==W?(q=o.jsxs(ft,{children:[J,W]}),t[50]=J,t[51]=W,t[52]=q):q=t[52];let R;t[53]!==e?(R=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=R):R=t[54];let H;t[55]!==R?(H=o.jsx(ht,{children:R}),t[55]=R,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==q||t[66]!==oe?(se=o.jsxs(Ct,{children:[q,oe]}),t[65]=q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:U,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==Q||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,Q,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=Q,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ms as default};
|
|
1
|
+
import{c as ge,b as me,j as o,v as Ae,t as le,B as ne,F as De,o as Ie,a as Le,r as X,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-DDNkkWLs.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-BggRvEh9.js";import{a as Ge}from"./Users03-BAonmOfw.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-CzqkmjKN.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-DrXsz2Gh.js";import{P as ce}from"./index-BY10LBdj.js";import{a as Ue}from"./DotsVertical-DlkoNOjo.js";import{A as Re,C as fe,aW as $e}from"./agent-icon-BwZmxZXB.js";import{a as He}from"./Settings02-C6kyxW7G.js";import{s as Ve}from"./Trash01-CBJEu1qv.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-CO828s2W.js";import{e as qe,h as Qe}from"./use-organization-settings-B2Gux989.js";import{u as Se}from"./use-capability-DcMyBnS4.js";import{C as Je}from"./card-Bits-eBf.js";import{E as Ye}from"./empty-state-Cp2wPJZ8.js";import{u as We}from"./use-create-virtual-mcp-BBFP4Vw4.js";import{u as Xe}from"./use-connection-DVLPDTuB.js";import{u as xe,S as Ze}from"./use-mcp-client-B1vuae8u.js";import{p as et,a as je}from"./deco-site-production-url-CaKZ7xBn.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-ufuvpGD9.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-Ct9Ey8Rj.js";import{i as dt}from"./ArrowLeft-BqlCFBY7.js";import{C as ut}from"./collection-search-DhMY4ddj.js";import{A as pt,a as gt,b as ft,c as ht,d as xt,e as jt,f as Ct,g as bt}from"./alert-dialog-Dw-FseSS.js";import{S as Dt}from"./search-input-kBCGvCld.js";import{s as Ce}from"./Plus-D4rlrlLr.js";import"./Check-BuqR_Kwe.js";import"./ChevronRight-EyYVLyQY.js";import"./use-debounced-value-CkNYo5YL.js";import"./authenticate-and-persist-oauth-C7D93rUY.js";import"./mcp-oauth-upBlM6GN.js";import"./auth-BN6YAe4k.js";import"./LinkExternal01-BT1cKht3.js";import"./Share07-q1slgvW5.js";import"./use-mcp-tools-DwnvrfSJ.js";import"./extract-connection-data-Da3hmofn.js";import"./metadata-dUsYcpuu.js";import"./sidebar-6Pwgqwg8.js";import"./LayoutLeft-Dve3wTbL.js";import"./use-mobile-Cavq-ZyH.js";import"./X-Co0bDnHw.js";import"./tooltip-11Yrt4wp.js";import"./AlertCircle-Bj0VV7up.js";import"./Tool01-CEpJ1e8Z.js";import"./ArrowUp-D_w2qey6.js";import"./Tool02-Cn87iqZi.js";import"./XCircle-C2qoD1I-.js";import"./ArrowUpRight-DZ8WfL-N.js";import"./TrendUp01-B5Y95ssn.js";import"./ZapSquare-Cois6M8k.js";import"./CheckCircle-Bp_VEEVz.js";import"./ChevronDown-65wLzJTw.js";import"./ChevronUp-BNz5kAIR.js";import"./Stars02-B6VMIlyW.js";import"./Copy01-CC0Hd3xm.js";import"./CpuChip01-AFiwguFW.js";import"./CreditCard01-Crsjk2NQ.js";import"./Globe01-BzoxFmTs.js";import"./Eye-DA0zzgps.js";import"./FilterLines-URZsEuaM.js";import"./Star01-DSgMIlZH.js";import"./Globe04-3sGIF22h.js";import"./SwitchHorizontal01-OZQMkGRb.js";import"./HardDrive-Do13Gda6.js";import"./Key01-f9O3oH8b.js";import"./LogOut01-BUyEI5Ky.js";import"./Monitor01-CvmVoJ-i.js";import"./Sun-BhbPIZVi.js";import"./Palette--hypnXQO.js";import"./Play-xBu_rWbV.js";import"./SearchLg-DxcRs5em.js";import"./SearchMd-CGwyuA_K.js";import"./Shield01-CYrRKcNn.js";import"./Stars01-Cv4Wame5.js";import"./Upload01-BtHH4hys.js";import"./User01-wzGmobUI.js";import"./Users01-JAFRD8ie.js";import"./XClose-BZUFm2pl.js";import"./Zap-B7cBqfTM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-B2o1BQtV.js";import"./decopilot-sse-pool-gVDOcCp6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-DM5QBHCQ.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=_e(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?Ke:void 0,{mainAgentId:M}=qe(),d=Qe(),{granted:T}=Se("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ve,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let _;e[33]!==z||e[34]!==l?(_=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=_):_=e[35];let N;e[36]!==i.title?(N=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=N):N=e[37];let v;e[38]!==m||e[39]!==c?(v=m&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),c("home.projectCard.mainAgentBadge")]}),e[38]=m,e[39]=c,e[40]=v):v=e[40];let P;e[41]!==N||e[42]!==v?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[N,v]}),e[41]=N,e[42]=v,e[43]=P):P=e[43];const F=i.description||"No description";let s;e[44]!==F?(s=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:F}),e[44]=F,e[45]=s):s=e[45];let p;e[46]!==P||e[47]!==s?(p=o.jsxs("div",{className:"flex flex-col gap-1",children:[P,s]}),e[46]=P,e[47]=s,e[48]=p):p=e[48];let g;e[49]!==_||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[_,p]}),e[49]=_,e[50]=p,e[51]=g):g=e[51];let b;e[52]!==n||e[53]!==x||e[54]!==i.updated_at||e[55]!==c?(b=n?c("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:x})}):c("home.projectCard.updated",{time:he(new Date(i.updated_at),{addSuffix:!0,locale:x})}),e[52]=n,e[53]=x,e[54]=i.updated_at,e[55]=c,e[56]=b):b=e[56];let S;e[57]!==b?(S=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=S):S=e[58];let A;e[59]!==g||e[60]!==S?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,S]}),e[59]=g,e[60]=S,e[61]=A):A=e[61];let k;return e[62]!==A||e[63]!==a?(k=o.jsxs(Je,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[a,A]}),e[62]=A,e[63]=a,e[64]=k):k=e[64],k}const wt="deco-sites";function _t(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 St(t,e){const i=e?_t(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function Nt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,i){const n=await fetch(t,e),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error??`${i} (${n.status})`);return r}function vt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function At({open:t,onOpenChange:e,onBack:i}){const n=me(),{org:r}=De(),f=_e(),c=Ie(),{data:G}=Le.useSession(),[x,M]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>vt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),_=O?.sites??[],N=s=>{s||(M(null),T(null),D("")),e(s)},v=_.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||v.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=_.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=St(s,g.metadata),S=st(p,b.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const Q=async()=>{I&&await j.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:I}}).catch(()=>{}),k&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),A&&await j.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const B=await Ne(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$,reused:J}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:S.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=J?null:$;const K=B.icon??null,Z=Nt(s),Y=s.toLowerCase(),W=et(je(g.domains)),q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:Y,productionUrl:W,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:S.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=q.structuredContent??q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:Z,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await Q(),B}},onSuccess:({slug:s,virtualMcpId:p,item:g})=>{V("deco_site_import_succeeded",{site_name:g.title,virtual_mcp_id:p,slug:s}),c.setQueryData(de.collectionItem(j,r.id,"","VIRTUAL_MCP",p),{item:g}),c.invalidateQueries({predicate:b=>{const S=b.queryKey;return S[1]===r.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),N(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:N,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&_.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!E&&!u&&!C&&l.status!=="error"&&_.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[v.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:m})}),v.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>N(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ms(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=X.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=We(G),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=Se("agents:manage"),l=f.toLowerCase(),h=n.filter(L=>L.id!==i.id&&(L.title.toLowerCase().includes(l)||L.description?.toLowerCase().includes(l))),{data:C}=Be(h.map(It));let w;t[1]!==r||t[2]!==d||t[3]!==e?(w=async()=>{if(!d)return;const{id:L,title:ve}=d;T(null);try{await r.delete.mutateAsync(L),V("agent_deleted",{agent_id:L,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:ve}))}catch{}},t[1]=r,t[2]=d,t[3]=e,t[4]=w):w=t[4];const u=w,O=ce,E=ce,z=ce;let _;t[5]!==e?(_=e("routes.agentsList.title"),t[5]=e,t[6]=_):_=t[6];let N;t[7]!==_?(N=o.jsx(ce.Title,{children:_}),t[7]=_,t[8]=N):N=t[8];let v;t[9]!==e?(v=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=v):v=t[10];let P;t[11]===Symbol.for("react.memo_cache_sentinel")?(P=L=>{L.key==="Escape"&&(c(""),L.target.blur())},t[11]=P):P=t[11];let F;t[12]!==f||t[13]!==v?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:v,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=v,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==N?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,p]}),t[23]=p,t[24]=N,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),S=h.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:h.map(L=>o.jsx(yt,{project:L,lastUsedAt:C?.get(L.id)?.last_used_at,onDeleteClick:a?()=>T({id:L.id,title:L.title}):void 0},L.id))})]});let A;t[26]!==g||t[27]!==b||t[28]!==S||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,S]}),t[26]=g,t[27]=b,t[28]=S,t[29]=z.Body,t[30]=A):A=t[30];let k;t[31]!==A||t[32]!==E.Content?(k=o.jsx(E.Content,{children:A}),t[31]=A,t[32]=E.Content,t[33]=k):k=t[33];let I;t[34]!==j?(I=o.jsx(Pe,{open:j,onOpenChange:y}),t[34]=j,t[35]=I):I=t[35];let Q;t[36]!==m?(Q=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=Q):Q=t[37];const B=!!d;let U;t[38]===Symbol.for("react.memo_cache_sentinel")?(U=L=>!L&&T(null),t[38]=U):U=t[38];let $;t[39]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=$):$=t[40];let J;t[41]!==$?(J=o.jsx(pt,{children:$}),t[41]=$,t[42]=J):J=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let Y;t[45]!==Z?(Y=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=Y):Y=t[46];let W;t[47]!==K||t[48]!==Y?(W=o.jsxs(gt,{children:[K," ",Y,"."]}),t[47]=K,t[48]=Y,t[49]=W):W=t[49];let q;t[50]!==J||t[51]!==W?(q=o.jsxs(ft,{children:[J,W]}),t[50]=J,t[51]=W,t[52]=q):q=t[52];let R;t[53]!==e?(R=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=R):R=t[54];let H;t[55]!==R?(H=o.jsx(ht,{children:R}),t[55]=R,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==q||t[66]!==oe?(se=o.jsxs(Ct,{children:[q,oe]}),t[65]=q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:U,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==Q||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,Q,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=Q,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ms as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as X,$ as K,_ as Ae,a3 as Ke,a4 as ne,a0 as Be,b8 as Oe,c as Z,b as le,a2 as ze,a1 as Le,r as W,j as s,a5 as nt,t as ee,av as Ve,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,p as Qe,v as at,E as ct}from"./index-DrMtZH3n.js";import{i as dt}from"./AlertCircle-WwYKI5Qb.js";import{P as Ne}from"./index-BHdTRFZE.js";import{S as Ee}from"./skeleton-BAWjjFCN.js";import{b as Ge,a as Me,S as Te,c as mt}from"./settings-section-BaQE1wG9.js";import{u as We,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Ye}from"./use-ai-providers-BHJZGUc0.js";import{i as ht}from"./CheckCircle-DR3Li8PK.js";import{b as xt,j as vt}from"./use-organization-settings-DO-5TCG5.js";import{c as bt,d as Je,P as yt,C as $e}from"./select-model-BJcNU1LC.js";import{u as jt}from"./use-debounced-autosave-JjCfq5kj.js";import{I as Ce}from"./input-B8CuwYhS.js";import{T as qe,a as St}from"./toggle-group-2FXdfAeH.js";import{A as Ze,a as Xe,b as et,c as tt,d as st,e as it,f as lt,g as ot}from"./alert-dialog-6X4VWLwP.js";import{u as ce}from"./studio-tools-Cl_MnIvi.js";import{s as Ct}from"./Plus-tOluSbOt.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-Dc3mraKQ.js";import{s as It}from"./Trash01-CCc2xaoD.js";import{A as Nt}from"./avatar-z-df-Tey.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-DrpZgC_J.js";import{s as Kt}from"./Eye-DoysLbE1.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-dwIz7L83.js";import{S as Ft}from"./spinner-DGBqgXCx.js";import{R as Ot}from"./require-capability-DOx9AETn.js";import"./sidebar-DgQgb5sn.js";import"./LayoutLeft-CV2T0vO3.js";import"./use-mobile-BpvQFpHJ.js";import"./X-Db6CXFPy.js";import"./tooltip-H0fhJGAw.js";import"./card-BvQeGTaA.js";import"./ArrowUpRight-BZW220i4.js";import"./use-mcp-client-BYQZ09jw.js";import"./auth-CHfV0PAM.js";import"./drawer-CgKwyvsH.js";import"./chat-context-WBuSodUL.js";import"./tab-id-Bxlhy6J5.js";import"./Check-CQsEmdtb.js";import"./Copy01-CKF7O5eT.js";import"./hooks-C786cEpP.js";import"./decopilot-sse-pool-DEYtntVd.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Cfa_s6xG.js";import"./use-decopilot-events-a7Wk8Vas.js";import"./checkbox-CHPu3dI7.js";import"./select-DwoG3i35.js";import"./ChevronDown-l4iG0p-P.js";import"./ChevronUp-DOlZYOVw.js";import"./ArrowLeft-aA-FzaCr.js";import"./Key01-Ch_IQKvS.js";import"./SearchMd-P-qGR4xa.js";import"./Monitor01-BT8u7fos.js";import"./ChevronRight-BgMlkNeC.js";import"./Stars01-DsD31Ln0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-DQvk8cF7.js";import"./use-capability-wtjHty-j.js";import"./access-gate-CVnQdqcu.js";import"./capability-load-error-CxtjMYLj.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const re=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();Be(["fast","smart","thinking","image","web_search","deep_research"]);Be(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:re,smart:re,thinking:re,image:re,web_search:re,deep_research:re})});X({tiers:X({fast:re.optional(),smart:re.optional(),thinking:re.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:l,filterModels:a,defaultKeyId:n}=e,c=We(),r=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[v,I]=W.useState(r??n);let _,o;t[0]!==r?(_=()=>{r&&I(r)},o=[r],t[0]=r,t[1]=_,t[2]=o):(_=t[1],o=t[2]),W.useEffect(_,o);let d;t[3]!==c||t[4]!==n||t[5]!==v?(d=c.some(C=>C.id===v)?v:n,t[3]=c,t[4]=n,t[5]=v,t[6]=d):d=t[6];const m=d;let u;t[7]!==m||t[8]!==c?(u=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=u):u=t[9];const b=u,{models:x,isLoading:y}=we(a?m??void 0:void 0),f=a?y||x.some(a):!0;let j;t[10]!==i||t[11]!==b?.providerId||t[12]!==r?(j=i&&r?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:b?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=b?.providerId,t[12]=r,t[13]=j):j=t[13];const N=j,g=le();if(a&&!f){let C;t[14]!==g?(C=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let k;t[18]!==g?(k=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=k):k=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=C=>I(C),t[20]=p):p=t[20];let h;t[21]!==m||t[22]!==l?(h=C=>{const w=C.keyId??m??"";I(w),l({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=l,t[23]=h):h=t[23];let S;return t[24]!==m||t[25]!==a||t[26]!==N||t[27]!==k||t[28]!==h?(S=s.jsx(bt,{variant:"bordered",placeholder:k,model:N,credentialId:m,filterModels:a,onCredentialChange:p,onModelChange:h}),t[24]=m,t[25]=a,t[26]=N,t[27]=k,t[28]=h,t[29]=S):S=t[29],S}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,a=le();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=c):c=t[2];let r;return t[3]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=r):r=t[4],r}if(l){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{size:12}),t[5]=n):n=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=c):c=t[7];let r;return t[8]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=r):r=t[9],r}return null}function Vt(){const e=Z.c(58),t=le(),i=We(),l=xt(),a=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=ze(Ut),e[0]=n):n=e[0];let c;e[1]!==l?(c={resolver:n,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const r=Le(c),{mutate:v,isPending:I,isSuccess:_}=vt(),o=r.formState.isDirty;let d;e[3]!==r||e[4]!==l||e[5]!==t||e[6]!==v?(d={delayMs:250,save:async()=>{const P=r.getValues();v(P,{onSuccess:()=>r.reset(P,{keepValues:!0}),onError:F=>{r.reset(l),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=r,e[4]=l,e[5]=t,e[6]=v,e[7]=d):d=e[7];const{schedule:m}=jt(d),u=i[0],b=i[1],x=i[2],{models:y}=we(u?.id),{models:f}=we(b?.id),{models:j}=we(x?.id);let N,g;e[8]!==r||e[9]!==a?(N=()=>{a||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[a,r],e[8]=r,e[9]=a,e[10]=N,e[11]=g):(N=e[10],g=e[11]),W.useEffect(N,g);let k;e[12]!==i||e[13]!==r||e[14]!==u||e[15]!==b||e[16]!==x||e[17]!==y||e[18]!==f||e[19]!==j?(k=()=>{const P=r.getValues(),F=new Set(i.map(Qt)),O={};u?.id&&(O[u.id]=y),b?.id&&(O[b.id]=f),x?.id&&(O[x.id]=j);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(P.tiers.fast)?null:P.tiers.fast,smart:T(P.tiers.smart)?null:P.tiers.smart,thinking:T(P.tiers.thinking)?null:P.tiers.thinking,image:T(P.tiers.image)?null:P.tiers.image,web_search:T(P.tiers.web_search)?null:P.tiers.web_search,deep_research:T(P.tiers.deep_research)?null:P.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===P.tiers.fast&&D.smart===P.tiers.smart&&D.thinking===P.tiers.thinking&&D.image===P.tiers.image&&D.web_search===P.tiers.web_search&&D.deep_research===P.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);r.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=r,e[14]=u,e[15]=b,e[16]=x,e[17]=y,e[18]=f,e[19]=j,e[20]=k):k=e[20];const p=u?.id,h=b?.id,S=x?.id;let C;e[21]!==i||e[22]!==r||e[23]!==y||e[24]!==f||e[25]!==j||e[26]!==p||e[27]!==h||e[28]!==S?(C=[r,i,y,f,j,p,h,S],e[21]=i,e[22]=r,e[23]=y,e[24]=f,e[25]=j,e[26]=p,e[27]=h,e[28]=S,e[29]=C):C=e[29],W.useEffect(k,C);let w;e[30]!==t?(w=P=>({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")})[P]||P,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=P=>({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")})[P]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=_&&!o;let $;e[40]!==I||e[41]!==Q?($=s.jsx(Lt,{isPending:I,showSaved:Q}),e[40]=I,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==r.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(P=>s.jsx(nt,{control:r.control,name:`tiers.${P.key}`,render:F=>{const{field:O}=F;return s.jsx(Ge,{title:R(P.key),description:E(P.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:P.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},P.key)),e[46]=i[0]?.id,e[47]=r.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=le(),i=ce(),[l,a]=W.useState(!1);let n;e[0]!==t?(n=p=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=n):n=e[1];const{mutate:c,isPending:r}=ae({mutationFn:async p=>{const{url:h}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:d});return h},onSuccess:Yt,onError:n}),[v,I]=W.useState(""),[_,o]=W.useState("usd"),d=_,m=parseFloat(v),u=!isNaN(m)&&m>=1,b=d==="brl"?"R$":"$";let x;e[2]!==o?(x=p=>{p&&o(p)},e[2]=o,e[3]=x):x=e[3];let y,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(qe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),f=s.jsx(qe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=y,e[5]=f):(y=e[4],f=e[5]);let j;e[6]!==d||e[7]!==x?(j=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:d,onValueChange:x,children:[y,f]}),e[6]=d,e[7]=x,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==b||e[11]!==l||e[12]!==r||e[13]!==t||e[14]!==c?(N=!l&&s.jsxs(s.Fragment,{children:[Gt[d].map(p=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:r,onClick:()=>c(p*100),children:[b,p]},p)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:r,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=b,e[11]=l,e[12]=r,e[13]=t,e[14]=c,e[15]=N):N=e[15];let g;e[16]!==b||e[17]!==v||e[18]!==m||e[19]!==l||e[20]!==u||e[21]!==r||e[22]!==I||e[23]!==t||e[24]!==c?(g=l&&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:b}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:v,onChange:p=>I(p.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!u||r,onClick:()=>c(Math.round(m*100)),children:r?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),I("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=b,e[17]=v,e[18]=m,e[19]=l,e[20]=u,e[21]=r,e[22]=I,e[23]=t,e[24]=c,e[25]=g):g=e[25];let k;return e[26]!==j||e[27]!==N||e[28]!==g?(k=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,g]})}),e[26]=j,e[27]=N,e[28]=g,e[29]=k):k=e[29],k}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=le(),{org:i}=_e(),l=ce(),a=ke(),n=Fe();let c;e[0]!==n?(c=n.find(Xt),e[0]=n,e[1]=c):c=e[1];const r=c,[v,I]=W.useState(!1);let _;e[2]!==r||e[3]!==l?(_=async()=>{r&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=l,e[4]=_):_=e[4];let o;e[5]!==i.id||e[6]!==a||e[7]!==t?(o=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),I(!1)},e[5]=i.id,e[6]=a,e[7]=t,e[8]=o):o=e[8];let d;e[9]!==t?(d=rt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:rt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==_||e[12]!==o||e[13]!==d?(m={mutationFn:_,onSuccess:o,onError:d},e[11]=_,e[12]=o,e[13]=d,e[14]=m):m=e[14];const{mutate:u,isPending:b}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const y=!!r;let f;e[17]!==l?(f=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=f):f=e[18];let j;e[19]!==x||e[20]!==y||e[21]!==f?(j={queryKey:x,enabled:y,staleTime:6e4,queryFn:f},e[19]=x,e[20]=y,e[21]=f,e[22]=j):j=e[22];const{data:N,isLoading:g,refetch:k,isFetching:p}=Re(j);if(!r)return null;const h=N?.balanceCents!=null?N.balanceCents/100:null;let S;e[23]!==h?(S=h!=null?`$${h.toFixed(2)}`:"—",e[23]=h,e[24]=S):S=e[24];const C=S;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>I(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==b||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:b,children:Q}),e[41]=b,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Ze,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let P;e[53]!==V?(P=s.jsx(Xe,{children:V}),e[53]=V,e[54]=P):P=e[54];let F;e[55]!==B||e[56]!==P?(F=s.jsxs(et,{children:[B,P]}),e[55]=B,e[56]=P,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(tt,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(st,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(it,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(lt,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==v||e[76]!==G?(oe=s.jsx(ot,{open:v,onOpenChange:I,children:G}),e[75]=v,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==h||e[79]!==C||e[80]!==p||e[81]!==g?(te=g||p?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",h!=null&&Jt(h)),children:C}),e[78]=h,e[79]=C,e[80]=p,e[81]=g,e[82]=te):te=e[82];let de;e[83]!==k?(de=()=>k(),e[83]=k,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=p&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Ve,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==p||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:p,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=p,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ie;return e[118]!==w||e[119]!==Se?(Ie=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ie):Ie=e[120],Ie}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(8),{org:t}=_e(),i=ce(),l=ke();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 n;e[2]!==t||e[3]!==l?(n=()=>{Qe("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=n):n=e[4];let c;return e[5]!==a||e[6]!==n?(c={mutationFn:a,onSuccess:n,onError:ts},e[5]=a,e[6]=n,e[7]=c):c=e[7],ae(c)}function ts(e){Qe("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ee.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=Z.c(37),t=le(),{mutate:i,isPending:l}=es();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 n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=n):n=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let r;e[4]!==c?(r=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=r):r=e[5];let v;e[6]!==t?(v=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=v):v=e[7];let I;e[8]!==v?(I=s.jsx("p",{className:"text-base font-semibold",children:v}),e[8]=v,e[9]=I):I=e[9];let _;e[10]!==t?(_=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=_):_=e[11];let o;e[12]!==_?(o=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:_}),e[12]=_,e[13]=o):o=e[13];let d;e[14]!==I||e[15]!==o?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[I,o]}),e[14]=I,e[15]=o,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let b;e[21]!==u||e[22]!==d?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[21]=u,e[22]=d,e[23]=b):b=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let y;e[26]!==l||e[27]!==t?(y=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=y):y=e[28];let f;e[29]!==l||e[30]!==x||e[31]!==y?(f=s.jsx(se,{variant:"outline",disabled:l,onClick:x,children:y}),e[29]=l,e[30]=x,e[31]=y,e[32]=f):f=e[32];let j;return e[33]!==b||e[34]!==f||e[35]!==r?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[n,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[r,b,f]})]}),e[33]=b,e[34]=f,e[35]=r,e[36]=j):j=e[36],j}const is=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function ls({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function os({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:a,currentBaseUrl:n,onCancel:c,onSuccess:r}){const{org:v}=_e(),I=ce(),_=ke(),o=le(),[d,m]=W.useState(!1),u=t.id==="openai-compatible",b=t.supportedMethods.includes("api-key"),x=is(o),{register:y,handleSubmit:f,watch:j,setError:N,formState:{errors:g}}=Le({resolver:ze(x),defaultValues:{label:a,apiKey:"",baseUrl:n??""}}),k=j("apiKey")??"",{mutate:p,isPending:h}=ae({mutationFn:async S=>{let C;S.apiKey&&(u?C=JSON.stringify({baseUrl:S.baseUrl||n||"",apiKey:S.apiKey}):C=S.apiKey),await I.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:S.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{_.invalidateQueries({queryKey:ie.aiProviderKeys(v.id)}),_.invalidateQueries({queryKey:ie.aiProviders(v.id)}),ee.success(o("settings.editProviderDialog.providerUpdated")),r()},onError:S=>ee.error(o("settings.editProviderDialog.failedToUpdate",{error:S.message}))});return s.jsxs("form",{onSubmit:f(S=>{if(ls({isOpenAICompatible:u,baseUrl:S.baseUrl,currentBaseUrl:n,apiKey:S.apiKey})){N("apiKey",{message:o("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}p(S)}),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:o("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:o("settings.editProviderDialog.labelPlaceholder"),...y("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??o("settings.editProviderDialog.baseUrlPlaceholder"),...y("baseUrl"),className:"h-8 text-sm"})]}),b&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[o("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",o("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:d&&k?"text":"password",placeholder:l,...y("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":o(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:h,children:o("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:h,children:o(h?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function rs(e){const t=Z.c(31),{providerKey:i,provider:l,open:a,onOpenChange:n}=e,c=le(),r=ce(),v=l.id==="openai-compatible"&&i.presetId?Je(i.presetId):void 0,I=v?.name??l.name;let _;t[0]!==i.id?(_=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=_):_=t[1];let o;t[2]!==i.id||t[3]!==r?(o=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=r,t[4]=o):o=t[4];let d;t[5]!==a||t[6]!==_||t[7]!==o?(d={queryKey:_,queryFn:o,enabled:a,staleTime:0},t[5]=a,t[6]=_,t[7]=o,t[8]=d):d=t[8];const{data:m,isLoading:u}=Re(d),b=Mt,x=Et,y="sm:max-w-md",f=Rt,j=At,N=c("settings.editProviderDialog.editTitle",{name:I});let g;t[9]!==j||t[10]!==N?(g=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=g):g=t[11];let k;t[12]!==f||t[13]!==g?(k=s.jsx(f,{children:g}),t[12]=f,t[13]=g,t[14]=k):k=t[14];let p;t[15]!==u||t[16]!==n||t[17]!==v||t[18]!==m||t[19]!==l||t[20]!==i?(p=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(os,{providerKey:i,provider:l,preset:v,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>n(!1),onSuccess:()=>n(!1)}),t[15]=u,t[16]=n,t[17]=v,t[18]=m,t[19]=l,t[20]=i,t[21]=p):p=t[21];let h;t[22]!==x||t[23]!==k||t[24]!==p?(h=s.jsxs(x,{className:y,children:[k,p]}),t[22]=x,t[23]=k,t[24]=p,t[25]=h):h=t[25];let S;return t[26]!==b||t[27]!==n||t[28]!==a||t[29]!==h?(S=s.jsx(b,{open:a,onOpenChange:n,children:h}),t[26]=b,t[27]=n,t[28]=a,t[29]=h,t[30]=S):S=t[30],S}function ns(e){const t=Z.c(86),{providerKey:i,provider:l}=e,{org:a}=_e(),n=ce(),c=ke(),[r,v]=W.useState(!1),[I,_]=W.useState(!1),o=le(),[d]=at(),m=d.language==="pt-BR"?_t:void 0,u=l?.id==="openai-compatible";let b;t[0]!==u||t[1]!==i.presetId?(b=u&&i.presetId?Je(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=b):b=t[2];const x=b;let y;t[3]!==u||t[4]!==x||t[5]!==l?.name||t[6]!==i.providerId||t[7]!==o?(y=x?x.name:u?o("settings.aiProviders.customOpenAiCompatible"):l?.name??(i.providerId==="claude-code"?o("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?o("settings.providerKeyRow.codex"):i.providerId),t[3]=u,t[4]=x,t[5]=l?.name,t[6]=i.providerId,t[7]=o,t[8]=y):y=t[8];const f=y,j=x?.logo??l?.logo??wt[i.providerId];let N;e:{if(u){N=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==o?(te=o("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=o,t[13]=te):te=t[13],N=te}const g=N;let k;t[14]!==i.id||t[15]!==n?(k=async()=>{await n.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=n,t[16]=k):k=t[16];let p;t[17]!==a||t[18]!==i.id||t[19]!==c||t[20]!==o?(p=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(a.id)}),c.invalidateQueries({queryKey:ie.aiProviders(a.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(a.id,i.id)}),ee.success(o("settings.providerKeyRow.keyDeleted")),v(!1)},t[17]=a,t[18]=i.id,t[19]=c,t[20]=o,t[21]=p):p=t[21];let h;t[22]!==o?(h=te=>ee.error(o("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=o,t[23]=h):h=t[23];let S;t[24]!==k||t[25]!==p||t[26]!==h?(S={mutationFn:k,onSuccess:p,onError:h},t[24]=k,t[25]=p,t[26]=h,t[27]=S):S=t[27];const{mutate:C,isPending:w}=ae(S);let R;t[28]!==f||t[29]!==j?(R=j?s.jsx("img",{src:j,alt:f,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:f.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=f,t[29]=j,t[30]=R):R=t[30];let A;t[31]!==l||t[32]!==o?(A=l?s.jsx(se,{variant:"ghost",size:"icon","aria-label":o("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>_(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=l,t[32]=o,t[33]=A):A=t[33];let E;t[34]!==o?(E=o("settings.providerKeyRow.deleteProviderKey"),t[34]=o,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>v(!0),U=s.jsx(It,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==g||t[45]!==f||t[46]!==Q||t[47]!==R?($=s.jsx(Ge,{icon:R,title:f,description:g,action:Q}),t[44]=g,t[45]=f,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==I||t[50]!==l||t[51]!==i?(q=l?s.jsx(rs,{providerKey:i,provider:l,open:I,onOpenChange:_}):null,t[49]=I,t[50]=l,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==o?(H=o("settings.providerKeyRow.deleteApiKey"),t[53]=o,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Ze,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(Xe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let P;t[59]!==B||t[60]!==V?(P=s.jsxs(et,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=P):P=t[61];let F;t[62]!==o?(F=o("settings.providerKeyRow.cancel"),t[62]=o,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(tt,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==o?(D=o("settings.providerKeyRow.delete"),t[68]=o,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(st,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(it,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==P||t[77]!==J?(z=s.jsxs(lt,{children:[P,J]}),t[76]=P,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==r||t[80]!==z?(G=s.jsx(ot,{open:r,onOpenChange:v,children:z}),t[79]=r,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function as(e){const t=e.filter(i=>gt(i.providerId));return{hasInventory:e.length>0,hasHostedProvider:t.length>0,hasDeco:t.some(i=>i.providerId==="deco")}}function cs(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(l=>l.id===i.providerId)??null}))}function He(e){const t=Z.c(13),{onConnectClick:i}=e,l=le(),a=Fe(),n=Ye();let c;if(t[0]!==n?.providers||t[1]!==a||t[2]!==i||t[3]!==l){const r=n?.providers??[],v=cs(a,r);let I;t[5]!==l?(I=l("settings.connectedProvidersSection.sectionTitle"),t[5]=l,t[6]=I):I=t[6];let _;t[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ct,{size:14}),t[7]=_):_=t[7];let o;t[8]!==l?(o=l("settings.connectedProvidersSection.connectButton"),t[8]=l,t[9]=o):o=t[9];let d;t[10]!==i||t[11]!==o?(d=s.jsxs(se,{size:"sm",onClick:i,children:[_,o]}),t[10]=i,t[11]=o,t[12]=d):d=t[12],c=s.jsx(Te,{title:I,headerClassName:"px-0",actions:d,children:v.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:v.map(ds)})}),t[0]=n?.providers,t[1]=a,t[2]=i,t[3]=l,t[4]=c}else c=t[4];return c}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(){const e=Z.c(55),t=le(),{org:i}=_e(),l=ce(),a=ke(),[n,c]=W.useState("");let r;e[0]!==i.id?(r=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=r):r=e[1];let v;e[2]!==l?(v=()=>l.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=l,e[3]=v):v=e[3];let I;e[4]!==r||e[5]!==v?(I={queryKey:r,queryFn:v},e[4]=r,e[5]=v,e[6]=I):I=e[6];const _=Re(I);let o;e[7]!==i.id||e[8]!==a?(o=()=>a.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=a,e[9]=o):o=e[9];const d=o;let m;e[10]!==l||e[11]!==n?(m=()=>l.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:n}),e[10]=l,e[11]=n,e[12]=m):m=e[12];let u;e[13]!==d||e[14]!==t?(u=async()=>{c(""),await d(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=d,e[14]=t,e[15]=u):u=e[15];let b;e[16]!==m||e[17]!==u?(b={mutationFn:m,onSuccess:u,onError:ps},e[16]=m,e[17]=u,e[18]=b):b=e[18];const x=ae(b);let y;e[19]!==l?(y=()=>l.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=l,e[20]=y):y=e[20];let f;e[21]!==d||e[22]!==t?(f=async()=>{await d(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=d,e[22]=t,e[23]=f):f=e[23];let j;e[24]!==y||e[25]!==f?(j={mutationFn:y,onSuccess:f,onError:us},e[24]=y,e[25]=f,e[26]=j):j=e[26];const N=ae(j),g=_.data?.connected===!0,k=!g&&!!_.data?.linkedAt;let p;e[27]!==t?(p=t("settings.claudeSubscription.title"),e[27]=t,e[28]=p):p=e[28];let h;e[29]!==p?(h=s.jsx("p",{className:"text-base font-semibold",children:p}),e[29]=p,e[30]=h):h=e[30];let S;e[31]!==g||e[32]!==k||e[33]!==t?(S=t(g?"settings.claudeSubscription.active":k?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=g,e[32]=k,e[33]=t,e[34]=S):S=e[34];let C;e[35]!==S?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[35]=S,e[36]=C):C=e[36];let w;e[37]!==h||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,C]}),e[37]=h,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==g||e[41]!==N||e[42]!==t?(R=g?s.jsx(se,{variant:"outline",disabled:N.isPending,onClick:()=>N.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=g,e[41]=N,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==g||e[49]!==t||e[50]!==n?(E=g?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:n,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:n.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=g,e[49]=t,e[50]=n,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function us(e){return ee.error(e.message)}function ps(e){return ee.error(e.message)}function fs(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(dt,{size:16}),t[0]=l):l=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:[l,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 gs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:l,hasHostedProvider:a,hasDeco:n}=i,[c,r]=W.useState(!1),[v,I]=W.useState(null),_=Ye();let o;e[2]!==_?.providers?(o=_?.providers??[],e[2]=_?.providers,e[3]=o):o=e[3];const d=o;if(!a){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let N;e[5]!==d?(N=s.jsx(yt,{providers:d,onSelect:I,onShowAll:j}),e[5]=d,e[6]=N):N=e[6];const g=v!==null||c;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=w=>{w||(I(null),r(!1))},e[7]=k):k=e[7];const p=v??void 0;let h;e[8]!==g||e[9]!==p?(h=s.jsx($e,{open:g,onOpenChange:k,initialProvider:p}),e[8]=g,e[9]=p,e[10]=h):h=e[10];let S;e[11]!==l?(S=l?s.jsx(He,{onConnectClick:()=>r(!0)}):null,e[11]=l,e[12]=S):S=e[12];let C;return e[13]!==N||e[14]!==h||e[15]!==S?(C=s.jsxs(s.Fragment,{children:[N,h,S]}),e[13]=N,e[14]=h,e[15]=S,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let u;e[18]!==n?(u=n?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=n,e[19]=u):u=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ms,{}),e[20]=b):b=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(He,{onConnectClick:()=>r(!0)}),e[21]=x):x=e[21];let y;e[22]!==c?(y=s.jsx($e,{open:c,onOpenChange:r}),e[22]=c,e[23]=y):y=e[23];let f;return e[24]!==u||e[25]!==y?(f=s.jsxs(s.Fragment,{children:[m,u,b,x,y]}),e[24]=u,e[25]=y,e[26]=f):f=e[26],f}function hs(){const e=Z.c(7),t=le();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ct,{fallback:xs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(gs,{})})}),e[4]=a):a=e[4];let n;return e[5]!==l?(n=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(mt,{children:[l,a]})})})}),e[5]=l,e[6]=n):n=e[6],n}function xs(e){const{error:t}=e;return s.jsx(fs,{error:t??new Error("Failed to load AI providers")})}function ki(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(hs,{})}),e[0]=t):t=e[0],t}export{ki as default};
|
|
1
|
+
import{Z as X,$ as K,_ as Ae,a3 as Ke,a4 as ne,a0 as Be,b8 as Oe,c as Z,b as le,a2 as ze,a1 as Le,r as W,j as s,a5 as nt,t as ee,av as Ve,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,p as Qe,v as at,E as ct}from"./index-DDNkkWLs.js";import{i as dt}from"./AlertCircle-Bj0VV7up.js";import{P as Ne}from"./index-BY10LBdj.js";import{S as Ee}from"./skeleton-BAcj33ku.js";import{b as Ge,a as Me,S as Te,c as mt}from"./settings-section-rIBQA49t.js";import{u as We,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Ye}from"./use-ai-providers-CUHFWYci.js";import{i as ht}from"./CheckCircle-Bp_VEEVz.js";import{b as xt,j as vt}from"./use-organization-settings-B2Gux989.js";import{c as bt,d as Je,P as yt,C as $e}from"./select-model-2-cyvNOe.js";import{u as jt}from"./use-debounced-autosave-yTGUa49y.js";import{I as Ce}from"./input-B6Ue8Gtq.js";import{T as qe,a as St}from"./toggle-group-BEWMY4aK.js";import{A as Ze,a as Xe,b as et,c as tt,d as st,e as it,f as lt,g as ot}from"./alert-dialog-Dw-FseSS.js";import{u as ce}from"./studio-tools-DM5QBHCQ.js";import{s as Ct}from"./Plus-D4rlrlLr.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-CEpJ1e8Z.js";import{s as It}from"./Trash01-CBJEu1qv.js";import{A as Nt}from"./avatar-BoobWyQ-.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-C6kyxW7G.js";import{s as Kt}from"./Eye-DA0zzgps.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-Ct9Ey8Rj.js";import{S as Ft}from"./spinner-ws5yutkc.js";import{R as Ot}from"./require-capability-D8V-K-Ln.js";import"./sidebar-6Pwgqwg8.js";import"./LayoutLeft-Dve3wTbL.js";import"./use-mobile-Cavq-ZyH.js";import"./X-Co0bDnHw.js";import"./tooltip-11Yrt4wp.js";import"./card-Bits-eBf.js";import"./ArrowUpRight-DZ8WfL-N.js";import"./use-mcp-client-B1vuae8u.js";import"./auth-BN6YAe4k.js";import"./drawer-GYAwqNoq.js";import"./chat-context-IReX7DMx.js";import"./tab-id-CiGWDuEk.js";import"./Check-BuqR_Kwe.js";import"./Copy01-CC0Hd3xm.js";import"./hooks-B2o1BQtV.js";import"./decopilot-sse-pool-gVDOcCp6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DrXsz2Gh.js";import"./use-decopilot-events-BcjIJdRs.js";import"./checkbox-BQcYZZpc.js";import"./select-Bn2gd7PP.js";import"./ChevronDown-65wLzJTw.js";import"./ChevronUp-BNz5kAIR.js";import"./ArrowLeft-BqlCFBY7.js";import"./Key01-f9O3oH8b.js";import"./SearchMd-CGwyuA_K.js";import"./Monitor01-CvmVoJ-i.js";import"./ChevronRight-EyYVLyQY.js";import"./Stars01-Cv4Wame5.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-wzGmobUI.js";import"./use-capability-DcMyBnS4.js";import"./access-gate-68wkTQqm.js";import"./capability-load-error-1c_U2BKc.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const re=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();Be(["fast","smart","thinking","image","web_search","deep_research"]);Be(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:re,smart:re,thinking:re,image:re,web_search:re,deep_research:re})});X({tiers:X({fast:re.optional(),smart:re.optional(),thinking:re.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:l,filterModels:a,defaultKeyId:n}=e,c=We(),r=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[v,I]=W.useState(r??n);let _,o;t[0]!==r?(_=()=>{r&&I(r)},o=[r],t[0]=r,t[1]=_,t[2]=o):(_=t[1],o=t[2]),W.useEffect(_,o);let d;t[3]!==c||t[4]!==n||t[5]!==v?(d=c.some(C=>C.id===v)?v:n,t[3]=c,t[4]=n,t[5]=v,t[6]=d):d=t[6];const m=d;let u;t[7]!==m||t[8]!==c?(u=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=u):u=t[9];const b=u,{models:x,isLoading:y}=we(a?m??void 0:void 0),f=a?y||x.some(a):!0;let j;t[10]!==i||t[11]!==b?.providerId||t[12]!==r?(j=i&&r?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:b?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=b?.providerId,t[12]=r,t[13]=j):j=t[13];const N=j,g=le();if(a&&!f){let C;t[14]!==g?(C=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let k;t[18]!==g?(k=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=k):k=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=C=>I(C),t[20]=p):p=t[20];let h;t[21]!==m||t[22]!==l?(h=C=>{const w=C.keyId??m??"";I(w),l({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=l,t[23]=h):h=t[23];let S;return t[24]!==m||t[25]!==a||t[26]!==N||t[27]!==k||t[28]!==h?(S=s.jsx(bt,{variant:"bordered",placeholder:k,model:N,credentialId:m,filterModels:a,onCredentialChange:p,onModelChange:h}),t[24]=m,t[25]=a,t[26]=N,t[27]=k,t[28]=h,t[29]=S):S=t[29],S}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:l}=e,a=le();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ve,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,t[2]=c):c=t[2];let r;return t[3]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=r):r=t[4],r}if(l){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ht,{size:12}),t[5]=n):n=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,t[7]=c):c=t[7];let r;return t[8]!==c?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=r):r=t[9],r}return null}function Vt(){const e=Z.c(58),t=le(),i=We(),l=xt(),a=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=ze(Ut),e[0]=n):n=e[0];let c;e[1]!==l?(c={resolver:n,values:l,mode:"onChange"},e[1]=l,e[2]=c):c=e[2];const r=Le(c),{mutate:v,isPending:I,isSuccess:_}=vt(),o=r.formState.isDirty;let d;e[3]!==r||e[4]!==l||e[5]!==t||e[6]!==v?(d={delayMs:250,save:async()=>{const P=r.getValues();v(P,{onSuccess:()=>r.reset(P,{keepValues:!0}),onError:F=>{r.reset(l),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=r,e[4]=l,e[5]=t,e[6]=v,e[7]=d):d=e[7];const{schedule:m}=jt(d),u=i[0],b=i[1],x=i[2],{models:y}=we(u?.id),{models:f}=we(b?.id),{models:j}=we(x?.id);let N,g;e[8]!==r||e[9]!==a?(N=()=>{a||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[a,r],e[8]=r,e[9]=a,e[10]=N,e[11]=g):(N=e[10],g=e[11]),W.useEffect(N,g);let k;e[12]!==i||e[13]!==r||e[14]!==u||e[15]!==b||e[16]!==x||e[17]!==y||e[18]!==f||e[19]!==j?(k=()=>{const P=r.getValues(),F=new Set(i.map(Qt)),O={};u?.id&&(O[u.id]=y),b?.id&&(O[b.id]=f),x?.id&&(O[x.id]=j);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(P.tiers.fast)?null:P.tiers.fast,smart:T(P.tiers.smart)?null:P.tiers.smart,thinking:T(P.tiers.thinking)?null:P.tiers.thinking,image:T(P.tiers.image)?null:P.tiers.image,web_search:T(P.tiers.web_search)?null:P.tiers.web_search,deep_research:T(P.tiers.deep_research)?null:P.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===P.tiers.fast&&D.smart===P.tiers.smart&&D.thinking===P.tiers.thinking&&D.image===P.tiers.image&&D.web_search===P.tiers.web_search&&D.deep_research===P.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);r.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=r,e[14]=u,e[15]=b,e[16]=x,e[17]=y,e[18]=f,e[19]=j,e[20]=k):k=e[20];const p=u?.id,h=b?.id,S=x?.id;let C;e[21]!==i||e[22]!==r||e[23]!==y||e[24]!==f||e[25]!==j||e[26]!==p||e[27]!==h||e[28]!==S?(C=[r,i,y,f,j,p,h,S],e[21]=i,e[22]=r,e[23]=y,e[24]=f,e[25]=j,e[26]=p,e[27]=h,e[28]=S,e[29]=C):C=e[29],W.useEffect(k,C);let w;e[30]!==t?(w=P=>({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")})[P]||P,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=P=>({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")})[P]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=_&&!o;let $;e[40]!==I||e[41]!==Q?($=s.jsx(Lt,{isPending:I,showSaved:Q}),e[40]=I,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==r.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(P=>s.jsx(nt,{control:r.control,name:`tiers.${P.key}`,render:F=>{const{field:O}=F;return s.jsx(Ge,{title:R(P.key),description:E(P.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:P.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},P.key)),e[46]=i[0]?.id,e[47]=r.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=le(),i=ce(),[l,a]=W.useState(!1);let n;e[0]!==t?(n=p=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=n):n=e[1];const{mutate:c,isPending:r}=ae({mutationFn:async p=>{const{url:h}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:d});return h},onSuccess:Yt,onError:n}),[v,I]=W.useState(""),[_,o]=W.useState("usd"),d=_,m=parseFloat(v),u=!isNaN(m)&&m>=1,b=d==="brl"?"R$":"$";let x;e[2]!==o?(x=p=>{p&&o(p)},e[2]=o,e[3]=x):x=e[3];let y,f;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(qe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),f=s.jsx(qe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=y,e[5]=f):(y=e[4],f=e[5]);let j;e[6]!==d||e[7]!==x?(j=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:d,onValueChange:x,children:[y,f]}),e[6]=d,e[7]=x,e[8]=j):j=e[8];let N;e[9]!==d||e[10]!==b||e[11]!==l||e[12]!==r||e[13]!==t||e[14]!==c?(N=!l&&s.jsxs(s.Fragment,{children:[Gt[d].map(p=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:r,onClick:()=>c(p*100),children:[b,p]},p)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:r,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=b,e[11]=l,e[12]=r,e[13]=t,e[14]=c,e[15]=N):N=e[15];let g;e[16]!==b||e[17]!==v||e[18]!==m||e[19]!==l||e[20]!==u||e[21]!==r||e[22]!==I||e[23]!==t||e[24]!==c?(g=l&&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:b}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:v,onChange:p=>I(p.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!u||r,onClick:()=>c(Math.round(m*100)),children:r?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),I("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=b,e[17]=v,e[18]=m,e[19]=l,e[20]=u,e[21]=r,e[22]=I,e[23]=t,e[24]=c,e[25]=g):g=e[25];let k;return e[26]!==j||e[27]!==N||e[28]!==g?(k=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,N,g]})}),e[26]=j,e[27]=N,e[28]=g,e[29]=k):k=e[29],k}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=le(),{org:i}=_e(),l=ce(),a=ke(),n=Fe();let c;e[0]!==n?(c=n.find(Xt),e[0]=n,e[1]=c):c=e[1];const r=c,[v,I]=W.useState(!1);let _;e[2]!==r||e[3]!==l?(_=async()=>{r&&await l.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=l,e[4]=_):_=e[4];let o;e[5]!==i.id||e[6]!==a||e[7]!==t?(o=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),I(!1)},e[5]=i.id,e[6]=a,e[7]=t,e[8]=o):o=e[8];let d;e[9]!==t?(d=rt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:rt.message}))},e[9]=t,e[10]=d):d=e[10];let m;e[11]!==_||e[12]!==o||e[13]!==d?(m={mutationFn:_,onSuccess:o,onError:d},e[11]=_,e[12]=o,e[13]=d,e[14]=m):m=e[14];const{mutate:u,isPending:b}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const y=!!r;let f;e[17]!==l?(f=async()=>{try{return await l.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=l,e[18]=f):f=e[18];let j;e[19]!==x||e[20]!==y||e[21]!==f?(j={queryKey:x,enabled:y,staleTime:6e4,queryFn:f},e[19]=x,e[20]=y,e[21]=f,e[22]=j):j=e[22];const{data:N,isLoading:g,refetch:k,isFetching:p}=Re(j);if(!r)return null;const h=N?.balanceCents!=null?N.balanceCents/100:null;let S;e[23]!==h?(S=h!=null?`$${h.toFixed(2)}`:"—",e[23]=h,e[24]=S):S=e[24];const C=S;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>I(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==b||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:b,children:Q}),e[41]=b,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Ze,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let P;e[53]!==V?(P=s.jsx(Xe,{children:V}),e[53]=V,e[54]=P):P=e[54];let F;e[55]!==B||e[56]!==P?(F=s.jsxs(et,{children:[B,P]}),e[55]=B,e[56]=P,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(tt,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==u?(D=()=>u(),e[62]=u,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(st,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(it,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(lt,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==v||e[76]!==G?(oe=s.jsx(ot,{open:v,onOpenChange:I,children:G}),e[75]=v,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==h||e[79]!==C||e[80]!==p||e[81]!==g?(te=g||p?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",h!=null&&Jt(h)),children:C}),e[78]=h,e[79]=C,e[80]=p,e[81]=g,e[82]=te):te=e[82];let de;e[83]!==k?(de=()=>k(),e[83]=k,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=p&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Ve,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==p||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:p,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=p,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ie;return e[118]!==w||e[119]!==Se?(Ie=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ie):Ie=e[120],Ie}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(8),{org:t}=_e(),i=ce(),l=ke();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 n;e[2]!==t||e[3]!==l?(n=()=>{Qe("ai_provider_provision_succeeded",{provider_id:"deco"}),l.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),l.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=l,e[4]=n):n=e[4];let c;return e[5]!==a||e[6]!==n?(c={mutationFn:a,onSuccess:n,onError:ts},e[5]=a,e[6]=n,e[7]=c):c=e[7],ae(c)}function ts(e){Qe("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),ee.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=Z.c(37),t=le(),{mutate:i,isPending:l}=es();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 n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=n):n=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let r;e[4]!==c?(r=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=r):r=e[5];let v;e[6]!==t?(v=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=v):v=e[7];let I;e[8]!==v?(I=s.jsx("p",{className:"text-base font-semibold",children:v}),e[8]=v,e[9]=I):I=e[9];let _;e[10]!==t?(_=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=_):_=e[11];let o;e[12]!==_?(o=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:_}),e[12]=_,e[13]=o):o=e[13];let d;e[14]!==I||e[15]!==o?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[I,o]}),e[14]=I,e[15]=o,e[16]=d):d=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let u;e[19]!==m?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=u):u=e[20];let b;e[21]!==u||e[22]!==d?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[21]=u,e[22]=d,e[23]=b):b=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let y;e[26]!==l||e[27]!==t?(y=t(l?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=l,e[27]=t,e[28]=y):y=e[28];let f;e[29]!==l||e[30]!==x||e[31]!==y?(f=s.jsx(se,{variant:"outline",disabled:l,onClick:x,children:y}),e[29]=l,e[30]=x,e[31]=y,e[32]=f):f=e[32];let j;return e[33]!==b||e[34]!==f||e[35]!==r?(j=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[n,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[r,b,f]})]}),e[33]=b,e[34]=f,e[35]=r,e[36]=j):j=e[36],j}const is=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function ls({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:l}){return e&&!!t&&t!==i&&!l}function os({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:a,currentBaseUrl:n,onCancel:c,onSuccess:r}){const{org:v}=_e(),I=ce(),_=ke(),o=le(),[d,m]=W.useState(!1),u=t.id==="openai-compatible",b=t.supportedMethods.includes("api-key"),x=is(o),{register:y,handleSubmit:f,watch:j,setError:N,formState:{errors:g}}=Le({resolver:ze(x),defaultValues:{label:a,apiKey:"",baseUrl:n??""}}),k=j("apiKey")??"",{mutate:p,isPending:h}=ae({mutationFn:async S=>{let C;S.apiKey&&(u?C=JSON.stringify({baseUrl:S.baseUrl||n||"",apiKey:S.apiKey}):C=S.apiKey),await I.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:S.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{_.invalidateQueries({queryKey:ie.aiProviderKeys(v.id)}),_.invalidateQueries({queryKey:ie.aiProviders(v.id)}),ee.success(o("settings.editProviderDialog.providerUpdated")),r()},onError:S=>ee.error(o("settings.editProviderDialog.failedToUpdate",{error:S.message}))});return s.jsxs("form",{onSubmit:f(S=>{if(ls({isOpenAICompatible:u,baseUrl:S.baseUrl,currentBaseUrl:n,apiKey:S.apiKey})){N("apiKey",{message:o("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}p(S)}),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:o("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:o("settings.editProviderDialog.labelPlaceholder"),...y("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:o("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??o("settings.editProviderDialog.baseUrlPlaceholder"),...y("baseUrl"),className:"h-8 text-sm"})]}),b&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[o("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",o("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:d&&k?"text":"password",placeholder:l,...y("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!d),"aria-label":o(d?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:d?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:h,children:o("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:h,children:o(h?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function rs(e){const t=Z.c(31),{providerKey:i,provider:l,open:a,onOpenChange:n}=e,c=le(),r=ce(),v=l.id==="openai-compatible"&&i.presetId?Je(i.presetId):void 0,I=v?.name??l.name;let _;t[0]!==i.id?(_=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=_):_=t[1];let o;t[2]!==i.id||t[3]!==r?(o=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=r,t[4]=o):o=t[4];let d;t[5]!==a||t[6]!==_||t[7]!==o?(d={queryKey:_,queryFn:o,enabled:a,staleTime:0},t[5]=a,t[6]=_,t[7]=o,t[8]=d):d=t[8];const{data:m,isLoading:u}=Re(d),b=Mt,x=Et,y="sm:max-w-md",f=Rt,j=At,N=c("settings.editProviderDialog.editTitle",{name:I});let g;t[9]!==j||t[10]!==N?(g=s.jsx(j,{children:N}),t[9]=j,t[10]=N,t[11]=g):g=t[11];let k;t[12]!==f||t[13]!==g?(k=s.jsx(f,{children:g}),t[12]=f,t[13]=g,t[14]=k):k=t[14];let p;t[15]!==u||t[16]!==n||t[17]!==v||t[18]!==m||t[19]!==l||t[20]!==i?(p=u||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(os,{providerKey:i,provider:l,preset:v,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>n(!1),onSuccess:()=>n(!1)}),t[15]=u,t[16]=n,t[17]=v,t[18]=m,t[19]=l,t[20]=i,t[21]=p):p=t[21];let h;t[22]!==x||t[23]!==k||t[24]!==p?(h=s.jsxs(x,{className:y,children:[k,p]}),t[22]=x,t[23]=k,t[24]=p,t[25]=h):h=t[25];let S;return t[26]!==b||t[27]!==n||t[28]!==a||t[29]!==h?(S=s.jsx(b,{open:a,onOpenChange:n,children:h}),t[26]=b,t[27]=n,t[28]=a,t[29]=h,t[30]=S):S=t[30],S}function ns(e){const t=Z.c(86),{providerKey:i,provider:l}=e,{org:a}=_e(),n=ce(),c=ke(),[r,v]=W.useState(!1),[I,_]=W.useState(!1),o=le(),[d]=at(),m=d.language==="pt-BR"?_t:void 0,u=l?.id==="openai-compatible";let b;t[0]!==u||t[1]!==i.presetId?(b=u&&i.presetId?Je(i.presetId):void 0,t[0]=u,t[1]=i.presetId,t[2]=b):b=t[2];const x=b;let y;t[3]!==u||t[4]!==x||t[5]!==l?.name||t[6]!==i.providerId||t[7]!==o?(y=x?x.name:u?o("settings.aiProviders.customOpenAiCompatible"):l?.name??(i.providerId==="claude-code"?o("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?o("settings.providerKeyRow.codex"):i.providerId),t[3]=u,t[4]=x,t[5]=l?.name,t[6]=i.providerId,t[7]=o,t[8]=y):y=t[8];const f=y,j=x?.logo??l?.logo??wt[i.providerId];let N;e:{if(u){N=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==o?(te=o("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=o,t[13]=te):te=t[13],N=te}const g=N;let k;t[14]!==i.id||t[15]!==n?(k=async()=>{await n.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=n,t[16]=k):k=t[16];let p;t[17]!==a||t[18]!==i.id||t[19]!==c||t[20]!==o?(p=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(a.id)}),c.invalidateQueries({queryKey:ie.aiProviders(a.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(a.id,i.id)}),ee.success(o("settings.providerKeyRow.keyDeleted")),v(!1)},t[17]=a,t[18]=i.id,t[19]=c,t[20]=o,t[21]=p):p=t[21];let h;t[22]!==o?(h=te=>ee.error(o("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=o,t[23]=h):h=t[23];let S;t[24]!==k||t[25]!==p||t[26]!==h?(S={mutationFn:k,onSuccess:p,onError:h},t[24]=k,t[25]=p,t[26]=h,t[27]=S):S=t[27];const{mutate:C,isPending:w}=ae(S);let R;t[28]!==f||t[29]!==j?(R=j?s.jsx("img",{src:j,alt:f,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:f.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=f,t[29]=j,t[30]=R):R=t[30];let A;t[31]!==l||t[32]!==o?(A=l?s.jsx(se,{variant:"ghost",size:"icon","aria-label":o("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>_(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=l,t[32]=o,t[33]=A):A=t[33];let E;t[34]!==o?(E=o("settings.providerKeyRow.deleteProviderKey"),t[34]=o,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>v(!0),U=s.jsx(It,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==g||t[45]!==f||t[46]!==Q||t[47]!==R?($=s.jsx(Ge,{icon:R,title:f,description:g,action:Q}),t[44]=g,t[45]=f,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==I||t[50]!==l||t[51]!==i?(q=l?s.jsx(rs,{providerKey:i,provider:l,open:I,onOpenChange:_}):null,t[49]=I,t[50]=l,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==o?(H=o("settings.providerKeyRow.deleteApiKey"),t[53]=o,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Ze,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(Xe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let P;t[59]!==B||t[60]!==V?(P=s.jsxs(et,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=P):P=t[61];let F;t[62]!==o?(F=o("settings.providerKeyRow.cancel"),t[62]=o,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(tt,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==o?(D=o("settings.providerKeyRow.delete"),t[68]=o,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(st,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(it,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==P||t[77]!==J?(z=s.jsxs(lt,{children:[P,J]}),t[76]=P,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==r||t[80]!==z?(G=s.jsx(ot,{open:r,onOpenChange:v,children:z}),t[79]=r,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function as(e){const t=e.filter(i=>gt(i.providerId));return{hasInventory:e.length>0,hasHostedProvider:t.length>0,hasDeco:t.some(i=>i.providerId==="deco")}}function cs(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(l=>l.id===i.providerId)??null}))}function He(e){const t=Z.c(13),{onConnectClick:i}=e,l=le(),a=Fe(),n=Ye();let c;if(t[0]!==n?.providers||t[1]!==a||t[2]!==i||t[3]!==l){const r=n?.providers??[],v=cs(a,r);let I;t[5]!==l?(I=l("settings.connectedProvidersSection.sectionTitle"),t[5]=l,t[6]=I):I=t[6];let _;t[7]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ct,{size:14}),t[7]=_):_=t[7];let o;t[8]!==l?(o=l("settings.connectedProvidersSection.connectButton"),t[8]=l,t[9]=o):o=t[9];let d;t[10]!==i||t[11]!==o?(d=s.jsxs(se,{size:"sm",onClick:i,children:[_,o]}),t[10]=i,t[11]=o,t[12]=d):d=t[12],c=s.jsx(Te,{title:I,headerClassName:"px-0",actions:d,children:v.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:l("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:v.map(ds)})}),t[0]=n?.providers,t[1]=a,t[2]=i,t[3]=l,t[4]=c}else c=t[4];return c}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(){const e=Z.c(55),t=le(),{org:i}=_e(),l=ce(),a=ke(),[n,c]=W.useState("");let r;e[0]!==i.id?(r=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=r):r=e[1];let v;e[2]!==l?(v=()=>l.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=l,e[3]=v):v=e[3];let I;e[4]!==r||e[5]!==v?(I={queryKey:r,queryFn:v},e[4]=r,e[5]=v,e[6]=I):I=e[6];const _=Re(I);let o;e[7]!==i.id||e[8]!==a?(o=()=>a.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=a,e[9]=o):o=e[9];const d=o;let m;e[10]!==l||e[11]!==n?(m=()=>l.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:n}),e[10]=l,e[11]=n,e[12]=m):m=e[12];let u;e[13]!==d||e[14]!==t?(u=async()=>{c(""),await d(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=d,e[14]=t,e[15]=u):u=e[15];let b;e[16]!==m||e[17]!==u?(b={mutationFn:m,onSuccess:u,onError:ps},e[16]=m,e[17]=u,e[18]=b):b=e[18];const x=ae(b);let y;e[19]!==l?(y=()=>l.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=l,e[20]=y):y=e[20];let f;e[21]!==d||e[22]!==t?(f=async()=>{await d(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=d,e[22]=t,e[23]=f):f=e[23];let j;e[24]!==y||e[25]!==f?(j={mutationFn:y,onSuccess:f,onError:us},e[24]=y,e[25]=f,e[26]=j):j=e[26];const N=ae(j),g=_.data?.connected===!0,k=!g&&!!_.data?.linkedAt;let p;e[27]!==t?(p=t("settings.claudeSubscription.title"),e[27]=t,e[28]=p):p=e[28];let h;e[29]!==p?(h=s.jsx("p",{className:"text-base font-semibold",children:p}),e[29]=p,e[30]=h):h=e[30];let S;e[31]!==g||e[32]!==k||e[33]!==t?(S=t(g?"settings.claudeSubscription.active":k?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=g,e[32]=k,e[33]=t,e[34]=S):S=e[34];let C;e[35]!==S?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),e[35]=S,e[36]=C):C=e[36];let w;e[37]!==h||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,C]}),e[37]=h,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==g||e[41]!==N||e[42]!==t?(R=g?s.jsx(se,{variant:"outline",disabled:N.isPending,onClick:()=>N.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=g,e[41]=N,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==g||e[49]!==t||e[50]!==n?(E=g?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:n,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:n.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=g,e[49]=t,e[50]=n,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function us(e){return ee.error(e.message)}function ps(e){return ee.error(e.message)}function fs(e){const t=Z.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(dt,{size:16}),t[0]=l):l=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:[l,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 gs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:l,hasHostedProvider:a,hasDeco:n}=i,[c,r]=W.useState(!1),[v,I]=W.useState(null),_=Ye();let o;e[2]!==_?.providers?(o=_?.providers??[],e[2]=_?.providers,e[3]=o):o=e[3];const d=o;if(!a){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let N;e[5]!==d?(N=s.jsx(yt,{providers:d,onSelect:I,onShowAll:j}),e[5]=d,e[6]=N):N=e[6];const g=v!==null||c;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=w=>{w||(I(null),r(!1))},e[7]=k):k=e[7];const p=v??void 0;let h;e[8]!==g||e[9]!==p?(h=s.jsx($e,{open:g,onOpenChange:k,initialProvider:p}),e[8]=g,e[9]=p,e[10]=h):h=e[10];let S;e[11]!==l?(S=l?s.jsx(He,{onConnectClick:()=>r(!0)}):null,e[11]=l,e[12]=S):S=e[12];let C;return e[13]!==N||e[14]!==h||e[15]!==S?(C=s.jsxs(s.Fragment,{children:[N,h,S]}),e[13]=N,e[14]=h,e[15]=S,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let u;e[18]!==n?(u=n?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=n,e[19]=u):u=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ms,{}),e[20]=b):b=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(He,{onConnectClick:()=>r(!0)}),e[21]=x):x=e[21];let y;e[22]!==c?(y=s.jsx($e,{open:c,onOpenChange:r}),e[22]=c,e[23]=y):y=e[23];let f;return e[24]!==u||e[25]!==y?(f=s.jsxs(s.Fragment,{children:[m,u,b,x,y]}),e[24]=u,e[25]=y,e[26]=f):f=e[26],f}function hs(){const e=Z.c(7),t=le();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let l;e[2]!==i?(l=s.jsx(Ne.Title,{children:i}),e[2]=i,e[3]=l):l=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ct,{fallback:xs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(gs,{})})}),e[4]=a):a=e[4];let n;return e[5]!==l?(n=s.jsx(Ne,{children:s.jsx(Ne.Content,{children:s.jsx(Ne.Body,{children:s.jsxs(mt,{children:[l,a]})})})}),e[5]=l,e[6]=n):n=e[6],n}function xs(e){const{error:t}=e;return s.jsx(fs,{error:t??new Error("Failed to load AI providers")})}function ki(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(hs,{})}),e[0]=t):t=e[0],t}export{ki as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,m as o,j as c,bC as d}from"./index-
|
|
1
|
+
import{c as n,m as o,j as c,bC as d}from"./index-DDNkkWLs.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as r,cS as T,cU as w,aL as m,cW as A,e0 as O,H as M,aN as I,cT as L,e1 as D,cV as z,d2 as F,aJ as G,d4 as H,cX as V,c as n,m as p,U as v}from"./index-
|
|
1
|
+
import{r as i,j as r,cS as T,cU as w,aL as m,cW as A,e0 as O,H as M,aN as I,cT as L,e1 as D,cV as z,d2 as F,aJ as G,d4 as H,cX as V,c as n,m as p,U as v}from"./index-DDNkkWLs.js";var x="AlertDialog",[W]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var k="AlertDialogTrigger",U=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});U.displayName=k;var Y="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=Y;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(V,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[B,J]=W(f),X=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:h,docsSlug:"alert-dialog",children:r.jsx(B,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(X,{children:a}),r.jsx(Q,{contentRef:c})]})})})});j.displayName=f;var h="AlertDialogTitle",b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});b.displayName=h;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});R.displayName=E;var K="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=K;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=J($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var Q=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Bt,b as kt,r as A,j as o,m as jt,k as _t,t as xt}from"./index-DrMtZH3n.js";import{i as wt}from"./ChevronRight-BgMlkNeC.js";import{B as At}from"./automation-runs-BPvY5e0p.js";import{u as Et,A as Nt}from"./use-section-preview-base-DadVPpps.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-5uJTtKF7.js";import"./select-DwoG3i35.js";import"./tooltip-H0fhJGAw.js";import"./Check-CQsEmdtb.js";import"./ChevronDown-l4iG0p-P.js";import"./ChevronUp-DOlZYOVw.js";import"./agent-icon-BHmHLR-n.js";import"./AlertCircle-WwYKI5Qb.js";import"./Tool01-Dc3mraKQ.js";import"./ArrowUp-Dl3cQVzC.js";import"./ArrowLeft-aA-FzaCr.js";import"./Tool02-Br6dtRR1.js";import"./XCircle-u_MUCjn5.js";import"./ArrowUpRight-BZW220i4.js";import"./TrendUp01-Drrs9no-.js";import"./ZapSquare-CATFBr1V.js";import"./Users03-BJlJhI3u.js";import"./CheckCircle-DR3Li8PK.js";import"./DotsVertical-CowCWATW.js";import"./Stars02-CV1jiWYO.js";import"./Copy01-CKF7O5eT.js";import"./CpuChip01-rrqN9f4p.js";import"./CreditCard01-DD6aW3wk.js";import"./Globe01-Bl9pBdBK.js";import"./Settings02-DrpZgC_J.js";import"./Eye-DoysLbE1.js";import"./FilterLines-CXcCTqQu.js";import"./Share07-DGsuXOEY.js";import"./Star01-BYdY-DAR.js";import"./Globe04-Ccsw_B8c.js";import"./SwitchHorizontal01-44Mb4crN.js";import"./HardDrive-D30Gjyo8.js";import"./Key01-Ch_IQKvS.js";import"./LayoutLeft-CV2T0vO3.js";import"./LinkExternal01-DLPXVHWD.js";import"./LogOut01-BtWQrKvN.js";import"./Monitor01-BT8u7fos.js";import"./Sun-C9UnoqJl.js";import"./Palette-CZ3inffY.js";import"./Play-D7O034DB.js";import"./Plus-tOluSbOt.js";import"./SearchLg-C67h3xK8.js";import"./SearchMd-P-qGR4xa.js";import"./Shield01-DVvWyA23.js";import"./Stars01-DsD31Ln0.js";import"./Trash01-CCc2xaoD.js";import"./Upload01-pkxuOolK.js";import"./User01-DQvk8cF7.js";import"./Users01-BTeOoP3Y.js";import"./XClose-C0MPTyCv.js";import"./X-Db6CXFPy.js";import"./Zap-DW4Pf0JH.js";import"./useInfiniteQuery-BSP--nFF.js";import"./use-infinite-scroll-CbzOsGKa.js";import"./use-connection-C06aQf36.js";import"./use-mcp-client-BYQZ09jw.js";import"./auth-CHfV0PAM.js";import"./use-virtual-mcp-Cfa_s6xG.js";import"./card-BvQeGTaA.js";import"./sidebar-DgQgb5sn.js";import"./use-mobile-BpvQFpHJ.js";import"./table-wkh9heo2.js";import"./empty-state-DIZU59YF.js";import"./use-members-hO-mw4Hb.js";import"./use-org-auth-client-BemR7rGU.js";import"./use-clock-tick-CxYlu2Gq.js";import"./use-automations-CUmyAWfM.js";import"./studio-tools-Cl_MnIvi.js";import"./useSuspenseInfiniteQuery-CrU4YP2H.js";import"./avatar-z-df-Tey.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-gW0QHo8P.js";import"./dialog-dwIz7L83.js";import"./tab-id-Bxlhy6J5.js";import"./hooks-C786cEpP.js";import"./decopilot-sse-pool-DEYtntVd.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-WBuSodUL.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-BHJZGUc0.js";import"./use-decopilot-events-a7Wk8Vas.js";import"./use-organization-settings-DO-5TCG5.js";import"./monaco-editor-BEE54e2X.js";import"./spinner-DGBqgXCx.js";import"./index-cjWVUbYe.js";import"./shell-layout-B5fO0Zra.js";import"./required-auth-layout-088Qrhua.js";import"./use-org-sso-BCOboyXc.js";import"./integration-icon-CyGR5k8y.js";import"./use-navigate-to-agent-BqIzfs1W.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DF9gicSk.js";import"./form-Z85glc_u.js";import"./label-mbqBY0TT.js";import"./input-B8CuwYhS.js";import"./file-type-icon-BkqsbMIs.js";import"./drawer-CgKwyvsH.js";import"./collection-search-TJMJz_8d.js";import"./tabs-CEYHI8Md.js";import"./toggle-group-2FXdfAeH.js";import"./use-deco-credits-g0IlK0Pn.js";import"./popover-jpJstolX.js";import"./alert-dialog-6X4VWLwP.js";import"./toolbar-DJeYjzbm.js";import"./skeleton-BAWjjFCN.js";import"./github-repo-picker-CgqrZDpc.js";import"./use-debounced-value-Dp6sftMR.js";import"./authenticate-and-persist-oauth-2C0xJmA1.js";import"./mcp-oauth-Bh4D_1yr.js";import"./use-mcp-tools-1zzjIAwR.js";import"./extract-connection-data-CW-wL2c1.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-Cetubrum.js";import"./use-registry-connections-DAUYDjwC.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-1wjTSY40.js";import"./connection-form-helpers-BVEb50_K.js";import"./collection-tabs-DOWoAX_i.js";import"./badge-CSetiRsF.js";import"./use-open-billing-url-DhJWA6Ab.js";import"./select-model-BJcNU1LC.js";import"./checkbox-CHPu3dI7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BaQE1wG9.js";import"./cards-DM50BBl9.js";import"./dropdown-menu-DBTeEfEp.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B7jzN0nF.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-wtjHty-j.js";import"./pt-BR-CLy76QW2.js";import"./switch-BkAM2D0l.js";import"./use-debounced-autosave-JjCfq5kj.js";import"./index-BHdTRFZE.js";import"./search-input-yzjarZOy.js";import"./index-DBCVpCmb.js";import"./use-secrets-DbAKuIqf.js";import"./self-tool-result-BIcvrUov.js";import"./use-tags-C70JhIII.js";import"./get-initials-D-f_fDFw.js";import"./command-B1gQ3Abx.js";import"./index-D6mIw648.js";import"./use-file-configs-BXAOsCuo.js";import"./automation-list-row-CRYE-69o.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Pr(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{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:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{Pr as AppEditor};
|
|
1
|
+
import{c as Bt,b as kt,r as A,j as o,m as jt,k as _t,t as xt}from"./index-DDNkkWLs.js";import{i as wt}from"./ChevronRight-EyYVLyQY.js";import{B as At}from"./automation-runs-Cdra6s3F.js";import{u as Et,A as Nt}from"./use-section-preview-base-D_sClGro.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-DUS53ufg.js";import"./select-Bn2gd7PP.js";import"./tooltip-11Yrt4wp.js";import"./Check-BuqR_Kwe.js";import"./ChevronDown-65wLzJTw.js";import"./ChevronUp-BNz5kAIR.js";import"./agent-icon-BwZmxZXB.js";import"./AlertCircle-Bj0VV7up.js";import"./Tool01-CEpJ1e8Z.js";import"./ArrowUp-D_w2qey6.js";import"./ArrowLeft-BqlCFBY7.js";import"./Tool02-Cn87iqZi.js";import"./XCircle-C2qoD1I-.js";import"./ArrowUpRight-DZ8WfL-N.js";import"./TrendUp01-B5Y95ssn.js";import"./ZapSquare-Cois6M8k.js";import"./Users03-BAonmOfw.js";import"./CheckCircle-Bp_VEEVz.js";import"./DotsVertical-DlkoNOjo.js";import"./Stars02-B6VMIlyW.js";import"./Copy01-CC0Hd3xm.js";import"./CpuChip01-AFiwguFW.js";import"./CreditCard01-Crsjk2NQ.js";import"./Globe01-BzoxFmTs.js";import"./Settings02-C6kyxW7G.js";import"./Eye-DA0zzgps.js";import"./FilterLines-URZsEuaM.js";import"./Share07-q1slgvW5.js";import"./Star01-DSgMIlZH.js";import"./Globe04-3sGIF22h.js";import"./SwitchHorizontal01-OZQMkGRb.js";import"./HardDrive-Do13Gda6.js";import"./Key01-f9O3oH8b.js";import"./LayoutLeft-Dve3wTbL.js";import"./LinkExternal01-BT1cKht3.js";import"./LogOut01-BUyEI5Ky.js";import"./Monitor01-CvmVoJ-i.js";import"./Sun-BhbPIZVi.js";import"./Palette--hypnXQO.js";import"./Play-xBu_rWbV.js";import"./Plus-D4rlrlLr.js";import"./SearchLg-DxcRs5em.js";import"./SearchMd-CGwyuA_K.js";import"./Shield01-CYrRKcNn.js";import"./Stars01-Cv4Wame5.js";import"./Trash01-CBJEu1qv.js";import"./Upload01-BtHH4hys.js";import"./User01-wzGmobUI.js";import"./Users01-JAFRD8ie.js";import"./XClose-BZUFm2pl.js";import"./X-Co0bDnHw.js";import"./Zap-B7cBqfTM.js";import"./useInfiniteQuery-CpFXCemx.js";import"./use-infinite-scroll-B52yZeYp.js";import"./use-connection-DVLPDTuB.js";import"./use-mcp-client-B1vuae8u.js";import"./auth-BN6YAe4k.js";import"./use-virtual-mcp-DrXsz2Gh.js";import"./card-Bits-eBf.js";import"./sidebar-6Pwgqwg8.js";import"./use-mobile-Cavq-ZyH.js";import"./table-la-GCDtJ.js";import"./empty-state-Cp2wPJZ8.js";import"./use-members-Cu4tim8h.js";import"./use-org-auth-client-BQJU69BH.js";import"./use-clock-tick-QY57Oj13.js";import"./use-automations-iQtt0rLd.js";import"./studio-tools-DM5QBHCQ.js";import"./useSuspenseInfiniteQuery-BSnce96W.js";import"./avatar-BoobWyQ-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D-GM29SE.js";import"./dialog-Ct9Ey8Rj.js";import"./tab-id-CiGWDuEk.js";import"./hooks-B2o1BQtV.js";import"./decopilot-sse-pool-gVDOcCp6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-IReX7DMx.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CUHFWYci.js";import"./use-decopilot-events-BcjIJdRs.js";import"./use-organization-settings-B2Gux989.js";import"./monaco-editor-B8kAUX7x.js";import"./spinner-ws5yutkc.js";import"./index-Byd_5VBR.js";import"./shell-layout-DvrKfubx.js";import"./required-auth-layout-QkQ_LFn1.js";import"./use-org-sso-Bv_JE25K.js";import"./integration-icon-WlgJZAAr.js";import"./use-navigate-to-agent-CO828s2W.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-CeR7jziX.js";import"./form-ahiIaHkC.js";import"./label-ByQVKXpC.js";import"./input-B6Ue8Gtq.js";import"./file-type-icon-_hn3I6uX.js";import"./drawer-GYAwqNoq.js";import"./collection-search-DhMY4ddj.js";import"./tabs-CA2r-tm8.js";import"./toggle-group-BEWMY4aK.js";import"./use-deco-credits-Cthvsr_H.js";import"./popover-C4xldx8X.js";import"./alert-dialog-Dw-FseSS.js";import"./toolbar-DOAlJJnD.js";import"./skeleton-BAcj33ku.js";import"./github-repo-picker-CzqkmjKN.js";import"./use-debounced-value-CkNYo5YL.js";import"./authenticate-and-persist-oauth-C7D93rUY.js";import"./mcp-oauth-upBlM6GN.js";import"./use-mcp-tools-DwnvrfSJ.js";import"./extract-connection-data-Da3hmofn.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-ufuvpGD9.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DzP8uvoS.js";import"./use-registry-connections-B30kwQ-D.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Cgxpb5eg.js";import"./connection-form-helpers-RsEw84Yh.js";import"./collection-tabs-ByKLfy-a.js";import"./badge-Be6ykVtM.js";import"./use-open-billing-url-Cq6CFoOt.js";import"./select-model-2-cyvNOe.js";import"./checkbox-BQcYZZpc.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-rIBQA49t.js";import"./cards-PKu1jg4N.js";import"./dropdown-menu-BggRvEh9.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CT1tk-BS.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-DcMyBnS4.js";import"./pt-BR-CLy76QW2.js";import"./switch-DkU4M0dt.js";import"./use-debounced-autosave-yTGUa49y.js";import"./index-BY10LBdj.js";import"./search-input-kBCGvCld.js";import"./index-DLk8Iv0l.js";import"./use-secrets-DVBgSmhl.js";import"./self-tool-result-PcOApdBI.js";import"./use-tags-CzUPzpBT.js";import"./get-initials-D-f_fDFw.js";import"./command-BszbaY2I.js";import"./index-CNhpdWse.js";import"./use-file-configs-CpKyEHH5.js";import"./automation-list-row-wSuBQBzW.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Pr(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{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:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{Pr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cA as v,cB as $,cC as W,cD as L,cE as H,cF as D,cG as V,cH as x,cI as q,cJ as j,cK as y,cL as N,cM as B,cN as F,cO as Z}from"./index-DrMtZH3n.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Y(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function 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 V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function 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 v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function 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 O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Y(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 x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{cA as v,cB as $,cC as W,cD as L,cE as H,cF as D,cG as V,cH as x,cI as q,cJ as j,cK as y,cL as N,cM as B,cN as F,cO as Z}from"./index-DDNkkWLs.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Y(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function 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 V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function 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 v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function 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 O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Y(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 x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-
|
|
1
|
+
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-DDNkkWLs.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};
|