decocms 4.217.13 → 4.217.14
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-0OUPWUNo.js → AlertCircle-CEGqDvaA.js} +1 -1
- package/dist/client/assets/{AreaChart-BKcNvqGV.js → AreaChart-rNtuKWY8.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CcZIvmNQ.js → ArrowLeft-D-GaGLbo.js} +1 -1
- package/dist/client/assets/{ArrowUp-CNifCRwW.js → ArrowUp-DazHjV8x.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CHr_jXVV.js → ArrowUpRight-DNskIx7Q.js} +1 -1
- package/dist/client/assets/{Check-YqNpUnjS.js → Check-B8suwSr9.js} +1 -1
- package/dist/client/assets/{CheckCircle-HA9HSubF.js → CheckCircle-DObEUtRu.js} +1 -1
- package/dist/client/assets/{ChevronDown-BX2HgupK.js → ChevronDown-C6kSK4xi.js} +1 -1
- package/dist/client/assets/{ChevronRight-kdKaq9Ii.js → ChevronRight-BIidR9SM.js} +1 -1
- package/dist/client/assets/{ChevronUp-J2R9ILOH.js → ChevronUp-DHnR36Wm.js} +1 -1
- package/dist/client/assets/{Copy01-Bm8H5mLb.js → Copy01-C9sG-6D6.js} +1 -1
- package/dist/client/assets/{CpuChip01-DgkecjAs.js → CpuChip01-C6R2c7cp.js} +1 -1
- package/dist/client/assets/{CreditCard01-f8B5Wkqh.js → CreditCard01-sjHzWu4n.js} +1 -1
- package/dist/client/assets/{DotsVertical-Cz5ElmDn.js → DotsVertical-DVg_Pbm_.js} +1 -1
- package/dist/client/assets/{Eye-CaOR6o-h.js → Eye-B0s0rmgv.js} +1 -1
- package/dist/client/assets/{FilterLines-CU3G94q8.js → FilterLines-xbs5S3Vb.js} +1 -1
- package/dist/client/assets/{Globe01-BAit6vQe.js → Globe01-_I5Gee5_.js} +1 -1
- package/dist/client/assets/{Globe04-DOMcqhEH.js → Globe04-p6Pq1FLe.js} +1 -1
- package/dist/client/assets/{HardDrive-CGleOs63.js → HardDrive-BX_FsVnA.js} +1 -1
- package/dist/client/assets/{Key01-DE0cHxdc.js → Key01-kW6GScFx.js} +1 -1
- package/dist/client/assets/{LayoutLeft-B3Xq6Q9F.js → LayoutLeft-B8TJ15_W.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CtVhb7np.js → LinkExternal01-Dqas4G6a.js} +1 -1
- package/dist/client/assets/{LogOut01-pEbmO0Np.js → LogOut01-C6waAPKc.js} +1 -1
- package/dist/client/assets/{Monitor01-DDxK-vql.js → Monitor01-BJd3P9Bs.js} +1 -1
- package/dist/client/assets/{Palette-BdM6u7AM.js → Palette-CVUGmkcJ.js} +1 -1
- package/dist/client/assets/{Play-IbqcJdN3.js → Play-D6P4Qt3H.js} +1 -1
- package/dist/client/assets/{Plus-BXW-bLkv.js → Plus-Cuw6ld9s.js} +1 -1
- package/dist/client/assets/{SearchLg-L_ta90AC.js → SearchLg-CvmvPTNH.js} +1 -1
- package/dist/client/assets/{SearchMd-B1jAF5PX.js → SearchMd-BPfugAIu.js} +1 -1
- package/dist/client/assets/{Settings02-D8A1C3JO.js → Settings02-D9mUVp_d.js} +1 -1
- package/dist/client/assets/{Share07-BVdvoyk4.js → Share07-C3qW0KvP.js} +1 -1
- package/dist/client/assets/{Shield01-D2H3k2fO.js → Shield01-BuqzbXhN.js} +1 -1
- package/dist/client/assets/{Star01-Dk3FFpxM.js → Star01-itSgb7DF.js} +1 -1
- package/dist/client/assets/{Stars01-ndnSTODt.js → Stars01-04iBWvYW.js} +1 -1
- package/dist/client/assets/{Stars02-D49Mvriv.js → Stars02-D3OSImoU.js} +1 -1
- package/dist/client/assets/{Sun-BZWpsJUV.js → Sun-fnvHykt1.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B0vjSREj.js → SwitchHorizontal01-Di19iqO8.js} +1 -1
- package/dist/client/assets/{Tool01-BK3Hfpvm.js → Tool01-n6deJtHB.js} +1 -1
- package/dist/client/assets/{Tool02-gKszIrtU.js → Tool02-ChBe855x.js} +1 -1
- package/dist/client/assets/{Trash01-BSXuR-v0.js → Trash01-BysA7V0F.js} +1 -1
- package/dist/client/assets/{TrendUp01-D4y32I70.js → TrendUp01-BhChTRyL.js} +1 -1
- package/dist/client/assets/{Upload01-nh4tHrH4.js → Upload01-Y2mazRed.js} +1 -1
- package/dist/client/assets/{User01-XKHS0Yi2.js → User01-BvPxxSqY.js} +1 -1
- package/dist/client/assets/{Users01-tFQvWfNL.js → Users01-ChDlVjp-.js} +1 -1
- package/dist/client/assets/{Users03-DEaDNrbw.js → Users03-C7g8VOdi.js} +1 -1
- package/dist/client/assets/{X-B1FpD19v.js → X-Bb9AvrlL.js} +1 -1
- package/dist/client/assets/{XCircle-CT6qobjT.js → XCircle-J5pnVl1i.js} +1 -1
- package/dist/client/assets/{XClose-CnW8TKsr.js → XClose-BQLeCToC.js} +1 -1
- package/dist/client/assets/{Zap-CAz1ejRf.js → Zap-B30ko8EF.js} +1 -1
- package/dist/client/assets/{ZapSquare-C7FTkjlS.js → ZapSquare-D28-LH7C.js} +1 -1
- package/dist/client/assets/{access-gate-BUqNYnUF.js → access-gate-DBwhIB9O.js} +1 -1
- package/dist/client/assets/{agent-icon-ivyach6Y.js → agent-icon-s6_qyUu1.js} +1 -1
- package/dist/client/assets/{agents-list-BD8HMFlr.js → agents-list-BIqOwdsn.js} +1 -1
- package/dist/client/assets/{ai-providers-CLkRw_xJ.js → ai-providers-H4mb24A6.js} +1 -1
- package/dist/client/assets/{alert-JiyNNqe_.js → alert-DzZkeGZS.js} +1 -1
- package/dist/client/assets/{alert-dialog-BtRTtbG0.js → alert-dialog-DC6Lplgx.js} +1 -1
- package/dist/client/assets/{api-keys-DpqcfGrn.js → api-keys-Cax5K7wk.js} +1 -1
- package/dist/client/assets/{app-editor-BUsapCBQ.js → app-editor-qAsv6qqG.js} +1 -1
- package/dist/client/assets/{auth-BxRabvv-.js → auth-B_fsW_pO.js} +1 -1
- package/dist/client/assets/{auth-catchall-Cs7ipMDJ.js → auth-catchall-s1CXHbJH.js} +1 -1
- package/dist/client/assets/{auth-entry-Db5e2aY_.js → auth-entry-CNHAV1Br.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Du-8m3RM.js → auth-split-layout-J_umNggt.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DH2xTiqE.js → authenticate-and-persist-oauth-C5hTKLZu.js} +1 -1
- package/dist/client/assets/{automation-list-row-D0gz_UHt.js → automation-list-row-CdL9Bcdo.js} +1 -1
- package/dist/client/assets/{automation-runs-B9PPWxz2.js → automation-runs-BMnosc0O.js} +1 -1
- package/dist/client/assets/{automations-B77Ef8pJ.js → automations-amKzeO-u.js} +1 -1
- package/dist/client/assets/{avatar-BxOwauBx.js → avatar-Cen-fEa-.js} +1 -1
- package/dist/client/assets/{badge-YeCL-pM6.js → badge-Cf8TI2On.js} +1 -1
- package/dist/client/assets/{billing-LBD_HGMi.js → billing-DQSelg4x.js} +1 -1
- package/dist/client/assets/{block-document-Dwn6SQky.js → block-document-BC_10-SY.js} +1 -1
- package/dist/client/assets/{brand-context-B5zJkNnY.js → brand-context-CfH1CgID.js} +1 -1
- package/dist/client/assets/{buckets-BnUKsEzp.js → buckets-CYFjRu-Z.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DTyd9WI7.js → bulk-category-panel-zETDvhPN.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bl4HXrb5.js → capability-load-error-5XD0Oq4g.js} +1 -1
- package/dist/client/assets/{card-BgLseUz9.js → card-bfZkFKGg.js} +1 -1
- package/dist/client/assets/{cards-nVim6xBl.js → cards-BhMv0YTc.js} +1 -1
- package/dist/client/assets/{category-editor-DsDVl13L.js → category-editor-BepLapvY.js} +1 -1
- package/dist/client/assets/{chat-context-DtiyxjXg.js → chat-context-CViMhULY.js} +1 -1
- package/dist/client/assets/{checkbox-DtxWa1Lp.js → checkbox-BiqXdTZP.js} +1 -1
- package/dist/client/assets/{cli-auth-success-D7_d7B6d.js → cli-auth-success-BJsuzA-1.js} +1 -1
- package/dist/client/assets/{collection-detail-BsnNHZuj.js → collection-detail-BV5oizjn.js} +1 -1
- package/dist/client/assets/{collection-display-button-o9rgPX4h.js → collection-display-button-BaoilCj7.js} +1 -1
- package/dist/client/assets/{collection-search-C5R8jkCo.js → collection-search-UbWH5VZy.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-prfaJL6p.js → collection-table-wrapper-CbDiYvna.js} +1 -1
- package/dist/client/assets/{collection-tabs-CCbVGHLG.js → collection-tabs-B-UVnRIT.js} +1 -1
- package/dist/client/assets/{command-BweZE9r1.js → command-DrNiVNR3.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-D86hui_V.js → commerce-onboarding-OCLqANIK.js} +1 -1
- package/dist/client/assets/{connect-C9Mordhu.js → connect-d2UX1k7O.js} +1 -1
- package/dist/client/assets/{connection-BHMqqEr8.js → connection-DRNSQbMi.js} +1 -1
- package/dist/client/assets/{connection-card-B7NQUqWh.js → connection-card-C9SeUY5z.js} +1 -1
- package/dist/client/assets/{connection-detail-BRAl0ckH.js → connection-detail-s7jjmM9f.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-ZRhzxhfS.js → connection-form-helpers-CZF0KXDA.js} +1 -1
- package/dist/client/assets/{connections-DpqEid10.js → connections-CcNHjVc2.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BwUtRq_o.js → decopilot-sse-pool-H9DQ4gY8.js} +1 -1
- package/dist/client/assets/{dialog-DsCqITds.js → dialog-f2gIoJyo.js} +1 -1
- package/dist/client/assets/{domain-settings-D-pog2VX.js → domain-settings-CuovgRAH.js} +1 -1
- package/dist/client/assets/{drawer-CWuptb6-.js → drawer-BM7WsZWa.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CkysSdXs.js → dropdown-menu-CkRaLL_n.js} +1 -1
- package/dist/client/assets/{empty-state-HwZPqFUt.js → empty-state-6Ei3fC_M.js} +1 -1
- package/dist/client/assets/{extract-connection-data-XyQY0B73.js → extract-connection-data-Dwb0cyv5.js} +1 -1
- package/dist/client/assets/{file-explorer-BYizn1JB.js → file-explorer-BFXhO0OE.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cqwaa-8d.js → file-type-icon-CicLZ25Q.js} +1 -1
- package/dist/client/assets/{form-C5LT36jD.js → form-BfQ5_Xev.js} +1 -1
- package/dist/client/assets/{general-jy9ogNyA.js → general-DZz1BiAH.js} +1 -1
- package/dist/client/assets/{github-repo-picker-UNa4kaK1.js → github-repo-picker-8yIoQVfR.js} +1 -1
- package/dist/client/assets/{hooks-DoEly3LT.js → hooks-IaMFwizq.js} +1 -1
- package/dist/client/assets/{index-B6bkuuby.js → index-6A0kQsfc.js} +1 -1
- package/dist/client/assets/{index-CD1X_eW5.js → index-AtVn8mi0.js} +1 -1
- package/dist/client/assets/{index-uoMzVpNH.js → index-BJ8bMiZH.js} +1 -1
- package/dist/client/assets/{index-wqhKYY5M.js → index-BtGXwuiz.js} +1 -1
- package/dist/client/assets/{index-BQO3LZFM.js → index-D9iRNBXx.js} +1 -1
- package/dist/client/assets/{index-6TRi0uef.js → index-DUWa0kTK.js} +1 -1
- package/dist/client/assets/{index-CxV3B-5l.js → index-DyBmgM84.js} +4 -4
- package/dist/client/assets/{index-HWhUkMVs.js → index-GPtGFYbO.js} +3 -3
- package/dist/client/assets/{index-DC1l1OL-.js → index-ZrFL84cc.js} +1 -1
- package/dist/client/assets/{index-Cb7hCoS-.js → index-diZVRqpE.js} +1 -1
- package/dist/client/assets/{index-redirect-BoS6Qpc-.js → index-redirect-DRzVUZWo.js} +1 -1
- package/dist/client/assets/{input-CDxc4QX0.js → input-C4kw1M0o.js} +1 -1
- package/dist/client/assets/{integration-icon-CtS0uJhZ.js → integration-icon-DrUXWgOf.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-vJbHGv59.js → invite-member-dialog-Dn-nY7b9.js} +1 -1
- package/dist/client/assets/{label-CZbP70z-.js → label-DCGTT-Xz.js} +1 -1
- package/dist/client/assets/{layout-DqMTePyh.js → layout-DDe9VzmF.js} +1 -1
- package/dist/client/assets/{login-Cajnb4aP.js → login-D6N8YGTw.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DKoInR_S.js → mcp-oauth-DYN1bOv6.js} +1 -1
- package/dist/client/assets/{members-SjX1OUIT.js → members-D4U8HZ8h.js} +1 -1
- package/dist/client/assets/{monaco-editor-8vQ4bsg1.js → monaco-editor-C4i3AQCg.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DCubd6zO.js → monitoring-stats-row-B7ErD4Tf.js} +1 -1
- package/dist/client/assets/{multi-select-CP76ESrQ.js → multi-select-mR66j8Sr.js} +1 -1
- package/dist/client/assets/{oauth-callback-BRJVac2a.js → oauth-callback-CJiOPjAt.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DwlNDTj-.js → oauth-callback-ai-provider-CCITL_nC.js} +1 -1
- package/dist/client/assets/{onboarding-DN4soHuD.js → onboarding-BvNyPibN.js} +1 -1
- package/dist/client/assets/{org-layout-7FmNBUHk.js → org-layout-D5qHW3da.js} +1 -1
- package/dist/client/assets/{organization-choice-DditNfue.js → organization-choice-BkfJzZK6.js} +1 -1
- package/dist/client/assets/{orgs-C8FbFzrk.js → orgs-DBOtBeOr.js} +1 -1
- package/dist/client/assets/{page-seo-form-q36UjJko.js → page-seo-form-_B8ARCX_.js} +1 -1
- package/dist/client/assets/{popover-CnbRVVJ4.js → popover-BVzFNm24.js} +1 -1
- package/dist/client/assets/{post-editor-CsgQrDnJ.js → post-editor-DxciAkdF.js} +1 -1
- package/dist/client/assets/{primitives-D7u08cAb.js → primitives-BJpIBKy4.js} +1 -1
- package/dist/client/assets/{profile-DjaGLDcj.js → profile-D5Dpkxk9.js} +1 -1
- package/dist/client/assets/{project-app-view-DlvKMam_.js → project-app-view-AbNqnhsW.js} +1 -1
- package/dist/client/assets/record-editor-DnV-f_3E.js +1 -0
- package/dist/client/assets/redirect-editor-B5R2cIbh.js +1 -0
- package/dist/client/assets/registry-BM82mflG.js +2 -0
- package/dist/client/assets/{registry-layout-CQILIy3B.js → registry-layout-ChKu7vVg.js} +1 -1
- package/dist/client/assets/{reports-4WwZo7l5.js → reports-B5HmQreI.js} +2 -2
- package/dist/client/assets/{require-capability-V2e0LU3P.js → require-capability-CPhtITFk.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cdi-946f.js → required-auth-layout-CMXSrbVh.js} +1 -1
- package/dist/client/assets/{reset-password-Daf0ERPq.js → reset-password-Cc2GeSl_.js} +1 -1
- package/dist/client/assets/{roles-D5WQ-8A7.js → roles-BxCqnDDZ.js} +1 -1
- package/dist/client/assets/{search-input-DmFmc4FA.js → search-input-BQvnJ7ie.js} +1 -1
- package/dist/client/assets/{secrets-Dp7mvwc3.js → secrets-CkJM5pHd.js} +1 -1
- package/dist/client/assets/{sections-editor-D9g5CKfD.js → sections-editor-CtptmgzO.js} +1 -1
- package/dist/client/assets/{select-D3htjNBx.js → select-DCUthKzq.js} +1 -1
- package/dist/client/assets/{select-model-DQpQr2DQ.js → select-model-CAkcqYBe.js} +1 -1
- package/dist/client/assets/{self-tool-result-Ces-0lJd.js → self-tool-result-BnIQca-t.js} +1 -1
- package/dist/client/assets/{seo-editor-DpR_FVvo.js → seo-editor-W-be-pOE.js} +1 -1
- package/dist/client/assets/{settings-layout-Be7ozVBR.js → settings-layout-uM_v5UZP.js} +1 -1
- package/dist/client/assets/{settings-section-DzETP_0_.js → settings-section-CAbLKYDo.js} +1 -1
- package/dist/client/assets/{shell-controls-D7-dloPl.js → shell-controls-BbaCDCTk.js} +1 -1
- package/dist/client/assets/{shell-layout-CzKlLa8f.js → shell-layout-B6xqx3ks.js} +1 -1
- package/dist/client/assets/{sidebar-DbMpr-rh.js → sidebar-BKLfDbJN.js} +1 -1
- package/dist/client/assets/{skeleton-Y7gyZPrn.js → skeleton-E7dM1cU6.js} +1 -1
- package/dist/client/assets/{spinner-CMWgEkOv.js → spinner-BKYiVvRF.js} +1 -1
- package/dist/client/assets/{sso-pOrWsTkM.js → sso-CTp57qTl.js} +1 -1
- package/dist/client/assets/{store-u2l_1WH6.js → store-BtDmLKWJ.js} +1 -1
- package/dist/client/assets/store-registry-AVNiISOY.js +2 -0
- package/dist/client/assets/{studio-tools-whdp8gFV.js → studio-tools-BDRk_Gqu.js} +1 -1
- package/dist/client/assets/{switch-b6594rNl.js → switch-DHdf9bGS.js} +1 -1
- package/dist/client/assets/{synced-repos-DBzAs0pB.js → synced-repos-DHvd4DNO.js} +1 -1
- package/dist/client/assets/{tab-id-fxY7FqYq.js → tab-id-BiJME16N.js} +1 -1
- package/dist/client/assets/{table-Bieg1GxH.js → table-D0OjjXFn.js} +1 -1
- package/dist/client/assets/{tabs-D4B8_rLi.js → tabs-DezkOYP4.js} +1 -1
- package/dist/client/assets/{textarea-CXh3iKjW.js → textarea-BltiOv6V.js} +1 -1
- package/dist/client/assets/{toggle-group-CBptT1rM.js → toggle-group-DhBiPEmR.js} +1 -1
- package/dist/client/assets/{toolbar-BI3FThik.js → toolbar-ANRXiQzU.js} +1 -1
- package/dist/client/assets/{tooltip-DO91iaPZ.js → tooltip-Btz0jJUy.js} +1 -1
- package/dist/client/assets/{track-CY-fnB6q.js → track-CM-gFNzg.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Dfw1C_Qb.js → use-ai-providers-a-L8T3uD.js} +1 -1
- package/dist/client/assets/{use-api-keys-D0_X5TBd.js → use-api-keys-DwiRAhRw.js} +1 -1
- package/dist/client/assets/{use-automations-Y3CwRy47.js → use-automations-CR14JUIv.js} +1 -1
- package/dist/client/assets/{use-autosave-DwrF0hri.js → use-autosave-2cJHdPpV.js} +1 -1
- package/dist/client/assets/{use-capability-hVyOyKfv.js → use-capability-7E41d664.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CttCxR3S.js → use-clock-tick-CcVpPjly.js} +1 -1
- package/dist/client/assets/{use-connection-B24S3YCN.js → use-connection-_5ysFy7m.js} +1 -1
- package/dist/client/assets/{use-copy-BNHHpgOS.js → use-copy-OBJePWyp.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-B4-JNTOi.js → use-create-virtual-mcp-CJZL5OXt.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CrvyuS1z.js → use-debounced-autosave-zC-uauJa.js} +1 -1
- package/dist/client/assets/{use-debounced-value-P_5pUA9W.js → use-debounced-value-CgunDIm8.js} +1 -1
- package/dist/client/assets/{use-deco-credits-5oBMNAq-.js → use-deco-credits-C4n4jHC3.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-LcKd19eo.js → use-decopilot-events-eIVvjBw7.js} +1 -1
- package/dist/client/assets/{use-delete-connection-YreJg1bm.js → use-delete-connection-B4-A3kiZ.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BHP-geVv.js → use-deployment-admin-SQnVkdAY.js} +1 -1
- package/dist/client/assets/{use-file-configs-CPONQlYc.js → use-file-configs-D9uM3Pg0.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CBy2t19Z.js → use-infinite-scroll-Bx6Dv81T.js} +1 -1
- package/dist/client/assets/{use-join-requests-atODS-UJ.js → use-join-requests-EtqBkha1.js} +1 -1
- package/dist/client/assets/{use-mcp-client-WNkI8KAJ.js → use-mcp-client-B8hPaR2x.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BW_wQYIZ.js → use-mcp-tools-DxzHZCmj.js} +1 -1
- package/dist/client/assets/{use-members-smedIK7m.js → use-members-caI7LoqI.js} +1 -1
- package/dist/client/assets/{use-mobile-nNGwbm7m.js → use-mobile-DoH3Zs0T.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-9y1G65Xj.js → use-navigate-to-agent-DzLLgouC.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-GphQa9pn.js → use-open-billing-url-93kNP1D3.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-uDIBUVH9.js → use-org-auth-client-BagXMda2.js} +1 -1
- package/dist/client/assets/{use-org-sso-DrOx8nh9.js → use-org-sso-Ck-Kjho-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DYd5AO4U.js → use-organization-roles-CtXbiqWt.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BJdrgwhq.js → use-organization-settings-JoyMX7--.js} +1 -1
- package/dist/client/assets/{use-registry-connections-ChaImRoz.js → use-registry-connections-BibtsFf-.js} +1 -1
- package/dist/client/assets/{use-secrets-Dl1vnLJJ.js → use-secrets-BX95LtsI.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BcBdEo4a.js → use-section-preview-base-BqSulPkL.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CRL_QHV0.js → use-status-sounds-CMvp4UmG.js} +1 -1
- package/dist/client/assets/{use-tags-4N4KBIBB.js → use-tags-U4CIg3SL.js} +1 -1
- package/dist/client/assets/{use-view-mode-Cuib_Qyk.js → use-view-mode-9vv-wVeZ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-uppMIhb1.js → use-virtual-mcp-Bo4QPAh_.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B4qPBAxY.js +1 -0
- package/dist/client/assets/{useRouterState-DMhgLsX7.js → useRouterState-B6Pq2isx.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-KfvQ1Xcr.js +1 -0
- package/dist/client/assets/{users-D_L2xQM5.js → users-BlIhHxql.js} +1 -1
- package/dist/client/assets/{variant-calendar-CqXsSQtn.js → variant-calendar-CfoMFSFl.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Bd7XGg_T.js → view-mode-toggle-CIT6nAQv.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/record-editor-B9tAoum2.js +0 -1
- package/dist/client/assets/redirect-editor-B0SRp5vj.js +0 -1
- package/dist/client/assets/registry-DMD5W51g.js +0 -2
- package/dist/client/assets/store-registry-D-qh_ccf.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BOShi_GX.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C2H3DSMn.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,b as me,j as o,v as Ae,t as le,B as ne,F as De,o as Ie,a as Le,r as X,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-HWhUkMVs.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-CkysSdXs.js";import{a as Ge}from"./Users03-DEaDNrbw.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-UNa4kaK1.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-uppMIhb1.js";import{P as ce}from"./index-6TRi0uef.js";import{a as Ue}from"./DotsVertical-Cz5ElmDn.js";import{A as Re,C as fe,aW as $e}from"./agent-icon-ivyach6Y.js";import{a as He}from"./Settings02-D8A1C3JO.js";import{s as Ve}from"./Trash01-BSXuR-v0.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as Se}from"./use-navigate-to-agent-9y1G65Xj.js";import{e as qe,h as Qe}from"./use-organization-settings-BJdrgwhq.js";import{u as _e}from"./use-capability-hVyOyKfv.js";import{C as Je}from"./card-BgLseUz9.js";import{E as Ye}from"./empty-state-HwZPqFUt.js";import{u as We}from"./use-create-virtual-mcp-B4-JNTOi.js";import{u as Xe}from"./use-connection-B24S3YCN.js";import{u as xe,S as Ze}from"./use-mcp-client-WNkI8KAJ.js";import{p as et,a as je}from"./deco-site-production-url-BjY4ZYd-.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-DsCqITds.js";import{i as dt}from"./ArrowLeft-CcZIvmNQ.js";import{C as ut}from"./collection-search-C5R8jkCo.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-BtRTtbG0.js";import{S as Dt}from"./search-input-DmFmc4FA.js";import{s as Ce}from"./Plus-BXW-bLkv.js";import"./Check-YqNpUnjS.js";import"./ChevronRight-kdKaq9Ii.js";import"./use-debounced-value-P_5pUA9W.js";import"./authenticate-and-persist-oauth-DH2xTiqE.js";import"./mcp-oauth-DKoInR_S.js";import"./auth-BxRabvv-.js";import"./LinkExternal01-CtVhb7np.js";import"./Share07-BVdvoyk4.js";import"./use-mcp-tools-BW_wQYIZ.js";import"./extract-connection-data-XyQY0B73.js";import"./metadata-dUsYcpuu.js";import"./sidebar-DbMpr-rh.js";import"./LayoutLeft-B3Xq6Q9F.js";import"./use-mobile-nNGwbm7m.js";import"./X-B1FpD19v.js";import"./tooltip-DO91iaPZ.js";import"./AlertCircle-0OUPWUNo.js";import"./Tool01-BK3Hfpvm.js";import"./ArrowUp-CNifCRwW.js";import"./Tool02-gKszIrtU.js";import"./XCircle-CT6qobjT.js";import"./ArrowUpRight-CHr_jXVV.js";import"./TrendUp01-D4y32I70.js";import"./ZapSquare-C7FTkjlS.js";import"./CheckCircle-HA9HSubF.js";import"./ChevronDown-BX2HgupK.js";import"./ChevronUp-J2R9ILOH.js";import"./Stars02-D49Mvriv.js";import"./Copy01-Bm8H5mLb.js";import"./CpuChip01-DgkecjAs.js";import"./CreditCard01-f8B5Wkqh.js";import"./Globe01-BAit6vQe.js";import"./Eye-CaOR6o-h.js";import"./FilterLines-CU3G94q8.js";import"./Star01-Dk3FFpxM.js";import"./Globe04-DOMcqhEH.js";import"./SwitchHorizontal01-B0vjSREj.js";import"./HardDrive-CGleOs63.js";import"./Key01-DE0cHxdc.js";import"./LogOut01-pEbmO0Np.js";import"./Monitor01-DDxK-vql.js";import"./Sun-BZWpsJUV.js";import"./Palette-BdM6u7AM.js";import"./Play-IbqcJdN3.js";import"./SearchLg-L_ta90AC.js";import"./SearchMd-B1jAF5PX.js";import"./Shield01-D2H3k2fO.js";import"./Stars01-ndnSTODt.js";import"./Upload01-nh4tHrH4.js";import"./User01-XKHS0Yi2.js";import"./Users01-tFQvWfNL.js";import"./XClose-CnW8TKsr.js";import"./Zap-CAz1ejRf.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-DoEly3LT.js";import"./decopilot-sse-pool-BwUtRq_o.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-whdp8gFV.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=Se(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?Ke:void 0,{mainAgentId:M}=qe(),d=Qe(),{granted:T}=_e("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ve,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=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]=N):N=e[40];let P;e[41]!==v||e[42]!==N?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,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]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,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 _;e[57]!==b?(_=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,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 St(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 _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(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 Nt(t){return ve(`/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=Se(),c=Ie(),{data:G}=Le.useSession(),[x,M]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(M(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||N.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=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 ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=Q.structuredContent??Q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:Z,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await J(),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 _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.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"&&S.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:[N.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})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ms(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=X.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=We(G),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=_e("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:Ne}=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:Ne}))}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 S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=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]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),_=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]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,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 J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=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 Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let R;t[53]!==e?(R=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=R):R=t[54];let H;t[55]!==R?(H=o.jsx(ht,{children:R}),t[55]=R,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:U,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ms as default};
|
|
1
|
+
import{c as ge,b as me,j as o,v as Ae,t as le,B as ne,F as De,o as Ie,a as Le,r as X,n as Te,K as de,e as Ee,p as V,G as Fe,m as ke}from"./index-GPtGFYbO.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-CkRaLL_n.js";import{a as Ge}from"./Users03-C7g8VOdi.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-8yIoQVfR.js";import{a as Oe,b as ze,c as Be}from"./use-virtual-mcp-Bo4QPAh_.js";import{P as ce}from"./index-DUWa0kTK.js";import{a as Ue}from"./DotsVertical-DVg_Pbm_.js";import{A as Re,C as fe,aW as $e}from"./agent-icon-s6_qyUu1.js";import{a as He}from"./Settings02-D9mUVp_d.js";import{s as Ve}from"./Trash01-BysA7V0F.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as Se}from"./use-navigate-to-agent-DzLLgouC.js";import{e as qe,h as Qe}from"./use-organization-settings-JoyMX7--.js";import{u as _e}from"./use-capability-7E41d664.js";import{C as Je}from"./card-bfZkFKGg.js";import{E as Ye}from"./empty-state-6Ei3fC_M.js";import{u as We}from"./use-create-virtual-mcp-CJZL5OXt.js";import{u as Xe}from"./use-connection-_5ysFy7m.js";import{u as xe,S as Ze}from"./use-mcp-client-B8hPaR2x.js";import{p as et,a as je}from"./deco-site-production-url-BjY4ZYd-.js";import{g as tt,f as ot,b as st,G as it,p as nt}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import{e as rt,d as lt,a as at,b as ct,c as mt}from"./dialog-f2gIoJyo.js";import{i as dt}from"./ArrowLeft-D-GaGLbo.js";import{C as ut}from"./collection-search-UbWH5VZy.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-DC6Lplgx.js";import{S as Dt}from"./search-input-BQvnJ7ie.js";import{s as Ce}from"./Plus-Cuw6ld9s.js";import"./Check-B8suwSr9.js";import"./ChevronRight-BIidR9SM.js";import"./use-debounced-value-CgunDIm8.js";import"./authenticate-and-persist-oauth-C5hTKLZu.js";import"./mcp-oauth-DYN1bOv6.js";import"./auth-B_fsW_pO.js";import"./LinkExternal01-Dqas4G6a.js";import"./Share07-C3qW0KvP.js";import"./use-mcp-tools-DxzHZCmj.js";import"./extract-connection-data-Dwb0cyv5.js";import"./metadata-dUsYcpuu.js";import"./sidebar-BKLfDbJN.js";import"./LayoutLeft-B8TJ15_W.js";import"./use-mobile-DoH3Zs0T.js";import"./X-Bb9AvrlL.js";import"./tooltip-Btz0jJUy.js";import"./AlertCircle-CEGqDvaA.js";import"./Tool01-n6deJtHB.js";import"./ArrowUp-DazHjV8x.js";import"./Tool02-ChBe855x.js";import"./XCircle-J5pnVl1i.js";import"./ArrowUpRight-DNskIx7Q.js";import"./TrendUp01-BhChTRyL.js";import"./ZapSquare-D28-LH7C.js";import"./CheckCircle-DObEUtRu.js";import"./ChevronDown-C6kSK4xi.js";import"./ChevronUp-DHnR36Wm.js";import"./Stars02-D3OSImoU.js";import"./Copy01-C9sG-6D6.js";import"./CpuChip01-C6R2c7cp.js";import"./CreditCard01-sjHzWu4n.js";import"./Globe01-_I5Gee5_.js";import"./Eye-B0s0rmgv.js";import"./FilterLines-xbs5S3Vb.js";import"./Star01-itSgb7DF.js";import"./Globe04-p6Pq1FLe.js";import"./SwitchHorizontal01-Di19iqO8.js";import"./HardDrive-BX_FsVnA.js";import"./Key01-kW6GScFx.js";import"./LogOut01-C6waAPKc.js";import"./Monitor01-BJd3P9Bs.js";import"./Sun-fnvHykt1.js";import"./Palette-CVUGmkcJ.js";import"./Play-D6P4Qt3H.js";import"./SearchLg-CvmvPTNH.js";import"./SearchMd-BPfugAIu.js";import"./Shield01-BuqzbXhN.js";import"./Stars01-04iBWvYW.js";import"./Upload01-Y2mazRed.js";import"./User01-BvPxxSqY.js";import"./Users01-ChDlVjp-.js";import"./XClose-BQLeCToC.js";import"./Zap-B30ko8EF.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-IaMFwizq.js";import"./decopilot-sse-pool-H9DQ4gY8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-BDRk_Gqu.js";function be(t){const e=ge.c(28),{onCreateFromScratch:i,onImportGitHub:n,onImportDeco:r,isCreating:f,align:c,side:G,showBetaBadge:x}=t,M=c===void 0?"end":c,d=me();let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(Ge,{size:14}),e[0]=T):T=e[0];let m;e[1]!==d?(m=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=m):m=e[2];let D;e[3]!==f||e[4]!==i||e[5]!==m?(D=o.jsxs(re,{disabled:f,onClick:i,children:[T,m]}),e[3]=f,e[4]=i,e[5]=m,e[6]=D):D=e[6];let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(we,{className:"size-3.5"}),e[7]=j):j=e[7];let y;e[8]!==d?(y=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=y):y=e[9];let a;e[10]!==x?(a=x&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=x,e[11]=a):a=e[11];let l;e[12]!==n||e[13]!==y||e[14]!==a?(l=o.jsxs(re,{onClick:n,children:[j,y,a]}),e[12]=n,e[13]=y,e[14]=a,e[15]=l):l=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=h):h=e[16];let C;e[17]!==d?(C=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=C):C=e[18];let w;e[19]!==r||e[20]!==C?(w=o.jsxs(re,{onClick:r,children:[h,C]}),e[19]=r,e[20]=C,e[21]=w):w=e[21];let u;return e[22]!==M||e[23]!==G||e[24]!==w||e[25]!==D||e[26]!==l?(u=o.jsxs(ye,{side:G,align:M,className:"w-48",children:[D,l,w]}),e[22]=M,e[23]=G,e[24]=w,e[25]=D,e[26]=l,e[27]=u):u=e[27],u}function yt(t){const e=ge.c(65),{project:i,lastUsedAt:n,onDeleteClick:r}=t,f=Se(),c=me(),[G]=Ae(),x=G.language==="pt-BR"?Ke:void 0,{mainAgentId:M}=qe(),d=Qe(),{granted:T}=_e("org:manage"),m=M===i.id;let D;e[0]!==m||e[1]!==i.id||e[2]!==i.title||e[3]!==d||e[4]!==c?(D=()=>{const I=m?null:i.id;d.mutate(I,{onSuccess:()=>le.success(m?c("home.projectCard.mainAgentUnset",{title:i.title}):c("home.projectCard.mainAgentSet",{title:i.title})),onError:()=>le.error(c("home.projectCard.mainAgentError"))})},e[0]=m,e[1]=i.id,e[2]=i.title,e[3]=d,e[4]=c,e[5]=D):D=e[5];const j=D;let y;e[6]!==f||e[7]!==i.id?(y=()=>f(i.id),e[6]=f,e[7]=i.id,e[8]=y):y=e[8];let a;e[9]!==i.title||e[10]!==y?(a=o.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":i.title}),e[9]=i.title,e[10]=y,e[11]=a):a=e[11];let l;e[12]!==i.icon||e[13]!==i.title?(l=o.jsx(Re,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[12]=i.icon,e[13]=i.title,e[14]=l):l=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ue,{asChild:!0,children:o.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Ue,{size:20})})}),e[15]=h):h=e[15];let C;e[16]!==f||e[17]!==i.id?(C=()=>f(i.id,{search:{main:"settings"}}),e[16]=f,e[17]=i.id,e[18]=C):C=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(He,{size:16}),e[19]=w):w=e[19];let u;e[20]!==C?(u=o.jsxs(re,{onClick:C,children:[w,"Settings"]}),e[20]=C,e[21]=u):u=e[21];let O;e[22]!==T||e[23]!==m||e[24]!==c||e[25]!==j?(O=T&&o.jsxs(re,{onClick:I=>{I.stopPropagation(),j()},children:[o.jsx(fe,{size:16}),c(m?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[22]=T,e[23]=m,e[24]=c,e[25]=j,e[26]=O):O=e[26];let E;e[27]!==r?(E=r&&o.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),r(I)},children:[o.jsx(Ve,{size:16}),"Delete"]}),e[27]=r,e[28]=E):E=e[28];let z;e[29]!==E||e[30]!==u||e[31]!==O?(z=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[h,o.jsxs(ye,{align:"end",children:[u,O,E]})]})}),e[29]=E,e[30]=u,e[31]=O,e[32]=z):z=e[32];let S;e[33]!==z||e[34]!==l?(S=o.jsxs("div",{className:"flex items-start justify-between",children:[l,z]}),e[33]=z,e[34]=l,e[35]=S):S=e[35];let v;e[36]!==i.title?(v=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[36]=i.title,e[37]=v):v=e[37];let N;e[38]!==m||e[39]!==c?(N=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]=N):N=e[40];let P;e[41]!==v||e[42]!==N?(P=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,N]}),e[41]=v,e[42]=N,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]!==S||e[50]!==p?(g=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[S,p]}),e[49]=S,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 _;e[57]!==b?(_=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),e[57]=b,e[58]=_):_=e[58];let A;e[59]!==g||e[60]!==_?(A=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[g,_]}),e[59]=g,e[60]=_,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 St(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 _t(t,e){const i=e?St(e):null,n=i?.owner??wt,r=i?.repo??t;return{owner:n,name:r,url:`https://github.com/${n}/${r}`}}function vt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function ve(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 Nt(t){return ve(`/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=Se(),c=Ie(),{data:G}=Le.useSession(),[x,M]=X.useState(null),[d,T]=X.useState(null),[m,D]=X.useState(""),j=xe({connectionId:Ze,orgId:r.id,orgSlug:r.slug}),y=Xe({slug:"mcp-github"}),a=tt(y),l=Me({enabled:t&&a.length===0}),h=a.length===1?a[0]??null:d,C=a.length>1&&!h,w=xe({connectionId:h?.id??"",orgId:r.id,orgSlug:r.slug}),u=t&&a.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:E,error:z}=Te({queryKey:de.decoSites(G?.user?.email),queryFn:()=>Nt(r.slug),enabled:t&&!!G?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],v=s=>{s||(M(null),T(null),D("")),e(s)},N=S.filter(s=>s.name.toLowerCase().includes(m.toLowerCase())||(s.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),P=!x||N.some(s=>s.name===x),F=Ee({mutationFn:async s=>{if(!h)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));V("deco_site_import_started",{site_name:s});const{installations:p}=await ot(B=>j.callTool(B),h.id),g=S.find(B=>B.name===s);if(!g)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const b=_t(s,g.metadata),_=st(p,b.owner);if(!_)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:b.owner,installUrl:it}));let A=null,k=null,I=null;const J=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 ve(`/api/${r.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:s})},n("common.importFromDecoDialog.failedToCreateConnection")),U=B.connId;if(!U)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=U;const{childConnectionId:$,reused:Y}=await nt({orgSlug:r.slug,sourceConnection:h,installationId:_.installationId,owner:b.owner,repo:b.name,githubCallTool:H=>w.callTool(H),selfCallTool:H=>j.callTool(H)});k=Y?null:$;const K=B.icon??null,Z=vt(s),W=s.toLowerCase(),q=et(je(g.domains)),Q=await j.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s,description:"Imported from deco.cx",pinned:!1,icon:K??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:q,productionUrl:q,githubRepo:{owner:b.owner,name:b.name,url:b.url,installationId:_.installationId,connectionId:$},ui:{banner:null,bannerColor:"#22C55E",icon:K,themeColor:"#22C55E",slug:Z,pinnedViews:[{connectionId:U,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:U,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:U},{connection_id:$}]}}}),R=Q.structuredContent??Q;if(!R.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=R.item.id,{slug:Z,virtualMcpId:R.item.id,connId:U,item:R.item}}catch(B){throw await J(),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 _=b.queryKey;return _[1]===r.id&&_[3]==="collection"&&_[4]==="VIRTUAL_MCP"}}),c.invalidateQueries({queryKey:de.projects(r.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:s})),v(!1),localStorage.setItem(Fe.sidebarOpen(),JSON.stringify(!1)),f(p)},onError:s=>{V("deco_site_import_failed",{error:s instanceof Error?s.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(s instanceof Error?s.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(rt,{open:t,onOpenChange:v,children:o.jsxs(lt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(at,{className:"sr-only",children:o.jsx(ct,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[i&&o.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(dt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ut,{value:m,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:s=>{s.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ne,{variant:"outline",size:"sm",onClick:l.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),C&&!u&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),a.map(s=>o.jsxs("button",{type:"button",onClick:()=>T(s),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?o.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(we,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}),E&&!u&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!E&&!u&&!C&&l.status!=="error"&&!z&&S.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"&&S.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:[N.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})}),N.map(s=>{const p=je(s.domains),g=x===s.name;return o.jsxs("button",{type:"button",onClick:()=>M(s.name),className:ke("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",g?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:s.thumb_url?o.jsx("img",{src:s.thumb_url,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:s.name}),p&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:p})]})]},s.name)})]})]}),o.jsxs(mt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ne,{variant:"outline",onClick:()=>v(!1),disabled:F.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(ne,{disabled:!x||!P||F.isPending||E||u||C||!h||l.status==="error",onClick:()=>x&&F.mutate(x),children:F.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ms(){const t=ge.c(77),e=me(),{org:i}=De(),n=Oe(),r=ze(),[f,c]=X.useState("");let G;t[0]===Symbol.for("react.memo_cache_sentinel")?(G={navigateOnCreate:!0},t[0]=G):G=t[0];const{createVirtualMCP:x,isCreating:M}=We(G),[d,T]=X.useState(null),[m,D]=X.useState(!1),[j,y]=X.useState(!1),{granted:a}=_e("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:Ne}=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:Ne}))}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 S;t[5]!==e?(S=e("routes.agentsList.title"),t[5]=e,t[6]=S):S=t[6];let v;t[7]!==S?(v=o.jsx(ce.Title,{children:S}),t[7]=S,t[8]=v):v=t[8];let N;t[9]!==e?(N=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=N):N=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]!==N?(F=o.jsx(Dt,{value:f,onChange:c,placeholder:N,className:"w-full md:w-[375px]",onKeyDown:P}),t[12]=f,t[13]=N,t[14]=F):F=t[14];let s;t[15]!==a||t[16]!==x||t[17]!==M||t[18]!==e?(s=a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:M,align:"end"})]}),t[15]=a,t[16]=x,t[17]=M,t[18]=e,t[19]=s):s=t[19];let p;t[20]!==F||t[21]!==s?(p=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[F,s]}),t[20]=F,t[21]=s,t[22]=p):p=t[22];let g;t[23]!==p||t[24]!==v?(g=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,p]}),t[23]=p,t[24]=v,t[25]=g):g=t[25];const b=h.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{image:o.jsx($e,{size:48,className:"text-muted-foreground"}),title:e(f?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:f?e("routes.agentsList.noAgentsMatchSearch",{search:f}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!f&&a&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(ne,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),x()},onImportGitHub:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"github"}),y(!0)},onImportDeco:()=>{V("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:M,align:"center",showBetaBadge:!0})]})})}),_=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]!==_||t[29]!==z.Body?(A=o.jsxs(z.Body,{children:[g,b,_]}),t[26]=g,t[27]=b,t[28]=_,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 J;t[36]!==m?(J=o.jsx(At,{open:m,onOpenChange:D}),t[36]=m,t[37]=J):J=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 Y;t[41]!==$?(Y=o.jsx(pt,{children:$}),t[41]=$,t[42]=Y):Y=t[42];let K;t[43]!==e?(K=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=K):K=t[44];const Z=d?.title;let W;t[45]!==Z?(W=o.jsx("span",{className:"font-medium text-foreground",children:Z}),t[45]=Z,t[46]=W):W=t[46];let q;t[47]!==K||t[48]!==W?(q=o.jsxs(gt,{children:[K," ",W,"."]}),t[47]=K,t[48]=W,t[49]=q):q=t[49];let Q;t[50]!==Y||t[51]!==q?(Q=o.jsxs(ft,{children:[Y,q]}),t[50]=Y,t[51]=q,t[52]=Q):Q=t[52];let R;t[53]!==e?(R=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=R):R=t[54];let H;t[55]!==R?(H=o.jsx(ht,{children:R}),t[55]=R,t[56]=H):H=t[56];let ee;t[57]!==e?(ee=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=ee):ee=t[58];let te;t[59]!==u||t[60]!==ee?(te=o.jsx(xt,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ee}),t[59]=u,t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==H||t[63]!==te?(oe=o.jsxs(jt,{children:[H,te]}),t[62]=H,t[63]=te,t[64]=oe):oe=t[64];let se;t[65]!==Q||t[66]!==oe?(se=o.jsxs(Ct,{children:[Q,oe]}),t[65]=Q,t[66]=oe,t[67]=se):se=t[67];let ie;t[68]!==B||t[69]!==se?(ie=o.jsx(bt,{open:B,onOpenChange:U,children:se}),t[68]=B,t[69]=se,t[70]=ie):ie=t[70];let ae;return t[71]!==O||t[72]!==k||t[73]!==I||t[74]!==J||t[75]!==ie?(ae=o.jsxs(O,{children:[k,I,J,ie]}),t[71]=O,t[72]=k,t[73]=I,t[74]=J,t[75]=ie,t[76]=ae):ae=t[76],ae}function It(t){return t.id}export{ms as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as X,$ as K,_ as Ae,a3 as Ke,a4 as ne,a0 as ze,b9 as Oe,c as Z,b as re,a2 as Le,a1 as Ve,r as W,j as s,a5 as at,t as ee,av as Qe,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,v as Ge,p as $e,E as ct}from"./index-HWhUkMVs.js";import{i as dt}from"./AlertCircle-0OUPWUNo.js";import{P as Ie}from"./index-6TRi0uef.js";import{S as Ee}from"./skeleton-Y7gyZPrn.js";import{b as We,a as Me,S as Te,c as mt}from"./settings-section-DzETP_0_.js";import{u as Ye,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Je}from"./use-ai-providers-Dfw1C_Qb.js";import{i as ht}from"./CheckCircle-HA9HSubF.js";import{b as xt,j as vt}from"./use-organization-settings-BJdrgwhq.js";import{c as bt,d as Ze,P as yt,C as qe}from"./select-model-DQpQr2DQ.js";import{u as jt}from"./use-debounced-autosave-CrvyuS1z.js";import{I as Ce}from"./input-CDxc4QX0.js";import{T as He,a as St}from"./toggle-group-CBptT1rM.js";import{A as Xe,a as et,b as tt,c as st,d as it,e as rt,f as ot,g as lt}from"./alert-dialog-BtRTtbG0.js";import{u as ce}from"./studio-tools-whdp8gFV.js";import{s as Ct}from"./Plus-BXW-bLkv.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-BK3Hfpvm.js";import{s as Nt}from"./Trash01-BSXuR-v0.js";import{A as It}from"./avatar-BxOwauBx.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-D8A1C3JO.js";import{s as Kt}from"./Eye-CaOR6o-h.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-DsCqITds.js";import{S as Ft}from"./spinner-CMWgEkOv.js";import{R as Ot}from"./require-capability-V2e0LU3P.js";import"./sidebar-DbMpr-rh.js";import"./LayoutLeft-B3Xq6Q9F.js";import"./use-mobile-nNGwbm7m.js";import"./X-B1FpD19v.js";import"./tooltip-DO91iaPZ.js";import"./card-BgLseUz9.js";import"./ArrowUpRight-CHr_jXVV.js";import"./use-mcp-client-WNkI8KAJ.js";import"./auth-BxRabvv-.js";import"./drawer-CWuptb6-.js";import"./chat-context-DtiyxjXg.js";import"./tab-id-fxY7FqYq.js";import"./Check-YqNpUnjS.js";import"./Copy01-Bm8H5mLb.js";import"./hooks-DoEly3LT.js";import"./decopilot-sse-pool-BwUtRq_o.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-uppMIhb1.js";import"./use-decopilot-events-LcKd19eo.js";import"./checkbox-DtxWa1Lp.js";import"./select-D3htjNBx.js";import"./ChevronDown-BX2HgupK.js";import"./ChevronUp-J2R9ILOH.js";import"./ArrowLeft-CcZIvmNQ.js";import"./Key01-DE0cHxdc.js";import"./SearchMd-B1jAF5PX.js";import"./Monitor01-DDxK-vql.js";import"./ChevronRight-kdKaq9Ii.js";import"./Stars01-ndnSTODt.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-XKHS0Yi2.js";import"./use-capability-hVyOyKfv.js";import"./access-gate-BUqNYnUF.js";import"./capability-load-error-Bl4HXrb5.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const le=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();ze(["fast","smart","thinking","image","web_search","deep_research"]);ze(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:le,smart:le,thinking:le,image:le,web_search:le,deep_research:le})});X({tiers:X({fast:le.optional(),smart:le.optional(),thinking:le.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Ye(),o=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[u,_]=W.useState(o??a);let y,l;t[0]!==o?(y=()=>{o&&_(o)},l=[o],t[0]=o,t[1]=y,t[2]=l):(y=t[1],l=t[2]),W.useEffect(y,l);let f;t[3]!==c||t[4]!==a||t[5]!==u?(f=c.some(C=>C.id===u)?u:a,t[3]=c,t[4]=a,t[5]=u,t[6]=f):f=t[6];const m=f;let p;t[7]!==m||t[8]!==c?(p=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=p):p=t[9];const P=p,{models:x,isLoading:v}=we(n?m??void 0:void 0),g=n?v||x.some(n):!0;let k;t[10]!==i||t[11]!==P?.providerId||t[12]!==o?(k=i&&o?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:P?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=P?.providerId,t[12]=o,t[13]=k):k=t[13];const I=k,h=re();if(n&&!g){let C;t[14]!==h?(C=h("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=h,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let j;t[18]!==h?(j=h("settings.simpleModeSection.pickModel"),t[18]=h,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=C=>_(C),t[20]=S):S=t[20];let d;t[21]!==m||t[22]!==r?(d=C=>{const w=C.keyId??m??"";_(w),r({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=r,t[23]=d):d=t[23];let b;return t[24]!==m||t[25]!==n||t[26]!==I||t[27]!==j||t[28]!==d?(b=s.jsx(bt,{variant:"bordered",placeholder:j,model:I,credentialId:m,filterModels:n,onCredentialChange:S,onModelChange:d}),t[24]=m,t[25]=n,t[26]=I,t[27]=j,t[28]=d,t[29]=b):b=t[29],b}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:r}=e,n=re();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Qe,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ht,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function Vt(){const e=Z.c(58),t=re(),i=Ye(),r=xt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Le(Ut),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const o=Ve(c),{mutate:u,isPending:_,isSuccess:y}=vt(),l=o.formState.isDirty;let f;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==u?(f={delayMs:250,save:async()=>{const N=o.getValues();u(N,{onSuccess:()=>o.reset(N,{keepValues:!0}),onError:F=>{o.reset(r),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=u,e[7]=f):f=e[7];const{schedule:m}=jt(f),p=i[0],P=i[1],x=i[2],{models:v}=we(p?.id),{models:g}=we(P?.id),{models:k}=we(x?.id);let I,h;e[8]!==o||e[9]!==n?(I=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},h=[n,o],e[8]=o,e[9]=n,e[10]=I,e[11]=h):(I=e[10],h=e[11]),W.useEffect(I,h);let j;e[12]!==i||e[13]!==o||e[14]!==p||e[15]!==P||e[16]!==x||e[17]!==v||e[18]!==g||e[19]!==k?(j=()=>{const N=o.getValues(),F=new Set(i.map(Qt)),O={};p?.id&&(O[p.id]=v),P?.id&&(O[P.id]=g),x?.id&&(O[x.id]=k);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(N.tiers.fast)?null:N.tiers.fast,smart:T(N.tiers.smart)?null:N.tiers.smart,thinking:T(N.tiers.thinking)?null:N.tiers.thinking,image:T(N.tiers.image)?null:N.tiers.image,web_search:T(N.tiers.web_search)?null:N.tiers.web_search,deep_research:T(N.tiers.deep_research)?null:N.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===N.tiers.fast&&D.smart===N.tiers.smart&&D.thinking===N.tiers.thinking&&D.image===N.tiers.image&&D.web_search===N.tiers.web_search&&D.deep_research===N.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);o.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=p,e[15]=P,e[16]=x,e[17]=v,e[18]=g,e[19]=k,e[20]=j):j=e[20];const S=p?.id,d=P?.id,b=x?.id;let C;e[21]!==i||e[22]!==o||e[23]!==v||e[24]!==g||e[25]!==k||e[26]!==S||e[27]!==d||e[28]!==b?(C=[o,i,v,g,k,S,d,b],e[21]=i,e[22]=o,e[23]=v,e[24]=g,e[25]=k,e[26]=S,e[27]=d,e[28]=b,e[29]=C):C=e[29],W.useEffect(j,C);let w;e[30]!==t?(w=N=>({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")})[N]||N,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=N=>({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")})[N]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=y&&!l;let $;e[40]!==_||e[41]!==Q?($=s.jsx(Lt,{isPending:_,showSaved:Q}),e[40]=_,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(N=>s.jsx(at,{control:o.control,name:`tiers.${N.key}`,render:F=>{const{field:O}=F;return s.jsx(We,{title:R(N.key),description:E(N.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:N.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},N.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=re(),i=ce(),[r]=Ge(),[n,a]=W.useState(!1);let c;e[0]!==t?(c=d=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:d.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:o,isPending:u}=ae({mutationFn:async d=>{const{url:b}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:d,currency:m});return b},onSuccess:Yt,onError:c}),[_,y]=W.useState(""),[l,f]=W.useState(r.language==="pt-BR"?"brl":"usd"),m=l,p=parseFloat(_),P=!isNaN(p)&&p>=1,x=m==="brl"?"R$":"$";let v;e[2]!==f?(v=d=>{d&&f(d)},e[2]=f,e[3]=v):v=e[3];let g,k;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(He,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),k=s.jsx(He,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=g,e[5]=k):(g=e[4],k=e[5]);let I;e[6]!==m||e[7]!==v?(I=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:m,onValueChange:v,children:[g,k]}),e[6]=m,e[7]=v,e[8]=I):I=e[8];let h;e[9]!==m||e[10]!==x||e[11]!==n||e[12]!==u||e[13]!==t||e[14]!==o?(h=!n&&s.jsxs(s.Fragment,{children:[Gt[m].map(d=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:u,onClick:()=>o(d*100),children:[x,d]},d)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:u,children:t("settings.decoCreditsHero.custom")})]}),e[9]=m,e[10]=x,e[11]=n,e[12]=u,e[13]=t,e[14]=o,e[15]=h):h=e[15];let j;e[16]!==x||e[17]!==_||e[18]!==p||e[19]!==n||e[20]!==P||e[21]!==u||e[22]!==y||e[23]!==t||e[24]!==o?(j=n&&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:x}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:_,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!P||u,onClick:()=>o(Math.round(p*100)),children:u?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=x,e[17]=_,e[18]=p,e[19]=n,e[20]=P,e[21]=u,e[22]=y,e[23]=t,e[24]=o,e[25]=j):j=e[25];let S;return e[26]!==I||e[27]!==h||e[28]!==j?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I,h,j]})}),e[26]=I,e[27]=h,e[28]=j,e[29]=S):S=e[29],S}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=re(),{org:i}=_e(),r=ce(),n=ke(),a=Fe();let c;e[0]!==a?(c=a.find(Xt),e[0]=a,e[1]=c):c=e[1];const o=c,[u,_]=W.useState(!1);let y;e[2]!==o||e[3]!==r?(y=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=y):y=e[4];let l;e[5]!==i.id||e[6]!==n||e[7]!==t?(l=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=l):l=e[8];let f;e[9]!==t?(f=nt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:nt.message}))},e[9]=t,e[10]=f):f=e[10];let m;e[11]!==y||e[12]!==l||e[13]!==f?(m={mutationFn:y,onSuccess:l,onError:f},e[11]=y,e[12]=l,e[13]=f,e[14]=m):m=e[14];const{mutate:p,isPending:P}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const v=!!o;let g;e[17]!==r?(g=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=g):g=e[18];let k;e[19]!==x||e[20]!==v||e[21]!==g?(k={queryKey:x,enabled:v,staleTime:6e4,queryFn:g},e[19]=x,e[20]=v,e[21]=g,e[22]=k):k=e[22];const{data:I,isLoading:h,refetch:j,isFetching:S}=Re(k);if(!o)return null;const d=I?.balanceCents!=null?I.balanceCents/100:null;let b;e[23]!==d?(b=d!=null?`$${d.toFixed(2)}`:"—",e[23]=d,e[24]=b):b=e[24];const C=b;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>_(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==P||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:P,children:Q}),e[41]=P,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Xe,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let N;e[53]!==V?(N=s.jsx(et,{children:V}),e[53]=V,e[54]=N):N=e[54];let F;e[55]!==B||e[56]!==N?(F=s.jsxs(tt,{children:[B,N]}),e[55]=B,e[56]=N,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(st,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==p?(D=()=>p(),e[62]=p,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(it,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(rt,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(ot,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==u||e[76]!==G?(oe=s.jsx(lt,{open:u,onOpenChange:_,children:G}),e[75]=u,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==d||e[79]!==C||e[80]!==S||e[81]!==h?(te=h||S?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&Jt(d)),children:C}),e[78]=d,e[79]=C,e[80]=S,e[81]=h,e[82]=te):te=e[82];let de;e[83]!==j?(de=()=>j(),e[83]=j,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=S&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Qe,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==S||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=S,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ne;return e[118]!==w||e[119]!==Se?(Ne=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ne):Ne=e[120],Ne}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(12),{org:t}=_e(),i=ce(),r=ke(),n=re();let a;e[0]!==i?(a=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=a):a=e[1];let c;e[2]!==t||e[3]!==r||e[4]!==n?(c=()=>{$e("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success(n("settings.aiProviders.decoConnectSuccess"))},e[2]=t,e[3]=r,e[4]=n,e[5]=c):c=e[5];let o;e[6]!==n?(o=_=>{$e("ai_provider_provision_failed",{provider_id:"deco",error:_.message}),ee.error(n("settings.aiProviders.decoConnectError",{error:_.message}))},e[6]=n,e[7]=o):o=e[7];let u;return e[8]!==a||e[9]!==c||e[10]!==o?(u={mutationFn:a,onSuccess:c,onError:o},e[8]=a,e[9]=c,e[10]=o,e[11]=u):u=e[11],ae(u)}function ts(){const e=Z.c(37),t=re(),{mutate:i,isPending:r}=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 a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let u;e[6]!==t?(u=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=u):u=e[7];let _;e[8]!==u?(_=s.jsx("p",{className:"text-base font-semibold",children:u}),e[8]=u,e[9]=_):_=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let l;e[12]!==y?(l=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=l):l=e[13];let f;e[14]!==_||e[15]!==l?(f=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,l]}),e[14]=_,e[15]=l,e[16]=f):f=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let p;e[19]!==m?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=p):p=e[20];let P;e[21]!==p||e[22]!==f?(P=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,p]}),e[21]=p,e[22]=f,e[23]=P):P=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let v;e[26]!==r||e[27]!==t?(v=t(r?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=r,e[27]=t,e[28]=v):v=e[28];let g;e[29]!==r||e[30]!==x||e[31]!==v?(g=s.jsx(se,{variant:"outline",disabled:r,onClick:x,children:v}),e[29]=r,e[30]=x,e[31]=v,e[32]=g):g=e[32];let k;return e[33]!==P||e[34]!==g||e[35]!==o?(k=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,P,g]})]}),e[33]=P,e[34]=g,e[35]=o,e[36]=k):k=e[36],k}const ss=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function is({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function rs({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:u}=_e(),_=ce(),y=ke(),l=re(),[f,m]=W.useState(!1),p=t.id==="openai-compatible",P=t.supportedMethods.includes("api-key"),x=ss(l),{register:v,handleSubmit:g,watch:k,setError:I,formState:{errors:h}}=Ve({resolver:Le(x),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),j=k("apiKey")??"",{mutate:S,isPending:d}=ae({mutationFn:async b=>{let C;b.apiKey&&(p?C=JSON.stringify({baseUrl:b.baseUrl||a||"",apiKey:b.apiKey}):C=b.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:b.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:ie.aiProviderKeys(u.id)}),y.invalidateQueries({queryKey:ie.aiProviders(u.id)}),ee.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:b=>ee.error(l("settings.editProviderDialog.failedToUpdate",{error:b.message}))});return s.jsxs("form",{onSubmit:g(b=>{if(is({isOpenAICompatible:p,baseUrl:b.baseUrl,currentBaseUrl:a,apiKey:b.apiKey})){I("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}S(b)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...v("label"),className:"h-8 text-sm"}),h.label&&s.jsx("p",{className:"text-xs text-destructive",children:h.label.message})]}),p&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...v("baseUrl"),className:"h-8 text-sm"})]}),P&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[l("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",l("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:f&&j?"text":"password",placeholder:r,...v("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),j&&s.jsx("button",{type:"button",onClick:()=>m(!f),"aria-label":l(f?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:f?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),h.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:h.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:d,children:l("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:d,children:l(d?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function os(e){const t=Z.c(31),{providerKey:i,provider:r,open:n,onOpenChange:a}=e,c=re(),o=ce(),u=r.id==="openai-compatible"&&i.presetId?Ze(i.presetId):void 0,_=u?.name??r.name;let y;t[0]!==i.id?(y=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let l;t[2]!==i.id||t[3]!==o?(l=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=l):l=t[4];let f;t[5]!==n||t[6]!==y||t[7]!==l?(f={queryKey:y,queryFn:l,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=l,t[8]=f):f=t[8];const{data:m,isLoading:p}=Re(f),P=Mt,x=Et,v="sm:max-w-md",g=Rt,k=At,I=c("settings.editProviderDialog.editTitle",{name:_});let h;t[9]!==k||t[10]!==I?(h=s.jsx(k,{children:I}),t[9]=k,t[10]=I,t[11]=h):h=t[11];let j;t[12]!==g||t[13]!==h?(j=s.jsx(g,{children:h}),t[12]=g,t[13]=h,t[14]=j):j=t[14];let S;t[15]!==p||t[16]!==a||t[17]!==u||t[18]!==m||t[19]!==r||t[20]!==i?(S=p||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(rs,{providerKey:i,provider:r,preset:u,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=p,t[16]=a,t[17]=u,t[18]=m,t[19]=r,t[20]=i,t[21]=S):S=t[21];let d;t[22]!==x||t[23]!==j||t[24]!==S?(d=s.jsxs(x,{className:v,children:[j,S]}),t[22]=x,t[23]=j,t[24]=S,t[25]=d):d=t[25];let b;return t[26]!==P||t[27]!==a||t[28]!==n||t[29]!==d?(b=s.jsx(P,{open:n,onOpenChange:a,children:d}),t[26]=P,t[27]=a,t[28]=n,t[29]=d,t[30]=b):b=t[30],b}function ls(e){const t=Z.c(86),{providerKey:i,provider:r}=e,{org:n}=_e(),a=ce(),c=ke(),[o,u]=W.useState(!1),[_,y]=W.useState(!1),l=re(),[f]=Ge(),m=f.language==="pt-BR"?_t:void 0,p=r?.id==="openai-compatible";let P;t[0]!==p||t[1]!==i.presetId?(P=p&&i.presetId?Ze(i.presetId):void 0,t[0]=p,t[1]=i.presetId,t[2]=P):P=t[2];const x=P;let v;t[3]!==p||t[4]!==x||t[5]!==r?.name||t[6]!==i.providerId||t[7]!==l?(v=x?x.name:p?l("settings.aiProviders.customOpenAiCompatible"):r?.name??(i.providerId==="claude-code"?l("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?l("settings.providerKeyRow.codex"):i.providerId),t[3]=p,t[4]=x,t[5]=r?.name,t[6]=i.providerId,t[7]=l,t[8]=v):v=t[8];const g=v,k=x?.logo??r?.logo??wt[i.providerId];let I;e:{if(p){I=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==l?(te=l("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=l,t[13]=te):te=t[13],I=te}const h=I;let j;t[14]!==i.id||t[15]!==a?(j=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=a,t[16]=j):j=t[16];let S;t[17]!==n||t[18]!==i.id||t[19]!==c||t[20]!==l?(S=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:ie.aiProviders(n.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(n.id,i.id)}),ee.success(l("settings.providerKeyRow.keyDeleted")),u(!1)},t[17]=n,t[18]=i.id,t[19]=c,t[20]=l,t[21]=S):S=t[21];let d;t[22]!==l?(d=te=>ee.error(l("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=l,t[23]=d):d=t[23];let b;t[24]!==j||t[25]!==S||t[26]!==d?(b={mutationFn:j,onSuccess:S,onError:d},t[24]=j,t[25]=S,t[26]=d,t[27]=b):b=t[27];const{mutate:C,isPending:w}=ae(b);let R;t[28]!==g||t[29]!==k?(R=k?s.jsx("img",{src:k,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(It,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=k,t[30]=R):R=t[30];let A;t[31]!==r||t[32]!==l?(A=r?s.jsx(se,{variant:"ghost",size:"icon","aria-label":l("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>y(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=r,t[32]=l,t[33]=A):A=t[33];let E;t[34]!==l?(E=l("settings.providerKeyRow.deleteProviderKey"),t[34]=l,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>u(!0),U=s.jsx(Nt,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==h||t[45]!==g||t[46]!==Q||t[47]!==R?($=s.jsx(We,{icon:R,title:g,description:h,action:Q}),t[44]=h,t[45]=g,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==_||t[50]!==r||t[51]!==i?(q=r?s.jsx(os,{providerKey:i,provider:r,open:_,onOpenChange:y}):null,t[49]=_,t[50]=r,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==l?(H=l("settings.providerKeyRow.deleteApiKey"),t[53]=l,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Xe,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(et,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let N;t[59]!==B||t[60]!==V?(N=s.jsxs(tt,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=N):N=t[61];let F;t[62]!==l?(F=l("settings.providerKeyRow.cancel"),t[62]=l,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(st,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==l?(D=l("settings.providerKeyRow.delete"),t[68]=l,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(it,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(rt,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==N||t[77]!==J?(z=s.jsxs(ot,{children:[N,J]}),t[76]=N,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==o||t[80]!==z?(G=s.jsx(lt,{open:o,onOpenChange:u,children:z}),t[79]=o,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function ns(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 as(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(r=>r.id===i.providerId)??null}))}function Be(e){const t=Z.c(13),{onConnectClick:i}=e,r=re(),n=Fe(),a=Je();let c;if(t[0]!==a?.providers||t[1]!==n||t[2]!==i||t[3]!==r){const o=a?.providers??[],u=as(n,o);let _;t[5]!==r?(_=r("settings.connectedProvidersSection.sectionTitle"),t[5]=r,t[6]=_):_=t[6];let y;t[7]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ct,{size:14}),t[7]=y):y=t[7];let l;t[8]!==r?(l=r("settings.connectedProvidersSection.connectButton"),t[8]=r,t[9]=l):l=t[9];let f;t[10]!==i||t[11]!==l?(f=s.jsxs(se,{size:"sm",onClick:i,children:[y,l]}),t[10]=i,t[11]=l,t[12]=f):f=t[12],c=s.jsx(Te,{title:_,headerClassName:"px-0",actions:f,children:u.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:u.map(cs)})}),t[0]=a?.providers,t[1]=n,t[2]=i,t[3]=r,t[4]=c}else c=t[4];return c}function cs(e){const{key:t,provider:i}=e;return s.jsx(ls,{providerKey:t,provider:i},t.id)}function ds(){const e=Z.c(55),t=re(),{org:i}=_e(),r=ce(),n=ke(),[a,c]=W.useState("");let o;e[0]!==i.id?(o=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=o):o=e[1];let u;e[2]!==r?(u=()=>r.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=r,e[3]=u):u=e[3];let _;e[4]!==o||e[5]!==u?(_={queryKey:o,queryFn:u},e[4]=o,e[5]=u,e[6]=_):_=e[6];const y=Re(_);let l;e[7]!==i.id||e[8]!==n?(l=()=>n.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=n,e[9]=l):l=e[9];const f=l;let m;e[10]!==r||e[11]!==a?(m=()=>r.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:a}),e[10]=r,e[11]=a,e[12]=m):m=e[12];let p;e[13]!==f||e[14]!==t?(p=async()=>{c(""),await f(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=f,e[14]=t,e[15]=p):p=e[15];let P;e[16]!==m||e[17]!==p?(P={mutationFn:m,onSuccess:p,onError:us},e[16]=m,e[17]=p,e[18]=P):P=e[18];const x=ae(P);let v;e[19]!==r?(v=()=>r.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=r,e[20]=v):v=e[20];let g;e[21]!==f||e[22]!==t?(g=async()=>{await f(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=f,e[22]=t,e[23]=g):g=e[23];let k;e[24]!==v||e[25]!==g?(k={mutationFn:v,onSuccess:g,onError:ms},e[24]=v,e[25]=g,e[26]=k):k=e[26];const I=ae(k),h=y.data?.connected===!0,j=!h&&!!y.data?.linkedAt;let S;e[27]!==t?(S=t("settings.claudeSubscription.title"),e[27]=t,e[28]=S):S=e[28];let d;e[29]!==S?(d=s.jsx("p",{className:"text-base font-semibold",children:S}),e[29]=S,e[30]=d):d=e[30];let b;e[31]!==h||e[32]!==j||e[33]!==t?(b=t(h?"settings.claudeSubscription.active":j?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=h,e[32]=j,e[33]=t,e[34]=b):b=e[34];let C;e[35]!==b?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),e[35]=b,e[36]=C):C=e[36];let w;e[37]!==d||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,C]}),e[37]=d,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==h||e[41]!==I||e[42]!==t?(R=h?s.jsx(se,{variant:"outline",disabled:I.isPending,onClick:()=>I.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=h,e[41]=I,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==h||e[49]!==t||e[50]!==a?(E=h?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:a,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:a.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=h,e[49]=t,e[50]=a,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function ms(e){return ee.error(e.message)}function us(e){return ee.error(e.message)}function ps(e){const t=Z.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(dt,{size:16}),t[0]=r):r=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:[r,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 fs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=ns(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:r,hasHostedProvider:n,hasDeco:a}=i,[c,o]=W.useState(!1),[u,_]=W.useState(null),y=Je();let l;e[2]!==y?.providers?(l=y?.providers??[],e[2]=y?.providers,e[3]=l):l=e[3];const f=l;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>o(!0),e[4]=k):k=e[4];let I;e[5]!==f?(I=s.jsx(yt,{providers:f,onSelect:_,onShowAll:k}),e[5]=f,e[6]=I):I=e[6];const h=u!==null||c;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=w=>{w||(_(null),o(!1))},e[7]=j):j=e[7];const S=u??void 0;let d;e[8]!==h||e[9]!==S?(d=s.jsx(qe,{open:h,onOpenChange:j,initialProvider:S}),e[8]=h,e[9]=S,e[10]=d):d=e[10];let b;e[11]!==r?(b=r?s.jsx(Be,{onConnectClick:()=>o(!0)}):null,e[11]=r,e[12]=b):b=e[12];let C;return e[13]!==I||e[14]!==d||e[15]!==b?(C=s.jsxs(s.Fragment,{children:[I,d,b]}),e[13]=I,e[14]=d,e[15]=b,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let p;e[18]!==a?(p=a?s.jsx(Zt,{}):s.jsx(ts,{}),e[18]=a,e[19]=p):p=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ds,{}),e[20]=P):P=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Be,{onConnectClick:()=>o(!0)}),e[21]=x):x=e[21];let v;e[22]!==c?(v=s.jsx(qe,{open:c,onOpenChange:o}),e[22]=c,e[23]=v):v=e[23];let g;return e[24]!==p||e[25]!==v?(g=s.jsxs(s.Fragment,{children:[m,p,P,x,v]}),e[24]=p,e[25]=v,e[26]=g):g=e[26],g}function gs(){const e=Z.c(7),t=re();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let r;e[2]!==i?(r=s.jsx(Ie.Title,{children:i}),e[2]=i,e[3]=r):r=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ct,{fallback:hs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(fs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==r?(a=s.jsx(Ie,{children:s.jsx(Ie.Content,{children:s.jsx(Ie.Body,{children:s.jsxs(mt,{children:[r,n]})})})}),e[5]=r,e[6]=a):a=e[6],a}function hs(e){const{error:t}=e;return s.jsx(ps,{error:t??new Error("Failed to load AI providers")})}function _i(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(gs,{})}),e[0]=t):t=e[0],t}export{_i as default};
|
|
1
|
+
import{Z as X,$ as K,_ as Ae,a3 as Ke,a4 as ne,a0 as ze,b9 as Oe,c as Z,b as re,a2 as Le,a1 as Ve,r as W,j as s,a5 as at,t as ee,av as Qe,F as _e,o as ke,e as ae,K as ie,n as Re,m as Ue,B as se,v as Ge,p as $e,E as ct}from"./index-GPtGFYbO.js";import{i as dt}from"./AlertCircle-CEGqDvaA.js";import{P as Ie}from"./index-DUWa0kTK.js";import{S as Ee}from"./skeleton-E7dM1cU6.js";import{b as We,a as Me,S as Te,c as mt}from"./settings-section-CAbLKYDo.js";import{u as Ye,b as we,i as ut,c as pt,p as ft,d as Fe,e as gt,f as Je}from"./use-ai-providers-a-L8T3uD.js";import{i as ht}from"./CheckCircle-DObEUtRu.js";import{b as xt,j as vt}from"./use-organization-settings-JoyMX7--.js";import{c as bt,d as Ze,P as yt,C as qe}from"./select-model-CAkcqYBe.js";import{u as jt}from"./use-debounced-autosave-zC-uauJa.js";import{I as Ce}from"./input-C4kw1M0o.js";import{T as He,a as St}from"./toggle-group-DhBiPEmR.js";import{A as Xe,a as et,b as tt,c as st,d as it,e as rt,f as ot,g as lt}from"./alert-dialog-DC6Lplgx.js";import{u as ce}from"./studio-tools-BDRk_Gqu.js";import{s as Ct}from"./Plus-Cuw6ld9s.js";import{p as _t,f as kt}from"./pt-BR-CLy76QW2.js";import{c as Pt}from"./Tool01-n6deJtHB.js";import{s as Nt}from"./Trash01-BysA7V0F.js";import{A as It}from"./avatar-Cen-fEa-.js";import{P as wt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Dt}from"./Settings02-D9mUVp_d.js";import{s as Kt}from"./Eye-B0s0rmgv.js";import{b as At,a as Rt,d as Et,e as Mt,c as Tt}from"./dialog-f2gIoJyo.js";import{S as Ft}from"./spinner-BKYiVvRF.js";import{R as Ot}from"./require-capability-CPhtITFk.js";import"./sidebar-BKLfDbJN.js";import"./LayoutLeft-B8TJ15_W.js";import"./use-mobile-DoH3Zs0T.js";import"./X-Bb9AvrlL.js";import"./tooltip-Btz0jJUy.js";import"./card-bfZkFKGg.js";import"./ArrowUpRight-DNskIx7Q.js";import"./use-mcp-client-B8hPaR2x.js";import"./auth-B_fsW_pO.js";import"./drawer-BM7WsZWa.js";import"./chat-context-CViMhULY.js";import"./tab-id-BiJME16N.js";import"./Check-B8suwSr9.js";import"./Copy01-C9sG-6D6.js";import"./hooks-IaMFwizq.js";import"./decopilot-sse-pool-H9DQ4gY8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Bo4QPAh_.js";import"./use-decopilot-events-eIVvjBw7.js";import"./checkbox-BiqXdTZP.js";import"./select-DCUthKzq.js";import"./ChevronDown-C6kSK4xi.js";import"./ChevronUp-DHnR36Wm.js";import"./ArrowLeft-D-GaGLbo.js";import"./Key01-kW6GScFx.js";import"./SearchMd-BPfugAIu.js";import"./Monitor01-BJd3P9Bs.js";import"./ChevronRight-BIidR9SM.js";import"./Stars01-04iBWvYW.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-BvPxxSqY.js";import"./use-capability-7E41d664.js";import"./access-gate-DBwhIB9O.js";import"./capability-load-error-5XD0Oq4g.js";X({title:K(),url:K(),icon:K()});X({registries:Ke(K(),X({enabled:ne()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:Ae(K()).describe("List of MCP app_name or app_id values to hide from the store.")});const le=X({keyId:K(),modelId:K(),title:K().optional()}).nullable();ze(["fast","smart","thinking","image","web_search","deep_research"]);ze(["fast","smart","thinking"]);const Ut=X({tiers:X({fast:le,smart:le,thinking:le,image:le,web_search:le,deep_research:le})});X({tiers:X({fast:le.optional(),smart:le.optional(),thinking:le.optional()})});X({ids:Ae(K()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});X({demo_mode:ne().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:ne().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),qa_agent_enabled:ne().optional().describe("Run the QA Agent on a task's pull request once it's In Review — it verifies the task actually solved the problem (exercises the feature, not just the diff)."),code_reviewer_enabled:ne().optional().describe("Run the Code Reviewer on a task's pull request once it's In Review — it reviews the code using the repo's stack-appropriate review skills."),auto_merge:ne().optional().describe("When every enabled reviewer (QA Agent / Code Reviewer) approves a task's pull request, merge it automatically instead of leaving the merge to a human. If the merge is blocked by a conflict with the base branch, hand the PR back to the Super Agent to resolve the conflict (check out the branch, merge the base, push) so it can then merge."),auto_assign_report_tasks_to_super_agent:ne().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned.")});X({id:K().describe("Brand context ID"),name:K().describe("Company name"),domain:K().describe("Company domain (e.g. example.com)"),overview:K().describe("Company overview / description"),logo:K().nullable().optional().describe("Logo URL"),favicon:K().nullable().optional().describe("Favicon URL"),ogImage:K().nullable().optional().describe("OG image URL"),fonts:X({heading:K().optional().describe("Font family for headings"),body:K().optional().describe("Font family for body text"),code:K().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:X({primary:K().optional().describe("Primary brand color (hex)"),secondary:K().optional().describe("Secondary brand color (hex)"),accent:K().optional().describe("Accent / highlight color (hex)"),background:K().optional().describe("Background color (hex)"),foreground:K().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:Ae(Ke(K(),Oe())).nullable().optional().describe("Brand images"),metadata:Ke(K(),Oe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:K().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:ne().optional().describe("Whether this is the default brand for the organization")});const $t=e=>e.capabilities?.includes("image")===!0,qt=e=>ut(e),Ht=e=>pt(e),Bt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:$t},{key:"web_search",filter:qt},{key:"deep_research",filter:Ht}];function zt(e){const t=Z.c(30),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Ye(),o=c.some(C=>C.id===i?.keyId)?i?.keyId:null,[u,_]=W.useState(o??a);let y,l;t[0]!==o?(y=()=>{o&&_(o)},l=[o],t[0]=o,t[1]=y,t[2]=l):(y=t[1],l=t[2]),W.useEffect(y,l);let f;t[3]!==c||t[4]!==a||t[5]!==u?(f=c.some(C=>C.id===u)?u:a,t[3]=c,t[4]=a,t[5]=u,t[6]=f):f=t[6];const m=f;let p;t[7]!==m||t[8]!==c?(p=m?c.find(C=>C.id===m):null,t[7]=m,t[8]=c,t[9]=p):p=t[9];const P=p,{models:x,isLoading:v}=we(n?m??void 0:void 0),g=n?v||x.some(n):!0;let k;t[10]!==i||t[11]!==P?.providerId||t[12]!==o?(k=i&&o?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:P?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=P?.providerId,t[12]=o,t[13]=k):k=t[13];const I=k,h=re();if(n&&!g){let C;t[14]!==h?(C=h("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=h,t[15]=C):C=t[15];let w;return t[16]!==C?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=w):w=t[17],w}let j;t[18]!==h?(j=h("settings.simpleModeSection.pickModel"),t[18]=h,t[19]=j):j=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=C=>_(C),t[20]=S):S=t[20];let d;t[21]!==m||t[22]!==r?(d=C=>{const w=C.keyId??m??"";_(w),r({keyId:w,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=r,t[23]=d):d=t[23];let b;return t[24]!==m||t[25]!==n||t[26]!==I||t[27]!==j||t[28]!==d?(b=s.jsx(bt,{variant:"bordered",placeholder:j,model:I,credentialId:m,filterModels:n,onCredentialChange:S,onModelChange:d}),t[24]=m,t[25]=n,t[26]=I,t[27]=j,t[28]=d,t[29]=b):b=t[29],b}function Lt(e){const t=Z.c(10),{isPending:i,showSaved:r}=e,n=re();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Qe,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let o;return t[3]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=o):o=t[4],o}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ht,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let o;return t[8]!==c?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=o):o=t[9],o}return null}function Vt(){const e=Z.c(58),t=re(),i=Ye(),r=xt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Le(Ut),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const o=Ve(c),{mutate:u,isPending:_,isSuccess:y}=vt(),l=o.formState.isDirty;let f;e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==u?(f={delayMs:250,save:async()=>{const N=o.getValues();u(N,{onSuccess:()=>o.reset(N,{keepValues:!0}),onError:F=>{o.reset(r),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=o,e[4]=r,e[5]=t,e[6]=u,e[7]=f):f=e[7];const{schedule:m}=jt(f),p=i[0],P=i[1],x=i[2],{models:v}=we(p?.id),{models:g}=we(P?.id),{models:k}=we(x?.id);let I,h;e[8]!==o||e[9]!==n?(I=()=>{n||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},h=[n,o],e[8]=o,e[9]=n,e[10]=I,e[11]=h):(I=e[10],h=e[11]),W.useEffect(I,h);let j;e[12]!==i||e[13]!==o||e[14]!==p||e[15]!==P||e[16]!==x||e[17]!==v||e[18]!==g||e[19]!==k?(j=()=>{const N=o.getValues(),F=new Set(i.map(Qt)),O={};p?.id&&(O[p.id]=v),P?.id&&(O[P.id]=g),x?.id&&(O[x.id]=k);const T=G=>G!=null&&!F.has(G.keyId),D={fast:T(N.tiers.fast)?null:N.tiers.fast,smart:T(N.tiers.smart)?null:N.tiers.smart,thinking:T(N.tiers.thinking)?null:N.tiers.thinking,image:T(N.tiers.image)?null:N.tiers.image,web_search:T(N.tiers.web_search)?null:N.tiers.web_search,deep_research:T(N.tiers.deep_research)?null:N.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,J=D.fast===N.tiers.fast&&D.smart===N.tiers.smart&&D.thinking===N.tiers.thinking&&D.image===N.tiers.image&&D.web_search===N.tiers.web_search&&D.deep_research===N.tiers.deep_research;if(!Y&&J)return;const z=ft(i,O);o.reset({tiers:{fast:D.fast??z.chat.fast,smart:D.smart??z.chat.smart,thinking:D.thinking??z.chat.thinking,image:D.image??z.image,web_search:D.web_search??z.webSearch,deep_research:D.deep_research??z.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=o,e[14]=p,e[15]=P,e[16]=x,e[17]=v,e[18]=g,e[19]=k,e[20]=j):j=e[20];const S=p?.id,d=P?.id,b=x?.id;let C;e[21]!==i||e[22]!==o||e[23]!==v||e[24]!==g||e[25]!==k||e[26]!==S||e[27]!==d||e[28]!==b?(C=[o,i,v,g,k,S,d,b],e[21]=i,e[22]=o,e[23]=v,e[24]=g,e[25]=k,e[26]=S,e[27]=d,e[28]=b,e[29]=C):C=e[29],W.useEffect(j,C);let w;e[30]!==t?(w=N=>({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")})[N]||N,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=N=>({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")})[N]||"",e[32]=t,e[33]=A):A=e[33];const E=A;let M;e[34]!==t?(M=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=M):M=e[35];let U;e[36]!==t?(U=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=U):U=e[37];let L;e[38]!==U?(L=s.jsx("p",{className:"text-sm text-muted-foreground",children:U}),e[38]=U,e[39]=L):L=e[39];const Q=y&&!l;let $;e[40]!==_||e[41]!==Q?($=s.jsx(Lt,{isPending:_,showSaved:Q}),e[40]=_,e[41]=Q,e[42]=$):$=e[42];let q;e[43]!==L||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[L,$]}),e[43]=L,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==o.control||e[48]!==E||e[49]!==R||e[50]!==m?(H=Bt.map(N=>s.jsx(at,{control:o.control,name:`tiers.${N.key}`,render:F=>{const{field:O}=F;return s.jsx(We,{title:R(N.key),description:E(N.key),action:s.jsx(zt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:N.filter,onSlotChange:T=>{O.onChange(T),m()}})})}},N.key)),e[46]=i[0]?.id,e[47]=o.control,e[48]=E,e[49]=R,e[50]=m,e[51]=H):H=e[51];let B;e[52]!==H?(B=s.jsx(Me,{children:H}),e[52]=H,e[53]=B):B=e[53];let V;return e[54]!==M||e[55]!==q||e[56]!==B?(V=s.jsxs(Te,{title:M,headerClassName:"pl-0",children:[q,B]}),e[54]=M,e[55]=q,e[56]=B,e[57]=V):V=e[57],V}function Qt(e){return e.id}const Gt={usd:[10,20,100],brl:[50,100,500]};function Wt(){const e=Z.c(30),t=re(),i=ce(),[r]=Ge(),[n,a]=W.useState(!1);let c;e[0]!==t?(c=d=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:d.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:o,isPending:u}=ae({mutationFn:async d=>{const{url:b}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:d,currency:m});return b},onSuccess:Yt,onError:c}),[_,y]=W.useState(""),[l,f]=W.useState(r.language==="pt-BR"?"brl":"usd"),m=l,p=parseFloat(_),P=!isNaN(p)&&p>=1,x=m==="brl"?"R$":"$";let v;e[2]!==f?(v=d=>{d&&f(d)},e[2]=f,e[3]=v):v=e[3];let g,k;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(He,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),k=s.jsx(He,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=g,e[5]=k):(g=e[4],k=e[5]);let I;e[6]!==m||e[7]!==v?(I=s.jsxs(St,{type:"single",variant:"outline",size:"default",value:m,onValueChange:v,children:[g,k]}),e[6]=m,e[7]=v,e[8]=I):I=e[8];let h;e[9]!==m||e[10]!==x||e[11]!==n||e[12]!==u||e[13]!==t||e[14]!==o?(h=!n&&s.jsxs(s.Fragment,{children:[Gt[m].map(d=>s.jsxs(se,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:u,onClick:()=>o(d*100),children:[x,d]},d)),s.jsx(se,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:u,children:t("settings.decoCreditsHero.custom")})]}),e[9]=m,e[10]=x,e[11]=n,e[12]=u,e[13]=t,e[14]=o,e[15]=h):h=e[15];let j;e[16]!==x||e[17]!==_||e[18]!==p||e[19]!==n||e[20]!==P||e[21]!==u||e[22]!==y||e[23]!==t||e[24]!==o?(j=n&&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:x}),s.jsx(Ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:_,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(se,{className:"h-10",disabled:!P||u,onClick:()=>o(Math.round(p*100)),children:u?"...":t("settings.decoCreditsHero.add")}),s.jsx(se,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=x,e[17]=_,e[18]=p,e[19]=n,e[20]=P,e[21]=u,e[22]=y,e[23]=t,e[24]=o,e[25]=j):j=e[25];let S;return e[26]!==I||e[27]!==h||e[28]!==j?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I,h,j]})}),e[26]=I,e[27]=h,e[28]=j,e[29]=S):S=e[29],S}function Yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Jt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Zt(){const e=Z.c(121),t=re(),{org:i}=_e(),r=ce(),n=ke(),a=Fe();let c;e[0]!==a?(c=a.find(Xt),e[0]=a,e[1]=c):c=e[1];const o=c,[u,_]=W.useState(!1);let y;e[2]!==o||e[3]!==r?(y=async()=>{o&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=r,e[4]=y):y=e[4];let l;e[5]!==i.id||e[6]!==n||e[7]!==t?(l=()=>{n.invalidateQueries({queryKey:ie.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:ie.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=l):l=e[8];let f;e[9]!==t?(f=nt=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:nt.message}))},e[9]=t,e[10]=f):f=e[10];let m;e[11]!==y||e[12]!==l||e[13]!==f?(m={mutationFn:y,onSuccess:l,onError:f},e[11]=y,e[12]=l,e[13]=f,e[14]=m):m=e[14];const{mutate:p,isPending:P}=ae(m);let x;e[15]!==i.id?(x=ie.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=x):x=e[16];const v=!!o;let g;e[17]!==r?(g=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=r,e[18]=g):g=e[18];let k;e[19]!==x||e[20]!==v||e[21]!==g?(k={queryKey:x,enabled:v,staleTime:6e4,queryFn:g},e[19]=x,e[20]=v,e[21]=g,e[22]=k):k=e[22];const{data:I,isLoading:h,refetch:j,isFetching:S}=Re(k);if(!o)return null;const d=I?.balanceCents!=null?I.balanceCents/100:null;let b;e[23]!==d?(b=d!=null?`$${d.toFixed(2)}`:"—",e[23]=d,e[24]=b):b=e[24];const C=b;let w;e[25]!==t?(w=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=w):w=e[26];let R;e[27]!==t?(R=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=R):R=e[28];let A;e[29]!==R?(A=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:R,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=R,e[30]=A):A=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let M;e[33]!==E?(M=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=M):M=e[34];let U;e[35]!==A||e[36]!==M?(U=s.jsxs("div",{className:"flex items-center gap-3",children:[A,M]}),e[35]=A,e[36]=M,e[37]=U):U=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=()=>_(!0),e[38]=L):L=e[38];let Q;e[39]!==t?(Q=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=Q):Q=e[40];let $;e[41]!==P||e[42]!==Q?($=s.jsx(se,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:L,disabled:P,children:Q}),e[41]=P,e[42]=Q,e[43]=$):$=e[43];let q;e[44]!==U||e[45]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between",children:[U,$]}),e[44]=U,e[45]=$,e[46]=q):q=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let B;e[49]!==H?(B=s.jsx(Xe,{children:H}),e[49]=H,e[50]=B):B=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let N;e[53]!==V?(N=s.jsx(et,{children:V}),e[53]=V,e[54]=N):N=e[54];let F;e[55]!==B||e[56]!==N?(F=s.jsxs(tt,{children:[B,N]}),e[55]=B,e[56]=N,e[57]=F):F=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let T;e[60]!==O?(T=s.jsx(st,{children:O}),e[60]=O,e[61]=T):T=e[61];let D;e[62]!==p?(D=()=>p(),e[62]=p,e[63]=D):D=e[63];let Y;e[64]!==t?(Y=t("settings.decoCreditsHero.disconnectButton"),e[64]=t,e[65]=Y):Y=e[65];let J;e[66]!==D||e[67]!==Y?(J=s.jsx(it,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=J):J=e[68];let z;e[69]!==T||e[70]!==J?(z=s.jsxs(rt,{children:[T,J]}),e[69]=T,e[70]=J,e[71]=z):z=e[71];let G;e[72]!==F||e[73]!==z?(G=s.jsxs(ot,{children:[F,z]}),e[72]=F,e[73]=z,e[74]=G):G=e[74];let oe;e[75]!==u||e[76]!==G?(oe=s.jsx(lt,{open:u,onOpenChange:_,children:G}),e[75]=u,e[76]=G,e[77]=oe):oe=e[77];let te;e[78]!==d||e[79]!==C||e[80]!==S||e[81]!==h?(te=h||S?s.jsx(Ee,{className:"h-9 w-24"}):s.jsx("span",{className:Ue("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&Jt(d)),children:C}),e[78]=d,e[79]=C,e[80]=S,e[81]=h,e[82]=te):te=e[82];let de;e[83]!==j?(de=()=>j(),e[83]=j,e[84]=de):de=e[84];let me;e[85]!==t?(me=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=me):me=e[86];const De=S&&"animate-spin";let ue;e[87]!==De?(ue=Ue(De),e[87]=De,e[88]=ue):ue=e[88];let pe;e[89]!==ue?(pe=s.jsx(Qe,{size:14,className:ue}),e[89]=ue,e[90]=pe):pe=e[90];let fe;e[91]!==S||e[92]!==de||e[93]!==me||e[94]!==pe?(fe=s.jsx("button",{type:"button",onClick:de,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":me,children:pe}),e[91]=S,e[92]=de,e[93]=me,e[94]=pe,e[95]=fe):fe=e[95];let ge;e[96]!==te||e[97]!==fe?(ge=s.jsxs("div",{className:"flex items-baseline gap-2",children:[te,fe]}),e[96]=te,e[97]=fe,e[98]=ge):ge=e[98];let he;e[99]!==t?(he=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=he):he=e[100];let xe;e[101]!==he?(xe=s.jsx("p",{className:"text-xs text-muted-foreground",children:he}),e[101]=he,e[102]=xe):xe=e[102];let ve;e[103]!==ge||e[104]!==xe?(ve=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[ge,xe]}),e[103]=ge,e[104]=xe,e[105]=ve):ve=e[105];let be;e[106]!==t?(be=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=be):be=e[107];let ye;e[108]!==be?(ye=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:be}),e[108]=be,e[109]=ye):ye=e[109];let Pe;e[110]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(Wt,{}),e[110]=Pe):Pe=e[110];let je;e[111]!==ye?(je=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[ye,Pe]}),e[111]=ye,e[112]=je):je=e[112];let Se;e[113]!==q||e[114]!==oe||e[115]!==ve||e[116]!==je?(Se=s.jsx(Me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[q,oe,ve,je]})}),e[113]=q,e[114]=oe,e[115]=ve,e[116]=je,e[117]=Se):Se=e[117];let Ne;return e[118]!==w||e[119]!==Se?(Ne=s.jsx(Te,{title:w,children:Se}),e[118]=w,e[119]=Se,e[120]=Ne):Ne=e[120],Ne}function Xt(e){return e.providerId==="deco"}function es(){const e=Z.c(12),{org:t}=_e(),i=ce(),r=ke(),n=re();let a;e[0]!==i?(a=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=a):a=e[1];let c;e[2]!==t||e[3]!==r||e[4]!==n?(c=()=>{$e("ai_provider_provision_succeeded",{provider_id:"deco"}),r.invalidateQueries({queryKey:ie.aiProviderKeys(t.id)}),r.invalidateQueries({queryKey:ie.aiProviders(t.id)}),ee.success(n("settings.aiProviders.decoConnectSuccess"))},e[2]=t,e[3]=r,e[4]=n,e[5]=c):c=e[5];let o;e[6]!==n?(o=_=>{$e("ai_provider_provision_failed",{provider_id:"deco",error:_.message}),ee.error(n("settings.aiProviders.decoConnectError",{error:_.message}))},e[6]=n,e[7]=o):o=e[7];let u;return e[8]!==a||e[9]!==c||e[10]!==o?(u={mutationFn:a,onSuccess:c,onError:o},e[8]=a,e[9]=c,e[10]=o,e[11]=u):u=e[11],ae(u)}function ts(){const e=Z.c(37),t=re(),{mutate:i,isPending:r}=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 a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=a):a=e[1];let c;e[2]!==t?(c=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=c):c=e[3];let o;e[4]!==c?(o=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:c,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=c,e[5]=o):o=e[5];let u;e[6]!==t?(u=t("settings.decoNudgeCard.decoAiGateway"),e[6]=t,e[7]=u):u=e[7];let _;e[8]!==u?(_=s.jsx("p",{className:"text-base font-semibold",children:u}),e[8]=u,e[9]=_):_=e[9];let y;e[10]!==t?(y=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=y):y=e[11];let l;e[12]!==y?(l=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:y}),e[12]=y,e[13]=l):l=e[13];let f;e[14]!==_||e[15]!==l?(f=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,l]}),e[14]=_,e[15]=l,e[16]=f):f=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let p;e[19]!==m?(p=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=p):p=e[20];let P;e[21]!==p||e[22]!==f?(P=s.jsxs("div",{className:"flex-1 min-w-0",children:[f,p]}),e[21]=p,e[22]=f,e[23]=P):P=e[23];let x;e[24]!==i?(x=()=>i(),e[24]=i,e[25]=x):x=e[25];let v;e[26]!==r||e[27]!==t?(v=t(r?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=r,e[27]=t,e[28]=v):v=e[28];let g;e[29]!==r||e[30]!==x||e[31]!==v?(g=s.jsx(se,{variant:"outline",disabled:r,onClick:x,children:v}),e[29]=r,e[30]=x,e[31]=v,e[32]=g):g=e[32];let k;return e[33]!==P||e[34]!==g||e[35]!==o?(k=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[a,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[o,P,g]})]}),e[33]=P,e[34]=g,e[35]=o,e[36]=k):k=e[36],k}const ss=e=>X({label:K().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:K().optional(),baseUrl:K().optional()});function is({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:r}){return e&&!!t&&t!==i&&!r}function rs({providerKey:e,provider:t,preset:i,maskedKey:r,currentLabel:n,currentBaseUrl:a,onCancel:c,onSuccess:o}){const{org:u}=_e(),_=ce(),y=ke(),l=re(),[f,m]=W.useState(!1),p=t.id==="openai-compatible",P=t.supportedMethods.includes("api-key"),x=ss(l),{register:v,handleSubmit:g,watch:k,setError:I,formState:{errors:h}}=Ve({resolver:Le(x),defaultValues:{label:n,apiKey:"",baseUrl:a??""}}),j=k("apiKey")??"",{mutate:S,isPending:d}=ae({mutationFn:async b=>{let C;b.apiKey&&(p?C=JSON.stringify({baseUrl:b.baseUrl||a||"",apiKey:b.apiKey}):C=b.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:b.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{y.invalidateQueries({queryKey:ie.aiProviderKeys(u.id)}),y.invalidateQueries({queryKey:ie.aiProviders(u.id)}),ee.success(l("settings.editProviderDialog.providerUpdated")),o()},onError:b=>ee.error(l("settings.editProviderDialog.failedToUpdate",{error:b.message}))});return s.jsxs("form",{onSubmit:g(b=>{if(is({isOpenAICompatible:p,baseUrl:b.baseUrl,currentBaseUrl:a,apiKey:b.apiKey})){I("apiKey",{message:l("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}S(b)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.label")}),s.jsx(Ce,{placeholder:l("settings.editProviderDialog.labelPlaceholder"),...v("label"),className:"h-8 text-sm"}),h.label&&s.jsx("p",{className:"text-xs text-destructive",children:h.label.message})]}),p&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:l("settings.editProviderDialog.baseUrl")}),s.jsx(Ce,{type:"url",placeholder:i?.baseUrlPlaceholder??l("settings.editProviderDialog.baseUrlPlaceholder"),...v("baseUrl"),className:"h-8 text-sm"})]}),P&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[l("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",l("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(Ce,{type:f&&j?"text":"password",placeholder:r,...v("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),j&&s.jsx("button",{type:"button",onClick:()=>m(!f),"aria-label":l(f?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:f?s.jsx(Dt,{size:14}):s.jsx(Kt,{size:14})})]}),h.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:h.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Tt,{children:[s.jsx(se,{type:"button",variant:"ghost",size:"sm",onClick:c,disabled:d,children:l("settings.editProviderDialog.cancel")}),s.jsx(se,{type:"submit",size:"sm",disabled:d,children:l(d?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function os(e){const t=Z.c(31),{providerKey:i,provider:r,open:n,onOpenChange:a}=e,c=re(),o=ce(),u=r.id==="openai-compatible"&&i.presetId?Ze(i.presetId):void 0,_=u?.name??r.name;let y;t[0]!==i.id?(y=ie.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=y):y=t[1];let l;t[2]!==i.id||t[3]!==o?(l=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=o,t[4]=l):l=t[4];let f;t[5]!==n||t[6]!==y||t[7]!==l?(f={queryKey:y,queryFn:l,enabled:n,staleTime:0},t[5]=n,t[6]=y,t[7]=l,t[8]=f):f=t[8];const{data:m,isLoading:p}=Re(f),P=Mt,x=Et,v="sm:max-w-md",g=Rt,k=At,I=c("settings.editProviderDialog.editTitle",{name:_});let h;t[9]!==k||t[10]!==I?(h=s.jsx(k,{children:I}),t[9]=k,t[10]=I,t[11]=h):h=t[11];let j;t[12]!==g||t[13]!==h?(j=s.jsx(g,{children:h}),t[12]=g,t[13]=h,t[14]=j):j=t[14];let S;t[15]!==p||t[16]!==a||t[17]!==u||t[18]!==m||t[19]!==r||t[20]!==i?(S=p||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Ft,{})}):s.jsx(rs,{providerKey:i,provider:r,preset:u,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[15]=p,t[16]=a,t[17]=u,t[18]=m,t[19]=r,t[20]=i,t[21]=S):S=t[21];let d;t[22]!==x||t[23]!==j||t[24]!==S?(d=s.jsxs(x,{className:v,children:[j,S]}),t[22]=x,t[23]=j,t[24]=S,t[25]=d):d=t[25];let b;return t[26]!==P||t[27]!==a||t[28]!==n||t[29]!==d?(b=s.jsx(P,{open:n,onOpenChange:a,children:d}),t[26]=P,t[27]=a,t[28]=n,t[29]=d,t[30]=b):b=t[30],b}function ls(e){const t=Z.c(86),{providerKey:i,provider:r}=e,{org:n}=_e(),a=ce(),c=ke(),[o,u]=W.useState(!1),[_,y]=W.useState(!1),l=re(),[f]=Ge(),m=f.language==="pt-BR"?_t:void 0,p=r?.id==="openai-compatible";let P;t[0]!==p||t[1]!==i.presetId?(P=p&&i.presetId?Ze(i.presetId):void 0,t[0]=p,t[1]=i.presetId,t[2]=P):P=t[2];const x=P;let v;t[3]!==p||t[4]!==x||t[5]!==r?.name||t[6]!==i.providerId||t[7]!==l?(v=x?x.name:p?l("settings.aiProviders.customOpenAiCompatible"):r?.name??(i.providerId==="claude-code"?l("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?l("settings.providerKeyRow.codex"):i.providerId),t[3]=p,t[4]=x,t[5]=r?.name,t[6]=i.providerId,t[7]=l,t[8]=v):v=t[8];const g=v,k=x?.logo??r?.logo??wt[i.providerId];let I;e:{if(p){I=i.label;break e}let te;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==l?(te=l("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:kt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=l,t[13]=te):te=t[13],I=te}const h=I;let j;t[14]!==i.id||t[15]!==a?(j=async()=>{await a.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=a,t[16]=j):j=t[16];let S;t[17]!==n||t[18]!==i.id||t[19]!==c||t[20]!==l?(S=()=>{c.invalidateQueries({queryKey:ie.aiProviderKeys(n.id)}),c.invalidateQueries({queryKey:ie.aiProviders(n.id)}),c.invalidateQueries({queryKey:ie.aiProviderModels(n.id,i.id)}),ee.success(l("settings.providerKeyRow.keyDeleted")),u(!1)},t[17]=n,t[18]=i.id,t[19]=c,t[20]=l,t[21]=S):S=t[21];let d;t[22]!==l?(d=te=>ee.error(l("settings.providerKeyRow.failedToDeleteKey",{error:te.message})),t[22]=l,t[23]=d):d=t[23];let b;t[24]!==j||t[25]!==S||t[26]!==d?(b={mutationFn:j,onSuccess:S,onError:d},t[24]=j,t[25]=S,t[26]=d,t[27]=b):b=t[27];const{mutate:C,isPending:w}=ae(b);let R;t[28]!==g||t[29]!==k?(R=k?s.jsx("img",{src:k,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(It,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=k,t[30]=R):R=t[30];let A;t[31]!==r||t[32]!==l?(A=r?s.jsx(se,{variant:"ghost",size:"icon","aria-label":l("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>y(!0),children:s.jsx(Pt,{size:14})}):null,t[31]=r,t[32]=l,t[33]=A):A=t[33];let E;t[34]!==l?(E=l("settings.providerKeyRow.deleteProviderKey"),t[34]=l,t[35]=E):E=t[35];let M,U;t[36]===Symbol.for("react.memo_cache_sentinel")?(M=()=>u(!0),U=s.jsx(Nt,{size:14}),t[36]=M,t[37]=U):(M=t[36],U=t[37]);let L;t[38]!==w||t[39]!==E?(L=s.jsx(se,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:w,onClick:M,children:U}),t[38]=w,t[39]=E,t[40]=L):L=t[40];let Q;t[41]!==L||t[42]!==A?(Q=s.jsxs("div",{className:"flex items-center gap-0.5",children:[A,L]}),t[41]=L,t[42]=A,t[43]=Q):Q=t[43];let $;t[44]!==h||t[45]!==g||t[46]!==Q||t[47]!==R?($=s.jsx(We,{icon:R,title:g,description:h,action:Q}),t[44]=h,t[45]=g,t[46]=Q,t[47]=R,t[48]=$):$=t[48];let q;t[49]!==_||t[50]!==r||t[51]!==i?(q=r?s.jsx(os,{providerKey:i,provider:r,open:_,onOpenChange:y}):null,t[49]=_,t[50]=r,t[51]=i,t[52]=q):q=t[52];let H;t[53]!==l?(H=l("settings.providerKeyRow.deleteApiKey"),t[53]=l,t[54]=H):H=t[54];let B;t[55]!==H?(B=s.jsx(Xe,{children:H}),t[55]=H,t[56]=B):B=t[56];let V;t[57]!==i.label?(V=s.jsxs(et,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]}),t[57]=i.label,t[58]=V):V=t[58];let N;t[59]!==B||t[60]!==V?(N=s.jsxs(tt,{children:[B,V]}),t[59]=B,t[60]=V,t[61]=N):N=t[61];let F;t[62]!==l?(F=l("settings.providerKeyRow.cancel"),t[62]=l,t[63]=F):F=t[63];let O;t[64]!==F?(O=s.jsx(st,{children:F}),t[64]=F,t[65]=O):O=t[65];let T;t[66]!==C?(T=()=>C(),t[66]=C,t[67]=T):T=t[67];let D;t[68]!==l?(D=l("settings.providerKeyRow.delete"),t[68]=l,t[69]=D):D=t[69];let Y;t[70]!==T||t[71]!==D?(Y=s.jsx(it,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=T,t[71]=D,t[72]=Y):Y=t[72];let J;t[73]!==O||t[74]!==Y?(J=s.jsxs(rt,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=J):J=t[75];let z;t[76]!==N||t[77]!==J?(z=s.jsxs(ot,{children:[N,J]}),t[76]=N,t[77]=J,t[78]=z):z=t[78];let G;t[79]!==o||t[80]!==z?(G=s.jsx(lt,{open:o,onOpenChange:u,children:z}),t[79]=o,t[80]=z,t[81]=G):G=t[81];let oe;return t[82]!==$||t[83]!==q||t[84]!==G?(oe=s.jsxs(s.Fragment,{children:[$,q,G]}),t[82]=$,t[83]=q,t[84]=G,t[85]=oe):oe=t[85],oe}function ns(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 as(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(r=>r.id===i.providerId)??null}))}function Be(e){const t=Z.c(13),{onConnectClick:i}=e,r=re(),n=Fe(),a=Je();let c;if(t[0]!==a?.providers||t[1]!==n||t[2]!==i||t[3]!==r){const o=a?.providers??[],u=as(n,o);let _;t[5]!==r?(_=r("settings.connectedProvidersSection.sectionTitle"),t[5]=r,t[6]=_):_=t[6];let y;t[7]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ct,{size:14}),t[7]=y):y=t[7];let l;t[8]!==r?(l=r("settings.connectedProvidersSection.connectButton"),t[8]=r,t[9]=l):l=t[9];let f;t[10]!==i||t[11]!==l?(f=s.jsxs(se,{size:"sm",onClick:i,children:[y,l]}),t[10]=i,t[11]=l,t[12]=f):f=t[12],c=s.jsx(Te,{title:_,headerClassName:"px-0",actions:f,children:u.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:r("settings.connectedProvidersSection.emptyState")}):s.jsx(Me,{children:u.map(cs)})}),t[0]=a?.providers,t[1]=n,t[2]=i,t[3]=r,t[4]=c}else c=t[4];return c}function cs(e){const{key:t,provider:i}=e;return s.jsx(ls,{providerKey:t,provider:i},t.id)}function ds(){const e=Z.c(55),t=re(),{org:i}=_e(),r=ce(),n=ke(),[a,c]=W.useState("");let o;e[0]!==i.id?(o=ie.claudeSubscription(i.id),e[0]=i.id,e[1]=o):o=e[1];let u;e[2]!==r?(u=()=>r.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=r,e[3]=u):u=e[3];let _;e[4]!==o||e[5]!==u?(_={queryKey:o,queryFn:u},e[4]=o,e[5]=u,e[6]=_):_=e[6];const y=Re(_);let l;e[7]!==i.id||e[8]!==n?(l=()=>n.invalidateQueries({queryKey:ie.claudeSubscription(i.id)}),e[7]=i.id,e[8]=n,e[9]=l):l=e[9];const f=l;let m;e[10]!==r||e[11]!==a?(m=()=>r.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:a}),e[10]=r,e[11]=a,e[12]=m):m=e[12];let p;e[13]!==f||e[14]!==t?(p=async()=>{c(""),await f(),ee.success(t("settings.claudeSubscription.connected"))},e[13]=f,e[14]=t,e[15]=p):p=e[15];let P;e[16]!==m||e[17]!==p?(P={mutationFn:m,onSuccess:p,onError:us},e[16]=m,e[17]=p,e[18]=P):P=e[18];const x=ae(P);let v;e[19]!==r?(v=()=>r.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=r,e[20]=v):v=e[20];let g;e[21]!==f||e[22]!==t?(g=async()=>{await f(),ee.success(t("settings.claudeSubscription.disconnected"))},e[21]=f,e[22]=t,e[23]=g):g=e[23];let k;e[24]!==v||e[25]!==g?(k={mutationFn:v,onSuccess:g,onError:ms},e[24]=v,e[25]=g,e[26]=k):k=e[26];const I=ae(k),h=y.data?.connected===!0,j=!h&&!!y.data?.linkedAt;let S;e[27]!==t?(S=t("settings.claudeSubscription.title"),e[27]=t,e[28]=S):S=e[28];let d;e[29]!==S?(d=s.jsx("p",{className:"text-base font-semibold",children:S}),e[29]=S,e[30]=d):d=e[30];let b;e[31]!==h||e[32]!==j||e[33]!==t?(b=t(h?"settings.claudeSubscription.active":j?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=h,e[32]=j,e[33]=t,e[34]=b):b=e[34];let C;e[35]!==b?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),e[35]=b,e[36]=C):C=e[36];let w;e[37]!==d||e[38]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,C]}),e[37]=d,e[38]=C,e[39]=w):w=e[39];let R;e[40]!==h||e[41]!==I||e[42]!==t?(R=h?s.jsx(se,{variant:"outline",disabled:I.isPending,onClick:()=>I.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=h,e[41]=I,e[42]=t,e[43]=R):R=e[43];let A;e[44]!==w||e[45]!==R?(A=s.jsxs("div",{className:"flex items-center gap-4",children:[w,R]}),e[44]=w,e[45]=R,e[46]=A):A=e[46];let E;e[47]!==x||e[48]!==h||e[49]!==t||e[50]!==a?(E=h?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[t("settings.claudeSubscription.howTo")," ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:"claude setup-token"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ce,{type:"password",value:a,onChange:U=>c(U.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(se,{disabled:a.trim().length===0||x.isPending,onClick:()=>x.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=x,e[48]=h,e[49]=t,e[50]=a,e[51]=E):E=e[51];let M;return e[52]!==A||e[53]!==E?(M=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[A,E]}),e[52]=A,e[53]=E,e[54]=M):M=e[54],M}function ms(e){return ee.error(e.message)}function us(e){return ee.error(e.message)}function ps(e){const t=Z.c(3),{error:i}=e;let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(dt,{size:16}),t[0]=r):r=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:[r,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 fs(){const e=Z.c(27),t=Fe();let i;e[0]!==t?(i=ns(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:r,hasHostedProvider:n,hasDeco:a}=i,[c,o]=W.useState(!1),[u,_]=W.useState(null),y=Je();let l;e[2]!==y?.providers?(l=y?.providers??[],e[2]=y?.providers,e[3]=l):l=e[3];const f=l;if(!n){let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>o(!0),e[4]=k):k=e[4];let I;e[5]!==f?(I=s.jsx(yt,{providers:f,onSelect:_,onShowAll:k}),e[5]=f,e[6]=I):I=e[6];const h=u!==null||c;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=w=>{w||(_(null),o(!1))},e[7]=j):j=e[7];const S=u??void 0;let d;e[8]!==h||e[9]!==S?(d=s.jsx(qe,{open:h,onOpenChange:j,initialProvider:S}),e[8]=h,e[9]=S,e[10]=d):d=e[10];let b;e[11]!==r?(b=r?s.jsx(Be,{onConnectClick:()=>o(!0)}):null,e[11]=r,e[12]=b):b=e[12];let C;return e[13]!==I||e[14]!==d||e[15]!==b?(C=s.jsxs(s.Fragment,{children:[I,d,b]}),e[13]=I,e[14]=d,e[15]=b,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-16 w-full"}),children:s.jsx(Vt,{})}),e[17]=m):m=e[17];let p;e[18]!==a?(p=a?s.jsx(Zt,{}):s.jsx(ts,{}),e[18]=a,e[19]=p):p=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ds,{}),e[20]=P):P=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Be,{onConnectClick:()=>o(!0)}),e[21]=x):x=e[21];let v;e[22]!==c?(v=s.jsx(qe,{open:c,onOpenChange:o}),e[22]=c,e[23]=v):v=e[23];let g;return e[24]!==p||e[25]!==v?(g=s.jsxs(s.Fragment,{children:[m,p,P,x,v]}),e[24]=p,e[25]=v,e[26]=g):g=e[26],g}function gs(){const e=Z.c(7),t=re();let i;e[0]!==t?(i=t("settings.nav.aiProviders"),e[0]=t,e[1]=i):i=e[1];let r;e[2]!==i?(r=s.jsx(Ie.Title,{children:i}),e[2]=i,e[3]=r):r=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ct,{fallback:hs,children:s.jsx(W.Suspense,{fallback:s.jsx(Ee,{className:"h-64 w-full"}),children:s.jsx(fs,{})})}),e[4]=n):n=e[4];let a;return e[5]!==r?(a=s.jsx(Ie,{children:s.jsx(Ie.Content,{children:s.jsx(Ie.Body,{children:s.jsxs(mt,{children:[r,n]})})})}),e[5]=r,e[6]=a):a=e[6],a}function hs(e){const{error:t}=e;return s.jsx(ps,{error:t??new Error("Failed to load AI providers")})}function _i(){const e=Z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(gs,{})}),e[0]=t):t=e[0],t}export{_i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,m as o,j as c,bD as d}from"./index-
|
|
1
|
+
import{c as n,m as o,j as c,bD as d}from"./index-GPtGFYbO.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,cU as w,cW as T,aL as m,cY as A,dZ as O,H as M,aN as I,cV as L,d_ as D,cX as z,d4 as F,aJ as G,d6 as H,cZ as V,c as n,m as p,U as v}from"./index-
|
|
1
|
+
import{r as i,j as r,cU as w,cW as T,aL as m,cY as A,dZ as O,H as M,aN as I,cV as L,d_ as D,cX as z,d4 as F,aJ as G,d6 as H,cZ as V,c as n,m as p,U as v}from"./index-GPtGFYbO.js";var x="AlertDialog",[W]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var Y="AlertDialogTrigger",k=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});k.displayName=Y;var U="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=U;var Z="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(V,{...o,...a,ref:e})});_.displayName=Z;var f="AlertDialogContent",[q,B]=W(f),J=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:h,docsSlug:"alert-dialog",children:r.jsx(q,{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(K,{contentRef:c})]})})})});j.displayName=f;var h="AlertDialogTitle",b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});b.displayName=h;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var X="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=X;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=B($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var K=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,b as k,j as t,E as ie,r as F,B as N,t as I}from"./index-HWhUkMVs.js";import{i as le}from"./AlertCircle-0OUPWUNo.js";import{a as ne}from"./Copy01-Bm8H5mLb.js";import{i as M}from"./Key01-DE0cHxdc.js";import{s as Q}from"./Plus-BXW-bLkv.js";import{s as re}from"./Trash01-BSXuR-v0.js";import{g as ae,f as oe,b as ce,A as de,a as me,e as fe,c as pe,d as ue}from"./alert-dialog-BtRTtbG0.js";import{b as U,h as V,a as W,c as X,d as Y,e as Z}from"./dialog-DsCqITds.js";import{I as ee}from"./input-CDxc4QX0.js";import{L as xe}from"./label-CZbP70z-.js";import{S as ge}from"./skeleton-Y7gyZPrn.js";import{P as R}from"./index-6TRi0uef.js";import{c as ye}from"./settings-section-DzETP_0_.js";import{a as he,b as je,u as Ke}from"./use-api-keys-D0_X5TBd.js";import{R as be}from"./require-capability-V2e0LU3P.js";import"./X-B1FpD19v.js";import"./sidebar-DbMpr-rh.js";import"./LayoutLeft-B3Xq6Q9F.js";import"./use-mobile-nNGwbm7m.js";import"./tooltip-DO91iaPZ.js";import"./card-BgLseUz9.js";import"./ArrowUpRight-CHr_jXVV.js";import"./use-mcp-client-WNkI8KAJ.js";import"./auth-BxRabvv-.js";import"./use-capability-hVyOyKfv.js";import"./access-gate-BUqNYnUF.js";import"./capability-load-error-Bl4HXrb5.js";function Ce(r){const e=v.c(6),{error:c}=r,l=k();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(le,{size:16}),e[0]=i):i=e[0];let s;e[1]!==c.message||e[2]!==l?(s=l("settings.apiKeys.failedToLoadError",{error:c.message}),e[1]=c.message,e[2]=l,e[3]=s):s=e[3];let n;return e[4]!==s?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function De(r){const e=v.c(20),{apiKey:c,onDelete:l}=r,i=k();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==c.name?(n=t.jsx("span",{className:"font-medium text-sm truncate block",children:c.name}),e[1]=c.name,e[2]=n):n=e[2];let d;e[3]!==c.createdAt||e[4]!==i?(d=i("settings.apiKeys.createdAt",{date:new Date(c.createdAt).toLocaleDateString()}),e[3]=c.createdAt,e[4]=i,e[5]=d):d=e[5];let a;e[6]!==d?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:d}),e[6]=d,e[7]=a):a=e[7];let m;e[8]!==n||e[9]!==a?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[n,a]})]}),e[8]=n,e[9]=a,e[10]=m):m=e[10];let o;e[11]!==i?(o=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=o):o=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(re,{size:14}),e[13]=f):f=e[13];let u;e[14]!==l||e[15]!==o?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:l,"aria-label":o,children:f}),e[14]=l,e[15]=o,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function Ae(r){const e=v.c(21),{onCreate:c}=r,l=k();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==l?(s=l("settings.apiKeys.emptyTitle"),e[1]=l,e[2]=s):s=e[2];let n;e[3]!==s?(n=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let d;e[5]!==l?(d=l("settings.apiKeys.emptyDescription"),e[5]=l,e[6]=d):d=e[6];let a;e[7]!==d?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:d}),e[7]=d,e[8]=a):a=e[8];let m;e[9]!==n||e[10]!==a?(m=t.jsxs("div",{children:[n,a]}),e[9]=n,e[10]=a,e[11]=m):m=e[11];let o;e[12]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Q,{size:14}),e[12]=o):o=e[12];let f;e[13]!==l?(f=l("settings.apiKeys.newKey"),e[13]=l,e[14]=f):f=e[14];let u;e[15]!==c||e[16]!==f?(u=t.jsxs(N,{onClick:c,size:"sm",className:"mt-2",children:[o,f]}),e[15]=c,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function G(r){const e=v.c(40),{createdKey:c,onClose:l}=r,i=k(),s=c!==null;let n;e[0]!==l?(n=A=>!A&&l(),e[0]=l,e[1]=n):n=e[1];let d;e[2]!==i?(d=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(U,{children:d}),e[4]=d,e[5]=a):a=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let o;e[8]!==m?(o=t.jsx(V,{children:m}),e[8]=m,e[9]=o):o=e[9];let f;e[10]!==a||e[11]!==o?(f=t.jsxs(W,{children:[a,o]}),e[10]=a,e[11]=o,e[12]=f):f=e[12];const u=c?.key??"";let p;e[13]!==u?(p=t.jsx(ee,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==c||e[16]!==i?(x=()=>{c&&(navigator.clipboard?.writeText(c.key),I.success(i("settings.apiKeys.copied")))},e[15]=c,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ne,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==l||e[30]!==j?(K=t.jsx(X,{children:t.jsx(N,{onClick:l,children:j})}),e[29]=l,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(Y,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==n?(D=t.jsx(Z,{open:s,onOpenChange:n,children:C}),e[36]=s,e[37]=C,e[38]=n,e[39]=D):D=e[39],D}function J(r){const e=v.c(64),{open:c,onOpenChange:l,onCreated:i}=r,s=k(),[n,d]=F.useState(""),a=Ke();let m;e[0]!==l?(m=function(){d(""),l(!1)},e[0]=l,e[1]=m):m=e[1];const o=m;let f;e[2]!==a||e[3]!==o||e[4]!==n||e[5]!==i||e[6]!==s?(f=async function(se){if(se.preventDefault(),!!n.trim())try{const q=await a.mutateAsync({name:n.trim()});o(),i(q)}catch(q){const H=q;I.error(H instanceof Error?H.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=a,e[3]=o,e[4]=n,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==o||e[9]!==l?(p=B=>{B?l(B):o()},e[8]=o,e[9]=l,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(U,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(V,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(W,{children:[g,y]}),e[19]=g,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=t.jsx(xe,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=B=>d(B.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==n||e[30]!==D?(A=t.jsx(ee,{id:"api-key-name",value:n,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=A):A=e[31];let S;e[32]!==K||e[33]!==A?(S=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=S):S=e[34];const te=a.isPending;let _;e[35]!==s?(_=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=_):_=e[36];let w;e[37]!==a.isPending||e[38]!==o||e[39]!==_?(w=t.jsx(N,{type:"button",variant:"outline",onClick:o,disabled:te,children:_}),e[37]=a.isPending,e[38]=o,e[39]=_,e[40]=w):w=e[40];let P;e[41]!==a.isPending||e[42]!==n?(P=a.isPending||!n.trim(),e[41]=a.isPending,e[42]=n,e[43]=P):P=e[43];let z;e[44]!==a.isPending||e[45]!==s?(z=a.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=a.isPending,e[45]=s,e[46]=z):z=e[46];let T;e[47]!==P||e[48]!==z?(T=t.jsx(N,{type:"submit",disabled:P,children:z}),e[47]=P,e[48]=z,e[49]=T):T=e[49];let E;e[50]!==w||e[51]!==T?(E=t.jsxs(X,{children:[w,T]}),e[50]=w,e[51]=T,e[52]=E):E=e[52];let O;e[53]!==u||e[54]!==S||e[55]!==E?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[S,E]}),e[53]=u,e[54]=S,e[55]=E,e[56]=O):O=e[56];let $;e[57]!==O||e[58]!==h?($=t.jsxs(Y,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=$):$=e[59];let L;return e[60]!==c||e[61]!==$||e[62]!==p?(L=t.jsx(Z,{open:c,onOpenChange:p,children:$}),e[60]=c,e[61]=$,e[62]=p,e[63]=L):L=e[63],L}function Ne(){const r=k(),{data:e=[]}=he(),c=je(),[l,i]=F.useState(!1),[s,n]=F.useState(null),[d,a]=F.useState(null);async function m(){if(d)try{await c.mutateAsync(d.id),I.success(r("settings.apiKeys.keyDeleted",{name:d.name}))}catch(o){I.error(o instanceof Error?o.message:r("settings.apiKeys.failedToDeleteKey"))}finally{a(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(Ae,{onCreate:()=>i(!0)}),t.jsx(J,{open:l,onOpenChange:i,onCreated:n}),t.jsx(G,{createdKey:s,onClose:()=>n(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:r(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(Q,{size:14}),r("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(o=>t.jsx(De,{apiKey:o,onDelete:()=>a(o)},o.id))})}),t.jsx(J,{open:l,onOpenChange:i,onCreated:n}),t.jsx(G,{createdKey:s,onClose:()=>n(null)}),t.jsx(ae,{open:d!==null,onOpenChange:o=>{o||a(null)},children:t.jsxs(oe,{children:[t.jsxs(ce,{children:[t.jsx(de,{children:r("settings.apiKeys.deleteTitle",{name:d?.name??""})}),t.jsx(me,{children:r("settings.apiKeys.deleteDescription")})]}),t.jsxs(fe,{children:[t.jsx(pe,{children:r("settings.apiKeys.cancelButton")}),t.jsx(ue,{onClick:m,children:r("settings.apiKeys.deleteKey")})]})]})})]})}function ve(){const r=v.c(7),e=k();let c;r[0]!==e?(c=e("settings.nav.apiKeys"),r[0]=e,r[1]=c):c=r[1];let l;r[2]!==c?(l=t.jsx(R.Title,{children:c}),r[2]=c,r[3]=l):l=r[3];let i;r[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{fallback:ke,children:t.jsx(F.Suspense,{fallback:t.jsx(ge,{className:"h-32 w-full"}),children:t.jsx(Ne,{})})}),r[4]=i):i=r[4];let s;return r[5]!==l?(s=t.jsx(R,{children:t.jsx(R.Content,{children:t.jsx(R.Body,{children:t.jsxs(ye,{children:[l,i]})})})}),r[5]=l,r[6]=s):s=r[6],s}function ke(r){const{error:e}=r;return t.jsx(Ce,{error:e??new Error("Failed to load API keys")})}function tt(){const r=v.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(ve,{})}),r[0]=e):e=r[0],e}export{tt as default};
|
|
1
|
+
import{c as v,b as k,j as t,E as ie,r as F,B as N,t as I}from"./index-GPtGFYbO.js";import{i as le}from"./AlertCircle-CEGqDvaA.js";import{a as ne}from"./Copy01-C9sG-6D6.js";import{i as M}from"./Key01-kW6GScFx.js";import{s as Q}from"./Plus-Cuw6ld9s.js";import{s as re}from"./Trash01-BysA7V0F.js";import{g as ae,f as oe,b as ce,A as de,a as me,e as fe,c as pe,d as ue}from"./alert-dialog-DC6Lplgx.js";import{b as U,h as V,a as W,c as X,d as Y,e as Z}from"./dialog-f2gIoJyo.js";import{I as ee}from"./input-C4kw1M0o.js";import{L as xe}from"./label-DCGTT-Xz.js";import{S as ge}from"./skeleton-E7dM1cU6.js";import{P as R}from"./index-DUWa0kTK.js";import{c as ye}from"./settings-section-CAbLKYDo.js";import{a as he,b as je,u as Ke}from"./use-api-keys-DwiRAhRw.js";import{R as be}from"./require-capability-CPhtITFk.js";import"./X-Bb9AvrlL.js";import"./sidebar-BKLfDbJN.js";import"./LayoutLeft-B8TJ15_W.js";import"./use-mobile-DoH3Zs0T.js";import"./tooltip-Btz0jJUy.js";import"./card-bfZkFKGg.js";import"./ArrowUpRight-DNskIx7Q.js";import"./use-mcp-client-B8hPaR2x.js";import"./auth-B_fsW_pO.js";import"./use-capability-7E41d664.js";import"./access-gate-DBwhIB9O.js";import"./capability-load-error-5XD0Oq4g.js";function Ce(r){const e=v.c(6),{error:c}=r,l=k();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(le,{size:16}),e[0]=i):i=e[0];let s;e[1]!==c.message||e[2]!==l?(s=l("settings.apiKeys.failedToLoadError",{error:c.message}),e[1]=c.message,e[2]=l,e[3]=s):s=e[3];let n;return e[4]!==s?(n=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function De(r){const e=v.c(20),{apiKey:c,onDelete:l}=r,i=k();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==c.name?(n=t.jsx("span",{className:"font-medium text-sm truncate block",children:c.name}),e[1]=c.name,e[2]=n):n=e[2];let d;e[3]!==c.createdAt||e[4]!==i?(d=i("settings.apiKeys.createdAt",{date:new Date(c.createdAt).toLocaleDateString()}),e[3]=c.createdAt,e[4]=i,e[5]=d):d=e[5];let a;e[6]!==d?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:d}),e[6]=d,e[7]=a):a=e[7];let m;e[8]!==n||e[9]!==a?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[n,a]})]}),e[8]=n,e[9]=a,e[10]=m):m=e[10];let o;e[11]!==i?(o=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=o):o=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(re,{size:14}),e[13]=f):f=e[13];let u;e[14]!==l||e[15]!==o?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:l,"aria-label":o,children:f}),e[14]=l,e[15]=o,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function Ae(r){const e=v.c(21),{onCreate:c}=r,l=k();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==l?(s=l("settings.apiKeys.emptyTitle"),e[1]=l,e[2]=s):s=e[2];let n;e[3]!==s?(n=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let d;e[5]!==l?(d=l("settings.apiKeys.emptyDescription"),e[5]=l,e[6]=d):d=e[6];let a;e[7]!==d?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:d}),e[7]=d,e[8]=a):a=e[8];let m;e[9]!==n||e[10]!==a?(m=t.jsxs("div",{children:[n,a]}),e[9]=n,e[10]=a,e[11]=m):m=e[11];let o;e[12]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Q,{size:14}),e[12]=o):o=e[12];let f;e[13]!==l?(f=l("settings.apiKeys.newKey"),e[13]=l,e[14]=f):f=e[14];let u;e[15]!==c||e[16]!==f?(u=t.jsxs(N,{onClick:c,size:"sm",className:"mt-2",children:[o,f]}),e[15]=c,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function G(r){const e=v.c(40),{createdKey:c,onClose:l}=r,i=k(),s=c!==null;let n;e[0]!==l?(n=A=>!A&&l(),e[0]=l,e[1]=n):n=e[1];let d;e[2]!==i?(d=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(U,{children:d}),e[4]=d,e[5]=a):a=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let o;e[8]!==m?(o=t.jsx(V,{children:m}),e[8]=m,e[9]=o):o=e[9];let f;e[10]!==a||e[11]!==o?(f=t.jsxs(W,{children:[a,o]}),e[10]=a,e[11]=o,e[12]=f):f=e[12];const u=c?.key??"";let p;e[13]!==u?(p=t.jsx(ee,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==c||e[16]!==i?(x=()=>{c&&(navigator.clipboard?.writeText(c.key),I.success(i("settings.apiKeys.copied")))},e[15]=c,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ne,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==l||e[30]!==j?(K=t.jsx(X,{children:t.jsx(N,{onClick:l,children:j})}),e[29]=l,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(Y,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==n?(D=t.jsx(Z,{open:s,onOpenChange:n,children:C}),e[36]=s,e[37]=C,e[38]=n,e[39]=D):D=e[39],D}function J(r){const e=v.c(64),{open:c,onOpenChange:l,onCreated:i}=r,s=k(),[n,d]=F.useState(""),a=Ke();let m;e[0]!==l?(m=function(){d(""),l(!1)},e[0]=l,e[1]=m):m=e[1];const o=m;let f;e[2]!==a||e[3]!==o||e[4]!==n||e[5]!==i||e[6]!==s?(f=async function(se){if(se.preventDefault(),!!n.trim())try{const q=await a.mutateAsync({name:n.trim()});o(),i(q)}catch(q){const H=q;I.error(H instanceof Error?H.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=a,e[3]=o,e[4]=n,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==o||e[9]!==l?(p=B=>{B?l(B):o()},e[8]=o,e[9]=l,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(U,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(V,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(W,{children:[g,y]}),e[19]=g,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=t.jsx(xe,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=B=>d(B.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==n||e[30]!==D?(A=t.jsx(ee,{id:"api-key-name",value:n,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=A):A=e[31];let S;e[32]!==K||e[33]!==A?(S=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=S):S=e[34];const te=a.isPending;let _;e[35]!==s?(_=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=_):_=e[36];let w;e[37]!==a.isPending||e[38]!==o||e[39]!==_?(w=t.jsx(N,{type:"button",variant:"outline",onClick:o,disabled:te,children:_}),e[37]=a.isPending,e[38]=o,e[39]=_,e[40]=w):w=e[40];let P;e[41]!==a.isPending||e[42]!==n?(P=a.isPending||!n.trim(),e[41]=a.isPending,e[42]=n,e[43]=P):P=e[43];let z;e[44]!==a.isPending||e[45]!==s?(z=a.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=a.isPending,e[45]=s,e[46]=z):z=e[46];let T;e[47]!==P||e[48]!==z?(T=t.jsx(N,{type:"submit",disabled:P,children:z}),e[47]=P,e[48]=z,e[49]=T):T=e[49];let E;e[50]!==w||e[51]!==T?(E=t.jsxs(X,{children:[w,T]}),e[50]=w,e[51]=T,e[52]=E):E=e[52];let O;e[53]!==u||e[54]!==S||e[55]!==E?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[S,E]}),e[53]=u,e[54]=S,e[55]=E,e[56]=O):O=e[56];let $;e[57]!==O||e[58]!==h?($=t.jsxs(Y,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=$):$=e[59];let L;return e[60]!==c||e[61]!==$||e[62]!==p?(L=t.jsx(Z,{open:c,onOpenChange:p,children:$}),e[60]=c,e[61]=$,e[62]=p,e[63]=L):L=e[63],L}function Ne(){const r=k(),{data:e=[]}=he(),c=je(),[l,i]=F.useState(!1),[s,n]=F.useState(null),[d,a]=F.useState(null);async function m(){if(d)try{await c.mutateAsync(d.id),I.success(r("settings.apiKeys.keyDeleted",{name:d.name}))}catch(o){I.error(o instanceof Error?o.message:r("settings.apiKeys.failedToDeleteKey"))}finally{a(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(Ae,{onCreate:()=>i(!0)}),t.jsx(J,{open:l,onOpenChange:i,onCreated:n}),t.jsx(G,{createdKey:s,onClose:()=>n(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:r(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(Q,{size:14}),r("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(o=>t.jsx(De,{apiKey:o,onDelete:()=>a(o)},o.id))})}),t.jsx(J,{open:l,onOpenChange:i,onCreated:n}),t.jsx(G,{createdKey:s,onClose:()=>n(null)}),t.jsx(ae,{open:d!==null,onOpenChange:o=>{o||a(null)},children:t.jsxs(oe,{children:[t.jsxs(ce,{children:[t.jsx(de,{children:r("settings.apiKeys.deleteTitle",{name:d?.name??""})}),t.jsx(me,{children:r("settings.apiKeys.deleteDescription")})]}),t.jsxs(fe,{children:[t.jsx(pe,{children:r("settings.apiKeys.cancelButton")}),t.jsx(ue,{onClick:m,children:r("settings.apiKeys.deleteKey")})]})]})})]})}function ve(){const r=v.c(7),e=k();let c;r[0]!==e?(c=e("settings.nav.apiKeys"),r[0]=e,r[1]=c):c=r[1];let l;r[2]!==c?(l=t.jsx(R.Title,{children:c}),r[2]=c,r[3]=l):l=r[3];let i;r[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{fallback:ke,children:t.jsx(F.Suspense,{fallback:t.jsx(ge,{className:"h-32 w-full"}),children:t.jsx(Ne,{})})}),r[4]=i):i=r[4];let s;return r[5]!==l?(s=t.jsx(R,{children:t.jsx(R.Content,{children:t.jsx(R.Body,{children:t.jsxs(ye,{children:[l,i]})})})}),r[5]=l,r[6]=s):s=r[6],s}function ke(r){const{error:e}=r;return t.jsx(Ce,{error:e??new Error("Failed to load API keys")})}function tt(){const r=v.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(ve,{})}),r[0]=e):e=r[0],e}export{tt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Bt,b as kt,r as A,j as o,m as jt,k as _t,t as xt}from"./index-HWhUkMVs.js";import{i as wt}from"./ChevronRight-kdKaq9Ii.js";import{B as At}from"./automation-runs-B9PPWxz2.js";import{u as Et,A as Nt}from"./use-section-preview-base-BcBdEo4a.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-CxV3B-5l.js";import"./select-D3htjNBx.js";import"./tooltip-DO91iaPZ.js";import"./Check-YqNpUnjS.js";import"./ChevronDown-BX2HgupK.js";import"./ChevronUp-J2R9ILOH.js";import"./agent-icon-ivyach6Y.js";import"./AlertCircle-0OUPWUNo.js";import"./Tool01-BK3Hfpvm.js";import"./ArrowUp-CNifCRwW.js";import"./ArrowLeft-CcZIvmNQ.js";import"./Tool02-gKszIrtU.js";import"./XCircle-CT6qobjT.js";import"./ArrowUpRight-CHr_jXVV.js";import"./TrendUp01-D4y32I70.js";import"./ZapSquare-C7FTkjlS.js";import"./Users03-DEaDNrbw.js";import"./CheckCircle-HA9HSubF.js";import"./DotsVertical-Cz5ElmDn.js";import"./Stars02-D49Mvriv.js";import"./Copy01-Bm8H5mLb.js";import"./CpuChip01-DgkecjAs.js";import"./CreditCard01-f8B5Wkqh.js";import"./Globe01-BAit6vQe.js";import"./Settings02-D8A1C3JO.js";import"./Eye-CaOR6o-h.js";import"./FilterLines-CU3G94q8.js";import"./Share07-BVdvoyk4.js";import"./Star01-Dk3FFpxM.js";import"./Globe04-DOMcqhEH.js";import"./SwitchHorizontal01-B0vjSREj.js";import"./HardDrive-CGleOs63.js";import"./Key01-DE0cHxdc.js";import"./LayoutLeft-B3Xq6Q9F.js";import"./LinkExternal01-CtVhb7np.js";import"./LogOut01-pEbmO0Np.js";import"./Monitor01-DDxK-vql.js";import"./Sun-BZWpsJUV.js";import"./Palette-BdM6u7AM.js";import"./Play-IbqcJdN3.js";import"./Plus-BXW-bLkv.js";import"./SearchLg-L_ta90AC.js";import"./SearchMd-B1jAF5PX.js";import"./Shield01-D2H3k2fO.js";import"./Stars01-ndnSTODt.js";import"./Trash01-BSXuR-v0.js";import"./Upload01-nh4tHrH4.js";import"./User01-XKHS0Yi2.js";import"./Users01-tFQvWfNL.js";import"./XClose-CnW8TKsr.js";import"./X-B1FpD19v.js";import"./Zap-CAz1ejRf.js";import"./useInfiniteQuery-BOShi_GX.js";import"./use-infinite-scroll-CBy2t19Z.js";import"./use-connection-B24S3YCN.js";import"./use-mcp-client-WNkI8KAJ.js";import"./auth-BxRabvv-.js";import"./use-virtual-mcp-uppMIhb1.js";import"./card-BgLseUz9.js";import"./sidebar-DbMpr-rh.js";import"./use-mobile-nNGwbm7m.js";import"./table-Bieg1GxH.js";import"./empty-state-HwZPqFUt.js";import"./use-members-smedIK7m.js";import"./use-org-auth-client-uDIBUVH9.js";import"./use-clock-tick-CttCxR3S.js";import"./use-automations-Y3CwRy47.js";import"./studio-tools-whdp8gFV.js";import"./useSuspenseInfiniteQuery-C2H3DSMn.js";import"./avatar-BxOwauBx.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BNHHpgOS.js";import"./dialog-DsCqITds.js";import"./tab-id-fxY7FqYq.js";import"./hooks-DoEly3LT.js";import"./decopilot-sse-pool-BwUtRq_o.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-DtiyxjXg.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-Dfw1C_Qb.js";import"./use-decopilot-events-LcKd19eo.js";import"./use-organization-settings-BJdrgwhq.js";import"./monaco-editor-8vQ4bsg1.js";import"./spinner-CMWgEkOv.js";import"./index-B6bkuuby.js";import"./shell-layout-CzKlLa8f.js";import"./required-auth-layout-Cdi-946f.js";import"./use-org-sso-DrOx8nh9.js";import"./integration-icon-CtS0uJhZ.js";import"./use-navigate-to-agent-9y1G65Xj.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BKcNvqGV.js";import"./form-C5LT36jD.js";import"./label-CZbP70z-.js";import"./input-CDxc4QX0.js";import"./file-type-icon-Cqwaa-8d.js";import"./drawer-CWuptb6-.js";import"./collection-search-C5R8jkCo.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-D4B8_rLi.js";import"./toggle-group-CBptT1rM.js";import"./use-deco-credits-5oBMNAq-.js";import"./popover-CnbRVVJ4.js";import"./self-tool-result-Ces-0lJd.js";import"./alert-dialog-BtRTtbG0.js";import"./extract-connection-data-XyQY0B73.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-P_5pUA9W.js";import"./authenticate-and-persist-oauth-DH2xTiqE.js";import"./mcp-oauth-DKoInR_S.js";import"./track-CY-fnB6q.js";import"./toolbar-BI3FThik.js";import"./skeleton-Y7gyZPrn.js";import"./github-repo-picker-UNa4kaK1.js";import"./use-mcp-tools-BW_wQYIZ.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-B7NQUqWh.js";import"./use-registry-connections-ChaImRoz.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CXh3iKjW.js";import"./connection-form-helpers-ZRhzxhfS.js";import"./collection-tabs-CCbVGHLG.js";import"./badge-YeCL-pM6.js";import"./use-open-billing-url-GphQa9pn.js";import"./select-model-DQpQr2DQ.js";import"./checkbox-DtxWa1Lp.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DzETP_0_.js";import"./cards-nVim6xBl.js";import"./dropdown-menu-CkysSdXs.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CRL_QHV0.js";import"./use-capability-hVyOyKfv.js";import"./pt-BR-CLy76QW2.js";import"./switch-b6594rNl.js";import"./use-debounced-autosave-CrvyuS1z.js";import"./index-6TRi0uef.js";import"./search-input-DmFmc4FA.js";import"./index-uoMzVpNH.js";import"./use-secrets-Dl1vnLJJ.js";import"./use-tags-4N4KBIBB.js";import"./get-initials-D-f_fDFw.js";import"./command-BweZE9r1.js";import"./index-BQO3LZFM.js";import"./use-file-configs-CPONQlYc.js";import"./automation-list-row-D0gz_UHt.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function $r(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{$r as AppEditor};
|
|
1
|
+
import{c as Bt,b as kt,r as A,j as o,m as jt,k as _t,t as xt}from"./index-GPtGFYbO.js";import{i as wt}from"./ChevronRight-BIidR9SM.js";import{B as At}from"./automation-runs-BMnosc0O.js";import{u as Et,A as Nt}from"./use-section-preview-base-BqSulPkL.js";import{A as Rt,B as Ct,C as Kt,D as Tt,F as Ft,G as Pt,H as $t,S as Ut,I as Ot,J as zt}from"./index-DyBmgM84.js";import"./select-DCUthKzq.js";import"./tooltip-Btz0jJUy.js";import"./Check-B8suwSr9.js";import"./ChevronDown-C6kSK4xi.js";import"./ChevronUp-DHnR36Wm.js";import"./agent-icon-s6_qyUu1.js";import"./AlertCircle-CEGqDvaA.js";import"./Tool01-n6deJtHB.js";import"./ArrowUp-DazHjV8x.js";import"./ArrowLeft-D-GaGLbo.js";import"./Tool02-ChBe855x.js";import"./XCircle-J5pnVl1i.js";import"./ArrowUpRight-DNskIx7Q.js";import"./TrendUp01-BhChTRyL.js";import"./ZapSquare-D28-LH7C.js";import"./Users03-C7g8VOdi.js";import"./CheckCircle-DObEUtRu.js";import"./DotsVertical-DVg_Pbm_.js";import"./Stars02-D3OSImoU.js";import"./Copy01-C9sG-6D6.js";import"./CpuChip01-C6R2c7cp.js";import"./CreditCard01-sjHzWu4n.js";import"./Globe01-_I5Gee5_.js";import"./Settings02-D9mUVp_d.js";import"./Eye-B0s0rmgv.js";import"./FilterLines-xbs5S3Vb.js";import"./Share07-C3qW0KvP.js";import"./Star01-itSgb7DF.js";import"./Globe04-p6Pq1FLe.js";import"./SwitchHorizontal01-Di19iqO8.js";import"./HardDrive-BX_FsVnA.js";import"./Key01-kW6GScFx.js";import"./LayoutLeft-B8TJ15_W.js";import"./LinkExternal01-Dqas4G6a.js";import"./LogOut01-C6waAPKc.js";import"./Monitor01-BJd3P9Bs.js";import"./Sun-fnvHykt1.js";import"./Palette-CVUGmkcJ.js";import"./Play-D6P4Qt3H.js";import"./Plus-Cuw6ld9s.js";import"./SearchLg-CvmvPTNH.js";import"./SearchMd-BPfugAIu.js";import"./Shield01-BuqzbXhN.js";import"./Stars01-04iBWvYW.js";import"./Trash01-BysA7V0F.js";import"./Upload01-Y2mazRed.js";import"./User01-BvPxxSqY.js";import"./Users01-ChDlVjp-.js";import"./XClose-BQLeCToC.js";import"./X-Bb9AvrlL.js";import"./Zap-B30ko8EF.js";import"./useInfiniteQuery-B4qPBAxY.js";import"./use-infinite-scroll-Bx6Dv81T.js";import"./use-connection-_5ysFy7m.js";import"./use-mcp-client-B8hPaR2x.js";import"./auth-B_fsW_pO.js";import"./use-virtual-mcp-Bo4QPAh_.js";import"./card-bfZkFKGg.js";import"./sidebar-BKLfDbJN.js";import"./use-mobile-DoH3Zs0T.js";import"./table-D0OjjXFn.js";import"./empty-state-6Ei3fC_M.js";import"./use-members-caI7LoqI.js";import"./use-org-auth-client-BagXMda2.js";import"./use-clock-tick-CcVpPjly.js";import"./use-automations-CR14JUIv.js";import"./studio-tools-BDRk_Gqu.js";import"./useSuspenseInfiniteQuery-KfvQ1Xcr.js";import"./avatar-Cen-fEa-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-OBJePWyp.js";import"./dialog-f2gIoJyo.js";import"./tab-id-BiJME16N.js";import"./hooks-IaMFwizq.js";import"./decopilot-sse-pool-H9DQ4gY8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-CViMhULY.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-a-L8T3uD.js";import"./use-decopilot-events-eIVvjBw7.js";import"./use-organization-settings-JoyMX7--.js";import"./monaco-editor-C4i3AQCg.js";import"./spinner-BKYiVvRF.js";import"./index-6A0kQsfc.js";import"./shell-layout-B6xqx3ks.js";import"./required-auth-layout-CMXSrbVh.js";import"./use-org-sso-Ck-Kjho-.js";import"./integration-icon-DrUXWgOf.js";import"./use-navigate-to-agent-DzLLgouC.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-rNtuKWY8.js";import"./form-BfQ5_Xev.js";import"./label-DCGTT-Xz.js";import"./input-C4kw1M0o.js";import"./file-type-icon-CicLZ25Q.js";import"./drawer-BM7WsZWa.js";import"./collection-search-UbWH5VZy.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-DezkOYP4.js";import"./toggle-group-DhBiPEmR.js";import"./use-deco-credits-C4n4jHC3.js";import"./popover-BVzFNm24.js";import"./self-tool-result-BnIQca-t.js";import"./alert-dialog-DC6Lplgx.js";import"./extract-connection-data-Dwb0cyv5.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CgunDIm8.js";import"./authenticate-and-persist-oauth-C5hTKLZu.js";import"./mcp-oauth-DYN1bOv6.js";import"./track-CM-gFNzg.js";import"./toolbar-ANRXiQzU.js";import"./skeleton-E7dM1cU6.js";import"./github-repo-picker-8yIoQVfR.js";import"./use-mcp-tools-DxzHZCmj.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-C9SeUY5z.js";import"./use-registry-connections-BibtsFf-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BltiOv6V.js";import"./connection-form-helpers-CZF0KXDA.js";import"./collection-tabs-B-UVnRIT.js";import"./badge-Cf8TI2On.js";import"./use-open-billing-url-93kNP1D3.js";import"./select-model-CAkcqYBe.js";import"./checkbox-BiqXdTZP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CAbLKYDo.js";import"./cards-BhMv0YTc.js";import"./dropdown-menu-CkRaLL_n.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CMvp4UmG.js";import"./use-capability-7E41d664.js";import"./pt-BR-CLy76QW2.js";import"./switch-DHdf9bGS.js";import"./use-debounced-autosave-zC-uauJa.js";import"./index-DUWa0kTK.js";import"./search-input-BQvnJ7ie.js";import"./index-BJ8bMiZH.js";import"./use-secrets-BX95LtsI.js";import"./use-tags-U4CIg3SL.js";import"./get-initials-D-f_fDFw.js";import"./command-DrNiVNR3.js";import"./index-D9iRNBXx.js";import"./use-file-configs-D9uM3Pg0.js";import"./automation-list-row-CdL9Bcdo.js";function It(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Rt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function $r(n){const t=Bt.c(78),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:ht,excludeFields:H,schemaPending:nt,previewBaseUrl:lt}=n,M=nt===void 0?!1:nt,Z=lt===void 0?null:lt,c=kt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Et(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Ct(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const G=C,ct=ht??(x?Kt(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const W=Ft(T);let F;t[17]!==S?(F=Ot((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const X=F,[bt,vt]=A.useState(p),[Y,dt]=A.useState(null),[tt,ut]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,ft]=A.useState(P),[et,d]=A.useState(!1),$=A.useRef(null);bt!==p&&(vt(p),dt(null),ut(Vt),ft([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const ot=U;let y;t[22]!==Y?(y=Y??{},t[22]=Y,t[23]=y):y=t[23];let O;t[24]!==ot||t[25]!==y?(O={...ot,...y},t[24]=ot,t[25]=y,t[26]=O):O=t[26];const rt=O;let z;t[27]!==p||t[28]!==v||t[29]!==S?(z=e=>{const r=e;dt(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=z):z=t[30];const it=z;let I;t[31]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{ft(e)},t[31]=I):I=t[31];const E=I;let L;t[32]!==l||t[33]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=It(e,l);await W.mutateAsync({blockKey:u,data:f}),xt.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}catch(u){const f=u,yt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw xt.error(yt),f}},t[32]=l,t[33]=J,t[34]=W,t[35]=c,t[36]=L):L=t[36];const B=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==B||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await B(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=B,t[40]=d,t[41]=q):q=t[41];const mt=q,pt=g.length>0?[ct,...g]:[],St="flex h-full flex-col",gt="flex h-12 shrink-0 items-center justify-between border-b px-6",at=pt.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:pt.map((e,r)=>{const u=r===pt.length-1,f=Pt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(wt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ut(Lt)},title:f,className:jt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:ct});let k;t[42]!==Q?(k=o.jsx(zt,{isPending:Q,isError:!1}),t[42]=Q,t[43]=k):k=t[43];let j;t[44]!==at||t[45]!==k?(j=o.jsxs("div",{className:gt,children:[at,k]}),t[44]=at,t[45]=k,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==st||t[57]!==G||t[58]!==a||t[59]!==s||t[60]!==X||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==i?(_=o.jsx(At,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Ut,{schema:b,value:rt,onChange:it,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:B,onRequestAddSection:st,sandbox:{orgSlug:s,virtualMcpId:i,branch:m}},`${p}:${tt}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=st,t[57]=G,t[58]=a,t[59]=s,t[60]=X,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=i,t[66]=_):_=t[66];let w;t[67]!==et||t[68]!==l||t[69]!==mt||t[70]!==a||t[71]!==h||t[72]!==d?(w=h&&o.jsx(Nt,{open:et,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{mt(e)}}),t[67]=et,t[68]=l,t[69]=mt,t[70]=a,t[71]=h,t[72]=d,t[73]=w):w=t[73];let D;return t[74]!==j||t[75]!==_||t[76]!==w?(D=o.jsxs("div",{className:St,children:[j,_,w]}),t[74]=j,t[75]=_,t[76]=w,t[77]=D):D=t[77],D}function Lt(n){return n+1}function Vt(n){return n+1}export{$r as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cC as v,cD as $,cE as W,cF as L,cG as H,cH as D,cI as V,cJ as x,cK as q,cL as j,cM as y,cN as N,cO as B,cP as F,cQ as Z}from"./index-HWhUkMVs.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
1
|
+
import{cC as v,cD as $,cE as W,cF as L,cG as H,cH as D,cI as V,cJ as x,cK as q,cL as j,cM as y,cN as N,cO as B,cP as F,cQ as Z}from"./index-GPtGFYbO.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as 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-GPtGFYbO.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};
|