decocms 4.210.2 → 4.211.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-B-VB_v8_.js → AlertCircle-TYVVkJeU.js} +1 -1
- package/dist/client/assets/{AreaChart-GISiEbjd.js → AreaChart-AqLvPM9g.js} +1 -1
- package/dist/client/assets/{ArrowLeft-KvTc6rGE.js → ArrowLeft-BbdA6t_3.js} +1 -1
- package/dist/client/assets/{ArrowUp-CM4hwO1x.js → ArrowUp-1naNHBRj.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CT3hd3Gz.js → ArrowUpRight-D4SZdU4m.js} +1 -1
- package/dist/client/assets/{Check-jVlurWFp.js → Check-BDzbzT06.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dag22p3m.js → CheckCircle-CC4Xh21R.js} +1 -1
- package/dist/client/assets/{ChevronDown-p_tbIzFd.js → ChevronDown-DpHXwB32.js} +1 -1
- package/dist/client/assets/{ChevronRight-CPHsfQo3.js → ChevronRight-BSjdSVNm.js} +1 -1
- package/dist/client/assets/{ChevronUp-vuWH7gGr.js → ChevronUp-ChdWc9lc.js} +1 -1
- package/dist/client/assets/{Copy01-C_8GUzyJ.js → Copy01-C0796Rq9.js} +1 -1
- package/dist/client/assets/{CpuChip01-4na0tDxe.js → CpuChip01-Bdbhw0P9.js} +1 -1
- package/dist/client/assets/{CreditCard01-DW_FdoX9.js → CreditCard01-Lv_9rwEK.js} +1 -1
- package/dist/client/assets/{DotsVertical-BGG3Ho_u.js → DotsVertical-DdiasF4L.js} +1 -1
- package/dist/client/assets/{Eye-Dn-joolw.js → Eye-BQf3dLN4.js} +1 -1
- package/dist/client/assets/{FilterLines-CYIS3PyF.js → FilterLines-BqTb37m2.js} +1 -1
- package/dist/client/assets/{Globe01-BMEBgVG2.js → Globe01-DK8Sgoou.js} +1 -1
- package/dist/client/assets/{Globe04-DufTt3Vi.js → Globe04-BQdFq6tK.js} +1 -1
- package/dist/client/assets/{HardDrive-H4sB7rht.js → HardDrive-CvH9aARD.js} +1 -1
- package/dist/client/assets/{Key01-CH_IVG_t.js → Key01-BWdrOc5q.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BLZ5NIVe.js → LayoutLeft-D9xQiMAK.js} +1 -1
- package/dist/client/assets/{LinkExternal01-SB0_tkSE.js → LinkExternal01-BmVaCxbN.js} +1 -1
- package/dist/client/assets/{LogOut01-BccMqXFZ.js → LogOut01-p090sMWF.js} +1 -1
- package/dist/client/assets/{Monitor01-DljnePZF.js → Monitor01-CLFxIYpP.js} +1 -1
- package/dist/client/assets/{Palette-BkqWyxiz.js → Palette-BCn2XIPU.js} +1 -1
- package/dist/client/assets/{Play-BO_bz8z5.js → Play-BQ-LkqC0.js} +1 -1
- package/dist/client/assets/{Plus-DChWoRcZ.js → Plus-7n57TljD.js} +1 -1
- package/dist/client/assets/{SearchLg-DIkeGuEU.js → SearchLg-Cx0osKta.js} +1 -1
- package/dist/client/assets/{SearchMd-CUHSKZ0C.js → SearchMd-DpIls16E.js} +1 -1
- package/dist/client/assets/{Settings02-DwsCOelc.js → Settings02-DNRmixh-.js} +1 -1
- package/dist/client/assets/{Share07-BKiSFd-U.js → Share07-BBENyvyC.js} +1 -1
- package/dist/client/assets/{Shield01-DZaZzDZT.js → Shield01-CLdpriOK.js} +1 -1
- package/dist/client/assets/{Star01-CHCsqoaq.js → Star01-DTAIuohm.js} +1 -1
- package/dist/client/assets/{Stars01-sT_rQek5.js → Stars01-CUCVbuJx.js} +1 -1
- package/dist/client/assets/{Stars02-9Za0OT3w.js → Stars02-CSDWekQs.js} +1 -1
- package/dist/client/assets/{Sun-ftMFixk5.js → Sun-dQOwAtEs.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Cebat5cd.js → SwitchHorizontal01-DLBKMScd.js} +1 -1
- package/dist/client/assets/{Tool01-DncLlBOd.js → Tool01-CTOSBnQx.js} +1 -1
- package/dist/client/assets/{Tool02-Dop27LUm.js → Tool02-Y7HqJxc6.js} +1 -1
- package/dist/client/assets/{Trash01-BjgXKgr6.js → Trash01-Cox6-EZ7.js} +1 -1
- package/dist/client/assets/{TrendUp01-DeH0rZDG.js → TrendUp01-D5eQgKus.js} +1 -1
- package/dist/client/assets/{Upload01-C9lBOcvL.js → Upload01-C7EZwIUG.js} +1 -1
- package/dist/client/assets/{User01-BJ2PmluK.js → User01-CV4pB4M5.js} +1 -1
- package/dist/client/assets/{Users01-CDyoTcZA.js → Users01-CIEwutni.js} +1 -1
- package/dist/client/assets/{Users03-DBRXdvYq.js → Users03-BjYPDVws.js} +1 -1
- package/dist/client/assets/{X-JiAwzhaQ.js → X-BcWTB26X.js} +1 -1
- package/dist/client/assets/{XCircle-BAmgho8b.js → XCircle-CXuc-Uxn.js} +1 -1
- package/dist/client/assets/{XClose-DgBj6S8z.js → XClose-BCPmotKV.js} +1 -1
- package/dist/client/assets/{Zap-ywE7kIil.js → Zap-BDg1HYtQ.js} +1 -1
- package/dist/client/assets/{ZapSquare-4QAPR3zA.js → ZapSquare-D4DjiT_W.js} +1 -1
- package/dist/client/assets/{access-gate-So3U0BEa.js → access-gate-DyocA4nP.js} +1 -1
- package/dist/client/assets/{agent-icon-BypwlSQB.js → agent-icon-BkJC4HZY.js} +1 -1
- package/dist/client/assets/{agents-list-C8CTZGET.js → agents-list-DsMfF9po.js} +1 -1
- package/dist/client/assets/{ai-providers-CZgWwdeh.js → ai-providers-DhUWGBnq.js} +1 -1
- package/dist/client/assets/{alert-DpBr9hws.js → alert-CejJSmSg.js} +1 -1
- package/dist/client/assets/{alert-dialog-CZcxNTn5.js → alert-dialog-V3SBzBF6.js} +2 -2
- package/dist/client/assets/{app-editor-ByEM6PQA.js → app-editor-Dz9ipuIR.js} +1 -1
- package/dist/client/assets/{auth-CgC0zRiu.js → auth-CITqEd5Y.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dz8vFuO9.js → auth-catchall-CdiNifz6.js} +1 -1
- package/dist/client/assets/{auth-entry-BllwLBnz.js → auth-entry-C3nGhKNy.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CKjZUbdm.js → auth-split-layout-DW93TS5_.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-zBYZihEH.js → authenticate-and-persist-oauth-CMEk6iib.js} +1 -1
- package/dist/client/assets/{automation-list-row-DtC9A60K.js → automation-list-row-Db-gegHI.js} +1 -1
- package/dist/client/assets/{automation-runs-BlKRnDL3.js → automation-runs-FKj_eO_X.js} +1 -1
- package/dist/client/assets/{automations-CojYI39x.js → automations-CXmIt2ng.js} +1 -1
- package/dist/client/assets/{avatar-BeSTVwN_.js → avatar-ZohFyJD1.js} +1 -1
- package/dist/client/assets/{badge-7TN3Wktg.js → badge-DqEA_1WO.js} +1 -1
- package/dist/client/assets/{billing-Bja42Pi1.js → billing-CnvJo8nq.js} +1 -1
- package/dist/client/assets/{block-document-BSnBImDv.js → block-document-CPon3YEP.js} +1 -1
- package/dist/client/assets/{brand-context-CaGiPaFo.js → brand-context-CH5ydrsO.js} +1 -1
- package/dist/client/assets/{buckets-BFrcNzoB.js → buckets-DBYfHnab.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DYieY-aA.js → bulk-category-panel-BHtcP6Av.js} +1 -1
- package/dist/client/assets/{capability-load-error-CKYF121O.js → capability-load-error-DDyZYkk6.js} +1 -1
- package/dist/client/assets/{card-DcOVhRdn.js → card-DwS9YBX_.js} +1 -1
- package/dist/client/assets/{cards-CGo6rBiP.js → cards-C7m4XNgd.js} +1 -1
- package/dist/client/assets/{category-editor-DOcP_AaV.js → category-editor-BsWB5pLu.js} +1 -1
- package/dist/client/assets/{chat-context-CHpxk4f9.js → chat-context-CG-xd16U.js} +1 -1
- package/dist/client/assets/{checkbox-tzeh-qrP.js → checkbox-B_GAdRqO.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DfRqWz-l.js → cli-auth-success-CrncupgE.js} +1 -1
- package/dist/client/assets/{collection-detail-D_2wxesW.js → collection-detail-bBcTt8pZ.js} +1 -1
- package/dist/client/assets/{collection-display-button-DgdY2-SO.js → collection-display-button-BoE4VEX3.js} +1 -1
- package/dist/client/assets/{collection-search-D9_uCTpl.js → collection-search-C7rh3ktP.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-yAMwsEKr.js → collection-table-wrapper-wUjq02Bx.js} +1 -1
- package/dist/client/assets/{collection-tabs-Cgws9vFl.js → collection-tabs-DPFnfk3X.js} +1 -1
- package/dist/client/assets/{command-vCdEhggD.js → command-Blo3i6hw.js} +1 -1
- package/dist/client/assets/commerce-onboarding-BSheeaBX.js +1 -0
- package/dist/client/assets/{connect-w7lllDYQ.js → connect-D6k6HF7B.js} +1 -1
- package/dist/client/assets/{connection-VFkeKEW_.js → connection-Dyei1SNq.js} +1 -1
- package/dist/client/assets/{connection-card-BXKTS1UY.js → connection-card-C8I5Q67K.js} +1 -1
- package/dist/client/assets/{connection-detail-Bq1COctm.js → connection-detail-BGPYuqW4.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-ClipGuvp.js → connection-form-helpers-CSXI4N5_.js} +1 -1
- package/dist/client/assets/{connections-VtLjYpst.js → connections-CCpCpGbi.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DxtdX756.js → decopilot-sse-pool-Cd_vwHza.js} +1 -1
- package/dist/client/assets/{dialog-BndOy54_.js → dialog-Bae-MxD_.js} +1 -1
- package/dist/client/assets/{domain-settings-D6c9-Vro.js → domain-settings-BHEf1RBC.js} +1 -1
- package/dist/client/assets/{drawer-CG0exhDi.js → drawer-DGMnIv29.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BlydGYwg.js → dropdown-menu-D7pVBiz9.js} +1 -1
- package/dist/client/assets/{empty-state-C-U6aO8t.js → empty-state-DSZDhzyD.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BTdYO2Ie.js → extract-connection-data-BzdJJn3l.js} +1 -1
- package/dist/client/assets/{file-explorer-ChVtqjrB.js → file-explorer-6N0fIoLP.js} +1 -1
- package/dist/client/assets/{file-type-icon-umbWZVCL.js → file-type-icon-D4StIude.js} +1 -1
- package/dist/client/assets/{form-B913lxdw.js → form-DUcjvD3B.js} +1 -1
- package/dist/client/assets/{general-qD94BshC.js → general-D1xDDLRg.js} +1 -1
- package/dist/client/assets/{github-repo-picker-IkpFrAa4.js → github-repo-picker-CHSJzmIC.js} +1 -1
- package/dist/client/assets/{hooks-DSQPS7ZB.js → hooks-Ca8QZPOn.js} +1 -1
- package/dist/client/assets/{index-phl_pIXQ.js → index-3YsVfLnT.js} +1 -1
- package/dist/client/assets/{index-D7ruAD9R.js → index-B9npqQk3.js} +6 -6
- package/dist/client/assets/{index-lvxbMBlt.js → index-BF1I_mPj.js} +5 -5
- package/dist/client/assets/{index-DXMTUPM-.css → index-BLA5BTNJ.css} +1 -1
- package/dist/client/assets/{index-CqMFU0yP.js → index-BLZuLLtX.js} +1 -1
- package/dist/client/assets/{index-BdXS1C_d.js → index-ChOzfVk5.js} +1 -1
- package/dist/client/assets/{index-BbcBLfTr.js → index-CtegNSps.js} +1 -1
- package/dist/client/assets/{index-fAEWeRk2.js → index-Dfl_R7ZT.js} +1 -1
- package/dist/client/assets/{index-D93sMh9L.js → index-DfykQcW9.js} +1 -1
- package/dist/client/assets/{index-nd630d8o.js → index-ZSJNXD5n.js} +1 -1
- package/dist/client/assets/{index-BVax3vfK.js → index-aMy7NxkO.js} +1 -1
- package/dist/client/assets/{index-redirect-PIoczkKB.js → index-redirect-CyXygCRy.js} +1 -1
- package/dist/client/assets/{input-BywtKe6R.js → input-BKxcTVd2.js} +1 -1
- package/dist/client/assets/{integration-icon-BDe33Str.js → integration-icon-D-gqZILO.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-Cd1X6Vsw.js → invite-member-dialog-DGMvAwXw.js} +1 -1
- package/dist/client/assets/{label-sPxTCHgi.js → label-Be1FgYVt.js} +1 -1
- package/dist/client/assets/{layout-DC7V__Wf.js → layout-B1Sp1EaS.js} +1 -1
- package/dist/client/assets/{login-4F7Q4eab.js → login-D5FLnC9v.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CNM-bHuQ.js → mcp-oauth-BhQlQCDi.js} +1 -1
- package/dist/client/assets/{members-DvnXbOrX.js → members-DEu44QBG.js} +1 -1
- package/dist/client/assets/{monaco-editor-5TGvXJMP.js → monaco-editor-Cs5d250N.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BvX0Iwku.js → monitoring-stats-row-Vk5s6ZIh.js} +1 -1
- package/dist/client/assets/{multi-select-CfxNtheE.js → multi-select-CZI8UNeu.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bkyx6a7J.js → oauth-callback-DB5pjIw2.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CaAAAR6l.js → oauth-callback-ai-provider-B8yoLX-E.js} +1 -1
- package/dist/client/assets/onboarding-B7wTezE7.js +1 -0
- package/dist/client/assets/{org-layout-BwK5e6T_.js → org-layout-Ct4hhHqf.js} +1 -1
- package/dist/client/assets/organization-choice-AmHs8fIs.js +1 -0
- package/dist/client/assets/{orgs-DFSwvs3E.js → orgs-Chb-Siqo.js} +1 -1
- package/dist/client/assets/{page-seo-form-CftmESyH.js → page-seo-form-vR1HIGDN.js} +1 -1
- package/dist/client/assets/{popover-DMey_8nq.js → popover-DqPd8WJS.js} +1 -1
- package/dist/client/assets/{post-editor-Duz7yAQd.js → post-editor-C7XaR5Fz.js} +1 -1
- package/dist/client/assets/{primitives-CYrbLQxI.js → primitives-DZqIioCE.js} +1 -1
- package/dist/client/assets/{profile-CP1J74Pn.js → profile-B8oLwcCf.js} +1 -1
- package/dist/client/assets/{project-app-view-hgruxcGv.js → project-app-view-DKrLSNrA.js} +1 -1
- package/dist/client/assets/record-editor-CTFYRbp9.js +1 -0
- package/dist/client/assets/redirect-editor-B2AQImGK.js +1 -0
- package/dist/client/assets/registry-Ccrbv5J2.js +2 -0
- package/dist/client/assets/{registry-layout-BXgtH3-2.js → registry-layout-CLHQOwZI.js} +1 -1
- package/dist/client/assets/{reports-j4qlGGA1.js → reports-BttQ3VXZ.js} +1 -1
- package/dist/client/assets/{require-capability-BTVUJu40.js → require-capability-wDDU8uIl.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D8pQ4hlg.js → required-auth-layout-D1zgX91n.js} +1 -1
- package/dist/client/assets/{reset-password-uH2eEwS5.js → reset-password-WSqrBKVp.js} +1 -1
- package/dist/client/assets/{roles-CZj8iSpk.js → roles-DZ7NNBzQ.js} +1 -1
- package/dist/client/assets/{search-input-B0dv5yOL.js → search-input-CGkNhXkv.js} +1 -1
- package/dist/client/assets/{secrets-Bkf1kD0z.js → secrets-C6Klozeg.js} +1 -1
- package/dist/client/assets/{sections-editor-BVnK7z0H.js → sections-editor-BivJl6N2.js} +1 -1
- package/dist/client/assets/{select-model-DvmZyKHW.js → select-model-CrMy6GlK.js} +1 -1
- package/dist/client/assets/{select-BpPnRSd-.js → select-xQgf68lb.js} +1 -1
- package/dist/client/assets/self-tool-result-BbEDg8mP.js +1 -0
- package/dist/client/assets/{seo-editor-D6Qp5PAw.js → seo-editor-CaqEbPF_.js} +1 -1
- package/dist/client/assets/{settings-layout-BSj52fb7.js → settings-layout-Ds3wnMOD.js} +1 -1
- package/dist/client/assets/{settings-section-CewjBJDd.js → settings-section-Qz93uThQ.js} +1 -1
- package/dist/client/assets/{shell-controls-UGsMszrT.js → shell-controls-DTivsFkI.js} +1 -1
- package/dist/client/assets/{shell-layout-U1XEcaQb.js → shell-layout-COqpNXs0.js} +1 -1
- package/dist/client/assets/{sidebar-XtHztjYp.js → sidebar-BuFyLs3D.js} +1 -1
- package/dist/client/assets/{skeleton-TYssXBL8.js → skeleton-BQFCVo8u.js} +1 -1
- package/dist/client/assets/{spinner-BDArA5p5.js → spinner-CpgB19wz.js} +1 -1
- package/dist/client/assets/{sso-CEwCgILO.js → sso-bLxHReVR.js} +1 -1
- package/dist/client/assets/{store-BAtC58cE.js → store-PqeC9hH6.js} +1 -1
- package/dist/client/assets/store-registry-n123Tw6S.js +2 -0
- package/dist/client/assets/{studio-tools-43YF_K-Q.js → studio-tools-CoB4u-70.js} +1 -1
- package/dist/client/assets/{switch-COa2pVfk.js → switch-JRcY3_n1.js} +1 -1
- package/dist/client/assets/{synced-repos-BQu96mXT.js → synced-repos-0Vi_LSno.js} +1 -1
- package/dist/client/assets/{tab-id-D2hxEf3P.js → tab-id-bg9ksjYj.js} +1 -1
- package/dist/client/assets/{table-DPk5SmMs.js → table-DDF0__cN.js} +1 -1
- package/dist/client/assets/{tabs-Y4Dxc2rR.js → tabs-DI3I6rGJ.js} +1 -1
- package/dist/client/assets/{textarea-BJCjQSy4.js → textarea-Cn0XTkv8.js} +1 -1
- package/dist/client/assets/{toggle-group-BaXRwZme.js → toggle-group-BsjEMfic.js} +1 -1
- package/dist/client/assets/{toolbar-WaysqEfz.js → toolbar-BcWKUVdT.js} +1 -1
- package/dist/client/assets/{tooltip-2La-f68Q.js → tooltip-kcGiZu6P.js} +1 -1
- package/dist/client/assets/{use-ai-providers-kgciqmRs.js → use-ai-providers-BcIUouZf.js} +1 -1
- package/dist/client/assets/{use-automations-DmPoIHA3.js → use-automations-C79xORO3.js} +1 -1
- package/dist/client/assets/{use-autosave-CT7wG3Qv.js → use-autosave-KV9xz2CC.js} +1 -1
- package/dist/client/assets/{use-capability-DxrcT9AW.js → use-capability-JYilRL77.js} +1 -1
- package/dist/client/assets/{use-clock-tick-n9GtE0Cq.js → use-clock-tick-DClVqBI6.js} +1 -1
- package/dist/client/assets/{use-connection-DNjvpsXX.js → use-connection-DXYv0Dlt.js} +1 -1
- package/dist/client/assets/{use-copy-DEnQ3bpL.js → use-copy-DTiLIjX4.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BZMkd898.js → use-create-virtual-mcp-DpDzLWae.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Blzii2X5.js → use-debounced-autosave-BdVa5FtM.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C2tRwl1G.js → use-debounced-value-BASrSWg3.js} +1 -1
- package/dist/client/assets/use-deco-credits-4AbLahU1.js +1 -0
- package/dist/client/assets/{use-decopilot-events-DgBVDXYP.js → use-decopilot-events-CqxWC3Qt.js} +1 -1
- package/dist/client/assets/{use-delete-connection-xxYRBi8p.js → use-delete-connection-DBTideE2.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CTV5HKPv.js → use-deployment-admin-Ddcy4-RM.js} +1 -1
- package/dist/client/assets/{use-file-configs-SWRAWh_l.js → use-file-configs-CNpa8frL.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CGISYIMq.js → use-infinite-scroll-BJfoFF98.js} +1 -1
- package/dist/client/assets/{use-join-requests-CoVD6BOS.js → use-join-requests-BFN1qb3o.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B5b37aiu.js → use-mcp-client-D88A_FLe.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DD2MmEqL.js → use-mcp-tools-DasMWNgZ.js} +1 -1
- package/dist/client/assets/{use-members-DzkjUoJV.js → use-members-B2oQ4Mli.js} +1 -1
- package/dist/client/assets/{use-mobile-CT3yU0Mk.js → use-mobile-FSyJw-g8.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DpmJRDSG.js → use-navigate-to-agent-BAUFuqoL.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BsBXjjlS.js → use-open-billing-url-CY3_mFFw.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bo-CO3rH.js → use-org-auth-client-C3CuRPbb.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dzy04a3G.js → use-org-sso-DKk_Tbqk.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DGOLTZKh.js → use-organization-roles-COLS-CjO.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BSdKLcGF.js → use-organization-settings-DYIICGR9.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BJ91vRwf.js → use-registry-connections-CHDtRuU8.js} +1 -1
- package/dist/client/assets/{use-secrets-DdHTSlNZ.js → use-secrets-DzUh6HrD.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BhwwAIIj.js → use-section-preview-base-BfG_5dSA.js} +1 -1
- package/dist/client/assets/{use-status-sounds-6JeLPtQS.js → use-status-sounds-COLJP0Lu.js} +1 -1
- package/dist/client/assets/{use-tags-C4qTyTIP.js → use-tags-CcBRYgNt.js} +1 -1
- package/dist/client/assets/{use-view-mode-a2V8IUPD.js → use-view-mode-CM2kJ519.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-C4nfOvWc.js +1 -0
- package/dist/client/assets/useInfiniteQuery-CmmOH8T_.js +1 -0
- package/dist/client/assets/{useRouterState-CPf57-wY.js → useRouterState-DqtNE6zu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BDnje4nq.js +1 -0
- package/dist/client/assets/{users-qSQTwwCC.js → users-wYf-b4P0.js} +1 -1
- package/dist/client/assets/{variant-calendar-CW881-GE.js → variant-calendar-WEqnNDvV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CAlt97wR.js → view-mode-toggle-BAamz_K6.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/commerce-onboarding-BcbHBN76.js +0 -1
- package/dist/client/assets/onboarding-CQGDI3Bm.js +0 -1
- package/dist/client/assets/organization-choice-BRJ5bOuv.js +0 -1
- package/dist/client/assets/record-editor-DpRInA4u.js +0 -1
- package/dist/client/assets/redirect-editor-WxghSLXV.js +0 -1
- package/dist/client/assets/registry-ClpCJTmQ.js +0 -2
- package/dist/client/assets/self-tool-result-DPsJP5SW.js +0 -1
- package/dist/client/assets/store-registry-CRuDI2z7.js +0 -2
- package/dist/client/assets/use-deco-credits-DQwVauly.js +0 -1
- package/dist/client/assets/use-virtual-mcp-D1c8M1hh.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ueeYN8M9.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CLfnZXXY.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as pt,b as at,j as r}from"./index-D7ruAD9R.js";import{C as ct}from"./checkbox-tzeh-qrP.js";import{I as rt}from"./input-BywtKe6R.js";import{L as et}from"./label-sPxTCHgi.js";import{d as dt,a as nt,b as ft,c as xt,S as ht}from"./select-BpPnRSd-.js";import{F as ut,bw as bt,J as yt,bx as jt,by as vt}from"./index-lvxbMBlt.js";import{u as gt}from"./use-autosave-CT7wG3Qv.js";import"./Check-jVlurWFp.js";import"./tooltip-2La-f68Q.js";import"./ChevronDown-p_tbIzFd.js";import"./ChevronUp-vuWH7gGr.js";import"./ArrowUp-CM4hwO1x.js";import"./chat-context-CHpxk4f9.js";import"./tab-id-D2hxEf3P.js";import"./dialog-BndOy54_.js";import"./X-JiAwzhaQ.js";import"./Copy01-C_8GUzyJ.js";import"./hooks-DSQPS7ZB.js";import"./use-mcp-client-B5b37aiu.js";import"./auth-CgC0zRiu.js";import"./decopilot-sse-pool-DxtdX756.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-D1c8M1hh.js";import"./use-ai-providers-kgciqmRs.js";import"./studio-tools-43YF_K-Q.js";import"./use-decopilot-events-DgBVDXYP.js";import"./use-organization-settings-BSdKLcGF.js";import"./automation-runs-BlKRnDL3.js";import"./agent-icon-BypwlSQB.js";import"./AlertCircle-B-VB_v8_.js";import"./Tool01-DncLlBOd.js";import"./ArrowLeft-KvTc6rGE.js";import"./Tool02-Dop27LUm.js";import"./XCircle-BAmgho8b.js";import"./ArrowUpRight-CT3hd3Gz.js";import"./TrendUp01-DeH0rZDG.js";import"./ZapSquare-4QAPR3zA.js";import"./Users03-DBRXdvYq.js";import"./CheckCircle-Dag22p3m.js";import"./ChevronRight-CPHsfQo3.js";import"./DotsVertical-BGG3Ho_u.js";import"./Stars02-9Za0OT3w.js";import"./CpuChip01-4na0tDxe.js";import"./CreditCard01-DW_FdoX9.js";import"./Globe01-BMEBgVG2.js";import"./Settings02-DwsCOelc.js";import"./Eye-Dn-joolw.js";import"./FilterLines-CYIS3PyF.js";import"./Share07-BKiSFd-U.js";import"./Star01-CHCsqoaq.js";import"./Globe04-DufTt3Vi.js";import"./SwitchHorizontal01-Cebat5cd.js";import"./HardDrive-H4sB7rht.js";import"./Key01-CH_IVG_t.js";import"./LayoutLeft-BLZ5NIVe.js";import"./LinkExternal01-SB0_tkSE.js";import"./LogOut01-BccMqXFZ.js";import"./Monitor01-DljnePZF.js";import"./Sun-ftMFixk5.js";import"./Palette-BkqWyxiz.js";import"./Play-BO_bz8z5.js";import"./Plus-DChWoRcZ.js";import"./SearchLg-DIkeGuEU.js";import"./SearchMd-CUHSKZ0C.js";import"./Shield01-DZaZzDZT.js";import"./Stars01-sT_rQek5.js";import"./Trash01-BjgXKgr6.js";import"./Upload01-C9lBOcvL.js";import"./User01-BJ2PmluK.js";import"./Users01-CDyoTcZA.js";import"./XClose-DgBj6S8z.js";import"./Zap-ywE7kIil.js";import"./useInfiniteQuery-ueeYN8M9.js";import"./use-infinite-scroll-CGISYIMq.js";import"./use-connection-DNjvpsXX.js";import"./card-DcOVhRdn.js";import"./sidebar-XtHztjYp.js";import"./use-mobile-CT3yU0Mk.js";import"./table-DPk5SmMs.js";import"./empty-state-C-U6aO8t.js";import"./use-members-DzkjUoJV.js";import"./use-org-auth-client-Bo-CO3rH.js";import"./use-clock-tick-n9GtE0Cq.js";import"./use-automations-DmPoIHA3.js";import"./useSuspenseInfiniteQuery-CLfnZXXY.js";import"./avatar-BeSTVwN_.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DEnQ3bpL.js";import"./monaco-editor-5TGvXJMP.js";import"./spinner-BDArA5p5.js";import"./index-BVax3vfK.js";import"./shell-layout-U1XEcaQb.js";import"./required-auth-layout-D8pQ4hlg.js";import"./use-org-sso-Dzy04a3G.js";import"./integration-icon-BDe33Str.js";import"./use-navigate-to-agent-DpmJRDSG.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-GISiEbjd.js";import"./form-B913lxdw.js";import"./file-type-icon-umbWZVCL.js";import"./drawer-CG0exhDi.js";import"./collection-search-D9_uCTpl.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./tabs-Y4Dxc2rR.js";import"./toggle-group-BaXRwZme.js";import"./use-deco-credits-DQwVauly.js";import"./popover-DMey_8nq.js";import"./alert-dialog-CZcxNTn5.js";import"./toolbar-WaysqEfz.js";import"./skeleton-TYssXBL8.js";import"./github-repo-picker-IkpFrAa4.js";import"./use-debounced-value-C2tRwl1G.js";import"./authenticate-and-persist-oauth-zBYZihEH.js";import"./mcp-oauth-CNM-bHuQ.js";import"./use-mcp-tools-DD2MmEqL.js";import"./extract-connection-data-BTdYO2Ie.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./agent-capabilities-cXfbMfjV.js";import"./connection-card-BXKTS1UY.js";import"./use-registry-connections-BJ91vRwf.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BJCjQSy4.js";import"./connection-form-helpers-ClipGuvp.js";import"./collection-tabs-Cgws9vFl.js";import"./badge-7TN3Wktg.js";import"./use-open-billing-url-BsBXjjlS.js";import"./select-model-DvmZyKHW.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CewjBJDd.js";import"./cards-CGo6rBiP.js";import"./dropdown-menu-BlydGYwg.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-6JeLPtQS.js";import"./use-capability-DxrcT9AW.js";import"./pt-BR-CLy76QW2.js";import"./switch-COa2pVfk.js";import"./use-debounced-autosave-Blzii2X5.js";import"./index-CqMFU0yP.js";import"./search-input-B0dv5yOL.js";import"./index-D93sMh9L.js";import"./use-secrets-DdHTSlNZ.js";import"./self-tool-result-DPsJP5SW.js";import"./use-tags-C4qTyTIP.js";import"./get-initials-D-f_fDFw.js";import"./command-vCdEhggD.js";import"./index-BbcBLfTr.js";import"./use-file-configs-SWRAWh_l.js";import"./automation-list-row-DtC9A60K.js";const Et=[{value:"temporary",labelKey:"sandbox.redirectEditor.typeTemporary"},{value:"permanent",labelKey:"sandbox.redirectEditor.typePermanent"}];function xi(it){const t=pt.c(106),{orgSlug:G,virtualMcpId:H,branch:W,blockKey:X,block:Z}=it,e=at();let V;t[0]!==W||t[1]!==G||t[2]!==H?(V={orgSlug:G,virtualMcpId:H,branch:W},t[0]=W,t[1]=G,t[2]=H,t[3]=V):V=t[3];const s=ut(V);let J;t[4]!==Z?(J=bt(Z),t[4]=Z,t[5]=J):J=t[5];const ot=J;let M;t[6]!==X||t[7]!==s?(M=i=>{s.mutate({blockKey:X,data:vt(i)})},t[6]=X,t[7]=s,t[8]=M):M=t[8];const[o,tt]=gt(ot,M);let Y;t[9]!==o||t[10]!==tt?(Y=i=>tt({...o,...i}),t[9]=o,t[10]=tt,t[11]=Y):Y=t[11];const m=Y;let l;t[12]!==e?(l=e("sandbox.redirectEditor.title"),t[12]=e,t[13]=l):l=t[13];let p;t[14]!==l?(p=r.jsx("span",{className:"text-sm font-medium",children:l}),t[14]=l,t[15]=p):p=t[15];let a;t[16]!==s.isError||t[17]!==s.isPending?(a=r.jsx(yt,{isPending:s.isPending,isError:s.isError}),t[16]=s.isError,t[17]=s.isPending,t[18]=a):a=t[18];let c;t[19]!==p||t[20]!==a?(c=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[p,a]}),t[19]=p,t[20]=a,t[21]=c):c=t[21];let d;t[22]!==e?(d=e("sandbox.redirectEditor.fromLabel"),t[22]=e,t[23]=d):d=t[23];let n;t[24]!==d?(n=r.jsx(et,{htmlFor:"redirect-from",children:d}),t[24]=d,t[25]=n):n=t[25];const mt=o.from;let f;t[26]!==e?(f=e("sandbox.redirectEditor.fromPlaceholder"),t[26]=e,t[27]=f):f=t[27];let x;t[28]!==m?(x=i=>m({from:i.target.value}),t[28]=m,t[29]=x):x=t[29];let h;t[30]!==o.from||t[31]!==f||t[32]!==x?(h=r.jsx(rt,{id:"redirect-from",value:mt,placeholder:f,onChange:x,className:"h-10"}),t[30]=o.from,t[31]=f,t[32]=x,t[33]=h):h=t[33];let u;t[34]!==e?(u=e("sandbox.redirectEditor.fromDescription"),t[34]=e,t[35]=u):u=t[35];let b;t[36]!==u?(b=r.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[36]=u,t[37]=b):b=t[37];let y;t[38]!==n||t[39]!==h||t[40]!==b?(y=r.jsxs("div",{className:"space-y-2",children:[n,h,b]}),t[38]=n,t[39]=h,t[40]=b,t[41]=y):y=t[41];let j;t[42]!==e?(j=e("sandbox.redirectEditor.toLabel"),t[42]=e,t[43]=j):j=t[43];let v;t[44]!==j?(v=r.jsx(et,{htmlFor:"redirect-to",children:j}),t[44]=j,t[45]=v):v=t[45];const st=o.to;let g;t[46]!==e?(g=e("sandbox.redirectEditor.toPlaceholder"),t[46]=e,t[47]=g):g=t[47];let E;t[48]!==m?(E=i=>m({to:i.target.value}),t[48]=m,t[49]=E):E=t[49];let P;t[50]!==o.to||t[51]!==g||t[52]!==E?(P=r.jsx(rt,{id:"redirect-to",value:st,placeholder:g,onChange:E,className:"h-10"}),t[50]=o.to,t[51]=g,t[52]=E,t[53]=P):P=t[53];let N;t[54]!==e?(N=e("sandbox.redirectEditor.toDescription"),t[54]=e,t[55]=N):N=t[55];let S;t[56]!==N?(S=r.jsx("p",{className:"text-xs text-muted-foreground",children:N}),t[56]=N,t[57]=S):S=t[57];let C;t[58]!==v||t[59]!==P||t[60]!==S?(C=r.jsxs("div",{className:"space-y-2",children:[v,P,S]}),t[58]=v,t[59]=P,t[60]=S,t[61]=C):C=t[61];let T;t[62]!==e?(T=e("sandbox.redirectEditor.typeLabel"),t[62]=e,t[63]=T):T=t[63];let k;t[64]!==T?(k=r.jsx(et,{htmlFor:"redirect-type",children:T}),t[64]=T,t[65]=k):k=t[65];const lt=o.type;let w;t[66]!==m?(w=i=>m({type:i}),t[66]=m,t[67]=w):w=t[67];let R;t[68]!==e?(R=e("sandbox.redirectEditor.typePlaceholder"),t[68]=e,t[69]=R):R=t[69];let I;t[70]!==R?(I=r.jsx(nt,{id:"redirect-type",className:"h-10 w-full",children:r.jsx(ft,{placeholder:R})}),t[70]=R,t[71]=I):I=t[71];let _;t[72]!==e?(_=Et.map(i=>r.jsx(dt,{value:i.value,children:e(i.labelKey,{status:jt[i.value]})},i.value)),t[72]=e,t[73]=_):_=t[73];let F;t[74]!==_?(F=r.jsx(xt,{children:_}),t[74]=_,t[75]=F):F=t[75];let L;t[76]!==o.type||t[77]!==w||t[78]!==I||t[79]!==F?(L=r.jsxs(ht,{value:lt,onValueChange:w,children:[I,F]}),t[76]=o.type,t[77]=w,t[78]=I,t[79]=F,t[80]=L):L=t[80];let $;t[81]===Symbol.for("react.memo_cache_sentinel")?($=r.jsx("strong",{children:"Temporary"}),t[81]=$):$=t[81];let q;t[82]===Symbol.for("react.memo_cache_sentinel")?(q=r.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",$," when the redirect may change;"," ",r.jsx("strong",{children:"Permanent"})," lets browsers cache it."]}),t[82]=q):q=t[82];let Q;t[83]!==k||t[84]!==L?(Q=r.jsxs("div",{className:"space-y-2",children:[k,L,q]}),t[83]=k,t[84]=L,t[85]=Q):Q=t[85];let K;t[86]!==m?(K=i=>m({discardQueryParameters:i===!0}),t[86]=m,t[87]=K):K=t[87];let D;t[88]!==o.discardQueryParameters||t[89]!==K?(D=r.jsx(ct,{checked:o.discardQueryParameters,onCheckedChange:K}),t[88]=o.discardQueryParameters,t[89]=K,t[90]=D):D=t[90];let A;t[91]!==e?(A=e("sandbox.redirectEditor.discardQueryParameters"),t[91]=e,t[92]=A):A=t[92];let B;t[93]!==A?(B=r.jsx("span",{className:"text-sm",children:A}),t[93]=A,t[94]=B):B=t[94];let O;t[95]!==D||t[96]!==B?(O=r.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5",children:[D,B]}),t[95]=D,t[96]=B,t[97]=O):O=t[97];let U;t[98]!==y||t[99]!==C||t[100]!==Q||t[101]!==O?(U=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsxs("div",{className:"mx-auto max-w-xl space-y-6",children:[y,C,Q,O]})}),t[98]=y,t[99]=C,t[100]=Q,t[101]=O,t[102]=U):U=t[102];let z;return t[103]!==U||t[104]!==c?(z=r.jsxs("div",{className:"flex h-full flex-col",children:[c,U]}),t[103]=U,t[104]=c,t[105]=z):z=t[105],z}export{xi as RedirectEditor};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BXgtH3-2.js","assets/index-D7ruAD9R.js","assets/index-DXMTUPM-.css","assets/Tool02-Dop27LUm.js","assets/CheckCircle-Dag22p3m.js","assets/Settings02-DwsCOelc.js","assets/use-mcp-client-B5b37aiu.js","assets/auth-CgC0zRiu.js","assets/useInfiniteQuery-ueeYN8M9.js","assets/use-infinite-scroll-CGISYIMq.js","assets/studio-tools-43YF_K-Q.js","assets/badge-7TN3Wktg.js","assets/input-BywtKe6R.js","assets/dropdown-menu-BlydGYwg.js","assets/Check-jVlurWFp.js","assets/ChevronRight-CPHsfQo3.js","assets/DotsVertical-BGG3Ho_u.js","assets/table-DPk5SmMs.js","assets/toggle-group-BaXRwZme.js","assets/use-view-mode-a2V8IUPD.js","assets/use-mobile-CT3yU0Mk.js","assets/FilterLines-CYIS3PyF.js","assets/Globe01-BMEBgVG2.js","assets/SearchMd-CUHSKZ0C.js","assets/dialog-BndOy54_.js","assets/X-JiAwzhaQ.js","assets/AlertCircle-B-VB_v8_.js","assets/Upload01-C9lBOcvL.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-CZcxNTn5.js","assets/card-DcOVhRdn.js","assets/Trash01-BjgXKgr6.js","assets/label-sPxTCHgi.js","assets/select-BpPnRSd-.js","assets/tooltip-2La-f68Q.js","assets/ChevronDown-p_tbIzFd.js","assets/ChevronUp-vuWH7gGr.js","assets/switch-COa2pVfk.js","assets/textarea-BJCjQSy4.js","assets/ArrowLeft-KvTc6rGE.js","assets/XCircle-BAmgho8b.js","assets/checkbox-tzeh-qrP.js","assets/Eye-Dn-joolw.js","assets/LinkExternal01-SB0_tkSE.js","assets/use-copy-DEnQ3bpL.js","assets/Copy01-C_8GUzyJ.js","assets/Key01-CH_IVG_t.js","assets/Plus-DChWoRcZ.js","assets/mcp-oauth-CNM-bHuQ.js","assets/Play-BO_bz8z5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as i,j as e,r as s,k as a,aG as o}from"./index-D7ruAD9R.js";import{R as m}from"./require-capability-BTVUJu40.js";import"./use-capability-DxrcT9AW.js";import"./access-gate-So3U0BEa.js";import"./capability-load-error-CKYF121O.js";const n=s.lazy(()=>o(()=>import("./registry-layout-BXgtH3-2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function f(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(m,{capability:"registry:manage",area:"the registry",children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(n,{})})}),r[0]=t):t=r[0],t}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aS as mt,Y as Ie,aT as ft,X as gt,aU as We,o as ye,aV as pt,aW as ht,r as H,aX as bt,aY as yt,aZ as xt,a_ as Ct,a$ as Me,b0 as vt,b1 as Ot,b2 as St,c as G,m as fe,j as o,b as te,k as Re,B as Z,e as Te,K as X,Z as xe,$ as ie,a2 as Ce,a1 as ve,n as be,ar as jt,t as _e,u as _t,x as je,p as ue,Q as Nt,E as Tt,a as Et}from"./index-D7ruAD9R.js";import{W as Ye,g as wt,u as Fe,S as It}from"./use-mcp-client-B5b37aiu.js";import{I as Le}from"./integration-icon-BDe33Str.js";import{c as ge,b as Ze,a as Xe,d as Je,e as et,h as kt}from"./dialog-BndOy54_.js";import{c as Ke,T as Ae,a as De}from"./tooltip-2La-f68Q.js";import{m as tt,e as nt,Q as Rt}from"./agent-icon-BypwlSQB.js";import{b as Ft,c as Lt,e as Kt}from"./extract-connection-data-BTdYO2Ie.js";import{a as At,f as ot,b as Dt,p as Pt,i as Bt}from"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import{g as st}from"./metadata-dUsYcpuu.js";import{i as it}from"./CheckCircle-Dag22p3m.js";import{d as re,F as Oe,a as ae,e as he,b as ce,c as le,f as Ut}from"./form-B913lxdw.js";import{I as pe}from"./input-BywtKe6R.js";import{i as qt}from"./Check-jVlurWFp.js";import{a as rt}from"./Copy01-C_8GUzyJ.js";import{i as $t}from"./Settings02-DwsCOelc.js";import{s as Mt}from"./Eye-Dn-joolw.js";import{u as Qt}from"./use-debounced-value-C2tRwl1G.js";import{n as zt}from"./LinkExternal01-SB0_tkSE.js";import{a as Vt}from"./authenticate-and-persist-oauth-zBYZihEH.js";function Qe(n,e){const t=new Set(e);return n.filter(s=>!t.has(s))}function Ht(n,e,t){const s=n.slice(0);return s[e]=t,s}var Gt=class extends mt{#s;#e;#i;#o;#t;#n;#r;#a;#c;#l=[];constructor(n,e,t){super(),this.#s=n,this.#o=t,this.#i=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(n=>{n.subscribe(e=>{this.#f(n,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(n=>{n.destroy()})}setQueries(n,e){this.#i=n,this.#o=e,Ie.batch(()=>{const t=this.#t,s=this.#m(this.#i);s.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const i=s.map(d=>d.observer),c=i.map(d=>d.getCurrentResult()),r=t.length!==i.length,l=i.some((d,a)=>d!==t[a]),u=r||l,p=u?!0:c.some((d,a)=>{const f=this.#e[a];return!f||!ft(d,f)});!u&&!p||(u&&(this.#l=s,this.#t=i),this.#e=c,this.hasListeners()&&(u&&(Qe(t,i).forEach(d=>{d.destroy()}),Qe(i,t).forEach(d=>{d.subscribe(a=>{this.#f(d,a)})})),this.#g()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(n=>n.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(n,e){const t=this.#m(n),s=t.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),i=t.map(c=>c.defaultedQueryOptions.queryHash);return[s,c=>this.#u(c??s,e,i),()=>this.#d(s,t)]}#d(n,e){return e.map((t,s)=>{const i=n[s];return t.defaultedQueryOptions.notifyOnChangeProps?i:t.observer.trackResult(i,c=>{e.forEach(r=>{r.observer.trackProp(c)})})})}#u(n,e,t){if(e){const s=this.#c,i=t!==void 0&&s!==void 0&&(s.length!==t.length||t.some((c,r)=>c!==s[r]));return(!this.#n||this.#e!==this.#a||i||e!==this.#r)&&(this.#r=e,this.#a=this.#e,t!==void 0&&(this.#c=t),this.#n=gt(this.#n,e(n))),this.#n}return n}#p(){return this.#o?.combine!==void 0&&this.#t.some((n,e)=>n.options.suspense&&this.#e[e]?.data===void 0)}#m(n){const e=new Map;this.#t.forEach(s=>{const i=s.options.queryHash;if(!i)return;const c=e.get(i);c?c.push(s):e.set(i,[s])});const t=[];return n.forEach(s=>{const i=this.#s.defaultQueryOptions(s),r=e.get(i.queryHash)?.shift()??new We(this.#s,i);t.push({defaultedQueryOptions:i,observer:r})}),t}#f(n,e){const t=this.#t.indexOf(n);t!==-1&&(this.#e=Ht(this.#e,t,e),this.#g())}#g(){if(this.hasListeners()){const n=this.#d(this.#e,this.#l),e=this.#p(),t=this.#n,s=e?t:this.#u(n,this.#o?.combine);(e||t!==s)&&Ie.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function Wt({queries:n,...e},t){const s=ye(t),i=pt(),c=ht(),r=H.useMemo(()=>n.map(x=>{const h=s.defaultQueryOptions(x);return h._optimisticResults=i?"isRestoring":"optimistic",h}),[n,s,i]);r.forEach(x=>{bt(x);const h=s.getQueryCache().get(x.queryHash);yt(x,c,h)}),xt(c);const[l]=H.useState(()=>new Gt(s,r,e)),[u,p,d]=l.getOptimisticResult(r,e.combine),a=!i&&e.subscribed!==!1;H.useSyncExternalStore(H.useCallback(x=>a?l.subscribe(Ie.batchCalls(x)):Ct,[l,a]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),H.useEffect(()=>{l.setQueries(r,e)},[r,e,l]);const m=u.some((x,h)=>Me(r[h],x))?u.flatMap((x,h)=>{const b=r[h];if(b&&Me(b,x)){const g=new We(s,b);return vt(b,g,c)}return[]}):[];if(m.length>0)throw Promise.all(m);const y=u.find((x,h)=>{const b=r[h];return b&&Ot({result:x,errorResetBoundary:c,throwOnError:b.throwOnError,query:s.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(y?.error)throw y.error;return p(d())}function Yt(n,e){return Wt({...n,queries:n.queries.map(t=>({...t,suspense:!0,throwOnError:St,enabled:!0,placeholderData:void 0}))},e)}const Zt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Xt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Jt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,en=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ne(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=Zt.test(e),s=Xt.test(e),i=Jt.test(e);if(t&&!s&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=s?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=r.hostname.split(".");return l.length<2||l.some(u=>!u||!en.test(u))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Po(n,e){if(!n.trim())return!0;const t=Ne(n);if(!t.ok||!e)return!1;const s=Ne(e);return s.ok&&s.value===t.value}function tn(n){if(!n)return null;const e=Ne(n);return e.ok?new URL(e.value).hostname:null}function nn(n){const e=G.c(14),{children:t,className:s,wrapperClassName:i}=n,[c,r]=H.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=x=>{if(!x)return;const h=()=>{const g=x.scrollHeight-x.scrollTop-x.clientHeight<8;r(g)};h(),x.addEventListener("scroll",h,{passive:!0});const b=new ResizeObserver(h);b.observe(x);for(const g of Array.from(x.children))b.observe(g);return()=>{x.removeEventListener("scroll",h),b.disconnect()}},e[0]=l):l=e[0];const u=l;let p;e[1]!==i?(p=fe("relative",i),e[1]=i,e[2]=p):p=e[2];let d;e[3]!==t||e[4]!==s?(d=o.jsx("div",{ref:u,className:s,children:t}),e[3]=t,e[4]=s,e[5]=d):d=e[5];const a=c?"opacity-0":"opacity-100";let f;e[6]!==a?(f=fe("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",a),e[6]=a,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("div",{"aria-hidden":!0,className:f}),e[8]=f,e[9]=m):m=e[9];let y;return e[10]!==p||e[11]!==d||e[12]!==m?(y=o.jsxs("div",{className:p,children:[d,m]}),e[10]=p,e[11]=d,e[12]=m,e[13]=y):y=e[13],y}const on=new Set([]);function sn(n){if(n.boundVia==="sa")return!0;const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return me(e?.accountName);case"shopify":return me(e?.storeDomain);case"google-analytics":return me(e?.propertyId);case"google-search-console":return me(e?.siteUrl);case"github":return me(t?.github_repo);default:return!0}}function rn(n){const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return typeof e?.accountName=="string"?e.accountName:null;case"shopify":return typeof e?.storeDomain=="string"?e.storeDomain:null;case"google-analytics":return typeof e?.propertyId=="string"?e.propertyId:null;case"google-search-console":return typeof e?.siteUrl=="string"?e.siteUrl:null;case"github":return typeof t?.github_repo=="string"?t.github_repo:null;default:return null}}function an(n){const e=n.properties;if(!e)return[];const t=[];for(const[s,i]of Object.entries(e)){const l=i?.properties?.__type?.const;typeof l=="string"&&l.length>0&&t.push({fieldKey:s,bindingType:l})}return t}const cn=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"shopify",bindingType:"shopify"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function ln(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function ee(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function dn(n,e,t,s){return{...n??{},[e]:{__type:t,value:s}}}function me(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(me):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&me(t)):!1}const un={accountName:"commerceOnboarding.companionCard.configField.accountName",appKey:"commerceOnboarding.companionCard.configField.appKey",appToken:"commerceOnboarding.companionCard.configField.appToken",propertyId:"commerceOnboarding.companionCard.configField.propertyId",siteUrl:"commerceOnboarding.companionCard.configField.siteUrl"};function mn(n,e){const t=un[n];return t?e(t):n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,s=>s.toUpperCase())}function fn(n){return me(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function gn(n,e){return n?Object.entries(n).flatMap(([t,s])=>{if(t.startsWith("__"))return[];const i=fn(s);return i?[{key:t,label:mn(t,e),value:i}]:[]}):[]}function ze({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function pn(n,e,t){const s=n.filter(i=>(i.app_name===e||!!t&&i.app_id===t)&&At(i)===null);return s.length===0?null:(s.sort((i,c)=>{const r=l=>l.status==="active"?0:1;return r(i)!==r(c)?r(i)-r(c):(c.updated_at??"").localeCompare(i.updated_at??"")}),s[0].id)}function hn(n){return n.server?.icons?.[0]?.src??Ft(n.server?.repository)??null}function bn(n,e){const t=st(n._meta);return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function yn(n){const e=[],t=new Map(n.connections.map(s=>[s.id,s]));for(const s of n.requirements){const i=n.curated[s.bindingType],c=i?n.itemsById[i.registryAppId]:n.itemsByName[s.bindingType];if(!c)continue;const r=n.configurationState?.[s.fieldKey]?.value,l=r?t.get(r):void 0,u=r&&l?r:null,p=u?n.connectionReadiness?.[u]!==!1:!1,d=!!u&&p,a=d?void 0:n.saBindings?.[s.bindingType],f=d||!!a,m=d?"oauth":a?"sa":null,y=f&&sn({bindingType:s.bindingType,boundVia:m,companionConfig:l?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:c,title:bn(c,s.bindingType),icon:hn(c),headline:i?.headline??st(c._meta)?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:f,configured:y,required:on.has(s.bindingType),candidateConnectionId:f?null:u||pn(n.connections,s.bindingType,i?.registryAppId),linkedConnectionId:u,configurationState:l?.configuration_state??null,boundVia:m,boundResource:a?.resource??null,connectedDetail:f?rn({bindingType:s.bindingType,companionConfig:l?.configuration_state??null,cdConfig:n.configurationState??null}):null})}return e}function xn(n,e){if(!n)return null;const t=i=>{const c=i.startsWith("sc-domain:")?i.substring(10):(()=>{try{return new URL(i.startsWith("http")?i:`https://${i}`).hostname}catch{return null}})();return c===null?i:c.startsWith("www.")?c.substring(4):c},s=t(n);for(const i of e)if(t(i.siteUrl)===s)return i.siteUrl;return null}function Cn(n){return(n?.response?.accountSummaries??[]).map(s=>({account:s.account,options:(s.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${s.displayName})`}))}))}function vn(n){const e=G.c(25),{icon:t,title:s,headline:i,required:c,attention:r,action:l}=n,u=te(),p=r?"border-warning/50 bg-warning/[0.04]":"border-border";let d;e[0]!==p?(d=fe("relative flex items-center justify-between gap-3 rounded-lg border bg-card p-3.5 sm:gap-4 sm:p-4",p),e[0]=p,e[1]=d):d=e[1];let a;e[2]!==c||e[3]!==u?(a=c&&o.jsx("span",{className:"absolute -top-3 right-4 rounded-full border border-input bg-background px-3 py-1 text-xs font-medium text-foreground",children:u("commerceOnboarding.companionCard.required")}),e[2]=c,e[3]=u,e[4]=a):a=e[4];let f;e[5]!==t||e[6]!==s?(f=o.jsx(Le,{icon:t,name:s,size:"sm",fit:"contain",className:"shrink-0 p-1"}),e[5]=t,e[6]=s,e[7]=f):f=e[7];let m;e[8]!==s?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:s}),e[8]=s,e[9]=m):m=e[9];let y;e[10]!==i?(y=i&&o.jsx("p",{className:"hidden text-sm leading-5 text-muted-foreground sm:block",children:i}),e[10]=i,e[11]=y):y=e[11];let x;e[12]!==m||e[13]!==y?(x=o.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[m,y]}),e[12]=m,e[13]=y,e[14]=x):x=e[14];let h;e[15]!==f||e[16]!==x?(h=o.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3 sm:items-start",children:[f,x]}),e[15]=f,e[16]=x,e[17]=h):h=e[17];let b;e[18]!==l?(b=o.jsx("div",{className:"shrink-0",children:l}),e[18]=l,e[19]=b):b=e[19];let g;return e[20]!==d||e[21]!==a||e[22]!==h||e[23]!==b?(g=o.jsxs("div",{className:d,children:[a,h,b]}),e[20]=d,e[21]=a,e[22]=h,e[23]=b,e[24]=g):g=e[24],g}function at(n){const e=G.c(12),{connecting:t,disabled:s,title:i,primary:c,onConnect:r}=n,l=te(),u=c?"default":"outline",p=s||t;let d;e[0]!==l||e[1]!==i?(d=l("commerceOnboarding.companionCard.connectAriaLabel",{title:i}),e[0]=l,e[1]=i,e[2]=d):d=e[2];let a;e[3]!==t||e[4]!==l?(a=t?o.jsx(Re,{size:16,className:"animate-spin"}):l("commerceOnboarding.companionCard.connect"),e[3]=t,e[4]=l,e[5]=a):a=e[5];let f;return e[6]!==r||e[7]!==u||e[8]!==p||e[9]!==d||e[10]!==a?(f=o.jsx(Z,{type:"button",variant:u,size:"sm",disabled:p,onClick:r,"aria-label":d,children:a}),e[6]=r,e[7]=u,e[8]=p,e[9]=d,e[10]=a,e[11]=f):f=e[11],f}function On(n){const e=G.c(11),{disabled:t,title:s,onConfigure:i}=n,c=te();let r;e[0]!==c||e[1]!==s?(r=c("commerceOnboarding.companionCard.configureAriaLabel",{title:s}),e[0]=c,e[1]=s,e[2]=r):r=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(tt,{size:16}),e[3]=l):l=e[3];let u;e[4]!==c?(u=c("commerceOnboarding.companionCard.finishSetup"),e[4]=c,e[5]=u):u=e[5];let p;return e[6]!==t||e[7]!==i||e[8]!==r||e[9]!==u?(p=o.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-warning/60 text-warning hover:bg-warning/10 hover:text-warning",disabled:t,onClick:i,"aria-label":r,children:[l,u]}),e[6]=t,e[7]=i,e[8]=r,e[9]=u,e[10]=p):p=e[10],p}function ct(n){const e=G.c(9),{detail:t,controls:s}=n,i=te();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(it,{size:16,className:"text-success"}),e[0]=c):c=e[0];let r;e[1]!==t||e[2]!==i?(r=t?o.jsx("span",{className:"max-w-40 truncate text-foreground",children:t}):i("commerceOnboarding.companionCard.connected"),e[1]=t,e[2]=i,e[3]=r):r=e[3];let l;e[4]!==r?(l=o.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[c," ",r]}),e[4]=r,e[5]=l):l=e[5];let u;return e[6]!==s||e[7]!==l?(u=o.jsxs("div",{className:"flex items-center gap-1",children:[l,s]}),e[6]=s,e[7]=l,e[8]=u):u=e[8],u}function lt(n){const e=G.c(4),{ariaLabel:t,onClick:s}=n;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(tt,{size:16}),e[0]=i):i=e[0];let c;return e[1]!==t||e[2]!==s?(c=o.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:s,"aria-label":t,children:i}),e[1]=t,e[2]=s,e[3]=c):c=e[3],c}function ke(n){const e=G.c(38);let t,s,i,c,r;e[0]!==n?({value:r,onChange:s,placeholder:i,className:t,...c}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=i,e[4]=c,e[5]=r):(t=e[1],s=e[2],i=e[3],c=e[4],r=e[5]);const[l,u]=H.useState(!1),[p,d]=H.useState(!1);let a;e[6]!==r?(a=async()=>{if(r)try{await navigator.clipboard.writeText(r),d(!0),setTimeout(()=>d(!1),2e3)}catch(N){console.error("Failed to copy text: ",N)}},e[6]=r,e[7]=a):a=e[7];const f=a;let m;e[8]!==l?(m=()=>{u(!l)},e[8]=l,e[9]=m):m=e[9];const y=m,x=l?"text":"password";let h;e[10]!==t?(h=fe("pr-20",t),e[10]=t,e[11]=h):h=e[11];let b;e[12]!==s||e[13]!==i||e[14]!==c||e[15]!==x||e[16]!==h||e[17]!==r?(b=o.jsx(pe,{type:x,value:r,onChange:s,placeholder:i,className:h,...c}),e[12]=s,e[13]=i,e[14]=c,e[15]=x,e[16]=h,e[17]=r,e[18]=b):b=e[18];const g=l?"Hide password":"Show password";let v;e[19]!==l?(v=l?o.jsx($t,{size:16}):o.jsx(Mt,{size:16}),e[19]=l,e[20]=v):v=e[20];let C;e[21]!==g||e[22]!==v||e[23]!==y?(C=o.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:y,title:g,children:v}),e[21]=g,e[22]=v,e[23]=y,e[24]=C):C=e[24];const S=!r,j=p?"Copied!":"Copy token";let _;e[25]!==p?(_=p?o.jsx(qt,{size:16}):o.jsx(rt,{size:16}),e[25]=p,e[26]=_):_=e[26];let O;e[27]!==f||e[28]!==j||e[29]!==_||e[30]!==S?(O=o.jsx(Z,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:f,disabled:S,title:j,children:_}),e[27]=f,e[28]=j,e[29]=_,e[30]=S,e[31]=O):O=e[31];let w;e[32]!==O||e[33]!==C?(w=o.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,O]}),e[32]=O,e[33]=C,e[34]=w):w=e[34];let E;return e[35]!==w||e[36]!==b?(E=o.jsxs("div",{className:"relative",children:[b,w]}),e[35]=w,e[36]=b,e[37]=E):E=e[37],E}function Ee(n){const e=G.c(19),{card:t,selfClient:s,org:i,onDone:c,onError:r}=n,l=ye();let u;e[0]!==t||e[1]!==s?(u=async h=>{const{values:b,connectionToken:g}=h,C={configuration_state:{...t.configurationState??{},...b}};g!==void 0&&(C.connection_token=g),await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:t.linkedConnectionId||t.candidateConnectionId,data:C}})},e[0]=t,e[1]=s,e[2]=u):u=e[2];let p;e[3]!==c||e[4]!==i||e[5]!==l?(p=async()=>{await l.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),c()},e[3]=c,e[4]=i,e[5]=l,e[6]=p):p=e[6];let d;e[7]!==r?(d=h=>{r?.(h)},e[7]=r,e[8]=d):d=e[8];let a;e[9]!==u||e[10]!==p||e[11]!==d?(a={mutationFn:u,onSuccess:p,onError:d},e[9]=u,e[10]=p,e[11]=d,e[12]=a):a=e[12];const f=Te(a);let m;e[13]!==f?(m=(h,b)=>f.mutate({values:h,connectionToken:b?.connectionToken}),e[13]=f,e[14]=m):m=e[14];const y=m;let x;return e[15]!==f.error||e[16]!==f.isPending||e[17]!==y?(x={save:y,isPending:f.isPending,error:f.error},e[15]=f.error,e[16]=f.isPending,e[17]=y,e[18]=x):x=e[18],x}const Sn=xe({accountName:ie().min(1,"Informe o nome da conta"),appKey:ie().optional(),appToken:ie().optional()});function jn(n){const e=G.c(73),{card:t,selfClient:s,org:i,onDone:c,onIsPendingChange:r}=n,l=te();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=Ce(Sn),e[0]=u):u=e[0];const p=t.configurationState?.accountName||"",d=t.configurationState?.appKey||"",a=t.configurationState?.appToken||"";let f;e[1]!==p||e[2]!==d||e[3]!==a?(f={resolver:u,defaultValues:{accountName:p,appKey:d,appToken:a}},e[1]=p,e[2]=d,e[3]=a,e[4]=f):f=e[4];const m=ve(f);let y;e[5]!==t.configurationState?.accountName||e[6]!==t.configurationState?.appKey||e[7]!==t.configurationState?.appToken||e[8]!==m?(y=()=>{m.reset({accountName:t.configurationState?.accountName||"",appKey:t.configurationState?.appKey||"",appToken:t.configurationState?.appToken||""})},e[5]=t.configurationState?.accountName,e[6]=t.configurationState?.appKey,e[7]=t.configurationState?.appToken,e[8]=m,e[9]=y):y=e[9];let x;e[10]!==t.configurationState||e[11]!==m?(x=[t.configurationState,m],e[10]=t.configurationState,e[11]=m,e[12]=x):x=e[12],H.useEffect(y,x);let h;e[13]!==t||e[14]!==c||e[15]!==i||e[16]!==s?(h={card:t,selfClient:s,org:i,onDone:c},e[13]=t,e[14]=c,e[15]=i,e[16]=s,e[17]=h):h=e[17];const{save:b,isPending:g,error:v}=Ee(h);let C,S;e[18]!==g||e[19]!==r?(S=()=>{r?.(g)},C=[g,r],e[18]=g,e[19]=r,e[20]=C,e[21]=S):(C=e[20],S=e[21]),H.useEffect(S,C);let j;if(e[22]!==m||e[23]!==b){let K;e[25]!==b?(K=async U=>{b(U)},e[25]=b,e[26]=K):K=e[26],j=m.handleSubmit(K),e[22]=m,e[23]=b,e[24]=j}else j=e[24];const _=j;let O;e[27]!==g||e[28]!==l?(O=K=>{const{field:U}=K;return o.jsxs(ae,{children:[o.jsx(he,{children:l("commerceOnboarding.vtexConfigForm.accountNameLabel")}),o.jsx(ce,{children:o.jsx(pe,{placeholder:l("commerceOnboarding.vtexConfigForm.accountNamePlaceholder"),...U,disabled:g})}),o.jsx(le,{})]})},e[27]=g,e[28]=l,e[29]=O):O=e[29];let w;e[30]!==m.control||e[31]!==O?(w=o.jsx(re,{control:m.control,name:"accountName",render:O}),e[30]=m.control,e[31]=O,e[32]=w):w=e[32];let E;e[33]!==g||e[34]!==l?(E=K=>{const{field:U}=K;return o.jsxs(ae,{children:[o.jsx(he,{children:l("commerceOnboarding.vtexConfigForm.appKeyLabel")}),o.jsx(ce,{children:o.jsx(ke,{placeholder:l("commerceOnboarding.vtexConfigForm.appKeyPlaceholder"),...U,disabled:g})}),o.jsx(le,{})]})},e[33]=g,e[34]=l,e[35]=E):E=e[35];let N;e[36]!==m.control||e[37]!==E?(N=o.jsx(re,{control:m.control,name:"appKey",render:E}),e[36]=m.control,e[37]=E,e[38]=N):N=e[38];let k;e[39]!==g||e[40]!==l?(k=K=>{const{field:U}=K;return o.jsxs(ae,{children:[o.jsx(he,{children:l("commerceOnboarding.vtexConfigForm.appTokenLabel")}),o.jsx(ce,{children:o.jsx(ke,{placeholder:l("commerceOnboarding.vtexConfigForm.appTokenPlaceholder"),...U,disabled:g})}),o.jsx(le,{})]})},e[39]=g,e[40]=l,e[41]=k):k=e[41];let I;e[42]!==m.control||e[43]!==k?(I=o.jsx(re,{control:m.control,name:"appToken",render:k}),e[42]=m.control,e[43]=k,e[44]=I):I=e[44];let F;e[45]!==m||e[46]!==w||e[47]!==N||e[48]!==I?(F=o.jsxs(Oe,{...m,children:[w,N,I]}),e[45]=m,e[46]=w,e[47]=N,e[48]=I,e[49]=F):F=e[49];let P;e[50]!==v||e[51]!==l?(P=v&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:l("commerceOnboarding.vtexConfigForm.savingError")}),e[50]=v,e[51]=l,e[52]=P):P=e[52];let T;e[53]!==l?(T=l("commerceOnboarding.vtexConfigForm.cancelButton"),e[53]=l,e[54]=T):T=e[54];let L;e[55]!==g||e[56]!==c||e[57]!==T?(L=o.jsx(Z,{type:"button",variant:"outline",onClick:c,disabled:g,children:T}),e[55]=g,e[56]=c,e[57]=T,e[58]=L):L=e[58];let A;e[59]!==g||e[60]!==l?(A=l(g?"commerceOnboarding.vtexConfigForm.savingButton":"commerceOnboarding.vtexConfigForm.saveButton"),e[59]=g,e[60]=l,e[61]=A):A=e[61];let q;e[62]!==g||e[63]!==A?(q=o.jsx(Z,{type:"submit",disabled:g,children:A}),e[62]=g,e[63]=A,e[64]=q):q=e[64];let B;e[65]!==L||e[66]!==q?(B=o.jsxs(ge,{className:"pt-4",children:[L,q]}),e[65]=L,e[66]=q,e[67]=B):B=e[67];let M;return e[68]!==_||e[69]!==F||e[70]!==P||e[71]!==B?(M=o.jsxs("form",{onSubmit:_,className:"space-y-4",children:[F,P,B]}),e[68]=_,e[69]=F,e[70]=P,e[71]=B,e[72]=M):M=e[72],M}const _n=(n,e)=>xe({storeDomain:ie().min(1,e("commerceOnboarding.shopifyConfigForm.storeDomainRequired")),accessToken:ie().optional(),apiVersion:ie().optional()}).refine(t=>n||!!t.accessToken?.trim(),{path:["accessToken"],message:e("commerceOnboarding.shopifyConfigForm.accessTokenRequired")});function Nn(n){const e=G.c(76),{card:t,selfClient:s,org:i,onDone:c,onIsPendingChange:r}=n,l=te();let u;e[0]!==t.configured||e[1]!==l?(u=Ce(_n(t.configured,l)),e[0]=t.configured,e[1]=l,e[2]=u):u=e[2];const p=t.configurationState?.storeDomain||"",d=t.configurationState?.apiVersion||"";let a;e[3]!==p||e[4]!==d?(a={storeDomain:p,accessToken:"",apiVersion:d},e[3]=p,e[4]=d,e[5]=a):a=e[5];let f;e[6]!==u||e[7]!==a?(f={resolver:u,defaultValues:a},e[6]=u,e[7]=a,e[8]=f):f=e[8];const m=ve(f);let y;e[9]!==t.configurationState?.apiVersion||e[10]!==t.configurationState?.storeDomain||e[11]!==m?(y=()=>{m.reset({storeDomain:t.configurationState?.storeDomain||"",accessToken:"",apiVersion:t.configurationState?.apiVersion||""})},e[9]=t.configurationState?.apiVersion,e[10]=t.configurationState?.storeDomain,e[11]=m,e[12]=y):y=e[12];let x;e[13]!==t.configurationState||e[14]!==m?(x=[t.configurationState,m],e[13]=t.configurationState,e[14]=m,e[15]=x):x=e[15],H.useEffect(y,x);let h;e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==s?(h={card:t,selfClient:s,org:i,onDone:c},e[16]=t,e[17]=c,e[18]=i,e[19]=s,e[20]=h):h=e[20];const{save:b,isPending:g,error:v}=Ee(h);let C,S;e[21]!==g||e[22]!==r?(S=()=>{r?.(g)},C=[g,r],e[21]=g,e[22]=r,e[23]=C,e[24]=S):(C=e[23],S=e[24]),H.useEffect(S,C);let j;if(e[25]!==m||e[26]!==b){let K;e[28]!==b?(K=async U=>{const D=U.apiVersion?.trim(),Q=U.accessToken?.trim();b({storeDomain:U.storeDomain.trim(),...D?{apiVersion:D}:{}},Q?{connectionToken:Q}:void 0)},e[28]=b,e[29]=K):K=e[29],j=m.handleSubmit(K),e[25]=m,e[26]=b,e[27]=j}else j=e[27];const _=j;let O;e[30]!==g||e[31]!==l?(O=K=>{const{field:U}=K;return o.jsxs(ae,{children:[o.jsx(he,{children:l("commerceOnboarding.shopifyConfigForm.storeDomainLabel")}),o.jsx(ce,{children:o.jsx(pe,{placeholder:l("commerceOnboarding.shopifyConfigForm.storeDomainPlaceholder"),...U,disabled:g})}),o.jsx(le,{})]})},e[30]=g,e[31]=l,e[32]=O):O=e[32];let w;e[33]!==m.control||e[34]!==O?(w=o.jsx(re,{control:m.control,name:"storeDomain",render:O}),e[33]=m.control,e[34]=O,e[35]=w):w=e[35];let E;e[36]!==g||e[37]!==l?(E=K=>{const{field:U}=K;return o.jsxs(ae,{children:[o.jsx(he,{children:l("commerceOnboarding.shopifyConfigForm.accessTokenLabel")}),o.jsx(ce,{children:o.jsx(ke,{placeholder:l("commerceOnboarding.shopifyConfigForm.accessTokenPlaceholder"),...U,disabled:g})}),o.jsx(le,{})]})},e[36]=g,e[37]=l,e[38]=E):E=e[38];let N;e[39]!==m.control||e[40]!==E?(N=o.jsx(re,{control:m.control,name:"accessToken",render:E}),e[39]=m.control,e[40]=E,e[41]=N):N=e[41];let k;e[42]!==g||e[43]!==l?(k=K=>{const{field:U}=K;return o.jsxs(ae,{children:[o.jsx(he,{children:l("commerceOnboarding.shopifyConfigForm.apiVersionLabel")}),o.jsx(ce,{children:o.jsx(pe,{placeholder:l("commerceOnboarding.shopifyConfigForm.apiVersionPlaceholder"),...U,disabled:g})}),o.jsx(le,{})]})},e[42]=g,e[43]=l,e[44]=k):k=e[44];let I;e[45]!==m.control||e[46]!==k?(I=o.jsx(re,{control:m.control,name:"apiVersion",render:k}),e[45]=m.control,e[46]=k,e[47]=I):I=e[47];let F;e[48]!==m||e[49]!==w||e[50]!==N||e[51]!==I?(F=o.jsxs(Oe,{...m,children:[w,N,I]}),e[48]=m,e[49]=w,e[50]=N,e[51]=I,e[52]=F):F=e[52];let P;e[53]!==v||e[54]!==l?(P=v&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:l("commerceOnboarding.shopifyConfigForm.savingError")}),e[53]=v,e[54]=l,e[55]=P):P=e[55];let T;e[56]!==l?(T=l("commerceOnboarding.shopifyConfigForm.cancelButton"),e[56]=l,e[57]=T):T=e[57];let L;e[58]!==g||e[59]!==c||e[60]!==T?(L=o.jsx(Z,{type:"button",variant:"outline",onClick:c,disabled:g,children:T}),e[58]=g,e[59]=c,e[60]=T,e[61]=L):L=e[61];let A;e[62]!==g||e[63]!==l?(A=l(g?"commerceOnboarding.shopifyConfigForm.savingButton":"commerceOnboarding.shopifyConfigForm.saveButton"),e[62]=g,e[63]=l,e[64]=A):A=e[64];let q;e[65]!==g||e[66]!==A?(q=o.jsx(Z,{type:"submit",disabled:g,children:A}),e[65]=g,e[66]=A,e[67]=q):q=e[67];let B;e[68]!==L||e[69]!==q?(B=o.jsxs(ge,{className:"pt-4",children:[L,q]}),e[68]=L,e[69]=q,e[70]=B):B=e[70];let M;return e[71]!==_||e[72]!==F||e[73]!==P||e[74]!==B?(M=o.jsxs("form",{onSubmit:_,className:"space-y-4",children:[F,P,B]}),e[71]=_,e[72]=F,e[73]=P,e[74]=B,e[75]=M):M=e[75],M}function Pe(n){const e=G.c(31),{options:t,value:s,onChange:i,disabled:c,ariaLabel:r,searchPlaceholder:l,hideSearch:u}=n,p=u===void 0?!1:u,d=te(),[a,f]=H.useState("");let m,y,x;if(e[0]!==t||e[1]!==a||e[2]!==s){const _=a.trim().toLowerCase();m=_?t.filter(O=>O.label.toLowerCase().includes(_)):t,y=m.map(Tn),x=y.includes(s)?s:y[0]??"",e[0]=t,e[1]=a,e[2]=s,e[3]=m,e[4]=y,e[5]=x}else m=e[3],y=e[4],x=e[5];const h=x;let b;e[6]!==c||e[7]!==y||e[8]!==i?(b=function(O){if(c||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(O.key))return;O.preventDefault();const E=O.currentTarget.dataset.value,N=y.indexOf(E),k=y.length;if(k===0)return;let I;O.key==="ArrowDown"||O.key==="ArrowRight"?I=(N+1)%k:O.key==="ArrowUp"||O.key==="ArrowLeft"?I=(N-1+k)%k:O.key==="Home"?I=0:I=k-1;const F=y[I];i(F),O.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(F)}"]`)?.focus()},e[6]=c,e[7]=y,e[8]=i,e[9]=b):b=e[9];const g=b;let v;e[10]!==r||e[11]!==c||e[12]!==p||e[13]!==a||e[14]!==l||e[15]!==d?(v=p?null:o.jsxs("div",{className:"relative",children:[o.jsx(nt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),o.jsx(pe,{type:"text",value:a,onChange:_=>f(_.target.value),disabled:c,placeholder:l??d("commerceOnboarding.selectableList.searchPlaceholder"),"aria-label":d("commerceOnboarding.selectableList.searchAriaLabel",{label:r}),className:"h-8 pl-8"})]}),e[10]=r,e[11]=c,e[12]=p,e[13]=a,e[14]=l,e[15]=d,e[16]=v):v=e[16];let C;e[17]!==c||e[18]!==m||e[19]!==g||e[20]!==i||e[21]!==d||e[22]!==h||e[23]!==s?(C=m.length===0?o.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:d("commerceOnboarding.selectableList.noResults")}):m.map(_=>{const O=_.value===s;return o.jsxs("button",{type:"button",role:"radio","aria-checked":O,disabled:c,"data-value":_.value,tabIndex:_.value===h?0:-1,onClick:()=>i(_.value),onKeyDown:g,className:fe("flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left text-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",O?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[o.jsx("span",{className:"truncate",children:_.label}),O?o.jsx(it,{size:16,className:"shrink-0 text-primary"}):null]},_.value)}),e[17]=c,e[18]=m,e[19]=g,e[20]=i,e[21]=d,e[22]=h,e[23]=s,e[24]=C):C=e[24];let S;e[25]!==r||e[26]!==C?(S=o.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:C}),e[25]=r,e[26]=C,e[27]=S):S=e[27];let j;return e[28]!==v||e[29]!==S?(j=o.jsxs("div",{className:"space-y-2",children:[v,S]}),e[28]=v,e[29]=S,e[30]=j):j=e[30],j}function Tn(n){return n.value}function Be(n){const e=G.c(16),{label:t,iconSize:s,className:i,iconClassName:c,labelClassName:r}=n,l=s===void 0?14:s;let u;e[0]!==i?(u=fe("inline-flex items-center gap-2",i),e[0]=i,e[1]=u):u=e[1];let p;e[2]!==c?(p=fe("shrink-0 animate-spin",c),e[2]=c,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==p?(d=o.jsx(Re,{size:l,className:p}),e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==r?(a=fe("text-sm",r),e[7]=r,e[8]=a):a=e[8];let f;e[9]!==t||e[10]!==a?(f=o.jsx("span",{className:a,children:t}),e[9]=t,e[10]=a,e[11]=f):f=e[11];let m;return e[12]!==u||e[13]!==d||e[14]!==f?(m=o.jsxs("span",{className:u,children:[d,f]}),e[12]=u,e[13]=d,e[14]=f,e[15]=m):m=e[15],m}const En=xe({propertyId:ie().min(1,"Selecione uma propriedade")});function wn(n){const e=G.c(68),{card:t,connectionId:s,companionClient:i,selfClient:c,org:r,onDone:l,onDisconnect:u,onIsPendingChange:p}=n;let d;e[0]!==s||e[1]!==r.id?(d=X.commerceDiscoveryCompanionGaProperties(r.id,s),e[0]=s,e[1]=r.id,e[2]=d):d=e[2];let a;e[3]!==i?(a=async()=>{const D=await i.callTool({name:"get-account-summaries",arguments:{}}),Q=ee(D);return Cn(Q)},e[3]=i,e[4]=a):a=e[4];let f;e[5]!==d||e[6]!==a?(f={queryKey:d,queryFn:a},e[5]=d,e[6]=a,e[7]=f):f=e[7];const m=be(f);let y;e[8]===Symbol.for("react.memo_cache_sentinel")?(y=Ce(En),e[8]=y):y=e[8];const x=t.configurationState?.propertyId||"";let h;e[9]!==x?(h={resolver:y,defaultValues:{propertyId:x}},e[9]=x,e[10]=h):h=e[10];const b=ve(h);let g;e[11]!==t||e[12]!==l||e[13]!==r||e[14]!==c?(g={card:t,selfClient:c,org:r,onDone:l},e[11]=t,e[12]=l,e[13]=r,e[14]=c,e[15]=g):g=e[15];const{save:v,isPending:C,error:S}=Ee(g);let j,_;e[16]!==C||e[17]!==p?(j=()=>{p?.(C)},_=[C,p],e[16]=C,e[17]=p,e[18]=j,e[19]=_):(j=e[18],_=e[19]),H.useEffect(j,_);let O;if(e[20]!==b||e[21]!==v){let D;e[23]!==v?(D=async Q=>{v(Q)},e[23]=v,e[24]=D):D=e[24],O=b.handleSubmit(D),e[20]=b,e[21]=v,e[22]=O}else O=e[22];const w=O;if(m.isLoading){let D;return e[25]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:o.jsx(Be,{label:"Carregando propriedades..."})}),e[25]=D):D=e[25],D}if(m.isError){let D;return e[26]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx("div",{className:"space-y-4",children:o.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=D):D=e[26],D}let E;e[27]!==m.data?(E=m.data||[],e[27]=m.data,e[28]=E):E=e[28];const N=E;if(N.flatMap(kn).length===0){let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma propriedade do Google Analytics foi encontrada. Conecte uma conta do Google Analytics com propriedades."}),e[29]=D):D=e[29];let Q;e[30]!==u?(Q=u?o.jsx("button",{type:"button",onClick:u,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):o.jsx("span",{}),e[30]=u,e[31]=Q):Q=e[31];let $;e[32]!==l?($=o.jsx(Z,{type:"button",variant:"outline",onClick:l,children:"Fechar"}),e[32]=l,e[33]=$):$=e[33];let Y;return e[34]!==Q||e[35]!==$?(Y=o.jsxs("div",{className:"space-y-4",children:[D,o.jsxs(ge,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[Q,$]})]}),e[34]=Q,e[35]=$,e[36]=Y):Y=e[36],Y}let I;e[37]!==C||e[38]!==N?(I=D=>{const{field:Q}=D;return o.jsxs(ae,{children:[o.jsx(ce,{children:o.jsx(Pe,{options:N.flatMap(In),value:Q.value,onChange:Q.onChange,disabled:C,ariaLabel:"Propriedade do Google Analytics"})}),o.jsx(le,{})]})},e[37]=C,e[38]=N,e[39]=I):I=e[39];let F;e[40]!==b.control||e[41]!==I?(F=o.jsx(re,{control:b.control,name:"propertyId",render:I}),e[40]=b.control,e[41]=I,e[42]=F):F=e[42];let P;e[43]!==b||e[44]!==F?(P=o.jsx(Oe,{...b,children:F}),e[43]=b,e[44]=F,e[45]=P):P=e[45];let T;e[46]!==S?(T=S&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:S instanceof Error?S.message:"Não foi possível salvar a configuração"}),e[46]=S,e[47]=T):T=e[47];let L;e[48]!==C||e[49]!==u?(L=u?o.jsx("button",{type:"button",onClick:u,disabled:C,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):o.jsx("span",{}),e[48]=C,e[49]=u,e[50]=L):L=e[50];let A;e[51]!==C||e[52]!==l?(A=o.jsx(Z,{type:"button",variant:"outline",onClick:l,disabled:C,children:"Cancelar"}),e[51]=C,e[52]=l,e[53]=A):A=e[53];const q=C?"Salvando...":"Salvar";let B;e[54]!==C||e[55]!==q?(B=o.jsx(Z,{type:"submit",disabled:C,children:q}),e[54]=C,e[55]=q,e[56]=B):B=e[56];let M;e[57]!==A||e[58]!==B?(M=o.jsxs("div",{className:"flex gap-2",children:[A,B]}),e[57]=A,e[58]=B,e[59]=M):M=e[59];let K;e[60]!==L||e[61]!==M?(K=o.jsxs(ge,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[L,M]}),e[60]=L,e[61]=M,e[62]=K):K=e[62];let U;return e[63]!==w||e[64]!==P||e[65]!==T||e[66]!==K?(U=o.jsxs("form",{onSubmit:w,className:"space-y-4",children:[P,T,K]}),e[63]=w,e[64]=P,e[65]=T,e[66]=K,e[67]=U):U=e[67],U}function In(n){return n.options}function kn(n){return n.options}const Rn=n=>xe({siteUrl:ie().min(1,n("commerceOnboarding.googleSearchConsoleConfigForm.siteRequired"))});function Fn(n){const e=G.c(83),{card:t,connectionId:s,companionClient:i,selfClient:c,org:r,contextSiteUrl:l,onDone:u,onIsPendingChange:p}=n,d=te();let a;e[0]!==s||e[1]!==r.id?(a=X.commerceDiscoveryCompanionGscSites(r.id,s),e[0]=s,e[1]=r.id,e[2]=a):a=e[2];let f;e[3]!==i?(f=async()=>{const R=await i.callTool({name:"list_sites",arguments:{}});return ee(R).sites||[]},e[3]=i,e[4]=f):f=e[4];let m;e[5]!==a||e[6]!==f?(m={queryKey:a,queryFn:f},e[5]=a,e[6]=f,e[7]=m):m=e[7];const y=be(m);let x;e[8]!==d?(x=Ce(Rn(d)),e[8]=d,e[9]=x):x=e[9];const h=t.configurationState?.siteUrl||"";let b;e[10]!==h?(b={siteUrl:h},e[10]=h,e[11]=b):b=e[11];let g;e[12]!==x||e[13]!==b?(g={resolver:x,defaultValues:b},e[12]=x,e[13]=b,e[14]=g):g=e[14];const v=ve(g);let C;e[15]!==t||e[16]!==u||e[17]!==r||e[18]!==c?(C={card:t,selfClient:c,org:r,onDone:u},e[15]=t,e[16]=u,e[17]=r,e[18]=c,e[19]=C):C=e[19];const{save:S,isPending:j,error:_}=Ee(C),O=H.useRef(!1),w=t.configurationState?.siteUrl;let E,N;e[20]!==j||e[21]!==p?(N=()=>{p?.(j)},E=[j,p],e[20]=j,e[21]=p,e[22]=E,e[23]=N):(E=e[22],N=e[23]),H.useEffect(N,E);let k,I;e[24]!==l||e[25]!==v||e[26]!==w||e[27]!==y.data||e[28]!==y.isSuccess?(k=()=>{if(!(O.current||!y.isSuccess)){if(O.current=!0,w){v.getValues("siteUrl")!==w&&v.setValue("siteUrl",w);return}if(!v.getValues("siteUrl")){const R=xn(l,y.data??[]);R&&v.setValue("siteUrl",R)}}},I=[y.isSuccess,y.data,w,l,v],e[24]=l,e[25]=v,e[26]=w,e[27]=y.data,e[28]=y.isSuccess,e[29]=k,e[30]=I):(k=e[29],I=e[30]),H.useEffect(k,I);let F;if(e[31]!==v||e[32]!==S){let R;e[34]!==S?(R=async z=>{S(z)},e[34]=S,e[35]=R):R=e[35],F=v.handleSubmit(R),e[31]=v,e[32]=S,e[33]=F}else F=e[33];const P=F;if(y.isLoading){let R;e[36]!==d?(R=d("commerceOnboarding.googleSearchConsoleConfigForm.loadingSites"),e[36]=d,e[37]=R):R=e[37];let z;return e[38]!==R?(z=o.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:o.jsx(Be,{label:R})}),e[38]=R,e[39]=z):z=e[39],z}if(y.isError){let R;e[40]!==d?(R=d("commerceOnboarding.googleSearchConsoleConfigForm.loadSitesError"),e[40]=d,e[41]=R):R=e[41];let z;return e[42]!==R?(z=o.jsx("div",{className:"space-y-4",children:o.jsx("p",{className:"text-sm text-destructive",children:R})}),e[42]=R,e[43]=z):z=e[43],z}let T;e[44]!==y.data?(T=y.data||[],e[44]=y.data,e[45]=T):T=e[45];const L=T;if(L.length===0){let R;e[46]!==d?(R=d("commerceOnboarding.googleSearchConsoleConfigForm.noSitesFound"),e[46]=d,e[47]=R):R=e[47];let z;return e[48]!==R?(z=o.jsx("div",{className:"space-y-4",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:R})}),e[48]=R,e[49]=z):z=e[49],z}let A;e[50]!==j||e[51]!==L||e[52]!==d?(A=R=>{const{field:z}=R;return o.jsxs(ae,{children:[o.jsx(ce,{children:o.jsx(Pe,{options:L.map(Ln),value:z.value,onChange:z.onChange,disabled:j,ariaLabel:d("commerceOnboarding.googleSearchConsoleConfigForm.siteAriaLabel")})}),o.jsx(le,{})]})},e[50]=j,e[51]=L,e[52]=d,e[53]=A):A=e[53];let q;e[54]!==v.control||e[55]!==A?(q=o.jsx(re,{control:v.control,name:"siteUrl",render:A}),e[54]=v.control,e[55]=A,e[56]=q):q=e[56];let B;e[57]!==v||e[58]!==q?(B=o.jsx(Oe,{...v,children:q}),e[57]=v,e[58]=q,e[59]=B):B=e[59];let M;e[60]!==_||e[61]!==d?(M=_&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:_ instanceof Error?_.message:d("commerceOnboarding.googleSearchConsoleConfigForm.savingError")}),e[60]=_,e[61]=d,e[62]=M):M=e[62];let K;e[63]!==d?(K=d("commerceOnboarding.googleSearchConsoleConfigForm.cancelButton"),e[63]=d,e[64]=K):K=e[64];let U;e[65]!==j||e[66]!==u||e[67]!==K?(U=o.jsx(Z,{type:"button",variant:"outline",onClick:u,disabled:j,children:K}),e[65]=j,e[66]=u,e[67]=K,e[68]=U):U=e[68];let D;e[69]!==j||e[70]!==d?(D=d(j?"commerceOnboarding.googleSearchConsoleConfigForm.savingButton":"commerceOnboarding.googleSearchConsoleConfigForm.saveButton"),e[69]=j,e[70]=d,e[71]=D):D=e[71];let Q;e[72]!==j||e[73]!==D?(Q=o.jsx(Z,{type:"submit",disabled:j,children:D}),e[72]=j,e[73]=D,e[74]=Q):Q=e[74];let $;e[75]!==U||e[76]!==Q?($=o.jsxs(ge,{className:"pt-4",children:[U,Q]}),e[75]=U,e[76]=Q,e[77]=$):$=e[77];let Y;return e[78]!==P||e[79]!==B||e[80]!==M||e[81]!==$?(Y=o.jsxs("form",{onSubmit:P,className:"space-y-4",children:[B,M,$]}),e[78]=P,e[79]=B,e[80]=M,e[81]=$,e[82]=Y):Y=e[82],Y}function Ln(n){return{value:n.siteUrl,label:n.siteUrl}}function Kn(n){const[e,t]=n.split("/");return!e||!t?null:{owner:e,name:t}}function An(n){const{existingRepo:e,owner:t,name:s}=n;return e?.connectionId&&e.owner.toLowerCase()===t.toLowerCase()&&e.name.toLowerCase()===s.toLowerCase()?{connectionId:e.connectionId,installationId:e.installationId}:null}function Dn(n){const{existingRepo:e,existingConnections:t,repoConnectionId:s}=n,i=e?.connectionId&&e.connectionId!==s?e.connectionId:void 0,c=[...t.filter(r=>r.connection_id!==s&&r.connection_id!==i),{connection_id:s,selected_tools:[]}];return{staleConnectionId:i,mergedConnections:c}}const Pn=xe({githubRepo:ie().min(1,"commerceOnboarding.githubConfigForm.selectRepository")}),Bn=15e3,Un=/^[\w.-]+\/[\w.-]+$/;async function qn(n,e,t,s){const{installations:i}=await ot(n,t),c=s.trim(),r=await Promise.allSettled(i.map(async d=>{const a=d.type==="User"?"user":"org",f=c?`${a}:${d.login} ${c} in:name`:`${a}:${d.login}`,y=await e.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(Bn)}),x=y.content?.[0]?.text;if(y.isError)throw new Error(x??"search_repositories failed");if(!x)throw new Error("empty search_repositories response");return JSON.parse(x).items??[]})),l=new Map;let u=0;for(const d of r){if(d.status==="rejected"){u+=1;continue}for(const a of d.value)a.full_name&&!l.has(a.full_name)&&l.set(a.full_name,a)}return{repos:Array.from(l.values()).sort((d,a)=>(a.updated_at??"").localeCompare(d.updated_at??"")).map(d=>d.full_name),failed:u,total:i.length}}function $n({connectionId:n,companionClient:e,selfClient:t,org:s,onDone:i,onIsPendingChange:c}){const r=te(),l=ye(),u=Ye.COMMERCE_DISCOVERY(s.id),[p,d]=H.useState(""),a=Qt(p,300),f=H.useRef(!1),m=be({queryKey:X.commerceDiscoveryCompanionGithubSelected(s.id,n),queryFn:async()=>{const N=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}}),k=ee(N).item?.configuration_state??null;return typeof k?.github_repo=="string"?k.github_repo:""}}),y=be({queryKey:X.commerceDiscoveryCompanionGithubRepos(s.id,n,a.trim()),queryFn:()=>qn(N=>t.callTool(N),e,n,a)}),x=ve({resolver:Ce(Pn),defaultValues:{githubRepo:""}}),h=Te({mutationFn:async N=>{const k=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}}),F={...ee(k).item?.configuration_state??null??{},github_repo:N};await t.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:u,data:{configuration_state:F}}});const P=Kn(N);if(!P)throw new Error(r("commerceOnboarding.githubConfigForm.invalidRepository",{repo:N}));const{owner:T,name:L}=P,A=wt(s.id),q=ee(await t.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:A}})).item,B=q?.metadata?.githubRepo,M=q?.connections??[],K=An({existingRepo:B,owner:T,name:L});let U=K?.connectionId,D=K?.installationId,Q;if(!U){const{installations:R}=await ot(J=>t.callTool(J),n),z=Dt(R,T);if(!z)throw new Error(r("commerceOnboarding.githubConfigForm.noGithubInstallation",{owner:T}));D=z.installationId;const ne=ee(await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}})).item;if(!ne)throw new Error(r("commerceOnboarding.githubConfigForm.githubConnectionNotFound"));const{childConnectionId:oe,reused:W}=await Pt({orgSlug:s.slug,sourceConnection:ne,installationId:D,owner:T,repo:L,githubCallTool:J=>e.callTool(J),selfCallTool:J=>t.callTool(J)});U=oe,Q=W?void 0:oe}const{staleConnectionId:$,mergedConnections:Y}=Dn({existingRepo:B,existingConnections:M,repoConnectionId:U});try{if(await t.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:A,data:{connections:Y,metadata:{githubRepo:{owner:T,name:L,url:`https://github.com/${N}`,installationId:D,connectionId:U}}}}}),$){const R=ee(await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:$}})).item;R&&!Bt(R)&&await t.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:$,force:!0}}).catch(()=>{})}}catch(R){throw Q&&await t.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:Q,force:!0}}).catch(()=>{}),R}},onSuccess:async()=>{await l.invalidateQueries({queryKey:X.commerceDiscoveryConnection(s.id,u)}),await l.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(s.id)}),jt(l,s.id),i()}}),b=h.isPending;H.useEffect(()=>{c?.(b)},[b,c]);const g=m.data??"";H.useEffect(()=>{!m.isSuccess||f.current||(f.current=!0,m.data&&x.setValue("githubRepo",m.data))},[m.isSuccess,m.data,x]);const v=x.handleSubmit(async N=>{h.mutate(N.githubRepo)}),C=y.data?.repos??[],S=y.data?.failed??0,j=y.data?.total??0,_=a.trim(),O=[...C];_&&Un.test(_)&&!O.includes(_)&&O.unshift(_),g&&!O.includes(g)&&O.push(g);const w=j>0&&S===j,E=y.isError||w?r("commerceOnboarding.githubConfigForm.searchFailedTotal"):S>0?r("commerceOnboarding.githubConfigForm.searchFailedPartial"):null;return o.jsxs("form",{onSubmit:v,className:"space-y-4",children:[o.jsxs("div",{className:"relative",children:[o.jsx(nt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),o.jsx(pe,{type:"text",value:p,onChange:N=>d(N.target.value),disabled:b,placeholder:r("commerceOnboarding.githubConfigForm.searchRepositoryPlaceholder"),"aria-label":r("commerceOnboarding.githubConfigForm.searchRepositoryLabel"),className:"h-8 pl-8"})]}),y.isLoading?o.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:o.jsx(Be,{label:r("commerceOnboarding.githubConfigForm.loadingRepositories")})}):o.jsxs(o.Fragment,{children:[E&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E}),O.length===0?!E&&o.jsx("p",{className:"text-sm text-muted-foreground",children:r("commerceOnboarding.githubConfigForm.noRepositoriesFound")}):o.jsx(Oe,{...x,children:o.jsx(re,{control:x.control,name:"githubRepo",render:({field:N})=>o.jsxs(ae,{children:[o.jsx(ce,{children:o.jsx(Pe,{options:O.map(k=>({value:k,label:k})),value:N.value,onChange:N.onChange,disabled:b,ariaLabel:"Repositório",hideSearch:!0})}),o.jsx(le,{})]})})})]}),h.error&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:h.error instanceof Error?h.error.message:r("commerceOnboarding.githubConfigForm.failedToSave")}),o.jsxs(ge,{className:"pt-4",children:[o.jsx(Z,{type:"button",variant:"outline",onClick:i,disabled:b,children:r("commerceOnboarding.githubConfigForm.cancel")}),o.jsx(Z,{type:"submit",disabled:b,children:r(b?"commerceOnboarding.githubConfigForm.saving":"commerceOnboarding.githubConfigForm.save")})]})]})}const dt={vtex:jn,shopify:Nn,"google-analytics":wn,"google-search-console":Fn,github:$n},we="deco-reader@decocms.iam.gserviceaccount.com",ut={"google-analytics":"ga4","google-search-console":"gsc"},Mn={ga4:{label:"Google Analytics",consoleUrl:"https://analytics.google.com/analytics/web/#/admin",consoleLinkKey:"commerceOnboarding.saBinding.ga4.openConsole",steps:["commerceOnboarding.saBinding.ga4.step1","commerceOnboarding.saBinding.ga4.step2","commerceOnboarding.saBinding.ga4.step3"],resourceLabelKey:"commerceOnboarding.saBinding.ga4.resourceLabel",resourcePlaceholderKey:"commerceOnboarding.saBinding.ga4.resourcePlaceholder",resourceHintKey:"commerceOnboarding.saBinding.ga4.resourceHint"},gsc:{label:"Google Search Console",consoleUrl:"https://search.google.com/search-console",consoleLinkKey:"commerceOnboarding.saBinding.gsc.openConsole",steps:["commerceOnboarding.saBinding.gsc.step1","commerceOnboarding.saBinding.gsc.step2","commerceOnboarding.saBinding.gsc.step3"],resourceLabelKey:"commerceOnboarding.saBinding.gsc.resourceLabel",resourcePlaceholderKey:"commerceOnboarding.saBinding.gsc.resourcePlaceholder",resourceHintKey:"commerceOnboarding.saBinding.gsc.resourceHint"}};function Qn(n,e){switch(e){case"no-access":return{titleKey:"commerceOnboarding.saBinding.remediation.noAccess.title",stepKeys:n==="ga4"?["commerceOnboarding.saBinding.remediation.noAccess.ga4.1","commerceOnboarding.saBinding.remediation.noAccess.ga4.2","commerceOnboarding.saBinding.remediation.noAccess.ga4.3"]:["commerceOnboarding.saBinding.remediation.noAccess.gsc.1","commerceOnboarding.saBinding.remediation.noAccess.gsc.2","commerceOnboarding.saBinding.remediation.noAccess.gsc.3"]};case"no-web-stream":return{titleKey:"commerceOnboarding.saBinding.remediation.noWebStream.title",stepKeys:["commerceOnboarding.saBinding.remediation.noWebStream.1","commerceOnboarding.saBinding.remediation.noWebStream.2","commerceOnboarding.saBinding.remediation.noWebStream.3","commerceOnboarding.saBinding.remediation.noWebStream.4"]};case"no-match":return{titleKey:"commerceOnboarding.saBinding.remediation.noMatch.title",stepKeys:n==="ga4"?["commerceOnboarding.saBinding.remediation.noMatch.ga4.1","commerceOnboarding.saBinding.remediation.noMatch.ga4.2"]:["commerceOnboarding.saBinding.remediation.noMatch.gsc.1","commerceOnboarding.saBinding.remediation.noMatch.gsc.2"]};case"resource_already_bound":return{titleKey:"commerceOnboarding.saBinding.remediation.alreadyBound.title",stepKeys:["commerceOnboarding.saBinding.remediation.alreadyBound.1","commerceOnboarding.saBinding.remediation.alreadyBound.2"]};default:return{titleKey:"commerceOnboarding.saBinding.remediation.unknown.title",stepKeys:["commerceOnboarding.saBinding.remediation.unknown.1","commerceOnboarding.saBinding.remediation.unknown.2"]}}}function zn(n){const e=G.c(96),{provider:t,siteUrl:s,siteHost:i,selfClient:c,org:r,initialResourceId:l,onDone:u,onIsPendingChange:p,onOAuthInstead:d}=n,a=te(),f=Mn[t],m=ye(),[y,x]=H.useState(null);let h;e[0]!==i||e[1]!==a?(h=i||a("commerceOnboarding.saBinding.sampleDomain"),e[0]=i,e[1]=a,e[2]=h):h=e[2];const b=h;let g,v;if(e[3]!==f.resourceLabelKey||e[4]!==a){const W=xe({resourceId:ie().trim().min(1,a("commerceOnboarding.saBindingForm.resourceIdRequired",{resourceLabel:a(f.resourceLabelKey).toLowerCase()}))});v=ve,g=Ce(W),e[3]=f.resourceLabelKey,e[4]=a,e[5]=g,e[6]=v}else g=e[5],v=e[6];const C=l??"";let S;e[7]!==C?(S={resourceId:C},e[7]=C,e[8]=S):S=e[8];let j;e[9]!==g||e[10]!==S?(j={resolver:g,defaultValues:S},e[9]=g,e[10]=S,e[11]=j):j=e[11];const _=v(j);let O;e[12]!==t||e[13]!==c||e[14]!==s||e[15]!==a?(O=async W=>{if(!s)throw new Error(a("commerceOnboarding.saBindingForm.storeUrlUnavailable"));const J=await c.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:s,provider:t,resourceId:W.resourceId}});return ee(J)},e[12]=t,e[13]=c,e[14]=s,e[15]=a,e[16]=O):O=e[16];let w,E;e[17]!==p?(w=()=>p?.(!0),E=()=>p?.(!1),e[17]=p,e[18]=w,e[19]=E):(w=e[18],E=e[19]);let N;e[20]!==f.label||e[21]!==u||e[22]!==r||e[23]!==t||e[24]!==m||e[25]!==s||e[26]!==a?(N=async W=>{if(W.ok){x(null),_e.success(a("commerceOnboarding.saBindingForm.connectedSuccess",{label:f.label})),s&&await m.invalidateQueries({queryKey:X.commerceDiscoveryConnectionStatus(r.id,s)}),u();return}x({...Qn(t,W.reason??"unknown"),detail:W.detail})},e[20]=f.label,e[21]=u,e[22]=r,e[23]=t,e[24]=m,e[25]=s,e[26]=a,e[27]=N):N=e[27];let k;e[28]!==N||e[29]!==O||e[30]!==w||e[31]!==E?(k={mutationFn:O,onMutate:w,onSettled:E,onSuccess:N},e[28]=N,e[29]=O,e[30]=w,e[31]=E,e[32]=k):k=e[32];const I=Te(k);let F;if(e[33]!==_||e[34]!==I){let W;e[36]!==I?(W=J=>I.mutate(J),e[36]=I,e[37]=W):W=e[37],F=_.handleSubmit(W),e[33]=_,e[34]=I,e[35]=F}else F=e[35];const P=F,T=I.isPending;let L;e[38]!==a?(L=()=>{navigator.clipboard?.writeText(we),_e.success(a("commerceOnboarding.saBindingForm.emailCopied"))},e[38]=a,e[39]=L):L=e[39];const A=L;let q;e[40]!==f.consoleLinkKey||e[41]!==f.consoleUrl||e[42]!==f.resourceHintKey||e[43]!==f.resourceLabelKey||e[44]!==f.resourcePlaceholderKey||e[45]!==A||e[46]!==_||e[47]!==b||e[48]!==T||e[49]!==a?(q=W=>W===0?o.jsxs("a",{href:f.consoleUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground underline underline-offset-2 hover:text-foreground",children:[o.jsx(zt,{size:14}),a(f.consoleLinkKey)]}):W===1?o.jsxs("div",{className:"flex w-full items-center gap-2 rounded-lg border border-input bg-muted/40 p-2",children:[o.jsx("code",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:we}),o.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",onClick:A,"aria-label":a("commerceOnboarding.saBindingForm.copyEmailLabel"),children:o.jsx(rt,{size:16})})]}):o.jsx(Oe,{..._,children:o.jsx(re,{control:_.control,name:"resourceId",render:J=>{const{field:de}=J;return o.jsxs(ae,{className:"w-full",children:[o.jsx(ce,{children:o.jsx(pe,{...de,placeholder:a(f.resourcePlaceholderKey,{host:b}),disabled:T,autoComplete:"off","aria-label":a(f.resourceLabelKey)})}),o.jsx(Ut,{children:a(f.resourceHintKey,{host:b})}),o.jsx(le,{})]})}})}),e[40]=f.consoleLinkKey,e[41]=f.consoleUrl,e[42]=f.resourceHintKey,e[43]=f.resourceLabelKey,e[44]=f.resourcePlaceholderKey,e[45]=A,e[46]=_,e[47]=b,e[48]=T,e[49]=a,e[50]=q):q=e[50];const B=q;let M;if(e[51]!==B||e[52]!==f.steps||e[53]!==b||e[54]!==a){let W;e[56]!==B||e[57]!==b||e[58]!==a?(W=(J,de)=>o.jsxs("li",{className:"flex gap-3 rounded-lg border border-border p-4",children:[o.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-medium text-foreground",children:de+1}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-start gap-2",children:[o.jsx("p",{className:"text-sm leading-5 text-foreground",children:a(J,{host:b})}),B(de)]})]},J),e[56]=B,e[57]=b,e[58]=a,e[59]=W):W=e[59],M=f.steps.map(W),e[51]=B,e[52]=f.steps,e[53]=b,e[54]=a,e[55]=M}else M=e[55];let K;e[60]!==M?(K=o.jsx("ol",{className:"space-y-2",children:M}),e[60]=M,e[61]=K):K=e[61];let U;e[62]!==f.label||e[63]!==y||e[64]!==a?(U=y&&o.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:a(y.titleKey,{label:f.label})}),o.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:y.stepKeys.map(W=>o.jsxs("li",{className:"flex gap-2",children:[o.jsx("span",{"aria-hidden":!0,children:"•"}),o.jsx("span",{children:a(W,{email:we})})]},W))})]}),e[62]=f.label,e[63]=y,e[64]=a,e[65]=U):U=e[65];let D;e[66]!==I.error||e[67]!==I.isError||e[68]!==a?(D=I.isError&&o.jsx("p",{role:"alert",className:"text-sm text-destructive",children:I.error instanceof Error?I.error.message:a("commerceOnboarding.saBindingForm.bindError")}),e[66]=I.error,e[67]=I.isError,e[68]=a,e[69]=D):D=e[69];let Q;e[70]!==T||e[71]!==d||e[72]!==a?(Q=d&&o.jsxs("p",{className:"text-sm leading-5 text-muted-foreground",children:[a("commerceOnboarding.saBinding.oauthNote")," ",o.jsx("button",{type:"button",onClick:d,disabled:T,className:"underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:a("commerceOnboarding.saBindingForm.googleLoginAlternative")})]}),e[70]=T,e[71]=d,e[72]=a,e[73]=Q):Q=e[73];let $;e[74]!==a?($=a("commerceOnboarding.saBindingForm.cancel"),e[74]=a,e[75]=$):$=e[75];let Y;e[76]!==T||e[77]!==u||e[78]!==$?(Y=o.jsx(Z,{type:"button",variant:"outline",onClick:u,disabled:T,children:$}),e[76]=T,e[77]=u,e[78]=$,e[79]=Y):Y=e[79];let R;e[80]!==T||e[81]!==a?(R=a(T?"commerceOnboarding.saBindingForm.verifying":"commerceOnboarding.saBindingForm.bind"),e[80]=T,e[81]=a,e[82]=R):R=e[82];let z;e[83]!==T||e[84]!==R?(z=o.jsx(Z,{type:"submit",disabled:T,children:R}),e[83]=T,e[84]=R,e[85]=z):z=e[85];let ne;e[86]!==Y||e[87]!==z?(ne=o.jsxs(ge,{className:"gap-2",children:[Y,z]}),e[86]=Y,e[87]=z,e[88]=ne):ne=e[88];let oe;return e[89]!==P||e[90]!==K||e[91]!==U||e[92]!==D||e[93]!==Q||e[94]!==ne?(oe=o.jsxs("form",{onSubmit:P,className:"space-y-5",children:[K,U,D,Q,ne]}),e[89]=P,e[90]=K,e[91]=U,e[92]=D,e[93]=Q,e[94]=ne,e[95]=oe):oe=e[95],oe}function Vn(){const n=G.c(2);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0];let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-3 sm:h-full sm:flex-col sm:items-stretch sm:p-4",children:[e,o.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[o.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),o.jsx("div",{className:"hidden h-3 w-full animate-pulse rounded bg-muted/60 sm:block"})]}),o.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),n[1]=t):t=n[1],t}function Ve(n){const e=G.c(17),{title:t,disconnecting:s,disabled:i,onDisconnect:c}=n,r=te(),l=i||s;let u;e[0]!==r||e[1]!==t?(u=r("commerceOnboarding.companionCard.disconnectAriaLabel",{title:t}),e[0]=r,e[1]=t,e[2]=u):u=e[2];let p;e[3]!==s?(p=s?o.jsx(Re,{size:16,className:"animate-spin"}):o.jsx(Rt,{size:16}),e[3]=s,e[4]=p):p=e[4];let d;e[5]!==c||e[6]!==l||e[7]!==u||e[8]!==p?(d=o.jsx(Ae,{asChild:!0,children:o.jsx(Z,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground hover:text-destructive",disabled:l,onClick:c,"aria-label":u,children:p})}),e[5]=c,e[6]=l,e[7]=u,e[8]=p,e[9]=d):d=e[9];let a;e[10]!==r?(a=r("commerceOnboarding.companionCard.disconnect"),e[10]=r,e[11]=a):a=e[11];let f;e[12]!==a?(f=o.jsx(De,{children:a}),e[12]=a,e[13]=f):f=e[13];let m;return e[14]!==d||e[15]!==f?(m=o.jsxs(Ke,{children:[d,f]}),e[14]=d,e[15]=f,e[16]=m):m=e[16],m}function Hn(n){const e=G.c(23),{card:t,connecting:s,disconnecting:i,disabled:c,onConnect:r,onDisconnect:l,org:u,selfClient:p,siteUrl:d,autoOpenConfigFieldKey:a,onAutoOpenConfigHandled:f}=n,m=t.linkedConnectionId,y=ut[t.bindingType],x=!!y&&t.boundVia!=="oauth",h=t.satisfied&&!t.configured;let b;e[0]!==a||e[1]!==t||e[2]!==s||e[3]!==c||e[4]!==i||e[5]!==m||e[6]!==h||e[7]!==f||e[8]!==r||e[9]!==l||e[10]!==u||e[11]!==y||e[12]!==p||e[13]!==d||e[14]!==x?(b=x&&y?o.jsx(Gn,{card:t,provider:y,org:u,selfClient:p,siteUrl:d,onOAuthInstead:r,disabled:c,connecting:s,primary:t.required}):t.satisfied&&m?h?o.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[o.jsx(H.Suspense,{fallback:o.jsx(He,{}),children:o.jsx(Ge,{card:t,org:u,selfClient:p,connectionId:m,contextSiteUrl:d,variant:"configure",disabled:c,autoOpen:ze({autoOpenFieldKey:a,card:t}),onAutoOpenHandled:f})}),o.jsx(Ve,{title:t.title,disconnecting:i,disabled:c,onDisconnect:l})]}):o.jsx(ct,{detail:t.connectedDetail,controls:o.jsxs(o.Fragment,{children:[o.jsx(H.Suspense,{fallback:o.jsx(He,{}),children:o.jsx(Ge,{card:t,org:u,selfClient:p,connectionId:m,contextSiteUrl:d,variant:"gear",disabled:c,autoOpen:ze({autoOpenFieldKey:a,card:t}),onAutoOpenHandled:f})}),o.jsx(Ve,{title:t.title,disconnecting:i,disabled:c,onDisconnect:l})]})}):o.jsx(at,{connecting:s,disabled:c,title:t.title,primary:t.required,onConnect:r}),e[0]=a,e[1]=t,e[2]=s,e[3]=c,e[4]=i,e[5]=m,e[6]=h,e[7]=f,e[8]=r,e[9]=l,e[10]=u,e[11]=y,e[12]=p,e[13]=d,e[14]=x,e[15]=b):b=e[15];const g=b,v=t.required&&!t.satisfied;let C;return e[16]!==g||e[17]!==t.headline||e[18]!==t.icon||e[19]!==t.title||e[20]!==h||e[21]!==v?(C=o.jsx(o.Fragment,{children:o.jsx(vn,{icon:t.icon,title:t.title,headline:t.headline,required:v,attention:h,action:g})}),e[16]=g,e[17]=t.headline,e[18]=t.icon,e[19]=t.title,e[20]=h,e[21]=v,e[22]=C):C=e[22],C}function Gn(n){const e=G.c(22),{card:t,provider:s,org:i,selfClient:c,siteUrl:r,onOAuthInstead:l,disabled:u,connecting:p,primary:d}=n,a=te(),[f,m]=H.useState(!1);let y;e[0]!==t.connectedDetail||e[1]!==t.satisfied||e[2]!==t.title||e[3]!==p||e[4]!==u||e[5]!==d||e[6]!==a?(y=t.satisfied?o.jsx(ct,{detail:t.connectedDetail,controls:o.jsxs(Ke,{children:[o.jsx(Ae,{asChild:!0,children:o.jsx(lt,{ariaLabel:a("commerceOnboarding.companionCard.configureAriaLabel",{title:t.title}),onClick:()=>m(!0)})}),o.jsx(De,{children:a("commerceOnboarding.companionCard.editConfiguration")})]})}):o.jsx(at,{connecting:p,disabled:u,title:t.title,primary:d,onConnect:()=>m(!0)}),e[0]=t.connectedDetail,e[1]=t.satisfied,e[2]=t.title,e[3]=p,e[4]=u,e[5]=d,e[6]=a,e[7]=y):y=e[7];let x;e[8]!==t.satisfied||e[9]!==l?(x=t.satisfied?void 0:()=>{m(!1),l()},e[8]=t.satisfied,e[9]=l,e[10]=x):x=e[10];let h;e[11]!==t||e[12]!==f||e[13]!==i||e[14]!==s||e[15]!==c||e[16]!==r||e[17]!==x?(h=o.jsx(Wn,{card:t,provider:s,org:i,selfClient:c,siteUrl:r,open:f,onOpenChange:m,onOAuthInstead:x}),e[11]=t,e[12]=f,e[13]=i,e[14]=s,e[15]=c,e[16]=r,e[17]=x,e[18]=h):h=e[18];let b;return e[19]!==y||e[20]!==h?(b=o.jsxs(o.Fragment,{children:[y,h]}),e[19]=y,e[20]=h,e[21]=b):b=e[21],b}function Wn(n){const e=G.c(31),{card:t,provider:s,org:i,selfClient:c,siteUrl:r,open:l,onOpenChange:u,onOAuthInstead:p}=n,[d,a]=H.useState(!1);let f;e[0]!==u||e[1]!==d?(f=_=>{!_&&d||u(_)},e[0]=u,e[1]=d,e[2]=f):f=e[2];const m=f;let y;e[3]!==t.icon||e[4]!==t.title?(y=o.jsx(Le,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1"}),e[3]=t.icon,e[4]=t.title,e[5]=y):y=e[5];let x;e[6]!==t.title?(x=o.jsx(Ze,{className:"min-w-0 flex-1",children:t.title}),e[6]=t.title,e[7]=x):x=e[7];let h;e[8]!==y||e[9]!==x?(h=o.jsxs(Xe,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[y,x]}),e[8]=y,e[9]=x,e[10]=h):h=e[10];let b;e[11]!==r?(b=tn(r),e[11]=r,e[12]=b):b=e[12];const g=t.boundResource??void 0;let v;e[13]!==u?(v=()=>u(!1),e[13]=u,e[14]=v):v=e[14];let C;e[15]!==p||e[16]!==i||e[17]!==s||e[18]!==c||e[19]!==r||e[20]!==b||e[21]!==g||e[22]!==v?(C=o.jsx(zn,{provider:s,siteUrl:r,siteHost:b,selfClient:c,org:i,initialResourceId:g,onDone:v,onIsPendingChange:a,onOAuthInstead:p}),e[15]=p,e[16]=i,e[17]=s,e[18]=c,e[19]=r,e[20]=b,e[21]=g,e[22]=v,e[23]=C):C=e[23];let S;e[24]!==h||e[25]!==C?(S=o.jsxs(Je,{"aria-describedby":void 0,className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[h,C]}),e[24]=h,e[25]=C,e[26]=S):S=e[26];let j;return e[27]!==m||e[28]!==l||e[29]!==S?(j=o.jsx(et,{open:l,onOpenChange:m,children:S}),e[27]=m,e[28]=l,e[29]=S,e[30]=j):j=e[30],j}function He(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),n[0]=e):e=n[0],e}function Ge(n){const e=G.c(25),{card:t,org:s,selfClient:i,connectionId:c,contextSiteUrl:r,variant:l,disabled:u,autoOpen:p,onAutoOpenHandled:d}=n,a=te(),[f,m]=H.useState(p);let y;e[0]!==t.configurationState||e[1]!==a?(y=gn(t.configurationState,a),e[0]=t.configurationState,e[1]=a,e[2]=y):y=e[2];const x=y;let h;e[3]!==p||e[4]!==d?(h=()=>{m(!1),p&&d()},e[3]=p,e[4]=d,e[5]=h):h=e[5];const b=h;if(!dt[t.bindingType])return null;let g;e[6]!==t.title||e[7]!==u||e[8]!==x||e[9]!==a||e[10]!==l?(g=l==="configure"?o.jsx(On,{disabled:u,title:t.title,onConfigure:()=>m(!0)}):o.jsxs(Ke,{children:[o.jsx(Ae,{asChild:!0,children:o.jsx(lt,{ariaLabel:a("commerceOnboarding.companionCard.configureAriaLabel",{title:t.title}),onClick:()=>m(!0)})}),o.jsx(De,{children:x.length>0?a("commerceOnboarding.companionCard.editConfiguration"):a("commerceOnboarding.companionCard.configure")})]}),e[6]=t.title,e[7]=u,e[8]=x,e[9]=a,e[10]=l,e[11]=g):g=e[11];const v=g;let C;e[12]!==b?(C=_=>_?m(!0):b(),e[12]=b,e[13]=C):C=e[13];let S;e[14]!==t||e[15]!==c||e[16]!==r||e[17]!==f||e[18]!==s||e[19]!==i||e[20]!==C?(S=o.jsx(Yn,{card:t,org:s,selfClient:i,connectionId:c,contextSiteUrl:r,open:f,onOpenChange:C}),e[14]=t,e[15]=c,e[16]=r,e[17]=f,e[18]=s,e[19]=i,e[20]=C,e[21]=S):S=e[21];let j;return e[22]!==S||e[23]!==v?(j=o.jsxs(o.Fragment,{children:[v,S]}),e[22]=S,e[23]=v,e[24]=j):j=e[24],j}function Yn(n){const e=G.c(59),{card:t,org:s,selfClient:i,connectionId:c,contextSiteUrl:r,open:l,onOpenChange:u}=n,p=te();let d;e[0]!==c||e[1]!==s.id||e[2]!==s.slug?(d={connectionId:c,orgId:s.id,orgSlug:s.slug},e[0]=c,e[1]=s.id,e[2]=s.slug,e[3]=d):d=e[3];const a=Fe(d),[f,m]=H.useState(!1),y=ye(),x=dt[t.bindingType];let h;e[4]!==c||e[5]!==i?(h=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:c,force:!0}})},e[4]=c,e[5]=i,e[6]=h):h=e[6];let b;e[7]!==t.title||e[8]!==u||e[9]!==s.id||e[10]!==y||e[11]!==p?(b=async()=>{await y.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(s.id)}),_e.success(p("commerceOnboarding.companionCard.disconnectedSuccess",{title:t.title})),u(!1)},e[7]=t.title,e[8]=u,e[9]=s.id,e[10]=y,e[11]=p,e[12]=b):b=e[12];let g;e[13]!==p?(g=()=>{_e.error(p("commerceOnboarding.companionCard.disconnectError"))},e[13]=p,e[14]=g):g=e[14];let v;e[15]!==h||e[16]!==b||e[17]!==g?(v={mutationFn:h,onSuccess:b,onError:g},e[15]=h,e[16]=b,e[17]=g,e[18]=v):v=e[18];const C=Te(v);if(!x)return null;let S;e[19]!==f||e[20]!==u?(S=A=>{!A&&f||u(A)},e[19]=f,e[20]=u,e[21]=S):S=e[21];const j=S;let _;e[22]!==t.icon||e[23]!==t.title?(_=o.jsx(Le,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1"}),e[22]=t.icon,e[23]=t.title,e[24]=_):_=e[24];let O;e[25]!==t.title?(O=o.jsx(Ze,{children:t.title}),e[25]=t.title,e[26]=O):O=e[26];let w;e[27]!==t.title||e[28]!==p?(w=p("commerceOnboarding.companionCard.configureDescription",{title:t.title}),e[27]=t.title,e[28]=p,e[29]=w):w=e[29];let E;e[30]!==w?(E=o.jsx(kt,{children:w}),e[30]=w,e[31]=E):E=e[31];let N;e[32]!==E||e[33]!==O?(N=o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[O,E]}),e[32]=E,e[33]=O,e[34]=N):N=e[34];let k;e[35]!==N||e[36]!==_?(k=o.jsxs(Xe,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[_,N]}),e[35]=N,e[36]=_,e[37]=k):k=e[37];let I;e[38]!==u?(I=()=>u(!1),e[38]=u,e[39]=I):I=e[39];let F;e[40]!==C?(F=()=>C.mutate(),e[40]=C,e[41]=F):F=e[41];let P;e[42]!==x||e[43]!==t||e[44]!==a||e[45]!==c||e[46]!==r||e[47]!==s||e[48]!==i||e[49]!==I||e[50]!==F?(P=o.jsx(x,{card:t,connectionId:c,companionClient:a,selfClient:i,org:s,contextSiteUrl:r,onDone:I,onDisconnect:F,onIsPendingChange:m}),e[42]=x,e[43]=t,e[44]=a,e[45]=c,e[46]=r,e[47]=s,e[48]=i,e[49]=I,e[50]=F,e[51]=P):P=e[51];let T;e[52]!==k||e[53]!==P?(T=o.jsxs(Je,{className:"sm:max-w-lg",children:[k,P]}),e[52]=k,e[53]=P,e[54]=T):T=e[54];let L;return e[55]!==j||e[56]!==l||e[57]!==T?(L=o.jsx(et,{open:l,onOpenChange:j,children:T}),e[55]=j,e[56]=l,e[57]=T,e[58]=L):L=e[58],L}const Ue={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},shopify:{registryAppId:"deco/shopify",area:"Catálogo",headline:"Pedidos, estoque e catálogo direto da sua Shopify."},"google-analytics":{registryAppId:"deco/google-analytics",area:"Funil",headline:"Onde a receita vaza no seu funil."},"google-search-console":{registryAppId:"deco/google-search-console",area:"Busca",headline:"O tráfego de busca que você deixa na mesa."},github:{registryAppId:"deco/mcp-github",area:"Engenharia",headline:"A saúde da entrega de código por trás da sua loja."}};function Zn(n){const e=G.c(44),{selfClient:t,org:s,cdConnectionId:i,siteUrl:c}=n;let r;e[0]!==i||e[1]!==s.id||e[2]!==s.slug?(r={connectionId:i,orgId:s.id,orgSlug:s.slug},e[0]=i,e[1]=s.id,e[2]=s.slug,e[3]=r):r=e[3];const l=Fe(r);let u;e[4]!==i||e[5]!==s.id?(u=X.commerceDiscoveryCompanionSchema(s.id,i),e[4]=i,e[5]=s.id,e[6]=u):u=e[6];let p;e[7]!==l?(p=async()=>{const V=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(V)},e[7]=l,e[8]=p):p=e[8];let d;e[9]!==u||e[10]!==p?(d={queryKey:u,queryFn:p,retry:!1},e[9]=u,e[10]=p,e[11]=d):d=e[11];const a=be(d),f=a.data?.stateSchema?an(a.data.stateSchema):null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},e[12]=m):m=e[12];const{shopify:y}=_t(m);let x;e[13]!==y?(x=V=>V.bindingType!=="shopify"||y!=null,e[13]=y,e[14]=x):x=e[14];const h=(f&&f.length>0?f:cn).filter(x),b=h.map(ao),g=h.map(ro).filter(io),v=h.filter(so).map(oo),C=[...g,...v].sort().join(",");let S;e[15]!==i||e[16]!==s.id?(S=X.commerceDiscoveryConnection(s.id,i),e[15]=i,e[16]=s.id,e[17]=S):S=e[17];let j;e[18]!==i||e[19]!==t?(j=async()=>{const V=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ee(V)},e[18]=i,e[19]=t,e[20]=j):j=e[20];let _;e[21]!==S||e[22]!==j?(_={queryKey:S,queryFn:j},e[21]=S,e[22]=j,e[23]=_):_=e[23];const w=je(_).data?.item?.configuration_state??null;let E;e[24]!==w?(E=V=>w?.[V.fieldKey]?.value,e[24]=w,e[25]=E):E=e[25];const N=h.map(E).filter(no),k=[...b.map(to),...g.map(eo),...N.map(Jn)].sort().join(","),F=je({queryKey:X.commerceDiscoveryCompanionConnections(s.id,k),queryFn:async()=>{if(h.length===0)return{items:[]};const V=[{field:["app_name"],operator:"in",value:b},{field:["app_id"],operator:"in",value:g}];N.length>0&&V.push({field:["id"],operator:"in",value:N});const se=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:V},limit:1e3}});return ee(se)}}).data?.items??[],P=new Set(N),T=F.filter(V=>P.has(V.id)),L=T.filter(Xn);let A;e[26]!==s.id||e[27]!==s.slug?(A=V=>({queryKey:X.commerceDiscoveryCompanionOAuthStatus(s.id,V.id),queryFn:async()=>{try{const se=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(V.id)}/oauth-token/status`,{credentials:"include"});return se.ok?{hasToken:(await se.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[26]=s.id,e[27]=s.slug,e[28]=A):A=e[28];const q=Yt({queries:L.map(A)});let B;e[29]!==q?(B=(V,se)=>[V.id,q[se]?.data?.hasToken===!0],e[29]=q,e[30]=B):B=e[30];const M=new Map(L.map(B)),K={};for(const V of T)K[V.id]=!V.oauth_config||!!V.connection_token||M.get(V.id)===!0;const U=je({queryKey:X.commerceDiscoveryCompanionRegistry(s.id,C),queryFn:async()=>{if(h.length===0)return{items:[]};const V=ln(g,v),se=await Lt(Ye.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...V?{where:V}:{},limit:1e3});return ee(se)}}),D={},Q={};for(const V of U.data?.items??[])D[V.id]=V,V.server?.name&&(Q[V.server.name]=V);let $;e[31]!==s.id||e[32]!==c?($=X.commerceDiscoveryConnectionStatus(s.id,c??""),e[31]=s.id,e[32]=c,e[33]=$):$=e[33];const Y=!!c;let R;e[34]!==t||e[35]!==c?(R=async()=>{const V=await t.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:c}});return ee(V)},e[34]=t,e[35]=c,e[36]=R):R=e[36];let z;e[37]!==$||e[38]!==Y||e[39]!==R?(z={queryKey:$,enabled:Y,queryFn:R},e[37]=$,e[38]=Y,e[39]=R,e[40]=z):z=e[40];const ne=be(z),oe={};for(const[V,se]of Object.entries(ut)){const Se=ne.data?.providers?.[se];Se?.connected&&Se.via==="sa"&&(oe[V]={resource:Se.resource??null})}const W=!!c&&(ne.isError||ne.data?.claimed===!1),J=yn({requirements:h,itemsById:D,itemsByName:Q,connections:F,connectionReadiness:K,configurationState:w,curated:Ue,saBindings:oe});let de;return e[41]!==J||e[42]!==W?(de={cards:J,saStatusUnavailable:W},e[41]=J,e[42]=W,e[43]=de):de=e[43],de}function Xn(n){return n.oauth_config&&!n.connection_token}function Jn(n){return`linked:${n}`}function eo(n){return`app:${n}`}function to(n){return`binding:${n}`}function no(n){return typeof n=="string"&&n.length>0}function oo(n){return n.bindingType}function so(n){return!Ue[n.bindingType]}function io(n){return!!n}function ro(n){return Ue[n.bindingType]?.registryAppId}function ao(n){return n.bindingType}function Bo(n){const e=G.c(9),{selfClient:t,org:s,cdConnectionId:i}=n;let c;e[0]!==i||e[1]!==s.id?(c=X.commerceDiscoveryConnection(s.id,i),e[0]=i,e[1]=s.id,e[2]=c):c=e[2];let r;e[3]!==i||e[4]!==t?(r=async()=>{const d=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ee(d)},e[3]=i,e[4]=t,e[5]=r):r=e[5];let l;e[6]!==c||e[7]!==r?(l={queryKey:c,queryFn:r,retry:!1},e[6]=c,e[7]=r,e[8]=l):l=e[8];const p=je(l).data.item?.metadata?.siteUrl;return typeof p=="string"?p:void 0}function co({selfClient:n,org:e,userId:t,cdConnectionId:s,domain:i,siteUrl:c}){const r=ye(),[l,u]=H.useState(null),[p,d]=H.useState(null),[a,f]=H.useState(null),m=async(h,b)=>{const g=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:h,data:b}});return ee(g)};async function y(h){u(h.fieldKey),f(null);const b={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:i,site_url:c};ue("commerce_onboarding_companion_connect_clicked",b);try{let g=h.candidateConnectionId;if(!g){const O=Kt(h.registryItem,e.id,t,{remoteIndex:0}),w=O.connection_type==="STDIO",E=!!O.connection_url,N=w&&O.connection_headers&&typeof O.connection_headers=="object"&&"command"in O.connection_headers;if(!E&&!N)return ue("commerce_onboarding_companion_connect_failed",{...b,error:"no_connection_method"}),f(`${h.title} cannot be connected: no connection method available`),!1;const k=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:O}});g=ee(k).item.id}const v=g,C=await Vt({connectionId:v,orgId:e.id,orgSlug:e.slug,persistFallback:O=>m(v,{connection_token:O}).then(()=>{})});if(!C.ok)return ue("commerce_onboarding_companion_connect_failed",{...b,error:C.error}),f(`Couldn't sign in to ${h.title}: ${C.error}`),!1;const S=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),j=ee(S).item?.configuration_state??null,_=dn(j,h.fieldKey,h.bindingType,v);return h.bindingType==="github"&&delete _.github_repo,await m(s,{configuration_state:_}),await r.invalidateQueries({queryKey:X.commerceDiscoveryConnection(e.id,s)}),await r.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ue("commerce_onboarding_companion_connected",b),!0}catch(g){return ue("commerce_onboarding_companion_connect_failed",{...b,error:g instanceof Error?g.message:String(g)}),f(g instanceof Error?g.message:String(g)),!1}finally{u(null)}}async function x(h){d(h.fieldKey),f(null);const b={app_name:h.title,field_key:h.fieldKey,organization_id:e.id,domain:i,site_url:c};ue("commerce_onboarding_companion_disconnect_clicked",b);try{const g=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),C={...ee(g).item?.configuration_state??null??{}};return delete C[h.fieldKey],h.bindingType==="github"&&delete C.github_repo,await m(s,{configuration_state:C}),await r.invalidateQueries({queryKey:X.commerceDiscoveryConnection(e.id,s)}),await r.invalidateQueries({queryKey:X.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ue("commerce_onboarding_companion_disconnected",b),!0}catch(g){return ue("commerce_onboarding_companion_disconnect_failed",{...b,error:g instanceof Error?g.message:String(g)}),f(g instanceof Error?g.message:String(g)),!1}finally{d(null)}}return{connect:y,connectingFieldKey:l,disconnect:x,disconnectingFieldKey:p,error:a}}const qe="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-6";function $e(){const n=G.c(4),e=te();let t;n[0]!==e?(t=e("routes.commerceOnboarding.companionSection.title"),n[0]=e,n[1]=t):t=n[1];let s;return n[2]!==t?(s=o.jsx("h1",{className:"text-lg font-medium leading-6 text-foreground lg:text-xl lg:leading-7",children:t}),n[2]=t,n[3]=s):s=n[3],s}function lo(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex flex-col gap-4",children:[0,1,2,3].map(uo)}),n[0]=e):e=n[0],e}function uo(n){return o.jsx(Vn,{},n)}function mo(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsxs("div",{className:qe,children:[o.jsx($e,{}),o.jsx(lo,{})]}),n[0]=e):e=n[0],e}function fo(n){const e=G.c(18),{onRetry:t}=n,s=te();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx($e,{}),e[0]=i):i=e[0];let c;e[1]!==s?(c=s("routes.commerceOnboarding.companionSection.loadError"),e[1]=s,e[2]=c):c=e[2];let r;e[3]!==c?(r=o.jsx("p",{className:"text-sm text-foreground",children:c}),e[3]=c,e[4]=r):r=e[4];let l;e[5]!==s?(l=s("routes.commerceOnboarding.companionSection.loadErrorDescription"),e[5]=s,e[6]=l):l=e[6];let u;e[7]!==l?(u=o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:l}),e[7]=l,e[8]=u):u=e[8];let p;e[9]!==s?(p=s("routes.commerceOnboarding.companionSection.retry"),e[9]=s,e[10]=p):p=e[10];let d;e[11]!==t||e[12]!==p?(d=o.jsx(Z,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:t,children:p}),e[11]=t,e[12]=p,e[13]=d):d=e[13];let a;return e[14]!==r||e[15]!==u||e[16]!==d?(a=o.jsxs("div",{className:qe,children:[i,o.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[r,u,d]})]}),e[14]=r,e[15]=u,e[16]=d,e[17]=a):a=e[17],a}function Uo(n){const e=G.c(2);let t;return e[0]!==n?(t=o.jsx(Nt,{children:s=>{const{reset:i}=s;return o.jsx(Tt,{fallback:c=>{const{resetError:r}=c;return o.jsx(fo,{onRetry:()=>{i(),r()}})},children:o.jsx(H.Suspense,{fallback:o.jsx(mo,{}),children:o.jsx(go,{...n})})})}}),e[0]=n,e[1]=t):t=e[1],t}function go(n){const e=G.c(60),{org:t,cdConnectionId:s,siteUrl:i,onReadinessChange:c}=n,r=te(),{data:l}=Et.useSession(),u=l?.user?.id??"";let p;if(e[0]!==i){const M=i?Ne(i):null;if(M?.ok)try{p=new URL(M.value).hostname}catch{p=void 0}e[0]=i,e[1]=p}else p=e[1];let d;e[2]!==t.id||e[3]!==t.slug?(d={connectionId:It,orgId:t.id,orgSlug:t.slug},e[2]=t.id,e[3]=t.slug,e[4]=d):d=e[4];const a=Fe(d);let f;e[5]!==s||e[6]!==t||e[7]!==a||e[8]!==i?(f={selfClient:a,org:t,cdConnectionId:s,siteUrl:i},e[5]=s,e[6]=t,e[7]=a,e[8]=i,e[9]=f):f=e[9];const{cards:m,saStatusUnavailable:y}=Zn(f);let x;e[10]!==s||e[11]!==t||e[12]!==a||e[13]!==p||e[14]!==i||e[15]!==u?(x={selfClient:a,org:t,userId:u,cdConnectionId:s,domain:p,siteUrl:i},e[10]=s,e[11]=t,e[12]=a,e[13]=p,e[14]=i,e[15]=u,e[16]=x):x=e[16];const{connect:h,connectingFieldKey:b,disconnect:g,disconnectingFieldKey:v,error:C}=co(x),[S,j]=H.useState(null),_=bo;let O,w,E,N,k,I,F,P,T,L;if(e[17]!==S||e[18]!==m||e[19]!==h||e[20]!==C||e[21]!==b||e[22]!==g||e[23]!==v||e[24]!==c||e[25]!==t||e[26]!==y||e[27]!==a||e[28]!==i||e[29]!==r){N=Symbol.for("react.early_return_sentinel");e:{const M=m.filter(ho),K=m.filter(po),U=y||(M.length>0?M.every(_):m.length===0||m.some(_));if(c?.(U),m.length===0){N=null;break e}const D=b!==null||v!==null,Q=$=>{const Y=async()=>{await h($)&&j($.fieldKey)};return o.jsx(Hn,{card:$,connecting:b===$.fieldKey,disconnecting:v===$.fieldKey,disabled:D&&b!==$.fieldKey&&v!==$.fieldKey,org:t,selfClient:a,siteUrl:i,autoOpenConfigFieldKey:S,onAutoOpenConfigHandled:()=>j(R=>R===$.fieldKey?null:R),onConnect:()=>{Y()},onDisconnect:()=>{g($)}},$.fieldKey)};w=qe,e[40]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx($e,{}),e[40]=E):E=e[40],O=nn,F="flex min-h-0 flex-1 flex-col md:block",P="-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",e[41]!==C?(T=C&&o.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:C}),e[41]=C,e[42]=T):T=e[42],e[43]!==y||e[44]!==r?(L=y&&o.jsx("p",{role:"status",className:"mb-3 rounded-lg border border-warning/40 bg-warning/10 p-3 text-sm text-foreground",children:r("routes.commerceOnboarding.companionSection.statusUnavailable")}),e[43]=y,e[44]=r,e[45]=L):L=e[45],k="flex flex-col gap-4 pt-3",I=[...M,...K].map(Q)}e[17]=S,e[18]=m,e[19]=h,e[20]=C,e[21]=b,e[22]=g,e[23]=v,e[24]=c,e[25]=t,e[26]=y,e[27]=a,e[28]=i,e[29]=r,e[30]=O,e[31]=w,e[32]=E,e[33]=N,e[34]=k,e[35]=I,e[36]=F,e[37]=P,e[38]=T,e[39]=L}else O=e[30],w=e[31],E=e[32],N=e[33],k=e[34],I=e[35],F=e[36],P=e[37],T=e[38],L=e[39];if(N!==Symbol.for("react.early_return_sentinel"))return N;let A;e[46]!==k||e[47]!==I?(A=o.jsx("div",{className:k,children:I}),e[46]=k,e[47]=I,e[48]=A):A=e[48];let q;e[49]!==O||e[50]!==A||e[51]!==F||e[52]!==P||e[53]!==T||e[54]!==L?(q=o.jsxs(O,{wrapperClassName:F,className:P,children:[T,L,A]}),e[49]=O,e[50]=A,e[51]=F,e[52]=P,e[53]=T,e[54]=L,e[55]=q):q=e[55];let B;return e[56]!==w||e[57]!==E||e[58]!==q?(B=o.jsxs("div",{className:w,children:[E,q]}),e[56]=w,e[57]=E,e[58]=q,e[59]=B):B=e[59],B}function po(n){return!n.required}function ho(n){return n.required}function bo(n){return n.satisfied&&n.configured}function yo(n){return n.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function qo(n){const e=n;if(e.isError)throw new Error(yo(e));return e.structuredContent??n}export{mo as C,Be as L,ut as P,nn as S,Uo as a,Wt as b,Bo as c,Zn as d,co as e,Yn as f,Wn as g,Po as i,Ne as n,qo as p,tn as s,ee as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BXgtH3-2.js","assets/index-D7ruAD9R.js","assets/index-DXMTUPM-.css","assets/Tool02-Dop27LUm.js","assets/CheckCircle-Dag22p3m.js","assets/Settings02-DwsCOelc.js","assets/use-mcp-client-B5b37aiu.js","assets/auth-CgC0zRiu.js","assets/useInfiniteQuery-ueeYN8M9.js","assets/use-infinite-scroll-CGISYIMq.js","assets/studio-tools-43YF_K-Q.js","assets/badge-7TN3Wktg.js","assets/input-BywtKe6R.js","assets/dropdown-menu-BlydGYwg.js","assets/Check-jVlurWFp.js","assets/ChevronRight-CPHsfQo3.js","assets/DotsVertical-BGG3Ho_u.js","assets/table-DPk5SmMs.js","assets/toggle-group-BaXRwZme.js","assets/use-view-mode-a2V8IUPD.js","assets/use-mobile-CT3yU0Mk.js","assets/FilterLines-CYIS3PyF.js","assets/Globe01-BMEBgVG2.js","assets/SearchMd-CUHSKZ0C.js","assets/dialog-BndOy54_.js","assets/X-JiAwzhaQ.js","assets/AlertCircle-B-VB_v8_.js","assets/Upload01-C9lBOcvL.js","assets/metadata-dUsYcpuu.js","assets/alert-dialog-CZcxNTn5.js","assets/card-DcOVhRdn.js","assets/Trash01-BjgXKgr6.js","assets/label-sPxTCHgi.js","assets/select-BpPnRSd-.js","assets/tooltip-2La-f68Q.js","assets/ChevronDown-p_tbIzFd.js","assets/ChevronUp-vuWH7gGr.js","assets/switch-COa2pVfk.js","assets/textarea-BJCjQSy4.js","assets/ArrowLeft-KvTc6rGE.js","assets/XCircle-BAmgho8b.js","assets/checkbox-tzeh-qrP.js","assets/Eye-Dn-joolw.js","assets/LinkExternal01-SB0_tkSE.js","assets/use-copy-DEnQ3bpL.js","assets/Copy01-C_8GUzyJ.js","assets/Key01-CH_IVG_t.js","assets/Plus-DChWoRcZ.js","assets/mcp-oauth-CNM-bHuQ.js","assets/Play-BO_bz8z5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as m,d as n,f as c,j as t,k as f,r as l,aG as p}from"./index-D7ruAD9R.js";import{R as u}from"./require-capability-BTVUJu40.js";import"./use-capability-DxrcT9AW.js";import"./access-gate-So3U0BEa.js";import"./capability-load-error-CKYF121O.js";const g=l.lazy(()=>p(()=>import("./registry-layout-BXgtH3-2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as M,b as B,j as t,y as Ut,B as te,Z as qt,$ as Kt,a2 as ht,a1 as pt,e as Gt,a as ae,r as H,aR as Xt,d as st,s as Qt,m as X,t as U,w as Wt,k as ke,p as R,F as oe,f as ot,u as it,L as Yt,D as Jt,I as Zt,G as en,K as at,o as tn,n as nn}from"./index-D7ruAD9R.js";import{i as sn}from"./ChevronRight-CPHsfQo3.js";import{i as on}from"./X-JiAwzhaQ.js";import{aD as an,Q as ln,A as xt,g as rn,ae as cn}from"./agent-icon-BypwlSQB.js";import{t as jt}from"./ChevronDown-p_tbIzFd.js";import{T as Ce,a as ye,c as Se}from"./tooltip-2La-f68Q.js";import{u as bt,d as vt,c as Ct}from"./sidebar-XtHztjYp.js";import{a as lt,i as dn,f as un,S as mn,u as fn}from"./use-mcp-client-B5b37aiu.js";import{a as gn,u as hn}from"./use-virtual-mcp-D1c8M1hh.js";import{a as Le,b as yt,P as St}from"./popover-DMey_8nq.js";import{i as Ee}from"./Check-jVlurWFp.js";import{s as Ne}from"./Plus-DChWoRcZ.js";import{i as Nt}from"./SearchMd-CUHSKZ0C.js";import{s as wt}from"./XClose-DgBj6S8z.js";import{A as pn,a as xn,b as jn,c as bn,e as vn,f as Cn,g as yn}from"./alert-dialog-CZcxNTn5.js";import{d as W,F as nt,a as Y,e as J,b as Z,f as Sn,c as ee}from"./form-B913lxdw.js";import{I as ie}from"./input-BywtKe6R.js";import{S as Nn}from"./spinner-BDArA5p5.js";import{T as _t}from"./toolbar-WaysqEfz.js";import{S as wn}from"./skeleton-TYssXBL8.js";import{D as Dt,a as kt,b as At,c as _n,g as Dn,e as kn,f as An}from"./drawer-CG0exhDi.js";import{u as It}from"./use-mobile-CT3yU0Mk.js";import{a as In,G as zn}from"./github-repo-picker-IkpFrAa4.js";import{g as Tn,b as Pn,a as zt}from"./hooks-DSQPS7ZB.js";import{u as On,g as Mn,a as $n,b as Fn}from"./use-navigate-to-agent-DpmJRDSG.js";import{a as Bn,c as Tt}from"./agent-capabilities-cXfbMfjV.js";import{u as Pt}from"./shell-layout-U1XEcaQb.js";import{f as Ln}from"./reusable-new-chat-CouMjkYR.js";import{C as En}from"./collection-search-D9_uCTpl.js";import{g as Vn,a as Rn,b as Hn,e as Un}from"./extract-connection-data-BTdYO2Ie.js";import{u as Ot,a as Mt,g as qn,C as Ye}from"./connection-card-BXKTS1UY.js";import{e as $t,d as Ft,a as Bt,b as Lt,h as Kn,c as Gn}from"./dialog-BndOy54_.js";import{S as Xn,a as Qn,b as Wn,c as Yn,d as De}from"./select-BpPnRSd-.js";import{T as Jn}from"./textarea-BJCjQSy4.js";import{b as Et}from"./use-connection-DNjvpsXX.js";import{n as Be,i as Je}from"./Tool02-Dop27LUm.js";import{s as Ze}from"./Star01-CHCsqoaq.js";import{c as Zn,i as $e,a as ut,E as es,p as ts,b as ns,d as ss}from"./connection-form-helpers-ClipGuvp.js";import{a as et}from"./authenticate-and-persist-oauth-zBYZihEH.js";import{g as os}from"./connection-slug-eyAPH6o3.js";import{C as is}from"./collection-tabs-Cgws9vFl.js";import{u as mt}from"./use-infinite-scroll-CGISYIMq.js";import{B as Fe}from"./badge-7TN3Wktg.js";import{u as as}from"./useSuspenseInfiniteQuery-CLfnZXXY.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ls}from"./studio-tools-43YF_K-Q.js";import{u as rs}from"./use-ai-providers-kgciqmRs.js";const cs="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function ds(){const n=M.c(13),e=B();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let i;n[3]!==o?(i=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=i):i=n[4];let a;n[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("img",{src:cs,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=a):a=n[5];let l;n[6]!==e?(l=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=l):l=n[7];let c;n[8]!==l?(c=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[a,t.jsx("span",{className:"text-base font-medium",children:l})]}),n[8]=l,n[9]=c):c=n[9];let r;return n[10]!==i||n[11]!==c?(r=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,i,c]}),n[10]=i,n[11]=c,n[12]=r):r=n[12],r}function us(){const n=M.c(19),e=B();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:an,label:s},n[2]=s,n[3]=o):o=n[3];let i;n[4]!==e?(i=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=i):i=n[5];let a;n[6]!==i?(a={Icon:Ut,label:i},n[6]=i,n[7]=a):a=n[7];let l;n[8]!==e?(l=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=l):l=n[9];let c;n[10]!==l?(c={Icon:ln,label:l},n[10]=l,n[11]=c):c=n[11];let r;n[12]!==o||n[13]!==a||n[14]!==c?(r=[o,a,c],n[12]=o,n[13]=a,n[14]=c,n[15]=r):r=n[15];const u=r;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(ms)})]}),n[17]=u,n[18]=f):f=n[18],f}function ms(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function Xo(n){const e=M.c(22),{siteHost:s,footer:o,onClose:i,children:a}=n,l=B(),c=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let r;e[0]!==i||e[1]!==l?(r=i&&t.jsx("button",{type:"button",onClick:i,"aria-label":l("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(on,{size:18})}),e[0]=i,e[1]=l,e[2]=r):r=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==c||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(sn,{size:16,className:"shrink-0 text-foreground/25"}),c&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:c,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=c,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let h;e[10]!==o?(h=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=h):h=e[11];let C;e[12]!==a||e[13]!==d||e[14]!==h?(C=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,a,h]}),e[12]=a,e[13]=d,e[14]=h,e[15]=C):C=e[15];let p,g;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),g=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=p,e[17]=g):(p=e[16],g=e[17]);let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[p,g,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(ds,{}),t.jsx("div",{className:"flex-1"}),t.jsx(us,{})]})]}),e[18]=j):j=e[18];let b;return e[19]!==r||e[20]!==C?(b=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[r,C,j]}),e[19]=r,e[20]=C,e[21]=b):b=e[21],b}function Qo(n){const e=M.c(5),{ready:s,pending:o,label:i,onClick:a,children:l}=n,c=o||!s,r=s&&!o?l:null;let u;return e[0]!==i||e[1]!==a||e[2]!==c||e[3]!==r?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:a,disabled:c,children:[i,r]}),e[0]=i,e[1]=a,e[2]=c,e[3]=r,e[4]=u):u=e[4],u}function ft(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const fs=qt({name:Kt().min(2,"Organization name is required")});function gs(n){const e=M.c(66),{open:s,onOpenChange:o}=n,i=B();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={resolver:ht(fs),defaultValues:{name:""}},e[0]=a):a=e[0];const l=pt(a);let c;e[1]!==i?(c=async V=>{const $=ft(V.name);if(!$)throw new Error(i("common.createOrganizationDialog.invalidSlug"));const K=await ae.organization.create({name:V.name,slug:$});if(K?.error)throw new Error(K.error.message||i("common.createOrganizationDialog.failedToCreate"));const q=K?.data?.slug??$;if(!q)throw new Error(i("common.createOrganizationDialog.failedToCreate"));return{orgSlug:q}},e[1]=i,e[2]=c):c=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=hs,e[3]=r):r=e[3];let u;e[4]!==c?(u={mutationFn:c,onSuccess:r},e[4]=c,e[5]=u):u=e[5];const m=Gt(u);let f;e[6]!==m.error||e[7]!==i?(f=m.error instanceof Error?m.error.message:m.error?i("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=m.error,e[7]=i,e[8]=f):f=e[8];const d=f;let h;e[9]!==i?(h=i("common.createOrganizationDialog.title"),e[9]=i,e[10]=h):h=e[10];let C;e[11]!==h?(C=t.jsx(pn,{children:h}),e[11]=h,e[12]=C):C=e[12];let p;e[13]!==i?(p=i("common.createOrganizationDialog.description"),e[13]=i,e[14]=p):p=e[14];let g;e[15]!==p?(g=t.jsx(xn,{children:p}),e[15]=p,e[16]=g):g=e[16];let j;e[17]!==C||e[18]!==g?(j=t.jsxs(jn,{children:[C,g]}),e[17]=C,e[18]=g,e[19]=j):j=e[19];let b;if(e[20]!==m||e[21]!==l){let V;e[23]!==m?(V=$=>m.mutateAsync($),e[23]=m,e[24]=V):V=e[24],b=l.handleSubmit(V),e[20]=m,e[21]=l,e[22]=b}else b=e[22];let v;e[25]!==l.formState.isSubmitting||e[26]!==i?(v=V=>{const{field:$}=V;return t.jsxs(Y,{children:[t.jsx(J,{children:i("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...$,placeholder:i("common.createOrganizationDialog.namePlaceholder"),disabled:l.formState.isSubmitting})}),t.jsx(Sn,{children:i("common.createOrganizationDialog.nameDescription")}),$.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[i("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ft($.value)]})]}),t.jsx(ee,{})]})},e[25]=l.formState.isSubmitting,e[26]=i,e[27]=v):v=e[27];let N;e[28]!==l.control||e[29]!==v?(N=t.jsx(W,{control:l.control,name:"name",render:v}),e[28]=l.control,e[29]=v,e[30]=N):N=e[30];let w;e[31]!==d?(w=d&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[31]=d,e[32]=w):w=e[32];const z=l.formState.isSubmitting;let P;e[33]!==m||e[34]!==l?(P=()=>{m.reset(),l.reset()},e[33]=m,e[34]=l,e[35]=P):P=e[35];let x;e[36]!==i?(x=i("common.createOrganizationDialog.cancel"),e[36]=i,e[37]=x):x=e[37];let _;e[38]!==l.formState.isSubmitting||e[39]!==P||e[40]!==x?(_=t.jsx(bn,{disabled:z,onClick:P,children:x}),e[38]=l.formState.isSubmitting,e[39]=P,e[40]=x,e[41]=_):_=e[41];const T=!l.formState.isValid||l.formState.isSubmitting;let S;e[42]!==l.formState.isSubmitting||e[43]!==i?(S=l.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Nn,{size:"xs"})," ",i("common.createOrganizationDialog.creating")]}):i("common.createOrganizationDialog.createButton"),e[42]=l.formState.isSubmitting,e[43]=i,e[44]=S):S=e[44];let y;e[45]!==T||e[46]!==S?(y=t.jsx(te,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=y):y=e[47];let I;e[48]!==_||e[49]!==y?(I=t.jsxs(vn,{children:[_,y]}),e[48]=_,e[49]=y,e[50]=I):I=e[50];let k;e[51]!==b||e[52]!==N||e[53]!==w||e[54]!==I?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[N,w,I]}),e[51]=b,e[52]=N,e[53]=w,e[54]=I,e[55]=k):k=e[55];let A;e[56]!==l||e[57]!==k?(A=t.jsx(nt,{...l,children:k}),e[56]=l,e[57]=k,e[58]=A):A=e[58];let O;e[59]!==j||e[60]!==A?(O=t.jsxs(Cn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=O):O=e[61];let E;return e[62]!==o||e[63]!==s||e[64]!==O?(E=t.jsx(yn,{open:s,onOpenChange:o,children:O}),e[62]=o,e[63]=s,e[64]=O,e[65]=E):E=e[65],E}function hs(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(Xt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>s?.()}}function ps(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function rt(n){const e=M.c(13),{org:s,size:o}=n,i=o===void 0?"sm":o,a=i==="xs"?"size-5":"size-6",l=i==="xs"?"text-[9px]":"text-xs";let c;e[0]!==a?(c=X(a,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==s.logo||e[3]!==s.name?(r=s.logo?void 0:ps(s.name),e[2]=s.logo,e[3]=s.name,e[4]=r):r=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let m;return e[9]!==c||e[10]!==r||e[11]!==u?(m=t.jsx("div",{className:c,style:r,children:u}),e[9]=c,e[10]=r,e[11]=u,e[12]=m):m=e[12],m}function xs({invitation:n,onChanged:e}){const s=B(),[o,i]=H.useState(!1),a=n.organizationName??s("header.orgSwitcher.unknownOrganization"),l=async()=>{i(!0);try{const u=await ae.organization.acceptInvitation({invitationId:n.id});if(u.error){U.error(u.error.message),i(!1);return}}catch{U.error(s("header.orgSwitcher.failedToAcceptInvitation")),i(!1);return}U.success(s("header.orgSwitcher.joined",{name:a})),Wt();let r;try{r=(await ae.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=r?`/${r}`:"/"},c=async()=>{i(!0);try{const r=await ae.organization.rejectInvitation({invitationId:n.id});if(r.error){U.error(r.error.message),i(!1);return}U.success(s("header.orgSwitcher.invitationDeclined")),i(!1),e()}catch{U.error(s("header.orgSwitcher.failedToDeclineInvitation")),i(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(rt,{org:{name:a},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:a}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:l,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:a}),children:t.jsx(wt,{size:14})})]})]})}function js(n){const e=M.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:i}=n,a=B(),{data:l}=Qt(),{invitations:c,refetch:r}=Vt();let u;e[0]!==s?(u=(k,A)=>k.slug===s?-1:A.slug===s?1:k.name.localeCompare(A.name),e[0]=s,e[1]=u):u=e[1];const m=[...l??[]].sort(u),[f,d]=H.useState(""),h=f.toLowerCase(),C=h?m.filter(k=>k.name.toLowerCase().includes(h)||k.slug.toLowerCase().includes(h)):m;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Nt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=p):p=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>d(k.target.value),e[3]=g):g=e[3];let j;e[4]!==f?(j=k=>k.key==="Escape"&&f&&d(""),e[4]=f,e[5]=j):j=e[5];let b;e[6]!==a?(b=a("header.orgSwitcher.searchOrganizations"),e[6]=a,e[7]=b):b=e[7];let v;e[8]!==f||e[9]!==j||e[10]!==b?(v=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:g,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=j,e[10]=b,e[11]=v):v=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ne,{size:16}),e[12]=N):N=e[12];let w;e[13]!==i?(w=t.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:N}),e[13]=i,e[14]=w):w=e[14];let z;e[15]!==v||e[16]!==w?(z=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[p,v,w]}),e[15]=v,e[16]=w,e[17]=z):z=e[17];const P="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let x;e[18]!==c||e[19]!==f||e[20]!==r?(x=!f&&c.map(k=>t.jsx(xs,{invitation:k,onChanged:r},k.id)),e[18]=c,e[19]=f,e[20]=r,e[21]=x):x=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?a("header.orgSwitcher.noOrganizationsMatch",{query:f}):a("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==o||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>o(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(rt,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=o,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let y;e[25]!==x||e[26]!==_||e[27]!==S?(y=t.jsxs("div",{className:P,children:[x,_,S]}),e[25]=x,e[26]=_,e[27]=S,e[28]=y):y=e[28];let I;return e[29]!==y||e[30]!==z?(I=t.jsxs(t.Fragment,{children:[z,y]}),e[29]=y,e[30]=z,e[31]=I):I=e[31],I}function bs(n){const e=M.c(22),{trigger:s,orgParam:o,align:i,side:a}=n,l=i===void 0?"start":i,c=a===void 0?"bottom":a,r=st(),[u,m]=H.useState(!1),[f,d]=H.useState(!1);let h;e[0]!==s?(h=t.jsx(Le,{asChild:!0,children:s}),e[0]=s,e[1]=h):h=e[1];const C=String(u);let p;e[2]!==r?(p=z=>{m(!1),r({to:"/$org",params:{org:z}})},e[2]=r,e[3]=p):p=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),d(!0)},e[4]=g):g=e[4];let j;e[5]!==o||e[6]!==C||e[7]!==p?(j=t.jsx(js,{orgParam:o,onSelectOrg:p,onCreateOrg:g},C),e[5]=o,e[6]=C,e[7]=p,e[8]=j):j=e[8];let b;e[9]!==l||e[10]!==c||e[11]!==j?(b=t.jsx(yt,{side:c,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Cs,onCloseAutoFocus:vs,children:j}),e[9]=l,e[10]=c,e[11]=j,e[12]=b):b=e[12];let v;e[13]!==u||e[14]!==h||e[15]!==b?(v=t.jsxs(St,{open:u,onOpenChange:m,children:[h,b]}),e[13]=u,e[14]=h,e[15]=b,e[16]=v):v=e[16];let N;e[17]!==f?(N=t.jsx(gs,{open:f,onOpenChange:d}),e[17]=f,e[18]=N):N=e[18];let w;return e[19]!==N||e[20]!==v?(w=t.jsxs(t.Fragment,{children:[v,N]}),e[19]=N,e[20]=v,e[21]=w):w=e[21],w}function vs(n){return n.preventDefault()}function Cs(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ys(n){const e=M.c(21),{value:s,onChange:o,placeholder:i,onKeyDown:a,className:l,isSearching:c,disabled:r}=n,u=i===void 0?"Search...":i;let m;e[0]!==l?(m=X("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const f=r?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=X("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let h;e[4]!==c?(h=c?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(Nt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=h):h=e[5];let C;e[6]!==o?(C=b=>o(b.target.value),e[6]=o,e[7]=C):C=e[7];let p;e[8]!==r||e[9]!==a||e[10]!==u||e[11]!==C||e[12]!==s?(p=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:a,placeholder:u,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=r,e[9]=a,e[10]=u,e[11]=C,e[12]=s,e[13]=p):p=e[13];let g;e[14]!==d||e[15]!==h||e[16]!==p?(g=t.jsxs("label",{className:d,children:[h,p]}),e[14]=d,e[15]=h,e[16]=p,e[17]=g):g=e[17];let j;return e[18]!==m||e[19]!==g?(j=t.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=j):j=e[20],j}function Ss(n,e,s){if(!s)return null;const o=Tn(n,e);return o?o.threads.get().find(a=>a.id===s)?.branch??null:null}function Ns(n){const e=M.c(6),{value:s,onChange:o}=n,i=B();let a;e[0]!==i?(a=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=a):a=e[1];let l;return e[2]!==o||e[3]!==a||e[4]!==s?(l=t.jsx(ys,{value:s,onChange:o,placeholder:a}),e[2]=o,e[3]=a,e[4]=s,e[5]=l):l=e[5],l}function ws(){const n=M.c(4),e=B();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function _s(n){const e=M.c(10),{org:s,onClose:o}=n,i=B();let a;e[0]!==s.slug?(a={org:s.slug},e[0]=s.slug,e[1]=a):a=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==i?(c=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=c):c=e[5];let r;return e[6]!==a||e[7]!==l||e[8]!==c?(r=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Yt,{to:"/$org/settings/agents",params:a,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=a,e[7]=l,e[8]=c,e[9]=r):r=e[9],r}function Ds(){const n=M.c(4),e=B();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Rt,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function ks(n){const e=M.c(11),{onImportFromGithub:s}=n,o=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(zn,{className:"size-3.5"}),e[0]=i):i=e[0];let a;e[1]!==o?(a=o("sidebar.agentsSection.import"),e[1]=o,e[2]=a):a=e[2];let l;e[3]!==s||e[4]!==a?(l=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[i,a]}),e[3]=s,e[4]=a,e[5]=l):l=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let r;return e[8]!==l||e[9]!==c?(r=t.jsx(Rt,{action:l,children:c}),e[8]=l,e[9]=c,e[10]=r):r=e[10],r}function As(n){const e=M.c(11),{setOpen:s,emptyCtaClass:o}=n,i=B();let a;e[0]!==i?(a=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=a):a=e[1];let l;e[2]!==o?(l=X(o),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ne,{className:"size-4"}),e[6]=r):r=e[6];let u;return e[7]!==a||e[8]!==l||e[9]!==c?(u=t.jsx(_t,{"aria-label":a,className:l,onClick:c,children:r}),e[7]=a,e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function Is(n){const e=M.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:i}=n,a=B();let l;e[0]!==o||e[1]!==a?(l=o?void 0:a("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a,e[2]=l):l=e[2];let c;e[3]!==i?(c=X(i),e[3]=i,e[4]=c):c=e[4];let r;e[5]!==s?(r=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=r):r=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ne,{}),e[7]=u):u=e[7];let m;e[8]!==a?(m=a("sidebar.agentsSection.newAgent"),e[8]=a,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==l||e[13]!==c||e[14]!==r||e[15]!==f?(d=t.jsx(vt,{children:t.jsxs(Ct,{tooltip:l,className:c,onClick:r,children:[u,f]})}),e[12]=l,e[13]=c,e[14]=r,e[15]=f,e[16]=d):d=e[16],d}function zs(){const n=M.c(4),e=B();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ts(n){const e=M.c(8),{emptyCtaClass:s}=n,o=B();let i;e[0]!==o?(i=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s?(a=X(s),e[2]=s,e[3]=a):a=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ne,{className:"size-4"}),e[4]=l):l=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsx(_t,{"aria-label":i,className:a,children:l}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Ps(n){const e=M.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:i}=n,a=B();let l;e[0]!==o||e[1]!==a?(l=o?void 0:a("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a,e[2]=l):l=e[2];let c;e[3]!==i?(c=X(i),e[3]=i,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ne,{}),e[5]=r):r=e[5];let u;e[6]!==a?(u=a("sidebar.agentsSection.newAgent"),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==l||e[11]!==c||e[12]!==m?(f=t.jsx(Le,{asChild:!0,children:t.jsxs(Ct,{tooltip:l,className:c,children:[r,m]})}),e[10]=l,e[11]=c,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let h;return e[17]!==d?(h=t.jsx(vt,{children:d}),e[17]=d,e[18]=h):h=e[18],h}function Os(n){const e=M.c(9),{children:s}=n,o=B();let i;e[0]!==s?(i=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=a):a=e[3];let l;e[4]!==a?(l=t.jsx(ye,{side:"right",sideOffset:8,children:a}),e[4]=a,e[5]=l):l=e[5];let c;return e[6]!==i||e[7]!==l?(c=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[i,l]}),e[6]=i,e[7]=l,e[8]=c):c=e[8],c}function Ms(n){const e=st(),{create:s}=Pn(),{locator:o}=oe(),i=ot({strict:!1}),a=it({strict:!1});return async l=>{const c=crypto.randomUUID(),r=l===a.virtualmcpid?Ss(n,o,i.taskId??""):null;try{await s({id:c,virtual_mcp_id:l,...r?{branch:r}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:c},search:{virtualmcpid:l}})}}function tt(n){const e=M.c(20),{agent:s,selected:o,onClick:i}=n,a=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==a?(l=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",a),e[0]=a,e[1]=l):l=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(xt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let r;e[5]!==s.title?(r=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=r):r=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==r||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,u]}),e[9]=r,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==i||e[15]!==l||e[16]!==c||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:i,className:l,children:[c,m,f]}),e[14]=i,e[15]=l,e[16]=c,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Rt(n){const e=M.c(5),{children:s,action:o}=n;let i;e[0]!==s?(i=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==o||e[3]!==i?(a=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,o]}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}function $s(n){const e=M.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:i,onImportFromGithub:a}=n,[l,c]=H.useState(""),r=gn(),u=r??[],{org:m}=oe(),{data:f}=ae.useSession(),d=f?.user?.id??"anon",h=Mn(r),C=$n(),p=Ms(m.slug),g=Bn(r),j=l.toLowerCase(),b=u.filter(Es).filter(L=>!g.has(L.id)).filter(Ls).filter(L=>!l||L.title.toLowerCase().includes(j)),v=b.filter(Bs),N=b.filter(Fs),w=lt(m.id),z=!l||w.title.toLowerCase().includes(j),P=!!(o&&z);let x;e[0]!==s||e[1]!==o?(x=()=>{o?.(null),s(),c("")},e[0]=s,e[1]=o,e[2]=x):x=e[2];const _=x,T=L=>{if(o){o(L.id),s(),c("");return}Fn({orgId:m.id,userId:d},L.id,h),C(),s(),c(""),p(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==l?(y=t.jsx(Ns,{value:l,onChange:c}),e[3]=l,e[4]=y):y=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=o&&z&&w&&t.jsx(tt,{agent:w,selected:!i||i===w.id,onClick:_}),A=(v.length>0||!l)&&t.jsx(ks,{onImportFromGithub:a}),O=v.map(L=>t.jsx(tt,{agent:L,selected:o?i===L.id:void 0,onClick:()=>T(L)},L.id)),E=N.length>0&&t.jsx(Ds,{}),V=N.map(L=>t.jsx(tt,{agent:L,selected:o?i===L.id:void 0,onClick:()=>T(L)},L.id));let $;e[5]!==P||e[6]!==l||e[7]!==b.length?($=b.length===0&&!P&&l&&t.jsx(ws,{}),e[5]=P,e[6]=l,e[7]=b.length,e[8]=$):$=e[8];let K;e[9]!==$||e[10]!==k||e[11]!==A||e[12]!==O||e[13]!==E||e[14]!==V?(K=t.jsxs("div",{className:I,children:[k,A,O,E,V,$]}),e[9]=$,e[10]=k,e[11]=A,e[12]=O,e[13]=E,e[14]=V,e[15]=K):K=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(_s,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==K||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:S,children:[y,K,q]}),e[19]=K,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function Fs(n){return!Tt(n.metadata)}function Bs(n){return Tt(n.metadata)}function Ls(n){return!un(n.id)}function Es(n){return!dn(n.id)}function Vs(n){const e=M.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:i,onSelectAgent:a,selectedAgentId:l,side:c,align:r}=s,u=o===void 0?!1:o,m=c===void 0?"right":c,f=r===void 0?"start":r,[d,h]=H.useState(!1),[C,p]=H.useState(!1),g=It(),{setOpenMobile:j}=bt(),b=On(),v=b?"border border-border":void 0;let N;e[2]!==b?(N=A=>b?t.jsx(Os,{children:A}):A,e[2]=b,e[3]=N):N=e[3];const w=N;let z;e[4]!==g||e[5]!==j?(z=()=>{h(!1),g&&j(!1)},e[4]=g,e[5]=j,e[6]=z):z=e[6];const P=z;let x;e[7]!==P?(x=()=>{P(),p(!0)},e[7]=P,e[8]=x):x=e[8];const _=x;let T;e[9]!==P||e[10]!==_||e[11]!==a||e[12]!==d||e[13]!==l?(T=d&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(wn,{className:"h-4 w-24"})}),children:t.jsx($s,{onClose:P,onSelectAgent:a,selectedAgentId:l,onImportFromGithub:_})}),e[9]=P,e[10]=_,e[11]=a,e[12]=d,e[13]=l,e[14]=T):T=e[14];const S=T;let y;e[15]!==f||e[16]!==u||e[17]!==v||e[18]!==b||e[19]!==g||e[20]!==d||e[21]!==S||e[22]!==m||e[23]!==i||e[24]!==w?(y=g?t.jsxs(t.Fragment,{children:[i?t.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):u?w(t.jsx(As,{setOpen:h,emptyCtaClass:v})):t.jsx(Is,{setOpen:h,highlightEmpty:b,emptyCtaClass:v}),t.jsx(Dt,{open:d,onOpenChange:h,direction:"bottom",children:t.jsxs(kt,{className:"max-h-[85dvh] p-0",children:[t.jsx(zs,{}),S]})})]}):t.jsxs(St,{open:d,onOpenChange:A=>{A&&!d&&R("agent_browser_opened",{surface:"desktop_popover"}),h(A)},children:[i?t.jsx(Le,{asChild:!0,children:i}):u?w(t.jsx(Le,{asChild:!0,children:t.jsx(Ts,{emptyCtaClass:v})})):t.jsx(Ps,{wrapEmptyHint:w,highlightEmpty:b,emptyCtaClass:v}),t.jsx(yt,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:S})]}),e[15]=f,e[16]=u,e[17]=v,e[18]=b,e[19]=g,e[20]=d,e[21]=S,e[22]=m,e[23]=i,e[24]=w,e[25]=y):y=e[25];let I;e[26]!==C?(I=t.jsx(In,{open:C,onOpenChange:p,mode:"agent"}),e[26]=C,e[27]=I):I=e[27];let k;return e[28]!==I||e[29]!==y?(k=t.jsxs(t.Fragment,{children:[y,I]}),e[28]=I,e[29]=y,e[30]=k):k=e[30],k}const Rs="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Hs(n){const e=M.c(29),{agentId:s,fallback:o,onOpenHome:i,onPick:a}=n,l=B(),c=hn(s)??o??null;let r,u,m,f,d;e[0]!==c?.title||e[1]!==i||e[2]!==l?(d=c?.title??l("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",r="button",u=i,m=l("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=c?.title,e[1]=i,e[2]=l,e[3]=r,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(r=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const h=c?.icon??null;let C;e[8]!==h||e[9]!==d?(C=t.jsx(xt,{icon:h,name:d,size:"xs"}),e[8]=h,e[9]=d,e[10]=C):C=e[10];let p;e[11]!==r||e[12]!==u||e[13]!==m||e[14]!==C?(p=t.jsx("button",{type:r,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:C}),e[11]=r,e[12]=u,e[13]=m,e[14]=C,e[15]=p):p=e[15];let g;e[16]!==d?(g=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=g):g=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let b;e[19]!==g?(b=t.jsxs("button",{type:"button",className:Rs,children:[g,j]}),e[19]=g,e[20]=b):b=e[20];let v;e[21]!==s||e[22]!==a||e[23]!==b?(v=t.jsx(Vs,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:a,trigger:b}),e[21]=s,e[22]=a,e[23]=b,e[24]=v):v=e[24];let N;return e[25]!==v||e[26]!==f||e[27]!==p?(N=t.jsxs("div",{className:f,children:[p,v]}),e[25]=v,e[26]=f,e[27]=p,e[28]=N):N=e[28],N}function Wo(n){const e=M.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,i=B(),{org:a}=oe(),{state:l,isMobile:c}=bt(),r=Vt().invitations.length>0,u=l==="collapsed"||c;let m;e[2]!==r||e[3]!==a.name||e[4]!==i?(m=r?i("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:a.name}):i("header.shellBreadcrumb.switchOrganization",{name:a.name}),e[2]=r,e[3]=a.name,e[4]=i,e[5]=m):m=e[5];let f;e[6]!==a?(f=t.jsx(rt,{org:a,size:"sm"}),e[6]=a,e[7]=f):f=e[7];let d;e[8]!==r||e[9]!==u?(d=r&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=r,e[9]=u,e[10]=d):d=e[10];let h;e[11]!==f||e[12]!==d?(h=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=h):h=e[13];let C;e[14]!==a.name||e[15]!==o?(C=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:a.name}),e[14]=a.name,e[15]=o,e[16]=C):C=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=p):p=e[17];let g;e[18]!==m||e[19]!==h||e[20]!==C?(g=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[h,C,p]})}),e[18]=m,e[19]=h,e[20]=C,e[21]=g):g=e[21];let j;e[22]!==a.slug||e[23]!==g?(j=t.jsx(bs,{orgParam:a.slug,trigger:g}),e[22]=a.slug,e[23]=g,e[24]=j):j=e[24];let b;e[25]!==a.name?(b=t.jsx(ye,{side:"bottom",children:a.name}),e[25]=a.name,e[26]=b):b=e[26];let v;return e[27]!==b||e[28]!==j?(v=t.jsxs(Se,{children:[j,b]}),e[27]=b,e[28]=j,e[29]=v):v=e[29],v}function Yo(n){const e=M.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:i}=oe();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const l=ot(a);let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[3]=c):c=e[3];const r=it(c),{threads:u}=zt(),{data:m}=ae.useSession(),{setTaskId:f,createNewTask:d}=Pt();let h;e[4]!==i.id?(h=lt(i.id),e[4]=i.id,e[5]=h):h=e[5];const C=h,p=C.id,g=l.taskId?r.virtualmcpid??p:p;let j;e[6]!==d||e[7]!==p||e[8]!==o||e[9]!==m?.user?.id||e[10]!==f||e[11]!==u?(j=P=>{const x=P??p,_=Ln(u,x,m?.user?.id);_?f(_.id,x):d(x),o?.()},e[6]=d,e[7]=p,e[8]=o,e[9]=m?.user?.id,e[10]=f,e[11]=u,e[12]=j):j=e[12];const b=j;let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=v):v=e[13];const N=g===p?C:void 0;let w;e[14]!==g||e[15]!==b?(w=()=>b(g),e[14]=g,e[15]=b,e[16]=w):w=e[16];let z;return e[17]!==g||e[18]!==b||e[19]!==N||e[20]!==w?(z=t.jsx(H.Suspense,{fallback:v,children:t.jsx(Hs,{agentId:g,fallback:N,onOpenHome:w,onPick:b})}),e[17]=g,e[18]=b,e[19]=N,e[20]=w,e[21]=z):z=e[21],z}function Jo(){const n=M.c(24),e=B(),{org:s}=oe();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[0]=o):o=n[0];const i=ot(o);let a;n[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},n[1]=a):a=n[1];const l=it(a),{threads:c}=zt(),{createNewTask:r}=Pt();let u;n[2]!==s.id?(u=lt(s.id),n[2]=s.id,n[3]=u):u=n[3];const m=u.id,f=i.taskId?l.virtualmcpid??m:m;let d;n[4]!==i.taskId||n[5]!==c?(d=(i.taskId?c.find(z=>z.id===i.taskId)?.branch:null)??null,n[4]=i.taskId,n[5]=c,n[6]=d):d=n[6];const h=d;let C;n[7]!==f||n[8]!==r||n[9]!==h?(C=()=>{r(f,h)},n[7]=f,n[8]=r,n[9]=h,n[10]=C):C=n[10];const p=C;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(rn,{size:16}),n[13]=j):j=n[13];let b;n[14]!==p||n[15]!==g?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:p,"aria-label":g,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[14]=p,n[15]=g,n[16]=b):b=n[16];let v;n[17]!==e?(v=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=v):v=n[18];let N;n[19]!==v?(N=t.jsx(ye,{side:"bottom",children:v}),n[19]=v,n[20]=N):N=n[20];let w;return n[21]!==b||n[22]!==N?(w=t.jsxs(Se,{children:[b,N]}),n[21]=b,n[22]=N,n[23]=w):w=n[23],w}function Us({open:n,onOpenChange:e,onCreated:s}){const o=B(),{org:i}=oe(),{data:a}=ae.useSession(),{stdioEnabled:l}=Jt(),c=It(),r=Et(),u=Ot(),f=Mt(u,"").items,d=pt({resolver:ht(Zn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=d.watch("ui_type"),C=d.watch("connection_url"),p=d.watch("npx_package"),g=$e({uiType:h,connectionUrl:C??"",npxPackage:p??""})??ut({uiType:h,connectionUrl:C??"",registryItems:f}),j=x=>{const _=x.trim();if(!_)return;const T=!!d.formState.dirtyFields.title,S=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,I=A=>{if(A&&(!T&&!d.getValues("title").trim()&&A.title&&d.setValue("title",A.title,{shouldDirty:!1}),!S&&!(d.getValues("description")??"").trim()&&A.description&&d.setValue("description",A.description,{shouldDirty:!1}),!y&&A.envVarKeys?.length)){const O=d.getValues("env_vars")??[],E=new Set(O.map($=>$.key)),V=A.envVarKeys.filter($=>!E.has($));V.length>0&&d.setValue("env_vars",[...O,...V.map($=>({key:$,value:""}))],{shouldDirty:!0})}},k=ts(_);if(k&&l){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",k.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),I($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";d.setValue("ui_type",A,{shouldDirty:!0}),d.setValue("connection_url",_,{shouldDirty:!0}),I($e({uiType:A,connectionUrl:_})??ut({uiType:A,connectionUrl:_,registryItems:f}));return}h==="NPX"&&I($e({uiType:"NPX",npxPackage:_}))},b=x=>{x||d.reset(),e(x)},v=async x=>{let _,T=null,S=null,y=null;x.ui_type==="NPX"?(_="STDIO",T="",y=ns(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(_="STDIO",T="",y=ss(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(_=x.ui_type,T=x.connection_url||"",S=x.connection_token||null);const I=Vn("conn");try{await r.create.mutateAsync({id:I,title:x.title,description:x.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:i.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(I)}catch{U.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},N=o("connections.createConnectionDialog.title"),w=o("connections.createConnectionDialog.description"),z=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),P=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(W,{control:d.control,name:"ui_type",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(Xn,{value:x.value,onValueChange:x.onChange,children:[t.jsx(Z,{children:t.jsx(Qn,{children:t.jsx(Wn,{})})}),t.jsxs(Yn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(cn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),h==="NPX"&&t.jsx(W,{control:d.control,name:"npx_package",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...x,value:x.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),d.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(W,{control:d.control,name:"stdio_command",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"stdio_args",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...x,value:x.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...x,value:x.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(W,{control:d.control,name:"env_vars",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(es,{value:x.value??[],onChange:x.onChange})}),t.jsx(ee,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(W,{control:d.control,name:"connection_url",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...x,value:x.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),d.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),x.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"connection_token",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:g?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:g?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...x,value:x.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(W,{control:d.control,name:"title",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...x})}),t.jsx(ee,{})]})}),t.jsx(W,{control:d.control,name:"description",render:({field:x})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Jn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...x,value:x.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(Dt,{open:n,onOpenChange:b,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(_n,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:N}),t.jsx(Dn,{className:"mt-1",children:w})]}),t.jsx(kn,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(wt,{size:16})})})]})}),t.jsx(nt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(v),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:P}),t.jsx(An,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx($t,{open:n,onOpenChange:b,children:t.jsxs(Ft,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Lt,{children:N}),t.jsx(Kn,{children:w})]}),t.jsx(nt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(v),children:[t.jsx("div",{className:"py-4",children:P}),t.jsxs(Gn,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>b(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})}function qs(n){const e=M.c(72),{mode:s,agentId:o,addedConnectionIds:i,onAdd:a,onCloneAndAdd:l,onConnectAndAdd:c,connectingItemId:r,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,h=s===void 0?"add":s,C=d===void 0?"connected":d,p=B(),{org:g}=oe(),j=H.useDeferredValue(u),b=u!==j;let v;e[0]!==j?(v=j.trim().toLowerCase(),e[0]=j,e[1]=v):v=e[1];const N=v;let w;e[2]!==C?(w=D=>D??C,e[2]=C,e[3]=w):w=e[3];const[z,P]=Zt(en.connectionsTab(g.slug)+(C==="all"?":home-modal":":agent-modal"),w);let x;e[4]!==z||e[5]!==P?(x=D=>{D!==z&&R("connections_dialog_tab_changed",{to_tab:D}),P(D)},e[4]=z,e[5]=P,e[6]=x):x=e[6];const _=x;let T;e[7]!==g.id||e[8]!==g.slug?(T={connectionId:mn,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=T):T=e[9];const S=fn(T),y=j?.trim().split(/\s+/).filter(Boolean)??[],I=y.length>0?{operator:"or",conditions:y.flatMap(Zs)}:void 0,k={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:O,fetchNextPage:E,hasNextPage:V,isFetchingNextPage:$}=as({queryKey:at.collectionListInfinite(S,g.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Ys,staleTime:3e4}),K=O?.pages.flatMap(Ws)??[],q=qn(K),de=new Set(K.filter(Qs).map(Xs)),L=Ot(),le=Mt(L,j),Re=mt(le.loadMore,le.hasMore,le.isLoadingMore),He=mt(E,V??!1,$),Q=z==="all"||!!N,ct=Q?le.items.filter(D=>{const F=Rn(D);if(F&&de.has(F))return!1;if(!N)return!0;const se=Ve(D._meta),re=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(ne=>re.includes(ne.toLowerCase()))}):[],we=ct.filter(Gs),_e=ct.filter(Ks);let Ae;e[10]!==i?(Ae=D=>D.some(F=>i.has(F.id)),e[10]=i,e[11]=Ae):Ae=e[11];const Ue=Ae;let Ie;e[12]!==i||e[13]!==o||e[14]!==r||e[15]!==Ue||e[16]!==h||e[17]!==a||e[18]!==f||e[19]!==l||e[20]!==p?(Ie=(D,F,se,re,ne)=>{const Me=Ue(ne),ve=ne.find(ce=>!i.has(ce.id)),G=ne[0];if(h==="browse"){const ce=os(G);return t.jsx(Ye,{connection:{title:F,icon:se,description:ne.length>1?`${ne.length} instances`:re??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",p("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:G.app_name??null,connection_id:G.id,instances_count:ne.length}),f?.(ce)}},D)}return t.jsx(Ye,{connection:{title:F,icon:se,description:re},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",p("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:ce=>{ce.stopPropagation(),ve?(R("connection_add_clicked",{action:"use_existing",app_name:G.app_name??null,connection_id:ve.id}),o&&R("agent_connection_attached",{agent_id:o,connection_id:ve.id,app_name:G.app_name??null,mode:"existing"}),a(ve.id)):(R("connection_add_clicked",{action:"clone",app_name:G.app_name??null,base_connection_id:G.id}),l(G))},children:p("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=i,e[13]=o,e[14]=r,e[15]=Ue,e[16]=h,e[17]=a,e[18]=f,e[19]=l,e[20]=p,e[21]=Ie):Ie=e[21];const ze=Ie;let Te;e[22]!==r||e[23]!==h||e[24]!==c||e[25]!==p?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",re=D.server?.description||D.description||null,ne=D.server?.icons?.[0]?.src||Hn(D.server?.repository)||null,Me=F?.official===!0,ve=F?.verified===!0,G=F?.owner==="deco";return t.jsx(Ye,{connection:{title:se,description:re,icon:ne},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[G&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:p("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByDeco")})]}),!G&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!G&&!Me&&ve&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:p("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:ce=>{ce.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),c(D)},children:r===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):p(h==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=r,e[23]=h,e[24]=c,e[25]=p,e[26]=Te):Te=e[26];const dt=Te;let ue;e[27]!==z||e[28]!==_||e[29]!==m||e[30]!==N||e[31]!==p?(ue=!N&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(is,{tabs:[{id:"all",label:p("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:p("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:z,onTabChange:D=>_(D)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),m()},children:[t.jsx(Ne,{size:12}),p("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=z,e[28]=_,e[29]=m,e[30]=N,e[31]=p,e[32]=ue):ue=e[32];const qe=b&&"opacity-50 pointer-events-none";let me;e[33]!==qe?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",qe),e[33]=qe,e[34]=me):me=e[34];const Ht="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Pe;e[35]!==ze?(Pe=D=>{if(D.type==="group")return ze(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return ze(F.id,F.title,F.icon,F.description??null,[F])},e[35]=ze,e[36]=Pe):Pe=e[36];const Ke=q.map(Pe);let fe;e[37]!==He?(fe=t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[37]=He,e[38]=fe):fe=e[38];let ge;e[39]!==$?(ge=$&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=$,e[40]=ge):ge=e[40];const Ge=Q&&we.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Je,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Xe=Q&&we.map(dt),Qe=Q&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:p("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=Q&&_e.map(dt);let he;e[41]!==Re||e[42]!==L||e[43]!==Q?(he=Q&&L.length>0&&t.jsx("div",{ref:Re,className:"col-span-full h-1"}),e[41]=Re,e[42]=L,e[43]=Q,e[44]=he):he=e[44];let pe;e[45]!==le.isLoadingMore||e[46]!==Q?(pe=Q&&le.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=le.isLoadingMore,e[46]=Q,e[47]=pe):pe=e[47];let xe;e[48]!==Ke||e[49]!==fe||e[50]!==ge||e[51]!==Ge||e[52]!==Xe||e[53]!==Qe||e[54]!==We||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:Ht,children:[Ke,fe,ge,Ge,Xe,Qe,We,he,pe]}),e[48]=Ke,e[49]=fe,e[50]=ge,e[51]=Ge,e[52]=Xe,e[53]=Qe,e[54]=We,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==z||e[59]!==q.length||e[60]!==_e||e[61]!==u||e[62]!==p||e[63]!==we?(je=q.length===0&&we.length===0&&_e.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?p("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):p(z==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=z,e[59]=q.length,e[60]=_e,e[61]=u,e[62]=p,e[63]=we,e[64]=je):je=e[64];let be;e[65]!==me||e[66]!==xe||e[67]!==je?(be=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=be):be=e[68];let Oe;return e[69]!==ue||e[70]!==be?(Oe=t.jsxs(t.Fragment,{children:[ue,be]}),e[69]=ue,e[70]=be,e[71]=Oe):Oe=e[71],Oe}function Ks(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Gs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Xs(n){return n.app_name}function Qs(n){return n.app_name}function Ws(n){return n?.items??[]}function Ys(n,e){if(n?.hasMore)return e.reduce(Js,0)}function Js(n,e){return n+(e?.items?.length??0)}function Zs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Zo({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...i}){const a=B(),l=i.mode??"add",c="agentId"in i?i.agentId:void 0,r="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,u="onAdd"in i&&i.onAdd?i.onAdd:S=>{},m=(S,y,I)=>{c&&R("agent_connection_attached",{agent_id:c,connection_id:S,app_name:y,mode:I})},[f,d]=H.useState(null),[h,C]=H.useState(o),[p,g]=H.useState(!1),{org:j}=oe(),{data:b}=ae.useSession(),v=Et(),N=tn(),w=st(),z=S=>{e(!1),w({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},P=()=>{N.invalidateQueries({predicate:S=>{const y=S.queryKey;return y[1]===j.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},x=async(S,y)=>{R("connection_oauth_succeeded",{connection_id:S,flow:y});const I=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await N.invalidateQueries({queryKey:at.isMCPAuthenticated(I.href,null)}),P()},_=async S=>{d(S.app_name??S.id);try{const I=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await v.create.mutateAsync({title:I,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,O=await et({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:E=>v.update.mutateAsync({id:A,data:{connection_token:E}}).then(()=>{})});if(O.ran&&!O.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:O.error??"no_token"}),U.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:O.error??"no token received"})),await v.delete.mutateAsync(A);return}O.ran&&await x(A,"clone"),m(A,S.app_name??null,"clone"),u(A)}catch(y){console.error("Failed to add connection:",y),U.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},T=async S=>{if(!(!j||!b?.user?.id)){d(S.id);try{const y=Un(S,j.id,b.user.id,{remoteIndex:0}),I=y.connection_type==="STDIO",k=!!y.connection_url,A=I&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!k&&!A){U.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:O}=await v.create.mutateAsync(y),E=await et({connectionId:O,orgId:j.id,orgSlug:j.slug,persistFallback:V=>v.update.mutateAsync({id:O,data:{connection_token:V}}).then(()=>{})});if(E.ran&&!E.ok){R("connection_oauth_failed",{connection_id:O,flow:"connect_new",error:E.error??"no_token"}),U.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:E.error??"no token received"})}),m(O,y.app_name??null,"new"),u(O);return}E.ran?(await x(O,"connect_new"),U.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):U.success(a("virtualMcp.addConnectionDialog.connected")),m(O,y.app_name??null,"new"),u(O)}catch(y){console.error("Failed to connect:",y),U.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs($t,{open:n,onOpenChange:e,children:[t.jsxs(Ft,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Lt,{className:"text-base font-semibold",children:a(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(En,{value:h,onChange:C,placeholder:a("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(qs,{mode:l,agentId:c,addedConnectionIds:r,onAdd:u,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:f,search:h,onCreateConnection:()=>g(!0),onBrowseNavigate:z,defaultTab:s})})]}),t.jsx(Us,{open:p,onOpenChange:g,onCreated:async S=>{g(!1);const y=await et({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:I=>v.update.mutateAsync({id:S,data:{connection_token:I}}).then(()=>{})});if(y.ran&&!y.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:y.error??"no_token"}),U.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(S,null,"custom"),u(S),e(!1);return}y.ran&&await x(S,"custom_create"),m(S,null,"custom"),u(S),e(!1)}})]})}const gt=new Map;function ei(){const{org:n}=oe(),e=ls(),s=rs(),o=s.find(g=>g.providerId==="deco"),{data:i,isLoading:a,refetch:l,isFetching:c}=nn({queryKey:at.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),r=i?.balanceCents??null,u=r!=null?r/100:null,m=H.useRef(new Map);if(r!=null){const g=gt.get(n.id);m.current.get(n.id)&&g!=null&&r>g&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:r-g,previous_balance_cents:g,new_balance_cents:r}),gt.set(n.id,r),m.current.set(n.id,!0)}const f=!!o,d=r!=null&&r>0,h=r!=null&&r===0,C=r!=null&&r===200,p=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:r,balanceDollars:u,hasCredits:d,isZeroBalance:h,isInitialFreeCredit:C,hasOnlyDecoProvider:p,isLoading:a,isFetching:c,refetch:l}}export{Yo as A,Xo as C,Jo as N,Wo as O,Qo as a,Zo as b,bs as c,rt as d,ei as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,F as a,d$ as P,bd as L,K as S,bc as p,n as V}from"./index-D7ruAD9R.js";import{S as g,u as C}from"./use-mcp-client-B5b37aiu.js";function U(e){const t=d.c(5);let s;t[0]!==e?(s=e===void 0?{}:e,t[0]=e,t[1]=s):s=t[1];const n=s,{org:i}=a();let o;t[2]!==i.id||t[3]!==i.slug?(o={connectionId:g,orgId:i.id,orgSlug:i.slug},t[2]=i.id,t[3]=i.slug,t[4]=o):o=t[4];const l=C(o);return P(i.id,"VIRTUAL_MCP",l,n)}function b(e){const t=d.c(3),{org:s}=a();let n;t[0]!==s.id||t[1]!==s.slug?(n={connectionId:g,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=n):n=t[2];const i=C(n);return p(s.id,"VIRTUAL_MCP",e??void 0,i)}function y(e){const t=d.c(15),{org:s}=a();let n;t[0]!==s.id||t[1]!==s.slug?(n={connectionId:g,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=n):n=t[2];const i=C(n);let o,l,u;t[3]!==e||t[4]!==s.id?(o=[...e].sort(),u=V,l=S.virtualMcpLastUsed(s.id,o),t[3]=e,t[4]=s.id,t[5]=o,t[6]=l,t[7]=u):(o=t[5],l=t[6],u=t[7]);const I=o.length>0;let c;t[8]!==i||t[9]!==o?(c=async()=>{const M=(await i.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:o}})).structuredContent??{items:[]},f=new Map;for(const m of M.items)f.set(m.id,m);return f},t[8]=i,t[9]=o,t[10]=c):c=t[10];let r;return t[11]!==l||t[12]!==I||t[13]!==c?(r={queryKey:l,enabled:I,staleTime:3e4,queryFn:c},t[11]=l,t[12]=I,t[13]=c,t[14]=r):r=t[14],u(r)}function R(){const e=d.c(3),{org:t}=a();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:g,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const n=C(s);return L(t.id,"VIRTUAL_MCP",n)}export{U as a,R as b,y as c,b as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./use-infinite-scroll-CGISYIMq.js";import{e5 as i}from"./index-D7ruAD9R.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./use-infinite-scroll-CGISYIMq.js";import{e5 as u,b2 as n}from"./index-D7ruAD9R.js";function a(e,r){return u({...e,enabled:!0,suspense:!0,throwOnError:n},s,r)}export{a as u};
|