decocms 4.167.1 → 4.167.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B9QqDYpV.js → AlertCircle-CUqW_w6g.js} +1 -1
- package/dist/client/assets/{AreaChart-DbP5hfAi.js → AreaChart-Bm75VTUe.js} +1 -1
- package/dist/client/assets/{ArrowUp-DWMmuZz_.js → ArrowUp-C7ToAohd.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BWTRGGcn.js → ArrowUpRight-Ctd2GOR9.js} +1 -1
- package/dist/client/assets/{Check-BVpJjApv.js → Check-CgsRhHy8.js} +1 -1
- package/dist/client/assets/{CheckCircle-DqPpDLAb.js → CheckCircle-VXm1pD5i.js} +1 -1
- package/dist/client/assets/{ChevronDown-DTyVSvpW.js → ChevronDown-Wb4xUAM2.js} +1 -1
- package/dist/client/assets/{ChevronRight-MVnPAPii.js → ChevronRight-Bb4Md-MD.js} +1 -1
- package/dist/client/assets/{ChevronUp-DNXgZ_10.js → ChevronUp-Bsb-Y77Y.js} +1 -1
- package/dist/client/assets/{Copy01-CKPJ5IhB.js → Copy01-DZd32DIO.js} +1 -1
- package/dist/client/assets/{CpuChip01-Du71UW4x.js → CpuChip01-BPw4omKe.js} +1 -1
- package/dist/client/assets/{DotsVertical-0qwliDrg.js → DotsVertical-Do26-QjL.js} +1 -1
- package/dist/client/assets/{Eye-DydEPicd.js → Eye-B22W8AyK.js} +1 -1
- package/dist/client/assets/{FilterLines-BJV5RK1l.js → FilterLines-Bc1kxraS.js} +1 -1
- package/dist/client/assets/{HardDrive-CGeasvVZ.js → HardDrive-BUNzYRdb.js} +1 -1
- package/dist/client/assets/{Key01-DuDppfi_.js → Key01-CG1NND7T.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Ciwgy5UL.js → LayoutLeft-m1wg28yS.js} +1 -1
- package/dist/client/assets/{LinkExternal01--DLqIMAa.js → LinkExternal01-BHdYJ4vg.js} +1 -1
- package/dist/client/assets/{LogOut01-DMqcCuTY.js → LogOut01-CTki1bzq.js} +1 -1
- package/dist/client/assets/{Monitor01-B6vkAJLy.js → Monitor01-DcyY807V.js} +1 -1
- package/dist/client/assets/{Palette-BoJouFtF.js → Palette-BEUtyKuF.js} +1 -1
- package/dist/client/assets/{Play-C5V2_mAu.js → Play-DrITqLDw.js} +1 -1
- package/dist/client/assets/{Plus-hTCIWDtE.js → Plus-BmYOuiAj.js} +1 -1
- package/dist/client/assets/{SearchLg-CEMI_Yu5.js → SearchLg-Brn3yddB.js} +1 -1
- package/dist/client/assets/{SearchMd-CGs342fz.js → SearchMd-h05KKMiS.js} +1 -1
- package/dist/client/assets/{Settings02-CzRrS-qR.js → Settings02-DqYJFs_A.js} +1 -1
- package/dist/client/assets/{Shield01-b0Ri5_gK.js → Shield01-BGuTNf8w.js} +1 -1
- package/dist/client/assets/{Star01-BetPRMOP.js → Star01-sYD82Np9.js} +1 -1
- package/dist/client/assets/{Stars01-DQgIK8ZP.js → Stars01-CfCAp21f.js} +1 -1
- package/dist/client/assets/{Stars02-JSRi49Xl.js → Stars02-DnbvYkKU.js} +1 -1
- package/dist/client/assets/{Sun-OLuqlB9J.js → Sun-tw8Adw2s.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-GLaQT_tZ.js → SwitchHorizontal01-BnpMv-f4.js} +1 -1
- package/dist/client/assets/{Tool01-D_lBKESF.js → Tool01-CTroi0ek.js} +1 -1
- package/dist/client/assets/{Tool02-BcNfyibb.js → Tool02-Bh88tYGs.js} +1 -1
- package/dist/client/assets/{Trash01--2hLWyEP.js → Trash01-B8ymhEo_.js} +1 -1
- package/dist/client/assets/{TrendUp01-4daEWKyg.js → TrendUp01-Bqs7ykt4.js} +1 -1
- package/dist/client/assets/{Upload01-CpoC4YD6.js → Upload01-CRF4bF0L.js} +1 -1
- package/dist/client/assets/{User01-Ddv0yRQm.js → User01-BMMY0J4X.js} +1 -1
- package/dist/client/assets/{Users01-B0XXonaO.js → Users01-Co3nN3tw.js} +1 -1
- package/dist/client/assets/{Users03-C-1TY48R.js → Users03-23U4ny0D.js} +1 -1
- package/dist/client/assets/{X-BcM56kD2.js → X-BM44NliR.js} +1 -1
- package/dist/client/assets/{XCircle-B8N2lyCq.js → XCircle-UQVfZTIm.js} +1 -1
- package/dist/client/assets/{XClose-BMHkS-kz.js → XClose-Beh-B9Gb.js} +1 -1
- package/dist/client/assets/{Zap-0Vx8dn_e.js → Zap-BuelQrvQ.js} +1 -1
- package/dist/client/assets/{ZapSquare-Nv0rijSe.js → ZapSquare-Cp9irGGl.js} +1 -1
- package/dist/client/assets/{access-gate-ClCWz49c.js → access-gate-D-oUG6gg.js} +1 -1
- package/dist/client/assets/{add-section-modal-J4MpuN5T.js → add-section-modal-D_hcTQ7N.js} +1 -1
- package/dist/client/assets/{agent-icon-DvITB4KO.js → agent-icon-CSidaJ6B.js} +1 -1
- package/dist/client/assets/{agents-list-CplH0YOk.js → agents-list-DpnxFgYY.js} +1 -1
- package/dist/client/assets/{ai-providers-EMQ_jn-r.js → ai-providers-B2Fsskz4.js} +1 -1
- package/dist/client/assets/{alert-B3oOnpj5.js → alert-BTpI2Cnj.js} +1 -1
- package/dist/client/assets/{alert-dialog-B9G0eJ9-.js → alert-dialog-FVJZWl26.js} +1 -1
- package/dist/client/assets/{app-editor-yXBS1_dG.js → app-editor-B4ngBBof.js} +1 -1
- package/dist/client/assets/{auth-C7EjAKuK.js → auth-D-uIp2CQ.js} +1 -1
- package/dist/client/assets/{auth-catchall-BfqFoMfa.js → auth-catchall-V3EeqtwY.js} +1 -1
- package/dist/client/assets/{auth-entry-BB2Zbbuo.js → auth-entry-C08ZxDNT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DwqQL_lh.js → auth-split-layout-ByioBOA7.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Drw6R7zD.js → authenticate-and-persist-oauth-DObbFBl5.js} +1 -1
- package/dist/client/assets/{automation-list-row-B6zoK1J4.js → automation-list-row-DMeZ0lJ3.js} +1 -1
- package/dist/client/assets/{automation-runs-CgyKaz2R.js → automation-runs-DChno1Ee.js} +1 -1
- package/dist/client/assets/{automations-Rl8s5Ge5.js → automations-B1nDP5Tu.js} +1 -1
- package/dist/client/assets/{avatar-BN0lsHoN.js → avatar-BumNKk7X.js} +1 -1
- package/dist/client/assets/{badge-ClnYkgjJ.js → badge-BFv5PsKE.js} +1 -1
- package/dist/client/assets/{block-document-Cs_WYNJE.js → block-document-DT1iEokX.js} +1 -1
- package/dist/client/assets/{brand-context-CtuFGog_.js → brand-context-CjUnREO9.js} +1 -1
- package/dist/client/assets/{buckets-CWde2N2a.js → buckets-D7qH3DY9.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-CGldf2S5.js → bulk-category-panel-R7nvjZc1.js} +1 -1
- package/dist/client/assets/{calendar-CX7YfHEa.js → calendar-DMZ7yz5j.js} +1 -1
- package/dist/client/assets/{capability-load-error-D2CLFEVV.js → capability-load-error-Zpx0CzA1.js} +1 -1
- package/dist/client/assets/{card-Dwttk7rT.js → card-Dv8gN6wM.js} +1 -1
- package/dist/client/assets/{category-editor-Zu5hW0O8.js → category-editor-DBU4RcGL.js} +1 -1
- package/dist/client/assets/{chat-context-BbbE9k_D.js → chat-context-D2jz7TPk.js} +1 -1
- package/dist/client/assets/{checkbox-CpYf9_vX.js → checkbox-B5fS-ChG.js} +1 -1
- package/dist/client/assets/{cli-auth-success-D6c-aysX.js → cli-auth-success-Dq-DdX99.js} +1 -1
- package/dist/client/assets/{collection-detail-D92VY8wh.js → collection-detail-BJdFlI_D.js} +1 -1
- package/dist/client/assets/{collection-display-button-DP3SA4GB.js → collection-display-button-DlQC5Fqe.js} +1 -1
- package/dist/client/assets/{collection-search-Cz6kdWMP.js → collection-search-CclDfE5O.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D5y3-VS8.js → collection-table-wrapper-DRbR52Xw.js} +1 -1
- package/dist/client/assets/{collection-tabs-DySS3fYR.js → collection-tabs-B0dT6Ygy.js} +1 -1
- package/dist/client/assets/{command-CBET95DA.js → command-Bjp1VURS.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BeqUSNyL.js → commerce-onboarding-EUvt30Jc.js} +1 -1
- package/dist/client/assets/{companions-core-DfxidC-a.js → companions-core-BDbmsLM0.js} +1 -1
- package/dist/client/assets/{connect-BpZc7CVv.js → connect-DaqnZRt8.js} +1 -1
- package/dist/client/assets/{connection-_mzadKpF.js → connection-C0Suj0GO.js} +1 -1
- package/dist/client/assets/{connection-card-DDBFrRVD.js → connection-card-HFSstqIJ.js} +1 -1
- package/dist/client/assets/{connection-detail-CQnHH61z.js → connection-detail-BvAKPB53.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B7chcMcT.js → connection-form-helpers-CKgaIsD-.js} +1 -1
- package/dist/client/assets/{connections-Ba0_1aAV.js → connections-O4_j66gP.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-C5huenWS.js → decopilot-sse-pool-NjFnhgvn.js} +1 -1
- package/dist/client/assets/{dialog-BSwzm_xb.js → dialog-D4l4Xdsp.js} +1 -1
- package/dist/client/assets/{domain-settings-BvGX-H5z.js → domain-settings-BMIxOiTg.js} +1 -1
- package/dist/client/assets/{drawer-Bs_TJ-Xq.js → drawer-C3pYai9a.js} +1 -1
- package/dist/client/assets/{dropdown-menu-b_BfGjG2.js → dropdown-menu-Q--ZyLLW.js} +1 -1
- package/dist/client/assets/{empty-state-p3Rv7ykT.js → empty-state-BOcwt_Pf.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CD7g_CXG.js → extract-connection-data-Df7SJj9F.js} +1 -1
- package/dist/client/assets/{file-explorer-wJZqCObJ.js → file-explorer-lqBegrgA.js} +1 -1
- package/dist/client/assets/{form-DH41eKNk.js → form-DMrBv8ot.js} +1 -1
- package/dist/client/assets/{general-CMWfkn6U.js → general-N31775KP.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B3yLKSRu.js → github-repo-picker-Bw5gD-qj.js} +1 -1
- package/dist/client/assets/{hooks-Bva17Au4.js → hooks-BkWYCTuM.js} +1 -1
- package/dist/client/assets/{index-kdXFHcLL.js → index-3_M3tW1F.js} +1 -1
- package/dist/client/assets/{index-DnYz0HYp.js → index-BR7TGZHq.js} +1 -1
- package/dist/client/assets/{index-CMKFDBTg.js → index-BxSgbIJg.js} +1 -1
- package/dist/client/assets/{index-CHyu4u6F.js → index-C8SvWM2K.js} +1 -1
- package/dist/client/assets/{index-B3Lyzc7o.js → index-CfVmXxnZ.js} +35 -35
- package/dist/client/assets/{index-BXC1jJIv.js → index-DBssoMSm.js} +1 -1
- package/dist/client/assets/{index-m3kwuU8_.js → index-DIkj5DIc.js} +1 -1
- package/dist/client/assets/{index-bSjz3FLt.js → index-DptGhhs0.js} +27 -27
- package/dist/client/assets/{index-BuiYUoEr.js → index-Dsil6t1i.js} +1 -1
- package/dist/client/assets/{index-Pe4ypjX9.js → index-NXIL8Ow6.js} +3 -3
- package/dist/client/assets/{index-redirect-Dcp2bxDL.js → index-redirect-dX53aGUA.js} +1 -1
- package/dist/client/assets/{index-r7ibRdki.js → index-yBY16i4r.js} +1 -1
- package/dist/client/assets/{input-mwCJa3UC.js → input-zj8m7n84.js} +1 -1
- package/dist/client/assets/{integration-icon-Dw-S_xW-.js → integration-icon-BuPK5TYy.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BmhAm9Lx.js → invite-member-dialog-C6-_qm1d.js} +1 -1
- package/dist/client/assets/{label-BdYpUysi.js → label-CuF09Kzu.js} +1 -1
- package/dist/client/assets/{layout-wXBYk3l6.js → layout-DBvRMRIb.js} +1 -1
- package/dist/client/assets/{login-BT8Xsyxn.js → login-Cc4SDSF_.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CFh8Fy0x.js → mcp-oauth-shlK2GTY.js} +1 -1
- package/dist/client/assets/{members-DkjeT3mE.js → members-BDXBmXwe.js} +1 -1
- package/dist/client/assets/{monaco-editor-DLbVfQ_7.js → monaco-editor-CVT6PsIN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B_q91RyA.js → monitoring-stats-row-Cdet9jiU.js} +1 -1
- package/dist/client/assets/{multi-select-ponRWmkh.js → multi-select-xU_EwzSI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-3M6tgaHM.js → oauth-callback-ai-provider-Dm1COiz9.js} +1 -1
- package/dist/client/assets/{oauth-callback-qeybtKtJ.js → oauth-callback-iNyi40DB.js} +1 -1
- package/dist/client/assets/{onboarding-DdiUwvH4.js → onboarding-Cloqiw3U.js} +1 -1
- package/dist/client/assets/{org-layout-BO_NrrDG.js → org-layout-CAFsjPqf.js} +1 -1
- package/dist/client/assets/{organization-choice-BT4w0rse.js → organization-choice-Cyi_e8Zq.js} +1 -1
- package/dist/client/assets/{orgs-ChPD5qq-.js → orgs-S_k4xMrd.js} +1 -1
- package/dist/client/assets/{page-seo-form-CP8D3Ih-.js → page-seo-form-D01XOKmk.js} +1 -1
- package/dist/client/assets/{popover-NHkLoGwZ.js → popover-Bt8NA7TT.js} +1 -1
- package/dist/client/assets/{post-editor-Cr2du04f.js → post-editor-C7T3qUe4.js} +1 -1
- package/dist/client/assets/{primitives-2VpPQpUT.js → primitives-CghAr9iC.js} +1 -1
- package/dist/client/assets/{profile-CGYeqX8p.js → profile-Dte5ZwvH.js} +1 -1
- package/dist/client/assets/project-app-view-BkR_dxRJ.js +1 -0
- package/dist/client/assets/record-editor-C_TZAxUC.js +1 -0
- package/dist/client/assets/{redirect-editor-ZxNWX7KV.js → redirect-editor-BSuCXuw4.js} +1 -1
- package/dist/client/assets/registry-Cy4VwkhT.js +2 -0
- package/dist/client/assets/{registry-layout-8gQg9AHQ.js → registry-layout-D7OeE4Tp.js} +1 -1
- package/dist/client/assets/{reports-DuFKwYsN.js → reports-Ii6S1PYR.js} +1 -1
- package/dist/client/assets/{require-capability-gdmir0q8.js → require-capability-D5sKrc-a.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DNnOiPNc.js → required-auth-layout-PejcRLRr.js} +1 -1
- package/dist/client/assets/{reset-password-B7ZF2KQd.js → reset-password-j1MU8BBT.js} +1 -1
- package/dist/client/assets/{roles-DHyl-7I0.js → roles-CpX37qPN.js} +1 -1
- package/dist/client/assets/{search-input-D80HsBNG.js → search-input-Bf_CjAux.js} +1 -1
- package/dist/client/assets/{secrets-xULgdM9X.js → secrets-DidOyNZ0.js} +1 -1
- package/dist/client/assets/{sections-editor-EBt_1HWU.js → sections-editor-DY2AuZd7.js} +1 -1
- package/dist/client/assets/{select-C_F8-amA.js → select-j9WEM8Sh.js} +1 -1
- package/dist/client/assets/{select-model-DQDGLP7u.js → select-model-C8d0poms.js} +1 -1
- package/dist/client/assets/self-tool-result-aQ7EVEiZ.js +1 -0
- package/dist/client/assets/{seo-editor-5b4Q7Rbq.js → seo-editor-DGYP3acD.js} +1 -1
- package/dist/client/assets/{settings-layout-BmqyTuv_.js → settings-layout-DWcGqshR.js} +1 -1
- package/dist/client/assets/{settings-section-BgUHQSVM.js → settings-section-fm3Mm6Bm.js} +1 -1
- package/dist/client/assets/{shell-controls-obP95UlH.js → shell-controls-DVyMygC3.js} +1 -1
- package/dist/client/assets/{shell-layout-nGpsxb9b.js → shell-layout-Qdn6Ab14.js} +1 -1
- package/dist/client/assets/{sidebar-ZY9Na73j.js → sidebar-DYUk0Bcn.js} +1 -1
- package/dist/client/assets/{skeleton-CHQGQrAg.js → skeleton--88gs_EO.js} +1 -1
- package/dist/client/assets/{spinner-CT6gj-U7.js → spinner-DEsDb5EQ.js} +1 -1
- package/dist/client/assets/{sso-DMVK9tiq.js → sso-C0YVRrqi.js} +1 -1
- package/dist/client/assets/{store-DSld3m2K.js → store-9L8vOeYP.js} +1 -1
- package/dist/client/assets/store-registry-DZm0Mqt3.js +2 -0
- package/dist/client/assets/{studio-tools-CnY1iRfX.js → studio-tools-Dz4porfg.js} +1 -1
- package/dist/client/assets/{switch-g5eZwQWn.js → switch-CjtCOM9l.js} +1 -1
- package/dist/client/assets/{tab-id-D_shElJ5.js → tab-id-swDgZMnB.js} +1 -1
- package/dist/client/assets/{table-DUzcE7pw.js → table-B1o0Pwj4.js} +1 -1
- package/dist/client/assets/{tabs-CU_nfhem.js → tabs-VUaZhlmm.js} +1 -1
- package/dist/client/assets/{textarea-BNXibmKi.js → textarea-Bs8WvAl6.js} +1 -1
- package/dist/client/assets/{toggle-group-DGoI3Yg0.js → toggle-group-BsLp02VA.js} +1 -1
- package/dist/client/assets/{toolbar-DI-Q6oWY.js → toolbar-B5h5oyq6.js} +1 -1
- package/dist/client/assets/{tooltip-Bfr58shw.js → tooltip-CETnd3ay.js} +1 -1
- package/dist/client/assets/{use-ai-providers-b8vjAuOw.js → use-ai-providers-gi5xr2mP.js} +1 -1
- package/dist/client/assets/{use-automations-D6FStJIQ.js → use-automations-DhjGDNZK.js} +1 -1
- package/dist/client/assets/{use-autosave-BU3YP_ga.js → use-autosave-D0NLBkKG.js} +1 -1
- package/dist/client/assets/{use-capability-CamUh6kt.js → use-capability-BqS7iGUH.js} +1 -1
- package/dist/client/assets/{use-clock-tick-XnKcERte.js → use-clock-tick-B9BJ0pwX.js} +1 -1
- package/dist/client/assets/{use-connection-BzH0Kdzc.js → use-connection-BMokl4CO.js} +1 -1
- package/dist/client/assets/{use-copy-Bb3AUakA.js → use-copy-Be1Kjd_w.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BwmEhwgt.js → use-create-virtual-mcp-CWkwgd9r.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D3rcIunV.js → use-debounced-autosave-D0IOAPSF.js} +1 -1
- package/dist/client/assets/{use-debounced-value-GljL4VOJ.js → use-debounced-value-B-JvHFEo.js} +1 -1
- package/dist/client/assets/{use-deco-credits-Ds-jb_dO.js → use-deco-credits-UciEpjbi.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D8GZCmLu.js → use-decopilot-events-CEPq_dZU.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CLOnrzoe.js → use-delete-connection-COvCqZ-1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BV4YO5qR.js → use-deployment-admin-BJaOQser.js} +1 -1
- package/dist/client/assets/{use-file-configs-Cyy8AsxM.js → use-file-configs-I7iEol3j.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cg9HfQoH.js → use-infinite-scroll-CK3Uizc8.js} +1 -1
- package/dist/client/assets/{use-join-requests-BlRZvCNl.js → use-join-requests-DqDoWz8D.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-BqOdulae.js → use-mcp-auth-status-h3xamCXm.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BcyA1fq6.js → use-mcp-client-C7paE-cE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dsxlr_F7.js → use-mcp-tools-DS7HyfmS.js} +1 -1
- package/dist/client/assets/{use-members-BPAn97Ac.js → use-members-BuBLbPW8.js} +1 -1
- package/dist/client/assets/{use-mobile-DtJ9mqo3.js → use-mobile-CYh3EGEt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B56yEq2x.js → use-navigate-to-agent-Bqz6pwLi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BbxxaMLu.js → use-org-auth-client-CsKd0mpo.js} +1 -1
- package/dist/client/assets/{use-org-sso-9IKzvoT7.js → use-org-sso-CCq7sZnB.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ROrqTPFl.js → use-organization-roles-CgtJI-6n.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B7aJIu7V.js → use-organization-settings-MkvwyFUq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B--YAga1.js → use-registry-connections-YnGGDwWM.js} +1 -1
- package/dist/client/assets/{use-secrets-DWxO4tT-.js → use-secrets-HEeF0D3f.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DGy4iLtW.js → use-status-sounds-CyFcW6V5.js} +1 -1
- package/dist/client/assets/{use-tags-CRJNGby7.js → use-tags-BDVrYGwL.js} +1 -1
- package/dist/client/assets/{use-view-mode-CcQ20A8d.js → use-view-mode-9B1lHoFF.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bujf-aIR.js → use-virtual-mcp-Bdv0Gghv.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BIuIIh4Y.js +1 -0
- package/dist/client/assets/{useQueries-CC6kPLN8.js → useQueries-Bq9KgQR-.js} +1 -1
- package/dist/client/assets/{useRouterState-wMiETB_2.js → useRouterState-Bf1ibFXD.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-TLdwTHtB.js +1 -0
- package/dist/client/assets/{users-BG9VHnqD.js → users-BpJTuCAK.js} +1 -1
- package/dist/client/assets/{variant-calendar-COmRMH0Y.js → variant-calendar-B7O5BNIE.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C-PRhWQn.js → view-mode-toggle-BO7qzBum.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +22 -22
- package/dist/server/server.js +18 -18
- package/package.json +1 -1
- package/dist/client/assets/project-app-view-C9N2qA5x.js +0 -1
- package/dist/client/assets/record-editor-RMLYnDrn.js +0 -1
- package/dist/client/assets/registry-7HcYvODq.js +0 -2
- package/dist/client/assets/self-tool-result-C1Frg_4o.js +0 -1
- package/dist/client/assets/store-registry-Cmahj97T.js +0 -2
- package/dist/client/assets/useInfiniteQuery-gU5karM4.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DfcVoJ9U.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,v as Ae,t as le,B as ie,F as De,o as Ie,a as Le,r as W,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-bSjz3FLt.js";import{a as ne,b as ye,D as ue,c as pe}from"./dropdown-menu-b_BfGjG2.js";import{a as Ge}from"./Users03-C-1TY48R.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-B3yLKSRu.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-Bujf-aIR.js";import{P as ce}from"./index-m3kwuU8_.js";import{a as Ue}from"./DotsVertical-0qwliDrg.js";import{A as Re,G as fe,aY as $e}from"./agent-icon-DvITB4KO.js";import{a as He,b as Ve}from"./Settings02-CzRrS-qR.js";import{s as Ke}from"./Trash01--2hLWyEP.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-B56yEq2x.js";import{e as Qe,h as Ye}from"./use-organization-settings-B7aJIu7V.js";import{u as Se}from"./use-capability-CamUh6kt.js";import{C as Je}from"./card-Dwttk7rT.js";import{E as We}from"./empty-state-p3Rv7ykT.js";import{u as Xe}from"./use-create-virtual-mcp-BwmEhwgt.js";import{u as Ze}from"./use-connection-BzH0Kdzc.js";import{u as xe,S as et}from"./use-mcp-client-BcyA1fq6.js";import{p as tt,a as je}from"./deco-site-production-url-CaKZ7xBn.js";import{g as ot,f as st,a as it,G as nt,p as rt}from"./provision-repo-scoped-github-connection-CAXumITS.js";import{e as lt,d as at,a as ct,b as mt,c as dt}from"./dialog-BSwzm_xb.js";import{C as ut}from"./collection-search-Cz6kdWMP.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-B9G0eJ9-.js";import{S as Dt}from"./search-input-D80HsBNG.js";import{s as Ce}from"./Plus-hTCIWDtE.js";import"./Check-BVpJjApv.js";import"./ChevronRight-MVnPAPii.js";import"./use-debounced-value-GljL4VOJ.js";import"./authenticate-and-persist-oauth-Drw6R7zD.js";import"./mcp-oauth-CFh8Fy0x.js";import"./auth-C7EjAKuK.js";import"./LinkExternal01--DLqIMAa.js";import"./use-mcp-tools-Dsxlr_F7.js";import"./extract-connection-data-CD7g_CXG.js";import"./metadata-dUsYcpuu.js";import"./sidebar-ZY9Na73j.js";import"./LayoutLeft-Ciwgy5UL.js";import"./use-mobile-DtJ9mqo3.js";import"./X-BcM56kD2.js";import"./tooltip-Bfr58shw.js";import"./AlertCircle-B9QqDYpV.js";import"./Tool01-D_lBKESF.js";import"./ArrowUp-DWMmuZz_.js";import"./Tool02-BcNfyibb.js";import"./XCircle-B8N2lyCq.js";import"./ArrowUpRight-BWTRGGcn.js";import"./TrendUp01-4daEWKyg.js";import"./ZapSquare-Nv0rijSe.js";import"./CheckCircle-DqPpDLAb.js";import"./ChevronDown-DTyVSvpW.js";import"./ChevronUp-DNXgZ_10.js";import"./Stars02-JSRi49Xl.js";import"./Copy01-CKPJ5IhB.js";import"./CpuChip01-Du71UW4x.js";import"./Eye-DydEPicd.js";import"./FilterLines-BJV5RK1l.js";import"./Star01-BetPRMOP.js";import"./Palette-BoJouFtF.js";import"./SwitchHorizontal01-GLaQT_tZ.js";import"./HardDrive-CGeasvVZ.js";import"./Key01-DuDppfi_.js";import"./LogOut01-DMqcCuTY.js";import"./Monitor01-B6vkAJLy.js";import"./Sun-OLuqlB9J.js";import"./Play-C5V2_mAu.js";import"./SearchLg-CEMI_Yu5.js";import"./SearchMd-CGs342fz.js";import"./Shield01-b0Ri5_gK.js";import"./Stars01-DQgIK8ZP.js";import"./Upload01-CpoC4YD6.js";import"./User01-Ddv0yRQm.js";import"./Users01-B0XXonaO.js";import"./XClose-BMHkS-kz.js";import"./Zap-0Vx8dn_e.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-Bva17Au4.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C5huenWS.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-CnY1iRfX.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(ne,{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(ne,{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(ne,{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"?qe:void 0,{mainAgentId:M}=Qe(),d=Ye(),{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(ie,{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(ne,{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(ne,{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(ne,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(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]=W.useState(null),[d,T]=W.useState(null),[m,D]=W.useState(""),j=xe({connectionId:et,orgId:r.id,orgSlug:r.slug}),y=Ze({slug:"mcp-github"}),a=ot(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 st(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=it(p,b.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:nt}));let A=null,k=null,I=null;const Y=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:$}=await rt({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=$;const K=B.icon??null,q=Nt(s),re=s.toLowerCase(),J=tt(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:re,productionUrl:J,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:S.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:q,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:q,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await Y(),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(lt,{open:t,onOpenChange:N,children:o.jsxs(at,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ct,{className:"sr-only",children:o.jsx(mt,{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(Ve,{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(ie,{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(dt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ie,{variant:"outline",onClick:()=>N(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ie,{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 ns(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=W.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}=Xe(G),[d,T]=W.useState(null),[m,D]=W.useState(!1),[j,y]=W.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(ie,{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(We,{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(ie,{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 Y;t[36]!==m?(Y=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=Y):Y=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 K;t[41]!==$?(K=o.jsx(pt,{children:$}),t[41]=$,t[42]=K):K=t[42];let q;t[43]!==e?(q=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=q):q=t[44];const re=d?.title;let J;t[45]!==re?(J=o.jsx("span",{className:"font-medium text-foreground",children:re}),t[45]=re,t[46]=J):J=t[46];let Q;t[47]!==q||t[48]!==J?(Q=o.jsxs(gt,{children:[q," ",J,"."]}),t[47]=q,t[48]=J,t[49]=Q):Q=t[49];let R;t[50]!==K||t[51]!==Q?(R=o.jsxs(ft,{children:[K,Q]}),t[50]=K,t[51]=Q,t[52]=R):R=t[52];let H;t[53]!==e?(H=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=H):H=t[54];let X;t[55]!==H?(X=o.jsx(ht,{children:H}),t[55]=H,t[56]=X):X=t[56];let Z;t[57]!==e?(Z=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=Z):Z=t[58];let ee;t[59]!==u||t[60]!==Z?(ee=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Z}),t[59]=u,t[60]=Z,t[61]=ee):ee=t[61];let te;t[62]!==X||t[63]!==ee?(te=o.jsxs(jt,{children:[X,ee]}),t[62]=X,t[63]=ee,t[64]=te):te=t[64];let oe;t[65]!==R||t[66]!==te?(oe=o.jsxs(Ct,{children:[R,te]}),t[65]=R,t[66]=te,t[67]=oe):oe=t[67];let se;t[68]!==B||t[69]!==oe?(se=o.jsx(bt,{open:B,onOpenChange:U,children:oe}),t[68]=B,t[69]=oe,t[70]=se):se=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==Y||t[75]!==se?(ae=o.jsxs(O,{children:[k,I,Y,se]}),t[71]=O,t[72]=k,t[73]=I,t[74]=Y,t[75]=se,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ns as default};
|
|
1
|
+
import{c as ge,b as me,j as o,v as Ae,t as le,B as ie,F as De,o as Ie,a as Le,r as W,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-DptGhhs0.js";import{a as ne,b as ye,D as ue,c as pe}from"./dropdown-menu-Q--ZyLLW.js";import{a as Ge}from"./Users03-23U4ny0D.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-Bw5gD-qj.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-Bdv0Gghv.js";import{P as ce}from"./index-DIkj5DIc.js";import{a as Ue}from"./DotsVertical-Do26-QjL.js";import{A as Re,G as fe,aY as $e}from"./agent-icon-CSidaJ6B.js";import{a as He,b as Ve}from"./Settings02-DqYJFs_A.js";import{s as Ke}from"./Trash01-B8ymhEo_.js";import{p as qe,f as he}from"./pt-BR-CLy76QW2.js";import{c as _e}from"./use-navigate-to-agent-Bqz6pwLi.js";import{e as Qe,h as Ye}from"./use-organization-settings-MkvwyFUq.js";import{u as Se}from"./use-capability-BqS7iGUH.js";import{C as Je}from"./card-Dv8gN6wM.js";import{E as We}from"./empty-state-BOcwt_Pf.js";import{u as Xe}from"./use-create-virtual-mcp-CWkwgd9r.js";import{u as Ze}from"./use-connection-BMokl4CO.js";import{u as xe,S as et}from"./use-mcp-client-C7paE-cE.js";import{p as tt,a as je}from"./deco-site-production-url-CaKZ7xBn.js";import{g as ot,f as st,a as it,G as nt,p as rt}from"./provision-repo-scoped-github-connection-CAXumITS.js";import{e as lt,d as at,a as ct,b as mt,c as dt}from"./dialog-D4l4Xdsp.js";import{C as ut}from"./collection-search-CclDfE5O.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-FVJZWl26.js";import{S as Dt}from"./search-input-Bf_CjAux.js";import{s as Ce}from"./Plus-BmYOuiAj.js";import"./Check-CgsRhHy8.js";import"./ChevronRight-Bb4Md-MD.js";import"./use-debounced-value-B-JvHFEo.js";import"./authenticate-and-persist-oauth-DObbFBl5.js";import"./mcp-oauth-shlK2GTY.js";import"./auth-D-uIp2CQ.js";import"./LinkExternal01-BHdYJ4vg.js";import"./use-mcp-tools-DS7HyfmS.js";import"./extract-connection-data-Df7SJj9F.js";import"./metadata-dUsYcpuu.js";import"./sidebar-DYUk0Bcn.js";import"./LayoutLeft-m1wg28yS.js";import"./use-mobile-CYh3EGEt.js";import"./X-BM44NliR.js";import"./tooltip-CETnd3ay.js";import"./AlertCircle-CUqW_w6g.js";import"./Tool01-CTroi0ek.js";import"./ArrowUp-C7ToAohd.js";import"./Tool02-Bh88tYGs.js";import"./XCircle-UQVfZTIm.js";import"./ArrowUpRight-Ctd2GOR9.js";import"./TrendUp01-Bqs7ykt4.js";import"./ZapSquare-Cp9irGGl.js";import"./CheckCircle-VXm1pD5i.js";import"./ChevronDown-Wb4xUAM2.js";import"./ChevronUp-Bsb-Y77Y.js";import"./Stars02-DnbvYkKU.js";import"./Copy01-DZd32DIO.js";import"./CpuChip01-BPw4omKe.js";import"./Eye-B22W8AyK.js";import"./FilterLines-Bc1kxraS.js";import"./Star01-sYD82Np9.js";import"./Palette-BEUtyKuF.js";import"./SwitchHorizontal01-BnpMv-f4.js";import"./HardDrive-BUNzYRdb.js";import"./Key01-CG1NND7T.js";import"./LogOut01-CTki1bzq.js";import"./Monitor01-DcyY807V.js";import"./Sun-tw8Adw2s.js";import"./Play-DrITqLDw.js";import"./SearchLg-Brn3yddB.js";import"./SearchMd-h05KKMiS.js";import"./Shield01-BGuTNf8w.js";import"./Stars01-CfCAp21f.js";import"./Upload01-CRF4bF0L.js";import"./User01-BMMY0J4X.js";import"./Users01-Co3nN3tw.js";import"./XClose-Beh-B9Gb.js";import"./Zap-BuelQrvQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-BkWYCTuM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-NjFnhgvn.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-Dz4porfg.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(ne,{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(ne,{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(ne,{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"?qe:void 0,{mainAgentId:M}=Qe(),d=Ye(),{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(ie,{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(ne,{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(ne,{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(ne,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ke,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(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]=W.useState(null),[d,T]=W.useState(null),[m,D]=W.useState(""),j=xe({connectionId:et,orgId:r.id,orgSlug:r.slug}),y=Ze({slug:"mcp-github"}),a=ot(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 st(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=it(p,b.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:nt}));let A=null,k=null,I=null;const Y=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:$}=await rt({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=$;const K=B.icon??null,q=Nt(s),re=s.toLowerCase(),J=tt(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:re,productionUrl:J,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:S.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:q,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:q,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await Y(),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(lt,{open:t,onOpenChange:N,children:o.jsxs(at,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ct,{className:"sr-only",children:o.jsx(mt,{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(Ve,{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(ie,{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(dt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ie,{variant:"outline",onClick:()=>N(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ie,{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 ns(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=W.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}=Xe(G),[d,T]=W.useState(null),[m,D]=W.useState(!1),[j,y]=W.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(ie,{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(We,{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(ie,{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 Y;t[36]!==m?(Y=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=Y):Y=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 K;t[41]!==$?(K=o.jsx(pt,{children:$}),t[41]=$,t[42]=K):K=t[42];let q;t[43]!==e?(q=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=q):q=t[44];const re=d?.title;let J;t[45]!==re?(J=o.jsx("span",{className:"font-medium text-foreground",children:re}),t[45]=re,t[46]=J):J=t[46];let Q;t[47]!==q||t[48]!==J?(Q=o.jsxs(gt,{children:[q," ",J,"."]}),t[47]=q,t[48]=J,t[49]=Q):Q=t[49];let R;t[50]!==K||t[51]!==Q?(R=o.jsxs(ft,{children:[K,Q]}),t[50]=K,t[51]=Q,t[52]=R):R=t[52];let H;t[53]!==e?(H=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=H):H=t[54];let X;t[55]!==H?(X=o.jsx(ht,{children:H}),t[55]=H,t[56]=X):X=t[56];let Z;t[57]!==e?(Z=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=Z):Z=t[58];let ee;t[59]!==u||t[60]!==Z?(ee=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Z}),t[59]=u,t[60]=Z,t[61]=ee):ee=t[61];let te;t[62]!==X||t[63]!==ee?(te=o.jsxs(jt,{children:[X,ee]}),t[62]=X,t[63]=ee,t[64]=te):te=t[64];let oe;t[65]!==R||t[66]!==te?(oe=o.jsxs(Ct,{children:[R,te]}),t[65]=R,t[66]=te,t[67]=oe):oe=t[67];let se;t[68]!==B||t[69]!==oe?(se=o.jsx(bt,{open:B,onOpenChange:U,children:oe}),t[68]=B,t[69]=oe,t[70]=se):se=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==Y||t[75]!==se?(ae=o.jsxs(O,{children:[k,I,Y,se]}),t[71]=O,t[72]=k,t[73]=I,t[74]=Y,t[75]=se,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ns as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as Z,Z as D,a3 as Ae,a5 as Ke,a6 as ne,a4 as qe,b8 as Te,c as X,b as oe,_ as ze,$ as Be,r as J,j as s,a7 as nt,t as re,aw as Le,F as Ne,o as we,e as Se,K as ie,n as Ve,m as Oe,B as se,p as Qe,v as at,E as ct}from"./index-bSjz3FLt.js";import{i as dt}from"./AlertCircle-B9QqDYpV.js";import{P as ke}from"./index-m3kwuU8_.js";import{S as Re}from"./skeleton-CHQGQrAg.js";import{b as Ge,a as Me,S as Ee,c as mt}from"./settings-section-BgUHQSVM.js";import{u as Ye,b as Pe,i as ut,c as pt,p as ft,d as Fe,e as gt,f as We}from"./use-ai-providers-b8vjAuOw.js";import{i as ht}from"./CheckCircle-DqPpDLAb.js";import{b as xt,j as vt}from"./use-organization-settings-B7aJIu7V.js";import{c as bt,d as Je,P as yt,C as $e}from"./select-model-DQDGLP7u.js";import{u as jt}from"./use-debounced-autosave-D3rcIunV.js";import{I as Ie}from"./input-mwCJa3UC.js";import{T as Ue,a as St}from"./toggle-group-DGoI3Yg0.js";import{A as Ze,a as Xe,b as et,c as tt,d as st,e as it,f as ot,g as rt}from"./alert-dialog-B9G0eJ9-.js";import{u as je}from"./studio-tools-CnY1iRfX.js";import{s as Ct}from"./Plus-hTCIWDtE.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-D_lBKESF.js";import{s as It}from"./Trash01--2hLWyEP.js";import{A as Nt}from"./avatar-BN0lsHoN.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-CzRrS-qR.js";import{s as Kt}from"./Eye-DydEPicd.js";import{b as At,a as Rt,d as Mt,e as Et,c as Ft}from"./dialog-BSwzm_xb.js";import{S as Tt}from"./spinner-CT6gj-U7.js";import{R as Ot}from"./require-capability-gdmir0q8.js";import"./sidebar-ZY9Na73j.js";import"./LayoutLeft-Ciwgy5UL.js";import"./use-mobile-DtJ9mqo3.js";import"./X-BcM56kD2.js";import"./tooltip-Bfr58shw.js";import"./card-Dwttk7rT.js";import"./ArrowUpRight-BWTRGGcn.js";import"./use-mcp-client-BcyA1fq6.js";import"./auth-C7EjAKuK.js";import"./drawer-Bs_TJ-Xq.js";import"./chat-context-BbbE9k_D.js";import"./tab-id-D_shElJ5.js";import"./Check-BVpJjApv.js";import"./Copy01-CKPJ5IhB.js";import"./hooks-Bva17Au4.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C5huenWS.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Bujf-aIR.js";import"./use-decopilot-events-D8GZCmLu.js";import"./checkbox-CpYf9_vX.js";import"./select-C_F8-amA.js";import"./ChevronDown-DTyVSvpW.js";import"./ChevronUp-DNXgZ_10.js";import"./Key01-DuDppfi_.js";import"./SearchMd-CGs342fz.js";import"./Monitor01-B6vkAJLy.js";import"./ChevronRight-MVnPAPii.js";import"./Stars01-DQgIK8ZP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-Ddv0yRQm.js";import"./use-capability-CamUh6kt.js";import"./access-gate-ClCWz49c.js";import"./capability-load-error-D2CLFEVV.js";Z({title:D(),url:D(),icon:D()});Z({registries:Ke(D(),Z({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const le=Z({keyId:D(),modelId:D(),title:D().optional()}).nullable();qe(["fast","smart","thinking","image","web_search","deep_research"]);qe(["fast","smart","thinking"]);const $t=Z({tiers:Z({fast:le,smart:le,thinking:le,image:le,web_search:le,deep_research:le})});Z({tiers:Z({fast:le.optional(),smart:le.optional(),thinking:le.optional()})});Z({ids:Ae(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});Z({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.")});Z({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:Z({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:Z({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(D(),Te())).nullable().optional().describe("Brand images"),metadata:Ke(D(),Te()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const Ut=e=>e.capabilities?.includes("image")===!0,Ht=e=>ut(e),qt=e=>pt(e),zt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ut},{key:"web_search",filter:Ht},{key:"deep_research",filter:qt}];function Bt(e){const t=X.c(30),{slot:i,onSlotChange:o,filterModels:n,defaultKeyId:c}=e,a=Ye(),l=a.some(I=>I.id===i?.keyId)?i?.keyId:null,[S,P]=J.useState(l??c);let b,r;t[0]!==l?(b=()=>{l&&P(l)},r=[l],t[0]=l,t[1]=b,t[2]=r):(b=t[1],r=t[2]),J.useEffect(b,r);let d;t[3]!==a||t[4]!==c||t[5]!==S?(d=a.some(I=>I.id===S)?S:c,t[3]=a,t[4]=c,t[5]=S,t[6]=d):d=t[6];const u=d;let p;t[7]!==u||t[8]!==a?(p=u?a.find(I=>I.id===u):null,t[7]=u,t[8]=a,t[9]=p):p=t[9];const y=p,{models:f,isLoading:_}=Pe(n?u??void 0:void 0),g=n?_||f.some(n):!0;let h;t[10]!==i||t[11]!==y?.providerId||t[12]!==l?(h=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:y?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=y?.providerId,t[12]=l,t[13]=h):h=t[13];const N=h,j=oe();if(n&&!g){let I;t[14]!==j?(I=j("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=j,t[15]=I):I=t[15];let K;return t[16]!==I?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[16]=I,t[17]=K):K=t[17],K}let C;t[18]!==j?(C=j("settings.simpleModeSection.pickModel"),t[18]=j,t[19]=C):C=t[19];let m;t[20]===Symbol.for("react.memo_cache_sentinel")?(m=I=>P(I),t[20]=m):m=t[20];let x;t[21]!==u||t[22]!==o?(x=I=>{const K=I.keyId??u??"";P(K),o({keyId:K,modelId:I.modelId,title:I.title})},t[21]=u,t[22]=o,t[23]=x):x=t[23];let k;return t[24]!==u||t[25]!==n||t[26]!==N||t[27]!==C||t[28]!==x?(k=s.jsx(bt,{variant:"bordered",placeholder:C,model:N,credentialId:u,filterModels:n,onCredentialChange:m,onModelChange:x}),t[24]=u,t[25]=n,t[26]=N,t[27]=C,t[28]=x,t[29]=k):k=t[29],k}function Lt(e){const t=X.c(10),{isPending:i,showSaved:o}=e,n=oe();if(i){let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Le,{size:12,className:"animate-spin"}),t[0]=c):c=t[0];let a;t[1]!==n?(a=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=a):a=t[2];let l;return t[3]!==a?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c,a]}),t[3]=a,t[4]=l):l=t[4],l}if(o){let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ht,{size:12}),t[5]=c):c=t[5];let a;t[6]!==n?(a=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=a):a=t[7];let l;return t[8]!==a?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c,a]}),t[8]=a,t[9]=l):l=t[9],l}return null}function Vt(){const e=X.c(58),t=oe(),i=Ye(),o=xt(),n=i.length>0;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=ze($t),e[0]=c):c=e[0];let a;e[1]!==o?(a={resolver:c,values:o,mode:"onChange"},e[1]=o,e[2]=a):a=e[2];const l=Be(a),{mutate:S,isPending:P,isSuccess:b}=vt(),r=l.formState.isDirty;let d;e[3]!==l||e[4]!==o||e[5]!==t||e[6]!==S?(d={delayMs:250,save:async()=>{const v=l.getValues();S(v,{onSuccess:()=>l.reset(v,{keepValues:!0}),onError:R=>{l.reset(o),re.error(t("settings.simpleModeSection.failedToSave",{error:R.message}))}})}},e[3]=l,e[4]=o,e[5]=t,e[6]=S,e[7]=d):d=e[7];const{schedule:u}=jt(d),p=i[0],y=i[1],f=i[2],{models:_}=Pe(p?.id),{models:g}=Pe(y?.id),{models:h}=Pe(f?.id);let N,j;e[8]!==l||e[9]!==n?(N=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},j=[n,l],e[8]=l,e[9]=n,e[10]=N,e[11]=j):(N=e[10],j=e[11]),J.useEffect(N,j);let C;e[12]!==i||e[13]!==l||e[14]!==p||e[15]!==y||e[16]!==f||e[17]!==_||e[18]!==g||e[19]!==h?(C=()=>{const v=l.getValues(),R=new Set(i.map(Qt)),M={};p?.id&&(M[p.id]=_),y?.id&&(M[y.id]=g),f?.id&&(M[f.id]=h);const A=G=>G!=null&&!R.has(G.keyId),w={fast:A(v.tiers.fast)?null:v.tiers.fast,smart:A(v.tiers.smart)?null:v.tiers.smart,thinking:A(v.tiers.thinking)?null:v.tiers.thinking,image:A(v.tiers.image)?null:v.tiers.image,web_search:A(v.tiers.web_search)?null:v.tiers.web_search,deep_research:A(v.tiers.deep_research)?null:v.tiers.deep_research},Y=!w.fast||!w.smart||!w.thinking||!w.image||!w.web_search||!w.deep_research,W=w.fast===v.tiers.fast&&w.smart===v.tiers.smart&&w.thinking===v.tiers.thinking&&w.image===v.tiers.image&&w.web_search===v.tiers.web_search&&w.deep_research===v.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);l.reset({tiers:{fast:w.fast??$.chat.fast,smart:w.smart??$.chat.smart,thinking:w.thinking??$.chat.thinking,image:w.image??$.image,web_search:w.web_search??$.webSearch,deep_research:w.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=p,e[15]=y,e[16]=f,e[17]=_,e[18]=g,e[19]=h,e[20]=C):C=e[20];const m=p?.id,x=y?.id,k=f?.id;let I;e[21]!==i||e[22]!==l||e[23]!==_||e[24]!==g||e[25]!==h||e[26]!==m||e[27]!==x||e[28]!==k?(I=[l,i,_,g,h,m,x,k],e[21]=i,e[22]=l,e[23]=_,e[24]=g,e[25]=h,e[26]=m,e[27]=x,e[28]=k,e[29]=I):I=e[29],J.useEffect(C,I);let K;e[30]!==t?(K=v=>({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")})[v]||v,e[30]=t,e[31]=K):K=e[31];const L=K;let U;e[32]!==t?(U=v=>({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")})[v]||"",e[32]=t,e[33]=U):U=e[33];const V=U;let H;e[34]!==t?(H=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=H):H=e[35];let q;e[36]!==t?(q=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=q):q=e[37];let z;e[38]!==q?(z=s.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[38]=q,e[39]=z):z=e[39];const Q=b&&!r;let E;e[40]!==P||e[41]!==Q?(E=s.jsx(Lt,{isPending:P,showSaved:Q}),e[40]=P,e[41]=Q,e[42]=E):E=e[42];let F;e[43]!==z||e[44]!==E?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[z,E]}),e[43]=z,e[44]=E,e[45]=F):F=e[45];let T;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==V||e[49]!==L||e[50]!==u?(T=zt.map(v=>s.jsx(nt,{control:l.control,name:`tiers.${v.key}`,render:R=>{const{field:M}=R;return s.jsx(Ge,{title:L(v.key),description:V(v.key),action:s.jsx(Bt,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:v.filter,onSlotChange:A=>{M.onChange(A),u()}})})}},v.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=V,e[49]=L,e[50]=u,e[51]=T):T=e[51];let O;e[52]!==T?(O=s.jsx(Me,{children:T}),e[52]=T,e[53]=O):O=e[53];let B;return e[54]!==H||e[55]!==F||e[56]!==O?(B=s.jsxs(Ee,{title:H,headerClassName:"pl-0",children:[F,O]}),e[54]=H,e[55]=F,e[56]=O,e[57]=B):B=e[57],B}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Yt(){const e=X.c(30),t=oe(),i=je(),[o,n]=J.useState(!1);let c;e[0]!==t?(c=m=>{re.error(t("settings.decoCreditsHero.topUpFailed",{message:m.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:a,isPending:l}=Se({mutationFn:async m=>{const{url:x}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:m,currency:d});return x},onSuccess:Wt,onError:c}),[S,P]=J.useState(""),[b,r]=J.useState("usd"),d=b,u=parseFloat(S),p=!isNaN(u)&&u>=1,y=d==="brl"?"R$":"$";let f;e[2]!==r?(f=m=>{m&&r(m)},e[2]=r,e[3]=f):f=e[3];let _,g;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ue,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(Ue,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=_,e[5]=g):(_=e[4],g=e[5]);let h;e[6]!==d||e[7]!==f?(h=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:d,onValueChange:f,children:[_,g]}),e[6]=d,e[7]=f,e[8]=h):h=e[8];let N;e[9]!==d||e[10]!==y||e[11]!==o||e[12]!==l||e[13]!==t||e[14]!==a?(N=!o&&s.jsxs(s.Fragment,{children:[Gt[d].map(m=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>a(m*100),children:[y,m]},m)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=y,e[11]=o,e[12]=l,e[13]=t,e[14]=a,e[15]=N):N=e[15];let j;e[16]!==y||e[17]!==S||e[18]!==u||e[19]!==o||e[20]!==p||e[21]!==l||e[22]!==P||e[23]!==t||e[24]!==a?(j=o&&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:y}),s.jsx(Ie,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:S,onChange:m=>P(m.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!p||l,onClick:()=>a(Math.round(u*100)),children:l?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),P("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=y,e[17]=S,e[18]=u,e[19]=o,e[20]=p,e[21]=l,e[22]=P,e[23]=t,e[24]=a,e[25]=j):j=e[25];let C;return e[26]!==h||e[27]!==N||e[28]!==j?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h,N,j]})}),e[26]=h,e[27]=N,e[28]=j,e[29]=C):C=e[29],C}function Wt(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=X.c(121),t=oe(),{org:i}=Ne(),o=je(),n=we(),c=Fe();let a;e[0]!==c?(a=c.find(Xt),e[0]=c,e[1]=a):a=e[1];const l=a,[S,P]=J.useState(!1);let b;e[2]!==l||e[3]!==o?(b=async()=>{l&&await o.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=o,e[4]=b):b=e[4];let r;e[5]!==i.id||e[6]!==n||e[7]!==t?(r=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:ie.aiProviders(i.id)}),re.success(t("settings.decoCreditsHero.disconnectSuccess")),P(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=r):r=e[8];let d;e[9]!==t?(d=lt=>{re.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=d):d=e[10];let u;e[11]!==b||e[12]!==r||e[13]!==d?(u={mutationFn:b,onSuccess:r,onError:d},e[11]=b,e[12]=r,e[13]=d,e[14]=u):u=e[14];const{mutate:p,isPending:y}=Se(u);let f;e[15]!==i.id?(f=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=f):f=e[16];const _=!!l;let g;e[17]!==o?(g=async()=>{try{return await o.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=o,e[18]=g):g=e[18];let h;e[19]!==f||e[20]!==_||e[21]!==g?(h={queryKey:f,enabled:_,staleTime:6e4,queryFn:g},e[19]=f,e[20]=_,e[21]=g,e[22]=h):h=e[22];const{data:N,isLoading:j,refetch:C,isFetching:m}=Ve(h);if(!l)return null;const x=N?.balanceCents!=null?N.balanceCents/100:null;let k;e[23]!==x?(k=x!=null?`$${x.toFixed(2)}`:"—",e[23]=x,e[24]=k):k=e[24];const I=k;let K;e[25]!==t?(K=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=K):K=e[26];let L;e[27]!==t?(L=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=L):L=e[28];let U;e[29]!==L?(U=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:L,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=L,e[30]=U):U=e[30];let V;e[31]!==t?(V=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=V):V=e[32];let H;e[33]!==V?(H=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:V})}),e[33]=V,e[34]=H):H=e[34];let q;e[35]!==U||e[36]!==H?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[U,H]}),e[35]=U,e[36]=H,e[37]=q):q=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=()=>P(!0),e[38]=z):z=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let E;e[41]!==y||e[42]!==Q?(E=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:y,children:Q}),e[41]=y,e[42]=Q,e[43]=E):E=e[43];let F;e[44]!==q||e[45]!==E?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[q,E]}),e[44]=q,e[45]=E,e[46]=F):F=e[46];let T;e[47]!==t?(T=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=T):T=e[48];let O;e[49]!==T?(O=s.jsx(Ze,{children:T}),e[49]=T,e[50]=O):O=e[50];let B;e[51]!==t?(B=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=B):B=e[52];let v;e[53]!==B?(v=s.jsx(Xe,{children:B}),e[53]=B,e[54]=v):v=e[54];let R;e[55]!==O||e[56]!==v?(R=s.jsxs(et,{children:[O,v]}),e[55]=O,e[56]=v,e[57]=R):R=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let A;e[60]!==M?(A=s.jsx(tt,{children:M}),e[60]=M,e[61]=A):A=e[61];let w;e[62]!==p?(w=()=>p(),e[62]=p,e[63]=w):w=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==w||e[67]!==Y?(W=s.jsx(st,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=w,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==A||e[70]!==W?($=s.jsxs(it,{children:[A,W]}),e[69]=A,e[70]=W,e[71]=$):$=e[71];let G;e[72]!==R||e[73]!==$?(G=s.jsxs(ot,{children:[R,$]}),e[72]=R,e[73]=$,e[74]=G):G=e[74];let te;e[75]!==S||e[76]!==G?(te=s.jsx(rt,{open:S,onOpenChange:P,children:G}),e[75]=S,e[76]=G,e[77]=te):te=e[77];let ee;e[78]!==x||e[79]!==I||e[80]!==m||e[81]!==j?(ee=j||m?s.jsx(Re,{className:"h-9 w-24"}):s.jsx("span",{className:Oe("text-3xl font-semibold tabular-nums tracking-tight",x!=null&&Jt(x)),children:I}),e[78]=x,e[79]=I,e[80]=m,e[81]=j,e[82]=ee):ee=e[82];let ae;e[83]!==C?(ae=()=>C(),e[83]=C,e[84]=ae):ae=e[84];let ce;e[85]!==t?(ce=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ce):ce=e[86];const De=m&&"animate-spin";let de;e[87]!==De?(de=Oe(De),e[87]=De,e[88]=de):de=e[88];let me;e[89]!==de?(me=s.jsx(Le,{size:14,className:de}),e[89]=de,e[90]=me):me=e[90];let ue;e[91]!==m||e[92]!==ae||e[93]!==ce||e[94]!==me?(ue=s.jsx("button",{type:"button",onClick:ae,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ce,children:me}),e[91]=m,e[92]=ae,e[93]=ce,e[94]=me,e[95]=ue):ue=e[95];let pe;e[96]!==ee||e[97]!==ue?(pe=s.jsxs("div",{className:"flex items-baseline gap-2",children:[ee,ue]}),e[96]=ee,e[97]=ue,e[98]=pe):pe=e[98];let fe;e[99]!==t?(fe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=fe):fe=e[100];let ge;e[101]!==fe?(ge=s.jsx("p",{className:"text-xs text-muted-foreground",children:fe}),e[101]=fe,e[102]=ge):ge=e[102];let he;e[103]!==pe||e[104]!==ge?(he=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[pe,ge]}),e[103]=pe,e[104]=ge,e[105]=he):he=e[105];let xe;e[106]!==t?(xe=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=xe):xe=e[107];let ve;e[108]!==xe?(ve=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:xe}),e[108]=xe,e[109]=ve):ve=e[109];let Ce;e[110]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Yt,{}),e[110]=Ce):Ce=e[110];let be;e[111]!==ve?(be=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ve,Ce]}),e[111]=ve,e[112]=be):be=e[112];let ye;e[113]!==F||e[114]!==te||e[115]!==he||e[116]!==be?(ye=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,te,he,be]})}),e[113]=F,e[114]=te,e[115]=he,e[116]=be,e[117]=ye):ye=e[117];let _e;return e[118]!==K||e[119]!==ye?(_e=s.jsx(Ee,{title:K,children:ye}),e[118]=K,e[119]=ye,e[120]=_e):_e=e[120],_e}function Xt(e){return e.providerId==="deco"}function es(){const e=X.c(8),{org:t}=Ne(),i=je(),o=we();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let c;e[2]!==t||e[3]!==o?(c=()=>{Qe("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:ie.aiProviders(t.id)}),re.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=o,e[4]=c):c=e[4];let a;return e[5]!==n||e[6]!==c?(a={mutationFn:n,onSuccess:c,onError:ts},e[5]=n,e[6]=c,e[7]=a):a=e[7],Se(a)}function ts(e){Qe("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),re.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=X.c(37),t=oe(),{mutate:i,isPending:o}=es();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["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]=n):n=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=c):c=e[1];let a;e[2]!==t?(a=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=a):a=e[3];let l;e[4]!==a?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:a,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=a,e[5]=l):l=e[5];let S;e[6]!==t?(S=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=S):S=e[7];let P;e[8]!==S?(P=s.jsx("p",{className:"text-base font-semibold",children:S}),e[8]=S,e[9]=P):P=e[9];let b;e[10]!==t?(b=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=b):b=e[11];let r;e[12]!==b?(r=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:b}),e[12]=b,e[13]=r):r=e[13];let d;e[14]!==P||e[15]!==r?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[P,r]}),e[14]=P,e[15]=r,e[16]=d):d=e[16];let u;e[17]!==t?(u=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=u):u=e[18];let p;e[19]!==u?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[19]=u,e[20]=p):p=e[20];let y;e[21]!==p||e[22]!==d?(y=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,p]}),e[21]=p,e[22]=d,e[23]=y):y=e[23];let f;e[24]!==i?(f=()=>i(),e[24]=i,e[25]=f):f=e[25];let _;e[26]!==o||e[27]!==t?(_=t(o?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=o,e[27]=t,e[28]=_):_=e[28];let g;e[29]!==o||e[30]!==f||e[31]!==_?(g=s.jsx(se,{variant:"outline",disabled:o,onClick:f,children:_}),e[29]=o,e[30]=f,e[31]=_,e[32]=g):g=e[32];let h;return e[33]!==y||e[34]!==g||e[35]!==l?(h=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[c,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,y,g]})]}),e[33]=y,e[34]=g,e[35]=l,e[36]=h):h=e[36],h}const is=e=>Z({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function os({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:o}){return e&&!!t&&t!==i&&!o}function rs({providerKey:e,provider:t,preset:i,maskedKey:o,currentLabel:n,currentBaseUrl:c,onCancel:a,onSuccess:l}){const{org:S}=Ne(),P=je(),b=we(),r=oe(),[d,u]=J.useState(!1),p=t.id==="openai-compatible",y=t.supportedMethods.includes("api-key"),f=is(r),{register:_,handleSubmit:g,watch:h,setError:N,formState:{errors:j}}=Be({resolver:ze(f),defaultValues:{label:n,apiKey:"",baseUrl:c??""}}),C=h("apiKey")??"",{mutate:m,isPending:x}=Se({mutationFn:async k=>{let I;k.apiKey&&(p?I=JSON.stringify({baseUrl:k.baseUrl||c||"",apiKey:k.apiKey}):I=k.apiKey),await P.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:k.label,...I!==void 0?{apiKey:I}:{}})},onSuccess:()=>{b.invalidateQueries({queryKey:ie.aiProviderKeys(S.id)}),b.invalidateQueries({queryKey:ie.aiProviders(S.id)}),re.success(r("settings.editProviderDialog.providerUpdated")),l()},onError:k=>re.error(r("settings.editProviderDialog.failedToUpdate",{error:k.message}))});return s.jsxs("form",{onSubmit:g(k=>{if(os({isOpenAICompatible:p,baseUrl:k.baseUrl,currentBaseUrl:c,apiKey:k.apiKey})){N("apiKey",{message:r("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}m(k)}),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:r("settings.editProviderDialog.label")}),s.jsx(Ie,{placeholder:r("settings.editProviderDialog.labelPlaceholder"),..._("label"),className:"h-8 text-sm"}),j.label&&s.jsx("p",{className:"text-xs text-destructive",children:j.label.message})]}),p&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.baseUrl")}),s.jsx(Ie,{type:"url",placeholder:i?.baseUrlPlaceholder??r("settings.editProviderDialog.baseUrlPlaceholder"),..._("baseUrl"),className:"h-8 text-sm"})]}),y&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[r("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",r("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ie,{type:d&&C?"text":"password",placeholder:o,..._("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),C&&s.jsx("button",{type:"button",onClick:()=>u(!d),"aria-label":r(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})})]}),j.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:j.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Ft,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:a,disabled:x,children:r("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:x,children:r(x?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ls(e){const t=X.c(31),{providerKey:i,provider:o,open:n,onOpenChange:c}=e,a=oe(),l=je(),S=o.id==="openai-compatible"&&i.presetId?Je(i.presetId):void 0,P=S?.name??o.name;let b;t[0]!==i.id?(b=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=b):b=t[1];let r;t[2]!==i.id||t[3]!==l?(r=()=>l.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=l,t[4]=r):r=t[4];let d;t[5]!==n||t[6]!==b||t[7]!==r?(d={queryKey:b,queryFn:r,enabled:n,staleTime:0},t[5]=n,t[6]=b,t[7]=r,t[8]=d):d=t[8];const{data:u,isLoading:p}=Ve(d),y=Et,f=Mt,_="sm:max-w-md",g=Rt,h=At,N=a("settings.editProviderDialog.editTitle",{name:P});let j;t[9]!==h||t[10]!==N?(j=s.jsx(h,{children:N}),t[9]=h,t[10]=N,t[11]=j):j=t[11];let C;t[12]!==g||t[13]!==j?(C=s.jsx(g,{children:j}),t[12]=g,t[13]=j,t[14]=C):C=t[14];let m;t[15]!==p||t[16]!==c||t[17]!==S||t[18]!==u||t[19]!==o||t[20]!==i?(m=p||!u?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Tt,{})}):s.jsx(rs,{providerKey:i,provider:o,preset:S,maskedKey:u.maskedKey,currentLabel:u.label,currentBaseUrl:u.baseUrl,onCancel:()=>c(!1),onSuccess:()=>c(!1)}),t[15]=p,t[16]=c,t[17]=S,t[18]=u,t[19]=o,t[20]=i,t[21]=m):m=t[21];let x;t[22]!==f||t[23]!==C||t[24]!==m?(x=s.jsxs(f,{className:_,children:[C,m]}),t[22]=f,t[23]=C,t[24]=m,t[25]=x):x=t[25];let k;return t[26]!==y||t[27]!==c||t[28]!==n||t[29]!==x?(k=s.jsx(y,{open:n,onOpenChange:c,children:x}),t[26]=y,t[27]=c,t[28]=n,t[29]=x,t[30]=k):k=t[30],k}function ns(e){const t=X.c(86),{providerKey:i,provider:o}=e,{org:n}=Ne(),c=je(),a=we(),[l,S]=J.useState(!1),[P,b]=J.useState(!1),r=oe(),[d]=at(),u=d.language==="pt-BR"?_t:void 0,p=o?.id==="openai-compatible";let y;t[0]!==p||t[1]!==i.presetId?(y=p&&i.presetId?Je(i.presetId):void 0,t[0]=p,t[1]=i.presetId,t[2]=y):y=t[2];const f=y;let _;t[3]!==p||t[4]!==f||t[5]!==o?.name||t[6]!==i.providerId||t[7]!==r?(_=f?f.name:p?r("settings.aiProviders.customOpenAiCompatible"):o?.name??(i.providerId==="claude-code"?r("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?r("settings.providerKeyRow.codex"):i.providerId),t[3]=p,t[4]=f,t[5]=o?.name,t[6]=i.providerId,t[7]=r,t[8]=_):_=t[8];const g=_,h=f?.logo??o?.logo??wt[i.providerId];let N;e:{if(p){N=i.label;break e}let ee;t[9]!==u||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==r?(ee=r("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:u})}),t[9]=u,t[10]=i.createdAt,t[11]=i.label,t[12]=r,t[13]=ee):ee=t[13],N=ee}const j=N;let C;t[14]!==i.id||t[15]!==c?(C=async()=>{await c.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=c,t[16]=C):C=t[16];let m;t[17]!==n||t[18]!==i.id||t[19]!==a||t[20]!==r?(m=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(n.id)}),a.invalidateQueries({queryKey:ie.aiProviders(n.id)}),a.invalidateQueries({queryKey:ie.aiProviderModels(n.id,i.id)}),re.success(r("settings.providerKeyRow.keyDeleted")),S(!1)},t[17]=n,t[18]=i.id,t[19]=a,t[20]=r,t[21]=m):m=t[21];let x;t[22]!==r?(x=ee=>re.error(r("settings.providerKeyRow.failedToDeleteKey",{error:ee.message})),t[22]=r,t[23]=x):x=t[23];let k;t[24]!==C||t[25]!==m||t[26]!==x?(k={mutationFn:C,onSuccess:m,onError:x},t[24]=C,t[25]=m,t[26]=x,t[27]=k):k=t[27];const{mutate:I,isPending:K}=Se(k);let L;t[28]!==g||t[29]!==h?(L=h?s.jsx("img",{src:h,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=h,t[30]=L):L=t[30];let U;t[31]!==o||t[32]!==r?(U=o?s.jsx(se,{variant:"ghost",size:"icon","aria-label":r("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>b(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=o,t[32]=r,t[33]=U):U=t[33];let V;t[34]!==r?(V=r("settings.providerKeyRow.deleteProviderKey"),t[34]=r,t[35]=V):V=t[35];let H,q;t[36]===Symbol.for("react.memo_cache_sentinel")?(H=()=>S(!0),q=s.jsx(It,{size:14}),t[36]=H,t[37]=q):(H=t[36],q=t[37]);let z;t[38]!==K||t[39]!==V?(z=s.jsx(se,{variant:"ghost",size:"icon","aria-label":V,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:K,onClick:H,children:q}),t[38]=K,t[39]=V,t[40]=z):z=t[40];let Q;t[41]!==z||t[42]!==U?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,z]}),t[41]=z,t[42]=U,t[43]=Q):Q=t[43];let E;t[44]!==j||t[45]!==g||t[46]!==Q||t[47]!==L?(E=s.jsx(Ge,{icon:L,title:g,description:j,action:Q}),t[44]=j,t[45]=g,t[46]=Q,t[47]=L,t[48]=E):E=t[48];let F;t[49]!==P||t[50]!==o||t[51]!==i?(F=o?s.jsx(ls,{providerKey:i,provider:o,open:P,onOpenChange:b}):null,t[49]=P,t[50]=o,t[51]=i,t[52]=F):F=t[52];let T;t[53]!==r?(T=r("settings.providerKeyRow.deleteApiKey"),t[53]=r,t[54]=T):T=t[54];let O;t[55]!==T?(O=s.jsx(Ze,{children:T}),t[55]=T,t[56]=O):O=t[56];let B;t[57]!==i.label?(B=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]=B):B=t[58];let v;t[59]!==O||t[60]!==B?(v=s.jsxs(et,{children:[O,B]}),t[59]=O,t[60]=B,t[61]=v):v=t[61];let R;t[62]!==r?(R=r("settings.providerKeyRow.cancel"),t[62]=r,t[63]=R):R=t[63];let M;t[64]!==R?(M=s.jsx(tt,{children:R}),t[64]=R,t[65]=M):M=t[65];let A;t[66]!==I?(A=()=>I(),t[66]=I,t[67]=A):A=t[67];let w;t[68]!==r?(w=r("settings.providerKeyRow.delete"),t[68]=r,t[69]=w):w=t[69];let Y;t[70]!==A||t[71]!==w?(Y=s.jsx(st,{onClick:A,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:w}),t[70]=A,t[71]=w,t[72]=Y):Y=t[72];let W;t[73]!==M||t[74]!==Y?(W=s.jsxs(it,{children:[M,Y]}),t[73]=M,t[74]=Y,t[75]=W):W=t[75];let $;t[76]!==v||t[77]!==W?($=s.jsxs(ot,{children:[v,W]}),t[76]=v,t[77]=W,t[78]=$):$=t[78];let G;t[79]!==l||t[80]!==$?(G=s.jsx(rt,{open:l,onOpenChange:S,children:$}),t[79]=l,t[80]=$,t[81]=G):G=t[81];let te;return t[82]!==E||t[83]!==F||t[84]!==G?(te=s.jsxs(s.Fragment,{children:[E,F,G]}),t[82]=E,t[83]=F,t[84]=G,t[85]=te):te=t[85],te}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(o=>o.id===i.providerId)??null}))}function He(e){const t=X.c(13),{onConnectClick:i}=e,o=oe(),n=Fe(),c=We();let a;if(t[0]!==c?.providers||t[1]!==n||t[2]!==i||t[3]!==o){const l=c?.providers??[],S=cs(n,l);let P;t[5]!==o?(P=o("settings.connectedProvidersSection.sectionTitle"),t[5]=o,t[6]=P):P=t[6];let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ct,{size:14}),t[7]=b):b=t[7];let r;t[8]!==o?(r=o("settings.connectedProvidersSection.connectButton"),t[8]=o,t[9]=r):r=t[9];let d;t[10]!==i||t[11]!==r?(d=s.jsxs(se,{size:"sm",onClick:i,children:[b,r]}),t[10]=i,t[11]=r,t[12]=d):d=t[12],a=s.jsx(Ee,{title:P,headerClassName:"px-0",actions:d,children:S.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:o("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:S.map(ds)})}),t[0]=c?.providers,t[1]=n,t[2]=i,t[3]=o,t[4]=a}else a=t[4];return a}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(e){const t=X.c(3),{error:i}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:16}),t[0]=o):o=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function us(){const e=X.c(26),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:o,hasHostedProvider:n,hasDeco:c}=i,[a,l]=J.useState(!1),[S,P]=J.useState(null),b=We();let r;e[2]!==b?.providers?(r=b?.providers??[],e[2]=b?.providers,e[3]=r):r=e[3];const d=r;if(!n){let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>l(!0),e[4]=g):g=e[4];let h;e[5]!==d?(h=s.jsx(yt,{providers:d,onSelect:P,onShowAll:g}),e[5]=d,e[6]=h):h=e[6];const N=S!==null||a;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=I=>{I||(P(null),l(!1))},e[7]=j):j=e[7];const C=S??void 0;let m;e[8]!==N||e[9]!==C?(m=s.jsx($e,{open:N,onOpenChange:j,initialProvider:C}),e[8]=N,e[9]=C,e[10]=m):m=e[10];let x;e[11]!==o?(x=o?s.jsx(He,{onConnectClick:()=>l(!0)}):null,e[11]=o,e[12]=x):x=e[12];let k;return e[13]!==h||e[14]!==m||e[15]!==x?(k=s.jsxs(s.Fragment,{children:[h,m,x]}),e[13]=h,e[14]=m,e[15]=x,e[16]=k):k=e[16],k}let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(J.Suspense,{fallback:s.jsx(Re,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=u):u=e[17];let p;e[18]!==c?(p=c?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=c,e[19]=p):p=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(He,{onConnectClick:()=>l(!0)}),e[20]=y):y=e[20];let f;e[21]!==a?(f=s.jsx($e,{open:a,onOpenChange:l}),e[21]=a,e[22]=f):f=e[22];let _;return e[23]!==p||e[24]!==f?(_=s.jsxs(s.Fragment,{children:[u,p,y,f]}),e[23]=p,e[24]=f,e[25]=_):_=e[25],_}function ps(){const e=X.c(7),t=oe();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let o;e[2]!==i?(o=s.jsx(ke.Title,{children:i}),e[2]=i,e[3]=o):o=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ct,{fallback:fs,children:s.jsx(J.Suspense,{fallback:s.jsx(Re,{className:"h-64 w-full"}),children:s.jsx(us,{})})}),e[4]=n):n=e[4];let c;return e[5]!==o?(c=s.jsx(ke,{children:s.jsx(ke.Content,{children:s.jsx(ke.Body,{children:s.jsxs(mt,{children:[o,n]})})})}),e[5]=o,e[6]=c):c=e[6],c}function fs(e){const{error:t}=e;return s.jsx(ms,{error:t??new Error("Failed to load AI providers")})}function ji(){const e=X.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(ps,{})}),e[0]=t):t=e[0],t}export{ji as default};
|
|
1
|
+
import{Y as Z,Z as D,a3 as Ae,a5 as Ke,a6 as ne,a4 as qe,b8 as Te,c as X,b as oe,_ as ze,$ as Be,r as J,j as s,a7 as nt,t as re,aw as Le,F as Ne,o as we,e as Se,K as ie,n as Ve,m as Oe,B as se,p as Qe,v as at,E as ct}from"./index-DptGhhs0.js";import{i as dt}from"./AlertCircle-CUqW_w6g.js";import{P as ke}from"./index-DIkj5DIc.js";import{S as Re}from"./skeleton--88gs_EO.js";import{b as Ge,a as Me,S as Ee,c as mt}from"./settings-section-fm3Mm6Bm.js";import{u as Ye,b as Pe,i as ut,c as pt,p as ft,d as Fe,e as gt,f as We}from"./use-ai-providers-gi5xr2mP.js";import{i as ht}from"./CheckCircle-VXm1pD5i.js";import{b as xt,j as vt}from"./use-organization-settings-MkvwyFUq.js";import{c as bt,d as Je,P as yt,C as $e}from"./select-model-C8d0poms.js";import{u as jt}from"./use-debounced-autosave-D0IOAPSF.js";import{I as Ie}from"./input-zj8m7n84.js";import{T as Ue,a as St}from"./toggle-group-BsLp02VA.js";import{A as Ze,a as Xe,b as et,c as tt,d as st,e as it,f as ot,g as rt}from"./alert-dialog-FVJZWl26.js";import{u as je}from"./studio-tools-Dz4porfg.js";import{s as Ct}from"./Plus-BmYOuiAj.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-CTroi0ek.js";import{s as It}from"./Trash01-B8ymhEo_.js";import{A as Nt}from"./avatar-BumNKk7X.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-DqYJFs_A.js";import{s as Kt}from"./Eye-B22W8AyK.js";import{b as At,a as Rt,d as Mt,e as Et,c as Ft}from"./dialog-D4l4Xdsp.js";import{S as Tt}from"./spinner-DEsDb5EQ.js";import{R as Ot}from"./require-capability-D5sKrc-a.js";import"./sidebar-DYUk0Bcn.js";import"./LayoutLeft-m1wg28yS.js";import"./use-mobile-CYh3EGEt.js";import"./X-BM44NliR.js";import"./tooltip-CETnd3ay.js";import"./card-Dv8gN6wM.js";import"./ArrowUpRight-Ctd2GOR9.js";import"./use-mcp-client-C7paE-cE.js";import"./auth-D-uIp2CQ.js";import"./drawer-C3pYai9a.js";import"./chat-context-D2jz7TPk.js";import"./tab-id-swDgZMnB.js";import"./Check-CgsRhHy8.js";import"./Copy01-DZd32DIO.js";import"./hooks-BkWYCTuM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-NjFnhgvn.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Bdv0Gghv.js";import"./use-decopilot-events-CEPq_dZU.js";import"./checkbox-B5fS-ChG.js";import"./select-j9WEM8Sh.js";import"./ChevronDown-Wb4xUAM2.js";import"./ChevronUp-Bsb-Y77Y.js";import"./Key01-CG1NND7T.js";import"./SearchMd-h05KKMiS.js";import"./Monitor01-DcyY807V.js";import"./ChevronRight-Bb4Md-MD.js";import"./Stars01-CfCAp21f.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-BMMY0J4X.js";import"./use-capability-BqS7iGUH.js";import"./access-gate-D-oUG6gg.js";import"./capability-load-error-Zpx0CzA1.js";Z({title:D(),url:D(),icon:D()});Z({registries:Ke(D(),Z({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(D()).describe("List of MCP app_name or app_id values to hide from the store.")});const le=Z({keyId:D(),modelId:D(),title:D().optional()}).nullable();qe(["fast","smart","thinking","image","web_search","deep_research"]);qe(["fast","smart","thinking"]);const $t=Z({tiers:Z({fast:le,smart:le,thinking:le,image:le,web_search:le,deep_research:le})});Z({tiers:Z({fast:le.optional(),smart:le.optional(),thinking:le.optional()})});Z({ids:Ae(D()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});Z({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.")});Z({id:D().describe("Brand context ID"),name:D().describe("Company name"),domain:D().describe("Company domain (e.g. example.com)"),overview:D().describe("Company overview / description"),logo:D().nullable().optional().describe("Logo URL"),favicon:D().nullable().optional().describe("Favicon URL"),ogImage:D().nullable().optional().describe("OG image URL"),fonts:Z({heading:D().optional().describe("Font family for headings"),body:D().optional().describe("Font family for body text"),code:D().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:Z({primary:D().optional().describe("Primary brand color (hex)"),secondary:D().optional().describe("Secondary brand color (hex)"),accent:D().optional().describe("Accent / highlight color (hex)"),background:D().optional().describe("Background color (hex)"),foreground:D().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(D(),Te())).nullable().optional().describe("Brand images"),metadata:Ke(D(),Te()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:D().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const Ut=e=>e.capabilities?.includes("image")===!0,Ht=e=>ut(e),qt=e=>pt(e),zt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Ut},{key:"web_search",filter:Ht},{key:"deep_research",filter:qt}];function Bt(e){const t=X.c(30),{slot:i,onSlotChange:o,filterModels:n,defaultKeyId:c}=e,a=Ye(),l=a.some(I=>I.id===i?.keyId)?i?.keyId:null,[S,P]=J.useState(l??c);let b,r;t[0]!==l?(b=()=>{l&&P(l)},r=[l],t[0]=l,t[1]=b,t[2]=r):(b=t[1],r=t[2]),J.useEffect(b,r);let d;t[3]!==a||t[4]!==c||t[5]!==S?(d=a.some(I=>I.id===S)?S:c,t[3]=a,t[4]=c,t[5]=S,t[6]=d):d=t[6];const u=d;let p;t[7]!==u||t[8]!==a?(p=u?a.find(I=>I.id===u):null,t[7]=u,t[8]=a,t[9]=p):p=t[9];const y=p,{models:f,isLoading:_}=Pe(n?u??void 0:void 0),g=n?_||f.some(n):!0;let h;t[10]!==i||t[11]!==y?.providerId||t[12]!==l?(h=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:y?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=y?.providerId,t[12]=l,t[13]=h):h=t[13];const N=h,j=oe();if(n&&!g){let I;t[14]!==j?(I=j("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=j,t[15]=I):I=t[15];let K;return t[16]!==I?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[16]=I,t[17]=K):K=t[17],K}let C;t[18]!==j?(C=j("settings.simpleModeSection.pickModel"),t[18]=j,t[19]=C):C=t[19];let m;t[20]===Symbol.for("react.memo_cache_sentinel")?(m=I=>P(I),t[20]=m):m=t[20];let x;t[21]!==u||t[22]!==o?(x=I=>{const K=I.keyId??u??"";P(K),o({keyId:K,modelId:I.modelId,title:I.title})},t[21]=u,t[22]=o,t[23]=x):x=t[23];let k;return t[24]!==u||t[25]!==n||t[26]!==N||t[27]!==C||t[28]!==x?(k=s.jsx(bt,{variant:"bordered",placeholder:C,model:N,credentialId:u,filterModels:n,onCredentialChange:m,onModelChange:x}),t[24]=u,t[25]=n,t[26]=N,t[27]=C,t[28]=x,t[29]=k):k=t[29],k}function Lt(e){const t=X.c(10),{isPending:i,showSaved:o}=e,n=oe();if(i){let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Le,{size:12,className:"animate-spin"}),t[0]=c):c=t[0];let a;t[1]!==n?(a=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=a):a=t[2];let l;return t[3]!==a?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c,a]}),t[3]=a,t[4]=l):l=t[4],l}if(o){let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ht,{size:12}),t[5]=c):c=t[5];let a;t[6]!==n?(a=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=a):a=t[7];let l;return t[8]!==a?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c,a]}),t[8]=a,t[9]=l):l=t[9],l}return null}function Vt(){const e=X.c(58),t=oe(),i=Ye(),o=xt(),n=i.length>0;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=ze($t),e[0]=c):c=e[0];let a;e[1]!==o?(a={resolver:c,values:o,mode:"onChange"},e[1]=o,e[2]=a):a=e[2];const l=Be(a),{mutate:S,isPending:P,isSuccess:b}=vt(),r=l.formState.isDirty;let d;e[3]!==l||e[4]!==o||e[5]!==t||e[6]!==S?(d={delayMs:250,save:async()=>{const v=l.getValues();S(v,{onSuccess:()=>l.reset(v,{keepValues:!0}),onError:R=>{l.reset(o),re.error(t("settings.simpleModeSection.failedToSave",{error:R.message}))}})}},e[3]=l,e[4]=o,e[5]=t,e[6]=S,e[7]=d):d=e[7];const{schedule:u}=jt(d),p=i[0],y=i[1],f=i[2],{models:_}=Pe(p?.id),{models:g}=Pe(y?.id),{models:h}=Pe(f?.id);let N,j;e[8]!==l||e[9]!==n?(N=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},j=[n,l],e[8]=l,e[9]=n,e[10]=N,e[11]=j):(N=e[10],j=e[11]),J.useEffect(N,j);let C;e[12]!==i||e[13]!==l||e[14]!==p||e[15]!==y||e[16]!==f||e[17]!==_||e[18]!==g||e[19]!==h?(C=()=>{const v=l.getValues(),R=new Set(i.map(Qt)),M={};p?.id&&(M[p.id]=_),y?.id&&(M[y.id]=g),f?.id&&(M[f.id]=h);const A=G=>G!=null&&!R.has(G.keyId),w={fast:A(v.tiers.fast)?null:v.tiers.fast,smart:A(v.tiers.smart)?null:v.tiers.smart,thinking:A(v.tiers.thinking)?null:v.tiers.thinking,image:A(v.tiers.image)?null:v.tiers.image,web_search:A(v.tiers.web_search)?null:v.tiers.web_search,deep_research:A(v.tiers.deep_research)?null:v.tiers.deep_research},Y=!w.fast||!w.smart||!w.thinking||!w.image||!w.web_search||!w.deep_research,W=w.fast===v.tiers.fast&&w.smart===v.tiers.smart&&w.thinking===v.tiers.thinking&&w.image===v.tiers.image&&w.web_search===v.tiers.web_search&&w.deep_research===v.tiers.deep_research;if(!Y&&W)return;const $=ft(i,M);l.reset({tiers:{fast:w.fast??$.chat.fast,smart:w.smart??$.chat.smart,thinking:w.thinking??$.chat.thinking,image:w.image??$.image,web_search:w.web_search??$.webSearch,deep_research:w.deep_research??$.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=p,e[15]=y,e[16]=f,e[17]=_,e[18]=g,e[19]=h,e[20]=C):C=e[20];const m=p?.id,x=y?.id,k=f?.id;let I;e[21]!==i||e[22]!==l||e[23]!==_||e[24]!==g||e[25]!==h||e[26]!==m||e[27]!==x||e[28]!==k?(I=[l,i,_,g,h,m,x,k],e[21]=i,e[22]=l,e[23]=_,e[24]=g,e[25]=h,e[26]=m,e[27]=x,e[28]=k,e[29]=I):I=e[29],J.useEffect(C,I);let K;e[30]!==t?(K=v=>({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")})[v]||v,e[30]=t,e[31]=K):K=e[31];const L=K;let U;e[32]!==t?(U=v=>({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")})[v]||"",e[32]=t,e[33]=U):U=e[33];const V=U;let H;e[34]!==t?(H=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=H):H=e[35];let q;e[36]!==t?(q=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=q):q=e[37];let z;e[38]!==q?(z=s.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[38]=q,e[39]=z):z=e[39];const Q=b&&!r;let E;e[40]!==P||e[41]!==Q?(E=s.jsx(Lt,{isPending:P,showSaved:Q}),e[40]=P,e[41]=Q,e[42]=E):E=e[42];let F;e[43]!==z||e[44]!==E?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[z,E]}),e[43]=z,e[44]=E,e[45]=F):F=e[45];let T;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==V||e[49]!==L||e[50]!==u?(T=zt.map(v=>s.jsx(nt,{control:l.control,name:`tiers.${v.key}`,render:R=>{const{field:M}=R;return s.jsx(Ge,{title:L(v.key),description:V(v.key),action:s.jsx(Bt,{slot:M.value,defaultKeyId:i[0]?.id??null,filterModels:v.filter,onSlotChange:A=>{M.onChange(A),u()}})})}},v.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=V,e[49]=L,e[50]=u,e[51]=T):T=e[51];let O;e[52]!==T?(O=s.jsx(Me,{children:T}),e[52]=T,e[53]=O):O=e[53];let B;return e[54]!==H||e[55]!==F||e[56]!==O?(B=s.jsxs(Ee,{title:H,headerClassName:"pl-0",children:[F,O]}),e[54]=H,e[55]=F,e[56]=O,e[57]=B):B=e[57],B}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Yt(){const e=X.c(30),t=oe(),i=je(),[o,n]=J.useState(!1);let c;e[0]!==t?(c=m=>{re.error(t("settings.decoCreditsHero.topUpFailed",{message:m.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:a,isPending:l}=Se({mutationFn:async m=>{const{url:x}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:m,currency:d});return x},onSuccess:Wt,onError:c}),[S,P]=J.useState(""),[b,r]=J.useState("usd"),d=b,u=parseFloat(S),p=!isNaN(u)&&u>=1,y=d==="brl"?"R$":"$";let f;e[2]!==r?(f=m=>{m&&r(m)},e[2]=r,e[3]=f):f=e[3];let _,g;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Ue,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(Ue,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=_,e[5]=g):(_=e[4],g=e[5]);let h;e[6]!==d||e[7]!==f?(h=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:d,onValueChange:f,children:[_,g]}),e[6]=d,e[7]=f,e[8]=h):h=e[8];let N;e[9]!==d||e[10]!==y||e[11]!==o||e[12]!==l||e[13]!==t||e[14]!==a?(N=!o&&s.jsxs(s.Fragment,{children:[Gt[d].map(m=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>a(m*100),children:[y,m]},m)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:t("settings.decoCreditsHero.custom")})]}),e[9]=d,e[10]=y,e[11]=o,e[12]=l,e[13]=t,e[14]=a,e[15]=N):N=e[15];let j;e[16]!==y||e[17]!==S||e[18]!==u||e[19]!==o||e[20]!==p||e[21]!==l||e[22]!==P||e[23]!==t||e[24]!==a?(j=o&&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:y}),s.jsx(Ie,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:S,onChange:m=>P(m.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!p||l,onClick:()=>a(Math.round(u*100)),children:l?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),P("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=y,e[17]=S,e[18]=u,e[19]=o,e[20]=p,e[21]=l,e[22]=P,e[23]=t,e[24]=a,e[25]=j):j=e[25];let C;return e[26]!==h||e[27]!==N||e[28]!==j?(C=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h,N,j]})}),e[26]=h,e[27]=N,e[28]=j,e[29]=C):C=e[29],C}function Wt(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=X.c(121),t=oe(),{org:i}=Ne(),o=je(),n=we(),c=Fe();let a;e[0]!==c?(a=c.find(Xt),e[0]=c,e[1]=a):a=e[1];const l=a,[S,P]=J.useState(!1);let b;e[2]!==l||e[3]!==o?(b=async()=>{l&&await o.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=o,e[4]=b):b=e[4];let r;e[5]!==i.id||e[6]!==n||e[7]!==t?(r=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:ie.aiProviders(i.id)}),re.success(t("settings.decoCreditsHero.disconnectSuccess")),P(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=r):r=e[8];let d;e[9]!==t?(d=lt=>{re.error(t("settings.decoCreditsHero.disconnectError",{message:lt.message}))},e[9]=t,e[10]=d):d=e[10];let u;e[11]!==b||e[12]!==r||e[13]!==d?(u={mutationFn:b,onSuccess:r,onError:d},e[11]=b,e[12]=r,e[13]=d,e[14]=u):u=e[14];const{mutate:p,isPending:y}=Se(u);let f;e[15]!==i.id?(f=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=f):f=e[16];const _=!!l;let g;e[17]!==o?(g=async()=>{try{return await o.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=o,e[18]=g):g=e[18];let h;e[19]!==f||e[20]!==_||e[21]!==g?(h={queryKey:f,enabled:_,staleTime:6e4,queryFn:g},e[19]=f,e[20]=_,e[21]=g,e[22]=h):h=e[22];const{data:N,isLoading:j,refetch:C,isFetching:m}=Ve(h);if(!l)return null;const x=N?.balanceCents!=null?N.balanceCents/100:null;let k;e[23]!==x?(k=x!=null?`$${x.toFixed(2)}`:"—",e[23]=x,e[24]=k):k=e[24];const I=k;let K;e[25]!==t?(K=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=K):K=e[26];let L;e[27]!==t?(L=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=L):L=e[28];let U;e[29]!==L?(U=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:L,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=L,e[30]=U):U=e[30];let V;e[31]!==t?(V=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=V):V=e[32];let H;e[33]!==V?(H=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:V})}),e[33]=V,e[34]=H):H=e[34];let q;e[35]!==U||e[36]!==H?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[U,H]}),e[35]=U,e[36]=H,e[37]=q):q=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=()=>P(!0),e[38]=z):z=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let E;e[41]!==y||e[42]!==Q?(E=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:y,children:Q}),e[41]=y,e[42]=Q,e[43]=E):E=e[43];let F;e[44]!==q||e[45]!==E?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[q,E]}),e[44]=q,e[45]=E,e[46]=F):F=e[46];let T;e[47]!==t?(T=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=T):T=e[48];let O;e[49]!==T?(O=s.jsx(Ze,{children:T}),e[49]=T,e[50]=O):O=e[50];let B;e[51]!==t?(B=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=B):B=e[52];let v;e[53]!==B?(v=s.jsx(Xe,{children:B}),e[53]=B,e[54]=v):v=e[54];let R;e[55]!==O||e[56]!==v?(R=s.jsxs(et,{children:[O,v]}),e[55]=O,e[56]=v,e[57]=R):R=e[57];let M;e[58]!==t?(M=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=M):M=e[59];let A;e[60]!==M?(A=s.jsx(tt,{children:M}),e[60]=M,e[61]=A):A=e[61];let w;e[62]!==p?(w=()=>p(),e[62]=p,e[63]=w):w=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let W;e[66]!==w||e[67]!==Y?(W=s.jsx(st,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=w,e[67]=Y,e[68]=W):W=e[68];let $;e[69]!==A||e[70]!==W?($=s.jsxs(it,{children:[A,W]}),e[69]=A,e[70]=W,e[71]=$):$=e[71];let G;e[72]!==R||e[73]!==$?(G=s.jsxs(ot,{children:[R,$]}),e[72]=R,e[73]=$,e[74]=G):G=e[74];let te;e[75]!==S||e[76]!==G?(te=s.jsx(rt,{open:S,onOpenChange:P,children:G}),e[75]=S,e[76]=G,e[77]=te):te=e[77];let ee;e[78]!==x||e[79]!==I||e[80]!==m||e[81]!==j?(ee=j||m?s.jsx(Re,{className:"h-9 w-24"}):s.jsx("span",{className:Oe("text-3xl font-semibold tabular-nums tracking-tight",x!=null&&Jt(x)),children:I}),e[78]=x,e[79]=I,e[80]=m,e[81]=j,e[82]=ee):ee=e[82];let ae;e[83]!==C?(ae=()=>C(),e[83]=C,e[84]=ae):ae=e[84];let ce;e[85]!==t?(ce=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ce):ce=e[86];const De=m&&"animate-spin";let de;e[87]!==De?(de=Oe(De),e[87]=De,e[88]=de):de=e[88];let me;e[89]!==de?(me=s.jsx(Le,{size:14,className:de}),e[89]=de,e[90]=me):me=e[90];let ue;e[91]!==m||e[92]!==ae||e[93]!==ce||e[94]!==me?(ue=s.jsx("button",{type:"button",onClick:ae,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ce,children:me}),e[91]=m,e[92]=ae,e[93]=ce,e[94]=me,e[95]=ue):ue=e[95];let pe;e[96]!==ee||e[97]!==ue?(pe=s.jsxs("div",{className:"flex items-baseline gap-2",children:[ee,ue]}),e[96]=ee,e[97]=ue,e[98]=pe):pe=e[98];let fe;e[99]!==t?(fe=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=fe):fe=e[100];let ge;e[101]!==fe?(ge=s.jsx("p",{className:"text-xs text-muted-foreground",children:fe}),e[101]=fe,e[102]=ge):ge=e[102];let he;e[103]!==pe||e[104]!==ge?(he=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[pe,ge]}),e[103]=pe,e[104]=ge,e[105]=he):he=e[105];let xe;e[106]!==t?(xe=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=xe):xe=e[107];let ve;e[108]!==xe?(ve=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:xe}),e[108]=xe,e[109]=ve):ve=e[109];let Ce;e[110]===Symbol.for("react.memo_cache_sentinel")?(Ce=s.jsx(Yt,{}),e[110]=Ce):Ce=e[110];let be;e[111]!==ve?(be=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ve,Ce]}),e[111]=ve,e[112]=be):be=e[112];let ye;e[113]!==F||e[114]!==te||e[115]!==he||e[116]!==be?(ye=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,te,he,be]})}),e[113]=F,e[114]=te,e[115]=he,e[116]=be,e[117]=ye):ye=e[117];let _e;return e[118]!==K||e[119]!==ye?(_e=s.jsx(Ee,{title:K,children:ye}),e[118]=K,e[119]=ye,e[120]=_e):_e=e[120],_e}function Xt(e){return e.providerId==="deco"}function es(){const e=X.c(8),{org:t}=Ne(),i=je(),o=we();let n;e[0]!==i?(n=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=n):n=e[1];let c;e[2]!==t||e[3]!==o?(c=()=>{Qe("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:ie.aiProviders(t.id)}),re.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=o,e[4]=c):c=e[4];let a;return e[5]!==n||e[6]!==c?(a={mutationFn:n,onSuccess:c,onError:ts},e[5]=n,e[6]=c,e[7]=a):a=e[7],Se(a)}function ts(e){Qe("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),re.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function ss(){const e=X.c(37),t=oe(),{mutate:i,isPending:o}=es();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["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]=n):n=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=c):c=e[1];let a;e[2]!==t?(a=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=a):a=e[3];let l;e[4]!==a?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:a,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=a,e[5]=l):l=e[5];let S;e[6]!==t?(S=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=S):S=e[7];let P;e[8]!==S?(P=s.jsx("p",{className:"text-base font-semibold",children:S}),e[8]=S,e[9]=P):P=e[9];let b;e[10]!==t?(b=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=b):b=e[11];let r;e[12]!==b?(r=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:b}),e[12]=b,e[13]=r):r=e[13];let d;e[14]!==P||e[15]!==r?(d=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[P,r]}),e[14]=P,e[15]=r,e[16]=d):d=e[16];let u;e[17]!==t?(u=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=u):u=e[18];let p;e[19]!==u?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:u}),e[19]=u,e[20]=p):p=e[20];let y;e[21]!==p||e[22]!==d?(y=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,p]}),e[21]=p,e[22]=d,e[23]=y):y=e[23];let f;e[24]!==i?(f=()=>i(),e[24]=i,e[25]=f):f=e[25];let _;e[26]!==o||e[27]!==t?(_=t(o?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=o,e[27]=t,e[28]=_):_=e[28];let g;e[29]!==o||e[30]!==f||e[31]!==_?(g=s.jsx(se,{variant:"outline",disabled:o,onClick:f,children:_}),e[29]=o,e[30]=f,e[31]=_,e[32]=g):g=e[32];let h;return e[33]!==y||e[34]!==g||e[35]!==l?(h=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[c,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,y,g]})]}),e[33]=y,e[34]=g,e[35]=l,e[36]=h):h=e[36],h}const is=e=>Z({label:D().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:D().optional(),baseUrl:D().optional()});function os({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:o}){return e&&!!t&&t!==i&&!o}function rs({providerKey:e,provider:t,preset:i,maskedKey:o,currentLabel:n,currentBaseUrl:c,onCancel:a,onSuccess:l}){const{org:S}=Ne(),P=je(),b=we(),r=oe(),[d,u]=J.useState(!1),p=t.id==="openai-compatible",y=t.supportedMethods.includes("api-key"),f=is(r),{register:_,handleSubmit:g,watch:h,setError:N,formState:{errors:j}}=Be({resolver:ze(f),defaultValues:{label:n,apiKey:"",baseUrl:c??""}}),C=h("apiKey")??"",{mutate:m,isPending:x}=Se({mutationFn:async k=>{let I;k.apiKey&&(p?I=JSON.stringify({baseUrl:k.baseUrl||c||"",apiKey:k.apiKey}):I=k.apiKey),await P.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:k.label,...I!==void 0?{apiKey:I}:{}})},onSuccess:()=>{b.invalidateQueries({queryKey:ie.aiProviderKeys(S.id)}),b.invalidateQueries({queryKey:ie.aiProviders(S.id)}),re.success(r("settings.editProviderDialog.providerUpdated")),l()},onError:k=>re.error(r("settings.editProviderDialog.failedToUpdate",{error:k.message}))});return s.jsxs("form",{onSubmit:g(k=>{if(os({isOpenAICompatible:p,baseUrl:k.baseUrl,currentBaseUrl:c,apiKey:k.apiKey})){N("apiKey",{message:r("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}m(k)}),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:r("settings.editProviderDialog.label")}),s.jsx(Ie,{placeholder:r("settings.editProviderDialog.labelPlaceholder"),..._("label"),className:"h-8 text-sm"}),j.label&&s.jsx("p",{className:"text-xs text-destructive",children:j.label.message})]}),p&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.baseUrl")}),s.jsx(Ie,{type:"url",placeholder:i?.baseUrlPlaceholder??r("settings.editProviderDialog.baseUrlPlaceholder"),..._("baseUrl"),className:"h-8 text-sm"})]}),y&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[r("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",r("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ie,{type:d&&C?"text":"password",placeholder:o,..._("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),C&&s.jsx("button",{type:"button",onClick:()=>u(!d),"aria-label":r(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})})]}),j.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:j.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Ft,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:a,disabled:x,children:r("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:x,children:r(x?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function ls(e){const t=X.c(31),{providerKey:i,provider:o,open:n,onOpenChange:c}=e,a=oe(),l=je(),S=o.id==="openai-compatible"&&i.presetId?Je(i.presetId):void 0,P=S?.name??o.name;let b;t[0]!==i.id?(b=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=b):b=t[1];let r;t[2]!==i.id||t[3]!==l?(r=()=>l.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=l,t[4]=r):r=t[4];let d;t[5]!==n||t[6]!==b||t[7]!==r?(d={queryKey:b,queryFn:r,enabled:n,staleTime:0},t[5]=n,t[6]=b,t[7]=r,t[8]=d):d=t[8];const{data:u,isLoading:p}=Ve(d),y=Et,f=Mt,_="sm:max-w-md",g=Rt,h=At,N=a("settings.editProviderDialog.editTitle",{name:P});let j;t[9]!==h||t[10]!==N?(j=s.jsx(h,{children:N}),t[9]=h,t[10]=N,t[11]=j):j=t[11];let C;t[12]!==g||t[13]!==j?(C=s.jsx(g,{children:j}),t[12]=g,t[13]=j,t[14]=C):C=t[14];let m;t[15]!==p||t[16]!==c||t[17]!==S||t[18]!==u||t[19]!==o||t[20]!==i?(m=p||!u?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Tt,{})}):s.jsx(rs,{providerKey:i,provider:o,preset:S,maskedKey:u.maskedKey,currentLabel:u.label,currentBaseUrl:u.baseUrl,onCancel:()=>c(!1),onSuccess:()=>c(!1)}),t[15]=p,t[16]=c,t[17]=S,t[18]=u,t[19]=o,t[20]=i,t[21]=m):m=t[21];let x;t[22]!==f||t[23]!==C||t[24]!==m?(x=s.jsxs(f,{className:_,children:[C,m]}),t[22]=f,t[23]=C,t[24]=m,t[25]=x):x=t[25];let k;return t[26]!==y||t[27]!==c||t[28]!==n||t[29]!==x?(k=s.jsx(y,{open:n,onOpenChange:c,children:x}),t[26]=y,t[27]=c,t[28]=n,t[29]=x,t[30]=k):k=t[30],k}function ns(e){const t=X.c(86),{providerKey:i,provider:o}=e,{org:n}=Ne(),c=je(),a=we(),[l,S]=J.useState(!1),[P,b]=J.useState(!1),r=oe(),[d]=at(),u=d.language==="pt-BR"?_t:void 0,p=o?.id==="openai-compatible";let y;t[0]!==p||t[1]!==i.presetId?(y=p&&i.presetId?Je(i.presetId):void 0,t[0]=p,t[1]=i.presetId,t[2]=y):y=t[2];const f=y;let _;t[3]!==p||t[4]!==f||t[5]!==o?.name||t[6]!==i.providerId||t[7]!==r?(_=f?f.name:p?r("settings.aiProviders.customOpenAiCompatible"):o?.name??(i.providerId==="claude-code"?r("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?r("settings.providerKeyRow.codex"):i.providerId),t[3]=p,t[4]=f,t[5]=o?.name,t[6]=i.providerId,t[7]=r,t[8]=_):_=t[8];const g=_,h=f?.logo??o?.logo??wt[i.providerId];let N;e:{if(p){N=i.label;break e}let ee;t[9]!==u||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==r?(ee=r("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:u})}),t[9]=u,t[10]=i.createdAt,t[11]=i.label,t[12]=r,t[13]=ee):ee=t[13],N=ee}const j=N;let C;t[14]!==i.id||t[15]!==c?(C=async()=>{await c.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=c,t[16]=C):C=t[16];let m;t[17]!==n||t[18]!==i.id||t[19]!==a||t[20]!==r?(m=()=>{a.invalidateQueries({queryKey:ie.aiProviderKeys(n.id)}),a.invalidateQueries({queryKey:ie.aiProviders(n.id)}),a.invalidateQueries({queryKey:ie.aiProviderModels(n.id,i.id)}),re.success(r("settings.providerKeyRow.keyDeleted")),S(!1)},t[17]=n,t[18]=i.id,t[19]=a,t[20]=r,t[21]=m):m=t[21];let x;t[22]!==r?(x=ee=>re.error(r("settings.providerKeyRow.failedToDeleteKey",{error:ee.message})),t[22]=r,t[23]=x):x=t[23];let k;t[24]!==C||t[25]!==m||t[26]!==x?(k={mutationFn:C,onSuccess:m,onError:x},t[24]=C,t[25]=m,t[26]=x,t[27]=k):k=t[27];const{mutate:I,isPending:K}=Se(k);let L;t[28]!==g||t[29]!==h?(L=h?s.jsx("img",{src:h,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Nt,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=h,t[30]=L):L=t[30];let U;t[31]!==o||t[32]!==r?(U=o?s.jsx(se,{variant:"ghost",size:"icon","aria-label":r("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>b(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=o,t[32]=r,t[33]=U):U=t[33];let V;t[34]!==r?(V=r("settings.providerKeyRow.deleteProviderKey"),t[34]=r,t[35]=V):V=t[35];let H,q;t[36]===Symbol.for("react.memo_cache_sentinel")?(H=()=>S(!0),q=s.jsx(It,{size:14}),t[36]=H,t[37]=q):(H=t[36],q=t[37]);let z;t[38]!==K||t[39]!==V?(z=s.jsx(se,{variant:"ghost",size:"icon","aria-label":V,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:K,onClick:H,children:q}),t[38]=K,t[39]=V,t[40]=z):z=t[40];let Q;t[41]!==z||t[42]!==U?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,z]}),t[41]=z,t[42]=U,t[43]=Q):Q=t[43];let E;t[44]!==j||t[45]!==g||t[46]!==Q||t[47]!==L?(E=s.jsx(Ge,{icon:L,title:g,description:j,action:Q}),t[44]=j,t[45]=g,t[46]=Q,t[47]=L,t[48]=E):E=t[48];let F;t[49]!==P||t[50]!==o||t[51]!==i?(F=o?s.jsx(ls,{providerKey:i,provider:o,open:P,onOpenChange:b}):null,t[49]=P,t[50]=o,t[51]=i,t[52]=F):F=t[52];let T;t[53]!==r?(T=r("settings.providerKeyRow.deleteApiKey"),t[53]=r,t[54]=T):T=t[54];let O;t[55]!==T?(O=s.jsx(Ze,{children:T}),t[55]=T,t[56]=O):O=t[56];let B;t[57]!==i.label?(B=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]=B):B=t[58];let v;t[59]!==O||t[60]!==B?(v=s.jsxs(et,{children:[O,B]}),t[59]=O,t[60]=B,t[61]=v):v=t[61];let R;t[62]!==r?(R=r("settings.providerKeyRow.cancel"),t[62]=r,t[63]=R):R=t[63];let M;t[64]!==R?(M=s.jsx(tt,{children:R}),t[64]=R,t[65]=M):M=t[65];let A;t[66]!==I?(A=()=>I(),t[66]=I,t[67]=A):A=t[67];let w;t[68]!==r?(w=r("settings.providerKeyRow.delete"),t[68]=r,t[69]=w):w=t[69];let Y;t[70]!==A||t[71]!==w?(Y=s.jsx(st,{onClick:A,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:w}),t[70]=A,t[71]=w,t[72]=Y):Y=t[72];let W;t[73]!==M||t[74]!==Y?(W=s.jsxs(it,{children:[M,Y]}),t[73]=M,t[74]=Y,t[75]=W):W=t[75];let $;t[76]!==v||t[77]!==W?($=s.jsxs(ot,{children:[v,W]}),t[76]=v,t[77]=W,t[78]=$):$=t[78];let G;t[79]!==l||t[80]!==$?(G=s.jsx(rt,{open:l,onOpenChange:S,children:$}),t[79]=l,t[80]=$,t[81]=G):G=t[81];let te;return t[82]!==E||t[83]!==F||t[84]!==G?(te=s.jsxs(s.Fragment,{children:[E,F,G]}),t[82]=E,t[83]=F,t[84]=G,t[85]=te):te=t[85],te}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(o=>o.id===i.providerId)??null}))}function He(e){const t=X.c(13),{onConnectClick:i}=e,o=oe(),n=Fe(),c=We();let a;if(t[0]!==c?.providers||t[1]!==n||t[2]!==i||t[3]!==o){const l=c?.providers??[],S=cs(n,l);let P;t[5]!==o?(P=o("settings.connectedProvidersSection.sectionTitle"),t[5]=o,t[6]=P):P=t[6];let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Ct,{size:14}),t[7]=b):b=t[7];let r;t[8]!==o?(r=o("settings.connectedProvidersSection.connectButton"),t[8]=o,t[9]=r):r=t[9];let d;t[10]!==i||t[11]!==r?(d=s.jsxs(se,{size:"sm",onClick:i,children:[b,r]}),t[10]=i,t[11]=r,t[12]=d):d=t[12],a=s.jsx(Ee,{title:P,headerClassName:"px-0",actions:d,children:S.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:o("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:S.map(ds)})}),t[0]=c?.providers,t[1]=n,t[2]=i,t[3]=o,t[4]=a}else a=t[4];return a}function ds(e){const{key:t,provider:i}=e;return s.jsx(ns,{providerKey:t,provider:i},t.id)}function ms(e){const t=X.c(3),{error:i}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(dt,{size:16}),t[0]=o):o=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function us(){const e=X.c(26),t=Fe();let i;e[0]!==t?(i=as(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:o,hasHostedProvider:n,hasDeco:c}=i,[a,l]=J.useState(!1),[S,P]=J.useState(null),b=We();let r;e[2]!==b?.providers?(r=b?.providers??[],e[2]=b?.providers,e[3]=r):r=e[3];const d=r;if(!n){let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>l(!0),e[4]=g):g=e[4];let h;e[5]!==d?(h=s.jsx(yt,{providers:d,onSelect:P,onShowAll:g}),e[5]=d,e[6]=h):h=e[6];const N=S!==null||a;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=I=>{I||(P(null),l(!1))},e[7]=j):j=e[7];const C=S??void 0;let m;e[8]!==N||e[9]!==C?(m=s.jsx($e,{open:N,onOpenChange:j,initialProvider:C}),e[8]=N,e[9]=C,e[10]=m):m=e[10];let x;e[11]!==o?(x=o?s.jsx(He,{onConnectClick:()=>l(!0)}):null,e[11]=o,e[12]=x):x=e[12];let k;return e[13]!==h||e[14]!==m||e[15]!==x?(k=s.jsxs(s.Fragment,{children:[h,m,x]}),e[13]=h,e[14]=m,e[15]=x,e[16]=k):k=e[16],k}let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(J.Suspense,{fallback:s.jsx(Re,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=u):u=e[17];let p;e[18]!==c?(p=c?s.jsx(Zt,{}):s.jsx(ss,{}),e[18]=c,e[19]=p):p=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(He,{onConnectClick:()=>l(!0)}),e[20]=y):y=e[20];let f;e[21]!==a?(f=s.jsx($e,{open:a,onOpenChange:l}),e[21]=a,e[22]=f):f=e[22];let _;return e[23]!==p||e[24]!==f?(_=s.jsxs(s.Fragment,{children:[u,p,y,f]}),e[23]=p,e[24]=f,e[25]=_):_=e[25],_}function ps(){const e=X.c(7),t=oe();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let o;e[2]!==i?(o=s.jsx(ke.Title,{children:i}),e[2]=i,e[3]=o):o=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ct,{fallback:fs,children:s.jsx(J.Suspense,{fallback:s.jsx(Re,{className:"h-64 w-full"}),children:s.jsx(us,{})})}),e[4]=n):n=e[4];let c;return e[5]!==o?(c=s.jsx(ke,{children:s.jsx(ke.Content,{children:s.jsx(ke.Body,{children:s.jsxs(mt,{children:[o,n]})})})}),e[5]=o,e[6]=c):c=e[6],c}function fs(e){const{error:t}=e;return s.jsx(ms,{error:t??new Error("Failed to load AI providers")})}function ji(){const e=X.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(ps,{})}),e[0]=t):t=e[0],t}export{ji 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-DptGhhs0.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,cY as w,cZ as T,aC as m,c_ as A,e0 as O,H as M,aE as I,cy as z,e1 as D,cz as F,d5 as L,aA as G,d7 as H,cA as Y,c as n,m as p,U as v}from"./index-
|
|
1
|
+
import{r as i,j as r,cY as w,cZ as T,aC as m,c_ as A,e0 as O,H as M,aE as I,cy as z,e1 as D,cz as F,d5 as L,aA as G,d7 as H,cA as Y,c as n,m as p,U as v}from"./index-DptGhhs0.js";var x="AlertDialog",[k]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var V="AlertDialogTrigger",W=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});W.displayName=V;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(Y,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[U,Z]=k(f),J=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:h,docsSlug:"alert-dialog",children:r.jsx(U,{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(J,{children:a}),r.jsx(Q,{contentRef:c})]})})})});j.displayName=f;var h="AlertDialogTitle",E=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});E.displayName=h;var b="AlertDialogDescription",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});C.displayName=b;var K="AlertDialogAction",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});R.displayName=K;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=Z($,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 \`${b}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-bSjz3FLt.js";import{i as jt}from"./ChevronRight-MVnPAPii.js";import{l as Bt}from"./automation-runs-CgyKaz2R.js";import{A as At}from"./add-section-modal-J4MpuN5T.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-B3Lyzc7o.js";import"./select-C_F8-amA.js";import"./tooltip-Bfr58shw.js";import"./Check-BVpJjApv.js";import"./ChevronDown-DTyVSvpW.js";import"./ChevronUp-DNXgZ_10.js";import"./useInfiniteQuery-gU5karM4.js";import"./use-infinite-scroll-Cg9HfQoH.js";import"./use-connection-BzH0Kdzc.js";import"./use-mcp-client-BcyA1fq6.js";import"./auth-C7EjAKuK.js";import"./use-virtual-mcp-Bujf-aIR.js";import"./card-Dwttk7rT.js";import"./sidebar-ZY9Na73j.js";import"./LayoutLeft-Ciwgy5UL.js";import"./use-mobile-DtJ9mqo3.js";import"./X-BcM56kD2.js";import"./table-DUzcE7pw.js";import"./empty-state-p3Rv7ykT.js";import"./use-members-BPAn97Ac.js";import"./use-org-auth-client-BbxxaMLu.js";import"./use-clock-tick-XnKcERte.js";import"./AlertCircle-B9QqDYpV.js";import"./CheckCircle-DqPpDLAb.js";import"./DotsVertical-0qwliDrg.js";import"./agent-icon-DvITB4KO.js";import"./Tool01-D_lBKESF.js";import"./ArrowUp-DWMmuZz_.js";import"./Settings02-CzRrS-qR.js";import"./Tool02-BcNfyibb.js";import"./XCircle-B8N2lyCq.js";import"./ArrowUpRight-BWTRGGcn.js";import"./TrendUp01-4daEWKyg.js";import"./ZapSquare-Nv0rijSe.js";import"./Users03-C-1TY48R.js";import"./Stars02-JSRi49Xl.js";import"./Copy01-CKPJ5IhB.js";import"./CpuChip01-Du71UW4x.js";import"./Eye-DydEPicd.js";import"./FilterLines-BJV5RK1l.js";import"./Star01-BetPRMOP.js";import"./Palette-BoJouFtF.js";import"./SwitchHorizontal01-GLaQT_tZ.js";import"./HardDrive-CGeasvVZ.js";import"./Key01-DuDppfi_.js";import"./LinkExternal01--DLqIMAa.js";import"./LogOut01-DMqcCuTY.js";import"./Monitor01-B6vkAJLy.js";import"./Sun-OLuqlB9J.js";import"./Play-C5V2_mAu.js";import"./Plus-hTCIWDtE.js";import"./SearchLg-CEMI_Yu5.js";import"./SearchMd-CGs342fz.js";import"./Shield01-b0Ri5_gK.js";import"./Stars01-DQgIK8ZP.js";import"./Trash01--2hLWyEP.js";import"./Upload01-CpoC4YD6.js";import"./User01-Ddv0yRQm.js";import"./Users01-B0XXonaO.js";import"./XClose-BMHkS-kz.js";import"./Zap-0Vx8dn_e.js";import"./use-automations-D6FStJIQ.js";import"./studio-tools-CnY1iRfX.js";import"./useSuspenseInfiniteQuery-DfcVoJ9U.js";import"./avatar-BN0lsHoN.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Bb3AUakA.js";import"./calendar-CX7YfHEa.js";import"./dialog-BSwzm_xb.js";import"./tab-id-D_shElJ5.js";import"./hooks-Bva17Au4.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C5huenWS.js";import"./chat-context-BbbE9k_D.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-b8vjAuOw.js";import"./use-decopilot-events-D8GZCmLu.js";import"./use-organization-settings-B7aJIu7V.js";import"./monaco-editor-DLbVfQ_7.js";import"./spinner-CT6gj-U7.js";import"./index-r7ibRdki.js";import"./shell-layout-nGpsxb9b.js";import"./required-auth-layout-DNnOiPNc.js";import"./use-org-sso-9IKzvoT7.js";import"./integration-icon-Dw-S_xW-.js";import"./use-navigate-to-agent-B56yEq2x.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DbP5hfAi.js";import"./form-DH41eKNk.js";import"./label-BdYpUysi.js";import"./input-mwCJa3UC.js";import"./drawer-Bs_TJ-Xq.js";import"./collection-search-Cz6kdWMP.js";import"./index-Pe4ypjX9.js";import"./get-initials-D-f_fDFw.js";import"./popover-NHkLoGwZ.js";import"./dropdown-menu-b_BfGjG2.js";import"./github-repo-picker-B3yLKSRu.js";import"./use-debounced-value-GljL4VOJ.js";import"./authenticate-and-persist-oauth-Drw6R7zD.js";import"./mcp-oauth-CFh8Fy0x.js";import"./use-mcp-tools-Dsxlr_F7.js";import"./extract-connection-data-CD7g_CXG.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./use-tags-CRJNGby7.js";import"./skeleton-CHQGQrAg.js";import"./command-CBET95DA.js";import"./index-BXC1jJIv.js";import"./companions-core-DfxidC-a.js";import"./tabs-CU_nfhem.js";import"./toggle-group-DGoI3Yg0.js";import"./use-deco-credits-Ds-jb_dO.js";import"./alert-dialog-B9G0eJ9-.js";import"./toolbar-DI-Q6oWY.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-DDBFrRVD.js";import"./use-registry-connections-B--YAga1.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BNXibmKi.js";import"./connection-form-helpers-B7chcMcT.js";import"./collection-tabs-DySS3fYR.js";import"./badge-ClnYkgjJ.js";import"./select-model-DQDGLP7u.js";import"./checkbox-CpYf9_vX.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BgUHQSVM.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DGy4iLtW.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-CamUh6kt.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-BqOdulae.js";import"./use-debounced-autosave-D3rcIunV.js";import"./index-m3kwuU8_.js";import"./search-input-D80HsBNG.js";import"./switch-g5eZwQWn.js";import"./use-secrets-DWxO4tT-.js";import"./useQueries-CC6kPLN8.js";import"./use-file-configs-Cyy8AsxM.js";import"./automation-list-row-B6zoK1J4.js";function Pt(l,t){const p=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),u=/^[A-Za-z]/.test(p)&&p.length>0?p:"Section",n=wt(t,u);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Ar(l){const t=gt.c(80),{orgSlug:p,virtualMcpId:u,branch:n,blockKey:i,block:c,meta:m,decofile:d,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=l,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,s=yt(),b=typeof c?.__resolveType=="string"?c.__resolveType:"";let R;t[0]!==G||t[1]!==m||t[2]!==b?(R=Et(b,m,G),t[0]=G,t[1]=m,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==c||t[7]!==i||t[8]!==m||t[9]!==Z?(K=Z??(c?Nt(i,c,m):i),t[6]=c,t[7]=i,t[8]=m,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==n||t[12]!==p||t[13]!==u?(T={orgSlug:p,virtualMcpId:u,branch:n},t[11]=n,t[12]=p,t[13]=u,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==n||t[16]!==p||t[17]!==u?(F={orgSlug:p,virtualMcpId:u,branch:n},t[15]=n,t[16]=p,t[17]=u,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(i),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[a,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==i&&(bt(i),dt(null),ft(zt),ut([]));let z;t[22]!==c?(z=c??{},t[22]=c,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==i||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(i,{...r,__resolveType:b})},t[29]=i,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==d||t[35]!==W||t[36]!==Y||t[37]!==s?(L=async(e,r)=>{try{const{blockKey:f,data:N}=Pt(e,d);await Y.mutateAsync({blockKey:f,data:N}),xt.success(s("sandbox.appEditor.createdSection",{name:f})),r({__resolveType:f}),W()}catch(f){const N=f,St=N instanceof Error?N.message:s("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=d,t[35]=W,t[36]=Y,t[37]=s,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,f=>{r(f),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==a||t[43]!==v?(H=a.length>0?[v,...a]:[],t[42]=a,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==a||t[46]!==E||t[47]!==s||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":s("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const f=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(a,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",f?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=a,t[46]=E,t[47]=s,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==i||t[56]!==a||t[57]!==d||t[58]!==st||t[59]!==ot||t[60]!==y||t[61]!==pt||t[62]!==Q||t[63]!==m||t[64]!==x||t[65]!==tt||t[66]!==h||t[67]!==J||t[68]!==s?(B=o.jsx(Bt,{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:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:a,onBreadcrumbChange:at,decofile:d,meta:m,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${ot}`):J?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"}),s("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("sandbox.appEditor.noEditableSchema")})})})}),t[55]=i,t[56]=a,t[57]=d,t[58]=st,t[59]=ot,t[60]=y,t[61]=pt,t[62]=Q,t[63]=m,t[64]=x,t[65]=tt,t[66]=h,t[67]=J,t[68]=s,t[69]=B):B=t[69];let A;t[70]!==rt||t[71]!==d||t[72]!==lt||t[73]!==m||t[74]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:m,decofile:d,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[70]=rt,t[71]=d,t[72]=lt,t[73]=m,t[74]=x,t[75]=A):A=t[75];let M;return t[76]!==j||t[77]!==B||t[78]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[76]=j,t[77]=B,t[78]=A,t[79]=M):M=t[79],M}function Ot(l){return l+1}function zt(l){return l+1}export{Ar as AppEditor};
|
|
1
|
+
import{c as gt,b as yt,r as w,j as o,m as kt,k as _t,t as xt}from"./index-DptGhhs0.js";import{i as jt}from"./ChevronRight-Bb4Md-MD.js";import{l as Bt}from"./automation-runs-DChno1Ee.js";import{A as At}from"./add-section-modal-D_hcTQ7N.js";import{A as wt,B as Et,C as Nt,D as Rt,F as Ct,G as Kt,S as Tt,H as Ft,I as $t}from"./index-CfVmXxnZ.js";import"./select-j9WEM8Sh.js";import"./tooltip-CETnd3ay.js";import"./Check-CgsRhHy8.js";import"./ChevronDown-Wb4xUAM2.js";import"./ChevronUp-Bsb-Y77Y.js";import"./useInfiniteQuery-BIuIIh4Y.js";import"./use-infinite-scroll-CK3Uizc8.js";import"./use-connection-BMokl4CO.js";import"./use-mcp-client-C7paE-cE.js";import"./auth-D-uIp2CQ.js";import"./use-virtual-mcp-Bdv0Gghv.js";import"./card-Dv8gN6wM.js";import"./sidebar-DYUk0Bcn.js";import"./LayoutLeft-m1wg28yS.js";import"./use-mobile-CYh3EGEt.js";import"./X-BM44NliR.js";import"./table-B1o0Pwj4.js";import"./empty-state-BOcwt_Pf.js";import"./use-members-BuBLbPW8.js";import"./use-org-auth-client-CsKd0mpo.js";import"./use-clock-tick-B9BJ0pwX.js";import"./AlertCircle-CUqW_w6g.js";import"./CheckCircle-VXm1pD5i.js";import"./DotsVertical-Do26-QjL.js";import"./agent-icon-CSidaJ6B.js";import"./Tool01-CTroi0ek.js";import"./ArrowUp-C7ToAohd.js";import"./Settings02-DqYJFs_A.js";import"./Tool02-Bh88tYGs.js";import"./XCircle-UQVfZTIm.js";import"./ArrowUpRight-Ctd2GOR9.js";import"./TrendUp01-Bqs7ykt4.js";import"./ZapSquare-Cp9irGGl.js";import"./Users03-23U4ny0D.js";import"./Stars02-DnbvYkKU.js";import"./Copy01-DZd32DIO.js";import"./CpuChip01-BPw4omKe.js";import"./Eye-B22W8AyK.js";import"./FilterLines-Bc1kxraS.js";import"./Star01-sYD82Np9.js";import"./Palette-BEUtyKuF.js";import"./SwitchHorizontal01-BnpMv-f4.js";import"./HardDrive-BUNzYRdb.js";import"./Key01-CG1NND7T.js";import"./LinkExternal01-BHdYJ4vg.js";import"./LogOut01-CTki1bzq.js";import"./Monitor01-DcyY807V.js";import"./Sun-tw8Adw2s.js";import"./Play-DrITqLDw.js";import"./Plus-BmYOuiAj.js";import"./SearchLg-Brn3yddB.js";import"./SearchMd-h05KKMiS.js";import"./Shield01-BGuTNf8w.js";import"./Stars01-CfCAp21f.js";import"./Trash01-B8ymhEo_.js";import"./Upload01-CRF4bF0L.js";import"./User01-BMMY0J4X.js";import"./Users01-Co3nN3tw.js";import"./XClose-Beh-B9Gb.js";import"./Zap-BuelQrvQ.js";import"./use-automations-DhjGDNZK.js";import"./studio-tools-Dz4porfg.js";import"./useSuspenseInfiniteQuery-TLdwTHtB.js";import"./avatar-BumNKk7X.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Be1Kjd_w.js";import"./calendar-DMZ7yz5j.js";import"./dialog-D4l4Xdsp.js";import"./tab-id-swDgZMnB.js";import"./hooks-BkWYCTuM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-NjFnhgvn.js";import"./chat-context-D2jz7TPk.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-gi5xr2mP.js";import"./use-decopilot-events-CEPq_dZU.js";import"./use-organization-settings-MkvwyFUq.js";import"./monaco-editor-CVT6PsIN.js";import"./spinner-DEsDb5EQ.js";import"./index-yBY16i4r.js";import"./shell-layout-Qdn6Ab14.js";import"./required-auth-layout-PejcRLRr.js";import"./use-org-sso-CCq7sZnB.js";import"./integration-icon-BuPK5TYy.js";import"./use-navigate-to-agent-Bqz6pwLi.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-Bm75VTUe.js";import"./form-DMrBv8ot.js";import"./label-CuF09Kzu.js";import"./input-zj8m7n84.js";import"./drawer-C3pYai9a.js";import"./collection-search-CclDfE5O.js";import"./index-NXIL8Ow6.js";import"./get-initials-D-f_fDFw.js";import"./popover-Bt8NA7TT.js";import"./dropdown-menu-Q--ZyLLW.js";import"./github-repo-picker-Bw5gD-qj.js";import"./use-debounced-value-B-JvHFEo.js";import"./authenticate-and-persist-oauth-DObbFBl5.js";import"./mcp-oauth-shlK2GTY.js";import"./use-mcp-tools-DS7HyfmS.js";import"./extract-connection-data-Df7SJj9F.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CAXumITS.js";import"./use-tags-BDVrYGwL.js";import"./skeleton--88gs_EO.js";import"./command-Bjp1VURS.js";import"./index-DBssoMSm.js";import"./companions-core-BDbmsLM0.js";import"./tabs-VUaZhlmm.js";import"./toggle-group-BsLp02VA.js";import"./use-deco-credits-UciEpjbi.js";import"./alert-dialog-FVJZWl26.js";import"./toolbar-B5h5oyq6.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-HFSstqIJ.js";import"./use-registry-connections-YnGGDwWM.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-Bs8WvAl6.js";import"./connection-form-helpers-CKgaIsD-.js";import"./collection-tabs-B0dT6Ygy.js";import"./badge-BFv5PsKE.js";import"./select-model-C8d0poms.js";import"./checkbox-B5fS-ChG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-fm3Mm6Bm.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CyFcW6V5.js";import"./deco-site-production-url-CaKZ7xBn.js";import"./use-capability-BqS7iGUH.js";import"./pt-BR-CLy76QW2.js";import"./use-mcp-auth-status-h3xamCXm.js";import"./use-debounced-autosave-D0IOAPSF.js";import"./index-DIkj5DIc.js";import"./search-input-Bf_CjAux.js";import"./switch-CjtCOM9l.js";import"./use-secrets-HEeF0D3f.js";import"./useQueries-Bq9KgQR-.js";import"./use-file-configs-I7iEol3j.js";import"./automation-list-row-DMeZ0lJ3.js";function Pt(l,t){const p=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),u=/^[A-Za-z]/.test(p)&&p.length>0?p:"Section",n=wt(t,u);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Ar(l){const t=gt.c(80),{orgSlug:p,virtualMcpId:u,branch:n,blockKey:i,block:c,meta:m,decofile:d,title:Z,excludeFields:G,schemaPending:nt,previewBaseUrl:ct}=l,J=nt===void 0?!1:nt,x=ct===void 0?null:ct,s=yt(),b=typeof c?.__resolveType=="string"?c.__resolveType:"";let R;t[0]!==G||t[1]!==m||t[2]!==b?(R=Et(b,m,G),t[0]=G,t[1]=m,t[2]=b,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const Q=C;let K;t[6]!==c||t[7]!==i||t[8]!==m||t[9]!==Z?(K=Z??(c?Nt(i,c,m):i),t[6]=c,t[7]=i,t[8]=m,t[9]=Z,t[10]=K):K=t[10];const v=K;let T;t[11]!==n||t[12]!==p||t[13]!==u?(T={orgSlug:p,virtualMcpId:u,branch:n},t[11]=n,t[12]=p,t[13]=u,t[14]=T):T=t[14];const{save:S,flush:W,isPending:X}=Rt(T);let F;t[15]!==n||t[16]!==p||t[17]!==u?(F={orgSlug:p,virtualMcpId:u,branch:n},t[15]=n,t[16]=p,t[17]=u,t[18]=F):F=t[18];const Y=Ct(F);let $;t[19]!==S?($=Ft((e,r)=>S(e,r)),t[19]=S,t[20]=$):$=t[20];const tt=$,[ht,bt]=w.useState(i),[et,dt]=w.useState(null),[ot,ft]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[a,ut]=w.useState(P),[rt,it]=w.useState(!1),O=w.useRef(null);ht!==i&&(bt(i),dt(null),ft(zt),ut([]));let z;t[22]!==c?(z=c??{},t[22]=c,t[23]=z):z=t[23];const mt=z;let g;t[24]!==et?(g=et??{},t[24]=et,t[25]=g):g=t[25];let I;t[26]!==mt||t[27]!==g?(I={...mt,...g},t[26]=mt,t[27]=g,t[28]=I):I=t[28];const st=I;let V;t[29]!==i||t[30]!==b||t[31]!==S?(V=e=>{const r=e;dt(r),S(i,{...r,__resolveType:b})},t[29]=i,t[30]=b,t[31]=S,t[32]=V):V=t[32];const pt=V;let q;t[33]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{ut(e)},t[33]=q):q=t[33];const at=q;let L;t[34]!==d||t[35]!==W||t[36]!==Y||t[37]!==s?(L=async(e,r)=>{try{const{blockKey:f,data:N}=Pt(e,d);await Y.mutateAsync({blockKey:f,data:N}),xt.success(s("sandbox.appEditor.createdSection",{name:f})),r({__resolveType:f}),W()}catch(f){const N=f,St=N instanceof Error?N.message:s("sandbox.appEditor.failedAddSection");throw xt.error(St),N}},t[34]=d,t[35]=W,t[36]=Y,t[37]=s,t[38]=L):L=t[38];const y=L;let U;t[39]===Symbol.for("react.memo_cache_sentinel")?(U=e=>{O.current=e.append,it(!0)},t[39]=U):U=t[39];const vt=U;let D;t[40]!==y?(D=async e=>{const r=O.current;if(r)try{await y(e,f=>{r(f),it(!1),O.current=null})}catch{}},t[40]=y,t[41]=D):D=t[41];const lt=D;let H;t[42]!==a||t[43]!==v?(H=a.length>0?[v,...a]:[],t[42]=a,t[43]=v,t[44]=H):H=t[44];const E=H;let k;t[45]!==a||t[46]!==E||t[47]!==s||t[48]!==v?(k=E.length>0?o.jsx("nav",{"aria-label":s("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:E.map((e,r)=>{const f=r===E.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{at(r===0?[]:Kt(a,r)),ft(Ot)},title:e,className:kt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",f?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[45]=a,t[46]=E,t[47]=s,t[48]=v,t[49]=k):k=t[49];let _;t[50]!==X?(_=o.jsx($t,{isPending:X,isError:!1}),t[50]=X,t[51]=_):_=t[51];let j;t[52]!==k||t[53]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[k,_]}),t[52]=k,t[53]=_,t[54]=j):j=t[54];let B;t[55]!==i||t[56]!==a||t[57]!==d||t[58]!==st||t[59]!==ot||t[60]!==y||t[61]!==pt||t[62]!==Q||t[63]!==m||t[64]!==x||t[65]!==tt||t[66]!==h||t[67]!==J||t[68]!==s?(B=o.jsx(Bt,{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:Q?o.jsx(Tt,{schema:h,value:st,onChange:pt,basePath:"",breadcrumbPath:a,onBreadcrumbChange:at,decofile:d,meta:m,onSaveReferencedBlock:tt,previewBaseUrl:x,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${ot}`):J?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"}),s("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:s("sandbox.appEditor.noEditableSchema")})})})}),t[55]=i,t[56]=a,t[57]=d,t[58]=st,t[59]=ot,t[60]=y,t[61]=pt,t[62]=Q,t[63]=m,t[64]=x,t[65]=tt,t[66]=h,t[67]=J,t[68]=s,t[69]=B):B=t[69];let A;t[70]!==rt||t[71]!==d||t[72]!==lt||t[73]!==m||t[74]!==x?(A=x&&o.jsx(At,{open:rt,onOpenChange:e=>{it(e),e||(O.current=null)},meta:m,decofile:d,previewBaseUrl:x,onSelect:e=>{lt(e)}}),t[70]=rt,t[71]=d,t[72]=lt,t[73]=m,t[74]=x,t[75]=A):A=t[75];let M;return t[76]!==j||t[77]!==B||t[78]!==A?(M=o.jsxs("div",{className:"flex h-full flex-col",children:[j,B,A]}),t[76]=j,t[77]=B,t[78]=A,t[79]=M):M=t[79],M}function Ot(l){return l+1}function zt(l){return l+1}export{Ar as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cG as v,cH as $,cI as W,cJ as L,cK as H,cL as D,cM as V,cN as x,cO as q,cP as j,cQ as y,cR as N,cS as B,cT as Z,cU as F}from"./index-bSjz3FLt.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await 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 k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl: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 F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{cG as v,cH as $,cI as W,cJ as L,cK as H,cL as D,cM as V,cN as x,cO as q,cP as j,cQ as y,cR as N,cS as B,cT as Z,cU as F}from"./index-DptGhhs0.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await 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 k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl: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 F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-
|
|
1
|
+
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-DptGhhs0.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};
|