decocms 4.286.0 → 4.286.2

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 (231) hide show
  1. package/dist/client/assets/{AlertCircle-BGw3XlXk.js → AlertCircle-hiOqJcW5.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BmadQ3iU.js → AreaChart-BqfhkmRW.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C_gfx94q.js → ArrowLeft-DEFSUc-V.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Be3wdSNr.js → ArrowUp-CHCWVGsK.js} +1 -1
  5. package/dist/client/assets/{Check-DiujM3Bc.js → Check-yS6TBRKx.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DcWCuiei.js → CheckCircle-DUmezbyG.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-B9H-gqPt.js → ChevronDown-RrKk7H6I.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-zk3hjjG0.js → ChevronRight-B3-5oKsn.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CiZklIQA.js → ChevronSelectorVertical-CqILirh0.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-BzNZuBSL.js → ChevronUp-7BeD5K4q.js} +1 -1
  11. package/dist/client/assets/{Copy01-Ce6E_Ifo.js → Copy01-DH1C4T5n.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BNnQurqN.js → CreditCard01-DxOjVad1.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-CuaVjEFE.js → DotsVertical-DL_xKTby.js} +1 -1
  14. package/dist/client/assets/{Download01-CLn3maXy.js → Download01-uGF8VQkc.js} +1 -1
  15. package/dist/client/assets/{Eye-DlNcBFBo.js → Eye-BP8ZftGB.js} +1 -1
  16. package/dist/client/assets/{FilterLines-DEGFannV.js → FilterLines-DQxyjNBq.js} +1 -1
  17. package/dist/client/assets/{Globe01-B23V2Joo.js → Globe01-DZMulFU5.js} +1 -1
  18. package/dist/client/assets/{Globe04-Bo3nBCKm.js → Globe04-DCtFs4xl.js} +1 -1
  19. package/dist/client/assets/{HardDrive-CS0V7I_b.js → HardDrive-BLuff5wS.js} +1 -1
  20. package/dist/client/assets/{Key01-Cl-G8wdQ.js → Key01-DLwJ7Ckf.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-6Eva3_re.js → LinkExternal01--8l2Mzfp.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-CN11iIqE.js → LockUnlocked01-DiNL4sfs.js} +1 -1
  23. package/dist/client/assets/{LogOut01-JOlIpVYg.js → LogOut01-DDaRu_3P.js} +1 -1
  24. package/dist/client/assets/{Monitor01-1s1dhhgC.js → Monitor01-i2p8_gzb.js} +1 -1
  25. package/dist/client/assets/{Palette-Cutx8lDK.js → Palette-xsvHNVzX.js} +1 -1
  26. package/dist/client/assets/{Play-D2y6v2GO.js → Play-BAPfXOmA.js} +1 -1
  27. package/dist/client/assets/{Plus-C6RnBW-5.js → Plus-BAv6QwTj.js} +1 -1
  28. package/dist/client/assets/{SearchLg-vQ4mWmFa.js → SearchLg-C-Eqo4y8.js} +1 -1
  29. package/dist/client/assets/{SearchMd-Cme8xHxY.js → SearchMd-BsqgJ4OR.js} +1 -1
  30. package/dist/client/assets/{Settings02-xVDbAjw7.js → Settings02-EAB5l-Jo.js} +1 -1
  31. package/dist/client/assets/{Share07-CgIIbXvb.js → Share07-D3k-RSTq.js} +1 -1
  32. package/dist/client/assets/{Shield01-DWzLUFLj.js → Shield01-XqMu5Nf3.js} +1 -1
  33. package/dist/client/assets/{Stars01-C0ceIy5a.js → Stars01-CqDHtnom.js} +1 -1
  34. package/dist/client/assets/{Stars02-D3wWSFvd.js → Stars02-DvnkqIQI.js} +1 -1
  35. package/dist/client/assets/{Sun-1LLuEmlt.js → Sun-BArbxBTe.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-LE5pNn35.js → SwitchHorizontal01-V4kh4_ID.js} +1 -1
  37. package/dist/client/assets/{Tool01-BOA3Hhno.js → Tool01-Bi7x_pFT.js} +1 -1
  38. package/dist/client/assets/{Tool02-qepgblpf.js → Tool02-BahI2w-F.js} +1 -1
  39. package/dist/client/assets/{Trash01-DbU5lEn8.js → Trash01-CxXI4uLo.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-BG3C69eq.js → TrendUp01-CYU0S4zQ.js} +1 -1
  41. package/dist/client/assets/{Upload01-CZRgQZHh.js → Upload01-Dx6t-7oj.js} +1 -1
  42. package/dist/client/assets/{User01-gcsNuBlu.js → User01-Bs6_V_tl.js} +1 -1
  43. package/dist/client/assets/{UserSquare-BnCNQ7NG.js → UserSquare-BaeuOy58.js} +1 -1
  44. package/dist/client/assets/{Users01-1L3hBTBq.js → Users01-UmcM8Jww.js} +1 -1
  45. package/dist/client/assets/{Users03-GR2oALJt.js → Users03-xamSOp-f.js} +1 -1
  46. package/dist/client/assets/{XCircle-DHXzS_UE.js → XCircle-DbIIvoOs.js} +1 -1
  47. package/dist/client/assets/{XClose-DN7n2l1K.js → XClose-BWO2zbra.js} +1 -1
  48. package/dist/client/assets/{YAxis-IIZkm6Pd.js → YAxis-ByFmlys2.js} +1 -1
  49. package/dist/client/assets/{Zap-BzSAmKbo.js → Zap-DrubYVJC.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-zh5y12_O.js → ZapSquare-BWMDlPC4.js} +1 -1
  51. package/dist/client/assets/{access-gate-CBhluzKR.js → access-gate-BxOMxDlN.js} +1 -1
  52. package/dist/client/assets/{agent-icon-D6UFUEyp.js → agent-icon-Dk522vgR.js} +1 -1
  53. package/dist/client/assets/{agents-list-kv_vJJBq.js → agents-list-DPxzcA1Q.js} +1 -1
  54. package/dist/client/assets/{ai-providers-WMBiWVB1.js → ai-providers-DudSkLhI.js} +1 -1
  55. package/dist/client/assets/{alert-DRLJF3VA.js → alert-Bz2oKGcW.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-CJ6HPz9N.js → alert-dialog-C7gi43qw.js} +1 -1
  57. package/dist/client/assets/{api-keys-bD_OqpgF.js → api-keys-BmwPSJJx.js} +1 -1
  58. package/dist/client/assets/{app-editor-DDia3knP.js → app-editor-CyR5TnHa.js} +1 -1
  59. package/dist/client/assets/{auth-LNmB6-r8.js → auth-XA3XVIU6.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-Bj_OOHwi.js → auth-catchall-C9aYupjX.js} +1 -1
  61. package/dist/client/assets/{auth-entry-DrGIwQE7.js → auth-entry-DxkDBhzc.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-t5lVTlh8.js → auth-split-layout-Dl6V6Y4j.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-abE4nlr8.js → authenticate-and-persist-oauth-C4F2LaiG.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-DEBz1PZ5.js → automation-list-row-CmUv79s4.js} +1 -1
  65. package/dist/client/assets/{automation-runs-DvmtKa8G.js → automation-runs-DHi91GZY.js} +1 -1
  66. package/dist/client/assets/{automations-BQ1zE1lw.js → automations-CbhqrSJB.js} +1 -1
  67. package/dist/client/assets/{avatar-Bk95B5w8.js → avatar-BKEDMSnX.js} +1 -1
  68. package/dist/client/assets/{badge-B2Zf6qZN.js → badge-BVOT5cY1.js} +1 -1
  69. package/dist/client/assets/{block-document-Dfh-563r.js → block-document-CIjl4dWS.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-D-a6INvq.js → breadcrumb-DcuBWgU6.js} +1 -1
  71. package/dist/client/assets/{buckets-AcGnhT8r.js → buckets-BxUOH6pm.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-p3TNvbhg.js → bulk-category-panel-BLG4ug1F.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-UIZj-j0m.js → capability-load-error-Bz8fYgjS.js} +1 -1
  74. package/dist/client/assets/{cards-Dzy79ZMy.js → cards-XUuMSfqb.js} +1 -1
  75. package/dist/client/assets/{category-editor-6z-ynKee.js → category-editor-CdqRjEq-.js} +1 -1
  76. package/dist/client/assets/{chart-CzT1O9dt.js → chart-Ck_FKld6.js} +1 -1
  77. package/dist/client/assets/{chat-context-CTjB2DFv.js → chat-context-cfHPN5ei.js} +1 -1
  78. package/dist/client/assets/{checkbox-CwLuHRXz.js → checkbox-hfjBf94F.js} +1 -1
  79. package/dist/client/assets/{choose-editor-0h8LisJM.js → choose-editor-Zlcu6_gN.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-C63ZUYMU.js → cli-auth-success-CyoOzdgx.js} +1 -1
  81. package/dist/client/assets/{collection-detail-DyuXWD9X.js → collection-detail-BltlsBDt.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-WkkTdQiO.js → collection-display-button-C-VYkKeK.js} +1 -1
  83. package/dist/client/assets/{collection-search-BZ-Q3I-u.js → collection-search-Bw_HysKr.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-jDt3a0l0.js → collection-table-wrapper-D6YxcBlE.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-DPjZex-Z.js → collection-tabs-B_gvi_U1.js} +1 -1
  86. package/dist/client/assets/{command-DfkgcKu8.js → command-DmgErSks.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-BdqD65r9.js → commerce-onboarding-CVXvwgis.js} +1 -1
  88. package/dist/client/assets/{config-C053AB8T.js → config-Bhu5kCwB.js} +1 -1
  89. package/dist/client/assets/{connect-BSiXRQhd.js → connect-B3CB3NbU.js} +1 -1
  90. package/dist/client/assets/{connection-BQsZLYHP.js → connection-Du-s9JTq.js} +1 -1
  91. package/dist/client/assets/{connection-card-C7MobTIK.js → connection-card-qmGgp48y.js} +1 -1
  92. package/dist/client/assets/{connection-detail-MU6BsxU6.js → connection-detail-CdS57-hi.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-DC83nWwS.js → connection-form-helpers-CEN5IzSB.js} +1 -1
  94. package/dist/client/assets/{connections-BGS1paTU.js → connections-4JE1f-NA.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-A07DOCGf.js → decopilot-sse-pool-JfBMouUo.js} +1 -1
  96. package/dist/client/assets/{dialog-DveHs0kp.js → dialog-qy0Z1aJp.js} +1 -1
  97. package/dist/client/assets/{domain-settings-C8ucuxUh.js → domain-settings-BAj4VRPx.js} +1 -1
  98. package/dist/client/assets/{drawer-CRhVZ0X7.js → drawer-Ba-RJ-Vm.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-BR_cSQLm.js → dropdown-menu-U_vACpBP.js} +1 -1
  100. package/dist/client/assets/{empty-state-CSneS9BU.js → empty-state-jsXC5kwN.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-Dai3fHMk.js → extract-connection-data-C4yVX3dU.js} +1 -1
  102. package/dist/client/assets/{file-explorer-Dlt8T-eE.js → file-explorer-BQ3uCYfn.js} +1 -1
  103. package/dist/client/assets/{file-type-icon-CTS2wX2I.js → file-type-icon-Qndp-c2z.js} +1 -1
  104. package/dist/client/assets/{form-DPY4ZjEn.js → form-YGkaTcsZ.js} +1 -1
  105. package/dist/client/assets/{general-D25Ymmu9.js → general-MN_YuUqq.js} +1 -1
  106. package/dist/client/assets/{github-repo-picker-DzT6Zs-M.js → github-repo-picker-BqSmN9CA.js} +1 -1
  107. package/dist/client/assets/{hooks-BBTWuwj0.js → hooks-BQCR9h_s.js} +1 -1
  108. package/dist/client/assets/{index-Cwc5OUhn.js → index-66BUlUCq.js} +5 -5
  109. package/dist/client/assets/{index-IhD4MlVw.js → index-B069nvZi.js} +1 -1
  110. package/dist/client/assets/{index-CwhEUWmk.js → index-B_cjnmHp.js} +1 -1
  111. package/dist/client/assets/{index-Cxlyb4Tg.js → index-BbuG8Jbg.js} +1 -1
  112. package/dist/client/assets/{index-CUUhrBmX.js → index-BlALgPn0.js} +1 -1
  113. package/dist/client/assets/{index-tJJOgsq4.js → index-BpfHCkMo.js} +1 -1
  114. package/dist/client/assets/{index-D08DKujt.js → index-CP07biT3.js} +1 -1
  115. package/dist/client/assets/{index-LPzaT2sc.js → index-CXN6bmWL.js} +61 -61
  116. package/dist/client/assets/{index-Dfnot3bs.js → index-CYDZxSyh.js} +1 -1
  117. package/dist/client/assets/index-Phl0yjiP.css +1 -0
  118. package/dist/client/assets/{index-redirect-CdiWvESd.js → index-redirect-CCwJiDzA.js} +1 -1
  119. package/dist/client/assets/{index-Bo3ENa71.js → index-w7SC22aY.js} +1 -1
  120. package/dist/client/assets/{infra-billing-C2F2Qt-N.js → infra-billing-BMnY0AH9.js} +1 -1
  121. package/dist/client/assets/{input-H1AQT31Q.js → input-DSNlRZp-.js} +1 -1
  122. package/dist/client/assets/{integration-icon-DnxesxSu.js → integration-icon-DgpBd9x9.js} +1 -1
  123. package/dist/client/assets/{invite-member-dialog-kiZFlDTJ.js → invite-member-dialog-BxVvTBsq.js} +1 -1
  124. package/dist/client/assets/{label-CH7Mz6MF.js → label-CqOwuXw5.js} +1 -1
  125. package/dist/client/assets/{layout-CJs037de.js → layout-BX1xrGBZ.js} +1 -1
  126. package/dist/client/assets/{login-CrkMX2vj.js → login-CdYcIAH1.js} +1 -1
  127. package/dist/client/assets/{mcp-oauth-C4AEx9Qj.js → mcp-oauth-CCK0vzqY.js} +1 -1
  128. package/dist/client/assets/{members-nVR0C66u.js → members-DArjgHPY.js} +1 -1
  129. package/dist/client/assets/{monaco-editor-BBhZuVQY.js → monaco-editor-doGausTU.js} +1 -1
  130. package/dist/client/assets/{monitoring-stats-row-CrhBPyxd.js → monitoring-stats-row-BE0x_Y2T.js} +1 -1
  131. package/dist/client/assets/{multi-select--GOxbZFW.js → multi-select-CpP6bWVL.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-BYMpBx-b.js → oauth-callback-DDLCnMS3.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ai-provider-Btw8m4Pw.js → oauth-callback-ai-provider-BdKpH2mQ.js} +1 -1
  134. package/dist/client/assets/{onboarding-Cusp2Kco.js → onboarding-BhdMYjwb.js} +1 -1
  135. package/dist/client/assets/{org-layout-DYEMsp-k.js → org-layout-6Z4I0hHW.js} +1 -1
  136. package/dist/client/assets/{organization-choice-H0x2yplX.js → organization-choice-BP7uSM89.js} +1 -1
  137. package/dist/client/assets/{orgs-C_TsjzsU.js → orgs-Dg1CXVTF.js} +1 -1
  138. package/dist/client/assets/{page-seo-form-BRpzwi34.js → page-seo-form-CqsF5lXU.js} +1 -1
  139. package/dist/client/assets/{popover-Kt90GgHN.js → popover-B-hxuR7_.js} +1 -1
  140. package/dist/client/assets/{post-calendar-Q7egXydN.js → post-calendar-CwOyzayg.js} +1 -1
  141. package/dist/client/assets/{post-editor-3W4nlw2D.js → post-editor-CMogJsWz.js} +1 -1
  142. package/dist/client/assets/{primitives-Uy3Dn3l5.js → primitives-DFmC6p_Q.js} +1 -1
  143. package/dist/client/assets/{profile-BpnLekw3.js → profile-Dkr0W5iY.js} +1 -1
  144. package/dist/client/assets/{project-app-view-Bl_hd5Qi.js → project-app-view-CU0pWUxg.js} +1 -1
  145. package/dist/client/assets/{prompts-s5jy6ei-.js → prompts-7twTnqOX.js} +1 -1
  146. package/dist/client/assets/record-editor-B5zgmpPT.js +1 -0
  147. package/dist/client/assets/{redirect-editor-DB6qYMS7.js → redirect-editor-CBQTBNAl.js} +1 -1
  148. package/dist/client/assets/registry-CT7qFX2T.js +2 -0
  149. package/dist/client/assets/{registry-layout-Bh_qys_B.js → registry-layout-BKOsGixf.js} +1 -1
  150. package/dist/client/assets/{reports-SCSdTqAq.js → reports-DRMI8_m1.js} +1 -1
  151. package/dist/client/assets/{require-capability-DkLXZoIE.js → require-capability-NxUQlfkl.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-TicOmrWu.js → required-auth-layout-CHGHhIp4.js} +1 -1
  153. package/dist/client/assets/{reset-password-CH0TbZtk.js → reset-password-DqdRqc5j.js} +1 -1
  154. package/dist/client/assets/{review-settings-DTxUaKsw.js → review-settings-hF6_ejz-.js} +1 -1
  155. package/dist/client/assets/{roles-B_pshoUl.js → roles-DNg-v40Q.js} +1 -1
  156. package/dist/client/assets/{scroll-area-B4y7Uc4_.js → scroll-area-5vzmt2fx.js} +1 -1
  157. package/dist/client/assets/{search-input-ByGGbbuH.js → search-input-fSMW29Ha.js} +1 -1
  158. package/dist/client/assets/{secrets-_ieMj3TA.js → secrets-DZUJRYpg.js} +1 -1
  159. package/dist/client/assets/{sections-editor-DPLCdotd.js → sections-editor-dUiZNQ0T.js} +1 -1
  160. package/dist/client/assets/{select-nNkfzHSn.js → select-BxxMay64.js} +1 -1
  161. package/dist/client/assets/{select-model-BjrzakQK.js → select-model-3PUtzWOF.js} +1 -1
  162. package/dist/client/assets/{self-tool-result-BCjIfrHl.js → self-tool-result-CnLvIY_a.js} +1 -1
  163. package/dist/client/assets/{seo-editor-D0U1KWjh.js → seo-editor-C771IjDu.js} +1 -1
  164. package/dist/client/assets/{settings-layout-QoXDdekp.js → settings-layout-68cErOzo.js} +1 -1
  165. package/dist/client/assets/{shell-controls-srlxCIc-.js → shell-controls-CnzOBK-d.js} +1 -1
  166. package/dist/client/assets/{shell-layout-y0pc6Ps_.js → shell-layout-BAPiuVCF.js} +1 -1
  167. package/dist/client/assets/{spinner-BxT2-RQL.js → spinner-5kJIZwhC.js} +1 -1
  168. package/dist/client/assets/{sso-DMw9bkMB.js → sso-BSgokATe.js} +1 -1
  169. package/dist/client/assets/{store-CwG7oz8f.js → store-BDt4_0eK.js} +1 -1
  170. package/dist/client/assets/store-registry-417KFpib.js +2 -0
  171. package/dist/client/assets/{switch-FVvEKs7w.js → switch-DranR37-.js} +1 -1
  172. package/dist/client/assets/{synced-repos-BWqJ5BRx.js → synced-repos-C9zoHXsA.js} +1 -1
  173. package/dist/client/assets/{tab-id-B-MuWZyB.js → tab-id-rV9ba-P7.js} +1 -1
  174. package/dist/client/assets/{table-DPeHBel0.js → table-BaBcwP7i.js} +1 -1
  175. package/dist/client/assets/{tabs-ClBY3Swc.js → tabs-C4RG823b.js} +1 -1
  176. package/dist/client/assets/{task-board-Cc9n4YDI.js → task-board-U9ekmgf6.js} +1 -1
  177. package/dist/client/assets/{tasks-B24sGOdi.js → tasks-CLCpAm24.js} +1 -1
  178. package/dist/client/assets/{textarea-5UXjbrfA.js → textarea-BJRhlIeX.js} +1 -1
  179. package/dist/client/assets/{toggle-group-BRrB6fNL.js → toggle-group-BjESUsiw.js} +1 -1
  180. package/dist/client/assets/{toolbar-CtyPj6Jz.js → toolbar-B7xp1f_g.js} +1 -1
  181. package/dist/client/assets/{track-Baz2c1uX.js → track-CLV6okT5.js} +1 -1
  182. package/dist/client/assets/{types-D-eDMOji.js → types-Dptm8vRS.js} +1 -1
  183. package/dist/client/assets/{use-ai-providers-C5pRAYMe.js → use-ai-providers-Dnx2BwXA.js} +1 -1
  184. package/dist/client/assets/{use-api-keys-CZgi0Ffw.js → use-api-keys-9J2chZIl.js} +1 -1
  185. package/dist/client/assets/{use-automations-DgdPB5W5.js → use-automations-hHGlxB3Q.js} +1 -1
  186. package/dist/client/assets/{use-autosave-CKwEOpyw.js → use-autosave-CjMVnZ9D.js} +1 -1
  187. package/dist/client/assets/{use-commerce-diagnostic-C-6WH25O.js → use-commerce-diagnostic-Brb2fqiq.js} +1 -1
  188. package/dist/client/assets/{use-connection-09ezQVmp.js → use-connection-lpB7Ak3D.js} +1 -1
  189. package/dist/client/assets/{use-copy-3AwQB8Iu.js → use-copy-cPUcRSDk.js} +1 -1
  190. package/dist/client/assets/{use-create-virtual-mcp-DBiwi9ad.js → use-create-virtual-mcp-BE3_FLPI.js} +1 -1
  191. package/dist/client/assets/{use-debounced-autosave-W2VmKoU8.js → use-debounced-autosave-BTblZwgG.js} +1 -1
  192. package/dist/client/assets/{use-debounced-value-DRya_SIM.js → use-debounced-value-C1RgoEO7.js} +1 -1
  193. package/dist/client/assets/{use-decopilot-events-KsVmeo4N.js → use-decopilot-events-BKdVQlWj.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-BMflGo_0.js → use-delete-connection-D-APxGPc.js} +1 -1
  195. package/dist/client/assets/{use-deployment-admin-CqaCx9zD.js → use-deployment-admin-BaYSlZon.js} +1 -1
  196. package/dist/client/assets/{use-file-configs-B34ZlHyv.js → use-file-configs-CwqLdhuz.js} +1 -1
  197. package/dist/client/assets/{use-infinite-scroll-CXfjhv8u.js → use-infinite-scroll--Ew0plMX.js} +1 -1
  198. package/dist/client/assets/{use-join-requests-BQMQ0atp.js → use-join-requests-C7H_x6Qk.js} +1 -1
  199. package/dist/client/assets/{use-mcp-auth-status-BbOwCYFJ.js → use-mcp-auth-status-5BY6Nzu_.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-DDri_uok.js → use-mcp-client-DPpSkRNd.js} +1 -1
  201. package/dist/client/assets/{use-mcp-tools-D39UBufk.js → use-mcp-tools-BgQkZEa9.js} +1 -1
  202. package/dist/client/assets/{use-members-CBxZJhy7.js → use-members-ZgUYxfoN.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-Bf4VINKK.js → use-navigate-to-agent-BDnGtSYT.js} +1 -1
  204. package/dist/client/assets/{use-org-auth-client-CNZVyny3.js → use-org-auth-client-s5DfOquz.js} +1 -1
  205. package/dist/client/assets/{use-org-repo-syncs-BsKGoRHN.js → use-org-repo-syncs-BVrqXPPs.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-CrDXOfve.js → use-org-sso-4XYfaR1R.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-C97DSxT9.js → use-organization-roles-BhSD9m9-.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-CU8oKGH8.js → use-organization-settings-DyKnNOU1.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-DXDW9BVj.js → use-registry-connections-CumAXYCD.js} +1 -1
  210. package/dist/client/assets/{use-secrets-DfX3lo5B.js → use-secrets-Dv8l4-qt.js} +1 -1
  211. package/dist/client/assets/{use-section-preview-base-B1_SCJCR.js → use-section-preview-base-DNZmvPJ8.js} +1 -1
  212. package/dist/client/assets/{use-status-sounds-BSLKT5kS.js → use-status-sounds-Lkn4Z7sU.js} +1 -1
  213. package/dist/client/assets/{use-tags-zhNtgkm6.js → use-tags-mKLoUee7.js} +1 -1
  214. package/dist/client/assets/{use-task-board-items-DMavIjbd.js → use-task-board-items-DhOTd2ok.js} +1 -1
  215. package/dist/client/assets/{use-view-mode-Bnd5pIZB.js → use-view-mode-C2aXQ0iB.js} +1 -1
  216. package/dist/client/assets/{use-virtual-mcp-CQghEz4m.js → use-virtual-mcp-CE8tx9or.js} +1 -1
  217. package/dist/client/assets/useInfiniteQuery-1rU8yXy8.js +1 -0
  218. package/dist/client/assets/useSuspenseInfiniteQuery-DiMhuD_T.js +1 -0
  219. package/dist/client/assets/{users-Dw_ixjEP.js → users-B59tCokk.js} +1 -1
  220. package/dist/client/assets/{variant-calendar-x0ITYFPs.js → variant-calendar-C9x2S-wB.js} +1 -1
  221. package/dist/client/assets/{view-mode-toggle-BuC5FO49.js → view-mode-toggle-D1UCXWa2.js} +1 -1
  222. package/dist/client/index.html +2 -2
  223. package/dist/server/cli.js +1 -1
  224. package/dist/server/server.js +1 -1
  225. package/package.json +1 -1
  226. package/dist/client/assets/index-CSzmTLvZ.css +0 -1
  227. package/dist/client/assets/record-editor-rWc6R365.js +0 -1
  228. package/dist/client/assets/registry-Dy5jw2xM.js +0 -2
  229. package/dist/client/assets/store-registry-CaCvkkvW.js +0 -2
  230. package/dist/client/assets/useInfiniteQuery-zd1aocsL.js +0 -1
  231. package/dist/client/assets/useSuspenseInfiniteQuery-yqcuCGQU.js +0 -1
