decocms 3.91.0 → 3.92.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 (214) hide show
  1. package/dist/client/assets/{AlertCircle-CJRvjf9E.js → AlertCircle-CTPV9V8h.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-C-ASyyy7.js → ArrowUpRight-C3z436np.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DHlN5aNG.js → CheckCircle-BcEM-U8z.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-siikX1CB.js → ChevronDown-h0x45P8o.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BMBu9Rmw.js → ChevronLeft-zdg7Q4jK.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-bS8zu0mE.js → ChevronRight-qRgV12A9.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CazSoL4d.js → ChevronUp-M8W7UfeY.js} +1 -1
  8. package/dist/client/assets/{DotsVertical--w5kUeSe.js → DotsVertical-5_LyH0_q.js} +1 -1
  9. package/dist/client/assets/{Eye-evykl5te.js → Eye-C_Xoo8qw.js} +1 -1
  10. package/dist/client/assets/{FilterLines-CbmfI3qe.js → FilterLines-dJo6BCZ1.js} +1 -1
  11. package/dist/client/assets/{Globe01-C5qUvOk3.js → Globe01-sY1H67fR.js} +1 -1
  12. package/dist/client/assets/{Globe04-ayhcWvo6.js → Globe04-DF2MygRC.js} +1 -1
  13. package/dist/client/assets/{HardDrive-BZnTfRN9.js → HardDrive-rN9rvzTi.js} +1 -1
  14. package/dist/client/assets/{Key01-BHQPeab7.js → Key01-DdhtrhKo.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-eB33hZq-.js → LayoutLeft-BGpgGNzH.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-C9BK0yA_.js → LinkExternal01-Qtas2L2N.js} +1 -1
  17. package/dist/client/assets/{Monitor01-CuUeTTqr.js → Monitor01-Dl_qoJKp.js} +1 -1
  18. package/dist/client/assets/{Palette-B-wglEVr.js → Palette-tdsAZuuV.js} +1 -1
  19. package/dist/client/assets/{Play-eP0tvaLl.js → Play-DJ7ZmWZL.js} +1 -1
  20. package/dist/client/assets/{Plus-DYuvLVJp.js → Plus-C1ojr5M2.js} +1 -1
  21. package/dist/client/assets/{SearchMd-BqOCkx90.js → SearchMd-DUageA20.js} +1 -1
  22. package/dist/client/assets/{Settings02-Ca71UgHw.js → Settings02-DozM190y.js} +1 -1
  23. package/dist/client/assets/{Shield01-DY339kBm.js → Shield01-C9Bch-EG.js} +1 -1
  24. package/dist/client/assets/{Star01-Cdx4KR4U.js → Star01-DqNKux5E.js} +1 -1
  25. package/dist/client/assets/{Stars01-DPz6mq_I.js → Stars01-r4i4yvEz.js} +1 -1
  26. package/dist/client/assets/{Stars02-CGjIjk8V.js → Stars02-DBKqj7gx.js} +1 -1
  27. package/dist/client/assets/{Sun-C4MaHaW6.js → Sun-CGcK7-RR.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DqWROiIl.js → SwitchHorizontal01-Bpw0CC0C.js} +1 -1
  29. package/dist/client/assets/{Tool01-CLVT6zPR.js → Tool01-D6XUAkke.js} +1 -1
  30. package/dist/client/assets/{Trash01-D3NdLyIt.js → Trash01-dG9X4BY7.js} +1 -1
  31. package/dist/client/assets/{Upload01-CwAL7vx3.js → Upload01-o5Xeg721.js} +1 -1
  32. package/dist/client/assets/{User01-CPYMutV0.js → User01-CDDYeeuq.js} +1 -1
  33. package/dist/client/assets/{Users01-Ih8cqcDu.js → Users01-BrrFQM4e.js} +1 -1
  34. package/dist/client/assets/{Users03-zuYH9zmO.js → Users03-DZMol2tr.js} +1 -1
  35. package/dist/client/assets/{X-DFZG0D7q.js → X-kuCvYxfG.js} +1 -1
  36. package/dist/client/assets/{XCircle-C4Okg4wT.js → XCircle-5-9If2le.js} +1 -1
  37. package/dist/client/assets/{XClose-CsMYL6lC.js → XClose-BXP3vjGQ.js} +1 -1
  38. package/dist/client/assets/{Zap-0-1HsH9l.js → Zap-DD_vVHsY.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CSwYwLqC.js → ZapSquare-Buvc-Lai.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-DZZylEjW.js → ZoomOut-CXIGZvFC.js} +1 -1
  41. package/dist/client/assets/{access-gate-BKEoJm4_.js → access-gate-BR7-vI-o.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-DcqHegyG.js → add-section-modal-DukcyzZP.js} +1 -1
  43. package/dist/client/assets/{agent-icon-DyIO38tc.js → agent-icon-y3KUME6u.js} +1 -1
  44. package/dist/client/assets/{agents-list-CTPBFG-U.js → agents-list-Dva-TMdx.js} +1 -1
  45. package/dist/client/assets/{ai-providers-BdFdksO5.js → ai-providers-U9Oy1IkQ.js} +1 -1
  46. package/dist/client/assets/{alert-bxo3sfvI.js → alert-8LZNYhbM.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-CvkQwL5h.js → alert-dialog-NR8Vy9T7.js} +3 -3
  48. package/dist/client/assets/{app-editor-B_pm__vT.js → app-editor-DBkxoyvh.js} +1 -1
  49. package/dist/client/assets/{auth-catchall-CSy0uKFp.js → auth-catchall-DLR6d36r.js} +1 -1
  50. package/dist/client/assets/{auth-entry-C20r1MAB.js → auth-entry-zDnCGVnz.js} +1 -1
  51. package/dist/client/assets/{auth-Duwx_iL2.js → auth-fiRjWiax.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-BAnr4RmX.js → auth-split-layout-8yYHO1kd.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-C_sfC4y1.js → authenticate-and-persist-oauth-BcWaYu03.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CSGFQlGB.js → automation-list-row--vcTFZr3.js} +1 -1
  55. package/dist/client/assets/{automation-runs-Cg17Xjs9.js → automation-runs-CHpPdKco.js} +1 -1
  56. package/dist/client/assets/{automations-DzcGR2GP.js → automations-ThLFbl1d.js} +1 -1
  57. package/dist/client/assets/{avatar-DK4P1R5g.js → avatar-BxyUCT4U.js} +1 -1
  58. package/dist/client/assets/{badge-BKEWn2TK.js → badge-DLF4nMeJ.js} +1 -1
  59. package/dist/client/assets/{block-document-NIWGLeAt.js → block-document-DpyUaDcw.js} +1 -1
  60. package/dist/client/assets/{brand-context-CJDKvZr6.js → brand-context-D0w3WInv.js} +1 -1
  61. package/dist/client/assets/{buckets-diJYBJDb.js → buckets-ClqHbsD2.js} +1 -1
  62. package/dist/client/assets/{capability-load-error-CvoDXWMK.js → capability-load-error-rkvVTAvN.js} +1 -1
  63. package/dist/client/assets/{card-CAloKMup.js → card-qTvvOhTO.js} +1 -1
  64. package/dist/client/assets/{category-editor-OJRcsrxS.js → category-editor-C5ERe_HJ.js} +1 -1
  65. package/dist/client/assets/{chat-context-B8Pf9_Ws.js → chat-context-KTj5-AOt.js} +1 -1
  66. package/dist/client/assets/{checkbox-BQjinmyU.js → checkbox-CuNBBII4.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-BUzt6pk1.js → cli-auth-success-Dtu3yTTD.js} +1 -1
  68. package/dist/client/assets/{collection-detail-BaUmzKIC.js → collection-detail-BPmhu-Hf.js} +1 -1
  69. package/dist/client/assets/{collection-display-button-DQ41t2NW.js → collection-display-button-5VmkUi41.js} +1 -1
  70. package/dist/client/assets/{collection-search-oL_WM4rt.js → collection-search-CzWpsVEo.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-BmqFW71W.js → collection-tabs-ZJSfiPZP.js} +1 -1
  72. package/dist/client/assets/{command-D3tx4Z-o.js → command-BpJf46EY.js} +1 -1
  73. package/dist/client/assets/{commerce-onboarding-BdejwHzi.js → commerce-onboarding-2OV0QV1i.js} +1 -1
  74. package/dist/client/assets/{connect-desktop-dialog-cYgK2XT4.js → connect-desktop-dialog-DDPFCC29.js} +1 -1
  75. package/dist/client/assets/{connection-card-DS-KJfkn.js → connection-card-CttTgPIt.js} +1 -1
  76. package/dist/client/assets/{connection-detail-DS2TWtDQ.js → connection-detail-DQ7R7HUI.js} +1 -1
  77. package/dist/client/assets/{connection-form-helpers-D6xKQSqh.js → connection-form-helpers-D0IiFAXA.js} +1 -1
  78. package/dist/client/assets/{connections-C20eJoml.js → connections-BRlfiprC.js} +1 -1
  79. package/dist/client/assets/{context-menu-Bv_k6cm6.js → context-menu-DVKrNuwG.js} +1 -1
  80. package/dist/client/assets/{decopilot-7gVBBoRg.js → decopilot-CaqXxVEy.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-85Pin_5c.js → decopilot-sse-pool-SxIYp1o0.js} +1 -1
  82. package/dist/client/assets/{dialog-C2ETGOlj.js → dialog-De44o6RM.js} +1 -1
  83. package/dist/client/assets/{domain-settings-DYnLYvkm.js → domain-settings-ChvIy0Wm.js} +1 -1
  84. package/dist/client/assets/{drawer-CliHEmeh.js → drawer-NLM-7FXB.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-DpexHxwz.js → dropdown-menu-BA5vMFVR.js} +1 -1
  86. package/dist/client/assets/{empty-state-Bttcdn67.js → empty-state-DFBlj7Oy.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-CdrxJbbw.js → extract-connection-data-DvTYFZdB.js} +1 -1
  88. package/dist/client/assets/{file-explorer-KrE43sZb.js → file-explorer-DsHRvYhD.js} +1 -1
  89. package/dist/client/assets/{file-type-icon-BqeQzn3H.js → file-type-icon-D53u34De.js} +1 -1
  90. package/dist/client/assets/{files-YqKKAUmX.js → files-CS4u69vv.js} +1 -1
  91. package/dist/client/assets/{form-Bbk-lY-7.js → form-Sjgg7L1l.js} +1 -1
  92. package/dist/client/assets/{general-fC_qvwJN.js → general-D8wSedUn.js} +1 -1
  93. package/dist/client/assets/{github-repo-picker-Cr4ZW67O.js → github-repo-picker-BFtRE41G.js} +1 -1
  94. package/dist/client/assets/{hooks-BPl3QtCR.js → hooks-CufRYk_8.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-CPuC0ABC.js → import-from-deco-dialog-Btg0GawG.js} +1 -1
  96. package/dist/client/assets/{index-C9HI3IQT.js → index-1sv4-AMe.js} +1 -1
  97. package/dist/client/assets/{index-CpYfLdbh.js → index-8IVTNNP6.js} +31 -31
  98. package/dist/client/assets/{index-DUQAYjfP.js → index-9e9TTQwf.js} +1 -1
  99. package/dist/client/assets/{index-BUBP8yoe.js → index-B9In4A29.js} +1 -1
  100. package/dist/client/assets/{index-CUkKcI0t.js → index-BHabOdpB.js} +1 -1
  101. package/dist/client/assets/{index-BHkcyC9T.js → index-Bba1-WC0.js} +1 -1
  102. package/dist/client/assets/{index-JxN6NNcb.js → index-BgmDXgkB.js} +1 -1
  103. package/dist/client/assets/index-C81L8B-t.js +26 -0
  104. package/dist/client/assets/{index-BONY-938.js → index-CtyGaPoF.js} +1 -1
  105. package/dist/client/assets/{index-CF2fOu8a.js → index-D8MUHYrz.js} +1 -1
  106. package/dist/client/assets/{index-DiDBx4Jd.js → index-DHIQ-5cy.js} +1 -1
  107. package/dist/client/assets/{index-B3I-Kacs.js → index-DSt_2A-Z.js} +1 -1
  108. package/dist/client/assets/{index-Dnojhzzx.js → index-De8cOu3L.js} +1 -1
  109. package/dist/client/assets/{index-BZ2bAvBZ.js → index-jIVzy9UM.js} +26 -26
  110. package/dist/client/assets/{index-redirect-DUmXObtL.js → index-redirect-EhTontBM.js} +1 -1
  111. package/dist/client/assets/{input-CIRD_tZz.js → input-DEW4adst.js} +1 -1
  112. package/dist/client/assets/{integration-icon-DR2sJls0.js → integration-icon-DRg6drab.js} +1 -1
  113. package/dist/client/assets/{label-B97xU05r.js → label-DiKcChLe.js} +1 -1
  114. package/dist/client/assets/{login-aqSvs4xu.js → login-CxnOTKMg.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-Djb0mwKI.js → mcp-oauth-D4oN1GD0.js} +1 -1
  116. package/dist/client/assets/{members-LIiEPwh_.js → members-B_xYxcsB.js} +1 -1
  117. package/dist/client/assets/{monaco-editor-chBKXgor.js → monaco-editor-BS4nF9vi.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-B2OtnWGL.js → monitoring-stats-row-C_BBIjSY.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-CPjT2KBB.js → oauth-callback-CQLBs7SS.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-CNvn3MnX.js → oauth-callback-ai-provider-WiMYmXXg.js} +1 -1
  121. package/dist/client/assets/{onboarding-Doy2esp8.js → onboarding-fkSLmT6O.js} +1 -1
  122. package/dist/client/assets/{org-install-DMtmX55L.js → org-install-DSZrjYGU.js} +1 -1
  123. package/dist/client/assets/{org-layout-DBS5Dl9D.js → org-layout-B41VWQNh.js} +1 -1
  124. package/dist/client/assets/{organization-choice-BmyyAVCI.js → organization-choice-jnC4WCjk.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-Cq4dpyUr.js → page-seo-form-DAOmgLEM.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-DM2mzdSm.js +1 -0
  127. package/dist/client/assets/{popover-Dg4e80gp.js → popover--OXcCKrd.js} +1 -1
  128. package/dist/client/assets/{post-editor-5nP4PxmA.js → post-editor-S8FcLvTH.js} +1 -1
  129. package/dist/client/assets/{preview-dialog-CDJVefgZ.js → preview-dialog-D6RImvCH.js} +1 -1
  130. package/dist/client/assets/{primitives-DUdU_mJX.js → primitives-CdETTpfY.js} +1 -1
  131. package/dist/client/assets/{profile-kBSMawrR.js → profile-BQCwnbZu.js} +1 -1
  132. package/dist/client/assets/project-app-view-C7wdVVC-.js +1 -0
  133. package/dist/client/assets/record-editor-Bc9sycrh.js +1 -0
  134. package/dist/client/assets/registry-CXYbVCrQ.js +2 -0
  135. package/dist/client/assets/{registry-layout-CulqOQUe.js → registry-layout-wlGf_Igm.js} +1 -1
  136. package/dist/client/assets/{require-capability-BmO-FXvQ.js → require-capability-DhJE5Xa9.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-k-s2E1Qb.js → required-auth-layout-Fr7G1_os.js} +1 -1
  138. package/dist/client/assets/{reset-password-zxigX-0y.js → reset-password-De0oku0I.js} +1 -1
  139. package/dist/client/assets/{roles-CnqkorpG.js → roles-CBq06nUQ.js} +1 -1
  140. package/dist/client/assets/{save-status-BHYmpruK.js → save-status-faczHAq_.js} +1 -1
  141. package/dist/client/assets/{scroll-area-D2_mdzGg.js → scroll-area-DtpEC4sX.js} +1 -1
  142. package/dist/client/assets/{search-input-CIf1Vg9y.js → search-input-q1eD_5_A.js} +1 -1
  143. package/dist/client/assets/{secrets-Chc4G-P7.js → secrets-BJHqkOjl.js} +1 -1
  144. package/dist/client/assets/{sections-editor-JadmVfEe.js → sections-editor-DZi5HAI6.js} +1 -1
  145. package/dist/client/assets/{select-BVI-5ZuA.js → select-DveGPtTs.js} +1 -1
  146. package/dist/client/assets/{select-model-xkUMgIU9.js → select-model-B9XvZJq8.js} +1 -1
  147. package/dist/client/assets/{seo-editor-CI81KXn7.js → seo-editor-jmDFQiXH.js} +1 -1
  148. package/dist/client/assets/{settings-layout-BhTO_Kmx.js → settings-layout-CbS4gDfO.js} +1 -1
  149. package/dist/client/assets/{settings-section-Cjt1BmIe.js → settings-section-7QSZzGGM.js} +1 -1
  150. package/dist/client/assets/{sheet-BRZ8PIrM.js → sheet-DotDwyu_.js} +1 -1
  151. package/dist/client/assets/{shell-controls-pLFf4RJ7.js → shell-controls-CAhd2j7y.js} +1 -1
  152. package/dist/client/assets/{shell-layout-DRb4EqiB.js → shell-layout-f_7DH_O9.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-DuHKXv9P.js → shell-route-loading-9aJk9Hmw.js} +1 -1
  154. package/dist/client/assets/{sidebar-Bnk9mrkf.js → sidebar-CURGt0uI.js} +1 -1
  155. package/dist/client/assets/{skeleton-DHujU9w_.js → skeleton-C7KobET9.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-Cxy3zG7_.js → sortable.esm-ChNxN2l_.js} +1 -1
  157. package/dist/client/assets/{sso-Bx7AxsDg.js → sso-CuKsNGpr.js} +1 -1
  158. package/dist/client/assets/{store-B8dfBRZv.js → store-Cm3ytQy5.js} +1 -1
  159. package/dist/client/assets/store-registry-CdgvqhD2.js +2 -0
  160. package/dist/client/assets/{studio-tools-DgyOaysE.js → studio-tools-Cs_A_fFf.js} +1 -1
  161. package/dist/client/assets/{switch-Bkziulms.js → switch-BfP1FSBL.js} +1 -1
  162. package/dist/client/assets/{table-KIotO0Kc.js → table-BaAa6K56.js} +1 -1
  163. package/dist/client/assets/{tabs-DHLQ27WW.js → tabs-CzNCi-GX.js} +1 -1
  164. package/dist/client/assets/{task-status-f5DTkB-J.js → task-status-Du-S_kdA.js} +1 -1
  165. package/dist/client/assets/{textarea-B3tIZUed.js → textarea-BOuQ8hAr.js} +1 -1
  166. package/dist/client/assets/{toggle-group-CRyR0oMn.js → toggle-group-g7Pofj3Q.js} +1 -1
  167. package/dist/client/assets/{toolbar-C_VPmr7n.js → toolbar-B3zorpAW.js} +1 -1
  168. package/dist/client/assets/{tooltip-CJMltTIZ.js → tooltip-ColKf3vR.js} +1 -1
  169. package/dist/client/assets/{types-COD2S7bi.js → types-jJ6t0Xlu.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-C9TDMEuy.js → use-ai-providers-CRDtHen0.js} +1 -1
  171. package/dist/client/assets/{use-automations-DJZ5x0Zc.js → use-automations-RE2HC5Hs.js} +1 -1
  172. package/dist/client/assets/{use-capability-B1kzuPXs.js → use-capability-Dmalupym.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-CMT1YGdo.js → use-clock-tick-BLgKQj6G.js} +1 -1
  174. package/dist/client/assets/{use-collections-BLUmcReO.js → use-collections-83Ppa4v2.js} +1 -1
  175. package/dist/client/assets/{use-connection-w2D8E4uB.js → use-connection-DvDmo5TH.js} +1 -1
  176. package/dist/client/assets/{use-copy-B3D09Hxq.js → use-copy-DDVFPKCT.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-Ct9eNtwu.js → use-create-virtual-mcp-CU-3ZPno.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-6krVFdTN.js → use-debounced-autosave-CxjDIf-9.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-DFc5oU0M.js → use-delete-connection-1T0rpL6n.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-2PCi1klw.js → use-file-configs-DsER6W2u.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-_XAuQc_I.js → use-infinite-scroll-DjDhs6Dg.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-DYWv9410.js → use-join-requests-BXJwJ1GJ.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-DN-NMZV3.js → use-mcp-client-B3ayFpDg.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-C617vkSu.js → use-mcp-prompts-C7TKdMuw.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-HiR2aat0.js → use-mcp-tools-CjEY2qt2.js} +1 -1
  186. package/dist/client/assets/{use-members-C2aOC6i6.js → use-members-Cw6sjYmY.js} +1 -1
  187. package/dist/client/assets/{use-mobile-Dl3xzohk.js → use-mobile-DtpAlBQq.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-Cv7a1gGO.js → use-navigate-to-agent-CPJoZFzF.js} +1 -1
  189. package/dist/client/assets/{use-org-auth-client-DuB9kXBr.js → use-org-auth-client-nI1SxZvL.js} +1 -1
  190. package/dist/client/assets/{use-org-sso-DqXQdm0q.js → use-org-sso-DAwQWdJa.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-8bKwxyLc.js → use-organization-roles-BZbxfhRO.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-CQ99RcOM.js → use-organization-settings-DLeFVLYP.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-O8z8zBrP.js → use-registry-connections-CbUctvnH.js} +1 -1
  194. package/dist/client/assets/{use-secrets-B2tL3Eiw.js → use-secrets-CmRMI5lN.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-ChxrQq8Q.js → use-status-sounds-BIOEVUjf.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-D4efzYWD.js → use-view-mode-CrvIhsqc.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-BZBO6fTt.js → use-virtual-mcp-B306vlX1.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-CxWQiSdG.js +1 -0
  199. package/dist/client/assets/{useQueries-BUNJnzbM.js → useQueries-CcOVMhFe.js} +1 -1
  200. package/dist/client/assets/useSuspenseInfiniteQuery-BLEicZ3F.js +1 -0
  201. package/dist/client/assets/{variant-calendar-BRzmbMAw.js → variant-calendar-Bxkf8791.js} +1 -1
  202. package/dist/client/assets/{view-mode-toggle-FA5jZlaq.js → view-mode-toggle-ClOP_Zq-.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +3 -3
  205. package/dist/server/server.js +1 -1
  206. package/package.json +2 -1
  207. package/dist/client/assets/index-DkuCmq2i.js +0 -26
  208. package/dist/client/assets/page-seo-sheet-BchgKYRp.js +0 -1
  209. package/dist/client/assets/project-app-view-BNdGMa0O.js +0 -1
  210. package/dist/client/assets/record-editor-BWfKPgxQ.js +0 -1
  211. package/dist/client/assets/registry-Bj4YS8KM.js +0 -2
  212. package/dist/client/assets/store-registry-Dw6Kxeid.js +0 -2
  213. package/dist/client/assets/useInfiniteQuery-D1y00mLl.js +0 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-BiCq230f.js +0 -1
@@ -1 +1 @@
1
- import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-CpYfLdbh.js";import{E as Ee}from"./empty-state-Bttcdn67.js";import{u as et,a as Ae}from"./use-collections-BLUmcReO.js";import{u as ce}from"./use-mcp-client-DN-NMZV3.js";import{F as ne,a as tt,b as de,d as me}from"./form-Bbk-lY-7.js";import{I as ue}from"./input-CIRD_tZz.js";import{T as re}from"./textarea-B3tIZUed.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-DkuCmq2i.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-DyIO38tc.js";import{g as ut,M as xt,a as Ne}from"./types-COD2S7bi.js";import{A as pt,a as ft,b as ht}from"./alert-bxo3sfvI.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-BVI-5ZuA.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-CJMltTIZ.js";import{i as jt}from"./AlertCircle-CJRvjf9E.js";import{s as bt}from"./Stars02-CGjIjk8V.js";import{a as Nt}from"./Eye-evykl5te.js";import{i as vt}from"./Play-eP0tvaLl.js";import{i as St}from"./ChevronRight-bS8zu0mE.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-C9HI3IQT.js";import{a as Oe,u as Re}from"./use-connection-w2D8E4uB.js";import{a as It}from"./use-mcp-tools-HiR2aat0.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-DR2sJls0.js";import{f as Tt,h as Pt}from"./chat-context-B8Pf9_Ws.js";import{b as kt}from"./shell-layout-DRb4EqiB.js";import{M as Et}from"./monaco-editor-chBKXgor.js";import{n as At}from"./XCircle-C4Okg4wT.js";import"./auth-Duwx_iL2.js";import"./label-B97xU05r.js";import"./index-DiDBx4Jd.js";import"./sidebar-Bnk9mrkf.js";import"./LayoutLeft-eB33hZq-.js";import"./use-mobile-Dl3xzohk.js";import"./sheet-BRZ8PIrM.js";import"./X-DFZG0D7q.js";import"./ZoomOut-DZZylEjW.js";import"./Key01-BHQPeab7.js";import"./extract-connection-data-CdrxJbbw.js";import"./use-registry-connections-O8z8zBrP.js";import"./use-organization-settings-CQ99RcOM.js";import"./studio-tools-DgyOaysE.js";import"./Plus-DYuvLVJp.js";import"./index-CUkKcI0t.js";import"./index-B3I-Kacs.js";import"./popover-Dg4e80gp.js";import"./use-virtual-mcp-BZBO6fTt.js";import"./ChevronUp-CazSoL4d.js";import"./SearchMd-BqOCkx90.js";import"./Users03-zuYH9zmO.js";import"./use-create-virtual-mcp-Ct9eNtwu.js";import"./use-navigate-to-agent-Cv7a1gGO.js";import"./Tool01-CLVT6zPR.js";import"./SwitchHorizontal01-DqWROiIl.js";import"./Settings02-Ca71UgHw.js";import"./ArrowUpRight-C-ASyyy7.js";import"./ZapSquare-CSwYwLqC.js";import"./CheckCircle-DHlN5aNG.js";import"./ChevronDown-siikX1CB.js";import"./ChevronLeft-BMBu9Rmw.js";import"./DotsVertical--w5kUeSe.js";import"./Globe01-C5qUvOk3.js";import"./FilterLines-CbmfI3qe.js";import"./Star01-Cdx4KR4U.js";import"./Globe04-ayhcWvo6.js";import"./HardDrive-BZnTfRN9.js";import"./LinkExternal01-C9BK0yA_.js";import"./Monitor01-CuUeTTqr.js";import"./Sun-C4MaHaW6.js";import"./Palette-B-wglEVr.js";import"./Shield01-DY339kBm.js";import"./Stars01-DPz6mq_I.js";import"./Trash01-D3NdLyIt.js";import"./Upload01-CwAL7vx3.js";import"./User01-CPYMutV0.js";import"./Users01-Ih8cqcDu.js";import"./XClose-CsMYL6lC.js";import"./Zap-0-1HsH9l.js";import"./mcp-oauth-Djb0mwKI.js";import"./badge-BKEWn2TK.js";import"./hooks-BPl3QtCR.js";import"./decopilot-sse-pool-85Pin_5c.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-C9TDMEuy.js";import"./tab-id-BptcWVWa.js";import"./avatar-DK4P1R5g.js";import"./dialog-C2ETGOlj.js";import"./required-auth-layout-k-s2E1Qb.js";import"./use-org-sso-DqXQdm0q.js";import"./index-Dnojhzzx.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
1
+ import{c as y,j as t,B,i as X,o as Ge,s as se,E as Pe,r as T,C as ie,p as Qe,l as V,bf as Ye,u as Xe,F as G,t as Ze,e as ae,b1 as ke}from"./index-8IVTNNP6.js";import{E as Ee}from"./empty-state-DFBlj7Oy.js";import{u as et,a as Ae}from"./use-collections-83Ppa4v2.js";import{u as ce}from"./use-mcp-client-B3ayFpDg.js";import{F as ne,a as tt,b as de,d as me}from"./form-Sjgg7L1l.js";import{I as ue}from"./input-DEW4adst.js";import{T as re}from"./textarea-BOuQ8hAr.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-C81L8B-t.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-y3KUME6u.js";import{g as ut,M as xt,a as Ne}from"./types-jJ6t0Xlu.js";import{A as pt,a as ft,b as ht}from"./alert-8LZNYhbM.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-DveGPtTs.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-ColKf3vR.js";import{i as jt}from"./AlertCircle-CTPV9V8h.js";import{s as bt}from"./Stars02-DBKqj7gx.js";import{a as Nt}from"./Eye-C_Xoo8qw.js";import{i as vt}from"./Play-DJ7ZmWZL.js";import{i as St}from"./ChevronRight-qRgV12A9.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-1sv4-AMe.js";import{a as Oe,u as Re}from"./use-connection-DvDmo5TH.js";import{a as It}from"./use-mcp-tools-CjEY2qt2.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-DRg6drab.js";import{f as Tt,h as Pt}from"./chat-context-KTj5-AOt.js";import{b as kt}from"./shell-layout-f_7DH_O9.js";import{M as Et}from"./monaco-editor-BS4nF9vi.js";import{n as At}from"./XCircle-5-9If2le.js";import"./auth-fiRjWiax.js";import"./label-DiKcChLe.js";import"./index-DHIQ-5cy.js";import"./sidebar-CURGt0uI.js";import"./LayoutLeft-BGpgGNzH.js";import"./use-mobile-DtpAlBQq.js";import"./sheet-DotDwyu_.js";import"./X-kuCvYxfG.js";import"./ZoomOut-CXIGZvFC.js";import"./Key01-DdhtrhKo.js";import"./extract-connection-data-DvTYFZdB.js";import"./use-registry-connections-CbUctvnH.js";import"./use-organization-settings-DLeFVLYP.js";import"./studio-tools-Cs_A_fFf.js";import"./Plus-C1ojr5M2.js";import"./index-BHabOdpB.js";import"./index-DSt_2A-Z.js";import"./popover--OXcCKrd.js";import"./use-virtual-mcp-B306vlX1.js";import"./ChevronUp-M8W7UfeY.js";import"./SearchMd-DUageA20.js";import"./Users03-DZMol2tr.js";import"./use-create-virtual-mcp-CU-3ZPno.js";import"./use-navigate-to-agent-CPJoZFzF.js";import"./Tool01-D6XUAkke.js";import"./SwitchHorizontal01-Bpw0CC0C.js";import"./Settings02-DozM190y.js";import"./ArrowUpRight-C3z436np.js";import"./ZapSquare-Buvc-Lai.js";import"./CheckCircle-BcEM-U8z.js";import"./ChevronDown-h0x45P8o.js";import"./ChevronLeft-zdg7Q4jK.js";import"./DotsVertical-5_LyH0_q.js";import"./Globe01-sY1H67fR.js";import"./FilterLines-dJo6BCZ1.js";import"./Star01-DqNKux5E.js";import"./Globe04-DF2MygRC.js";import"./HardDrive-rN9rvzTi.js";import"./LinkExternal01-Qtas2L2N.js";import"./Monitor01-Dl_qoJKp.js";import"./Sun-CGcK7-RR.js";import"./Palette-tdsAZuuV.js";import"./Shield01-C9Bch-EG.js";import"./Stars01-r4i4yvEz.js";import"./Trash01-dG9X4BY7.js";import"./Upload01-o5Xeg721.js";import"./User01-CDDYeeuq.js";import"./Users01-BrrFQM4e.js";import"./XClose-BXP3vjGQ.js";import"./Zap-DD_vVHsY.js";import"./mcp-oauth-D4oN1GD0.js";import"./badge-DLF4nMeJ.js";import"./hooks-CufRYk_8.js";import"./decopilot-sse-pool-SxIYp1o0.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CRDtHen0.js";import"./tab-id-BptcWVWa.js";import"./avatar-BxyUCT4U.js";import"./dialog-De44o6RM.js";import"./required-auth-layout-Fr7G1_os.js";import"./use-org-sso-DAwQWdJa.js";import"./index-De8cOu3L.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(B,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(B,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const F=JSON.parse(D);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,F])=>{if((F.type==="object"||F.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((F.type==="number"||F.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Fe=()=>{p(null),g(null),I(null),$(null),w(null)},Be=j?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Be})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(B,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Fe,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(B,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(B,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(B,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Bt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(B,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Mn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Mn as default};
@@ -1 +1 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-CpYfLdbh.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-DpexHxwz.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-DqWROiIl.js";import{i as S}from"./ChevronUp-CazSoL4d.js";import{a as I,b as K,c as P,T as W}from"./tooltip-CJMltTIZ.js";import{V as q}from"./view-mode-toggle-FA5jZlaq.js";import{B as G}from"./badge-BKEWn2TK.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-8IVTNNP6.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-BA5vMFVR.js";import{a as L,n as O,d as R,i as A,c as F}from"./SwitchHorizontal01-Bpw0CC0C.js";import{i as S}from"./ChevronUp-M8W7UfeY.js";import{a as I,b as K,c as P,T as W}from"./tooltip-ColKf3vR.js";import{V as q}from"./view-mode-toggle-ClOP_Zq-.js";import{B as G}from"./badge-DLF4nMeJ.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-CpYfLdbh.js";import{i as C}from"./SearchMd-BqOCkx90.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-8IVTNNP6.js";import{i as C}from"./SearchMd-DUageA20.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-CpYfLdbh.js";import{B as g}from"./badge-BKEWn2TK.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-8IVTNNP6.js";import{B as g}from"./badge-DLF4nMeJ.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-CpYfLdbh.js";import{_ as m}from"./index-B3I-Kacs.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-C2ETGOlj.js";import{i as y}from"./SearchMd-BqOCkx90.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-8IVTNNP6.js";import{_ as m}from"./index-DSt_2A-Z.js";import{a as k,d as N,e as j,c as b,b as w}from"./dialog-De44o6RM.js";import{i as y}from"./SearchMd-DUageA20.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 E,r as q,l as ee,j as t,B,m as nt,d as ke,K as W,o as Ke,s as fe,n as qe,p as Ve,k as me,i as st,a as Be,u as _t,b as it,q as It,v as ot,Q as wt,E as Et,w as Xe,L as Tt}from"./index-CpYfLdbh.js";import{A as kt}from"./auth-entry-C20r1MAB.js";import{A as Y}from"./auth-split-layout-BAnr4RmX.js";import{O as Je}from"./organization-choice-BmyyAVCI.js";import{f as Ot}from"./tab-id-BptcWVWa.js";import{I as Ge}from"./input-CIRD_tZz.js";import{u as Re,W as rt,S as lt,g as Rt,C as Ut}from"./use-mcp-client-DN-NMZV3.js";import{i as at}from"./XCircle-C4Okg4wT.js";import{I as $t}from"./integration-icon-DR2sJls0.js";import{D as He,a as Pt,b as zt,c as Lt,d as At,e as Dt}from"./dialog-C2ETGOlj.js";import{T as Mt,a as Ft,b as Kt}from"./tooltip-CJMltTIZ.js";import{i as ct}from"./CheckCircle-DHlN5aNG.js";import{i as qt}from"./ZoomOut-DZZylEjW.js";import{g as Vt,c as Bt,e as Gt}from"./extract-connection-data-CdrxJbbw.js";import{F as pe,a as Qe,b as ge,c as he,d as xe,e as ye}from"./form-Bbk-lY-7.js";import{i as Ht}from"./ChevronUp-CazSoL4d.js";import{s as Qt,a as Wt}from"./Eye-evykl5te.js";import{i as Yt}from"./Settings02-Ca71UgHw.js";import{S as dt,a as ut,b as mt,c as ft,d as pt}from"./select-BVI-5ZuA.js";import{u as Zt}from"./useQueries-BUNJnzbM.js";import{a as Xt}from"./authenticate-and-persist-oauth-C_sfC4y1.js";import{i as gt}from"./ArrowUpRight-C-ASyyy7.js";import{s as ht}from"./User01-CPYMutV0.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-DK4P1R5g.js";import"./auth-Duwx_iL2.js";import"./agent-icon-DyIO38tc.js";import"./AlertCircle-CJRvjf9E.js";import"./Tool01-CLVT6zPR.js";import"./SwitchHorizontal01-DqWROiIl.js";import"./ZapSquare-CSwYwLqC.js";import"./Users03-zuYH9zmO.js";import"./ChevronDown-siikX1CB.js";import"./ChevronLeft-BMBu9Rmw.js";import"./ChevronRight-bS8zu0mE.js";import"./DotsVertical--w5kUeSe.js";import"./Stars02-CGjIjk8V.js";import"./Globe01-C5qUvOk3.js";import"./FilterLines-CbmfI3qe.js";import"./Star01-Cdx4KR4U.js";import"./Globe04-ayhcWvo6.js";import"./HardDrive-BZnTfRN9.js";import"./Key01-BHQPeab7.js";import"./LayoutLeft-eB33hZq-.js";import"./LinkExternal01-C9BK0yA_.js";import"./Monitor01-CuUeTTqr.js";import"./Sun-C4MaHaW6.js";import"./Palette-B-wglEVr.js";import"./Play-eP0tvaLl.js";import"./Plus-DYuvLVJp.js";import"./SearchMd-BqOCkx90.js";import"./Shield01-DY339kBm.js";import"./Stars01-DPz6mq_I.js";import"./Trash01-D3NdLyIt.js";import"./Upload01-CwAL7vx3.js";import"./Users01-Ih8cqcDu.js";import"./XClose-CsMYL6lC.js";import"./X-DFZG0D7q.js";import"./Zap-0-1HsH9l.js";import"./label-B97xU05r.js";import"./mcp-oauth-Djb0mwKI.js";const Jt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,en=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,tn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,nn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ee(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Jt.test(e),i=en.test(e),o=tn.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=r.hostname.split(".");return l.length<2||l.some(a=>!a||!nn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function De(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=q.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=j=>{if(!j)return;const y=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};y(),j.addEventListener("scroll",y,{passive:!0});const h=new ResizeObserver(y);h.observe(j);for(const m of Array.from(j.children))h.observe(m);return()=>{j.removeEventListener("scroll",y),h.disconnect()}},e[0]=l):l=e[0];const a=l;let d;e[1]!==o?(d=ee("relative",o),e[1]=o,e[2]=d):d=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:a,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=c?"opacity-0":"opacity-100";let u;e[6]!==p?(u=ee("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",p),e[6]=p,e[7]=u):u=e[7];let x;e[8]!==u?(x=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let g;return e[10]!==d||e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:d,children:[f,x]}),e[10]=d,e[11]=f,e[12]=x,e[13]=g):g=e[13],g}function sn(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const l=o?.properties?.__type?.const;typeof l=="string"&&l.length>0&&n.push({fieldKey:i,bindingType:l})}return n}function on(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function J(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function rn(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Me(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Me):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Me(n)):!1}function ln(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function an(s){return Me(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function cn(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=an(n);return i?[{key:e,label:ln(e),value:i}]:[]}):[]}function dn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=l=>l.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function un(s){return s.server?.icons?.[0]?.src??Vt(s.server?.repository)??null}function mn(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function fn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,l=r?n.get(r):void 0,a=r&&l?r:null,d=a?s.connectionReadiness?.[a]!==!1:!1,f=!!a&&d;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:mn(c,i.bindingType),icon:un(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:a||dn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:a,configurationState:l?.configuration_state??null})}return e}function pn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function gn(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function et(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[l,a]=q.useState(!1),[d,f]=q.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(F){console.error("Failed to copy text: ",F)}},e[6]=r,e[7]=p):p=e[7];const u=p;let x;e[8]!==l?(x=()=>{a(!l)},e[8]=l,e[9]=x):x=e[9];const g=x,j=l?"text":"password";let y;e[10]!==n?(y=ee("pr-20",n),e[10]=n,e[11]=y):y=e[11];let h;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(h=t.jsx(Ge,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=h):h=e[18];const m=l?"Hide password":"Show password";let b;e[19]!==l?(b=l?t.jsx(Yt,{size:16}):t.jsx(Qt,{size:16}),e[19]=l,e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==b||e[23]!==g?(C=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:m,children:b}),e[21]=m,e[22]=b,e[23]=g,e[24]=C):C=e[24];const v=!r,N=d?"Copied!":"Copy token";let _;e[25]!==d?(_=d?t.jsx(Ht,{size:16}):t.jsx(Wt,{size:16}),e[25]=d,e[26]=_):_=e[26];let T;e[27]!==u||e[28]!==N||e[29]!==_||e[30]!==v?(T=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:v,title:N,children:_}),e[27]=u,e[28]=N,e[29]=_,e[30]=v,e[31]=T):T=e[31];let k;e[32]!==T||e[33]!==C?(k=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,T]}),e[32]=T,e[33]=C,e[34]=k):k=e[34];let w;return e[35]!==k||e[36]!==h?(w=t.jsxs("div",{className:"relative",children:[h,k]}),e[35]=k,e[36]=h,e[37]=w):w=e[37],w}function We(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,l=nt();let a;e[0]!==n||e[1]!==i?(a=async y=>{const h={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=i,e[2]=a):a=e[2];let d;e[3]!==c||e[4]!==o||e[5]!==l?(d=async()=>{await l.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnections(o.id)}),c()},e[3]=c,e[4]=o,e[5]=l,e[6]=d):d=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==a||e[10]!==d||e[11]!==f?(p={mutationFn:a,onSuccess:d,onError:f},e[9]=a,e[10]=d,e[11]=f,e[12]=p):p=e[12];const u=ke(p);let x;e[13]!==u?(x=y=>u.mutate(y),e[13]=u,e[14]=x):x=e[14];const g=x;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==g?(j={save:g,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=g,e[18]=j):j=e[18],j}const hn=Ke({accountName:fe().min(1,"Account name is required"),appKey:fe().optional(),appToken:fe().optional()});function xn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=qe(hn),e[0]=l):l=e[0];const a=n.configurationState?.accountName||"",d=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==d||e[3]!==f?(p={resolver:l,defaultValues:{accountName:a,appKey:d,appToken:f}},e[1]=a,e[2]=d,e[3]=f,e[4]=p):p=e[4];const u=Ve(p);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(x=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=x):x=e[9];let g;e[10]!==n.configurationState||e[11]!==u?(g=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=g):g=e[12],q.useEffect(x,g);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:h,error:m}=We(j);let b,C;e[18]!==h||e[19]!==r?(C=()=>{r?.(h)},b=[h,r],e[18]=h,e[19]=r,e[20]=b,e[21]=C):(b=e[20],C=e[21]),q.useEffect(C,b);let v;if(e[22]!==u||e[23]!==y){let z;e[25]!==y?(z=async S=>{y(S)},e[25]=y,e[26]=z):z=e[26],v=u.handleSubmit(z),e[22]=u,e[23]=y,e[24]=v}else v=e[24];const N=v;let _;e[27]!==h?(_=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"Account Name"}),t.jsx(xe,{children:t.jsx(Ge,{placeholder:"Your VTEX account name",...S,disabled:h})}),t.jsx(ye,{})]})},e[27]=h,e[28]=_):_=e[28];let T;e[29]!==u.control||e[30]!==_?(T=t.jsx(pe,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=T):T=e[31];let k;e[32]!==h?(k=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"App Key (optional)"}),t.jsx(xe,{children:t.jsx(et,{placeholder:"VTEX app key",...S,disabled:h})}),t.jsx(ye,{})]})},e[32]=h,e[33]=k):k=e[33];let w;e[34]!==u.control||e[35]!==k?(w=t.jsx(pe,{control:u.control,name:"appKey",render:k}),e[34]=u.control,e[35]=k,e[36]=w):w=e[36];let F;e[37]!==h?(F=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"App Token (optional)"}),t.jsx(xe,{children:t.jsx(et,{placeholder:"VTEX app token",...S,disabled:h})}),t.jsx(ye,{})]})},e[37]=h,e[38]=F):F=e[38];let R;e[39]!==u.control||e[40]!==F?(R=t.jsx(pe,{control:u.control,name:"appToken",render:F}),e[39]=u.control,e[40]=F,e[41]=R):R=e[41];let I;e[42]!==u||e[43]!==T||e[44]!==w||e[45]!==R?(I=t.jsxs(Qe,{...u,children:[T,w,R]}),e[42]=u,e[43]=T,e[44]=w,e[45]=R,e[46]=I):I=e[46];let P;e[47]!==m?(P=m&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Failed to save configuration"}),e[47]=m,e[48]=P):P=e[48];let A;e[49]!==h||e[50]!==c?(A=t.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:h,children:"Cancel"}),e[49]=h,e[50]=c,e[51]=A):A=e[51];const D=h?"Saving...":"Save";let K;e[52]!==h||e[53]!==D?(K=t.jsx(B,{type:"submit",disabled:h,children:D}),e[52]=h,e[53]=D,e[54]=K):K=e[54];let M;e[55]!==A||e[56]!==K?(M=t.jsxs(He,{className:"pt-4",children:[A,K]}),e[55]=A,e[56]=K,e[57]=M):M=e[57];let U;return e[58]!==N||e[59]!==I||e[60]!==P||e[61]!==M?(U=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[I,P,M]}),e[58]=N,e[59]=I,e[60]=P,e[61]=M,e[62]=U):U=e[62],U}const yn=Ke({propertyId:fe().min(1,"Property is required")});function jn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:l,onIsPendingChange:a}=s;let d;e[0]!==i||e[1]!==r.id?(d=W.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),L=J(S);return gn(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==d||e[6]!==f?(p={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=p):p=e[7];const u=me(p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=qe(yn),e[8]=x):x=e[8];const g=n.configurationState?.propertyId||"";let j;e[9]!==g?(j={resolver:x,defaultValues:{propertyId:g}},e[9]=g,e[10]=j):j=e[10];const y=Ve(j);let h;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(h={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=h):h=e[15];const{save:m,isPending:b,error:C}=We(h);let v,N;e[16]!==b||e[17]!==a?(v=()=>{a?.(b)},N=[b,a],e[16]=b,e[17]=a,e[18]=v,e[19]=N):(v=e[18],N=e[19]),q.useEffect(v,N);let _;if(e[20]!==y||e[21]!==m){let S;e[23]!==m?(S=async L=>{m(L)},e[23]=m,e[24]=S):S=e[24],_=y.handleSubmit(S),e[20]=y,e[21]=m,e[22]=_}else _=e[22];const T=_;if(u.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading properties..."})}),e[25]=S):S=e[25],S}if(u.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let k;e[27]!==u.data?(k=u.data||[],e[27]=u.data,e[28]=k):k=e[28];const w=k;if(w.flatMap(Sn).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let R;e[30]!==b||e[31]!==w?(R=S=>{const{field:L}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:"Google Analytics Property"}),t.jsx(xe,{children:t.jsxs(dt,{value:L.value,onValueChange:L.onChange,disabled:b,children:[t.jsx(ut,{children:t.jsx(mt,{placeholder:"Select a property"})}),t.jsx(ft,{children:w.map(bn)})]})}),t.jsx(ye,{})]})},e[30]=b,e[31]=w,e[32]=R):R=e[32];let I;e[33]!==y.control||e[34]!==R?(I=t.jsx(pe,{control:y.control,name:"propertyId",render:R}),e[33]=y.control,e[34]=R,e[35]=I):I=e[35];let P;e[36]!==y||e[37]!==I?(P=t.jsx(Qe,{...y,children:I}),e[36]=y,e[37]=I,e[38]=P):P=e[38];let A;e[39]!==C?(A=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[39]=C,e[40]=A):A=e[40];let D;e[41]!==b||e[42]!==l?(D=t.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:b,children:"Cancel"}),e[41]=b,e[42]=l,e[43]=D):D=e[43];const K=b?"Saving...":"Save";let M;e[44]!==b||e[45]!==K?(M=t.jsx(B,{type:"submit",disabled:b,children:K}),e[44]=b,e[45]=K,e[46]=M):M=e[46];let U;e[47]!==D||e[48]!==M?(U=t.jsxs(He,{className:"pt-4",children:[D,M]}),e[47]=D,e[48]=M,e[49]=U):U=e[49];let z;return e[50]!==T||e[51]!==P||e[52]!==A||e[53]!==U?(z=t.jsxs("form",{onSubmit:T,className:"space-y-4",children:[P,A,U]}),e[50]=T,e[51]=P,e[52]=A,e[53]=U,e[54]=z):z=e[54],z}function bn(s){return t.jsx("div",{children:s.options.map(Cn)},s.account)}function Cn(s){return t.jsx(pt,{value:s.value,children:s.label},s.value)}function Sn(s){return s.options}const vn=Ke({siteUrl:fe().min(1,"Site is required")});function Nn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:l,onDone:a,onIsPendingChange:d}=s;let f;e[0]!==i||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return J(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let u;e[5]!==f||e[6]!==p?(u={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=u):u=e[7];const x=me(u);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=qe(vn),e[8]=g):g=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:g,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const h=Ve(y);let m;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(m={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=m):m=e[15];const{save:b,isPending:C,error:v}=We(m);let N,_;e[16]!==C||e[17]!==d?(N=()=>{d?.(C)},_=[C,d],e[16]=C,e[17]=d,e[18]=N,e[19]=_):(N=e[18],_=e[19]),q.useEffect(N,_);let T;if(e[20]!==h||e[21]!==b){let S;e[23]!==b?(S=async L=>{b(L)},e[23]=b,e[24]=S):S=e[24],T=h.handleSubmit(S),e[20]=h,e[21]=b,e[22]=T}else T=e[22];const k=T;if(x.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sites..."})}),e[25]=S):S=e[25],S}if(x.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let w,F;if(e[27]!==n.configurationState?.siteUrl||e[28]!==l||e[29]!==h||e[30]!==x.data){F=Symbol.for("react.early_return_sentinel");e:{if(w=x.data||[],w.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],F=L;break e}const S=n.configurationState?.siteUrl;if(S&&h.getValues("siteUrl")!==S)h.setValue("siteUrl",S);else if(!S&&!h.getValues("siteUrl")){const L=pn(l,w);L&&h.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=l,e[29]=h,e[30]=x.data,e[31]=w,e[32]=F}else w=e[31],F=e[32];if(F!==Symbol.for("react.early_return_sentinel"))return F;let R;e[34]!==C||e[35]!==w?(R=S=>{const{field:L}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:"Verified Site"}),t.jsx(xe,{children:t.jsxs(dt,{value:L.value,onValueChange:L.onChange,disabled:C,children:[t.jsx(ut,{children:t.jsx(mt,{placeholder:"Select a site"})}),t.jsx(ft,{children:w.map(_n)})]})}),t.jsx(ye,{})]})},e[34]=C,e[35]=w,e[36]=R):R=e[36];let I;e[37]!==h.control||e[38]!==R?(I=t.jsx(pe,{control:h.control,name:"siteUrl",render:R}),e[37]=h.control,e[38]=R,e[39]=I):I=e[39];let P;e[40]!==h||e[41]!==I?(P=t.jsx(Qe,{...h,children:I}),e[40]=h,e[41]=I,e[42]=P):P=e[42];let A;e[43]!==v?(A=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=A):A=e[44];let D;e[45]!==C||e[46]!==a?(D=t.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:C,children:"Cancel"}),e[45]=C,e[46]=a,e[47]=D):D=e[47];const K=C?"Saving...":"Save";let M;e[48]!==C||e[49]!==K?(M=t.jsx(B,{type:"submit",disabled:C,children:K}),e[48]=C,e[49]=K,e[50]=M):M=e[50];let U;e[51]!==D||e[52]!==M?(U=t.jsxs(He,{className:"pt-4",children:[D,M]}),e[51]=D,e[52]=M,e[53]=U):U=e[53];let z;return e[54]!==k||e[55]!==P||e[56]!==A||e[57]!==U?(z=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[P,A,U]}),e[54]=k,e[55]=P,e[56]=A,e[57]=U,e[58]=z):z=e[58],z}function _n(s){return t.jsx(pt,{value:s.siteUrl,children:s.siteUrl},s.siteUrl)}const In={vtex:xn,"google-analytics":jn,"google-search-console":Nn};function wn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function Fe(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ct,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function En(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:l,siteUrl:a}=s,d=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=cn(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const p=f;let u;e[2]!==n.icon||e[3]!==n.title?(u=t.jsx($t,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let g;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(g=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(ct,{size:16})," Connected"]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(st,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=g):g=e[12];let j;e[13]!==u||e[14]!==x||e[15]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g]}),e[13]=u,e[14]=x,e[15]=g,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(Fe,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let h;e[19]!==n.headline?(h=n.headline&&t.jsx(Fe,{children:n.headline}),e[19]=n.headline,e[20]=h):h=e[20];let m;e[21]!==n.bullets?(m=n.bullets.map(Tn),e[21]=n.bullets,e[22]=m):m=e[22];let b;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(b=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=b):b=e[26];let C;e[27]!==y||e[28]!==h||e[29]!==m||e[30]!==b?(C=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,h,m,b]}),e[27]=y,e[28]=h,e[29]=m,e[30]=b,e[31]=C):C=e[31];let v;e[32]!==n||e[33]!==d||e[34]!==r||e[35]!==p||e[36]!==l||e[37]!==a?(v=n.satisfied&&d&&t.jsx(Rn,{card:n,org:r,selfClient:l,connectionId:d,savedConfigEntries:p,contextSiteUrl:a}),e[32]=n,e[33]=d,e[34]=r,e[35]=p,e[36]=l,e[37]=a,e[38]=v):v=e[38];let N;return e[39]!==C||e[40]!==v||e[41]!==j?(N=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,C,v]}),e[39]=C,e[40]=v,e[41]=j,e[42]=N):N=e[42],N}function Tn(s){return t.jsx(Fe,{children:s},s)}function kn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function On(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function Rn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:l}=s;let a;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(a={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=a):a=e[3];const d=Re(a),[f,p]=q.useState(!1),[u,x]=q.useState(!1),g=In[n.bindingType];let j;e[4]!==u?(j=w=>{!w&&u||p(w)},e[4]=u,e[5]=j):j=e[5];const y=j;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=h):h=e[6];let m;e[7]!==r.length?(m=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=m):m=e[8];let b;e[9]!==m?(b=t.jsxs("div",{className:"grid gap-1",children:[h,m]}),e[9]=m,e[10]=b):b=e[10];let C;e[11]!==g||e[12]!==n.title||e[13]!==r.length?(C=r.length>0?t.jsxs(Mt,{children:[t.jsx(Ft,{asChild:!0,children:t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>p(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!g,children:t.jsx(qt,{size:14})})}),t.jsx(Kt,{children:"Edit configuration"})]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!0),disabled:!g,children:"Configure"}),e[11]=g,e[12]=n.title,e[13]=r.length,e[14]=C):C=e[14];let v;e[15]!==b||e[16]!==C?(v=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b,C]}),e[15]=b,e[16]=C,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(Un)}),e[18]=r,e[19]=N):N=e[19];let _;e[20]!==v||e[21]!==N?(_=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[v,N]}),e[20]=v,e[21]=N,e[22]=_):_=e[22];let T;e[23]!==g||e[24]!==n||e[25]!==d||e[26]!==c||e[27]!==l||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(T=g?t.jsx(Pt,{open:f,onOpenChange:y,children:t.jsxs(zt,{className:"sm:max-w-lg",children:[t.jsxs(Lt,{children:[t.jsxs(At,{children:["Configure ",n.title]}),t.jsx(Dt,{children:"Update the values this companion uses for Commerce Discovery."})]}),t.jsx(g,{card:n,connectionId:c,companionClient:d,selfClient:o,org:i,contextSiteUrl:l,onDone:()=>p(!1),onIsPendingChange:x})]})}):t.jsx(On,{title:n.title}),e[23]=g,e[24]=n,e[25]=d,e[26]=c,e[27]=l,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=T):T=e[32];let k;return e[33]!==T||e[34]!==_?(k=t.jsxs(t.Fragment,{children:[_,T]}),e[33]=T,e[34]=_,e[35]=k):k=e[35],k}function Un(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:kn(s.key,s.value)})]},s.key)}const Ye={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 $n(s){const e=E.c(39),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=Re(c);let l;e[4]!==o||e[5]!==i.id?(l=W.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=l):l=e[6];let a;e[7]!==r?(a=async()=>{const O=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(O)},e[7]=r,e[8]=a):a=e[8];let d;e[9]!==l||e[10]!==a?(d={queryKey:l,queryFn:a},e[9]=l,e[10]=a,e[11]=d):d=e[11];const f=me(d),p=sn(f.data?.stateSchema??{properties:{}}),u=p.map(Kn),x=p.map(Fn).filter(Mn),g=p.filter(Dn).map(An),j=[...x,...g].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=W.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let h;e[15]!==o||e[16]!==n?(h=async()=>{const O=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return J(O)},e[15]=o,e[16]=n,e[17]=h):h=e[17];let m;e[18]!==y||e[19]!==h?(m={queryKey:y,queryFn:h},e[18]=y,e[19]=h,e[20]=m):m=e[20];const b=me(m),C=b.data?.item?.configuration_state??null;let v;e[21]!==C?(v=O=>C?.[O.fieldKey]?.value,e[21]=C,e[22]=v):v=e[22];const N=p.map(v).filter(Ln),_=me({queryKey:W.commerceDiscoveryCompanionConnections(i.id),enabled:p.length>0,queryFn:async()=>{const O=[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}];N.length>0&&O.push({field:["id"],operator:"in",value:N});const G=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:O},limit:1e3}});return J(G)}}),T=_.data?.items??[],k=new Set(N),w=T.filter(O=>k.has(O.id)),F=w.filter(zn);let R;e[23]!==i.id||e[24]!==i.slug?(R=O=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(i.id,O.id),queryFn:async()=>{const G=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(O.id)}/oauth-token/status`,{credentials:"include"});return G.ok?{hasToken:(await G.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=R):R=e[25];const I=Zt({queries:F.map(R)});let P;e[26]!==I?(P=(O,G)=>[O.id,I[G]?.data?.hasToken===!0],e[26]=I,e[27]=P):P=e[27];const A=new Map(F.map(P)),D={};for(const O of w)D[O.id]=!O.oauth_config||!!O.connection_token||A.get(O.id)===!0;const K=me({queryKey:W.commerceDiscoveryCompanionRegistry(i.id,j),enabled:p.length>0,queryFn:async()=>{const O=on(x,g),G=await Bt(rt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...O?{where:O}:{},limit:1e3});return J(G)}}),M={},U={};for(const O of K.data?.items??[])M[O.id]=O,O.server?.name&&(U[O.server.name]=O);const z=fn({requirements:p,itemsById:M,itemsByName:U,connections:T,connectionReadiness:D,configurationState:C,curated:Ye});let S;e[28]!==b||e[29]!==_||e[30]!==I||e[31]!==K||e[32]!==p||e[33]!==f.isPending?(S=f.isPending||b.isPending||p.length>0&&(_.isPending||K.isPending||I.some(Pn)),e[28]=b,e[29]=_,e[30]=I,e[31]=K,e[32]=p,e[33]=f.isPending,e[34]=S):S=e[34];const L=S,V=f.error??b.error??_.error??K.error??null;let Z;return e[35]!==z||e[36]!==V||e[37]!==L?(Z={cards:z,isLoading:L,error:V},e[35]=z,e[36]=V,e[37]=L,e[38]=Z):Z=e[38],Z}function Pn(s){return s.isPending}function zn(s){return s.oauth_config&&!s.connection_token}function Ln(s){return typeof s=="string"&&s.length>0}function An(s){return s.bindingType}function Dn(s){return!Ye[s.bindingType]}function Mn(s){return!!s}function Fn(s){return Ye[s.bindingType]?.registryAppId}function Kn(s){return s.bindingType}function qn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=nt(),[c,r]=q.useState(null),[l,a]=q.useState(null),d=async(p,u)=>{const x=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:u}});return J(x)};async function f(p){r(p.fieldKey),a(null);try{let u=p.candidateConnectionId;if(!u){const m=Gt(p.registryItem,e.id,n,{remoteIndex:0}),b=m.connection_type==="STDIO",C=!!m.connection_url,v=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!C&&!v){a(`${p.title} cannot be connected: no connection method available`);return}const N=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});u=J(N).item.id}const x=u,g=await Xt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>d(x,{connection_token:m}).then(()=>{})});if(!g.ok){a(`Couldn't sign in to ${p.title}: ${g.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=J(j).item?.configuration_state??null,h=rn(y,p.fieldKey,p.bindingType,x);await d(i,{configuration_state:h}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnections(e.id)})}catch(u){a(u instanceof Error?u.message:String(u))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:l}}const Vn="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Bn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Gn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Hn)}),s[0]=e):e=s[0],e}function Hn(s){return t.jsx(wn,{},s)}function Qn(s){const e=E.c(24),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=Be.useSession(),r=c?.user?.id??"";let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const a=Re(l);let d;e[3]!==i||e[4]!==n||e[5]!==a?(d={selfClient:a,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=a,e[6]=d):d=e[6];const{cards:f,isLoading:p,error:u}=$n(d);let x;e[7]!==i||e[8]!==n||e[9]!==a||e[10]!==r?(x={selfClient:a,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=a,e[10]=r,e[11]=x):x=e[11];const{connect:g,connectingFieldKey:j,error:y}=qn(x);if(!p&&!u&&f.length===0)return null;const h=j!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Bn,{}),e[12]=m):m=e[12];let b;return e[13]!==h||e[14]!==f||e[15]!==g||e[16]!==y||e[17]!==j||e[18]!==u||e[19]!==p||e[20]!==n||e[21]!==a||e[22]!==o?(b=t.jsxs("div",{className:Vn,children:[m,u?t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?t.jsx(Gn,{}):t.jsx(De,{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:t.jsxs("div",{className:"grid gap-4",children:[y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),f.map(C=>t.jsx(En,{card:C,connecting:j===C.fieldKey,disabled:h&&j!==C.fieldKey,org:n,selfClient:a,siteUrl:o,onConnect:()=>{g(C)}},C.fieldKey))]})})]}),e[13]=h,e[14]=f,e[15]=g,e[16]=y,e[17]=j,e[18]=u,e[19]=p,e[20]=n,e[21]=a,e[22]=o,e[23]=b):b=e[23],b}const Ze="https://decocms-tanstack.deco-cx.workers.dev/agendar",Wn="Rather have us walk you through it?",Yn="Book a 20-minute call and we'll run the diagnostic with you, live.";function xt({siteUrl:s,email:e}){const n=new URL(Ze);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function Zn(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?Ze:n,r=i===void 0?"lg":i;let l;e[0]!==o?(l=ee("w-full",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(gt,{size:16}),e[2]=a):a=e[2];let d;e[3]!==c?(d=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",a]}),e[3]=c,e[4]=d):d=e[4];let f;return e[5]!==r||e[6]!==l||e[7]!==d?(f=t.jsx(B,{asChild:!0,variant:"outline",size:r,className:l,children:d}),e[5]=r,e[6]=l,e[7]=d,e[8]=f):f=e[8],f}function tt(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Xn(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(ht,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(tt,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function yt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Xn,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Wn}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Yn})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(Zn,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function Jn(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?Ze:i;let c;e[0]!==n?(c=ee("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(ht,{size:20})}),e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),a=t.jsx(gt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let d;return e[5]!==o||e[6]!==c?(d=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,l,a]}),e[5]=o,e[6]=c,e[7]=d):d=e[7],d}function jt(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let l;e[3]!==i?(l=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n?(a=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,l,a]}),e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function bt(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,l=i===void 0?14:i;let a;e[0]!==o?(a=ee("inline-flex items-center gap-2",o),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==c?(d=ee("shrink-0 animate-spin",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==l||e[5]!==d?(f=t.jsx(st,{size:l,className:d}),e[4]=l,e[5]=d,e[6]=f):f=e[6];let p;e[7]!==r?(p=ee("text-sm",r),e[7]=r,e[8]=p):p=e[8];let u;e[9]!==n||e[10]!==p?(u=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==a||e[13]!==f||e[14]!==u?(x=t.jsxs("span",{className:a,children:[f,u]}),e[12]=a,e[13]=f,e[14]=u,e[15]=x):x=e[15],x}const es={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Ct(s){return es[s]}function St(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(Y,{children:t.jsx(Ue,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function Ue(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=Ct(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:t.jsx(bt,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function ts(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(bt,{label:Ct("button")}),s[0]=e):e=s[0],e}function Ci(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ss,{}),s[0]=e):e=s[0],e}const vt=q.createContext(null),Nt=()=>q.useContext(vt);function ns(s){if(!s)return null;const e=Ee(s);return e.ok?new URL(e.value).hostname:null}function ss(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=_t(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=ns(o),s[1]=o,s[2]=c):c=s[2];const r=c;let l;s[3]!==i||s[4]!==o?(l=t.jsx(is,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=l):l=s[5];let a;return s[6]!==r||s[7]!==l?(a=t.jsx(vt.Provider,{value:r,children:l}),s[6]=r,s[7]=l,s[8]=a):a=s[8],a}function is(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=Be.useSession(),r=Nt();if(c){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(St,{variant:"route"}),e[0]=a):a=e[0],a}if(!o){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r?t.jsx(jt,{host:r}):void 0,e[1]=r,e[2]=d):d=e[2];let f;return e[3]!==d?(f=t.jsx(Y,{children:t.jsx(kt,{callbackUrl:a,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:d})}),e[3]=d,e[4]=f):f=e[4],f}let l;return e[5]!==n||e[6]!==i?(l=t.jsx(os,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function os(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=it(),c=It(),[r,l]=q.useState(null),[a,d]=q.useState(null),f=c.data?.map(ls)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:rs,retry:!1,onSuccess:m=>{d(m)}},e[0]=p):p=e[0];const u=ke(p);if(c.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(St,{variant:"route"}),e[1]=m):m=e[1],m}if(c.error){let m;return e[2]!==c?(m=t.jsx(Te,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=m):m=e[3],m}const x=n?f.find(m=>m.slug===n):null;if(x){let m;return e[4]!==x||e[5]!==i?(m=t.jsx(we,{org:x,initialSiteUrl:i}),e[4]=x,e[5]=i,e[6]=m):m=e[6],m}if(n){let m;return e[7]!==c?(m=t.jsx(Te,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=t.jsx(we,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=t.jsx(we,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(te,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>l(v),e[16]=b):b=e[16];let C;return e[17]!==f?(C=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx(De,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Je,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=C):C=e[18],C}if(!a){let m;e[19]!==u?(m=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=m):m=e[20];let b;return e[21]!==u||e[22]!==m?(b=t.jsx(as,{mutation:u,onRetry:m}),e[21]=u,e[22]=m,e[23]=b):b=e[23],b}const g=a;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let m;return e[24]!==g.organization||e[25]!==i?(m=t.jsx(we,{org:g.organization,initialSiteUrl:i}),e[24]=g.organization,e[25]=i,e[26]=m):m=e[26],m}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(te,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=m):m=e[27];const b=g.domain??void 0;let C;e[28]!==o||e[29]!==i?(C=(N,_)=>{ot(),l({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=C):C=e[30];let v;return e[31]!==g.organizations||e[32]!==b||e[33]!==C?(v=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx(De,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Je,{organizations:g.organizations,domain:b,onJoined:C})})]})}),e[31]=g.organizations,e[32]=b,e[33]=C,e[34]=v):v=e[34],v}const j=g?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{d(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let h;return e[37]!==j||e[38]!==y?(h=t.jsx(Te,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=h):h=e[39],h}async function rs(){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&&ot(),e}function ls(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function as(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=q.useRef(!1);let c;e[0]!==n?(c=d=>{!d||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let d;return e[2]!==i?(d=t.jsx(Te,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=d):d=e[3],d}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ue,{variant:"workspace"}),e[4]=l):l=e[4];let a;return e[5]!==r?(a=t.jsx(Y,{children:t.jsx("div",{ref:r,children:l})}),e[5]=r,e[6]=a):a=e[6],a}function te(s){const e=E.c(8),{title:n,description:i}=s,o=Nt();let c;e[0]!==o?(c=o?t.jsx(jt,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let l;return e[5]!==c||e[6]!==r?(l=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=l):l=e[7],l}function Te(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(te,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let l;e[3]!==o||e[4]!==c?(l=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=l):l=e[5];let a;return e[6]!==r||e[7]!==l?(a=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[r,l]})}),e[6]=r,e[7]=l,e[8]=a):a=e[8],a}function cs(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function Ie(s){const e=s;if(e.isError)throw new Error(cs(e));return e.structuredContent??s}function we(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Be.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=xt({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const l=r;let a;e[3]!==l?(a=t.jsx(yt,{href:l}),e[3]=l,e[4]=a):a=e[4];const d=a;let f;return e[5]!==i||e[6]!==d||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(wt,{children:p=>{const{reset:u}=p;return t.jsx(Et,{fallback:x=>{const{error:g,resetError:j}=x;return t.jsx(Y,{visual:d,children:t.jsx(ds,{orgName:n.name,message:g instanceof Error?g.message:"We could not check Commerce Discovery setup.",onRetry:()=>{u(),j()}})})},children:t.jsx(q.Suspense,{fallback:t.jsx(Y,{visual:d,children:t.jsx(Ue,{variant:"connect"})}),children:t.jsx(us,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=d,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function ds(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(te,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let l;e[2]!==i?(l=t.jsx(Oe,{message:i}),e[2]=i,e[3]=l):l=e[3];let a;e[4]!==o?(a=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==r||e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"grid gap-10",children:[r,l,a]}),e[6]=r,e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function us(s){const e=E.c(104),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=it();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const l=Re(r),[a,d]=q.useState(i??""),[f,p]=q.useState(null),[u,x]=q.useState(null),g=q.useRef(!1),j=rt.COMMERCE_DISCOVERY(n.id),y=Rt(n.id),h=W.commerceDiscoveryConnection(n.id,j);let m;e[3]!==j||e[4]!==l?(m=async()=>{const $=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Ie($)},e[3]=j,e[4]=l,e[5]=m):m=e[5];let b;e[6]!==h||e[7]!==m?(b={queryKey:h,queryFn:m,retry:!1},e[6]=h,e[7]=m,e[8]=b):b=e[8];const C=Xe(b),v=W.commerceDiscoveryVirtualMcp(n.id,y);let N;e[9]!==l||e[10]!==y?(N=async()=>{const $=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return Ie($)},e[9]=l,e[10]=y,e[11]=N):N=e[11];let _;e[12]!==v||e[13]!==N?(_={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=_):_=e[14];const T=Xe(_);let k;e[15]!==l?(k=async $=>{const H=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:$}});return Ie(H)},e[15]=l,e[16]=k):k=e[16];let w;e[17]!==C||e[18]!==T?(w=$=>{p($),x(null),C.refetch(),T.refetch()},e[17]=C,e[18]=T,e[19]=w):w=e[19];let F;e[20]===Symbol.for("react.memo_cache_sentinel")?(F=$=>{x($ instanceof Error?$.message:"Commerce Discovery setup failed.")},e[20]=F):F=e[20];let R;e[21]!==k||e[22]!==w?(R={mutationFn:k,retry:!1,onSuccess:w,onError:F},e[21]=k,e[22]=w,e[23]=R):R=e[23];const I=ke(R);let P;e[24]!==l?(P={mutationFn:async $=>{const H=await l.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:$}});return Ie(H)},retry:!1},e[24]=l,e[25]=P):P=e[25];const A=ke(P),D=!!C.data.item&&!!T.data.item,K=C.data.item,M=typeof K?.metadata?.siteUrl=="string"?K.metadata.siteUrl:void 0,U=i||a||M||"";let z;e[26]!==U||e[27]!==o?(z=xt({siteUrl:U,email:o}),e[26]=U,e[27]=o,e[28]=z):z=e[28];const S=z;let L;e[29]!==S?(L=t.jsx(yt,{href:S}),e[29]=S,e[30]=L):L=e[30];const V=L;let Z;e[31]!==I?(Z=$=>{const H=Ee($);if(!H.ok){x(H.error);return}x(null),I.mutate(H.value)},e[31]=I,e[32]=Z):Z=e[32];const O=Z;let G;e[33]!==i||e[34]!==O||e[35]!==D?(G=$=>{!$||g.current||D||!i||(g.current=!0,O(i))},e[33]=i,e[34]=O,e[35]=D,e[36]=G):G=e[36];const je=G;let be;e[37]!==O||e[38]!==a?(be=$=>{$.preventDefault(),O(a)},e[37]=O,e[38]=a,e[39]=be):be=e[39];const X=be;let Ce;e[40]!==j||e[41]!==f?.reportApp||e[42]!==y?(Ce=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:Ut},e[40]=j,e[41]=f?.reportApp,e[42]=y,e[43]=Ce):Ce=e[43];const Q=Ce;let Se;e[44]!==U||e[45]!==c||e[46]!==n.slug||e[47]!==Q.connectionId||e[48]!==Q.toolName||e[49]!==Q.virtualMcpId||e[50]!==A?(Se=()=>{const $=Ee(U);$.ok&&A.mutate($.value),localStorage.setItem(Tt.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Q.virtualMcpId,main:Ot(Q.connectionId,Q.toolName),chat:0}})},e[44]=U,e[45]=c,e[46]=n.slug,e[47]=Q.connectionId,e[48]=Q.toolName,e[49]=Q.virtualMcpId,e[50]=A,e[51]=Se):Se=e[51];const $e=Se;if(D){let $;return e[52]!==S||e[53]!==V||e[54]!==U||e[55]!==$e||e[56]!==n||e[57]!==Q?($=t.jsx(ms,{org:n,reportApp:Q,onOpenReport:$e,meetingUrl:S,meetingVisual:V,siteUrl:U}),e[52]=S,e[53]=V,e[54]=U,e[55]=$e,e[56]=n,e[57]=Q,e[58]=$):$=e[58],$}if(i){let $;e[59]!==i?($=Ee(i),e[59]=i,e[60]=$):$=e[60];const H=$;if(!H.ok){const Le=`Commerce setup will continue for ${n.name}.`;let ae;e[61]!==Le?(ae=t.jsx(te,{title:"Commerce diagnostics",description:Le}),e[61]=Le,e[62]=ae):ae=e[62];let ce;e[63]!==H.error?(ce=t.jsx(Oe,{message:H.error}),e[63]=H.error,e[64]=ce):ce=e[64];let de;e[65]!==X||e[66]!==u||e[67]!==I.isPending||e[68]!==a?(de=t.jsx(Ae,{siteUrl:a,error:u,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X}),e[65]=X,e[66]=u,e[67]=I.isPending,e[68]=a,e[69]=de):de=e[69];let ue;e[70]!==ae||e[71]!==ce||e[72]!==de?(ue=t.jsxs("div",{className:"grid gap-10",children:[ae,ce,de]}),e[70]=ae,e[71]=ce,e[72]=de,e[73]=ue):ue=e[73];let _e;return e[74]!==V||e[75]!==ue?(_e=t.jsx(Y,{visual:V,children:ue}),e[74]=V,e[75]=ue,e[76]=_e):_e=e[76],_e}const ze=`Commerce Discovery is being prepared for ${H.value}.`;let oe;e[77]!==ze?(oe=t.jsx(te,{title:"Commerce diagnostics",description:ze}),e[77]=ze,e[78]=oe):oe=e[78];let re;e[79]!==X||e[80]!==u||e[81]!==I||e[82]!==a?(re=u?t.jsxs(t.Fragment,{children:[t.jsx(Oe,{message:u}),t.jsx(Ae,{siteUrl:a,error:null,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X})]}):t.jsx(Ue,{variant:"setup"}),e[79]=X,e[80]=u,e[81]=I,e[82]=a,e[83]=re):re=e[83];let le;e[84]!==oe||e[85]!==re||e[86]!==je?(le=t.jsxs("div",{ref:je,className:"grid gap-10",children:[oe,re]}),e[84]=oe,e[85]=re,e[86]=je,e[87]=le):le=e[87];let Ne;return e[88]!==V||e[89]!==le?(Ne=t.jsx(Y,{visual:V,children:le}),e[88]=V,e[89]=le,e[90]=Ne):Ne=e[90],Ne}const Pe=`Commerce setup will continue for ${n.name}.`;let ne;e[91]!==Pe?(ne=t.jsx(te,{title:"Commerce diagnostics",description:Pe}),e[91]=Pe,e[92]=ne):ne=e[92];let se;e[93]!==X||e[94]!==u||e[95]!==I.isPending||e[96]!==a?(se=t.jsx(Ae,{siteUrl:a,error:u,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X}),e[93]=X,e[94]=u,e[95]=I.isPending,e[96]=a,e[97]=se):se=e[97];let ie;e[98]!==ne||e[99]!==se?(ie=t.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[98]=ne,e[99]=se,e[100]=ie):ie=e[100];let ve;return e[101]!==V||e[102]!==ie?(ve=t.jsx(Y,{visual:V,children:ie}),e[101]=V,e[102]=ie,e[103]=ve):ve=e[103],ve}function Ae(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=l):l=e[0];let a;e[1]!==c?(a=y=>c(y.target.value),e[1]=c,e[2]=a):a=e[2];const d=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==a||e[6]!==d?(f=t.jsx(Ge,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:a,placeholder:"https://example.com","aria-invalid":d,disabled:o}),e[3]=o,e[4]=n,e[5]=a,e[6]=d,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(Oe,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let u;e[10]!==f||e[11]!==p?(u=t.jsxs("div",{className:"grid gap-2",children:[l,f,p]}),e[10]=f,e[11]=p,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?t.jsx(ts,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(at,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==x?(g=t.jsx(B,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==r||e[19]!==u||e[20]!==g?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,g]}),e[18]=r,e[19]=u,e[20]=g,e[21]=j):j=e[21],j}function ms(s){const e=E.c(20),{org:n,reportApp:i,onOpenReport:o,meetingUrl:c,meetingVisual:r,siteUrl:l}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(te,{}),e[0]=a):a=e[0];let d;e[1]!==n||e[2]!==i.connectionId||e[3]!==l?(d=t.jsx(Qn,{org:n,cdConnectionId:i.connectionId,siteUrl:l}),e[1]=n,e[2]=i.connectionId,e[3]=l,e[4]=d):d=e[4];let f;e[5]!==c?(f=t.jsx(Jn,{className:"md:hidden",href:c}),e[5]=c,e[6]=f):f=e[6];const p=!i.virtualMcpId;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(at,{size:18}),e[7]=u):u=e[7];let x;e[8]!==o||e[9]!==p?(x=t.jsxs(B,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",u]}),e[8]=o,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let j;e[14]!==d||e[15]!==g?(j=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[a,d,g]}),e[14]=d,e[15]=g,e[16]=j):j=e[16];let y;return e[17]!==r||e[18]!==j?(y=t.jsx(Y,{align:"fill",visual:r,children:j}),e[17]=r,e[18]=j,e[19]=y):y=e[19],y}function Oe(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{Ci as default};
1
+ import{c as E,r as q,l as ee,j as t,B,m as nt,d as ke,K as W,o as Ke,s as fe,n as qe,p as Ve,k as me,i as st,a as Be,u as _t,b as it,q as It,v as ot,Q as wt,E as Et,w as Xe,L as Tt}from"./index-8IVTNNP6.js";import{A as kt}from"./auth-entry-zDnCGVnz.js";import{A as Y}from"./auth-split-layout-8yYHO1kd.js";import{O as Je}from"./organization-choice-jnC4WCjk.js";import{f as Ot}from"./tab-id-BptcWVWa.js";import{I as Ge}from"./input-DEW4adst.js";import{u as Re,W as rt,S as lt,g as Rt,C as Ut}from"./use-mcp-client-B3ayFpDg.js";import{i as at}from"./XCircle-5-9If2le.js";import{I as $t}from"./integration-icon-DRg6drab.js";import{D as He,a as Pt,b as zt,c as Lt,d as At,e as Dt}from"./dialog-De44o6RM.js";import{T as Mt,a as Ft,b as Kt}from"./tooltip-ColKf3vR.js";import{i as ct}from"./CheckCircle-BcEM-U8z.js";import{i as qt}from"./ZoomOut-CXIGZvFC.js";import{g as Vt,c as Bt,e as Gt}from"./extract-connection-data-DvTYFZdB.js";import{F as pe,a as Qe,b as ge,c as he,d as xe,e as ye}from"./form-Sjgg7L1l.js";import{i as Ht}from"./ChevronUp-M8W7UfeY.js";import{s as Qt,a as Wt}from"./Eye-C_Xoo8qw.js";import{i as Yt}from"./Settings02-DozM190y.js";import{S as dt,a as ut,b as mt,c as ft,d as pt}from"./select-DveGPtTs.js";import{u as Zt}from"./useQueries-CcOVMhFe.js";import{a as Xt}from"./authenticate-and-persist-oauth-BcWaYu03.js";import{i as gt}from"./ArrowUpRight-C3z436np.js";import{s as ht}from"./User01-CDDYeeuq.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-BxyUCT4U.js";import"./auth-fiRjWiax.js";import"./agent-icon-y3KUME6u.js";import"./AlertCircle-CTPV9V8h.js";import"./Tool01-D6XUAkke.js";import"./SwitchHorizontal01-Bpw0CC0C.js";import"./ZapSquare-Buvc-Lai.js";import"./Users03-DZMol2tr.js";import"./ChevronDown-h0x45P8o.js";import"./ChevronLeft-zdg7Q4jK.js";import"./ChevronRight-qRgV12A9.js";import"./DotsVertical-5_LyH0_q.js";import"./Stars02-DBKqj7gx.js";import"./Globe01-sY1H67fR.js";import"./FilterLines-dJo6BCZ1.js";import"./Star01-DqNKux5E.js";import"./Globe04-DF2MygRC.js";import"./HardDrive-rN9rvzTi.js";import"./Key01-DdhtrhKo.js";import"./LayoutLeft-BGpgGNzH.js";import"./LinkExternal01-Qtas2L2N.js";import"./Monitor01-Dl_qoJKp.js";import"./Sun-CGcK7-RR.js";import"./Palette-tdsAZuuV.js";import"./Play-DJ7ZmWZL.js";import"./Plus-C1ojr5M2.js";import"./SearchMd-DUageA20.js";import"./Shield01-C9Bch-EG.js";import"./Stars01-r4i4yvEz.js";import"./Trash01-dG9X4BY7.js";import"./Upload01-o5Xeg721.js";import"./Users01-BrrFQM4e.js";import"./XClose-BXP3vjGQ.js";import"./X-kuCvYxfG.js";import"./Zap-DD_vVHsY.js";import"./label-DiKcChLe.js";import"./mcp-oauth-D4oN1GD0.js";const Jt=/^[a-zA-Z][a-zA-Z\d+.-]*:/,en=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,tn=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,nn=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function Ee(s){const e=s.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const n=Jt.test(e),i=en.test(e),o=tn.test(e);if(n&&!i&&!o)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=i?e:`https://${e}`;let r;try{r=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(r.protocol!=="http:"&&r.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const l=r.hostname.split(".");return l.length<2||l.some(a=>!a||!nn.test(a))?{ok:!1,error:"Enter a valid website URL."}:(r.protocol="https:",{ok:!0,value:r.origin})}function De(s){const e=E.c(14),{children:n,className:i,wrapperClassName:o}=s,[c,r]=q.useState(!0);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=j=>{if(!j)return;const y=()=>{const m=j.scrollHeight-j.scrollTop-j.clientHeight<8;r(m)};y(),j.addEventListener("scroll",y,{passive:!0});const h=new ResizeObserver(y);h.observe(j);for(const m of Array.from(j.children))h.observe(m);return()=>{j.removeEventListener("scroll",y),h.disconnect()}},e[0]=l):l=e[0];const a=l;let d;e[1]!==o?(d=ee("relative",o),e[1]=o,e[2]=d):d=e[2];let f;e[3]!==n||e[4]!==i?(f=t.jsx("div",{ref:a,className:i,children:n}),e[3]=n,e[4]=i,e[5]=f):f=e[5];const p=c?"opacity-0":"opacity-100";let u;e[6]!==p?(u=ee("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",p),e[6]=p,e[7]=u):u=e[7];let x;e[8]!==u?(x=t.jsx("div",{"aria-hidden":!0,className:u}),e[8]=u,e[9]=x):x=e[9];let g;return e[10]!==d||e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:d,children:[f,x]}),e[10]=d,e[11]=f,e[12]=x,e[13]=g):g=e[13],g}function sn(s){const e=s.properties;if(!e)return[];const n=[];for(const[i,o]of Object.entries(e)){const l=o?.properties?.__type?.const;typeof l=="string"&&l.length>0&&n.push({fieldKey:i,bindingType:l})}return n}function on(s,e){const n=[];if(s.length&&n.push({field:["id"],operator:"in",value:s}),e.length&&n.push({field:["name"],operator:"in",value:e}),n.length!==0)return n.length===1?n[0]:{operator:"or",conditions:n}}function J(s){const e=s;if(e.isError)throw new Error(e.content?.find(n=>n.text)?.text??"Tool call failed");return e.structuredContent??s}function rn(s,e,n,i){return{...s??{},[e]:{__type:n,value:i}}}function Me(s){return s==null?!1:typeof s=="string"?s.trim().length>0:typeof s=="number"||typeof s=="boolean"?!0:Array.isArray(s)?s.some(Me):typeof s=="object"?Object.entries(s).some(([e,n])=>!e.startsWith("__")&&Me(n)):!1}function ln(s){return s.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase())}function an(s){return Me(s)?typeof s=="string"?s.trim():typeof s=="number"||typeof s=="boolean"?String(s):JSON.stringify(s):null}function cn(s){return s?Object.entries(s).flatMap(([e,n])=>{if(e.startsWith("__"))return[];const i=an(n);return i?[{key:e,label:ln(e),value:i}]:[]}):[]}function dn(s,e,n){const i=s.filter(o=>o.app_name===e||!!n&&o.app_id===n);return i.length===0?null:(i.sort((o,c)=>{const r=l=>l.status==="active"?0:1;return r(o)!==r(c)?r(o)-r(c):(c.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function un(s){return s.server?.icons?.[0]?.src??Vt(s.server?.repository)??null}function mn(s,e){const n=s._meta?.["mcp.mesh"];return n?.friendlyName||n?.friendly_name||s.title||s.server?.title||s.server?.name||e}function fn(s){const e=[],n=new Map(s.connections.map(i=>[i.id,i]));for(const i of s.requirements){const o=s.curated[i.bindingType],c=o?s.itemsById[o.registryAppId]:s.itemsByName[i.bindingType];if(!c)continue;const r=s.configurationState?.[i.fieldKey]?.value,l=r?n.get(r):void 0,a=r&&l?r:null,d=a?s.connectionReadiness?.[a]!==!1:!1,f=!!a&&d;e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:c,title:mn(c,i.bindingType),icon:un(c),headline:o?.headline??c._meta?.["mcp.mesh"]?.short_description??null,checks:o?.checks??null,bullets:o?.bullets??[],satisfied:f,candidateConnectionId:f?null:a||dn(s.connections,i.bindingType,o?.registryAppId),linkedConnectionId:a,configurationState:l?.configuration_state??null})}return e}function pn(s,e){if(!s)return null;const n=o=>{if(o.startsWith("sc-domain:"))return o.substring(10);try{let r=new URL(o.startsWith("http")?o:`https://${o}`).hostname||"";return r.startsWith("www.")&&(r=r.substring(4)),r}catch{return o}},i=n(s);for(const o of e)if(n(o.siteUrl)===i)return o.siteUrl;return null}function gn(s){return(s?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:o.displayName}))}))}function et(s){const e=E.c(38);let n,i,o,c,r;e[0]!==s?({value:r,onChange:i,placeholder:o,className:n,...c}=s,e[0]=s,e[1]=n,e[2]=i,e[3]=o,e[4]=c,e[5]=r):(n=e[1],i=e[2],o=e[3],c=e[4],r=e[5]);const[l,a]=q.useState(!1),[d,f]=q.useState(!1);let p;e[6]!==r?(p=async()=>{if(r)try{await navigator.clipboard.writeText(r),f(!0),setTimeout(()=>f(!1),2e3)}catch(F){console.error("Failed to copy text: ",F)}},e[6]=r,e[7]=p):p=e[7];const u=p;let x;e[8]!==l?(x=()=>{a(!l)},e[8]=l,e[9]=x):x=e[9];const g=x,j=l?"text":"password";let y;e[10]!==n?(y=ee("pr-20",n),e[10]=n,e[11]=y):y=e[11];let h;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==j||e[16]!==y||e[17]!==r?(h=t.jsx(Ge,{type:j,value:r,onChange:i,placeholder:o,className:y,...c}),e[12]=i,e[13]=o,e[14]=c,e[15]=j,e[16]=y,e[17]=r,e[18]=h):h=e[18];const m=l?"Hide password":"Show password";let b;e[19]!==l?(b=l?t.jsx(Yt,{size:16}):t.jsx(Qt,{size:16}),e[19]=l,e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==b||e[23]!==g?(C=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g,title:m,children:b}),e[21]=m,e[22]=b,e[23]=g,e[24]=C):C=e[24];const v=!r,N=d?"Copied!":"Copy token";let _;e[25]!==d?(_=d?t.jsx(Ht,{size:16}):t.jsx(Wt,{size:16}),e[25]=d,e[26]=_):_=e[26];let T;e[27]!==u||e[28]!==N||e[29]!==_||e[30]!==v?(T=t.jsx(B,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,disabled:v,title:N,children:_}),e[27]=u,e[28]=N,e[29]=_,e[30]=v,e[31]=T):T=e[31];let k;e[32]!==T||e[33]!==C?(k=t.jsxs("div",{className:"absolute right-1 top-1 flex items-center gap-1 h-8",children:[C,T]}),e[32]=T,e[33]=C,e[34]=k):k=e[34];let w;return e[35]!==k||e[36]!==h?(w=t.jsxs("div",{className:"relative",children:[h,k]}),e[35]=k,e[36]=h,e[37]=w):w=e[37],w}function We(s){const e=E.c(19),{card:n,selfClient:i,org:o,onDone:c,onError:r}=s,l=nt();let a;e[0]!==n||e[1]!==i?(a=async y=>{const h={...n.configurationState??{},...y};await i.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:n.linkedConnectionId||n.candidateConnectionId,data:{configuration_state:h}}})},e[0]=n,e[1]=i,e[2]=a):a=e[2];let d;e[3]!==c||e[4]!==o||e[5]!==l?(d=async()=>{await l.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnections(o.id)}),c()},e[3]=c,e[4]=o,e[5]=l,e[6]=d):d=e[6];let f;e[7]!==r?(f=y=>{r?.(y)},e[7]=r,e[8]=f):f=e[8];let p;e[9]!==a||e[10]!==d||e[11]!==f?(p={mutationFn:a,onSuccess:d,onError:f},e[9]=a,e[10]=d,e[11]=f,e[12]=p):p=e[12];const u=ke(p);let x;e[13]!==u?(x=y=>u.mutate(y),e[13]=u,e[14]=x):x=e[14];const g=x;let j;return e[15]!==u.error||e[16]!==u.isPending||e[17]!==g?(j={save:g,isPending:u.isPending,error:u.error},e[15]=u.error,e[16]=u.isPending,e[17]=g,e[18]=j):j=e[18],j}const hn=Ke({accountName:fe().min(1,"Account name is required"),appKey:fe().optional(),appToken:fe().optional()});function xn(s){const e=E.c(63),{card:n,selfClient:i,org:o,onDone:c,onIsPendingChange:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=qe(hn),e[0]=l):l=e[0];const a=n.configurationState?.accountName||"",d=n.configurationState?.appKey||"",f=n.configurationState?.appToken||"";let p;e[1]!==a||e[2]!==d||e[3]!==f?(p={resolver:l,defaultValues:{accountName:a,appKey:d,appToken:f}},e[1]=a,e[2]=d,e[3]=f,e[4]=p):p=e[4];const u=Ve(p);let x;e[5]!==n.configurationState?.accountName||e[6]!==n.configurationState?.appKey||e[7]!==n.configurationState?.appToken||e[8]!==u?(x=()=>{u.reset({accountName:n.configurationState?.accountName||"",appKey:n.configurationState?.appKey||"",appToken:n.configurationState?.appToken||""})},e[5]=n.configurationState?.accountName,e[6]=n.configurationState?.appKey,e[7]=n.configurationState?.appToken,e[8]=u,e[9]=x):x=e[9];let g;e[10]!==n.configurationState||e[11]!==u?(g=[n.configurationState,u],e[10]=n.configurationState,e[11]=u,e[12]=g):g=e[12],q.useEffect(x,g);let j;e[13]!==n||e[14]!==c||e[15]!==o||e[16]!==i?(j={card:n,selfClient:i,org:o,onDone:c},e[13]=n,e[14]=c,e[15]=o,e[16]=i,e[17]=j):j=e[17];const{save:y,isPending:h,error:m}=We(j);let b,C;e[18]!==h||e[19]!==r?(C=()=>{r?.(h)},b=[h,r],e[18]=h,e[19]=r,e[20]=b,e[21]=C):(b=e[20],C=e[21]),q.useEffect(C,b);let v;if(e[22]!==u||e[23]!==y){let z;e[25]!==y?(z=async S=>{y(S)},e[25]=y,e[26]=z):z=e[26],v=u.handleSubmit(z),e[22]=u,e[23]=y,e[24]=v}else v=e[24];const N=v;let _;e[27]!==h?(_=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"Account Name"}),t.jsx(xe,{children:t.jsx(Ge,{placeholder:"Your VTEX account name",...S,disabled:h})}),t.jsx(ye,{})]})},e[27]=h,e[28]=_):_=e[28];let T;e[29]!==u.control||e[30]!==_?(T=t.jsx(pe,{control:u.control,name:"accountName",render:_}),e[29]=u.control,e[30]=_,e[31]=T):T=e[31];let k;e[32]!==h?(k=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"App Key (optional)"}),t.jsx(xe,{children:t.jsx(et,{placeholder:"VTEX app key",...S,disabled:h})}),t.jsx(ye,{})]})},e[32]=h,e[33]=k):k=e[33];let w;e[34]!==u.control||e[35]!==k?(w=t.jsx(pe,{control:u.control,name:"appKey",render:k}),e[34]=u.control,e[35]=k,e[36]=w):w=e[36];let F;e[37]!==h?(F=z=>{const{field:S}=z;return t.jsxs(ge,{children:[t.jsx(he,{children:"App Token (optional)"}),t.jsx(xe,{children:t.jsx(et,{placeholder:"VTEX app token",...S,disabled:h})}),t.jsx(ye,{})]})},e[37]=h,e[38]=F):F=e[38];let R;e[39]!==u.control||e[40]!==F?(R=t.jsx(pe,{control:u.control,name:"appToken",render:F}),e[39]=u.control,e[40]=F,e[41]=R):R=e[41];let I;e[42]!==u||e[43]!==T||e[44]!==w||e[45]!==R?(I=t.jsxs(Qe,{...u,children:[T,w,R]}),e[42]=u,e[43]=T,e[44]=w,e[45]=R,e[46]=I):I=e[46];let P;e[47]!==m?(P=m&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:m instanceof Error?m.message:"Failed to save configuration"}),e[47]=m,e[48]=P):P=e[48];let A;e[49]!==h||e[50]!==c?(A=t.jsx(B,{type:"button",variant:"outline",onClick:c,disabled:h,children:"Cancel"}),e[49]=h,e[50]=c,e[51]=A):A=e[51];const D=h?"Saving...":"Save";let K;e[52]!==h||e[53]!==D?(K=t.jsx(B,{type:"submit",disabled:h,children:D}),e[52]=h,e[53]=D,e[54]=K):K=e[54];let M;e[55]!==A||e[56]!==K?(M=t.jsxs(He,{className:"pt-4",children:[A,K]}),e[55]=A,e[56]=K,e[57]=M):M=e[57];let U;return e[58]!==N||e[59]!==I||e[60]!==P||e[61]!==M?(U=t.jsxs("form",{onSubmit:N,className:"space-y-4",children:[I,P,M]}),e[58]=N,e[59]=I,e[60]=P,e[61]=M,e[62]=U):U=e[62],U}const yn=Ke({propertyId:fe().min(1,"Property is required")});function jn(s){const e=E.c(55),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,onDone:l,onIsPendingChange:a}=s;let d;e[0]!==i||e[1]!==r.id?(d=W.commerceDiscoveryCompanionGaProperties(r.id,i),e[0]=i,e[1]=r.id,e[2]=d):d=e[2];let f;e[3]!==o?(f=async()=>{const S=await o.callTool({name:"get-account-summaries",arguments:{}}),L=J(S);return gn(L)},e[3]=o,e[4]=f):f=e[4];let p;e[5]!==d||e[6]!==f?(p={queryKey:d,queryFn:f},e[5]=d,e[6]=f,e[7]=p):p=e[7];const u=me(p);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=qe(yn),e[8]=x):x=e[8];const g=n.configurationState?.propertyId||"";let j;e[9]!==g?(j={resolver:x,defaultValues:{propertyId:g}},e[9]=g,e[10]=j):j=e[10];const y=Ve(j);let h;e[11]!==n||e[12]!==l||e[13]!==r||e[14]!==c?(h={card:n,selfClient:c,org:r,onDone:l},e[11]=n,e[12]=l,e[13]=r,e[14]=c,e[15]=h):h=e[15];const{save:m,isPending:b,error:C}=We(h);let v,N;e[16]!==b||e[17]!==a?(v=()=>{a?.(b)},N=[b,a],e[16]=b,e[17]=a,e[18]=v,e[19]=N):(v=e[18],N=e[19]),q.useEffect(v,N);let _;if(e[20]!==y||e[21]!==m){let S;e[23]!==m?(S=async L=>{m(L)},e[23]=m,e[24]=S):S=e[24],_=y.handleSubmit(S),e[20]=y,e[21]=m,e[22]=_}else _=e[22];const T=_;if(u.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading properties..."})}),e[25]=S):S=e[25],S}if(u.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Analytics properties."})}),e[26]=S):S=e[26],S}let k;e[27]!==u.data?(k=u.data||[],e[27]=u.data,e[28]=k):k=e[28];const w=k;if(w.flatMap(Sn).length===0){let S;return e[29]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No Google Analytics properties found. Please connect a Google Analytics account with properties."})}),e[29]=S):S=e[29],S}let R;e[30]!==b||e[31]!==w?(R=S=>{const{field:L}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:"Google Analytics Property"}),t.jsx(xe,{children:t.jsxs(dt,{value:L.value,onValueChange:L.onChange,disabled:b,children:[t.jsx(ut,{children:t.jsx(mt,{placeholder:"Select a property"})}),t.jsx(ft,{children:w.map(bn)})]})}),t.jsx(ye,{})]})},e[30]=b,e[31]=w,e[32]=R):R=e[32];let I;e[33]!==y.control||e[34]!==R?(I=t.jsx(pe,{control:y.control,name:"propertyId",render:R}),e[33]=y.control,e[34]=R,e[35]=I):I=e[35];let P;e[36]!==y||e[37]!==I?(P=t.jsx(Qe,{...y,children:I}),e[36]=y,e[37]=I,e[38]=P):P=e[38];let A;e[39]!==C?(A=C&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C instanceof Error?C.message:"Failed to save configuration"}),e[39]=C,e[40]=A):A=e[40];let D;e[41]!==b||e[42]!==l?(D=t.jsx(B,{type:"button",variant:"outline",onClick:l,disabled:b,children:"Cancel"}),e[41]=b,e[42]=l,e[43]=D):D=e[43];const K=b?"Saving...":"Save";let M;e[44]!==b||e[45]!==K?(M=t.jsx(B,{type:"submit",disabled:b,children:K}),e[44]=b,e[45]=K,e[46]=M):M=e[46];let U;e[47]!==D||e[48]!==M?(U=t.jsxs(He,{className:"pt-4",children:[D,M]}),e[47]=D,e[48]=M,e[49]=U):U=e[49];let z;return e[50]!==T||e[51]!==P||e[52]!==A||e[53]!==U?(z=t.jsxs("form",{onSubmit:T,className:"space-y-4",children:[P,A,U]}),e[50]=T,e[51]=P,e[52]=A,e[53]=U,e[54]=z):z=e[54],z}function bn(s){return t.jsx("div",{children:s.options.map(Cn)},s.account)}function Cn(s){return t.jsx(pt,{value:s.value,children:s.label},s.value)}function Sn(s){return s.options}const vn=Ke({siteUrl:fe().min(1,"Site is required")});function Nn(s){const e=E.c(59),{card:n,connectionId:i,companionClient:o,selfClient:c,org:r,contextSiteUrl:l,onDone:a,onIsPendingChange:d}=s;let f;e[0]!==i||e[1]!==r.id?(f=W.commerceDiscoveryCompanionGscSites(r.id,i),e[0]=i,e[1]=r.id,e[2]=f):f=e[2];let p;e[3]!==o?(p=async()=>{const S=await o.callTool({name:"list_sites",arguments:{}});return J(S).sites||[]},e[3]=o,e[4]=p):p=e[4];let u;e[5]!==f||e[6]!==p?(u={queryKey:f,queryFn:p},e[5]=f,e[6]=p,e[7]=u):u=e[7];const x=me(u);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=qe(vn),e[8]=g):g=e[8];const j=n.configurationState?.siteUrl||"";let y;e[9]!==j?(y={resolver:g,defaultValues:{siteUrl:j}},e[9]=j,e[10]=y):y=e[10];const h=Ve(y);let m;e[11]!==n||e[12]!==a||e[13]!==r||e[14]!==c?(m={card:n,selfClient:c,org:r,onDone:a},e[11]=n,e[12]=a,e[13]=r,e[14]=c,e[15]=m):m=e[15];const{save:b,isPending:C,error:v}=We(m);let N,_;e[16]!==C||e[17]!==d?(N=()=>{d?.(C)},_=[C,d],e[16]=C,e[17]=d,e[18]=N,e[19]=_):(N=e[18],_=e[19]),q.useEffect(N,_);let T;if(e[20]!==h||e[21]!==b){let S;e[23]!==b?(S=async L=>{b(L)},e[23]=b,e[24]=S):S=e[24],T=h.handleSubmit(S),e[20]=h,e[21]=b,e[22]=T}else T=e[22];const k=T;if(x.isLoading){let S;return e[25]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sites..."})}),e[25]=S):S=e[25],S}if(x.isError){let S;return e[26]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load Google Search Console sites."})}),e[26]=S):S=e[26],S}let w,F;if(e[27]!==n.configurationState?.siteUrl||e[28]!==l||e[29]!==h||e[30]!==x.data){F=Symbol.for("react.early_return_sentinel");e:{if(w=x.data||[],w.length===0){let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("div",{className:"space-y-4",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No verified sites found. Please verify a site in Google Search Console."})}),e[33]=L):L=e[33],F=L;break e}const S=n.configurationState?.siteUrl;if(S&&h.getValues("siteUrl")!==S)h.setValue("siteUrl",S);else if(!S&&!h.getValues("siteUrl")){const L=pn(l,w);L&&h.setValue("siteUrl",L)}}e[27]=n.configurationState?.siteUrl,e[28]=l,e[29]=h,e[30]=x.data,e[31]=w,e[32]=F}else w=e[31],F=e[32];if(F!==Symbol.for("react.early_return_sentinel"))return F;let R;e[34]!==C||e[35]!==w?(R=S=>{const{field:L}=S;return t.jsxs(ge,{children:[t.jsx(he,{children:"Verified Site"}),t.jsx(xe,{children:t.jsxs(dt,{value:L.value,onValueChange:L.onChange,disabled:C,children:[t.jsx(ut,{children:t.jsx(mt,{placeholder:"Select a site"})}),t.jsx(ft,{children:w.map(_n)})]})}),t.jsx(ye,{})]})},e[34]=C,e[35]=w,e[36]=R):R=e[36];let I;e[37]!==h.control||e[38]!==R?(I=t.jsx(pe,{control:h.control,name:"siteUrl",render:R}),e[37]=h.control,e[38]=R,e[39]=I):I=e[39];let P;e[40]!==h||e[41]!==I?(P=t.jsx(Qe,{...h,children:I}),e[40]=h,e[41]=I,e[42]=P):P=e[42];let A;e[43]!==v?(A=v&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:v instanceof Error?v.message:"Failed to save configuration"}),e[43]=v,e[44]=A):A=e[44];let D;e[45]!==C||e[46]!==a?(D=t.jsx(B,{type:"button",variant:"outline",onClick:a,disabled:C,children:"Cancel"}),e[45]=C,e[46]=a,e[47]=D):D=e[47];const K=C?"Saving...":"Save";let M;e[48]!==C||e[49]!==K?(M=t.jsx(B,{type:"submit",disabled:C,children:K}),e[48]=C,e[49]=K,e[50]=M):M=e[50];let U;e[51]!==D||e[52]!==M?(U=t.jsxs(He,{className:"pt-4",children:[D,M]}),e[51]=D,e[52]=M,e[53]=U):U=e[53];let z;return e[54]!==k||e[55]!==P||e[56]!==A||e[57]!==U?(z=t.jsxs("form",{onSubmit:k,className:"space-y-4",children:[P,A,U]}),e[54]=k,e[55]=P,e[56]=A,e[57]=U,e[58]=z):z=e[58],z}function _n(s){return t.jsx(pt,{value:s.siteUrl,children:s.siteUrl},s.siteUrl)}const In={vtex:xn,"google-analytics":jn,"google-search-console":Nn};function wn(){const s=E.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"size-9 shrink-0 animate-pulse rounded-lg bg-muted/60"}),t.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),t.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),s[1]=n):n=s[1];let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[n,t.jsx("div",{className:"p-1",children:t.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),s[2]=i):i=s[2],i}function Fe(s){const e=E.c(3),{children:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ct,{size:14,className:"shrink-0 text-blue-500"}),e[0]=i):i=e[0];let o;return e[1]!==n?(o=t.jsxs("div",{className:"flex items-center gap-2 p-1",children:[i,t.jsx("p",{className:"text-sm text-foreground",children:n})]}),e[1]=n,e[2]=o):o=e[2],o}function En(s){const e=E.c(43),{card:n,connecting:i,disabled:o,onConnect:c,org:r,selfClient:l,siteUrl:a}=s,d=n.linkedConnectionId;let f;e[0]!==n.configurationState?(f=cn(n.configurationState),e[0]=n.configurationState,e[1]=f):f=e[1];const p=f;let u;e[2]!==n.icon||e[3]!==n.title?(u=t.jsx($t,{icon:n.icon,name:n.title,size:"sm",fit:"contain",className:"p-1.5"}),e[2]=n.icon,e[3]=n.title,e[4]=u):u=e[4];let x;e[5]!==n.title?(x=t.jsx("p",{className:"flex-1 text-sm text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let g;e[7]!==n.satisfied||e[8]!==n.title||e[9]!==i||e[10]!==o||e[11]!==c?(g=n.satisfied?t.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[t.jsx(ct,{size:16})," Connected"]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",disabled:o||i,onClick:c,"aria-label":`Connect ${n.title}`,children:i?t.jsx(st,{size:16,className:"animate-spin"}):"Connect"}),e[7]=n.satisfied,e[8]=n.title,e[9]=i,e[10]=o,e[11]=c,e[12]=g):g=e[12];let j;e[13]!==u||e[14]!==x||e[15]!==g?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[u,x,g]}),e[13]=u,e[14]=x,e[15]=g,e[16]=j):j=e[16];let y;e[17]!==n.checks?(y=n.checks!==null&&t.jsxs(Fe,{children:["+ ",n.checks," checks"]}),e[17]=n.checks,e[18]=y):y=e[18];let h;e[19]!==n.headline?(h=n.headline&&t.jsx(Fe,{children:n.headline}),e[19]=n.headline,e[20]=h):h=e[20];let m;e[21]!==n.bullets?(m=n.bullets.map(Tn),e[21]=n.bullets,e[22]=m):m=e[22];let b;e[23]!==n.candidateConnectionId||e[24]!==n.satisfied||e[25]!==n.title?(b=!n.satisfied&&n.candidateConnectionId&&t.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",n.title]}),e[23]=n.candidateConnectionId,e[24]=n.satisfied,e[25]=n.title,e[26]=b):b=e[26];let C;e[27]!==y||e[28]!==h||e[29]!==m||e[30]!==b?(C=t.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[y,h,m,b]}),e[27]=y,e[28]=h,e[29]=m,e[30]=b,e[31]=C):C=e[31];let v;e[32]!==n||e[33]!==d||e[34]!==r||e[35]!==p||e[36]!==l||e[37]!==a?(v=n.satisfied&&d&&t.jsx(Rn,{card:n,org:r,selfClient:l,connectionId:d,savedConfigEntries:p,contextSiteUrl:a}),e[32]=n,e[33]=d,e[34]=r,e[35]=p,e[36]=l,e[37]=a,e[38]=v):v=e[38];let N;return e[39]!==C||e[40]!==v||e[41]!==j?(N=t.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[j,C,v]}),e[39]=C,e[40]=v,e[41]=j,e[42]=N):N=e[42],N}function Tn(s){return t.jsx(Fe,{children:s},s)}function kn(s,e){return/(token|secret|password|appKey|key)$/i.test(s)?"••••••••":e}function On(s){const e=E.c(2),{title:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"grid gap-3 border-t border-border pt-3",children:t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Configuration isn't available here yet for ",n,"."]})}),e[0]=n,e[1]=i):i=e[1],i}function Rn(s){const e=E.c(36),{card:n,org:i,selfClient:o,connectionId:c,savedConfigEntries:r,contextSiteUrl:l}=s;let a;e[0]!==c||e[1]!==i.id||e[2]!==i.slug?(a={connectionId:c,orgId:i.id,orgSlug:i.slug},e[0]=c,e[1]=i.id,e[2]=i.slug,e[3]=a):a=e[3];const d=Re(a),[f,p]=q.useState(!1),[u,x]=q.useState(!1),g=In[n.bindingType];let j;e[4]!==u?(j=w=>{!w&&u||p(w)},e[4]=u,e[5]=j):j=e[5];const y=j;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Configuration"}),e[6]=h):h=e[6];let m;e[7]!==r.length?(m=r.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No configuration values saved yet."}),e[7]=r.length,e[8]=m):m=e[8];let b;e[9]!==m?(b=t.jsxs("div",{className:"grid gap-1",children:[h,m]}),e[9]=m,e[10]=b):b=e[10];let C;e[11]!==g||e[12]!==n.title||e[13]!==r.length?(C=r.length>0?t.jsxs(Mt,{children:[t.jsx(Ft,{asChild:!0,children:t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>p(!0),"aria-label":`Edit ${n.title} configuration`,disabled:!g,children:t.jsx(qt,{size:14})})}),t.jsx(Kt,{children:"Edit configuration"})]}):t.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!0),disabled:!g,children:"Configure"}),e[11]=g,e[12]=n.title,e[13]=r.length,e[14]=C):C=e[14];let v;e[15]!==b||e[16]!==C?(v=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b,C]}),e[15]=b,e[16]=C,e[17]=v):v=e[17];let N;e[18]!==r?(N=r.length>0&&t.jsx("dl",{className:"grid gap-2",children:r.map(Un)}),e[18]=r,e[19]=N):N=e[19];let _;e[20]!==v||e[21]!==N?(_=t.jsxs("div",{className:"grid gap-3 border-t border-border pt-3",children:[v,N]}),e[20]=v,e[21]=N,e[22]=_):_=e[22];let T;e[23]!==g||e[24]!==n||e[25]!==d||e[26]!==c||e[27]!==l||e[28]!==f||e[29]!==y||e[30]!==i||e[31]!==o?(T=g?t.jsx(Pt,{open:f,onOpenChange:y,children:t.jsxs(zt,{className:"sm:max-w-lg",children:[t.jsxs(Lt,{children:[t.jsxs(At,{children:["Configure ",n.title]}),t.jsx(Dt,{children:"Update the values this companion uses for Commerce Discovery."})]}),t.jsx(g,{card:n,connectionId:c,companionClient:d,selfClient:o,org:i,contextSiteUrl:l,onDone:()=>p(!1),onIsPendingChange:x})]})}):t.jsx(On,{title:n.title}),e[23]=g,e[24]=n,e[25]=d,e[26]=c,e[27]=l,e[28]=f,e[29]=y,e[30]=i,e[31]=o,e[32]=T):T=e[32];let k;return e[33]!==T||e[34]!==_?(k=t.jsxs(t.Fragment,{children:[_,T]}),e[33]=T,e[34]=_,e[35]=k):k=e[35],k}function Un(s){return t.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[t.jsx("dt",{className:"text-muted-foreground",children:s.label}),t.jsx("dd",{className:"truncate text-foreground",children:kn(s.key,s.value)})]},s.key)}const Ye={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 $n(s){const e=E.c(39),{selfClient:n,org:i,cdConnectionId:o}=s;let c;e[0]!==o||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:o,orgId:i.id,orgSlug:i.slug},e[0]=o,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const r=Re(c);let l;e[4]!==o||e[5]!==i.id?(l=W.commerceDiscoveryCompanionSchema(i.id,o),e[4]=o,e[5]=i.id,e[6]=l):l=e[6];let a;e[7]!==r?(a=async()=>{const O=await r.callTool({name:"MCP_CONFIGURATION",arguments:{}});return J(O)},e[7]=r,e[8]=a):a=e[8];let d;e[9]!==l||e[10]!==a?(d={queryKey:l,queryFn:a},e[9]=l,e[10]=a,e[11]=d):d=e[11];const f=me(d),p=sn(f.data?.stateSchema??{properties:{}}),u=p.map(Kn),x=p.map(Fn).filter(Mn),g=p.filter(Dn).map(An),j=[...x,...g].sort().join(",");let y;e[12]!==o||e[13]!==i.id?(y=W.commerceDiscoveryConnection(i.id,o),e[12]=o,e[13]=i.id,e[14]=y):y=e[14];let h;e[15]!==o||e[16]!==n?(h=async()=>{const O=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:o}});return J(O)},e[15]=o,e[16]=n,e[17]=h):h=e[17];let m;e[18]!==y||e[19]!==h?(m={queryKey:y,queryFn:h},e[18]=y,e[19]=h,e[20]=m):m=e[20];const b=me(m),C=b.data?.item?.configuration_state??null;let v;e[21]!==C?(v=O=>C?.[O.fieldKey]?.value,e[21]=C,e[22]=v):v=e[22];const N=p.map(v).filter(Ln),_=me({queryKey:W.commerceDiscoveryCompanionConnections(i.id),enabled:p.length>0,queryFn:async()=>{const O=[{field:["app_name"],operator:"in",value:u},{field:["app_id"],operator:"in",value:x}];N.length>0&&O.push({field:["id"],operator:"in",value:N});const G=await n.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:O},limit:1e3}});return J(G)}}),T=_.data?.items??[],k=new Set(N),w=T.filter(O=>k.has(O.id)),F=w.filter(zn);let R;e[23]!==i.id||e[24]!==i.slug?(R=O=>({queryKey:W.commerceDiscoveryCompanionOAuthStatus(i.id,O.id),queryFn:async()=>{const G=await fetch(`/api/${encodeURIComponent(i.slug)}/connections/${encodeURIComponent(O.id)}/oauth-token/status`,{credentials:"include"});return G.ok?{hasToken:(await G.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=i.id,e[24]=i.slug,e[25]=R):R=e[25];const I=Zt({queries:F.map(R)});let P;e[26]!==I?(P=(O,G)=>[O.id,I[G]?.data?.hasToken===!0],e[26]=I,e[27]=P):P=e[27];const A=new Map(F.map(P)),D={};for(const O of w)D[O.id]=!O.oauth_config||!!O.connection_token||A.get(O.id)===!0;const K=me({queryKey:W.commerceDiscoveryCompanionRegistry(i.id,j),enabled:p.length>0,queryFn:async()=>{const O=on(x,g),G=await Bt(rt.REGISTRY(i.id),i.id,i.slug,"COLLECTION_REGISTRY_APP_LIST",{...O?{where:O}:{},limit:1e3});return J(G)}}),M={},U={};for(const O of K.data?.items??[])M[O.id]=O,O.server?.name&&(U[O.server.name]=O);const z=fn({requirements:p,itemsById:M,itemsByName:U,connections:T,connectionReadiness:D,configurationState:C,curated:Ye});let S;e[28]!==b||e[29]!==_||e[30]!==I||e[31]!==K||e[32]!==p||e[33]!==f.isPending?(S=f.isPending||b.isPending||p.length>0&&(_.isPending||K.isPending||I.some(Pn)),e[28]=b,e[29]=_,e[30]=I,e[31]=K,e[32]=p,e[33]=f.isPending,e[34]=S):S=e[34];const L=S,V=f.error??b.error??_.error??K.error??null;let Z;return e[35]!==z||e[36]!==V||e[37]!==L?(Z={cards:z,isLoading:L,error:V},e[35]=z,e[36]=V,e[37]=L,e[38]=Z):Z=e[38],Z}function Pn(s){return s.isPending}function zn(s){return s.oauth_config&&!s.connection_token}function Ln(s){return typeof s=="string"&&s.length>0}function An(s){return s.bindingType}function Dn(s){return!Ye[s.bindingType]}function Mn(s){return!!s}function Fn(s){return Ye[s.bindingType]?.registryAppId}function Kn(s){return s.bindingType}function qn({selfClient:s,org:e,userId:n,cdConnectionId:i}){const o=nt(),[c,r]=q.useState(null),[l,a]=q.useState(null),d=async(p,u)=>{const x=await s.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:p,data:u}});return J(x)};async function f(p){r(p.fieldKey),a(null);try{let u=p.candidateConnectionId;if(!u){const m=Gt(p.registryItem,e.id,n,{remoteIndex:0}),b=m.connection_type==="STDIO",C=!!m.connection_url,v=b&&m.connection_headers&&typeof m.connection_headers=="object"&&"command"in m.connection_headers;if(!C&&!v){a(`${p.title} cannot be connected: no connection method available`);return}const N=await s.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:m}});u=J(N).item.id}const x=u,g=await Xt({connectionId:x,orgId:e.id,orgSlug:e.slug,persistFallback:m=>d(x,{connection_token:m}).then(()=>{})});if(!g.ok){a(`Couldn't sign in to ${p.title}: ${g.error}`);return}const j=await s.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}}),y=J(j).item?.configuration_state??null,h=rn(y,p.fieldKey,p.bindingType,x);await d(i,{configuration_state:h}),await o.invalidateQueries({queryKey:W.commerceDiscoveryConnection(e.id,i)}),await o.invalidateQueries({queryKey:W.commerceDiscoveryCompanionConnections(e.id)})}catch(u){a(u instanceof Error?u.message:String(u))}finally{r(null)}}return{connect:f,connectingFieldKey:c,error:l}}const Vn="flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none md:gap-4";function Bn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),t.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),s[0]=e):e=s[0],e}function Gn(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"grid gap-4",children:[0,1,2].map(Hn)}),s[0]=e):e=s[0],e}function Hn(s){return t.jsx(wn,{},s)}function Qn(s){const e=E.c(24),{org:n,cdConnectionId:i,siteUrl:o}=s,{data:c}=Be.useSession(),r=c?.user?.id??"";let l;e[0]!==n.id||e[1]!==n.slug?(l={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=l):l=e[2];const a=Re(l);let d;e[3]!==i||e[4]!==n||e[5]!==a?(d={selfClient:a,org:n,cdConnectionId:i},e[3]=i,e[4]=n,e[5]=a,e[6]=d):d=e[6];const{cards:f,isLoading:p,error:u}=$n(d);let x;e[7]!==i||e[8]!==n||e[9]!==a||e[10]!==r?(x={selfClient:a,org:n,userId:r,cdConnectionId:i},e[7]=i,e[8]=n,e[9]=a,e[10]=r,e[11]=x):x=e[11];const{connect:g,connectingFieldKey:j,error:y}=qn(x);if(!p&&!u&&f.length===0)return null;const h=j!==null;let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Bn,{}),e[12]=m):m=e[12];let b;return e[13]!==h||e[14]!==f||e[15]!==g||e[16]!==y||e[17]!==j||e[18]!==u||e[19]!==p||e[20]!==n||e[21]!==a||e[22]!==o?(b=t.jsxs("div",{className:Vn,children:[m,u?t.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[t.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?t.jsx(Gn,{}):t.jsx(De,{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:t.jsxs("div",{className:"grid gap-4",children:[y&&t.jsx("p",{role:"alert",className:"text-sm text-destructive",children:y}),f.map(C=>t.jsx(En,{card:C,connecting:j===C.fieldKey,disabled:h&&j!==C.fieldKey,org:n,selfClient:a,siteUrl:o,onConnect:()=>{g(C)}},C.fieldKey))]})})]}),e[13]=h,e[14]=f,e[15]=g,e[16]=y,e[17]=j,e[18]=u,e[19]=p,e[20]=n,e[21]=a,e[22]=o,e[23]=b):b=e[23],b}const Ze="https://decocms-tanstack.deco-cx.workers.dev/agendar",Wn="Rather have us walk you through it?",Yn="Book a 20-minute call and we'll run the diagnostic with you, live.";function xt({siteUrl:s,email:e}){const n=new URL(Ze);return s&&n.searchParams.set("siteUrl",s),e&&n.searchParams.set("email",e),n.toString()}function Zn(s){const e=E.c(9),{href:n,size:i,className:o}=s,c=n===void 0?Ze:n,r=i===void 0?"lg":i;let l;e[0]!==o?(l=ee("w-full",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(gt,{size:16}),e[2]=a):a=e[2];let d;e[3]!==c?(d=t.jsxs("a",{href:c,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",a]}),e[3]=c,e[4]=d):d=e[4];let f;return e[5]!==r||e[6]!==l||e[7]!==d?(f=t.jsx(B,{asChild:!0,variant:"outline",size:r,className:l,children:d}),e[5]=r,e[6]=l,e[7]=d,e[8]=f):f=e[8],f}function tt(s){const e=E.c(2),{children:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:n}),e[0]=n,e[1]=i):i=e[1],i}function Xn(){const s=E.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(ht,{size:20,className:"text-muted-foreground"})}),s[0]=e):e=s[0];let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:t.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),s[1]=n):n=s[1];let i;s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),s[2]=i):i=s[2];let o;return s[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,n,t.jsxs("div",{className:"relative",children:[i,t.jsxs(tt,{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),s[3]=o):o=s[3],o}function yt(s){const e=E.c(4),{href:n}=s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Xn,{}),e[0]=i):i=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{className:"grid gap-2",children:[t.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:Wn}),t.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Yn})]}),e[1]=o):o=e[1];let c;return e[2]!==n?(c=t.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:t.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[i,o,t.jsx(Zn,{href:n,size:"xl"})]})}),e[2]=n,e[3]=c):c=e[3],c}function Jn(s){const e=E.c(8),{className:n,href:i}=s,o=i===void 0?Ze:i;let c;e[0]!==n?(c=ee("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",n),e[0]=n,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(ht,{size:20})}),e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[t.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),t.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),a=t.jsx(gt,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let d;return e[5]!==o||e[6]!==c?(d=t.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",className:c,children:[r,l,a]}),e[5]=o,e[6]=c,e[7]=d):d=e[7],d}function jt(s){const e=E.c(10),{host:n}=s,i=`https://www.google.com/s2/favicons?domain=${n}&sz=128`;let o,c,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),r=t.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=o,e[1]=c,e[2]=r):(o=e[0],c=e[1],r=e[2]);let l;e[3]!==i?(l=t.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:t.jsx("img",{src:i,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n?(a=t.jsx("span",{className:"text-lg font-medium text-foreground",children:n}),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[o,c,r,l,a]}),e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function bt(s){const e=E.c(16),{label:n,iconSize:i,className:o,iconClassName:c,labelClassName:r}=s,l=i===void 0?14:i;let a;e[0]!==o?(a=ee("inline-flex items-center gap-2",o),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==c?(d=ee("shrink-0 animate-spin",c),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==l||e[5]!==d?(f=t.jsx(st,{size:l,className:d}),e[4]=l,e[5]=d,e[6]=f):f=e[6];let p;e[7]!==r?(p=ee("text-sm",r),e[7]=r,e[8]=p):p=e[8];let u;e[9]!==n||e[10]!==p?(u=t.jsx("span",{className:p,children:n}),e[9]=n,e[10]=p,e[11]=u):u=e[11];let x;return e[12]!==a||e[13]!==f||e[14]!==u?(x=t.jsxs("span",{className:a,children:[f,u]}),e[12]=a,e[13]=f,e[14]=u,e[15]=x):x=e[15],x}const es={route:"Preparing commerce onboarding...",workspace:"Preparing your commerce workspace...",connect:"Connecting workspace...",setup:"Setting up Commerce Discovery...",button:"Setting up"};function Ct(s){return es[s]}function St(s){const e=E.c(2),{variant:n}=s;let i;return e[0]!==n?(i=t.jsx(Y,{children:t.jsx(Ue,{variant:n})}),e[0]=n,e[1]=i):i=e[1],i}function Ue(s){const e=E.c(4),{variant:n}=s;let i;e[0]!==n?(i=Ct(n),e[0]=n,e[1]=i):i=e[1];let o;return e[2]!==i?(o=t.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:t.jsx(bt,{label:i,className:"text-muted-foreground"})}),e[2]=i,e[3]=o):o=e[3],o}function ts(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(bt,{label:Ct("button")}),s[0]=e):e=s[0],e}function Ci(){const s=E.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ss,{}),s[0]=e):e=s[0],e}const vt=q.createContext(null),Nt=()=>q.useContext(vt);function ns(s){if(!s)return null;const e=Ee(s);return e.ok?new URL(e.value).hostname:null}function ss(){const s=E.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},s[0]=e):e=s[0];const n=_t(e),{org:i,siteUrl:o}=n;let c;s[1]!==o?(c=ns(o),s[1]=o,s[2]=c):c=s[2];const r=c;let l;s[3]!==i||s[4]!==o?(l=t.jsx(is,{requestedOrgSlug:i,siteUrl:o}),s[3]=i,s[4]=o,s[5]=l):l=s[5];let a;return s[6]!==r||s[7]!==l?(a=t.jsx(vt.Provider,{value:r,children:l}),s[6]=r,s[7]=l,s[8]=a):a=s[8],a}function is(s){const e=E.c(8),{requestedOrgSlug:n,siteUrl:i}=s,{data:o,isPending:c}=Be.useSession(),r=Nt();if(c){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(St,{variant:"route"}),e[0]=a):a=e[0],a}if(!o){const a=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let d;e[1]!==r?(d=r?t.jsx(jt,{host:r}):void 0,e[1]=r,e[2]=d):d=e[2];let f;return e[3]!==d?(f=t.jsx(Y,{children:t.jsx(kt,{callbackUrl:a,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:d})}),e[3]=d,e[4]=f):f=e[4],f}let l;return e[5]!==n||e[6]!==i?(l=t.jsx(os,{requestedOrgSlug:n,siteUrl:i}),e[5]=n,e[6]=i,e[7]=l):l=e[7],l}function os(s){const e=E.c(40),{requestedOrgSlug:n,siteUrl:i}=s,o=it(),c=It(),[r,l]=q.useState(null),[a,d]=q.useState(null),f=c.data?.map(ls)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:rs,retry:!1,onSuccess:m=>{d(m)}},e[0]=p):p=e[0];const u=ke(p);if(c.isPending){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(St,{variant:"route"}),e[1]=m):m=e[1],m}if(c.error){let m;return e[2]!==c?(m=t.jsx(Te,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=m):m=e[3],m}const x=n?f.find(m=>m.slug===n):null;if(x){let m;return e[4]!==x||e[5]!==i?(m=t.jsx(we,{org:x,initialSiteUrl:i}),e[4]=x,e[5]=i,e[6]=m):m=e[6],m}if(n){let m;return e[7]!==c?(m=t.jsx(Te,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=m):m=e[8],m}if(r){let m;return e[9]!==r||e[10]!==i?(m=t.jsx(we,{org:r,initialSiteUrl:i}),e[9]=r,e[10]=i,e[11]=m):m=e[11],m}if(f.length===1&&f[0]){let m;return e[12]!==f[0]||e[13]!==i?(m=t.jsx(we,{org:f[0],initialSiteUrl:i}),e[12]=f[0],e[13]=i,e[14]=m):m=e[14],m}if(f.length>1){let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(te,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=m):m=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=v=>l(v),e[16]=b):b=e[16];let C;return e[17]!==f?(C=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx(De,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Je,{organizations:f,selectLabel:"Continue",onSelected:b})})]})}),e[17]=f,e[18]=C):C=e[18],C}if(!a){let m;e[19]!==u?(m=()=>{u.reset(),u.mutate()},e[19]=u,e[20]=m):m=e[20];let b;return e[21]!==u||e[22]!==m?(b=t.jsx(as,{mutation:u,onRetry:m}),e[21]=u,e[22]=m,e[23]=b):b=e[23],b}const g=a;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let m;return e[24]!==g.organization||e[25]!==i?(m=t.jsx(we,{org:g.organization,initialSiteUrl:i}),e[24]=g.organization,e[25]=i,e[26]=m):m=e[26],m}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let m;e[27]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(te,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=m):m=e[27];const b=g.domain??void 0;let C;e[28]!==o||e[29]!==i?(C=(N,_)=>{ot(),l({...N,slug:_}),o({to:"/commerce-onboarding",search:{org:_,siteUrl:i}})},e[28]=o,e[29]=i,e[30]=C):C=e[30];let v;return e[31]!==g.organizations||e[32]!==b||e[33]!==C?(v=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[m,t.jsx(De,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(Je,{organizations:g.organizations,domain:b,onJoined:C})})]})}),e[31]=g.organizations,e[32]=b,e[33]=C,e[34]=v):v=e[34],v}const j=g?.error??"We could not determine a commerce organization for this account.";let y;e[35]!==u?(y=()=>{d(null),u.reset()},e[35]=u,e[36]=y):y=e[36];let h;return e[37]!==j||e[38]!==y?(h=t.jsx(Te,{title:"Commerce onboarding needs support",description:j,actionLabel:"Try again",onRetry:y}),e[37]=j,e[38]=y,e[39]=h):h=e[39],h}async function rs(){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&&ot(),e}function ls(s){return{id:s.id,name:s.name,slug:s.slug,logo:s.logo??null}}function as(s){const e=E.c(7),{mutation:n,onRetry:i}=s,o=q.useRef(!1);let c;e[0]!==n?(c=d=>{!d||o.current||(o.current=!0,n.mutate())},e[0]=n,e[1]=c):c=e[1];const r=c;if(n.error){let d;return e[2]!==i?(d=t.jsx(Te,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:i}),e[2]=i,e[3]=d):d=e[3],d}let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ue,{variant:"workspace"}),e[4]=l):l=e[4];let a;return e[5]!==r?(a=t.jsx(Y,{children:t.jsx("div",{ref:r,children:l})}),e[5]=r,e[6]=a):a=e[6],a}function te(s){const e=E.c(8),{title:n,description:i}=s,o=Nt();let c;e[0]!==o?(c=o?t.jsx(jt,{host:o}):t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=o,e[1]=c):c=e[1];let r;e[2]!==i||e[3]!==n?(r=(n||i)&&t.jsxs("div",{className:"space-y-2",children:[n&&t.jsx("h1",{className:"text-2xl font-medium leading-8",children:n}),i&&t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:i})]}),e[2]=i,e[3]=n,e[4]=r):r=e[4];let l;return e[5]!==c||e[6]!==r?(l=t.jsxs("div",{className:"grid gap-10",children:[c,r]}),e[5]=c,e[6]=r,e[7]=l):l=e[7],l}function Te(s){const e=E.c(9),{title:n,description:i,actionLabel:o,onRetry:c}=s;let r;e[0]!==i||e[1]!==n?(r=t.jsx(te,{title:n,description:i}),e[0]=i,e[1]=n,e[2]=r):r=e[2];let l;e[3]!==o||e[4]!==c?(l=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:c,children:o}),e[3]=o,e[4]=c,e[5]=l):l=e[5];let a;return e[6]!==r||e[7]!==l?(a=t.jsx(Y,{children:t.jsxs("div",{className:"grid gap-10",children:[r,l]})}),e[6]=r,e[7]=l,e[8]=a):a=e[8],a}function cs(s){return s.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function Ie(s){const e=s;if(e.isError)throw new Error(cs(e));return e.structuredContent??s}function we(s){const e=E.c(10),{org:n,initialSiteUrl:i}=s,{data:o}=Be.useSession(),c=o?.user?.email;let r;e[0]!==i||e[1]!==c?(r=xt({siteUrl:i,email:c}),e[0]=i,e[1]=c,e[2]=r):r=e[2];const l=r;let a;e[3]!==l?(a=t.jsx(yt,{href:l}),e[3]=l,e[4]=a):a=e[4];const d=a;let f;return e[5]!==i||e[6]!==d||e[7]!==n||e[8]!==o?.user?.email?(f=t.jsx(wt,{children:p=>{const{reset:u}=p;return t.jsx(Et,{fallback:x=>{const{error:g,resetError:j}=x;return t.jsx(Y,{visual:d,children:t.jsx(ds,{orgName:n.name,message:g instanceof Error?g.message:"We could not check Commerce Discovery setup.",onRetry:()=>{u(),j()}})})},children:t.jsx(q.Suspense,{fallback:t.jsx(Y,{visual:d,children:t.jsx(Ue,{variant:"connect"})}),children:t.jsx(us,{org:n,initialSiteUrl:i,sessionEmail:o?.user?.email},`${n.id}:${i??""}`)})})}}),e[5]=i,e[6]=d,e[7]=n,e[8]=o?.user?.email,e[9]=f):f=e[9],f}function ds(s){const e=E.c(10),{orgName:n,message:i,onRetry:o}=s,c=`Commerce setup will continue for ${n}.`;let r;e[0]!==c?(r=t.jsx(te,{title:"Commerce diagnostics",description:c}),e[0]=c,e[1]=r):r=e[1];let l;e[2]!==i?(l=t.jsx(Oe,{message:i}),e[2]=i,e[3]=l):l=e[3];let a;e[4]!==o?(a=t.jsx(B,{type:"button",size:"xl",className:"w-full",onClick:o,children:"Retry"}),e[4]=o,e[5]=a):a=e[5];let d;return e[6]!==r||e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"grid gap-10",children:[r,l,a]}),e[6]=r,e[7]=l,e[8]=a,e[9]=d):d=e[9],d}function us(s){const e=E.c(104),{org:n,initialSiteUrl:i,sessionEmail:o}=s,c=it();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:lt,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const l=Re(r),[a,d]=q.useState(i??""),[f,p]=q.useState(null),[u,x]=q.useState(null),g=q.useRef(!1),j=rt.COMMERCE_DISCOVERY(n.id),y=Rt(n.id),h=W.commerceDiscoveryConnection(n.id,j);let m;e[3]!==j||e[4]!==l?(m=async()=>{const $=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:j}});return Ie($)},e[3]=j,e[4]=l,e[5]=m):m=e[5];let b;e[6]!==h||e[7]!==m?(b={queryKey:h,queryFn:m,retry:!1},e[6]=h,e[7]=m,e[8]=b):b=e[8];const C=Xe(b),v=W.commerceDiscoveryVirtualMcp(n.id,y);let N;e[9]!==l||e[10]!==y?(N=async()=>{const $=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:y}});return Ie($)},e[9]=l,e[10]=y,e[11]=N):N=e[11];let _;e[12]!==v||e[13]!==N?(_={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=_):_=e[14];const T=Xe(_);let k;e[15]!==l?(k=async $=>{const H=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:$}});return Ie(H)},e[15]=l,e[16]=k):k=e[16];let w;e[17]!==C||e[18]!==T?(w=$=>{p($),x(null),C.refetch(),T.refetch()},e[17]=C,e[18]=T,e[19]=w):w=e[19];let F;e[20]===Symbol.for("react.memo_cache_sentinel")?(F=$=>{x($ instanceof Error?$.message:"Commerce Discovery setup failed.")},e[20]=F):F=e[20];let R;e[21]!==k||e[22]!==w?(R={mutationFn:k,retry:!1,onSuccess:w,onError:F},e[21]=k,e[22]=w,e[23]=R):R=e[23];const I=ke(R);let P;e[24]!==l?(P={mutationFn:async $=>{const H=await l.callTool({name:"COMMERCE_DISCOVERY_RUN",arguments:{siteUrl:$}});return Ie(H)},retry:!1},e[24]=l,e[25]=P):P=e[25];const A=ke(P),D=!!C.data.item&&!!T.data.item,K=C.data.item,M=typeof K?.metadata?.siteUrl=="string"?K.metadata.siteUrl:void 0,U=i||a||M||"";let z;e[26]!==U||e[27]!==o?(z=xt({siteUrl:U,email:o}),e[26]=U,e[27]=o,e[28]=z):z=e[28];const S=z;let L;e[29]!==S?(L=t.jsx(yt,{href:S}),e[29]=S,e[30]=L):L=e[30];const V=L;let Z;e[31]!==I?(Z=$=>{const H=Ee($);if(!H.ok){x(H.error);return}x(null),I.mutate(H.value)},e[31]=I,e[32]=Z):Z=e[32];const O=Z;let G;e[33]!==i||e[34]!==O||e[35]!==D?(G=$=>{!$||g.current||D||!i||(g.current=!0,O(i))},e[33]=i,e[34]=O,e[35]=D,e[36]=G):G=e[36];const je=G;let be;e[37]!==O||e[38]!==a?(be=$=>{$.preventDefault(),O(a)},e[37]=O,e[38]=a,e[39]=be):be=e[39];const X=be;let Ce;e[40]!==j||e[41]!==f?.reportApp||e[42]!==y?(Ce=f?.reportApp??{connectionId:j,virtualMcpId:y,toolName:Ut},e[40]=j,e[41]=f?.reportApp,e[42]=y,e[43]=Ce):Ce=e[43];const Q=Ce;let Se;e[44]!==U||e[45]!==c||e[46]!==n.slug||e[47]!==Q.connectionId||e[48]!==Q.toolName||e[49]!==Q.virtualMcpId||e[50]!==A?(Se=()=>{const $=Ee(U);$.ok&&A.mutate($.value),localStorage.setItem(Tt.sidebarOpen(),JSON.stringify(!1)),c({to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:Q.virtualMcpId,main:Ot(Q.connectionId,Q.toolName),chat:0}})},e[44]=U,e[45]=c,e[46]=n.slug,e[47]=Q.connectionId,e[48]=Q.toolName,e[49]=Q.virtualMcpId,e[50]=A,e[51]=Se):Se=e[51];const $e=Se;if(D){let $;return e[52]!==S||e[53]!==V||e[54]!==U||e[55]!==$e||e[56]!==n||e[57]!==Q?($=t.jsx(ms,{org:n,reportApp:Q,onOpenReport:$e,meetingUrl:S,meetingVisual:V,siteUrl:U}),e[52]=S,e[53]=V,e[54]=U,e[55]=$e,e[56]=n,e[57]=Q,e[58]=$):$=e[58],$}if(i){let $;e[59]!==i?($=Ee(i),e[59]=i,e[60]=$):$=e[60];const H=$;if(!H.ok){const Le=`Commerce setup will continue for ${n.name}.`;let ae;e[61]!==Le?(ae=t.jsx(te,{title:"Commerce diagnostics",description:Le}),e[61]=Le,e[62]=ae):ae=e[62];let ce;e[63]!==H.error?(ce=t.jsx(Oe,{message:H.error}),e[63]=H.error,e[64]=ce):ce=e[64];let de;e[65]!==X||e[66]!==u||e[67]!==I.isPending||e[68]!==a?(de=t.jsx(Ae,{siteUrl:a,error:u,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X}),e[65]=X,e[66]=u,e[67]=I.isPending,e[68]=a,e[69]=de):de=e[69];let ue;e[70]!==ae||e[71]!==ce||e[72]!==de?(ue=t.jsxs("div",{className:"grid gap-10",children:[ae,ce,de]}),e[70]=ae,e[71]=ce,e[72]=de,e[73]=ue):ue=e[73];let _e;return e[74]!==V||e[75]!==ue?(_e=t.jsx(Y,{visual:V,children:ue}),e[74]=V,e[75]=ue,e[76]=_e):_e=e[76],_e}const ze=`Commerce Discovery is being prepared for ${H.value}.`;let oe;e[77]!==ze?(oe=t.jsx(te,{title:"Commerce diagnostics",description:ze}),e[77]=ze,e[78]=oe):oe=e[78];let re;e[79]!==X||e[80]!==u||e[81]!==I||e[82]!==a?(re=u?t.jsxs(t.Fragment,{children:[t.jsx(Oe,{message:u}),t.jsx(Ae,{siteUrl:a,error:null,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X})]}):t.jsx(Ue,{variant:"setup"}),e[79]=X,e[80]=u,e[81]=I,e[82]=a,e[83]=re):re=e[83];let le;e[84]!==oe||e[85]!==re||e[86]!==je?(le=t.jsxs("div",{ref:je,className:"grid gap-10",children:[oe,re]}),e[84]=oe,e[85]=re,e[86]=je,e[87]=le):le=e[87];let Ne;return e[88]!==V||e[89]!==le?(Ne=t.jsx(Y,{visual:V,children:le}),e[88]=V,e[89]=le,e[90]=Ne):Ne=e[90],Ne}const Pe=`Commerce setup will continue for ${n.name}.`;let ne;e[91]!==Pe?(ne=t.jsx(te,{title:"Commerce diagnostics",description:Pe}),e[91]=Pe,e[92]=ne):ne=e[92];let se;e[93]!==X||e[94]!==u||e[95]!==I.isPending||e[96]!==a?(se=t.jsx(Ae,{siteUrl:a,error:u,isSubmitting:I.isPending,onSiteUrlChange:d,onSubmit:X}),e[93]=X,e[94]=u,e[95]=I.isPending,e[96]=a,e[97]=se):se=e[97];let ie;e[98]!==ne||e[99]!==se?(ie=t.jsxs("div",{className:"grid gap-10",children:[ne,se]}),e[98]=ne,e[99]=se,e[100]=ie):ie=e[100];let ve;return e[101]!==V||e[102]!==ie?(ve=t.jsx(Y,{visual:V,children:ie}),e[101]=V,e[102]=ie,e[103]=ve):ve=e[103],ve}function Ae(s){const e=E.c(22),{siteUrl:n,error:i,isSubmitting:o,onSiteUrlChange:c,onSubmit:r}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=l):l=e[0];let a;e[1]!==c?(a=y=>c(y.target.value),e[1]=c,e[2]=a):a=e[2];const d=!!i;let f;e[3]!==o||e[4]!==n||e[5]!==a||e[6]!==d?(f=t.jsx(Ge,{id:"commerce-site-url",type:"text",inputMode:"url",value:n,onChange:a,placeholder:"https://example.com","aria-invalid":d,disabled:o}),e[3]=o,e[4]=n,e[5]=a,e[6]=d,e[7]=f):f=e[7];let p;e[8]!==i?(p=i?t.jsx(Oe,{message:i}):null,e[8]=i,e[9]=p):p=e[9];let u;e[10]!==f||e[11]!==p?(u=t.jsxs("div",{className:"grid gap-2",children:[l,f,p]}),e[10]=f,e[11]=p,e[12]=u):u=e[12];let x;e[13]!==o?(x=o?t.jsx(ts,{}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(at,{size:16})]}),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==o||e[16]!==x?(g=t.jsx(B,{type:"submit",size:"xl",className:"w-full",disabled:o,children:x}),e[15]=o,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==r||e[19]!==u||e[20]!==g?(j=t.jsxs("form",{className:"grid gap-4",onSubmit:r,children:[u,g]}),e[18]=r,e[19]=u,e[20]=g,e[21]=j):j=e[21],j}function ms(s){const e=E.c(20),{org:n,reportApp:i,onOpenReport:o,meetingUrl:c,meetingVisual:r,siteUrl:l}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(te,{}),e[0]=a):a=e[0];let d;e[1]!==n||e[2]!==i.connectionId||e[3]!==l?(d=t.jsx(Qn,{org:n,cdConnectionId:i.connectionId,siteUrl:l}),e[1]=n,e[2]=i.connectionId,e[3]=l,e[4]=d):d=e[4];let f;e[5]!==c?(f=t.jsx(Jn,{className:"md:hidden",href:c}),e[5]=c,e[6]=f):f=e[6];const p=!i.virtualMcpId;let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(at,{size:18}),e[7]=u):u=e[7];let x;e[8]!==o||e[9]!==p?(x=t.jsxs(B,{type:"button",size:"xl",className:"w-full rounded-2xl text-base font-medium",onClick:o,disabled:p,children:["See full report",u]}),e[8]=o,e[9]=p,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=t.jsxs("div",{className:"flex shrink-0 flex-col gap-3 md:mt-8",children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let j;e[14]!==d||e[15]!==g?(j=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[a,d,g]}),e[14]=d,e[15]=g,e[16]=j):j=e[16];let y;return e[17]!==r||e[18]!==j?(y=t.jsx(Y,{align:"fill",visual:r,children:j}),e[17]=r,e[18]=j,e[19]=y):y=e[19],y}function Oe(s){const e=E.c(2),{message:n}=s;let i;return e[0]!==n?(i=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:n}),e[0]=n,e[1]=i):i=e[1],i}export{Ci as default};
@@ -1 +1 @@
1
- import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-CpYfLdbh.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-C2ETGOlj.js";import{S as _}from"./chat-context-B8Pf9_Ws.js";import{i as $}from"./ChevronUp-CazSoL4d.js";import{a as A}from"./Eye-evykl5te.js";import{u as B}from"./studio-tools-DgyOaysE.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
1
+ import{c as b,C as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-8IVTNNP6.js";import{d as I,e as S,c as E,b as R,a as D}from"./dialog-De44o6RM.js";import{S as _}from"./chat-context-KTj5-AOt.js";import{i as $}from"./ChevronUp-M8W7UfeY.js";import{a as A}from"./Eye-C_Xoo8qw.js";import{u as B}from"./studio-tools-Cs_A_fFf.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(E,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(R,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(D,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};