decocms 3.93.0 → 3.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CPsUqb9w.js → AlertCircle-CVgQ7AOT.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DtS0Ql0c.js → ArrowUpRight-C9ykLtuj.js} +1 -1
- package/dist/client/assets/{CheckCircle-BolkWLNV.js → CheckCircle-H3pWKPYO.js} +1 -1
- package/dist/client/assets/{ChevronDown-Br0JyxxI.js → ChevronDown-DO3o3y5M.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DYKFs25Z.js → ChevronLeft-B7B0rGOG.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bb3fYro8.js → ChevronRight-D_tkXjWo.js} +1 -1
- package/dist/client/assets/{ChevronUp-9AmI2r-8.js → ChevronUp-u7VhfB08.js} +1 -1
- package/dist/client/assets/{DotsVertical-BWvAFXp6.js → DotsVertical-Cauolc8c.js} +1 -1
- package/dist/client/assets/{Eye-BeU9HzvI.js → Eye-C8Vfx0-4.js} +1 -1
- package/dist/client/assets/{FilterLines-BjafZAm6.js → FilterLines-DmVqY61b.js} +1 -1
- package/dist/client/assets/{Globe01-BaODUE4b.js → Globe01-B2Kb3oGL.js} +1 -1
- package/dist/client/assets/{Globe04-CeW5Z0Kh.js → Globe04-yg-G_BoN.js} +1 -1
- package/dist/client/assets/{HardDrive-BKjshHXk.js → HardDrive-Ct0X1WYx.js} +1 -1
- package/dist/client/assets/{Key01-CkNZEW2T.js → Key01-CYbGr3H3.js} +1 -1
- package/dist/client/assets/{LayoutLeft-AxfIYgPW.js → LayoutLeft-hqAstg8m.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DVLkc3K_.js → LinkExternal01-DFDKnuS_.js} +1 -1
- package/dist/client/assets/{Monitor01-C6fIMnPI.js → Monitor01-CjEGYbhQ.js} +1 -1
- package/dist/client/assets/{Palette-Du7PwJ5T.js → Palette-BrlikOjU.js} +1 -1
- package/dist/client/assets/{Play-YBZX5ZLG.js → Play-DsnYqyFF.js} +1 -1
- package/dist/client/assets/{Plus-CJK_Z_9l.js → Plus-BCyb-AcQ.js} +1 -1
- package/dist/client/assets/{SearchMd-Bu6i-7O-.js → SearchMd-pgxE25ht.js} +1 -1
- package/dist/client/assets/{Settings02-ClyP-nns.js → Settings02-BVbp_ypE.js} +1 -1
- package/dist/client/assets/{Shield01-BjFKeQ_N.js → Shield01-CDrsrKsk.js} +1 -1
- package/dist/client/assets/{Star01-D1d9bklt.js → Star01-BQYePq21.js} +1 -1
- package/dist/client/assets/{Stars01-C8smcBql.js → Stars01-BYz6LBgx.js} +1 -1
- package/dist/client/assets/{Stars02-B5rq9Mzt.js → Stars02-DToeu8SC.js} +1 -1
- package/dist/client/assets/{Sun-DodPsLp-.js → Sun-Ct9UUaO-.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-kAH8gjqT.js → SwitchHorizontal01-CUGpid9A.js} +1 -1
- package/dist/client/assets/{Tool01-Rpx-Fbsn.js → Tool01-qCeqaIYR.js} +1 -1
- package/dist/client/assets/{Trash01-Dyf1A0dZ.js → Trash01-BQ-tGqiC.js} +1 -1
- package/dist/client/assets/{Upload01-XbcBo5aV.js → Upload01-D4__IfBX.js} +1 -1
- package/dist/client/assets/{User01-BfBqwqiZ.js → User01-CxCzzEeX.js} +1 -1
- package/dist/client/assets/{Users01-CPlN96Ae.js → Users01-Cw-lssyZ.js} +1 -1
- package/dist/client/assets/{Users03-BrHC1wzv.js → Users03-BfmtQGSl.js} +1 -1
- package/dist/client/assets/{X-dsSDVl3-.js → X-CiAMFEWO.js} +1 -1
- package/dist/client/assets/{XCircle-D9bIJ2aG.js → XCircle-CoU_Hwe9.js} +1 -1
- package/dist/client/assets/{XClose-gI66KzDJ.js → XClose-BEAZpPEi.js} +1 -1
- package/dist/client/assets/{Zap-Cg8ncZ4g.js → Zap-BZ2VPUiO.js} +1 -1
- package/dist/client/assets/{ZapSquare-D0HzXU-T.js → ZapSquare-DiyzHRy2.js} +1 -1
- package/dist/client/assets/{ZoomOut-BzN_Ms7a.js → ZoomOut-DV_1o0PM.js} +1 -1
- package/dist/client/assets/{access-gate-CJ0Kwc3B.js → access-gate-COlpF0HW.js} +1 -1
- package/dist/client/assets/{add-section-modal-BieWS4zs.js → add-section-modal-CT6eQ2rC.js} +1 -1
- package/dist/client/assets/{agent-icon-zFcUURp0.js → agent-icon-NQ_Mk8_8.js} +1 -1
- package/dist/client/assets/{agents-list-BHA72N6X.js → agents-list-Co2Ggucu.js} +1 -1
- package/dist/client/assets/{ai-providers-Bc8lgoXa.js → ai-providers-CFpS67kU.js} +1 -1
- package/dist/client/assets/{alert-ClVBr42M.js → alert-BHi_IhB_.js} +1 -1
- package/dist/client/assets/{alert-dialog-1_FLDsv-.js → alert-dialog-BN65AiTi.js} +1 -1
- package/dist/client/assets/{app-editor-B82yAEWL.js → app-editor-CVsSmOXB.js} +1 -1
- package/dist/client/assets/{auth-Brn3FIq2.js → auth-BFkL4ufW.js} +1 -1
- package/dist/client/assets/{auth-catchall-B4CdMBde.js → auth-catchall-B7BFjX4w.js} +1 -1
- package/dist/client/assets/{auth-entry-Bu37HmBx.js → auth-entry-COL91flc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DdFuJpuY.js → auth-split-layout-BKBH2tBP.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DpasRxwB.js → authenticate-and-persist-oauth-DOKW32kF.js} +1 -1
- package/dist/client/assets/{automation-list-row-AaVS_thW.js → automation-list-row-Dq2Md0L2.js} +1 -1
- package/dist/client/assets/{automation-runs-CtBNdoCw.js → automation-runs-DxeqbBMl.js} +1 -1
- package/dist/client/assets/{automations-CaFTE7ZZ.js → automations-RKi2obC6.js} +1 -1
- package/dist/client/assets/{avatar-Bbv-vQmP.js → avatar-Oz8Lqgg4.js} +1 -1
- package/dist/client/assets/{badge-ntRHb2xe.js → badge-ho6xrCP4.js} +1 -1
- package/dist/client/assets/{block-document-CUi8tPcs.js → block-document-nMujhCPS.js} +1 -1
- package/dist/client/assets/{brand-context-2LkdpcNZ.js → brand-context-DcWPjFjP.js} +1 -1
- package/dist/client/assets/{buckets-DDlFW7BW.js → buckets-P0twp-Lm.js} +1 -1
- package/dist/client/assets/{capability-load-error-D4gZOly9.js → capability-load-error-DFTjyVYx.js} +1 -1
- package/dist/client/assets/{card-TqCh9vpE.js → card-PDEPm9MW.js} +1 -1
- package/dist/client/assets/{category-editor-DKUiS2HO.js → category-editor-DvGGcAON.js} +1 -1
- package/dist/client/assets/{chat-context-ZvIoYXlE.js → chat-context-JTwjeHTY.js} +1 -1
- package/dist/client/assets/{checkbox-CjmwO_qQ.js → checkbox-DiUfEdXJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Qxw92IEP.js → cli-auth-success-v2tuS2CA.js} +1 -1
- package/dist/client/assets/{collection-detail-BluOmLke.js → collection-detail-BexHPDmG.js} +1 -1
- package/dist/client/assets/{collection-display-button-Bl1k9hmZ.js → collection-display-button-DRtWEjmQ.js} +1 -1
- package/dist/client/assets/{collection-search-rvdULW19.js → collection-search-DFAr6GQp.js} +1 -1
- package/dist/client/assets/{collection-tabs-Dbzrj6g8.js → collection-tabs-Lxahjwi-.js} +1 -1
- package/dist/client/assets/{command-xiPyikST.js → command-Cd-mPIB0.js} +1 -1
- package/dist/client/assets/commerce-onboarding-9AsTn3E2.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-CdehM8HT.js → connect-desktop-dialog-D-0UYkrF.js} +1 -1
- package/dist/client/assets/{connection-card-CCUMmOJp.js → connection-card-CQKxBh27.js} +1 -1
- package/dist/client/assets/{connection-detail-DU-yhlHH.js → connection-detail-DCn0Q_rd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DwyZsmC2.js → connection-form-helpers-D9S11tHo.js} +1 -1
- package/dist/client/assets/{connections-TTpLAoSx.js → connections-BhO5lMQN.js} +1 -1
- package/dist/client/assets/{context-menu-C2_IMfFs.js → context-menu-DfXylCjH.js} +1 -1
- package/dist/client/assets/{decopilot-BfvheG4H.js → decopilot-Cdi5SbXT.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-gPcdIlzZ.js → decopilot-sse-pool-DBKZPhuP.js} +1 -1
- package/dist/client/assets/{dialog-DNLq7rFW.js → dialog-B2DoU3ik.js} +1 -1
- package/dist/client/assets/{domain-settings-DL5sm-Tx.js → domain-settings-DiYR0YK6.js} +1 -1
- package/dist/client/assets/{drawer-DVmSmGnj.js → drawer-CnIonxgu.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Cm5anyRF.js → dropdown-menu-C_iz5wEu.js} +1 -1
- package/dist/client/assets/{empty-state-BFpBC4xM.js → empty-state-Ccc7wvcy.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B-Wrpl8q.js → extract-connection-data-D2gQKJCU.js} +1 -1
- package/dist/client/assets/{file-explorer-u0QHw7Ux.js → file-explorer-DkkhrQYG.js} +1 -1
- package/dist/client/assets/{file-type-icon-CHCPvP7h.js → file-type-icon-C05PEJrX.js} +1 -1
- package/dist/client/assets/{files-2TRWMcXR.js → files-BYWkFvwm.js} +1 -1
- package/dist/client/assets/{form-ot5ixpyH.js → form-DNh2q8t4.js} +1 -1
- package/dist/client/assets/{general-DVWcKhSH.js → general-BOUVk894.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BRoi9lFR.js → github-repo-picker-Dl9Wu-Ij.js} +1 -1
- package/dist/client/assets/{hooks-BzM98nK3.js → hooks-CMI_9fmc.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-JCrtglrI.js → import-from-deco-dialog-BOm9c3ra.js} +1 -1
- package/dist/client/assets/{index-CTcesiMm.js → index-73tVSzqh.js} +1 -1
- package/dist/client/assets/index-B1Be6Vk-.css +1 -0
- package/dist/client/assets/{index-C39E3PwA.js → index-BBs9Cr8d.js} +5 -5
- package/dist/client/assets/{index-CCFPAqFW.js → index-BgN9pI07.js} +1 -1
- package/dist/client/assets/{index-Z9CY6YwJ.js → index-C2eVEqgk.js} +1 -1
- package/dist/client/assets/{index-y4n-lKYx.js → index-CAaHR2ia.js} +1 -1
- package/dist/client/assets/{index-CSc53yD2.js → index-CBSe4ASl.js} +1 -1
- package/dist/client/assets/{index-D8YsxgRv.js → index-DLktrx94.js} +1 -1
- package/dist/client/assets/{index-DZm2C9d-.js → index-DNsPZaO7.js} +1 -1
- package/dist/client/assets/{index-B8-rjD8O.js → index-DVooRj31.js} +1 -1
- package/dist/client/assets/{index-EIfjWvhU.js → index-Dk42mrp5.js} +1 -1
- package/dist/client/assets/{index-BLwOjDz-.js → index-DptZZauK.js} +3 -3
- package/dist/client/assets/{index-QXhoa99l.js → index-ES9ctbJi.js} +1 -1
- package/dist/client/assets/{index-H4th1M1W.js → index-gBQPS-LW.js} +1 -1
- package/dist/client/assets/{index-redirect-CGFmrszq.js → index-redirect-C9wUdbB_.js} +1 -1
- package/dist/client/assets/{index-BYcSBhf-.js → index-zsQNpAC_.js} +1 -1
- package/dist/client/assets/{input-ClZRxnmh.js → input-Ch9q0aZa.js} +1 -1
- package/dist/client/assets/{integration-icon-BbB4oB5i.js → integration-icon-YoYYs9mF.js} +1 -1
- package/dist/client/assets/{label-BSGw8oBO.js → label-B-U7wEM-.js} +1 -1
- package/dist/client/assets/{login-CdTPEOBa.js → login-B6e0iAu4.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B4Saszrk.js → mcp-oauth-DQE-04Mo.js} +1 -1
- package/dist/client/assets/{members-DBQhJ4XB.js → members-9KeuvWWT.js} +1 -1
- package/dist/client/assets/{monaco-editor-CzA3Yj-7.js → monaco-editor-DXogaJUp.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-D2iO8L9k.js → monitoring-stats-row-CP7I3KY2.js} +1 -1
- package/dist/client/assets/{oauth-callback-Bako7Xx5.js → oauth-callback-D18w_K8B.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-kLVV98j9.js → oauth-callback-ai-provider-Cdap4ord.js} +1 -1
- package/dist/client/assets/{onboarding-DtVt1E-s.js → onboarding-BZkIK-Ka.js} +1 -1
- package/dist/client/assets/{org-install-BZEHE0yF.js → org-install-CjuXIws6.js} +1 -1
- package/dist/client/assets/{org-layout-BEbkmqhm.js → org-layout-Dej6DmSC.js} +1 -1
- package/dist/client/assets/{organization-choice-B0z1MsQp.js → organization-choice-Bfb5SfTa.js} +1 -1
- package/dist/client/assets/{page-seo-form-Dbv12H5K.js → page-seo-form-tpLbkMUL.js} +1 -1
- package/dist/client/assets/page-seo-sheet-CX2gPBcd.js +1 -0
- package/dist/client/assets/{popover-DrCzKeNI.js → popover-CEv2N3w9.js} +1 -1
- package/dist/client/assets/{post-editor-C-cvaP0F.js → post-editor-DvPV2O57.js} +1 -1
- package/dist/client/assets/{preview-dialog-Cent5BMR.js → preview-dialog-td-oVNia.js} +1 -1
- package/dist/client/assets/{primitives-Cmp-rnEw.js → primitives-VnhXlpi8.js} +1 -1
- package/dist/client/assets/{profile-CBVk-VK5.js → profile-WTH-rkk7.js} +1 -1
- package/dist/client/assets/project-app-view-D_C5eQR6.js +1 -0
- package/dist/client/assets/record-editor-DaKtfPzO.js +1 -0
- package/dist/client/assets/registry-CqA4momB.js +2 -0
- package/dist/client/assets/{registry-layout-fxT45x9G.js → registry-layout-Ce_TARWv.js} +1 -1
- package/dist/client/assets/{require-capability-FrFn5vuD.js → require-capability-BZgleI4m.js} +1 -1
- package/dist/client/assets/{required-auth-layout-5s5GmtQD.js → required-auth-layout-BaGKlYtx.js} +1 -1
- package/dist/client/assets/{reset-password-CCAC6jao.js → reset-password-0UzgtY5z.js} +1 -1
- package/dist/client/assets/{roles-C4EA0fe9.js → roles-C1AHKSTJ.js} +1 -1
- package/dist/client/assets/{save-status-CxoqkKc0.js → save-status-Dc26iXJB.js} +1 -1
- package/dist/client/assets/{scroll-area-AgEJrEaz.js → scroll-area-B3EoQYK2.js} +41 -41
- package/dist/client/assets/{search-input-Dr84Z3zy.js → search-input-CUilRo9d.js} +1 -1
- package/dist/client/assets/{secrets-Cv_31YKq.js → secrets-DUGdX_tt.js} +1 -1
- package/dist/client/assets/{sections-editor-CdYoJhgp.js → sections-editor-C2iZ1hVk.js} +1 -1
- package/dist/client/assets/{select-C0uicJXN.js → select-CJdBdWqY.js} +1 -1
- package/dist/client/assets/{select-model-k6DruMQz.js → select-model-CArerA8a.js} +1 -1
- package/dist/client/assets/{seo-editor-Davp-Ubf.js → seo-editor-CwsY379b.js} +1 -1
- package/dist/client/assets/{settings-layout-CMBq2oi7.js → settings-layout-CcwwB4g3.js} +1 -1
- package/dist/client/assets/{settings-section-BIy2qPd0.js → settings-section-BtP8pWPF.js} +1 -1
- package/dist/client/assets/{sheet-FzTZnAMo.js → sheet-DDFgoCvO.js} +1 -1
- package/dist/client/assets/{shell-controls-bcOU57uW.js → shell-controls-CrCNeNtn.js} +1 -1
- package/dist/client/assets/{shell-layout-CTx4S0SP.js → shell-layout-RHUNhd-E.js} +1 -1
- package/dist/client/assets/{shell-route-loading-7Bhg6e88.js → shell-route-loading-CxYzXt5f.js} +1 -1
- package/dist/client/assets/{sidebar-wPogh5H2.js → sidebar-aiqzS0KL.js} +1 -1
- package/dist/client/assets/{skeleton-DbxaKwuD.js → skeleton-vMVUiRn_.js} +1 -1
- package/dist/client/assets/{sortable.esm-ByCZlKMG.js → sortable.esm-B0o7kFIh.js} +1 -1
- package/dist/client/assets/{sso-BvHL8UBy.js → sso-Box6hROX.js} +1 -1
- package/dist/client/assets/{store-h2l8hrU9.js → store-B87zIBKS.js} +1 -1
- package/dist/client/assets/store-registry-Do9M9YHO.js +2 -0
- package/dist/client/assets/{studio-tools-Bub4-_ck.js → studio-tools-BY37pyys.js} +1 -1
- package/dist/client/assets/{switch-BIG_iZUi.js → switch-CZySgwCj.js} +1 -1
- package/dist/client/assets/{table-CL3GsV9E.js → table-D8KWGQn2.js} +1 -1
- package/dist/client/assets/{tabs-BBOxnNNJ.js → tabs-C_nkVbiW.js} +1 -1
- package/dist/client/assets/{task-status-C0jVgE2C.js → task-status-B3dgE7Vl.js} +1 -1
- package/dist/client/assets/{textarea-CiOzOVqH.js → textarea-WgNB0BrE.js} +1 -1
- package/dist/client/assets/{toggle-group-DGtMQR93.js → toggle-group-ZDWrpgGI.js} +1 -1
- package/dist/client/assets/{toolbar-BY-bt8fG.js → toolbar-CC7gZdrp.js} +1 -1
- package/dist/client/assets/{tooltip-N_gwtefU.js → tooltip-Cn4Fr4Nc.js} +1 -1
- package/dist/client/assets/{types-B4TXjhWy.js → types-BGHXNEpK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bxs29-wG.js → use-ai-providers-Cc5cHyjW.js} +1 -1
- package/dist/client/assets/{use-automations-3L1xzB_A.js → use-automations-CcDuV2d6.js} +1 -1
- package/dist/client/assets/{use-capability-CxuRI8nR.js → use-capability-Bj9KYcez.js} +1 -1
- package/dist/client/assets/{use-clock-tick-D6kCNTAu.js → use-clock-tick-DS6HQj-T.js} +1 -1
- package/dist/client/assets/{use-collections-Bzpy7fbk.js → use-collections-JBGoJXV7.js} +1 -1
- package/dist/client/assets/{use-connection-BlwNcCfs.js → use-connection-D6MfbxRS.js} +1 -1
- package/dist/client/assets/{use-copy-C18cGMuZ.js → use-copy-DBmQNAjE.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DjprLKRm.js → use-create-virtual-mcp-Djox-xO9.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DwtJTCPs.js → use-debounced-autosave-D6UnZuik.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BqUiZBIv.js → use-delete-connection-BlM46eDx.js} +1 -1
- package/dist/client/assets/{use-file-configs-DmpAJnrE.js → use-file-configs-Bpo5RzC0.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-D90uCAWk.js → use-infinite-scroll-CToI6Rk5.js} +1 -1
- package/dist/client/assets/{use-join-requests-XdoqGykA.js → use-join-requests-CBCoJ3mh.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DTuk5FL3.js → use-mcp-client-CROrubmo.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CCJeXeit.js → use-mcp-prompts-D0RIhc9f.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-erMTNVPt.js → use-mcp-tools-Df4SfdHr.js} +1 -1
- package/dist/client/assets/{use-members-DVeZ57Fb.js → use-members-DyFFnkfi.js} +1 -1
- package/dist/client/assets/{use-mobile-CO6Qj17d.js → use-mobile-BRA9DBxz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C5qzB5Os.js → use-navigate-to-agent-Cbubh-yV.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CFe_aocy.js → use-org-auth-client-oOo72Oq9.js} +1 -1
- package/dist/client/assets/{use-org-sso-CUKxi2Np.js → use-org-sso-Bp1ATxlv.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DuVOs9is.js → use-organization-roles-FbsGo1TW.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BKJdKRk2.js → use-organization-settings-CVnodPz6.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BBgqLjED.js → use-registry-connections-DiD1GxkL.js} +1 -1
- package/dist/client/assets/{use-secrets-BjGeTk2k.js → use-secrets-zS4yVRiI.js} +1 -1
- package/dist/client/assets/{use-status-sounds-PgJJL_Xe.js → use-status-sounds-CkiMUfRN.js} +1 -1
- package/dist/client/assets/{use-view-mode-BVZfmz1B.js → use-view-mode-iWrWXNiJ.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bey-jE-7.js → use-virtual-mcp-BUyVS0ZN.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dhot3ff6.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-rXm6Ehme.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BW_N2GXU.js → useSuspenseQueries-AiXukE-T.js} +1 -1
- package/dist/client/assets/{variant-calendar-DtCm49M6.js → variant-calendar-B-rsy4S4.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CVV_-3gy.js → view-mode-toggle-C8lWSgq7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +75 -14
- package/package.json +1 -1
- package/dist/client/assets/commerce-onboarding-oFh3OU00.js +0 -1
- package/dist/client/assets/index-U1Qbw0Xz.css +0 -1
- package/dist/client/assets/page-seo-sheet-CgJD2Pyd.js +0 -1
- package/dist/client/assets/project-app-view-CQBqVZeE.js +0 -1
- package/dist/client/assets/record-editor-DGhJ2SI5.js +0 -1
- package/dist/client/assets/registry-BSgelBeo.js +0 -2
- package/dist/client/assets/store-registry-GDMsvEZE.js +0 -2
- package/dist/client/assets/useInfiniteQuery-33NCNh33.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CfUDvQx6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-BLwOjDz-.js";import{E as Ee}from"./empty-state-BFpBC4xM.js";import{u as et,a as Ae}from"./use-collections-Bzpy7fbk.js";import{u as ce}from"./use-mcp-client-DTuk5FL3.js";import{F as ne,a as tt,b as de,d as me}from"./form-ot5ixpyH.js";import{I as ue}from"./input-ClZRxnmh.js";import{T as re}from"./textarea-CiOzOVqH.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-H4th1M1W.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-zFcUURp0.js";import{g as ut,M as xt,a as Ne}from"./types-B4TXjhWy.js";import{A as pt,a as ft,b as ht}from"./alert-ClVBr42M.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-C0uicJXN.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-N_gwtefU.js";import{i as jt}from"./AlertCircle-CPsUqb9w.js";import{s as bt}from"./Stars02-B5rq9Mzt.js";import{a as Nt}from"./Eye-BeU9HzvI.js";import{i as vt}from"./Play-YBZX5ZLG.js";import{i as St}from"./ChevronRight-Bb3fYro8.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-B8-rjD8O.js";import{a as Oe,u as Re}from"./use-connection-BlwNcCfs.js";import{a as It}from"./use-mcp-tools-erMTNVPt.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-BbB4oB5i.js";import{f as Tt,h as Pt}from"./chat-context-ZvIoYXlE.js";import{b as kt}from"./shell-layout-CTx4S0SP.js";import{M as Et}from"./monaco-editor-CzA3Yj-7.js";import{n as At}from"./XCircle-D9bIJ2aG.js";import"./auth-Brn3FIq2.js";import"./label-BSGw8oBO.js";import"./index-CCFPAqFW.js";import"./sidebar-wPogh5H2.js";import"./LayoutLeft-AxfIYgPW.js";import"./use-mobile-CO6Qj17d.js";import"./sheet-FzTZnAMo.js";import"./X-dsSDVl3-.js";import"./ZoomOut-BzN_Ms7a.js";import"./Key01-CkNZEW2T.js";import"./extract-connection-data-B-Wrpl8q.js";import"./use-registry-connections-BBgqLjED.js";import"./use-organization-settings-BKJdKRk2.js";import"./studio-tools-Bub4-_ck.js";import"./Plus-CJK_Z_9l.js";import"./index-y4n-lKYx.js";import"./index-CTcesiMm.js";import"./popover-DrCzKeNI.js";import"./use-virtual-mcp-Bey-jE-7.js";import"./ChevronUp-9AmI2r-8.js";import"./SearchMd-Bu6i-7O-.js";import"./Users03-BrHC1wzv.js";import"./use-create-virtual-mcp-DjprLKRm.js";import"./use-navigate-to-agent-C5qzB5Os.js";import"./Tool01-Rpx-Fbsn.js";import"./SwitchHorizontal01-kAH8gjqT.js";import"./Settings02-ClyP-nns.js";import"./ArrowUpRight-DtS0Ql0c.js";import"./ZapSquare-D0HzXU-T.js";import"./CheckCircle-BolkWLNV.js";import"./ChevronDown-Br0JyxxI.js";import"./ChevronLeft-DYKFs25Z.js";import"./DotsVertical-BWvAFXp6.js";import"./Globe01-BaODUE4b.js";import"./FilterLines-BjafZAm6.js";import"./Star01-D1d9bklt.js";import"./Globe04-CeW5Z0Kh.js";import"./HardDrive-BKjshHXk.js";import"./LinkExternal01-DVLkc3K_.js";import"./Monitor01-C6fIMnPI.js";import"./Sun-DodPsLp-.js";import"./Palette-Du7PwJ5T.js";import"./Shield01-BjFKeQ_N.js";import"./Stars01-C8smcBql.js";import"./Trash01-Dyf1A0dZ.js";import"./Upload01-XbcBo5aV.js";import"./User01-BfBqwqiZ.js";import"./Users01-CPlN96Ae.js";import"./XClose-gI66KzDJ.js";import"./Zap-Cg8ncZ4g.js";import"./mcp-oauth-B4Saszrk.js";import"./badge-ntRHb2xe.js";import"./hooks-BzM98nK3.js";import"./decopilot-sse-pool-gPcdIlzZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Bxs29-wG.js";import"./tab-id-BptcWVWa.js";import"./avatar-Bbv-vQmP.js";import"./dialog-DNLq7rFW.js";import"./required-auth-layout-5s5GmtQD.js";import"./use-org-sso-CUKxi2Np.js";import"./index-Z9CY6YwJ.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(B,{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(B,{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:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),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:Mt})]}),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 Mt(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 Dt(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 zt(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 Me(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 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("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 Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(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(),z=`${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}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(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 D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=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}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{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(De,{children:Be})})]})}),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(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{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(B,{size:"icon",variant:M==="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(B,{size:"icon",variant:M==="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&&M==="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(z,d),onTeardown:()=>A?.clearAppContext(z),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(B,{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(Bt,{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(B,{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 M=>{r&&await R.update.mutateAsync({id:r,data:M})},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 z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}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 Mn(){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{Mn as default};
|
|
1
|
+
import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-DptZZauK.js";import{E as Ee}from"./empty-state-Ccc7wvcy.js";import{u as et,a as Ae}from"./use-collections-JBGoJXV7.js";import{u as ce}from"./use-mcp-client-CROrubmo.js";import{F as ne,a as tt,b as de,d as me}from"./form-DNh2q8t4.js";import{I as ue}from"./input-Ch9q0aZa.js";import{T as re}from"./textarea-WgNB0BrE.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-gBQPS-LW.js";import{ah as rt,x as it,a6 as at,ai as ct,a2 as dt,aj as mt,M as be}from"./agent-icon-NQ_Mk8_8.js";import{g as ut,M as xt,a as Ne}from"./types-BGHXNEpK.js";import{A as pt,a as ft,b as ht}from"./alert-BHi_IhB_.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-CJdBdWqY.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-Cn4Fr4Nc.js";import{i as jt}from"./AlertCircle-CVgQ7AOT.js";import{s as bt}from"./Stars02-DToeu8SC.js";import{a as Nt}from"./Eye-C8Vfx0-4.js";import{i as vt}from"./Play-DsnYqyFF.js";import{i as St}from"./ChevronRight-D_tkXjWo.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-DVooRj31.js";import{a as Oe,u as Re}from"./use-connection-D6MfbxRS.js";import{a as It}from"./use-mcp-tools-Df4SfdHr.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-YoYYs9mF.js";import{f as Tt,h as Pt}from"./chat-context-JTwjeHTY.js";import{b as kt}from"./shell-layout-RHUNhd-E.js";import{M as Et}from"./monaco-editor-DXogaJUp.js";import{n as At}from"./XCircle-CoU_Hwe9.js";import"./auth-BFkL4ufW.js";import"./label-B-U7wEM-.js";import"./index-BgN9pI07.js";import"./sidebar-aiqzS0KL.js";import"./LayoutLeft-hqAstg8m.js";import"./use-mobile-BRA9DBxz.js";import"./sheet-DDFgoCvO.js";import"./X-CiAMFEWO.js";import"./ZoomOut-DV_1o0PM.js";import"./Key01-CYbGr3H3.js";import"./extract-connection-data-D2gQKJCU.js";import"./use-registry-connections-DiD1GxkL.js";import"./use-organization-settings-CVnodPz6.js";import"./studio-tools-BY37pyys.js";import"./Plus-BCyb-AcQ.js";import"./index-CAaHR2ia.js";import"./index-73tVSzqh.js";import"./popover-CEv2N3w9.js";import"./use-virtual-mcp-BUyVS0ZN.js";import"./ChevronUp-u7VhfB08.js";import"./SearchMd-pgxE25ht.js";import"./Users03-BfmtQGSl.js";import"./use-create-virtual-mcp-Djox-xO9.js";import"./use-navigate-to-agent-Cbubh-yV.js";import"./Tool01-qCeqaIYR.js";import"./SwitchHorizontal01-CUGpid9A.js";import"./Settings02-BVbp_ypE.js";import"./ArrowUpRight-C9ykLtuj.js";import"./ZapSquare-DiyzHRy2.js";import"./CheckCircle-H3pWKPYO.js";import"./ChevronDown-DO3o3y5M.js";import"./ChevronLeft-B7B0rGOG.js";import"./DotsVertical-Cauolc8c.js";import"./Globe01-B2Kb3oGL.js";import"./FilterLines-DmVqY61b.js";import"./Star01-BQYePq21.js";import"./Globe04-yg-G_BoN.js";import"./HardDrive-Ct0X1WYx.js";import"./LinkExternal01-DFDKnuS_.js";import"./Monitor01-CjEGYbhQ.js";import"./Sun-Ct9UUaO-.js";import"./Palette-BrlikOjU.js";import"./Shield01-CDrsrKsk.js";import"./Stars01-BYz6LBgx.js";import"./Trash01-BQ-tGqiC.js";import"./Upload01-D4__IfBX.js";import"./User01-CxCzzEeX.js";import"./Users01-Cw-lssyZ.js";import"./XClose-BEAZpPEi.js";import"./Zap-BZ2VPUiO.js";import"./mcp-oauth-DQE-04Mo.js";import"./badge-ho6xrCP4.js";import"./hooks-CMI_9fmc.js";import"./decopilot-sse-pool-DBKZPhuP.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Cc5cHyjW.js";import"./tab-id-BptcWVWa.js";import"./avatar-Oz8Lqgg4.js";import"./dialog-B2DoU3ik.js";import"./required-auth-layout-BaGKlYtx.js";import"./use-org-sso-Bp1ATxlv.js";import"./index-C2eVEqgk.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(B,{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(B,{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:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),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:Mt})]}),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 Mt(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 Dt(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 zt(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 Me(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 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("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 Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(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(),z=`${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}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(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 D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=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}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{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(De,{children:Be})})]})}),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(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{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(B,{size:"icon",variant:M==="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(B,{size:"icon",variant:M==="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&&M==="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(z,d),onTeardown:()=>A?.clearAppContext(z),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(B,{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(Bt,{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(B,{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 M=>{r&&await R.update.mutateAsync({id:r,data:M})},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 z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}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 Mn(){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{Mn 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-DptZZauK.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-C_iz5wEu.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-CUGpid9A.js";import{i as S}from"./ChevronUp-u7VhfB08.js";import{a as I,b as K,c as P,T as W}from"./tooltip-Cn4Fr4Nc.js";import{V as q}from"./view-mode-toggle-C8lWSgq7.js";import{B as G}from"./badge-ho6xrCP4.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-DptZZauK.js";import{i as C}from"./SearchMd-pgxE25ht.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-DptZZauK.js";import{B as g}from"./badge-ho6xrCP4.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-DptZZauK.js";import{_ as m}from"./index-73tVSzqh.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-B2DoU3ik.js";import{i as y}from"./SearchMd-pgxE25ht.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 E,r as M,l as X,j as t,B as V,m as lt,d as Oe,K as Q,o as He,s as fe,n as Ge,p as Qe,i as at,k as ct,q as me,Q as dt,E as ut,a as We,u as Et,b as mt,v as Tt,w as ft,L as Ot}from"./index-DptZZauK.js";import{A as Rt}from"./auth-entry-COL91flc.js";import{A as W}from"./auth-split-layout-BKBH2tBP.js";import{O as it}from"./organization-choice-Bfb5SfTa.js";import{f as Ut}from"./tab-id-BptcWVWa.js";import{I as Re}from"./input-Ch9q0aZa.js";import{u as Ue,W as pt,S as gt,g as $t,C as zt}from"./use-mcp-client-CROrubmo.js";import{i as ht}from"./XCircle-CoU_Hwe9.js";import{I as xt}from"./integration-icon-YoYYs9mF.js";import{D as Ye,a as Lt,b as Pt,c as At,d as Dt,e as Mt}from"./dialog-B2DoU3ik.js";import{T as Ft,a as Kt,b as qt}from"./tooltip-Cn4Fr4Nc.js";import{i as Ze}from"./CheckCircle-H3pWKPYO.js";import{i as Vt}from"./ZoomOut-DV_1o0PM.js";import{g as Bt,c as Ht,e as Gt}from"./extract-connection-data-D2gQKJCU.js";import{F as pe,a as Xe,b as ge,c as Fe,d as he,e as xe}from"./form-DNh2q8t4.js";import{i as Qt}from"./ChevronUp-u7VhfB08.js";import{s as Wt,a as Yt}from"./Eye-C8Vfx0-4.js";import{i as Zt}from"./Settings02-BVbp_ypE.js";import{i as Xt}from"./agent-icon-NQ_Mk8_8.js";import{u as Jt}from"./useSuspenseQueries-AiXukE-T.js";import{a as en}from"./authenticate-and-persist-oauth-DOKW32kF.js";import{i as yt}from"./ArrowUpRight-C9ykLtuj.js";import{s as jt}from"./User01-CxCzzEeX.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-Oz8Lqgg4.js";import"./auth-BFkL4ufW.js";import"./X-CiAMFEWO.js";import"./label-B-U7wEM-.js";import"./AlertCircle-CVgQ7AOT.js";import"./Tool01-qCeqaIYR.js";import"./SwitchHorizontal01-CUGpid9A.js";import"./ZapSquare-DiyzHRy2.js";import"./Users03-BfmtQGSl.js";import"./ChevronDown-DO3o3y5M.js";import"./ChevronLeft-B7B0rGOG.js";import"./ChevronRight-D_tkXjWo.js";import"./DotsVertical-Cauolc8c.js";import"./Stars02-DToeu8SC.js";import"./Globe01-B2Kb3oGL.js";import"./FilterLines-DmVqY61b.js";import"./Star01-BQYePq21.js";import"./Globe04-yg-G_BoN.js";import"./HardDrive-Ct0X1WYx.js";import"./Key01-CYbGr3H3.js";import"./LayoutLeft-hqAstg8m.js";import"./LinkExternal01-DFDKnuS_.js";import"./Monitor01-CjEGYbhQ.js";import"./Sun-Ct9UUaO-.js";import"./Palette-BrlikOjU.js";import"./Play-DsnYqyFF.js";import"./Plus-BCyb-AcQ.js";import"./SearchMd-pgxE25ht.js";import"./Shield01-CDrsrKsk.js";import"./Stars01-BYz6LBgx.js";import"./Trash01-BQ-tGqiC.js";import"./Upload01-D4__IfBX.js";import"./Users01-Cw-lssyZ.js";import"./XClose-BEAZpPEi.js";import"./Zap-BZ2VPUiO.js";import"./mcp-oauth-DQE-04Mo.js";const tn=/^[a-zA-Z][a-zA-Z\d+.-]*:/,nn=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,sn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,on=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ee(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=tn.test(e),i=nn.test(e),o=sn.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=r.hostname.split(".");return a.length<2||a.some(l=>!l||!on.test(l))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function qe(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=M.useState(!0);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=j=>{if(!j)return;const y=()=>{const u=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(u)};y(),j.addEventListener("scroll",y,{passive:!0});const p=new ResizeObserver(y);p.observe(j);for(const u of Array.from(j.children))p.observe(u);return()=>{j.removeEventListener("scroll",y),p.disconnect()}},e[0]=a):a=e[0];const l=a;let m;e[1]!==o?(m=X("relative",o),e[1]=o,e[2]=m):m=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:l,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const g=c?"opacity-0":"opacity-100";let d;e[6]!==g?(d=X("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",g),e[6]=g,e[7]=d):d=e[7];let h;e[8]!==d?(h=t.jsx("div",{"aria-hidden":!0,className:d}),e[8]=d,e[9]=h):h=e[9];let x;return e[10]!==m||e[11]!==f||e[12]!==h?(x=t.jsxs("div",{className:m,children:[f,h]}),e[10]=m,e[11]=f,e[12]=h,e[13]=x):x=e[13],x}function rn(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&n.push({fieldKey:i,bindingType:a})}return n}function ln(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 Z(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 an(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Ve(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Ve):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Ve(n)):!1}function cn(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function dn(s){return Ve(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function un(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=dn(n);return i?[{key:e,label:cn(e),value:i}]:[]}):[]}function mn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=a=>a.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function fn(s){return s.server?.icons?.[0]?.src??Bt(s.server?.repository)??null}function pn(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function gn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,a=r?n.get(r):void 0,l=r&&a?r:null,m=l?s.connectionReadiness?.[l]!==!1:!1,f=!!l&&m;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:pn(c,i.bindingType),icon:fn(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:l||mn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:l,configurationState:a?.configuration_state??null})}return e}function hn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function xn(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function ot(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[a,l]=M.useState(!1),[m,f]=M.useState(!1);let g;e[6]!==r?(g=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(A){console.error("Failed to copy text: ",A)}},e[6]=r,e[7]=g):g=e[7];const d=g;let h;e[8]!==a?(h=()=>{l(!a)},e[8]=a,e[9]=h):h=e[9];const x=h,j=a?"text":"password";let y;e[10]!==n?(y=X("pr-20",n),e[10]=n,e[11]=y):y=e[11];let p;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(p=t.jsx(Re,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=p):p=e[18];const u=a?"Hide password":"Show password";let S;e[19]!==a?(S=a?t.jsx(Zt,{size:16}):t.jsx(Wt,{size:16}),e[19]=a,e[20]=S):S=e[20];let b;e[21]!==u||e[22]!==S||e[23]!==x?(b=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:x,title:u,children:S}),e[21]=u,e[22]=S,e[23]=x,e[24]=b):b=e[24];const C=!r,_=m?"Copied!":"Copy token";let k;e[25]!==m?(k=m?t.jsx(Qt,{size:16}):t.jsx(Yt,{size:16}),e[25]=m,e[26]=k):k=e[26];let w;e[27]!==d||e[28]!==_||e[29]!==k||e[30]!==C?(w=t.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:d,disabled:C,title:_,children:k}),e[27]=d,e[28]=_,e[29]=k,e[30]=C,e[31]=w):w=e[31];let N;e[32]!==w||e[33]!==b?(N=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[b,w]}),e[32]=w,e[33]=b,e[34]=N):N=e[34];let T;return e[35]!==N||e[36]!==p?(T=t.jsxs("div",{className:"relative",children:[p,N]}),e[35]=N,e[36]=p,e[37]=T):T=e[37],T}function Je(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,a=lt();let l;e[0]!==n||e[1]!==i?(l=async y=>{const p={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:p}}})},e[0]=n,e[1]=i,e[2]=l):l=e[2];let m;e[3]!==c||e[4]!==o||e[5]!==a?(m=async()=>{await a.invalidateQueries({queryKey:Q.commerceDiscoveryCompanionConnectionsPrefix(o.id)}),c()},e[3]=c,e[4]=o,e[5]=a,e[6]=m):m=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let g;e[9]!==l||e[10]!==m||e[11]!==f?(g={mutationFn:l,onSuccess:m,onError:f},e[9]=l,e[10]=m,e[11]=f,e[12]=g):g=e[12];const d=Oe(g);let h;e[13]!==d?(h=y=>d.mutate(y),e[13]=d,e[14]=h):h=e[14];const x=h;let j;return e[15]!==d.error||e[16]!==d.isPending||e[17]!==x?(j={save:x,isPending:d.isPending,error:d.error},e[15]=d.error,e[16]=d.isPending,e[17]=x,e[18]=j):j=e[18],j}const yn=He({accountName:fe().min(1,"Account name is required"),appKey:fe().optional(),appToken:fe().optional()});function jn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Ge(yn),e[0]=a):a=e[0];const l=n.configurationState?.accountName||"",m=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let g;e[1]!==l||e[2]!==m||e[3]!==f?(g={resolver:a,defaultValues:{accountName:l,appKey:m,appToken:f}},e[1]=l,e[2]=m,e[3]=f,e[4]=g):g=e[4];const d=Qe(g);let h;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==d?(h=()=>{d.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]=d,e[9]=h):h=e[9];let x;e[10]!==n.configurationState||e[11]!==d?(x=[n.configurationState,d],e[10]=n.configurationState,e[11]=d,e[12]=x):x=e[12],M.useEffect(h,x);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:p,error:u}=Je(j);let S,b;e[18]!==p||e[19]!==r?(b=()=>{r?.(p)},S=[p,r],e[18]=p,e[19]=r,e[20]=S,e[21]=b):(S=e[20],b=e[21]),M.useEffect(b,S);let C;if(e[22]!==d||e[23]!==y){let D;e[25]!==y?(D=async v=>{y(v)},e[25]=y,e[26]=D):D=e[26],C=d.handleSubmit(D),e[22]=d,e[23]=y,e[24]=C}else C=e[24];const _=C;let k;e[27]!==p?(k=D=>{const{field:v}=D;return t.jsxs(ge,{children:[t.jsx(Fe,{children:"Account Name"}),t.jsx(he,{children:t.jsx(Re,{placeholder:"Your VTEX account name",...v,disabled:p})}),t.jsx(xe,{})]})},e[27]=p,e[28]=k):k=e[28];let w;e[29]!==d.control||e[30]!==k?(w=t.jsx(pe,{control:d.control,name:"accountName",render:k}),e[29]=d.control,e[30]=k,e[31]=w):w=e[31];let N;e[32]!==p?(N=D=>{const{field:v}=D;return t.jsxs(ge,{children:[t.jsx(Fe,{children:"App Key (optional)"}),t.jsx(he,{children:t.jsx(ot,{placeholder:"VTEX app key",...v,disabled:p})}),t.jsx(xe,{})]})},e[32]=p,e[33]=N):N=e[33];let T;e[34]!==d.control||e[35]!==N?(T=t.jsx(pe,{control:d.control,name:"appKey",render:N}),e[34]=d.control,e[35]=N,e[36]=T):T=e[36];let A;e[37]!==p?(A=D=>{const{field:v}=D;return t.jsxs(ge,{children:[t.jsx(Fe,{children:"App Token (optional)"}),t.jsx(he,{children:t.jsx(ot,{placeholder:"VTEX app token",...v,disabled:p})}),t.jsx(xe,{})]})},e[37]=p,e[38]=A):A=e[38];let $;e[39]!==d.control||e[40]!==A?($=t.jsx(pe,{control:d.control,name:"appToken",render:A}),e[39]=d.control,e[40]=A,e[41]=$):$=e[41];let I;e[42]!==d||e[43]!==w||e[44]!==T||e[45]!==$?(I=t.jsxs(Xe,{...d,children:[w,T,$]}),e[42]=d,e[43]=w,e[44]=T,e[45]=$,e[46]=I):I=e[46];let R;e[47]!==u?(R=u&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:u instanceof Error?u.message:"Failed to save configuration"}),e[47]=u,e[48]=R):R=e[48];let U;e[49]!==p||e[50]!==c?(U=t.jsx(V,{type:"button",variant:"outline",onClick:c,disabled:p,children:"Cancel"}),e[49]=p,e[50]=c,e[51]=U):U=e[51];const F=p?"Saving...":"Save";let q;e[52]!==p||e[53]!==F?(q=t.jsx(V,{type:"submit",disabled:p,children:F}),e[52]=p,e[53]=F,e[54]=q):q=e[54];let P;e[55]!==U||e[56]!==q?(P=t.jsxs(Ye,{className:"pt-4",children:[U,q]}),e[55]=U,e[56]=q,e[57]=P):P=e[57];let K;return e[58]!==_||e[59]!==I||e[60]!==R||e[61]!==P?(K=t.jsxs("form",{onSubmit:_,className:"space-y-4",children:[I,R,P]}),e[58]=_,e[59]=I,e[60]=R,e[61]=P,e[62]=K):K=e[62],K}function bt(s){const e=E.c(30),{options:n,value:i,onChange:o,disabled:c,ariaLabel:r,searchPlaceholder:a}=s,l=a===void 0?"Search…":a,[m,f]=M.useState("");let g,d,h;if(e[0]!==n||e[1]!==m||e[2]!==i){const w=m.trim().toLowerCase();g=w?n.filter(N=>N.label.toLowerCase().includes(w)):n,d=g.map(bn),h=d.includes(i)?i:d[0]??"",e[0]=n,e[1]=m,e[2]=i,e[3]=g,e[4]=d,e[5]=h}else g=e[3],d=e[4],h=e[5];const x=h;let j;e[6]!==c||e[7]!==d||e[8]!==o?(j=function(N){if(c||!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft","Home","End"].includes(N.key))return;N.preventDefault();const A=N.currentTarget.dataset.value,$=d.indexOf(A),I=d.length;if(I===0)return;let R;N.key==="ArrowDown"||N.key==="ArrowRight"?R=($+1)%I:N.key==="ArrowUp"||N.key==="ArrowLeft"?R=($-1+I)%I:N.key==="Home"?R=0:R=I-1;const U=d[R];o(U),N.currentTarget.closest('[role="radiogroup"]')?.querySelector(`[data-value="${CSS.escape(U)}"]`)?.focus()},e[6]=c,e[7]=d,e[8]=o,e[9]=j):j=e[9];const y=j;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Xt,{size:16,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[10]=p):p=e[10];let u;e[11]===Symbol.for("react.memo_cache_sentinel")?(u=w=>f(w.target.value),e[11]=u):u=e[11];const S=`Search ${r}`;let b;e[12]!==c||e[13]!==m||e[14]!==l||e[15]!==S?(b=t.jsxs("div",{className:"relative",children:[p,t.jsx(Re,{type:"text",value:m,onChange:u,disabled:c,placeholder:l,"aria-label":S,className:"h-8 pl-8"})]}),e[12]=c,e[13]=m,e[14]=l,e[15]=S,e[16]=b):b=e[16];let C;e[17]!==c||e[18]!==g||e[19]!==y||e[20]!==o||e[21]!==x||e[22]!==i?(C=g.length===0?t.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:"No results"}):g.map(w=>{const N=w.value===i;return t.jsxs("button",{type:"button",role:"radio","aria-checked":N,disabled:c,"data-value":w.value,tabIndex:w.value===x?0:-1,onClick:()=>o(w.value),onKeyDown:y,className:X("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",N?"bg-muted font-medium text-foreground":"text-foreground hover:bg-muted/50"),children:[t.jsx("span",{className:"truncate",children:w.label}),N?t.jsx(Ze,{size:16,className:"shrink-0 text-primary"}):null]},w.value)}),e[17]=c,e[18]=g,e[19]=y,e[20]=o,e[21]=x,e[22]=i,e[23]=C):C=e[23];let _;e[24]!==r||e[25]!==C?(_=t.jsx("div",{role:"radiogroup","aria-label":r,className:"max-h-[280px] overflow-y-auto",children:C}),e[24]=r,e[25]=C,e[26]=_):_=e[26];let k;return e[27]!==b||e[28]!==_?(k=t.jsxs("div",{className:"space-y-2",children:[b,_]}),e[27]=b,e[28]=_,e[29]=k):k=e[29],k}function bn(s){return s.value}function $e(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,a=i===void 0?14:i;let l;e[0]!==o?(l=X("inline-flex items-center gap-2",o),e[0]=o,e[1]=l):l=e[1];let m;e[2]!==c?(m=X("shrink-0 animate-spin",c),e[2]=c,e[3]=m):m=e[3];let f;e[4]!==a||e[5]!==m?(f=t.jsx(at,{size:a,className:m}),e[4]=a,e[5]=m,e[6]=f):f=e[6];let g;e[7]!==r?(g=X("text-sm",r),e[7]=r,e[8]=g):g=e[8];let d;e[9]!==n||e[10]!==g?(d=t.jsx("span",{className:g,children:n}),e[9]=n,e[10]=g,e[11]=d):d=e[11];let h;return e[12]!==l||e[13]!==f||e[14]!==d?(h=t.jsxs("span",{className:l,children:[f,d]}),e[12]=l,e[13]=f,e[14]=d,e[15]=h):h=e[15],h}const Sn=He({propertyId:fe().min(1,"Property is required")});function vn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:a,onIsPendingChange:l}=s;let m;e[0]!==i||e[1]!==r.id?(m=Q.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=m):m=e[2];let f;e[3]!==o?(f=async()=>{const v=await o.callTool({name:"get-account-summaries",arguments:{}}),L=Z(v);return xn(L)},e[3]=o,e[4]=f):f=e[4];let g;e[5]!==m||e[6]!==f?(g={queryKey:m,queryFn:f},e[5]=m,e[6]=f,e[7]=g):g=e[7];const d=ct(g);let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Ge(Sn),e[8]=h):h=e[8];const x=n.configurationState?.propertyId||"";let j;e[9]!==x?(j={resolver:h,defaultValues:{propertyId:x}},e[9]=x,e[10]=j):j=e[10];const y=Qe(j);let p;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(p={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=p):p=e[15];const{save:u,isPending:S,error:b}=Je(p);let C,_;e[16]!==S||e[17]!==l?(C=()=>{l?.(S)},_=[S,l],e[16]=S,e[17]=l,e[18]=C,e[19]=_):(C=e[18],_=e[19]),M.useEffect(C,_);let k;if(e[20]!==y||e[21]!==u){let v;e[23]!==u?(v=async L=>{u(L)},e[23]=u,e[24]=v):v=e[24],k=y.handleSubmit(v),e[20]=y,e[21]=u,e[22]=k}else k=e[22];const w=k;if(d.isLoading){let v;return e[25]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx($e,{label:"Loading properties…"})}),e[25]=v):v=e[25],v}if(d.isError){let v;return e[26]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=v):v=e[26],v}let N;e[27]!==d.data?(N=d.data||[],e[27]=d.data,e[28]=N):N=e[28];const T=N;if(T.flatMap(Nn).length===0){let v;return e[29]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=v):v=e[29],v}let $;e[30]!==S||e[31]!==T?($=v=>{const{field:L}=v;return t.jsxs(ge,{children:[t.jsx(he,{children:t.jsx(bt,{options:T.flatMap(Cn),value:L.value,onChange:L.onChange,disabled:S,ariaLabel:"Google Analytics Property"})}),t.jsx(xe,{})]})},e[30]=S,e[31]=T,e[32]=$):$=e[32];let I;e[33]!==y.control||e[34]!==$?(I=t.jsx(pe,{control:y.control,name:"propertyId",render:$}),e[33]=y.control,e[34]=$,e[35]=I):I=e[35];let R;e[36]!==y||e[37]!==I?(R=t.jsx(Xe,{...y,children:I}),e[36]=y,e[37]=I,e[38]=R):R=e[38];let U;e[39]!==b?(U=b&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:b instanceof Error?b.message:"Failed to save configuration"}),e[39]=b,e[40]=U):U=e[40];let F;e[41]!==S||e[42]!==a?(F=t.jsx(V,{type:"button",variant:"outline",onClick:a,disabled:S,children:"Cancel"}),e[41]=S,e[42]=a,e[43]=F):F=e[43];const q=S?"Saving...":"Save";let P;e[44]!==S||e[45]!==q?(P=t.jsx(V,{type:"submit",disabled:S,children:q}),e[44]=S,e[45]=q,e[46]=P):P=e[46];let K;e[47]!==F||e[48]!==P?(K=t.jsxs(Ye,{className:"pt-4",children:[F,P]}),e[47]=F,e[48]=P,e[49]=K):K=e[49];let D;return e[50]!==w||e[51]!==R||e[52]!==U||e[53]!==K?(D=t.jsxs("form",{onSubmit:w,className:"space-y-4",children:[R,U,K]}),e[50]=w,e[51]=R,e[52]=U,e[53]=K,e[54]=D):D=e[54],D}function Cn(s){return s.options}function Nn(s){return s.options}const _n=He({siteUrl:fe().min(1,"Site is required")});function wn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:a,onDone:l,onIsPendingChange:m}=s;let f;e[0]!==i||e[1]!==r.id?(f=Q.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let g;e[3]!==o?(g=async()=>{const v=await o.callTool({name:"list_sites",arguments:{}});return Z(v).sites||[]},e[3]=o,e[4]=g):g=e[4];let d;e[5]!==f||e[6]!==g?(d={queryKey:f,queryFn:g},e[5]=f,e[6]=g,e[7]=d):d=e[7];const h=ct(d);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=Ge(_n),e[8]=x):x=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:x,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const p=Qe(y);let u;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(u={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=u):u=e[15];const{save:S,isPending:b,error:C}=Je(u);let _,k;e[16]!==b||e[17]!==m?(_=()=>{m?.(b)},k=[b,m],e[16]=b,e[17]=m,e[18]=_,e[19]=k):(_=e[18],k=e[19]),M.useEffect(_,k);let w;if(e[20]!==p||e[21]!==S){let v;e[23]!==S?(v=async L=>{S(L)},e[23]=S,e[24]=v):v=e[24],w=p.handleSubmit(v),e[20]=p,e[21]=S,e[22]=w}else w=e[22];const N=w;if(h.isLoading){let v;return e[25]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:t.jsx($e,{label:"Loading sites…"})}),e[25]=v):v=e[25],v}if(h.isError){let v;return e[26]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=v):v=e[26],v}let T,A;if(e[27]!==n.configurationState?.siteUrl||e[28]!==a||e[29]!==p||e[30]!==h.data){A=Symbol.for("react.early_return_sentinel");e:{if(T=h.data||[],T.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],A=L;break e}const v=n.configurationState?.siteUrl;if(v&&p.getValues("siteUrl")!==v)p.setValue("siteUrl",v);else if(!v&&!p.getValues("siteUrl")){const L=hn(a,T);L&&p.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=a,e[29]=p,e[30]=h.data,e[31]=T,e[32]=A}else T=e[31],A=e[32];if(A!==Symbol.for("react.early_return_sentinel"))return A;let $;e[34]!==b||e[35]!==T?($=v=>{const{field:L}=v;return t.jsxs(ge,{children:[t.jsx(he,{children:t.jsx(bt,{options:T.map(kn),value:L.value,onChange:L.onChange,disabled:b,ariaLabel:"Verified Site"})}),t.jsx(xe,{})]})},e[34]=b,e[35]=T,e[36]=$):$=e[36];let I;e[37]!==p.control||e[38]!==$?(I=t.jsx(pe,{control:p.control,name:"siteUrl",render:$}),e[37]=p.control,e[38]=$,e[39]=I):I=e[39];let R;e[40]!==p||e[41]!==I?(R=t.jsx(Xe,{...p,children:I}),e[40]=p,e[41]=I,e[42]=R):R=e[42];let U;e[43]!==C?(U=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[43]=C,e[44]=U):U=e[44];let F;e[45]!==b||e[46]!==l?(F=t.jsx(V,{type:"button",variant:"outline",onClick:l,disabled:b,children:"Cancel"}),e[45]=b,e[46]=l,e[47]=F):F=e[47];const q=b?"Saving...":"Save";let P;e[48]!==b||e[49]!==q?(P=t.jsx(V,{type:"submit",disabled:b,children:q}),e[48]=b,e[49]=q,e[50]=P):P=e[50];let K;e[51]!==F||e[52]!==P?(K=t.jsxs(Ye,{className:"pt-4",children:[F,P]}),e[51]=F,e[52]=P,e[53]=K):K=e[53];let D;return e[54]!==N||e[55]!==R||e[56]!==U||e[57]!==K?(D=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[R,U,K]}),e[54]=N,e[55]=R,e[56]=U,e[57]=K,e[58]=D):D=e[58],D}function kn(s){return{value:s.siteUrl,label:s.siteUrl}}const In={vtex:jn,"google-analytics":vn,"google-search-console":wn};function En(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function Be(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ze,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function Tn(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:a,siteUrl:l}=s,m=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=un(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const g=f;let d;e[2]!==n.icon||e[3]!==n.title?(d=t.jsx(xt,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=d):d=e[4];let h;e[5]!==n.title?(h=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=h):h=e[6];let x;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(x=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(Ze,{size:16})," Connected"]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(at,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=x):x=e[12];let j;e[13]!==d||e[14]!==h||e[15]!==x?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[d,h,x]}),e[13]=d,e[14]=h,e[15]=x,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(Be,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let p;e[19]!==n.headline?(p=n.headline&&t.jsx(Be,{children:n.headline}),e[19]=n.headline,e[20]=p):p=e[20];let u;e[21]!==n.bullets?(u=n.bullets.map(On),e[21]=n.bullets,e[22]=u):u=e[22];let S;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(S=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=S):S=e[26];let b;e[27]!==y||e[28]!==p||e[29]!==u||e[30]!==S?(b=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,p,u,S]}),e[27]=y,e[28]=p,e[29]=u,e[30]=S,e[31]=b):b=e[31];let C;e[32]!==n||e[33]!==m||e[34]!==r||e[35]!==g||e[36]!==a||e[37]!==l?(C=n.satisfied&&m&&t.jsx(M.Suspense,{fallback:t.jsx($n,{}),children:t.jsx(zn,{card:n,org:r,selfClient:a,connectionId:m,savedConfigEntries:g,contextSiteUrl:l})}),e[32]=n,e[33]=m,e[34]=r,e[35]=g,e[36]=a,e[37]=l,e[38]=C):C=e[38];let _;return e[39]!==b||e[40]!==C||e[41]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,b,C]}),e[39]=b,e[40]=C,e[41]=j,e[42]=_):_=e[42],_}function On(s){return t.jsx(Be,{children:s},s)}function Rn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function Un(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function $n(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("div",{className:"h-5 w-24 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]})}),s[0]=e):e=s[0],e}function zn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:a}=s;let l;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(l={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=l):l=e[3];const m=Ue(l),[f,g]=M.useState(!1),[d,h]=M.useState(!1),x=In[n.bindingType];let j;e[4]!==d?(j=T=>{!T&&d||g(T)},e[4]=d,e[5]=j):j=e[5];const y=j;let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=p):p=e[6];let u;e[7]!==r.length?(u=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=u):u=e[8];let S;e[9]!==u?(S=t.jsxs("div",{className:"grid gap-1",children:[p,u]}),e[9]=u,e[10]=S):S=e[10];let b;e[11]!==x||e[12]!==n.title||e[13]!==r.length?(b=r.length>0?t.jsxs(Ft,{children:[t.jsx(Kt,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>g(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!x,children:t.jsx(Vt,{size:14})})}),t.jsx(qt,{children:"Edit configuration"})]}):t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!0),disabled:!x,children:"Configure"}),e[11]=x,e[12]=n.title,e[13]=r.length,e[14]=b):b=e[14];let C;e[15]!==S||e[16]!==b?(C=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[S,b]}),e[15]=S,e[16]=b,e[17]=C):C=e[17];let _;e[18]!==r?(_=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(Ln)}),e[18]=r,e[19]=_):_=e[19];let k;e[20]!==C||e[21]!==_?(k=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[C,_]}),e[20]=C,e[21]=_,e[22]=k):k=e[22];let w;e[23]!==x||e[24]!==n||e[25]!==m||e[26]!==c||e[27]!==a||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(w=x?t.jsx(Lt,{open:f,onOpenChange:y,children:t.jsxs(Pt,{className:"sm:max-w-lg",children:[t.jsxs(At,{className:"flex-row items-center gap-3 space-y-0 text-left",children:[t.jsx(xt,{icon:n.icon,name:n.title,size:"md",fit:"contain",className:"p-1.5"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t.jsx(Dt,{children:n.title}),t.jsxs(Mt,{children:["Configure ",n.title," to enrich data"]})]})]}),t.jsx(x,{card:n,connectionId:c,companionClient:m,selfClient:o,org:i,contextSiteUrl:a,onDone:()=>g(!1),onIsPendingChange:h})]})}):t.jsx(Un,{title:n.title}),e[23]=x,e[24]=n,e[25]=m,e[26]=c,e[27]=a,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=w):w=e[32];let N;return e[33]!==w||e[34]!==k?(N=t.jsxs(t.Fragment,{children:[k,w]}),e[33]=w,e[34]=k,e[35]=N):N=e[35],N}function Ln(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:Rn(s.key,s.value)})]},s.key)}const et={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function Pn(s){const e=E.c(30),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=Ue(c);let a;e[4]!==o||e[5]!==i.id?(a=Q.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=a):a=e[6];let l;e[7]!==r?(l=async()=>{const O=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return Z(O)},e[7]=r,e[8]=l):l=e[8];let m;e[9]!==a||e[10]!==l?(m={queryKey:a,queryFn:l},e[9]=a,e[10]=l,e[11]=m):m=e[11];const f=me(m),g=rn(f.data?.stateSchema??{properties:{}}),d=g.map(Gn),h=g.map(Hn).filter(Bn),x=g.filter(Vn).map(qn),j=[...h,...x].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=Q.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let p;e[15]!==o||e[16]!==n?(p=async()=>{const O=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return Z(O)},e[15]=o,e[16]=n,e[17]=p):p=e[17];let u;e[18]!==y||e[19]!==p?(u={queryKey:y,queryFn:p},e[18]=y,e[19]=p,e[20]=u):u=e[20];const b=me(u).data?.item?.configuration_state??null;let C;e[21]!==b?(C=O=>b?.[O.fieldKey]?.value,e[21]=b,e[22]=C):C=e[22];const _=g.map(C).filter(Kn),k=[...d.map(Fn),...h.map(Mn),..._.map(Dn)].sort().join(","),N=me({queryKey:Q.commerceDiscoveryCompanionConnections(i.id,k),queryFn:async()=>{if(g.length===0)return{items:[]};const O=[{field:["app_name"],operator:"in",value:d},{field:["app_id"],operator:"in",value:h}];_.length>0&&O.push({field:["id"],operator:"in",value:_});const B=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:O},limit:1e3}});return Z(B)}}).data?.items??[],T=new Set(_),A=N.filter(O=>T.has(O.id)),$=A.filter(An);let I;e[23]!==i.id||e[24]!==i.slug?(I=O=>({queryKey:Q.commerceDiscoveryCompanionOAuthStatus(i.id,O.id),queryFn:async()=>{try{const B=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(O.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]=i.id,e[24]=i.slug,e[25]=I):I=e[25];const R=Jt({queries:$.map(I)});let U;e[26]!==R?(U=(O,B)=>[O.id,R[B]?.data?.hasToken===!0],e[26]=R,e[27]=U):U=e[27];const F=new Map($.map(U)),q={};for(const O of A)q[O.id]=!O.oauth_config||!!O.connection_token||F.get(O.id)===!0;const P=me({queryKey:Q.commerceDiscoveryCompanionRegistry(i.id,j),queryFn:async()=>{if(g.length===0)return{items:[]};const O=ln(h,x),B=await Ht(pt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...O?{where:O}:{},limit:1e3});return Z(B)}}),K={},D={};for(const O of P.data?.items??[])K[O.id]=O,O.server?.name&&(D[O.server.name]=O);const v=gn({requirements:g,itemsById:K,itemsByName:D,connections:N,connectionReadiness:q,configurationState:b,curated:et});let L;return e[28]!==v?(L={cards:v},e[28]=v,e[29]=L):L=e[29],L}function An(s){return s.oauth_config&&!s.connection_token}function Dn(s){return`linked:${s}`}function Mn(s){return`app:${s}`}function Fn(s){return`binding:${s}`}function Kn(s){return typeof s=="string"&&s.length>0}function qn(s){return s.bindingType}function Vn(s){return!et[s.bindingType]}function Bn(s){return!!s}function Hn(s){return et[s.bindingType]?.registryAppId}function Gn(s){return s.bindingType}function Qn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=lt(),[c,r]=M.useState(null),[a,l]=M.useState(null),m=async(g,d)=>{const h=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:g,data:d}});return Z(h)};async function f(g){r(g.fieldKey),l(null);try{let d=g.candidateConnectionId;if(!d){const u=Gt(g.registryItem,e.id,n,{remoteIndex:0}),S=u.connection_type==="STDIO",b=!!u.connection_url,C=S&&u.connection_headers&&typeof u.connection_headers=="object"&&"command"in u.connection_headers;if(!b&&!C){l(`${g.title} cannot be connected: no connection method available`);return}const _=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:u}});d=Z(_).item.id}const h=d,x=await en({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:u=>m(h,{connection_token:u}).then(()=>{})});if(!x.ok){l(`Couldn't sign in to ${g.title}: ${x.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=Z(j).item?.configuration_state??null,p=an(y,g.fieldKey,g.bindingType,h);await m(i,{configuration_state:p}),await o.invalidateQueries({queryKey:Q.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:Q.commerceDiscoveryCompanionConnectionsPrefix(e.id)})}catch(d){l(d instanceof Error?d.message:String(d))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:a}}const tt="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function nt(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Wn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Yn)}),s[0]=e):e=s[0],e}function Yn(s){return t.jsx(En,{},s)}function Zn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:tt,children:[t.jsx(nt,{}),t.jsx(Wn,{})]}),s[0]=e):e=s[0],e}function Xn(s){const e=E.c(5),{onRetry:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(nt,{}),e[0]=i):i=e[0];let o,c;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),c=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Something went wrong loading your integrations."}),e[1]=o,e[2]=c):(o=e[1],c=e[2]);let r;return e[3]!==n?(r=t.jsxs("div",{className:tt,children:[i,t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[o,c,t.jsx(V,{type:"button",variant:"outline",size:"sm",className:"mt-3",onClick:n,children:"Try again"})]})]}),e[3]=n,e[4]=r):r=e[4],r}function Jn(s){const e=E.c(2);let n;return e[0]!==s?(n=t.jsx(dt,{children:i=>{const{reset:o}=i;return t.jsx(ut,{fallback:c=>{const{resetError:r}=c;return t.jsx(Xn,{onRetry:()=>{o(),r()}})},children:t.jsx(M.Suspense,{fallback:t.jsx(Zn,{}),children:t.jsx(es,{...s})})})}}),e[0]=s,e[1]=n):n=e[1],n}function es(s){const e=E.c(33),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=We.useSession(),r=c?.user?.id??"";let a;e[0]!==n.id||e[1]!==n.slug?(a={connectionId:gt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=a):a=e[2];const l=Ue(a);let m;e[3]!==i||e[4]!==n||e[5]!==l?(m={selfClient:l,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=l,e[6]=m):m=e[6];const{cards:f}=Pn(m);let g;e[7]!==i||e[8]!==n||e[9]!==l||e[10]!==r?(g={selfClient:l,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=l,e[10]=r,e[11]=g):g=e[11];const{connect:d,connectingFieldKey:h,error:x}=Qn(g);if(f.length===0)return null;const j=h!==null;let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(nt,{}),e[12]=y):y=e[12];let p;e[13]!==x?(p=x&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x}),e[13]=x,e[14]=p):p=e[14];let u;if(e[15]!==j||e[16]!==f||e[17]!==d||e[18]!==h||e[19]!==n||e[20]!==l||e[21]!==o){let b;e[23]!==j||e[24]!==d||e[25]!==h||e[26]!==n||e[27]!==l||e[28]!==o?(b=C=>t.jsx(Tn,{card:C,connecting:h===C.fieldKey,disabled:j&&h!==C.fieldKey,org:n,selfClient:l,siteUrl:o,onConnect:()=>{d(C)}},C.fieldKey),e[23]=j,e[24]=d,e[25]=h,e[26]=n,e[27]=l,e[28]=o,e[29]=b):b=e[29],u=f.map(b),e[15]=j,e[16]=f,e[17]=d,e[18]=h,e[19]=n,e[20]=l,e[21]=o,e[22]=u}else u=e[22];let S;return e[30]!==p||e[31]!==u?(S=t.jsxs("div",{className:tt,children:[y,t.jsx(qe,{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-[60vh] md:flex-none",children:t.jsxs("div",{className:"grid gap-4",children:[p,u]})})]}),e[30]=p,e[31]=u,e[32]=S):S=e[32],S}const st="https://decocms-tanstack.deco-cx.workers.dev/agendar",ts="Rather have us walk you through it?",ns="Book a 20-minute call and we'll run the diagnostic with you, live.";function St({siteUrl:s,email:e}){const n=new URL(st);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function ss(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?st:n,r=i===void 0?"lg":i;let a;e[0]!==o?(a=X("w-full",o),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(yt,{size:16}),e[2]=l):l=e[2];let m;e[3]!==c?(m=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",l]}),e[3]=c,e[4]=m):m=e[4];let f;return e[5]!==r||e[6]!==a||e[7]!==m?(f=t.jsx(V,{asChild:!0,variant:"outline",size:r,className:a,children:m}),e[5]=r,e[6]=a,e[7]=m,e[8]=f):f=e[8],f}function rt(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function is(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rt,{children:t.jsx(jt,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(rt,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function vt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(is,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:ts}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:ns})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(ss,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function os(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?st:i;let c;e[0]!==n?(c=X("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(jt,{size:20})}),e[2]=r):r=e[2];let a,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),l=t.jsx(yt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=a,e[4]=l):(a=e[3],l=e[4]);let m;return e[5]!==o||e[6]!==c?(m=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,a,l]}),e[5]=o,e[6]=c,e[7]=m):m=e[7],m}function Ct(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=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]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let a;e[3]!==i?(a=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:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=a):a=e[4];let l;e[5]!==n?(l=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=l):l=e[6];let m;return e[7]!==a||e[8]!==l?(m=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,a,l]}),e[7]=a,e[8]=l,e[9]=m):m=e[9],m}const rs={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Nt(s){return rs[s]}function _t(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(W,{children:t.jsx(ze,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function ze(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=Nt(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:t.jsx($e,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function wt(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($e,{label:Nt("button")}),s[0]=e):e=s[0],e}function _i(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(as,{}),s[0]=e):e=s[0],e}const kt=M.createContext(null),It=()=>M.useContext(kt);function ls(s){if(!s)return null;const e=Ee(s);return e.ok?new URL(e.value).hostname:null}function as(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=Et(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=ls(o),s[1]=o,s[2]=c):c=s[2];const r=c;let a;s[3]!==i||s[4]!==o?(a=t.jsx(cs,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=a):a=s[5];let l;return s[6]!==r||s[7]!==a?(l=t.jsx(kt.Provider,{value:r,children:a}),s[6]=r,s[7]=a,s[8]=l):l=s[8],l}function cs(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=We.useSession(),r=It();if(c){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(_t,{variant:"route"}),e[0]=l):l=e[0],l}if(!o){const l=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==r?(m=r?t.jsx(Ct,{host:r}):void 0,e[1]=r,e[2]=m):m=e[2];let f;return e[3]!==m?(f=t.jsx(W,{children:t.jsx(Rt,{callbackUrl:l,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=f):f=e[4],f}let a;return e[5]!==n||e[6]!==i?(a=t.jsx(ds,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=a):a=e[7],a}function ds(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=mt(),c=Tt(),[r,a]=M.useState(null),[l,m]=M.useState(null),f=c.data?.map(ms)??[];let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={mutationFn:us,retry:!1,onSuccess:u=>{m(u)}},e[0]=g):g=e[0];const d=Oe(g);if(c.isPending){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(_t,{variant:"route"}),e[1]=u):u=e[1],u}if(c.error){let u;return e[2]!==c?(u=t.jsx(Te,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=u):u=e[3],u}const h=n?f.find(u=>u.slug===n):null;if(h){let u;return e[4]!==h||e[5]!==i?(u=t.jsx(Ie,{org:h,initialSiteUrl:i}),e[4]=h,e[5]=i,e[6]=u):u=e[6],u}if(n){let u;return e[7]!==c?(u=t.jsx(Te,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=u):u=e[8],u}if(r){let u;return e[9]!==r||e[10]!==i?(u=t.jsx(Ie,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=u):u=e[11],u}if(f.length===1&&f[0]){let u;return e[12]!==f[0]||e[13]!==i?(u=t.jsx(Ie,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=u):u=e[14],u}if(f.length>1){let u;e[15]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ee,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=u):u=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=C=>a(C),e[16]=S):S=e[16];let b;return e[17]!==f?(b=t.jsx(W,{children:t.jsxs("div",{className:"grid gap-10",children:[u,t.jsx(qe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(it,{organizations:f,selectLabel:"Continue",onSelected:S})})]})}),e[17]=f,e[18]=b):b=e[18],b}if(!l){let u;e[19]!==d?(u=()=>{d.reset(),d.mutate()},e[19]=d,e[20]=u):u=e[20];let S;return e[21]!==d||e[22]!==u?(S=t.jsx(fs,{mutation:d,onRetry:u}),e[21]=d,e[22]=u,e[23]=S):S=e[23],S}const x=l;if(x?.success&&(x.status==="created"||x.status==="joined"||x.status==="already_has_organization")&&x.organization){let u;return e[24]!==x.organization||e[25]!==i?(u=t.jsx(Ie,{org:x.organization,initialSiteUrl:i}),e[24]=x.organization,e[25]=i,e[26]=u):u=e[26],u}if(x?.status==="ambiguous"&&x.organizations&&x.organizations.length>0){let u;e[27]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ee,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=u):u=e[27];const S=x.domain??void 0;let b;e[28]!==o||e[29]!==i?(b=(_,k)=>{ft(),a({..._,slug:k}),o({to:"/commerce-onboarding",search:{org:k,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=b):b=e[30];let C;return e[31]!==x.organizations||e[32]!==S||e[33]!==b?(C=t.jsx(W,{children:t.jsxs("div",{className:"grid gap-10",children:[u,t.jsx(qe,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(it,{organizations:x.organizations,domain:S,onJoined:b})})]})}),e[31]=x.organizations,e[32]=S,e[33]=b,e[34]=C):C=e[34],C}const j=x?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==d?(y=()=>{m(null),d.reset()},e[35]=d,e[36]=y):y=e[36];let p;return e[37]!==j||e[38]!==y?(p=t.jsx(Te,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=p):p=e[39],p}async function us(){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&&ft(),e}function ms(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function fs(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=M.useRef(!1);let c;e[0]!==n?(c=m=>{!m||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let m;return e[2]!==i?(m=t.jsx(Te,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=m):m=e[3],m}let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ze,{variant:"workspace"}),e[4]=a):a=e[4];let l;return e[5]!==r?(l=t.jsx(W,{children:t.jsx("div",{ref:r,children:a})}),e[5]=r,e[6]=l):l=e[6],l}function ee(s){const e=E.c(8),{title:n,description:i}=s,o=It();let c;e[0]!==o?(c=o?t.jsx(Ct,{host:o}):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]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let a;return e[5]!==c||e[6]!==r?(a=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=a):a=e[7],a}function Te(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(ee,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let a;e[3]!==o||e[4]!==c?(a=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=a):a=e[5];let l;return e[6]!==r||e[7]!==a?(l=t.jsx(W,{children:t.jsxs("div",{className:"grid gap-10",children:[r,a]})}),e[6]=r,e[7]=a,e[8]=l):l=e[8],l}function ps(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function ke(s){const e=s;if(e.isError)throw new Error(ps(e));return e.structuredContent??s}function Ie(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=We.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=St({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const a=r;let l;e[3]!==a?(l=t.jsx(vt,{href:a}),e[3]=a,e[4]=l):l=e[4];const m=l;let f;return e[5]!==i||e[6]!==m||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(dt,{children:g=>{const{reset:d}=g;return t.jsx(ut,{fallback:h=>{const{error:x,resetError:j}=h;return t.jsx(W,{visual:m,children:t.jsx(gs,{orgName:n.name,message:x instanceof Error?x.message:"We could not check Commerce Discovery setup.",onRetry:()=>{d(),j()}})})},children:t.jsx(M.Suspense,{fallback:t.jsx(W,{visual:m,children:t.jsx(ze,{variant:"connect"})}),children:t.jsx(hs,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=m,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function gs(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(ee,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let a;e[2]!==i?(a=t.jsx(ye,{message:i}),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=t.jsx(V,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=l):l=e[5];let m;return e[6]!==r||e[7]!==a||e[8]!==l?(m=t.jsxs("div",{className:"grid gap-10",children:[r,a,l]}),e[6]=r,e[7]=a,e[8]=l,e[9]=m):m=e[9],m}function hs(s){const e=E.c(104),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=mt();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:gt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const a=Ue(r),[l,m]=M.useState(i??""),[f,g]=M.useState(null),[d,h]=M.useState(null),x=M.useRef(!1),j=pt.COMMERCE_DISCOVERY(n.id),y=$t(n.id),p=Q.commerceDiscoveryConnection(n.id,j);let u;e[3]!==j||e[4]!==a?(u=async()=>{const z=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return ke(z)},e[3]=j,e[4]=a,e[5]=u):u=e[5];let S;e[6]!==p||e[7]!==u?(S={queryKey:p,queryFn:u,retry:!1},e[6]=p,e[7]=u,e[8]=S):S=e[8];const b=me(S),C=Q.commerceDiscoveryVirtualMcp(n.id,y);let _;e[9]!==a||e[10]!==y?(_=async()=>{const z=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return ke(z)},e[9]=a,e[10]=y,e[11]=_):_=e[11];let k;e[12]!==C||e[13]!==_?(k={queryKey:C,queryFn:_,retry:!1},e[12]=C,e[13]=_,e[14]=k):k=e[14];const w=me(k);let N;e[15]!==a?(N=async z=>{const G=await a.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:z}});return ke(G)},e[15]=a,e[16]=N):N=e[16];let T;e[17]!==b||e[18]!==w?(T=z=>{g(z),h(null),b.refetch(),w.refetch()},e[17]=b,e[18]=w,e[19]=T):T=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=z=>{h(z instanceof Error?z.message:"Commerce Discovery setup failed.")},e[20]=A):A=e[20];let $;e[21]!==N||e[22]!==T?($={mutationFn:N,retry:!1,onSuccess:T,onError:A},e[21]=N,e[22]=T,e[23]=$):$=e[23];const I=Oe($);let R;e[24]!==a?(R={mutationFn:async z=>{const G=await a.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:z}});return ke(G)},retry:!1},e[24]=a,e[25]=R):R=e[25];const U=Oe(R),[F,q]=M.useState(null),P=!!b.data.item&&!!w.data.item,K=b.data.item,D=typeof K?.metadata?.siteUrl=="string"?K.metadata.siteUrl:void 0,v=i||l||D||"";let L;e[26]!==v||e[27]!==o?(L=St({siteUrl:v,email:o}),e[26]=v,e[27]=o,e[28]=L):L=e[28];const O=L;let B;e[29]!==O?(B=t.jsx(vt,{href:O}),e[29]=O,e[30]=B):B=e[30];const H=B;let je;e[31]!==I?(je=z=>{const G=Ee(z);if(!G.ok){h(G.error);return}h(null),I.mutate(G.value)},e[31]=I,e[32]=je):je=e[32];const te=je;let be;e[33]!==i||e[34]!==te||e[35]!==P?(be=z=>{!z||x.current||P||!i||(x.current=!0,te(i))},e[33]=i,e[34]=te,e[35]=P,e[36]=be):be=e[36];const Le=be;let Se;e[37]!==te||e[38]!==l?(Se=z=>{z.preventDefault(),te(l)},e[37]=te,e[38]=l,e[39]=Se):Se=e[39];const Y=Se;let ve;e[40]!==j||e[41]!==f?.reportApp||e[42]!==y?(ve=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:zt},e[40]=j,e[41]=f?.reportApp,e[42]=y,e[43]=ve):ve=e[43];const J=ve;let Ce;e[44]!==v||e[45]!==c||e[46]!==n.slug||e[47]!==J||e[48]!==U?(Ce=async()=>{q(null);const z=Ee(v);if(z.ok)try{await U.mutateAsync(z.value)}catch{q("Algo deu errado ao gerar seu relatório. Tente novamente em instantes.");return}localStorage.setItem(Ot.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:J.virtualMcpId,main:Ut(J.connectionId,J.toolName),chat:0}})},e[44]=v,e[45]=c,e[46]=n.slug,e[47]=J,e[48]=U,e[49]=Ce):Ce=e[49];const Pe=Ce;if(P){let z;return e[50]!==O||e[51]!==H||e[52]!==v||e[53]!==Pe||e[54]!==n||e[55]!==J||e[56]!==F||e[57]!==U.isPending?(z=t.jsx(xs,{org:n,reportApp:J,onOpenReport:Pe,isSubmitting:U.isPending,error:F,meetingUrl:O,meetingVisual:H,siteUrl:v}),e[50]=O,e[51]=H,e[52]=v,e[53]=Pe,e[54]=n,e[55]=J,e[56]=F,e[57]=U.isPending,e[58]=z):z=e[58],z}if(i){let z;e[59]!==i?(z=Ee(i),e[59]=i,e[60]=z):z=e[60];const G=z;if(!G.ok){const Me=`Commerce setup will continue for ${n.name}.`;let ae;e[61]!==Me?(ae=t.jsx(ee,{title:"Commerce diagnostics",description:Me}),e[61]=Me,e[62]=ae):ae=e[62];let ce;e[63]!==G.error?(ce=t.jsx(ye,{message:G.error}),e[63]=G.error,e[64]=ce):ce=e[64];let de;e[65]!==Y||e[66]!==d||e[67]!==I.isPending||e[68]!==l?(de=t.jsx(Ke,{siteUrl:l,error:d,isSubmitting:I.isPending,onSiteUrlChange:m,onSubmit:Y}),e[65]=Y,e[66]=d,e[67]=I.isPending,e[68]=l,e[69]=de):de=e[69];let ue;e[70]!==ae||e[71]!==ce||e[72]!==de?(ue=t.jsxs("div",{className:"grid gap-10",children:[ae,ce,de]}),e[70]=ae,e[71]=ce,e[72]=de,e[73]=ue):ue=e[73];let we;return e[74]!==H||e[75]!==ue?(we=t.jsx(W,{visual:H,children:ue}),e[74]=H,e[75]=ue,e[76]=we):we=e[76],we}const De=`Commerce Discovery is being prepared for ${G.value}.`;let oe;e[77]!==De?(oe=t.jsx(ee,{title:"Commerce diagnostics",description:De}),e[77]=De,e[78]=oe):oe=e[78];let re;e[79]!==Y||e[80]!==d||e[81]!==I||e[82]!==l?(re=d?t.jsxs(t.Fragment,{children:[t.jsx(ye,{message:d}),t.jsx(Ke,{siteUrl:l,error:null,isSubmitting:I.isPending,onSiteUrlChange:m,onSubmit:Y})]}):t.jsx(ze,{variant:"setup"}),e[79]=Y,e[80]=d,e[81]=I,e[82]=l,e[83]=re):re=e[83];let le;e[84]!==oe||e[85]!==re||e[86]!==Le?(le=t.jsxs("div",{ref:Le,className:"grid gap-10",children:[oe,re]}),e[84]=oe,e[85]=re,e[86]=Le,e[87]=le):le=e[87];let _e;return e[88]!==H||e[89]!==le?(_e=t.jsx(W,{visual:H,children:le}),e[88]=H,e[89]=le,e[90]=_e):_e=e[90],_e}const Ae=`Commerce setup will continue for ${n.name}.`;let ne;e[91]!==Ae?(ne=t.jsx(ee,{title:"Commerce diagnostics",description:Ae}),e[91]=Ae,e[92]=ne):ne=e[92];let se;e[93]!==Y||e[94]!==d||e[95]!==I.isPending||e[96]!==l?(se=t.jsx(Ke,{siteUrl:l,error:d,isSubmitting:I.isPending,onSiteUrlChange:m,onSubmit:Y}),e[93]=Y,e[94]=d,e[95]=I.isPending,e[96]=l,e[97]=se):se=e[97];let ie;e[98]!==ne||e[99]!==se?(ie=t.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[98]=ne,e[99]=se,e[100]=ie):ie=e[100];let Ne;return e[101]!==H||e[102]!==ie?(Ne=t.jsx(W,{visual:H,children:ie}),e[101]=H,e[102]=ie,e[103]=Ne):Ne=e[103],Ne}function Ke(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=a):a=e[0];let l;e[1]!==c?(l=y=>c(y.target.value),e[1]=c,e[2]=l):l=e[2];const m=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==l||e[6]!==m?(f=t.jsx(Re,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:l,placeholder:"https://example.com","aria-invalid":m,disabled:o}),e[3]=o,e[4]=n,e[5]=l,e[6]=m,e[7]=f):f=e[7];let g;e[8]!==i?(g=i?t.jsx(ye,{message:i}):null,e[8]=i,e[9]=g):g=e[9];let d;e[10]!==f||e[11]!==g?(d=t.jsxs("div",{className:"grid gap-2",children:[a,f,g]}),e[10]=f,e[11]=g,e[12]=d):d=e[12];let h;e[13]!==o?(h=o?t.jsx(wt,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(ht,{size:16})]}),e[13]=o,e[14]=h):h=e[14];let x;e[15]!==o||e[16]!==h?(x=t.jsx(V,{type:"submit",size:"xl",className:"w-full",disabled:o,children:h}),e[15]=o,e[16]=h,e[17]=x):x=e[17];let j;return e[18]!==r||e[19]!==d||e[20]!==x?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[d,x]}),e[18]=r,e[19]=d,e[20]=x,e[21]=j):j=e[21],j}function xs(s){const e=E.c(25),{org:n,reportApp:i,onOpenReport:o,isSubmitting:c,error:r,meetingUrl:a,meetingVisual:l,siteUrl:m}=s;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ee,{}),e[0]=f):f=e[0];let g;e[1]!==n||e[2]!==i.connectionId||e[3]!==m?(g=t.jsx(Jn,{org:n,cdConnectionId:i.connectionId,siteUrl:m}),e[1]=n,e[2]=i.connectionId,e[3]=m,e[4]=g):g=e[4];let d;e[5]!==a?(d=t.jsx(os,{className:"md:hidden",href:a}),e[5]=a,e[6]=d):d=e[6];let h;e[7]!==r?(h=r?t.jsx(ye,{message:r}):null,e[7]=r,e[8]=h):h=e[8];const x=c||!i.virtualMcpId;let j;e[9]!==c?(j=c?t.jsx(wt,{}):t.jsxs(t.Fragment,{children:["See full report",t.jsx(ht,{size:18})]}),e[9]=c,e[10]=j):j=e[10];let y;e[11]!==o||e[12]!==x||e[13]!==j?(y=t.jsx(V,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:x,children:j}),e[11]=o,e[12]=x,e[13]=j,e[14]=y):y=e[14];let p;e[15]!==d||e[16]!==h||e[17]!==y?(p=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[d,h,y]}),e[15]=d,e[16]=h,e[17]=y,e[18]=p):p=e[18];let u;e[19]!==g||e[20]!==p?(u=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[f,g,p]}),e[19]=g,e[20]=p,e[21]=u):u=e[21];let S;return e[22]!==l||e[23]!==u?(S=t.jsx(W,{align:"fill",visual:l,children:u}),e[22]=l,e[23]=u,e[24]=S):S=e[24],S}function ye(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{_i as default};
|
package/dist/client/assets/{connect-desktop-dialog-CdehM8HT.js → connect-desktop-dialog-D-0UYkrF.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-
|
|
1
|
+
import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-DptZZauK.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-B2DoU3ik.js";import{S as _}from"./chat-context-JTwjeHTY.js";import{i as $}from"./ChevronUp-u7VhfB08.js";import{a as A}from"./Eye-C8Vfx0-4.js";import{u as B}from"./studio-tools-BY37pyys.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=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]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=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]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=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 r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!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:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,C 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,C as $,b0 as k,K as D,l as E,j as x}from"./index-DptZZauK.js";import{u as K}from"./use-registry-connections-DiD1GxkL.js";import{b as Q}from"./use-organization-settings-CVnodPz6.js";import{S as w,e as F}from"./use-mcp-client-CROrubmo.js";import{u as H}from"./useInfiniteQuery-Dhot3ff6.js";import{i as q,f as G}from"./extract-connection-data-D2gQKJCU.js";import{C as U}from"./card-PDEPm9MW.js";import{I as V}from"./integration-icon-YoYYs9mF.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 N=null;try{N=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await N.callTool({name:j,arguments:I}),C=P.structuredContent??P,M=C.nextCursor||C.cursor||void 0,L=G(C?[C]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await N?.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 N;e[22]!==r?(N=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=N):N=e[23];let I;e[24]!==v||e[25]!==N||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,N]}),e[24]=v,e[25]=N,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 C;e[30]!==I||e[31]!==P?(C=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=C):C=e[32];let M;return e[33]!==u||e[34]!==C||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:C}),e[33]=u,e[34]=C,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};
|