decocms 4.239.2 → 4.241.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CeleFBrs.js → AlertCircle-BSGNUx7V.js} +1 -1
- package/dist/client/assets/{AreaChart-Cr68R9KD.js → AreaChart-qGMzdkmk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CwsJ1Sfc.js → ArrowLeft-DHRINKlz.js} +1 -1
- package/dist/client/assets/{ArrowUp-PM43ttWN.js → ArrowUp-ntTpD-To.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-C0hTvHTE.js → ArrowUpRight-BG4SvGJv.js} +1 -1
- package/dist/client/assets/{Check-BdzjeMXF.js → Check-DhNjrmaj.js} +1 -1
- package/dist/client/assets/{CheckCircle-D-nlOrXB.js → CheckCircle-B_sdSbJU.js} +1 -1
- package/dist/client/assets/{ChevronDown-BOc1-i9L.js → ChevronDown-CaUFgq06.js} +1 -1
- package/dist/client/assets/{ChevronRight-wqbYwiLF.js → ChevronRight-jZWdrf9f.js} +1 -1
- package/dist/client/assets/{ChevronUp-IHCmvX3E.js → ChevronUp-BRjHRWFg.js} +1 -1
- package/dist/client/assets/{Copy01-DIJvVGQk.js → Copy01-C3CSvCmh.js} +1 -1
- package/dist/client/assets/{CreditCard01-W4m_wy49.js → CreditCard01-5rNLMrBA.js} +1 -1
- package/dist/client/assets/{DotsVertical-Bohq38Q1.js → DotsVertical-Dp5Cm_iP.js} +1 -1
- package/dist/client/assets/Download01-DIiuseU_.js +1 -0
- package/dist/client/assets/{Eye-C5vDWwaK.js → Eye-CVDf_kH4.js} +1 -1
- package/dist/client/assets/{FilterLines-C9pmu5SZ.js → FilterLines-DV7AkyjC.js} +1 -1
- package/dist/client/assets/Globe01-Bak8Df7R.js +1 -0
- package/dist/client/assets/{Globe04-CDJqKwdP.js → Globe04-21nMtmZT.js} +1 -1
- package/dist/client/assets/{HardDrive-BicURFt0.js → HardDrive-yKF5zKg2.js} +1 -1
- package/dist/client/assets/{Key01-CRQOB5O_.js → Key01-C-HagbU9.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DZwVeKk1.js → LayoutLeft-DTt2h_gY.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Do6tmctI.js → LinkExternal01-BAXCjJ3W.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-BxK9l3CJ.js → LockUnlocked01-CTGb9BVB.js} +1 -1
- package/dist/client/assets/{LogOut01-DhAdDNkV.js → LogOut01-CI181NEF.js} +1 -1
- package/dist/client/assets/{Monitor01-BKGGKBRj.js → Monitor01-Be5N7TRy.js} +1 -1
- package/dist/client/assets/{Palette-5WrpEUaC.js → Palette-BNNCPeK0.js} +1 -1
- package/dist/client/assets/{Play-Yhg2bDxR.js → Play-BsRzOgzp.js} +1 -1
- package/dist/client/assets/{Plus-CgXuzVCT.js → Plus-9luEKPZw.js} +1 -1
- package/dist/client/assets/{SearchLg-CYNvKytJ.js → SearchLg-F6MPrrZo.js} +1 -1
- package/dist/client/assets/{SearchMd-BOeEZKFu.js → SearchMd-7UCVFr92.js} +1 -1
- package/dist/client/assets/{Settings02-CpRid7rG.js → Settings02-DWTUyGYI.js} +1 -1
- package/dist/client/assets/{Share07-B14EYmF_.js → Share07-BBwkuMmH.js} +1 -1
- package/dist/client/assets/{Shield01-DS1CkOm5.js → Shield01-DwaMx4Kj.js} +1 -1
- package/dist/client/assets/{Stars01-CPDNiFNQ.js → Stars01-gwxykcEQ.js} +1 -1
- package/dist/client/assets/{Stars02-CH68Qhm_.js → Stars02-B6JXDKru.js} +1 -1
- package/dist/client/assets/{Sun-CjcZKPaq.js → Sun-BJxBIAjy.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DOmwqeXB.js → SwitchHorizontal01-CdQluNjW.js} +1 -1
- package/dist/client/assets/{Tool01-BLxK-7k7.js → Tool01-B3cfX7QW.js} +1 -1
- package/dist/client/assets/{Tool02-B8GwG_SX.js → Tool02-Dz1T3Rmg.js} +1 -1
- package/dist/client/assets/{Trash01-COMthlp3.js → Trash01-Dx-L9twD.js} +1 -1
- package/dist/client/assets/{TrendUp01-Pa_0KlRB.js → TrendUp01-jt7vyfmI.js} +1 -1
- package/dist/client/assets/{Upload01-DO7DRGUd.js → Upload01-BxhthB2p.js} +1 -1
- package/dist/client/assets/{User01-C2rVZTl-.js → User01-CFSl83nB.js} +1 -1
- package/dist/client/assets/{Users01-ClsBMo4K.js → Users01-BijcXXI3.js} +1 -1
- package/dist/client/assets/{Users03-DP3zwt6-.js → Users03-D4EG206O.js} +1 -1
- package/dist/client/assets/{X-Bfx6rO6W.js → X-CSYXCnV9.js} +1 -1
- package/dist/client/assets/{XCircle-jlAhwcDu.js → XCircle-Cu0-8nUy.js} +1 -1
- package/dist/client/assets/{XClose-DdXn46Em.js → XClose-DSHM2tuZ.js} +1 -1
- package/dist/client/assets/{YAxis-C5lX8CaJ.js → YAxis-DaCLoj6F.js} +1 -1
- package/dist/client/assets/{Zap-li0rR-RI.js → Zap-BJ7aktKA.js} +1 -1
- package/dist/client/assets/{ZapSquare-Gxca0Ylc.js → ZapSquare-DsGT7WIC.js} +1 -1
- package/dist/client/assets/{access-gate-C8o_OE1N.js → access-gate-rP_MjwR7.js} +1 -1
- package/dist/client/assets/agent-icon-eH38g2HT.js +1 -0
- package/dist/client/assets/agents-list-DCLtFhhx.js +1 -0
- package/dist/client/assets/ai-providers-BVZMQNKu.js +1 -0
- package/dist/client/assets/{alert-1MxwzRCP.js → alert-BMVQGRt6.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cqq7FgQj.js → alert-dialog-CMLgUtLr.js} +1 -1
- package/dist/client/assets/{api-keys-BmVwKDo4.js → api-keys-KMpkqWx8.js} +1 -1
- package/dist/client/assets/app-editor-DePidg7R.js +1 -0
- package/dist/client/assets/{auth-tEJ4bybR.js → auth-C0RxM0MV.js} +1 -1
- package/dist/client/assets/{auth-catchall-CYO83hyU.js → auth-catchall-DKTY___X.js} +1 -1
- package/dist/client/assets/{auth-entry-Dc1zlPtG.js → auth-entry-BpqowsP8.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C945ZTK3.js → auth-split-layout-CjAUeNRJ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CqRX86RU.js → authenticate-and-persist-oauth-iw6ouFr9.js} +1 -1
- package/dist/client/assets/{automation-list-row-BN46j3bE.js → automation-list-row-Bkk5b-Xu.js} +1 -1
- package/dist/client/assets/{automation-runs-nfuxnSim.js → automation-runs-7BxhYAN0.js} +16 -16
- package/dist/client/assets/automations-g01DiXGR.js +1 -0
- package/dist/client/assets/{avatar-BqAz0FLa.js → avatar-CzJUVoDs.js} +1 -1
- package/dist/client/assets/{badge-D24p8Xxi.js → badge-DbSQDjS0.js} +1 -1
- package/dist/client/assets/{billing-DSz5ucLf.js → billing-4Wr63XfR.js} +1 -1
- package/dist/client/assets/{block-document-ChYHEJUH.js → block-document-c_ItM0iq.js} +1 -1
- package/dist/client/assets/{buckets-DyBjeMFW.js → buckets-BEGiPCkc.js} +1 -1
- package/dist/client/assets/bulk-category-panel-DhM1EGbP.js +1 -0
- package/dist/client/assets/{capability-load-error-CPQoG_lp.js → capability-load-error-CRpB249h.js} +1 -1
- package/dist/client/assets/{card-CooN3E-v.js → card-FCEwqon6.js} +1 -1
- package/dist/client/assets/cards-CIZK-4zJ.js +9 -0
- package/dist/client/assets/category-editor-CVaNQqlc.js +1 -0
- package/dist/client/assets/{chart-Dtka3CXu.js → chart-BVs8Wshz.js} +1 -1
- package/dist/client/assets/{chat-context--S2eGI2t.js → chat-context-Qk-9IhfU.js} +1 -1
- package/dist/client/assets/{checkbox-BqtDvsR1.js → checkbox-Badqx0C2.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B6EGxQbP.js → cli-auth-success-BBdGAncX.js} +1 -1
- package/dist/client/assets/collection-detail-C13FmfjI.js +1 -0
- package/dist/client/assets/{collection-display-button-B1OCDGvC.js → collection-display-button-DBcRwNMI.js} +1 -1
- package/dist/client/assets/{collection-search-H6c7ia6t.js → collection-search-DcQsyJxv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CksgkvG8.js → collection-table-wrapper-DKCmgLGf.js} +1 -1
- package/dist/client/assets/{collection-tabs-BqnoVI6Y.js → collection-tabs-TNXMy8gA.js} +1 -1
- package/dist/client/assets/{command-DhvOaMnH.js → command-DWBbdLBX.js} +1 -1
- package/dist/client/assets/commerce-onboarding-4x4UgCdX.js +1 -0
- package/dist/client/assets/{connect-C-NmOGr7.js → connect-Dtqc1nsL.js} +1 -1
- package/dist/client/assets/{connection-DJ2785KU.js → connection-DyYsm8dV.js} +1 -1
- package/dist/client/assets/{connection-card-DSX5zHxO.js → connection-card-BsbMWXtq.js} +1 -1
- package/dist/client/assets/connection-detail-CusJoVJI.js +1 -0
- package/dist/client/assets/{connection-form-helpers-B07wLptq.js → connection-form-helpers-hjpjGHOP.js} +1 -1
- package/dist/client/assets/connections-C3g87Fyq.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-U92pbu07.js → decopilot-sse-pool-BNW6JWpR.js} +1 -1
- package/dist/client/assets/{dialog-C2XtKj4W.js → dialog-0fNUeR9R.js} +1 -1
- package/dist/client/assets/{domain-settings-D2fweBMx.js → domain-settings-B4x9P8HV.js} +1 -1
- package/dist/client/assets/{drawer-HtUPoolZ.js → drawer-HRJ32EbE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Buaqq-Fn.js → dropdown-menu-Gs5UGB4h.js} +1 -1
- package/dist/client/assets/{empty-state-Bd3g-2FH.js → empty-state-LcWMvkBG.js} +1 -1
- package/dist/client/assets/{extract-connection-data-V948FMyj.js → extract-connection-data-BYxfOuH_.js} +1 -1
- package/dist/client/assets/file-explorer-B7clljfW.js +2 -0
- package/dist/client/assets/{file-type-icon-BSAnhEu5.js → file-type-icon-CTX2jq9G.js} +1 -1
- package/dist/client/assets/{form-CMuk1nXb.js → form-DGhZtrNx.js} +1 -1
- package/dist/client/assets/general-B8n1QEr5.js +1 -0
- package/dist/client/assets/{github-repo-picker-DjVb6-0i.js → github-repo-picker-DOf_JZk2.js} +1 -1
- package/dist/client/assets/{hooks-Cd2G3711.js → hooks-Cj6NKwbB.js} +1 -1
- package/dist/client/assets/{index-Dwrgaiv3.js → index-2ZeZ7XA1.js} +1 -1
- package/dist/client/assets/{index-DNa-ZV66.js → index-Bqi-j8tu.js} +1 -1
- package/dist/client/assets/{index-BKOwC_zz.js → index-CElD4z4O.js} +1 -1
- package/dist/client/assets/{index-BflbKT0u.js → index-CiuQrzO7.js} +2 -2
- package/dist/client/assets/{index-BaWtU9eb.js → index-CnpdnndP.js} +58 -61
- package/dist/client/assets/{index-BoSySxnu.js → index-D87JktxF.js} +1 -1
- package/dist/client/assets/{index-CPCOiQxX.js → index-DZl62lg2.js} +1 -1
- package/dist/client/assets/{index-BRjr3L_N.js → index-DporvBqC.js} +1 -1
- package/dist/client/assets/{index-BphIXXOp.js → index-QSWmOkVC.js} +37 -37
- package/dist/client/assets/index-mmj8d1OZ.js +1 -0
- package/dist/client/assets/{index-redirect-CyqcxiJb.js → index-redirect-CLI7ZZ-t.js} +1 -1
- package/dist/client/assets/{infra-billing-B1fwJNOz.js → infra-billing-BEXhDVVj.js} +1 -1
- package/dist/client/assets/{input-9TNY2G6W.js → input-CjD4VhOq.js} +1 -1
- package/dist/client/assets/{integration-icon-CGwCrGIc.js → integration-icon-CPM2Wy4S.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BIJfPXUf.js → invite-member-dialog-uqixWqH7.js} +1 -1
- package/dist/client/assets/{label-DhJo3WjY.js → label-BM_KNax6.js} +1 -1
- package/dist/client/assets/{layout-CeWP0gEY.js → layout-Cyxx23a5.js} +1 -1
- package/dist/client/assets/{login-DxZTpOpk.js → login-DTcPenfD.js} +1 -1
- package/dist/client/assets/{mcp-oauth--A5K-xL8.js → mcp-oauth-CXtITOci.js} +1 -1
- package/dist/client/assets/{members-B5PzIuUU.js → members-BngJJI1k.js} +1 -1
- package/dist/client/assets/{monaco-editor-BMLOnDLJ.js → monaco-editor-BhG2pRsy.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Rpla78Nn.js → monitoring-stats-row-V0REizP2.js} +1 -1
- package/dist/client/assets/{multi-select-Duz2hJ29.js → multi-select-DVmJ8N16.js} +1 -1
- package/dist/client/assets/{oauth-callback-Cn0wl-wL.js → oauth-callback-QWZ-1Ao_.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CvoqVCiX.js → oauth-callback-ai-provider-DNiT_-tQ.js} +1 -1
- package/dist/client/assets/{onboarding-CTQgNbX8.js → onboarding-4kFhDwBC.js} +1 -1
- package/dist/client/assets/{org-layout-tUX-e_rZ.js → org-layout-D1UQZWSN.js} +1 -1
- package/dist/client/assets/{organization-choice-T8a5zIBy.js → organization-choice-CguXU_qj.js} +1 -1
- package/dist/client/assets/{orgs-CGkwFzZ6.js → orgs-C0r08Wz9.js} +1 -1
- package/dist/client/assets/{page-seo-form-C0yVvfZn.js → page-seo-form-BYQ_C966.js} +1 -1
- package/dist/client/assets/{popover-BV2Ziop4.js → popover-Cdk4wGDs.js} +1 -1
- package/dist/client/assets/post-editor-CBRsERKT.js +1 -0
- package/dist/client/assets/{primitives-QfIbZaez.js → primitives-oSbSlJdK.js} +1 -1
- package/dist/client/assets/{profile-Bp26cqE6.js → profile-DT6piyAB.js} +1 -1
- package/dist/client/assets/project-app-view-ODxcuXJo.js +1 -0
- package/dist/client/assets/record-editor-DVIXyY1q.js +1 -0
- package/dist/client/assets/redirect-editor-CXtmXnNZ.js +1 -0
- package/dist/client/assets/registry-C7n-7FhE.js +2 -0
- package/dist/client/assets/{registry-layout-DdRmZw6K.js → registry-layout-DoD0R5_E.js} +3 -3
- package/dist/client/assets/{reports-DMvf7MMo.js → reports-CxxatuXV.js} +1 -1
- package/dist/client/assets/{require-capability-ChdE_Nc5.js → require-capability-BujVC6Iv.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DYO8_0ig.js → required-auth-layout-Bc5Jqmw0.js} +1 -1
- package/dist/client/assets/{reset-password-C661myht.js → reset-password-CRp5Vxzw.js} +1 -1
- package/dist/client/assets/roles-Bg6Wpwtz.js +1 -0
- package/dist/client/assets/{search-input-ChJAF9CO.js → search-input-DPH-j2ty.js} +1 -1
- package/dist/client/assets/{secrets-CwgPWaoJ.js → secrets-BS8SMJ5_.js} +1 -1
- package/dist/client/assets/{sections-editor-D8xoci4G.js → sections-editor-Cm60dl8s.js} +2 -2
- package/dist/client/assets/{select-COjQ5V-V.js → select-BY-TTUaX.js} +1 -1
- package/dist/client/assets/select-model-CKrLO7E8.js +4 -0
- package/dist/client/assets/{self-tool-result-DA97K7F2.js → self-tool-result-CQmRuOJJ.js} +1 -1
- package/dist/client/assets/seo-editor-qcHpiGxs.js +1 -0
- package/dist/client/assets/{settings-layout-C23Ga1Si.js → settings-layout-CkkEfluT.js} +1 -1
- package/dist/client/assets/{settings-section-BN0IrtYX.js → settings-section-KNTU5IvO.js} +1 -1
- package/dist/client/assets/{settings-subnav-DlbWpD1A.js → settings-subnav-Cd0l_6Ey.js} +1 -1
- package/dist/client/assets/{shell-controls-BBRNaPXa.js → shell-controls-yGJ3B9DE.js} +1 -1
- package/dist/client/assets/{shell-layout-DIvwZhUJ.js → shell-layout-BJ43I-fM.js} +1 -1
- package/dist/client/assets/{sidebar-Dckv7Gxe.js → sidebar-B9FCz4Mq.js} +1 -1
- package/dist/client/assets/{skeleton-C_J-aMdg.js → skeleton-B9r2TOyq.js} +1 -1
- package/dist/client/assets/{spinner-Cbrhyipt.js → spinner-DzAXz-ak.js} +1 -1
- package/dist/client/assets/{sso-DC7cMRPW.js → sso-CktB1aVG.js} +1 -1
- package/dist/client/assets/{store-rWTYBa0y.js → store-DVzGhYCb.js} +1 -1
- package/dist/client/assets/store-registry-BsmH8UbB.js +2 -0
- package/dist/client/assets/{studio-tools-BoD8kcA1.js → studio-tools-D6IcfTHF.js} +1 -1
- package/dist/client/assets/{switch-b-8BZDWJ.js → switch-B8JKQssM.js} +1 -1
- package/dist/client/assets/synced-repos-R0AkTDG5.js +1 -0
- package/dist/client/assets/tab-id-CPIceFUq.js +1 -0
- package/dist/client/assets/{table-CfpVPCrj.js → table-DjnLlp3Y.js} +1 -1
- package/dist/client/assets/{tabs-D-7lRbur.js → tabs-BVCZRpzY.js} +1 -1
- package/dist/client/assets/tasks-bT0G2AAJ.js +1 -0
- package/dist/client/assets/{textarea-CosQp1Ex.js → textarea-DUhzY-49.js} +1 -1
- package/dist/client/assets/{toggle-group-5LW11eFN.js → toggle-group-C2GRyClc.js} +1 -1
- package/dist/client/assets/{toolbar-Q0b8veSU.js → toolbar-CRquLcIr.js} +1 -1
- package/dist/client/assets/{tooltip-BfkRKScU.js → tooltip-C8WdZoAs.js} +1 -1
- package/dist/client/assets/{track-CG8KgfQd.js → track-DlQssvS7.js} +1 -1
- package/dist/client/assets/{types-BGHf5GHQ.js → types-CPa8SGGQ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BezO2qdd.js → use-ai-providers-hG0NJmyg.js} +1 -1
- package/dist/client/assets/{use-api-keys-BELfjQ6X.js → use-api-keys-D8jDupAP.js} +1 -1
- package/dist/client/assets/{use-automations-BB8THpxC.js → use-automations-B_w6lxQU.js} +1 -1
- package/dist/client/assets/{use-autosave-C7alUjY0.js → use-autosave-g4einljo.js} +1 -1
- package/dist/client/assets/{use-capability-mz-0XBoJ.js → use-capability-B23RInvZ.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BlWbr6nY.js → use-clock-tick-BDuDvLsc.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-B54oYyoh.js → use-commerce-diagnostic-C2s_wvEf.js} +1 -1
- package/dist/client/assets/{use-connection-B5TzA1Ut.js → use-connection-Dg56f5Vt.js} +1 -1
- package/dist/client/assets/{use-copy-BEi_L0rW.js → use-copy-DGVAP1M7.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BfQJXcoA.js → use-create-virtual-mcp-Cv6u_vQj.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BHPvlnZn.js → use-debounced-autosave-CTkEMRHe.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D880nDlC.js → use-debounced-value-qVTGK2NR.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D7YXko6B.js → use-decopilot-events-_lZ6Xk3T.js} +1 -1
- package/dist/client/assets/{use-delete-connection-urOdWe-_.js → use-delete-connection-9Bgp-HfT.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D_5KLYHI.js → use-deployment-admin-Dsr6f3P7.js} +1 -1
- package/dist/client/assets/{use-file-configs-C4oqeXep.js → use-file-configs-BZ18LlNu.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-A-tTatQb.js → use-infinite-scroll-CWnPk8zt.js} +1 -1
- package/dist/client/assets/{use-join-requests-Cvq2Nlxy.js → use-join-requests-Bo2pV8IS.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DKcZ7v-W.js → use-mcp-client-BsAnTcHa.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-B4aUfPof.js → use-mcp-tools-kK8zHPYS.js} +1 -1
- package/dist/client/assets/{use-members-Dypq7HzL.js → use-members-B9vphmDn.js} +1 -1
- package/dist/client/assets/{use-mobile-C0XoguQx.js → use-mobile-D3ZpQ04i.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Cxg9_mL_.js → use-navigate-to-agent-BhiQJGHm.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BwHZpmU9.js → use-open-billing-url-FgqegUnw.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CEm0cNyU.js → use-org-auth-client-tPvCf1dF.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DCxfKVxi.js → use-org-repo-syncs-Dn3ug8I0.js} +1 -1
- package/dist/client/assets/{use-org-sso-8p_mXDai.js → use-org-sso-DdtLWeHC.js} +1 -1
- package/dist/client/assets/{use-organization-roles-EKX73RmE.js → use-organization-roles-BYyGmBMK.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C62jhu_V.js → use-organization-settings-DbHsJaaW.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C82adOhA.js → use-registry-connections-CI0z613-.js} +1 -1
- package/dist/client/assets/{use-secrets-CXv4Or8y.js → use-secrets-dYdxMugZ.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-uursozx3.js → use-section-preview-base-B46aIuGF.js} +1 -1
- package/dist/client/assets/{use-settings-tabs-BO1uyGPC.js → use-settings-tabs-B_hY1mlT.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Df1zE4-g.js → use-status-sounds-DnGWueq0.js} +1 -1
- package/dist/client/assets/{use-tags-DBhn0x6Q.js → use-tags-BIZOfShH.js} +1 -1
- package/dist/client/assets/{use-view-mode-B8mZlQkB.js → use-view-mode-DQUSR-GN.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-IokMTZJW.js → use-virtual-mcp-CJYABS2i.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-3soE5ZtR.js +1 -0
- package/dist/client/assets/{useRouterState-BHrQRzTY.js → useRouterState-CFKKaLoi.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cean782d.js +1 -0
- package/dist/client/assets/{users-B6MzMck4.js → users-CAizcdlt.js} +1 -1
- package/dist/client/assets/variant-calendar-CpdX720c.js +1 -0
- package/dist/client/assets/{view-mode-toggle-waWn0PEd.js → view-mode-toggle-DMaq2N-u.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/install.sh +443 -45
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/Globe01-DEX4B2yM.js +0 -1
- package/dist/client/assets/agent-icon-BnyLUh_P.js +0 -1
- package/dist/client/assets/agents-list-WqvM4PBU.js +0 -1
- package/dist/client/assets/ai-providers-Cm0Rm1KR.js +0 -1
- package/dist/client/assets/app-editor-BDtjnvii.js +0 -1
- package/dist/client/assets/automations-C9iJneF6.js +0 -1
- package/dist/client/assets/bulk-category-panel-tfM9zSbQ.js +0 -1
- package/dist/client/assets/cards-CxCBBMfu.js +0 -9
- package/dist/client/assets/category-editor-CIZoMWm2.js +0 -1
- package/dist/client/assets/collection-detail-DGbcByEY.js +0 -1
- package/dist/client/assets/commerce-onboarding-DO7FMttC.js +0 -1
- package/dist/client/assets/connection-detail-m014gzNI.js +0 -1
- package/dist/client/assets/connections-BNQ0Y0h7.js +0 -1
- package/dist/client/assets/file-explorer-DKHfXuC4.js +0 -2
- package/dist/client/assets/general-BTyXC0VC.js +0 -1
- package/dist/client/assets/index-Di0wCO9r.js +0 -1
- package/dist/client/assets/post-editor-DnamQd0I.js +0 -1
- package/dist/client/assets/project-app-view-C-J9cu-l.js +0 -1
- package/dist/client/assets/record-editor-CoztL6I2.js +0 -1
- package/dist/client/assets/redirect-editor-Bz1AUCqF.js +0 -1
- package/dist/client/assets/registry-DQjw_3WH.js +0 -2
- package/dist/client/assets/roles-CYg93TjU.js +0 -1
- package/dist/client/assets/select-model-B5IdH_n6.js +0 -4
- package/dist/client/assets/seo-editor-Do7jjKRP.js +0 -1
- package/dist/client/assets/store-registry-Dz8WBmEa.js +0 -2
- package/dist/client/assets/synced-repos-Cuzl6scP.js +0 -1
- package/dist/client/assets/tab-id-BJUTVZdl.js +0 -1
- package/dist/client/assets/tasks-EwwXPqCM.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ewuCizNF.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BvX-6eAF.js +0 -1
- package/dist/client/assets/variant-calendar-DrArrrSO.js +0 -1
|
@@ -0,0 +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-QSWmOkVC.js";import{a as re,b as ye,D as ue,c as pe}from"./dropdown-menu-Gs5UGB4h.js";import{a as Ge}from"./Users03-D4EG206O.js";import{G as we,b as Me,a as Pe}from"./github-repo-picker-DOf_JZk2.js";import{u as Oe,b as ze,c as Be}from"./use-virtual-mcp-CJYABS2i.js";import{P as ce}from"./index-CElD4z4O.js";import{a as Ue}from"./DotsVertical-Dp5Cm_iP.js";import{A as Re,g as fe,b3 as $e}from"./agent-icon-eH38g2HT.js";import{a as He}from"./Settings02-DWTUyGYI.js";import{s as Ve}from"./Trash01-Dx-L9twD.js";import{p as Ke,f as he}from"./pt-BR-CLy76QW2.js";import{c as Se}from"./use-navigate-to-agent-BhiQJGHm.js";import{f as qe,i as Qe}from"./use-organization-settings-DbHsJaaW.js";import{u as _e}from"./use-capability-B23RInvZ.js";import{C as Je}from"./card-FCEwqon6.js";import{E as Ye}from"./empty-state-LcWMvkBG.js";import{u as We}from"./use-create-virtual-mcp-Cv6u_vQj.js";import{u as Xe}from"./use-connection-Dg56f5Vt.js";import{u as xe,S as Ze}from"./use-mcp-client-BsAnTcHa.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-0fNUeR9R.js";import{i as dt}from"./ArrowLeft-DHRINKlz.js";import{C as ut}from"./collection-search-DcQsyJxv.js";import{c as pt,d as gt,b as ft,f as ht,g as xt,e as jt,a as Ct,A as bt}from"./alert-dialog-CMLgUtLr.js";import{S as Dt}from"./search-input-DPH-j2ty.js";import{s as Ce}from"./Plus-9luEKPZw.js";import"./Check-DhNjrmaj.js";import"./ChevronRight-jZWdrf9f.js";import"./use-debounced-value-qVTGK2NR.js";import"./authenticate-and-persist-oauth-iw6ouFr9.js";import"./mcp-oauth-CXtITOci.js";import"./auth-C0RxM0MV.js";import"./LinkExternal01-BAXCjJ3W.js";import"./LockUnlocked01-CTGb9BVB.js";import"./use-mcp-tools-kK8zHPYS.js";import"./extract-connection-data-BYxfOuH_.js";import"./metadata-dUsYcpuu.js";import"./sidebar-B9FCz4Mq.js";import"./LayoutLeft-DTt2h_gY.js";import"./use-mobile-D3ZpQ04i.js";import"./X-CSYXCnV9.js";import"./tooltip-C8WdZoAs.js";import"./AlertCircle-BSGNUx7V.js";import"./Tool01-B3cfX7QW.js";import"./ArrowUp-ntTpD-To.js";import"./Tool02-Dz1T3Rmg.js";import"./XCircle-Cu0-8nUy.js";import"./ArrowUpRight-BG4SvGJv.js";import"./TrendUp01-jt7vyfmI.js";import"./ZapSquare-DsGT7WIC.js";import"./CheckCircle-B_sdSbJU.js";import"./ChevronDown-CaUFgq06.js";import"./ChevronUp-BRjHRWFg.js";import"./Stars02-B6JXDKru.js";import"./Copy01-C3CSvCmh.js";import"./CreditCard01-5rNLMrBA.js";import"./Download01-DIiuseU_.js";import"./Eye-CVDf_kH4.js";import"./FilterLines-DV7AkyjC.js";import"./Share07-BBwkuMmH.js";import"./Globe01-Bak8Df7R.js";import"./Globe04-21nMtmZT.js";import"./SwitchHorizontal01-CdQluNjW.js";import"./HardDrive-yKF5zKg2.js";import"./Key01-C-HagbU9.js";import"./LogOut01-CI181NEF.js";import"./Monitor01-Be5N7TRy.js";import"./Sun-BJxBIAjy.js";import"./Palette-BNNCPeK0.js";import"./Play-BsRzOgzp.js";import"./SearchLg-F6MPrrZo.js";import"./SearchMd-7UCVFr92.js";import"./Shield01-DwaMx4Kj.js";import"./Stars01-gwxykcEQ.js";import"./Upload01-BxhthB2p.js";import"./User01-CFSl83nB.js";import"./Users01-BijcXXI3.js";import"./XClose-DSHM2tuZ.js";import"./Zap-BJ7aktKA.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-Cj6NKwbB.js";import"./decopilot-sse-pool-BNW6JWpR.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./studio-tools-D6IcfTHF.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")),R=B.connId;if(!R)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=R;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:R,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:R},{connection_id:$}]}}}),U=Q.structuredContent??Q;if(!U.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return I=U.item.id,{slug:Z,virtualMcpId:U.item.id,connId:R,item:U.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 R;t[38]===Symbol.for("react.memo_cache_sentinel")?(R=L=>!L&&T(null),t[38]=R):R=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 U;t[53]!==e?(U=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=U):U=t[54];let H;t[55]!==U?(H=o.jsx(ht,{children:U}),t[55]=U,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:R,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as J,b as se,a0 as Fe,$ as $e,r as G,j as s,a3 as tt,t as X,at as Ue,F as be,o as je,e as le,K as te,n as ke,m as Ee,B as ee,v as He,p as Re,X as st,Z as Pe,E as it}from"./index-QSWmOkVC.js";import{i as lt}from"./AlertCircle-BSGNUx7V.js";import{P as Ie}from"./index-CElD4z4O.js";import{S as Ke}from"./skeleton-B9r2TOyq.js";import{b as qe,a as De,S as we,c as rt}from"./settings-section-KNTU5IvO.js";import{S as ot}from"./settings-subnav-Cd0l_6Ey.js";import{u as Be,b as _e,i as nt,c as at,p as ct,d as Ae,e as dt,f as ze}from"./use-ai-providers-hG0NJmyg.js";import{i as mt}from"./CheckCircle-B_sdSbJU.js";import{c as ut,S as ft,k as pt}from"./use-organization-settings-DbHsJaaW.js";import{c as gt,d as Ve,P as xt,C as Me}from"./select-model-CKrLO7E8.js";import{u as ht}from"./use-debounced-autosave-CTkEMRHe.js";import{I as ye}from"./input-CjD4VhOq.js";import{a as Te,T as vt}from"./toggle-group-C2GRyClc.js";import{c as Le,d as Qe,b as Ge,f as Ye,g as We,e as Je,a as Xe,A as Ze}from"./alert-dialog-CMLgUtLr.js";import{u as re}from"./studio-tools-D6IcfTHF.js";import{s as yt}from"./Plus-9luEKPZw.js";import{p as bt,f as jt}from"./pt-BR-CLy76QW2.js";import{c as St}from"./Tool01-B3cfX7QW.js";import{s as Ct}from"./Trash01-Dx-L9twD.js";import{A as _t}from"./avatar-CzJUVoDs.js";import{P as Nt}from"./ai-providers-logos-DD3qZ33J.js";import{i as Pt}from"./Settings02-DWTUyGYI.js";import{s as It}from"./Eye-CVDf_kH4.js";import{b as kt,a as Kt,d as Dt,e as wt,c as At}from"./dialog-0fNUeR9R.js";import{S as Et}from"./spinner-DzAXz-ak.js";import{R as Rt}from"./require-capability-BujVC6Iv.js";import"./sidebar-B9FCz4Mq.js";import"./LayoutLeft-DTt2h_gY.js";import"./use-mobile-D3ZpQ04i.js";import"./X-CSYXCnV9.js";import"./tooltip-C8WdZoAs.js";import"./card-FCEwqon6.js";import"./ArrowUpRight-BG4SvGJv.js";import"./useRouterState-CFKKaLoi.js";import"./use-settings-tabs-B_hY1mlT.js";import"./use-capability-B23RInvZ.js";import"./use-mcp-client-BsAnTcHa.js";import"./auth-C0RxM0MV.js";import"./drawer-HRJ32EbE.js";import"./chat-context-Qk-9IhfU.js";import"./tab-id-CPIceFUq.js";import"./Check-DhNjrmaj.js";import"./Copy01-C3CSvCmh.js";import"./Download01-DIiuseU_.js";import"./hooks-Cj6NKwbB.js";import"./decopilot-sse-pool-BNW6JWpR.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CJYABS2i.js";import"./use-decopilot-events-_lZ6Xk3T.js";import"./checkbox-Badqx0C2.js";import"./select-BY-TTUaX.js";import"./ChevronDown-CaUFgq06.js";import"./ChevronUp-BRjHRWFg.js";import"./ArrowLeft-DHRINKlz.js";import"./Key01-C-HagbU9.js";import"./SearchMd-7UCVFr92.js";import"./Monitor01-Be5N7TRy.js";import"./ChevronRight-jZWdrf9f.js";import"./Stars01-gwxykcEQ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-CFSl83nB.js";import"./access-gate-rP_MjwR7.js";import"./capability-load-error-CRpB249h.js";const Mt=e=>e.capabilities?.includes("image")===!0,Tt=e=>nt(e),Ot=e=>at(e),Ft=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Mt},{key:"web_search",filter:Tt},{key:"deep_research",filter:Ot}];function $t(e){const t=J.c(30),{slot:i,onSlotChange:o,filterModels:n,defaultKeyId:c}=e,a=Be(),l=a.some(C=>C.id===i?.keyId)?i?.keyId:null,[u,_]=G.useState(l??c);let b,r;t[0]!==l?(b=()=>{l&&_(l)},r=[l],t[0]=l,t[1]=b,t[2]=r):(b=t[1],r=t[2]),G.useEffect(b,r);let p;t[3]!==a||t[4]!==c||t[5]!==u?(p=a.some(C=>C.id===u)?u:c,t[3]=a,t[4]=c,t[5]=u,t[6]=p):p=t[6];const m=p;let f;t[7]!==m||t[8]!==a?(f=m?a.find(C=>C.id===m):null,t[7]=m,t[8]=a,t[9]=f):f=t[9];const P=f,{models:h,isLoading:v}=_e(n?m??void 0:void 0),g=n?v||h.some(n):!0;let N;t[10]!==i||t[11]!==P?.providerId||t[12]!==l?(N=i&&l?{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]=l,t[13]=N):N=t[13];const k=N,x=se();if(n&&!g){let C;t[14]!==x?(C=x("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=x,t[15]=C):C=t[15];let K;return t[16]!==C?(K=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:C}),t[16]=C,t[17]=K):K=t[17],K}let j;t[18]!==x?(j=x("settings.simpleModeSection.pickModel"),t[18]=x,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]!==o?(d=C=>{const K=C.keyId??m??"";_(K),o({keyId:K,modelId:C.modelId,title:C.title})},t[21]=m,t[22]=o,t[23]=d):d=t[23];let y;return t[24]!==m||t[25]!==n||t[26]!==k||t[27]!==j||t[28]!==d?(y=s.jsx(gt,{variant:"bordered",placeholder:j,model:k,credentialId:m,filterModels:n,onCredentialChange:S,onModelChange:d}),t[24]=m,t[25]=n,t[26]=k,t[27]=j,t[28]=d,t[29]=y):y=t[29],y}function Ut(e){const t=J.c(10),{isPending:i,showSaved:o}=e,n=se();if(i){let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ue,{size:12,className:"animate-spin"}),t[0]=c):c=t[0];let a;t[1]!==n?(a=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=a):a=t[2];let l;return t[3]!==a?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c,a]}),t[3]=a,t[4]=l):l=t[4],l}if(o){let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(mt,{size:12}),t[5]=c):c=t[5];let a;t[6]!==n?(a=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=a):a=t[7];let l;return t[8]!==a?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[c,a]}),t[8]=a,t[9]=l):l=t[9],l}return null}function Ht(){const e=J.c(58),t=se(),i=Be(),o=ut(),n=i.length>0;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=Fe(ft),e[0]=c):c=e[0];let a;e[1]!==o?(a={resolver:c,values:o,mode:"onChange"},e[1]=o,e[2]=a):a=e[2];const l=$e(a),{mutate:u,isPending:_,isSuccess:b}=pt(),r=l.formState.isDirty;let p;e[3]!==l||e[4]!==o||e[5]!==t||e[6]!==u?(p={delayMs:250,save:async()=>{const I=l.getValues();u(I,{onSuccess:()=>l.reset(I,{keepValues:!0}),onError:T=>{l.reset(o),X.error(t("settings.simpleModeSection.failedToSave",{error:T.message}))}})}},e[3]=l,e[4]=o,e[5]=t,e[6]=u,e[7]=p):p=e[7];const{schedule:m}=ht(p),f=i[0],P=i[1],h=i[2],{models:v}=_e(f?.id),{models:g}=_e(P?.id),{models:N}=_e(h?.id);let k,x;e[8]!==l||e[9]!==n?(k=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},x=[n,l],e[8]=l,e[9]=n,e[10]=k,e[11]=x):(k=e[10],x=e[11]),G.useEffect(k,x);let j;e[12]!==i||e[13]!==l||e[14]!==f||e[15]!==P||e[16]!==h||e[17]!==v||e[18]!==g||e[19]!==N?(j=()=>{const I=l.getValues(),T=new Set(i.map(qt)),O={};f?.id&&(O[f.id]=v),P?.id&&(O[P.id]=g),h?.id&&(O[h.id]=N);const M=Q=>Q!=null&&!T.has(Q.keyId),D={fast:M(I.tiers.fast)?null:I.tiers.fast,smart:M(I.tiers.smart)?null:I.tiers.smart,thinking:M(I.tiers.thinking)?null:I.tiers.thinking,image:M(I.tiers.image)?null:I.tiers.image,web_search:M(I.tiers.web_search)?null:I.tiers.web_search,deep_research:M(I.tiers.deep_research)?null:I.tiers.deep_research},Y=!D.fast||!D.smart||!D.thinking||!D.image||!D.web_search||!D.deep_research,W=D.fast===I.tiers.fast&&D.smart===I.tiers.smart&&D.thinking===I.tiers.thinking&&D.image===I.tiers.image&&D.web_search===I.tiers.web_search&&D.deep_research===I.tiers.deep_research;if(!Y&&W)return;const B=ct(i,O);l.reset({tiers:{fast:D.fast??B.chat.fast,smart:D.smart??B.chat.smart,thinking:D.thinking??B.chat.thinking,image:D.image??B.image,web_search:D.web_search??B.webSearch,deep_research:D.deep_research??B.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=f,e[15]=P,e[16]=h,e[17]=v,e[18]=g,e[19]=N,e[20]=j):j=e[20];const S=f?.id,d=P?.id,y=h?.id;let C;e[21]!==i||e[22]!==l||e[23]!==v||e[24]!==g||e[25]!==N||e[26]!==S||e[27]!==d||e[28]!==y?(C=[l,i,v,g,N,S,d,y],e[21]=i,e[22]=l,e[23]=v,e[24]=g,e[25]=N,e[26]=S,e[27]=d,e[28]=y,e[29]=C):C=e[29],G.useEffect(j,C);let K;e[30]!==t?(K=I=>({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")})[I]||I,e[30]=t,e[31]=K):K=e[31];const A=K;let w;e[32]!==t?(w=I=>({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")})[I]||"",e[32]=t,e[33]=w):w=e[33];const E=w;let R;e[34]!==t?(R=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=R):R=e[35];let F;e[36]!==t?(F=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=F):F=e[37];let z;e[38]!==F?(z=s.jsx("p",{className:"text-sm text-muted-foreground",children:F}),e[38]=F,e[39]=z):z=e[39];const L=b&&!r;let $;e[40]!==_||e[41]!==L?($=s.jsx(Ut,{isPending:_,showSaved:L}),e[40]=_,e[41]=L,e[42]=$):$=e[42];let U;e[43]!==z||e[44]!==$?(U=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[z,$]}),e[43]=z,e[44]=$,e[45]=U):U=e[45];let H;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==E||e[49]!==A||e[50]!==m?(H=Ft.map(I=>s.jsx(tt,{control:l.control,name:`tiers.${I.key}`,render:T=>{const{field:O}=T;return s.jsx(qe,{title:A(I.key),description:E(I.key),action:s.jsx($t,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:I.filter,onSlotChange:M=>{O.onChange(M),m()}})})}},I.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=E,e[49]=A,e[50]=m,e[51]=H):H=e[51];let q;e[52]!==H?(q=s.jsx(De,{children:H}),e[52]=H,e[53]=q):q=e[53];let V;return e[54]!==R||e[55]!==U||e[56]!==q?(V=s.jsxs(we,{title:R,headerClassName:"pl-0",children:[U,q]}),e[54]=R,e[55]=U,e[56]=q,e[57]=V):V=e[57],V}function qt(e){return e.id}const Bt={usd:[10,20,100],brl:[50,100,500]};function zt(){const e=J.c(30),t=se(),i=re(),[o]=He(),[n,c]=G.useState(!1);let a;e[0]!==t?(a=d=>{X.error(t("settings.decoCreditsHero.topUpFailed",{message:d.message}))},e[0]=t,e[1]=a):a=e[1];const{mutate:l,isPending:u}=le({mutationFn:async d=>{const{url:y}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:d,currency:m});return y},onSuccess:Vt,onError:a}),[_,b]=G.useState(""),[r,p]=G.useState(o.language==="pt-BR"?"brl":"usd"),m=r,f=parseFloat(_),P=!isNaN(f)&&f>=1,h=m==="brl"?"R$":"$";let v;e[2]!==p?(v=d=>{d&&p(d)},e[2]=p,e[3]=v):v=e[3];let g,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Te,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),N=s.jsx(Te,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[4]=g,e[5]=N):(g=e[4],N=e[5]);let k;e[6]!==m||e[7]!==v?(k=s.jsxs(vt,{type:"single",variant:"outline",size:"default",value:m,onValueChange:v,children:[g,N]}),e[6]=m,e[7]=v,e[8]=k):k=e[8];let x;e[9]!==m||e[10]!==h||e[11]!==n||e[12]!==u||e[13]!==t||e[14]!==l?(x=!n&&s.jsxs(s.Fragment,{children:[Bt[m].map(d=>s.jsxs(ee,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:u,onClick:()=>l(d*100),children:[h,d]},d)),s.jsx(ee,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>c(!0),disabled:u,children:t("settings.decoCreditsHero.custom")})]}),e[9]=m,e[10]=h,e[11]=n,e[12]=u,e[13]=t,e[14]=l,e[15]=x):x=e[15];let j;e[16]!==h||e[17]!==_||e[18]!==f||e[19]!==n||e[20]!==P||e[21]!==u||e[22]!==b||e[23]!==t||e[24]!==l?(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:h}),s.jsx(ye,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:_,onChange:d=>b(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(ee,{className:"h-10",disabled:!P||u,onClick:()=>l(Math.round(f*100)),children:u?"...":t("settings.decoCreditsHero.add")}),s.jsx(ee,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{c(!1),b("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=h,e[17]=_,e[18]=f,e[19]=n,e[20]=P,e[21]=u,e[22]=b,e[23]=t,e[24]=l,e[25]=j):j=e[25];let S;return e[26]!==k||e[27]!==x||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:[k,x,j]})}),e[26]=k,e[27]=x,e[28]=j,e[29]=S):S=e[29],S}function Vt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function Lt(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function Qt(){const e=J.c(121),t=se(),{org:i}=be(),o=re(),n=je(),c=Ae();let a;e[0]!==c?(a=c.find(Gt),e[0]=c,e[1]=a):a=e[1];const l=a,[u,_]=G.useState(!1);let b;e[2]!==l||e[3]!==o?(b=async()=>{l&&await o.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=o,e[4]=b):b=e[4];let r;e[5]!==i.id||e[6]!==n||e[7]!==t?(r=()=>{n.invalidateQueries({queryKey:te.aiProviderKeys(i.id)}),n.invalidateQueries({queryKey:te.aiProviders(i.id)}),X.success(t("settings.decoCreditsHero.disconnectSuccess")),_(!1)},e[5]=i.id,e[6]=n,e[7]=t,e[8]=r):r=e[8];let p;e[9]!==t?(p=et=>{X.error(t("settings.decoCreditsHero.disconnectError",{message:et.message}))},e[9]=t,e[10]=p):p=e[10];let m;e[11]!==b||e[12]!==r||e[13]!==p?(m={mutationFn:b,onSuccess:r,onError:p},e[11]=b,e[12]=r,e[13]=p,e[14]=m):m=e[14];const{mutate:f,isPending:P}=le(m);let h;e[15]!==i.id?(h=te.aiProviderCredits(i.id,"deco"),e[15]=i.id,e[16]=h):h=e[16];const v=!!l;let g;e[17]!==o?(g=async()=>{try{return await o.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[17]=o,e[18]=g):g=e[18];let N;e[19]!==h||e[20]!==v||e[21]!==g?(N={queryKey:h,enabled:v,staleTime:6e4,queryFn:g},e[19]=h,e[20]=v,e[21]=g,e[22]=N):N=e[22];const{data:k,isLoading:x,refetch:j,isFetching:S}=ke(N);if(!l)return null;const d=k?.balanceCents!=null?k.balanceCents/100:null;let y;e[23]!==d?(y=d!=null?`$${d.toFixed(2)}`:"—",e[23]=d,e[24]=y):y=e[24];const C=y;let K;e[25]!==t?(K=t("settings.decoCreditsHero.title"),e[25]=t,e[26]=K):K=e[26];let A;e[27]!==t?(A=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[27]=t,e[28]=A):A=e[28];let w;e[29]!==A?(w=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:A,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[29]=A,e[30]=w):w=e[30];let E;e[31]!==t?(E=t("settings.decoCreditsHero.accessModels"),e[31]=t,e[32]=E):E=e[32];let R;e[33]!==E?(R=s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:E})}),e[33]=E,e[34]=R):R=e[34];let F;e[35]!==w||e[36]!==R?(F=s.jsxs("div",{className:"flex items-center gap-3",children:[w,R]}),e[35]=w,e[36]=R,e[37]=F):F=e[37];let z;e[38]===Symbol.for("react.memo_cache_sentinel")?(z=()=>_(!0),e[38]=z):z=e[38];let L;e[39]!==t?(L=t("settings.decoCreditsHero.disconnect"),e[39]=t,e[40]=L):L=e[40];let $;e[41]!==P||e[42]!==L?($=s.jsx(ee,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:P,children:L}),e[41]=P,e[42]=L,e[43]=$):$=e[43];let U;e[44]!==F||e[45]!==$?(U=s.jsxs("div",{className:"flex items-center justify-between",children:[F,$]}),e[44]=F,e[45]=$,e[46]=U):U=e[46];let H;e[47]!==t?(H=t("settings.decoCreditsHero.disconnectTitle"),e[47]=t,e[48]=H):H=e[48];let q;e[49]!==H?(q=s.jsx(Le,{children:H}),e[49]=H,e[50]=q):q=e[50];let V;e[51]!==t?(V=t("settings.decoCreditsHero.disconnectDescription"),e[51]=t,e[52]=V):V=e[52];let I;e[53]!==V?(I=s.jsx(Qe,{children:V}),e[53]=V,e[54]=I):I=e[54];let T;e[55]!==q||e[56]!==I?(T=s.jsxs(Ge,{children:[q,I]}),e[55]=q,e[56]=I,e[57]=T):T=e[57];let O;e[58]!==t?(O=t("settings.decoCreditsHero.cancelButton"),e[58]=t,e[59]=O):O=e[59];let M;e[60]!==O?(M=s.jsx(Ye,{children:O}),e[60]=O,e[61]=M):M=e[61];let D;e[62]!==f?(D=()=>f(),e[62]=f,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 W;e[66]!==D||e[67]!==Y?(W=s.jsx(We,{onClick:D,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Y}),e[66]=D,e[67]=Y,e[68]=W):W=e[68];let B;e[69]!==M||e[70]!==W?(B=s.jsxs(Je,{children:[M,W]}),e[69]=M,e[70]=W,e[71]=B):B=e[71];let Q;e[72]!==T||e[73]!==B?(Q=s.jsxs(Xe,{children:[T,B]}),e[72]=T,e[73]=B,e[74]=Q):Q=e[74];let ie;e[75]!==u||e[76]!==Q?(ie=s.jsx(Ze,{open:u,onOpenChange:_,children:Q}),e[75]=u,e[76]=Q,e[77]=ie):ie=e[77];let Z;e[78]!==d||e[79]!==C||e[80]!==S||e[81]!==x?(Z=x||S?s.jsx(Ke,{className:"h-9 w-24"}):s.jsx("span",{className:Ee("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&Lt(d)),children:C}),e[78]=d,e[79]=C,e[80]=S,e[81]=x,e[82]=Z):Z=e[82];let oe;e[83]!==j?(oe=()=>j(),e[83]=j,e[84]=oe):oe=e[84];let ne;e[85]!==t?(ne=t("settings.decoCreditsHero.refreshBalance"),e[85]=t,e[86]=ne):ne=e[86];const Ne=S&&"animate-spin";let ae;e[87]!==Ne?(ae=Ee(Ne),e[87]=Ne,e[88]=ae):ae=e[88];let ce;e[89]!==ae?(ce=s.jsx(Ue,{size:14,className:ae}),e[89]=ae,e[90]=ce):ce=e[90];let de;e[91]!==S||e[92]!==oe||e[93]!==ne||e[94]!==ce?(de=s.jsx("button",{type:"button",onClick:oe,disabled:S,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":ne,children:ce}),e[91]=S,e[92]=oe,e[93]=ne,e[94]=ce,e[95]=de):de=e[95];let me;e[96]!==Z||e[97]!==de?(me=s.jsxs("div",{className:"flex items-baseline gap-2",children:[Z,de]}),e[96]=Z,e[97]=de,e[98]=me):me=e[98];let ue;e[99]!==t?(ue=t("settings.decoCreditsHero.availableBalance"),e[99]=t,e[100]=ue):ue=e[100];let fe;e[101]!==ue?(fe=s.jsx("p",{className:"text-xs text-muted-foreground",children:ue}),e[101]=ue,e[102]=fe):fe=e[102];let pe;e[103]!==me||e[104]!==fe?(pe=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[me,fe]}),e[103]=me,e[104]=fe,e[105]=pe):pe=e[105];let ge;e[106]!==t?(ge=t("settings.decoCreditsHero.addCredits"),e[106]=t,e[107]=ge):ge=e[107];let xe;e[108]!==ge?(xe=s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:ge}),e[108]=ge,e[109]=xe):xe=e[109];let Se;e[110]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(zt,{}),e[110]=Se):Se=e[110];let he;e[111]!==xe?(he=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[xe,Se]}),e[111]=xe,e[112]=he):he=e[112];let ve;e[113]!==U||e[114]!==ie||e[115]!==pe||e[116]!==he?(ve=s.jsx(De,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[U,ie,pe,he]})}),e[113]=U,e[114]=ie,e[115]=pe,e[116]=he,e[117]=ve):ve=e[117];let Ce;return e[118]!==K||e[119]!==ve?(Ce=s.jsx(we,{title:K,children:ve}),e[118]=K,e[119]=ve,e[120]=Ce):Ce=e[120],Ce}function Gt(e){return e.providerId==="deco"}function Yt(){const e=J.c(12),{org:t}=be(),i=re(),o=je(),n=se();let c;e[0]!==i?(c=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==o||e[4]!==n?(a=()=>{Re("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:te.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:te.aiProviders(t.id)}),X.success(n("settings.aiProviders.decoConnectSuccess"))},e[2]=t,e[3]=o,e[4]=n,e[5]=a):a=e[5];let l;e[6]!==n?(l=_=>{Re("ai_provider_provision_failed",{provider_id:"deco",error:_.message}),X.error(n("settings.aiProviders.decoConnectError",{error:_.message}))},e[6]=n,e[7]=l):l=e[7];let u;return e[8]!==c||e[9]!==a||e[10]!==l?(u={mutationFn:c,onSuccess:a,onError:l},e[8]=c,e[9]=a,e[10]=l,e[11]=u):u=e[11],le(u)}function Wt(){const e=J.c(37),t=se(),{mutate:i,isPending:o}=Yt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=n):n=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=c):c=e[1];let a;e[2]!==t?(a=t("settings.decoNudgeCard.decoAiGateway"),e[2]=t,e[3]=a):a=e[3];let l;e[4]!==a?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:a,className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[4]=a,e[5]=l):l=e[5];let 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 b;e[10]!==t?(b=t("settings.decoNudgeCard.recommended"),e[10]=t,e[11]=b):b=e[11];let r;e[12]!==b?(r=s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:b}),e[12]=b,e[13]=r):r=e[13];let p;e[14]!==_||e[15]!==r?(p=s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[_,r]}),e[14]=_,e[15]=r,e[16]=p):p=e[16];let m;e[17]!==t?(m=t("settings.decoNudgeCard.description"),e[17]=t,e[18]=m):m=e[18];let f;e[19]!==m?(f=s.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[19]=m,e[20]=f):f=e[20];let P;e[21]!==f||e[22]!==p?(P=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,f]}),e[21]=f,e[22]=p,e[23]=P):P=e[23];let h;e[24]!==i?(h=()=>i(),e[24]=i,e[25]=h):h=e[25];let v;e[26]!==o||e[27]!==t?(v=t(o?"settings.decoNudgeCard.connecting":"settings.decoNudgeCard.connectDeco"),e[26]=o,e[27]=t,e[28]=v):v=e[28];let g;e[29]!==o||e[30]!==h||e[31]!==v?(g=s.jsx(ee,{variant:"outline",disabled:o,onClick:h,children:v}),e[29]=o,e[30]=h,e[31]=v,e[32]=g):g=e[32];let N;return e[33]!==P||e[34]!==g||e[35]!==l?(N=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[c,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,P,g]})]}),e[33]=P,e[34]=g,e[35]=l,e[36]=N):N=e[36],N}const Jt=e=>st({label:Pe().min(1,e("settings.editProviderDialog.labelRequired")).max(100),apiKey:Pe().optional(),baseUrl:Pe().optional()});function Xt({isOpenAICompatible:e,baseUrl:t,currentBaseUrl:i,apiKey:o}){return e&&!!t&&t!==i&&!o}function Zt({providerKey:e,provider:t,preset:i,maskedKey:o,currentLabel:n,currentBaseUrl:c,onCancel:a,onSuccess:l}){const{org:u}=be(),_=re(),b=je(),r=se(),[p,m]=G.useState(!1),f=t.id==="openai-compatible",P=t.supportedMethods.includes("api-key"),h=Jt(r),{register:v,handleSubmit:g,watch:N,setError:k,formState:{errors:x}}=$e({resolver:Fe(h),defaultValues:{label:n,apiKey:"",baseUrl:c??""}}),j=N("apiKey")??"",{mutate:S,isPending:d}=le({mutationFn:async y=>{let C;y.apiKey&&(f?C=JSON.stringify({baseUrl:y.baseUrl||c||"",apiKey:y.apiKey}):C=y.apiKey),await _.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:y.label,...C!==void 0?{apiKey:C}:{}})},onSuccess:()=>{b.invalidateQueries({queryKey:te.aiProviderKeys(u.id)}),b.invalidateQueries({queryKey:te.aiProviders(u.id)}),X.success(r("settings.editProviderDialog.providerUpdated")),l()},onError:y=>X.error(r("settings.editProviderDialog.failedToUpdate",{error:y.message}))});return s.jsxs("form",{onSubmit:g(y=>{if(Xt({isOpenAICompatible:f,baseUrl:y.baseUrl,currentBaseUrl:c,apiKey:y.apiKey})){k("apiKey",{message:r("settings.editProviderDialog.apiKeyRequiredForBaseUrlChange")});return}S(y)}),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.label")}),s.jsx(ye,{placeholder:r("settings.editProviderDialog.labelPlaceholder"),...v("label"),className:"h-8 text-sm"}),x.label&&s.jsx("p",{className:"text-xs text-destructive",children:x.label.message})]}),f&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:r("settings.editProviderDialog.baseUrl")}),s.jsx(ye,{type:"url",placeholder:i?.baseUrlPlaceholder??r("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:[r("settings.editProviderDialog.apiKey")," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",r("settings.editProviderDialog.leaveBlankHint"),")"]})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ye,{type:p&&j?"text":"password",placeholder:o,...v("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),j&&s.jsx("button",{type:"button",onClick:()=>m(!p),"aria-label":r(p?"settings.editProviderDialog.hideApiKey":"settings.editProviderDialog.showApiKey"),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:p?s.jsx(Pt,{size:14}):s.jsx(It,{size:14})})]}),x.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:x.apiKey.message})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(At,{children:[s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:a,disabled:d,children:r("settings.editProviderDialog.cancel")}),s.jsx(ee,{type:"submit",size:"sm",disabled:d,children:r(d?"settings.editProviderDialog.saving":"settings.editProviderDialog.save")})]})]})}function es(e){const t=J.c(31),{providerKey:i,provider:o,open:n,onOpenChange:c}=e,a=se(),l=re(),u=o.id==="openai-compatible"&&i.presetId?Ve(i.presetId):void 0,_=u?.name??o.name;let b;t[0]!==i.id?(b=te.aiProviderKeyPreview(i.id),t[0]=i.id,t[1]=b):b=t[1];let r;t[2]!==i.id||t[3]!==l?(r=()=>l.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[2]=i.id,t[3]=l,t[4]=r):r=t[4];let p;t[5]!==n||t[6]!==b||t[7]!==r?(p={queryKey:b,queryFn:r,enabled:n,staleTime:0},t[5]=n,t[6]=b,t[7]=r,t[8]=p):p=t[8];const{data:m,isLoading:f}=ke(p),P=wt,h=Dt,v="sm:max-w-md",g=Kt,N=kt,k=a("settings.editProviderDialog.editTitle",{name:_});let x;t[9]!==N||t[10]!==k?(x=s.jsx(N,{children:k}),t[9]=N,t[10]=k,t[11]=x):x=t[11];let j;t[12]!==g||t[13]!==x?(j=s.jsx(g,{children:x}),t[12]=g,t[13]=x,t[14]=j):j=t[14];let S;t[15]!==f||t[16]!==c||t[17]!==u||t[18]!==m||t[19]!==o||t[20]!==i?(S=f||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Et,{})}):s.jsx(Zt,{providerKey:i,provider:o,preset:u,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>c(!1),onSuccess:()=>c(!1)}),t[15]=f,t[16]=c,t[17]=u,t[18]=m,t[19]=o,t[20]=i,t[21]=S):S=t[21];let d;t[22]!==h||t[23]!==j||t[24]!==S?(d=s.jsxs(h,{className:v,children:[j,S]}),t[22]=h,t[23]=j,t[24]=S,t[25]=d):d=t[25];let y;return t[26]!==P||t[27]!==c||t[28]!==n||t[29]!==d?(y=s.jsx(P,{open:n,onOpenChange:c,children:d}),t[26]=P,t[27]=c,t[28]=n,t[29]=d,t[30]=y):y=t[30],y}function ts(e){const t=J.c(86),{providerKey:i,provider:o}=e,{org:n}=be(),c=re(),a=je(),[l,u]=G.useState(!1),[_,b]=G.useState(!1),r=se(),[p]=He(),m=p.language==="pt-BR"?bt:void 0,f=o?.id==="openai-compatible";let P;t[0]!==f||t[1]!==i.presetId?(P=f&&i.presetId?Ve(i.presetId):void 0,t[0]=f,t[1]=i.presetId,t[2]=P):P=t[2];const h=P;let v;t[3]!==f||t[4]!==h||t[5]!==o?.name||t[6]!==i.providerId||t[7]!==r?(v=h?h.name:f?r("settings.aiProviders.customOpenAiCompatible"):o?.name??(i.providerId==="claude-code"?r("settings.providerKeyRow.claudeCode"):i.providerId==="codex"?r("settings.providerKeyRow.codex"):i.providerId),t[3]=f,t[4]=h,t[5]=o?.name,t[6]=i.providerId,t[7]=r,t[8]=v):v=t[8];const g=v,N=h?.logo??o?.logo??Nt[i.providerId];let k;e:{if(f){k=i.label;break e}let Z;t[9]!==m||t[10]!==i.createdAt||t[11]!==i.label||t[12]!==r?(Z=r("settings.providerKeyRow.addedTimeAgo",{label:i.label,time:jt(new Date(i.createdAt),{locale:m})}),t[9]=m,t[10]=i.createdAt,t[11]=i.label,t[12]=r,t[13]=Z):Z=t[13],k=Z}const x=k;let j;t[14]!==i.id||t[15]!==c?(j=async()=>{await c.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[14]=i.id,t[15]=c,t[16]=j):j=t[16];let S;t[17]!==n||t[18]!==i.id||t[19]!==a||t[20]!==r?(S=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(n.id)}),a.invalidateQueries({queryKey:te.aiProviders(n.id)}),a.invalidateQueries({queryKey:te.aiProviderModels(n.id,i.id)}),X.success(r("settings.providerKeyRow.keyDeleted")),u(!1)},t[17]=n,t[18]=i.id,t[19]=a,t[20]=r,t[21]=S):S=t[21];let d;t[22]!==r?(d=Z=>X.error(r("settings.providerKeyRow.failedToDeleteKey",{error:Z.message})),t[22]=r,t[23]=d):d=t[23];let y;t[24]!==j||t[25]!==S||t[26]!==d?(y={mutationFn:j,onSuccess:S,onError:d},t[24]=j,t[25]=S,t[26]=d,t[27]=y):y=t[27];const{mutate:C,isPending:K}=le(y);let A;t[28]!==g||t[29]!==N?(A=N?s.jsx("img",{src:N,alt:g,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(_t,{fallback:g.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[28]=g,t[29]=N,t[30]=A):A=t[30];let w;t[31]!==o||t[32]!==r?(w=o?s.jsx(ee,{variant:"ghost",size:"icon","aria-label":r("settings.providerKeyRow.editProviderKey"),className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>b(!0),children:s.jsx(St,{size:14})}):null,t[31]=o,t[32]=r,t[33]=w):w=t[33];let E;t[34]!==r?(E=r("settings.providerKeyRow.deleteProviderKey"),t[34]=r,t[35]=E):E=t[35];let R,F;t[36]===Symbol.for("react.memo_cache_sentinel")?(R=()=>u(!0),F=s.jsx(Ct,{size:14}),t[36]=R,t[37]=F):(R=t[36],F=t[37]);let z;t[38]!==K||t[39]!==E?(z=s.jsx(ee,{variant:"ghost",size:"icon","aria-label":E,className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:K,onClick:R,children:F}),t[38]=K,t[39]=E,t[40]=z):z=t[40];let L;t[41]!==z||t[42]!==w?(L=s.jsxs("div",{className:"flex items-center gap-0.5",children:[w,z]}),t[41]=z,t[42]=w,t[43]=L):L=t[43];let $;t[44]!==x||t[45]!==g||t[46]!==L||t[47]!==A?($=s.jsx(qe,{icon:A,title:g,description:x,action:L}),t[44]=x,t[45]=g,t[46]=L,t[47]=A,t[48]=$):$=t[48];let U;t[49]!==_||t[50]!==o||t[51]!==i?(U=o?s.jsx(es,{providerKey:i,provider:o,open:_,onOpenChange:b}):null,t[49]=_,t[50]=o,t[51]=i,t[52]=U):U=t[52];let H;t[53]!==r?(H=r("settings.providerKeyRow.deleteApiKey"),t[53]=r,t[54]=H):H=t[54];let q;t[55]!==H?(q=s.jsx(Le,{children:H}),t[55]=H,t[56]=q):q=t[56];let V;t[57]!==i.label?(V=s.jsxs(Qe,{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 I;t[59]!==q||t[60]!==V?(I=s.jsxs(Ge,{children:[q,V]}),t[59]=q,t[60]=V,t[61]=I):I=t[61];let T;t[62]!==r?(T=r("settings.providerKeyRow.cancel"),t[62]=r,t[63]=T):T=t[63];let O;t[64]!==T?(O=s.jsx(Ye,{children:T}),t[64]=T,t[65]=O):O=t[65];let M;t[66]!==C?(M=()=>C(),t[66]=C,t[67]=M):M=t[67];let D;t[68]!==r?(D=r("settings.providerKeyRow.delete"),t[68]=r,t[69]=D):D=t[69];let Y;t[70]!==M||t[71]!==D?(Y=s.jsx(We,{onClick:M,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),t[70]=M,t[71]=D,t[72]=Y):Y=t[72];let W;t[73]!==O||t[74]!==Y?(W=s.jsxs(Je,{children:[O,Y]}),t[73]=O,t[74]=Y,t[75]=W):W=t[75];let B;t[76]!==I||t[77]!==W?(B=s.jsxs(Xe,{children:[I,W]}),t[76]=I,t[77]=W,t[78]=B):B=t[78];let Q;t[79]!==l||t[80]!==B?(Q=s.jsx(Ze,{open:l,onOpenChange:u,children:B}),t[79]=l,t[80]=B,t[81]=Q):Q=t[81];let ie;return t[82]!==$||t[83]!==U||t[84]!==Q?(ie=s.jsxs(s.Fragment,{children:[$,U,Q]}),t[82]=$,t[83]=U,t[84]=Q,t[85]=ie):ie=t[85],ie}function ss(e){const t=e.filter(i=>dt(i.providerId));return{hasInventory:e.length>0,hasHostedProvider:t.length>0,hasDeco:t.some(i=>i.providerId==="deco")}}function is(e,t){return e.filter(i=>i.providerId!=="deco").map(i=>({key:i,provider:t.find(o=>o.id===i.providerId)??null}))}function Oe(e){const t=J.c(13),{onConnectClick:i}=e,o=se(),n=Ae(),c=ze();let a;if(t[0]!==c?.providers||t[1]!==n||t[2]!==i||t[3]!==o){const l=c?.providers??[],u=is(n,l);let _;t[5]!==o?(_=o("settings.connectedProvidersSection.sectionTitle"),t[5]=o,t[6]=_):_=t[6];let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(yt,{size:14}),t[7]=b):b=t[7];let r;t[8]!==o?(r=o("settings.connectedProvidersSection.connectButton"),t[8]=o,t[9]=r):r=t[9];let p;t[10]!==i||t[11]!==r?(p=s.jsxs(ee,{size:"sm",onClick:i,children:[b,r]}),t[10]=i,t[11]=r,t[12]=p):p=t[12],a=s.jsx(we,{title:_,headerClassName:"px-0",actions:p,children:u.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:o("settings.connectedProvidersSection.emptyState")}):s.jsx(De,{children:u.map(ls)})}),t[0]=c?.providers,t[1]=n,t[2]=i,t[3]=o,t[4]=a}else a=t[4];return a}function ls(e){const{key:t,provider:i}=e;return s.jsx(ts,{providerKey:t,provider:i},t.id)}function rs(){const e=J.c(55),t=se(),{org:i}=be(),o=re(),n=je(),[c,a]=G.useState("");let l;e[0]!==i.id?(l=te.claudeSubscription(i.id),e[0]=i.id,e[1]=l):l=e[1];let u;e[2]!==o?(u=()=>o.call("CLAUDE_SUBSCRIPTION_STATUS",{}),e[2]=o,e[3]=u):u=e[3];let _;e[4]!==l||e[5]!==u?(_={queryKey:l,queryFn:u},e[4]=l,e[5]=u,e[6]=_):_=e[6];const b=ke(_);let r;e[7]!==i.id||e[8]!==n?(r=()=>n.invalidateQueries({queryKey:te.claudeSubscription(i.id)}),e[7]=i.id,e[8]=n,e[9]=r):r=e[9];const p=r;let m;e[10]!==o||e[11]!==c?(m=()=>o.call("CLAUDE_SUBSCRIPTION_CONNECT",{token:c}),e[10]=o,e[11]=c,e[12]=m):m=e[12];let f;e[13]!==p||e[14]!==t?(f=async()=>{a(""),await p(),X.success(t("settings.claudeSubscription.connected"))},e[13]=p,e[14]=t,e[15]=f):f=e[15];let P;e[16]!==m||e[17]!==f?(P={mutationFn:m,onSuccess:f,onError:ns},e[16]=m,e[17]=f,e[18]=P):P=e[18];const h=le(P);let v;e[19]!==o?(v=()=>o.call("CLAUDE_SUBSCRIPTION_DISCONNECT",{}),e[19]=o,e[20]=v):v=e[20];let g;e[21]!==p||e[22]!==t?(g=async()=>{await p(),X.success(t("settings.claudeSubscription.disconnected"))},e[21]=p,e[22]=t,e[23]=g):g=e[23];let N;e[24]!==v||e[25]!==g?(N={mutationFn:v,onSuccess:g,onError:os},e[24]=v,e[25]=g,e[26]=N):N=e[26];const k=le(N),x=b.data?.connected===!0,j=!x&&!!b.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 y;e[31]!==x||e[32]!==j||e[33]!==t?(y=t(x?"settings.claudeSubscription.active":j?"settings.claudeSubscription.expired":"settings.claudeSubscription.description"),e[31]=x,e[32]=j,e[33]=t,e[34]=y):y=e[34];let C;e[35]!==y?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[35]=y,e[36]=C):C=e[36];let K;e[37]!==d||e[38]!==C?(K=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,C]}),e[37]=d,e[38]=C,e[39]=K):K=e[39];let A;e[40]!==x||e[41]!==k||e[42]!==t?(A=x?s.jsx(ee,{variant:"outline",disabled:k.isPending,onClick:()=>k.mutate(),children:t("settings.claudeSubscription.disconnect")}):null,e[40]=x,e[41]=k,e[42]=t,e[43]=A):A=e[43];let w;e[44]!==K||e[45]!==A?(w=s.jsxs("div",{className:"flex items-center gap-4",children:[K,A]}),e[44]=K,e[45]=A,e[46]=w):w=e[46];let E;e[47]!==h||e[48]!==x||e[49]!==t||e[50]!==c?(E=x?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(ye,{type:"password",value:c,onChange:F=>a(F.target.value),placeholder:t("settings.claudeSubscription.tokenPlaceholder")}),s.jsx(ee,{disabled:c.trim().length===0||h.isPending,onClick:()=>h.mutate(),children:t("settings.claudeSubscription.connect")})]})]}),e[47]=h,e[48]=x,e[49]=t,e[50]=c,e[51]=E):E=e[51];let R;return e[52]!==w||e[53]!==E?(R=s.jsxs("div",{className:"rounded-xl border border-border px-6 py-5 flex flex-col gap-4",children:[w,E]}),e[52]=w,e[53]=E,e[54]=R):R=e[54],R}function os(e){return X.error(e.message)}function ns(e){return X.error(e.message)}function as(e){const t=J.c(3),{error:i}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(lt,{size:16}),t[0]=o):o=t[0];let n;return t[1]!==i.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=n):n=t[2],n}function cs(){const e=J.c(27),t=Ae();let i;e[0]!==t?(i=ss(t),e[0]=t,e[1]=i):i=e[1];const{hasInventory:o,hasHostedProvider:n,hasDeco:c}=i,[a,l]=G.useState(!1),[u,_]=G.useState(null),b=ze();let r;e[2]!==b?.providers?(r=b?.providers??[],e[2]=b?.providers,e[3]=r):r=e[3];const p=r;if(!n){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=()=>l(!0),e[4]=N):N=e[4];let k;e[5]!==p?(k=s.jsx(xt,{providers:p,onSelect:_,onShowAll:N}),e[5]=p,e[6]=k):k=e[6];const x=u!==null||a;let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=K=>{K||(_(null),l(!1))},e[7]=j):j=e[7];const S=u??void 0;let d;e[8]!==x||e[9]!==S?(d=s.jsx(Me,{open:x,onOpenChange:j,initialProvider:S}),e[8]=x,e[9]=S,e[10]=d):d=e[10];let y;e[11]!==o?(y=o?s.jsx(Oe,{onConnectClick:()=>l(!0)}):null,e[11]=o,e[12]=y):y=e[12];let C;return e[13]!==k||e[14]!==d||e[15]!==y?(C=s.jsxs(s.Fragment,{children:[k,d,y]}),e[13]=k,e[14]=d,e[15]=y,e[16]=C):C=e[16],C}let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(G.Suspense,{fallback:s.jsx(Ke,{className:"h-16 w-full"}),children:s.jsx(Ht,{})}),e[17]=m):m=e[17];let f;e[18]!==c?(f=c?s.jsx(Qt,{}):s.jsx(Wt,{}),e[18]=c,e[19]=f):f=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(rs,{}),e[20]=P):P=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Oe,{onConnectClick:()=>l(!0)}),e[21]=h):h=e[21];let v;e[22]!==a?(v=s.jsx(Me,{open:a,onOpenChange:l}),e[22]=a,e[23]=v):v=e[23];let g;return e[24]!==f||e[25]!==v?(g=s.jsxs(s.Fragment,{children:[m,f,P,h,v]}),e[24]=f,e[25]=v,e[26]=g):g=e[26],g}function ds(){const e=J.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ot,{group:"billing"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ie,{children:s.jsx(Ie.Content,{children:s.jsx(Ie.Body,{children:s.jsxs(rt,{children:[t,s.jsx(it,{fallback:ms,children:s.jsx(G.Suspense,{fallback:s.jsx(Ke,{className:"h-64 w-full"}),children:s.jsx(cs,{})})})]})})})}),e[1]=i):i=e[1],i}function ms(e){const{error:t}=e;return s.jsx(as,{error:t??new Error("Failed to load AI providers")})}function Ci(){const e=J.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Rt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(ds,{})}),e[0]=t):t=e[0],t}export{Ci as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,m as o,j as c,aR as d}from"./index-
|
|
1
|
+
import{c as n,m as o,j as c,aR as d}from"./index-QSWmOkVC.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,aK as m,cY as A,dZ as O,H as M,aM as I,cV as z,d_ as D,cX as F,d4 as L,aI as G,d6 as H,cZ as V,c as n,m as p,aQ as v}from"./index-
|
|
1
|
+
import{r as i,j as r,cU as w,cW as T,aK as m,cY as A,dZ as O,H as M,aM as I,cV as z,d_ as D,cX as F,d4 as L,aI as G,d6 as H,cZ as V,c as n,m as p,aQ as v}from"./index-QSWmOkVC.js";var x="AlertDialog",[W]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t,modal:!0})};N.displayName=x;var 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 Z="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=Z;var q="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(V,{...o,...a,ref:e})});_.displayName=q;var f="AlertDialogContent",[B,K]=W(f),Q=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:h,docsSlug:"alert-dialog",children:r.jsx(B,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{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 U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as t,E as ie,r as F,b as B,B as N,t as R}from"./index-BphIXXOp.js";import{i as le}from"./AlertCircle-CeleFBrs.js";import{a as ne}from"./Copy01-DIJvVGQk.js";import{i as M}from"./Key01-CRQOB5O_.js";import{s as Q}from"./Plus-CgXuzVCT.js";import{s as re}from"./Trash01-COMthlp3.js";import{A as ae,a as oe,b as ce,c as me,d as de,e as fe,f as pe,g as ue}from"./alert-dialog-Cqq7FgQj.js";import{b as U,h as V,a as W,c as X,d as Y,e as Z}from"./dialog-C2XtKj4W.js";import{I as ee}from"./input-9TNY2G6W.js";import{L as xe}from"./label-DhJo3WjY.js";import{S as ge}from"./skeleton-C_J-aMdg.js";import{P as q}from"./index-BKOwC_zz.js";import{c as ye}from"./settings-section-BN0IrtYX.js";import{a as he,b as je,u as be}from"./use-api-keys-BELfjQ6X.js";import{S as Ke}from"./settings-subnav-DlbWpD1A.js";import{R as Ce}from"./require-capability-ChdE_Nc5.js";import"./X-Bfx6rO6W.js";import"./sidebar-Dckv7Gxe.js";import"./LayoutLeft-DZwVeKk1.js";import"./use-mobile-C0XoguQx.js";import"./tooltip-BfkRKScU.js";import"./card-CooN3E-v.js";import"./ArrowUpRight-C0hTvHTE.js";import"./use-mcp-client-DKcZ7v-W.js";import"./auth-tEJ4bybR.js";import"./useRouterState-BHrQRzTY.js";import"./use-settings-tabs-BO1uyGPC.js";import"./use-capability-mz-0XBoJ.js";import"./studio-tools-BoD8kcA1.js";import"./access-gate-C8o_OE1N.js";import"./capability-load-error-CPQoG_lp.js";function De(c){const e=S.c(6),{error:o}=c,a=B();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]!==o.message||e[2]!==a?(s=a("settings.apiKeys.failedToLoadError",{error:o.message}),e[1]=o.message,e[2]=a,e[3]=s):s=e[3];let l;return e[4]!==s?(l=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]=l):l=e[5],l}function Ae(c){const e=S.c(20),{apiKey:o,onDelete:a}=c,i=B();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 l;e[1]!==o.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:o.name}),e[1]=o.name,e[2]=l):l=e[2];let m;e[3]!==o.createdAt||e[4]!==i?(m=i("settings.apiKeys.createdAt",{date:new Date(o.createdAt).toLocaleDateString()}),e[3]=o.createdAt,e[4]=i,e[5]=m):m=e[5];let n;e[6]!==m?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:m}),e[6]=m,e[7]=n):n=e[7];let d;e[8]!==l||e[9]!==n?(d=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=d):d=e[10];let r;e[11]!==i?(r=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=r):r=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]!==a||e[15]!==r?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:a,"aria-label":r,children:f}),e[14]=a,e[15]=r,e[16]=u):u=e[16];let p;return e[17]!==d||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:[d,u]}),e[17]=d,e[18]=u,e[19]=p):p=e[19],p}function Ne(c){const e=S.c(21),{onCreate:o}=c,a=B();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]!==a?(s=a("settings.apiKeys.emptyTitle"),e[1]=a,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let m;e[5]!==a?(m=a("settings.apiKeys.emptyDescription"),e[5]=a,e[6]=m):m=e[6];let n;e[7]!==m?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:m}),e[7]=m,e[8]=n):n=e[8];let d;e[9]!==l||e[10]!==n?(d=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=d):d=e[11];let r;e[12]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Q,{size:14}),e[12]=r):r=e[12];let f;e[13]!==a?(f=a("settings.apiKeys.newKey"),e[13]=a,e[14]=f):f=e[14];let u;e[15]!==o||e[16]!==f?(u=t.jsxs(N,{onClick:o,size:"sm",className:"mt-2",children:[r,f]}),e[15]=o,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==d||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,d,u]}),e[18]=d,e[19]=u,e[20]=p):p=e[20],p}function G(c){const e=S.c(40),{createdKey:o,onClose:a}=c,i=B(),s=o!==null;let l;e[0]!==a?(l=A=>!A&&a(),e[0]=a,e[1]=l):l=e[1];let m;e[2]!==i?(m=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=m):m=e[3];let n;e[4]!==m?(n=t.jsx(U,{children:m}),e[4]=m,e[5]=n):n=e[5];let d;e[6]!==i?(d=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=d):d=e[7];let r;e[8]!==d?(r=t.jsx(V,{children:d}),e[8]=d,e[9]=r):r=e[9];let f;e[10]!==n||e[11]!==r?(f=t.jsxs(W,{children:[n,r]}),e[10]=n,e[11]=r,e[12]=f):f=e[12];const u=o?.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]!==o||e[16]!==i?(x=()=>{o&&(navigator.clipboard?.writeText(o.key),R.success(i("settings.apiKeys.copied")))},e[15]=o,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 K;e[20]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(ne,{size:14}),e[20]=K):K=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:K}),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 b;e[29]!==a||e[30]!==j?(b=t.jsx(X,{children:t.jsx(N,{onClick:a,children:j})}),e[29]=a,e[30]=j,e[31]=b):b=e[31];let C;e[32]!==h||e[33]!==b||e[34]!==f?(C=t.jsxs(Y,{className:"sm:max-w-lg",children:[f,h,b]}),e[32]=h,e[33]=b,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Z,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function J(c){const e=S.c(64),{open:o,onOpenChange:a,onCreated:i}=c,s=B(),[l,m]=F.useState(""),n=be();let d;e[0]!==a?(d=function(){m(""),a(!1)},e[0]=a,e[1]=d):d=e[1];const r=d;let f;e[2]!==n||e[3]!==r||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(se){if(se.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});r(),i(I)}catch(I){const H=I;R.error(H instanceof Error?H.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=r,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==r||e[9]!==a?(p=$=>{$?a($):r()},e[8]=r,e[9]=a,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 K;e[15]!==s?(K=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=K):K=e[16];let y;e[17]!==K?(y=t.jsx(V,{children:K}),e[17]=K,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 b;e[24]!==j?(b=t.jsx(xe,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=b):b=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>m($.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]!==l||e[30]!==D?(A=t.jsx(ee,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let v;e[32]!==b||e[33]!==A?(v=t.jsxs("div",{className:"space-y-1.5",children:[b,A]}),e[32]=b,e[33]=A,e[34]=v):v=e[34];const te=n.isPending;let k;e[35]!==s?(k=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=k):k=e[36];let _;e[37]!==n.isPending||e[38]!==r||e[39]!==k?(_=t.jsx(N,{type:"button",variant:"outline",onClick:r,disabled:te,children:k}),e[37]=n.isPending,e[38]=r,e[39]=k,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let E;e[50]!==_||e[51]!==z?(E=t.jsxs(X,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=E):E=e[52];let T;e[53]!==u||e[54]!==v||e[55]!==E?(T=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[v,E]}),e[53]=u,e[54]=v,e[55]=E,e[56]=T):T=e[56];let O;e[57]!==T||e[58]!==h?(O=t.jsxs(Y,{className:"sm:max-w-lg",children:[h,T]}),e[57]=T,e[58]=h,e[59]=O):O=e[59];let L;return e[60]!==o||e[61]!==O||e[62]!==p?(L=t.jsx(Z,{open:o,onOpenChange:p,children:O}),e[60]=o,e[61]=O,e[62]=p,e[63]=L):L=e[63],L}function Se(){const c=B(),{data:e=[]}=he(),o=je(),[a,i]=F.useState(!1),[s,l]=F.useState(null),[m,n]=F.useState(null);async function d(){if(m)try{await o.mutateAsync(m.id),R.success(c("settings.apiKeys.keyDeleted",{name:m.name}))}catch(r){R.error(r instanceof Error?r.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(Ne,{onCreate:()=>i(!0)}),t.jsx(J,{open:a,onOpenChange:i,onCreated:l}),t.jsx(G,{createdKey:s,onClose:()=>l(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:c(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}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(r=>t.jsx(Ae,{apiKey:r,onDelete:()=>n(r)},r.id))})}),t.jsx(J,{open:a,onOpenChange:i,onCreated:l}),t.jsx(G,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:m!==null,onOpenChange:r=>{r||n(null)},children:t.jsxs(oe,{children:[t.jsxs(ce,{children:[t.jsx(me,{children:c("settings.apiKeys.deleteTitle",{name:m?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(fe,{children:[t.jsx(pe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(ue,{onClick:d,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function ve(){const c=S.c(2);let e;c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{group:"connect"}),c[0]=e):e=c[0];let o;return c[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(q,{children:t.jsx(q.Content,{children:t.jsx(q.Body,{children:t.jsxs(ye,{children:[e,t.jsx(ie,{fallback:ke,children:t.jsx(F.Suspense,{fallback:t.jsx(ge,{className:"h-32 w-full"}),children:t.jsx(Se,{})})})]})})})}),c[1]=o):o=c[1],o}function ke(c){const{error:e}=c;return t.jsx(De,{error:e??new Error("Failed to load API keys")})}function rt(){const c=S.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ce,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(ve,{})}),c[0]=e):e=c[0],e}export{rt as default};
|
|
1
|
+
import{c as S,j as t,E as ie,r as F,b as B,B as N,t as R}from"./index-QSWmOkVC.js";import{i as le}from"./AlertCircle-BSGNUx7V.js";import{a as ne}from"./Copy01-C3CSvCmh.js";import{i as M}from"./Key01-C-HagbU9.js";import{s as Q}from"./Plus-9luEKPZw.js";import{s as re}from"./Trash01-Dx-L9twD.js";import{A as ae,a as oe,b as ce,c as me,d as de,e as fe,f as pe,g as ue}from"./alert-dialog-CMLgUtLr.js";import{b as U,h as V,a as W,c as X,d as Y,e as Z}from"./dialog-0fNUeR9R.js";import{I as ee}from"./input-CjD4VhOq.js";import{L as xe}from"./label-BM_KNax6.js";import{S as ge}from"./skeleton-B9r2TOyq.js";import{P as q}from"./index-CElD4z4O.js";import{c as ye}from"./settings-section-KNTU5IvO.js";import{a as he,b as je,u as be}from"./use-api-keys-D8jDupAP.js";import{S as Ke}from"./settings-subnav-Cd0l_6Ey.js";import{R as Ce}from"./require-capability-BujVC6Iv.js";import"./X-CSYXCnV9.js";import"./sidebar-B9FCz4Mq.js";import"./LayoutLeft-DTt2h_gY.js";import"./use-mobile-D3ZpQ04i.js";import"./tooltip-C8WdZoAs.js";import"./card-FCEwqon6.js";import"./ArrowUpRight-BG4SvGJv.js";import"./use-mcp-client-BsAnTcHa.js";import"./auth-C0RxM0MV.js";import"./useRouterState-CFKKaLoi.js";import"./use-settings-tabs-B_hY1mlT.js";import"./use-capability-B23RInvZ.js";import"./studio-tools-D6IcfTHF.js";import"./access-gate-rP_MjwR7.js";import"./capability-load-error-CRpB249h.js";function De(c){const e=S.c(6),{error:o}=c,a=B();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]!==o.message||e[2]!==a?(s=a("settings.apiKeys.failedToLoadError",{error:o.message}),e[1]=o.message,e[2]=a,e[3]=s):s=e[3];let l;return e[4]!==s?(l=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]=l):l=e[5],l}function Ae(c){const e=S.c(20),{apiKey:o,onDelete:a}=c,i=B();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 l;e[1]!==o.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:o.name}),e[1]=o.name,e[2]=l):l=e[2];let m;e[3]!==o.createdAt||e[4]!==i?(m=i("settings.apiKeys.createdAt",{date:new Date(o.createdAt).toLocaleDateString()}),e[3]=o.createdAt,e[4]=i,e[5]=m):m=e[5];let n;e[6]!==m?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:m}),e[6]=m,e[7]=n):n=e[7];let d;e[8]!==l||e[9]!==n?(d=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=d):d=e[10];let r;e[11]!==i?(r=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=r):r=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]!==a||e[15]!==r?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:a,"aria-label":r,children:f}),e[14]=a,e[15]=r,e[16]=u):u=e[16];let p;return e[17]!==d||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:[d,u]}),e[17]=d,e[18]=u,e[19]=p):p=e[19],p}function Ne(c){const e=S.c(21),{onCreate:o}=c,a=B();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]!==a?(s=a("settings.apiKeys.emptyTitle"),e[1]=a,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let m;e[5]!==a?(m=a("settings.apiKeys.emptyDescription"),e[5]=a,e[6]=m):m=e[6];let n;e[7]!==m?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:m}),e[7]=m,e[8]=n):n=e[8];let d;e[9]!==l||e[10]!==n?(d=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=d):d=e[11];let r;e[12]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Q,{size:14}),e[12]=r):r=e[12];let f;e[13]!==a?(f=a("settings.apiKeys.newKey"),e[13]=a,e[14]=f):f=e[14];let u;e[15]!==o||e[16]!==f?(u=t.jsxs(N,{onClick:o,size:"sm",className:"mt-2",children:[r,f]}),e[15]=o,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==d||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,d,u]}),e[18]=d,e[19]=u,e[20]=p):p=e[20],p}function G(c){const e=S.c(40),{createdKey:o,onClose:a}=c,i=B(),s=o!==null;let l;e[0]!==a?(l=A=>!A&&a(),e[0]=a,e[1]=l):l=e[1];let m;e[2]!==i?(m=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=m):m=e[3];let n;e[4]!==m?(n=t.jsx(U,{children:m}),e[4]=m,e[5]=n):n=e[5];let d;e[6]!==i?(d=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=d):d=e[7];let r;e[8]!==d?(r=t.jsx(V,{children:d}),e[8]=d,e[9]=r):r=e[9];let f;e[10]!==n||e[11]!==r?(f=t.jsxs(W,{children:[n,r]}),e[10]=n,e[11]=r,e[12]=f):f=e[12];const u=o?.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]!==o||e[16]!==i?(x=()=>{o&&(navigator.clipboard?.writeText(o.key),R.success(i("settings.apiKeys.copied")))},e[15]=o,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 K;e[20]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(ne,{size:14}),e[20]=K):K=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:K}),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 b;e[29]!==a||e[30]!==j?(b=t.jsx(X,{children:t.jsx(N,{onClick:a,children:j})}),e[29]=a,e[30]=j,e[31]=b):b=e[31];let C;e[32]!==h||e[33]!==b||e[34]!==f?(C=t.jsxs(Y,{className:"sm:max-w-lg",children:[f,h,b]}),e[32]=h,e[33]=b,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Z,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function J(c){const e=S.c(64),{open:o,onOpenChange:a,onCreated:i}=c,s=B(),[l,m]=F.useState(""),n=be();let d;e[0]!==a?(d=function(){m(""),a(!1)},e[0]=a,e[1]=d):d=e[1];const r=d;let f;e[2]!==n||e[3]!==r||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(se){if(se.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});r(),i(I)}catch(I){const H=I;R.error(H instanceof Error?H.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=r,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==r||e[9]!==a?(p=$=>{$?a($):r()},e[8]=r,e[9]=a,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 K;e[15]!==s?(K=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=K):K=e[16];let y;e[17]!==K?(y=t.jsx(V,{children:K}),e[17]=K,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 b;e[24]!==j?(b=t.jsx(xe,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=b):b=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>m($.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]!==l||e[30]!==D?(A=t.jsx(ee,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let v;e[32]!==b||e[33]!==A?(v=t.jsxs("div",{className:"space-y-1.5",children:[b,A]}),e[32]=b,e[33]=A,e[34]=v):v=e[34];const te=n.isPending;let k;e[35]!==s?(k=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=k):k=e[36];let _;e[37]!==n.isPending||e[38]!==r||e[39]!==k?(_=t.jsx(N,{type:"button",variant:"outline",onClick:r,disabled:te,children:k}),e[37]=n.isPending,e[38]=r,e[39]=k,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let E;e[50]!==_||e[51]!==z?(E=t.jsxs(X,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=E):E=e[52];let T;e[53]!==u||e[54]!==v||e[55]!==E?(T=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[v,E]}),e[53]=u,e[54]=v,e[55]=E,e[56]=T):T=e[56];let O;e[57]!==T||e[58]!==h?(O=t.jsxs(Y,{className:"sm:max-w-lg",children:[h,T]}),e[57]=T,e[58]=h,e[59]=O):O=e[59];let L;return e[60]!==o||e[61]!==O||e[62]!==p?(L=t.jsx(Z,{open:o,onOpenChange:p,children:O}),e[60]=o,e[61]=O,e[62]=p,e[63]=L):L=e[63],L}function Se(){const c=B(),{data:e=[]}=he(),o=je(),[a,i]=F.useState(!1),[s,l]=F.useState(null),[m,n]=F.useState(null);async function d(){if(m)try{await o.mutateAsync(m.id),R.success(c("settings.apiKeys.keyDeleted",{name:m.name}))}catch(r){R.error(r instanceof Error?r.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(Ne,{onCreate:()=>i(!0)}),t.jsx(J,{open:a,onOpenChange:i,onCreated:l}),t.jsx(G,{createdKey:s,onClose:()=>l(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:c(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}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(r=>t.jsx(Ae,{apiKey:r,onDelete:()=>n(r)},r.id))})}),t.jsx(J,{open:a,onOpenChange:i,onCreated:l}),t.jsx(G,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:m!==null,onOpenChange:r=>{r||n(null)},children:t.jsxs(oe,{children:[t.jsxs(ce,{children:[t.jsx(me,{children:c("settings.apiKeys.deleteTitle",{name:m?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(fe,{children:[t.jsx(pe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(ue,{onClick:d,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function ve(){const c=S.c(2);let e;c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{group:"connect"}),c[0]=e):e=c[0];let o;return c[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(q,{children:t.jsx(q.Content,{children:t.jsx(q.Body,{children:t.jsxs(ye,{children:[e,t.jsx(ie,{fallback:ke,children:t.jsx(F.Suspense,{fallback:t.jsx(ge,{className:"h-32 w-full"}),children:t.jsx(Se,{})})})]})})})}),c[1]=o):o=c[1],o}function ke(c){const{error:e}=c;return t.jsx(De,{error:e??new Error("Failed to load API keys")})}function rt(){const c=S.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ce,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(ve,{})}),c[0]=e):e=c[0],e}export{rt as default};
|
|
@@ -0,0 +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-QSWmOkVC.js";import{i as wt}from"./ChevronRight-jZWdrf9f.js";import{B as At}from"./automation-runs-7BxhYAN0.js";import{u as Et,A as Nt}from"./use-section-preview-base-B46aIuGF.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-CnpdnndP.js";import"./select-BY-TTUaX.js";import"./tooltip-C8WdZoAs.js";import"./Check-DhNjrmaj.js";import"./ChevronDown-CaUFgq06.js";import"./ChevronUp-BRjHRWFg.js";import"./agent-icon-eH38g2HT.js";import"./AlertCircle-BSGNUx7V.js";import"./Tool01-B3cfX7QW.js";import"./ArrowUp-ntTpD-To.js";import"./ArrowLeft-DHRINKlz.js";import"./Tool02-Dz1T3Rmg.js";import"./XCircle-Cu0-8nUy.js";import"./ArrowUpRight-BG4SvGJv.js";import"./TrendUp01-jt7vyfmI.js";import"./ZapSquare-DsGT7WIC.js";import"./Users03-D4EG206O.js";import"./CheckCircle-B_sdSbJU.js";import"./DotsVertical-Dp5Cm_iP.js";import"./Stars02-B6JXDKru.js";import"./Copy01-C3CSvCmh.js";import"./CreditCard01-5rNLMrBA.js";import"./Download01-DIiuseU_.js";import"./Settings02-DWTUyGYI.js";import"./Eye-CVDf_kH4.js";import"./FilterLines-DV7AkyjC.js";import"./Share07-BBwkuMmH.js";import"./Globe01-Bak8Df7R.js";import"./Globe04-21nMtmZT.js";import"./SwitchHorizontal01-CdQluNjW.js";import"./HardDrive-yKF5zKg2.js";import"./Key01-C-HagbU9.js";import"./LayoutLeft-DTt2h_gY.js";import"./LinkExternal01-BAXCjJ3W.js";import"./LockUnlocked01-CTGb9BVB.js";import"./LogOut01-CI181NEF.js";import"./Monitor01-Be5N7TRy.js";import"./Sun-BJxBIAjy.js";import"./Palette-BNNCPeK0.js";import"./Play-BsRzOgzp.js";import"./Plus-9luEKPZw.js";import"./SearchLg-F6MPrrZo.js";import"./SearchMd-7UCVFr92.js";import"./Shield01-DwaMx4Kj.js";import"./Stars01-gwxykcEQ.js";import"./Trash01-Dx-L9twD.js";import"./Upload01-BxhthB2p.js";import"./User01-CFSl83nB.js";import"./Users01-BijcXXI3.js";import"./XClose-DSHM2tuZ.js";import"./X-CSYXCnV9.js";import"./Zap-BJ7aktKA.js";import"./useInfiniteQuery-3soE5ZtR.js";import"./use-infinite-scroll-CWnPk8zt.js";import"./use-connection-Dg56f5Vt.js";import"./use-mcp-client-BsAnTcHa.js";import"./auth-C0RxM0MV.js";import"./use-virtual-mcp-CJYABS2i.js";import"./card-FCEwqon6.js";import"./sidebar-B9FCz4Mq.js";import"./use-mobile-D3ZpQ04i.js";import"./table-DjnLlp3Y.js";import"./empty-state-LcWMvkBG.js";import"./use-members-B9vphmDn.js";import"./use-org-auth-client-tPvCf1dF.js";import"./use-clock-tick-BDuDvLsc.js";import"./use-automations-B_w6lxQU.js";import"./studio-tools-D6IcfTHF.js";import"./useSuspenseInfiniteQuery-Cean782d.js";import"./avatar-CzJUVoDs.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DGVAP1M7.js";import"./dialog-0fNUeR9R.js";import"./tab-id-CPIceFUq.js";import"./hooks-Cj6NKwbB.js";import"./decopilot-sse-pool-BNW6JWpR.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./chat-context-Qk-9IhfU.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-hG0NJmyg.js";import"./use-decopilot-events-_lZ6Xk3T.js";import"./use-organization-settings-DbHsJaaW.js";import"./monaco-editor-BhG2pRsy.js";import"./spinner-DzAXz-ak.js";import"./types-CPa8SGGQ.js";import"./shell-layout-BJ43I-fM.js";import"./required-auth-layout-Bc5Jqmw0.js";import"./use-org-sso-DdtLWeHC.js";import"./integration-icon-CPM2Wy4S.js";import"./use-navigate-to-agent-BhiQJGHm.js";import"./reusable-new-chat-CouMjkYR.js";import"./chart-BVs8Wshz.js";import"./index-DporvBqC.js";import"./form-DGhZtrNx.js";import"./label-BM_KNax6.js";import"./input-CjD4VhOq.js";import"./file-type-icon-CTX2jq9G.js";import"./drawer-HRJ32EbE.js";import"./collection-search-DcQsyJxv.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-BVCZRpzY.js";import"./toggle-group-C2GRyClc.js";import"./use-commerce-diagnostic-C2s_wvEf.js";import"./popover-Cdk4wGDs.js";import"./self-tool-result-CQmRuOJJ.js";import"./alert-dialog-CMLgUtLr.js";import"./extract-connection-data-BYxfOuH_.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-qVTGK2NR.js";import"./authenticate-and-persist-oauth-iw6ouFr9.js";import"./mcp-oauth-CXtITOci.js";import"./track-DlQssvS7.js";import"./toolbar-CRquLcIr.js";import"./skeleton-B9r2TOyq.js";import"./github-repo-picker-DOf_JZk2.js";import"./use-mcp-tools-kK8zHPYS.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-BsbMWXtq.js";import"./use-registry-connections-CI0z613-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DUhzY-49.js";import"./connection-form-helpers-hjpjGHOP.js";import"./collection-tabs-TNXMy8gA.js";import"./badge-DbSQDjS0.js";import"./command-DWBbdLBX.js";import"./index-2ZeZ7XA1.js";import"./use-open-billing-url-FgqegUnw.js";import"./select-model-CKrLO7E8.js";import"./checkbox-Badqx0C2.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-KNTU5IvO.js";import"./cards-CIZK-4zJ.js";import"./dropdown-menu-Gs5UGB4h.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DnGWueq0.js";import"./use-capability-B23RInvZ.js";import"./use-file-configs-BZ18LlNu.js";import"./pt-BR-CLy76QW2.js";import"./switch-B8JKQssM.js";import"./use-debounced-autosave-CTkEMRHe.js";import"./index-CElD4z4O.js";import"./search-input-DPH-j2ty.js";import"./index-Bqi-j8tu.js";import"./use-secrets-dYdxMugZ.js";import"./AreaChart-qGMzdkmk.js";import"./use-tags-BIZOfShH.js";import"./get-initials-D-f_fDFw.js";import"./automation-list-row-Bkk5b-Xu.js";import"./use-org-repo-syncs-Dn3ug8I0.js";function It(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=Rt(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function zr(n){const t=Bt.c(78),{orgSlug:m,virtualMcpId:i,branch:s,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]!==s||t[10]!==m||t[11]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:J,isPending:Q}=Tt(K);let T;t[13]!==s||t[14]!==m||t[15]!==i?(T={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,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 mt=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 st=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]!==s||t[49]!==g||t[50]!==l||t[51]!==rt||t[52]!==tt||t[53]!==B||t[54]!==E||t[55]!==it||t[56]!==mt||t[57]!==G||t[58]!==a||t[59]!==m||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:mt,sandbox:{orgSlug:m,virtualMcpId:i,branch:s}},`${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]=s,t[49]=g,t[50]=l,t[51]=rt,t[52]=tt,t[53]=B,t[54]=E,t[55]=it,t[56]=mt,t[57]=G,t[58]=a,t[59]=m,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]!==st||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=>{st(e)}}),t[67]=et,t[68]=l,t[69]=st,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{zr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cA as v,cB as $,cC as W,cD as L,cE as H,cF as D,cG as V,cH as x,cI as q,cJ as j,cK as y,cL as N,cM as B,cN as F,cO as Z}from"./index-BphIXXOp.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Y(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Y(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{cA as v,cB as $,cC as W,cD as L,cE as H,cF as D,cG as V,cH as x,cI as q,cJ as j,cK as y,cL as N,cM as B,cN as F,cO as Z}from"./index-QSWmOkVC.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Y(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Y(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-
|
|
1
|
+
import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-QSWmOkVC.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,D as Fe,r as v,e as ce,p as Q,j as t,m as N,B as xe,o as Be,n as $e,K as me,c as fe,b as be,S as _e}from"./index-BphIXXOp.js";import{I as ee}from"./input-9TNY2G6W.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-Cbrhyipt.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:i,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,$=I?b.trim()&&L.trim()&&B.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ge(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await ze(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(i))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(_e,{})}function st({callbackURL:i,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(_e,{})}function lt(i){const e=fe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{lt as A,Ge as u};
|
|
1
|
+
import{a as V,D as Fe,r as v,e as ce,p as Q,j as t,m as N,B as xe,o as Be,n as $e,K as me,c as fe,b as be,S as _e}from"./index-QSWmOkVC.js";import{I as ee}from"./input-CjD4VhOq.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-DzAXz-ak.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:i,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,$=I?b.trim()&&L.trim()&&B.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ge(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await ze(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(i))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(_e,{})}function st({callbackURL:i,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(_e,{})}function lt(i){const e=fe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{lt as A,Ge as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,m as p,j as f}from"./index-
|
|
1
|
+
import{c as g,m as p,j as f}from"./index-QSWmOkVC.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-QSWmOkVC.js";import{i as u,a as p}from"./mcp-oauth-CXtITOci.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
|
package/dist/client/assets/{automation-list-row-BN46j3bE.js → automation-list-row-Bkk5b-Xu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-
|
|
1
|
+
import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-QSWmOkVC.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-CMLgUtLr.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-Gs5UGB4h.js";import{s as me}from"./Stars02-B6JXDKru.js";import{a as ue}from"./DotsVertical-Dp5Cm_iP.js";import{s as de}from"./Trash01-Dx-L9twD.js";import{i as fe}from"./Zap-BJ7aktKA.js";import{a as ge}from"./use-virtual-mcp-CJYABS2i.js";import{A as xe}from"./agent-icon-eH38g2HT.js";import{u as pe}from"./use-automations-B_w6lxQU.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(me,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(fe,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{ke as A};
|