decocms 4.132.3 → 4.133.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 (249) hide show
  1. package/dist/client/assets/{AlertCircle-DO8AJGWB.js → AlertCircle-D1EFOpNe.js} +1 -1
  2. package/dist/client/assets/{AreaChart-NfVY7RSM.js → AreaChart-D9vqL4Wl.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-DHJzC9yL.js → ArrowUp-BMyyApv0.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BHQ7XQ3Y.js → ArrowUpRight-CW2ZVxtG.js} +1 -1
  5. package/dist/client/assets/{Check-BTaTIHDo.js → Check-5NI1QKZd.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-pmSLGGBL.js → CheckCircle-Dm4eLsPy.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Dz8rYTo2.js → ChevronDown-EiDIMI8-.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CcHnWjQw.js → ChevronRight-b9CWsPSi.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DwhrRWOS.js → ChevronUp-BPCG9PUM.js} +1 -1
  10. package/dist/client/assets/{Copy01-DvYO0s9y.js → Copy01-BWqHMF3b.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-BzssfvDH.js → DotsVertical-iBRgqnhk.js} +1 -1
  12. package/dist/client/assets/{Eye-CGA18aa1.js → Eye-D-Iwb8I9.js} +1 -1
  13. package/dist/client/assets/{FilterLines-DleeTW24.js → FilterLines-Cx0qwQvZ.js} +1 -1
  14. package/dist/client/assets/{HardDrive-BS2-5W4k.js → HardDrive-BwcR8m6C.js} +1 -1
  15. package/dist/client/assets/{Key01-DxefwErs.js → Key01-B8Ou2QJB.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-wy3G5IiO.js → LayoutLeft-CHPOZnyo.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-JEvN2IWs.js → LinkExternal01-Ba3ftJ_R.js} +1 -1
  18. package/dist/client/assets/{LogOut01-BTbrzToV.js → LogOut01-P2BkZ-8B.js} +1 -1
  19. package/dist/client/assets/{Monitor01-C2hKjydq.js → Monitor01-plO_Z_lU.js} +1 -1
  20. package/dist/client/assets/{Palette-DOWvY2fs.js → Palette-NkINHuYO.js} +1 -1
  21. package/dist/client/assets/{Play-UyW8xTuC.js → Play-DNsEw7K5.js} +1 -1
  22. package/dist/client/assets/{Plus-DZ74PeRy.js → Plus-Cl4qtph7.js} +1 -1
  23. package/dist/client/assets/{SearchLg-DO4-eTMy.js → SearchLg-DpAUIQTx.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BytPwk0l.js → SearchMd-UGeI38f9.js} +1 -1
  25. package/dist/client/assets/{Settings02-D-2jum9c.js → Settings02-CNvgTiqs.js} +1 -1
  26. package/dist/client/assets/{Shield01-CXehW1bY.js → Shield01-DyU5Pc5k.js} +1 -1
  27. package/dist/client/assets/{Star01-BAizQSnd.js → Star01-Bd-5J4Lj.js} +1 -1
  28. package/dist/client/assets/{Stars01-DXY7uTrY.js → Stars01-B_LqALAO.js} +1 -1
  29. package/dist/client/assets/{Stars02-Mk2KS1Iq.js → Stars02-yb0Am4ou.js} +1 -1
  30. package/dist/client/assets/{Sun-CaCfNeal.js → Sun-BfCJUnUR.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-CtyzxFYC.js → SwitchHorizontal01-DdqBdzLk.js} +1 -1
  32. package/dist/client/assets/{Tool01-o2URO3Xw.js → Tool01-5dsYVH9m.js} +1 -1
  33. package/dist/client/assets/{Tool02-COcgrUGY.js → Tool02-B1daDn4g.js} +1 -1
  34. package/dist/client/assets/{Trash01-Dkm8dhQa.js → Trash01-BNr5muXv.js} +1 -1
  35. package/dist/client/assets/{TrendUp01-B6EjI-eP.js → TrendUp01-C94t5UF_.js} +1 -1
  36. package/dist/client/assets/{Upload01-B6UQJenG.js → Upload01-Z0fsKYsa.js} +1 -1
  37. package/dist/client/assets/{User01-C-3QhhY8.js → User01-ChozFzAn.js} +1 -1
  38. package/dist/client/assets/{Users01-BtoiNkYu.js → Users01-Dvi13jrX.js} +1 -1
  39. package/dist/client/assets/{Users03-DrE5YWI-.js → Users03-C4wjtTaG.js} +1 -1
  40. package/dist/client/assets/{X-gWtgqXtq.js → X-BxlAIg00.js} +1 -1
  41. package/dist/client/assets/XCircle-EznHRbAE.js +1 -0
  42. package/dist/client/assets/{XClose-4JuituU3.js → XClose-HdAPiAFA.js} +1 -1
  43. package/dist/client/assets/{Zap-Cckv2ysK.js → Zap-DaJ64ImZ.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-sN72C3rB.js → ZapSquare-BvRmDr6t.js} +1 -1
  45. package/dist/client/assets/{access-gate-CB8omzGA.js → access-gate-fL6r5bq0.js} +1 -1
  46. package/dist/client/assets/{add-section-modal-CEsw-hhH.js → add-section-modal-aRBFkVLn.js} +1 -1
  47. package/dist/client/assets/agent-capabilities-cXfbMfjV.js +1 -0
  48. package/dist/client/assets/agent-icon-CUdj9a7D.js +1 -0
  49. package/dist/client/assets/agents-list-BJp-rYHG.js +1 -0
  50. package/dist/client/assets/{ai-providers-BvGWTMHi.js → ai-providers-DuiS_cRo.js} +1 -1
  51. package/dist/client/assets/{alert-x5VnDVum.js → alert-QZvjCvjp.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BQXH5QlO.js → alert-dialog-D0ADYiJb.js} +1 -1
  53. package/dist/client/assets/app-editor-jEVw4VdX.js +1 -0
  54. package/dist/client/assets/{auth-JRIP9lfB.js → auth-BmCKFNnH.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BnOoA7Mj.js → auth-catchall-DhXHEex8.js} +1 -1
  56. package/dist/client/assets/{auth-entry-2KnkE3C2.js → auth-entry-CIaD70HI.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-Sa4uv3zQ.js → auth-split-layout-CuxYmM3L.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-DFLQVpqC.js → authenticate-and-persist-oauth-CkajuFfc.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-D7E9Kn1U.js → automation-list-row-2ZYemPoP.js} +1 -1
  60. package/dist/client/assets/{automation-runs-DiYWzSYK.js → automation-runs-C1TeyztC.js} +7 -7
  61. package/dist/client/assets/automations-BS3ykZi5.js +1 -0
  62. package/dist/client/assets/{avatar-gfucIkgw.js → avatar-0c465KL2.js} +1 -1
  63. package/dist/client/assets/{badge-DywtG9EL.js → badge-B4UFBZHt.js} +1 -1
  64. package/dist/client/assets/{block-document-BffMwAwV.js → block-document-CyUs20VR.js} +1 -1
  65. package/dist/client/assets/{brand-context-Ch-r9p72.js → brand-context-BlqXLTVP.js} +1 -1
  66. package/dist/client/assets/{buckets-BOgEu0eM.js → buckets-bhxWLISW.js} +1 -1
  67. package/dist/client/assets/bulk-category-panel-Ddrm4aLm.js +1 -0
  68. package/dist/client/assets/{calendar-Dsn6K5sG.js → calendar-m3vzr9CW.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-D_o-DiqA.js → capability-load-error-CTumtUvP.js} +1 -1
  70. package/dist/client/assets/{card-DfCYY00-.js → card-DUp9-cc7.js} +1 -1
  71. package/dist/client/assets/category-editor-BTUo1Pfs.js +1 -0
  72. package/dist/client/assets/{chat-context-og02PpRy.js → chat-context-OugPuthB.js} +1 -1
  73. package/dist/client/assets/{checkbox-CodJ-DjN.js → checkbox-DzWb8tQm.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BtVPRCCV.js → cli-auth-success-81rnx4wZ.js} +1 -1
  75. package/dist/client/assets/collection-detail-rNMOIMRN.js +1 -0
  76. package/dist/client/assets/{collection-display-button-IHiAJ77P.js → collection-display-button-QOFml_4u.js} +1 -1
  77. package/dist/client/assets/{collection-search-DfaOYvz3.js → collection-search-2WLROEuH.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-f08MOK3U.js → collection-table-wrapper-ea_1DdgH.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-BRRlVwwX.js → collection-tabs-DtBl2--X.js} +1 -1
  80. package/dist/client/assets/{command-D_SuF5XT.js → command-iiEZFaSc.js} +1 -1
  81. package/dist/client/assets/commerce-onboarding-CkmxaoCD.js +1 -0
  82. package/dist/client/assets/{companions-core-vWkhy-Xa.js → companions-core-D5ncC1DM.js} +1 -1
  83. package/dist/client/assets/{connect-LpoaPfT9.js → connect-B8eIaBH6.js} +1 -1
  84. package/dist/client/assets/{connect-desktop-dialog-JoYMIG25.js → connect-desktop-dialog-C5mpULtZ.js} +1 -1
  85. package/dist/client/assets/{connection-CP08jUAI.js → connection-CTNdymbE.js} +1 -1
  86. package/dist/client/assets/{connection-card-Cp6qxhsR.js → connection-card-DCx7YUCL.js} +1 -1
  87. package/dist/client/assets/connection-detail-Tal8Gntk.js +1 -0
  88. package/dist/client/assets/{connection-form-helpers-B7I8IsOZ.js → connection-form-helpers-DZUJO_PA.js} +1 -1
  89. package/dist/client/assets/connections-9pVXst0K.js +1 -0
  90. package/dist/client/assets/{decopilot-sse-pool-CpS_ayYS.js → decopilot-sse-pool-BFuPRbka.js} +1 -1
  91. package/dist/client/assets/{dialog-XGMSS2BT.js → dialog-C2YjFiTe.js} +1 -1
  92. package/dist/client/assets/{domain-settings-BPMa0-Fl.js → domain-settings-CduENsGv.js} +1 -1
  93. package/dist/client/assets/{drawer-WduMSgJb.js → drawer-DXz1i3Ey.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-BgXH8hQg.js → dropdown-menu-B4xnvUfa.js} +1 -1
  95. package/dist/client/assets/{empty-state-DjbEcZDh.js → empty-state-DppU7t1S.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-hO9eeM9Y.js → extract-connection-data-ZG-EdEiL.js} +1 -1
  97. package/dist/client/assets/file-explorer-CchJR-qU.js +2 -0
  98. package/dist/client/assets/{form-f1NFII60.js → form-BjRThqCw.js} +1 -1
  99. package/dist/client/assets/general-CSlgtBrF.js +1 -0
  100. package/dist/client/assets/{github-repo-picker-wXUx31ob.js → github-repo-picker-CNEN1mCK.js} +1 -1
  101. package/dist/client/assets/{hooks-_PRkH-Yy.js → hooks-ZCA5GrCx.js} +1 -1
  102. package/dist/client/assets/{index-KoJ8mCYD.js → index-BXwYK1AN.js} +1 -1
  103. package/dist/client/assets/{index-CLqS_rbc.js → index-BhUah0H3.js} +1 -1
  104. package/dist/client/assets/{index-CJ3g_pEU.js → index-Bk-gpEdy.js} +2 -2
  105. package/dist/client/assets/{index-5Y7z9AvW.css → index-BtYfp9ST.css} +1 -1
  106. package/dist/client/assets/{index-BNXQVoT7.js → index-Bzqm1aIp.js} +1 -1
  107. package/dist/client/assets/index-CmUGbeoq.js +1 -0
  108. package/dist/client/assets/{index-DC0xonGL.js → index-CtSWRGXN.js} +6 -6
  109. package/dist/client/assets/index-Cy23bPqn.js +1 -0
  110. package/dist/client/assets/{index-BS0UZZ3R.js → index-Dr6K3WZk.js} +1 -1
  111. package/dist/client/assets/index-Jv7UYekz.js +8 -0
  112. package/dist/client/assets/{index-BFhfrk-7.js → index-cr7sQsKR.js} +11 -11
  113. package/dist/client/assets/{index-IS5EuMmy.js → index-lYBqI9jZ.js} +1 -1
  114. package/dist/client/assets/{index-redirect-CJgqMysy.js → index-redirect-DUL-IBmJ.js} +1 -1
  115. package/dist/client/assets/{input-o6ZH2ATw.js → input-Db_81kO1.js} +1 -1
  116. package/dist/client/assets/{integration-icon-BOtq1b3a.js → integration-icon-Cm5cd1X9.js} +1 -1
  117. package/dist/client/assets/{invite-member-dialog-Dl9OfTyI.js → invite-member-dialog-CIGb4s54.js} +1 -1
  118. package/dist/client/assets/{label-D6gevQO5.js → label-xkewAavb.js} +1 -1
  119. package/dist/client/assets/{layout-BRMJ4QW0.js → layout-BiZB9CPh.js} +1 -1
  120. package/dist/client/assets/{login-D4reqp_H.js → login-Bb-FXTtq.js} +1 -1
  121. package/dist/client/assets/{mcp-oauth-_jIfjQ4e.js → mcp-oauth-CeJbm62x.js} +1 -1
  122. package/dist/client/assets/{members-B9ugkuj7.js → members-CC3sFUzT.js} +1 -1
  123. package/dist/client/assets/{monaco-editor-De4Dc2qH.js → monaco-editor-jGAng9y0.js} +1 -1
  124. package/dist/client/assets/{monitoring-stats-row-BjmhXGnQ.js → monitoring-stats-row--V5jU4OE.js} +1 -1
  125. package/dist/client/assets/{multi-select-CmfdCjL3.js → multi-select-L3G1DGel.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-DAfWuaW9.js → oauth-callback-CvMBZbQ1.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-C9ILOFPh.js → oauth-callback-ai-provider-DqjfOZHc.js} +1 -1
  128. package/dist/client/assets/{onboarding-BDy5V0Y5.js → onboarding-D4tufvXr.js} +1 -1
  129. package/dist/client/assets/{org-install-Nfl-C6Fr.js → org-install-BMW0ieH6.js} +1 -1
  130. package/dist/client/assets/{org-layout-Bglystg8.js → org-layout-CT5MDUhT.js} +1 -1
  131. package/dist/client/assets/{organization-choice-QZ4CceMT.js → organization-choice-DB9iP1Io.js} +1 -1
  132. package/dist/client/assets/{orgs-Bzsm3GbN.js → orgs-DEDYnZR5.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-6UFNw7QE.js → page-seo-form-Nci1dKAH.js} +1 -1
  134. package/dist/client/assets/{popover-NRtbfv2k.js → popover-C2mVmmM3.js} +1 -1
  135. package/dist/client/assets/post-editor-CSyrzjqc.js +1 -0
  136. package/dist/client/assets/{primitives-Ca_4nj6i.js → primitives-DY-s_M7M.js} +1 -1
  137. package/dist/client/assets/{profile-Bbdc0aa5.js → profile-7rjZKU5s.js} +1 -1
  138. package/dist/client/assets/project-app-view-lK2nU1ck.js +1 -0
  139. package/dist/client/assets/record-editor-Cc9Myw3K.js +1 -0
  140. package/dist/client/assets/redirect-editor-Ct70n9eh.js +1 -0
  141. package/dist/client/assets/registry-DAW1UQNc.js +2 -0
  142. package/dist/client/assets/{registry-layout-DB_BQfsv.js → registry-layout-BYAmYz3p.js} +3 -3
  143. package/dist/client/assets/{reports-DWqeNbVA.js → reports-Um4xS_Yj.js} +2 -2
  144. package/dist/client/assets/{require-capability-B9QvPt0P.js → require-capability-DlwOuiNr.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-BQkcFNSY.js → required-auth-layout-CnMHJOGc.js} +1 -1
  146. package/dist/client/assets/{reset-password-BRY2mgjM.js → reset-password-es1IE5ES.js} +1 -1
  147. package/dist/client/assets/roles-ElS59blP.js +1 -0
  148. package/dist/client/assets/{search-input-w-Uw_627.js → search-input-CSxZSFsh.js} +1 -1
  149. package/dist/client/assets/{secrets-DxBXALaf.js → secrets-4FQR1l88.js} +1 -1
  150. package/dist/client/assets/{sections-editor-Bj2vTVuY.js → sections-editor-De25DQBE.js} +1 -1
  151. package/dist/client/assets/{select-B5f7HhvU.js → select-B5EaKas6.js} +1 -1
  152. package/dist/client/assets/{select-model-CsX-ggrB.js → select-model-BfBEqrZY.js} +1 -1
  153. package/dist/client/assets/{self-tool-result-DpU0tQS9.js → self-tool-result-jJPmNqH0.js} +1 -1
  154. package/dist/client/assets/seo-editor-BtYVx40w.js +1 -0
  155. package/dist/client/assets/{settings-layout-CBe0B4n0.js → settings-layout-C0OZlD1y.js} +1 -1
  156. package/dist/client/assets/{settings-section-C4BFAUrO.js → settings-section-CGbvWxCZ.js} +1 -1
  157. package/dist/client/assets/{shell-controls-D-7RZqxS.js → shell-controls-DPcvK_JL.js} +1 -1
  158. package/dist/client/assets/{shell-layout-BeK9P9ft.js → shell-layout-Bts7BKBo.js} +1 -1
  159. package/dist/client/assets/{sidebar-DQXesux1.js → sidebar-PKysj9Dx.js} +1 -1
  160. package/dist/client/assets/{skeleton-DjfKeZpb.js → skeleton-BBdAm6HD.js} +1 -1
  161. package/dist/client/assets/{sso-CvRIpXlP.js → sso-DazmY20S.js} +1 -1
  162. package/dist/client/assets/{store-Oq8d8-KX.js → store-NX9I1fhP.js} +1 -1
  163. package/dist/client/assets/store-registry-CzWFlhBQ.js +2 -0
  164. package/dist/client/assets/{studio-tools-BxKVhdl5.js → studio-tools-vyjLnKmQ.js} +1 -1
  165. package/dist/client/assets/{switch-DMWTEjcS.js → switch-hQq0QI-C.js} +1 -1
  166. package/dist/client/assets/{tab-id-C88eCqEl.js → tab-id-C2306KTT.js} +1 -1
  167. package/dist/client/assets/{table-DNmdTLiQ.js → table-C6cDBInx.js} +1 -1
  168. package/dist/client/assets/{tabs-WPCKfd9w.js → tabs-BmAjcVMR.js} +1 -1
  169. package/dist/client/assets/{textarea-D8292CBW.js → textarea-RVmqOr4j.js} +1 -1
  170. package/dist/client/assets/{toggle-group-BAneIJ_q.js → toggle-group-BALlIfSA.js} +1 -1
  171. package/dist/client/assets/{toolbar-ClqoJTXH.js → toolbar-BsQ88yQ5.js} +1 -1
  172. package/dist/client/assets/{tooltip-BhSpX1ND.js → tooltip-ztWCXsGn.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-CQ2I-LaB.js → use-ai-providers-xMhYyku_.js} +1 -1
  174. package/dist/client/assets/{use-api-keys-CiYhk31Q.js → use-api-keys-0oNlYcUz.js} +1 -1
  175. package/dist/client/assets/{use-automations-DZtGeBhj.js → use-automations-BlNgSHyl.js} +1 -1
  176. package/dist/client/assets/{use-autosave-4DOLgpxI.js → use-autosave-B_6r3jf2.js} +1 -1
  177. package/dist/client/assets/{use-capability-BijkezB0.js → use-capability-CB7ygdAk.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-Ck1QWCTn.js → use-clock-tick-C5-SIqzM.js} +1 -1
  179. package/dist/client/assets/{use-connection-DKI0btty.js → use-connection-CXvgBm3n.js} +1 -1
  180. package/dist/client/assets/{use-copy-Ckfi3jro.js → use-copy-Bwk9gWKN.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-Bzg_79Jq.js → use-create-virtual-mcp-Dm2RqIhQ.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-DuwUQiyp.js → use-debounced-autosave-CxYzex1r.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-BfhS7NzY.js → use-debounced-value-CCfEW0FL.js} +1 -1
  184. package/dist/client/assets/use-deco-credits-CQujDEjB.js +1 -0
  185. package/dist/client/assets/{use-decopilot-events-C60U_6NC.js → use-decopilot-events-hJo-OehE.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-wZW_t9C1.js → use-delete-connection-BhU_gjrn.js} +1 -1
  187. package/dist/client/assets/{use-deployment-admin-DVnk-18Z.js → use-deployment-admin-C7qoshmE.js} +1 -1
  188. package/dist/client/assets/{use-file-configs-BJSUtYu8.js → use-file-configs-BstsG7aU.js} +1 -1
  189. package/dist/client/assets/{use-infinite-scroll-D55J0QCa.js → use-infinite-scroll-lP2pzZku.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-LXT_hQlm.js → use-join-requests-hyRT50fi.js} +1 -1
  191. package/dist/client/assets/{use-mcp-auth-status-Bt0R0Ko0.js → use-mcp-auth-status-B8KIbNK9.js} +1 -1
  192. package/dist/client/assets/{use-mcp-client-D2wMBlJa.js → use-mcp-client-lcJKOGs_.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-ByjLCuvT.js → use-mcp-tools-C9MMiOUN.js} +1 -1
  194. package/dist/client/assets/{use-members-DwY4uJeI.js → use-members-D25t9IMN.js} +1 -1
  195. package/dist/client/assets/{use-mobile-Ci-3vXgY.js → use-mobile-tvEsrjEm.js} +1 -1
  196. package/dist/client/assets/{use-navigate-to-agent-CfpBmYWs.js → use-navigate-to-agent-Cc3FgZHa.js} +1 -1
  197. package/dist/client/assets/{use-org-auth-client-DxjPGaJY.js → use-org-auth-client-Br2aEgEs.js} +1 -1
  198. package/dist/client/assets/{use-org-sso-CP7ZzKMd.js → use-org-sso-Bi6BhNGu.js} +1 -1
  199. package/dist/client/assets/{use-organization-roles-v8NB06fn.js → use-organization-roles-CIR5lCET.js} +1 -1
  200. package/dist/client/assets/use-organization-settings-B5-tuJ2Q.js +1 -0
  201. package/dist/client/assets/{use-registry-app-C7ykwY3m.js → use-registry-app-C8eLSi1c.js} +1 -1
  202. package/dist/client/assets/use-registry-connections-w3mbkUAA.js +1 -0
  203. package/dist/client/assets/{use-secrets-Ceu6jA09.js → use-secrets-Bt7EeNIh.js} +1 -1
  204. package/dist/client/assets/{use-status-sounds-N94fiYA8.js → use-status-sounds-RyrNyVpv.js} +1 -1
  205. package/dist/client/assets/{use-view-mode-CoijRYYc.js → use-view-mode-B3_hJncC.js} +1 -1
  206. package/dist/client/assets/{use-virtual-mcp-DTFj7Ne9.js → use-virtual-mcp-BpPJtNfM.js} +1 -1
  207. package/dist/client/assets/useInfiniteQuery-X4Ac6dgb.js +1 -0
  208. package/dist/client/assets/{useQueries-D_5MOWWA.js → useQueries-Bjrz3ZD4.js} +1 -1
  209. package/dist/client/assets/{useRouterState-y-78H74p.js → useRouterState-6FdWyW5y.js} +1 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-Bbz9LUHP.js +1 -0
  211. package/dist/client/assets/{users-BXKD5UP4.js → users-DBNuKuDj.js} +1 -1
  212. package/dist/client/assets/variant-calendar-C9DqbTjK.js +1 -0
  213. package/dist/client/assets/{view-mode-toggle-kl9oHR9n.js → view-mode-toggle-mwcblebg.js} +1 -1
  214. package/dist/client/index.html +2 -2
  215. package/dist/server/cli.js +445 -445
  216. package/dist/server/migrate.js +97 -97
  217. package/dist/server/server.js +154 -154
  218. package/package.json +1 -1
  219. package/dist/client/assets/ArrowRight-DyTlfC-y.js +0 -1
  220. package/dist/client/assets/XCircle-rDPO1UsQ.js +0 -1
  221. package/dist/client/assets/agent-icon-C3WZp91B.js +0 -1
  222. package/dist/client/assets/agents-list-Dueuilec.js +0 -1
  223. package/dist/client/assets/app-editor-HYAQLT3s.js +0 -1
  224. package/dist/client/assets/automations-DHm4S8yh.js +0 -1
  225. package/dist/client/assets/bulk-category-panel-DMS0dgIY.js +0 -1
  226. package/dist/client/assets/category-editor-CKbWLUfN.js +0 -1
  227. package/dist/client/assets/collection-detail-BIO0-fvs.js +0 -1
  228. package/dist/client/assets/commerce-onboarding-CRzBqKhl.js +0 -1
  229. package/dist/client/assets/connection-detail-B-Nozkza.js +0 -1
  230. package/dist/client/assets/connections-BD_Peozp.js +0 -1
  231. package/dist/client/assets/file-explorer-B8yzeokF.js +0 -2
  232. package/dist/client/assets/general-DsAyK0Yv.js +0 -1
  233. package/dist/client/assets/index-B7PHqiG5.js +0 -1
  234. package/dist/client/assets/index-DHBTbW_a.js +0 -1
  235. package/dist/client/assets/index-Dwjqo81u.js +0 -8
  236. package/dist/client/assets/post-editor-CW30V7xZ.js +0 -1
  237. package/dist/client/assets/project-app-view-DL6dqliK.js +0 -1
  238. package/dist/client/assets/record-editor-Df1WwuGM.js +0 -1
  239. package/dist/client/assets/redirect-editor-JdvBMz-F.js +0 -1
  240. package/dist/client/assets/registry-B9qaH13z.js +0 -2
  241. package/dist/client/assets/roles-CFONmmPI.js +0 -1
  242. package/dist/client/assets/seo-editor-CX9ONL8x.js +0 -1
  243. package/dist/client/assets/store-registry-Xe430xgO.js +0 -2
  244. package/dist/client/assets/use-deco-credits-C2-JcKqs.js +0 -1
  245. package/dist/client/assets/use-organization-settings-BsDc4ylh.js +0 -1
  246. package/dist/client/assets/use-registry-connections-CQLDUOUQ.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-BPmgtnC9.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-BKKqa4sQ.js +0 -1
  249. package/dist/client/assets/variant-calendar-DsN7vzLP.js +0 -1
