decocms 4.145.4 → 4.146.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 (244) hide show
  1. package/dist/README.md +1 -0
  2. package/dist/client/assets/{AlertCircle-CSQCPj_V.js → AlertCircle-B7r3EaII.js} +1 -1
  3. package/dist/client/assets/{AreaChart-BMJ7Mtx-.js → AreaChart-BymqE9V8.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-B6IlW6Qi.js → ArrowUp-BQshHDSK.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-eD5g-cFd.js → ArrowUpRight-BCZbaWin.js} +1 -1
  6. package/dist/client/assets/{Check-CWNssTV8.js → Check-DgYNB0_V.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DDuWLqUq.js → CheckCircle-CN5-9xsQ.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BWHEr7M7.js → ChevronDown-CHc-y-Al.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Bqyf0yi2.js → ChevronRight-9d4jtA28.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-ROaBb_s7.js → ChevronUp-B-O9_nTC.js} +1 -1
  11. package/dist/client/assets/{Copy01-_e4tlhaR.js → Copy01-C5QjOujR.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-C-UD1H-W.js → DotsVertical-BIcnJzPR.js} +1 -1
  13. package/dist/client/assets/{Eye-BZEDG_yV.js → Eye-Cvgl0KNf.js} +1 -1
  14. package/dist/client/assets/{FilterLines-B2iuWHYg.js → FilterLines-DGkZM5wO.js} +1 -1
  15. package/dist/client/assets/{HardDrive-1qI5HKiO.js → HardDrive-Cs2Ept5K.js} +1 -1
  16. package/dist/client/assets/{Key01-AWbv_wld.js → Key01-CABDssnL.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CGP9_srE.js → LayoutLeft-B0iWGVbj.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-BHxU7hA5.js → LinkExternal01-CuFbC-Ib.js} +1 -1
  19. package/dist/client/assets/{LogOut01-BHFIF5pV.js → LogOut01-BTC97zIN.js} +1 -1
  20. package/dist/client/assets/{Monitor01-kMl_aKHS.js → Monitor01-CmLdEM36.js} +1 -1
  21. package/dist/client/assets/{Palette-BStHvqZ6.js → Palette-D7J1kWGW.js} +1 -1
  22. package/dist/client/assets/{Play-CgnGl0Ls.js → Play-eSj6vmxE.js} +1 -1
  23. package/dist/client/assets/{Plus-CSNWQMMp.js → Plus-Ca5ksK2g.js} +1 -1
  24. package/dist/client/assets/{SearchLg-LtdaD4ZG.js → SearchLg-CPBJr8DH.js} +1 -1
  25. package/dist/client/assets/{SearchMd-BEvxAPyw.js → SearchMd-B26GBZrh.js} +1 -1
  26. package/dist/client/assets/{Settings02-DWHb-lRw.js → Settings02-CxyT3aA1.js} +1 -1
  27. package/dist/client/assets/{Shield01-T-UpndO1.js → Shield01-Cv0doLKj.js} +1 -1
  28. package/dist/client/assets/{Star01-qAZqSHYs.js → Star01-CVXcsIV7.js} +1 -1
  29. package/dist/client/assets/{Stars01-CO4iRFT5.js → Stars01-C6tvzvYW.js} +1 -1
  30. package/dist/client/assets/{Stars02-DLFxhacf.js → Stars02-BiPhZp0l.js} +1 -1
  31. package/dist/client/assets/{Sun-Bmj9T9Hs.js → Sun-DuCKp6uv.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-SFOutJ0F.js → SwitchHorizontal01-BTb2rFJr.js} +1 -1
  33. package/dist/client/assets/{Tool01-DluxhvbR.js → Tool01-CtxHxaVb.js} +1 -1
  34. package/dist/client/assets/{Tool02-5oU4U7Oz.js → Tool02-CT9ZXUaF.js} +1 -1
  35. package/dist/client/assets/{Trash01-BecpyKSB.js → Trash01-a9h5F5OE.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-DxZS9i5H.js → TrendUp01-B0KTJh5U.js} +1 -1
  37. package/dist/client/assets/{Upload01-D6mhS0Il.js → Upload01-Cc8J1X67.js} +1 -1
  38. package/dist/client/assets/{User01-CAYZjCBh.js → User01-DYrVlXdz.js} +1 -1
  39. package/dist/client/assets/{Users01-CJn3nv4f.js → Users01-B0OeOpb3.js} +1 -1
  40. package/dist/client/assets/{Users03-DgykpOrm.js → Users03-CwkNhzLs.js} +1 -1
  41. package/dist/client/assets/{X-CalOG8rP.js → X-Dpv9CfhB.js} +1 -1
  42. package/dist/client/assets/{XCircle-CfbsFoSm.js → XCircle-_qYA_TW_.js} +1 -1
  43. package/dist/client/assets/{XClose-BFk0sz9G.js → XClose-DyN8kvjl.js} +1 -1
  44. package/dist/client/assets/{Zap-BNdcgXgA.js → Zap-CbUqvhH7.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-Dm2_KtgV.js → ZapSquare-BJsaOMIO.js} +1 -1
  46. package/dist/client/assets/{access-gate-BPcsz4E2.js → access-gate-DRL0-3Sz.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-BV6Pejty.js → add-section-modal-C-b1r5D8.js} +1 -1
  48. package/dist/client/assets/{agent-icon-aWRSFV3S.js → agent-icon-UVuzT1cN.js} +1 -1
  49. package/dist/client/assets/{agents-list-Doi_CXpl.js → agents-list-DSB9MzCv.js} +1 -1
  50. package/dist/client/assets/ai-providers-WhunEA4I.js +1 -0
  51. package/dist/client/assets/{alert-C7dLb2xM.js → alert-DzGSEr4W.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-CI_jOgZR.js → alert-dialog-D7aaUEgg.js} +2 -2
  53. package/dist/client/assets/app-editor-DdGWFPsv.js +1 -0
  54. package/dist/client/assets/{auth-ByPgJhb1.js → auth-BIKfPH28.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BrR9Uohz.js → auth-catchall-EB957YqX.js} +1 -1
  56. package/dist/client/assets/auth-entry-Bw6_-UpI.js +1 -0
  57. package/dist/client/assets/{auth-split-layout-WhFDNx9E.js → auth-split-layout-CqVnmbzx.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-BjOG3bpy.js → authenticate-and-persist-oauth-CdKnhp_q.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-xT8oiUOD.js → automation-list-row-IdmGWs3t.js} +1 -1
  60. package/dist/client/assets/{automation-runs-BZROadaX.js → automation-runs-qAKBH1Z0.js} +1 -1
  61. package/dist/client/assets/{automations-B0GAyss_.js → automations-BT0hUV83.js} +1 -1
  62. package/dist/client/assets/{avatar-2NkvJFhn.js → avatar-C6aV7hw3.js} +1 -1
  63. package/dist/client/assets/{badge-BkDtGQCF.js → badge-B33YJ7h5.js} +1 -1
  64. package/dist/client/assets/{block-document-5TIiP0i6.js → block-document-DfWCrJb2.js} +1 -1
  65. package/dist/client/assets/{brand-context-BMuLBGKb.js → brand-context-C4P0vyrn.js} +1 -1
  66. package/dist/client/assets/{buckets-DhwsPAZ0.js → buckets-BJGzD4J6.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-BcSXynyW.js +1 -0
  68. package/dist/client/assets/{calendar-Cd5zs7es.js → calendar-DYOKaG5a.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-C0MHRICc.js → capability-load-error-qbPiIGZj.js} +1 -1
  70. package/dist/client/assets/{card-yJEtZ44f.js → card-CNJcSytc.js} +1 -1
  71. package/dist/client/assets/category-editor-BSunnGC9.js +1 -0
  72. package/dist/client/assets/chat-context-IQhFNrCK.js +36 -0
  73. package/dist/client/assets/{checkbox-5E1V-xvi.js → checkbox-DyIcCVMx.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BoXabKLI.js → cli-auth-success-wGPbI1I0.js} +1 -1
  75. package/dist/client/assets/{collection-detail-6rxSJkCq.js → collection-detail-DDpdB3wI.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-CBvgEV5M.js → collection-display-button-IQpgfmoE.js} +1 -1
  77. package/dist/client/assets/{collection-search-vT5mWioA.js → collection-search-DSPRiMjg.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-CEpWE0F9.js → collection-table-wrapper-Z05WN6kF.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-Cm8oTUd7.js → collection-tabs-CrOZFtVh.js} +1 -1
  80. package/dist/client/assets/{command-Dq6iipS5.js → command-Bia5XJF-.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-CdsU1n7i.js → commerce-onboarding-DH0DawO2.js} +1 -1
  82. package/dist/client/assets/{companions-core-DBWG3_HY.js → companions-core-HnFl8baM.js} +1 -1
  83. package/dist/client/assets/connect-x5iIXh5i.js +8 -0
  84. package/dist/client/assets/{connection-C42PVCSd.js → connection-BWCT-l_B.js} +1 -1
  85. package/dist/client/assets/{connection-card-CK8a5ay6.js → connection-card-BGFGJ3dJ.js} +1 -1
  86. package/dist/client/assets/connection-detail-qEKau9L0.js +1 -0
  87. package/dist/client/assets/{connection-form-helpers-C2rTDrzA.js → connection-form-helpers-GHi3zYxQ.js} +1 -1
  88. package/dist/client/assets/connections-ZqhZNVLK.js +1 -0
  89. package/dist/client/assets/{decopilot-sse-pool-C1RJsJS0.js → decopilot-sse-pool-BGikXbt8.js} +1 -1
  90. package/dist/client/assets/{dialog-Dq_peVG0.js → dialog-BPjvUNGD.js} +1 -1
  91. package/dist/client/assets/{domain-settings-CtzeSPRr.js → domain-settings-DVqzPc4K.js} +1 -1
  92. package/dist/client/assets/{drawer-BSvXGda-.js → drawer-D-mvJkqQ.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BuPKJUY8.js → dropdown-menu-CaL7DApX.js} +1 -1
  94. package/dist/client/assets/{empty-state-BZSpYvM0.js → empty-state-0sZo57jy.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-ZTR7xcCD.js → extract-connection-data-Bq1iwuT1.js} +1 -1
  96. package/dist/client/assets/file-explorer-sI7DMd8g.js +2 -0
  97. package/dist/client/assets/{form-Da6Pak5q.js → form-CUC6wee5.js} +1 -1
  98. package/dist/client/assets/{general-Dxp-Gk6z.js → general-BtU55mHB.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-BjY_cbDW.js → github-repo-picker-BeYuKlOy.js} +1 -1
  100. package/dist/client/assets/{hooks-CiBCHAEU.js → hooks-Ckdzt-Nv.js} +2 -2
  101. package/dist/client/assets/{index-CXiIkJNe.js → index-BDZ-VwFU.js} +1 -1
  102. package/dist/client/assets/index-BmsAtj16.js +1 -0
  103. package/dist/client/assets/index-CCczML2o.js +8 -0
  104. package/dist/client/assets/{index-k6yNjC6u.js → index-CS6AKJgD.js} +1 -1
  105. package/dist/client/assets/{index-CVc4ITjm.js → index-C_usV78a.js} +1 -1
  106. package/dist/client/assets/{index-luz2_Kqi.js → index-Ca_3YTYR.js} +1 -1
  107. package/dist/client/assets/{index-Bl2gwdpO.js → index-CcB8mZk8.js} +1 -1
  108. package/dist/client/assets/{index-fII9c_kY.js → index-CpReHYcd.js} +37 -37
  109. package/dist/client/assets/{index-SsOp9DoN.js → index-DDHOxC3K.js} +1 -1
  110. package/dist/client/assets/{index-sd38S2ER.js → index-DDug671b.js} +27 -27
  111. package/dist/client/assets/{index-CHt7Tdc5.js → index-DPvg2w8m.js} +1 -1
  112. package/dist/client/assets/index-DolLSrq-.css +1 -0
  113. package/dist/client/assets/{index-redirect-DJUUAT-x.js → index-redirect-M0BGCOfn.js} +1 -1
  114. package/dist/client/assets/{input-Df5WqCIh.js → input-CGjm14VM.js} +1 -1
  115. package/dist/client/assets/{integration-icon-D-DwNzR1.js → integration-icon-CdNdqZ3V.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-Rie9X6aX.js → invite-member-dialog-BnrRiacj.js} +1 -1
  117. package/dist/client/assets/{label-q5RWAz3v.js → label-DjBQc1IG.js} +1 -1
  118. package/dist/client/assets/{layout-4S09taad.js → layout-D7T8iG74.js} +1 -1
  119. package/dist/client/assets/{login-BT0MtgCn.js → login-B95uBFC4.js} +1 -1
  120. package/dist/client/assets/mcp-oauth-Cfiwi3-V.js +1 -0
  121. package/dist/client/assets/{members-BFl3wg6J.js → members-BY9BwWjA.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-Cxpp-hMU.js → monaco-editor-CpDJSoQc.js} +4 -4
  123. package/dist/client/assets/{monitoring-stats-row-C_ZvOQMg.js → monitoring-stats-row-CmnOxXTZ.js} +1 -1
  124. package/dist/client/assets/{multi-select-BLzsq679.js → multi-select-CAhHEpPq.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-DW7fVwr1.js → oauth-callback-UjIBoeiV.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-CiK488OV.js → oauth-callback-ai-provider-l88D6VMW.js} +1 -1
  127. package/dist/client/assets/{onboarding-BG6NzFm2.js → onboarding-8HLGhCuk.js} +1 -1
  128. package/dist/client/assets/{org-install-DGkz2TMa.js → org-install-B4B99JK6.js} +1 -1
  129. package/dist/client/assets/{org-layout-B-rNRqK1.js → org-layout-UVBxFbNY.js} +1 -1
  130. package/dist/client/assets/{organization-choice-CeiMbljd.js → organization-choice-CKKJ8Ypb.js} +1 -1
  131. package/dist/client/assets/{orgs-KwuNkzmk.js → orgs-BjdOoHWm.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-soQoyhZq.js → page-seo-form-DRzF-Mc_.js} +1 -1
  133. package/dist/client/assets/{popover-BxXBf9EH.js → popover-BPNEzQ0m.js} +1 -1
  134. package/dist/client/assets/post-editor-CgEdOmfW.js +1 -0
  135. package/dist/client/assets/{primitives-hG3gzivQ.js → primitives-BJ98RSW8.js} +1 -1
  136. package/dist/client/assets/{profile-0GWHiBFp.js → profile-BCbQwPC3.js} +1 -1
  137. package/dist/client/assets/project-app-view-BhAIxf5D.js +1 -0
  138. package/dist/client/assets/record-editor-YBfn4rg-.js +1 -0
  139. package/dist/client/assets/redirect-editor-avdBkJrC.js +1 -0
  140. package/dist/client/assets/registry-DufVFHM-.js +2 -0
  141. package/dist/client/assets/{registry-layout-BPmkJ_es.js → registry-layout-CmY2dO5z.js} +1 -1
  142. package/dist/client/assets/{reports-9uRBgUwC.js → reports-BaPkY152.js} +1 -1
  143. package/dist/client/assets/{require-capability-CqQ6B0ux.js → require-capability-DhQvBPSi.js} +1 -1
  144. package/dist/client/assets/{required-auth-layout-CIVjmrI-.js → required-auth-layout-2Mdec4Xs.js} +1 -1
  145. package/dist/client/assets/{reset-password-CWGs2cLw.js → reset-password-sZTFKMEK.js} +1 -1
  146. package/dist/client/assets/{roles-CdAcWw-W.js → roles-D9O9VAcM.js} +1 -1
  147. package/dist/client/assets/{search-input-C0Tu8jAx.js → search-input-D1r_hzL6.js} +1 -1
  148. package/dist/client/assets/{secrets-rhPict2d.js → secrets-C8Avtf_0.js} +1 -1
  149. package/dist/client/assets/{sections-editor-CVy2fhWn.js → sections-editor-C5gvXfu2.js} +2 -2
  150. package/dist/client/assets/{select-BaiNHGHX.js → select-Csj8R7k2.js} +1 -1
  151. package/dist/client/assets/select-model-U0fL_6_X.js +4 -0
  152. package/dist/client/assets/{self-tool-result-DKMkJU4m.js → self-tool-result-BGsopSDN.js} +1 -1
  153. package/dist/client/assets/seo-editor-D3h_SAyN.js +1 -0
  154. package/dist/client/assets/{settings-layout-C5m3Vodh.js → settings-layout-Bz4oLNkE.js} +1 -1
  155. package/dist/client/assets/{settings-section-BzmRZGKV.js → settings-section-BDJITHua.js} +1 -1
  156. package/dist/client/assets/{shell-controls-zNdpglpf.js → shell-controls-7CChtS3i.js} +1 -1
  157. package/dist/client/assets/{shell-layout-OumtAwy1.js → shell-layout-YbtfJ2t7.js} +1 -1
  158. package/dist/client/assets/{sidebar-DTxjIJ56.js → sidebar-BjwcFmHe.js} +1 -1
  159. package/dist/client/assets/{skeleton-Bqf4wcUq.js → skeleton-DJEY9mQO.js} +1 -1
  160. package/dist/client/assets/{sso-y15zIhWp.js → sso-CY40Ae_n.js} +1 -1
  161. package/dist/client/assets/{store-Bdo34j2n.js → store-HH-7F5MX.js} +1 -1
  162. package/dist/client/assets/store-registry-BOAH46-F.js +2 -0
  163. package/dist/client/assets/{studio-tools-C9O5T6hk.js → studio-tools-BVOWXGL8.js} +1 -1
  164. package/dist/client/assets/{switch-DzR4USnH.js → switch-xBTYAphU.js} +1 -1
  165. package/dist/client/assets/{tab-id-D67TyC-3.js → tab-id-B-A7fEMu.js} +1 -1
  166. package/dist/client/assets/{table-CW9azojk.js → table-C6TyHppk.js} +1 -1
  167. package/dist/client/assets/{tabs-Dg2fovl2.js → tabs-DeUeCPgO.js} +1 -1
  168. package/dist/client/assets/{textarea-B-mbIfJP.js → textarea-BS0D_b-K.js} +1 -1
  169. package/dist/client/assets/{toggle-group-Bd_5HjJ1.js → toggle-group-Cz7IyNF-.js} +1 -1
  170. package/dist/client/assets/{toolbar-BQhumIzA.js → toolbar-pO-Q748B.js} +1 -1
  171. package/dist/client/assets/{tooltip-Bjx5IK0l.js → tooltip-WZpxGeui.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-Dsmt_TQY.js → use-ai-providers-D_DNnD-Q.js} +1 -1
  173. package/dist/client/assets/{use-automations-DAZgpS9S.js → use-automations-Dupm5wzI.js} +1 -1
  174. package/dist/client/assets/{use-autosave-B5hezYu8.js → use-autosave-Z8Xd52Fx.js} +1 -1
  175. package/dist/client/assets/{use-capability-DbSBzq4m.js → use-capability-CSraCk_w.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-9uLrrBUm.js → use-clock-tick-D5KJnX9J.js} +1 -1
  177. package/dist/client/assets/{use-connection-DtVPu3zH.js → use-connection-BH3GAkyc.js} +1 -1
  178. package/dist/client/assets/{use-copy-BmXjtpVk.js → use-copy-yAEQGKxe.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-CZZVOBEo.js → use-create-virtual-mcp-ZxuwOjY4.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-CV9YJ4dj.js → use-debounced-autosave-CnxCSHa2.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-BhoOs69E.js → use-debounced-value-d1LbDD45.js} +1 -1
  182. package/dist/client/assets/use-deco-credits-BKe46R4j.js +1 -0
  183. package/dist/client/assets/{use-decopilot-events-Hca5p5mu.js → use-decopilot-events-Rl4pYnmz.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-BA2vzFXU.js → use-delete-connection-DqRcaJY_.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-DmRm5A9N.js → use-deployment-admin-b6x6KmxH.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-giwXdJFa.js → use-file-configs-DNPvjrq1.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-BOm4DukJ.js → use-infinite-scroll-BCQQzaQW.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-DamNnIat.js → use-join-requests-6PSEubYq.js} +1 -1
  189. package/dist/client/assets/{use-mcp-auth-status-BggNWMN0.js → use-mcp-auth-status-DNePqWs9.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-Cav0AiKw.js → use-mcp-client-BHIx7JlY.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-BvTay4jb.js → use-mcp-tools-Dv1bErmV.js} +1 -1
  192. package/dist/client/assets/{use-members-1alkNMLr.js → use-members-DMaPK1aF.js} +1 -1
  193. package/dist/client/assets/{use-mobile-DxvpAkbd.js → use-mobile-CnuHZAQe.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-DWHbwpLC.js → use-navigate-to-agent-BUCfyhQC.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-HGMDWZ37.js → use-org-auth-client-OPJSyera.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-elnfvOdJ.js → use-org-sso-VUn3tGLY.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-Dlno3YRH.js → use-organization-roles-BUFxH_8r.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-C8aPcOm4.js → use-organization-settings-lxipe-fc.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-BJ4Y5FI-.js → use-registry-connections-z0q_Ein8.js} +1 -1
  200. package/dist/client/assets/{use-secrets-5yqKG0Fz.js → use-secrets-BPx1_drU.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-BkECfwLj.js → use-status-sounds-DCs1a_56.js} +1 -1
  202. package/dist/client/assets/{use-tags-DhH7fJ9n.js → use-tags-DBN4__BV.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-QVi8YiL9.js → use-view-mode-BOoVU3bc.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-DzUwFLTQ.js → use-virtual-mcp-BlRB4Rkc.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-BIQdmDG8.js +1 -0
  206. package/dist/client/assets/{useQueries-CHVnUdBY.js → useQueries-UeWiznkI.js} +1 -1
  207. package/dist/client/assets/{useRouterState-CJgrSpoY.js → useRouterState-DC4XQJbr.js} +1 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-B1FcYDrn.js +1 -0
  209. package/dist/client/assets/{users-BHNa2I19.js → users-BWqTd_-2.js} +1 -1
  210. package/dist/client/assets/variant-calendar-TzpScg5D.js +1 -0
  211. package/dist/client/assets/{view-mode-toggle-CeRa3z7B.js → view-mode-toggle-CawzraQZ.js} +1 -1
  212. package/dist/client/index.html +2 -2
  213. package/dist/client/native-boot.js +20 -0
  214. package/dist/server/cli.js +7 -1
  215. package/dist/server/server.js +1 -1
  216. package/package.json +2 -2
  217. package/dist/client/assets/ai-providers-CmDhk4US.js +0 -1
  218. package/dist/client/assets/app-editor-Chpkqa2F.js +0 -1
  219. package/dist/client/assets/auth-entry-BFtkZTwu.js +0 -1
  220. package/dist/client/assets/bulk-category-panel-C5e6mdWG.js +0 -1
  221. package/dist/client/assets/category-editor-BB1Wibnh.js +0 -1
  222. package/dist/client/assets/chat-context-DoK0lfG3.js +0 -36
  223. package/dist/client/assets/connect-B_S04Bfy.js +0 -8
  224. package/dist/client/assets/connect-desktop-dialog-BUp1haXa.js +0 -1
  225. package/dist/client/assets/connection-detail-DP-88uz5.js +0 -1
  226. package/dist/client/assets/connections-PwhMV6Az.js +0 -1
  227. package/dist/client/assets/file-explorer-DOrJ6I00.js +0 -2
  228. package/dist/client/assets/index-CIJ4b6SD.js +0 -8
  229. package/dist/client/assets/index-CaPJLPSU.js +0 -1
  230. package/dist/client/assets/index-DSghpBCP.css +0 -1
  231. package/dist/client/assets/mcp-oauth-C159CTqw.js +0 -1
  232. package/dist/client/assets/post-editor-BOGVp1SK.js +0 -1
  233. package/dist/client/assets/project-app-view-DGcbWl7X.js +0 -1
  234. package/dist/client/assets/record-editor-BKkPOez0.js +0 -1
  235. package/dist/client/assets/redirect-editor-n2iW7SHJ.js +0 -1
  236. package/dist/client/assets/registry-CfztJypZ.js +0 -2
  237. package/dist/client/assets/select-model-C_5UqaCI.js +0 -4
  238. package/dist/client/assets/seo-editor-CbwzBxXD.js +0 -1
  239. package/dist/client/assets/store-registry-DscNaxt3.js +0 -2
  240. package/dist/client/assets/use-api-keys-CSaFJXfD.js +0 -1
  241. package/dist/client/assets/use-deco-credits-CWhdUeI9.js +0 -1
  242. package/dist/client/assets/useInfiniteQuery-cI69eqxa.js +0 -1
  243. package/dist/client/assets/useSuspenseInfiniteQuery-DXLjl_Ue.js +0 -1
  244. package/dist/client/assets/variant-calendar-Dx1J5lqR.js +0 -1
@@ -1 +1 @@
1
- import{c as E,b as $,j as i,m as Le,p as se,B as ve,u as Ge,q as it,r as B,a as Te,d as ot,s as st,e as Ye,v as Se,w as Je,Q as nt,E as lt,K as Fe,x as $e,N as at}from"./index-sd38S2ER.js";import{L as ct,s as ke,S as He,i as mt,n as Ie,C as Xe,p as Re}from"./self-tool-result-DKMkJU4m.js";import{A as dt}from"./auth-entry-BFtkZTwu.js";import{A as ut}from"./auth-split-layout-WhFDNx9E.js";import{O as Be}from"./organization-choice-CeiMbljd.js";import{I as gt}from"./input-Df5WqCIh.js";import{D as ft,a as We,b as pt,c as ht}from"./dropdown-menu-BuPKJUY8.js";import{S as bt,u as xt,W as yt,g as jt,a as Ct}from"./use-mcp-client-Cav0AiKw.js";import{i as Ot}from"./XCircle-CfbsFoSm.js";import{i as vt}from"./ArrowUpRight-eD5g-cFd.js";import"./integration-icon-D-DwNzR1.js";import"./Tool02-5oU4U7Oz.js";import"./agent-icon-aWRSFV3S.js";import"./AlertCircle-CSQCPj_V.js";import"./Tool01-DluxhvbR.js";import"./ArrowUp-B6IlW6Qi.js";import"./Settings02-DWHb-lRw.js";import"./TrendUp01-DxZS9i5H.js";import"./ZapSquare-Dm2_KtgV.js";import"./Users03-DgykpOrm.js";import"./CheckCircle-DDuWLqUq.js";import"./Check-CWNssTV8.js";import"./ChevronDown-BWHEr7M7.js";import"./ChevronRight-Bqyf0yi2.js";import"./ChevronUp-ROaBb_s7.js";import"./DotsVertical-C-UD1H-W.js";import"./Stars02-DLFxhacf.js";import"./Copy01-_e4tlhaR.js";import"./Eye-BZEDG_yV.js";import"./FilterLines-B2iuWHYg.js";import"./Star01-qAZqSHYs.js";import"./Palette-BStHvqZ6.js";import"./SwitchHorizontal01-SFOutJ0F.js";import"./HardDrive-1qI5HKiO.js";import"./Key01-AWbv_wld.js";import"./LayoutLeft-CGP9_srE.js";import"./LinkExternal01-BHxU7hA5.js";import"./LogOut01-BHFIF5pV.js";import"./Monitor01-kMl_aKHS.js";import"./Sun-Bmj9T9Hs.js";import"./Play-CgnGl0Ls.js";import"./Plus-CSNWQMMp.js";import"./SearchLg-LtdaD4ZG.js";import"./SearchMd-BEvxAPyw.js";import"./Shield01-T-UpndO1.js";import"./Stars01-CO4iRFT5.js";import"./Trash01-BecpyKSB.js";import"./Upload01-D6mhS0Il.js";import"./User01-CAYZjCBh.js";import"./Users01-CJn3nv4f.js";import"./XClose-BFk0sz9G.js";import"./X-CalOG8rP.js";import"./Zap-BNdcgXgA.js";import"./dialog-Dq_peVG0.js";import"./tooltip-Bjx5IK0l.js";import"./companions-core-DBWG3_HY.js";import"./extract-connection-data-ZTR7xcCD.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./form-Da6Pak5q.js";import"./label-q5RWAz3v.js";import"./use-debounced-value-BhoOs69E.js";import"./useQueries-CHVnUdBY.js";import"./authenticate-and-persist-oauth-BjOG3bpy.js";import"./mcp-oauth-C159CTqw.js";import"./auth-ByPgJhb1.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-2NkvJFhn.js";const qe={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ve=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],St="var(--brand-green-dark)";function Me({siteUrl:t,email:e,locale:o}){const s=(o&&qe[o])??qe["pt-BR"]??"https://decocms.com/agendar",r=new URL(s);return t&&r.searchParams.set("siteUrl",t),e&&r.searchParams.set("email",e),r.toString()}function _t(t){const e=E.c(15),{href:o,size:s,className:r,orgId:a}=t,l=s===void 0?"lg":s,n=$();let c;e[0]!==r?(c=Le("w-full",r),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==a?(m=()=>se("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=u):u=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(vt,{size:16}),e[6]=d):d=e[6];let g;e[7]!==o||e[8]!==m||e[9]!==u?(g=i.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",onClick:m,children:[u,d]}),e[7]=o,e[8]=m,e[9]=u,e[10]=g):g=e[10];let p;return e[11]!==l||e[12]!==c||e[13]!==g?(p=i.jsx(ve,{asChild:!0,variant:"outline",size:l,className:c,children:g}),e[11]=l,e[12]=c,e[13]=g,e[14]=p):p=e[14],p}function wt(t){const e=E.c(13),{size:o}=t,s=o===void 0?72:o,r=$();let a;e[0]!==r?(a=r("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=r,e[1]=a):a=e[1];const l=a;let n;e[2]!==s?(n=Math.round(s*.3),e[2]=s,e[3]=n):n=e[3];const c=n;let m;e[4]!==s?(m={height:s},e[4]=s,e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==c||e[8]!==s?(u=Ve.map((g,p)=>i.jsxs("div",{className:"relative shrink-0",style:{width:s,height:s,marginLeft:p===0?0:-c,zIndex:Ve.length-p},children:[i.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:i.jsx("img",{src:g,alt:l,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&i.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),i.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},g)),e[6]=l,e[7]=c,e[8]=s,e[9]=u):u=e[9];let d;return e[10]!==m||e[11]!==u?(d=i.jsx("div",{className:"flex items-end",style:m,children:u}),e[10]=m,e[11]=u,e[12]=d):d=e[12],d}function De(t){const e=E.c(19),{href:o,orgId:s}=t,r=$();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"h-20",style:{backgroundColor:St}}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"-mt-9 mb-4",children:i.jsx(wt,{})}),e[1]=l):l=e[1];let n;e[2]!==r?(n=r("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=r,e[3]=n):n=e[3];let c;e[4]!==n?(c=i.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r?(m=r("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=i.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=u):u=e[9];let d;e[10]!==c||e[11]!==u?(d=i.jsxs("div",{className:"grid gap-1.5",children:[c,u]}),e[10]=c,e[11]=u,e[12]=d):d=e[12];let g;e[13]!==o||e[14]!==s?(g=i.jsx(_t,{href:o,size:"lg",className:"mt-6",orgId:s}),e[13]=o,e[14]=s,e[15]=g):g=e[15];let p;return e[16]!==d||e[17]!==g?(p=i.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:i.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[a,i.jsxs("div",{className:"px-8 pb-8",children:[l,d,g]})]})}),e[16]=d,e[17]=g,e[18]=p):p=e[18],p}function Ze(t){const e=E.c(10),{host:o}=t,s=`https://www.google.com/s2/favicons?domain=${o}&sz=128`;let r,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=i.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=r,e[1]=a,e[2]=l):(r=e[0],a=e[1],l=e[2]);let n;e[3]!==s?(n=i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:i.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==o?(c=i.jsx("span",{className:"text-lg font-medium text-foreground",children:o}),e[5]=o,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=i.jsxs("div",{className:"flex items-center gap-3",children:[r,a,l,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function Ae(t){const e=E.c(5),{variant:o}=t,s=$();let r;e[0]!==s||e[1]!==o?(r=s(o==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=s,e[1]=o,e[2]=r):r=e[2];const a=r;let l;return e[3]!==a?(l=i.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:i.jsx(ct,{label:a,className:"text-muted-foreground"})}),e[3]=a,e[4]=l):l=e[4],l}function ri(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(It,{}),t[0]=e):e=t[0],e}const et=B.createContext(null),tt=()=>B.useContext(et);function Nt(){const t=E.c(22),[e,o]=Se(),s=e.language==="pt-BR"?"PT-BR":"EN";let r;t[0]!==s?(r=i.jsx(ft,{asChild:!0,children:i.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:s})}),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==o?(a=()=>{o(Ut)},t[2]=o,t[3]=a):a=t[3];const l=e.language==="en"&&"bg-accent";let n;t[4]!==l?(n=Le(l),t[4]=l,t[5]=n):n=t[5];let c;t[6]!==a||t[7]!==n?(c=i.jsx(We,{onClick:a,className:n,children:"English"}),t[6]=a,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==o?(m=()=>{o(Et)},t[9]=o,t[10]=m):m=t[10];const u=e.language==="pt-BR"&&"bg-accent";let d;t[11]!==u?(d=Le(u),t[11]=u,t[12]=d):d=t[12];let g;t[13]!==m||t[14]!==d?(g=i.jsx(We,{onClick:m,className:d,children:"Português (Brasil)"}),t[13]=m,t[14]=d,t[15]=g):g=t[15];let p;t[16]!==c||t[17]!==g?(p=i.jsxs(pt,{align:"end",children:[c,g]}),t[16]=c,t[17]=g,t[18]=p):p=t[18];let v;return t[19]!==r||t[20]!==p?(v=i.jsxs(ht,{children:[r,p]}),t[19]=r,t[20]=p,t[21]=v):v=t[21],v}function Et(t){return{...t,language:"pt-BR"}}function Ut(t){return{...t,language:"en"}}function T(t){const e=E.c(17);let o,s,r;e[0]!==t?({visual:r,children:o,...s}=t,e[0]=t,e[1]=o,e[2]=s,e[3]=r):(o=e[1],s=e[2],r=e[3]);let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/commerce-onboarding"},e[4]=a):a=e[4];const l=Ge(a),{data:n}=Te.useSession(),[c]=Se(),m=n?.user?.email;let u;e[5]!==c.language||e[6]!==l.siteUrl||e[7]!==m?(u=Me({siteUrl:l.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=e[8];const d=u;let g;e[9]!==d||e[10]!==r?(g=r??i.jsx(De,{href:d}),e[9]=d,e[10]=r,e[11]=g):g=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsxs("div",{className:"flex justify-between items-start mb-8",children:[i.jsx("div",{}),i.jsx(Nt,{})]}),e[12]=p):p=e[12];let v;return e[13]!==o||e[14]!==s||e[15]!==g?(v=i.jsxs(ut,{...s,visual:g,children:[p,o]}),e[13]=o,e[14]=s,e[15]=g,e[16]=v):v=e[16],v}function Pt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}function Ke(t,e){switch(e){case"Enter a website URL.":return t("routes.commerceOnboarding.siteUrl.enterUrl");case"Use an HTTP or HTTPS website URL.":return t("routes.commerceOnboarding.siteUrl.useHttpOrHttps");case"Enter a valid website URL.":return t("routes.commerceOnboarding.siteUrl.enterValidUrl");case"__configurationFailed":return t("routes.commerceOnboarding.configurationFailed");default:return e}}let Qe=!1;function It(){const t=Ge({from:"/commerce-onboarding"}),{org:e,siteUrl:o}=t,s=ke(o);return!Qe&&it()&&(Qe=!0,se("commerce_onboarding_viewed",{site_url:o,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),i.jsx(et.Provider,{value:s,children:i.jsx(Rt,{requestedOrgSlug:e,siteUrl:o})})}function Rt(t){const e=E.c(14),{requestedOrgSlug:o,siteUrl:s}=t,r=$(),{data:a,isPending:l}=Te.useSession(),n=tt();if(l){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(T,{children:i.jsx(Ae,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!a){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==r?(u=r("routes.commerceOnboarding.unlockDiagnostic"),e[1]=r,e[2]=u):u=e[2];let d;e[3]!==n?(d=n?i.jsx(Ze,{host:n}):void 0,e[3]=n,e[4]=d):d=e[4];let g;e[5]!==r?(g=Pt(r),e[5]=r,e[6]=g):g=e[6];let p;return e[7]!==u||e[8]!==d||e[9]!==g?(p=i.jsx(T,{children:i.jsx(dt,{callbackUrl:m,allowAutoLogin:!1,title:u,subtitle:null,brand:d,copy:g})}),e[7]=u,e[8]=d,e[9]=g,e[10]=p):p=e[10],p}let c;return e[11]!==o||e[12]!==s?(c=i.jsx(zt,{requestedOrgSlug:o,siteUrl:s}),e[11]=o,e[12]=s,e[13]=c):c=e[13],c}function zt(t){const e=E.c(95),{requestedOrgSlug:o,siteUrl:s}=t,r=$(),a=ot(),l=st(),[n,c]=B.useState(null),[m,u]=B.useState(null),d=l.data?.map(kt)??[];let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={mutationFn:Lt,retry:!1,onSuccess:f=>{u(f)}},e[0]=g):g=e[0];const p=Ye(g);if(l.isPending){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(T,{children:i.jsx(Ae,{variant:"workspace"})}),e[1]=f):f=e[1],f}if(l.error){let f;e[2]!==r?(f=r("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=r,e[3]=f):f=e[3];let h;e[4]!==r?(h=r("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=r,e[5]=h):h=e[5];let x;e[6]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=x):x=e[7];let j;e[8]!==l?(j=()=>l.refetch(),e[8]=l,e[9]=j):j=e[9];let O;return e[10]!==f||e[11]!==h||e[12]!==x||e[13]!==j?(O=i.jsx(Ce,{title:f,description:h,actionLabel:x,onRetry:j}),e[10]=f,e[11]=h,e[12]=x,e[13]=j,e[14]=O):O=e[14],O}const v=o?d.find(f=>f.slug===o):null;if(v){let f;return e[15]!==v||e[16]!==s?(f=i.jsx(je,{org:v,initialSiteUrl:s}),e[15]=v,e[16]=s,e[17]=f):f=e[17],f}if(o){let f;e[18]!==r?(f=r("routes.commerceOnboarding.orgNotFound"),e[18]=r,e[19]=f):f=e[19];let h;e[20]!==r?(h=r("routes.commerceOnboarding.couldNotFindOrg"),e[20]=r,e[21]=h):h=e[21];let x;e[22]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[22]=r,e[23]=x):x=e[23];let j;e[24]!==l?(j=()=>l.refetch(),e[24]=l,e[25]=j):j=e[25];let O;return e[26]!==f||e[27]!==h||e[28]!==x||e[29]!==j?(O=i.jsx(Ce,{title:f,description:h,actionLabel:x,onRetry:j}),e[26]=f,e[27]=h,e[28]=x,e[29]=j,e[30]=O):O=e[30],O}if(n){let f;return e[31]!==n||e[32]!==s?(f=i.jsx(je,{org:n,initialSiteUrl:s}),e[31]=n,e[32]=s,e[33]=f):f=e[33],f}if(d.length===1&&d[0]){let f;return e[34]!==d[0]||e[35]!==s?(f=i.jsx(je,{org:d[0],initialSiteUrl:s}),e[34]=d[0],e[35]=s,e[36]=f):f=e[36],f}if(d.length>1){let f;e[37]!==r?(f=r("routes.commerceOnboarding.chooseOrg"),e[37]=r,e[38]=f):f=e[38];let h;e[39]!==r?(h=r("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=r,e[40]=h):h=e[40];let x;e[41]!==f||e[42]!==h?(x=i.jsx(W,{title:f,description:h}),e[41]=f,e[42]=h,e[43]=x):x=e[43];let j;e[44]!==r?(j=r("routes.commerceOnboarding.authCopy.continue"),e[44]=r,e[45]=j):j=e[45];let O;e[46]!==a||e[47]!==s?(O=V=>a({to:"/commerce-onboarding",search:{org:V.slug,siteUrl:s}}),e[46]=a,e[47]=s,e[48]=O):O=e[48];let C;e[49]!==d||e[50]!==j||e[51]!==O?(C=i.jsx(He,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(Be,{organizations:d,selectLabel:j,onSelected:O})}),e[49]=d,e[50]=j,e[51]=O,e[52]=C):C=e[52];let D;return e[53]!==x||e[54]!==C?(D=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[x,C]})}),e[53]=x,e[54]=C,e[55]=D):D=e[55],D}if(!m){let f;e[56]!==p?(f=()=>{p.reset(),p.mutate()},e[56]=p,e[57]=f):f=e[57];let h;return e[58]!==p||e[59]!==f?(h=i.jsx(Tt,{mutation:p,onRetry:f}),e[58]=p,e[59]=f,e[60]=h):h=e[60],h}const b=m;if(b?.success&&(b.status==="created"||b.status==="joined"||b.status==="already_has_organization")&&b.organization){let f;return e[61]!==b.organization||e[62]!==s?(f=i.jsx(je,{org:b.organization,initialSiteUrl:s}),e[61]=b.organization,e[62]=s,e[63]=f):f=e[63],f}if(b?.status==="ambiguous"&&b.organizations&&b.organizations.length>0){let f;e[64]!==r?(f=r("routes.commerceOnboarding.chooseOrg"),e[64]=r,e[65]=f):f=e[65];let h;e[66]!==r?(h=r("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[66]=r,e[67]=h):h=e[67];let x;e[68]!==f||e[69]!==h?(x=i.jsx(W,{title:f,description:h}),e[68]=f,e[69]=h,e[70]=x):x=e[70];const j=b.domain??void 0;let O;e[71]!==a||e[72]!==s?(O=(V,q)=>{Je(),c({...V,slug:q}),a({to:"/commerce-onboarding",search:{org:q,siteUrl:s}})},e[71]=a,e[72]=s,e[73]=O):O=e[73];let C;e[74]!==b.organizations||e[75]!==j||e[76]!==O?(C=i.jsx(He,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(Be,{organizations:b.organizations,domain:j,onJoined:O})}),e[74]=b.organizations,e[75]=j,e[76]=O,e[77]=C):C=e[77];let D;return e[78]!==x||e[79]!==C?(D=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[x,C]})}),e[78]=x,e[79]=C,e[80]=D):D=e[80],D}let w;e[81]!==r?(w=r("routes.commerceOnboarding.onboardingNeedsSupport"),e[81]=r,e[82]=w):w=e[82];let N;e[83]!==b?.error||e[84]!==r?(N=b?.error??r("routes.commerceOnboarding.couldNotDetermineOrg"),e[83]=b?.error,e[84]=r,e[85]=N):N=e[85];let P;e[86]!==r?(P=r("routes.commerceOnboarding.retryAgain"),e[86]=r,e[87]=P):P=e[87];let U;e[88]!==p?(U=()=>{u(null),p.reset()},e[88]=p,e[89]=U):U=e[89];let M;return e[90]!==w||e[91]!==N||e[92]!==P||e[93]!==U?(M=i.jsx(Ce,{title:w,description:N,actionLabel:P,onRetry:U}),e[90]=w,e[91]=N,e[92]=P,e[93]=U,e[94]=M):M=e[94],M}async function Lt(){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&&Je(),e}function kt(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function Tt(t){const e=E.c(16),{mutation:o,onRetry:s}=t,r=$(),a=B.useRef(!1);let l;e[0]!==o?(l=u=>{!u||a.current||(a.current=!0,o.mutate())},e[0]=o,e[1]=l):l=e[1];const n=l;if(o.error){let u;e[2]!==r?(u=r("routes.commerceOnboarding.onboardingUnavailable"),e[2]=r,e[3]=u):u=e[3];let d;e[4]!==r?(d=r("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=r,e[5]=d):d=e[5];let g;e[6]!==r?(g=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=g):g=e[7];let p;return e[8]!==s||e[9]!==u||e[10]!==d||e[11]!==g?(p=i.jsx(Ce,{title:u,description:d,actionLabel:g,onRetry:s}),e[8]=s,e[9]=u,e[10]=d,e[11]=g,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Ae,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=i.jsx(T,{children:i.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function W(t){const e=E.c(8),{title:o,description:s}=t,r=tt();let a;e[0]!==r?(a=r?i.jsx(Ze,{host:r}):i.jsxs("div",{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s||e[3]!==o?(l=(o||s)&&i.jsxs("div",{className:"space-y-2",children:[o&&i.jsx("h1",{className:"text-2xl font-medium leading-8",children:o}),s&&i.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let n;return e[5]!==a||e[6]!==l?(n=i.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=n):n=e[7],n}function Ce(t){const e=E.c(9),{title:o,description:s,actionLabel:r,onRetry:a}=t;let l;e[0]!==s||e[1]!==o?(l=i.jsx(W,{title:o,description:s}),e[0]=s,e[1]=o,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==a?(n=i.jsx(ve,{type:"button",size:"xl",className:"w-full",onClick:a,children:r}),e[3]=r,e[4]=a,e[5]=n):n=e[5];let c;return e[6]!==l||e[7]!==n?(c=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[l,n]})}),e[6]=l,e[7]=n,e[8]=c):c=e[8],c}function je(t){const e=E.c(13),{org:o,initialSiteUrl:s}=t,r=$(),{data:a}=Te.useSession(),[l]=Se(),n=a?.user?.email;let c;e[0]!==s||e[1]!==l.language||e[2]!==n?(c=Me({siteUrl:s,email:n,locale:l.language}),e[0]=s,e[1]=l.language,e[2]=n,e[3]=c):c=e[3];const m=c;let u;e[4]!==m||e[5]!==o.id?(u=i.jsx(De,{href:m,orgId:o.id}),e[4]=m,e[5]=o.id,e[6]=u):u=e[6];const d=u;let g;return e[7]!==s||e[8]!==d||e[9]!==o||e[10]!==a?.user?.email||e[11]!==r?(g=i.jsx(nt,{children:p=>{const{reset:v}=p;return i.jsx(lt,{fallback:b=>{const{error:w,resetError:N}=b;return i.jsx(T,{visual:d,children:i.jsx(Mt,{orgName:o.name,message:w instanceof Error?w.message:r("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{v(),N()}})})},children:i.jsx(B.Suspense,{fallback:i.jsx(rt,{visual:d}),children:i.jsx(Dt,{org:o,initialSiteUrl:s,sessionEmail:a?.user?.email},`${o.id}:${s??""}`)})})}}),e[7]=s,e[8]=d,e[9]=o,e[10]=a?.user?.email,e[11]=r,e[12]=g):g=e[12],g}function rt(t){const e=E.c(3),{visual:o}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[i.jsx(W,{}),i.jsx(Xe,{})]}),e[0]=s):s=e[0];let r;return e[1]!==o?(r=i.jsx(T,{align:"fill",visual:o,children:s}),e[1]=o,e[2]=r):r=e[2],r}function Mt(t){const e=E.c(19),{orgName:o,message:s,onRetry:r}=t,a=$();let l;e[0]!==a?(l=a("routes.commerceOnboarding.commerceDiagnostic"),e[0]=a,e[1]=l):l=e[1];let n;e[2]!==o||e[3]!==a?(n=a("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o}),e[2]=o,e[3]=a,e[4]=n):n=e[4];let c;e[5]!==l||e[6]!==n?(c=i.jsx(W,{title:l,description:n}),e[5]=l,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==s?(m=i.jsx(Oe,{message:s}),e[8]=s,e[9]=m):m=e[9];let u;e[10]!==a?(u=a("routes.commerceOnboarding.retryAgain"),e[10]=a,e[11]=u):u=e[11];let d;e[12]!==r||e[13]!==u?(d=i.jsx(ve,{type:"button",size:"xl",className:"w-full",onClick:r,children:u}),e[12]=r,e[13]=u,e[14]=d):d=e[14];let g;return e[15]!==c||e[16]!==m||e[17]!==d?(g=i.jsxs("div",{className:"grid gap-10",children:[c,m,d]}),e[15]=c,e[16]=m,e[17]=d,e[18]=g):g=e[18],g}function Dt(t){const e=E.c(135),{org:o,initialSiteUrl:s,sessionEmail:r}=t;let a;e[0]!==o.id||e[1]!==o.slug?(a={connectionId:bt,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=a):a=e[2];const l=xt(a),[n,c]=B.useState(s??""),[m,u]=B.useState(null),d=B.useRef(!1),g=yt.COMMERCE_DISCOVERY(o.id),p=jt(o.id),v=Fe.commerceDiscoveryConnection(o.id,g);let b;e[3]!==g||e[4]!==l?(b=async()=>{const y=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:g}});return Re(y)},e[3]=g,e[4]=l,e[5]=b):b=e[5];let w;e[6]!==v||e[7]!==b?(w={queryKey:v,queryFn:b,retry:!1},e[6]=v,e[7]=b,e[8]=w):w=e[8];const N=$e(w),P=Fe.commerceDiscoveryVirtualMcp(o.id,p);let U;e[9]!==l||e[10]!==p?(U=async()=>{const y=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Re(y)},e[9]=l,e[10]=p,e[11]=U):U=e[11];let M;e[12]!==P||e[13]!==U?(M={queryKey:P,queryFn:U,retry:!1},e[12]=P,e[13]=U,e[14]=M):M=e[14];const f=$e(M);let h;e[15]!==l?(h=async y=>{const S=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Re(S)},e[15]=l,e[16]=h):h=e[16];let x;e[17]!==N||e[18]!==o.id||e[19]!==f?(x=(y,S)=>{se("commerce_onboarding_setup_succeeded",{domain:ke(S)??void 0,organization_id:o.id}),u(null),N.refetch(),f.refetch()},e[17]=N,e[18]=o.id,e[19]=f,e[20]=x):x=e[20];let j;e[21]!==o.id?(j=(y,S)=>{se("commerce_onboarding_setup_failed",{domain:ke(S)??void 0,organization_id:o.id,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:"__configurationFailed")},e[21]=o.id,e[22]=j):j=e[22];let O;e[23]!==j||e[24]!==h||e[25]!==x?(O={mutationFn:h,retry:!1,onSuccess:x,onError:j},e[23]=j,e[24]=h,e[25]=x,e[26]=O):O=e[26];const C=Ye(O),D=!!N.data.item&&!!f.data.item,V=N.data.item,q=typeof V?.metadata?.siteUrl=="string"?V.metadata.siteUrl:void 0,_e=s||n||"";let ne;e[27]!==q||e[28]!==_e?(ne=mt(_e,q),e[27]=q,e[28]=_e,e[29]=ne):ne=e[29];const le=D&&ne,ae=s||n||q||"",_=$(),[we]=Se();let ce;e[30]!==ae||e[31]!==we.language||e[32]!==r?(ce=Me({siteUrl:ae,email:r,locale:we.language}),e[30]=ae,e[31]=we.language,e[32]=r,e[33]=ce):ce=e[33];const Ne=ce;let me;e[34]!==Ne||e[35]!==o.id?(me=i.jsx(De,{href:Ne,orgId:o.id}),e[34]=Ne,e[35]=o.id,e[36]=me):me=e[36];const L=me;let de;e[37]!==m||e[38]!==_?(de=m?Ke(_,m):null,e[37]=m,e[38]=_,e[39]=de):de=e[39];const k=de;let ue;e[40]!==C?(ue=y=>{const S=Ie(y);if(!S.ok){u(S.error);return}u(null),C.mutate(S.value)},e[40]=C,e[41]=ue):ue=e[41];const K=ue;let ge;e[42]!==s||e[43]!==K||e[44]!==le?(ge=y=>{!y||d.current||le||!s||(d.current=!0,K(s))},e[42]=s,e[43]=K,e[44]=le,e[45]=ge):ge=e[45];const Ee=ge;let fe;e[46]!==o.id||e[47]!==K||e[48]!==n?(fe=y=>{y.preventDefault();const S=Ie(n);S.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:o.id}),K(n)},e[46]=o.id,e[47]=K,e[48]=n,e[49]=fe):fe=e[49];const A=fe;if(le){const y=o.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let I;e[51]!==o.slug?(I={org:y,taskId:S},e[51]=o.slug,e[52]=I):I=e[52];let R;e[53]!==o.id?(R=Ct(o.id),e[53]=o.id,e[54]=R):R=e[54];const H=ae||void 0;let z;e[55]!==R.id||e[56]!==H?(z={virtualmcpid:R.id,connect:"1",siteUrl:H},e[55]=R.id,e[56]=H,e[57]=z):z=e[57];let F;return e[58]!==I||e[59]!==z?(F=i.jsx(at,{to:"/$org/$taskId",params:I,search:z,replace:!0}),e[58]=I,e[59]=z,e[60]=F):F=e[60],F}if(C.isPending){let y;return e[61]!==L?(y=i.jsx(rt,{visual:L}),e[61]=L,e[62]=y):y=e[62],y}if(s){let y,S,I,R,H,z,F,Z;if(e[63]!==L||e[64]!==A||e[65]!==s||e[66]!==o.name||e[67]!==C.isPending||e[68]!==n||e[69]!==_||e[70]!==k||e[71]!==Ee){Z=Symbol.for("react.early_return_sentinel");e:{const Ue=Ie(s);if(!Ue.ok){let ie;e[80]!==_?(ie=_("routes.commerceOnboarding.commerceDiagnostic"),e[80]=_,e[81]=ie):ie=e[81];let oe;e[82]!==o.name||e[83]!==_?(oe=_("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o.name}),e[82]=o.name,e[83]=_,e[84]=oe):oe=e[84];let be;e[85]!==ie||e[86]!==oe?(be=i.jsx(W,{title:ie,description:oe}),e[85]=ie,e[86]=oe,e[87]=be):be=e[87];let xe;e[88]!==A||e[89]!==C.isPending||e[90]!==n||e[91]!==k?(xe=i.jsx(ze,{siteUrl:n,error:k,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A}),e[88]=A,e[89]=C.isPending,e[90]=n,e[91]=k,e[92]=xe):xe=e[92];const Pe=i.jsxs("div",{className:"grid gap-10",children:[be,i.jsx(Oe,{message:Ke(_,Ue.error)}),xe]});let ye;e[93]!==L||e[94]!==Pe?(ye=i.jsx(T,{visual:L,children:Pe}),e[93]=L,e[94]=Pe,e[95]=ye):ye=e[95],Z=ye;break e}S=T,F=L,H=Ee,z="grid gap-10",y=W,e[96]!==_?(I=_("routes.commerceOnboarding.commerceDiagnostic"),e[96]=_,e[97]=I):I=e[97],R=_("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Ue.value})}e[63]=L,e[64]=A,e[65]=s,e[66]=o.name,e[67]=C.isPending,e[68]=n,e[69]=_,e[70]=k,e[71]=Ee,e[72]=y,e[73]=S,e[74]=I,e[75]=R,e[76]=H,e[77]=z,e[78]=F,e[79]=Z}else y=e[72],S=e[73],I=e[74],R=e[75],H=e[76],z=e[77],F=e[78],Z=e[79];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let ee;e[98]!==y||e[99]!==I||e[100]!==R?(ee=i.jsx(y,{title:I,description:R}),e[98]=y,e[99]=I,e[100]=R,e[101]=ee):ee=e[101];let te;e[102]!==A||e[103]!==C.isPending||e[104]!==n||e[105]!==k?(te=k?i.jsxs(i.Fragment,{children:[i.jsx(Oe,{message:k}),i.jsx(ze,{siteUrl:n,error:null,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A})]}):i.jsx(Xe,{}),e[102]=A,e[103]=C.isPending,e[104]=n,e[105]=k,e[106]=te):te=e[106];let re;e[107]!==H||e[108]!==z||e[109]!==ee||e[110]!==te?(re=i.jsxs("div",{ref:H,className:z,children:[ee,te]}),e[107]=H,e[108]=z,e[109]=ee,e[110]=te,e[111]=re):re=e[111];let he;return e[112]!==S||e[113]!==F||e[114]!==re?(he=i.jsx(S,{visual:F,children:re}),e[112]=S,e[113]=F,e[114]=re,e[115]=he):he=e[115],he}let Q;e[116]!==_?(Q=_("routes.commerceOnboarding.commerceDiagnostic"),e[116]=_,e[117]=Q):Q=e[117];let G;e[118]!==o.name||e[119]!==_?(G=_("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o.name}),e[118]=o.name,e[119]=_,e[120]=G):G=e[120];let Y;e[121]!==Q||e[122]!==G?(Y=i.jsx(W,{title:Q,description:G}),e[121]=Q,e[122]=G,e[123]=Y):Y=e[123];let J;e[124]!==A||e[125]!==C.isPending||e[126]!==n||e[127]!==k?(J=i.jsx(ze,{siteUrl:n,error:k,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A}),e[124]=A,e[125]=C.isPending,e[126]=n,e[127]=k,e[128]=J):J=e[128];let X;e[129]!==Y||e[130]!==J?(X=i.jsxs("div",{className:"grid gap-10",children:[Y,J]}),e[129]=Y,e[130]=J,e[131]=X):X=e[131];let pe;return e[132]!==L||e[133]!==X?(pe=i.jsx(T,{visual:L,children:X}),e[132]=L,e[133]=X,e[134]=pe):pe=e[134],pe}function ze(t){const e=E.c(30),{siteUrl:o,error:s,isSubmitting:r,onSiteUrlChange:a,onSubmit:l}=t,n=$();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=i.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let u;e[4]!==a?(u=M=>a(M.target.value),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==n?(d=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=d):d=e[7];const g=!!s;let p;e[8]!==r||e[9]!==o||e[10]!==u||e[11]!==d||e[12]!==g?(p=i.jsx(gt,{id:"commerce-site-url",type:"text",inputMode:"url",value:o,onChange:u,placeholder:d,"aria-invalid":g,disabled:r}),e[8]=r,e[9]=o,e[10]=u,e[11]=d,e[12]=g,e[13]=p):p=e[13];let v;e[14]!==s?(v=s?i.jsx(Oe,{message:s}):null,e[14]=s,e[15]=v):v=e[15];let b;e[16]!==m||e[17]!==p||e[18]!==v?(b=i.jsxs("div",{className:"grid gap-2",children:[m,p,v]}),e[16]=m,e[17]=p,e[18]=v,e[19]=b):b=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Ot,{size:16}),e[22]=N):N=e[22];let P;e[23]!==r||e[24]!==w?(P=i.jsxs(ve,{type:"submit",size:"xl",className:"w-full",disabled:r,children:[w,N]}),e[23]=r,e[24]=w,e[25]=P):P=e[25];let U;return e[26]!==l||e[27]!==P||e[28]!==b?(U=i.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[b,P]}),e[26]=l,e[27]=P,e[28]=b,e[29]=U):U=e[29],U}function Oe(t){const e=E.c(2),{message:o}=t;let s;return e[0]!==o?(s=i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:o}),e[0]=o,e[1]=s):s=e[1],s}export{ri as default};
1
+ import{c as E,b as $,j as i,m as Le,p as se,B as ve,u as Ge,q as it,r as B,a as Te,d as ot,s as st,e as Ye,v as Se,w as Je,Q as nt,E as lt,K as Fe,x as $e,N as at}from"./index-DDug671b.js";import{L as ct,s as ke,S as He,i as mt,n as Ie,C as Xe,p as Re}from"./self-tool-result-BGsopSDN.js";import{A as dt}from"./auth-entry-Bw6_-UpI.js";import{A as ut}from"./auth-split-layout-CqVnmbzx.js";import{O as Be}from"./organization-choice-CKKJ8Ypb.js";import{I as gt}from"./input-CGjm14VM.js";import{D as ft,a as We,b as pt,c as ht}from"./dropdown-menu-CaL7DApX.js";import{S as bt,u as xt,W as yt,g as jt,a as Ct}from"./use-mcp-client-BHIx7JlY.js";import{i as Ot}from"./XCircle-_qYA_TW_.js";import{i as vt}from"./ArrowUpRight-BCZbaWin.js";import"./integration-icon-CdNdqZ3V.js";import"./Tool02-CT9ZXUaF.js";import"./agent-icon-UVuzT1cN.js";import"./AlertCircle-B7r3EaII.js";import"./Tool01-CtxHxaVb.js";import"./ArrowUp-BQshHDSK.js";import"./Settings02-CxyT3aA1.js";import"./TrendUp01-B0KTJh5U.js";import"./ZapSquare-BJsaOMIO.js";import"./Users03-CwkNhzLs.js";import"./CheckCircle-CN5-9xsQ.js";import"./Check-DgYNB0_V.js";import"./ChevronDown-CHc-y-Al.js";import"./ChevronRight-9d4jtA28.js";import"./ChevronUp-B-O9_nTC.js";import"./DotsVertical-BIcnJzPR.js";import"./Stars02-BiPhZp0l.js";import"./Copy01-C5QjOujR.js";import"./Eye-Cvgl0KNf.js";import"./FilterLines-DGkZM5wO.js";import"./Star01-CVXcsIV7.js";import"./Palette-D7J1kWGW.js";import"./SwitchHorizontal01-BTb2rFJr.js";import"./HardDrive-Cs2Ept5K.js";import"./Key01-CABDssnL.js";import"./LayoutLeft-B0iWGVbj.js";import"./LinkExternal01-CuFbC-Ib.js";import"./LogOut01-BTC97zIN.js";import"./Monitor01-CmLdEM36.js";import"./Sun-DuCKp6uv.js";import"./Play-eSj6vmxE.js";import"./Plus-Ca5ksK2g.js";import"./SearchLg-CPBJr8DH.js";import"./SearchMd-B26GBZrh.js";import"./Shield01-Cv0doLKj.js";import"./Stars01-C6tvzvYW.js";import"./Trash01-a9h5F5OE.js";import"./Upload01-Cc8J1X67.js";import"./User01-DYrVlXdz.js";import"./Users01-B0OeOpb3.js";import"./XClose-DyN8kvjl.js";import"./X-Dpv9CfhB.js";import"./Zap-CbUqvhH7.js";import"./dialog-BPjvUNGD.js";import"./tooltip-WZpxGeui.js";import"./companions-core-HnFl8baM.js";import"./extract-connection-data-Bq1iwuT1.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-DWINBxtd.js";import"./form-CUC6wee5.js";import"./label-DjBQc1IG.js";import"./use-debounced-value-d1LbDD45.js";import"./useQueries-UeWiznkI.js";import"./authenticate-and-persist-oauth-CdKnhp_q.js";import"./mcp-oauth-Cfiwi3-V.js";import"./auth-BIKfPH28.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-C6aV7hw3.js";const qe={"pt-BR":"https://decocms.com/agendar",en:"https://www.decocms.com/en/schedule"},Ve=["https://decoims.com/image?src=decocms%2Fb07a1c19-0cd6-49c8-b326-86055ee78605%2Fauthor-1763423987973-baby.jpeg&quality=original&fit=cover&width=200&height=200","https://decoims.com/decocms/07c2daf4-a3c2-485e-a1a8-341585a06e3b/cecilia.png","https://decoims.com/decocms/48013ca2-3277-464b-b0f1-dd5f1f08d986/tavano.png"],St="var(--brand-green-dark)";function Me({siteUrl:t,email:e,locale:o}){const s=(o&&qe[o])??qe["pt-BR"]??"https://decocms.com/agendar",r=new URL(s);return t&&r.searchParams.set("siteUrl",t),e&&r.searchParams.set("email",e),r.toString()}function _t(t){const e=E.c(15),{href:o,size:s,className:r,orgId:a}=t,l=s===void 0?"lg":s,n=$();let c;e[0]!==r?(c=Le("w-full",r),e[0]=r,e[1]=c):c=e[1];let m;e[2]!==a?(m=()=>se("commerce_onboarding_meeting_cta_clicked",{placement:"visual_card",organization_id:a}),e[2]=a,e[3]=m):m=e[3];let u;e[4]!==n?(u=n("routes.commerceOnboarding.scheduleMeeting.scheduleButton"),e[4]=n,e[5]=u):u=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(vt,{size:16}),e[6]=d):d=e[6];let g;e[7]!==o||e[8]!==m||e[9]!==u?(g=i.jsxs("a",{href:o,target:"_blank",rel:"noreferrer",onClick:m,children:[u,d]}),e[7]=o,e[8]=m,e[9]=u,e[10]=g):g=e[10];let p;return e[11]!==l||e[12]!==c||e[13]!==g?(p=i.jsx(ve,{asChild:!0,variant:"outline",size:l,className:c,children:g}),e[11]=l,e[12]=c,e[13]=g,e[14]=p):p=e[14],p}function wt(t){const e=E.c(13),{size:o}=t,s=o===void 0?72:o,r=$();let a;e[0]!==r?(a=r("routes.commerceOnboarding.scheduleMeeting.expertAlt"),e[0]=r,e[1]=a):a=e[1];const l=a;let n;e[2]!==s?(n=Math.round(s*.3),e[2]=s,e[3]=n):n=e[3];const c=n;let m;e[4]!==s?(m={height:s},e[4]=s,e[5]=m):m=e[5];let u;e[6]!==l||e[7]!==c||e[8]!==s?(u=Ve.map((g,p)=>i.jsxs("div",{className:"relative shrink-0",style:{width:s,height:s,marginLeft:p===0?0:-c,zIndex:Ve.length-p},children:[i.jsx("div",{className:"h-full w-full overflow-hidden rounded-full border-4 border-card bg-muted",children:i.jsx("img",{src:g,alt:l,className:"h-full w-full object-cover",loading:"lazy"})}),p===0&&i.jsxs("span",{className:"absolute bottom-1.5 right-1.5 flex h-3.5 w-3.5",children:[i.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-success opacity-60 motion-safe:animate-ping","aria-hidden":!0}),i.jsx("span",{className:"relative inline-flex h-3.5 w-3.5 rounded-full border-2 border-card bg-success"})]})]},g)),e[6]=l,e[7]=c,e[8]=s,e[9]=u):u=e[9];let d;return e[10]!==m||e[11]!==u?(d=i.jsx("div",{className:"flex items-end",style:m,children:u}),e[10]=m,e[11]=u,e[12]=d):d=e[12],d}function De(t){const e=E.c(19),{href:o,orgId:s}=t,r=$();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"h-20",style:{backgroundColor:St}}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"-mt-9 mb-4",children:i.jsx(wt,{})}),e[1]=l):l=e[1];let n;e[2]!==r?(n=r("routes.commerceOnboarding.scheduleMeeting.headline"),e[2]=r,e[3]=n):n=e[3];let c;e[4]!==n?(c=i.jsx("h2",{className:"text-lg font-medium leading-6 text-foreground",children:n}),e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r?(m=r("routes.commerceOnboarding.scheduleMeeting.body"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=i.jsx("p",{className:"text-sm leading-5 text-muted-foreground",children:m}),e[8]=m,e[9]=u):u=e[9];let d;e[10]!==c||e[11]!==u?(d=i.jsxs("div",{className:"grid gap-1.5",children:[c,u]}),e[10]=c,e[11]=u,e[12]=d):d=e[12];let g;e[13]!==o||e[14]!==s?(g=i.jsx(_t,{href:o,size:"lg",className:"mt-6",orgId:s}),e[13]=o,e[14]=s,e[15]=g):g=e[15];let p;return e[16]!==d||e[17]!==g?(p=i.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:i.jsxs("div",{className:"w-full max-w-[440px] overflow-hidden rounded-3xl border border-border bg-card card-shadow",children:[a,i.jsxs("div",{className:"px-8 pb-8",children:[l,d,g]})]})}),e[16]=d,e[17]=g,e[18]=p):p=e[18],p}function Ze(t){const e=E.c(10),{host:o}=t,s=`https://www.google.com/s2/favicons?domain=${o}&sz=128`;let r,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=i.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=r,e[1]=a,e[2]=l):(r=e[0],a=e[1],l=e[2]);let n;e[3]!==s?(n=i.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:i.jsx("img",{src:s,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==o?(c=i.jsx("span",{className:"text-lg font-medium text-foreground",children:o}),e[5]=o,e[6]=c):c=e[6];let m;return e[7]!==n||e[8]!==c?(m=i.jsxs("div",{className:"flex items-center gap-3",children:[r,a,l,n,c]}),e[7]=n,e[8]=c,e[9]=m):m=e[9],m}function Ae(t){const e=E.c(5),{variant:o}=t,s=$();let r;e[0]!==s||e[1]!==o?(r=s(o==="workspace"?"routes.commerceOnboarding.loading.preparingWorkspace":"routes.commerceOnboarding.loading.preparing"),e[0]=s,e[1]=o,e[2]=r):r=e[2];const a=r;let l;return e[3]!==a?(l=i.jsx("div",{className:"flex justify-center py-4",role:"status","aria-live":"polite",children:i.jsx(ct,{label:a,className:"text-muted-foreground"})}),e[3]=a,e[4]=l):l=e[4],l}function ri(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(It,{}),t[0]=e):e=t[0],e}const et=B.createContext(null),tt=()=>B.useContext(et);function Nt(){const t=E.c(22),[e,o]=Se(),s=e.language==="pt-BR"?"PT-BR":"EN";let r;t[0]!==s?(r=i.jsx(ft,{asChild:!0,children:i.jsx("button",{className:"text-sm font-medium text-foreground/70 hover:text-foreground transition-colors",type:"button",children:s})}),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==o?(a=()=>{o(Ut)},t[2]=o,t[3]=a):a=t[3];const l=e.language==="en"&&"bg-accent";let n;t[4]!==l?(n=Le(l),t[4]=l,t[5]=n):n=t[5];let c;t[6]!==a||t[7]!==n?(c=i.jsx(We,{onClick:a,className:n,children:"English"}),t[6]=a,t[7]=n,t[8]=c):c=t[8];let m;t[9]!==o?(m=()=>{o(Et)},t[9]=o,t[10]=m):m=t[10];const u=e.language==="pt-BR"&&"bg-accent";let d;t[11]!==u?(d=Le(u),t[11]=u,t[12]=d):d=t[12];let g;t[13]!==m||t[14]!==d?(g=i.jsx(We,{onClick:m,className:d,children:"Português (Brasil)"}),t[13]=m,t[14]=d,t[15]=g):g=t[15];let p;t[16]!==c||t[17]!==g?(p=i.jsxs(pt,{align:"end",children:[c,g]}),t[16]=c,t[17]=g,t[18]=p):p=t[18];let v;return t[19]!==r||t[20]!==p?(v=i.jsxs(ht,{children:[r,p]}),t[19]=r,t[20]=p,t[21]=v):v=t[21],v}function Et(t){return{...t,language:"pt-BR"}}function Ut(t){return{...t,language:"en"}}function T(t){const e=E.c(17);let o,s,r;e[0]!==t?({visual:r,children:o,...s}=t,e[0]=t,e[1]=o,e[2]=s,e[3]=r):(o=e[1],s=e[2],r=e[3]);let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/commerce-onboarding"},e[4]=a):a=e[4];const l=Ge(a),{data:n}=Te.useSession(),[c]=Se(),m=n?.user?.email;let u;e[5]!==c.language||e[6]!==l.siteUrl||e[7]!==m?(u=Me({siteUrl:l.siteUrl,email:m,locale:c.language}),e[5]=c.language,e[6]=l.siteUrl,e[7]=m,e[8]=u):u=e[8];const d=u;let g;e[9]!==d||e[10]!==r?(g=r??i.jsx(De,{href:d}),e[9]=d,e[10]=r,e[11]=g):g=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsxs("div",{className:"flex justify-between items-start mb-8",children:[i.jsx("div",{}),i.jsx(Nt,{})]}),e[12]=p):p=e[12];let v;return e[13]!==o||e[14]!==s||e[15]!==g?(v=i.jsxs(ut,{...s,visual:g,children:[p,o]}),e[13]=o,e[14]=s,e[15]=g,e[16]=v):v=e[16],v}function Pt(t){return{signUpFailed:t("routes.commerceOnboarding.authCopy.signUpFailed"),signInFailed:t("routes.commerceOnboarding.authCopy.signInFailed"),authenticationFailed:t("routes.commerceOnboarding.authCopy.authenticationFailed"),resetEmailFailed:t("routes.commerceOnboarding.authCopy.resetEmailFailed"),otpSendFailed:t("routes.commerceOnboarding.authCopy.otpSendFailed"),invalidCode:t("routes.commerceOnboarding.authCopy.invalidCode"),invalidEmail:t("routes.commerceOnboarding.authCopy.invalidEmail"),invalidEmailOrPassword:t("routes.commerceOnboarding.authCopy.invalidEmailOrPassword"),accountExists:t("routes.commerceOnboarding.authCopy.accountExists"),networkError:t("routes.commerceOnboarding.authCopy.networkError"),tooManyAttempts:t("routes.commerceOnboarding.authCopy.tooManyAttempts"),invalidOrExpiredCode:t("routes.commerceOnboarding.authCopy.invalidOrExpiredCode"),genericError:t("routes.commerceOnboarding.authCopy.genericError"),resetPasswordTitle:t("routes.commerceOnboarding.authCopy.resetPasswordTitle"),verificationCodeTitle:t("routes.commerceOnboarding.authCopy.verificationCodeTitle"),welcomeTitle:t("routes.commerceOnboarding.authCopy.welcomeTitle"),resetPasswordSubtitle:t("routes.commerceOnboarding.authCopy.resetPasswordSubtitle"),codeSentTo:e=>t("routes.commerceOnboarding.authCopy.codeSentTo",{email:e}),defaultSubtitle:t("routes.commerceOnboarding.authCopy.defaultSubtitle"),resetEmailSent:t("routes.commerceOnboarding.authCopy.resetEmailSent"),continueWith:e=>t("routes.commerceOnboarding.authCopy.continueWith",{provider:e}),divider:t("routes.commerceOnboarding.authCopy.divider"),emailLabel:t("routes.commerceOnboarding.authCopy.emailLabel"),emailPlaceholder:t("routes.commerceOnboarding.authCopy.emailPlaceholder"),sending:t("routes.commerceOnboarding.authCopy.sending"),sendCode:t("routes.commerceOnboarding.authCopy.sendCode"),verificationCodeLabel:t("routes.commerceOnboarding.authCopy.verificationCodeLabel"),enterCodePlaceholder:t("routes.commerceOnboarding.authCopy.enterCodePlaceholder"),verifying:t("routes.commerceOnboarding.authCopy.verifying"),verify:t("routes.commerceOnboarding.authCopy.verify"),useDifferentEmail:t("routes.commerceOnboarding.authCopy.useDifferentEmail"),sendResetLink:t("routes.commerceOnboarding.authCopy.sendResetLink"),nameLabel:t("routes.commerceOnboarding.authCopy.nameLabel"),namePlaceholder:t("routes.commerceOnboarding.authCopy.namePlaceholder"),passwordLabel:t("routes.commerceOnboarding.authCopy.passwordLabel"),forgotPassword:t("routes.commerceOnboarding.authCopy.forgotPassword"),creatingAccount:t("routes.commerceOnboarding.authCopy.creatingAccount"),signingIn:t("routes.commerceOnboarding.authCopy.signingIn"),continue:t("routes.commerceOnboarding.authCopy.continue"),backToSignIn:t("routes.commerceOnboarding.authCopy.backToSignIn"),signInWithPassword:t("routes.commerceOnboarding.authCopy.signInWithPassword"),alreadyHaveAccount:t("routes.commerceOnboarding.authCopy.alreadyHaveAccount"),dontHaveAccount:t("routes.commerceOnboarding.authCopy.dontHaveAccount"),signIn:t("routes.commerceOnboarding.authCopy.signIn"),signUp:t("routes.commerceOnboarding.authCopy.signUp"),signInWithEmailCode:t("routes.commerceOnboarding.authCopy.signInWithEmailCode")}}function Ke(t,e){switch(e){case"Enter a website URL.":return t("routes.commerceOnboarding.siteUrl.enterUrl");case"Use an HTTP or HTTPS website URL.":return t("routes.commerceOnboarding.siteUrl.useHttpOrHttps");case"Enter a valid website URL.":return t("routes.commerceOnboarding.siteUrl.enterValidUrl");case"__configurationFailed":return t("routes.commerceOnboarding.configurationFailed");default:return e}}let Qe=!1;function It(){const t=Ge({from:"/commerce-onboarding"}),{org:e,siteUrl:o}=t,s=ke(o);return!Qe&&it()&&(Qe=!0,se("commerce_onboarding_viewed",{site_url:o,domain:s??void 0,...s?{$set:{last_scanned_domain:s}}:{}})),i.jsx(et.Provider,{value:s,children:i.jsx(Rt,{requestedOrgSlug:e,siteUrl:o})})}function Rt(t){const e=E.c(14),{requestedOrgSlug:o,siteUrl:s}=t,r=$(),{data:a,isPending:l}=Te.useSession(),n=tt();if(l){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(T,{children:i.jsx(Ae,{variant:"generic"})}),e[0]=m):m=e[0],m}if(!a){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let u;e[1]!==r?(u=r("routes.commerceOnboarding.unlockDiagnostic"),e[1]=r,e[2]=u):u=e[2];let d;e[3]!==n?(d=n?i.jsx(Ze,{host:n}):void 0,e[3]=n,e[4]=d):d=e[4];let g;e[5]!==r?(g=Pt(r),e[5]=r,e[6]=g):g=e[6];let p;return e[7]!==u||e[8]!==d||e[9]!==g?(p=i.jsx(T,{children:i.jsx(dt,{callbackUrl:m,allowAutoLogin:!1,title:u,subtitle:null,brand:d,copy:g})}),e[7]=u,e[8]=d,e[9]=g,e[10]=p):p=e[10],p}let c;return e[11]!==o||e[12]!==s?(c=i.jsx(zt,{requestedOrgSlug:o,siteUrl:s}),e[11]=o,e[12]=s,e[13]=c):c=e[13],c}function zt(t){const e=E.c(95),{requestedOrgSlug:o,siteUrl:s}=t,r=$(),a=ot(),l=st(),[n,c]=B.useState(null),[m,u]=B.useState(null),d=l.data?.map(kt)??[];let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={mutationFn:Lt,retry:!1,onSuccess:f=>{u(f)}},e[0]=g):g=e[0];const p=Ye(g);if(l.isPending){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(T,{children:i.jsx(Ae,{variant:"workspace"})}),e[1]=f):f=e[1],f}if(l.error){let f;e[2]!==r?(f=r("routes.commerceOnboarding.couldNotLoadOrgs"),e[2]=r,e[3]=f):f=e[3];let h;e[4]!==r?(h=r("routes.commerceOnboarding.retryToConfigureCommerce"),e[4]=r,e[5]=h):h=e[5];let x;e[6]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=x):x=e[7];let j;e[8]!==l?(j=()=>l.refetch(),e[8]=l,e[9]=j):j=e[9];let O;return e[10]!==f||e[11]!==h||e[12]!==x||e[13]!==j?(O=i.jsx(Ce,{title:f,description:h,actionLabel:x,onRetry:j}),e[10]=f,e[11]=h,e[12]=x,e[13]=j,e[14]=O):O=e[14],O}const v=o?d.find(f=>f.slug===o):null;if(v){let f;return e[15]!==v||e[16]!==s?(f=i.jsx(je,{org:v,initialSiteUrl:s}),e[15]=v,e[16]=s,e[17]=f):f=e[17],f}if(o){let f;e[18]!==r?(f=r("routes.commerceOnboarding.orgNotFound"),e[18]=r,e[19]=f):f=e[19];let h;e[20]!==r?(h=r("routes.commerceOnboarding.couldNotFindOrg"),e[20]=r,e[21]=h):h=e[21];let x;e[22]!==r?(x=r("routes.commerceOnboarding.retryAgain"),e[22]=r,e[23]=x):x=e[23];let j;e[24]!==l?(j=()=>l.refetch(),e[24]=l,e[25]=j):j=e[25];let O;return e[26]!==f||e[27]!==h||e[28]!==x||e[29]!==j?(O=i.jsx(Ce,{title:f,description:h,actionLabel:x,onRetry:j}),e[26]=f,e[27]=h,e[28]=x,e[29]=j,e[30]=O):O=e[30],O}if(n){let f;return e[31]!==n||e[32]!==s?(f=i.jsx(je,{org:n,initialSiteUrl:s}),e[31]=n,e[32]=s,e[33]=f):f=e[33],f}if(d.length===1&&d[0]){let f;return e[34]!==d[0]||e[35]!==s?(f=i.jsx(je,{org:d[0],initialSiteUrl:s}),e[34]=d[0],e[35]=s,e[36]=f):f=e[36],f}if(d.length>1){let f;e[37]!==r?(f=r("routes.commerceOnboarding.chooseOrg"),e[37]=r,e[38]=f):f=e[38];let h;e[39]!==r?(h=r("routes.commerceOnboarding.selectWhereCommerceContinues"),e[39]=r,e[40]=h):h=e[40];let x;e[41]!==f||e[42]!==h?(x=i.jsx(W,{title:f,description:h}),e[41]=f,e[42]=h,e[43]=x):x=e[43];let j;e[44]!==r?(j=r("routes.commerceOnboarding.authCopy.continue"),e[44]=r,e[45]=j):j=e[45];let O;e[46]!==a||e[47]!==s?(O=V=>a({to:"/commerce-onboarding",search:{org:V.slug,siteUrl:s}}),e[46]=a,e[47]=s,e[48]=O):O=e[48];let C;e[49]!==d||e[50]!==j||e[51]!==O?(C=i.jsx(He,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(Be,{organizations:d,selectLabel:j,onSelected:O})}),e[49]=d,e[50]=j,e[51]=O,e[52]=C):C=e[52];let D;return e[53]!==x||e[54]!==C?(D=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[x,C]})}),e[53]=x,e[54]=C,e[55]=D):D=e[55],D}if(!m){let f;e[56]!==p?(f=()=>{p.reset(),p.mutate()},e[56]=p,e[57]=f):f=e[57];let h;return e[58]!==p||e[59]!==f?(h=i.jsx(Tt,{mutation:p,onRetry:f}),e[58]=p,e[59]=f,e[60]=h):h=e[60],h}const b=m;if(b?.success&&(b.status==="created"||b.status==="joined"||b.status==="already_has_organization")&&b.organization){let f;return e[61]!==b.organization||e[62]!==s?(f=i.jsx(je,{org:b.organization,initialSiteUrl:s}),e[61]=b.organization,e[62]=s,e[63]=f):f=e[63],f}if(b?.status==="ambiguous"&&b.organizations&&b.organizations.length>0){let f;e[64]!==r?(f=r("routes.commerceOnboarding.chooseOrg"),e[64]=r,e[65]=f):f=e[65];let h;e[66]!==r?(h=r("routes.commerceOnboarding.emailAccessMultipleOrgs"),e[66]=r,e[67]=h):h=e[67];let x;e[68]!==f||e[69]!==h?(x=i.jsx(W,{title:f,description:h}),e[68]=f,e[69]=h,e[70]=x):x=e[70];const j=b.domain??void 0;let O;e[71]!==a||e[72]!==s?(O=(V,q)=>{Je(),c({...V,slug:q}),a({to:"/commerce-onboarding",search:{org:q,siteUrl:s}})},e[71]=a,e[72]=s,e[73]=O):O=e[73];let C;e[74]!==b.organizations||e[75]!==j||e[76]!==O?(C=i.jsx(He,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:i.jsx(Be,{organizations:b.organizations,domain:j,onJoined:O})}),e[74]=b.organizations,e[75]=j,e[76]=O,e[77]=C):C=e[77];let D;return e[78]!==x||e[79]!==C?(D=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[x,C]})}),e[78]=x,e[79]=C,e[80]=D):D=e[80],D}let w;e[81]!==r?(w=r("routes.commerceOnboarding.onboardingNeedsSupport"),e[81]=r,e[82]=w):w=e[82];let N;e[83]!==b?.error||e[84]!==r?(N=b?.error??r("routes.commerceOnboarding.couldNotDetermineOrg"),e[83]=b?.error,e[84]=r,e[85]=N):N=e[85];let P;e[86]!==r?(P=r("routes.commerceOnboarding.retryAgain"),e[86]=r,e[87]=P):P=e[87];let U;e[88]!==p?(U=()=>{u(null),p.reset()},e[88]=p,e[89]=U):U=e[89];let M;return e[90]!==w||e[91]!==N||e[92]!==P||e[93]!==U?(M=i.jsx(Ce,{title:w,description:N,actionLabel:P,onRetry:U}),e[90]=w,e[91]=N,e[92]=P,e[93]=U,e[94]=M):M=e[94],M}async function Lt(){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&&Je(),e}function kt(t){return{id:t.id,name:t.name,slug:t.slug,logo:t.logo??null}}function Tt(t){const e=E.c(16),{mutation:o,onRetry:s}=t,r=$(),a=B.useRef(!1);let l;e[0]!==o?(l=u=>{!u||a.current||(a.current=!0,o.mutate())},e[0]=o,e[1]=l):l=e[1];const n=l;if(o.error){let u;e[2]!==r?(u=r("routes.commerceOnboarding.onboardingUnavailable"),e[2]=r,e[3]=u):u=e[3];let d;e[4]!==r?(d=r("routes.commerceOnboarding.couldNotPrepareOrg"),e[4]=r,e[5]=d):d=e[5];let g;e[6]!==r?(g=r("routes.commerceOnboarding.retryAgain"),e[6]=r,e[7]=g):g=e[7];let p;return e[8]!==s||e[9]!==u||e[10]!==d||e[11]!==g?(p=i.jsx(Ce,{title:u,description:d,actionLabel:g,onRetry:s}),e[8]=s,e[9]=u,e[10]=d,e[11]=g,e[12]=p):p=e[12],p}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Ae,{variant:"generic"}),e[13]=c):c=e[13];let m;return e[14]!==n?(m=i.jsx(T,{children:i.jsx("div",{ref:n,children:c})}),e[14]=n,e[15]=m):m=e[15],m}function W(t){const e=E.c(8),{title:o,description:s}=t,r=tt();let a;e[0]!==r?(a=r?i.jsx(Ze,{host:r}):i.jsxs("div",{children:[i.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),i.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s||e[3]!==o?(l=(o||s)&&i.jsxs("div",{className:"space-y-2",children:[o&&i.jsx("h1",{className:"text-2xl font-medium leading-8",children:o}),s&&i.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s})]}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let n;return e[5]!==a||e[6]!==l?(n=i.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=n):n=e[7],n}function Ce(t){const e=E.c(9),{title:o,description:s,actionLabel:r,onRetry:a}=t;let l;e[0]!==s||e[1]!==o?(l=i.jsx(W,{title:o,description:s}),e[0]=s,e[1]=o,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==a?(n=i.jsx(ve,{type:"button",size:"xl",className:"w-full",onClick:a,children:r}),e[3]=r,e[4]=a,e[5]=n):n=e[5];let c;return e[6]!==l||e[7]!==n?(c=i.jsx(T,{children:i.jsxs("div",{className:"grid gap-10",children:[l,n]})}),e[6]=l,e[7]=n,e[8]=c):c=e[8],c}function je(t){const e=E.c(13),{org:o,initialSiteUrl:s}=t,r=$(),{data:a}=Te.useSession(),[l]=Se(),n=a?.user?.email;let c;e[0]!==s||e[1]!==l.language||e[2]!==n?(c=Me({siteUrl:s,email:n,locale:l.language}),e[0]=s,e[1]=l.language,e[2]=n,e[3]=c):c=e[3];const m=c;let u;e[4]!==m||e[5]!==o.id?(u=i.jsx(De,{href:m,orgId:o.id}),e[4]=m,e[5]=o.id,e[6]=u):u=e[6];const d=u;let g;return e[7]!==s||e[8]!==d||e[9]!==o||e[10]!==a?.user?.email||e[11]!==r?(g=i.jsx(nt,{children:p=>{const{reset:v}=p;return i.jsx(lt,{fallback:b=>{const{error:w,resetError:N}=b;return i.jsx(T,{visual:d,children:i.jsx(Mt,{orgName:o.name,message:w instanceof Error?w.message:r("routes.commerceOnboarding.couldNotVerifyCommerceSetting"),onRetry:()=>{v(),N()}})})},children:i.jsx(B.Suspense,{fallback:i.jsx(rt,{visual:d}),children:i.jsx(Dt,{org:o,initialSiteUrl:s,sessionEmail:a?.user?.email},`${o.id}:${s??""}`)})})}}),e[7]=s,e[8]=d,e[9]=o,e[10]=a?.user?.email,e[11]=r,e[12]=g):g=e[12],g}function rt(t){const e=E.c(3),{visual:o}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:gap-4",children:[i.jsx(W,{}),i.jsx(Xe,{})]}),e[0]=s):s=e[0];let r;return e[1]!==o?(r=i.jsx(T,{align:"fill",visual:o,children:s}),e[1]=o,e[2]=r):r=e[2],r}function Mt(t){const e=E.c(19),{orgName:o,message:s,onRetry:r}=t,a=$();let l;e[0]!==a?(l=a("routes.commerceOnboarding.commerceDiagnostic"),e[0]=a,e[1]=l):l=e[1];let n;e[2]!==o||e[3]!==a?(n=a("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o}),e[2]=o,e[3]=a,e[4]=n):n=e[4];let c;e[5]!==l||e[6]!==n?(c=i.jsx(W,{title:l,description:n}),e[5]=l,e[6]=n,e[7]=c):c=e[7];let m;e[8]!==s?(m=i.jsx(Oe,{message:s}),e[8]=s,e[9]=m):m=e[9];let u;e[10]!==a?(u=a("routes.commerceOnboarding.retryAgain"),e[10]=a,e[11]=u):u=e[11];let d;e[12]!==r||e[13]!==u?(d=i.jsx(ve,{type:"button",size:"xl",className:"w-full",onClick:r,children:u}),e[12]=r,e[13]=u,e[14]=d):d=e[14];let g;return e[15]!==c||e[16]!==m||e[17]!==d?(g=i.jsxs("div",{className:"grid gap-10",children:[c,m,d]}),e[15]=c,e[16]=m,e[17]=d,e[18]=g):g=e[18],g}function Dt(t){const e=E.c(135),{org:o,initialSiteUrl:s,sessionEmail:r}=t;let a;e[0]!==o.id||e[1]!==o.slug?(a={connectionId:bt,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=a):a=e[2];const l=xt(a),[n,c]=B.useState(s??""),[m,u]=B.useState(null),d=B.useRef(!1),g=yt.COMMERCE_DISCOVERY(o.id),p=jt(o.id),v=Fe.commerceDiscoveryConnection(o.id,g);let b;e[3]!==g||e[4]!==l?(b=async()=>{const y=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:g}});return Re(y)},e[3]=g,e[4]=l,e[5]=b):b=e[5];let w;e[6]!==v||e[7]!==b?(w={queryKey:v,queryFn:b,retry:!1},e[6]=v,e[7]=b,e[8]=w):w=e[8];const N=$e(w),P=Fe.commerceDiscoveryVirtualMcp(o.id,p);let U;e[9]!==l||e[10]!==p?(U=async()=>{const y=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:p}});return Re(y)},e[9]=l,e[10]=p,e[11]=U):U=e[11];let M;e[12]!==P||e[13]!==U?(M={queryKey:P,queryFn:U,retry:!1},e[12]=P,e[13]=U,e[14]=M):M=e[14];const f=$e(M);let h;e[15]!==l?(h=async y=>{const S=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:y}});return Re(S)},e[15]=l,e[16]=h):h=e[16];let x;e[17]!==N||e[18]!==o.id||e[19]!==f?(x=(y,S)=>{se("commerce_onboarding_setup_succeeded",{domain:ke(S)??void 0,organization_id:o.id}),u(null),N.refetch(),f.refetch()},e[17]=N,e[18]=o.id,e[19]=f,e[20]=x):x=e[20];let j;e[21]!==o.id?(j=(y,S)=>{se("commerce_onboarding_setup_failed",{domain:ke(S)??void 0,organization_id:o.id,error:y instanceof Error?y.message:String(y)}),u(y instanceof Error?y.message:"__configurationFailed")},e[21]=o.id,e[22]=j):j=e[22];let O;e[23]!==j||e[24]!==h||e[25]!==x?(O={mutationFn:h,retry:!1,onSuccess:x,onError:j},e[23]=j,e[24]=h,e[25]=x,e[26]=O):O=e[26];const C=Ye(O),D=!!N.data.item&&!!f.data.item,V=N.data.item,q=typeof V?.metadata?.siteUrl=="string"?V.metadata.siteUrl:void 0,_e=s||n||"";let ne;e[27]!==q||e[28]!==_e?(ne=mt(_e,q),e[27]=q,e[28]=_e,e[29]=ne):ne=e[29];const le=D&&ne,ae=s||n||q||"",_=$(),[we]=Se();let ce;e[30]!==ae||e[31]!==we.language||e[32]!==r?(ce=Me({siteUrl:ae,email:r,locale:we.language}),e[30]=ae,e[31]=we.language,e[32]=r,e[33]=ce):ce=e[33];const Ne=ce;let me;e[34]!==Ne||e[35]!==o.id?(me=i.jsx(De,{href:Ne,orgId:o.id}),e[34]=Ne,e[35]=o.id,e[36]=me):me=e[36];const L=me;let de;e[37]!==m||e[38]!==_?(de=m?Ke(_,m):null,e[37]=m,e[38]=_,e[39]=de):de=e[39];const k=de;let ue;e[40]!==C?(ue=y=>{const S=Ie(y);if(!S.ok){u(S.error);return}u(null),C.mutate(S.value)},e[40]=C,e[41]=ue):ue=e[41];const K=ue;let ge;e[42]!==s||e[43]!==K||e[44]!==le?(ge=y=>{!y||d.current||le||!s||(d.current=!0,K(s))},e[42]=s,e[43]=K,e[44]=le,e[45]=ge):ge=e[45];const Ee=ge;let fe;e[46]!==o.id||e[47]!==K||e[48]!==n?(fe=y=>{y.preventDefault();const S=Ie(n);S.ok&&se("commerce_onboarding_site_url_submitted",{domain:new URL(S.value).hostname,organization_id:o.id}),K(n)},e[46]=o.id,e[47]=K,e[48]=n,e[49]=fe):fe=e[49];const A=fe;if(le){const y=o.slug;let S;e[50]===Symbol.for("react.memo_cache_sentinel")?(S=crypto.randomUUID(),e[50]=S):S=e[50];let I;e[51]!==o.slug?(I={org:y,taskId:S},e[51]=o.slug,e[52]=I):I=e[52];let R;e[53]!==o.id?(R=Ct(o.id),e[53]=o.id,e[54]=R):R=e[54];const H=ae||void 0;let z;e[55]!==R.id||e[56]!==H?(z={virtualmcpid:R.id,connect:"1",siteUrl:H},e[55]=R.id,e[56]=H,e[57]=z):z=e[57];let F;return e[58]!==I||e[59]!==z?(F=i.jsx(at,{to:"/$org/$taskId",params:I,search:z,replace:!0}),e[58]=I,e[59]=z,e[60]=F):F=e[60],F}if(C.isPending){let y;return e[61]!==L?(y=i.jsx(rt,{visual:L}),e[61]=L,e[62]=y):y=e[62],y}if(s){let y,S,I,R,H,z,F,Z;if(e[63]!==L||e[64]!==A||e[65]!==s||e[66]!==o.name||e[67]!==C.isPending||e[68]!==n||e[69]!==_||e[70]!==k||e[71]!==Ee){Z=Symbol.for("react.early_return_sentinel");e:{const Ue=Ie(s);if(!Ue.ok){let ie;e[80]!==_?(ie=_("routes.commerceOnboarding.commerceDiagnostic"),e[80]=_,e[81]=ie):ie=e[81];let oe;e[82]!==o.name||e[83]!==_?(oe=_("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o.name}),e[82]=o.name,e[83]=_,e[84]=oe):oe=e[84];let be;e[85]!==ie||e[86]!==oe?(be=i.jsx(W,{title:ie,description:oe}),e[85]=ie,e[86]=oe,e[87]=be):be=e[87];let xe;e[88]!==A||e[89]!==C.isPending||e[90]!==n||e[91]!==k?(xe=i.jsx(ze,{siteUrl:n,error:k,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A}),e[88]=A,e[89]=C.isPending,e[90]=n,e[91]=k,e[92]=xe):xe=e[92];const Pe=i.jsxs("div",{className:"grid gap-10",children:[be,i.jsx(Oe,{message:Ke(_,Ue.error)}),xe]});let ye;e[93]!==L||e[94]!==Pe?(ye=i.jsx(T,{visual:L,children:Pe}),e[93]=L,e[94]=Pe,e[95]=ye):ye=e[95],Z=ye;break e}S=T,F=L,H=Ee,z="grid gap-10",y=W,e[96]!==_?(I=_("routes.commerceOnboarding.commerceDiagnostic"),e[96]=_,e[97]=I):I=e[97],R=_("routes.commerceOnboarding.commerceDiscoveryBeingPrepared",{url:Ue.value})}e[63]=L,e[64]=A,e[65]=s,e[66]=o.name,e[67]=C.isPending,e[68]=n,e[69]=_,e[70]=k,e[71]=Ee,e[72]=y,e[73]=S,e[74]=I,e[75]=R,e[76]=H,e[77]=z,e[78]=F,e[79]=Z}else y=e[72],S=e[73],I=e[74],R=e[75],H=e[76],z=e[77],F=e[78],Z=e[79];if(Z!==Symbol.for("react.early_return_sentinel"))return Z;let ee;e[98]!==y||e[99]!==I||e[100]!==R?(ee=i.jsx(y,{title:I,description:R}),e[98]=y,e[99]=I,e[100]=R,e[101]=ee):ee=e[101];let te;e[102]!==A||e[103]!==C.isPending||e[104]!==n||e[105]!==k?(te=k?i.jsxs(i.Fragment,{children:[i.jsx(Oe,{message:k}),i.jsx(ze,{siteUrl:n,error:null,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A})]}):i.jsx(Xe,{}),e[102]=A,e[103]=C.isPending,e[104]=n,e[105]=k,e[106]=te):te=e[106];let re;e[107]!==H||e[108]!==z||e[109]!==ee||e[110]!==te?(re=i.jsxs("div",{ref:H,className:z,children:[ee,te]}),e[107]=H,e[108]=z,e[109]=ee,e[110]=te,e[111]=re):re=e[111];let he;return e[112]!==S||e[113]!==F||e[114]!==re?(he=i.jsx(S,{visual:F,children:re}),e[112]=S,e[113]=F,e[114]=re,e[115]=he):he=e[115],he}let Q;e[116]!==_?(Q=_("routes.commerceOnboarding.commerceDiagnostic"),e[116]=_,e[117]=Q):Q=e[117];let G;e[118]!==o.name||e[119]!==_?(G=_("routes.commerceOnboarding.configurationWillContinueIn",{orgName:o.name}),e[118]=o.name,e[119]=_,e[120]=G):G=e[120];let Y;e[121]!==Q||e[122]!==G?(Y=i.jsx(W,{title:Q,description:G}),e[121]=Q,e[122]=G,e[123]=Y):Y=e[123];let J;e[124]!==A||e[125]!==C.isPending||e[126]!==n||e[127]!==k?(J=i.jsx(ze,{siteUrl:n,error:k,isSubmitting:C.isPending,onSiteUrlChange:c,onSubmit:A}),e[124]=A,e[125]=C.isPending,e[126]=n,e[127]=k,e[128]=J):J=e[128];let X;e[129]!==Y||e[130]!==J?(X=i.jsxs("div",{className:"grid gap-10",children:[Y,J]}),e[129]=Y,e[130]=J,e[131]=X):X=e[131];let pe;return e[132]!==L||e[133]!==X?(pe=i.jsx(T,{visual:L,children:X}),e[132]=L,e[133]=X,e[134]=pe):pe=e[134],pe}function ze(t){const e=E.c(30),{siteUrl:o,error:s,isSubmitting:r,onSiteUrlChange:a,onSubmit:l}=t,n=$();let c;e[0]!==n?(c=n("routes.commerceOnboarding.siteUrlLabel"),e[0]=n,e[1]=c):c=e[1];let m;e[2]!==c?(m=i.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:c}),e[2]=c,e[3]=m):m=e[3];let u;e[4]!==a?(u=M=>a(M.target.value),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==n?(d=n("routes.commerceOnboarding.siteUrlPlaceholder"),e[6]=n,e[7]=d):d=e[7];const g=!!s;let p;e[8]!==r||e[9]!==o||e[10]!==u||e[11]!==d||e[12]!==g?(p=i.jsx(gt,{id:"commerce-site-url",type:"text",inputMode:"url",value:o,onChange:u,placeholder:d,"aria-invalid":g,disabled:r}),e[8]=r,e[9]=o,e[10]=u,e[11]=d,e[12]=g,e[13]=p):p=e[13];let v;e[14]!==s?(v=s?i.jsx(Oe,{message:s}):null,e[14]=s,e[15]=v):v=e[15];let b;e[16]!==m||e[17]!==p||e[18]!==v?(b=i.jsxs("div",{className:"grid gap-2",children:[m,p,v]}),e[16]=m,e[17]=p,e[18]=v,e[19]=b):b=e[19];let w;e[20]!==n?(w=n("routes.commerceOnboarding.authCopy.continue"),e[20]=n,e[21]=w):w=e[21];let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Ot,{size:16}),e[22]=N):N=e[22];let P;e[23]!==r||e[24]!==w?(P=i.jsxs(ve,{type:"submit",size:"xl",className:"w-full",disabled:r,children:[w,N]}),e[23]=r,e[24]=w,e[25]=P):P=e[25];let U;return e[26]!==l||e[27]!==P||e[28]!==b?(U=i.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[b,P]}),e[26]=l,e[27]=P,e[28]=b,e[29]=U):U=e[29],U}function Oe(t){const e=E.c(2),{message:o}=t;let s;return e[0]!==o?(s=i.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:o}),e[0]=o,e[1]=s):s=e[1],s}export{ri as default};
@@ -1 +1 @@
1
- import{b}from"./extract-connection-data-ZTR7xcCD.js";import{b as h}from"./provision-repo-scoped-github-connection-DWINBxtd.js";import{g}from"./metadata-dUsYcpuu.js";const C=new Set(["google-analytics"]);function _(n){if(n.boundVia==="sa")return!0;const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return u(e?.accountName);case"google-analytics":return u(e?.propertyId);case"google-search-console":return u(e?.siteUrl);case"github":return u(t?.github_repo);default:return!0}}function T(n){const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return typeof e?.accountName=="string"?e.accountName:null;case"google-analytics":return typeof e?.propertyId=="string"?e.propertyId:null;case"google-search-console":return typeof e?.siteUrl=="string"?e.siteUrl:null;case"github":return typeof t?.github_repo=="string"?t.github_repo:null;default:return null}}function U(n){const e=n.properties;if(!e)return[];const t=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&t.push({fieldKey:i,bindingType:a})}return t}const B=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function O(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function x(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function M(n,e,t,i){return{...n??{},[e]:{__type:t,value:i}}}function u(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(u):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&u(t)):!1}function I(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function N(n){return u(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function v(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=N(t);return i?[{key:e,label:I(e),value:i}]:[]}):[]}function P({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function S(n,e,t){const i=n.filter(o=>(o.app_name===e||!!t&&o.app_id===t)&&h(o)===null);return i.length===0?null:(i.sort((o,r)=>{const s=a=>a.status==="active"?0:1;return s(o)!==s(r)?s(o)-s(r):(r.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function w(n){return n.server?.icons?.[0]?.src??b(n.server?.repository)??null}function K(n,e){const t=g(n._meta);return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function V(n){const e=[],t=new Map(n.connections.map(i=>[i.id,i]));for(const i of n.requirements){const o=n.curated[i.bindingType],r=o?n.itemsById[o.registryAppId]:n.itemsByName[i.bindingType];if(!r)continue;const s=n.configurationState?.[i.fieldKey]?.value,a=s?t.get(s):void 0,c=s&&a?s:null,y=c?n.connectionReadiness?.[c]!==!1:!1,p=!!c&&y,f=p?void 0:n.saBindings?.[i.bindingType],l=p||!!f,d=p?"oauth":f?"sa":null,m=l&&_({bindingType:i.bindingType,boundVia:d,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:r,title:K(r,i.bindingType),icon:w(r),headline:o?.headline??g(r._meta)?.short_description??null,area:o?.area??null,bullets:o?.bullets??[],satisfied:l,configured:m,required:C.has(i.bindingType),candidateConnectionId:l?null:c||S(n.connections,i.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:a?.configuration_state??null,boundVia:d,boundResource:f?.resource??null,connectedDetail:l?T({bindingType:i.bindingType,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null}):null})}return e}function W(n,e){if(!n)return null;const t=o=>{const r=o.startsWith("sc-domain:")?o.substring(10):(()=>{try{return new URL(o.startsWith("http")?o:`https://${o}`).hostname}catch{return null}})();return r===null?o:r.startsWith("www.")?r.substring(4):r},i=t(n);for(const o of e)if(t(o.siteUrl)===i)return o.siteUrl;return null}function q(n){return(n?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${i.displayName})`}))}))}export{B as F,V as a,O as b,M as c,v as g,W as m,U as p,P as s,q as t,x as u};
1
+ import{b}from"./extract-connection-data-Bq1iwuT1.js";import{b as h}from"./provision-repo-scoped-github-connection-DWINBxtd.js";import{g}from"./metadata-dUsYcpuu.js";const C=new Set(["google-analytics"]);function _(n){if(n.boundVia==="sa")return!0;const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return u(e?.accountName);case"google-analytics":return u(e?.propertyId);case"google-search-console":return u(e?.siteUrl);case"github":return u(t?.github_repo);default:return!0}}function T(n){const{companionConfig:e,cdConfig:t}=n;switch(n.bindingType){case"vtex":return typeof e?.accountName=="string"?e.accountName:null;case"google-analytics":return typeof e?.propertyId=="string"?e.propertyId:null;case"google-search-console":return typeof e?.siteUrl=="string"?e.siteUrl:null;case"github":return typeof t?.github_repo=="string"?t.github_repo:null;default:return null}}function U(n){const e=n.properties;if(!e)return[];const t=[];for(const[i,o]of Object.entries(e)){const a=o?.properties?.__type?.const;typeof a=="string"&&a.length>0&&t.push({fieldKey:i,bindingType:a})}return t}const B=[{fieldKey:"vtex",bindingType:"vtex"},{fieldKey:"ga4",bindingType:"google-analytics"},{fieldKey:"gsc",bindingType:"google-search-console"},{fieldKey:"github",bindingType:"github"}];function O(n,e){const t=[];if(n.length&&t.push({field:["id"],operator:"in",value:n}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function x(n){const e=n;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??n}function M(n,e,t,i){return{...n??{},[e]:{__type:t,value:i}}}function u(n){return n==null?!1:typeof n=="string"?n.trim().length>0:typeof n=="number"||typeof n=="boolean"?!0:Array.isArray(n)?n.some(u):typeof n=="object"?Object.entries(n).some(([e,t])=>!e.startsWith("__")&&u(t)):!1}function I(n){const e={accountName:"Nome da conta",appKey:"App Key",appToken:"App Token",propertyId:"Propriedade",siteUrl:"Site"};return e[n]?e[n]:n.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase())}function N(n){return u(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function v(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=N(t);return i?[{key:e,label:I(e),value:i}]:[]}):[]}function P({autoOpenFieldKey:n,card:e}){return n===e.fieldKey&&e.satisfied&&!!e.linkedConnectionId}function S(n,e,t){const i=n.filter(o=>(o.app_name===e||!!t&&o.app_id===t)&&h(o)===null);return i.length===0?null:(i.sort((o,r)=>{const s=a=>a.status==="active"?0:1;return s(o)!==s(r)?s(o)-s(r):(r.updated_at??"").localeCompare(o.updated_at??"")}),i[0].id)}function w(n){return n.server?.icons?.[0]?.src??b(n.server?.repository)??null}function K(n,e){const t=g(n._meta);return t?.friendlyName||t?.friendly_name||n.title||n.server?.title||n.server?.name||e}function V(n){const e=[],t=new Map(n.connections.map(i=>[i.id,i]));for(const i of n.requirements){const o=n.curated[i.bindingType],r=o?n.itemsById[o.registryAppId]:n.itemsByName[i.bindingType];if(!r)continue;const s=n.configurationState?.[i.fieldKey]?.value,a=s?t.get(s):void 0,c=s&&a?s:null,y=c?n.connectionReadiness?.[c]!==!1:!1,p=!!c&&y,f=p?void 0:n.saBindings?.[i.bindingType],l=p||!!f,d=p?"oauth":f?"sa":null,m=l&&_({bindingType:i.bindingType,boundVia:d,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:r,title:K(r,i.bindingType),icon:w(r),headline:o?.headline??g(r._meta)?.short_description??null,area:o?.area??null,bullets:o?.bullets??[],satisfied:l,configured:m,required:C.has(i.bindingType),candidateConnectionId:l?null:c||S(n.connections,i.bindingType,o?.registryAppId),linkedConnectionId:c,configurationState:a?.configuration_state??null,boundVia:d,boundResource:f?.resource??null,connectedDetail:l?T({bindingType:i.bindingType,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null}):null})}return e}function W(n,e){if(!n)return null;const t=o=>{const r=o.startsWith("sc-domain:")?o.substring(10):(()=>{try{return new URL(o.startsWith("http")?o:`https://${o}`).hostname}catch{return null}})();return r===null?o:r.startsWith("www.")?r.substring(4):r},i=t(n);for(const o of e)if(t(o.siteUrl)===i)return o.siteUrl;return null}function q(n){return(n?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(o=>({value:o.property,label:`${o.displayName} (${i.displayName})`}))}))}export{B as F,V as a,O as b,M as c,v as g,W as m,U as p,P as s,q as t,x as u};
@@ -0,0 +1,8 @@
1
+ import{c as b,j as s,B as C,F as z,o as O,e as Y,K as R,n as X,r as Z,z as ee,t as P}from"./index-DDug671b.js";import{A as te,b as se}from"./alert-DzGSEr4W.js";import{C as ne}from"./card-CNJcSytc.js";import{c as q,T as L,b as T,a as W}from"./tabs-DeUeCPgO.js";import{u as H}from"./use-copy-yAEQGKxe.js";import{i as Q}from"./Check-DgYNB0_V.js";import{a as U}from"./Copy01-C5QjOujR.js";import{i as ie}from"./Key01-CABDssnL.js";import{n as re}from"./LinkExternal01-CuFbC-Ib.js";import{s as oe}from"./Trash01-a9h5F5OE.js";import{P as A}from"./index-CcB8mZk8.js";import{c as ae}from"./settings-section-BDJITHua.js";import{S as B,u as D}from"./use-mcp-client-BHIx7JlY.js";import"./sidebar-BjwcFmHe.js";import"./LayoutLeft-B0iWGVbj.js";import"./use-mobile-CnuHZAQe.js";import"./X-Dpv9CfhB.js";import"./tooltip-WZpxGeui.js";import"./ArrowUpRight-BCZbaWin.js";import"./auth-BIKfPH28.js";function le(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function ce(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function de({client:e,mode:t,url:r,apiKey:a}){const o=a??"<paste-your-api-key>",i=le();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${i} ${r}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${i} ${r} \\
2
+ --header "Authorization: Bearer ${o}"`};if(e==="cursor"){const n={url:r};return t==="api-key"&&(n.headers={Authorization:`Bearer ${o}`}),{language:"json",pathHint:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{[i]:n}},null,2)}}if(e==="codex"){const n=[`[mcp_servers.${i}]`,`url = "${r}"`];return t==="api-key"&&n.push(`http_headers = { "Authorization" = "Bearer ${o}" }`),{language:"toml",pathHint:"~/.codex/config.toml",code:n.join(`
3
+ `)}}if(e==="claude-desktop"){const n={type:"http",url:r};return t==="api-key"&&(n.headers={Authorization:`Bearer ${o}`}),{language:"json",pathHint:"claude_desktop_config.json",code:JSON.stringify({mcpServers:{[i]:n}},null,2)}}return t==="oauth"?{language:"text",code:`${r}
4
+
5
+ # OAuth: clients that support MCP OAuth 2.1 will discover
6
+ # the auth flow via the WWW-Authenticate header on 401.`}:{language:"text",code:`${r}
7
+
8
+ Authorization: Bearer ${o}`}}function I(e){const t=b.c(23),{client:r,mode:a,url:o,apiKey:i}=e;let n;t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==o?(n=de({client:r,mode:a,url:o,apiKey:i}),t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=n):n=t[4];const l=n,{handleCopy:d,copied:m}=H(),u=l.pathHint??l.language;let c;t[5]!==u?(c=s.jsx("span",{className:"text-[11px] text-muted-foreground font-medium uppercase tracking-wider",children:u}),t[5]=u,t[6]=c):c=t[6];let f;t[7]!==d||t[8]!==l.code?(f=()=>d(l.code),t[7]=d,t[8]=l.code,t[9]=f):f=t[9];let p;t[10]!==m?(p=m?s.jsx(Q,{size:14}):s.jsx(U,{size:14}),t[10]=m,t[11]=p):p=t[11];let x;t[12]!==f||t[13]!==p?(x=s.jsx(C,{variant:"ghost",size:"icon",className:"size-7 shrink-0",onClick:f,"aria-label":"Copy snippet",children:p}),t[12]=f,t[13]=p,t[14]=x):x=t[14];let h;t[15]!==c||t[16]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border",children:[c,x]}),t[15]=c,t[16]=x,t[17]=h):h=t[17];let g;t[18]!==l.code?(g=s.jsx("pre",{className:"p-3 text-xs overflow-x-auto font-mono",children:s.jsx("code",{children:l.code})}),t[18]=l.code,t[19]=g):g=t[19];let y;return t[20]!==h||t[21]!==g?(y=s.jsxs("div",{className:"relative rounded-md border border-border bg-muted/40",children:[h,g]}),t[20]=h,t[21]=g,t[22]=y):y=t[22],y}function G(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function ue(){const e=b.c(10),{org:t}=z();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:B,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const a=D(r);let o;e[3]!==t.id?(o=R.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let i;e[5]!==a?(i=async()=>{const l=await a.callTool({name:"API_KEY_LIST",arguments:{}});return G(l,"Failed to list API keys").items},e[5]=a,e[6]=i):i=e[6];let n;return e[7]!==o||e[8]!==i?(n={queryKey:o,queryFn:i,staleTime:3e4},e[7]=o,e[8]=i,e[9]=n):n=e[9],X(n)}function me(){const e=b.c(11),{org:t}=z();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:B,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const a=D(r),o=O();let i;e[3]!==a?(i=async d=>{const m=await a.callTool({name:"API_KEY_CREATE",arguments:{name:d.name,permissions:d.permissions??{"*":["*"]}}});return G(m,"Failed to create API key")},e[3]=a,e[4]=i):i=e[4];let n;e[5]!==t.id||e[6]!==o?(n=()=>{o.invalidateQueries({queryKey:R.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=n):n=e[7];let l;return e[8]!==i||e[9]!==n?(l={mutationFn:i,onSuccess:n},e[8]=i,e[9]=n,e[10]=l):l=e[10],Y(l)}function fe(){const e=b.c(11),{org:t}=z();let r;e[0]!==t.id||e[1]!==t.slug?(r={connectionId:B,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=r):r=e[2];const a=D(r),o=O();let i;e[3]!==a?(i=async d=>{const m=await a.callTool({name:"API_KEY_DELETE",arguments:{keyId:d}});return G(m,"Failed to delete API key")},e[3]=a,e[4]=i):i=e[4];let n;e[5]!==t.id||e[6]!==o?(n=()=>{o.invalidateQueries({queryKey:R.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=n):n=e[7];let l;return e[8]!==i||e[9]!==n?(l={mutationFn:i,onSuccess:n},e[8]=i,e[9]=n,e[10]=l):l=e[10],Y(l)}const K="Connect: ",F=[{id:"claude-code",label:"Claude Code"},{id:"cursor",label:"Cursor"},{id:"codex",label:"Codex"},{id:"claude-desktop",label:"Claude Desktop"},{id:"raw",label:"Raw URL"}];function J(e){return F.find(t=>t.id===e)?.label??e}function pe(){return typeof window>"u"?"unknown":window.location.hostname}function M(e){const t=b.c(8),{text:r}=e,{handleCopy:a,copied:o}=H();let i;t[0]!==a||t[1]!==r?(i=()=>a(r),t[0]=a,t[1]=r,t[2]=i):i=t[2];let n;t[3]!==o?(n=o?s.jsx(Q,{size:14}):s.jsx(U,{size:14}),t[3]=o,t[4]=n):n=t[4];let l;return t[5]!==i||t[6]!==n?(l=s.jsx(C,{variant:"ghost",size:"icon",className:"size-7 shrink-0",onClick:i,"aria-label":"Copy",children:n}),t[5]=i,t[6]=n,t[7]=l):l=t[7],l}function xe(e){const t=b.c(16),{client:r,url:a,newKey:o,onGenerate:i,isGenerating:n,onClearNewKey:l}=e;let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(q,{children:[s.jsx(T,{value:"oauth",children:"OAuth"}),s.jsx(T,{value:"api-key",children:"API key"})]}),t[0]=d):d=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Recommended for your laptop. Browser will open on first use to sign in — no token to manage."}),t[1]=m):m=t[1];let u;t[2]!==r||t[3]!==a?(u=s.jsxs(L,{value:"oauth",className:"mt-3 space-y-3",children:[m,s.jsx(I,{client:r,mode:"oauth",url:a})]}),t[2]=r,t[3]=a,t[4]=u):u=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:"For CI, Conductor, or headless agents that can't open a browser."}),t[5]=c):c=t[5];let f;t[6]!==r||t[7]!==n||t[8]!==o||t[9]!==l||t[10]!==i||t[11]!==a?(f=s.jsxs(L,{value:"api-key",className:"mt-3 space-y-3",children:[c,o?s.jsxs(s.Fragment,{children:[s.jsxs(te,{variant:"warning",className:"text-xs",children:[s.jsx(ee,{}),s.jsx(se,{children:"Copy this snippet now — the key won't be shown again. You can revoke it later from the list below."})]}),s.jsx(I,{client:r,mode:"api-key",url:a,apiKey:o}),s.jsx(C,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:"Done, hide key"})]}):s.jsxs(s.Fragment,{children:[s.jsx(I,{client:r,mode:"api-key",url:a}),s.jsxs(C,{size:"sm",onClick:i,disabled:n,className:"gap-1.5",children:[s.jsx(ie,{size:14}),n?"Generating…":`Generate key for ${J(r)}`]})]})]}),t[6]=r,t[7]=n,t[8]=o,t[9]=l,t[10]=i,t[11]=a,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==f?(p=s.jsxs(W,{defaultValue:"oauth",className:"mt-4",children:[d,u,f]}),t[13]=u,t[14]=f,t[15]=p):p=t[15],p}function he(){const e=b.c(16),{data:t,isLoading:r,error:a}=ue(),o=fe();let i,n,l;if(e[0]!==t||e[1]!==o||e[2]!==a||e[3]!==r){l=Symbol.for("react.early_return_sentinel");e:{const m=t?.filter(je)??[];if(r){let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading active keys…"}),e[7]=c):c=e[7],l=c;break e}if(a){let c;e[8]!==a.message?(c=s.jsxs("p",{className:"text-xs text-destructive",children:["Failed to load keys: ",a.message]}),e[8]=a.message,e[9]=c):c=e[9],l=c;break e}if(m.length===0){let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"text-xs text-muted-foreground",children:"No connect keys minted yet. Generate one from a client tab above for headless setups."}),e[10]=c):c=e[10],l=c;break e}i="divide-y divide-border rounded-md border border-border";let u;e[11]!==o?(u=c=>s.jsxs("li",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"font-medium truncate",children:c.name.replace(K,"")}),s.jsxs("div",{className:"text-muted-foreground",children:["Created ",new Date(c.createdAt).toLocaleDateString()]})]}),s.jsxs(C,{variant:"ghost",size:"sm",onClick:()=>{confirm(`Revoke "${c.name}"? Any client still using this key will lose access.`)&&o.mutate(c.id,{onSuccess:ye,onError:ge})},disabled:o.isPending,className:"gap-1 text-destructive hover:text-destructive",children:[s.jsx(oe,{size:14}),"Revoke"]})]},c.id),e[11]=o,e[12]=u):u=e[12],n=m.map(u)}e[0]=t,e[1]=o,e[2]=a,e[3]=r,e[4]=i,e[5]=n,e[6]=l}else i=e[4],n=e[5],l=e[6];if(l!==Symbol.for("react.early_return_sentinel"))return l;let d;return e[13]!==i||e[14]!==n?(d=s.jsx("ul",{className:i,children:n}),e[13]=i,e[14]=n,e[15]=d):d=e[15],d}function ge(e){return P.error(e.message)}function ye(){return P.success("Key revoked")}function je(e){return e.name.startsWith(K)}function be(){const e=b.c(29),{org:t}=z();let r;e[0]!==t.slug?(r=ce(t.slug),e[0]=t.slug,e[1]=r):r=e[1];const a=r,o=me();let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={},e[2]=i):i=e[2];const[n,l]=Z.useState(i);let d;e[3]!==o?(d=j=>{const E=`${K}${J(j)} on ${pe()}`;o.mutate({name:E,permissions:{"*":["*"]}},{onSuccess:$=>{l(V=>({...V,[j]:$.key})),P.success("Key created")},onError:we})},e[3]=o,e[4]=d):d=e[4];const m=d,u=`${a}/.well-known/oauth-protected-resource`;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(A.Title,{children:"Connect to clients"}),e[5]=c):c=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"size-9 rounded-lg bg-muted/60 flex items-center justify-center text-muted-foreground shrink-0",children:s.jsx(re,{size:18})}),e[6]=f):f=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"flex items-start gap-3",children:[f,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:"Your org's unified MCP"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1 leading-snug",children:"Plug this URL into any MCP client to give that runtime every connection enabled in this org, governed by your Decopilot rules."})]})]}),e[7]=p):p=e[7];let x;e[8]!==a?(x=s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/40 px-3 py-1.5",children:[s.jsx("code",{className:"text-xs flex-1 truncate",children:a}),s.jsx(M,{text:a})]}),e[8]=a,e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("summary",{className:"cursor-pointer hover:text-foreground",children:"Wiring a custom client?"}),e[10]=h):h=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{children:"OAuth 2.1 Protected Resource Metadata is advertised on 401:"}),e[11]=g):g=e[11];let y;e[12]!==u?(y=s.jsxs("details",{className:"text-xs text-muted-foreground",children:[h,s.jsxs("div",{className:"mt-2 space-y-1",children:[g,s.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-2 py-1",children:[s.jsx("code",{className:"text-[11px] flex-1 truncate",children:u}),s.jsx(M,{text:u})]})]})]}),e[12]=u,e[13]=y):y=e[13];let v;e[14]!==x||e[15]!==y?(v=s.jsxs(ne,{className:"p-5 gap-3",children:[p,x,y]}),e[14]=x,e[15]=y,e[16]=v):v=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(q,{variant:"underline",children:F.map(ve)}),e[17]=_):_=e[17];let w;e[18]!==o||e[19]!==m||e[20]!==n||e[21]!==a?(w=F.map(j=>s.jsx(L,{value:j.id,children:s.jsx(xe,{client:j.id,url:a,newKey:n[j.id]??null,onGenerate:()=>m(j.id),isGenerating:o.isPending&&o.variables?.name?.startsWith(`${K}${j.label}`)===!0,onClearNewKey:()=>l(E=>{const $={...E};return delete $[j.id],$})})},j.id)),e[18]=o,e[19]=m,e[20]=n,e[21]=a,e[22]=w):w=e[22];let N;e[23]!==w?(N=s.jsxs(W,{defaultValue:"claude-code",variant:"underline",children:[_,w]}),e[23]=w,e[24]=N):N=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"px-4",children:[s.jsx("h2",{className:"text-[15px] font-medium leading-tight",children:"Active keys"}),s.jsx("p",{className:"text-sm text-muted-foreground leading-snug mt-1",children:"Keys you've generated for headless clients. Revoke any time."})]}),s.jsx(he,{})]}),e[25]=k):k=e[25];let S;return e[26]!==v||e[27]!==N?(S=s.jsx(A,{children:s.jsx(A.Content,{children:s.jsx(A.Body,{children:s.jsxs(ae,{children:[c,v,N,k]})})})}),e[26]=v,e[27]=N,e[28]=S):S=e[28],S}function ve(e){return s.jsx(T,{value:e.id,variant:"underline",children:e.label},e.id)}function we(e){return P.error(e.message)}function Oe(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(be,{}),e[0]=t):t=e[0],t}export{Oe as default};
@@ -1 +1 @@
1
- import{X as i,a3 as r,a2 as t,Y as e,a4 as o,b0 as a,bb as d,c4 as l,ba as u}from"./index-sd38S2ER.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
1
+ import{X as i,a3 as r,a2 as t,Y as e,a4 as o,b0 as a,bb as d,c4 as l,ba as u}from"./index-DDug671b.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),connection_type:r(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as i,g as p};
@@ -1 +1 @@
1
- import{c as M,F as $,at as L,K as k,m as w,j as I}from"./index-sd38S2ER.js";import{u as D}from"./use-registry-connections-BJ4Y5FI-.js";import{f as K}from"./use-organization-settings-C8aPcOm4.js";import{S as E,j as F}from"./use-mcp-client-Cav0AiKw.js";import{u as Q}from"./useInfiniteQuery-cI69eqxa.js";import{i as H,f as q}from"./extract-connection-data-ZTR7xcCD.js";import{r as G,R as U}from"./retry-CErkP7V6.js";import{g as T}from"./connection-slug-eyAPH6o3.js";import{C as V}from"./card-yJEtZ44f.js";import{I as X}from"./integration-icon-D-DwNzR1.js";function ue(){const s=M.c(6),e=D(),t=K(),a=$().project.enabledPlugins??[];let o;if(s[0]!==a||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(Y),a.includes("private-registry")&&t(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=a,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function Y(s){return{id:s.id,title:s.title,icon:s.icon}}const z=24,_=3;function A(s){return s.id.includes("community-registry")}function B(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(a=>t.map(o=>({field:o,operator:"contains",value:a})))}}function S(s,e,t,a,o){const l=s.map(u=>u.id).sort().join(","),r=B(o),{data:p,fetchNextPage:d,hasNextPage:m,isFetchingNextPage:g,isLoading:N}=Q({queryKey:k.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:u})=>{const n=u??{};return await Promise.all(s.map(async i=>{const h=n[i.id];if(h==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);try{return await G(async()=>{let f=null;try{f=await F({connectionId:i.id,orgId:e,orgSlug:t});const x={limit:z};h&&(x.cursor=h),r&&(x.where=r);const C=await f.callTool({name:j,arguments:x}),v=C.structuredContent??C,P=v.nextCursor||v.cursor||void 0,b=q(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:b,nextCursor:P}}finally{await f?.close().catch(()=>{})}},{maxAttempts:_,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(f){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${_} attempts:`,f instanceof U?f.cause:f),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:u=>{const n={};let c=!1;for(const i of u)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,c=!0):n[i.registryId]="EXHAUSTED");return c?n:void 0},staleTime:3600*1e3,placeholderData:L,retry:!1,enabled:s.length>0}),y=[];if(p?.pages)for(const u of p.pages)for(const n of u)for(const c of n.items)y.push({...c,_sourceName:c._sourceName??n.registryTitle,_sourceIcon:c._sourceIcon??n.registryIcon,_registryId:c._registryId??n.registryId});return{items:y,hasMore:m??!1,isLoadingMore:g,isInitialLoading:N,fetchNextPage:()=>{m&&!g&&d()}}}function fe(s,e){const t=M.c(16),{org:a}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const p=r,d=S(l,a.id,a.slug,!0,e),m=S(p,a.id,a.slug,!0,e);let g;if(t[4]!==m.items||t[5]!==d.items){const h=new Set;g=[];const j=[...d.items,...m.items];for(const f of j){const x=`${f._registryId}:${f.id}`;h.has(x)||(h.add(x),g.push(f))}t[4]=m.items,t[5]=d.items,t[6]=g}else g=t[6];const N=d.isInitialLoading||m.isInitialLoading,y=d.isLoadingMore||m.isLoadingMore,u=d.hasMore||m.hasMore;let n;t[7]!==m||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),m.hasMore&&m.fetchNextPage()},t[7]=m,t[8]=d,t[9]=n):n=t[9];const c=n;let i;return t[10]!==u||t[11]!==N||t[12]!==y||t[13]!==g||t[14]!==c?(i={items:g,hasMore:u,isLoadingMore:y,isInitialLoading:N,loadMore:c},t[10]=u,t[11]=N,t[12]=y,t[13]=g,t[14]=c,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function me(s){const e=new Map;for(const o of s){const l=T(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],a=new Set;for(const o of s){const l=T(o);if(a.has(l))continue;a.add(l);const r=e.get(l),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:l,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function de(s){const e=M.c(37),{connection:t,onClick:a,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:p,className:d,fallbackIcon:m}=s,g=l===void 0?!1:l,N=a&&"hover:bg-muted/50";let y;e[0]!==d||e[1]!==N?(y=w("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",N,d),e[0]=d,e[1]=N,e[2]=y):y=e[2];let u;e[3]!==t.icon||e[4]!==t.title||e[5]!==m?(u=I.jsx(X,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=t.icon,e[4]=t.title,e[5]=m,e[6]=u):u=e[6];let n;e[7]!==o||e[8]!==g?(n=o&&I.jsx("div",{className:w("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:O,children:o}),e[7]=o,e[8]=g,e[9]=n):n=e[9];let c;e[10]!==n?(c=I.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=c):c=e[11];let i;e[12]!==u||e[13]!==c?(i=I.jsxs("div",{className:"flex items-start justify-between",children:[u,c]}),e[12]=u,e[13]=c,e[14]=i):i=e[14];let h;e[15]!==t.title?(h=I.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=h):h=e[16];const j=t.description||"No description";let f;e[17]!==j?(f=I.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=f):f=e[18];let x;e[19]!==f||e[20]!==h?(x=I.jsxs("div",{className:"flex flex-col gap-1",children:[h,f]}),e[19]=f,e[20]=h,e[21]=x):x=e[21];let C;e[22]!==r?(C=r&&I.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let v;e[24]!==x||e[25]!==C||e[26]!==i?(v=I.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,x,C]}),e[24]=x,e[25]=C,e[26]=i,e[27]=v):v=e[27];let P;e[28]!==p?(P=p&&I.jsx("div",{className:"border-t border-border mt-auto",children:I.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:J,children:p})}),e[28]=p,e[29]=P):P=e[29];let b;e[30]!==v||e[31]!==P?(b=I.jsxs("div",{className:"flex flex-col flex-1",children:[v,P]}),e[30]=v,e[31]=P,e[32]=b):b=e[32];let R;return e[33]!==a||e[34]!==b||e[35]!==y?(R=I.jsx(V,{className:y,onClick:a,children:b}),e[33]=a,e[34]=b,e[35]=y,e[36]=R):R=e[36],R}function J(s){return s.stopPropagation()}function O(s){return s.stopPropagation()}export{de as C,fe as a,me as g,ue as u};
1
+ import{c as M,F as $,as as L,K as k,m as w,j as I}from"./index-DDug671b.js";import{u as D}from"./use-registry-connections-z0q_Ein8.js";import{f as K}from"./use-organization-settings-lxipe-fc.js";import{S as E,j as F}from"./use-mcp-client-BHIx7JlY.js";import{u as Q}from"./useInfiniteQuery-BIQdmDG8.js";import{i as H,f as q}from"./extract-connection-data-Bq1iwuT1.js";import{r as G,R as U}from"./retry-CErkP7V6.js";import{g as T}from"./connection-slug-eyAPH6o3.js";import{C as V}from"./card-CNJcSytc.js";import{I as X}from"./integration-icon-CdNdqZ3V.js";function ue(){const s=M.c(6),e=D(),t=K(),a=$().project.enabledPlugins??[];let o;if(s[0]!==a||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(Y),a.includes("private-registry")&&t(E)&&o.push({id:E,title:"Private Registry",icon:null}),s[0]=a,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function Y(s){return{id:s.id,title:s.title,icon:s.icon}}const z=24,_=3;function A(s){return s.id.includes("community-registry")}function B(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(a=>t.map(o=>({field:o,operator:"contains",value:a})))}}function S(s,e,t,a,o){const l=s.map(u=>u.id).sort().join(","),r=B(o),{data:p,fetchNextPage:d,hasNextPage:m,isFetchingNextPage:g,isLoading:N}=Q({queryKey:k.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:u})=>{const n=u??{};return await Promise.all(s.map(async i=>{const h=n[i.id];if(h==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);try{return await G(async()=>{let f=null;try{f=await F({connectionId:i.id,orgId:e,orgSlug:t});const x={limit:z};h&&(x.cursor=h),r&&(x.where=r);const C=await f.callTool({name:j,arguments:x}),v=C.structuredContent??C,P=v.nextCursor||v.cursor||void 0,b=q(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:b,nextCursor:P}}finally{await f?.close().catch(()=>{})}},{maxAttempts:_,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(f){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${_} attempts:`,f instanceof U?f.cause:f),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:u=>{const n={};let c=!1;for(const i of u)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,c=!0):n[i.registryId]="EXHAUSTED");return c?n:void 0},staleTime:3600*1e3,placeholderData:L,retry:!1,enabled:s.length>0}),y=[];if(p?.pages)for(const u of p.pages)for(const n of u)for(const c of n.items)y.push({...c,_sourceName:c._sourceName??n.registryTitle,_sourceIcon:c._sourceIcon??n.registryIcon,_registryId:c._registryId??n.registryId});return{items:y,hasMore:m??!1,isLoadingMore:g,isInitialLoading:N,fetchNextPage:()=>{m&&!g&&d()}}}function fe(s,e){const t=M.c(16),{org:a}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const p=r,d=S(l,a.id,a.slug,!0,e),m=S(p,a.id,a.slug,!0,e);let g;if(t[4]!==m.items||t[5]!==d.items){const h=new Set;g=[];const j=[...d.items,...m.items];for(const f of j){const x=`${f._registryId}:${f.id}`;h.has(x)||(h.add(x),g.push(f))}t[4]=m.items,t[5]=d.items,t[6]=g}else g=t[6];const N=d.isInitialLoading||m.isInitialLoading,y=d.isLoadingMore||m.isLoadingMore,u=d.hasMore||m.hasMore;let n;t[7]!==m||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),m.hasMore&&m.fetchNextPage()},t[7]=m,t[8]=d,t[9]=n):n=t[9];const c=n;let i;return t[10]!==u||t[11]!==N||t[12]!==y||t[13]!==g||t[14]!==c?(i={items:g,hasMore:u,isLoadingMore:y,isInitialLoading:N,loadMore:c},t[10]=u,t[11]=N,t[12]=y,t[13]=g,t[14]=c,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function me(s){const e=new Map;for(const o of s){const l=T(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],a=new Set;for(const o of s){const l=T(o);if(a.has(l))continue;a.add(l);const r=e.get(l),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:l,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function de(s){const e=M.c(37),{connection:t,onClick:a,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:p,className:d,fallbackIcon:m}=s,g=l===void 0?!1:l,N=a&&"hover:bg-muted/50";let y;e[0]!==d||e[1]!==N?(y=w("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",N,d),e[0]=d,e[1]=N,e[2]=y):y=e[2];let u;e[3]!==t.icon||e[4]!==t.title||e[5]!==m?(u=I.jsx(X,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=t.icon,e[4]=t.title,e[5]=m,e[6]=u):u=e[6];let n;e[7]!==o||e[8]!==g?(n=o&&I.jsx("div",{className:w("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:O,children:o}),e[7]=o,e[8]=g,e[9]=n):n=e[9];let c;e[10]!==n?(c=I.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=c):c=e[11];let i;e[12]!==u||e[13]!==c?(i=I.jsxs("div",{className:"flex items-start justify-between",children:[u,c]}),e[12]=u,e[13]=c,e[14]=i):i=e[14];let h;e[15]!==t.title?(h=I.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=h):h=e[16];const j=t.description||"No description";let f;e[17]!==j?(f=I.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=f):f=e[18];let x;e[19]!==f||e[20]!==h?(x=I.jsxs("div",{className:"flex flex-col gap-1",children:[h,f]}),e[19]=f,e[20]=h,e[21]=x):x=e[21];let C;e[22]!==r?(C=r&&I.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let v;e[24]!==x||e[25]!==C||e[26]!==i?(v=I.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,x,C]}),e[24]=x,e[25]=C,e[26]=i,e[27]=v):v=e[27];let P;e[28]!==p?(P=p&&I.jsx("div",{className:"border-t border-border mt-auto",children:I.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:J,children:p})}),e[28]=p,e[29]=P):P=e[29];let b;e[30]!==v||e[31]!==P?(b=I.jsxs("div",{className:"flex flex-col flex-1",children:[v,P]}),e[30]=v,e[31]=P,e[32]=b):b=e[32];let R;return e[33]!==a||e[34]!==b||e[35]!==y?(R=I.jsx(V,{className:y,onClick:a,children:b}),e[33]=a,e[34]=b,e[35]=y,e[36]=R):R=e[36],R}function J(s){return s.stopPropagation()}function O(s){return s.stopPropagation()}export{de as C,fe as a,me as g,ue as u};
@@ -0,0 +1 @@
1
+ import{X as be,a4 as $e,b0 as De,Y as me,a2 as Oe,c as V,b as H,j as t,k as ve,B,r as Z,m as Ne,F as te,x as Me,K as ae,d as se,au as ue,D as ze,E as Ee,f as Ue,b1 as Ve,o as Re,_ as Fe,Z as Le,t as J}from"./index-DDug671b.js";import{g as Be}from"./extract-connection-data-Bq1iwuT1.js";import{E as Se}from"./empty-state-0sZo57jy.js";import{E as He,c as qe,r as Ke,b as Xe,d as Ge}from"./connection-form-helpers-GHi3zYxQ.js";import{c as Qe,S as We,V as Ye}from"./index-C_usV78a.js";import{u as ye,T as Je}from"./use-mcp-auth-status-DNePqWs9.js";import{u as Ze}from"./use-members-DMaPK1aF.js";import{A as et}from"./avatar-C6aV7hw3.js";import{a as Ce,b as _e,u as tt}from"./use-connection-BH3GAkyc.js";import{u as we}from"./use-mcp-client-BHIx7JlY.js";import{a as st}from"./use-mcp-tools-Dv1bErmV.js";import{c as nt,C as it,a as ot,d as at}from"./AreaChart-BymqE9V8.js";import{i as lt,a as rt}from"./mcp-oauth-Cfiwi3-V.js";import{I as le}from"./integration-icon-CdNdqZ3V.js";import{s as ct}from"./Plus-Ca5ksK2g.js";import{V as dt,a as mt,aK as ut,a5 as xt}from"./agent-icon-UVuzT1cN.js";import{a as ke,s as pt}from"./Settings02-CxyT3aA1.js";import{s as ce}from"./Trash01-a9h5F5OE.js";import{q as ft,p as ht,o as gt,m as jt,n as bt}from"./sidebar-BjwcFmHe.js";import{F as X,b as G,c as Q,d as L,e as W,f as vt,a as Nt}from"./form-CUC6wee5.js";import{I as Y}from"./input-CGjm14VM.js";import{u as St,D as yt}from"./use-delete-connection-DqRcaJY_.js";import{c as Ct,B as _t,a as wt,C as kt}from"./monitoring-stats-row-CmnOxXTZ.js";import{u as It}from"./studio-tools-BVOWXGL8.js";import{a as Tt}from"./use-virtual-mcp-BlRB4Rkc.js";import{i as Ie}from"./ChevronRight-9d4jtA28.js";import{a as Te}from"./Users03-CwkNhzLs.js";import{b as ne,c as At,T as ie,a as Pt}from"./tabs-DeUeCPgO.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-BJsaOMIO.js";import{d as Dt}from"./Tool01-CtxHxaVb.js";import{g as de,M as Ot}from"./index-Ca_3YTYR.js";import{C as Mt}from"./collection-search-DSPRiMjg.js";import{C as zt}from"./card-CNJcSytc.js";import{B as Et}from"./badge-B33YJ7h5.js";import{c as Ut,D as Vt,b as Rt,a as xe}from"./dropdown-menu-CaL7DApX.js";import{S as pe,a as fe,b as he,c as ge,d as K}from"./select-Csj8R7k2.js";import{i as Ft}from"./CheckCircle-CN5-9xsQ.js";import{t as Lt}from"./ChevronDown-CHc-y-Al.js";import{a as Bt}from"./Tool02-CT9ZXUaF.js";import{s as oe}from"./Star01-CVXcsIV7.js";import{s as Ht}from"./XClose-DyN8kvjl.js";import{p as qt,i as Kt}from"./connection-BWCT-l_B.js";import"./metadata-dUsYcpuu.js";import"./index-CcB8mZk8.js";import"./Key01-CABDssnL.js";import"./auth-BIKfPH28.js";import"./use-registry-connections-z0q_Ein8.js";import"./use-organization-settings-lxipe-fc.js";import"./index-CS6AKJgD.js";import"./popover-BPNEzQ0m.js";import"./tooltip-WZpxGeui.js";import"./Check-DgYNB0_V.js";import"./SearchMd-B26GBZrh.js";import"./use-mobile-CnuHZAQe.js";import"./use-create-virtual-mcp-ZxuwOjY4.js";import"./use-navigate-to-agent-BUCfyhQC.js";import"./hooks-Ckdzt-Nv.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BGikXbt8.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-Cvgl0KNf.js";import"./use-org-auth-client-OPJSyera.js";import"./User01-DYrVlXdz.js";import"./AlertCircle-B7r3EaII.js";import"./ArrowUp-BQshHDSK.js";import"./XCircle-_qYA_TW_.js";import"./ArrowUpRight-BCZbaWin.js";import"./TrendUp01-B0KTJh5U.js";import"./ChevronUp-B-O9_nTC.js";import"./DotsVertical-BIcnJzPR.js";import"./Stars02-BiPhZp0l.js";import"./Copy01-C5QjOujR.js";import"./FilterLines-DGkZM5wO.js";import"./Palette-D7J1kWGW.js";import"./SwitchHorizontal01-BTb2rFJr.js";import"./HardDrive-Cs2Ept5K.js";import"./LayoutLeft-B0iWGVbj.js";import"./LinkExternal01-CuFbC-Ib.js";import"./LogOut01-BTC97zIN.js";import"./Monitor01-CmLdEM36.js";import"./Sun-DuCKp6uv.js";import"./Play-eSj6vmxE.js";import"./SearchLg-CPBJr8DH.js";import"./Shield01-Cv0doLKj.js";import"./Stars01-C6tvzvYW.js";import"./Upload01-Cc8J1X67.js";import"./Users01-B0OeOpb3.js";import"./X-Dpv9CfhB.js";import"./Zap-CbUqvhH7.js";import"./label-DjBQc1IG.js";import"./alert-dialog-D7aaUEgg.js";const Xt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Gt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Xt}];function Qt(s){const e=V.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=V.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Yt(s){const e=V.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Qt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Jt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=V.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=It(),o=es(a),{data:r}=Me({queryKey:ae.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=Ct(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Jt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(nt,{config:ts,className:"h-16 w-full",children:t.jsxs(_t,{data:p,barCategoryGap:"4%",children:[t.jsx(it,{content:t.jsx(ot,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(wt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(kt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=V.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=V.c(19),{connectionId:n}=s,c=H(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=V.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=V.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(rs,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function ds(s){const e=V.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=Tt(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=V.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:j.name}),t.jsx(Je,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function re(s){const e=V.c(5),{label:n}=s,c=H();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function xs(s){const e=V.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(R){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(R)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let R;e[18]!==C?(R=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=R):R=e[19];let q;e[20]!==d?(q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=q):q=e[21];let F;e[22]!==q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[22]=q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==R?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[R,F]}),e[24]=F,e[25]=R,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ne,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ne,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ne,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ne,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(At,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(ie,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(ie,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(ie,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(ie,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Pt,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=V.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=ze(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?qt(e.connection_url):null;return d?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(X,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(K,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(K,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(K,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(K,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(K,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(X,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(G,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(K,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(K,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(K,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(oe,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(K,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(K,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(X,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(X,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(X,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(X,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(Y,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(X,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(He,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(X,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(G,{className:"flex flex-col gap-3",children:[t.jsx(Q,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ut,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Et,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Lt,{size:12})]})})}),t.jsxs(Rt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(Y,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(vt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Kt(s.connection_headers)){const c=s.connection_headers,a=Ke(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Ge(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Re(),d=_e(),{org:f}=te(),u=St({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=Ze(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=Qe(D,Gt),v=Fe({resolver:Le(qe),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:R}=await rt({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(R||!O){J.error(r("details.connection.authFailed",{error:R??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const q=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(q.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();J.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...u}),t.jsx(ft,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(et,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(Nt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(X,{control:v.control,name:"title",render:({field:x})=>t.jsxs(G,{children:[t.jsx(Q,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(Y,{...x})}),t.jsx(W,{})]})}),t.jsx(X,{control:v.control,name:"description",render:({field:x})=>t.jsxs(G,{children:[t.jsx(Q,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(Y,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(We,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(Ye,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Yt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),J.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,R=Be("conn");await d.create.mutateAsync({id:R,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${f.slug}/mcp/${R}`,window.location.origin),F=await lt({url:q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(R)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=V.c(52),e=H();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ue(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=tt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=st(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=at(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Ve(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=V.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ee,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function ji(){const s=V.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{ji as default};
@@ -1 +1 @@
1
- import{X as R,a4 as A,b0 as I,Y as a,a2 as j,a3 as z,c as L,j as u,B as C}from"./index-sd38S2ER.js";import{I as H}from"./input-Df5WqCIh.js";import{s as W}from"./Plus-CSNWQMMp.js";import{s as q}from"./Trash01-BecpyKSB.js";const K=R({key:a().min(1,"Key is required"),value:a()}),G=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function M(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function Y(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function F(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{M as E,J as a,Q as b,G as c,Z as d,F as i,D as p,Y as r};
1
+ import{X as R,a4 as A,b0 as I,Y as a,a2 as j,a3 as z,c as L,j as u,B as C}from"./index-DDug671b.js";import{I as H}from"./input-CGjm14VM.js";import{s as W}from"./Plus-Ca5ksK2g.js";import{s as q}from"./Trash01-a9h5F5OE.js";const K=R({key:a().min(1,"Key is required"),value:a()}),G=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function M(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function Y(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function F(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{M as E,J as a,Q as b,G as c,Z as d,F as i,D as p,Y as r};
@@ -0,0 +1 @@
1
+ import{r as K,c as re,b as ae,j as t,B as G,k as ge,p as ce,m as xe,E as Je,F as De,d as Ne,u as Ye,a as ke,D as Ze,I as et,G as tt,_ as nt,Z as st,o as ot,t as Q,K as it}from"./index-DDug671b.js";import{a as Te,b as ct,g as rt,e as lt}from"./extract-connection-data-Bq1iwuT1.js";import{C as at}from"./collection-display-button-IQpgfmoE.js";import{S as dt}from"./search-input-D1r_hzL6.js";import{C as ut}from"./collection-tabs-CrOZFtVh.js";import{C as ve,u as mt,a as Ae,g as gt}from"./connection-card-BGFGJ3dJ.js";import{E as pt}from"./empty-state-0sZo57jy.js";import{P as pe}from"./index-CcB8mZk8.js";import{u as ft,D as ht}from"./use-delete-connection-DqRcaJY_.js";import{u as Ce}from"./use-capability-CSraCk_w.js";import{u as xt}from"./use-infinite-scroll-BCQQzaQW.js";import{u as jt}from"./use-view-mode-BOoVU3bc.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as we,d as Ie,b as Pe,f as Le,g as Oe,e as Me,a as Fe,A as $e}from"./alert-dialog-D7aaUEgg.js";import{a as je}from"./Tool02-CT9ZXUaF.js";import{g as yt}from"./metadata-dUsYcpuu.js";import{b as Ue,h as Ve,a as ze,c as Ee,d as Be,e as Ke}from"./dialog-BPjvUNGD.js";import{D as St,a as Ct,c as vt,b as bt,e as _t,f as Dt,g as Nt}from"./drawer-D-mvJkqQ.js";import{u as kt}from"./use-mobile-CnuHZAQe.js";import{F as te,b as ne,c as se,d as oe,e as ie,a as be}from"./form-CUC6wee5.js";import{I as de}from"./input-CGjm14VM.js";import{S as Tt,a as At,b as wt,c as It,d as me}from"./select-Csj8R7k2.js";import{T as Pt}from"./textarea-BS0D_b-K.js";import{b as He,u as Lt}from"./use-connection-BH3GAkyc.js";import{a as Ot}from"./use-virtual-mcp-BlRB4Rkc.js";import{u as Mt}from"./studio-tools-BVOWXGL8.js";import{s as Se}from"./Star01-CVXcsIV7.js";import{s as Re}from"./Plus-Ca5ksK2g.js";import{aJ as Ft,a as $t,V as Ut,a5 as Vt}from"./agent-icon-UVuzT1cN.js";import{s as We}from"./XClose-DyN8kvjl.js";import{i as fe,a as _e,E as zt,c as Et,p as Bt,b as Kt,d as Ht}from"./connection-form-helpers-GHi3zYxQ.js";import{a as Rt}from"./authenticate-and-persist-oauth-CdKnhp_q.js";import{I as Wt}from"./integration-icon-CdNdqZ3V.js";import{C as Xe}from"./checkbox-DyIcCVMx.js";import{a as ue,D as Xt,c as Gt,b as qt}from"./dropdown-menu-CaL7DApX.js";import{a as Qt}from"./DotsVertical-BIcnJzPR.js";import{s as Ge}from"./Eye-Cvgl0KNf.js";import{s as qe}from"./Trash01-a9h5F5OE.js";import"./use-mcp-client-BHIx7JlY.js";import"./auth-BIKfPH28.js";import"./ArrowUp-BQshHDSK.js";import"./Check-DgYNB0_V.js";import"./SwitchHorizontal01-BTb2rFJr.js";import"./tooltip-WZpxGeui.js";import"./view-mode-toggle-CawzraQZ.js";import"./badge-B33YJ7h5.js";import"./SearchMd-B26GBZrh.js";import"./use-registry-connections-z0q_Ein8.js";import"./use-organization-settings-lxipe-fc.js";import"./useInfiniteQuery-BIQdmDG8.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-CNJcSytc.js";import"./sidebar-BjwcFmHe.js";import"./LayoutLeft-B0iWGVbj.js";import"./X-Dpv9CfhB.js";import"./label-DjBQc1IG.js";import"./ChevronDown-CHc-y-Al.js";import"./ChevronUp-B-O9_nTC.js";import"./AlertCircle-B7r3EaII.js";import"./Tool01-CtxHxaVb.js";import"./Settings02-CxyT3aA1.js";import"./XCircle-_qYA_TW_.js";import"./ArrowUpRight-BCZbaWin.js";import"./TrendUp01-B0KTJh5U.js";import"./ZapSquare-BJsaOMIO.js";import"./Users03-CwkNhzLs.js";import"./CheckCircle-CN5-9xsQ.js";import"./ChevronRight-9d4jtA28.js";import"./Stars02-BiPhZp0l.js";import"./Copy01-C5QjOujR.js";import"./FilterLines-DGkZM5wO.js";import"./Palette-D7J1kWGW.js";import"./HardDrive-Cs2Ept5K.js";import"./Key01-CABDssnL.js";import"./LinkExternal01-CuFbC-Ib.js";import"./LogOut01-BTC97zIN.js";import"./Monitor01-CmLdEM36.js";import"./Sun-DuCKp6uv.js";import"./Play-eSj6vmxE.js";import"./SearchLg-CPBJr8DH.js";import"./Shield01-Cv0doLKj.js";import"./Stars01-C6tvzvYW.js";import"./Upload01-Cc8J1X67.js";import"./User01-DYrVlXdz.js";import"./Users01-B0OeOpb3.js";import"./Zap-CbUqvhH7.js";import"./mcp-oauth-Cfiwi3-V.js";function Jt(s){const e=`deco-filters-${s}`,[n,g]=K.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{g(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Yt(s){const e=re.c(7),[n,g]=K.useState(s),[l,c]=K.useState(s?"desc":null);let o;e[0]!==l||e[1]!==n?(o=a=>{n!==a?(g(a),c("asc")):l==="asc"?c("desc"):l==="desc"&&(g(void 0),c(null))},e[0]=l,e[1]=n,e[2]=o):o=e[2];const r=o;let d;return e[3]!==r||e[4]!==l||e[5]!==n?(d={sortKey:n,sortDirection:l,handleSort:r},e[3]=r,e[4]=l,e[5]=n,e[6]=d):d=e[6],d}function Zt(s){const e=re.c(20),{namespace:n,resource:g,defaultSortKey:l,defaultViewMode:c}=s,o=l===void 0?"title":l,r=c===void 0?"table":c,[d,a]=K.useState(""),N=K.useDeferredValue(d),h=`${n}-${g}`,[p,v]=Jt(h),x=`studio-${g}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[m,S]=K.useState(_);let j;e[2]!==x?(j=U=>{S(U),globalThis.localStorage?.setItem(x,String(U))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==m||e[5]!==D?(b=()=>{D(!m)},e[4]=m,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=jt(`studio-${g}-${n}`,r),{sortKey:L,sortDirection:$,handleSort:A}=Yt(o),V=L;let O;return e[7]!==m||e[8]!==p||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==$||e[16]!==V||e[17]!==k||e[18]!==i?(O={search:d,searchTerm:N,setSearch:a,filters:p,setFilters:v,filterBarVisible:m,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:V,sortDirection:$,handleSort:A},e[7]=m,e[8]=p,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=$,e[16]=V,e[17]=k,e[18]=i,e[19]=O):O=e[19],O}function en(s){const e=re.c(35),{open:n,onOpenChange:g,count:l,onConfirm:c}=s,o=ae(),r=l!==1?"s":"";let d;e[0]!==l||e[1]!==o||e[2]!==r?(d=o("orgs.bulkDeleteDialog.deleteTitle",{count:l,plural:r}),e[0]=l,e[1]=o,e[2]=r,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(we,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=l!==1?"s":"";let h;e[6]!==o||e[7]!==N?(h=o("orgs.bulkDeleteDialog.deleteDescription",{plural:N}),e[6]=o,e[7]=N,e[8]=h):h=e[8];let p;e[9]!==h?(p=t.jsx(Ie,{children:h}),e[9]=h,e[10]=p):p=e[10];let v;e[11]!==a||e[12]!==p?(v=t.jsxs(Pe,{children:[a,p]}),e[11]=a,e[12]=p,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Le,{children:x}),e[16]=x,e[17]=_):_=e[17];const m=l!==1?"s":"";let S;e[18]!==l||e[19]!==o||e[20]!==m?(S=o("orgs.bulkDeleteDialog.deleteButton",{count:l,plural:m}),e[18]=l,e[19]=o,e[20]=m,e[21]=S):S=e[21];let j;e[22]!==c||e[23]!==S?(j=t.jsx(Oe,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:S}),e[22]=c,e[23]=S,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Me,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs(Fe,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==g||e[32]!==n||e[33]!==b?(k=t.jsx($e,{open:n,onOpenChange:g,children:b}),e[31]=g,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function tn(s){return s._registryId?.includes("community-registry")===!0}function nn(s){const e=re.c(83),{item:n,canManage:g,allConnections:l,connectedAppNames:c,connectingItemId:o,onNavigateConnected:r,onConnect:d}=s,a=ae(),[N,h]=K.useState(!1),[p,v]=K.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Te(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const m=_;let S;e[4]!==n._meta?(S=yt(n._meta),e[4]=n._meta,e[5]=S):S=e[5];const j=S,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||ct(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==l||e[10]!==x){let E;e[12]!==x?(E=le=>le.connection_type!=="VIRTUAL"&&le.app_name===x,e[12]=x,e[13]=E):E=e[13],T=l.filter(E),e[9]=l,e[10]=x,e[11]=T}else T=e[11];const L=T;let $;e[14]!==n?($=tn(n),e[14]=n,e[15]=$):$=e[15];const A=$;let V,O;e[16]!==L||e[17]!==g||e[18]!==A||e[19]!==m||e[20]!==n||e[21]!==d||e[22]!==r?(V=()=>{if(m){const E=L[0];E&&r(E);return}g&&O()},O=()=>{A?(v("connect"),h(!0)):d(n)},e[16]=L,e[17]=g,e[18]=A,e[19]=m,e[20]=n,e[21]=d,e[22]=r,e[23]=V,e[24]=O):(V=e[23],O=e[24]);let U;e[25]!==n||e[26]!==d||e[27]!==p?(U=()=>{ce("connections_community_warning_confirmed",{registry_item_id:n.id}),h(!1),p==="connect"&&d(n),v(null)},e[25]=n,e[26]=d,e[27]=p,e[28]=U):U=e[28];const B=U;let I;e[29]!==b||e[30]!==i||e[31]!==D?(I={title:D,description:b,icon:i},e[29]=b,e[30]=i,e[31]=D,e[32]=I):I=e[32];let q;e[33]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(je,{}),e[33]=q):q=e[33];let J;e[34]!==A||e[35]!==n._sourceIcon?(J=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[34]=A,e[35]=n._sourceIcon,e[36]=J):J=e[36];let y;e[37]!==g||e[38]!==o||e[39]!==O||e[40]!==m||e[41]!==n.id||e[42]!==a?(y=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):g&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:E=>{E.stopPropagation(),O()},children:o===n.id?t.jsx(ge,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[37]=g,e[38]=o,e[39]=O,e[40]=m,e[41]=n.id,e[42]=a,e[43]=y):y=e[43];let w;e[44]!==y||e[45]!==J?(w=t.jsxs("div",{className:"flex items-center gap-2",children:[J,y]}),e[44]=y,e[45]=J,e[46]=w):w=e[46];let z;e[47]!==V||e[48]!==w||e[49]!==I?(z=t.jsx(ve,{connection:I,fallbackIcon:q,onClick:V,headerActionsAlwaysVisible:!0,headerActions:w}),e[47]=V,e[48]=w,e[49]=I,e[50]=z):z=e[50];let R;e[51]!==a?(R=a("orgs.catalogItemCard.communityMcpServerTitle"),e[51]=a,e[52]=R):R=e[52];let H;e[53]!==R?(H=t.jsx(we,{children:R}),e[53]=R,e[54]=H):H=e[54];let C;e[55]!==a?(C=a("orgs.catalogItemCard.communityMcpServerDescription"),e[55]=a,e[56]=C):C=e[56];let M;e[57]!==C?(M=t.jsx(Ie,{children:C}),e[57]=C,e[58]=M):M=e[58];let P;e[59]!==H||e[60]!==M?(P=t.jsxs(Pe,{children:[H,M]}),e[59]=H,e[60]=M,e[61]=P):P=e[61];let Y;e[62]!==a?(Y=a("orgs.catalogItemCard.cancel"),e[62]=a,e[63]=Y):Y=e[63];let ee;e[64]!==Y?(ee=t.jsx(Le,{children:Y}),e[64]=Y,e[65]=ee):ee=e[65];let Z;e[66]!==a?(Z=a("orgs.catalogItemCard.continue"),e[66]=a,e[67]=Z):Z=e[67];let u;e[68]!==B||e[69]!==Z?(u=t.jsx(Oe,{onClick:B,children:Z}),e[68]=B,e[69]=Z,e[70]=u):u=e[70];let f;e[71]!==ee||e[72]!==u?(f=t.jsxs(Me,{children:[ee,u]}),e[71]=ee,e[72]=u,e[73]=f):f=e[73];let F;e[74]!==P||e[75]!==f?(F=t.jsxs(Fe,{children:[P,f]}),e[74]=P,e[75]=f,e[76]=F):F=e[76];let W;e[77]!==N||e[78]!==F?(W=t.jsx($e,{open:N,onOpenChange:h,children:F}),e[77]=N,e[78]=F,e[79]=W):W=e[79];let X;return e[80]!==z||e[81]!==W?(X=t.jsxs(t.Fragment,{children:[z,W]}),e[80]=z,e[81]=W,e[82]=X):X=e[82],X}function Qe(s){const e=re.c(8),{selectionMode:n,children:g}=s,l=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==l?(c=xe("overflow-hidden transition-all duration-150 ease-out",l),e[0]=l,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Xt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:on,children:t.jsx(Qt,{size:20})})}),e[2]=o):o=e[2];let r;e[3]!==g?(r=t.jsxs(Gt,{children:[o,t.jsx(qt,{align:"end",onClick:sn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==c||e[6]!==r?(d=t.jsx("div",{className:c,children:r}),e[5]=c,e[6]=r,e[7]=d):d=e[7],d}function sn(s){return s.stopPropagation()}function on(s){return s.stopPropagation()}function cn(s){const e=re.c(56),{group:n,onOpen:g,selectionMode:l,selectedIds:c,onToggleSelect:o}=s,r=ae();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=q=>c.has(q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=q=>c.has(q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const h=N;let p;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(p=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=p):p=e[14];const v=p,x=n.title,_=n.icon;let m;e[15]!==n.connections.length||e[16]!==r?(m=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=m):m=e[17];let S;e[18]!==n.icon||e[19]!==n.title||e[20]!==m?(S={title:x,icon:_,description:m},e[18]=n.icon,e[19]=n.title,e[20]=m,e[21]=S):S=e[21];let j;e[22]!==g||e[23]!==l||e[24]!==v?(j=()=>l?v():g(),e[22]=g,e[23]=l,e[24]=v,e[25]=j):j=e[25];const D=l&&a&&"ring-2 ring-primary",b=l&&h&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=xe(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];let i;e[29]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(je,{}),e[29]=i):i=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==l||e[33]!==h||e[34]!==r||e[35]!==v?(T=l?t.jsx(Xe,{checked:a?!0:h?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=l,e[33]=h,e[34]=r,e[35]=v,e[36]=T):T=e[36];let L;e[37]!==g?(L=I=>{I.stopPropagation(),g()},e[37]=g,e[38]=L):L=e[38];let $;e[39]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ge,{size:16}),e[39]=$):$=e[39];let A;e[40]!==r?(A=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=A):A=e[41];let V;e[42]!==L||e[43]!==A?(V=t.jsxs(ue,{onClick:L,children:[$,A]}),e[42]=L,e[43]=A,e[44]=V):V=e[44];let O;e[45]!==l||e[46]!==V?(O=t.jsx(Qe,{selectionMode:l,children:V}),e[45]=l,e[46]=V,e[47]=O):O=e[47];let U;e[48]!==T||e[49]!==O?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[T,O]}),e[48]=T,e[49]=O,e[50]=U):U=e[50];let B;return e[51]!==k||e[52]!==U||e[53]!==S||e[54]!==j?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:S,onClick:j,className:k,fallbackIcon:i,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=k,e[52]=U,e[53]=S,e[54]=j,e[55]=B):B=e[55],B}function rn(s){const e=re.c(36),{connection:n,isSelected:g,selectionMode:l,canManage:c,canManageAgents:o,onToggleSelect:r,onOpen:d,onToggleStatus:a,onDelete:N}=s,h=ae();let p;e[0]!==g||e[1]!==r||e[2]!==l||e[3]!==h?(p=l?t.jsx(Xe,{checked:g,onCheckedChange:r,onClick:ln}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:h("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=l,e[3]=h,e[4]=p):p=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ge,{size:16}),e[7]=x):x=e[7];let _;e[8]!==h?(_=h("orgs.connectionSelectionUi.open"),e[8]=h,e[9]=_):_=e[9];let m;e[10]!==v||e[11]!==_?(m=t.jsxs(ue,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=m):m=e[12];let S;e[13]!==c||e[14]!==o||e[15]!==r||e[16]!==h?(S=(c||o)&&t.jsxs(ue,{onClick:i=>{i.stopPropagation(),r()},children:[t.jsx(Ft,{size:16}),h("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=r,e[16]=h,e[17]=S):S=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==h?(j=c&&(n.status==="active"?t.jsxs(ue,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx($t,{size:16}),h("orgs.connectionSelectionUi.disable")]}):t.jsxs(ue,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Ut,{size:16}),h("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=h,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==h?(D=c&&t.jsxs(ue,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(qe,{size:16}),h("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=h,e[26]=D):D=e[26];let b;e[27]!==l||e[28]!==m||e[29]!==S||e[30]!==j||e[31]!==D?(b=t.jsxs(Qe,{selectionMode:l,children:[m,S,j,D]}),e[27]=l,e[28]=m,e[29]=S,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==p||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[p,b]}),e[33]=p,e[34]=b,e[35]=k):k=e[35],k}function ln(s){return s.stopPropagation()}function an(s){const e=re.c(29),{count:n,total:g,canManage:l,canManageAgents:c,onSelectAll:o,onDeselectAll:r,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:h}=s,p=ae();if(n===0)return null;let v;e[0]!==n||e[1]!==p?(v=p("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=p,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==r||e[7]!==o||e[8]!==p||e[9]!==g?(_=n<g?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:p("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:p("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=o,e[8]=p,e[9]=g,e[10]=_):_=e[10];let m;e[11]!==c||e[12]!==a||e[13]!==p?(m=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Re,{size:13}),p("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=p,e[14]=m):m=e[14];let S;e[15]!==l||e[16]!==d||e[17]!==N||e[18]!==p?(S=l&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:p("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:p("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(qe,{size:13}),p("orgs.connectionSelectionUi.delete")]})]}),e[15]=l,e[16]=d,e[17]=N,e[18]=p,e[19]=S):S=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(We,{size:13}),e[20]=j):j=e[20];let D;e[21]!==h?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:j}),e[21]=h,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==m||e[26]!==S||e[27]!==D?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[x,_,m,S,D]})}),e[23]=x,e[24]=_,e[25]=m,e[26]=S,e[27]=D,e[28]=b):b=e[28],b}function dn(s){const e=re.c(45),{open:n,onOpenChange:g,agents:l,onConfirm:c}=s,o=ae(),[r,d]=K.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ue,{children:a}),e[2]=a,e[3]=N):N=e[3];let h;e[4]!==o?(h=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=h):h=e[5];let p;e[6]!==h?(p=t.jsx(Ve,{children:h}),e[6]=h,e[7]=p):p=e[7];let v;e[8]!==N||e[9]!==p?(v=t.jsxs(ze,{children:[N,p]}),e[8]=N,e[9]=p,e[10]=v):v=e[10];let x;e[11]!==l||e[12]!==r||e[13]!==o?(x=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):l.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:xe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Wt,{icon:A.icon,name:A.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=l,e[12]=r,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let m;e[17]!==g?(m=()=>g(!1),e[17]=g,e[18]=m):m=e[18];let S;e[19]!==o?(S=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=S):S=e[20];let j;e[21]!==m||e[22]!==S?(j=t.jsx(G,{variant:"outline",onClick:m,children:S}),e[21]=m,e[22]=S,e[23]=j):j=e[23];const D=!r;let b;e[24]!==c||e[25]!==g||e[26]!==r?(b=()=>{r&&(c(r),g(!1),d(null))},e[24]=c,e[25]=g,e[26]=r,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Ee,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let L;e[37]!==T||e[38]!==v||e[39]!==_?(L=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=L):L=e[40];let $;return e[41]!==g||e[42]!==n||e[43]!==L?($=t.jsx(Ke,{open:n,onOpenChange:g,children:L}),e[41]=g,e[42]=n,e[43]=L,e[44]=$):$=e[44],$}function un({listState:s,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:l,enabledRegistries:c}){const o=ae(),{org:r}=De(),d=ot(),a=Ne(),{data:N}=ke.useSession(),h=He(),p=Lt(s),v=ft(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[m,S]=K.useState(new Set),j=m.size>0,[D,b]=K.useState(!1),[k,i]=K.useState(!1),[T,L]=K.useState(null),$=Ot(),A=p.filter(u=>!(n!=="ALL"&&u.connection_type!==n||g!=="ALL"&&u.status!==g)),V=gt(A),O=u=>{S(f=>{const F=new Set(f);return F.has(u)?F.delete(u):F.add(u),F})},U=()=>{S(new Set)},B=Ae(c,s.searchTerm),I=B.items,q=xt(B.loadMore,B.hasMore,B.isLoadingMore),J=new Set(p.filter(u=>u.app_name).map(u=>u.app_name)),y=l==="ALL"||c.some(u=>u.id===l)?l:"ALL",w=s.search.length>0,z=e==="all"||w?I.filter(u=>{if(y!=="ALL"&&u._registryId!==y)return!1;if(w){const f=Te(u);if(f&&J.has(f))return!1}return!0}):[],R=e==="connected"||w?V:[],H=async u=>{if(!(!r||!N?.user?.id)){ce("connection_add_clicked",{action:"connect_new",registry_item_id:u.id,source:"connections_page"}),L(u.id);try{const f=lt(u,r.id,N.user.id,{remoteIndex:0}),F=f.connection_type==="STDIO",W=!!f.connection_url,X=F&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!W&&!X){Q.error(o("orgs.connections.cannotConnectNoMethod")),L(null);return}const{id:E}=await h.create.mutateAsync(f),le=await Rt({connectionId:E,orgId:r.id,orgSlug:r.slug,persistFallback:ye=>h.update.mutateAsync({id:E,data:{connection_token:ye}}).then(()=>{})});if(le.ran&&!le.ok){ce("connection_oauth_failed",{connection_id:E,flow:"connections_page_connect",error:le.error??"no_token"}),Q.error(o("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ce("connection_oauth_succeeded",{connection_id:E,flow:"connections_page_connect"});const ye=new URL(`/api/${r.slug}/mcp/${E}`,window.location.origin);await d.invalidateQueries({queryKey:it.isMCPAuthenticated(ye.href,null)}),M(),Q.success(o("orgs.connections.authenticationSuccessful"))}Q.success(o("orgs.connections.connectedSuccessfully"))}catch(f){Q.error(o("orgs.connections.failedToConnect",{error:f instanceof Error?f.message:String(f)}))}finally{L(null)}}},C=Mt(),M=()=>{d.invalidateQueries({predicate:u=>{const f=u.queryKey;return f[1]===r.id&&f[3]==="collection"&&f[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const u=[...m];ce("connections_bulk_delete",{count:u.length});let f=0;for(const F of u)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:F,force:!0}),f++}catch{}M(),Q.success(o("orgs.connections.deletedConnections",{count:f})),U()},Y=async(u,f)=>{try{await h.update.mutateAsync({id:u,data:{status:f}}),M(),Q.success(o(f==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Q.error(o("orgs.connections.failedToUpdateConnection"))}},ee=async u=>{const f=[...m];ce("connections_bulk_status_toggled",{count:f.length,to_status:u});let F=0;for(const W of f)try{await h.update.mutateAsync({id:W,data:{status:u}}),F++}catch{}M(),Q.success(u==="active"?o("orgs.connections.enabledConnections",{count:F}):o("orgs.connections.disabledConnections",{count:F})),U()},Z=async u=>{const f=$.find(X=>X.id===u);if(!f)return;ce("connections_bulk_add_to_agent",{agent_id:u,count:m.size});const F=new Set(f.connections.map(X=>X.connection_id)),W=[...m].filter(X=>!F.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Q.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:u,data:{connections:[...f.connections,...W]}}),d.invalidateQueries({predicate:X=>{const E=X.queryKey;return E[1]===r.id&&E[3]==="collection"&&E[4]==="VIRTUAL_MCP"}}),Q.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:f.title})),U()}catch{Q.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(ht,{...v}),t.jsx(en,{open:D,onOpenChange:b,count:m.size,onConfirm:P}),t.jsx(dn,{open:k,onOpenChange:i,agents:$,onConfirm:Z}),B.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(pt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(u=>{if(u.type==="group")return t.jsx(cn,{group:u,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:u.key}})},selectionMode:j,selectedIds:m,onToggleSelect:O},u.key);const f=u.connection,F=m.has(f.id);return t.jsx(ve,{connection:f,fallbackIcon:t.jsx(je,{}),onClick:()=>j?O(f.id):a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:he(f)}}),className:xe(F&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:f,isSelected:F,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>O(f.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:he(f)}}),onToggleStatus:W=>Y(f.id,W),onDelete:()=>v.requestDelete(f)})},f.id)}),z.map(u=>t.jsx(nn,{item:u,canManage:x,allConnections:p,connectedAppNames:J,connectingItemId:T,onNavigateConnected:f=>a({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:he(f)}}),onConnect:H},`catalog-${u._registryId}:${u.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:q,className:"col-span-full h-4"}),(e==="all"||w)&&B.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ge,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(an,{count:m.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{S(new Set(A.map(u=>u.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:ee,onCancel:U})]})}function mn(){const s=ae(),{org:e}=De(),n=Ne(),g=Ye({strict:!1}),{data:l}=ke.useSession(),{stdioEnabled:c}=Ze(),o=kt(),{granted:r}=Ce("connections:manage"),d=Zt({namespace:e.slug,resource:"connections"}),a=He(),[N,h]=et(tt.connectionsTab(e.slug),y=>g.tab==="all"||g.tab==="connected"?g.tab:y??"all"),[p,v]=K.useState("ALL"),[x,_]=K.useState("ALL"),[m,S]=K.useState("ALL"),j=mt(),b=Ae(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=nt({resolver:st(Et),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),L=i.watch("connection_url"),$=i.watch("npx_package"),A=fe({uiType:T,connectionUrl:L??"",npxPackage:$??""})??_e({uiType:T,connectionUrl:L??"",registryItems:b}),V=r&&g.action==="create",O=()=>{ce("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},U=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},B=async y=>{let w,z=null,R=null,H=null;y.ui_type==="NPX"?(w="STDIO",z="",H=Kt(y.npx_package||"",y.env_vars||[])):y.ui_type==="STDIO"?(w="STDIO",z="",H=Ht(y.stdio_command||"",y.stdio_args||"",y.stdio_cwd,y.env_vars||[])):(w=y.ui_type,z=y.connection_url||"",R=y.connection_token||null);const C=rt("conn");ce("connection_custom_created",{connection_type:w,ui_type:y.ui_type}),await a.create.mutateAsync({id:C,title:y.title,description:y.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:e.id,icon:y.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),U(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:he({app_name:null,connection_url:z,title:y.title,id:C})}})},I=y=>{y||(V&&U(),i.reset())},q=y=>{const w=y.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Y=i.getValues("env_vars")??[],ee=new Set(Y.map(u=>u.key)),Z=P.envVarKeys.filter(u=>!ee.has(u));Z.length>0&&i.setValue("env_vars",[...Y,...Z.map(u=>({key:u,value:""}))],{shouldDirty:!0})}},M=Bt(w);if(M&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",M.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(fe({uiType:"NPX",npxPackage:M.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(fe({uiType:P,connectionUrl:w})??_e({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(fe({uiType:"NPX",npxPackage:w}))},J=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:O,children:[t.jsx(Re,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const y=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(te,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.type")}),t.jsxs(Tt,{value:C.value,onValueChange:C.onChange,children:[t.jsx(oe,{children:t.jsx(At,{children:t.jsx(wt,{})})}),t.jsxs(It,{children:[t.jsx(me,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(me,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(me,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(me,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(me,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Vt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(ie,{})]})}),T==="NPX"&&t.jsx(te,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.npmPackage")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:M=>{const P=M.clipboardData.getData("text");P&&(M.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),q(P))},onBlur:M=>{q(M.target.value),C.onBlur()}})}),t.jsx(ie,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(te,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.command")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(ie,{})]})}),t.jsx(te,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.arguments")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(ie,{})]})})]}),t.jsx(te,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.workingDirectory")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(ie,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(te,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.environmentVariables")}),t.jsx(oe,{children:t.jsx(zt,{value:C.value??[],onChange:C.onChange})}),t.jsx(ie,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(te,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.url")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:M=>{const P=M.clipboardData.getData("text");P&&(M.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),q(P))},onBlur:M=>{q(M.target.value),C.onBlur()}})}),t.jsx(ie,{})]})}),t.jsx(te,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(oe,{children:t.jsx(de,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(ie,{})]})})]}),t.jsx(te,{control:i.control,name:"title",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.name")}),t.jsx(oe,{children:t.jsx(de,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(ie,{})]})}),t.jsx(te,{control:i.control,name:"description",render:({field:C})=>t.jsxs(ne,{children:[t.jsx(se,{children:s("orgs.connections.description")}),t.jsx(oe,{children:t.jsx(Pt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(ie,{})]})})]}),H=V;return o?t.jsx(St,{open:H,onOpenChange:I,children:t.jsxs(Ct,{className:"max-h-[90vh]",children:[t.jsx(vt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(bt,{children:y}),t.jsx(_t,{className:"mt-1",children:w})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(We,{size:16})})})]})}),t.jsx(be,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(B),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(Nt,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Ke,{open:H,onOpenChange:I,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(ze,{children:[t.jsx(Ue,{children:y}),t.jsx(Ve,{children:w})]}),t.jsx(be,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(B),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ee,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>I(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:y=>{y.key==="Escape"&&(d.setSearch(""),y.target.blur())}}),t.jsx(at,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:p,onChange:y=>v(y||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:x,onChange:y=>_(y||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:m,onChange:y=>S(y||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(y=>({id:y.id,label:y.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):y.title}))]}]:[]]})]}),J]}),t.jsx(ut,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:y=>{const w=y;w!==N&&ce("connections_page_tab_changed",{to_tab:w}),h(w)}}),t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(un,{listState:d,activeTab:N,typeFilter:p,statusFilter:x,registryFilter:m,enabledRegistries:j})})})]})})})]})})}function Gs(){const s=re.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Je,{children:t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(mn,{})})}),s[0]=e):e=s[0],e}export{Gs as default};