@@ -1 +1 @@
1
- import{c as O,b as L,j as t,C as Gt,av as Qt,B as te,r as R,bu as Wt,d as ot,w as Xt,n as H,a as re,t as U,y as Yt,k as Ie,a5 as xt,M as jt,q as E,_ as vt,Z as bt,Y as Jt,H as ne,f as it,u as at,a8 as Ce,a9 as ye,ab as Ne,L as Zt,G as en,aw as tn,ax as nn,R as sn,I as on,K as Ae,p as an,ac as ln,o as ke}from"./index-Cwc5OUhn.js";import{i as cn}from"./ChevronRight-zk3hjjG0.js";import{aK as rn,Q as dn,A as Ct,L as un,s as Ze}from"./agent-icon-D6UFUEyp.js";import{t as yt}from"./ChevronDown-B9H-gqPt.js";import{a as lt,i as mn,d as fn,S as Nt,f as gn,W as hn,C as wt,g as pn}from"./constants-dLUUoWH7.js";import{u as _t,a as xn}from"./use-virtual-mcp-CQghEz4m.js";import{a as Re,b as St,P as Dt}from"./popover-Kt90GgHN.js";import{i as Ve}from"./Check-DiujM3Bc.js";import{s as we}from"./Plus-C6RnBW-5.js";import{i as kt}from"./SearchMd-Cme8xHxY.js";import{s as It}from"./XClose-DN7n2l1K.js";import{C as jn,d as ut}from"./self-tool-result-BCjIfrHl.js";import{T as At}from"./toolbar-CtyPj6Jz.js";import{D as Tt,a as Pt,b as Ot,c as vn,g as bn,e as Cn,f as yn}from"./drawer-CRhVZ0X7.js";import{a as Nn,G as wn}from"./github-repo-picker-DzT6Zs-M.js";import{g as _n,a as Sn,u as zt}from"./hooks-BBTWuwj0.js";import{u as Dn,g as kn,a as In,b as An}from"./use-navigate-to-agent-Bf4VINKK.js";import{g as Tn,a as Mt}from"./agent-capabilities-B52k7xCe.js";import{u as $t}from"./shell-layout-y0pc6Ps_.js";import{f as Pn}from"./reusable-new-chat-CzvRy4Pe.js";import{d as On}from"./session-runtime-wVXsCwcJ.js";import{C as zn}from"./collection-search-BZ-Q3I-u.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-Dai3fHMk.js";import{u as Ft,a as Lt,g as Bn,C as et}from"./connection-card-C7MobTIK.js";import{e as Bt,d as Et,a as Rt,b as Vt,h as En,c as Rn}from"./dialog-DveHs0kp.js";import{d as X,a as Y,e as J,b as Z,c as ee,F as mt}from"./form-DPY4ZjEn.js";import{I as ce}from"./input-H1AQT31Q.js";import{S as Vn,a as Un,b as Hn,c as Kn,d as De}from"./select-nNkfzHSn.js";import{T as qn}from"./textarea-5UXjbrfA.js";import{b as Ut}from"./use-connection-09ezQVmp.js";import{n as Ee,i as tt}from"./Tool02-qepgblpf.js";import{e as Gn}from"./UserSquare-BnCNQ7NG.js";import{c as Qn,i as Le,a as ft,E as Wn,p as Xn,b as Yn,d as Jn}from"./connection-form-helpers-DC83nWwS.js";import{a as nt}from"./authenticate-and-persist-oauth-abE4nlr8.js";import{g as Zn}from"./connection-slug-eyAPH6o3.js";import{C as es}from"./collection-tabs-DPjZex-Z.js";import{u as gt}from"./use-infinite-scroll-CXfjhv8u.js";import{B as Be}from"./badge-B2Zf6qZN.js";import{u as ts}from"./useSuspenseInfiniteQuery-yqcuCGQU.js";import{u as ns,m as ht}from"./use-mcp-client-DDri_uok.js";import{g as Ue}from"./metadata-dUsYcpuu.js";import{u as ss}from"./use-ai-providers-C5pRAYMe.js";import{f as os}from"./tab-id-B-MuWZyB.js";const is="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function as(){const n=O.c(13),e=L();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let a;n[3]!==o?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=a):a=n[4];let i;n[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:is,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=i):i=n[5];let l;n[6]!==e?(l=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=l):l=n[7];let c;n[8]!==l?(c=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,t.jsx("span",{className:"text-base font-medium",children:l})]}),n[8]=l,n[9]=c):c=n[9];let r;return n[10]!==a||n[11]!==c?(r=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,c]}),n[10]=a,n[11]=c,n[12]=r):r=n[12],r}function ls(){const n=O.c(19),e=L();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:rn,label:s},n[2]=s,n[3]=o):o=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let i;n[6]!==a?(i={Icon:Gt,label:a},n[6]=a,n[7]=i):i=n[7];let l;n[8]!==e?(l=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=l):l=n[9];let c;n[10]!==l?(c={Icon:dn,label:l},n[10]=l,n[11]=c):c=n[11];let r;n[12]!==o||n[13]!==i||n[14]!==c?(r=[o,i,c],n[12]=o,n[13]=i,n[14]=c,n[15]=r):r=n[15];const u=r;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(cs)})]}),n[17]=u,n[18]=f):f=n[18],f}function cs(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function Vo(n){const e=O.c(22),{siteHost:s,footer:o,onClose:a,children:i}=n,l=L(),c=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let r;e[0]!==a||e[1]!==l?(r=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":l("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(Qt,{size:18})}),e[0]=a,e[1]=l,e[2]=r):r=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==c||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(cn,{size:16,className:"shrink-0 text-foreground/25"}),c&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:c,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=c,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let g;e[10]!==o?(g=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=g):g=e[11];let C;e[12]!==i||e[13]!==d||e[14]!==g?(C=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,i,g]}),e[12]=i,e[13]=d,e[14]=g,e[15]=C):C=e[15];let x,h;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),h=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=x,e[17]=h):(x=e[16],h=e[17]);let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[x,h,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(as,{}),t.jsx("div",{className:"flex-1"}),t.jsx(ls,{})]})]}),e[18]=p):p=e[18];let v;return e[19]!==r||e[20]!==C?(v=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[r,C,p]}),e[19]=r,e[20]=C,e[21]=v):v=e[21],v}function Uo(n){const e=O.c(5),{ready:s,pending:o,label:a,onClick:i,children:l}=n,c=o||!s,r=s&&!o?l:null;let u;return e[0]!==a||e[1]!==i||e[2]!==c||e[3]!==r?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:c,children:[a,r]}),e[0]=a,e[1]=i,e[2]=c,e[3]=r,e[4]=u):u=e[4],u}function Ht(){const n=R.useContext(Wt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function rs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function ct(n){const e=O.c(13),{org:s,size:o}=n,a=o===void 0?"sm":o,i=a==="xs"?"size-5":"size-6",l=a==="xs"?"text-[9px]":"text-xs";let c;e[0]!==i?(c=H(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==s.logo||e[3]!==s.name?(r=s.logo?void 0:rs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=r):r=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:H("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let m;return e[9]!==c||e[10]!==r||e[11]!==u?(m=t.jsx("div",{className:c,style:r,children:u}),e[9]=c,e[10]=r,e[11]=u,e[12]=m):m=e[12],m}function ds({invitation:n,onChanged:e}){const s=L(),[o,a]=R.useState(!1),i=n.organizationName??s("header.orgSwitcher.unknownOrganization"),l=async()=>{a(!0);try{const u=await re.organization.acceptInvitation({invitationId:n.id});if(u.error){U.error(u.error.message),a(!1);return}}catch{U.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}U.success(s("header.orgSwitcher.joined",{name:i})),Yt();let r;try{r=(await re.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=r?`/${r}`:"/"},c=async()=>{a(!0);try{const r=await re.organization.rejectInvitation({invitationId:n.id});if(r.error){U.error(r.error.message),a(!1);return}U.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{U.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(ct,{org:{name:i},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:i}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:l,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:t.jsx(It,{size:14})})]})]})}function us(n){const e=O.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:a}=n,i=L(),{data:l}=Xt(),{invitations:c,refetch:r}=Ht();let u;e[0]!==s?(u=(I,T)=>I.slug===s?-1:T.slug===s?1:I.name.localeCompare(T.name),e[0]=s,e[1]=u):u=e[1];const m=[...l??[]].sort(u),[f,d]=R.useState(""),g=f.toLowerCase(),C=g?m.filter(I=>I.name.toLowerCase().includes(g)||I.slug.toLowerCase().includes(g)):m;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(kt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=I=>d(I.target.value),e[3]=h):h=e[3];let p;e[4]!==f?(p=I=>I.key==="Escape"&&f&&d(""),e[4]=f,e[5]=p):p=e[5];let v;e[6]!==i?(v=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=v):v=e[7];let b;e[8]!==f||e[9]!==p||e[10]!==v?(b=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:h,onKeyDown:p,placeholder:v,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=p,e[10]=v,e[11]=b):b=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(we,{size:16}),e[12]=N):N=e[12];let S;e[13]!==a?(S=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:N}),e[13]=a,e[14]=S):S=e[14];let k;e[15]!==b||e[16]!==S?(k=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,S]}),e[15]=b,e[16]=S,e[17]=k):k=e[17];const z="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let j;e[18]!==c||e[19]!==f||e[20]!==r?(j=!f&&c.map(I=>t.jsx(ds,{invitation:I,onChanged:r},I.id)),e[18]=c,e[19]=f,e[20]=r,e[21]=j):j=e[21];const D=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?i("header.orgSwitcher.noOrganizationsMatch",{query:f}):i("header.orgSwitcher.noOrganizationsAvailable")});let A;e[22]!==o||e[23]!==s?(A=I=>t.jsxs("button",{type:"button",onClick:()=>o(I.slug),className:H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",I.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(ct,{org:I,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.slug})]}),I.slug===s&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id),e[22]=o,e[23]=s,e[24]=A):A=e[24];const w=C.map(A);let y;e[25]!==j||e[26]!==D||e[27]!==w?(y=t.jsxs("div",{className:z,children:[j,D,w]}),e[25]=j,e[26]=D,e[27]=w,e[28]=y):y=e[28];let P;return e[29]!==y||e[30]!==k?(P=t.jsxs(t.Fragment,{children:[k,y]}),e[29]=y,e[30]=k,e[31]=P):P=e[31],P}function ms(n){const e=O.c(22),{trigger:s,orgParam:o,align:a,side:i}=n,l=a===void 0?"start":a,c=i===void 0?"bottom":i,r=ot(),[u,m]=R.useState(!1),[f,d]=R.useState(!1);let g;e[0]!==s?(g=t.jsx(Re,{asChild:!0,children:s}),e[0]=s,e[1]=g):g=e[1];const C=String(u);let x;e[2]!==r?(x=k=>{m(!1),r({to:"/$org",params:{org:k}})},e[2]=r,e[3]=x):x=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{m(!1),d(!0)},e[4]=h):h=e[4];let p;e[5]!==o||e[6]!==C||e[7]!==x?(p=t.jsx(us,{orgParam:o,onSelectOrg:x,onCreateOrg:h},C),e[5]=o,e[6]=C,e[7]=x,e[8]=p):p=e[8];let v;e[9]!==l||e[10]!==c||e[11]!==p?(v=t.jsx(St,{side:c,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:gs,onCloseAutoFocus:fs,children:p}),e[9]=l,e[10]=c,e[11]=p,e[12]=v):v=e[12];let b;e[13]!==u||e[14]!==g||e[15]!==v?(b=t.jsxs(Dt,{open:u,onOpenChange:m,children:[g,v]}),e[13]=u,e[14]=g,e[15]=v,e[16]=b):b=e[16];let N;e[17]!==f?(N=t.jsx(jn,{open:f,onOpenChange:d}),e[17]=f,e[18]=N):N=e[18];let S;return e[19]!==N||e[20]!==b?(S=t.jsxs(t.Fragment,{children:[b,N]}),e[19]=N,e[20]=b,e[21]=S):S=e[21],S}function fs(n){return n.preventDefault()}function gs(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function hs(n){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:c,disabled:r}=n,u=a===void 0?"Search...":a;let m;e[0]!==l?(m=H("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const f=r?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=H("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let g;e[4]!==c?(g=c?t.jsx(Ie,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=g):g=e[5];let C;e[6]!==o?(C=v=>o(v.target.value),e[6]=o,e[7]=C):C=e[7];let x;e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:i,placeholder:u,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=r,e[9]=i,e[10]=u,e[11]=C,e[12]=s,e[13]=x):x=e[13];let h;e[14]!==d||e[15]!==g||e[16]!==x?(h=t.jsxs("label",{className:d,children:[g,x]}),e[14]=d,e[15]=g,e[16]=x,e[17]=h):h=e[17];let p;return e[18]!==m||e[19]!==h?(p=t.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=p):p=e[20],p}function ps(n,e,s){if(!s)return null;const o=_n(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function xs(n){const e=O.c(6),{value:s,onChange:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(hs,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function js(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function vs(n){const e=O.c(10),{org:s,onClose:o}=n,a=L();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==i||e[7]!==l||e[8]!==c?(r=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Zt,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=i,e[7]=l,e[8]=c,e[9]=r):r=e[9],r}function bs(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Kt,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function Cs(n){const e=O.c(11),{onImportFromGithub:s}=n,o=L();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(wn,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let r;return e[8]!==l||e[9]!==c?(r=t.jsx(Kt,{action:l,children:c}),e[8]=l,e[9]=c,e[10]=r):r=e[10],r}function ys(n){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H(o),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==s?(c=()=>{E("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{className:"size-4"}),e[6]=r):r=e[6];let u;return e[7]!==i||e[8]!==l||e[9]!==c?(u=t.jsx(At,{"aria-label":i,className:l,onClick:c,children:r}),e[7]=i,e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function Ns(n){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=H(a),e[3]=a,e[4]=c):c=e[4];let r;e[5]!==s?(r=()=>{E("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=r):r=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(we,{}),e[7]=u):u=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==l||e[13]!==c||e[14]!==r||e[15]!==f?(d=t.jsx(vt,{children:t.jsxs(bt,{tooltip:l,className:c,onClick:r,children:[u,f]})}),e[12]=l,e[13]=c,e[14]=r,e[15]=f,e[16]=d):d=e[16],d}function ws(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ot,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function _s(n){const e=O.c(8),{emptyCtaClass:s}=n,o=L();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=H(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{className:"size-4"}),e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==i?(c=t.jsx(At,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}function Ss(n){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=H(a),e[3]=a,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{}),e[5]=r):r=e[5];let u;e[6]!==i?(u=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==l||e[11]!==c||e[12]!==m?(f=t.jsx(Re,{asChild:!0,children:t.jsxs(bt,{tooltip:l,className:c,children:[r,m]})}),e[10]=l,e[11]=c,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let g;return e[17]!==d?(g=t.jsx(vt,{children:d}),e[17]=d,e[18]=g):g=e[18],g}function Ds(n){const e=O.c(9),{children:s}=n,o=L();let a;e[0]!==s?(a=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(ye,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=t.jsxs(Ne,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function ks(n){const e=ot(),{create:s}=Sn(),{locator:o}=ne(),a=it({strict:!1}),i=at({strict:!1});return async l=>{const c=crypto.randomUUID(),r=l===i.virtualmcpid?ps(n,o,a.taskId??""):null;try{await s({id:c,virtual_mcp_id:l,...r?{branch:r}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:c},search:{virtualmcpid:l}})}}function st(n){const e=O.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(Ct,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let r;e[5]!==s.title?(r=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=r):r=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==r||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,u]}),e[9]=r,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:a,className:l,children:[c,m,f]}),e[14]=a,e[15]=l,e[16]=c,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Kt(n){const e=O.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Is(n){const e=O.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,c]=R.useState(""),r=_t(),u=r??[],{org:m}=ne(),{data:f}=re.useSession(),d=f?.user?.id??"anon",g=kn(r),C=In(),x=ks(m.slug),h=Tn(r),p=l.toLowerCase(),v=u.filter(Os).filter(F=>!h.has(F.id)).filter(Ps).filter(F=>!l||F.title.toLowerCase().includes(p)),b=v.filter(Ts),N=v.filter(As),S=lt(m.id),k=!l||S.title.toLowerCase().includes(p),z=!!(o&&k);let j;e[0]!==s||e[1]!==o?(j=()=>{o?.(null),s(),c("")},e[0]=s,e[1]=o,e[2]=j):j=e[2];const D=j,A=F=>{if(o){o(F.id),s(),c("");return}An({orgId:m.id,userId:d},F.id,g),C(),s(),c(""),x(F.id)},w="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==l?(y=t.jsx(xs,{value:l,onChange:c}),e[3]=l,e[4]=y):y=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",I=o&&k&&S&&t.jsx(st,{agent:S,selected:!a||a===S.id,onClick:D}),T=(b.length>0||!l)&&t.jsx(Cs,{onImportFromGithub:i}),M=b.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>A(F)},F.id)),V=N.length>0&&t.jsx(bs,{}),Q=N.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>A(F)},F.id));let B;e[5]!==z||e[6]!==l||e[7]!==v.length?(B=v.length===0&&!z&&l&&t.jsx(js,{}),e[5]=z,e[6]=l,e[7]=v.length,e[8]=B):B=e[8];let se;e[9]!==B||e[10]!==I||e[11]!==T||e[12]!==M||e[13]!==V||e[14]!==Q?(se=t.jsxs("div",{className:P,children:[I,T,M,V,Q,B]}),e[9]=B,e[10]=I,e[11]=T,e[12]=M,e[13]=V,e[14]=Q,e[15]=se):se=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(vs,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==se||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:w,children:[y,se,q]}),e[19]=se,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function As(n){return!Mt(n.metadata)}function Ts(n){return Mt(n.metadata)}function Ps(n){return!fn(n.id)}function Os(n){return!mn(n.id)}function zs(n){const e=O.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:a,onSelectAgent:i,selectedAgentId:l,side:c,align:r}=s,u=o===void 0?!1:o,m=c===void 0?"right":c,f=r===void 0?"start":r,[d,g]=R.useState(!1),[C,x]=R.useState(!1),h=xt(),{setOpenMobile:p}=jt(),v=Dn(),b=v?"border border-border":void 0;let N;e[2]!==v?(N=T=>v?t.jsx(Ds,{children:T}):T,e[2]=v,e[3]=N):N=e[3];const S=N;let k;e[4]!==h||e[5]!==p?(k=()=>{g(!1),h&&p(!1)},e[4]=h,e[5]=p,e[6]=k):k=e[6];const z=k;let j;e[7]!==z?(j=()=>{z(),x(!0)},e[7]=z,e[8]=j):j=e[8];const D=j;let A;e[9]!==z||e[10]!==D||e[11]!==i||e[12]!==d||e[13]!==l?(A=d&&t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Jt,{className:"h-4 w-24"})}),children:t.jsx(Is,{onClose:z,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:D})}),e[9]=z,e[10]=D,e[11]=i,e[12]=d,e[13]=l,e[14]=A):A=e[14];const w=A;let y;e[15]!==f||e[16]!==u||e[17]!==b||e[18]!==v||e[19]!==h||e[20]!==d||e[21]!==w||e[22]!==m||e[23]!==a||e[24]!==S?(y=h?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:a}):u?S(t.jsx(ys,{setOpen:g,emptyCtaClass:b})):t.jsx(Ns,{setOpen:g,highlightEmpty:v,emptyCtaClass:b}),t.jsx(Tt,{open:d,onOpenChange:g,direction:"bottom",children:t.jsxs(Pt,{className:"max-h-[85dvh] p-0",children:[t.jsx(ws,{}),w]})})]}):t.jsxs(Dt,{open:d,onOpenChange:T=>{T&&!d&&E("agent_browser_opened",{surface:"desktop_popover"}),g(T)},children:[a?t.jsx(Re,{asChild:!0,children:a}):u?S(t.jsx(Re,{asChild:!0,children:t.jsx(_s,{emptyCtaClass:b})})):t.jsx(Ss,{wrapEmptyHint:S,highlightEmpty:v,emptyCtaClass:b}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:w})]}),e[15]=f,e[16]=u,e[17]=b,e[18]=v,e[19]=h,e[20]=d,e[21]=w,e[22]=m,e[23]=a,e[24]=S,e[25]=y):y=e[25];let P;e[26]!==C?(P=t.jsx(Nn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let I;return e[28]!==P||e[29]!==y?(I=t.jsxs(t.Fragment,{children:[y,P]}),e[28]=P,e[29]=y,e[30]=I):I=e[30],I}function Ms(){const n=O.c(2),e=_t()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?On(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const $s="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Fs(n){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=L(),c=xn(s)??o??null;let r,u,m,f,d;e[0]!==c?.title||e[1]!==a||e[2]!==l?(d=c?.title??l("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",r="button",u=a,m=l("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=c?.title,e[1]=a,e[2]=l,e[3]=r,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(r=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const g=c?.icon??null;let C;e[8]!==g||e[9]!==d?(C=t.jsx(Ct,{icon:g,name:d,size:"xs"}),e[8]=g,e[9]=d,e[10]=C):C=e[10];let x;e[11]!==r||e[12]!==u||e[13]!==m||e[14]!==C?(x=t.jsx("button",{type:r,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:C}),e[11]=r,e[12]=u,e[13]=m,e[14]=C,e[15]=x):x=e[15];let h;e[16]!==d?(h=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=h):h=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(yt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=p):p=e[18];let v;e[19]!==h?(v=t.jsxs("button",{type:"button",className:$s,children:[h,p]}),e[19]=h,e[20]=v):v=e[20];let b;e[21]!==s||e[22]!==i||e[23]!==v?(b=t.jsx(zs,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:v}),e[21]=s,e[22]=i,e[23]=v,e[24]=b):b=e[24];let N;return e[25]!==b||e[26]!==f||e[27]!==x?(N=t.jsxs("div",{className:f,children:[x,b]}),e[25]=b,e[26]=f,e[27]=x,e[28]=N):N=e[28],N}function Ho(n){const e=O.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,a=L(),{org:i}=ne(),{state:l,isMobile:c}=jt(),r=Ht().invitations.length>0,u=l==="collapsed"||c;let m;e[2]!==r||e[3]!==i.name||e[4]!==a?(m=r?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:i.name}):a("header.shellBreadcrumb.switchOrganization",{name:i.name}),e[2]=r,e[3]=i.name,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i?(f=t.jsx(ct,{org:i,size:"sm"}),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==r||e[9]!==u?(d=r&&t.jsx("span",{className:H("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=r,e[9]=u,e[10]=d):d=e[10];let g;e[11]!==f||e[12]!==d?(g=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=g):g=e[13];let C;e[14]!==i.name||e[15]!==o?(C=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[14]=i.name,e[15]=o,e[16]=C):C=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(yt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=x):x=e[17];let h;e[18]!==m||e[19]!==g||e[20]!==C?(h=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[g,C,x]})}),e[18]=m,e[19]=g,e[20]=C,e[21]=h):h=e[21];let p;e[22]!==i.slug||e[23]!==h?(p=t.jsx(ms,{orgParam:i.slug,trigger:h}),e[22]=i.slug,e[23]=h,e[24]=p):p=e[24];let v;e[25]!==i.name?(v=t.jsx(ye,{side:"bottom",children:i.name}),e[25]=i.name,e[26]=v):v=e[26];let b;return e[27]!==v||e[28]!==p?(b=t.jsxs(Ne,{children:[p,v]}),e[27]=v,e[28]=p,e[29]=b):b=e[29],b}function Ko(n){const e=O.c(23);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=ne();let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[2]=i):i=e[2];const l=it(i);let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[3]=c):c=e[3];const r=at(c),{threads:u}=zt(),{data:m}=re.useSession(),{setTaskId:f,createNewTask:d}=$t(),g=Ms();let C;e[4]!==a.id?(C=lt(a.id),e[4]=a.id,e[5]=C):C=e[5];const x=C,h=x.id,p=l.taskId?r.virtualmcpid??h:h;let v;e[6]!==d||e[7]!==h||e[8]!==o||e[9]!==g||e[10]!==m?.user?.id||e[11]!==f||e[12]!==u?(v=j=>{const D=j??h,A=Pn(u,D,m?.user?.id,g(D));A?f(A.id,D):d(D),o?.()},e[6]=d,e[7]=h,e[8]=o,e[9]=g,e[10]=m?.user?.id,e[11]=f,e[12]=u,e[13]=v):v=e[13];const b=v;let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[14]=N):N=e[14];const S=p===h?x:void 0;let k;e[15]!==p||e[16]!==b?(k=()=>b(p),e[15]=p,e[16]=b,e[17]=k):k=e[17];let z;return e[18]!==p||e[19]!==b||e[20]!==S||e[21]!==k?(z=t.jsx(R.Suspense,{fallback:N,children:t.jsx(Fs,{agentId:p,fallback:S,onOpenHome:k,onPick:b})}),e[18]=p,e[19]=b,e[20]=S,e[21]=k,e[22]=z):z=e[22],z}function qo(){const n=O.c(24),e=L(),{org:s}=ne();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[0]=o):o=n[0];const a=it(o);let i;n[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[1]=i):i=n[1];const l=at(i),{threads:c}=zt(),{createNewTask:r}=$t();let u;n[2]!==s.id?(u=lt(s.id),n[2]=s.id,n[3]=u):u=n[3];const m=u.id,f=a.taskId?l.virtualmcpid??m:m;let d;n[4]!==a.taskId||n[5]!==c?(d=(a.taskId?c.find(k=>k.id===a.taskId)?.branch:null)??null,n[4]=a.taskId,n[5]=c,n[6]=d):d=n[6];const g=d;let C;n[7]!==f||n[8]!==r||n[9]!==g?(C=()=>{r(f,g)},n[7]=f,n[8]=r,n[9]=g,n[10]=C):C=n[10];const x=C;let h;n[11]!==e?(h=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=h):h=n[12];let p;n[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(un,{size:16}),n[13]=p):p=n[13];let v;n[14]!==x||n[15]!==h?(v=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":h,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p})}),n[14]=x,n[15]=h,n[16]=v):v=n[16];let b;n[17]!==e?(b=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=b):b=n[18];let N;n[19]!==b?(N=t.jsx(ye,{side:"bottom",children:b}),n[19]=b,n[20]=N):N=n[20];let S;return n[21]!==v||n[22]!==N?(S=t.jsxs(Ne,{children:[v,N]}),n[21]=v,n[22]=N,n[23]=S):S=n[23],S}function Ls({open:n,onOpenChange:e,onCreated:s}){const o=L(),{org:a}=ne(),{data:i}=re.useSession(),{stdioEnabled:l}=en(),c=xt(),r=Ut(),u=Ft(),f=Lt(u,"").items,d=tn({resolver:nn(Qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),C=d.watch("connection_url"),x=d.watch("npx_package"),h=Le({uiType:g,connectionUrl:C??"",npxPackage:x??""})??ft({uiType:g,connectionUrl:C??"",registryItems:f}),p=j=>{const D=j.trim();if(!D)return;const A=!!d.formState.dirtyFields.title,w=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,P=T=>{if(T&&(!A&&!d.getValues("title").trim()&&T.title&&d.setValue("title",T.title,{shouldDirty:!1}),!w&&!(d.getValues("description")??"").trim()&&T.description&&d.setValue("description",T.description,{shouldDirty:!1}),!y&&T.envVarKeys?.length)){const M=d.getValues("env_vars")??[],V=new Set(M.map(B=>B.key)),Q=T.envVarKeys.filter(B=>!V.has(B));Q.length>0&&d.setValue("env_vars",[...M,...Q.map(B=>({key:B,value:""}))],{shouldDirty:!0})}},I=Xn(D);if(I&&l){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",I.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),P(Le({uiType:"NPX",npxPackage:I.packageName}));return}if(D.startsWith("http://")||D.startsWith("https://")){const T=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",T,{shouldDirty:!0}),d.setValue("connection_url",D,{shouldDirty:!0}),P(Le({uiType:T,connectionUrl:D})??ft({uiType:T,connectionUrl:D,registryItems:f}));return}g==="NPX"&&P(Le({uiType:"NPX",npxPackage:D}))},v=j=>{j||d.reset(),e(j)},b=async j=>{let D,A=null,w=null,y=null;j.ui_type==="NPX"?(D="STDIO",A="",y=Yn(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(D="STDIO",A="",y=Jn(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(D=j.ui_type,A=j.connection_url||"",w=j.connection_token||null);const P=Mn("conn");try{await r.create.mutateAsync({id:P,title:j.title,description:j.description||null,connection_type:D,connection_url:A,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:j.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(P)}catch{U.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},N=o("connections.createConnectionDialog.title"),S=o("connections.createConnectionDialog.description"),k=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(X,{control:d.control,name:"ui_type",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(Vn,{value:j.value,onValueChange:j.onChange,children:[t.jsx(Z,{children:t.jsx(Un,{children:t.jsx(Hn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),g==="NPX"&&t.jsx(X,{control:d.control,name:"npx_package",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...j,value:j.value??"",onPaste:D=>{const A=D.clipboardData.getData("text");A&&(D.preventDefault(),d.setValue("npx_package",A.trim(),{shouldDirty:!0}),p(A))},onBlur:D=>{p(D.target.value),j.onBlur()}})}),t.jsx(ee,{})]})}),g==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(X,{control:d.control,name:"stdio_command",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...j,value:j.value??""})}),t.jsx(ee,{})]})}),t.jsx(X,{control:d.control,name:"stdio_args",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...j,value:j.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(X,{control:d.control,name:"stdio_cwd",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...j,value:j.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(g==="NPX"||g==="STDIO")&&t.jsx(X,{control:d.control,name:"env_vars",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Wn,{value:j.value??[],onChange:j.onChange})}),t.jsx(ee,{})]})}),g!=="NPX"&&g!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(X,{control:d.control,name:"connection_url",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...j,value:j.value??"",onPaste:D=>{const A=D.clipboardData.getData("text");A&&(D.preventDefault(),d.setValue("connection_url",A.trim(),{shouldDirty:!0}),p(A))},onBlur:D=>{p(D.target.value),j.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(X,{control:d.control,name:"connection_token",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:h?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ce,{type:"password",placeholder:h?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...j,value:j.value??""})}),h?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.token.helperText,h.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(X,{control:d.control,name:"title",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...j})}),t.jsx(ee,{})]})}),t.jsx(X,{control:d.control,name:"description",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(qn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(Tt,{open:n,onOpenChange:v,children:t.jsxs(Pt,{className:"max-h-[90vh]",children:[t.jsx(vn,{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(Ot,{children:N}),t.jsx(bn,{className:"mt-1",children:S})]}),t.jsx(Cn,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(It,{size:16})})})]})}),t.jsx(mt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(b),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:z}),t.jsx(yn,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):t.jsx(Bt,{open:n,onOpenChange:v,children:t.jsxs(Et,{className:"sm:max-w-[525px]",children:[t.jsxs(Rt,{children:[t.jsx(Vt,{children:N}),t.jsx(En,{children:S})]}),t.jsx(mt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(b),children:[t.jsx("div",{className:"py-4",children:z}),t.jsxs(Rn,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>v(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function Bs(n){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:c,connectingItemId:r,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,g=s===void 0?"add":s,C=d===void 0?"connected":d,x=L(),{org:h}=ne(),p=R.useDeferredValue(u),v=u!==p;let b;e[0]!==p?(b=p.trim().toLowerCase(),e[0]=p,e[1]=b):b=e[1];const N=b;let S;e[2]!==C?(S=_=>_??C,e[2]=C,e[3]=S):S=e[3];const[k,z]=sn(on.connectionsTab(h.slug)+(C==="all"?":home-modal":":agent-modal"),S);let j;e[4]!==k||e[5]!==z?(j=_=>{_!==k&&E("connections_dialog_tab_changed",{to_tab:_}),z(_)},e[4]=k,e[5]=z,e[6]=j):j=e[6];const D=j;let A;e[7]!==h.id||e[8]!==h.slug?(A={connectionId:Nt,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=A):A=e[9];const w=ns(A),y=p?.trim().split(/\s+/).filter(Boolean)??[],P=y.length>0?{operator:"or",conditions:y.flatMap(Gs)}:void 0,I={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(I),{data:M,fetchNextPage:V,hasNextPage:Q,isFetchingNextPage:B}=ts({queryKey:Ae.collectionListInfinite(w,h.id,"","CONNECTIONS",T),queryFn:async _=>{const{pageParam:$}=_,oe=$===void 0?0:$;return(await w.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:oe}})).structuredContent},initialPageParam:0,getNextPageParam:Ks,staleTime:3e4}),se=M?.pages.flatMap(Hs)??[],q=Bn(se),de=new Set(se.filter(Us).map(Vs)),F=Ft(),ie=Lt(F,p),He=gt(ie.loadMore,ie.hasMore,ie.isLoadingMore),Ke=gt(V,Q??!1,B),G=k==="all"||!!N,rt=G?ie.items.filter(_=>{const $=$n(_);if($&&de.has($))return!1;if(!N)return!0;const oe=Ue(_._meta),ae=[_.title,_.description,_.name,_.server?.title,_.server?.description,_.server?.name,oe?.friendly_name,oe?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(W=>ae.includes(W.toLowerCase()))}):[],_e=rt.filter(Rs),Se=rt.filter(Es);let Te;e[10]!==a?(Te=_=>_.some($=>a.has($.id)),e[10]=a,e[11]=Te):Te=e[11];const qe=Te;let Pe;e[12]!==a||e[13]!==o||e[14]!==r||e[15]!==qe||e[16]!==g||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==x?(Pe=(_,$,oe,ae,W)=>{const Fe=qe(W),be=W.find(le=>!a.has(le.id)),K=W[0];if(g==="browse"){const le=Zn(K);return t.jsx(et,{connection:{title:$,icon:oe,description:W.length>1?`${W.length} instances`:ae??void 0},fallbackIcon:t.jsx(Ee,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Be,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{E("connection_browse_clicked",{app_name:K.app_name??null,connection_id:K.id,instances_count:W.length}),f?.(le)}},_)}return t.jsx(et,{connection:{title:$,icon:oe,description:ae},fallbackIcon:t.jsx(Ee,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Fe&&t.jsxs(Be,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:le=>{le.stopPropagation(),be?(E("connection_add_clicked",{action:"use_existing",app_name:K.app_name??null,connection_id:be.id}),o&&E("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:K.app_name??null,mode:"existing"}),i(be.id)):(E("connection_add_clicked",{action:"clone",app_name:K.app_name??null,base_connection_id:K.id}),l(K))},children:x("virtualMcp.connectionDialogContent.add")})]})},_)},e[12]=a,e[13]=o,e[14]=r,e[15]=qe,e[16]=g,e[17]=i,e[18]=f,e[19]=l,e[20]=x,e[21]=Pe):Pe=e[21];const Oe=Pe;let ze;e[22]!==r||e[23]!==g||e[24]!==c||e[25]!==x?(ze=_=>{const $=Ue(_._meta),oe=$?.friendlyName||$?.friendly_name||_.server?.title||_.title||_.server?.name||_.name||_.id||"",ae=_.server?.description||_.description||null,W=_.server?.icons?.[0]?.src||Fn(_.server?.repository)||null,Fe=$?.official===!0,be=$?.verified===!0,K=$?.owner==="deco";return t.jsx(et,{connection:{title:oe,description:ae,icon:W},fallbackIcon:t.jsx(Ee,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[K&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!K&&Fe&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Be,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!K&&!Fe&&be&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Be,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:le=>{le.stopPropagation(),E("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,app_name:$?.friendlyName||_.server?.name||_.name||null}),c(_)},children:r===_.id?t.jsx(Ie,{size:14,className:"animate-spin"}):x(g==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${_.id}`)},e[22]=r,e[23]=g,e[24]=c,e[25]=x,e[26]=ze):ze=e[26];const dt=ze;let ue;e[27]!==k||e[28]!==D||e[29]!==m||e[30]!==N||e[31]!==x?(ue=!N&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(es,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:k,onTabChange:_=>D(_)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{E("connections_dialog_custom_clicked"),m()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=k,e[28]=D,e[29]=m,e[30]=N,e[31]=x,e[32]=ue):ue=e[32];const Ge=v&&"opacity-50 pointer-events-none";let me;e[33]!==Ge?(me=H("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[33]=Ge,e[34]=me):me=e[34];const qt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Me;e[35]!==Oe?(Me=_=>{if(_.type==="group")return Oe(_.key,_.title,_.icon,null,_.connections);const $=_.connection;return Oe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Oe,e[36]=Me):Me=e[36];const Qe=q.map(Me);let fe;e[37]!==Ke?(fe=t.jsx("div",{ref:Ke,className:"col-span-full h-1"}),e[37]=Ke,e[38]=fe):fe=e[38];let ge;e[39]!==B?(ge=B&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=B,e[40]=ge):ge=e[40];const We=G&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(tt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Xe=G&&_e.map(dt),Ye=G&&Se.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Je=G&&Se.map(dt);let he;e[41]!==He||e[42]!==F||e[43]!==G?(he=G&&F.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=F,e[43]=G,e[44]=he):he=e[44];let pe;e[45]!==ie.isLoadingMore||e[46]!==G?(pe=G&&ie.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=ie.isLoadingMore,e[46]=G,e[47]=pe):pe=e[47];let xe;e[48]!==Qe||e[49]!==fe||e[50]!==ge||e[51]!==We||e[52]!==Xe||e[53]!==Ye||e[54]!==Je||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:qt,children:[Qe,fe,ge,We,Xe,Ye,Je,he,pe]}),e[48]=Qe,e[49]=fe,e[50]=ge,e[51]=We,e[52]=Xe,e[53]=Ye,e[54]=Je,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==k||e[59]!==q.length||e[60]!==Se||e[61]!==u||e[62]!==x||e[63]!==_e?(je=q.length===0&&_e.length===0&&Se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):x(k==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=k,e[59]=q.length,e[60]=Se,e[61]=u,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let $e;return e[69]!==ue||e[70]!==ve?($e=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=$e):$e=e[71],$e}function Es(n){return!n.verified&&!Ue(n._meta)?.verified&&!n.meta?.verified}function Rs(n){return n.verified||Ue(n._meta)?.verified||n.meta?.verified}function Vs(n){return n.app_name}function Us(n){return n.app_name}function Hs(n){return n?.items??[]}function Ks(n,e){if(n?.hasMore)return e.reduce(qs,0)}function qs(n,e){return n+(e?.items?.length??0)}function Gs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Go({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=L(),l=a.mode??"add",c="agentId"in a?a.agentId:void 0,r="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,u="onAdd"in a&&a.onAdd?a.onAdd:w=>{},m=(w,y,P)=>{c&&E("agent_connection_attached",{agent_id:c,connection_id:w,app_name:y,mode:P})},[f,d]=R.useState(null),[g,C]=R.useState(o),[x,h]=R.useState(!1),{org:p}=ne(),{data:v}=re.useSession(),b=Ut(),N=an(),S=ot(),k=w=>{e(!1),S({to:"/$org/settings/connections/$appSlug",params:{org:p.slug,appSlug:w}})},z=()=>{N.invalidateQueries({predicate:w=>{const y=w.queryKey;return y[1]===p.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},j=async(w,y)=>{E("connection_oauth_succeeded",{connection_id:w,flow:y});const P=new URL(`/api/${p.slug}/mcp/${w}`,window.location.origin);await N.invalidateQueries({queryKey:Ae.isMCPAuthenticated(P.href,null)}),z()},D=async w=>{d(w.app_name??w.id);try{const P=`${w.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,T=(await b.create.mutateAsync({title:P,description:w.description??null,connection_type:w.connection_type,connection_url:w.connection_url??null,connection_token:null,icon:w.icon??null,app_name:w.app_name??null,app_id:w.app_id??null,connection_headers:w.connection_headers??null})).id,M=await nt({connectionId:T,orgId:p.id,orgSlug:p.slug,persistFallback:V=>b.update.mutateAsync({id:T,data:{connection_token:V}}).then(()=>{})});if(M.ran&&!M.ok){E("connection_oauth_failed",{connection_id:T,flow:"clone",error:M.error??"no_token"}),U.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:M.error??"no token received"})),await b.delete.mutateAsync(T);return}M.ran&&await j(T,"clone"),m(T,w.app_name??null,"clone"),u(T)}catch(y){console.error("Failed to add connection:",y),U.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},A=async w=>{if(!(!p||!v?.user?.id)){d(w.id);try{const y=Ln(w,p.id,v.user.id,{remoteIndex:0}),P=y.connection_type==="STDIO",I=!!y.connection_url,T=P&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!I&&!T){U.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:M}=await b.create.mutateAsync(y),V=await nt({connectionId:M,orgId:p.id,orgSlug:p.slug,persistFallback:Q=>b.update.mutateAsync({id:M,data:{connection_token:Q}}).then(()=>{})});if(V.ran&&!V.ok){E("connection_oauth_failed",{connection_id:M,flow:"connect_new",error:V.error??"no_token"}),U.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:V.error??"no token received"})}),m(M,y.app_name??null,"new"),u(M);return}V.ran?(await j(M,"connect_new"),U.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):U.success(i("virtualMcp.addConnectionDialog.connected")),m(M,y.app_name??null,"new"),u(M)}catch(y){console.error("Failed to connect:",y),U.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs(Bt,{open:n,onOpenChange:e,children:[t.jsxs(Et,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Rt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Vt,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:g,onChange:C,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Bs,{mode:l,agentId:c,addedConnectionIds:r,onAdd:u,onCloneAndAdd:D,onConnectAndAdd:A,connectingItemId:f,search:g,onCreateConnection:()=>h(!0),onBrowseNavigate:k,defaultTab:s})})]}),t.jsx(Ls,{open:x,onOpenChange:h,onCreated:async w=>{h(!1);const y=await nt({connectionId:w,orgId:p.id,orgSlug:p.slug,persistFallback:P=>b.update.mutateAsync({id:w,data:{connection_token:P}}).then(()=>{})});if(y.ran&&!y.ok){E("connection_oauth_failed",{connection_id:w,flow:"custom_create",error:y.error??"no_token"}),U.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(w,null,"custom"),u(w),e(!1);return}y.ran&&await j(w,"custom_create"),m(w,null,"custom"),u(w),e(!1)}})]})}const pt=new Map;function Qo(){const{org:n}=ne(),e=ln(),s=ss(),o=s.find(h=>h.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:c}=ke({queryKey:Ae.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),r=a?.balanceCents??null,u=r!=null?r/100:null,m=R.useRef(new Map);if(r!=null){const h=pt.get(n.id);m.current.get(n.id)&&h!=null&&r>h&&E("credits_topped_up_detected",{organization_id:n.id,delta_cents:r-h,previous_balance_cents:h,new_balance_cents:r}),pt.set(n.id,r),m.current.set(n.id,!0)}const f=!!o,d=r!=null&&r>0,g=r!=null&&r===0,C=r!=null&&r===200,x=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:r,balanceDollars:u,hasCredits:d,isZeroBalance:g,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:i,isFetching:c,refetch:l}}function Wo(n){const e=O.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==a||e[5]!==i||e[6]!==l?(c=t.jsx("img",{src:gn,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=c):c=e[7],c}function Qs(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const Ws=2e4;function Xs(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Xo(){const n=O.c(19),{org:e}=ne(),s=hn.COMMERCE_DISCOVERY(e.id);let o;n[0]!==e.id||n[1]!==e.slug?(o=ht({connectionId:Nt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=o):o=n[2];const{data:a}=ke(o),i=ke({queryKey:Ae.commerceDiscoveryConnection(e.id,s),enabled:!!a,retry:!1,staleTime:6e4,queryFn:async()=>{if(!a)throw new Error("selfClient not ready");const S=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return ut(S)}}),l=i.data?.item??null,{data:c}=ke({...ht({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!l}),r=Ae.commerceDiscoveryDiagnostic(e.id,s),u=!!c;let m;n[3]!==c?(m=async()=>{if(!c)throw new Error("cdClient not ready");const S=await c.callTool({name:wt,arguments:{}});return ut(S).diagnostic??null},n[3]=c,n[4]=m):m=n[4];let f;n[5]!==r||n[6]!==u||n[7]!==m?(f={queryKey:r,enabled:u,retry:1,refetchInterval:Ys,queryFn:m},n[5]=r,n[6]=u,n[7]=m,n[8]=f):f=n[8];const d=ke(f),g=l?.metadata?.siteUrl,C=d.data??null,x=d.isSuccess,h=i.isPending||!!l&&d.isPending,p=typeof g=="string"&&g?g:null;let v;n[9]!==g?(v=Xs(g),n[9]=g,n[10]=v):v=n[10];const b=c??null;let N;return n[11]!==s||n[12]!==d.isSuccess||n[13]!==b||n[14]!==C||n[15]!==h||n[16]!==p||n[17]!==v?(N={diagnostic:C,isSuccess:x,isLoading:h,siteUrl:p,host:v,connectionId:s,cdClient:b},n[11]=s,n[12]=d.isSuccess,n[13]=b,n[14]=C,n[15]=h,n[16]=p,n[17]=v,n[18]=N):N=n[18],N}function Ys(n){return n.state.status!=="error"&&Qs(n.state.data)==="generating"?Ws:!1}function Yo(n,e){return{to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:pn(n.id),main:os(e,wt)}}}export{Ko as A,Vo as C,qo as N,Ho as O,Wo as S,Uo as a,Go as b,Xo as c,Ms as d,ms as e,ct as f,Qs as g,Yo as h,Qo as u};
1
+ import{c as O,b as L,j as t,C as Gt,av as Qt,B as te,r as R,bu as Wt,d as ot,w as Xt,n as H,a as re,t as U,y as Yt,k as Ie,a5 as xt,M as jt,q as E,_ as vt,Z as bt,Y as Jt,H as ne,f as it,u as at,a8 as Ce,a9 as ye,ab as Ne,L as Zt,G as en,aw as tn,ax as nn,R as sn,I as on,K as Ae,p as an,ac as ln,o as ke}from"./index-66BUlUCq.js";import{i as cn}from"./ChevronRight-B3-5oKsn.js";import{aK as rn,Q as dn,A as Ct,L as un,s as Ze}from"./agent-icon-Dk522vgR.js";import{t as yt}from"./ChevronDown-RrKk7H6I.js";import{a as lt,i as mn,d as fn,S as Nt,f as gn,W as hn,C as wt,g as pn}from"./constants-dLUUoWH7.js";import{u as _t,a as xn}from"./use-virtual-mcp-CE8tx9or.js";import{a as Re,b as St,P as Dt}from"./popover-B-hxuR7_.js";import{i as Ve}from"./Check-yS6TBRKx.js";import{s as we}from"./Plus-BAv6QwTj.js";import{i as kt}from"./SearchMd-BsqgJ4OR.js";import{s as It}from"./XClose-BWO2zbra.js";import{C as jn,d as ut}from"./self-tool-result-CnLvIY_a.js";import{T as At}from"./toolbar-B7xp1f_g.js";import{D as Tt,a as Pt,b as Ot,c as vn,g as bn,e as Cn,f as yn}from"./drawer-Ba-RJ-Vm.js";import{a as Nn,G as wn}from"./github-repo-picker-BqSmN9CA.js";import{g as _n,a as Sn,u as zt}from"./hooks-BQCR9h_s.js";import{u as Dn,g as kn,a as In,b as An}from"./use-navigate-to-agent-BDnGtSYT.js";import{g as Tn,a as Mt}from"./agent-capabilities-B52k7xCe.js";import{u as $t}from"./shell-layout-BAPiuVCF.js";import{f as Pn}from"./reusable-new-chat-CzvRy4Pe.js";import{d as On}from"./session-runtime-wVXsCwcJ.js";import{C as zn}from"./collection-search-Bw_HysKr.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-C4yVX3dU.js";import{u as Ft,a as Lt,g as Bn,C as et}from"./connection-card-qmGgp48y.js";import{e as Bt,d as Et,a as Rt,b as Vt,h as En,c as Rn}from"./dialog-qy0Z1aJp.js";import{d as X,a as Y,e as J,b as Z,c as ee,F as mt}from"./form-YGkaTcsZ.js";import{I as ce}from"./input-DSNlRZp-.js";import{S as Vn,a as Un,b as Hn,c as Kn,d as De}from"./select-BxxMay64.js";import{T as qn}from"./textarea-BJRhlIeX.js";import{b as Ut}from"./use-connection-lpB7Ak3D.js";import{n as Ee,i as tt}from"./Tool02-BahI2w-F.js";import{e as Gn}from"./UserSquare-BaeuOy58.js";import{c as Qn,i as Le,a as ft,E as Wn,p as Xn,b as Yn,d as Jn}from"./connection-form-helpers-CEN5IzSB.js";import{a as nt}from"./authenticate-and-persist-oauth-C4F2LaiG.js";import{g as Zn}from"./connection-slug-eyAPH6o3.js";import{C as es}from"./collection-tabs-B_gvi_U1.js";import{u as gt}from"./use-infinite-scroll--Ew0plMX.js";import{B as Be}from"./badge-BVOT5cY1.js";import{u as ts}from"./useSuspenseInfiniteQuery-DiMhuD_T.js";import{u as ns,m as ht}from"./use-mcp-client-DPpSkRNd.js";import{g as Ue}from"./metadata-dUsYcpuu.js";import{u as ss}from"./use-ai-providers-Dnx2BwXA.js";import{f as os}from"./tab-id-rV9ba-P7.js";const is="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function as(){const n=O.c(13),e=L();let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),n[0]=s):s=n[0];let o;n[1]!==e?(o=e("routes.commerceOnboarding.connectModal.quote"),n[1]=e,n[2]=o):o=n[2];let a;n[3]!==o?(a=t.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",o,"”"]}),n[3]=o,n[4]=a):a=n[4];let i;n[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("img",{src:is,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),n[5]=i):i=n[5];let l;n[6]!==e?(l=e("routes.commerceOnboarding.connectModal.quoteAuthor"),n[6]=e,n[7]=l):l=n[7];let c;n[8]!==l?(c=t.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[i,t.jsx("span",{className:"text-base font-medium",children:l})]}),n[8]=l,n[9]=c):c=n[9];let r;return n[10]!==a||n[11]!==c?(r=t.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[s,a,c]}),n[10]=a,n[11]=c,n[12]=r):r=n[12],r}function ls(){const n=O.c(19),e=L();let s;n[0]!==e?(s=e("routes.commerceOnboarding.connectModal.trustRevoke"),n[0]=e,n[1]=s):s=n[1];let o;n[2]!==s?(o={Icon:rn,label:s},n[2]=s,n[3]=o):o=n[3];let a;n[4]!==e?(a=e("routes.commerceOnboarding.connectModal.trustEncrypted"),n[4]=e,n[5]=a):a=n[5];let i;n[6]!==a?(i={Icon:Gt,label:a},n[6]=a,n[7]=i):i=n[7];let l;n[8]!==e?(l=e("routes.commerceOnboarding.connectModal.trustNeverSold"),n[8]=e,n[9]=l):l=n[9];let c;n[10]!==l?(c={Icon:dn,label:l},n[10]=l,n[11]=c):c=n[11];let r;n[12]!==o||n[13]!==i||n[14]!==c?(r=[o,i,c],n[12]=o,n[13]=i,n[14]=c,n[15]=r):r=n[15];const u=r;let m;n[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"h-px w-full bg-white/15"}),n[16]=m):m=n[16];let f;return n[17]!==u?(f=t.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[m,t.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:u.map(cs)})]}),n[17]=u,n[18]=f):f=n[18],f}function cs(n){const{Icon:e,label:s}=n;return t.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[t.jsx(e,{className:"size-4 shrink-0 opacity-85"}),s]},s)}function Vo(n){const e=O.c(22),{siteHost:s,footer:o,onClose:a,children:i}=n,l=L(),c=s?`https://www.google.com/s2/favicons?domain=${s}&sz=128`:null;let r;e[0]!==a||e[1]!==l?(r=a&&t.jsx("button",{type:"button",onClick:a,"aria-label":l("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:t.jsx(Qt,{size:18})}),e[0]=a,e[1]=l,e[2]=r):r=e[2];let u,m;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),m=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),e[3]=u,e[4]=m):(u=e[3],m=e[4]);let f;e[5]!==c||e[6]!==s?(f=s&&t.jsxs(t.Fragment,{children:[t.jsx(cn,{size:16,className:"shrink-0 text-foreground/25"}),c&&t.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:t.jsx("img",{src:c,alt:"",className:"size-full"})}),t.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:s})]}),e[5]=c,e[6]=s,e[7]=f):f=e[7];let d;e[8]!==f?(d=t.jsxs("div",{className:"flex items-center gap-2",children:[u,m,f]}),e[8]=f,e[9]=d):d=e[9];let g;e[10]!==o?(g=t.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:o}),e[10]=o,e[11]=g):g=e[11];let C;e[12]!==i||e[13]!==d||e[14]!==g?(C=t.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[d,i,g]}),e[12]=i,e[13]=d,e[14]=g,e[15]=C):C=e[15];let x,h;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),h=t.jsx("div",{className:"absolute inset-0 bg-black/20"}),e[16]=x,e[17]=h):(x=e[16],h=e[17]);let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[x,h,t.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[t.jsx("div",{className:"flex-1"}),t.jsx(as,{}),t.jsx("div",{className:"flex-1"}),t.jsx(ls,{})]})]}),e[18]=p):p=e[18];let v;return e[19]!==r||e[20]!==C?(v=t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[r,C,p]}),e[19]=r,e[20]=C,e[21]=v):v=e[21],v}function Uo(n){const e=O.c(5),{ready:s,pending:o,label:a,onClick:i,children:l}=n,c=o||!s,r=s&&!o?l:null;let u;return e[0]!==a||e[1]!==i||e[2]!==c||e[3]!==r?(u=t.jsxs(te,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:i,disabled:c,children:[a,r]}),e[0]=a,e[1]=i,e[2]=c,e[3]=r,e[4]=u):u=e[4],u}function Ht(){const n=R.useContext(Wt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(a=>a.status==="pending"&&new Date(a.expiresAt)>new Date),refetch:()=>s?.()}}function rs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function ct(n){const e=O.c(13),{org:s,size:o}=n,a=o===void 0?"sm":o,i=a==="xs"?"size-5":"size-6",l=a==="xs"?"text-[9px]":"text-xs";let c;e[0]!==i?(c=H(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==s.logo||e[3]!==s.name?(r=s.logo?void 0:rs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=r):r=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:H("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let m;return e[9]!==c||e[10]!==r||e[11]!==u?(m=t.jsx("div",{className:c,style:r,children:u}),e[9]=c,e[10]=r,e[11]=u,e[12]=m):m=e[12],m}function ds({invitation:n,onChanged:e}){const s=L(),[o,a]=R.useState(!1),i=n.organizationName??s("header.orgSwitcher.unknownOrganization"),l=async()=>{a(!0);try{const u=await re.organization.acceptInvitation({invitationId:n.id});if(u.error){U.error(u.error.message),a(!1);return}}catch{U.error(s("header.orgSwitcher.failedToAcceptInvitation")),a(!1);return}U.success(s("header.orgSwitcher.joined",{name:i})),Yt();let r;try{r=(await re.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=r?`/${r}`:"/"},c=async()=>{a(!0);try{const r=await re.organization.rejectInvitation({invitationId:n.id});if(r.error){U.error(r.error.message),a(!1);return}U.success(s("header.orgSwitcher.invitationDeclined")),a(!1),e()}catch{U.error(s("header.orgSwitcher.failedToDeclineInvitation")),a(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(ct,{org:{name:i},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:i}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(te,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:l,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:i}),children:t.jsx(It,{size:14})})]})]})}function us(n){const e=O.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:a}=n,i=L(),{data:l}=Xt(),{invitations:c,refetch:r}=Ht();let u;e[0]!==s?(u=(I,T)=>I.slug===s?-1:T.slug===s?1:I.name.localeCompare(T.name),e[0]=s,e[1]=u):u=e[1];const m=[...l??[]].sort(u),[f,d]=R.useState(""),g=f.toLowerCase(),C=g?m.filter(I=>I.name.toLowerCase().includes(g)||I.slug.toLowerCase().includes(g)):m;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(kt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=I=>d(I.target.value),e[3]=h):h=e[3];let p;e[4]!==f?(p=I=>I.key==="Escape"&&f&&d(""),e[4]=f,e[5]=p):p=e[5];let v;e[6]!==i?(v=i("header.orgSwitcher.searchOrganizations"),e[6]=i,e[7]=v):v=e[7];let b;e[8]!==f||e[9]!==p||e[10]!==v?(b=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:f,onChange:h,onKeyDown:p,placeholder:v,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=f,e[9]=p,e[10]=v,e[11]=b):b=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(we,{size:16}),e[12]=N):N=e[12];let S;e[13]!==a?(S=t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:N}),e[13]=a,e[14]=S):S=e[14];let k;e[15]!==b||e[16]!==S?(k=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,b,S]}),e[15]=b,e[16]=S,e[17]=k):k=e[17];const z="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let j;e[18]!==c||e[19]!==f||e[20]!==r?(j=!f&&c.map(I=>t.jsx(ds,{invitation:I,onChanged:r},I.id)),e[18]=c,e[19]=f,e[20]=r,e[21]=j):j=e[21];const D=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:f?i("header.orgSwitcher.noOrganizationsMatch",{query:f}):i("header.orgSwitcher.noOrganizationsAvailable")});let A;e[22]!==o||e[23]!==s?(A=I=>t.jsxs("button",{type:"button",onClick:()=>o(I.slug),className:H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",I.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(ct,{org:I,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.slug})]}),I.slug===s&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},I.id),e[22]=o,e[23]=s,e[24]=A):A=e[24];const w=C.map(A);let y;e[25]!==j||e[26]!==D||e[27]!==w?(y=t.jsxs("div",{className:z,children:[j,D,w]}),e[25]=j,e[26]=D,e[27]=w,e[28]=y):y=e[28];let P;return e[29]!==y||e[30]!==k?(P=t.jsxs(t.Fragment,{children:[k,y]}),e[29]=y,e[30]=k,e[31]=P):P=e[31],P}function ms(n){const e=O.c(22),{trigger:s,orgParam:o,align:a,side:i}=n,l=a===void 0?"start":a,c=i===void 0?"bottom":i,r=ot(),[u,m]=R.useState(!1),[f,d]=R.useState(!1);let g;e[0]!==s?(g=t.jsx(Re,{asChild:!0,children:s}),e[0]=s,e[1]=g):g=e[1];const C=String(u);let x;e[2]!==r?(x=k=>{m(!1),r({to:"/$org",params:{org:k}})},e[2]=r,e[3]=x):x=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{m(!1),d(!0)},e[4]=h):h=e[4];let p;e[5]!==o||e[6]!==C||e[7]!==x?(p=t.jsx(us,{orgParam:o,onSelectOrg:x,onCreateOrg:h},C),e[5]=o,e[6]=C,e[7]=x,e[8]=p):p=e[8];let v;e[9]!==l||e[10]!==c||e[11]!==p?(v=t.jsx(St,{side:c,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:gs,onCloseAutoFocus:fs,children:p}),e[9]=l,e[10]=c,e[11]=p,e[12]=v):v=e[12];let b;e[13]!==u||e[14]!==g||e[15]!==v?(b=t.jsxs(Dt,{open:u,onOpenChange:m,children:[g,v]}),e[13]=u,e[14]=g,e[15]=v,e[16]=b):b=e[16];let N;e[17]!==f?(N=t.jsx(jn,{open:f,onOpenChange:d}),e[17]=f,e[18]=N):N=e[18];let S;return e[19]!==N||e[20]!==b?(S=t.jsxs(t.Fragment,{children:[b,N]}),e[19]=N,e[20]=b,e[21]=S):S=e[21],S}function fs(n){return n.preventDefault()}function gs(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function hs(n){const e=O.c(21),{value:s,onChange:o,placeholder:a,onKeyDown:i,className:l,isSearching:c,disabled:r}=n,u=a===void 0?"Search...":a;let m;e[0]!==l?(m=H("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const f=r?"cursor-not-allowed opacity-50":"cursor-text";let d;e[2]!==f?(d=H("flex items-center gap-2.5 h-12 px-4",f),e[2]=f,e[3]=d):d=e[3];let g;e[4]!==c?(g=c?t.jsx(Ie,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(kt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=g):g=e[5];let C;e[6]!==o?(C=v=>o(v.target.value),e[6]=o,e[7]=C):C=e[7];let x;e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:i,placeholder:u,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=r,e[9]=i,e[10]=u,e[11]=C,e[12]=s,e[13]=x):x=e[13];let h;e[14]!==d||e[15]!==g||e[16]!==x?(h=t.jsxs("label",{className:d,children:[g,x]}),e[14]=d,e[15]=g,e[16]=x,e[17]=h):h=e[17];let p;return e[18]!==m||e[19]!==h?(p=t.jsx("div",{className:m,children:h}),e[18]=m,e[19]=h,e[20]=p):p=e[20],p}function ps(n,e,s){if(!s)return null;const o=_n(n,e);return o?o.threads.get().find(i=>i.id===s)?.branch??null:null}function xs(n){const e=O.c(6),{value:s,onChange:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.searchAgents"),e[0]=a,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==i||e[4]!==s?(l=t.jsx(hs,{value:s,onChange:o,placeholder:i}),e[2]=o,e[3]=i,e[4]=s,e[5]=l):l=e[5],l}function js(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function vs(n){const e=O.c(10),{org:s,onClose:o}=n,a=L();let i;e[0]!==s.slug?(i={org:s.slug},e[0]=s.slug,e[1]=i):i=e[1];let l;e[2]!==o?(l=()=>o(),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==a?(c=a("sidebar.agentsSection.seeAllAgents"),e[4]=a,e[5]=c):c=e[5];let r;return e[6]!==i||e[7]!==l||e[8]!==c?(r=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Zt,{to:"/$org/settings/agents",params:i,onClick:l,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=i,e[7]=l,e[8]=c,e[9]=r):r=e[9],r}function bs(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Kt,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function Cs(n){const e=O.c(11),{onImportFromGithub:s}=n,o=L();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(wn,{className:"size-3.5"}),e[0]=a):a=e[0];let i;e[1]!==o?(i=o("sidebar.agentsSection.import"),e[1]=o,e[2]=i):i=e[2];let l;e[3]!==s||e[4]!==i?(l=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[a,i]}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let c;e[6]!==o?(c=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=c):c=e[7];let r;return e[8]!==l||e[9]!==c?(r=t.jsx(Kt,{action:l,children:c}),e[8]=l,e[9]=c,e[10]=r):r=e[10],r}function ys(n){const e=O.c(11),{setOpen:s,emptyCtaClass:o}=n,a=L();let i;e[0]!==a?(i=a("sidebar.agentsSection.browseAgents"),e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H(o),e[2]=o,e[3]=l):l=e[3];let c;e[4]!==s?(c=()=>{E("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{className:"size-4"}),e[6]=r):r=e[6];let u;return e[7]!==i||e[8]!==l||e[9]!==c?(u=t.jsx(At,{"aria-label":i,className:l,onClick:c,children:r}),e[7]=i,e[8]=l,e[9]=c,e[10]=u):u=e[10],u}function Ns(n){const e=O.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=H(a),e[3]=a,e[4]=c):c=e[4];let r;e[5]!==s?(r=()=>{E("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=r):r=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(we,{}),e[7]=u):u=e[7];let m;e[8]!==i?(m=i("sidebar.agentsSection.newAgent"),e[8]=i,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx("span",{children:m}),e[10]=m,e[11]=f):f=e[11];let d;return e[12]!==l||e[13]!==c||e[14]!==r||e[15]!==f?(d=t.jsx(vt,{children:t.jsxs(bt,{tooltip:l,className:c,onClick:r,children:[u,f]})}),e[12]=l,e[13]=c,e[14]=r,e[15]=f,e[16]=d):d=e[16],d}function ws(){const n=O.c(4),e=L();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Ot,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function _s(n){const e=O.c(8),{emptyCtaClass:s}=n,o=L();let a;e[0]!==o?(a=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a):a=e[1];let i;e[2]!==s?(i=H(s),e[2]=s,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(we,{className:"size-4"}),e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==i?(c=t.jsx(At,{"aria-label":a,className:i,children:l}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}function Ss(n){const e=O.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:a}=n,i=L();let l;e[0]!==o||e[1]!==i?(l=o?void 0:i("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let c;e[3]!==a?(c=H(a),e[3]=a,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{}),e[5]=r):r=e[5];let u;e[6]!==i?(u=i("sidebar.agentsSection.newAgent"),e[6]=i,e[7]=u):u=e[7];let m;e[8]!==u?(m=t.jsx("span",{children:u}),e[8]=u,e[9]=m):m=e[9];let f;e[10]!==l||e[11]!==c||e[12]!==m?(f=t.jsx(Re,{asChild:!0,children:t.jsxs(bt,{tooltip:l,className:c,children:[r,m]})}),e[10]=l,e[11]=c,e[12]=m,e[13]=f):f=e[13];let d;e[14]!==f||e[15]!==s?(d=s(f),e[14]=f,e[15]=s,e[16]=d):d=e[16];let g;return e[17]!==d?(g=t.jsx(vt,{children:d}),e[17]=d,e[18]=g):g=e[18],g}function Ds(n){const e=O.c(9),{children:s}=n,o=L();let a;e[0]!==s?(a=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==o?(i=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==i?(l=t.jsx(ye,{side:"right",sideOffset:8,children:i}),e[4]=i,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=t.jsxs(Ne,{defaultOpen:!0,delayDuration:0,children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function ks(n){const e=ot(),{create:s}=Sn(),{locator:o}=ne(),a=it({strict:!1}),i=at({strict:!1});return async l=>{const c=crypto.randomUUID(),r=l===i.virtualmcpid?ps(n,o,a.taskId??""):null;try{await s({id:c,virtual_mcp_id:l,...r?{branch:r}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:c},search:{virtualmcpid:l}})}}function st(n){const e=O.c(20),{agent:s,selected:o,onClick:a}=n,i=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==i?(l=H("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(Ct,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let r;e[5]!==s.title?(r=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=r):r=e[6];let u;e[7]!==s.description?(u=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=u):u=e[8];let m;e[9]!==r||e[10]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,u]}),e[9]=r,e[10]=u,e[11]=m):m=e[11];let f;e[12]!==o?(f=o&&t.jsx(Ve,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=f):f=e[13];let d;return e[14]!==a||e[15]!==l||e[16]!==c||e[17]!==m||e[18]!==f?(d=t.jsxs("button",{type:"button",onClick:a,className:l,children:[c,m,f]}),e[14]=a,e[15]=l,e[16]=c,e[17]=m,e[18]=f,e[19]=d):d=e[19],d}function Kt(n){const e=O.c(5),{children:s,action:o}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=a):a=e[1];let i;return e[2]!==o||e[3]!==a?(i=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[a,o]}),e[2]=o,e[3]=a,e[4]=i):i=e[4],i}function Is(n){const e=O.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:a,onImportFromGithub:i}=n,[l,c]=R.useState(""),r=_t(),u=r??[],{org:m}=ne(),{data:f}=re.useSession(),d=f?.user?.id??"anon",g=kn(r),C=In(),x=ks(m.slug),h=Tn(r),p=l.toLowerCase(),v=u.filter(Os).filter(F=>!h.has(F.id)).filter(Ps).filter(F=>!l||F.title.toLowerCase().includes(p)),b=v.filter(Ts),N=v.filter(As),S=lt(m.id),k=!l||S.title.toLowerCase().includes(p),z=!!(o&&k);let j;e[0]!==s||e[1]!==o?(j=()=>{o?.(null),s(),c("")},e[0]=s,e[1]=o,e[2]=j):j=e[2];const D=j,A=F=>{if(o){o(F.id),s(),c("");return}An({orgId:m.id,userId:d},F.id,g),C(),s(),c(""),x(F.id)},w="flex flex-col max-h-[min(640px,80dvh)]";let y;e[3]!==l?(y=t.jsx(xs,{value:l,onChange:c}),e[3]=l,e[4]=y):y=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",I=o&&k&&S&&t.jsx(st,{agent:S,selected:!a||a===S.id,onClick:D}),T=(b.length>0||!l)&&t.jsx(Cs,{onImportFromGithub:i}),M=b.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>A(F)},F.id)),V=N.length>0&&t.jsx(bs,{}),Q=N.map(F=>t.jsx(st,{agent:F,selected:o?a===F.id:void 0,onClick:()=>A(F)},F.id));let B;e[5]!==z||e[6]!==l||e[7]!==v.length?(B=v.length===0&&!z&&l&&t.jsx(js,{}),e[5]=z,e[6]=l,e[7]=v.length,e[8]=B):B=e[8];let se;e[9]!==B||e[10]!==I||e[11]!==T||e[12]!==M||e[13]!==V||e[14]!==Q?(se=t.jsxs("div",{className:P,children:[I,T,M,V,Q,B]}),e[9]=B,e[10]=I,e[11]=T,e[12]=M,e[13]=V,e[14]=Q,e[15]=se):se=e[15];let q;e[16]!==s||e[17]!==m?(q=t.jsx(vs,{org:m,onClose:s}),e[16]=s,e[17]=m,e[18]=q):q=e[18];let de;return e[19]!==se||e[20]!==q||e[21]!==y?(de=t.jsxs("div",{className:w,children:[y,se,q]}),e[19]=se,e[20]=q,e[21]=y,e[22]=de):de=e[22],de}function As(n){return!Mt(n.metadata)}function Ts(n){return Mt(n.metadata)}function Ps(n){return!fn(n.id)}function Os(n){return!mn(n.id)}function zs(n){const e=O.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:a,onSelectAgent:i,selectedAgentId:l,side:c,align:r}=s,u=o===void 0?!1:o,m=c===void 0?"right":c,f=r===void 0?"start":r,[d,g]=R.useState(!1),[C,x]=R.useState(!1),h=xt(),{setOpenMobile:p}=jt(),v=Dn(),b=v?"border border-border":void 0;let N;e[2]!==v?(N=T=>v?t.jsx(Ds,{children:T}):T,e[2]=v,e[3]=N):N=e[3];const S=N;let k;e[4]!==h||e[5]!==p?(k=()=>{g(!1),h&&p(!1)},e[4]=h,e[5]=p,e[6]=k):k=e[6];const z=k;let j;e[7]!==z?(j=()=>{z(),x(!0)},e[7]=z,e[8]=j):j=e[8];const D=j;let A;e[9]!==z||e[10]!==D||e[11]!==i||e[12]!==d||e[13]!==l?(A=d&&t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Jt,{className:"h-4 w-24"})}),children:t.jsx(Is,{onClose:z,onSelectAgent:i,selectedAgentId:l,onImportFromGithub:D})}),e[9]=z,e[10]=D,e[11]=i,e[12]=d,e[13]=l,e[14]=A):A=e[14];const w=A;let y;e[15]!==f||e[16]!==u||e[17]!==b||e[18]!==v||e[19]!==h||e[20]!==d||e[21]!==w||e[22]!==m||e[23]!==a||e[24]!==S?(y=h?t.jsxs(t.Fragment,{children:[a?t.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:a}):u?S(t.jsx(ys,{setOpen:g,emptyCtaClass:b})):t.jsx(Ns,{setOpen:g,highlightEmpty:v,emptyCtaClass:b}),t.jsx(Tt,{open:d,onOpenChange:g,direction:"bottom",children:t.jsxs(Pt,{className:"max-h-[85dvh] p-0",children:[t.jsx(ws,{}),w]})})]}):t.jsxs(Dt,{open:d,onOpenChange:T=>{T&&!d&&E("agent_browser_opened",{surface:"desktop_popover"}),g(T)},children:[a?t.jsx(Re,{asChild:!0,children:a}):u?S(t.jsx(Re,{asChild:!0,children:t.jsx(_s,{emptyCtaClass:b})})):t.jsx(Ss,{wrapEmptyHint:S,highlightEmpty:v,emptyCtaClass:b}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:m,align:f,children:w})]}),e[15]=f,e[16]=u,e[17]=b,e[18]=v,e[19]=h,e[20]=d,e[21]=w,e[22]=m,e[23]=a,e[24]=S,e[25]=y):y=e[25];let P;e[26]!==C?(P=t.jsx(Nn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let I;return e[28]!==P||e[29]!==y?(I=t.jsxs(t.Fragment,{children:[y,P]}),e[28]=P,e[29]=y,e[30]=I):I=e[30],I}function Ms(){const n=O.c(2),e=_t()??[];let s;return n[0]!==e?(s=o=>{if(!o)return;const a=e.find(i=>i.id===o);return a?On(a.metadata):void 0},n[0]=e,n[1]=s):s=n[1],s}const $s="inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Fs(n){const e=O.c(29),{agentId:s,fallback:o,onOpenHome:a,onPick:i}=n,l=L(),c=xn(s)??o??null;let r,u,m,f,d;e[0]!==c?.title||e[1]!==a||e[2]!==l?(d=c?.title??l("header.shellBreadcrumb.superAgentDefaultName"),f="flex min-w-0 items-center gap-0",r="button",u=a,m=l("header.shellBreadcrumb.openAgentHome",{name:d}),e[0]=c?.title,e[1]=a,e[2]=l,e[3]=r,e[4]=u,e[5]=m,e[6]=f,e[7]=d):(r=e[3],u=e[4],m=e[5],f=e[6],d=e[7]);const g=c?.icon??null;let C;e[8]!==g||e[9]!==d?(C=t.jsx(Ct,{icon:g,name:d,size:"xs"}),e[8]=g,e[9]=d,e[10]=C):C=e[10];let x;e[11]!==r||e[12]!==u||e[13]!==m||e[14]!==C?(x=t.jsx("button",{type:r,onClick:u,"aria-label":m,className:"flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:C}),e[11]=r,e[12]=u,e[13]=m,e[14]=C,e[15]=x):x=e[15];let h;e[16]!==d?(h=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:d}),e[16]=d,e[17]=h):h=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(yt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=p):p=e[18];let v;e[19]!==h?(v=t.jsxs("button",{type:"button",className:$s,children:[h,p]}),e[19]=h,e[20]=v):v=e[20];let b;e[21]!==s||e[22]!==i||e[23]!==v?(b=t.jsx(zs,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:i,trigger:v}),e[21]=s,e[22]=i,e[23]=v,e[24]=b):b=e[24];let N;return e[25]!==b||e[26]!==f||e[27]!==x?(N=t.jsxs("div",{className:f,children:[x,b]}),e[25]=b,e[26]=f,e[27]=x,e[28]=N):N=e[28],N}function Ho(n){const e=O.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,a=L(),{org:i}=ne(),{state:l,isMobile:c}=jt(),r=Ht().invitations.length>0,u=l==="collapsed"||c;let m;e[2]!==r||e[3]!==i.name||e[4]!==a?(m=r?a("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:i.name}):a("header.shellBreadcrumb.switchOrganization",{name:i.name}),e[2]=r,e[3]=i.name,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==i?(f=t.jsx(ct,{org:i,size:"sm"}),e[6]=i,e[7]=f):f=e[7];let d;e[8]!==r||e[9]!==u?(d=r&&t.jsx("span",{className:H("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",u?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=r,e[9]=u,e[10]=d):d=e[10];let g;e[11]!==f||e[12]!==d?(g=t.jsxs("span",{className:"relative inline-flex",children:[f,d]}),e[11]=f,e[12]=d,e[13]=g):g=e[13];let C;e[14]!==i.name||e[15]!==o?(C=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:i.name}),e[14]=i.name,e[15]=o,e[16]=C):C=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(yt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=x):x=e[17];let h;e[18]!==m||e[19]!==g||e[20]!==C?(h=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[g,C,x]})}),e[18]=m,e[19]=g,e[20]=C,e[21]=h):h=e[21];let p;e[22]!==i.slug||e[23]!==h?(p=t.jsx(ms,{orgParam:i.slug,trigger:h}),e[22]=i.slug,e[23]=h,e[24]=p):p=e[24];let v;e[25]!==i.name?(v=t.jsx(ye,{side:"bottom",children:i.name}),e[25]=i.name,e[26]=v):v=e[26];let b;return e[27]!==v||e[28]!==p?(b=t.jsxs(Ne,{children:[p,v]}),e[27]=v,e[28]=p,e[29]=b):b=e[29],b}function Ko(n){const e=O.c(23);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:a}=ne();let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[2]=i):i=e[2];const l=it(i);let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[3]=c):c=e[3];const r=at(c),{threads:u}=zt(),{data:m}=re.useSession(),{setTaskId:f,createNewTask:d}=$t(),g=Ms();let C;e[4]!==a.id?(C=lt(a.id),e[4]=a.id,e[5]=C):C=e[5];const x=C,h=x.id,p=l.taskId?r.virtualmcpid??h:h;let v;e[6]!==d||e[7]!==h||e[8]!==o||e[9]!==g||e[10]!==m?.user?.id||e[11]!==f||e[12]!==u?(v=j=>{const D=j??h,A=Pn(u,D,m?.user?.id,g(D));A?f(A.id,D):d(D),o?.()},e[6]=d,e[7]=h,e[8]=o,e[9]=g,e[10]=m?.user?.id,e[11]=f,e[12]=u,e[13]=v):v=e[13];const b=v;let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[14]=N):N=e[14];const S=p===h?x:void 0;let k;e[15]!==p||e[16]!==b?(k=()=>b(p),e[15]=p,e[16]=b,e[17]=k):k=e[17];let z;return e[18]!==p||e[19]!==b||e[20]!==S||e[21]!==k?(z=t.jsx(R.Suspense,{fallback:N,children:t.jsx(Fs,{agentId:p,fallback:S,onOpenHome:k,onPick:b})}),e[18]=p,e[19]=b,e[20]=S,e[21]=k,e[22]=z):z=e[22],z}function qo(){const n=O.c(24),e=L(),{org:s}=ne();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[0]=o):o=n[0];const a=it(o);let i;n[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[1]=i):i=n[1];const l=at(i),{threads:c}=zt(),{createNewTask:r}=$t();let u;n[2]!==s.id?(u=lt(s.id),n[2]=s.id,n[3]=u):u=n[3];const m=u.id,f=a.taskId?l.virtualmcpid??m:m;let d;n[4]!==a.taskId||n[5]!==c?(d=(a.taskId?c.find(k=>k.id===a.taskId)?.branch:null)??null,n[4]=a.taskId,n[5]=c,n[6]=d):d=n[6];const g=d;let C;n[7]!==f||n[8]!==r||n[9]!==g?(C=()=>{r(f,g)},n[7]=f,n[8]=r,n[9]=g,n[10]=C):C=n[10];const x=C;let h;n[11]!==e?(h=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=h):h=n[12];let p;n[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(un,{size:16}),n[13]=p):p=n[13];let v;n[14]!==x||n[15]!==h?(v=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":h,className:"flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p})}),n[14]=x,n[15]=h,n[16]=v):v=n[16];let b;n[17]!==e?(b=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=b):b=n[18];let N;n[19]!==b?(N=t.jsx(ye,{side:"bottom",children:b}),n[19]=b,n[20]=N):N=n[20];let S;return n[21]!==v||n[22]!==N?(S=t.jsxs(Ne,{children:[v,N]}),n[21]=v,n[22]=N,n[23]=S):S=n[23],S}function Ls({open:n,onOpenChange:e,onCreated:s}){const o=L(),{org:a}=ne(),{data:i}=re.useSession(),{stdioEnabled:l}=en(),c=xt(),r=Ut(),u=Ft(),f=Lt(u,"").items,d=tn({resolver:nn(Qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),g=d.watch("ui_type"),C=d.watch("connection_url"),x=d.watch("npx_package"),h=Le({uiType:g,connectionUrl:C??"",npxPackage:x??""})??ft({uiType:g,connectionUrl:C??"",registryItems:f}),p=j=>{const D=j.trim();if(!D)return;const A=!!d.formState.dirtyFields.title,w=!!d.formState.dirtyFields.description,y=!!d.formState.dirtyFields.env_vars,P=T=>{if(T&&(!A&&!d.getValues("title").trim()&&T.title&&d.setValue("title",T.title,{shouldDirty:!1}),!w&&!(d.getValues("description")??"").trim()&&T.description&&d.setValue("description",T.description,{shouldDirty:!1}),!y&&T.envVarKeys?.length)){const M=d.getValues("env_vars")??[],V=new Set(M.map(B=>B.key)),Q=T.envVarKeys.filter(B=>!V.has(B));Q.length>0&&d.setValue("env_vars",[...M,...Q.map(B=>({key:B,value:""}))],{shouldDirty:!0})}},I=Xn(D);if(I&&l){d.setValue("ui_type","NPX",{shouldDirty:!0}),d.setValue("npx_package",I.packageName,{shouldDirty:!0}),d.setValue("connection_url","",{shouldDirty:!0}),d.setValue("connection_token",null,{shouldDirty:!0}),P(Le({uiType:"NPX",npxPackage:I.packageName}));return}if(D.startsWith("http://")||D.startsWith("https://")){const T=g==="HTTP"||g==="SSE"||g==="Websocket"?g:"HTTP";d.setValue("ui_type",T,{shouldDirty:!0}),d.setValue("connection_url",D,{shouldDirty:!0}),P(Le({uiType:T,connectionUrl:D})??ft({uiType:T,connectionUrl:D,registryItems:f}));return}g==="NPX"&&P(Le({uiType:"NPX",npxPackage:D}))},v=j=>{j||d.reset(),e(j)},b=async j=>{let D,A=null,w=null,y=null;j.ui_type==="NPX"?(D="STDIO",A="",y=Yn(j.npx_package||"",j.env_vars||[])):j.ui_type==="STDIO"?(D="STDIO",A="",y=Jn(j.stdio_command||"",j.stdio_args||"",j.stdio_cwd,j.env_vars||[])):(D=j.ui_type,A=j.connection_url||"",w=j.connection_token||null);const P=Mn("conn");try{await r.create.mutateAsync({id:P,title:j.title,description:j.description||null,connection_type:D,connection_url:A,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:i?.user?.id||"system",organization_id:a.id,icon:j.icon??null,app_name:null,app_id:null,connection_headers:y,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),d.reset(),e(!1),s?.(P)}catch{U.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},N=o("connections.createConnectionDialog.title"),S=o("connections.createConnectionDialog.description"),k=d.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(X,{control:d.control,name:"ui_type",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(Vn,{value:j.value,onValueChange:j.onChange,children:[t.jsx(Z,{children:t.jsx(Un,{children:t.jsx(Hn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),g==="NPX"&&t.jsx(X,{control:d.control,name:"npx_package",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...j,value:j.value??"",onPaste:D=>{const A=D.clipboardData.getData("text");A&&(D.preventDefault(),d.setValue("npx_package",A.trim(),{shouldDirty:!0}),p(A))},onBlur:D=>{p(D.target.value),j.onBlur()}})}),t.jsx(ee,{})]})}),g==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(X,{control:d.control,name:"stdio_command",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...j,value:j.value??""})}),t.jsx(ee,{})]})}),t.jsx(X,{control:d.control,name:"stdio_args",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...j,value:j.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(X,{control:d.control,name:"stdio_cwd",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...j,value:j.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(g==="NPX"||g==="STDIO")&&t.jsx(X,{control:d.control,name:"env_vars",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Wn,{value:j.value??[],onChange:j.onChange})}),t.jsx(ee,{})]})}),g!=="NPX"&&g!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(X,{control:d.control,name:"connection_url",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...j,value:j.value??"",onPaste:D=>{const A=D.clipboardData.getData("text");A&&(D.preventDefault(),d.setValue("connection_url",A.trim(),{shouldDirty:!0}),p(A))},onBlur:D=>{p(D.target.value),j.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(X,{control:d.control,name:"connection_token",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:h?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ce,{type:"password",placeholder:h?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...j,value:j.value??""})}),h?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.token.helperText,h.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(X,{control:d.control,name:"title",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ce,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...j})}),t.jsx(ee,{})]})}),t.jsx(X,{control:d.control,name:"description",render:({field:j})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(qn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...j,value:j.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(Tt,{open:n,onOpenChange:v,children:t.jsxs(Pt,{className:"max-h-[90vh]",children:[t.jsx(vn,{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(Ot,{children:N}),t.jsx(bn,{className:"mt-1",children:S})]}),t.jsx(Cn,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(It,{size:16})})})]})}),t.jsx(mt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(b),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:z}),t.jsx(yn,{children:t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"w-full",children:k})})]})})]})}):t.jsx(Bt,{open:n,onOpenChange:v,children:t.jsxs(Et,{className:"sm:max-w-[525px]",children:[t.jsxs(Rt,{children:[t.jsx(Vt,{children:N}),t.jsx(En,{children:S})]}),t.jsx(mt,{...d,children:t.jsxs("form",{onSubmit:d.handleSubmit(b),children:[t.jsx("div",{className:"py-4",children:z}),t.jsxs(Rn,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:()=>v(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(te,{type:"submit",disabled:d.formState.isSubmitting,className:"min-w-40",children:k})]})]})})]})})}function Bs(n){const e=O.c(72),{mode:s,agentId:o,addedConnectionIds:a,onAdd:i,onCloneAndAdd:l,onConnectAndAdd:c,connectingItemId:r,search:u,onCreateConnection:m,onBrowseNavigate:f,defaultTab:d}=n,g=s===void 0?"add":s,C=d===void 0?"connected":d,x=L(),{org:h}=ne(),p=R.useDeferredValue(u),v=u!==p;let b;e[0]!==p?(b=p.trim().toLowerCase(),e[0]=p,e[1]=b):b=e[1];const N=b;let S;e[2]!==C?(S=_=>_??C,e[2]=C,e[3]=S):S=e[3];const[k,z]=sn(on.connectionsTab(h.slug)+(C==="all"?":home-modal":":agent-modal"),S);let j;e[4]!==k||e[5]!==z?(j=_=>{_!==k&&E("connections_dialog_tab_changed",{to_tab:_}),z(_)},e[4]=k,e[5]=z,e[6]=j):j=e[6];const D=j;let A;e[7]!==h.id||e[8]!==h.slug?(A={connectionId:Nt,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=A):A=e[9];const w=ns(A),y=p?.trim().split(/\s+/).filter(Boolean)??[],P=y.length>0?{operator:"or",conditions:y.flatMap(Gs)}:void 0,I={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},T=JSON.stringify(I),{data:M,fetchNextPage:V,hasNextPage:Q,isFetchingNextPage:B}=ts({queryKey:Ae.collectionListInfinite(w,h.id,"","CONNECTIONS",T),queryFn:async _=>{const{pageParam:$}=_,oe=$===void 0?0:$;return(await w.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:oe}})).structuredContent},initialPageParam:0,getNextPageParam:Ks,staleTime:3e4}),se=M?.pages.flatMap(Hs)??[],q=Bn(se),de=new Set(se.filter(Us).map(Vs)),F=Ft(),ie=Lt(F,p),He=gt(ie.loadMore,ie.hasMore,ie.isLoadingMore),Ke=gt(V,Q??!1,B),G=k==="all"||!!N,rt=G?ie.items.filter(_=>{const $=$n(_);if($&&de.has($))return!1;if(!N)return!0;const oe=Ue(_._meta),ae=[_.title,_.description,_.name,_.server?.title,_.server?.description,_.server?.name,oe?.friendly_name,oe?.friendlyName].filter(Boolean).join(" ").toLowerCase();return y.some(W=>ae.includes(W.toLowerCase()))}):[],_e=rt.filter(Rs),Se=rt.filter(Es);let Te;e[10]!==a?(Te=_=>_.some($=>a.has($.id)),e[10]=a,e[11]=Te):Te=e[11];const qe=Te;let Pe;e[12]!==a||e[13]!==o||e[14]!==r||e[15]!==qe||e[16]!==g||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==x?(Pe=(_,$,oe,ae,W)=>{const Fe=qe(W),be=W.find(le=>!a.has(le.id)),K=W[0];if(g==="browse"){const le=Zn(K);return t.jsx(et,{connection:{title:$,icon:oe,description:W.length>1?`${W.length} instances`:ae??void 0},fallbackIcon:t.jsx(Ee,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Be,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{E("connection_browse_clicked",{app_name:K.app_name??null,connection_id:K.id,instances_count:W.length}),f?.(le)}},_)}return t.jsx(et,{connection:{title:$,icon:oe,description:ae},fallbackIcon:t.jsx(Ee,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Fe&&t.jsxs(Be,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ve,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:le=>{le.stopPropagation(),be?(E("connection_add_clicked",{action:"use_existing",app_name:K.app_name??null,connection_id:be.id}),o&&E("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:K.app_name??null,mode:"existing"}),i(be.id)):(E("connection_add_clicked",{action:"clone",app_name:K.app_name??null,base_connection_id:K.id}),l(K))},children:x("virtualMcp.connectionDialogContent.add")})]})},_)},e[12]=a,e[13]=o,e[14]=r,e[15]=qe,e[16]=g,e[17]=i,e[18]=f,e[19]=l,e[20]=x,e[21]=Pe):Pe=e[21];const Oe=Pe;let ze;e[22]!==r||e[23]!==g||e[24]!==c||e[25]!==x?(ze=_=>{const $=Ue(_._meta),oe=$?.friendlyName||$?.friendly_name||_.server?.title||_.title||_.server?.name||_.name||_.id||"",ae=_.server?.description||_.description||null,W=_.server?.icons?.[0]?.src||Fn(_.server?.repository)||null,Fe=$?.official===!0,be=$?.verified===!0,K=$?.owner==="deco";return t.jsx(et,{connection:{title:oe,description:ae,icon:W},fallbackIcon:t.jsx(Ee,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[K&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!K&&Fe&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Be,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!K&&!Fe&&be&&t.jsxs(Ne,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Be,{variant:"outline",size:"icon",children:t.jsx(tt,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:r!==null,onClick:le=>{le.stopPropagation(),E("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,app_name:$?.friendlyName||_.server?.name||_.name||null}),c(_)},children:r===_.id?t.jsx(Ie,{size:14,className:"animate-spin"}):x(g==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${_.id}`)},e[22]=r,e[23]=g,e[24]=c,e[25]=x,e[26]=ze):ze=e[26];const dt=ze;let ue;e[27]!==k||e[28]!==D||e[29]!==m||e[30]!==N||e[31]!==x?(ue=!N&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(es,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:k,onTabChange:_=>D(_)}),t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{E("connections_dialog_custom_clicked"),m()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=k,e[28]=D,e[29]=m,e[30]=N,e[31]=x,e[32]=ue):ue=e[32];const Ge=v&&"opacity-50 pointer-events-none";let me;e[33]!==Ge?(me=H("flex-1 overflow-auto p-5 transition-opacity duration-150",Ge),e[33]=Ge,e[34]=me):me=e[34];const qt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Me;e[35]!==Oe?(Me=_=>{if(_.type==="group")return Oe(_.key,_.title,_.icon,null,_.connections);const $=_.connection;return Oe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Oe,e[36]=Me):Me=e[36];const Qe=q.map(Me);let fe;e[37]!==Ke?(fe=t.jsx("div",{ref:Ke,className:"col-span-full h-1"}),e[37]=Ke,e[38]=fe):fe=e[38];let ge;e[39]!==B?(ge=B&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=B,e[40]=ge):ge=e[40];const We=G&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(tt,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Xe=G&&_e.map(dt),Ye=G&&Se.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Je=G&&Se.map(dt);let he;e[41]!==He||e[42]!==F||e[43]!==G?(he=G&&F.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=F,e[43]=G,e[44]=he):he=e[44];let pe;e[45]!==ie.isLoadingMore||e[46]!==G?(pe=G&&ie.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=ie.isLoadingMore,e[46]=G,e[47]=pe):pe=e[47];let xe;e[48]!==Qe||e[49]!==fe||e[50]!==ge||e[51]!==We||e[52]!==Xe||e[53]!==Ye||e[54]!==Je||e[55]!==he||e[56]!==pe?(xe=t.jsxs("div",{className:qt,children:[Qe,fe,ge,We,Xe,Ye,Je,he,pe]}),e[48]=Qe,e[49]=fe,e[50]=ge,e[51]=We,e[52]=Xe,e[53]=Ye,e[54]=Je,e[55]=he,e[56]=pe,e[57]=xe):xe=e[57];let je;e[58]!==k||e[59]!==q.length||e[60]!==Se||e[61]!==u||e[62]!==x||e[63]!==_e?(je=q.length===0&&_e.length===0&&Se.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:u?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:u}):x(k==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=k,e[59]=q.length,e[60]=Se,e[61]=u,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let $e;return e[69]!==ue||e[70]!==ve?($e=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=$e):$e=e[71],$e}function Es(n){return!n.verified&&!Ue(n._meta)?.verified&&!n.meta?.verified}function Rs(n){return n.verified||Ue(n._meta)?.verified||n.meta?.verified}function Vs(n){return n.app_name}function Us(n){return n.app_name}function Hs(n){return n?.items??[]}function Ks(n,e){if(n?.hasMore)return e.reduce(qs,0)}function qs(n,e){return n+(e?.items?.length??0)}function Gs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Go({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...a}){const i=L(),l=a.mode??"add",c="agentId"in a?a.agentId:void 0,r="addedConnectionIds"in a?a.addedConnectionIds??new Set:new Set,u="onAdd"in a&&a.onAdd?a.onAdd:w=>{},m=(w,y,P)=>{c&&E("agent_connection_attached",{agent_id:c,connection_id:w,app_name:y,mode:P})},[f,d]=R.useState(null),[g,C]=R.useState(o),[x,h]=R.useState(!1),{org:p}=ne(),{data:v}=re.useSession(),b=Ut(),N=an(),S=ot(),k=w=>{e(!1),S({to:"/$org/settings/connections/$appSlug",params:{org:p.slug,appSlug:w}})},z=()=>{N.invalidateQueries({predicate:w=>{const y=w.queryKey;return y[1]===p.id&&y[3]==="collection"&&y[4]==="CONNECTIONS"}})},j=async(w,y)=>{E("connection_oauth_succeeded",{connection_id:w,flow:y});const P=new URL(`/api/${p.slug}/mcp/${w}`,window.location.origin);await N.invalidateQueries({queryKey:Ae.isMCPAuthenticated(P.href,null)}),z()},D=async w=>{d(w.app_name??w.id);try{const P=`${w.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,T=(await b.create.mutateAsync({title:P,description:w.description??null,connection_type:w.connection_type,connection_url:w.connection_url??null,connection_token:null,icon:w.icon??null,app_name:w.app_name??null,app_id:w.app_id??null,connection_headers:w.connection_headers??null})).id,M=await nt({connectionId:T,orgId:p.id,orgSlug:p.slug,persistFallback:V=>b.update.mutateAsync({id:T,data:{connection_token:V}}).then(()=>{})});if(M.ran&&!M.ok){E("connection_oauth_failed",{connection_id:T,flow:"clone",error:M.error??"no_token"}),U.error(i("virtualMcp.addConnectionDialog.authenticationFailedError",{error:M.error??"no token received"})),await b.delete.mutateAsync(T);return}M.ran&&await j(T,"clone"),m(T,w.app_name??null,"clone"),u(T)}catch(y){console.error("Failed to add connection:",y),U.error(i("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{d(null)}},A=async w=>{if(!(!p||!v?.user?.id)){d(w.id);try{const y=Ln(w,p.id,v.user.id,{remoteIndex:0}),P=y.connection_type==="STDIO",I=!!y.connection_url,T=P&&y.connection_headers&&typeof y.connection_headers=="object"&&"command"in y.connection_headers;if(!I&&!T){U.error(i("virtualMcp.addConnectionDialog.mcpServerConnectionError")),d(null);return}const{id:M}=await b.create.mutateAsync(y),V=await nt({connectionId:M,orgId:p.id,orgSlug:p.slug,persistFallback:Q=>b.update.mutateAsync({id:M,data:{connection_token:Q}}).then(()=>{})});if(V.ran&&!V.ok){E("connection_oauth_failed",{connection_id:M,flow:"connect_new",error:V.error??"no_token"}),U.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:V.error??"no token received"})}),m(M,y.app_name??null,"new"),u(M);return}V.ran?(await j(M,"connect_new"),U.success(i("virtualMcp.addConnectionDialog.connectedAuthenticated"))):U.success(i("virtualMcp.addConnectionDialog.connected")),m(M,y.app_name??null,"new"),u(M)}catch(y){console.error("Failed to connect:",y),U.error(i("virtualMcp.addConnectionDialog.failedToConnect"))}finally{d(null)}}};return t.jsxs(Bt,{open:n,onOpenChange:e,children:[t.jsxs(Et,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Rt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Vt,{className:"text-base font-semibold",children:i(l==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:g,onChange:C,placeholder:i("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(R.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Bs,{mode:l,agentId:c,addedConnectionIds:r,onAdd:u,onCloneAndAdd:D,onConnectAndAdd:A,connectingItemId:f,search:g,onCreateConnection:()=>h(!0),onBrowseNavigate:k,defaultTab:s})})]}),t.jsx(Ls,{open:x,onOpenChange:h,onCreated:async w=>{h(!1);const y=await nt({connectionId:w,orgId:p.id,orgSlug:p.slug,persistFallback:P=>b.update.mutateAsync({id:w,data:{connection_token:P}}).then(()=>{})});if(y.ran&&!y.ok){E("connection_oauth_failed",{connection_id:w,flow:"custom_create",error:y.error??"no_token"}),U.warning(i("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:i("virtualMcp.addConnectionDialog.signInFailedDescription",{error:y.error??"no token received"})}),m(w,null,"custom"),u(w),e(!1);return}y.ran&&await j(w,"custom_create"),m(w,null,"custom"),u(w),e(!1)}})]})}const pt=new Map;function Qo(){const{org:n}=ne(),e=ln(),s=ss(),o=s.find(h=>h.providerId==="deco"),{data:a,isLoading:i,refetch:l,isFetching:c}=ke({queryKey:Ae.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),r=a?.balanceCents??null,u=r!=null?r/100:null,m=R.useRef(new Map);if(r!=null){const h=pt.get(n.id);m.current.get(n.id)&&h!=null&&r>h&&E("credits_topped_up_detected",{organization_id:n.id,delta_cents:r-h,previous_balance_cents:h,new_balance_cents:r}),pt.set(n.id,r),m.current.set(n.id,!0)}const f=!!o,d=r!=null&&r>0,g=r!=null&&r===0,C=r!=null&&r===200,x=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:f,decoKeyId:o?.id??null,balanceCents:r,balanceDollars:u,hasCredits:d,isZeroBalance:g,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:i,isFetching:c,refetch:l}}function Wo(n){const e=O.c(8),{size:s,className:o}=n,a=s===void 0?16:s;let i;e[0]!==a?(i={width:a,height:a},e[0]=a,e[1]=i):i=e[1];let l;e[2]!==o?(l=H("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=l):l=e[3];let c;return e[4]!==a||e[5]!==i||e[6]!==l?(c=t.jsx("img",{src:gn,alt:"Super Agent",width:a,height:a,style:i,className:l}),e[4]=a,e[5]=i,e[6]=l,e[7]=c):c=e[7],c}function Qs(n){return n?n.run_in_progress?"generating":n.scanned_at?"ready":"none":"none"}const Ws=2e4;function Xs(n){if(typeof n!="string"||!n)return null;try{return new URL(n).hostname||null}catch{return null}}function Xo(){const n=O.c(19),{org:e}=ne(),s=hn.COMMERCE_DISCOVERY(e.id);let o;n[0]!==e.id||n[1]!==e.slug?(o=ht({connectionId:Nt,orgId:e.id,orgSlug:e.slug}),n[0]=e.id,n[1]=e.slug,n[2]=o):o=n[2];const{data:a}=ke(o),i=ke({queryKey:Ae.commerceDiscoveryConnection(e.id,s),enabled:!!a,retry:!1,staleTime:6e4,queryFn:async()=>{if(!a)throw new Error("selfClient not ready");const S=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:s}});return ut(S)}}),l=i.data?.item??null,{data:c}=ke({...ht({connectionId:s,orgId:e.id,orgSlug:e.slug}),enabled:!!l}),r=Ae.commerceDiscoveryDiagnostic(e.id,s),u=!!c;let m;n[3]!==c?(m=async()=>{if(!c)throw new Error("cdClient not ready");const S=await c.callTool({name:wt,arguments:{}});return ut(S).diagnostic??null},n[3]=c,n[4]=m):m=n[4];let f;n[5]!==r||n[6]!==u||n[7]!==m?(f={queryKey:r,enabled:u,retry:1,refetchInterval:Ys,queryFn:m},n[5]=r,n[6]=u,n[7]=m,n[8]=f):f=n[8];const d=ke(f),g=l?.metadata?.siteUrl,C=d.data??null,x=d.isSuccess,h=i.isPending||!!l&&d.isPending,p=typeof g=="string"&&g?g:null;let v;n[9]!==g?(v=Xs(g),n[9]=g,n[10]=v):v=n[10];const b=c??null;let N;return n[11]!==s||n[12]!==d.isSuccess||n[13]!==b||n[14]!==C||n[15]!==h||n[16]!==p||n[17]!==v?(N={diagnostic:C,isSuccess:x,isLoading:h,siteUrl:p,host:v,connectionId:s,cdClient:b},n[11]=s,n[12]=d.isSuccess,n[13]=b,n[14]=C,n[15]=h,n[16]=p,n[17]=v,n[18]=N):N=n[18],N}function Ys(n){return n.state.status!=="error"&&Qs(n.state.data)==="generating"?Ws:!1}function Yo(n,e){return{to:"/$org/$taskId",params:{org:n.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:pn(n.id),main:os(e,wt)}}}export{Ko as A,Vo as C,qo as N,Ho as O,Wo as S,Uo as a,Go as b,Xo as c,Ms as d,ms as e,ct as f,Qs as g,Yo as h,Qo as u};
@@ -1 +1 @@
1
- import{c as f,H as C,bU as N,eP as O,bT as S}from"./index-Cwc5OUhn.js";import{u as I}from"./use-mcp-client-DDri_uok.js";import{S as m}from"./constants-dLUUoWH7.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:m,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=I(a);return O(u.id,"CONNECTIONS",A,p)}function P(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:m,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=I(n);return S(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:m,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=I(i);return N(o.id,"CONNECTIONS",n)}export{P as a,_ as b,E as u};
1
+ import{c as f,H as C,bU as N,eP as O,bT as S}from"./index-66BUlUCq.js";import{u as I}from"./use-mcp-client-DPpSkRNd.js";import{S as m}from"./constants-dLUUoWH7.js";function E(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let r;o[12]!==e?(r=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=r):r=o[13];let g;o[14]!==s||o[15]!==r?(g={...s,additionalToolArgs:r},o[14]=s,o[15]=r,o[16]=g):g=o[16];const p=g,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:m,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const A=I(a);return O(u.id,"CONNECTIONS",A,p)}function P(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:m,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=I(n);return S(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:m,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=I(i);return N(o.id,"CONNECTIONS",n)}export{P as a,_ as b,E as u};
@@ -1 +1 @@
1
- import{c as i,r as n}from"./index-Cwc5OUhn.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
1
+ import{c as i,r as n}from"./index-66BUlUCq.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
@@ -1 +1 @@
1
- import{c as g}from"./index-Cwc5OUhn.js";import{b as f}from"./use-virtual-mcp-CQghEz4m.js";import{c as p}from"./use-navigate-to-agent-Bf4VINKK.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
1
+ import{c as g}from"./index-66BUlUCq.js";import{b as f}from"./use-virtual-mcp-CE8tx9or.js";import{c as p}from"./use-navigate-to-agent-BDnGtSYT.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
@@ -1 +1 @@
1
- import{r as u}from"./index-Cwc5OUhn.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
1
+ import{r as u}from"./index-66BUlUCq.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
@@ -1 +1 @@
1
- import{c as m,r as n}from"./index-Cwc5OUhn.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
1
+ import{c as m,r as n}from"./index-66BUlUCq.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-Cwc5OUhn.js";import{d as R,D as u}from"./decopilot-sse-pool-A07DOCGf.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
1
+ import{r as s}from"./index-66BUlUCq.js";import{d as R,D as u}from"./decopilot-sse-pool-JfBMouUo.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,H as se,p as ie,ac as ce,r as re,t as Y,bR as ae,bS as de}from"./index-Cwc5OUhn.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-CJ6HPz9N.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),k=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const w=s.mode==="deleting"&&s.connection.title;let o;e[8]!==w?(o=n.jsx("span",{className:"font-medium text-foreground",children:w}),e[8]=w,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==k||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:k,onOpenChange:m,children:j}),e[31]=k,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let S;e[43]!==M?(S=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=S):S=e[44];let v;e[45]!==t?(v=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=v):v=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==S||e[51]!==v||e[52]!==T?(A=n.jsxs("p",{children:[O," ",S," ",v," ",T,"."]}),e[49]=O,e[50]=S,e[51]=v,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let b;e[56]!==_?(b=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=b):b=e[57];let F;e[58]!==A||e[59]!==b?(F=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,b]})}),e[58]=A,e[59]=b,e[60]=F):F=e[60];let I;e[61]!==y||e[62]!==F?(I=n.jsxs(V,{children:[y,F]}),e[61]=y,e[62]=F,e[63]=I):I=e[63];let L;e[64]!==t?(L=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=L):L=e[65];let R;e[66]!==L?(R=n.jsx(X,{children:L}),e[66]=L,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let H;e[73]!==R||e[74]!==U?(H=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=H):H=e[75];let K;e[76]!==I||e[77]!==H?(K=n.jsxs(te,{children:[I,H]}),e[76]=I,e[77]=H,e[78]=K):K=e[78];let $;e[79]!==J||e[80]!==N||e[81]!==K?($=n.jsx(ne,{open:J,onOpenChange:N,children:K}),e[79]=J,e[80]=N,e[81]=K,e[82]=$):$=e[82];let Q;return e[83]!==p||e[84]!==$?(Q=n.jsxs(n.Fragment,{children:[p,$]}),e[83]=p,e[84]=$,e[85]=Q):Q=e[85],Q}function ue({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},k=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},m=o=>{t(),k(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),m(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
1
+ import{c as oe,b as le,j as n,H as se,p as ie,ac as ce,r as re,t as Y,bR as ae,bS as de}from"./index-66BUlUCq.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-C7gi43qw.js";function ge(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),k=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const w=s.mode==="deleting"&&s.connection.title;let o;e[8]!==w?(o=n.jsx("span",{className:"font-medium text-foreground",children:w}),e[8]=w,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==k||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:k,onOpenChange:m,children:j}),e[31]=k,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let S;e[43]!==M?(S=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=S):S=e[44];let v;e[45]!==t?(v=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=v):v=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==S||e[51]!==v||e[52]!==T?(A=n.jsxs("p",{children:[O," ",S," ",v," ",T,"."]}),e[49]=O,e[50]=S,e[51]=v,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let b;e[56]!==_?(b=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=b):b=e[57];let F;e[58]!==A||e[59]!==b?(F=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,b]})}),e[58]=A,e[59]=b,e[60]=F):F=e[60];let I;e[61]!==y||e[62]!==F?(I=n.jsxs(V,{children:[y,F]}),e[61]=y,e[62]=F,e[63]=I):I=e[63];let L;e[64]!==t?(L=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=L):L=e[65];let R;e[66]!==L?(R=n.jsx(X,{children:L}),e[66]=L,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let H;e[73]!==R||e[74]!==U?(H=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=H):H=e[75];let K;e[76]!==I||e[77]!==H?(K=n.jsxs(te,{children:[I,H]}),e[76]=I,e[77]=H,e[78]=K):K=e[78];let $;e[79]!==J||e[80]!==N||e[81]!==K?($=n.jsx(ne,{open:J,onOpenChange:N,children:K}),e[79]=J,e[80]=N,e[81]=K,e[82]=$):$=e[82];let Q;return e[83]!==p||e[84]!==$?(Q=n.jsxs(n.Fragment,{children:[p,$]}),e[83]=p,e[84]=$,e[85]=Q):Q=e[85],Q}function ue({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},k=o=>{ae(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===de&&l.queryKey[3]===o})},m=o=>{t(),k(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),m(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ge as D,ue as u};
@@ -1 +1 @@
1
- import{c as s,o as m,K as c}from"./index-Cwc5OUhn.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
1
+ import{c as s,o as m,K as c}from"./index-66BUlUCq.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
@@ -1 +1 @@
1
- import{c as u,H as c,ac as r,K as a,o as y,z as F,p as C,e as d}from"./index-Cwc5OUhn.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{E as a,m as b,q as c,I as u};
1
+ import{c as u,H as c,ac as r,K as a,o as y,z as F,p as C,e as d}from"./index-66BUlUCq.js";function E(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=F(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=r();let i;e[0]!==n.id?(i=a.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],y(s)}function m(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_CREATE",{...f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}function q(){const e=u.c(8),{org:n}=c(),o=r(),i=C();let t;e[0]!==o?(t=f=>o.call("FILE_CONFIG_DELETE",{id:f}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:a.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],d(l)}export{E as a,m as b,q as c,I as u};
@@ -1 +1 @@
1
- import{bx as l,eR as d,eS as x,r as i}from"./index-Cwc5OUhn.js";var b=class extends l{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:x(t,n.data),hasPreviousPage:d(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function p(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{b as I,p as u};
1
+ import{bx as l,eR as d,eS as x,r as i}from"./index-66BUlUCq.js";var b=class extends l{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:x(t,n.data),hasPreviousPage:d(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function p(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{b as I,p as u};
@@ -1 +1 @@
1
- import{c as O,H as T,ac as A,bJ as J,K as I,o as _,p as b,b as v,e as N,t as p}from"./index-Cwc5OUhn.js";function j(){const e=O.c(10),{org:u}=T(),d=A(),{capabilities:c,isPrivileged:f}=J(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=_(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=A(),f=b(),s=v();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let E;e[22]!==q||e[23]!==R||e[24]!==g?(E={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=E):E=e[25];const S=N(E);let m;return e[26]!==y||e[27]!==S?(m={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=m):m=e[28],m}export{F as a,j as u};
1
+ import{c as O,H as T,ac as A,bJ as J,K as I,o as _,p as b,b as v,e as N,t as p}from"./index-66BUlUCq.js";function j(){const e=O.c(10),{org:u}=T(),d=A(),{capabilities:c,isPrivileged:f}=J(),s=f||!!c["members:manage"];let i;e[0]!==u.id?(i=I.organizationJoinRequests(u.id),e[0]=u.id,e[1]=i):i=e[1];let t;e[2]!==d?(t=()=>d.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=d,e[3]=t):t=e[3];const o=!!u.id&&s;let n;e[4]!==i||e[5]!==t||e[6]!==o?(n={queryKey:i,queryFn:t,enabled:o},e[4]=i,e[5]=t,e[6]=o,e[7]=n):n=e[7];const{data:a}=_(n);let l;return e[8]!==a?.requests?(l=a?.requests??[],e[8]=a?.requests,e[9]=l):l=e[9],l}function F(){const e=O.c(29),{org:u,locator:d}=T(),c=A(),f=b(),s=v();let i;e[0]!==d||e[1]!==u||e[2]!==f?(i=()=>{f.invalidateQueries({queryKey:I.organizationJoinRequests(u.id)}),f.invalidateQueries({queryKey:I.members(d)})},e[0]=d,e[1]=u,e[2]=f,e[3]=i):i=e[3];const t=i;let o;e[4]!==c?(o=r=>c.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:r}),e[4]=c,e[5]=o):o=e[5];let n;e[6]!==t||e[7]!==s?(n=()=>{t(),p.success(s("settings.joinRequestsSection.approved"))},e[6]=t,e[7]=s,e[8]=n):n=e[8];let a;e[9]!==s?(a=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.approveFailed")),e[9]=s,e[10]=a):a=e[10];let l;e[11]!==o||e[12]!==n||e[13]!==a?(l={mutationFn:o,onSuccess:n,onError:a},e[11]=o,e[12]=n,e[13]=a,e[14]=l):l=e[14];const y=N(l);let q;e[15]!==c?(q=r=>c.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:r}),e[15]=c,e[16]=q):q=e[16];let R;e[17]!==t||e[18]!==s?(R=()=>{t(),p.success(s("settings.joinRequestsSection.denied"))},e[17]=t,e[18]=s,e[19]=R):R=e[19];let g;e[20]!==s?(g=r=>p.error(r instanceof Error?r.message:s("settings.joinRequestsSection.denyFailed")),e[20]=s,e[21]=g):g=e[21];let E;e[22]!==q||e[23]!==R||e[24]!==g?(E={mutationFn:q,onSuccess:R,onError:g},e[22]=q,e[23]=R,e[24]=g,e[25]=E):E=e[25];const S=N(E);let m;return e[26]!==y||e[27]!==S?(m={approve:y,deny:S},e[26]=y,e[27]=S,e[28]=m):m=e[28],m}export{F as a,j as u};
@@ -1 +1 @@
1
- import{c as b,b as $,D as k,a$ as N,j as o,ab as g,a8 as v,a9 as T,aa as S,H as A,K as H,z as L}from"./index-Cwc5OUhn.js";import{B as I}from"./badge-B2Zf6qZN.js";import{g as P}from"./types-D-eDMOji.js";import{s as _}from"./Eye-DlNcBFBo.js";import{s as U,aP as w}from"./agent-icon-D6UFUEyp.js";import{i as O}from"./mcp-oauth-C4AEx9Qj.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:_,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function D(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=$();let l;e[0]!==r?(l=P(r),e[0]=r,e[1]=l):l=e[1];const n=!!l;let s,i,a,u,d;if(e[2]!==c||e[3]!==n||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!n){d=null;break e}s=S,i="flex gap-1 flex-nowrap",e[10]!==n||e[11]!==t?(a=n&&o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(I,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(T,{children:t("tools.toolsList.interactive")})]}),e[10]=n,e[11]=t,e[12]=a):a=e[12];let m;e[13]!==t?(m=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(I,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(T,{children:t(j)})]},j)},e[13]=t,e[14]=m):m=e[14],u=x.map(m)}e[2]=c,e[3]=n,e[4]=t,e[5]=s,e[6]=i,e[7]=a,e[8]=u,e[9]=d}else s=e[5],i=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==i||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:i,children:[a,u]}),e[15]=i,e[16]=a,e[17]=u,e[18]=p):p=e[18];let f;return e[19]!==s||e[20]!==p?(f=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=f):f=e[21],f}function F(y){const e=b.c(11),{connectionId:c}=y,{org:r}=A();let t,l,n;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),n=L,l=H.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=n):(t=e[2],l=e[3],n=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let i;e[8]!==l||e[9]!==s?(i={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=i):i=e[10];const{data:a}=n(i);return a}export{D as T,F as u};
1
+ import{c as b,b as $,D as k,a$ as N,j as o,ab as g,a8 as v,a9 as T,aa as S,H as A,K as H,z as L}from"./index-66BUlUCq.js";import{B as I}from"./badge-BVOT5cY1.js";import{g as P}from"./types-Dptm8vRS.js";import{s as _}from"./Eye-BP8ZftGB.js";import{s as U,aP as w}from"./agent-icon-Dk522vgR.js";import{i as O}from"./mcp-oauth-CCK0vzqY.js";const R=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:_,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:U,variant:"outline"}];function D(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=$();let l;e[0]!==r?(l=P(r),e[0]=r,e[1]=l):l=e[1];const n=!!l;let s,i,a,u,d;if(e[2]!==c||e[3]!==n||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?R.filter(h=>c[h.key]===!0):[];if(x.length===0&&!n){d=null;break e}s=S,i="flex gap-1 flex-nowrap",e[10]!==n||e[11]!==t?(a=n&&o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(I,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(T,{children:t("tools.toolsList.interactive")})]}),e[10]=n,e[11]=t,e[12]=a):a=e[12];let m;e[13]!==t?(m=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(g,{children:[o.jsx(v,{asChild:!0,children:o.jsx(I,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(T,{children:t(j)})]},j)},e[13]=t,e[14]=m):m=e[14],u=x.map(m)}e[2]=c,e[3]=n,e[4]=t,e[5]=s,e[6]=i,e[7]=a,e[8]=u,e[9]=d}else s=e[5],i=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let p;e[15]!==i||e[16]!==a||e[17]!==u?(p=o.jsxs("div",{className:i,children:[a,u]}),e[15]=i,e[16]=a,e[17]=u,e[18]=p):p=e[18];let f;return e[19]!==s||e[20]!==p?(f=o.jsx(s,{children:p}),e[19]=s,e[20]=p,e[21]=f):f=e[21],f}function F(y){const e=b.c(11),{connectionId:c}=y,{org:r}=A();let t,l,n;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),n=L,l=H.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=n):(t=e[2],l=e[3],n=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>O({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let i;e[8]!==l||e[9]!==s?(i={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=i):i=e[10];const{data:a}=n(i);return a}export{D as T,F as u};