@@ -0,0 +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-CtSWRGXN.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-jJPmNqH0.js";import{A as dt}from"./auth-entry-CIaD70HI.js";import{A as ut}from"./auth-split-layout-CuxYmM3L.js";import{O as Be}from"./organization-choice-DB9iP1Io.js";import{I as gt}from"./input-Db_81kO1.js";import{D as ft,a as We,b as pt,c as ht}from"./dropdown-menu-B4xnvUfa.js";import{S as bt,u as xt,W as yt,g as jt,a as Ct}from"./use-mcp-client-lcJKOGs_.js";import{i as Ot}from"./XCircle-EznHRbAE.js";import{i as vt}from"./ArrowUpRight-CW2ZVxtG.js";import"./integration-icon-Cm5cd1X9.js";import"./Tool02-B1daDn4g.js";import"./agent-icon-CUdj9a7D.js";import"./AlertCircle-D1EFOpNe.js";import"./Tool01-5dsYVH9m.js";import"./ArrowUp-BMyyApv0.js";import"./Settings02-CNvgTiqs.js";import"./TrendUp01-C94t5UF_.js";import"./ZapSquare-BvRmDr6t.js";import"./Users03-C4wjtTaG.js";import"./CheckCircle-Dm4eLsPy.js";import"./Check-5NI1QKZd.js";import"./ChevronDown-EiDIMI8-.js";import"./ChevronRight-b9CWsPSi.js";import"./ChevronUp-BPCG9PUM.js";import"./DotsVertical-iBRgqnhk.js";import"./Stars02-yb0Am4ou.js";import"./Copy01-BWqHMF3b.js";import"./Eye-D-Iwb8I9.js";import"./FilterLines-Cx0qwQvZ.js";import"./Star01-Bd-5J4Lj.js";import"./Palette-NkINHuYO.js";import"./SwitchHorizontal01-DdqBdzLk.js";import"./HardDrive-BwcR8m6C.js";import"./Key01-B8Ou2QJB.js";import"./LayoutLeft-CHPOZnyo.js";import"./LinkExternal01-Ba3ftJ_R.js";import"./LogOut01-P2BkZ-8B.js";import"./Monitor01-plO_Z_lU.js";import"./Sun-BfCJUnUR.js";import"./Play-DNsEw7K5.js";import"./Plus-Cl4qtph7.js";import"./SearchLg-DpAUIQTx.js";import"./SearchMd-UGeI38f9.js";import"./Shield01-DyU5Pc5k.js";import"./Stars01-B_LqALAO.js";import"./Trash01-BNr5muXv.js";import"./Upload01-Z0fsKYsa.js";import"./User01-ChozFzAn.js";import"./Users01-Dvi13jrX.js";import"./XClose-HdAPiAFA.js";import"./X-BxlAIg00.js";import"./Zap-DaJ64ImZ.js";import"./dialog-C2YjFiTe.js";import"./tooltip-ztWCXsGn.js";import"./companions-core-D5ncC1DM.js";import"./extract-connection-data-ZG-EdEiL.js";import"./metadata-dUsYcpuu.js";import"./github-repo-scope-CKSTLD3W.js";import"./form-BjRThqCw.js";import"./label-xkewAavb.js";import"./use-debounced-value-CCfEW0FL.js";import"./provision-repo-scoped-github-connection-Dp638N7g.js";import"./useQueries-Bjrz3ZD4.js";import"./authenticate-and-persist-oauth-CkajuFfc.js";import"./mcp-oauth-CeJbm62x.js";import"./auth-BmCKFNnH.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-0c465KL2.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 ii(){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{ii as default};
@@ -1 +1 @@
1
- import{b}from"./extract-connection-data-hO9eeM9Y.js";import{a as h}from"./github-repo-scope-CKSTLD3W.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 E(n){const e=n.properties;if(!e)return[];const t=[];for(const[i,r]of Object.entries(e)){const a=r?.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 U(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 T(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 I(n){return u(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function x(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=I(t);return i?[{key:e,label:T(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(r=>(r.app_name===e||!!t&&r.app_id===t)&&h(r)===null);return i.length===0?null:(i.sort((r,o)=>{const s=a=>a.status==="active"?0:1;return s(r)!==s(o)?s(r)-s(o):(o.updated_at??"").localeCompare(r.updated_at??"")}),i[0].id)}function N(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 r=n.curated[i.bindingType],o=r?n.itemsById[r.registryAppId]:n.itemsByName[i.bindingType];if(!o)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,l=!!c&&y,f=l?void 0:n.saBindings?.[i.bindingType],p=l||!!f,d=l?"oauth":f?"sa":null,m=p&&_({bindingType:i.bindingType,boundVia:d,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:o,title:K(o,i.bindingType),icon:N(o),headline:r?.headline??g(o._meta)?.short_description??null,area:r?.area??null,bullets:r?.bullets??[],satisfied:p,configured:m,required:C.has(i.bindingType),candidateConnectionId:p?null:c||S(n.connections,i.bindingType,r?.registryAppId),linkedConnectionId:c,configurationState:a?.configuration_state??null,boundVia:d,boundResource:f?.resource??null})}return e}function W(n,e){if(!n)return null;const t=r=>{const o=r.startsWith("sc-domain:")?r.substring(10):(()=>{try{return new URL(r.startsWith("http")?r:`https://${r}`).hostname}catch{return null}})();return o===null?r:o.startsWith("www.")?o.substring(4):o},i=t(n);for(const r of e)if(t(r.siteUrl)===i)return r.siteUrl;return null}function q(n){return(n?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(r=>({value:r.property,label:`${r.displayName} (${i.displayName})`}))}))}export{B as F,V as a,O as b,M as c,x as g,W as m,E as p,P as s,q as t,U as u};
1
+ import{b}from"./extract-connection-data-ZG-EdEiL.js";import{a as h}from"./github-repo-scope-CKSTLD3W.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 E(n){const e=n.properties;if(!e)return[];const t=[];for(const[i,r]of Object.entries(e)){const a=r?.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 U(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 T(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 I(n){return u(n)?typeof n=="string"?n.trim():typeof n=="number"||typeof n=="boolean"?String(n):JSON.stringify(n):null}function x(n){return n?Object.entries(n).flatMap(([e,t])=>{if(e.startsWith("__"))return[];const i=I(t);return i?[{key:e,label:T(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(r=>(r.app_name===e||!!t&&r.app_id===t)&&h(r)===null);return i.length===0?null:(i.sort((r,o)=>{const s=a=>a.status==="active"?0:1;return s(r)!==s(o)?s(r)-s(o):(o.updated_at??"").localeCompare(r.updated_at??"")}),i[0].id)}function N(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 r=n.curated[i.bindingType],o=r?n.itemsById[r.registryAppId]:n.itemsByName[i.bindingType];if(!o)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,l=!!c&&y,f=l?void 0:n.saBindings?.[i.bindingType],p=l||!!f,d=l?"oauth":f?"sa":null,m=p&&_({bindingType:i.bindingType,boundVia:d,companionConfig:a?.configuration_state??null,cdConfig:n.configurationState??null});e.push({fieldKey:i.fieldKey,bindingType:i.bindingType,registryItem:o,title:K(o,i.bindingType),icon:N(o),headline:r?.headline??g(o._meta)?.short_description??null,area:r?.area??null,bullets:r?.bullets??[],satisfied:p,configured:m,required:C.has(i.bindingType),candidateConnectionId:p?null:c||S(n.connections,i.bindingType,r?.registryAppId),linkedConnectionId:c,configurationState:a?.configuration_state??null,boundVia:d,boundResource:f?.resource??null})}return e}function W(n,e){if(!n)return null;const t=r=>{const o=r.startsWith("sc-domain:")?r.substring(10):(()=>{try{return new URL(r.startsWith("http")?r:`https://${r}`).hostname}catch{return null}})();return o===null?r:o.startsWith("www.")?o.substring(4):o},i=t(n);for(const r of e)if(t(r.siteUrl)===i)return r.siteUrl;return null}function q(n){return(n?.response?.accountSummaries??[]).map(i=>({account:i.account,options:(i.propertySummaries??[]).map(r=>({value:r.property,label:`${r.displayName} (${i.displayName})`}))}))}export{B as F,V as a,O as b,M as c,x as g,W as m,E as p,P as s,q as t,U as u};
@@ -1,4 +1,4 @@
1
- import{c as k,j as s,B as C,F as H,r as U,z as Y,t as K}from"./index-DC0xonGL.js";import{A as J,b as V}from"./alert-x5VnDVum.js";import{C as X}from"./card-DfCYY00-.js";import{c as T,T as L,b as B,a as D}from"./tabs-WPCKfd9w.js";import{u as O}from"./use-copy-Ckfi3jro.js";import{i as F}from"./Check-BTaTIHDo.js";import{a as I}from"./Copy01-DvYO0s9y.js";import{i as q}from"./Key01-DxefwErs.js";import{n as Q}from"./LinkExternal01-JEvN2IWs.js";import{s as Z}from"./Trash01-Dkm8dhQa.js";import{P as z}from"./index-CLqS_rbc.js";import{c as ee}from"./settings-section-C4BFAUrO.js";import{a as te,m as se,u as re,b as ne,d as ie}from"./use-api-keys-CiYhk31Q.js";import"./sidebar-DQXesux1.js";import"./LayoutLeft-wy3G5IiO.js";import"./use-mobile-Ci-3vXgY.js";import"./X-gWtgqXtq.js";import"./tooltip-BhSpX1ND.js";import"./ArrowUpRight-BHQ7XQ3Y.js";import"./use-mcp-client-D2wMBlJa.js";import"./auth-JRIP9lfB.js";function ae({client:e,mode:t,url:i,apiKey:a}){const o=a??"<paste-your-api-key>",l=te();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${l} ${i}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${l} ${i} \\
1
+ import{c as k,j as s,B as C,F as H,r as U,z as Y,t as K}from"./index-CtSWRGXN.js";import{A as J,b as V}from"./alert-QZvjCvjp.js";import{C as X}from"./card-DUp9-cc7.js";import{c as T,T as L,b as B,a as D}from"./tabs-BmAjcVMR.js";import{u as O}from"./use-copy-Bwk9gWKN.js";import{i as F}from"./Check-5NI1QKZd.js";import{a as I}from"./Copy01-BWqHMF3b.js";import{i as q}from"./Key01-B8Ou2QJB.js";import{n as Q}from"./LinkExternal01-Ba3ftJ_R.js";import{s as Z}from"./Trash01-BNr5muXv.js";import{P as z}from"./index-BhUah0H3.js";import{c as ee}from"./settings-section-CGbvWxCZ.js";import{a as te,m as se,u as re,b as ne,d as ie}from"./use-api-keys-0oNlYcUz.js";import"./sidebar-PKysj9Dx.js";import"./LayoutLeft-CHPOZnyo.js";import"./use-mobile-tvEsrjEm.js";import"./X-BxlAIg00.js";import"./tooltip-ztWCXsGn.js";import"./ArrowUpRight-CW2ZVxtG.js";import"./use-mcp-client-lcJKOGs_.js";import"./auth-BmCKFNnH.js";function ae({client:e,mode:t,url:i,apiKey:a}){const o=a??"<paste-your-api-key>",l=te();if(e==="claude-code")return t==="oauth"?{language:"bash",code:`claude mcp add --transport http --scope user ${l} ${i}`}:{language:"bash",code:`claude mcp add --transport http --scope user ${l} ${i} \\
2
2
  --header "Authorization: Bearer ${o}"`};if(e==="cursor"){const n={url:i};return t==="api-key"&&(n.headers={Authorization:`Bearer ${o}`}),{language:"json",pathHint:"~/.cursor/mcp.json",code:JSON.stringify({mcpServers:{[l]:n}},null,2)}}if(e==="codex"){const n=[`[mcp_servers.${l}]`,`url = "${i}"`];return t==="api-key"&&n.push(`http_headers = { "Authorization" = "Bearer ${o}" }`),{language:"toml",pathHint:"~/.codex/config.toml",code:n.join(`
3
3
  `)}}if(e==="claude-desktop"){const n={type:"http",url:i};return t==="api-key"&&(n.headers={Authorization:`Bearer ${o}`}),{language:"json",pathHint:"claude_desktop_config.json",code:JSON.stringify({mcpServers:{[l]:n}},null,2)}}return t==="oauth"?{language:"text",code:`${i}
4
4
 
@@ -1 +1 @@
1
- import{c as z,j as t,b as A,r as _,B,m as w}from"./index-DC0xonGL.js";import{e as E,d as R,a as O,b as H,h as $}from"./dialog-XGMSS2BT.js";import{u as P,S as F}from"./chat-context-og02PpRy.js";import{i as G}from"./Check-BTaTIHDo.js";import{a as W}from"./Copy01-DvYO0s9y.js";function I(a){const e=z.c(3),{size:s}=a,l=s===void 0?16:s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:l,height:l,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=l,e[2]=i):i=e[2],i}function S(a){const e=z.c(3),{size:s}=a,l=s===void 0?16:s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:l,height:l,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=l,e[2]=i):i=e[2],i}const Y={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:I},codex:{labelKey:"chat.agentIcons.codex",Icon:S}};function X(a){return(a&&Y[a])??null}const T="bunx decocms@latest link",K=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:t.jsx(I,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:t.jsx(S,{size:18})}];function Z(a,e){return K.filter(s=>a.includes(s.capability)).map(s=>e(s.labelKey))}function ee(a){const e=z.c(46),{open:s,onOpenChange:l}=a,n=A();let i;e[0]!==s?(i={fast:s},e[0]=s,e[1]=i):i=e[1];const o=P(i),[N,M]=_.useState(!1);let r,d,m,p,x,u,h,f;if(e[2]!==o.hostname||e[3]!==o.machineId||e[4]!==o.online||e[5]!==l||e[6]!==s||e[7]!==n){const c=o.hostname??o.machineId??n("chat.connectDesktopDialog.yourDesktop");p=E,h=s,f=l,m=R,u="sm:max-w-md",d=O,r=H,x=o.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:c}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=o.hostname,e[3]=o.machineId,e[4]=o.online,e[5]=l,e[6]=s,e[7]=n,e[8]=r,e[9]=d,e[10]=m,e[11]=p,e[12]=x,e[13]=u,e[14]=h,e[15]=f}else r=e[8],d=e[9],m=e[10],p=e[11],x=e[12],u=e[13],h=e[14],f=e[15];let g;e[16]!==r||e[17]!==x?(g=t.jsx(r,{children:x}),e[16]=r,e[17]=x,e[18]=g):g=e[18];let D;e[19]!==o.online||e[20]!==n?(D=o.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=o.online,e[20]=n,e[21]=D):D=e[21];let b;e[22]!==D?(b=t.jsx($,{children:D}),e[22]=D,e[23]=b):b=e[23];let j;e[24]!==d||e[25]!==g||e[26]!==b?(j=t.jsxs(d,{children:[g,b]}),e[24]=d,e[25]=g,e[26]=b,e[27]=j):j=e[27];let k;e[28]!==N||e[29]!==o.online?(k=!o.online&&t.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[t.jsx("span",{className:"flex-1",children:T}),t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(T).then(()=>{M(!0),setTimeout(()=>M(!1),1500)})},children:N?t.jsx(G,{size:14}):t.jsx(W,{size:14})})]}),e[28]=N,e[29]=o.online,e[30]=k):k=e[30];let C;e[31]!==o.capabilities||e[32]!==o.online||e[33]!==n?(C=o.online?t.jsx("div",{className:"flex flex-col gap-3 text-sm",children:t.jsx("div",{className:"flex flex-col gap-2",children:K.map(c=>{const y=o.capabilities.includes(c.capability);return t.jsxs("div",{className:w("flex items-center gap-3 rounded-md border px-3 py-2",y?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[t.jsx("div",{className:w("flex size-6 items-center justify-center",y?"text-foreground":"text-muted-foreground"),children:c.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:n(c.labelKey)}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n(y?c.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),t.jsx("span",{className:w("size-2 rounded-full",y?"bg-success":"bg-muted-foreground/30")})]},c.capability)})})}):t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(F,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=o.capabilities,e[32]=o.online,e[33]=n,e[34]=C):C=e[34];let L;e[35]!==m||e[36]!==k||e[37]!==C||e[38]!==u||e[39]!==j?(L=t.jsxs(m,{className:u,children:[j,k,C]}),e[35]=m,e[36]=k,e[37]=C,e[38]=u,e[39]=j,e[40]=L):L=e[40];let v;return e[41]!==p||e[42]!==L||e[43]!==h||e[44]!==f?(v=t.jsx(p,{open:h,onOpenChange:f,children:L}),e[41]=p,e[42]=L,e[43]=h,e[44]=f,e[45]=v):v=e[45],v}export{ee as C,I as a,S as b,X as l,Z as v};
1
+ import{c as z,j as t,b as A,r as _,B,m as w}from"./index-CtSWRGXN.js";import{e as E,d as R,a as O,b as H,h as $}from"./dialog-C2YjFiTe.js";import{u as P,S as F}from"./chat-context-OugPuthB.js";import{i as G}from"./Check-5NI1QKZd.js";import{a as W}from"./Copy01-BWqHMF3b.js";function I(a){const e=z.c(3),{size:s}=a,l=s===void 0?16:s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:l,height:l,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),e[1]=l,e[2]=i):i=e[2],i}function S(a){const e=z.c(3),{size:s}=a,l=s===void 0?16:s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=n):n=e[0];let i;return e[1]!==l?(i=t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:l,height:l,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:n}),e[1]=l,e[2]=i):i=e[2],i}const Y={"claude-code":{labelKey:"chat.agentIcons.claudeCode",Icon:I},codex:{labelKey:"chat.agentIcons.codex",Icon:S}};function X(a){return(a&&Y[a])??null}const T="bunx decocms@latest link",K=[{capability:"claude-code",labelKey:"chat.connectDesktopDialog.agentClaudeCodeLabel",descriptionKey:"chat.connectDesktopDialog.agentClaudeCodeDescription",icon:t.jsx(I,{size:18})},{capability:"codex",labelKey:"chat.connectDesktopDialog.agentCodexLabel",descriptionKey:"chat.connectDesktopDialog.agentCodexDescription",icon:t.jsx(S,{size:18})}];function Z(a,e){return K.filter(s=>a.includes(s.capability)).map(s=>e(s.labelKey))}function ee(a){const e=z.c(46),{open:s,onOpenChange:l}=a,n=A();let i;e[0]!==s?(i={fast:s},e[0]=s,e[1]=i):i=e[1];const o=P(i),[N,M]=_.useState(!1);let r,d,m,p,x,u,h,f;if(e[2]!==o.hostname||e[3]!==o.machineId||e[4]!==o.online||e[5]!==l||e[6]!==s||e[7]!==n){const c=o.hostname??o.machineId??n("chat.connectDesktopDialog.yourDesktop");p=E,h=s,f=l,m=R,u="sm:max-w-md",d=O,r=H,x=o.online?n("chat.connectDesktopDialog.connectedTo",{desktopName:c}):n("chat.connectDesktopDialog.connectYourDesktop"),e[2]=o.hostname,e[3]=o.machineId,e[4]=o.online,e[5]=l,e[6]=s,e[7]=n,e[8]=r,e[9]=d,e[10]=m,e[11]=p,e[12]=x,e[13]=u,e[14]=h,e[15]=f}else r=e[8],d=e[9],m=e[10],p=e[11],x=e[12],u=e[13],h=e[14],f=e[15];let g;e[16]!==r||e[17]!==x?(g=t.jsx(r,{children:x}),e[16]=r,e[17]=x,e[18]=g):g=e[18];let D;e[19]!==o.online||e[20]!==n?(D=o.online?n("chat.connectDesktopDialog.machineAgentsDescription"):n("chat.connectDesktopDialog.runCommandDescription"),e[19]=o.online,e[20]=n,e[21]=D):D=e[21];let b;e[22]!==D?(b=t.jsx($,{children:D}),e[22]=D,e[23]=b):b=e[23];let j;e[24]!==d||e[25]!==g||e[26]!==b?(j=t.jsxs(d,{children:[g,b]}),e[24]=d,e[25]=g,e[26]=b,e[27]=j):j=e[27];let k;e[28]!==N||e[29]!==o.online?(k=!o.online&&t.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[t.jsx("span",{className:"flex-1",children:T}),t.jsx(B,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(T).then(()=>{M(!0),setTimeout(()=>M(!1),1500)})},children:N?t.jsx(G,{size:14}):t.jsx(W,{size:14})})]}),e[28]=N,e[29]=o.online,e[30]=k):k=e[30];let C;e[31]!==o.capabilities||e[32]!==o.online||e[33]!==n?(C=o.online?t.jsx("div",{className:"flex flex-col gap-3 text-sm",children:t.jsx("div",{className:"flex flex-col gap-2",children:K.map(c=>{const y=o.capabilities.includes(c.capability);return t.jsxs("div",{className:w("flex items-center gap-3 rounded-md border px-3 py-2",y?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[t.jsx("div",{className:w("flex size-6 items-center justify-center",y?"text-foreground":"text-muted-foreground"),children:c.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium",children:n(c.labelKey)}),t.jsx("p",{className:"text-xs text-muted-foreground",children:n(y?c.descriptionKey:"chat.connectDesktopDialog.notDetected")})]}),t.jsx("span",{className:w("size-2 rounded-full",y?"bg-success":"bg-muted-foreground/30")})]},c.capability)})})}):t.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t.jsx(F,{size:"sm"}),n("chat.connectDesktopDialog.waitingForDesktop")]}),e[31]=o.capabilities,e[32]=o.online,e[33]=n,e[34]=C):C=e[34];let L;e[35]!==m||e[36]!==k||e[37]!==C||e[38]!==u||e[39]!==j?(L=t.jsxs(m,{className:u,children:[j,k,C]}),e[35]=m,e[36]=k,e[37]=C,e[38]=u,e[39]=j,e[40]=L):L=e[40];let v;return e[41]!==p||e[42]!==L||e[43]!==h||e[44]!==f?(v=t.jsx(p,{open:h,onOpenChange:f,children:L}),e[41]=p,e[42]=L,e[43]=h,e[44]=f,e[45]=v):v=e[45],v}export{ee as C,I as a,S as b,X as l,Z as v};
@@ -1 +1 @@
1
- import{W as i,a2 as r,a1 as t,X as e,a3 as o,a$ as a,ba as d,c3 as l,b9 as u}from"./index-DC0xonGL.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{W as i,a2 as r,a1 as t,X as e,a3 as o,a$ as a,ba as d,c3 as l,b9 as u}from"./index-CtSWRGXN.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 $,as as L,K as k,m as w,j as I}from"./index-DC0xonGL.js";import{u as D}from"./use-registry-connections-CQLDUOUQ.js";import{d as K}from"./use-organization-settings-BsDc4ylh.js";import{S as E,j as F}from"./use-mcp-client-D2wMBlJa.js";import{u as Q}from"./useInfiniteQuery-BPmgtnC9.js";import{i as H,f as q}from"./extract-connection-data-hO9eeM9Y.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-DfCYY00-.js";import{I as X}from"./integration-icon-BOtq1b3a.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-CtSWRGXN.js";import{u as D}from"./use-registry-connections-w3mbkUAA.js";import{e as K}from"./use-organization-settings-B5-tuJ2Q.js";import{S as E,j as F}from"./use-mcp-client-lcJKOGs_.js";import{u as Q}from"./useInfiniteQuery-X4Ac6dgb.js";import{i as H,f as q}from"./extract-connection-data-ZG-EdEiL.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-DUp9-cc7.js";import{I as X}from"./integration-icon-Cm5cd1X9.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{W as be,a3 as $e,a$ as De,X as me,a1 as Oe,c as R,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,b0 as Re,o as Ve,Z as Fe,Y as Le,t as J}from"./index-CtSWRGXN.js";import{g as Be}from"./extract-connection-data-ZG-EdEiL.js";import{E as Se}from"./empty-state-DppU7t1S.js";import{E as He,c as qe,r as Xe,b as Ge,d as Ke}from"./connection-form-helpers-DZUJO_PA.js";import{c as Qe,S as We,V as Ye}from"./index-Bzqm1aIp.js";import{u as ye,T as Je}from"./use-mcp-auth-status-B8KIbNK9.js";import{u as Ze}from"./use-members-D25t9IMN.js";import{A as et}from"./avatar-0c465KL2.js";import{a as Ce,b as _e,u as tt}from"./use-connection-CXvgBm3n.js";import{u as we}from"./use-mcp-client-lcJKOGs_.js";import{a as st}from"./use-mcp-tools-C9MMiOUN.js";import{c as nt,C as it,a as ot,d as at}from"./AreaChart-D9vqL4Wl.js";import{i as lt,a as rt}from"./mcp-oauth-CeJbm62x.js";import{I as le}from"./integration-icon-Cm5cd1X9.js";import{s as ct}from"./Plus-Cl4qtph7.js";import{Y as dt,a as mt,aM as ut,d as xt}from"./agent-icon-CUdj9a7D.js";import{a as ke,s as pt}from"./Settings02-CNvgTiqs.js";import{s as ce}from"./Trash01-BNr5muXv.js";import{q as ft,p as ht,o as gt,m as jt,n as bt}from"./sidebar-PKysj9Dx.js";import{F as G,b as K,c as Q,d as L,e as W,f as vt,a as Nt}from"./form-BjRThqCw.js";import{I as Y}from"./input-Db_81kO1.js";import{u as St,D as yt}from"./use-delete-connection-BhU_gjrn.js";import{c as Ct,B as _t,a as wt,C as kt}from"./monitoring-stats-row--V5jU4OE.js";import{u as It}from"./studio-tools-vyjLnKmQ.js";import{a as Tt}from"./use-virtual-mcp-BpPJtNfM.js";import{i as Ie}from"./ChevronRight-b9CWsPSi.js";import{a as Te}from"./Users03-C4wjtTaG.js";import{b as ne,c as At,T as ie,a as Pt}from"./tabs-BmAjcVMR.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-BvRmDr6t.js";import{d as Dt}from"./Tool01-5dsYVH9m.js";import{g as de,M as Ot}from"./index-lYBqI9jZ.js";import{C as Mt}from"./collection-search-2WLROEuH.js";import{C as zt}from"./card-DUp9-cc7.js";import{B as Et}from"./badge-B4UFBZHt.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-B4xnvUfa.js";import{S as pe,a as fe,b as he,c as ge,d as X}from"./select-B5EaKas6.js";import{i as Ft}from"./CheckCircle-Dm4eLsPy.js";import{t as Lt}from"./ChevronDown-EiDIMI8-.js";import{a as Bt}from"./Tool02-B1daDn4g.js";import{s as oe}from"./Star01-Bd-5J4Lj.js";import{s as Ht}from"./XClose-HdAPiAFA.js";import{p as qt,i as Xt}from"./connection-CTNdymbE.js";import"./metadata-dUsYcpuu.js";import"./index-BhUah0H3.js";import"./Key01-B8Ou2QJB.js";import"./auth-BmCKFNnH.js";import"./use-registry-connections-w3mbkUAA.js";import"./use-organization-settings-B5-tuJ2Q.js";import"./index-BXwYK1AN.js";import"./popover-C2mVmmM3.js";import"./tooltip-ztWCXsGn.js";import"./Check-5NI1QKZd.js";import"./SearchMd-UGeI38f9.js";import"./use-mobile-tvEsrjEm.js";import"./use-create-virtual-mcp-Dm2RqIhQ.js";import"./use-navigate-to-agent-Cc3FgZHa.js";import"./hooks-ZCA5GrCx.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BFuPRbka.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-D-Iwb8I9.js";import"./use-org-auth-client-Br2aEgEs.js";import"./User01-ChozFzAn.js";import"./AlertCircle-D1EFOpNe.js";import"./ArrowUp-BMyyApv0.js";import"./XCircle-EznHRbAE.js";import"./ArrowUpRight-CW2ZVxtG.js";import"./TrendUp01-C94t5UF_.js";import"./ChevronUp-BPCG9PUM.js";import"./DotsVertical-iBRgqnhk.js";import"./Stars02-yb0Am4ou.js";import"./Copy01-BWqHMF3b.js";import"./FilterLines-Cx0qwQvZ.js";import"./Palette-NkINHuYO.js";import"./SwitchHorizontal01-DdqBdzLk.js";import"./HardDrive-BwcR8m6C.js";import"./LayoutLeft-CHPOZnyo.js";import"./LinkExternal01-Ba3ftJ_R.js";import"./LogOut01-P2BkZ-8B.js";import"./Monitor01-plO_Z_lU.js";import"./Sun-BfCJUnUR.js";import"./Play-DNsEw7K5.js";import"./SearchLg-DpAUIQTx.js";import"./Shield01-DyU5Pc5k.js";import"./Stars01-B_LqALAO.js";import"./Upload01-Z0fsKYsa.js";import"./Users01-Dvi13jrX.js";import"./X-BxlAIg00.js";import"./Zap-DaJ64ImZ.js";import"./label-xkewAavb.js";import"./alert-dialog-D0ADYiJb.js";const Gt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Kt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Gt}];function Qt(s){const e=R.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=R.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=R.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=R.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=R.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=R.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=R.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=R.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=R.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=R.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=R.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=R.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(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},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 V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=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]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,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=R.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(G,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(K,{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(X,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(X,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(X,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(X,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(X,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(K,{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(X,{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(X,{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(X,{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(X,{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(X,{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(G,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(K,{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(G,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(K,{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(G,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(K,{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(G,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(K,{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(G,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(K,{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(G,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(K,{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(Rt,{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(Vt,{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"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Xe(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=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Ke(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=Ve(),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,Kt),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:V}=await rt({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){J.error(r("details.connection.authFailed",{error:V??""}));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(G,{control:v.control,name:"title",render:({field:x})=>t.jsxs(K,{children:[t.jsx(Q,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(Y,{...x})}),t.jsx(W,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:x})=>t.jsxs(K,{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})`,V=Be("conn");await d.create.mutateAsync({id:V,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/${V}`,window.location.origin),F=await lt({url:q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}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=R.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}=Re(_);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=R.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=R.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{W as R,a3 as A,a$ as I,X as a,a1 as j,a2 as z,c as W,j as u,B as C}from"./index-DC0xonGL.js";import{I as H}from"./input-o6ZH2ATw.js";import{s as L}from"./Plus-DZ74PeRy.js";import{s as $}from"./Trash01-Dkm8dhQa.js";const q=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(q).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 K(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=W.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:K(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($,{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(L,{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 D(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 F(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 Y(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,Y as i,F as p,D as r};
1
+ import{W as R,a3 as A,a$ as I,X as a,a1 as j,a2 as z,c as W,j as u,B as C}from"./index-CtSWRGXN.js";import{I as H}from"./input-Db_81kO1.js";import{s as L}from"./Plus-Cl4qtph7.js";import{s as $}from"./Trash01-BNr5muXv.js";const q=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(q).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 K(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=W.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:K(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($,{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(L,{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 D(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 F(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 Y(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,Y as i,F as p,D 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 Ye,F as De,d as Ne,u as Je,a as ke,D as Ze,I as et,G as tt,Z as nt,Y as st,o as ot,t as Q,K as it}from"./index-CtSWRGXN.js";import{a as Te,b as ct,g as rt,e as lt}from"./extract-connection-data-ZG-EdEiL.js";import{C as at}from"./collection-display-button-QOFml_4u.js";import{S as dt}from"./search-input-CSxZSFsh.js";import{C as ut}from"./collection-tabs-DtBl2--X.js";import{C as ve,u as mt,a as Ae,g as gt}from"./connection-card-DCx7YUCL.js";import{E as pt}from"./empty-state-DppU7t1S.js";import{P as pe}from"./index-BhUah0H3.js";import{u as ft,D as ht}from"./use-delete-connection-BhU_gjrn.js";import{u as Ce}from"./use-capability-CB7ygdAk.js";import{u as xt}from"./use-infinite-scroll-lP2pzZku.js";import{u as jt}from"./use-view-mode-B3_hJncC.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-D0ADYiJb.js";import{a as je}from"./Tool02-B1daDn4g.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-C2YjFiTe.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-DXz1i3Ey.js";import{u as kt}from"./use-mobile-tvEsrjEm.js";import{F as te,b as ne,c as se,d as oe,e as ie,a as be}from"./form-BjRThqCw.js";import{I as de}from"./input-Db_81kO1.js";import{S as Tt,a as At,b as wt,c as It,d as me}from"./select-B5EaKas6.js";import{T as Pt}from"./textarea-RVmqOr4j.js";import{b as He,u as Lt}from"./use-connection-CXvgBm3n.js";import{a as Ot}from"./use-virtual-mcp-BpPJtNfM.js";import{u as Mt}from"./studio-tools-vyjLnKmQ.js";import{s as Se}from"./Star01-Bd-5J4Lj.js";import{s as Re}from"./Plus-Cl4qtph7.js";import{aL as Ft,a as $t,Y as Ut,d as Vt}from"./agent-icon-CUdj9a7D.js";import{s as We}from"./XClose-HdAPiAFA.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-DZUJO_PA.js";import{a as Rt}from"./authenticate-and-persist-oauth-CkajuFfc.js";import{I as Wt}from"./integration-icon-Cm5cd1X9.js";import{C as Xe}from"./checkbox-DzWb8tQm.js";import{a as ue,D as Xt,c as Gt,b as qt}from"./dropdown-menu-B4xnvUfa.js";import{a as Qt}from"./DotsVertical-iBRgqnhk.js";import{s as Ge}from"./Eye-D-Iwb8I9.js";import{s as qe}from"./Trash01-BNr5muXv.js";import"./use-mcp-client-lcJKOGs_.js";import"./auth-BmCKFNnH.js";import"./ArrowUp-BMyyApv0.js";import"./Check-5NI1QKZd.js";import"./SwitchHorizontal01-DdqBdzLk.js";import"./tooltip-ztWCXsGn.js";import"./view-mode-toggle-mwcblebg.js";import"./badge-B4UFBZHt.js";import"./SearchMd-UGeI38f9.js";import"./use-registry-connections-w3mbkUAA.js";import"./use-organization-settings-B5-tuJ2Q.js";import"./useInfiniteQuery-X4Ac6dgb.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-DUp9-cc7.js";import"./sidebar-PKysj9Dx.js";import"./LayoutLeft-CHPOZnyo.js";import"./X-BxlAIg00.js";import"./label-xkewAavb.js";import"./ChevronDown-EiDIMI8-.js";import"./ChevronUp-BPCG9PUM.js";import"./AlertCircle-D1EFOpNe.js";import"./Tool01-5dsYVH9m.js";import"./Settings02-CNvgTiqs.js";import"./XCircle-EznHRbAE.js";import"./ArrowUpRight-CW2ZVxtG.js";import"./TrendUp01-C94t5UF_.js";import"./ZapSquare-BvRmDr6t.js";import"./Users03-C4wjtTaG.js";import"./CheckCircle-Dm4eLsPy.js";import"./ChevronRight-b9CWsPSi.js";import"./Stars02-yb0Am4ou.js";import"./Copy01-BWqHMF3b.js";import"./FilterLines-Cx0qwQvZ.js";import"./Palette-NkINHuYO.js";import"./HardDrive-BwcR8m6C.js";import"./Key01-B8Ou2QJB.js";import"./LinkExternal01-Ba3ftJ_R.js";import"./LogOut01-P2BkZ-8B.js";import"./Monitor01-plO_Z_lU.js";import"./Sun-BfCJUnUR.js";import"./Play-DNsEw7K5.js";import"./SearchLg-DpAUIQTx.js";import"./Shield01-DyU5Pc5k.js";import"./Stars01-B_LqALAO.js";import"./Upload01-Z0fsKYsa.js";import"./User01-ChozFzAn.js";import"./Users01-Dvi13jrX.js";import"./Zap-DaJ64ImZ.js";import"./mcp-oauth-CeJbm62x.js";function Yt(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 Jt(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]=Yt(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}=Jt(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 Y;e[34]!==A||e[35]!==n._sourceIcon?(Y=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]=Y):Y=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]!==Y?(w=t.jsxs("div",{className:"flex items-center gap-2",children:[Y,y]}),e[44]=y,e[45]=Y,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 J;e[62]!==a?(J=a("orgs.catalogItemCard.cancel"),e[62]=a,e[63]=J):J=e[63];let ee;e[64]!==J?(ee=t.jsx(Le,{children:J}),e[64]=J,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),Y=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&&Y.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()},J=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=>J(f.id,W),onDelete:()=>v.requestDelete(f)})},f.id)}),z.map(u=>t.jsx(nn,{item:u,canManage:x,allConnections:p,connectedAppNames:Y,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=Je({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 J=i.getValues("env_vars")??[],ee=new Set(J.map(u=>u.key)),Z=P.envVarKeys.filter(u=>!ee.has(u));Z.length>0&&i.setValue("env_vars",[...J,...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}))},Y=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}))]}]:[]]})]}),Y]}),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(Ye,{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};
@@ -1 +1 @@
1
- import"./index-DC0xonGL.js";import{e as k}from"./backoff-CrEUbyZT.js";const N={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},S=Object.values(N),U="super-agent",b="task-board.item.updated",A="task-board.item.deleted",g=3e4,O=1e3;function M(o){const{buildUrl:d,eventTypes:u,name:i,crossTab:f=!1}=o,a=new Map,c=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(c&&!i)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const r of e.handlers)try{r(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&w(e)};const r=n=>{e.channel?.postMessage({kind:"event",type:n.type,data:n.data}),l(e,n)};for(const n of u)t.addEventListener(n,r)}function w(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(g,O,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!c){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${i}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function y(e){const t=a.get(e);if(t)return t;const r={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(a.set(e,r),c){const n=new BroadcastChannel(`sse:${i}:${e}`);n.onmessage=s=>D(r,s.data),r.channel=n}return r}function v(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,a.delete(e.key)}return{subscribe(e,t,r){const n=!a.has(e),s=y(e);s.refCount++,s.handlers.add(t),r&&s.reconnectHandlers.add(r),n&&L(s);let h=!1;return()=>{h||(h=!0,s.handlers.delete(t),r&&s.reconnectHandlers.delete(r),s.refCount--,s.refCount<=0&&v(s))}}}}function _(o,d){const u=new Set(d);return{subscribe(i,f,a){const c=l=>{u.has(l.type)&&f(l)};return o.subscribe(i,c,a)}}}const C=[...S,b,A],P=C,H=C,m=M({name:"watch",buildUrl:o=>`/api/${encodeURIComponent(o)}/watch?types=${P.join(",")}`,eventTypes:H,crossTab:!0}),I=_(m,[...S]),V=_(m,[b,A]),W=I;export{N as D,U as S,A as T,W as d,V as t};
1
+ import"./index-CtSWRGXN.js";import{e as k}from"./backoff-CrEUbyZT.js";const N={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},S=Object.values(N),U="super-agent",b="task-board.item.updated",A="task-board.item.deleted",g=3e4,O=1e3;function M(o){const{buildUrl:d,eventTypes:u,name:i,crossTab:f=!1}=o,a=new Map,c=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(c&&!i)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const r of e.handlers)try{r(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&w(e)};const r=n=>{e.channel?.postMessage({kind:"event",type:n.type,data:n.data}),l(e,n)};for(const n of u)t.addEventListener(n,r)}function w(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(g,O,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!c){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${i}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function y(e){const t=a.get(e);if(t)return t;const r={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(a.set(e,r),c){const n=new BroadcastChannel(`sse:${i}:${e}`);n.onmessage=s=>D(r,s.data),r.channel=n}return r}function v(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,a.delete(e.key)}return{subscribe(e,t,r){const n=!a.has(e),s=y(e);s.refCount++,s.handlers.add(t),r&&s.reconnectHandlers.add(r),n&&L(s);let h=!1;return()=>{h||(h=!0,s.handlers.delete(t),r&&s.reconnectHandlers.delete(r),s.refCount--,s.refCount<=0&&v(s))}}}}function _(o,d){const u=new Set(d);return{subscribe(i,f,a){const c=l=>{u.has(l.type)&&f(l)};return o.subscribe(i,c,a)}}}const C=[...S,b,A],P=C,H=C,m=M({name:"watch",buildUrl:o=>`/api/${encodeURIComponent(o)}/watch?types=${P.join(",")}`,eventTypes:H,crossTab:!0}),I=_(m,[...S]),V=_(m,[b,A]),W=I;export{N as D,U as S,A as T,W as d,V as t};
@@ -1 +1 @@
1
- import{c as n,j as i,cJ as u,m as c,H as m,cI as x,cK as j,cL as N,cN as b,cW as D,cM as g}from"./index-DC0xonGL.js";import{i as h}from"./X-gWtgqXtq.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,E as b,B as c,T as d,z as e,y as f,v as g,H as h,w as i};
1
+ import{c as n,j as i,cJ as u,m as c,H as m,cI as x,cK as j,cL as N,cN as b,cW as D,cM as g}from"./index-CtSWRGXN.js";import{i as h}from"./X-BxlAIg00.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,R as a,E as b,B as c,T as d,z as e,y as f,v as g,H as h,w as i};