decocms 3.88.1 → 3.89.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.
Files changed (219) hide show
  1. package/dist/client/assets/{AlertCircle-BCIpqdRc.js → AlertCircle-BMCh3ayd.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-SKBw9Pqy.js → ArrowUpRight-CwVMUp5O.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-C0cmb-ZB.js → CheckCircle-BP2lb3AX.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-DFwL-kIX.js → ChevronDown-CkcGr2qp.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BbIMqdNp.js → ChevronLeft-Cgw9JZYG.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-DFQnpIJA.js → ChevronRight-DYe9AFXl.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BVY3AvRH.js → ChevronUp-CiXD4kQk.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BjXhBL_Z.js → DotsVertical-Z_h1bSB3.js} +1 -1
  9. package/dist/client/assets/{Eye-CM171o_T.js → Eye-B92Ff4dY.js} +1 -1
  10. package/dist/client/assets/{FilterLines-B_OLvBIX.js → FilterLines-CMHeCbJ1.js} +1 -1
  11. package/dist/client/assets/{Form-Dm-inpFl.js → Form-GDlYmtQN.js} +1 -1
  12. package/dist/client/assets/{Globe01-CFpPlYvw.js → Globe01-MZlo2_34.js} +1 -1
  13. package/dist/client/assets/{Globe04-CUih2PQk.js → Globe04-BPWbnzx0.js} +1 -1
  14. package/dist/client/assets/{HardDrive-37phhXDh.js → HardDrive-D8FSpDtM.js} +1 -1
  15. package/dist/client/assets/{Key01-Bjq3bISb.js → Key01-CZVV-ceU.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DUnSd2UV.js → LayoutLeft-CuTI_WR9.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DXj8YNx5.js → LinkExternal01-DekFjc9P.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DkcBJDC1.js → Monitor01-BxGhRsUq.js} +1 -1
  19. package/dist/client/assets/{Palette-CPUIuuVv.js → Palette-BDlA8RUr.js} +1 -1
  20. package/dist/client/assets/{Play-CuliKeri.js → Play-BGGUeSDd.js} +1 -1
  21. package/dist/client/assets/{Plus-B-Qs2Uiq.js → Plus-CQOl41pg.js} +1 -1
  22. package/dist/client/assets/{SearchMd-DcehxwpA.js → SearchMd-Da504yGV.js} +1 -1
  23. package/dist/client/assets/{Settings02-DWIquGN2.js → Settings02-ozrzAwut.js} +1 -1
  24. package/dist/client/assets/{Shield01-CRDfaYL2.js → Shield01-CYPtC_lA.js} +1 -1
  25. package/dist/client/assets/{Star01-DebOZ6Zn.js → Star01-BoZIiKCL.js} +1 -1
  26. package/dist/client/assets/{Stars01-Dj5S_ACA.js → Stars01-BJuGXG_N.js} +1 -1
  27. package/dist/client/assets/{Stars02-BdFvlKms.js → Stars02-C4CXFnp9.js} +1 -1
  28. package/dist/client/assets/{Sun-D6czlCwk.js → Sun-2eUdoD8j.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-DmVhweUV.js → SwitchHorizontal01-DXdcIz27.js} +1 -1
  30. package/dist/client/assets/{Tool01-DNQgtpv8.js → Tool01-WsqNh4er.js} +1 -1
  31. package/dist/client/assets/{Trash01-2p0FIGGa.js → Trash01-z6De146C.js} +1 -1
  32. package/dist/client/assets/{Upload01-borqnT3M.js → Upload01-C4sYhZ0M.js} +1 -1
  33. package/dist/client/assets/{User01-iMaJ5G5i.js → User01-Cvp121NC.js} +1 -1
  34. package/dist/client/assets/{Users01-BlJ103LD.js → Users01-DcrlsWI1.js} +1 -1
  35. package/dist/client/assets/{Users03-6ZTV5EsG.js → Users03-CJuVy8Iz.js} +1 -1
  36. package/dist/client/assets/{X-DR9HB3B3.js → X-DgKWdqZ1.js} +1 -1
  37. package/dist/client/assets/{XCircle-BQDoqvYV.js → XCircle-DFBcUexW.js} +1 -1
  38. package/dist/client/assets/{XClose-BbTEw9b1.js → XClose-BKWXOZkj.js} +1 -1
  39. package/dist/client/assets/{Zap-CoqWx4PQ.js → Zap-Cxu6aoRs.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-C7oRshsF.js → ZapSquare-DOK7F1oe.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-D-HdW_bf.js → ZoomOut-ryBmf3S4.js} +1 -1
  42. package/dist/client/assets/{access-gate-C5x-nRLy.js → access-gate-DvuwS2Bs.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-W_473tnC.js → add-section-modal-CEyStjwy.js} +1 -1
  44. package/dist/client/assets/{agent-icon-BFccYxE5.js → agent-icon-pz8iT5cD.js} +1 -1
  45. package/dist/client/assets/{agents-list-UIM5n1tr.js → agents-list-C2TIIavL.js} +1 -1
  46. package/dist/client/assets/{ai-providers-4i5N4cdg.js → ai-providers-bb2flxno.js} +1 -1
  47. package/dist/client/assets/{alert-O-NNji_4.js → alert-BwNlkWBE.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-CZnOoJ9w.js → alert-dialog-CkCCiKt9.js} +1 -1
  49. package/dist/client/assets/{app-editor-CmlVQAd-.js → app-editor-mcTFLJlr.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-DICepikF.js → auth-catchall-HTDRVC4_.js} +1 -1
  51. package/dist/client/assets/{auth-entry-BMdUR7LR.js → auth-entry-BNYZmdvo.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-DSn4MzJT.js → auth-split-layout-DuCP9Fwl.js} +1 -1
  53. package/dist/client/assets/{auth-CfzJww_p.js → auth-xlfJjVrK.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-CqNVbzec.js → authenticate-and-persist-oauth-DPn6Vk96.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-BwuHwIT3.js → automation-list-row-CCZ8TAPg.js} +1 -1
  56. package/dist/client/assets/{automation-runs-CjE_mZvH.js → automation-runs-DBQv8Uvp.js} +1 -1
  57. package/dist/client/assets/{automations-DF-bRVrC.js → automations-D1p0mjNs.js} +1 -1
  58. package/dist/client/assets/{avatar-D2dw8dhk.js → avatar-Bh53txVX.js} +1 -1
  59. package/dist/client/assets/{badge-ChLKVFSi.js → badge-CdirlPdy.js} +1 -1
  60. package/dist/client/assets/block-document-D978uGtK.js +3 -0
  61. package/dist/client/assets/{brand-context-WmHjCNp8.js → brand-context-Ds48Bazs.js} +1 -1
  62. package/dist/client/assets/{buckets-BcMIDhNa.js → buckets-C6_Hhy5c.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-C3xdYLVG.js → capability-load-error-DgQyDsKl.js} +1 -1
  64. package/dist/client/assets/{card-DA0CRdef.js → card-D_tApM0k.js} +1 -1
  65. package/dist/client/assets/category-editor-DMZmSuPk.js +1 -0
  66. package/dist/client/assets/{chat-context-BaKzEXcz.js → chat-context-Dz9rhizY.js} +1 -1
  67. package/dist/client/assets/{checkbox-rsDrEbTB.js → checkbox-OtNKSART.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Y19Y0atA.js → cli-auth-success-BsGnTz93.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CxHpa3sj.js → collection-detail-8pBdQXs6.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-ilKYzdMu.js → collection-display-button-BgYBCk8T.js} +1 -1
  71. package/dist/client/assets/{collection-search-CWexPPH3.js → collection-search-JfLpXbmD.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CwjzVCpn.js → collection-tabs-B5YA_dM5.js} +1 -1
  73. package/dist/client/assets/{command-dTVkHeNJ.js → command-iFNWkWs6.js} +1 -1
  74. package/dist/client/assets/{commerce-onboarding-cOpcTeJO.js → commerce-onboarding-CjPSY7Rg.js} +1 -1
  75. package/dist/client/assets/{connect-desktop-dialog-Cl0j0-1f.js → connect-desktop-dialog-BxJ3X8re.js} +1 -1
  76. package/dist/client/assets/{connection-card-CL-zmo2b.js → connection-card--7NnoNLM.js} +1 -1
  77. package/dist/client/assets/{connection-detail-CEMYpDe1.js → connection-detail-Bak6_MXj.js} +1 -1
  78. package/dist/client/assets/{connection-form-helpers-DdtC3Pgy.js → connection-form-helpers-BW7AB-E3.js} +1 -1
  79. package/dist/client/assets/{connections-CnUcW-CM.js → connections-MxbhAMWj.js} +1 -1
  80. package/dist/client/assets/{context-menu-Cw4avSU4.js → context-menu-3RQyDKF5.js} +1 -1
  81. package/dist/client/assets/{decopilot-B4twc2Ml.js → decopilot-CiHv6XGE.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DkZeJYQj.js → decopilot-sse-pool-DXv2T192.js} +1 -1
  83. package/dist/client/assets/{dialog-DCgiGyoi.js → dialog-BFjL_my-.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BLhn_7dP.js → domain-settings-CuN5wwNc.js} +1 -1
  85. package/dist/client/assets/{drawer-CKz3r6D-.js → drawer-DZMXZPMN.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-Dn7Pv2Pt.js → dropdown-menu-B1DaP6vk.js} +1 -1
  87. package/dist/client/assets/{empty-state-DFoHkneE.js → empty-state-Lmcbk0Zv.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-4oeG-upD.js → extract-connection-data-Bau_aQvM.js} +1 -1
  89. package/dist/client/assets/{file-explorer-BjHGhNtP.js → file-explorer-CdToudqs.js} +1 -1
  90. package/dist/client/assets/{file-type-icon-3XkxZRTu.js → file-type-icon-CWgZWEkL.js} +1 -1
  91. package/dist/client/assets/{files-CawxLW4D.js → files-C6shWZY2.js} +1 -1
  92. package/dist/client/assets/{form-B4KTOAgi.js → form-B6Nf7hvD.js} +1 -1
  93. package/dist/client/assets/{general-B0o8nYom.js → general-BRjdlS0B.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-CxIi3moc.js → github-repo-picker-CThHTj5h.js} +1 -1
  95. package/dist/client/assets/{hooks-D1JlGnCv.js → hooks-CFfc1t5D.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-CMhv1JnE.js → import-from-deco-dialog-DnC_H8Us.js} +1 -1
  97. package/dist/client/assets/{index-DF3DGNsa.js → index-BDyN-RAN.js} +1 -1
  98. package/dist/client/assets/{index-B7DVjTC7.js → index-BK0DpA7w.js} +1 -1
  99. package/dist/client/assets/{index-BjV5UmPA.js → index-BVXtRunj.js} +2 -2
  100. package/dist/client/assets/{index-o74L97pJ.js → index-BtmyrH9L.js} +1 -1
  101. package/dist/client/assets/index-BzszuDGF.css +1 -0
  102. package/dist/client/assets/{index-CSs07ljO.js → index-C0_iRWcE.js} +1 -1
  103. package/dist/client/assets/{index-JbHIg2eg.js → index-C2QgbLxn.js} +27 -27
  104. package/dist/client/assets/{index-DHxp-zO5.js → index-C_XJPG8Z.js} +1 -1
  105. package/dist/client/assets/{index-CuPMUFWV.js → index-CjtDPqlj.js} +1 -1
  106. package/dist/client/assets/{index-Cv9mBjo7.js → index-CurNB2HG.js} +3 -3
  107. package/dist/client/assets/{index-DBkYOfx6.js → index-DqUFDG_W.js} +1 -1
  108. package/dist/client/assets/{index-C8-GFIYP.js → index-EwbYDv-_.js} +1 -1
  109. package/dist/client/assets/{index-BgN2bNGb.js → index-ZANilAX7.js} +1 -1
  110. package/dist/client/assets/{index-CpU6xEJd.js → index-ovnDLwrg.js} +1 -1
  111. package/dist/client/assets/{index-B_PLzC2v.js → index-qZ5-LmpP.js} +1 -1
  112. package/dist/client/assets/{index-redirect-tROvvlFl.js → index-redirect-Cc9Y9Kn-.js} +1 -1
  113. package/dist/client/assets/{input-C0jOhK5B.js → input-RRjvrcUF.js} +1 -1
  114. package/dist/client/assets/{integration-icon-D1BIYakT.js → integration-icon-Dpj2NSXY.js} +1 -1
  115. package/dist/client/assets/{label-Go7fdZec.js → label-DrXdAtn0.js} +1 -1
  116. package/dist/client/assets/{login-CX_AdtQ-.js → login-CdGM36BM.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-zDKd_I88.js → mcp-oauth-B5dnAc7V.js} +1 -1
  118. package/dist/client/assets/{members-DzrJ6F8u.js → members-C-wG0rnC.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-CdOky8aD.js → monaco-editor-zMbhl8rq.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-CNi1h27K.js → monitoring-stats-row-BnDnFbz0.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-CegWs_BO.js → oauth-callback-Dkf89E49.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-DMF7paT9.js → oauth-callback-ai-provider-BzTdkWaI.js} +1 -1
  123. package/dist/client/assets/{onboarding-BtQmIq0z.js → onboarding-CK9ke2oh.js} +1 -1
  124. package/dist/client/assets/{org-install-lwDrsMSp.js → org-install-CyaR-8_i.js} +1 -1
  125. package/dist/client/assets/{org-layout-DouPSHHv.js → org-layout-BDwAg4pd.js} +1 -1
  126. package/dist/client/assets/{organization-choice-Dg2la2I2.js → organization-choice-BcGxKG4I.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-7jsYE-bR.js → page-seo-form-CvCtyrxH.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-lBchETUb.js +1 -0
  129. package/dist/client/assets/{popover-D3saJV3U.js → popover-D7BamlkK.js} +1 -1
  130. package/dist/client/assets/post-editor-CJXGoikN.js +1 -0
  131. package/dist/client/assets/{preview-dialog-CGl7Sy5i.js → preview-dialog-C9Rx0Dtg.js} +1 -1
  132. package/dist/client/assets/primitives-BmW50XTY.js +1 -0
  133. package/dist/client/assets/{profile-Vb1WsqO8.js → profile-CzQbXboe.js} +1 -1
  134. package/dist/client/assets/project-app-view-CMzykg6f.js +1 -0
  135. package/dist/client/assets/record-editor-B__3b7h2.js +1 -0
  136. package/dist/client/assets/registry-DpRLil7D.js +2 -0
  137. package/dist/client/assets/{registry-layout-BRj2l1J0.js → registry-layout-D86NULga.js} +1 -1
  138. package/dist/client/assets/{require-capability-NjWUSrkJ.js → require-capability-CBJ6cwe3.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-BtAy7Pd6.js → required-auth-layout-Be__d9RH.js} +1 -1
  140. package/dist/client/assets/{reset-password-lpVy4ukP.js → reset-password-CFeeThio.js} +1 -1
  141. package/dist/client/assets/{roles-65tSQzKf.js → roles-P1-HY2OT.js} +1 -1
  142. package/dist/client/assets/{save-status-D1p0Uwgi.js → save-status-C9pT75mA.js} +1 -1
  143. package/dist/client/assets/{scroll-area-gFPEoZcL.js → scroll-area-CbWYdgRA.js} +1 -1
  144. package/dist/client/assets/{search-input-DmEH8Ik-.js → search-input-CeqwXCv0.js} +1 -1
  145. package/dist/client/assets/{secrets-D24hWrk1.js → secrets-EVcWk0yc.js} +1 -1
  146. package/dist/client/assets/{sections-editor-CsGa2Z5S.js → sections-editor-uxePiNCk.js} +1 -1
  147. package/dist/client/assets/{select-DUEHeuYo.js → select-BePf1IJF.js} +1 -1
  148. package/dist/client/assets/{select-model-CUG8RLc1.js → select-model-CgXZFBIr.js} +1 -1
  149. package/dist/client/assets/{seo-editor-BARjXWLU.js → seo-editor-BpqPSu1k.js} +1 -1
  150. package/dist/client/assets/{settings-layout-DrN_hvu_.js → settings-layout-ljEOwxAc.js} +1 -1
  151. package/dist/client/assets/{settings-section-C-8azX4E.js → settings-section-ELYurXQx.js} +1 -1
  152. package/dist/client/assets/{sheet-CDn5A9WC.js → sheet-Djk8ol5s.js} +1 -1
  153. package/dist/client/assets/{shell-controls-BemuITSX.js → shell-controls-CqOBDieU.js} +1 -1
  154. package/dist/client/assets/{shell-layout-Cwj61PL5.js → shell-layout-BkVrkYmb.js} +1 -1
  155. package/dist/client/assets/{shell-route-loading-BN6f_zUm.js → shell-route-loading-gKBpXu2h.js} +1 -1
  156. package/dist/client/assets/{sidebar-oD2qUX49.js → sidebar-DLCPSSnc.js} +1 -1
  157. package/dist/client/assets/{skeleton-C5vXsjqx.js → skeleton-DrM35KBr.js} +1 -1
  158. package/dist/client/assets/{sortable.esm-CNbrC8ai.js → sortable.esm-BN6bAoSL.js} +1 -1
  159. package/dist/client/assets/{sso-VkKddh5w.js → sso-By4pryNN.js} +1 -1
  160. package/dist/client/assets/{store-Bh13057J.js → store-BSz8T3hr.js} +1 -1
  161. package/dist/client/assets/store-registry-mttn5AI8.js +2 -0
  162. package/dist/client/assets/{studio-tools-CMCuOE16.js → studio-tools-BvQ8Bli1.js} +1 -1
  163. package/dist/client/assets/{switch-Bp8R4Ogd.js → switch-dEe0am9a.js} +1 -1
  164. package/dist/client/assets/{table-D0QkFxSQ.js → table-D_zHkpnq.js} +1 -1
  165. package/dist/client/assets/{tabs-CWEvITsy.js → tabs-DOJ7e6Z7.js} +1 -1
  166. package/dist/client/assets/{task-status-Bqa_azXs.js → task-status-DLHF9SZS.js} +1 -1
  167. package/dist/client/assets/{textarea-B8PE02TA.js → textarea-C7j7_npp.js} +1 -1
  168. package/dist/client/assets/{toggle-group-D1ygaulT.js → toggle-group-CSO_yZKm.js} +1 -1
  169. package/dist/client/assets/{toolbar-BwJHQetE.js → toolbar-D9CfLhAB.js} +1 -1
  170. package/dist/client/assets/{tools-list-DD46gG5N.js → tools-list-DC6csFT2.js} +1 -1
  171. package/dist/client/assets/{tooltip-DEAb2mMq.js → tooltip-CUlMaf5E.js} +1 -1
  172. package/dist/client/assets/{types-DF4YAM64.js → types-CDn4NSje.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-CBzxmcdL.js → use-ai-providers-D-XhQ6_q.js} +1 -1
  174. package/dist/client/assets/{use-automations-BryczEJs.js → use-automations-BllXXW29.js} +1 -1
  175. package/dist/client/assets/{use-capability-CRizWZs3.js → use-capability-DfdnXTfH.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-DeHv8kzt.js → use-clock-tick-DmUrmEeM.js} +1 -1
  177. package/dist/client/assets/{use-collections-B2ebH0Yh.js → use-collections-w44ZyJ1t.js} +1 -1
  178. package/dist/client/assets/{use-connection-D4_Drm-K.js → use-connection-Cvfufzsw.js} +1 -1
  179. package/dist/client/assets/{use-copy-DaxQFJa8.js → use-copy-BWQBaWRC.js} +1 -1
  180. package/dist/client/assets/{use-create-virtual-mcp-MkFBLM_P.js → use-create-virtual-mcp-CGofqNOQ.js} +1 -1
  181. package/dist/client/assets/{use-debounced-autosave-13ce3omV.js → use-debounced-autosave-CaTQp8tz.js} +1 -1
  182. package/dist/client/assets/{use-delete-connection-CGPl50zG.js → use-delete-connection-CNA7qawq.js} +1 -1
  183. package/dist/client/assets/{use-file-configs-tkbkdJ9-.js → use-file-configs-Bg9S5WW4.js} +1 -1
  184. package/dist/client/assets/{use-infinite-scroll-Dz6YZ4ZF.js → use-infinite-scroll-BlkXRVRw.js} +1 -1
  185. package/dist/client/assets/{use-join-requests-K6mmzn8F.js → use-join-requests-ByqDno7o.js} +1 -1
  186. package/dist/client/assets/{use-mcp-client-CqKvf2Rs.js → use-mcp-client-BbOUwA1H.js} +1 -1
  187. package/dist/client/assets/{use-mcp-prompts-42nV8aO-.js → use-mcp-prompts-Y5le4syR.js} +1 -1
  188. package/dist/client/assets/{use-mcp-tools-Ck3LeedI.js → use-mcp-tools-xGr1pN0n.js} +1 -1
  189. package/dist/client/assets/{use-members-Bsy0lU2t.js → use-members-blURElyD.js} +1 -1
  190. package/dist/client/assets/{use-navigate-to-agent-BsjU5Fmv.js → use-navigate-to-agent-CidcWwFC.js} +1 -1
  191. package/dist/client/assets/{use-org-auth-client-ycYUmZOr.js → use-org-auth-client-oMz0ubhe.js} +1 -1
  192. package/dist/client/assets/{use-org-sso-BtqdNxB3.js → use-org-sso-CIoYIaj1.js} +1 -1
  193. package/dist/client/assets/{use-organization-roles-CFrhcoj4.js → use-organization-roles-tA96x-8d.js} +1 -1
  194. package/dist/client/assets/{use-organization-settings-BDxA4itK.js → use-organization-settings-B5L78CqV.js} +1 -1
  195. package/dist/client/assets/{use-registry-connections-TpTO-i4h.js → use-registry-connections-3CHe_VwJ.js} +1 -1
  196. package/dist/client/assets/{use-secrets-DI_VwrKE.js → use-secrets-DlUSWVTu.js} +1 -1
  197. package/dist/client/assets/{use-status-sounds-Cvxd_NmF.js → use-status-sounds-Bbu_XWuO.js} +1 -1
  198. package/dist/client/assets/{use-view-mode-GKSdIw_y.js → use-view-mode-Dff0V9fY.js} +1 -1
  199. package/dist/client/assets/{use-virtual-mcp-Bhfb_Jiz.js → use-virtual-mcp-CLJ6qnG1.js} +1 -1
  200. package/dist/client/assets/useInfiniteQuery-BAIT4yxs.js +1 -0
  201. package/dist/client/assets/{useQueries-BBZ27cM8.js → useQueries-BqFctUi9.js} +1 -1
  202. package/dist/client/assets/useSuspenseInfiniteQuery-DpmGs3CS.js +1 -0
  203. package/dist/client/assets/{variant-calendar-Cp8r9l3J.js → variant-calendar-CUrfAk6h.js} +1 -1
  204. package/dist/client/assets/{view-mode-toggle-DleyNb-_.js → view-mode-toggle-CIiu6iGh.js} +1 -1
  205. package/dist/client/index.html +2 -2
  206. package/dist/server/cli.js +1 -1
  207. package/package.json +1 -1
  208. package/dist/client/assets/block-document-BkM5LwnW.js +0 -3
  209. package/dist/client/assets/category-editor-BWDkohsa.js +0 -1
  210. package/dist/client/assets/index-B6DoI6qf.css +0 -1
  211. package/dist/client/assets/page-seo-sheet-BKlqSNh3.js +0 -1
  212. package/dist/client/assets/post-editor-B_pMX1SM.js +0 -1
  213. package/dist/client/assets/primitives-uaedrAQa.js +0 -1
  214. package/dist/client/assets/project-app-view-BrJHzPRK.js +0 -1
  215. package/dist/client/assets/record-editor-DVQsAljm.js +0 -1
  216. package/dist/client/assets/registry-BvmeKd0N.js +0 -2
  217. package/dist/client/assets/store-registry-CKoPW5oz.js +0 -2
  218. package/dist/client/assets/useInfiniteQuery-Bpa3bNzf.js +0 -1
  219. package/dist/client/assets/useSuspenseInfiniteQuery-BjdhIRNy.js +0 -1
@@ -1 +1 @@
1
- import{c as y,j as t,B as F,i as X,z as Ge,C as se,E as Pe,r as T,w as ie,G as Qe,l as V,bf as Ye,u as Xe,y as G,t as Ze,e as ae,b1 as ke}from"./index-Cv9mBjo7.js";import{E as Ee}from"./empty-state-DFoHkneE.js";import{u as et,a as Ae}from"./use-collections-B2ebH0Yh.js";import{u as ce}from"./use-mcp-client-CqKvf2Rs.js";import{F as ne,a as tt,b as de,d as me}from"./form-B4KTOAgi.js";import{I as ue}from"./input-C0jOhK5B.js";import{T as re}from"./textarea-B8PE02TA.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-C8-GFIYP.js";import{ag as rt,x as it,a5 as at,ah as ct,a1 as dt,ai as mt,M as be}from"./agent-icon-BFccYxE5.js";import{g as ut,M as xt,a as Ne}from"./types-DF4YAM64.js";import{A as pt,a as ft,b as ht}from"./alert-O-NNji_4.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-DUEHeuYo.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-DEAb2mMq.js";import{i as jt}from"./AlertCircle-BCIpqdRc.js";import{s as bt}from"./Stars02-BdFvlKms.js";import{a as Nt}from"./Eye-CM171o_T.js";import{i as vt}from"./Play-CuliKeri.js";import{i as St}from"./ChevronRight-DFQnpIJA.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DD46gG5N.js";import{a as Oe,u as Re}from"./use-connection-D4_Drm-K.js";import{a as It}from"./use-mcp-tools-Ck3LeedI.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-D1BIYakT.js";import{f as Tt,h as Pt}from"./chat-context-BaKzEXcz.js";import{b as kt}from"./shell-layout-Cwj61PL5.js";import{M as Et}from"./monaco-editor-CdOky8aD.js";import{n as At}from"./XCircle-BQDoqvYV.js";import"./auth-CfzJww_p.js";import"./label-Go7fdZec.js";import"./index-B_PLzC2v.js";import"./sidebar-oD2qUX49.js";import"./LayoutLeft-DUnSd2UV.js";import"./sheet-CDn5A9WC.js";import"./X-DR9HB3B3.js";import"./ZoomOut-D-HdW_bf.js";import"./Key01-Bjq3bISb.js";import"./extract-connection-data-4oeG-upD.js";import"./use-registry-connections-TpTO-i4h.js";import"./use-organization-settings-BDxA4itK.js";import"./studio-tools-CMCuOE16.js";import"./Plus-B-Qs2Uiq.js";import"./Form-Dm-inpFl.js";import"./index-DHxp-zO5.js";import"./index-CpU6xEJd.js";import"./index-BdQq_4o_.js";import"./index-DF3DGNsa.js";import"./popover-D3saJV3U.js";import"./use-virtual-mcp-Bhfb_Jiz.js";import"./ChevronUp-BVY3AvRH.js";import"./SearchMd-DcehxwpA.js";import"./Users03-6ZTV5EsG.js";import"./use-create-virtual-mcp-MkFBLM_P.js";import"./use-navigate-to-agent-BsjU5Fmv.js";import"./Tool01-DNQgtpv8.js";import"./SwitchHorizontal01-DmVhweUV.js";import"./Settings02-DWIquGN2.js";import"./ArrowUpRight-SKBw9Pqy.js";import"./ZapSquare-C7oRshsF.js";import"./CheckCircle-C0cmb-ZB.js";import"./ChevronDown-DFwL-kIX.js";import"./ChevronLeft-BbIMqdNp.js";import"./DotsVertical-BjXhBL_Z.js";import"./Globe01-CFpPlYvw.js";import"./FilterLines-B_OLvBIX.js";import"./Star01-DebOZ6Zn.js";import"./Globe04-CUih2PQk.js";import"./HardDrive-37phhXDh.js";import"./LinkExternal01-DXj8YNx5.js";import"./Monitor01-DkcBJDC1.js";import"./Sun-D6czlCwk.js";import"./Palette-CPUIuuVv.js";import"./Shield01-CRDfaYL2.js";import"./Stars01-Dj5S_ACA.js";import"./Trash01-2p0FIGGa.js";import"./Upload01-borqnT3M.js";import"./User01-iMaJ5G5i.js";import"./Users01-BlJ103LD.js";import"./XClose-BbTEw9b1.js";import"./Zap-CoqWx4PQ.js";import"./mcp-oauth-zDKd_I88.js";import"./badge-ChLKVFSi.js";import"./hooks-D1JlGnCv.js";import"./decopilot-sse-pool-DkZeJYQj.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CBzxmcdL.js";import"./tab-id-BptcWVWa.js";import"./avatar-D2dw8dhk.js";import"./dialog-DCgiGyoi.js";import"./required-auth-layout-BtAy7Pd6.js";import"./use-org-sso-BtqdNxB3.js";import"./index-BgN2bNGb.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render: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 zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(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 ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),D=`${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"),[De,Le]=T.useState(!1);O&&!De&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(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(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant: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(F,{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(D,d),onTeardown:()=>A?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async 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 D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,D]})}),s[26]=U,s[27]=D,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 Dn(){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{Dn as default};
1
+ import{c as y,j as t,B as F,i as X,z as Ge,C as se,E as Pe,r as T,w as ie,G as Qe,l as V,bf as Ye,u as Xe,y as G,t as Ze,e as ae,b1 as ke}from"./index-CurNB2HG.js";import{E as Ee}from"./empty-state-Lmcbk0Zv.js";import{u as et,a as Ae}from"./use-collections-w44ZyJ1t.js";import{u as ce}from"./use-mcp-client-BbOUwA1H.js";import{F as ne,a as tt,b as de,d as me}from"./form-B6Nf7hvD.js";import{I as ue}from"./input-RRjvrcUF.js";import{T as re}from"./textarea-C7j7_npp.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-EwbYDv-_.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-pz8iT5cD.js";import{g as ut,M as xt,a as Ne}from"./types-CDn4NSje.js";import{A as pt,a as ft,b as ht}from"./alert-BwNlkWBE.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-BePf1IJF.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-CUlMaf5E.js";import{i as jt}from"./AlertCircle-BMCh3ayd.js";import{s as bt}from"./Stars02-C4CXFnp9.js";import{a as Nt}from"./Eye-B92Ff4dY.js";import{i as vt}from"./Play-BGGUeSDd.js";import{i as St}from"./ChevronRight-DYe9AFXl.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-DC6csFT2.js";import{a as Oe,u as Re}from"./use-connection-Cvfufzsw.js";import{a as It}from"./use-mcp-tools-xGr1pN0n.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-Dpj2NSXY.js";import{f as Tt,h as Pt}from"./chat-context-Dz9rhizY.js";import{b as kt}from"./shell-layout-BkVrkYmb.js";import{M as Et}from"./monaco-editor-zMbhl8rq.js";import{n as At}from"./XCircle-DFBcUexW.js";import"./auth-xlfJjVrK.js";import"./label-DrXdAtn0.js";import"./index-qZ5-LmpP.js";import"./sidebar-DLCPSSnc.js";import"./LayoutLeft-CuTI_WR9.js";import"./sheet-Djk8ol5s.js";import"./X-DgKWdqZ1.js";import"./ZoomOut-ryBmf3S4.js";import"./Key01-CZVV-ceU.js";import"./extract-connection-data-Bau_aQvM.js";import"./use-registry-connections-3CHe_VwJ.js";import"./use-organization-settings-B5L78CqV.js";import"./studio-tools-BvQ8Bli1.js";import"./Plus-CQOl41pg.js";import"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import"./index-ovnDLwrg.js";import"./index-BdQq_4o_.js";import"./index-BDyN-RAN.js";import"./popover-D7BamlkK.js";import"./use-virtual-mcp-CLJ6qnG1.js";import"./ChevronUp-CiXD4kQk.js";import"./SearchMd-Da504yGV.js";import"./Users03-CJuVy8Iz.js";import"./use-create-virtual-mcp-CGofqNOQ.js";import"./use-navigate-to-agent-CidcWwFC.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./ArrowUpRight-CwVMUp5O.js";import"./ZapSquare-DOK7F1oe.js";import"./CheckCircle-BP2lb3AX.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./DotsVertical-Z_h1bSB3.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./User01-Cvp121NC.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./Zap-Cxu6aoRs.js";import"./mcp-oauth-B5dnAc7V.js";import"./badge-CdirlPdy.js";import"./hooks-CFfc1t5D.js";import"./decopilot-sse-pool-DXv2T192.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-D-XhQ6_q.js";import"./tab-id-BptcWVWa.js";import"./avatar-Bh53txVX.js";import"./dialog-BFjL_my-.js";import"./required-auth-layout-Be__d9RH.js";import"./use-org-sso-CIoYIaj1.js";import"./index-ZANilAX7.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render: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 zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(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 ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),D=`${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"),[De,Le]=T.useState(!1);O&&!De&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(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(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant: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(F,{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(D,d),onTeardown:()=>A?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async 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 D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,D]})}),s[26]=U,s[27]=D,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 Dn(){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{Dn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-Cv9mBjo7.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-Dn7Pv2Pt.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-DmVhweUV.js";import{i as S}from"./ChevronUp-BVY3AvRH.js";import{T as I,a as K,c as P,b as W}from"./tooltip-DEAb2mMq.js";import{V as q}from"./view-mode-toggle-DleyNb-_.js";import{B as G}from"./badge-ChLKVFSi.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
+ import{c as B,j as s,l as M,B as V}from"./index-CurNB2HG.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-B1DaP6vk.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-DXdcIz27.js";import{i as S}from"./ChevronUp-CiXD4kQk.js";import{T as I,a as K,c as P,b as W}from"./tooltip-CUlMaf5E.js";import{V as q}from"./view-mode-toggle-CIiu6iGh.js";import{B as G}from"./badge-CdirlPdy.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-Cv9mBjo7.js";import{i as C}from"./SearchMd-DcehxwpA.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
+ import{c as v,l as b,j as a,i as w}from"./index-CurNB2HG.js";import{i as C}from"./SearchMd-Da504yGV.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-Cv9mBjo7.js";import{B as g}from"./badge-ChLKVFSi.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
+ import{c as f,l as u,j as m}from"./index-CurNB2HG.js";import{B as g}from"./badge-CdirlPdy.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-Cv9mBjo7.js";import{_ as m}from"./index-DF3DGNsa.js";import{d as k,a as N,b as j,D as b,c as w}from"./dialog-DCgiGyoi.js";import{i as y}from"./SearchMd-DcehxwpA.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};
1
+ import{c as d,l as i,j as n}from"./index-CurNB2HG.js";import{_ as m}from"./index-BDyN-RAN.js";import{d as k,a as N,b as j,D as b,c as w}from"./dialog-BFjL_my-.js";import{i as y}from"./SearchMd-Da504yGV.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};
@@ -1 +1 @@
1
- import{c as N,r as A,l as se,j as i,B as te,i as me,m as Re,K as Z,k as le,d as Se,a as ve,u as We,b as ze,n as Ve,o as Le,Q as Ge,E as Ye,p as we,L as Ze}from"./index-Cv9mBjo7.js";import{A as Je}from"./auth-entry-BMdUR7LR.js";import{A as J}from"./auth-split-layout-DSn4MzJT.js";import{O as ke}from"./organization-choice-Dg2la2I2.js";import{f as Xe}from"./tab-id-BptcWVWa.js";import{I as et}from"./input-C0jOhK5B.js";import{u as pe,W as Pe,S as $e,g as tt,C as nt}from"./use-mcp-client-CqKvf2Rs.js";import{i as Ue}from"./XCircle-BQDoqvYV.js";import{I as st}from"./integration-icon-D1BIYakT.js";import{v as Te,F as it}from"./Form-Dm-inpFl.js";import"./index-DHxp-zO5.js";import{i as Ae}from"./CheckCircle-C0cmb-ZB.js";import{i as ot}from"./ZoomOut-D-HdW_bf.js";import{g as rt,c as lt,e as at}from"./extract-connection-data-4oeG-upD.js";import{u as ct}from"./useQueries-BBZ27cM8.js";import{a as dt}from"./authenticate-and-persist-oauth-CqNVbzec.js";import{i as Me}from"./ArrowUpRight-SKBw9Pqy.js";import{s as De}from"./User01-iMaJ5G5i.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-D2dw8dhk.js";import"./auth-CfzJww_p.js";import"./agent-icon-BFccYxE5.js";import"./AlertCircle-BCIpqdRc.js";import"./Tool01-DNQgtpv8.js";import"./SwitchHorizontal01-DmVhweUV.js";import"./Settings02-DWIquGN2.js";import"./ZapSquare-C7oRshsF.js";import"./Users03-6ZTV5EsG.js";import"./ChevronUp-BVY3AvRH.js";import"./ChevronDown-DFwL-kIX.js";import"./ChevronLeft-BbIMqdNp.js";import"./ChevronRight-DFQnpIJA.js";import"./DotsVertical-BjXhBL_Z.js";import"./Stars02-BdFvlKms.js";import"./Eye-CM171o_T.js";import"./Globe01-CFpPlYvw.js";import"./FilterLines-B_OLvBIX.js";import"./Star01-DebOZ6Zn.js";import"./Globe04-CUih2PQk.js";import"./HardDrive-37phhXDh.js";import"./Key01-Bjq3bISb.js";import"./LayoutLeft-DUnSd2UV.js";import"./LinkExternal01-DXj8YNx5.js";import"./Monitor01-DkcBJDC1.js";import"./Sun-D6czlCwk.js";import"./Palette-CPUIuuVv.js";import"./Play-CuliKeri.js";import"./Plus-B-Qs2Uiq.js";import"./SearchMd-DcehxwpA.js";import"./Shield01-CRDfaYL2.js";import"./Stars01-Dj5S_ACA.js";import"./Trash01-2p0FIGGa.js";import"./Upload01-borqnT3M.js";import"./Users01-BlJ103LD.js";import"./XClose-BbTEw9b1.js";import"./X-DR9HB3B3.js";import"./Zap-CoqWx4PQ.js";import"./index-CpU6xEJd.js";import"./index-BdQq_4o_.js";import"./index-DF3DGNsa.js";import"./mcp-oauth-zDKd_I88.js";const ut=/^[a-zA-Z][a-zA-Z\d+.-]*:/,mt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,ft=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function be(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=ut.test(e),s=mt.test(e),o=ft.test(e);if(t&&!s&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=s?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(c=>!c||!gt.test(c))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function je(n){const e=N.c(14),{children:t,className:s,wrapperClassName:o}=n,[a,l]=A.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const j=()=>{const d=x.scrollHeight-x.scrollTop-x.clientHeight<8;l(d)};j(),x.addEventListener("scroll",j,{passive:!0});const b=new ResizeObserver(j);b.observe(x);for(const d of Array.from(x.children))b.observe(d);return()=>{x.removeEventListener("scroll",j),b.disconnect()}},e[0]=r):r=e[0];const c=r;let u;e[1]!==o?(u=se("relative",o),e[1]=o,e[2]=u):u=e[2];let m;e[3]!==t||e[4]!==s?(m=i.jsx("div",{ref:c,className:s,children:t}),e[3]=t,e[4]=s,e[5]=m):m=e[5];const f=a?"opacity-0":"opacity-100";let g;e[6]!==f?(g=se("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=g):g=e[7];let h;e[8]!==g?(h=i.jsx("div",{"aria-hidden":!0,className:g}),e[8]=g,e[9]=h):h=e[9];let p;return e[10]!==u||e[11]!==m||e[12]!==h?(p=i.jsxs("div",{className:u,children:[m,h]}),e[10]=u,e[11]=m,e[12]=h,e[13]=p):p=e[13],p}function pt(n){const e=n.properties;if(!e)return[];const t=[];for(const[s,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:s,bindingType:r})}return t}function ht(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function ee(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function xt(n,e,t,s){return{...n??{},[e]:{__type:t,value:s}}}function fe(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(fe):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&fe(t)):!1}function Ke(n){return fe(n)}function yt(n){return n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function bt(n){return fe(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function jt(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const s=bt(t);return s?[{key:e,label:yt(e),value:s}]:[]}):[]}function Ct(n,e,t){const s=n.filter(o=>o.app_name===e||!!t&&o.app_id===t);return s.length===0?null:(s.sort((o,a)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(a)?l(o)-l(a):(a.updated_at??"").localeCompare(o.updated_at??"")}),s[0].id)}function St(n){return n.server?.icons?.[0]?.src??rt(n.server?.repository)??null}function vt(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function _t(n){const e=[],t=new Map(n.connections.map(s=>[s.id,s]));for(const s of n.requirements){const o=n.curated[s.bindingType],a=o?n.itemsById[o.registryAppId]:n.itemsByName[s.bindingType];if(!a)continue;const l=n.configurationState?.[s.fieldKey]?.value,r=l?t.get(l):void 0,c=l&&r?l:null,u=c?n.connectionReadiness?.[c]!==!1:!1,m=!!c&&u;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:a,title:vt(a,s.bindingType),icon:St(a),headline:o?.headline??a._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:m,candidateConnectionId:m?null:c||Ct(n.connections,s.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:r?.configuration_state??null})}return e}function Nt(){const n=N.c(3);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),i.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),i.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),n[1]=t):t=n[1];let s;return n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),n[2]=s):s=n[2],s}function Ce(n){const e=N.c(3),{children:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Ae,{size:14,className:"shrink-0 text-blue-500"}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=i.jsxs("div",{className:"flex items-center gap-2 p-1",children:[s,i.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function It(n){const e=N.c(46),{card:t,connecting:s,disabled:o,onConnect:a,org:l,selfClient:r}=n,c=t.linkedConnectionId;let u;e[0]!==t.configurationState?(u=jt(t.configurationState),e[0]=t.configurationState,e[1]=u):u=e[1];const m=u;let f;e[2]!==t.configurationState||e[3]!==t.satisfied?(f=t.satisfied&&!Ke(t.configurationState),e[2]=t.configurationState,e[3]=t.satisfied,e[4]=f):f=e[4];const[g,h]=A.useState(f);let p;e[5]!==t.icon||e[6]!==t.title?(p=i.jsx(st,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1.5"}),e[5]=t.icon,e[6]=t.title,e[7]=p):p=e[7];let x;e[8]!==t.title?(x=i.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[8]=t.title,e[9]=x):x=e[9];let j;e[10]!==t.satisfied||e[11]!==t.title||e[12]!==s||e[13]!==o||e[14]!==a?(j=t.satisfied?i.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[i.jsx(Ae,{size:16})," Connected"]}):i.jsx(te,{type:"button",variant:"outline",size:"sm",disabled:o||s,onClick:a,"aria-label":`Connect ${t.title}`,children:s?i.jsx(me,{size:16,className:"animate-spin"}):"Connect"}),e[10]=t.satisfied,e[11]=t.title,e[12]=s,e[13]=o,e[14]=a,e[15]=j):j=e[15];let b;e[16]!==p||e[17]!==x||e[18]!==j?(b=i.jsxs("div",{className:"flex items-center gap-2",children:[p,x,j]}),e[16]=p,e[17]=x,e[18]=j,e[19]=b):b=e[19];let d;e[20]!==t.checks?(d=t.checks!==null&&i.jsxs(Ce,{children:["+ ",t.checks," checks"]}),e[20]=t.checks,e[21]=d):d=e[21];let y;e[22]!==t.headline?(y=t.headline&&i.jsx(Ce,{children:t.headline}),e[22]=t.headline,e[23]=y):y=e[23];let S;e[24]!==t.bullets?(S=t.bullets.map(Et),e[24]=t.bullets,e[25]=S):S=e[25];let v;e[26]!==t.candidateConnectionId||e[27]!==t.satisfied||e[28]!==t.title?(v=!t.satisfied&&t.candidateConnectionId&&i.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[26]=t.candidateConnectionId,e[27]=t.satisfied,e[28]=t.title,e[29]=v):v=e[29];let T;e[30]!==v||e[31]!==d||e[32]!==y||e[33]!==S?(T=i.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[d,y,S,v]}),e[30]=v,e[31]=d,e[32]=y,e[33]=S,e[34]=T):T=e[34];let I;e[35]!==t||e[36]!==g||e[37]!==c||e[38]!==l||e[39]!==m||e[40]!==r?(I=t.satisfied&&c&&i.jsx(Rt,{card:t,org:l,selfClient:r,connectionId:c,savedConfigEntries:m,isEditing:g,onEdit:()=>h(!0),onCancel:()=>h(!1),onSaved:()=>h(!1)}),e[35]=t,e[36]=g,e[37]=c,e[38]=l,e[39]=m,e[40]=r,e[41]=I):I=e[41];let R;return e[42]!==T||e[43]!==I||e[44]!==b?(R=i.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[b,T,I]}),e[42]=T,e[43]=I,e[44]=b,e[45]=R):R=e[45],R}function Et(n){return i.jsx(Ce,{children:n},n)}function wt(n){const e=n?.properties;return!!e&&typeof e=="object"&&Object.keys(e).length>0}function kt(n){return/(token|secret|password|appKey|key)$/i.test(n)}function Tt(n,e){return kt(n)?"••••••••":e}function Ot(n){const e=N.c(9),{id:t,label:s,description:o,children:a}=n;if(t.includes("__type")||t.includes("__binding"))return null;let l;e[0]!==t||e[1]!==s?(l=s&&i.jsx("label",{className:"text-sm font-medium text-foreground",htmlFor:t,children:s}),e[0]=t,e[1]=s,e[2]=l):l=e[2];let r;e[3]!==o?(r=o&&i.jsx("div",{className:"text-xs leading-4 text-muted-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let c;return e[5]!==a||e[6]!==l||e[7]!==r?(c=i.jsxs("div",{className:"grid gap-1.5",children:[l,a,r]}),e[5]=a,e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function Rt(n){const e=N.c(71),{card:t,org:s,selfClient:o,connectionId:a,savedConfigEntries:l,isEditing:r,onEdit:c,onCancel:u,onSaved:m}=n,f=Re();let g;e[0]!==a||e[1]!==s.id||e[2]!==s.slug?(g={connectionId:a,orgId:s.id,orgSlug:s.slug},e[0]=a,e[1]=s.id,e[2]=s.slug,e[3]=g):g=e[3];const h=pe(g);let p;e[4]!==t.configurationState?(p=t.configurationState??{},e[4]=t.configurationState,e[5]=p):p=e[5];const[x,j]=A.useState(p),[b,d]=A.useState(null);let y;e[6]!==a||e[7]!==s.id?(y=Z.commerceDiscoveryCompanionConnectionSchema(s.id,a),e[6]=a,e[7]=s.id,e[8]=y):y=e[8];let S;e[9]!==h?(S=async()=>{const k=await h.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(k)},e[9]=h,e[10]=S):S=e[10];let v;e[11]!==y||e[12]!==S?(v={queryKey:y,queryFn:S,retry:!1},e[11]=y,e[12]=S,e[13]=v):v=e[13];const T=le(v);let I;e[14]!==a||e[15]!==o?(I=async k=>{const _=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:a,data:{configuration_state:k}}});return ee(_)},e[14]=a,e[15]=o,e[16]=I):I=e[16];let R;e[17]!==m||e[18]!==s.id||e[19]!==f?(R=async()=>{d(null),await f.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnections(s.id)}),m()},e[17]=m,e[18]=s.id,e[19]=f,e[20]=R):R=e[20];let H;e[21]!==I||e[22]!==R?(H={mutationFn:I,onSuccess:R},e[21]=I,e[22]=R,e[23]=H):H=e[23];const E=Se(H),$=T.data?.stateSchema,L=wt($)&&(r||l.length>0);if(T.isPending){let k;return e[24]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-3 text-sm text-muted-foreground",children:[i.jsx(me,{size:14,className:"animate-spin"}),"Loading configuration..."]}),e[24]=k):k=e[24],k}if(T.error||!L||!$)return null;if(!r&&l.length>0){let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[25]=k):k=e[25];let _;e[26]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(ot,{size:14}),e[26]=_):_=e[26];let O;e[27]!==c?(O=i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[k,i.jsxs(te,{type:"button",variant:"ghost",size:"sm",onClick:c,children:[_,"Edit"]})]}),e[27]=c,e[28]=O):O=e[28];let X;e[29]!==l?(X=l.map(zt),e[29]=l,e[30]=X):X=e[30];let W;e[31]!==X?(W=i.jsx("dl",{className:"grid gap-2",children:X}),e[31]=X,e[32]=W):W=e[32];let Y;return e[33]!==O||e[34]!==W?(Y=i.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[O,W]}),e[33]=O,e[34]=W,e[35]=Y):Y=e[35],Y}let U;e[36]!==x||e[37]!==E||e[38]!==$?(U=()=>{if(!Ke(x)){d("Enter at least one configuration value.");return}const k=Te.validateFormData(x,$);if(k.errors.length>0){d(k.errors[0]?.stack??"Invalid configuration.");return}d(null),E.mutate(x)},e[36]=x,e[37]=E,e[38]=$,e[39]=U):U=e[39];const Q=U;let M;e[40]!==t.title?(M=i.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Configure ",t.title]}),e[40]=t.title,e[41]=M):M=e[41];const G=`${a}:configuration`;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=k=>j(k.formData??{}),e[42]=F):F=e[42];let V,P;e[43]===Symbol.for("react.memo_cache_sentinel")?(V={FieldTemplate:Ot},P=i.jsx(i.Fragment,{}),e[43]=V,e[44]=P):(V=e[43],P=e[44]);let D;e[45]!==x||e[46]!==$||e[47]!==G?(D=i.jsx(it,{schema:$,validator:Te,formData:x,onChange:F,liveValidate:!1,showErrorList:!1,templates:V,children:P},G),e[45]=x,e[46]=$,e[47]=G,e[48]=D):D=e[48];let w;e[49]!==E.error||e[50]!==b?(w=(b||E.error)&&i.jsx("p",{role:"alert",className:"text-sm text-destructive",children:b??(E.error instanceof Error?E.error.message:"Could not save configuration.")}),e[49]=E.error,e[50]=b,e[51]=w):w=e[51];let K;e[52]!==t.configurationState||e[53]!==u||e[54]!==E.isPending||e[55]!==l.length?(K=l.length>0&&i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j(t.configurationState??{}),d(null),u()},disabled:E.isPending,children:"Cancel"}),e[52]=t.configurationState,e[53]=u,e[54]=E.isPending,e[55]=l.length,e[56]=K):K=e[56];let B;e[57]!==E.isPending?(B=E.isPending?i.jsxs(i.Fragment,{children:[i.jsx(me,{size:14,className:"animate-spin"}),"Saving"]}):"Save",e[57]=E.isPending,e[58]=B):B=e[58];let q;e[59]!==Q||e[60]!==E.isPending||e[61]!==B?(q=i.jsx(te,{type:"button",size:"sm",onClick:Q,disabled:E.isPending,children:B}),e[59]=Q,e[60]=E.isPending,e[61]=B,e[62]=q):q=e[62];let C;e[63]!==K||e[64]!==q?(C=i.jsxs("div",{className:"flex justify-end gap-2",children:[K,q]}),e[63]=K,e[64]=q,e[65]=C):C=e[65];let z;return e[66]!==M||e[67]!==D||e[68]!==w||e[69]!==C?(z=i.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[M,D,w,C]}),e[66]=M,e[67]=D,e[68]=w,e[69]=C,e[70]=z):z=e[70],z}function zt(n){return i.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:n.label}),i.jsx("dd",{className:"truncate text-foreground",children:Tt(n.key,n.value)})]},n.key)}const _e={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 Lt(n){const e=N.c(39),{selfClient:t,org:s,cdConnectionId:o}=n;let a;e[0]!==o||e[1]!==s.id||e[2]!==s.slug?(a={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=o,e[1]=s.id,e[2]=s.slug,e[3]=a):a=e[3];const l=pe(a);let r;e[4]!==o||e[5]!==s.id?(r=Z.commerceDiscoveryCompanionSchema(s.id,o),e[4]=o,e[5]=s.id,e[6]=r):r=e[6];let c;e[7]!==l?(c=async()=>{const C=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(C)},e[7]=l,e[8]=c):c=e[8];let u;e[9]!==r||e[10]!==c?(u={queryKey:r,queryFn:c},e[9]=r,e[10]=c,e[11]=u):u=e[11];const m=le(u),f=pt(m.data?.stateSchema??{properties:{}}),g=f.map(qt),h=f.map(Kt).filter(Dt),p=f.filter(Mt).map(At),x=[...h,...p].sort().join(",");let j;e[12]!==o||e[13]!==s.id?(j=Z.commerceDiscoveryConnection(s.id,o),e[12]=o,e[13]=s.id,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==t?(b=async()=>{const C=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return ee(C)},e[15]=o,e[16]=t,e[17]=b):b=e[17];let d;e[18]!==j||e[19]!==b?(d={queryKey:j,queryFn:b},e[18]=j,e[19]=b,e[20]=d):d=e[20];const y=le(d),S=y.data?.item?.configuration_state??null;let v;e[21]!==S?(v=C=>S?.[C.fieldKey]?.value,e[21]=S,e[22]=v):v=e[22];const T=f.map(v).filter(Ut),I=le({queryKey:Z.commerceDiscoveryCompanionConnections(s.id),enabled:f.length>0,queryFn:async()=>{const C=[{field:["app_name"],operator:"in",value:g},{field:["app_id"],operator:"in",value:h}];T.length>0&&C.push({field:["id"],operator:"in",value:T});const z=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:C},limit:1e3}});return ee(z)}}),R=I.data?.items??[],H=new Set(T),E=R.filter(C=>H.has(C.id)),$=E.filter($t);let L;e[23]!==s.id||e[24]!==s.slug?(L=C=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(s.id,C.id),queryFn:async()=>{const z=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(C.id)}/oauth-token/status`,{credentials:"include"});return z.ok?{hasToken:(await z.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=L):L=e[25];const U=ct({queries:$.map(L)});let Q;e[26]!==U?(Q=(C,z)=>[C.id,U[z]?.data?.hasToken===!0],e[26]=U,e[27]=Q):Q=e[27];const M=new Map($.map(Q)),G={};for(const C of E)G[C.id]=!C.oauth_config||!!C.connection_token||M.get(C.id)===!0;const F=le({queryKey:Z.commerceDiscoveryCompanionRegistry(s.id,x),enabled:f.length>0,queryFn:async()=>{const C=ht(h,p),z=await lt(Pe.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...C?{where:C}:{},limit:1e3});return ee(z)}}),V={},P={};for(const C of F.data?.items??[])V[C.id]=C,C.server?.name&&(P[C.server.name]=C);const D=_t({requirements:f,itemsById:V,itemsByName:P,connections:R,connectionReadiness:G,configurationState:S,curated:_e});let w;e[28]!==y||e[29]!==I||e[30]!==U||e[31]!==F||e[32]!==f||e[33]!==m.isPending?(w=m.isPending||y.isPending||f.length>0&&(I.isPending||F.isPending||U.some(Pt)),e[28]=y,e[29]=I,e[30]=U,e[31]=F,e[32]=f,e[33]=m.isPending,e[34]=w):w=e[34];const K=w,B=m.error??y.error??I.error??F.error??null;let q;return e[35]!==D||e[36]!==B||e[37]!==K?(q={cards:D,isLoading:K,error:B},e[35]=D,e[36]=B,e[37]=K,e[38]=q):q=e[38],q}function Pt(n){return n.isPending}function $t(n){return n.oauth_config&&!n.connection_token}function Ut(n){return typeof n=="string"&&n.length>0}function At(n){return n.bindingType}function Mt(n){return!_e[n.bindingType]}function Dt(n){return!!n}function Kt(n){return _e[n.bindingType]?.registryAppId}function qt(n){return n.bindingType}function Ft({selfClient:n,org:e,userId:t,cdConnectionId:s}){const o=Re(),[a,l]=A.useState(null),[r,c]=A.useState(null),u=async(f,g)=>{const h=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:f,data:g}});return ee(h)};async function m(f){l(f.fieldKey),c(null);try{let g=f.candidateConnectionId;if(!g){const d=at(f.registryItem,e.id,t,{remoteIndex:0}),y=d.connection_type==="STDIO",S=!!d.connection_url,v=y&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!S&&!v){c(`${f.title} cannot be connected: no connection method available`);return}const T=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:d}});g=ee(T).item.id}const h=g,p=await dt({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:d=>u(h,{connection_token:d}).then(()=>{})});if(!p.ok){c(`Couldn't sign in to ${f.title}: ${p.error}`);return}const x=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),j=ee(x).item?.configuration_state??null,b=xt(j,f.fieldKey,f.bindingType,h);await u(s,{configuration_state:b}),await o.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,s)}),await o.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnections(e.id)})}catch(g){c(g instanceof Error?g.message:String(g))}finally{l(null)}}return{connect:m,connectingFieldKey:a,error:r}}function Bt(n){const e=N.c(23),{org:t,cdConnectionId:s}=n,{data:o}=ve.useSession(),a=o?.user?.id??"";let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:$e,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const r=pe(l);let c;e[3]!==s||e[4]!==t||e[5]!==r?(c={selfClient:r,org:t,cdConnectionId:s},e[3]=s,e[4]=t,e[5]=r,e[6]=c):c=e[6];const{cards:u,isLoading:m,error:f}=Lt(c);let g;e[7]!==s||e[8]!==t||e[9]!==r||e[10]!==a?(g={selfClient:r,org:t,userId:a,cdConnectionId:s},e[7]=s,e[8]=t,e[9]=r,e[10]=a,e[11]=g):g=e[11];const{connect:h,connectingFieldKey:p,error:x}=Ft(g);if(!m&&!f&&u.length===0)return null;const j=p!==null;let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs("div",{className:"grid gap-1.5",children:[i.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),i.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[12]=b):b=e[12];let d;return e[13]!==j||e[14]!==u||e[15]!==h||e[16]!==x||e[17]!==p||e[18]!==f||e[19]!==m||e[20]!==t||e[21]!==r?(d=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:block md:flex-none",children:[b,f?i.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):m?i.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Ht)}):i.jsx(je,{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-[45vh] md:flex-none",children:i.jsxs("div",{className:"grid gap-4",children:[x&&i.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x}),u.map(y=>i.jsx(It,{card:y,connecting:p===y.fieldKey,disabled:j&&p!==y.fieldKey,org:t,selfClient:r,onConnect:()=>{h(y)}},y.fieldKey))]})})]}),e[13]=j,e[14]=u,e[15]=h,e[16]=x,e[17]=p,e[18]=f,e[19]=m,e[20]=t,e[21]=r,e[22]=d):d=e[22],d}function Ht(n){return i.jsx(Nt,{},n)}const Ne="https://decocms-tanstack.deco-cx.workers.dev/agendar",Qt="Rather have us walk you through it?",Wt="Book a 20-minute call and we'll run the diagnostic with you, live.";function Vt({siteUrl:n,email:e}){const t=new URL(Ne);return n&&t.searchParams.set("siteUrl",n),e&&t.searchParams.set("email",e),t.toString()}function Gt(n){const e=N.c(9),{href:t,size:s,className:o}=n,a=t===void 0?Ne:t,l=s===void 0?"lg":s;let r;e[0]!==o?(r=se("w-full",o),e[0]=o,e[1]=r):r=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Me,{size:16}),e[2]=c):c=e[2];let u;e[3]!==a?(u=i.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",c]}),e[3]=a,e[4]=u):u=e[4];let m;return e[5]!==l||e[6]!==r||e[7]!==u?(m=i.jsx(te,{asChild:!0,variant:"outline",size:l,className:r,children:u}),e[5]=l,e[6]=r,e[7]=u,e[8]=m):m=e[8],m}function Oe(n){const e=N.c(2),{children:t}=n;let s;return e[0]!==t?(s=i.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:t}),e[0]=t,e[1]=s):s=e[1],s}function Yt(){const n=N.c(4);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Oe,{children:i.jsx(De,{size:20,className:"text-muted-foreground"})}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:i.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})}),n[1]=t):t=n[1];let s;n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),n[2]=s):s=n[2];let o;return n[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,i.jsxs("div",{className:"relative",children:[s,i.jsxs(Oe,{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),n[3]=o):o=n[3],o}function Zt(n){const e=N.c(4),{href:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Yt,{}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"grid gap-2",children:[i.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Qt}),i.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Wt})]}),e[1]=o):o=e[1];let a;return e[2]!==t?(a=i.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:i.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:[s,o,i.jsx(Gt,{href:t,size:"xl"})]})}),e[2]=t,e[3]=a):a=e[3],a}function Jt(n){const e=N.c(8),{className:t,href:s}=n,o=s===void 0?Ne:s;let a;e[0]!==t?(a=se("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:i.jsx(De,{size:20})}),e[2]=l):l=e[2];let r,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[i.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),i.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),c=i.jsx(Me,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=r,e[4]=c):(r=e[3],c=e[4]);let u;return e[5]!==o||e[6]!==a?(u=i.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:a,children:[l,r,c]}),e[5]=o,e[6]=a,e[7]=u):u=e[7],u}function qe(n){const e=N.c(10),{host:t}=n,s=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=i.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=a,e[2]=l):(o=e[0],a=e[1],l=e[2]);let r;e[3]!==s?(r=i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:i.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=r):r=e[4];let c;e[5]!==t?(c=i.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=c):c=e[6];let u;return e[7]!==r||e[8]!==c?(u=i.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l,r,c]}),e[7]=r,e[8]=c,e[9]=u):u=e[9],u}function Fe(n){const e=N.c(16),{label:t,iconSize:s,className:o,iconClassName:a,labelClassName:l}=n,r=s===void 0?14:s;let c;e[0]!==o?(c=se("inline-flex items-center gap-2",o),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==a?(u=se("shrink-0 animate-spin",a),e[2]=a,e[3]=u):u=e[3];let m;e[4]!==r||e[5]!==u?(m=i.jsx(me,{size:r,className:u}),e[4]=r,e[5]=u,e[6]=m):m=e[6];let f;e[7]!==l?(f=se("text-sm",l),e[7]=l,e[8]=f):f=e[8];let g;e[9]!==t||e[10]!==f?(g=i.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=g):g=e[11];let h;return e[12]!==c||e[13]!==m||e[14]!==g?(h=i.jsxs("span",{className:c,children:[m,g]}),e[12]=c,e[13]=m,e[14]=g,e[15]=h):h=e[15],h}const Xt={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Be(n){return Xt[n]}function Ie(n){const e=N.c(2),{variant:t}=n;let s;return e[0]!==t?(s=i.jsx(J,{children:i.jsx(Ee,{variant:t})}),e[0]=t,e[1]=s):s=e[1],s}function Ee(n){const e=N.c(4),{variant:t}=n;let s;e[0]!==t?(s=Be(t),e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=i.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:i.jsx(Fe,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=o):o=e[3],o}function en(){const n=N.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Fe,{label:Be("button")}),n[0]=e):e=n[0],e}function Cs(){const n=N.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(nn,{}),n[0]=e):e=n[0],e}const He=A.createContext(null),Qe=()=>A.useContext(He);function tn(n){if(!n)return null;const e=be(n);return e.ok?new URL(e.value).hostname:null}function nn(){const n=N.c(9);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},n[0]=e):e=n[0];const t=We(e),{org:s,siteUrl:o}=t;let a;n[1]!==o?(a=tn(o),n[1]=o,n[2]=a):a=n[2];const l=a;let r;n[3]!==s||n[4]!==o?(r=i.jsx(sn,{requestedOrgSlug:s,siteUrl:o}),n[3]=s,n[4]=o,n[5]=r):r=n[5];let c;return n[6]!==l||n[7]!==r?(c=i.jsx(He.Provider,{value:l,children:r}),n[6]=l,n[7]=r,n[8]=c):c=n[8],c}function sn(n){const e=N.c(8),{requestedOrgSlug:t,siteUrl:s}=n,{data:o,isPending:a}=ve.useSession(),l=Qe();if(a){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Ie,{variant:"route"}),e[0]=c):c=e[0],c}if(!o){const c=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==l?(u=l?i.jsx(qe,{host:l}):void 0,e[1]=l,e[2]=u):u=e[2];let m;return e[3]!==u?(m=i.jsx(J,{children:i.jsx(Je,{callbackUrl:c,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:u})}),e[3]=u,e[4]=m):m=e[4],m}let r;return e[5]!==t||e[6]!==s?(r=i.jsx(on,{requestedOrgSlug:t,siteUrl:s}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}function on(n){const e=N.c(40),{requestedOrgSlug:t,siteUrl:s}=n,o=ze(),a=Ve(),[l,r]=A.useState(null),[c,u]=A.useState(null),m=a.data?.map(ln)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:rn,retry:!1,onSuccess:d=>{u(d)}},e[0]=f):f=e[0];const g=Se(f);if(a.isPending){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ie,{variant:"route"}),e[1]=d):d=e[1],d}if(a.error){let d;return e[2]!==a?(d=i.jsx(ue,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=d):d=e[3],d}const h=t?m.find(d=>d.slug===t):null;if(h){let d;return e[4]!==h||e[5]!==s?(d=i.jsx(de,{org:h,initialSiteUrl:s}),e[4]=h,e[5]=s,e[6]=d):d=e[6],d}if(t){let d;return e[7]!==a?(d=i.jsx(ue,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=d):d=e[8],d}if(l){let d;return e[9]!==l||e[10]!==s?(d=i.jsx(de,{org:l,initialSiteUrl:s}),e[9]=l,e[10]=s,e[11]=d):d=e[11],d}if(m.length===1&&m[0]){let d;return e[12]!==m[0]||e[13]!==s?(d=i.jsx(de,{org:m[0],initialSiteUrl:s}),e[12]=m[0],e[13]=s,e[14]=d):d=e[14],d}if(m.length>1){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ne,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=d):d=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=v=>r(v),e[16]=y):y=e[16];let S;return e[17]!==m?(S=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[d,i.jsx(je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(ke,{organizations:m,selectLabel:"Continue",onSelected:y})})]})}),e[17]=m,e[18]=S):S=e[18],S}if(!c){let d;e[19]!==g?(d=()=>{g.reset(),g.mutate()},e[19]=g,e[20]=d):d=e[20];let y;return e[21]!==g||e[22]!==d?(y=i.jsx(an,{mutation:g,onRetry:d}),e[21]=g,e[22]=d,e[23]=y):y=e[23],y}const p=c;if(p?.success&&(p.status==="created"||p.status==="joined"||p.status==="already_has_organization")&&p.organization){let d;return e[24]!==p.organization||e[25]!==s?(d=i.jsx(de,{org:p.organization,initialSiteUrl:s}),e[24]=p.organization,e[25]=s,e[26]=d):d=e[26],d}if(p?.status==="ambiguous"&&p.organizations&&p.organizations.length>0){let d;e[27]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ne,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=d):d=e[27];const y=p.domain??void 0;let S;e[28]!==o||e[29]!==s?(S=(T,I)=>{Le(),r({...T,slug:I}),o({to:"/commerce-onboarding",search:{org:I,siteUrl:s}})},e[28]=o,e[29]=s,e[30]=S):S=e[30];let v;return e[31]!==p.organizations||e[32]!==y||e[33]!==S?(v=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[d,i.jsx(je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(ke,{organizations:p.organizations,domain:y,onJoined:S})})]})}),e[31]=p.organizations,e[32]=y,e[33]=S,e[34]=v):v=e[34],v}const x=p?.error??"We could not determine a commerce organization for this account.";let j;e[35]!==g?(j=()=>{u(null),g.reset()},e[35]=g,e[36]=j):j=e[36];let b;return e[37]!==x||e[38]!==j?(b=i.jsx(ue,{title:"Commerce onboarding needs support",description:x,actionLabel:"Try again",onRetry:j}),e[37]=x,e[38]=j,e[39]=b):b=e[39],b}async function rn(){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&&Le(),e}function ln(n){return{id:n.id,name:n.name,slug:n.slug,logo:n.logo??null}}function an(n){const e=N.c(7),{mutation:t,onRetry:s}=n,o=A.useRef(!1);let a;e[0]!==t?(a=u=>{!u||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=a):a=e[1];const l=a;if(t.error){let u;return e[2]!==s?(u=i.jsx(ue,{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:s}),e[2]=s,e[3]=u):u=e[3],u}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Ee,{variant:"workspace"}),e[4]=r):r=e[4];let c;return e[5]!==l?(c=i.jsx(J,{children:i.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=c):c=e[6],c}function ne(n){const e=N.c(8),{title:t,description:s}=n,o=Qe();let a;e[0]!==o?(a=o?i.jsx(qe,{host:o}):i.jsxs("div",{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=a):a=e[1];let l;e[2]!==s||e[3]!==t?(l=(t||s)&&i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),s&&i.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=i.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function ue(n){const e=N.c(9),{title:t,description:s,actionLabel:o,onRetry:a}=n;let l;e[0]!==s||e[1]!==t?(l=i.jsx(ne,{title:t,description:s}),e[0]=s,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==a?(r=i.jsx(te,{type:"button",size:"xl",className:"w-full",onClick:a,children:o}),e[3]=o,e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==l||e[7]!==r?(c=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function cn(n){return n.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function xe(n){const e=n;if(e.isError)throw new Error(cn(e));return e.structuredContent??n}function de(n){const e=N.c(3),{org:t,initialSiteUrl:s}=n;let o;return e[0]!==s||e[1]!==t?(o=i.jsx(Ge,{children:a=>{const{reset:l}=a;return i.jsx(Ye,{fallback:r=>{const{error:c,resetError:u}=r;return i.jsx(J,{children:i.jsx(dn,{orgName:t.name,message:c instanceof Error?c.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),u()}})})},children:i.jsx(A.Suspense,{fallback:i.jsx(Ie,{variant:"connect"}),children:i.jsx(un,{org:t,initialSiteUrl:s},`${t.id}:${s??""}`)})})}}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function dn(n){const e=N.c(10),{orgName:t,message:s,onRetry:o}=n,a=`Commerce setup will continue for ${t}.`;let l;e[0]!==a?(l=i.jsx(ne,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==s?(r=i.jsx(ge,{message:s}),e[2]=s,e[3]=r):r=e[3];let c;e[4]!==o?(c=i.jsx(te,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=c):c=e[5];let u;return e[6]!==l||e[7]!==r||e[8]!==c?(u=i.jsxs("div",{className:"grid gap-10",children:[l,r,c]}),e[6]=l,e[7]=r,e[8]=c,e[9]=u):u=e[9],u}function un(n){const e=N.c(84),{org:t,initialSiteUrl:s}=n,o=ze();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:$e,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const l=pe(a),[r,c]=A.useState(s??""),[u,m]=A.useState(null),[f,g]=A.useState(null),h=A.useRef(!1),p=Pe.COMMERCE_DISCOVERY(t.id),x=tt(t.id),j=Z.commerceDiscoveryConnection(t.id,p);let b;e[3]!==p||e[4]!==l?(b=async()=>{const _=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(_)},e[3]=p,e[4]=l,e[5]=b):b=e[5];let d;e[6]!==j||e[7]!==b?(d={queryKey:j,queryFn:b,retry:!1},e[6]=j,e[7]=b,e[8]=d):d=e[8];const y=we(d),S=Z.commerceDiscoveryVirtualMcp(t.id,x);let v;e[9]!==l||e[10]!==x?(v=async()=>{const _=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return xe(_)},e[9]=l,e[10]=x,e[11]=v):v=e[11];let T;e[12]!==S||e[13]!==v?(T={queryKey:S,queryFn:v,retry:!1},e[12]=S,e[13]=v,e[14]=T):T=e[14];const I=we(T);let R;e[15]!==l?(R=async _=>{const O=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:_}});return xe(O)},e[15]=l,e[16]=R):R=e[16];let H;e[17]!==y||e[18]!==I?(H=_=>{m(_),g(null),y.refetch(),I.refetch()},e[17]=y,e[18]=I,e[19]=H):H=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=_=>{g(_ instanceof Error?_.message:"Commerce Discovery setup failed.")},e[20]=E):E=e[20];let $;e[21]!==R||e[22]!==H?($={mutationFn:R,retry:!1,onSuccess:H,onError:E},e[21]=R,e[22]=H,e[23]=$):$=e[23];const L=Se($),U=!!y.data.item&&!!I.data.item;let Q;e[24]!==L?(Q=_=>{const O=be(_);if(!O.ok){g(O.error);return}g(null),L.mutate(O.value)},e[24]=L,e[25]=Q):Q=e[25];const M=Q;let G;e[26]!==s||e[27]!==M||e[28]!==U?(G=_=>{!_||h.current||U||!s||(h.current=!0,M(s))},e[26]=s,e[27]=M,e[28]=U,e[29]=G):G=e[29];const F=G;let V;e[30]!==M||e[31]!==r?(V=_=>{_.preventDefault(),M(r)},e[30]=M,e[31]=r,e[32]=V):V=e[32];const P=V;let D;e[33]!==p||e[34]!==u?.reportApp||e[35]!==x?(D=u?.reportApp??{connectionId:p,virtualMcpId:x,toolName:nt},e[33]=p,e[34]=u?.reportApp,e[35]=x,e[36]=D):D=e[36];const w=D;let K;e[37]!==o||e[38]!==t.slug||e[39]!==w.connectionId||e[40]!==w.toolName||e[41]!==w.virtualMcpId?(K=()=>{localStorage.setItem(Ze.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:w.virtualMcpId,main:Xe(w.connectionId,w.toolName),chat:0}})},e[37]=o,e[38]=t.slug,e[39]=w.connectionId,e[40]=w.toolName,e[41]=w.virtualMcpId,e[42]=K):K=e[42];const B=K;if(U){const _=s??r;let O;return e[43]!==B||e[44]!==t||e[45]!==w||e[46]!==_?(O=i.jsx(mn,{org:t,reportApp:w,onOpenReport:B,siteUrl:_}),e[43]=B,e[44]=t,e[45]=w,e[46]=_,e[47]=O):O=e[47],O}if(s){let _;e[48]!==s?(_=be(s),e[48]=s,e[49]=_):_=e[49];const O=_;if(!O.ok){const he=`Commerce setup will continue for ${t.name}.`;let ie;e[50]!==he?(ie=i.jsx(ne,{title:"Commerce diagnostics",description:he}),e[50]=he,e[51]=ie):ie=e[51];let oe;e[52]!==O.error?(oe=i.jsx(ge,{message:O.error}),e[52]=O.error,e[53]=oe):oe=e[53];let re;e[54]!==P||e[55]!==f||e[56]!==L.isPending||e[57]!==r?(re=i.jsx(ye,{siteUrl:r,error:f,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P}),e[54]=P,e[55]=f,e[56]=L.isPending,e[57]=r,e[58]=re):re=e[58];let ce;return e[59]!==ie||e[60]!==oe||e[61]!==re?(ce=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[ie,oe,re]})}),e[59]=ie,e[60]=oe,e[61]=re,e[62]=ce):ce=e[62],ce}const X=`Commerce Discovery is being prepared for ${O.value}.`;let W;e[63]!==X?(W=i.jsx(ne,{title:"Commerce diagnostics",description:X}),e[63]=X,e[64]=W):W=e[64];let Y;e[65]!==P||e[66]!==f||e[67]!==L||e[68]!==r?(Y=f?i.jsxs(i.Fragment,{children:[i.jsx(ge,{message:f}),i.jsx(ye,{siteUrl:r,error:null,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P})]}):i.jsx(Ee,{variant:"setup"}),e[65]=P,e[66]=f,e[67]=L,e[68]=r,e[69]=Y):Y=e[69];let ae;return e[70]!==W||e[71]!==Y||e[72]!==F?(ae=i.jsx(J,{children:i.jsxs("div",{ref:F,className:"grid gap-10",children:[W,Y]})}),e[70]=W,e[71]=Y,e[72]=F,e[73]=ae):ae=e[73],ae}const q=`Commerce setup will continue for ${t.name}.`;let C;e[74]!==q?(C=i.jsx(ne,{title:"Commerce diagnostics",description:q}),e[74]=q,e[75]=C):C=e[75];let z;e[76]!==P||e[77]!==f||e[78]!==L.isPending||e[79]!==r?(z=i.jsx(ye,{siteUrl:r,error:f,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P}),e[76]=P,e[77]=f,e[78]=L.isPending,e[79]=r,e[80]=z):z=e[80];let k;return e[81]!==C||e[82]!==z?(k=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[C,z]})}),e[81]=C,e[82]=z,e[83]=k):k=e[83],k}function ye(n){const e=N.c(22),{siteUrl:t,error:s,isSubmitting:o,onSiteUrlChange:a,onSubmit:l}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let c;e[1]!==a?(c=j=>a(j.target.value),e[1]=a,e[2]=c):c=e[2];const u=!!s;let m;e[3]!==o||e[4]!==t||e[5]!==c||e[6]!==u?(m=i.jsx(et,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:c,placeholder:"https://example.com","aria-invalid":u,disabled:o}),e[3]=o,e[4]=t,e[5]=c,e[6]=u,e[7]=m):m=e[7];let f;e[8]!==s?(f=s?i.jsx(ge,{message:s}):null,e[8]=s,e[9]=f):f=e[9];let g;e[10]!==m||e[11]!==f?(g=i.jsxs("div",{className:"grid gap-2",children:[r,m,f]}),e[10]=m,e[11]=f,e[12]=g):g=e[12];let h;e[13]!==o?(h=o?i.jsx(en,{}):i.jsxs(i.Fragment,{children:["Continue",i.jsx(Ue,{size:16})]}),e[13]=o,e[14]=h):h=e[14];let p;e[15]!==o||e[16]!==h?(p=i.jsx(te,{type:"submit",size:"xl",className:"w-full",disabled:o,children:h}),e[15]=o,e[16]=h,e[17]=p):p=e[17];let x;return e[18]!==l||e[19]!==g||e[20]!==p?(x=i.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[g,p]}),e[18]=l,e[19]=g,e[20]=p,e[21]=x):x=e[21],x}function mn(n){const e=N.c(24),{org:t,reportApp:s,onOpenReport:o,siteUrl:a}=n,{data:l}=ve.useSession(),r=l?.user?.email;let c;e[0]!==a||e[1]!==r?(c=Vt({siteUrl:a,email:r}),e[0]=a,e[1]=r,e[2]=c):c=e[2];const u=c;let m;e[3]!==u?(m=i.jsx(Zt,{href:u}),e[3]=u,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ne,{}),e[5]=f):f=e[5];let g;e[6]!==t||e[7]!==s.connectionId?(g=i.jsx(Bt,{org:t,cdConnectionId:s.connectionId}),e[6]=t,e[7]=s.connectionId,e[8]=g):g=e[8];let h;e[9]!==u?(h=i.jsx(Jt,{className:"md:hidden",href:u}),e[9]=u,e[10]=h):h=e[10];const p=!s.virtualMcpId;let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(Ue,{size:18}),e[11]=x):x=e[11];let j;e[12]!==o||e[13]!==p?(j=i.jsxs(te,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",x]}),e[12]=o,e[13]=p,e[14]=j):j=e[14];let b;e[15]!==h||e[16]!==j?(b=i.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[h,j]}),e[15]=h,e[16]=j,e[17]=b):b=e[17];let d;e[18]!==b||e[19]!==g?(d=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:block",children:[f,g,b]}),e[18]=b,e[19]=g,e[20]=d):d=e[20];let y;return e[21]!==d||e[22]!==m?(y=i.jsx(J,{align:"fill",visual:m,children:d}),e[21]=d,e[22]=m,e[23]=y):y=e[23],y}function ge(n){const e=N.c(2),{message:t}=n;let s;return e[0]!==t?(s=i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=s):s=e[1],s}export{Cs as default};
1
+ import{c as N,r as A,l as se,j as i,B as te,i as me,m as Re,K as Z,k as le,d as Se,a as ve,u as We,b as ze,n as Ve,o as Le,Q as Ge,E as Ye,p as we,L as Ze}from"./index-CurNB2HG.js";import{A as Je}from"./auth-entry-BNYZmdvo.js";import{A as J}from"./auth-split-layout-DuCP9Fwl.js";import{O as ke}from"./organization-choice-BcGxKG4I.js";import{f as Xe}from"./tab-id-BptcWVWa.js";import{I as et}from"./input-RRjvrcUF.js";import{u as pe,W as Pe,S as $e,g as tt,C as nt}from"./use-mcp-client-BbOUwA1H.js";import{i as Ue}from"./XCircle-DFBcUexW.js";import{I as st}from"./integration-icon-Dpj2NSXY.js";import{v as Te,F as it}from"./Form-GDlYmtQN.js";import"./index-C_XJPG8Z.js";import{i as Ae}from"./CheckCircle-BP2lb3AX.js";import{i as ot}from"./ZoomOut-ryBmf3S4.js";import{g as rt,c as lt,e as at}from"./extract-connection-data-Bau_aQvM.js";import{u as ct}from"./useQueries-BqFctUi9.js";import{a as dt}from"./authenticate-and-persist-oauth-DPn6Vk96.js";import{i as Me}from"./ArrowUpRight-CwVMUp5O.js";import{s as De}from"./User01-Cvp121NC.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-Bh53txVX.js";import"./auth-xlfJjVrK.js";import"./agent-icon-pz8iT5cD.js";import"./AlertCircle-BMCh3ayd.js";import"./Tool01-WsqNh4er.js";import"./SwitchHorizontal01-DXdcIz27.js";import"./Settings02-ozrzAwut.js";import"./ZapSquare-DOK7F1oe.js";import"./Users03-CJuVy8Iz.js";import"./ChevronUp-CiXD4kQk.js";import"./ChevronDown-CkcGr2qp.js";import"./ChevronLeft-Cgw9JZYG.js";import"./ChevronRight-DYe9AFXl.js";import"./DotsVertical-Z_h1bSB3.js";import"./Stars02-C4CXFnp9.js";import"./Eye-B92Ff4dY.js";import"./Globe01-MZlo2_34.js";import"./FilterLines-CMHeCbJ1.js";import"./Star01-BoZIiKCL.js";import"./Globe04-BPWbnzx0.js";import"./HardDrive-D8FSpDtM.js";import"./Key01-CZVV-ceU.js";import"./LayoutLeft-CuTI_WR9.js";import"./LinkExternal01-DekFjc9P.js";import"./Monitor01-BxGhRsUq.js";import"./Sun-2eUdoD8j.js";import"./Palette-BDlA8RUr.js";import"./Play-BGGUeSDd.js";import"./Plus-CQOl41pg.js";import"./SearchMd-Da504yGV.js";import"./Shield01-CYPtC_lA.js";import"./Stars01-BJuGXG_N.js";import"./Trash01-z6De146C.js";import"./Upload01-C4sYhZ0M.js";import"./Users01-DcrlsWI1.js";import"./XClose-BKWXOZkj.js";import"./X-DgKWdqZ1.js";import"./Zap-Cxu6aoRs.js";import"./index-ovnDLwrg.js";import"./index-BdQq_4o_.js";import"./index-BDyN-RAN.js";import"./mcp-oauth-B5dnAc7V.js";const ut=/^[a-zA-Z][a-zA-Z\d+.-]*:/,mt=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,ft=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,gt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function be(n){const e=n.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=ut.test(e),s=mt.test(e),o=ft.test(e);if(t&&!s&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=s?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(c=>!c||!gt.test(c))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function je(n){const e=N.c(14),{children:t,className:s,wrapperClassName:o}=n,[a,l]=A.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const j=()=>{const d=x.scrollHeight-x.scrollTop-x.clientHeight<8;l(d)};j(),x.addEventListener("scroll",j,{passive:!0});const b=new ResizeObserver(j);b.observe(x);for(const d of Array.from(x.children))b.observe(d);return()=>{x.removeEventListener("scroll",j),b.disconnect()}},e[0]=r):r=e[0];const c=r;let u;e[1]!==o?(u=se("relative",o),e[1]=o,e[2]=u):u=e[2];let m;e[3]!==t||e[4]!==s?(m=i.jsx("div",{ref:c,className:s,children:t}),e[3]=t,e[4]=s,e[5]=m):m=e[5];const f=a?"opacity-0":"opacity-100";let g;e[6]!==f?(g=se("pointer-events-none absolute inset-x-0 -bottom-px h-[72px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[1px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",f),e[6]=f,e[7]=g):g=e[7];let h;e[8]!==g?(h=i.jsx("div",{"aria-hidden":!0,className:g}),e[8]=g,e[9]=h):h=e[9];let p;return e[10]!==u||e[11]!==m||e[12]!==h?(p=i.jsxs("div",{className:u,children:[m,h]}),e[10]=u,e[11]=m,e[12]=h,e[13]=p):p=e[13],p}function pt(n){const e=n.properties;if(!e)return[];const t=[];for(const[s,o]of Object.entries(e)){const r=o?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:s,bindingType:r})}return t}function ht(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function ee(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function xt(n,e,t,s){return{...n??{},[e]:{__type:t,value:s}}}function fe(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(fe):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&fe(t)):!1}function Ke(n){return fe(n)}function yt(n){return n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function bt(n){return fe(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function jt(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const s=bt(t);return s?[{key:e,label:yt(e),value:s}]:[]}):[]}function Ct(n,e,t){const s=n.filter(o=>o.app_name===e||!!t&&o.app_id===t);return s.length===0?null:(s.sort((o,a)=>{const l=r=>r.status==="active"?0:1;return l(o)!==l(a)?l(o)-l(a):(a.updated_at??"").localeCompare(o.updated_at??"")}),s[0].id)}function St(n){return n.server?.icons?.[0]?.src??rt(n.server?.repository)??null}function vt(n,e){const t=n._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function _t(n){const e=[],t=new Map(n.connections.map(s=>[s.id,s]));for(const s of n.requirements){const o=n.curated[s.bindingType],a=o?n.itemsById[o.registryAppId]:n.itemsByName[s.bindingType];if(!a)continue;const l=n.configurationState?.[s.fieldKey]?.value,r=l?t.get(l):void 0,c=l&&r?l:null,u=c?n.connectionReadiness?.[c]!==!1:!1,m=!!c&&u;e.push({fieldKey:s.fieldKey,bindingType:s.bindingType,registryItem:a,title:vt(a,s.bindingType),icon:St(a),headline:o?.headline??a._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:m,candidateConnectionId:m?null:c||Ct(n.connections,s.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:r?.configuration_state??null})}return e}function Nt(){const n=N.c(3);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),i.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),i.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),n[1]=t):t=n[1];let s;return n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),n[2]=s):s=n[2],s}function Ce(n){const e=N.c(3),{children:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Ae,{size:14,className:"shrink-0 text-blue-500"}),e[0]=s):s=e[0];let o;return e[1]!==t?(o=i.jsxs("div",{className:"flex items-center gap-2 p-1",children:[s,i.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=o):o=e[2],o}function It(n){const e=N.c(46),{card:t,connecting:s,disabled:o,onConnect:a,org:l,selfClient:r}=n,c=t.linkedConnectionId;let u;e[0]!==t.configurationState?(u=jt(t.configurationState),e[0]=t.configurationState,e[1]=u):u=e[1];const m=u;let f;e[2]!==t.configurationState||e[3]!==t.satisfied?(f=t.satisfied&&!Ke(t.configurationState),e[2]=t.configurationState,e[3]=t.satisfied,e[4]=f):f=e[4];const[g,h]=A.useState(f);let p;e[5]!==t.icon||e[6]!==t.title?(p=i.jsx(st,{icon:t.icon,name:t.title,size:"sm",fit:"contain",className:"p-1.5"}),e[5]=t.icon,e[6]=t.title,e[7]=p):p=e[7];let x;e[8]!==t.title?(x=i.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[8]=t.title,e[9]=x):x=e[9];let j;e[10]!==t.satisfied||e[11]!==t.title||e[12]!==s||e[13]!==o||e[14]!==a?(j=t.satisfied?i.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[i.jsx(Ae,{size:16})," Connected"]}):i.jsx(te,{type:"button",variant:"outline",size:"sm",disabled:o||s,onClick:a,"aria-label":`Connect ${t.title}`,children:s?i.jsx(me,{size:16,className:"animate-spin"}):"Connect"}),e[10]=t.satisfied,e[11]=t.title,e[12]=s,e[13]=o,e[14]=a,e[15]=j):j=e[15];let b;e[16]!==p||e[17]!==x||e[18]!==j?(b=i.jsxs("div",{className:"flex items-center gap-2",children:[p,x,j]}),e[16]=p,e[17]=x,e[18]=j,e[19]=b):b=e[19];let d;e[20]!==t.checks?(d=t.checks!==null&&i.jsxs(Ce,{children:["+ ",t.checks," checks"]}),e[20]=t.checks,e[21]=d):d=e[21];let y;e[22]!==t.headline?(y=t.headline&&i.jsx(Ce,{children:t.headline}),e[22]=t.headline,e[23]=y):y=e[23];let S;e[24]!==t.bullets?(S=t.bullets.map(Et),e[24]=t.bullets,e[25]=S):S=e[25];let v;e[26]!==t.candidateConnectionId||e[27]!==t.satisfied||e[28]!==t.title?(v=!t.satisfied&&t.candidateConnectionId&&i.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[26]=t.candidateConnectionId,e[27]=t.satisfied,e[28]=t.title,e[29]=v):v=e[29];let T;e[30]!==v||e[31]!==d||e[32]!==y||e[33]!==S?(T=i.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[d,y,S,v]}),e[30]=v,e[31]=d,e[32]=y,e[33]=S,e[34]=T):T=e[34];let I;e[35]!==t||e[36]!==g||e[37]!==c||e[38]!==l||e[39]!==m||e[40]!==r?(I=t.satisfied&&c&&i.jsx(Rt,{card:t,org:l,selfClient:r,connectionId:c,savedConfigEntries:m,isEditing:g,onEdit:()=>h(!0),onCancel:()=>h(!1),onSaved:()=>h(!1)}),e[35]=t,e[36]=g,e[37]=c,e[38]=l,e[39]=m,e[40]=r,e[41]=I):I=e[41];let R;return e[42]!==T||e[43]!==I||e[44]!==b?(R=i.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[b,T,I]}),e[42]=T,e[43]=I,e[44]=b,e[45]=R):R=e[45],R}function Et(n){return i.jsx(Ce,{children:n},n)}function wt(n){const e=n?.properties;return!!e&&typeof e=="object"&&Object.keys(e).length>0}function kt(n){return/(token|secret|password|appKey|key)$/i.test(n)}function Tt(n,e){return kt(n)?"••••••••":e}function Ot(n){const e=N.c(9),{id:t,label:s,description:o,children:a}=n;if(t.includes("__type")||t.includes("__binding"))return null;let l;e[0]!==t||e[1]!==s?(l=s&&i.jsx("label",{className:"text-sm font-medium text-foreground",htmlFor:t,children:s}),e[0]=t,e[1]=s,e[2]=l):l=e[2];let r;e[3]!==o?(r=o&&i.jsx("div",{className:"text-xs leading-4 text-muted-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let c;return e[5]!==a||e[6]!==l||e[7]!==r?(c=i.jsxs("div",{className:"grid gap-1.5",children:[l,a,r]}),e[5]=a,e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function Rt(n){const e=N.c(71),{card:t,org:s,selfClient:o,connectionId:a,savedConfigEntries:l,isEditing:r,onEdit:c,onCancel:u,onSaved:m}=n,f=Re();let g;e[0]!==a||e[1]!==s.id||e[2]!==s.slug?(g={connectionId:a,orgId:s.id,orgSlug:s.slug},e[0]=a,e[1]=s.id,e[2]=s.slug,e[3]=g):g=e[3];const h=pe(g);let p;e[4]!==t.configurationState?(p=t.configurationState??{},e[4]=t.configurationState,e[5]=p):p=e[5];const[x,j]=A.useState(p),[b,d]=A.useState(null);let y;e[6]!==a||e[7]!==s.id?(y=Z.commerceDiscoveryCompanionConnectionSchema(s.id,a),e[6]=a,e[7]=s.id,e[8]=y):y=e[8];let S;e[9]!==h?(S=async()=>{const k=await h.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(k)},e[9]=h,e[10]=S):S=e[10];let v;e[11]!==y||e[12]!==S?(v={queryKey:y,queryFn:S,retry:!1},e[11]=y,e[12]=S,e[13]=v):v=e[13];const T=le(v);let I;e[14]!==a||e[15]!==o?(I=async k=>{const _=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:a,data:{configuration_state:k}}});return ee(_)},e[14]=a,e[15]=o,e[16]=I):I=e[16];let R;e[17]!==m||e[18]!==s.id||e[19]!==f?(R=async()=>{d(null),await f.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnections(s.id)}),m()},e[17]=m,e[18]=s.id,e[19]=f,e[20]=R):R=e[20];let H;e[21]!==I||e[22]!==R?(H={mutationFn:I,onSuccess:R},e[21]=I,e[22]=R,e[23]=H):H=e[23];const E=Se(H),$=T.data?.stateSchema,L=wt($)&&(r||l.length>0);if(T.isPending){let k;return e[24]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs("div",{className:"flex items-center gap-2 border-t border-border pt-3 text-sm text-muted-foreground",children:[i.jsx(me,{size:14,className:"animate-spin"}),"Loading configuration..."]}),e[24]=k):k=e[24],k}if(T.error||!L||!$)return null;if(!r&&l.length>0){let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[25]=k):k=e[25];let _;e[26]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(ot,{size:14}),e[26]=_):_=e[26];let O;e[27]!==c?(O=i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[k,i.jsxs(te,{type:"button",variant:"ghost",size:"sm",onClick:c,children:[_,"Edit"]})]}),e[27]=c,e[28]=O):O=e[28];let X;e[29]!==l?(X=l.map(zt),e[29]=l,e[30]=X):X=e[30];let W;e[31]!==X?(W=i.jsx("dl",{className:"grid gap-2",children:X}),e[31]=X,e[32]=W):W=e[32];let Y;return e[33]!==O||e[34]!==W?(Y=i.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[O,W]}),e[33]=O,e[34]=W,e[35]=Y):Y=e[35],Y}let U;e[36]!==x||e[37]!==E||e[38]!==$?(U=()=>{if(!Ke(x)){d("Enter at least one configuration value.");return}const k=Te.validateFormData(x,$);if(k.errors.length>0){d(k.errors[0]?.stack??"Invalid configuration.");return}d(null),E.mutate(x)},e[36]=x,e[37]=E,e[38]=$,e[39]=U):U=e[39];const Q=U;let M;e[40]!==t.title?(M=i.jsxs("p",{className:"text-sm font-medium text-foreground",children:["Configure ",t.title]}),e[40]=t.title,e[41]=M):M=e[41];const G=`${a}:configuration`;let F;e[42]===Symbol.for("react.memo_cache_sentinel")?(F=k=>j(k.formData??{}),e[42]=F):F=e[42];let V,P;e[43]===Symbol.for("react.memo_cache_sentinel")?(V={FieldTemplate:Ot},P=i.jsx(i.Fragment,{}),e[43]=V,e[44]=P):(V=e[43],P=e[44]);let D;e[45]!==x||e[46]!==$||e[47]!==G?(D=i.jsx(it,{schema:$,validator:Te,formData:x,onChange:F,liveValidate:!1,showErrorList:!1,templates:V,children:P},G),e[45]=x,e[46]=$,e[47]=G,e[48]=D):D=e[48];let w;e[49]!==E.error||e[50]!==b?(w=(b||E.error)&&i.jsx("p",{role:"alert",className:"text-sm text-destructive",children:b??(E.error instanceof Error?E.error.message:"Could not save configuration.")}),e[49]=E.error,e[50]=b,e[51]=w):w=e[51];let K;e[52]!==t.configurationState||e[53]!==u||e[54]!==E.isPending||e[55]!==l.length?(K=l.length>0&&i.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>{j(t.configurationState??{}),d(null),u()},disabled:E.isPending,children:"Cancel"}),e[52]=t.configurationState,e[53]=u,e[54]=E.isPending,e[55]=l.length,e[56]=K):K=e[56];let B;e[57]!==E.isPending?(B=E.isPending?i.jsxs(i.Fragment,{children:[i.jsx(me,{size:14,className:"animate-spin"}),"Saving"]}):"Save",e[57]=E.isPending,e[58]=B):B=e[58];let q;e[59]!==Q||e[60]!==E.isPending||e[61]!==B?(q=i.jsx(te,{type:"button",size:"sm",onClick:Q,disabled:E.isPending,children:B}),e[59]=Q,e[60]=E.isPending,e[61]=B,e[62]=q):q=e[62];let C;e[63]!==K||e[64]!==q?(C=i.jsxs("div",{className:"flex justify-end gap-2",children:[K,q]}),e[63]=K,e[64]=q,e[65]=C):C=e[65];let z;return e[66]!==M||e[67]!==D||e[68]!==w||e[69]!==C?(z=i.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[M,D,w,C]}),e[66]=M,e[67]=D,e[68]=w,e[69]=C,e[70]=z):z=e[70],z}function zt(n){return i.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[i.jsx("dt",{className:"text-muted-foreground",children:n.label}),i.jsx("dd",{className:"truncate text-foreground",children:Tt(n.key,n.value)})]},n.key)}const _e={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 Lt(n){const e=N.c(39),{selfClient:t,org:s,cdConnectionId:o}=n;let a;e[0]!==o||e[1]!==s.id||e[2]!==s.slug?(a={connectionId:o,orgId:s.id,orgSlug:s.slug},e[0]=o,e[1]=s.id,e[2]=s.slug,e[3]=a):a=e[3];const l=pe(a);let r;e[4]!==o||e[5]!==s.id?(r=Z.commerceDiscoveryCompanionSchema(s.id,o),e[4]=o,e[5]=s.id,e[6]=r):r=e[6];let c;e[7]!==l?(c=async()=>{const C=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return ee(C)},e[7]=l,e[8]=c):c=e[8];let u;e[9]!==r||e[10]!==c?(u={queryKey:r,queryFn:c},e[9]=r,e[10]=c,e[11]=u):u=e[11];const m=le(u),f=pt(m.data?.stateSchema??{properties:{}}),g=f.map(qt),h=f.map(Kt).filter(Dt),p=f.filter(Mt).map(At),x=[...h,...p].sort().join(",");let j;e[12]!==o||e[13]!==s.id?(j=Z.commerceDiscoveryConnection(s.id,o),e[12]=o,e[13]=s.id,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==t?(b=async()=>{const C=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return ee(C)},e[15]=o,e[16]=t,e[17]=b):b=e[17];let d;e[18]!==j||e[19]!==b?(d={queryKey:j,queryFn:b},e[18]=j,e[19]=b,e[20]=d):d=e[20];const y=le(d),S=y.data?.item?.configuration_state??null;let v;e[21]!==S?(v=C=>S?.[C.fieldKey]?.value,e[21]=S,e[22]=v):v=e[22];const T=f.map(v).filter(Ut),I=le({queryKey:Z.commerceDiscoveryCompanionConnections(s.id),enabled:f.length>0,queryFn:async()=>{const C=[{field:["app_name"],operator:"in",value:g},{field:["app_id"],operator:"in",value:h}];T.length>0&&C.push({field:["id"],operator:"in",value:T});const z=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:C},limit:1e3}});return ee(z)}}),R=I.data?.items??[],H=new Set(T),E=R.filter(C=>H.has(C.id)),$=E.filter($t);let L;e[23]!==s.id||e[24]!==s.slug?(L=C=>({queryKey:Z.commerceDiscoveryCompanionOAuthStatus(s.id,C.id),queryFn:async()=>{const z=await fetch(`/api/${encodeURIComponent(s.slug)}/connections/${encodeURIComponent(C.id)}/oauth-token/status`,{credentials:"include"});return z.ok?{hasToken:(await z.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=s.id,e[24]=s.slug,e[25]=L):L=e[25];const U=ct({queries:$.map(L)});let Q;e[26]!==U?(Q=(C,z)=>[C.id,U[z]?.data?.hasToken===!0],e[26]=U,e[27]=Q):Q=e[27];const M=new Map($.map(Q)),G={};for(const C of E)G[C.id]=!C.oauth_config||!!C.connection_token||M.get(C.id)===!0;const F=le({queryKey:Z.commerceDiscoveryCompanionRegistry(s.id,x),enabled:f.length>0,queryFn:async()=>{const C=ht(h,p),z=await lt(Pe.REGISTRY(s.id),s.id,s.slug,"COLLECTION_REGISTRY_APP_LIST",{...C?{where:C}:{},limit:1e3});return ee(z)}}),V={},P={};for(const C of F.data?.items??[])V[C.id]=C,C.server?.name&&(P[C.server.name]=C);const D=_t({requirements:f,itemsById:V,itemsByName:P,connections:R,connectionReadiness:G,configurationState:S,curated:_e});let w;e[28]!==y||e[29]!==I||e[30]!==U||e[31]!==F||e[32]!==f||e[33]!==m.isPending?(w=m.isPending||y.isPending||f.length>0&&(I.isPending||F.isPending||U.some(Pt)),e[28]=y,e[29]=I,e[30]=U,e[31]=F,e[32]=f,e[33]=m.isPending,e[34]=w):w=e[34];const K=w,B=m.error??y.error??I.error??F.error??null;let q;return e[35]!==D||e[36]!==B||e[37]!==K?(q={cards:D,isLoading:K,error:B},e[35]=D,e[36]=B,e[37]=K,e[38]=q):q=e[38],q}function Pt(n){return n.isPending}function $t(n){return n.oauth_config&&!n.connection_token}function Ut(n){return typeof n=="string"&&n.length>0}function At(n){return n.bindingType}function Mt(n){return!_e[n.bindingType]}function Dt(n){return!!n}function Kt(n){return _e[n.bindingType]?.registryAppId}function qt(n){return n.bindingType}function Ft({selfClient:n,org:e,userId:t,cdConnectionId:s}){const o=Re(),[a,l]=A.useState(null),[r,c]=A.useState(null),u=async(f,g)=>{const h=await n.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:f,data:g}});return ee(h)};async function m(f){l(f.fieldKey),c(null);try{let g=f.candidateConnectionId;if(!g){const d=at(f.registryItem,e.id,t,{remoteIndex:0}),y=d.connection_type==="STDIO",S=!!d.connection_url,v=y&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!S&&!v){c(`${f.title} cannot be connected: no connection method available`);return}const T=await n.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:d}});g=ee(T).item.id}const h=g,p=await dt({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:d=>u(h,{connection_token:d}).then(()=>{})});if(!p.ok){c(`Couldn't sign in to ${f.title}: ${p.error}`);return}const x=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}}),j=ee(x).item?.configuration_state??null,b=xt(j,f.fieldKey,f.bindingType,h);await u(s,{configuration_state:b}),await o.invalidateQueries({queryKey:Z.commerceDiscoveryConnection(e.id,s)}),await o.invalidateQueries({queryKey:Z.commerceDiscoveryCompanionConnections(e.id)})}catch(g){c(g instanceof Error?g.message:String(g))}finally{l(null)}}return{connect:m,connectingFieldKey:a,error:r}}function Bt(n){const e=N.c(23),{org:t,cdConnectionId:s}=n,{data:o}=ve.useSession(),a=o?.user?.id??"";let l;e[0]!==t.id||e[1]!==t.slug?(l={connectionId:$e,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=l):l=e[2];const r=pe(l);let c;e[3]!==s||e[4]!==t||e[5]!==r?(c={selfClient:r,org:t,cdConnectionId:s},e[3]=s,e[4]=t,e[5]=r,e[6]=c):c=e[6];const{cards:u,isLoading:m,error:f}=Lt(c);let g;e[7]!==s||e[8]!==t||e[9]!==r||e[10]!==a?(g={selfClient:r,org:t,userId:a,cdConnectionId:s},e[7]=s,e[8]=t,e[9]=r,e[10]=a,e[11]=g):g=e[11];const{connect:h,connectingFieldKey:p,error:x}=Ft(g);if(!m&&!f&&u.length===0)return null;const j=p!==null;let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsxs("div",{className:"grid gap-1.5",children:[i.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),i.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[12]=b):b=e[12];let d;return e[13]!==j||e[14]!==u||e[15]!==h||e[16]!==x||e[17]!==p||e[18]!==f||e[19]!==m||e[20]!==t||e[21]!==r?(d=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:block md:flex-none",children:[b,f?i.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[i.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):m?i.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Ht)}):i.jsx(je,{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-[45vh] md:flex-none",children:i.jsxs("div",{className:"grid gap-4",children:[x&&i.jsx("p",{role:"alert",className:"text-sm text-destructive",children:x}),u.map(y=>i.jsx(It,{card:y,connecting:p===y.fieldKey,disabled:j&&p!==y.fieldKey,org:t,selfClient:r,onConnect:()=>{h(y)}},y.fieldKey))]})})]}),e[13]=j,e[14]=u,e[15]=h,e[16]=x,e[17]=p,e[18]=f,e[19]=m,e[20]=t,e[21]=r,e[22]=d):d=e[22],d}function Ht(n){return i.jsx(Nt,{},n)}const Ne="https://decocms-tanstack.deco-cx.workers.dev/agendar",Qt="Rather have us walk you through it?",Wt="Book a 20-minute call and we'll run the diagnostic with you, live.";function Vt({siteUrl:n,email:e}){const t=new URL(Ne);return n&&t.searchParams.set("siteUrl",n),e&&t.searchParams.set("email",e),t.toString()}function Gt(n){const e=N.c(9),{href:t,size:s,className:o}=n,a=t===void 0?Ne:t,l=s===void 0?"lg":s;let r;e[0]!==o?(r=se("w-full",o),e[0]=o,e[1]=r):r=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Me,{size:16}),e[2]=c):c=e[2];let u;e[3]!==a?(u=i.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",c]}),e[3]=a,e[4]=u):u=e[4];let m;return e[5]!==l||e[6]!==r||e[7]!==u?(m=i.jsx(te,{asChild:!0,variant:"outline",size:l,className:r,children:u}),e[5]=l,e[6]=r,e[7]=u,e[8]=m):m=e[8],m}function Oe(n){const e=N.c(2),{children:t}=n;let s;return e[0]!==t?(s=i.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:t}),e[0]=t,e[1]=s):s=e[1],s}function Yt(){const n=N.c(4);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Oe,{children:i.jsx(De,{size:20,className:"text-muted-foreground"})}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:i.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})}),n[1]=t):t=n[1];let s;n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),n[2]=s):s=n[2];let o;return n[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,i.jsxs("div",{className:"relative",children:[s,i.jsxs(Oe,{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),n[3]=o):o=n[3],o}function Zt(n){const e=N.c(4),{href:t}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Yt,{}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"grid gap-2",children:[i.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Qt}),i.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Wt})]}),e[1]=o):o=e[1];let a;return e[2]!==t?(a=i.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:i.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:[s,o,i.jsx(Gt,{href:t,size:"xl"})]})}),e[2]=t,e[3]=a):a=e[3],a}function Jt(n){const e=N.c(8),{className:t,href:s}=n,o=s===void 0?Ne:s;let a;e[0]!==t?(a=se("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:i.jsx(De,{size:20})}),e[2]=l):l=e[2];let r,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[i.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),i.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),c=i.jsx(Me,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=r,e[4]=c):(r=e[3],c=e[4]);let u;return e[5]!==o||e[6]!==a?(u=i.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:a,children:[l,r,c]}),e[5]=o,e[6]=a,e[7]=u):u=e[7],u}function qe(n){const e=N.c(10),{host:t}=n,s=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let o,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=i.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=a,e[2]=l):(o=e[0],a=e[1],l=e[2]);let r;e[3]!==s?(r=i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:i.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=r):r=e[4];let c;e[5]!==t?(c=i.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=c):c=e[6];let u;return e[7]!==r||e[8]!==c?(u=i.jsxs("div",{className:"flex items-center gap-3",children:[o,a,l,r,c]}),e[7]=r,e[8]=c,e[9]=u):u=e[9],u}function Fe(n){const e=N.c(16),{label:t,iconSize:s,className:o,iconClassName:a,labelClassName:l}=n,r=s===void 0?14:s;let c;e[0]!==o?(c=se("inline-flex items-center gap-2",o),e[0]=o,e[1]=c):c=e[1];let u;e[2]!==a?(u=se("shrink-0 animate-spin",a),e[2]=a,e[3]=u):u=e[3];let m;e[4]!==r||e[5]!==u?(m=i.jsx(me,{size:r,className:u}),e[4]=r,e[5]=u,e[6]=m):m=e[6];let f;e[7]!==l?(f=se("text-sm",l),e[7]=l,e[8]=f):f=e[8];let g;e[9]!==t||e[10]!==f?(g=i.jsx("span",{className:f,children:t}),e[9]=t,e[10]=f,e[11]=g):g=e[11];let h;return e[12]!==c||e[13]!==m||e[14]!==g?(h=i.jsxs("span",{className:c,children:[m,g]}),e[12]=c,e[13]=m,e[14]=g,e[15]=h):h=e[15],h}const Xt={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Be(n){return Xt[n]}function Ie(n){const e=N.c(2),{variant:t}=n;let s;return e[0]!==t?(s=i.jsx(J,{children:i.jsx(Ee,{variant:t})}),e[0]=t,e[1]=s):s=e[1],s}function Ee(n){const e=N.c(4),{variant:t}=n;let s;e[0]!==t?(s=Be(t),e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=i.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:i.jsx(Fe,{label:s,className:"text-muted-foreground"})}),e[2]=s,e[3]=o):o=e[3],o}function en(){const n=N.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(Fe,{label:Be("button")}),n[0]=e):e=n[0],e}function Cs(){const n=N.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(nn,{}),n[0]=e):e=n[0],e}const He=A.createContext(null),Qe=()=>A.useContext(He);function tn(n){if(!n)return null;const e=be(n);return e.ok?new URL(e.value).hostname:null}function nn(){const n=N.c(9);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},n[0]=e):e=n[0];const t=We(e),{org:s,siteUrl:o}=t;let a;n[1]!==o?(a=tn(o),n[1]=o,n[2]=a):a=n[2];const l=a;let r;n[3]!==s||n[4]!==o?(r=i.jsx(sn,{requestedOrgSlug:s,siteUrl:o}),n[3]=s,n[4]=o,n[5]=r):r=n[5];let c;return n[6]!==l||n[7]!==r?(c=i.jsx(He.Provider,{value:l,children:r}),n[6]=l,n[7]=r,n[8]=c):c=n[8],c}function sn(n){const e=N.c(8),{requestedOrgSlug:t,siteUrl:s}=n,{data:o,isPending:a}=ve.useSession(),l=Qe();if(a){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Ie,{variant:"route"}),e[0]=c):c=e[0],c}if(!o){const c=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==l?(u=l?i.jsx(qe,{host:l}):void 0,e[1]=l,e[2]=u):u=e[2];let m;return e[3]!==u?(m=i.jsx(J,{children:i.jsx(Je,{callbackUrl:c,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:u})}),e[3]=u,e[4]=m):m=e[4],m}let r;return e[5]!==t||e[6]!==s?(r=i.jsx(on,{requestedOrgSlug:t,siteUrl:s}),e[5]=t,e[6]=s,e[7]=r):r=e[7],r}function on(n){const e=N.c(40),{requestedOrgSlug:t,siteUrl:s}=n,o=ze(),a=Ve(),[l,r]=A.useState(null),[c,u]=A.useState(null),m=a.data?.map(ln)??[];let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={mutationFn:rn,retry:!1,onSuccess:d=>{u(d)}},e[0]=f):f=e[0];const g=Se(f);if(a.isPending){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Ie,{variant:"route"}),e[1]=d):d=e[1],d}if(a.error){let d;return e[2]!==a?(d=i.jsx(ue,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=d):d=e[3],d}const h=t?m.find(d=>d.slug===t):null;if(h){let d;return e[4]!==h||e[5]!==s?(d=i.jsx(de,{org:h,initialSiteUrl:s}),e[4]=h,e[5]=s,e[6]=d):d=e[6],d}if(t){let d;return e[7]!==a?(d=i.jsx(ue,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=d):d=e[8],d}if(l){let d;return e[9]!==l||e[10]!==s?(d=i.jsx(de,{org:l,initialSiteUrl:s}),e[9]=l,e[10]=s,e[11]=d):d=e[11],d}if(m.length===1&&m[0]){let d;return e[12]!==m[0]||e[13]!==s?(d=i.jsx(de,{org:m[0],initialSiteUrl:s}),e[12]=m[0],e[13]=s,e[14]=d):d=e[14],d}if(m.length>1){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ne,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=d):d=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=v=>r(v),e[16]=y):y=e[16];let S;return e[17]!==m?(S=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[d,i.jsx(je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(ke,{organizations:m,selectLabel:"Continue",onSelected:y})})]})}),e[17]=m,e[18]=S):S=e[18],S}if(!c){let d;e[19]!==g?(d=()=>{g.reset(),g.mutate()},e[19]=g,e[20]=d):d=e[20];let y;return e[21]!==g||e[22]!==d?(y=i.jsx(an,{mutation:g,onRetry:d}),e[21]=g,e[22]=d,e[23]=y):y=e[23],y}const p=c;if(p?.success&&(p.status==="created"||p.status==="joined"||p.status==="already_has_organization")&&p.organization){let d;return e[24]!==p.organization||e[25]!==s?(d=i.jsx(de,{org:p.organization,initialSiteUrl:s}),e[24]=p.organization,e[25]=s,e[26]=d):d=e[26],d}if(p?.status==="ambiguous"&&p.organizations&&p.organizations.length>0){let d;e[27]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(ne,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=d):d=e[27];const y=p.domain??void 0;let S;e[28]!==o||e[29]!==s?(S=(T,I)=>{Le(),r({...T,slug:I}),o({to:"/commerce-onboarding",search:{org:I,siteUrl:s}})},e[28]=o,e[29]=s,e[30]=S):S=e[30];let v;return e[31]!==p.organizations||e[32]!==y||e[33]!==S?(v=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[d,i.jsx(je,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(ke,{organizations:p.organizations,domain:y,onJoined:S})})]})}),e[31]=p.organizations,e[32]=y,e[33]=S,e[34]=v):v=e[34],v}const x=p?.error??"We could not determine a commerce organization for this account.";let j;e[35]!==g?(j=()=>{u(null),g.reset()},e[35]=g,e[36]=j):j=e[36];let b;return e[37]!==x||e[38]!==j?(b=i.jsx(ue,{title:"Commerce onboarding needs support",description:x,actionLabel:"Try again",onRetry:j}),e[37]=x,e[38]=j,e[39]=b):b=e[39],b}async function rn(){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&&Le(),e}function ln(n){return{id:n.id,name:n.name,slug:n.slug,logo:n.logo??null}}function an(n){const e=N.c(7),{mutation:t,onRetry:s}=n,o=A.useRef(!1);let a;e[0]!==t?(a=u=>{!u||o.current||(o.current=!0,t.mutate())},e[0]=t,e[1]=a):a=e[1];const l=a;if(t.error){let u;return e[2]!==s?(u=i.jsx(ue,{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:s}),e[2]=s,e[3]=u):u=e[3],u}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Ee,{variant:"workspace"}),e[4]=r):r=e[4];let c;return e[5]!==l?(c=i.jsx(J,{children:i.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=c):c=e[6],c}function ne(n){const e=N.c(8),{title:t,description:s}=n,o=Qe();let a;e[0]!==o?(a=o?i.jsx(qe,{host:o}):i.jsxs("div",{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=a):a=e[1];let l;e[2]!==s||e[3]!==t?(l=(t||s)&&i.jsxs("div",{className:"space-y-2",children:[t&&i.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),s&&i.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=i.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function ue(n){const e=N.c(9),{title:t,description:s,actionLabel:o,onRetry:a}=n;let l;e[0]!==s||e[1]!==t?(l=i.jsx(ne,{title:t,description:s}),e[0]=s,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==o||e[4]!==a?(r=i.jsx(te,{type:"button",size:"xl",className:"w-full",onClick:a,children:o}),e[3]=o,e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==l||e[7]!==r?(c=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function cn(n){return n.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function xe(n){const e=n;if(e.isError)throw new Error(cn(e));return e.structuredContent??n}function de(n){const e=N.c(3),{org:t,initialSiteUrl:s}=n;let o;return e[0]!==s||e[1]!==t?(o=i.jsx(Ge,{children:a=>{const{reset:l}=a;return i.jsx(Ye,{fallback:r=>{const{error:c,resetError:u}=r;return i.jsx(J,{children:i.jsx(dn,{orgName:t.name,message:c instanceof Error?c.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),u()}})})},children:i.jsx(A.Suspense,{fallback:i.jsx(Ie,{variant:"connect"}),children:i.jsx(un,{org:t,initialSiteUrl:s},`${t.id}:${s??""}`)})})}}),e[0]=s,e[1]=t,e[2]=o):o=e[2],o}function dn(n){const e=N.c(10),{orgName:t,message:s,onRetry:o}=n,a=`Commerce setup will continue for ${t}.`;let l;e[0]!==a?(l=i.jsx(ne,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==s?(r=i.jsx(ge,{message:s}),e[2]=s,e[3]=r):r=e[3];let c;e[4]!==o?(c=i.jsx(te,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=c):c=e[5];let u;return e[6]!==l||e[7]!==r||e[8]!==c?(u=i.jsxs("div",{className:"grid gap-10",children:[l,r,c]}),e[6]=l,e[7]=r,e[8]=c,e[9]=u):u=e[9],u}function un(n){const e=N.c(84),{org:t,initialSiteUrl:s}=n,o=ze();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:$e,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const l=pe(a),[r,c]=A.useState(s??""),[u,m]=A.useState(null),[f,g]=A.useState(null),h=A.useRef(!1),p=Pe.COMMERCE_DISCOVERY(t.id),x=tt(t.id),j=Z.commerceDiscoveryConnection(t.id,p);let b;e[3]!==p||e[4]!==l?(b=async()=>{const _=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:p}});return xe(_)},e[3]=p,e[4]=l,e[5]=b):b=e[5];let d;e[6]!==j||e[7]!==b?(d={queryKey:j,queryFn:b,retry:!1},e[6]=j,e[7]=b,e[8]=d):d=e[8];const y=we(d),S=Z.commerceDiscoveryVirtualMcp(t.id,x);let v;e[9]!==l||e[10]!==x?(v=async()=>{const _=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return xe(_)},e[9]=l,e[10]=x,e[11]=v):v=e[11];let T;e[12]!==S||e[13]!==v?(T={queryKey:S,queryFn:v,retry:!1},e[12]=S,e[13]=v,e[14]=T):T=e[14];const I=we(T);let R;e[15]!==l?(R=async _=>{const O=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:_}});return xe(O)},e[15]=l,e[16]=R):R=e[16];let H;e[17]!==y||e[18]!==I?(H=_=>{m(_),g(null),y.refetch(),I.refetch()},e[17]=y,e[18]=I,e[19]=H):H=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=_=>{g(_ instanceof Error?_.message:"Commerce Discovery setup failed.")},e[20]=E):E=e[20];let $;e[21]!==R||e[22]!==H?($={mutationFn:R,retry:!1,onSuccess:H,onError:E},e[21]=R,e[22]=H,e[23]=$):$=e[23];const L=Se($),U=!!y.data.item&&!!I.data.item;let Q;e[24]!==L?(Q=_=>{const O=be(_);if(!O.ok){g(O.error);return}g(null),L.mutate(O.value)},e[24]=L,e[25]=Q):Q=e[25];const M=Q;let G;e[26]!==s||e[27]!==M||e[28]!==U?(G=_=>{!_||h.current||U||!s||(h.current=!0,M(s))},e[26]=s,e[27]=M,e[28]=U,e[29]=G):G=e[29];const F=G;let V;e[30]!==M||e[31]!==r?(V=_=>{_.preventDefault(),M(r)},e[30]=M,e[31]=r,e[32]=V):V=e[32];const P=V;let D;e[33]!==p||e[34]!==u?.reportApp||e[35]!==x?(D=u?.reportApp??{connectionId:p,virtualMcpId:x,toolName:nt},e[33]=p,e[34]=u?.reportApp,e[35]=x,e[36]=D):D=e[36];const w=D;let K;e[37]!==o||e[38]!==t.slug||e[39]!==w.connectionId||e[40]!==w.toolName||e[41]!==w.virtualMcpId?(K=()=>{localStorage.setItem(Ze.sidebarOpen(),JSON.stringify(!1)),o({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:w.virtualMcpId,main:Xe(w.connectionId,w.toolName),chat:0}})},e[37]=o,e[38]=t.slug,e[39]=w.connectionId,e[40]=w.toolName,e[41]=w.virtualMcpId,e[42]=K):K=e[42];const B=K;if(U){const _=s??r;let O;return e[43]!==B||e[44]!==t||e[45]!==w||e[46]!==_?(O=i.jsx(mn,{org:t,reportApp:w,onOpenReport:B,siteUrl:_}),e[43]=B,e[44]=t,e[45]=w,e[46]=_,e[47]=O):O=e[47],O}if(s){let _;e[48]!==s?(_=be(s),e[48]=s,e[49]=_):_=e[49];const O=_;if(!O.ok){const he=`Commerce setup will continue for ${t.name}.`;let ie;e[50]!==he?(ie=i.jsx(ne,{title:"Commerce diagnostics",description:he}),e[50]=he,e[51]=ie):ie=e[51];let oe;e[52]!==O.error?(oe=i.jsx(ge,{message:O.error}),e[52]=O.error,e[53]=oe):oe=e[53];let re;e[54]!==P||e[55]!==f||e[56]!==L.isPending||e[57]!==r?(re=i.jsx(ye,{siteUrl:r,error:f,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P}),e[54]=P,e[55]=f,e[56]=L.isPending,e[57]=r,e[58]=re):re=e[58];let ce;return e[59]!==ie||e[60]!==oe||e[61]!==re?(ce=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[ie,oe,re]})}),e[59]=ie,e[60]=oe,e[61]=re,e[62]=ce):ce=e[62],ce}const X=`Commerce Discovery is being prepared for ${O.value}.`;let W;e[63]!==X?(W=i.jsx(ne,{title:"Commerce diagnostics",description:X}),e[63]=X,e[64]=W):W=e[64];let Y;e[65]!==P||e[66]!==f||e[67]!==L||e[68]!==r?(Y=f?i.jsxs(i.Fragment,{children:[i.jsx(ge,{message:f}),i.jsx(ye,{siteUrl:r,error:null,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P})]}):i.jsx(Ee,{variant:"setup"}),e[65]=P,e[66]=f,e[67]=L,e[68]=r,e[69]=Y):Y=e[69];let ae;return e[70]!==W||e[71]!==Y||e[72]!==F?(ae=i.jsx(J,{children:i.jsxs("div",{ref:F,className:"grid gap-10",children:[W,Y]})}),e[70]=W,e[71]=Y,e[72]=F,e[73]=ae):ae=e[73],ae}const q=`Commerce setup will continue for ${t.name}.`;let C;e[74]!==q?(C=i.jsx(ne,{title:"Commerce diagnostics",description:q}),e[74]=q,e[75]=C):C=e[75];let z;e[76]!==P||e[77]!==f||e[78]!==L.isPending||e[79]!==r?(z=i.jsx(ye,{siteUrl:r,error:f,isSubmitting:L.isPending,onSiteUrlChange:c,onSubmit:P}),e[76]=P,e[77]=f,e[78]=L.isPending,e[79]=r,e[80]=z):z=e[80];let k;return e[81]!==C||e[82]!==z?(k=i.jsx(J,{children:i.jsxs("div",{className:"grid gap-10",children:[C,z]})}),e[81]=C,e[82]=z,e[83]=k):k=e[83],k}function ye(n){const e=N.c(22),{siteUrl:t,error:s,isSubmitting:o,onSiteUrlChange:a,onSubmit:l}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let c;e[1]!==a?(c=j=>a(j.target.value),e[1]=a,e[2]=c):c=e[2];const u=!!s;let m;e[3]!==o||e[4]!==t||e[5]!==c||e[6]!==u?(m=i.jsx(et,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:c,placeholder:"https://example.com","aria-invalid":u,disabled:o}),e[3]=o,e[4]=t,e[5]=c,e[6]=u,e[7]=m):m=e[7];let f;e[8]!==s?(f=s?i.jsx(ge,{message:s}):null,e[8]=s,e[9]=f):f=e[9];let g;e[10]!==m||e[11]!==f?(g=i.jsxs("div",{className:"grid gap-2",children:[r,m,f]}),e[10]=m,e[11]=f,e[12]=g):g=e[12];let h;e[13]!==o?(h=o?i.jsx(en,{}):i.jsxs(i.Fragment,{children:["Continue",i.jsx(Ue,{size:16})]}),e[13]=o,e[14]=h):h=e[14];let p;e[15]!==o||e[16]!==h?(p=i.jsx(te,{type:"submit",size:"xl",className:"w-full",disabled:o,children:h}),e[15]=o,e[16]=h,e[17]=p):p=e[17];let x;return e[18]!==l||e[19]!==g||e[20]!==p?(x=i.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[g,p]}),e[18]=l,e[19]=g,e[20]=p,e[21]=x):x=e[21],x}function mn(n){const e=N.c(24),{org:t,reportApp:s,onOpenReport:o,siteUrl:a}=n,{data:l}=ve.useSession(),r=l?.user?.email;let c;e[0]!==a||e[1]!==r?(c=Vt({siteUrl:a,email:r}),e[0]=a,e[1]=r,e[2]=c):c=e[2];const u=c;let m;e[3]!==u?(m=i.jsx(Zt,{href:u}),e[3]=u,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ne,{}),e[5]=f):f=e[5];let g;e[6]!==t||e[7]!==s.connectionId?(g=i.jsx(Bt,{org:t,cdConnectionId:s.connectionId}),e[6]=t,e[7]=s.connectionId,e[8]=g):g=e[8];let h;e[9]!==u?(h=i.jsx(Jt,{className:"md:hidden",href:u}),e[9]=u,e[10]=h):h=e[10];const p=!s.virtualMcpId;let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(Ue,{size:18}),e[11]=x):x=e[11];let j;e[12]!==o||e[13]!==p?(j=i.jsxs(te,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",x]}),e[12]=o,e[13]=p,e[14]=j):j=e[14];let b;e[15]!==h||e[16]!==j?(b=i.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[h,j]}),e[15]=h,e[16]=j,e[17]=b):b=e[17];let d;e[18]!==b||e[19]!==g?(d=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:block",children:[f,g,b]}),e[18]=b,e[19]=g,e[20]=d):d=e[20];let y;return e[21]!==d||e[22]!==m?(y=i.jsx(J,{align:"fill",visual:m,children:d}),e[21]=d,e[22]=m,e[23]=y):y=e[23],y}function ge(n){const e=N.c(2),{message:t}=n;let s;return e[0]!==t?(s=i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=s):s=e[1],s}export{Cs as default};
@@ -1 +1 @@
1
- import{c as b,w as N,K as k,k as z,j as s,r as M,B as T,l as v}from"./index-Cv9mBjo7.js";import{a as I,b as S,D,c as E,d as R}from"./dialog-DCgiGyoi.js";import{S as _}from"./chat-context-BaKzEXcz.js";import{i as $}from"./ChevronUp-BVY3AvRH.js";import{a as A}from"./Eye-CM171o_T.js";import{u as B}from"./studio-tools-CMCuOE16.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=N(),l=B();let o;i[0]!==e.id?(o=k.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",w=[{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 w.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(D,{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:w.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(E,{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(R,{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
+ import{c as b,w as N,K as k,k as z,j as s,r as M,B as T,l as v}from"./index-CurNB2HG.js";import{a as I,b as S,D,c as E,d as R}from"./dialog-BFjL_my-.js";import{S as _}from"./chat-context-Dz9rhizY.js";import{i as $}from"./ChevronUp-CiXD4kQk.js";import{a as A}from"./Eye-B92Ff4dY.js";import{u as B}from"./studio-tools-BvQ8Bli1.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=N(),l=B();let o;i[0]!==e.id?(o=k.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",w=[{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 w.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(D,{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:w.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(E,{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(R,{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,w as $,b0 as k,K as D,l as w,j as x}from"./index-Cv9mBjo7.js";import{u as K}from"./use-registry-connections-TpTO-i4h.js";import{b as Q}from"./use-organization-settings-BDxA4itK.js";import{S as E,e as F}from"./use-mcp-client-CqKvf2Rs.js";import{u as H}from"./useInfiniteQuery-Bpa3bNzf.js";import{i as q,f as G}from"./extract-connection-data-4oeG-upD.js";import{C as U}from"./card-DA0CRdef.js";import{I as V}from"./integration-icon-D1BIYakT.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(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=w("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:w("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,w as $,b0 as k,K as D,l as w,j as x}from"./index-CurNB2HG.js";import{u as K}from"./use-registry-connections-3CHe_VwJ.js";import{b as Q}from"./use-organization-settings-B5L78CqV.js";import{S as E,e as F}from"./use-mcp-client-BbOUwA1H.js";import{u as H}from"./useInfiniteQuery-BAIT4yxs.js";import{i as q,f as G}from"./extract-connection-data-Bau_aQvM.js";import{C as U}from"./card-D_tApM0k.js";import{I as V}from"./integration-icon-Dpj2NSXY.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(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=w("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:w("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};