decocms 4.11.13 → 4.11.15
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-CTHXh5-p.js → AlertCircle-FgdXx-fO.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-k1cP0iV6.js → ArrowUpRight-u21dpKI1.js} +1 -1
- package/dist/client/assets/{CheckCircle-8Ei6we3F.js → CheckCircle-BqwXUe-9.js} +1 -1
- package/dist/client/assets/{ChevronDown-Df0RIvSQ.js → ChevronDown-BgKzH_6t.js} +1 -1
- package/dist/client/assets/{ChevronRight-CXq8NU2Y.js → ChevronRight-CsAu1ubS.js} +1 -1
- package/dist/client/assets/{ChevronUp-C3BXqYCi.js → ChevronUp-jdmVgYm6.js} +1 -1
- package/dist/client/assets/{DotsVertical-CwYCWVMM.js → DotsVertical-A9HsZoTz.js} +1 -1
- package/dist/client/assets/{Eye-wIcZh6Ej.js → Eye-lKdW_90A.js} +1 -1
- package/dist/client/assets/{FilterLines-Cgjl2nuc.js → FilterLines-CpGD7_24.js} +1 -1
- package/dist/client/assets/{Globe01-N24f7g3W.js → Globe01-uCcgEs70.js} +1 -1
- package/dist/client/assets/{Globe04-DxXdOTy1.js → Globe04-DaW2FCuO.js} +1 -1
- package/dist/client/assets/{HardDrive-BUwPwE3w.js → HardDrive-DpEif7Ff.js} +1 -1
- package/dist/client/assets/{Key01-C7WZ_H03.js → Key01-DDuL1gx6.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DPPcbaTE.js → LayoutLeft-Bs-iEes6.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DuzCINX0.js → LinkExternal01-m2LlipJK.js} +1 -1
- package/dist/client/assets/{Monitor01-CCGN1dT2.js → Monitor01-OkhjbKM4.js} +1 -1
- package/dist/client/assets/{Palette-yg7sWZlD.js → Palette-Y51UcLz4.js} +1 -1
- package/dist/client/assets/{Play-C-3ujAna.js → Play-DIkREwRQ.js} +1 -1
- package/dist/client/assets/{Plus-BrMZ2xfy.js → Plus-BQgfnkfq.js} +1 -1
- package/dist/client/assets/{SearchLg-Wr2HMLh4.js → SearchLg-MpD9EurD.js} +1 -1
- package/dist/client/assets/{SearchMd-B54aJPl2.js → SearchMd-cu7PkEpK.js} +1 -1
- package/dist/client/assets/{Settings02-CTUo7PRN.js → Settings02-8YvtED8C.js} +1 -1
- package/dist/client/assets/{Shield01-Cjlk7ryk.js → Shield01-DFClx49D.js} +1 -1
- package/dist/client/assets/{Star01-BnAhMaak.js → Star01-C-LgFQGA.js} +1 -1
- package/dist/client/assets/{Stars01-ikQXXg6N.js → Stars01-Dc48ZbVB.js} +1 -1
- package/dist/client/assets/{Stars02-DoLta8rI.js → Stars02-BCCXJ1Zl.js} +1 -1
- package/dist/client/assets/{Sun-DESdbs8p.js → Sun-DQSTtkBY.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-KxspIYNU.js → SwitchHorizontal01-CSKcypAO.js} +1 -1
- package/dist/client/assets/{Tool01-BbbcTc54.js → Tool01-BOZXakyY.js} +1 -1
- package/dist/client/assets/{Trash01-DbU-RaAc.js → Trash01-DenmYBT4.js} +1 -1
- package/dist/client/assets/{Upload01-BFOeGEwg.js → Upload01-vOOl8rZv.js} +1 -1
- package/dist/client/assets/{User01-D8Hx_HwS.js → User01-Df45DblL.js} +1 -1
- package/dist/client/assets/{Users01-BOgHUEvo.js → Users01-CO9-9yBW.js} +1 -1
- package/dist/client/assets/{Users03-qNvX7ixx.js → Users03-CsffxETS.js} +1 -1
- package/dist/client/assets/{X-C5SZsgHZ.js → X-C0X3hkZA.js} +1 -1
- package/dist/client/assets/{XCircle-UP0Vo8yU.js → XCircle-CWYrT9gs.js} +1 -1
- package/dist/client/assets/{XClose-DHTZAZKM.js → XClose-BI3vKQdz.js} +1 -1
- package/dist/client/assets/{Zap-6Rv_zftW.js → Zap-5xjao1dd.js} +1 -1
- package/dist/client/assets/{ZapSquare-Cd9fNymP.js → ZapSquare-LV2AigSH.js} +1 -1
- package/dist/client/assets/{ZoomOut-CjE4I-3x.js → ZoomOut-DUzKTR0t.js} +1 -1
- package/dist/client/assets/{access-gate-CDa496QK.js → access-gate-CQYGE_cF.js} +1 -1
- package/dist/client/assets/{add-section-modal-D_TEIXIe.js → add-section-modal-D8hyvYwg.js} +1 -1
- package/dist/client/assets/{agent-icon-DAYPms3t.js → agent-icon-thc6Ncb-.js} +1 -1
- package/dist/client/assets/{agents-list-DICT82um.js → agents-list-Cim-ywcz.js} +1 -1
- package/dist/client/assets/{ai-providers-Dxb2lOWg.js → ai-providers-Bb-L4drK.js} +1 -1
- package/dist/client/assets/{alert-C6BXHYOb.js → alert-AJbMmj4c.js} +1 -1
- package/dist/client/assets/{alert-dialog-DqgnOZYZ.js → alert-dialog-DZnI3TEJ.js} +1 -1
- package/dist/client/assets/{app-editor-DXF3S2rz.js → app-editor-BZsaP9xh.js} +1 -1
- package/dist/client/assets/{auth-DwmBeFco.js → auth-DUkYqOUh.js} +1 -1
- package/dist/client/assets/{auth-catchall-keg1qYyN.js → auth-catchall-i9mJr_em.js} +1 -1
- package/dist/client/assets/{auth-entry-BZJAqUFC.js → auth-entry-DYEyNCfd.js} +1 -1
- package/dist/client/assets/{auth-split-layout-itYUplwy.js → auth-split-layout-p2YW8tqf.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CPLI7QL4.js → authenticate-and-persist-oauth-c_xgclBm.js} +1 -1
- package/dist/client/assets/{automation-list-row-D_kP8ZZC.js → automation-list-row-9t9F-pfx.js} +1 -1
- package/dist/client/assets/{automation-runs-BS4mVno7.js → automation-runs-C571-DDH.js} +1 -1
- package/dist/client/assets/{automations-COTM2NMM.js → automations-cy3RzkDY.js} +1 -1
- package/dist/client/assets/{avatar-wC5H86IC.js → avatar-C8s6DO0k.js} +1 -1
- package/dist/client/assets/{badge-DY4Q05in.js → badge-Ct2OowsY.js} +1 -1
- package/dist/client/assets/{block-document-DtLslOGO.js → block-document-iw-AU378.js} +1 -1
- package/dist/client/assets/{brand-context-CJeOYkNP.js → brand-context-CKqEv9pq.js} +1 -1
- package/dist/client/assets/{buckets-dMAoAMYp.js → buckets-Hx-8zGtu.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-aCIv89Ik.js → bulk-category-panel-pav3u7X9.js} +1 -1
- package/dist/client/assets/{capability-load-error-CQWw9pwT.js → capability-load-error-B_VjQGDA.js} +1 -1
- package/dist/client/assets/{card-BKraJj24.js → card-BaddKT88.js} +1 -1
- package/dist/client/assets/{category-editor-DAljYSM0.js → category-editor-DnMMyMrF.js} +1 -1
- package/dist/client/assets/{chat-context-DBIelBBn.js → chat-context-DVV9F_7K.js} +1 -1
- package/dist/client/assets/{checkbox-DleY1zPj.js → checkbox-B05uMDY4.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BUHzGPAL.js → cli-auth-success-DesSTo5O.js} +1 -1
- package/dist/client/assets/{collection-detail-AYksFWpW.js → collection-detail-BBKKhsT9.js} +1 -1
- package/dist/client/assets/{collection-display-button-CsHUxG3O.js → collection-display-button-B7V8L1lQ.js} +1 -1
- package/dist/client/assets/{collection-search-C8JFbx58.js → collection-search-Csmjyf6A.js} +1 -1
- package/dist/client/assets/{collection-tabs-D4Tw1b0x.js → collection-tabs-DYjUZsKK.js} +1 -1
- package/dist/client/assets/{command-Cetb8Z5A.js → command-Db6Fx_Xo.js} +1 -1
- package/dist/client/assets/commerce-onboarding-__6LqV4W.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-C2RqlRpL.js → connect-desktop-dialog-B74CcFZn.js} +1 -1
- package/dist/client/assets/{connection-card-DzG_Hi5Z.js → connection-card-B2-pnYlx.js} +1 -1
- package/dist/client/assets/{connection-detail-BVLutc72.js → connection-detail-ChDf9I8F.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Cb0tbNja.js → connection-form-helpers-BNa8lbdD.js} +1 -1
- package/dist/client/assets/{connections-Dp0pWsRB.js → connections-CGnFFqcU.js} +1 -1
- package/dist/client/assets/{context-menu-92LrLljn.js → context-menu-CFHk49Qd.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-qW7PE6iD.js → decopilot-sse-pool-BLzj72lU.js} +1 -1
- package/dist/client/assets/{decopilot-7_-viNnp.js → decopilot-t5nirqzO.js} +1 -1
- package/dist/client/assets/{dialog-B11fHjPd.js → dialog-Daex6yYW.js} +1 -1
- package/dist/client/assets/{domain-settings-DDSIfw8w.js → domain-settings-BXUCiOmm.js} +1 -1
- package/dist/client/assets/{drawer-aoGQUuhn.js → drawer-DhLOaE9K.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DsdWdkxS.js → dropdown-menu-C087IXcl.js} +1 -1
- package/dist/client/assets/{empty-state-y2pHAWD4.js → empty-state-Dqgcf7SG.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BhWemihs.js → extract-connection-data-Dv2pahl1.js} +1 -1
- package/dist/client/assets/{file-explorer-BNjiA3QM.js → file-explorer-BOb3W9aF.js} +1 -1
- package/dist/client/assets/{file-type-icon-BudSlLBm.js → file-type-icon-DUvhXe4j.js} +1 -1
- package/dist/client/assets/{files-DYr-0lgT.js → files-p30euFSj.js} +1 -1
- package/dist/client/assets/{form-BM_hwkDs.js → form-wmg_EESq.js} +1 -1
- package/dist/client/assets/{general-CxQXxizj.js → general-Bgk5Ym6I.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CfDFLdrK.js → github-repo-picker-Bu0vm4Dn.js} +1 -1
- package/dist/client/assets/{hooks-DCzkZE1p.js → hooks-CUu52L1d.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DwSGfZpN.js → import-from-deco-dialog-BoN3S8M1.js} +1 -1
- package/dist/client/assets/{index-P3OcEtbB.js → index-0ULh8TaG.js} +1 -1
- package/dist/client/assets/{index-DYWztF-D.js → index-B1i7vRhM.js} +1 -1
- package/dist/client/assets/index-BxnP05yO.css +1 -0
- package/dist/client/assets/{index-DY6AlWrV.js → index-C0TYFVlh.js} +4 -4
- package/dist/client/assets/{index-S6CzYkHv.js → index-CaQDWmX2.js} +1 -1
- package/dist/client/assets/{index-DMXmsGW1.js → index-CbTGRJqq.js} +1 -1
- package/dist/client/assets/{index-DjZ1BwiG.js → index-CjDx_RAd.js} +1 -1
- package/dist/client/assets/{index-Di_68JDu.js → index-CsN3COHO.js} +1 -1
- package/dist/client/assets/{index-DhA3IO7G.js → index-D3x5Yyzl.js} +1 -1
- package/dist/client/assets/{index-D7kwBsYd.js → index-DG_sodd2.js} +5 -5
- package/dist/client/assets/{index-CL7GyRwF.js → index-DIKPtHyb.js} +1 -1
- package/dist/client/assets/{index-BWcSqKQx.js → index-DpUHKLJI.js} +1 -1
- package/dist/client/assets/{index-B9tIhJ2t.js → index-Dq0jikhh.js} +1 -1
- package/dist/client/assets/{index-DPgirMbD.js → index-DsajivpY.js} +1 -1
- package/dist/client/assets/{index-CLbkAAAo.js → index-bCyYW_rE.js} +1 -1
- package/dist/client/assets/{index-redirect-CARJKqTS.js → index-redirect-DSiYA3rz.js} +1 -1
- package/dist/client/assets/{input-Cxys5AED.js → input-p3e0zeGc.js} +1 -1
- package/dist/client/assets/{integration-icon-Bml_vexs.js → integration-icon-DDqEpkh3.js} +1 -1
- package/dist/client/assets/{label-Dg2GlmKc.js → label-DgWCnHqE.js} +1 -1
- package/dist/client/assets/{login-CzZY6tZw.js → login-BYsGJ5G3.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B-Z8A5XV.js → mcp-oauth-DKN6Hvqf.js} +1 -1
- package/dist/client/assets/{members-C5w5FCHJ.js → members-Da_JMsvk.js} +1 -1
- package/dist/client/assets/{monaco-editor-DVREGO01.js → monaco-editor-BpJB3pLh.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B54Myurl.js → monitoring-stats-row-D4nvcyo_.js} +1 -1
- package/dist/client/assets/{oauth-callback-BpVkbvBA.js → oauth-callback-CifNB2iJ.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BjiAbhxr.js → oauth-callback-ai-provider-BVDganU_.js} +1 -1
- package/dist/client/assets/{onboarding-BGK1LYPe.js → onboarding-hGV80-0z.js} +1 -1
- package/dist/client/assets/{org-install-C5phsFTX.js → org-install-DMhCUZ4L.js} +1 -1
- package/dist/client/assets/{org-layout-CLyOSLYC.js → org-layout-qHJHWif_.js} +1 -1
- package/dist/client/assets/{organization-choice-BP3BcTYG.js → organization-choice-DGIub50b.js} +1 -1
- package/dist/client/assets/{page-seo-form-Bdcb_yyG.js → page-seo-form-CBNA_8xt.js} +1 -1
- package/dist/client/assets/page-seo-sheet-bgDdn8hS.js +1 -0
- package/dist/client/assets/{popover-DixifMu5.js → popover-yQFHJSKV.js} +1 -1
- package/dist/client/assets/{post-editor-9FhTa9Rw.js → post-editor-B5Im7QHX.js} +1 -1
- package/dist/client/assets/{primitives-C7yqLz6F.js → primitives-Bi8O8rDZ.js} +1 -1
- package/dist/client/assets/{profile-BOr_aqoH.js → profile-DU2GsjoT.js} +1 -1
- package/dist/client/assets/project-app-view-S9ya_ON5.js +1 -0
- package/dist/client/assets/record-editor-B-Z6Q1ZH.js +1 -0
- package/dist/client/assets/registry-DxNzJNs0.js +2 -0
- package/dist/client/assets/{registry-layout-BFfeNqes.js → registry-layout-BIKvUahp.js} +1 -1
- package/dist/client/assets/{require-capability-hM3nTF5K.js → require-capability-DqAspNKj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-D59BgWxt.js → required-auth-layout-B0Gd7J9q.js} +1 -1
- package/dist/client/assets/{reset-password-BeOXYTlI.js → reset-password-DlSFhsWk.js} +1 -1
- package/dist/client/assets/{roles--mIEZLxt.js → roles-CLwxgnNZ.js} +1 -1
- package/dist/client/assets/{scroll-area-kiY4rhd4.js → scroll-area-DsmPZRa4.js} +1 -1
- package/dist/client/assets/{search-input-BoJmJ8DE.js → search-input-wqBjDj0C.js} +1 -1
- package/dist/client/assets/{secrets-BjDmG9iR.js → secrets-B1URS7WB.js} +1 -1
- package/dist/client/assets/{sections-editor-CXYgzdsU.js → sections-editor-I3iDG93i.js} +1 -1
- package/dist/client/assets/{select-CFrtOJoV.js → select-_gpoGspJ.js} +1 -1
- package/dist/client/assets/{select-model-B5gY-IYm.js → select-model-Kb5TOXWF.js} +1 -1
- package/dist/client/assets/{seo-editor-CDUd6gNJ.js → seo-editor-D9NMXfzW.js} +1 -1
- package/dist/client/assets/{settings-layout-n6toCiiT.js → settings-layout-D-ZRVP4f.js} +1 -1
- package/dist/client/assets/{settings-section-DI4SKE2z.js → settings-section-Bn4-GPp3.js} +1 -1
- package/dist/client/assets/{sheet-4upMFKec.js → sheet-8NsalHzK.js} +1 -1
- package/dist/client/assets/{shell-controls-CDRS96iu.js → shell-controls-CiJy7rae.js} +1 -1
- package/dist/client/assets/{shell-layout-CVk4-62K.js → shell-layout-DscnsWVG.js} +1 -1
- package/dist/client/assets/{shell-route-loading-BR4rjk7q.js → shell-route-loading-DDYsD4bu.js} +1 -1
- package/dist/client/assets/{sidebar-BWhj2mdy.js → sidebar-DpPYkfNr.js} +1 -1
- package/dist/client/assets/{skeleton-CJVmd7bQ.js → skeleton-DoogmLoY.js} +1 -1
- package/dist/client/assets/{sortable.esm-DlPGTgi6.js → sortable.esm-V3rc2KZj.js} +1 -1
- package/dist/client/assets/{sso-DVv033qN.js → sso-BeWesc2G.js} +1 -1
- package/dist/client/assets/{store-rQMRK88o.js → store-BEmuDQ-r.js} +1 -1
- package/dist/client/assets/store-registry-RReZ4BE5.js +2 -0
- package/dist/client/assets/{studio-tools-lDr_QHpd.js → studio-tools-BcsWT94-.js} +1 -1
- package/dist/client/assets/{switch-B6B-Qogu.js → switch-3hgSwTAU.js} +1 -1
- package/dist/client/assets/{table-DOaBQe9x.js → table-FmJsaNlv.js} +1 -1
- package/dist/client/assets/{tabs-2edqXJ7G.js → tabs-BZlgvUnx.js} +1 -1
- package/dist/client/assets/{task-status-BSuPdNUJ.js → task-status-DHRlPcZ4.js} +1 -1
- package/dist/client/assets/{textarea-BAQ2thzp.js → textarea-BAn8NIm7.js} +1 -1
- package/dist/client/assets/{toggle-group-C4MYeBxQ.js → toggle-group--8o0QvwJ.js} +1 -1
- package/dist/client/assets/{toolbar-BllJjamo.js → toolbar-G2jdIOI1.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DVmxOz0L.js → toolbar-icon-button-DZDittGN.js} +1 -1
- package/dist/client/assets/{tools-list-Fxwr4mp7.js → tools-list-DKKpT-KX.js} +1 -1
- package/dist/client/assets/{tooltip-DsRGchIv.js → tooltip-Df46Is_I.js} +1 -1
- package/dist/client/assets/{types-AVHqIhyW.js → types-cpaF9wpu.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DmUYjQ9J.js → use-ai-providers-A5rWQ02q.js} +1 -1
- package/dist/client/assets/{use-automations-U1sBiwMG.js → use-automations-CRyMtO4u.js} +1 -1
- package/dist/client/assets/{use-capability-BVTKKkvT.js → use-capability-J9Yf_TNR.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BS8IVuFM.js → use-clock-tick-CW9zLAnh.js} +1 -1
- package/dist/client/assets/{use-collections-DJRSALQe.js → use-collections-DN2uNmiK.js} +1 -1
- package/dist/client/assets/{use-connection-Cj3R3eAz.js → use-connection-LcVparC-.js} +1 -1
- package/dist/client/assets/{use-copy-COHVLDJ8.js → use-copy-CrnmPhu2.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-tH-FSgFG.js → use-create-virtual-mcp-m_RQuCRM.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-UXjLvnL4.js → use-debounced-autosave-CMkkQ2ct.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B8Hf2bRu.js → use-debounced-value-Dg3DXKgS.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Cy2O1ur0.js → use-decopilot-events-BeaVBlmH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BQjUNFQz.js → use-delete-connection-yjQaYWBh.js} +1 -1
- package/dist/client/assets/{use-file-configs-ChOSYaPv.js → use-file-configs-9pBsA1ep.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CyV41AOO.js → use-infinite-scroll-DVI604VI.js} +1 -1
- package/dist/client/assets/{use-join-requests-CVE_hwlE.js → use-join-requests-DbaMWreh.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DOiDRKzU.js → use-mcp-client-C7QL8E14.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-B3QZrwgh.js → use-mcp-prompts-DIB1YiUA.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BBqawU2Q.js → use-mcp-tools-xr3NKb96.js} +1 -1
- package/dist/client/assets/{use-members-D_Q42wJm.js → use-members-UcgeWDSo.js} +1 -1
- package/dist/client/assets/{use-mobile-CCYRGvhR.js → use-mobile-D38H4tMD.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D1et6q0D.js → use-navigate-to-agent-yk8CY3g5.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-dKCS56k5.js → use-org-auth-client-WGlTt8eO.js} +1 -1
- package/dist/client/assets/{use-org-fs-55F-3Bdi.js → use-org-fs-DAL1xz0e.js} +1 -1
- package/dist/client/assets/{use-org-sso-BT_S1csM.js → use-org-sso-CtDpnZ72.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cw6xgwE4.js → use-organization-roles-B-OLodbd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-IPa1yt3o.js → use-organization-settings-D1yLMBJn.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DrsJGStA.js → use-registry-connections-CQYPRxSJ.js} +1 -1
- package/dist/client/assets/{use-secrets-CrH1fu8O.js → use-secrets-BvGv_Ttz.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BRxvMQuC.js → use-status-sounds-C8qcjzmr.js} +1 -1
- package/dist/client/assets/{use-view-mode-FXEBXqJ2.js → use-view-mode-ClvLlvas.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-jihMmhwQ.js → use-virtual-mcp-DnJvX2wg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CKp9Qy8F.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Byi09zem.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-oy9t9fvk.js → useSuspenseQueries-C74HlnGD.js} +1 -1
- package/dist/client/assets/{variant-calendar-BG0BpNEy.js → variant-calendar-BhVxIjLC.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-9hkF7Sw4.js → view-mode-toggle-Fn7vBBFj.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +376 -375
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/commerce-onboarding-BfZfBpxJ.js +0 -1
- package/dist/client/assets/index-DwE90cfR.css +0 -1
- package/dist/client/assets/page-seo-sheet-JPed36xG.js +0 -1
- package/dist/client/assets/project-app-view-DUoyt7vq.js +0 -1
- package/dist/client/assets/record-editor-DQEu88z-.js +0 -1
- package/dist/client/assets/registry-EX7-oZAN.js +0 -2
- package/dist/client/assets/store-registry-D-GZYEtM.js +0 -2
- package/dist/client/assets/useInfiniteQuery-DrCBzlRR.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DcFeEtRX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as d,j as c,bG as l,bH as b}from"./index-
|
|
1
|
+
import{c as n,l as d,j as c,bG as l,bH as b}from"./index-C0TYFVlh.js";import{i as m}from"./ChevronUp-jdmVgYm6.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,a as c,r as m,j as o}from"./index-
|
|
1
|
+
import{c as a,a as c,r as m,j as o}from"./index-C0TYFVlh.js";import{A as u}from"./auth-split-layout-p2YW8tqf.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,j as t,B as F,i as X,o as Ge,s as se,E as Pe,r as T,D as ie,p as Qe,l as V,bf as Ye,u as Xe,G,t as Ze,e as ae,b1 as ke}from"./index-DY6AlWrV.js";import{E as Ee}from"./empty-state-y2pHAWD4.js";import{u as et,a as Ae}from"./use-collections-DJRSALQe.js";import{u as ce}from"./use-mcp-client-DOiDRKzU.js";import{F as ne,a as tt,b as de,d as me}from"./form-BM_hwkDs.js";import{I as ue}from"./input-Cxys5AED.js";import{T as re}from"./textarea-BAQ2thzp.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-CLbkAAAo.js";import{an as rt,z as it,ac as at,ao as ct,a0 as dt,ap as mt,L as be}from"./agent-icon-DAYPms3t.js";import{g as ut,M as xt,a as Ne}from"./types-AVHqIhyW.js";import{A as pt,a as ft,b as ht}from"./alert-C6BXHYOb.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-CFrtOJoV.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-DsRGchIv.js";import{i as jt}from"./AlertCircle-CTHXh5-p.js";import{s as bt}from"./Stars02-DoLta8rI.js";import{a as Nt}from"./Eye-wIcZh6Ej.js";import{i as vt}from"./Play-C-3ujAna.js";import{i as St}from"./ChevronRight-CXq8NU2Y.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-Fxwr4mp7.js";import{a as Oe,u as Re}from"./use-connection-Cj3R3eAz.js";import{a as It}from"./use-mcp-tools-BBqawU2Q.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-Bml_vexs.js";import{j as Tt,m as Pt}from"./chat-context-DBIelBBn.js";import{b as kt}from"./shell-layout-CVk4-62K.js";import{M as Et}from"./monaco-editor-DVREGO01.js";import{n as At}from"./XCircle-UP0Vo8yU.js";import"./auth-DwmBeFco.js";import"./label-Dg2GlmKc.js";import"./index-P3OcEtbB.js";import"./sidebar-BWhj2mdy.js";import"./LayoutLeft-DPPcbaTE.js";import"./use-mobile-CCYRGvhR.js";import"./sheet-4upMFKec.js";import"./X-C5SZsgHZ.js";import"./ZoomOut-CjE4I-3x.js";import"./Key01-C7WZ_H03.js";import"./extract-connection-data-BhWemihs.js";import"./use-registry-connections-DrsJGStA.js";import"./use-organization-settings-IPa1yt3o.js";import"./studio-tools-lDr_QHpd.js";import"./Plus-BrMZ2xfy.js";import"./index-DYWztF-D.js";import"./index-S6CzYkHv.js";import"./index-DPgirMbD.js";import"./popover-DixifMu5.js";import"./use-virtual-mcp-jihMmhwQ.js";import"./ChevronUp-C3BXqYCi.js";import"./SearchMd-B54aJPl2.js";import"./Users03-qNvX7ixx.js";import"./use-create-virtual-mcp-tH-FSgFG.js";import"./use-navigate-to-agent-D1et6q0D.js";import"./Tool01-BbbcTc54.js";import"./SwitchHorizontal01-KxspIYNU.js";import"./Settings02-CTUo7PRN.js";import"./ArrowUpRight-k1cP0iV6.js";import"./ZapSquare-Cd9fNymP.js";import"./CheckCircle-8Ei6we3F.js";import"./ChevronDown-Df0RIvSQ.js";import"./DotsVertical-CwYCWVMM.js";import"./Globe01-N24f7g3W.js";import"./FilterLines-Cgjl2nuc.js";import"./Star01-BnAhMaak.js";import"./Globe04-DxXdOTy1.js";import"./HardDrive-BUwPwE3w.js";import"./LinkExternal01-DuzCINX0.js";import"./Monitor01-CCGN1dT2.js";import"./Sun-DESdbs8p.js";import"./Palette-yg7sWZlD.js";import"./SearchLg-Wr2HMLh4.js";import"./Shield01-Cjlk7ryk.js";import"./Stars01-ikQXXg6N.js";import"./Trash01-DbU-RaAc.js";import"./Upload01-BFOeGEwg.js";import"./User01-D8Hx_HwS.js";import"./Users01-BOgHUEvo.js";import"./XClose-DHTZAZKM.js";import"./Zap-6Rv_zftW.js";import"./mcp-oauth-B-Z8A5XV.js";import"./badge-DY4Q05in.js";import"./hooks-DCzkZE1p.js";import"./decopilot-sse-pool-qW7PE6iD.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-DmUYjQ9J.js";import"./use-decopilot-events-Cy2O1ur0.js";import"./tab-id-AX1D_RMI.js";import"./avatar-wC5H86IC.js";import"./dialog-B11fHjPd.js";import"./alert-dialog-DqgnOZYZ.js";import"./required-auth-layout-D59BgWxt.js";import"./use-org-sso-BT_S1csM.js";import"./index-DjZ1BwiG.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Mt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),M=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=T.useState("json"),[Me,Le]=T.useState(!1);O&&!Me&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&D==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(M,d),onTeardown:()=>A?.clearAppContext(M),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async D=>{r&&await R.update.mutateAsync({id:r,data:D})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let M;s[24]!==k?(M=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=M):M=s[25];let _;s[26]!==U||s[27]!==M||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(De,{children:[N,A,U,M]})}),s[26]=U,s[27]=M,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let D;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(D=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Ln(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Ln as default};
|
|
1
|
+
import{c as y,j as t,B as F,i as X,o as Ge,s as se,E as Pe,r as T,D as ie,p as Qe,l as V,bf as Ye,u as Xe,G,t as Ze,e as ae,b1 as ke}from"./index-C0TYFVlh.js";import{E as Ee}from"./empty-state-Dqgcf7SG.js";import{u as et,a as Ae}from"./use-collections-DN2uNmiK.js";import{u as ce}from"./use-mcp-client-C7QL8E14.js";import{F as ne,a as tt,b as de,d as me}from"./form-wmg_EESq.js";import{I as ue}from"./input-p3e0zeGc.js";import{T as re}from"./textarea-BAn8NIm7.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-bCyYW_rE.js";import{an as rt,z as it,ac as at,ao as ct,a0 as dt,ap as mt,L as be}from"./agent-icon-thc6Ncb-.js";import{g as ut,M as xt,a as Ne}from"./types-cpaF9wpu.js";import{A as pt,a as ft,b as ht}from"./alert-AJbMmj4c.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-_gpoGspJ.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-Df46Is_I.js";import{i as jt}from"./AlertCircle-FgdXx-fO.js";import{s as bt}from"./Stars02-BCCXJ1Zl.js";import{a as Nt}from"./Eye-lKdW_90A.js";import{i as vt}from"./Play-DIkREwRQ.js";import{i as St}from"./ChevronRight-CsAu1ubS.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DKKpT-KX.js";import{a as Oe,u as Re}from"./use-connection-LcVparC-.js";import{a as It}from"./use-mcp-tools-xr3NKb96.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-DDqEpkh3.js";import{j as Tt,m as Pt}from"./chat-context-DVV9F_7K.js";import{b as kt}from"./shell-layout-DscnsWVG.js";import{M as Et}from"./monaco-editor-BpJB3pLh.js";import{n as At}from"./XCircle-CWYrT9gs.js";import"./auth-DUkYqOUh.js";import"./label-DgWCnHqE.js";import"./index-0ULh8TaG.js";import"./sidebar-DpPYkfNr.js";import"./LayoutLeft-Bs-iEes6.js";import"./use-mobile-D38H4tMD.js";import"./sheet-8NsalHzK.js";import"./X-C0X3hkZA.js";import"./ZoomOut-DUzKTR0t.js";import"./Key01-DDuL1gx6.js";import"./extract-connection-data-Dv2pahl1.js";import"./use-registry-connections-CQYPRxSJ.js";import"./use-organization-settings-D1yLMBJn.js";import"./studio-tools-BcsWT94-.js";import"./Plus-BQgfnkfq.js";import"./index-B1i7vRhM.js";import"./index-CaQDWmX2.js";import"./index-DsajivpY.js";import"./popover-yQFHJSKV.js";import"./use-virtual-mcp-DnJvX2wg.js";import"./ChevronUp-jdmVgYm6.js";import"./SearchMd-cu7PkEpK.js";import"./Users03-CsffxETS.js";import"./use-create-virtual-mcp-m_RQuCRM.js";import"./use-navigate-to-agent-yk8CY3g5.js";import"./Tool01-BOZXakyY.js";import"./SwitchHorizontal01-CSKcypAO.js";import"./Settings02-8YvtED8C.js";import"./ArrowUpRight-u21dpKI1.js";import"./ZapSquare-LV2AigSH.js";import"./CheckCircle-BqwXUe-9.js";import"./ChevronDown-BgKzH_6t.js";import"./DotsVertical-A9HsZoTz.js";import"./Globe01-uCcgEs70.js";import"./FilterLines-CpGD7_24.js";import"./Star01-C-LgFQGA.js";import"./Globe04-DaW2FCuO.js";import"./HardDrive-DpEif7Ff.js";import"./LinkExternal01-m2LlipJK.js";import"./Monitor01-OkhjbKM4.js";import"./Sun-DQSTtkBY.js";import"./Palette-Y51UcLz4.js";import"./SearchLg-MpD9EurD.js";import"./Shield01-DFClx49D.js";import"./Stars01-Dc48ZbVB.js";import"./Trash01-DenmYBT4.js";import"./Upload01-vOOl8rZv.js";import"./User01-Df45DblL.js";import"./Users01-CO9-9yBW.js";import"./XClose-BI3vKQdz.js";import"./Zap-5xjao1dd.js";import"./mcp-oauth-DKN6Hvqf.js";import"./badge-Ct2OowsY.js";import"./hooks-CUu52L1d.js";import"./decopilot-sse-pool-BLzj72lU.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-A5rWQ02q.js";import"./use-decopilot-events-BeaVBlmH.js";import"./tab-id-AX1D_RMI.js";import"./avatar-C8s6DO0k.js";import"./dialog-Daex6yYW.js";import"./alert-dialog-DZnI3TEJ.js";import"./required-auth-layout-B0Gd7J9q.js";import"./use-org-sso-CtDpnZ72.js";import"./index-CjDx_RAd.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Mt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),M=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,Z]=T.useState("json"),[Me,Le]=T.useState(!1);O&&!Me&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&D==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(M,d),onTeardown:()=>A?.clearAppContext(M),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async D=>{r&&await R.update.mutateAsync({id:r,data:D})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let M;s[24]!==k?(M=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=M):M=s[25];let _;s[26]!==U||s[27]!==M||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(De,{children:[N,A,U,M]})}),s[26]=U,s[27]=M,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let D;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(D=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Ln(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Ln as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as B,j as s,l as M,B as V}from"./index-
|
|
1
|
+
import{c as B,j as s,l as M,B as V}from"./index-C0TYFVlh.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-C087IXcl.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-CSKcypAO.js";import{i as S}from"./ChevronUp-jdmVgYm6.js";import{a as I,b as K,c as P,T as W}from"./tooltip-Df46Is_I.js";import{V as q}from"./view-mode-toggle-Fn7vBBFj.js";import{B as G}from"./badge-Ct2OowsY.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,l as b,j as a,i as w}from"./index-
|
|
1
|
+
import{c as v,l as b,j as a,i as w}from"./index-C0TYFVlh.js";import{i as C}from"./SearchMd-cu7PkEpK.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,l as u,j as m}from"./index-
|
|
1
|
+
import{c as f,l as u,j as m}from"./index-C0TYFVlh.js";import{B as g}from"./badge-Ct2OowsY.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:a}=x;let t;e[0]!==a?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const d=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,l as i,j as n}from"./index-
|
|
1
|
+
import{c as d,l as i,j as n}from"./index-C0TYFVlh.js";import{_ as m}from"./index-DsajivpY.js";import{e as k,a as N,b as j,c as b,d as w}from"./dialog-Daex6yYW.js";import{i as y}from"./SearchMd-cu7PkEpK.js";function C(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function S(a){const e=d.c(24);let t,s,o,l,r;e[0]!==a?({title:l,description:r,children:t,className:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=l,e[5]=r):(t=e[1],s=e[2],o=e[3],l=e[4],r=e[5]);const _=l===void 0?"Command Palette":l,v=r===void 0?"Search for a command to run...":r;let c;e[6]!==_?(c=n.jsx(N,{children:_}),e[6]=_,e[7]=c):c=e[7];let p;e[8]!==v?(p=n.jsx(j,{children:v}),e[8]=v,e[9]=p):p=e[9];let u;e[10]!==c||e[11]!==p?(u=n.jsxs(b,{className:"sr-only",children:[c,p]}),e[10]=c,e[11]=p,e[12]=u):u=e[12];let f;e[13]!==s?(f=i("overflow-hidden p-0",s),e[13]=s,e[14]=f):f=e[14];let x;e[15]!==t?(x=n.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t}),e[15]=t,e[16]=x):x=e[16];let g;e[17]!==f||e[18]!==x?(g=n.jsx(w,{className:f,closeButtonClassName:"hidden",children:x}),e[17]=f,e[18]=x,e[19]=g):g=e[19];let h;return e[20]!==o||e[21]!==u||e[22]!==g?(h=n.jsxs(k,{...o,children:[u,g]}),e[20]=o,e[21]=u,e[22]=g,e[23]=h):h=e[23],h}function z(a){const e=d.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(y,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let l;e[4]!==t?(l=i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=l):l=e[5];let r;return e[6]!==s||e[7]!==l?(r=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(m.Input,{"data-slot":"command-input",className:l,...s})]}),e[6]=s,e[7]=l,e[8]=r):r=e[8],r}function G(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function L(a){const e=d.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(m.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function B(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}function H(a){const e=d.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let l;return e[5]!==s||e[6]!==o?(l=n.jsx(m.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=l):l=e[7],l}export{L as C,H as a,z as b,G as c,C as d,R as e,S as f,B as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as q,r as V,l as oe,j as t,B as H,m as Ce,d as fe,K as Y,o as _e,s as le,n as Se,p as Ne,i as ze,k as be,t as Ae,q as ge,v as ee,Q as st,E as ot,a as ke,u as it,w as Tt,b as rt,x as Ot,y as at,L as At}from"./index-C0TYFVlh.js";import{A as kt}from"./auth-entry-DYEyNCfd.js";import{A as Rt}from"./auth-split-layout-p2YW8tqf.js";import{O as Ze}from"./organization-choice-DGIub50b.js";import{f as Lt}from"./tab-id-AX1D_RMI.js";import{I as ye}from"./input-p3e0zeGc.js";import{W as De,u as Re,S as lt,g as Pt,C as $t}from"./use-mcp-client-C7QL8E14.js";import{i as ct}from"./XCircle-CWYrT9gs.js";import{I as Fe}from"./integration-icon-DDqEpkh3.js";import{D as he,a as dt,b as ut,c as mt,d as ft,e as pt}from"./dialog-Daex6yYW.js";import{T as gt,a as ht,b as xt}from"./tooltip-Df46Is_I.js";import{i as Me}from"./CheckCircle-BqwXUe-9.js";import{i as yt,t as bt}from"./agent-icon-thc6Ncb-.js";import{g as Ut,c as zt,e as Dt}from"./extract-connection-data-Dv2pahl1.js";import{F as ce,a as Ee,b as de,c as Te,d as ue,e as me,f as Ft}from"./form-wmg_EESq.js";import{i as Mt}from"./ChevronUp-jdmVgYm6.js";import{s as qt,a as vt}from"./Eye-lKdW_90A.js";import{i as Kt}from"./Settings02-8YvtED8C.js";import{u as Vt}from"./use-debounced-value-Dg3DXKgS.js";import{f as Gt}from"./github-installations-DzN1UQ4x.js";import{u as Ht}from"./useSuspenseQueries-C74HlnGD.js";import{a as Bt}from"./authenticate-and-persist-oauth-c_xgclBm.js";import{i as jt}from"./ArrowUpRight-u21dpKI1.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-C8s6DO0k.js";import"./User01-Df45DblL.js";import"./auth-DUkYqOUh.js";import"./X-C0X3hkZA.js";import"./AlertCircle-FgdXx-fO.js";import"./Tool01-BOZXakyY.js";import"./SwitchHorizontal01-CSKcypAO.js";import"./ZapSquare-LV2AigSH.js";import"./Users03-CsffxETS.js";import"./ChevronDown-BgKzH_6t.js";import"./ChevronRight-CsAu1ubS.js";import"./DotsVertical-A9HsZoTz.js";import"./Stars02-BCCXJ1Zl.js";import"./ZoomOut-DUzKTR0t.js";import"./Globe01-uCcgEs70.js";import"./FilterLines-CpGD7_24.js";import"./Star01-C-LgFQGA.js";import"./Globe04-DaW2FCuO.js";import"./HardDrive-DpEif7Ff.js";import"./Key01-DDuL1gx6.js";import"./LayoutLeft-Bs-iEes6.js";import"./LinkExternal01-m2LlipJK.js";import"./Monitor01-OkhjbKM4.js";import"./Sun-DQSTtkBY.js";import"./Palette-Y51UcLz4.js";import"./Play-DIkREwRQ.js";import"./Plus-BQgfnkfq.js";import"./SearchLg-MpD9EurD.js";import"./SearchMd-cu7PkEpK.js";import"./Shield01-DFClx49D.js";import"./Stars01-Dc48ZbVB.js";import"./Trash01-DenmYBT4.js";import"./Upload01-vOOl8rZv.js";import"./Users01-CO9-9yBW.js";import"./XClose-BI3vKQdz.js";import"./Zap-5xjao1dd.js";import"./label-DgWCnHqE.js";import"./mcp-oauth-DKN6Hvqf.js";const Qt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Wt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,Yt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,Jt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function ae(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Qt.test(e),o=Wt.test(e),i=Yt.test(e);if(n&&!o&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=o?e:`https://${e}`;let r;try{r=new URL(a)}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(c=>!c||!Jt.test(c))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function Zt(s,e){if(!s.trim())return!0;const n=ae(s);if(!n.ok||!e)return!1;const o=ae(e);return o.ok&&o.value===n.value}function $e(s){const e=q.c(14),{children:n,className:o,wrapperClassName:i}=s,[a,r]=V.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=j=>{if(!j)return;const v=()=>{const p=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(p)};v(),j.addEventListener("scroll",v,{passive:!0});const h=new ResizeObserver(v);h.observe(j);for(const p of Array.from(j.children))h.observe(p);return()=>{j.removeEventListener("scroll",v),h.disconnect()}},e[0]=l):l=e[0];const c=l;let m;e[1]!==i?(m=oe("relative",i),e[1]=i,e[2]=m):m=e[2];let d;e[3]!==n||e[4]!==o?(d=t.jsx("div",{ref:c,className:o,children:n}),e[3]=n,e[4]=o,e[5]=d):d=e[5];const f=a?"opacity-0":"opacity-100";let u;e[6]!==f?(u=oe("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",f),e[6]=f,e[7]=u):u=e[7];let g;e[8]!==u?(g=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=g):g=e[9];let x;return e[10]!==m||e[11]!==d||e[12]!==g?(x=t.jsxs("div",{className:m,children:[d,g]}),e[10]=m,e[11]=d,e[12]=g,e[13]=x):x=e[13],x}function Xt(s){const e=s.properties;if(!e)return[];const n=[];for(const[o,i]of Object.entries(e)){const l=i?.properties?.__type?.const;typeof l=="string"&&l.length>0&&n.push({fieldKey:o,bindingType:l})}return n}function en(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function ne(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function tn(s,e,n,o){return{...s??{},[e]:{__type:n,value:o}}}function Ue(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Ue):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Ue(n)):!1}function nn(s){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[s]?e[s]:s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,n=>n.toUpperCase())}function sn(s){return Ue(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function on(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const o=sn(n);return o?[{key:e,label:nn(e),value:o}]:[]}):[]}function rn({autoOpenFieldKey:s,card:e}){return s===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function an(s,e,n){const o=s.filter(i=>i.app_name===e||!!n&&i.app_id===n);return o.length===0?null:(o.sort((i,a)=>{const r=l=>l.status==="active"?0:1;return r(i)!==r(a)?r(i)-r(a):(a.updated_at??"").localeCompare(i.updated_at??"")}),o[0].id)}function ln(s){return s.server?.icons?.[0]?.src??Ut(s.server?.repository)??null}function cn(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function dn(s){const e=[],n=new Map(s.connections.map(o=>[o.id,o]));for(const o of s.requirements){const i=s.curated[o.bindingType],a=i?s.itemsById[i.registryAppId]:s.itemsByName[o.bindingType];if(!a)continue;const r=s.configurationState?.[o.fieldKey]?.value,l=r?n.get(r):void 0,c=r&&l?r:null,m=c?s.connectionReadiness?.[c]!==!1:!1,d=!!c&&m,f=d?void 0:s.saBindings?.[o.bindingType],u=d||!!f,g=d?"oauth":f?"sa":null;e.push({fieldKey:o.fieldKey,bindingType:o.bindingType,registryItem:a,title:cn(a,o.bindingType),icon:ln(a),headline:i?.headline??a._meta?.["mcp.mesh"]?.short_description??null,area:i?.area??null,bullets:i?.bullets??[],satisfied:u,candidateConnectionId:u?null:c||an(s.connections,o.bindingType,i?.registryAppId),linkedConnectionId:c,configurationState:l?.configuration_state??null,boundVia:g,boundResource:f?.resource??null})}return e}function un(s,e){if(!s)return null;const n=i=>{if(i.startsWith("sc-domain:"))return i.substring(10);try{let r=new URL(i.startsWith("http")?i:`https://${i}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return i}},o=n(s);for(const i of e)if(n(i.siteUrl)===o)return i.siteUrl;return null}function mn(s){return(s?.response?.accountSummaries??[]).map(o=>({account:o.account,options:(o.propertySummaries??[]).map(i=>({value:i.property,label:`${i.displayName} (${o.displayName})`}))}))}function Xe(s){const e=q.c(38);let n,o,i,a,r;e[0]!==s?({value:r,onChange:o,placeholder:i,className:n,...a}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=i,e[4]=a,e[5]=r):(n=e[1],o=e[2],i=e[3],a=e[4],r=e[5]);const[l,c]=V.useState(!1),[m,d]=V.useState(!1);let f;e[6]!==r?(f=async()=>{if(r)try{await navigator.clipboard.writeText(r),d(!0),setTimeout(()=>d(!1),2e3)}catch(k){console.error("Failed to copy text: ",k)}},e[6]=r,e[7]=f):f=e[7];const u=f;let g;e[8]!==l?(g=()=>{c(!l)},e[8]=l,e[9]=g):g=e[9];const x=g,j=l?"text":"password";let v;e[10]!==n?(v=oe("pr-20",n),e[10]=n,e[11]=v):v=e[11];let h;e[12]!==o||e[13]!==i||e[14]!==a||e[15]!==j||e[16]!==v||e[17]!==r?(h=t.jsx(ye,{type:j,value:r,onChange:o,placeholder:i,className:v,...a}),e[12]=o,e[13]=i,e[14]=a,e[15]=j,e[16]=v,e[17]=r,e[18]=h):h=e[18];const p=l?"Hide password":"Show password";let y;e[19]!==l?(y=l?t.jsx(Kt,{size:16}):t.jsx(qt,{size:16}),e[19]=l,e[20]=y):y=e[20];let b;e[21]!==p||e[22]!==y||e[23]!==x?(b=t.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:x,title:p,children:y}),e[21]=p,e[22]=y,e[23]=x,e[24]=b):b=e[24];const C=!r,w=m?"Copied!":"Copy token";let _;e[25]!==m?(_=m?t.jsx(Mt,{size:16}):t.jsx(vt,{size:16}),e[25]=m,e[26]=_):_=e[26];let S;e[27]!==u||e[28]!==w||e[29]!==_||e[30]!==C?(S=t.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:C,title:w,children:_}),e[27]=u,e[28]=w,e[29]=_,e[30]=C,e[31]=S):S=e[31];let O;e[32]!==S||e[33]!==b?(O=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[b,S]}),e[32]=S,e[33]=b,e[34]=O):O=e[34];let T;return e[35]!==O||e[36]!==h?(T=t.jsxs("div",{className:"relative",children:[h,O]}),e[35]=O,e[36]=h,e[37]=T):T=e[37],T}function qe(s){const e=q.c(19),{card:n,selfClient:o,org:i,onDone:a,onError:r}=s,l=Ce();let c;e[0]!==n||e[1]!==o?(c=async v=>{const h={...n.configurationState??{},...v};await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=o,e[2]=c):c=e[2];let m;e[3]!==a||e[4]!==i||e[5]!==l?(m=async()=>{await l.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(i.id)}),a()},e[3]=a,e[4]=i,e[5]=l,e[6]=m):m=e[6];let d;e[7]!==r?(d=v=>{r?.(v)},e[7]=r,e[8]=d):d=e[8];let f;e[9]!==c||e[10]!==m||e[11]!==d?(f={mutationFn:c,onSuccess:m,onError:d},e[9]=c,e[10]=m,e[11]=d,e[12]=f):f=e[12];const u=fe(f);let g;e[13]!==u?(g=v=>u.mutate(v),e[13]=u,e[14]=g):g=e[14];const x=g;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==x?(j={save:x,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=x,e[18]=j):j=e[18],j}const fn=_e({accountName:le().min(1,"Informe o nome da conta"),appKey:le().optional(),appToken:le().optional()});function pn(s){const e=q.c(63),{card:n,selfClient:o,org:i,onDone:a,onIsPendingChange:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Se(fn),e[0]=l):l=e[0];const c=n.configurationState?.accountName||"",m=n.configurationState?.appKey||"",d=n.configurationState?.appToken||"";let f;e[1]!==c||e[2]!==m||e[3]!==d?(f={resolver:l,defaultValues:{accountName:c,appKey:m,appToken:d}},e[1]=c,e[2]=m,e[3]=d,e[4]=f):f=e[4];const u=Ne(f);let g;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(g=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=g):g=e[9];let x;e[10]!==n.configurationState||e[11]!==u?(x=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=x):x=e[12],V.useEffect(g,x);let j;e[13]!==n||e[14]!==a||e[15]!==i||e[16]!==o?(j={card:n,selfClient:o,org:i,onDone:a},e[13]=n,e[14]=a,e[15]=i,e[16]=o,e[17]=j):j=e[17];const{save:v,isPending:h,error:p}=qe(j);let y,b;e[18]!==h||e[19]!==r?(b=()=>{r?.(h)},y=[h,r],e[18]=h,e[19]=r,e[20]=y,e[21]=b):(y=e[20],b=e[21]),V.useEffect(b,y);let C;if(e[22]!==u||e[23]!==v){let D;e[25]!==v?(D=async A=>{v(A)},e[25]=v,e[26]=D):D=e[26],C=u.handleSubmit(D),e[22]=u,e[23]=v,e[24]=C}else C=e[24];const w=C;let _;e[27]!==h?(_=D=>{const{field:A}=D;return t.jsxs(de,{children:[t.jsx(Te,{children:"Nome da conta"}),t.jsx(ue,{children:t.jsx(ye,{placeholder:"Nome da sua conta VTEX",...A,disabled:h})}),t.jsx(me,{})]})},e[27]=h,e[28]=_):_=e[28];let S;e[29]!==u.control||e[30]!==_?(S=t.jsx(ce,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=S):S=e[31];let O;e[32]!==h?(O=D=>{const{field:A}=D;return t.jsxs(de,{children:[t.jsx(Te,{children:"App Key (opcional)"}),t.jsx(ue,{children:t.jsx(Xe,{placeholder:"App Key da VTEX",...A,disabled:h})}),t.jsx(me,{})]})},e[32]=h,e[33]=O):O=e[33];let T;e[34]!==u.control||e[35]!==O?(T=t.jsx(ce,{control:u.control,name:"appKey",render:O}),e[34]=u.control,e[35]=O,e[36]=T):T=e[36];let k;e[37]!==h?(k=D=>{const{field:A}=D;return t.jsxs(de,{children:[t.jsx(Te,{children:"App Token (opcional)"}),t.jsx(ue,{children:t.jsx(Xe,{placeholder:"App Token da VTEX",...A,disabled:h})}),t.jsx(me,{})]})},e[37]=h,e[38]=k):k=e[38];let N;e[39]!==u.control||e[40]!==k?(N=t.jsx(ce,{control:u.control,name:"appToken",render:k}),e[39]=u.control,e[40]=k,e[41]=N):N=e[41];let L;e[42]!==u||e[43]!==S||e[44]!==T||e[45]!==N?(L=t.jsxs(Ee,{...u,children:[S,T,N]}),e[42]=u,e[43]=S,e[44]=T,e[45]=N,e[46]=L):L=e[46];let z;e[47]!==p?(z=p&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:p instanceof Error?p.message:"Não foi possível salvar a configuração"}),e[47]=p,e[48]=z):z=e[48];let P;e[49]!==h||e[50]!==a?(P=t.jsx(H,{type:"button",variant:"outline",onClick:a,disabled:h,children:"Cancelar"}),e[49]=h,e[50]=a,e[51]=P):P=e[51];const F=h?"Salvando...":"Salvar";let M;e[52]!==h||e[53]!==F?(M=t.jsx(H,{type:"submit",disabled:h,children:F}),e[52]=h,e[53]=F,e[54]=M):M=e[54];let E;e[55]!==P||e[56]!==M?(E=t.jsxs(he,{className:"pt-4",children:[P,M]}),e[55]=P,e[56]=M,e[57]=E):E=e[57];let I;return e[58]!==w||e[59]!==L||e[60]!==z||e[61]!==E?(I=t.jsxs("form",{onSubmit:w,className:"space-y-4",children:[L,z,E]}),e[58]=w,e[59]=L,e[60]=z,e[61]=E,e[62]=I):I=e[62],I}function Ke(s){const e=q.c(29),{options:n,value:o,onChange:i,disabled:a,ariaLabel:r,searchPlaceholder:l,hideSearch:c}=s,m=l===void 0?"Buscar...":l,d=c===void 0?!1:c,[f,u]=V.useState("");let g,x,j;if(e[0]!==n||e[1]!==f||e[2]!==o){const _=f.trim().toLowerCase();g=_?n.filter(S=>S.label.toLowerCase().includes(_)):n,x=g.map(gn),j=x.includes(o)?o:x[0]??"",e[0]=n,e[1]=f,e[2]=o,e[3]=g,e[4]=x,e[5]=j}else g=e[3],x=e[4],j=e[5];const v=j;let h;e[6]!==a||e[7]!==x||e[8]!==i?(h=function(S){if(a||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(S.key))return;S.preventDefault();const T=S.currentTarget.dataset.value,k=x.indexOf(T),N=x.length;if(N===0)return;let L;S.key==="ArrowDown"||S.key==="ArrowRight"?L=(k+1)%N:S.key==="ArrowUp"||S.key==="ArrowLeft"?L=(k-1+N)%N:S.key==="Home"?L=0:L=N-1;const z=x[L];i(z),S.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(z)}"]`)?.focus()},e[6]=a,e[7]=x,e[8]=i,e[9]=h):h=e[9];const p=h;let y;e[10]!==r||e[11]!==a||e[12]!==d||e[13]!==f||e[14]!==m?(y=d?null:t.jsxs("div",{className:"relative",children:[t.jsx(yt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t.jsx(ye,{type:"text",value:f,onChange:_=>u(_.target.value),disabled:a,placeholder:m,"aria-label":`Buscar ${r}`,className:"h-8 pl-8"})]}),e[10]=r,e[11]=a,e[12]=d,e[13]=f,e[14]=m,e[15]=y):y=e[15];let b;e[16]!==a||e[17]!==g||e[18]!==p||e[19]!==i||e[20]!==v||e[21]!==o?(b=g.length===0?t.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"Nenhum resultado"}):g.map(_=>{const S=_.value===o;return t.jsxs("button",{type:"button",role:"radio","aria-checked":S,disabled:a,"data-value":_.value,tabIndex:_.value===v?0:-1,onClick:()=>i(_.value),onKeyDown:p,className:oe("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",S?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[t.jsx("span",{className:"truncate",children:_.label}),S?t.jsx(Me,{size:16,className:"shrink-0 text-primary"}):null]},_.value)}),e[16]=a,e[17]=g,e[18]=p,e[19]=i,e[20]=v,e[21]=o,e[22]=b):b=e[22];let C;e[23]!==r||e[24]!==b?(C=t.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:b}),e[23]=r,e[24]=b,e[25]=C):C=e[25];let w;return e[26]!==y||e[27]!==C?(w=t.jsxs("div",{className:"space-y-2",children:[y,C]}),e[26]=y,e[27]=C,e[28]=w):w=e[28],w}function gn(s){return s.value}function Le(s){const e=q.c(16),{label:n,iconSize:o,className:i,iconClassName:a,labelClassName:r}=s,l=o===void 0?14:o;let c;e[0]!==i?(c=oe("inline-flex items-center gap-2",i),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=oe("shrink-0 animate-spin",a),e[2]=a,e[3]=m):m=e[3];let d;e[4]!==l||e[5]!==m?(d=t.jsx(ze,{size:l,className:m}),e[4]=l,e[5]=m,e[6]=d):d=e[6];let f;e[7]!==r?(f=oe("text-sm",r),e[7]=r,e[8]=f):f=e[8];let u;e[9]!==n||e[10]!==f?(u=t.jsx("span",{className:f,children:n}),e[9]=n,e[10]=f,e[11]=u):u=e[11];let g;return e[12]!==c||e[13]!==d||e[14]!==u?(g=t.jsxs("span",{className:c,children:[d,u]}),e[12]=c,e[13]=d,e[14]=u,e[15]=g):g=e[15],g}const hn=_e({propertyId:le().min(1,"Selecione uma propriedade")});function xn(s){const e=q.c(68),{card:n,connectionId:o,companionClient:i,selfClient:a,org:r,onDone:l,onDisconnect:c,onIsPendingChange:m}=s;let d;e[0]!==o||e[1]!==r.id?(d=Y.commerceDiscoveryCompanionGaProperties(r.id,o),e[0]=o,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==i?(f=async()=>{const U=await i.callTool({name:"get-account-summaries",arguments:{}}),K=ne(U);return mn(K)},e[3]=i,e[4]=f):f=e[4];let u;e[5]!==d||e[6]!==f?(u={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=u):u=e[7];const g=be(u);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=Se(hn),e[8]=x):x=e[8];const j=n.configurationState?.propertyId||"";let v;e[9]!==j?(v={resolver:x,defaultValues:{propertyId:j}},e[9]=j,e[10]=v):v=e[10];const h=Ne(v);let p;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==a?(p={card:n,selfClient:a,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=a,e[15]=p):p=e[15];const{save:y,isPending:b,error:C}=qe(p);let w,_;e[16]!==b||e[17]!==m?(w=()=>{m?.(b)},_=[b,m],e[16]=b,e[17]=m,e[18]=w,e[19]=_):(w=e[18],_=e[19]),V.useEffect(w,_);let S;if(e[20]!==h||e[21]!==y){let U;e[23]!==y?(U=async K=>{y(K)},e[23]=y,e[24]=U):U=e[24],S=h.handleSubmit(U),e[20]=h,e[21]=y,e[22]=S}else S=e[22];const O=S;if(g.isLoading){let U;return e[25]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx(Le,{label:"Carregando propriedades..."})}),e[25]=U):U=e[25],U}if(g.isError){let U;return e[26]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar as propriedades do Google Analytics."})}),e[26]=U):U=e[26],U}let T;e[27]!==g.data?(T=g.data||[],e[27]=g.data,e[28]=T):T=e[28];const k=T;if(k.flatMap(bn).length===0){let U;e[29]===Symbol.for("react.memo_cache_sentinel")?(U=t.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]=U):U=e[29];let K;e[30]!==c?(K=c?t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive",children:"Desconectar conta"}):t.jsx("span",{}),e[30]=c,e[31]=K):K=e[31];let Q;e[32]!==l?(Q=t.jsx(H,{type:"button",variant:"outline",onClick:l,children:"Fechar"}),e[32]=l,e[33]=Q):Q=e[33];let W;return e[34]!==K||e[35]!==Q?(W=t.jsxs("div",{className:"space-y-4",children:[U,t.jsxs(he,{className:"flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[K,Q]})]}),e[34]=K,e[35]=Q,e[36]=W):W=e[36],W}let L;e[37]!==b||e[38]!==k?(L=U=>{const{field:K}=U;return t.jsxs(de,{children:[t.jsx(ue,{children:t.jsx(Ke,{options:k.flatMap(yn),value:K.value,onChange:K.onChange,disabled:b,ariaLabel:"Propriedade do Google Analytics"})}),t.jsx(me,{})]})},e[37]=b,e[38]=k,e[39]=L):L=e[39];let z;e[40]!==h.control||e[41]!==L?(z=t.jsx(ce,{control:h.control,name:"propertyId",render:L}),e[40]=h.control,e[41]=L,e[42]=z):z=e[42];let P;e[43]!==h||e[44]!==z?(P=t.jsx(Ee,{...h,children:z}),e[43]=h,e[44]=z,e[45]=P):P=e[45];let F;e[46]!==C?(F=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Não foi possível salvar a configuração"}),e[46]=C,e[47]=F):F=e[47];let M;e[48]!==b||e[49]!==c?(M=c?t.jsx("button",{type:"button",onClick:c,disabled:b,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-destructive disabled:opacity-50",children:"Desconectar conta"}):t.jsx("span",{}),e[48]=b,e[49]=c,e[50]=M):M=e[50];let E;e[51]!==b||e[52]!==l?(E=t.jsx(H,{type:"button",variant:"outline",onClick:l,disabled:b,children:"Cancelar"}),e[51]=b,e[52]=l,e[53]=E):E=e[53];const I=b?"Salvando...":"Salvar";let D;e[54]!==b||e[55]!==I?(D=t.jsx(H,{type:"submit",disabled:b,children:I}),e[54]=b,e[55]=I,e[56]=D):D=e[56];let A;e[57]!==E||e[58]!==D?(A=t.jsxs("div",{className:"flex gap-2",children:[E,D]}),e[57]=E,e[58]=D,e[59]=A):A=e[59];let $;e[60]!==M||e[61]!==A?($=t.jsxs(he,{className:"flex-col gap-2 pt-4 sm:flex-row sm:items-center sm:justify-between",children:[M,A]}),e[60]=M,e[61]=A,e[62]=$):$=e[62];let G;return e[63]!==O||e[64]!==P||e[65]!==F||e[66]!==$?(G=t.jsxs("form",{onSubmit:O,className:"space-y-4",children:[P,F,$]}),e[63]=O,e[64]=P,e[65]=F,e[66]=$,e[67]=G):G=e[67],G}function yn(s){return s.options}function bn(s){return s.options}const vn=_e({siteUrl:le().min(1,"Selecione um site")});function jn(s){const e=q.c(59),{card:n,connectionId:o,companionClient:i,selfClient:a,org:r,contextSiteUrl:l,onDone:c,onIsPendingChange:m}=s;let d;e[0]!==o||e[1]!==r.id?(d=Y.commerceDiscoveryCompanionGscSites(r.id,o),e[0]=o,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==i?(f=async()=>{const A=await i.callTool({name:"list_sites",arguments:{}});return ne(A).sites||[]},e[3]=i,e[4]=f):f=e[4];let u;e[5]!==d||e[6]!==f?(u={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=u):u=e[7];const g=be(u);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=Se(vn),e[8]=x):x=e[8];const j=n.configurationState?.siteUrl||"";let v;e[9]!==j?(v={resolver:x,defaultValues:{siteUrl:j}},e[9]=j,e[10]=v):v=e[10];const h=Ne(v);let p;e[11]!==n||e[12]!==c||e[13]!==r||e[14]!==a?(p={card:n,selfClient:a,org:r,onDone:c},e[11]=n,e[12]=c,e[13]=r,e[14]=a,e[15]=p):p=e[15];const{save:y,isPending:b,error:C}=qe(p);let w,_;e[16]!==b||e[17]!==m?(w=()=>{m?.(b)},_=[b,m],e[16]=b,e[17]=m,e[18]=w,e[19]=_):(w=e[18],_=e[19]),V.useEffect(w,_);let S;if(e[20]!==h||e[21]!==y){let A;e[23]!==y?(A=async $=>{y($)},e[23]=y,e[24]=A):A=e[24],S=h.handleSubmit(A),e[20]=h,e[21]=y,e[22]=S}else S=e[22];const O=S;if(g.isLoading){let A;return e[25]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx(Le,{label:"Carregando sites..."})}),e[25]=A):A=e[25],A}if(g.isError){let A;return e[26]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Não foi possível carregar os sites do Google Search Console."})}),e[26]=A):A=e[26],A}let T,k;if(e[27]!==n.configurationState?.siteUrl||e[28]!==l||e[29]!==h||e[30]!==g.data){k=Symbol.for("react.early_return_sentinel");e:{if(T=g.data||[],T.length===0){let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum site verificado foi encontrado. Verifique um site no Google Search Console."})}),e[33]=$):$=e[33],k=$;break e}const A=n.configurationState?.siteUrl;if(A&&h.getValues("siteUrl")!==A)h.setValue("siteUrl",A);else if(!A&&!h.getValues("siteUrl")){const $=un(l,T);$&&h.setValue("siteUrl",$)}}e[27]=n.configurationState?.siteUrl,e[28]=l,e[29]=h,e[30]=g.data,e[31]=T,e[32]=k}else T=e[31],k=e[32];if(k!==Symbol.for("react.early_return_sentinel"))return k;let N;e[34]!==b||e[35]!==T?(N=A=>{const{field:$}=A;return t.jsxs(de,{children:[t.jsx(ue,{children:t.jsx(Ke,{options:T.map(Cn),value:$.value,onChange:$.onChange,disabled:b,ariaLabel:"Site verificado"})}),t.jsx(me,{})]})},e[34]=b,e[35]=T,e[36]=N):N=e[36];let L;e[37]!==h.control||e[38]!==N?(L=t.jsx(ce,{control:h.control,name:"siteUrl",render:N}),e[37]=h.control,e[38]=N,e[39]=L):L=e[39];let z;e[40]!==h||e[41]!==L?(z=t.jsx(Ee,{...h,children:L}),e[40]=h,e[41]=L,e[42]=z):z=e[42];let P;e[43]!==C?(P=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Não foi possível salvar a configuração"}),e[43]=C,e[44]=P):P=e[44];let F;e[45]!==b||e[46]!==c?(F=t.jsx(H,{type:"button",variant:"outline",onClick:c,disabled:b,children:"Cancelar"}),e[45]=b,e[46]=c,e[47]=F):F=e[47];const M=b?"Salvando...":"Salvar";let E;e[48]!==b||e[49]!==M?(E=t.jsx(H,{type:"submit",disabled:b,children:M}),e[48]=b,e[49]=M,e[50]=E):E=e[50];let I;e[51]!==F||e[52]!==E?(I=t.jsxs(he,{className:"pt-4",children:[F,E]}),e[51]=F,e[52]=E,e[53]=I):I=e[53];let D;return e[54]!==O||e[55]!==z||e[56]!==P||e[57]!==I?(D=t.jsxs("form",{onSubmit:O,className:"space-y-4",children:[z,P,I]}),e[54]=O,e[55]=z,e[56]=P,e[57]=I,e[58]=D):D=e[58],D}function Cn(s){return{value:s.siteUrl,label:s.siteUrl}}const _n=_e({githubRepo:le().min(1,"Selecione um repositório")}),Sn=15e3,Nn=/^[\w.-]+\/[\w.-]+$/;async function En(s,e,n,o){const{installations:i}=await Gt(s,n),a=o.trim(),r=await Promise.allSettled(i.map(async d=>{const f=d.type==="User"?"user":"org",u=a?`${f}:${d.login} ${a} in:name`:`${f}:${d.login}`,x=await e.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:50}},void 0,{signal:AbortSignal.timeout(Sn)}),j=x.content?.[0]?.text;if(x.isError)throw new Error(j??"search_repositories failed");if(!j)throw new Error("empty search_repositories response");return JSON.parse(j).items??[]})),l=new Map;let c=0;for(const d of r){if(d.status==="rejected"){c+=1;continue}for(const f of d.value)f.full_name&&!l.has(f.full_name)&&l.set(f.full_name,f)}return{repos:Array.from(l.values()).sort((d,f)=>(f.updated_at??"").localeCompare(d.updated_at??"")).map(d=>d.full_name),failed:c,total:i.length}}function wn(s){const e=q.c(80),{connectionId:n,companionClient:o,selfClient:i,org:a,onDone:r,onIsPendingChange:l}=s,c=Ce();let m;e[0]!==a.id?(m=De.COMMERCE_DISCOVERY(a.id),e[0]=a.id,e[1]=m):m=e[1];const d=m,[f,u]=V.useState(""),g=Vt(f,300);let x;e[2]!==n||e[3]!==a.id?(x=Y.commerceDiscoveryCompanionGithubSelected(a.id,n),e[2]=n,e[3]=a.id,e[4]=x):x=e[4];let j;e[5]!==d||e[6]!==i?(j=async()=>{const Z=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),X=ne(Z).item?.configuration_state??null;return typeof X?.github_repo=="string"?X.github_repo:""},e[5]=d,e[6]=i,e[7]=j):j=e[7];let v;e[8]!==x||e[9]!==j?(v={queryKey:x,queryFn:j},e[8]=x,e[9]=j,e[10]=v):v=e[10];const h=be(v);let p;e[11]!==n||e[12]!==g||e[13]!==a.id?(p=Y.commerceDiscoveryCompanionGithubRepos(a.id,n,g.trim()),e[11]=n,e[12]=g,e[13]=a.id,e[14]=p):p=e[14];let y;e[15]!==o||e[16]!==n||e[17]!==g||e[18]!==i?(y=()=>En(Z=>i.callTool(Z),o,n,g),e[15]=o,e[16]=n,e[17]=g,e[18]=i,e[19]=y):y=e[19];let b;e[20]!==p||e[21]!==y?(b={queryKey:p,queryFn:y},e[20]=p,e[21]=y,e[22]=b):b=e[22];const C=be(b);let w;e[23]===Symbol.for("react.memo_cache_sentinel")?(w={resolver:Se(_n),defaultValues:{githubRepo:""}},e[23]=w):w=e[23];const _=Ne(w);let S;e[24]!==d||e[25]!==i?(S=async Z=>{const X=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),It={...ne(X).item?.configuration_state??null??{},github_repo:Z};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:d,data:{configuration_state:It}}})},e[24]=d,e[25]=i,e[26]=S):S=e[26];let O;e[27]!==d||e[28]!==r||e[29]!==a.id||e[30]!==c?(O=async()=>{await c.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(a.id,d)}),await c.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(a.id)}),r()},e[27]=d,e[28]=r,e[29]=a.id,e[30]=c,e[31]=O):O=e[31];let T;e[32]!==O||e[33]!==S?(T={mutationFn:S,onSuccess:O},e[32]=O,e[33]=S,e[34]=T):T=e[34];const k=fe(T),N=k.isPending;let L,z;e[35]!==N||e[36]!==l?(L=()=>{l?.(N)},z=[N,l],e[35]=N,e[36]=l,e[37]=L,e[38]=z):(L=e[37],z=e[38]),V.useEffect(L,z);let P;if(e[39]!==_||e[40]!==k){let Z;e[42]!==k?(Z=async X=>{k.mutate(X.githubRepo)},e[42]=k,e[43]=Z):Z=e[43],P=_.handleSubmit(Z),e[39]=_,e[40]=k,e[41]=P}else P=e[41];const F=P,M=h.data??"";M&&_.getValues("githubRepo")!==M&&_.setValue("githubRepo",M);let E,I,D;if(e[44]!==g||e[45]!==C.data?.failed||e[46]!==C.data?.repos||e[47]!==C.data?.total||e[48]!==M){const Z=C.data?.repos??[];E=C.data?.failed??0,D=C.data?.total??0;const X=g.trim();I=[...Z],X&&Nn.test(X)&&!I.includes(X)&&I.unshift(X),M&&!I.includes(M)&&I.push(M),e[44]=g,e[45]=C.data?.failed,e[46]=C.data?.repos,e[47]=C.data?.total,e[48]=M,e[49]=E,e[50]=I,e[51]=D}else E=e[49],I=e[50],D=e[51];const A=D>0&&E===D,$=C.isError||A?"Não foi possível buscar os repositórios (erro ou tempo esgotado). Tente novamente ou digite o repositório no formato owner/nome.":E>0?"Parte da busca falhou — alguns repositórios podem não ter aparecido. Tente novamente ou digite owner/nome.":null;let G;e[52]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(yt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[52]=G):G=e[52];let U;e[53]===Symbol.for("react.memo_cache_sentinel")?(U=Z=>u(Z.target.value),e[53]=U):U=e[53];let K;e[54]!==N||e[55]!==f?(K=t.jsxs("div",{className:"relative",children:[G,t.jsx(ye,{type:"text",value:f,onChange:U,disabled:N,placeholder:"Buscar repositório (ex: deco-sites/fila-store)","aria-label":"Buscar repositório",className:"h-8 pl-8"})]}),e[54]=N,e[55]=f,e[56]=K):K=e[56];let Q;e[57]!==_||e[58]!==N||e[59]!==I||e[60]!==C.isLoading||e[61]!==$?(Q=C.isLoading?t.jsx("div",{className:"flex min-h-[160px] items-center justify-center",children:t.jsx(Le,{label:"Carregando repositórios..."})}):t.jsxs(t.Fragment,{children:[$&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:$}),I.length===0?!$&&t.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhum repositório encontrado. Digite o nome do repositório (owner/nome) para buscar."}):t.jsx(Ee,{..._,children:t.jsx(ce,{control:_.control,name:"githubRepo",render:Z=>{const{field:X}=Z;return t.jsxs(de,{children:[t.jsx(ue,{children:t.jsx(Ke,{options:I.map(In),value:X.value,onChange:X.onChange,disabled:N,ariaLabel:"Repositório",hideSearch:!0})}),t.jsx(me,{})]})}})})]}),e[57]=_,e[58]=N,e[59]=I,e[60]=C.isLoading,e[61]=$,e[62]=Q):Q=e[62];let W;e[63]!==k.error?(W=k.error&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:k.error instanceof Error?k.error.message:"Não foi possível salvar a configuração"}),e[63]=k.error,e[64]=W):W=e[64];let J;e[65]!==N||e[66]!==r?(J=t.jsx(H,{type:"button",variant:"outline",onClick:r,disabled:N,children:"Cancelar"}),e[65]=N,e[66]=r,e[67]=J):J=e[67];const te=N?"Salvando...":"Salvar";let R;e[68]!==N||e[69]!==te?(R=t.jsx(H,{type:"submit",disabled:N,children:te}),e[68]=N,e[69]=te,e[70]=R):R=e[70];let B;e[71]!==J||e[72]!==R?(B=t.jsxs(he,{className:"pt-4",children:[J,R]}),e[71]=J,e[72]=R,e[73]=B):B=e[73];let ie;return e[74]!==F||e[75]!==K||e[76]!==Q||e[77]!==W||e[78]!==B?(ie=t.jsxs("form",{onSubmit:F,className:"space-y-4",children:[K,Q,W,B]}),e[74]=F,e[75]=K,e[76]=Q,e[77]=W,e[78]=B,e[79]=ie):ie=e[79],ie}function In(s){return{value:s,label:s}}const Tn={vtex:pn,"google-analytics":xn,"google-search-console":jn,github:wn},xe="deco-reader@decocms.iam.gserviceaccount.com",Ct={"google-analytics":"ga4","google-search-console":"gsc"},_t={ga4:{label:"Google Analytics",resourceLabel:"ID da propriedade",resourcePlaceholder:"ex: 123456789",resourceHint:"No GA4: Admin → Detalhes da propriedade → ID da propriedade (só números).",connectSteps:["Abra o Google Analytics (GA4) da sua loja.","Vá em Admin → Acesso à propriedade (Gerenciamento de acesso).",`Clique em + → Adicionar usuários, cole ${xe} e conceda o papel Leitor.`,"Copie o ID da propriedade (Admin → Detalhes da propriedade) e cole abaixo."]},gsc:{label:"Google Search Console",resourceLabel:"Site / propriedade",resourcePlaceholder:"ex: sc-domain:sualoja.com.br",resourceHint:"Use o mesmo formato que aparece no Search Console: sc-domain:sualoja.com.br ou https://www.sualoja.com.br/.",connectSteps:["Abra o Google Search Console da sua loja.","Vá em Configurações → Usuários e permissões.",`Clique em Adicionar usuário, cole ${xe} e escolha permissão Completa.`,"Copie o endereço do site como aparece no seletor de propriedades e cole abaixo."]}};function On(s,e){const n=_t[s].label;switch(e){case"no-access":return{title:`Ainda não conseguimos acessar este recurso no ${n}.`,steps:s==="ga4"?[`Confirme que ${xe} foi adicionado em Admin → Acesso à propriedade com o papel Leitor.`,"Confira se o ID da propriedade está correto (só números, sem o prefixo 'properties/').","A concessão de acesso pode levar alguns segundos — tente novamente."]:[`Confirme que ${xe} foi adicionado em Configurações → Usuários e permissões.`,"A permissão precisa ser Completa ou Restrita — 'Não verificado' não funciona.","Confira se o endereço do site está exatamente como aparece no Search Console."]};case"no-web-stream":return{title:"Esta propriedade do GA4 não tem um fluxo de dados da Web (site) configurado.",steps:["No GA4, vá em Admin → Fluxos de dados.","Clique em Adicionar fluxo → Web.","Informe a URL do site da sua loja e salve o fluxo.","Volte aqui e tente vincular de novo. (Propriedades só de app precisam de vínculo manual — fale com o suporte.)"]};case"no-match":return{title:"O recurso informado não corresponde ao domínio desta loja.",steps:s==="ga4"?["Verifique se digitou o ID da propriedade certa — provavelmente é de outro site.","No GA4, o site medido aparece em Admin → Fluxos de dados → (seu fluxo Web) → URL do stream."]:["Verifique se selecionou a propriedade do Search Console referente a esta loja.","O endereço precisa cobrir o mesmo domínio do diagnóstico."]};case"resource_already_bound":return{title:"Este recurso já está vinculado a outra loja.",steps:["Se este recurso é realmente desta loja, fale com o suporte para uma revisão manual.","Caso tenha digitado o id errado, confira e tente novamente."]};default:return{title:"Não foi possível verificar o acesso a este recurso.",steps:["Revise os passos de acesso acima e tente novamente.","Se persistir, fale com o suporte."]}}}function An(s){const e=q.c(76),{provider:n,siteUrl:o,selfClient:i,org:a,initialResourceId:r,onDone:l,onIsPendingChange:c,onOAuthInstead:m}=s,d=_t[n],f=Ce(),[u,g]=V.useState(null);let x,j;if(e[0]!==d.resourceLabel){const R=_e({resourceId:le().trim().min(1,`Informe o ${d.resourceLabel.toLowerCase()}`)});j=Ne,x=Se(R),e[0]=d.resourceLabel,e[1]=x,e[2]=j}else x=e[1],j=e[2];const v=r??"";let h;e[3]!==v?(h={resourceId:v},e[3]=v,e[4]=h):h=e[4];let p;e[5]!==x||e[6]!==h?(p={resolver:x,defaultValues:h},e[5]=x,e[6]=h,e[7]=p):p=e[7];const y=j(p);let b;e[8]!==n||e[9]!==i||e[10]!==o?(b=async R=>{if(!o)throw new Error("URL da loja indisponível — recarregue a página.");const B=await i.callTool({name:"COMMERCE_DISCOVERY_BIND",arguments:{siteUrl:o,provider:n,resourceId:R.resourceId}});return ne(B)},e[8]=n,e[9]=i,e[10]=o,e[11]=b):b=e[11];let C,w;e[12]!==c?(C=()=>c?.(!0),w=()=>c?.(!1),e[12]=c,e[13]=C,e[14]=w):(C=e[13],w=e[14]);let _;e[15]!==d.label||e[16]!==l||e[17]!==a||e[18]!==n||e[19]!==f||e[20]!==o?(_=async R=>{if(R.ok){g(null),Ae.success(`${d.label} conectado`),o&&await f.invalidateQueries({queryKey:Y.commerceDiscoveryConnectionStatus(a.id,o)}),l();return}g({...On(n,R.reason??"unknown"),detail:R.detail})},e[15]=d.label,e[16]=l,e[17]=a,e[18]=n,e[19]=f,e[20]=o,e[21]=_):_=e[21];let S;e[22]!==b||e[23]!==C||e[24]!==w||e[25]!==_?(S={mutationFn:b,onMutate:C,onSettled:w,onSuccess:_},e[22]=b,e[23]=C,e[24]=w,e[25]=_,e[26]=S):S=e[26];const O=fe(S);let T;if(e[27]!==y||e[28]!==O){let R;e[30]!==O?(R=B=>O.mutate(B),e[30]=O,e[31]=R):R=e[31],T=y.handleSubmit(R),e[27]=y,e[28]=O,e[29]=T}else T=e[29];const k=T,N=O.isPending,L=Ln;let z;e[32]!==d.connectSteps?(z=d.connectSteps.map(Rn),e[32]=d.connectSteps,e[33]=z):z=e[33];let P;e[34]!==z?(P=t.jsx("ol",{className:"space-y-2 text-sm text-muted-foreground",children:z}),e[34]=z,e[35]=P):P=e[35];let F;e[36]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("code",{className:"min-w-0 flex-1 truncate text-xs text-foreground",children:xe}),e[36]=F):F=e[36];let M;e[37]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/40 p-2",children:[F,t.jsx(H,{type:"button",variant:"ghost",size:"icon-sm",onClick:L,"aria-label":"Copiar e-mail do service account",children:t.jsx(vt,{size:16})})]}),e[37]=M):M=e[37];let E;e[38]!==d.resourceHint||e[39]!==d.resourceLabel||e[40]!==d.resourcePlaceholder||e[41]!==N?(E=R=>{const{field:B}=R;return t.jsxs(de,{children:[t.jsx(Te,{children:d.resourceLabel}),t.jsx(ue,{children:t.jsx(ye,{...B,placeholder:d.resourcePlaceholder,disabled:N,autoComplete:"off"})}),t.jsx(Ft,{children:d.resourceHint}),t.jsx(me,{})]})},e[38]=d.resourceHint,e[39]=d.resourceLabel,e[40]=d.resourcePlaceholder,e[41]=N,e[42]=E):E=e[42];let I;e[43]!==y.control||e[44]!==E?(I=t.jsx(ce,{control:y.control,name:"resourceId",render:E}),e[43]=y.control,e[44]=E,e[45]=I):I=e[45];let D;e[46]!==y||e[47]!==I?(D=t.jsx(Ee,{...y,children:I}),e[46]=y,e[47]=I,e[48]=D):D=e[48];let A;e[49]!==u?(A=u&&t.jsxs("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:u.title}),t.jsx("ol",{className:"space-y-1 text-sm text-muted-foreground",children:u.steps.map(kn)})]}),e[49]=u,e[50]=A):A=e[50];let $;e[51]!==O.error||e[52]!==O.isError?($=O.isError&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:O.error instanceof Error?O.error.message:"Não foi possível vincular."}),e[51]=O.error,e[52]=O.isError,e[53]=$):$=e[53];let G;e[54]!==N||e[55]!==m?(G=m?t.jsx("button",{type:"button",onClick:m,disabled:N,className:"text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground disabled:opacity-50",children:"autorizar via login do Google"}):t.jsx("span",{}),e[54]=N,e[55]=m,e[56]=G):G=e[56];let U;e[57]!==N||e[58]!==l?(U=t.jsx(H,{type:"button",variant:"outline",onClick:l,disabled:N,children:"Cancelar"}),e[57]=N,e[58]=l,e[59]=U):U=e[59];const K=N?"Verificando...":"Vincular";let Q;e[60]!==N||e[61]!==K?(Q=t.jsx(H,{type:"submit",disabled:N,children:K}),e[60]=N,e[61]=K,e[62]=Q):Q=e[62];let W;e[63]!==U||e[64]!==Q?(W=t.jsxs("div",{className:"flex gap-2",children:[U,Q]}),e[63]=U,e[64]=Q,e[65]=W):W=e[65];let J;e[66]!==G||e[67]!==W?(J=t.jsxs(he,{className:"flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between",children:[G,W]}),e[66]=G,e[67]=W,e[68]=J):J=e[68];let te;return e[69]!==k||e[70]!==P||e[71]!==D||e[72]!==A||e[73]!==$||e[74]!==J?(te=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[P,M,D,A,$,J]}),e[69]=k,e[70]=P,e[71]=D,e[72]=A,e[73]=$,e[74]=J,e[75]=te):te=e[75],te}function kn(s){return t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{"aria-hidden":!0,children:"•"}),t.jsx("span",{children:s})]},s)}function Rn(s,e){return t.jsxs("li",{className:"flex gap-2",children:[t.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-foreground",children:e+1}),t.jsx("span",{children:s})]},s)}function Ln(){navigator.clipboard?.writeText(xe),Ae.success("E-mail copiado")}function Pn(){const s=q.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s[0]=e):e=s[0];let n;return s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[e,t.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[t.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"h-3 w-full animate-pulse rounded bg-muted/60"})]}),t.jsx("div",{className:"h-8 w-20 shrink-0 animate-pulse rounded-lg bg-muted/60 sm:mt-auto sm:w-full"})]}),s[1]=n):n=s[1],n}const et="rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground";function $n(s){const e=q.c(37),{card:n,connecting:o,disabled:i,onConnect:a,org:r,selfClient:l,siteUrl:c,autoOpenConfigFieldKey:m,onAutoOpenConfigHandled:d}=s,f=n.linkedConnectionId,u=Ct[n.bindingType],g=!!u&&n.boundVia!=="oauth";let x;e[0]!==m||e[1]!==n||e[2]!==o||e[3]!==i||e[4]!==f||e[5]!==d||e[6]!==a||e[7]!==r||e[8]!==u||e[9]!==l||e[10]!==c||e[11]!==g?(x=g&&u?t.jsx(Un,{card:n,provider:u,org:r,selfClient:l,siteUrl:c,onOAuthInstead:a,disabled:i,connecting:o}):n.satisfied&&f?t.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),t.jsx(V.Suspense,{fallback:t.jsx(zn,{}),children:t.jsx(Dn,{card:n,org:r,selfClient:l,connectionId:f,contextSiteUrl:c,autoOpen:rn({autoOpenFieldKey:m,card:n}),onAutoOpenHandled:d})})]}):t.jsx(H,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:i||o,onClick:a,"aria-label":`Conectar ${n.title}`,children:o?t.jsx(ze,{size:16,className:"animate-spin"}):"Conectar"}),e[0]=m,e[1]=n,e[2]=o,e[3]=i,e[4]=f,e[5]=d,e[6]=a,e[7]=r,e[8]=u,e[9]=l,e[10]=c,e[11]=g,e[12]=x):x=e[12];const j=x;let v;e[13]!==n.icon||e[14]!==n.title?(v=t.jsx(Fe,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"shrink-0 p-1.5"}),e[13]=n.icon,e[14]=n.title,e[15]=v):v=e[15];let h;e[16]!==n.area?(h=n.area&&t.jsx("span",{className:oe("hidden sm:inline-block",et),children:n.area}),e[16]=n.area,e[17]=h):h=e[17];let p;e[18]!==v||e[19]!==h?(p=t.jsxs("div",{className:"shrink-0 self-start sm:flex sm:w-full sm:items-center sm:justify-between sm:gap-2",children:[v,h]}),e[18]=v,e[19]=h,e[20]=p):p=e[20];let y;e[21]!==n.area?(y=n.area&&t.jsx("span",{className:oe("mb-1 inline-block sm:hidden",et),children:n.area}),e[21]=n.area,e[22]=y):y=e[22];let b;e[23]!==n.title?(b=t.jsx("p",{className:"text-sm font-medium text-foreground",children:n.title}),e[23]=n.title,e[24]=b):b=e[24];let C;e[25]!==n.headline?(C=n.headline&&t.jsx("p",{className:"mt-0.5 line-clamp-2 text-sm leading-5 text-muted-foreground",children:n.headline}),e[25]=n.headline,e[26]=C):C=e[26];let w;e[27]!==y||e[28]!==b||e[29]!==C?(w=t.jsxs("div",{className:"min-w-0 flex-1",children:[y,b,C]}),e[27]=y,e[28]=b,e[29]=C,e[30]=w):w=e[30];let _;e[31]!==j?(_=t.jsx("div",{className:"shrink-0 sm:mt-auto sm:w-full sm:pt-1",children:j}),e[31]=j,e[32]=_):_=e[32];let S;return e[33]!==p||e[34]!==w||e[35]!==_?(S=t.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card p-4 sm:h-full sm:flex-col sm:items-stretch",children:[p,w,_]}),e[33]=p,e[34]=w,e[35]=_,e[36]=S):S=e[36],S}function Un(s){const e=q.c(39),{card:n,provider:o,org:i,selfClient:a,siteUrl:r,onOAuthInstead:l,disabled:c,connecting:m}=s,[d,f]=V.useState(!1),[u,g]=V.useState(!1);let x;e[0]!==u?(x=L=>{!L&&u||f(L)},e[0]=u,e[1]=x):x=e[1];const j=x;let v;e[2]!==n.satisfied||e[3]!==n.title||e[4]!==m||e[5]!==c?(v=n.satisfied?t.jsxs("div",{className:"flex items-center justify-end gap-1 sm:justify-start",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[t.jsx(Me,{size:16,className:"text-success"})," Conectado"]}),t.jsxs(gt,{children:[t.jsx(ht,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:()=>f(!0),"aria-label":`Configurar ${n.title}`,children:t.jsx(bt,{size:16})})}),t.jsx(xt,{children:"Editar configuração"})]})]}):t.jsx(H,{type:"button",variant:"outline",size:"sm",className:"sm:w-full",disabled:c||m,onClick:()=>f(!0),"aria-label":`Conectar ${n.title}`,children:m?t.jsx(ze,{size:16,className:"animate-spin"}):"Conectar"}),e[2]=n.satisfied,e[3]=n.title,e[4]=m,e[5]=c,e[6]=v):v=e[6];let h;e[7]!==n.icon||e[8]!==n.title?(h=t.jsx(Fe,{icon:n.icon,name:n.title,size:"md",fit:"contain",className:"p-1.5"}),e[7]=n.icon,e[8]=n.title,e[9]=h):h=e[9];let p;e[10]!==n.title?(p=t.jsx(dt,{children:n.title}),e[10]=n.title,e[11]=p):p=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ut,{children:"Conceda acesso ao nosso leitor e informe o identificador"}),e[12]=y):y=e[12];let b;e[13]!==p?(b=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[p,y]}),e[13]=p,e[14]=b):b=e[14];let C;e[15]!==h||e[16]!==b?(C=t.jsxs(mt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[h,b]}),e[15]=h,e[16]=b,e[17]=C):C=e[17];const w=n.boundResource??void 0;let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=()=>f(!1),e[18]=_):_=e[18];let S;e[19]!==n.satisfied||e[20]!==l?(S=n.satisfied?void 0:()=>{f(!1),l()},e[19]=n.satisfied,e[20]=l,e[21]=S):S=e[21];let O;e[22]!==i||e[23]!==o||e[24]!==a||e[25]!==r||e[26]!==S||e[27]!==w?(O=t.jsx(An,{provider:o,siteUrl:r,selfClient:a,org:i,initialResourceId:w,onDone:_,onIsPendingChange:g,onOAuthInstead:S}),e[22]=i,e[23]=o,e[24]=a,e[25]=r,e[26]=S,e[27]=w,e[28]=O):O=e[28];let T;e[29]!==O||e[30]!==C?(T=t.jsxs(ft,{className:"sm:max-w-lg",children:[C,O]}),e[29]=O,e[30]=C,e[31]=T):T=e[31];let k;e[32]!==j||e[33]!==d||e[34]!==T?(k=t.jsx(pt,{open:d,onOpenChange:j,children:T}),e[32]=j,e[33]=d,e[34]=T,e[35]=k):k=e[35];let N;return e[36]!==k||e[37]!==v?(N=t.jsxs(t.Fragment,{children:[v,k]}),e[36]=k,e[37]=v,e[38]=N):N=e[38],N}function zn(){const s=q.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s[0]=e):e=s[0],e}function Dn(s){const e=q.c(60),{card:n,org:o,selfClient:i,connectionId:a,contextSiteUrl:r,autoOpen:l,onAutoOpenHandled:c}=s;let m;e[0]!==a||e[1]!==o.id||e[2]!==o.slug?(m={connectionId:a,orgId:o.id,orgSlug:o.slug},e[0]=a,e[1]=o.id,e[2]=o.slug,e[3]=m):m=e[3];const d=Re(m),[f,u]=V.useState(l),[g,x]=V.useState(!1),j=Ce(),v=Tn[n.bindingType],h=on(n.configurationState);let p;e[4]!==l||e[5]!==c?(p=()=>{u(!1),l&&c()},e[4]=l,e[5]=c,e[6]=p):p=e[6];const y=p;let b;e[7]!==y||e[8]!==g?(b=K=>{if(!(!K&&g)){if(!K){y();return}u(!0)}},e[7]=y,e[8]=g,e[9]=b):b=e[9];const C=b;let w;e[10]!==a||e[11]!==i?(w=async()=>{await i.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})},e[10]=a,e[11]=i,e[12]=w):w=e[12];let _;e[13]!==n.title||e[14]!==y||e[15]!==o.id||e[16]!==j?(_=async()=>{await j.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),Ae.success(`${n.title} desconectado`),y()},e[13]=n.title,e[14]=y,e[15]=o.id,e[16]=j,e[17]=_):_=e[17];let S;e[18]!==w||e[19]!==_?(S={mutationFn:w,onSuccess:_,onError:Fn},e[18]=w,e[19]=_,e[20]=S):S=e[20];const O=fe(S);if(!v)return null;let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=()=>u(!0),e[21]=T):T=e[21];const k=`Configurar ${n.title}`;let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(bt,{size:16}),e[22]=N):N=e[22];let L;e[23]!==k?(L=t.jsx(ht,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:T,"aria-label":k,children:N})}),e[23]=k,e[24]=L):L=e[24];const z=h.length>0?"Editar configuração":"Configurar";let P;e[25]!==z?(P=t.jsx(xt,{children:z}),e[25]=z,e[26]=P):P=e[26];let F;e[27]!==L||e[28]!==P?(F=t.jsxs(gt,{children:[L,P]}),e[27]=L,e[28]=P,e[29]=F):F=e[29];let M;e[30]!==n.icon||e[31]!==n.title?(M=t.jsx(Fe,{icon:n.icon,name:n.title,size:"md",fit:"contain",className:"p-1.5"}),e[30]=n.icon,e[31]=n.title,e[32]=M):M=e[32];let E;e[33]!==n.title?(E=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsx(dt,{children:n.title}),t.jsxs(ut,{children:["Configure o ",n.title," para enriquecer os dados"]})]}),e[33]=n.title,e[34]=E):E=e[34];let I;e[35]!==M||e[36]!==E?(I=t.jsxs(mt,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[M,E]}),e[35]=M,e[36]=E,e[37]=I):I=e[37];let D;e[38]!==O?(D=()=>O.mutate(),e[38]=O,e[39]=D):D=e[39];let A;e[40]!==v||e[41]!==n||e[42]!==y||e[43]!==d||e[44]!==a||e[45]!==r||e[46]!==o||e[47]!==i||e[48]!==D?(A=t.jsx(v,{card:n,connectionId:a,companionClient:d,selfClient:i,org:o,contextSiteUrl:r,onDone:y,onDisconnect:D,onIsPendingChange:x}),e[40]=v,e[41]=n,e[42]=y,e[43]=d,e[44]=a,e[45]=r,e[46]=o,e[47]=i,e[48]=D,e[49]=A):A=e[49];let $;e[50]!==I||e[51]!==A?($=t.jsxs(ft,{className:"sm:max-w-lg",children:[I,A]}),e[50]=I,e[51]=A,e[52]=$):$=e[52];let G;e[53]!==f||e[54]!==C||e[55]!==$?(G=t.jsx(pt,{open:f,onOpenChange:C,children:$}),e[53]=f,e[54]=C,e[55]=$,e[56]=G):G=e[56];let U;return e[57]!==F||e[58]!==G?(U=t.jsxs(t.Fragment,{children:[F,G]}),e[57]=F,e[58]=G,e[59]=U):U=e[59],U}function Fn(){Ae.error("Não foi possível desconectar. Tente novamente.")}const Ve={vtex:{registryAppId:"deco/vtex",area:"Catálogo",headline:"Rupturas e PDPs que travam suas vendas."},"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 Mn(s){const e=q.c(40),{selfClient:n,org:o,cdConnectionId:i,siteUrl:a}=s;let r;e[0]!==i||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:i,orgId:o.id,orgSlug:o.slug},e[0]=i,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const l=Re(r);let c;e[4]!==i||e[5]!==o.id?(c=Y.commerceDiscoveryCompanionSchema(o.id,i),e[4]=i,e[5]=o.id,e[6]=c):c=e[6];let m;e[7]!==l?(m=async()=>{const R=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ne(R)},e[7]=l,e[8]=m):m=e[8];let d;e[9]!==c||e[10]!==m?(d={queryKey:c,queryFn:m},e[9]=c,e[10]=m,e[11]=d):d=e[11];const f=ge(d),u=Xt(f.data?.stateSchema??{properties:{}}),g=u.map(Jn),x=u.map(Yn).filter(Wn),j=u.filter(Qn).map(Bn),v=[...x,...j].sort().join(",");let h;e[12]!==i||e[13]!==o.id?(h=Y.commerceDiscoveryConnection(o.id,i),e[12]=i,e[13]=o.id,e[14]=h):h=e[14];let p;e[15]!==i||e[16]!==n?(p=async()=>{const R=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return ne(R)},e[15]=i,e[16]=n,e[17]=p):p=e[17];let y;e[18]!==h||e[19]!==p?(y={queryKey:h,queryFn:p},e[18]=h,e[19]=p,e[20]=y):y=e[20];const C=ge(y).data?.item?.configuration_state??null;let w;e[21]!==C?(w=R=>C?.[R.fieldKey]?.value,e[21]=C,e[22]=w):w=e[22];const _=u.map(w).filter(Hn),S=[...g.map(Gn),...x.map(Vn),..._.map(Kn)].sort().join(","),T=ge({queryKey:Y.commerceDiscoveryCompanionConnections(o.id,S),queryFn:async()=>{if(u.length===0)return{items:[]};const R=[{field:["app_name"],operator:"in",value:g},{field:["app_id"],operator:"in",value:x}];_.length>0&&R.push({field:["id"],operator:"in",value:_});const B=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:R},limit:1e3}});return ne(B)}}).data?.items??[],k=new Set(_),N=T.filter(R=>k.has(R.id)),L=N.filter(qn);let z;e[23]!==o.id||e[24]!==o.slug?(z=R=>({queryKey:Y.commerceDiscoveryCompanionOAuthStatus(o.id,R.id),queryFn:async()=>{try{const B=await fetch(`/api/${encodeURIComponent(o.slug)}/connections/${encodeURIComponent(R.id)}/oauth-token/status`,{credentials:"include"});return B.ok?{hasToken:(await B.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}},retry:!1}),e[23]=o.id,e[24]=o.slug,e[25]=z):z=e[25];const P=Ht({queries:L.map(z)});let F;e[26]!==P?(F=(R,B)=>[R.id,P[B]?.data?.hasToken===!0],e[26]=P,e[27]=F):F=e[27];const M=new Map(L.map(F)),E={};for(const R of N)E[R.id]=!R.oauth_config||!!R.connection_token||M.get(R.id)===!0;const I=ge({queryKey:Y.commerceDiscoveryCompanionRegistry(o.id,v),queryFn:async()=>{if(u.length===0)return{items:[]};const R=en(x,j),B=await zt(De.REGISTRY(o.id),o.id,o.slug,"COLLECTION_REGISTRY_APP_LIST",{...R?{where:R}:{},limit:1e3});return ne(B)}}),D={},A={};for(const R of I.data?.items??[])D[R.id]=R,R.server?.name&&(A[R.server.name]=R);let $;e[28]!==o.id||e[29]!==a?($=Y.commerceDiscoveryConnectionStatus(o.id,a??""),e[28]=o.id,e[29]=a,e[30]=$):$=e[30];const G=!!a;let U;e[31]!==n||e[32]!==a?(U=async()=>{const R=await n.callTool({name:"COMMERCE_DISCOVERY_CONNECTION_STATUS",arguments:{siteUrl:a}});return ne(R)},e[31]=n,e[32]=a,e[33]=U):U=e[33];let K;e[34]!==$||e[35]!==G||e[36]!==U?(K={queryKey:$,enabled:G,queryFn:U},e[34]=$,e[35]=G,e[36]=U,e[37]=K):K=e[37];const Q=be(K),W={};for(const[R,B]of Object.entries(Ct)){const ie=Q.data?.providers?.[B];ie?.connected&&ie.via==="sa"&&(W[R]={resource:ie.resource??null})}const J=dn({requirements:u,itemsById:D,itemsByName:A,connections:T,connectionReadiness:E,configurationState:C,curated:Ve,saBindings:W});let te;return e[38]!==J?(te={cards:J},e[38]=J,e[39]=te):te=e[39],te}function qn(s){return s.oauth_config&&!s.connection_token}function Kn(s){return`linked:${s}`}function Vn(s){return`app:${s}`}function Gn(s){return`binding:${s}`}function Hn(s){return typeof s=="string"&&s.length>0}function Bn(s){return s.bindingType}function Qn(s){return!Ve[s.bindingType]}function Wn(s){return!!s}function Yn(s){return Ve[s.bindingType]?.registryAppId}function Jn(s){return s.bindingType}function Zn({selfClient:s,org:e,userId:n,cdConnectionId:o}){const i=Ce(),[a,r]=V.useState(null),[l,c]=V.useState(null),m=async(f,u)=>{const g=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:f,data:u}});return ne(g)};async function d(f){r(f.fieldKey),c(null);const u={app_name:f.title,field_key:f.fieldKey,organization_id:e.id};ee("commerce_onboarding_companion_connect_clicked",u);try{let g=f.candidateConnectionId;if(!g){const y=Dt(f.registryItem,e.id,n,{remoteIndex:0}),b=y.connection_type==="STDIO",C=!!y.connection_url,w=b&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!C&&!w)return ee("commerce_onboarding_companion_connect_failed",{...u,error:"no_connection_method"}),c(`${f.title} cannot be connected: no connection method available`),!1;const _=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:y}});g=ne(_).item.id}const x=g,j=await Bt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:y=>m(x,{connection_token:y}).then(()=>{})});if(!j.ok)return ee("commerce_onboarding_companion_connect_failed",{...u,error:j.error}),c(`Couldn't sign in to ${f.title}: ${j.error}`),!1;const v=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}}),h=ne(v).item?.configuration_state??null,p=tn(h,f.fieldKey,f.bindingType,x);return await m(o,{configuration_state:p}),await i.invalidateQueries({queryKey:Y.commerceDiscoveryConnection(e.id,o)}),await i.invalidateQueries({queryKey:Y.commerceDiscoveryCompanionConnectionsPrefix(e.id)}),ee("commerce_onboarding_companion_connected",u),!0}catch(g){return ee("commerce_onboarding_companion_connect_failed",{...u,error:g instanceof Error?g.message:String(g)}),c(g instanceof Error?g.message:String(g)),!1}finally{r(null)}}return{connect:d,connectingFieldKey:a,error:l}}const Ge="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function He(){const s=q.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("h1",{className:"text-2xl font-medium leading-8 text-foreground",children:"Conecte suas ferramentas para ver o diagnóstico completo"}),s[0]=e):e=s[0],e}function Xn(){const s=q.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[0,1,2,3].map(es)}),s[0]=e):e=s[0],e}function es(s){return t.jsx(Pn,{},s)}function Be(){const s=q.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:Ge,children:[t.jsx(He,{}),t.jsx(Xn,{})]}),s[0]=e):e=s[0],e}function ts(s){const e=q.c(5),{onRetry:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(He,{}),e[0]=o):o=e[0];let i,a;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("p",{className:"text-sm text-foreground",children:"Não foi possível carregar as integrações complementares."}),a=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Algo deu errado ao carregar suas integrações."}),e[1]=i,e[2]=a):(i=e[1],a=e[2]);let r;return e[3]!==n?(r=t.jsxs("div",{className:Ge,children:[o,t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i,a,t.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:n,children:"Tentar novamente"})]})]}),e[3]=n,e[4]=r):r=e[4],r}function ns(s){const e=q.c(2);let n;return e[0]!==s?(n=t.jsx(st,{children:o=>{const{reset:i}=o;return t.jsx(ot,{fallback:a=>{const{resetError:r}=a;return t.jsx(ts,{onRetry:()=>{i(),r()}})},children:t.jsx(V.Suspense,{fallback:t.jsx(Be,{}),children:t.jsx(ss,{...s})})})}}),e[0]=s,e[1]=n):n=e[1],n}function ss(s){const e=q.c(38),{org:n,cdConnectionId:o,siteUrl:i}=s,{data:a}=ke.useSession(),r=a?.user?.id??"";let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const c=Re(l);let m;e[3]!==o||e[4]!==n||e[5]!==c||e[6]!==i?(m={selfClient:c,org:n,cdConnectionId:o,siteUrl:i},e[3]=o,e[4]=n,e[5]=c,e[6]=i,e[7]=m):m=e[7];const{cards:d}=Mn(m);let f;e[8]!==o||e[9]!==n||e[10]!==c||e[11]!==r?(f={selfClient:c,org:n,userId:r,cdConnectionId:o},e[8]=o,e[9]=n,e[10]=c,e[11]=r,e[12]=f):f=e[12];const{connect:u,connectingFieldKey:g,error:x}=Zn(f),[j,v]=V.useState(null);if(d.length===0)return null;const h=g!==null;let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(He,{}),e[13]=p):p=e[13];let y;e[14]!==x?(y=x&&t.jsx("p",{role:"alert",className:"mb-3 text-sm text-destructive",children:x}),e[14]=x,e[15]=y):y=e[15];let b;if(e[16]!==j||e[17]!==h||e[18]!==d||e[19]!==u||e[20]!==g||e[21]!==n||e[22]!==c||e[23]!==i){let _;e[25]!==j||e[26]!==h||e[27]!==u||e[28]!==g||e[29]!==n||e[30]!==c||e[31]!==i?(_=S=>{const O=async()=>{await u(S)&&v(S.fieldKey)};return t.jsx($n,{card:S,connecting:g===S.fieldKey,disabled:h&&g!==S.fieldKey,org:n,selfClient:c,siteUrl:i,autoOpenConfigFieldKey:j,onAutoOpenConfigHandled:()=>v(T=>T===S.fieldKey?null:T),onConnect:()=>{O()}},S.fieldKey)},e[25]=j,e[26]=h,e[27]=u,e[28]=g,e[29]=n,e[30]=c,e[31]=i,e[32]=_):_=e[32],b=d.map(_),e[16]=j,e[17]=h,e[18]=d,e[19]=u,e[20]=g,e[21]=n,e[22]=c,e[23]=i,e[24]=b}else b=e[24];let C;e[33]!==b?(C=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:b}),e[33]=b,e[34]=C):C=e[34];let w;return e[35]!==y||e[36]!==C?(w=t.jsxs("div",{className:Ge,children:[p,t.jsxs($e,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[min(60vh,calc(100dvh-330px))] md:flex-none",children:[y,C]})]}),e[35]=y,e[36]=C,e[37]=w):w=e[37],w}const Qe="https://decocms.com/agendar",os="Precisa de ajuda? Fale conosco",is="Agende uma chamada de 20 minutos e rodamos o diagnóstico com você, ao vivo.",ve=[{photo:"https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png",alt:"Especialista da deco"},{photo:"https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png",alt:"Especialista da deco"}],rs="var(--brand-green-dark)";function We({siteUrl:s,email:e}){const n=new URL(Qe);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function as(s){const e=q.c(12),{href:n,size:o,className:i,orgId:a}=s,r=n===void 0?Qe:n,l=o===void 0?"lg":o;let c;e[0]!==i?(c=oe("w-full",i),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=()=>ee("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=m):m=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(jt,{size:16}),e[4]=d):d=e[4];let f;e[5]!==r||e[6]!==m?(f=t.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",onClick:m,children:["Agendar uma reunião",d]}),e[5]=r,e[6]=m,e[7]=f):f=e[7];let u;return e[8]!==l||e[9]!==c||e[10]!==f?(u=t.jsx(H,{asChild:!0,variant:"outline",size:l,className:c,children:f}),e[8]=l,e[9]=c,e[10]=f,e[11]=u):u=e[11],u}function ls(s){const e=q.c(10),{size:n}=s,o=n===void 0?72:n;let i;e[0]!==o?(i=Math.round(o*.3),e[0]=o,e[1]=i):i=e[1];const a=i;let r;e[2]!==o?(r={height:o},e[2]=o,e[3]=r):r=e[3];let l;e[4]!==a||e[5]!==o?(l=ve.map((m,d)=>t.jsxs("div",{className:"relative shrink-0",style:{width:o,height:o,marginLeft:d===0?0:-a,zIndex:ve.length-d},children:[t.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:t.jsx("img",{src:m.photo,alt:m.alt,className:"h-full w-full object-cover",loading:"lazy"})}),d===0&&t.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[t.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),t.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},m.photo)),e[4]=a,e[5]=o,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==l?(c=t.jsx("div",{className:"flex items-end",style:r,children:l}),e[7]=r,e[8]=l,e[9]=c):c=e[9],c}function Ye(s){const e=q.c(6),{href:n,orgId:o}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"h-20",style:{backgroundColor:rs}}),e[0]=i):i=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"-mt-9 mb-4",children:t.jsx(ls,{})}),e[1]=a):a=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:os}),t.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:is})]}),e[2]=r):r=e[2];let l;return e[3]!==n||e[4]!==o?(l=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[i,t.jsxs("div",{className:"px-8 pb-8",children:[a,r,t.jsx(as,{href:n,size:"lg",className:"mt-6",orgId:o})]})]})}),e[3]=n,e[4]=o,e[5]=l):l=e[5],l}function cs(s){const e=q.c(13),{className:n,href:o,orgId:i}=s,a=o===void 0?Qe:o;let r;e[0]!==i?(r=()=>ee("commerce_onboarding_meeting_cta_clicked",{placement:"mobile_banner",organization_id:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n?(l=oe("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[2]=n,e[3]=l):l=e[3];let c,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(c={height:44,width:44+2*Math.round(30.799999999999997)},m=ve.map(ds),e[4]=c,e[5]=m):(c=e[4],m=e[5]);let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs("span",{className:"relative flex shrink-0 items-center",style:c,children:[m,t.jsx("span",{className:"absolute -right-0.5 -top-0.5 h-3 w-3 rounded-full border-2 border-card bg-success","aria-hidden":!0,style:{zIndex:ve.length+1}})]}),e[6]=d):d=e[6];let f,u;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("span",{className:"flex-1 text-base font-medium leading-5 text-foreground",children:["Precisa de ajuda?",t.jsx("br",{}),"Fale conosco"]}),u=t.jsx(jt,{size:18,className:"shrink-0 text-muted-foreground"}),e[7]=f,e[8]=u):(f=e[7],u=e[8]);let g;return e[9]!==a||e[10]!==r||e[11]!==l?(g=t.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",onClick:r,className:l,children:[d,f,u]}),e[9]=a,e[10]=r,e[11]=l,e[12]=g):g=e[12],g}function ds(s,e){return t.jsx("span",{className:"absolute block h-11 w-11 overflow-hidden rounded-full border-2 border-card",style:{left:e*Math.round(30.799999999999997),zIndex:ve.length-e},children:t.jsx("img",{src:s.photo,alt:s.alt,className:"h-full w-full object-cover",loading:"lazy"})},s.photo)}function St(s){const e=q.c(10),{host:n}=s,o=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let i,a,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=a,e[2]=r):(i=e[0],a=e[1],r=e[2]);let l;e[3]!==o?(l=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:o,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=o,e[4]=l):l=e[4];let c;e[5]!==n?(c=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=c):c=e[6];let m;return e[7]!==l||e[8]!==c?(m=t.jsxs("div",{className:"flex items-center gap-3",children:[i,a,r,l,c]}),e[7]=l,e[8]=c,e[9]=m):m=e[9],m}const us={workspace:"Preparando seu workspace de commerce...",generic:"Preparando..."};function ms(s){return us[s]}function Je(s){const e=q.c(4),{variant:n}=s;let o;e[0]!==n?(o=ms(n),e[0]=n,e[1]=o):o=e[1];let i;return e[2]!==o?(i=t.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:t.jsx(Le,{label:o,className:"text-muted-foreground"})}),e[2]=o,e[3]=i):i=e[3],i}function Po(){const s=q.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ps,{}),s[0]=e):e=s[0],e}const Nt=V.createContext(null),Et=()=>V.useContext(Nt);function se(s){const e=q.c(13);let n,o;e[0]!==s?({visual:o,...n}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/commerce-onboarding"},e[3]=i):i=e[3];const a=it(i),{data:r}=ke.useSession(),l=r?.user?.email;let c;e[4]!==a.siteUrl||e[5]!==l?(c=We({siteUrl:a.siteUrl,email:l}),e[4]=a.siteUrl,e[5]=l,e[6]=c):c=e[6];const m=c;let d;e[7]!==m||e[8]!==o?(d=o??t.jsx(Ye,{href:m}),e[7]=m,e[8]=o,e[9]=d):d=e[9];let f;return e[10]!==n||e[11]!==d?(f=t.jsx(Rt,{...n,visual:d}),e[10]=n,e[11]=d,e[12]=f):f=e[12],f}const fs={signUpFailed:"Falha ao criar conta",signInFailed:"Falha ao entrar",authenticationFailed:"Falha na autenticação",resetEmailFailed:"Não foi possível enviar o e-mail de redefinição",otpSendFailed:"Não foi possível enviar o código",invalidCode:"Código inválido",invalidEmail:"E-mail inválido",invalidEmailOrPassword:"E-mail ou senha inválidos. Tente novamente.",accountExists:"Já existe uma conta com este e-mail. Tente entrar em vez de criar uma nova conta.",networkError:"Erro de rede. Verifique sua conexão e tente novamente.",tooManyAttempts:"Muitas tentativas. Aguarde um momento e tente novamente.",invalidOrExpiredCode:"Código inválido ou expirado. Tente novamente.",genericError:"Algo deu errado. Tente novamente.",resetPasswordTitle:"Redefinir sua senha",verificationCodeTitle:"Informe o código de verificação",welcomeTitle:"Bem-vindo à deco",resetPasswordSubtitle:"Enviaremos um link de redefinição",codeSentTo:s=>`Código enviado para ${s}`,defaultSubtitle:"Entre ou crie uma nova conta",resetEmailSent:"Verifique seu e-mail para redefinir a senha.",continueWith:s=>`Continuar com ${s}`,divider:"ou",emailLabel:"E-mail",emailPlaceholder:"Endereço de e-mail",sending:"Enviando...",sendCode:"Enviar código",verificationCodeLabel:"Código de verificação",enterCodePlaceholder:"Informe o código",verifying:"Verificando...",verify:"Verificar",useDifferentEmail:"Usar outro e-mail",sendResetLink:"Enviar link de redefinição",nameLabel:"Nome",namePlaceholder:"Seu nome",passwordLabel:"Senha",forgotPassword:"Esqueceu a senha?",creatingAccount:"Criando conta...",signingIn:"Entrando...",continue:"Continuar",backToSignIn:"Voltar para entrar",signInWithPassword:"Entrar com senha",alreadyHaveAccount:"Já tem uma conta? ",dontHaveAccount:"Não tem uma conta? ",signIn:"Entrar",signUp:"Criar conta",signInWithEmailCode:"Entrar com código por e-mail"};function pe(s){if(!s)return null;const e=ae(s);return e.ok?new URL(e.value).hostname:null}function tt(s){switch(s){case"Enter a website URL.":return"Informe a URL de um site.";case"Use an HTTP or HTTPS website URL.":return"Use uma URL de site HTTP ou HTTPS.";case"Enter a valid website URL.":return"Informe uma URL de site válida.";default:return s}}let nt=!1;function ps(){const s=it({from:"/commerce-onboarding"}),{org:e,siteUrl:n}=s,o=pe(n);return!nt&&Tt()&&(nt=!0,ee("commerce_onboarding_viewed",{site_url:n,domain:o??void 0,...o?{$set:{last_scanned_domain:o}}:{}})),t.jsx(Nt.Provider,{value:o,children:t.jsx(gs,{requestedOrgSlug:e,siteUrl:n})})}function gs(s){const e=q.c(8),{requestedOrgSlug:n,siteUrl:o}=s,{data:i,isPending:a}=ke.useSession(),r=Et();if(a){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(se,{children:t.jsx(Je,{variant:"generic"})}),e[0]=c):c=e[0],c}if(!i){const c=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==r?(m=r?t.jsx(St,{host:r}):void 0,e[1]=r,e[2]=m):m=e[2];let d;return e[3]!==m?(d=t.jsx(se,{children:t.jsx(kt,{callbackUrl:c,allowAutoLogin:!1,title:"Desbloqueie seu diagnóstico completo",subtitle:null,brand:m,copy:fs})}),e[3]=m,e[4]=d):d=e[4],d}let l;return e[5]!==n||e[6]!==o?(l=t.jsx(hs,{requestedOrgSlug:n,siteUrl:o}),e[5]=n,e[6]=o,e[7]=l):l=e[7],l}function hs(s){const e=q.c(40),{requestedOrgSlug:n,siteUrl:o}=s,i=rt(),a=Ot(),[r,l]=V.useState(null),[c,m]=V.useState(null),d=a.data?.map(ys)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:xs,retry:!1,onSuccess:p=>{m(p)}},e[0]=f):f=e[0];const u=fe(f);if(a.isPending){let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(se,{children:t.jsx(Je,{variant:"workspace"})}),e[1]=p):p=e[1],p}if(a.error){let p;return e[2]!==a?(p=t.jsx(Oe,{title:"Não foi possível carregar suas organizações",description:"Tente novamente para continuar a configuração de commerce nesta página.",actionLabel:"Tentar novamente",onRetry:()=>a.refetch()}),e[2]=a,e[3]=p):p=e[3],p}const g=n?d.find(p=>p.slug===n):null;if(g){let p;return e[4]!==g||e[5]!==o?(p=t.jsx(Ie,{org:g,initialSiteUrl:o}),e[4]=g,e[5]=o,e[6]=p):p=e[6],p}if(n){let p;return e[7]!==a?(p=t.jsx(Oe,{title:"Organização não encontrada",description:"Não conseguimos encontrar essa organização na sua conta.",actionLabel:"Tentar novamente",onRetry:()=>a.refetch()}),e[7]=a,e[8]=p):p=e[8],p}if(r){let p;return e[9]!==r||e[10]!==o?(p=t.jsx(Ie,{org:r,initialSiteUrl:o}),e[9]=r,e[10]=o,e[11]=p):p=e[11],p}if(d.length===1&&d[0]){let p;return e[12]!==d[0]||e[13]!==o?(p=t.jsx(Ie,{org:d[0],initialSiteUrl:o}),e[12]=d[0],e[13]=o,e[14]=p):p=e[14],p}if(d.length>1){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(re,{title:"Escolha uma organização",description:"Selecione onde o diagnóstico de commerce deve continuar."}),e[15]=p):p=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=C=>l(C),e[16]=y):y=e[16];let b;return e[17]!==d?(b=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[p,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Ze,{organizations:d,selectLabel:"Continuar",onSelected:y})})]})}),e[17]=d,e[18]=b):b=e[18],b}if(!c){let p;e[19]!==u?(p=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=p):p=e[20];let y;return e[21]!==u||e[22]!==p?(y=t.jsx(bs,{mutation:u,onRetry:p}),e[21]=u,e[22]=p,e[23]=y):y=e[23],y}const x=c;if(x?.success&&(x.status==="created"||x.status==="joined"||x.status==="already_has_organization")&&x.organization){let p;return e[24]!==x.organization||e[25]!==o?(p=t.jsx(Ie,{org:x.organization,initialSiteUrl:o}),e[24]=x.organization,e[25]=o,e[26]=p):p=e[26],p}if(x?.status==="ambiguous"&&x.organizations&&x.organizations.length>0){let p;e[27]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(re,{title:"Escolha uma organização",description:"Seu e-mail pode acessar mais de uma organização. Escolha onde a configuração de commerce deve continuar."}),e[27]=p):p=e[27];const y=x.domain??void 0;let b;e[28]!==i||e[29]!==o?(b=(w,_)=>{at(),l({...w,slug:_}),i({to:"/commerce-onboarding",search:{org:_,siteUrl:o}})},e[28]=i,e[29]=o,e[30]=b):b=e[30];let C;return e[31]!==x.organizations||e[32]!==y||e[33]!==b?(C=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[p,t.jsx($e,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Ze,{organizations:x.organizations,domain:y,onJoined:b})})]})}),e[31]=x.organizations,e[32]=y,e[33]=b,e[34]=C):C=e[34],C}const j=x?.error??"Não conseguimos determinar uma organização de commerce para esta conta.";let v;e[35]!==u?(v=()=>{m(null),u.reset()},e[35]=u,e[36]=v):v=e[36];let h;return e[37]!==j||e[38]!==v?(h=t.jsx(Oe,{title:"O onboarding de commerce precisa de suporte",description:j,actionLabel:"Tentar novamente",onRetry:v}),e[37]=j,e[38]=v,e[39]=h):h=e[39],h}async function xs(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&at(),e}function ys(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function bs(s){const e=q.c(7),{mutation:n,onRetry:o}=s,i=V.useRef(!1);let a;e[0]!==n?(a=m=>{!m||i.current||(i.current=!0,n.mutate())},e[0]=n,e[1]=a):a=e[1];const r=a;if(n.error){let m;return e[2]!==o?(m=t.jsx(Oe,{title:"Onboarding de commerce indisponível",description:"Não foi possível preparar uma organização para a configuração de commerce. Tente novamente por esta página ou fale com o suporte.",actionLabel:"Tentar novamente",onRetry:o}),e[2]=o,e[3]=m):m=e[3],m}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Je,{variant:"generic"}),e[4]=l):l=e[4];let c;return e[5]!==r?(c=t.jsx(se,{children:t.jsx("div",{ref:r,children:l})}),e[5]=r,e[6]=c):c=e[6],c}function re(s){const e=q.c(8),{title:n,description:o}=s,i=Et();let a;e[0]!==i?(a=i?t.jsx(St,{host:i}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=i,e[1]=a):a=e[1];let r;e[2]!==o||e[3]!==n?(r=(n||o)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),o&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:o})]}),e[2]=o,e[3]=n,e[4]=r):r=e[4];let l;return e[5]!==a||e[6]!==r?(l=t.jsxs("div",{className:"grid gap-10",children:[a,r]}),e[5]=a,e[6]=r,e[7]=l):l=e[7],l}function Oe(s){const e=q.c(9),{title:n,description:o,actionLabel:i,onRetry:a}=s;let r;e[0]!==o||e[1]!==n?(r=t.jsx(re,{title:n,description:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2];let l;e[3]!==i||e[4]!==a?(l=t.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:a,children:i}),e[3]=i,e[4]=a,e[5]=l):l=e[5];let c;return e[6]!==r||e[7]!==l?(c=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[r,l]})}),e[6]=r,e[7]=l,e[8]=c):c=e[8],c}function vs(s){return s.content?.find(e=>e.text)?.text??"A configuração do Commerce Discovery falhou."}function we(s){const e=s;if(e.isError)throw new Error(vs(e));return e.structuredContent??s}function Ie(s){const e=q.c(11),{org:n,initialSiteUrl:o}=s,{data:i}=ke.useSession(),a=i?.user?.email;let r;e[0]!==o||e[1]!==a?(r=We({siteUrl:o,email:a}),e[0]=o,e[1]=a,e[2]=r):r=e[2];const l=r;let c;e[3]!==l||e[4]!==n.id?(c=t.jsx(Ye,{href:l,orgId:n.id}),e[3]=l,e[4]=n.id,e[5]=c):c=e[5];const m=c;let d;return e[6]!==o||e[7]!==m||e[8]!==n||e[9]!==i?.user?.email?(d=t.jsx(st,{children:f=>{const{reset:u}=f;return t.jsx(ot,{fallback:g=>{const{error:x,resetError:j}=g;return t.jsx(se,{visual:m,children:t.jsx(js,{orgName:n.name,message:x instanceof Error?x.message:"Não foi possível verificar a configuração do Commerce Discovery.",onRetry:()=>{u(),j()}})})},children:t.jsx(V.Suspense,{fallback:t.jsx(wt,{visual:m}),children:t.jsx(Cs,{org:n,initialSiteUrl:o,sessionEmail:i?.user?.email},`${n.id}:${o??""}`)})})}}),e[6]=o,e[7]=m,e[8]=n,e[9]=i?.user?.email,e[10]=d):d=e[10],d}function wt(s){const e=q.c(3),{visual:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[t.jsx(re,{}),t.jsx(Be,{})]}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=t.jsx(se,{align:"fill",visual:n,children:o}),e[1]=n,e[2]=i):i=e[2],i}function js(s){const e=q.c(10),{orgName:n,message:o,onRetry:i}=s,a=`A configuração de commerce continuará em ${n}.`;let r;e[0]!==a?(r=t.jsx(re,{title:"Diagnóstico de commerce",description:a}),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==o?(l=t.jsx(je,{message:o}),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==i?(c=t.jsx(H,{type:"button",size:"xl",className:"w-full",onClick:i,children:"Tentar novamente"}),e[4]=i,e[5]=c):c=e[5];let m;return e[6]!==r||e[7]!==l||e[8]!==c?(m=t.jsxs("div",{className:"grid gap-10",children:[r,l,c]}),e[6]=r,e[7]=l,e[8]=c,e[9]=m):m=e[9],m}function Cs({org:s,initialSiteUrl:e,sessionEmail:n}){const o=rt(),i=Re({connectionId:lt,orgId:s.id,orgSlug:s.slug}),[a,r]=V.useState(e??""),[l,c]=V.useState(null),[m,d]=V.useState(null),f=V.useRef(!1),u=De.COMMERCE_DISCOVERY(s.id),g=Pt(s.id),x=ge({queryKey:Y.commerceDiscoveryConnection(s.id,u),queryFn:async()=>{const E=await i.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:u}});return we(E)},retry:!1}),j=ge({queryKey:Y.commerceDiscoveryVirtualMcp(s.id,g),queryFn:async()=>{const E=await i.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:g}});return we(E)},retry:!1}),v=fe({mutationFn:async E=>{const I=await i.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:E}});return we(I)},retry:!1,onSuccess:(E,I)=>{ee("commerce_onboarding_setup_succeeded",{domain:pe(I)??void 0,organization_id:s.id}),c(E),d(null),x.refetch(),j.refetch()},onError:(E,I)=>{ee("commerce_onboarding_setup_failed",{domain:pe(I)??void 0,organization_id:s.id,error:E instanceof Error?E.message:String(E)}),d(E instanceof Error?E.message:"A configuração do Commerce Discovery falhou.")}}),h=fe({mutationFn:async E=>{const I=await i.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:E}});return we(I)},retry:!1}),[p,y]=V.useState(null),b=!!x.data.item&&!!j.data.item,C=x.data.item,w=typeof C?.metadata?.siteUrl=="string"?C.metadata.siteUrl:void 0,S=Zt(e||a||"",w),O=b&&S,T=e||a||w||"",k=We({siteUrl:T,email:n}),N=t.jsx(Ye,{href:k,orgId:s.id}),L=E=>{const I=ae(E);if(!I.ok){d(tt(I.error));return}d(null),v.mutate(I.value)},z=E=>{!E||f.current||O||!e||(f.current=!0,L(e))},P=E=>{E.preventDefault();const I=ae(a);I.ok&&ee("commerce_onboarding_site_url_submitted",{domain:new URL(I.value).hostname,organization_id:s.id}),L(a)},F=l?.reportApp??{connectionId:u,virtualMcpId:g,toolName:$t},M=async()=>{y(null),ee("commerce_onboarding_open_report_clicked",{domain:pe(T)??void 0,organization_id:s.id});const E=ae(T);if(E.ok)try{const I=await h.mutateAsync(E.value);if(!I.triggered){ee("commerce_onboarding_run_failed",{domain:pe(T)??void 0,organization_id:s.id,error:I.reason??"not_triggered"}),y("Não foi possível gerar o relatório para este site. Recarregue a página e tente novamente.");return}}catch(I){ee("commerce_onboarding_run_failed",{domain:pe(T)??void 0,organization_id:s.id,error:I instanceof Error?I.message:String(I)}),y("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(At.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:s.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:F.virtualMcpId,main:Lt(F.connectionId,F.toolName),chat:0}})};if(O)return t.jsx(_s,{org:s,reportApp:F,onOpenReport:M,isSubmitting:h.isPending,error:p,meetingUrl:k,meetingVisual:N,siteUrl:T});if(v.isPending)return t.jsx(wt,{visual:N});if(e){const E=ae(e);return E.ok?t.jsx(se,{visual:N,children:t.jsxs("div",{ref:z,className:"grid gap-10",children:[t.jsx(re,{title:"Diagnóstico de commerce",description:`O Commerce Discovery está sendo preparado para ${E.value}.`}),m?t.jsxs(t.Fragment,{children:[t.jsx(je,{message:m}),t.jsx(Pe,{siteUrl:a,error:null,isSubmitting:v.isPending,onSiteUrlChange:r,onSubmit:P})]}):t.jsx(Be,{})]})}):t.jsx(se,{visual:N,children:t.jsxs("div",{className:"grid gap-10",children:[t.jsx(re,{title:"Diagnóstico de commerce",description:`A configuração de commerce continuará em ${s.name}.`}),t.jsx(je,{message:tt(E.error)}),t.jsx(Pe,{siteUrl:a,error:m,isSubmitting:v.isPending,onSiteUrlChange:r,onSubmit:P})]})})}return t.jsx(se,{visual:N,children:t.jsxs("div",{className:"grid gap-10",children:[t.jsx(re,{title:"Diagnóstico de commerce",description:`A configuração de commerce continuará em ${s.name}.`}),t.jsx(Pe,{siteUrl:a,error:m,isSubmitting:v.isPending,onSiteUrlChange:r,onSubmit:P})]})})}function Pe(s){const e=q.c(20),{siteUrl:n,error:o,isSubmitting:i,onSiteUrlChange:a,onSubmit:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"URL do site"}),e[0]=l):l=e[0];let c;e[1]!==a?(c=v=>a(v.target.value),e[1]=a,e[2]=c):c=e[2];const m=!!o;let d;e[3]!==i||e[4]!==n||e[5]!==c||e[6]!==m?(d=t.jsx(ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:c,placeholder:"https://example.com","aria-invalid":m,disabled:i}),e[3]=i,e[4]=n,e[5]=c,e[6]=m,e[7]=d):d=e[7];let f;e[8]!==o?(f=o?t.jsx(je,{message:o}):null,e[8]=o,e[9]=f):f=e[9];let u;e[10]!==d||e[11]!==f?(u=t.jsxs("div",{className:"grid gap-2",children:[l,d,f]}),e[10]=d,e[11]=f,e[12]=u):u=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(ct,{size:16}),e[13]=g):g=e[13];let x;e[14]!==i?(x=t.jsxs(H,{type:"submit",size:"xl",className:"w-full",disabled:i,children:["Continuar",g]}),e[14]=i,e[15]=x):x=e[15];let j;return e[16]!==r||e[17]!==u||e[18]!==x?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,x]}),e[16]=r,e[17]=u,e[18]=x,e[19]=j):j=e[19],j}function _s(s){const e=q.c(27),{org:n,reportApp:o,onOpenReport:i,isSubmitting:a,error:r,meetingUrl:l,meetingVisual:c,siteUrl:m}=s;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(re,{}),e[0]=d):d=e[0];let f;e[1]!==n||e[2]!==o.connectionId||e[3]!==m?(f=t.jsx(ns,{org:n,cdConnectionId:o.connectionId,siteUrl:m}),e[1]=n,e[2]=o.connectionId,e[3]=m,e[4]=f):f=e[4];let u;e[5]!==l||e[6]!==n.id?(u=t.jsx(cs,{className:"md:hidden",href:l,orgId:n.id}),e[5]=l,e[6]=n.id,e[7]=u):u=e[7];let g;e[8]!==r?(g=r?t.jsx(je,{message:r}):null,e[8]=r,e[9]=g):g=e[9];const x=a||!o.virtualMcpId,j=a?"Abrindo relatório...":"Ver relatório completo";let v;e[10]!==a?(v=a?null:t.jsx(ct,{size:18}),e[10]=a,e[11]=v):v=e[11];let h;e[12]!==i||e[13]!==x||e[14]!==j||e[15]!==v?(h=t.jsxs(H,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:i,disabled:x,children:[j,v]}),e[12]=i,e[13]=x,e[14]=j,e[15]=v,e[16]=h):h=e[16];let p;e[17]!==u||e[18]!==g||e[19]!==h?(p=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[u,g,h]}),e[17]=u,e[18]=g,e[19]=h,e[20]=p):p=e[20];let y;e[21]!==f||e[22]!==p?(y=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[d,f,p]}),e[21]=f,e[22]=p,e[23]=y):y=e[23];let b;return e[24]!==c||e[25]!==y?(b=t.jsx(se,{align:"fill",visual:c,children:y}),e[24]=c,e[25]=y,e[26]=b):b=e[26],b}function je(s){const e=q.c(2),{message:n}=s;let o;return e[0]!==n?(o=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=o):o=e[1],o}export{Po as default};
|
package/dist/client/assets/{connect-desktop-dialog-C2RqlRpL.js → connect-desktop-dialog-B74CcFZn.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,D as w,K as z,k as M,j as s,r as T,B as I,l as L}from"./index-
|
|
1
|
+
import{c as v,D as w,K as z,k as M,j as s,r as T,B as I,l as L}from"./index-C0TYFVlh.js";import{a as S,b as D,c as E,d as R,e as _}from"./dialog-Daex6yYW.js";import{S as $}from"./chat-context-DVV9F_7K.js";import{i as A}from"./ChevronUp-jdmVgYm6.js";import{a as B}from"./Eye-lKdW_90A.js";import{u as F}from"./studio-tools-BcsWT94-.js";const y={online:!1,capabilities:[],ready:!1};function K(a){const e=v.c(9),{org:n}=w(),i=F(),o=a?.fast??!1;let t;e[0]!==n.id?(t=z.currentLink(n.id),e[0]=n.id,e[1]=t):t=e[1];let l;e[2]!==i?(l=async()=>{const u=await i.call("LINK_CURRENT_GET",{});return u?{...u,ready:!0}:{...y,ready:!0}},e[2]=i,e[3]=l):l=e[3];const d=o?1e3:1e4,g=o?2e3:15e3;let r;e[4]!==t||e[5]!==l||e[6]!==d||e[7]!==g?(r={queryKey:t,queryFn:l,staleTime:d,refetchInterval:g,refetchOnWindowFocus:!0},e[4]=t,e[5]=l,e[6]=d,e[7]=g,e[8]=r):r=e[8];const{data:c}=M(r);return c??y}function O(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}function P(a){const e=v.c(3),{size:n}=a,i=n===void 0?16:n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=o):o=e[0];let t;return e[1]!==i?(t=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:i,height:i,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:o}),e[1]=i,e[2]=t):t=e[2],t}const N="bunx decocms@latest link",k=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(O,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(P,{size:18})}];function U(a){return k.filter(e=>a.includes(e.capability)).map(e=>e.label)}function J(a){const e=v.c(23),{open:n,onOpenChange:i}=a;let o;e[0]!==n?(o={fast:n},e[0]=n,e[1]=o):o=e[1];const t=K(o),[l,d]=T.useState(!1),g=t.hostname??t.machineId??"Your desktop",r=t.online?`Connected to ${g}`:"Connect your desktop";let c;e[2]!==r?(c=s.jsx(S,{children:r}),e[2]=r,e[3]=c):c=e[3];const u=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let m;e[4]!==u?(m=s.jsx(D,{children:u}),e[4]=u,e[5]=m):m=e[5];let x;e[6]!==c||e[7]!==m?(x=s.jsxs(E,{children:[c,m]}),e[6]=c,e[7]=m,e[8]=x):x=e[8];let f;e[9]!==l||e[10]!==t.online?(f=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:N}),s.jsx(I,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(N),d(!0),setTimeout(()=>d(!1),1500)},children:l?s.jsx(A,{size:14}):s.jsx(B,{size:14})})]}),e[9]=l,e[10]=t.online,e[11]=f):f=e[11];let p;e[12]!==t.capabilities||e[13]!==t.online?(p=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:k.map(b=>{const C=t.capabilities.includes(b.capability);return s.jsxs("div",{className:L("flex items-center gap-3 rounded-md border px-3 py-2",C?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:L("flex size-6 items-center justify-center",C?"text-foreground":"text-muted-foreground"),children:b.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:b.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:C?b.description:"Not detected"})]}),s.jsx("span",{className:L("size-2 rounded-full",C?"bg-success":"bg-muted-foreground/30")})]},b.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx($,{size:"sm"}),"Waiting for desktop…"]}),e[12]=t.capabilities,e[13]=t.online,e[14]=p):p=e[14];let h;e[15]!==x||e[16]!==f||e[17]!==p?(h=s.jsxs(R,{className:"sm:max-w-md",children:[x,f,p]}),e[15]=x,e[16]=f,e[17]=p,e[18]=h):h=e[18];let j;return e[19]!==i||e[20]!==n||e[21]!==h?(j=s.jsx(_,{open:n,onOpenChange:i,children:h}),e[19]=i,e[20]=n,e[21]=h,e[22]=j):j=e[22],j}export{J as C,O as a,P as b,K as u,U as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,D as $,b0 as k,K as D,l as E,j as x}from"./index-
|
|
1
|
+
import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,D as $,b0 as k,K as D,l as E,j as x}from"./index-C0TYFVlh.js";import{u as K}from"./use-registry-connections-CQYPRxSJ.js";import{b as Q}from"./use-organization-settings-D1yLMBJn.js";import{S as w,e as F}from"./use-mcp-client-C7QL8E14.js";import{u as H}from"./useInfiniteQuery-CKp9Qy8F.js";import{i as q,f as G}from"./extract-connection-data-Dv2pahl1.js";import{C as U}from"./card-BaddKT88.js";import{I as V}from"./integration-icon-DDqEpkh3.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
|