decocms 4.123.2 → 4.123.3

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 (236) hide show
  1. package/dist/client/assets/{AlertCircle-XCC42vnv.js → AlertCircle-eRcWDqyz.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BbeQRNr_.js → AreaChart-CWCyj3e3.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-BKBmhaLR.js → ArrowRight-p9iPk5i0.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-CIc1qLBi.js → ArrowUp-DpycHbYJ.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-BfP64txw.js → ArrowUpRight-CfTkoU4B.js} +1 -1
  6. package/dist/client/assets/{Check-BqbTs6Sp.js → Check-BdLBTBRG.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BPEhKJ6_.js → CheckCircle-CCKZTxeZ.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BeuEDkJI.js → ChevronDown-Bx3JuxA4.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-CpxTzNTm.js → ChevronRight-CFrIQqny.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-tFv_O9M0.js → ChevronUp-Dq6n-X7O.js} +1 -1
  11. package/dist/client/assets/{Copy01-DqXF8bW_.js → Copy01-XmlYTCnq.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Ue6eGmYj.js → DotsVertical-ws7g1gHH.js} +1 -1
  13. package/dist/client/assets/{Eye-Bk2Xgrvg.js → Eye-BBuEG2Wd.js} +1 -1
  14. package/dist/client/assets/{FilterLines-8U9bkKls.js → FilterLines-C8U7CVV9.js} +1 -1
  15. package/dist/client/assets/{Globe01-D61pxNbc.js → Globe01-C4KqixhG.js} +1 -1
  16. package/dist/client/assets/{Globe04-BVIaxGYK.js → Globe04-BqWPfPhC.js} +1 -1
  17. package/dist/client/assets/{HardDrive-Dp3ZELAy.js → HardDrive-C_ycSVMi.js} +1 -1
  18. package/dist/client/assets/{Image01-C0tZD_4N.js → Image01-DVjQLwZ-.js} +1 -1
  19. package/dist/client/assets/{Key01-C1OrSDs9.js → Key01-FIEtfPiH.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-BR0426bP.js → LayoutLeft-Dnm3NgQz.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-Dbdi7ThP.js → LinkExternal01-DunixMNV.js} +1 -1
  22. package/dist/client/assets/{LogOut01-BGKt8uk-.js → LogOut01-DlvBCesx.js} +1 -1
  23. package/dist/client/assets/{Monitor01-BpV1xCDw.js → Monitor01-JoeiLfz-.js} +1 -1
  24. package/dist/client/assets/{Package-CPikbMFw.js → Package-fVT5gTF_.js} +1 -1
  25. package/dist/client/assets/{Palette-CI2gPMub.js → Palette-BWnu1KwQ.js} +1 -1
  26. package/dist/client/assets/{Play-Ce8b-45f.js → Play-HYSZBOc2.js} +1 -1
  27. package/dist/client/assets/{Plus-BHn273te.js → Plus-CyjW8iPH.js} +1 -1
  28. package/dist/client/assets/{SearchLg-BhaN5Dkw.js → SearchLg-B2jol46R.js} +1 -1
  29. package/dist/client/assets/{SearchMd-ZOU8eHm5.js → SearchMd-DkKUttLm.js} +1 -1
  30. package/dist/client/assets/{Settings02-BMEbk95n.js → Settings02-BrdhYfJi.js} +1 -1
  31. package/dist/client/assets/{Shield01-ByBmvv87.js → Shield01-B1XsHete.js} +1 -1
  32. package/dist/client/assets/{Star01-CXoaBlcx.js → Star01-Hbm6yGaD.js} +1 -1
  33. package/dist/client/assets/{Stars01-DzME0iEm.js → Stars01-DipJVSzo.js} +1 -1
  34. package/dist/client/assets/{Stars02-aAWJ3II4.js → Stars02-D2qzcZbs.js} +1 -1
  35. package/dist/client/assets/{Sun-BvXvztsJ.js → Sun-D9gwkrf5.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-D0-CcWGL.js → SwitchHorizontal01-Bt3ZhF2O.js} +1 -1
  37. package/dist/client/assets/{Tool01-CsQku2ha.js → Tool01-DvE5TzJB.js} +1 -1
  38. package/dist/client/assets/{Tool02-9ZNic0qo.js → Tool02-_NBLVeeV.js} +1 -1
  39. package/dist/client/assets/{Trash01-DxhoFTU2.js → Trash01-BepZYT7H.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-DolEYhiE.js → TrendUp01-BKJLyuI9.js} +1 -1
  41. package/dist/client/assets/{Upload01-Cw1RTJdA.js → Upload01-BubHQTIU.js} +1 -1
  42. package/dist/client/assets/{User01-B9tHPp45.js → User01-DkpYEYe6.js} +1 -1
  43. package/dist/client/assets/{Users01-CtZ6-BIN.js → Users01-DjvWkBZ9.js} +1 -1
  44. package/dist/client/assets/{Users03-DKzOXdwZ.js → Users03-Ci9mYAgC.js} +1 -1
  45. package/dist/client/assets/{X-BlyIKSVp.js → X-HQl8Aj_L.js} +1 -1
  46. package/dist/client/assets/{XCircle-BS-TfzRr.js → XCircle-BizT01hc.js} +1 -1
  47. package/dist/client/assets/{XClose-CRX1ODGE.js → XClose-CcoerXx4.js} +1 -1
  48. package/dist/client/assets/{Zap-BbOt7jmA.js → Zap-BF-fUeLE.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-CmpVcXwq.js → ZapSquare-vjVCshpw.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-0gQoEQDY.js → ZoomOut-B_jcciLR.js} +1 -1
  51. package/dist/client/assets/{access-gate-BVvy6Xvh.js → access-gate-BqHB36ZF.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-Q5ILcd5n.js → add-section-modal-CQaBEUCu.js} +1 -1
  53. package/dist/client/assets/{agent-icon-D8X6NgHQ.js → agent-icon-ibE4Mzzu.js} +1 -1
  54. package/dist/client/assets/{agents-list-Djdw5X52.js → agents-list-0DDVnJrl.js} +1 -1
  55. package/dist/client/assets/{ai-providers-CZhLConq.js → ai-providers-DqD3zgSv.js} +1 -1
  56. package/dist/client/assets/{alert-DZt6s1-5.js → alert-DDQjZ7Sa.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-BbSxHfpk.js → alert-dialog-BWhpN8gU.js} +1 -1
  58. package/dist/client/assets/{app-editor-meMLTo05.js → app-editor-DVkvKRDN.js} +1 -1
  59. package/dist/client/assets/{auth-C0wxe8j1.js → auth-D8HvRHHP.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-y2fJEFYv.js → auth-catchall-C_KTlh8d.js} +1 -1
  61. package/dist/client/assets/{auth-entry-DcpdTLhj.js → auth-entry-DyZakAOt.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-BKK4N-N6.js → auth-split-layout-C79zlQMZ.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-Bkljayza.js → authenticate-and-persist-oauth-D2zBt4t0.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-BjXQjt1z.js → automation-list-row-7FNfxpyb.js} +1 -1
  65. package/dist/client/assets/{automation-runs-B-1RH_oI.js → automation-runs-cQOAIuK1.js} +1 -1
  66. package/dist/client/assets/{automations-B_fbLWl9.js → automations-DFHU57uN.js} +1 -1
  67. package/dist/client/assets/{autosend-Be-3DD9j.js → autosend-Btkz6-0l.js} +1 -1
  68. package/dist/client/assets/{avatar-CfUWjhDf.js → avatar-DtoeWk0Z.js} +1 -1
  69. package/dist/client/assets/{badge-DF-If9rp.js → badge-Coz8TMU0.js} +1 -1
  70. package/dist/client/assets/{block-document-QDu2JdkJ.js → block-document-TkTeRgax.js} +1 -1
  71. package/dist/client/assets/{brand-context-dVMghOOW.js → brand-context-DyrNgbHb.js} +1 -1
  72. package/dist/client/assets/{buckets-Buo3pKQm.js → buckets-jEkDUMWc.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-CvwIPpKb.js → bulk-category-panel-DcFs9iGz.js} +1 -1
  74. package/dist/client/assets/{calendar-DDdEu02Z.js → calendar-CUO5b1ow.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-B47bErtJ.js → capability-load-error-B7XmMBaL.js} +1 -1
  76. package/dist/client/assets/{card-Di-QpnW-.js → card-OSM07-YE.js} +1 -1
  77. package/dist/client/assets/{category-editor-BYmynf3_.js → category-editor-Kdrp5Ecc.js} +1 -1
  78. package/dist/client/assets/{chat-context-Bnmr5Esu.js → chat-context-DoZ1baNe.js} +1 -1
  79. package/dist/client/assets/{checkbox-Ca7NY1wR.js → checkbox-5Dqb50rX.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BM4UbwaW.js → cli-auth-success-5-sqgCR1.js} +1 -1
  81. package/dist/client/assets/{collection-detail-C_jvvVx2.js → collection-detail-BtHBlghi.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-Dvi-6XHb.js → collection-display-button-CnPuuZw0.js} +1 -1
  83. package/dist/client/assets/{collection-search-2V1qih3c.js → collection-search-5eKJWC8a.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-CVTrxPz3.js → collection-table-wrapper-Bt4X8CDw.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-u1HJ_eBo.js → collection-tabs-CNvc5FXj.js} +1 -1
  86. package/dist/client/assets/{command-DfYO983M.js → command-F60Vvdw9.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding--4NONN4b.js → commerce-onboarding-9CZnisfq.js} +1 -1
  88. package/dist/client/assets/{companions-core-BBPRO-hx.js → companions-core-DlPclFME.js} +1 -1
  89. package/dist/client/assets/{connect-CxMb3kaP.js → connect-Ce_xd66Z.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-CVoQrJ8F.js → connect-desktop-dialog-DUZxmsUO.js} +1 -1
  91. package/dist/client/assets/{connection-BbilOib-.js → connection-DvYP4ame.js} +1 -1
  92. package/dist/client/assets/{connection-card-DrMoCtl4.js → connection-card-Cdfh1gnU.js} +1 -1
  93. package/dist/client/assets/{connection-detail-DhhlgQDD.js → connection-detail-q5RUuSrv.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-jobllNge.js → connection-form-helpers-ofcrOZAr.js} +1 -1
  95. package/dist/client/assets/{connections-Cbwi0auT.js → connections-eosewDDm.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-BuymyfF0.js → decopilot-sse-pool-BjZ-wPbg.js} +1 -1
  97. package/dist/client/assets/{dialog-poX5N6OF.js → dialog-CKP-t2d8.js} +1 -1
  98. package/dist/client/assets/{domain-settings-Bf7aOGCi.js → domain-settings-Bg5U7NKI.js} +1 -1
  99. package/dist/client/assets/{drawer-CemU5qiA.js → drawer-DQHW9t04.js} +1 -1
  100. package/dist/client/assets/{dropdown-menu-C_IfrJtZ.js → dropdown-menu-ylG9Kkc3.js} +1 -1
  101. package/dist/client/assets/{empty-state-BPgoMkQH.js → empty-state-C08XplZ3.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-BP-6YHKf.js → extract-connection-data-C_r5IGMb.js} +1 -1
  103. package/dist/client/assets/{file-explorer-Ba3Y3MJx.js → file-explorer-CICAaSO_.js} +1 -1
  104. package/dist/client/assets/{file-type-icon-CCvkC4UX.js → file-type-icon-BlvOD0PX.js} +1 -1
  105. package/dist/client/assets/{files-z7S0toY0.js → files-Dp05Y0HV.js} +1 -1
  106. package/dist/client/assets/{form-CBy1yFE7.js → form-BOHVNPhz.js} +1 -1
  107. package/dist/client/assets/{general-CT5NFN2-.js → general-BRGJds_Q.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-WGLIOn68.js → github-repo-picker-DcHCLyjR.js} +1 -1
  109. package/dist/client/assets/{hooks-DO_GgbQ9.js → hooks-C9juaECv.js} +1 -1
  110. package/dist/client/assets/{index-BYB7faC2.js → index-4jOyya6Y.js} +1 -1
  111. package/dist/client/assets/{index-BTDLuR6K.js → index-70mmTZc_.js} +1 -1
  112. package/dist/client/assets/index-BgF6OVaJ.css +1 -0
  113. package/dist/client/assets/{index-CrVcfr0w.js → index-Bp_8bhFo.js} +3 -3
  114. package/dist/client/assets/{index-DAtTWfgt.js → index-C7paW5qO.js} +3 -3
  115. package/dist/client/assets/{index-NwnGjivz.js → index-CCsdUvVs.js} +1 -1
  116. package/dist/client/assets/{index-BUOc0Rlo.js → index-CHQBwCua.js} +1 -1
  117. package/dist/client/assets/{index-BZketn2G.js → index-COt3Wzd4.js} +1 -1
  118. package/dist/client/assets/{index-AqXdWiS8.js → index-CeSX2hgY.js} +1 -1
  119. package/dist/client/assets/{index-yo4ZLMjW.js → index-CpkyNb-g.js} +1 -1
  120. package/dist/client/assets/{index-COExXZVa.js → index-CvSG3gCR.js} +5 -5
  121. package/dist/client/assets/{index-BipIQ3Z0.js → index-DIGsSdbK.js} +1 -1
  122. package/dist/client/assets/{index-Dd3322Xk.js → index-DvmOfoBg.js} +1 -1
  123. package/dist/client/assets/{index-C8Q5qfXW.js → index-mMZ1-UT7.js} +1 -1
  124. package/dist/client/assets/{index-redirect-XUFJEhWY.js → index-redirect-DowabVtC.js} +1 -1
  125. package/dist/client/assets/{input-BTaZQTwt.js → input-B7NjdaWP.js} +1 -1
  126. package/dist/client/assets/{integration-icon-BFQyCHkv.js → integration-icon-DEmdrigW.js} +1 -1
  127. package/dist/client/assets/{invite-member-dialog-UtoUhAQN.js → invite-member-dialog-Do_rh2sG.js} +1 -1
  128. package/dist/client/assets/{label-CFiSNSYm.js → label-BsC9V_2x.js} +1 -1
  129. package/dist/client/assets/{layout-DNQqS4dI.js → layout-DttsLFsc.js} +1 -1
  130. package/dist/client/assets/{login-x836Suod.js → login-Bc-4_kHz.js} +1 -1
  131. package/dist/client/assets/{mcp-oauth-DjzzahSx.js → mcp-oauth-iPqAJoGm.js} +1 -1
  132. package/dist/client/assets/{members-C0PCyfD6.js → members-Df_EE43H.js} +1 -1
  133. package/dist/client/assets/{monaco-editor-BQlr5iHl.js → monaco-editor-B9OF3jRu.js} +1 -1
  134. package/dist/client/assets/{monitoring-stats-row-CYTksZ0o.js → monitoring-stats-row-BPtjhObG.js} +1 -1
  135. package/dist/client/assets/{multi-select-g0Zcdpuc.js → multi-select-B8L-uR0Z.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-CUqReAyz.js → oauth-callback-Dr5zVhyV.js} +1 -1
  137. package/dist/client/assets/{oauth-callback-ai-provider-BO8s14-F.js → oauth-callback-ai-provider-DMC1bSAT.js} +1 -1
  138. package/dist/client/assets/{onboarding-ifaPlnD7.js → onboarding-fiTo09oR.js} +1 -1
  139. package/dist/client/assets/{org-install-HCRLLUwR.js → org-install-B2bM7ppY.js} +1 -1
  140. package/dist/client/assets/{org-layout-37oPrsYr.js → org-layout-DZyE1NBJ.js} +1 -1
  141. package/dist/client/assets/{organization-choice-D4wTlG5B.js → organization-choice-CSaGCmhQ.js} +1 -1
  142. package/dist/client/assets/{orgs-CO8Ia10y.js → orgs-DQh8lqIU.js} +1 -1
  143. package/dist/client/assets/{page-seo-form-BElu4PcX.js → page-seo-form-BGL3rL7i.js} +1 -1
  144. package/dist/client/assets/page-seo-sheet-CsLUJ1Yf.js +1 -0
  145. package/dist/client/assets/{popover-6uiYyt5u.js → popover-BARdtmQ6.js} +1 -1
  146. package/dist/client/assets/{post-editor-CsfSnGeq.js → post-editor-C7J0K8nu.js} +1 -1
  147. package/dist/client/assets/{primitives-BQwrCqaw.js → primitives-DLF6JtPS.js} +1 -1
  148. package/dist/client/assets/{profile-BLmFaHgn.js → profile-BqTzXs9x.js} +1 -1
  149. package/dist/client/assets/project-app-view-4XZrS0Mr.js +1 -0
  150. package/dist/client/assets/record-editor-YzJoN9bv.js +1 -0
  151. package/dist/client/assets/{redirect-editor-CAt-r8L6.js → redirect-editor-YHB4gvcQ.js} +1 -1
  152. package/dist/client/assets/registry-DKMLAjwr.js +2 -0
  153. package/dist/client/assets/{registry-layout-DzeMIQ1B.js → registry-layout-C0zwUwDi.js} +1 -1
  154. package/dist/client/assets/{reports-CjTucZb2.js → reports-BG46h4YF.js} +1 -1
  155. package/dist/client/assets/{require-capability-AlDMTe2M.js → require-capability-l1pPM6L3.js} +1 -1
  156. package/dist/client/assets/{required-auth-layout-CxsIwght.js → required-auth-layout-Dgwezb2q.js} +1 -1
  157. package/dist/client/assets/{reset-password-fK3yI8C1.js → reset-password-C7WC8kCI.js} +1 -1
  158. package/dist/client/assets/{roles-8n-_hcZU.js → roles-55zZDlTP.js} +1 -1
  159. package/dist/client/assets/{search-input-BIlo3d_x.js → search-input-Rf45slkr.js} +1 -1
  160. package/dist/client/assets/{secrets-C5IXt4y-.js → secrets-CumVvXzE.js} +1 -1
  161. package/dist/client/assets/{sections-editor-C5e3xbtX.js → sections-editor-AIZ_vXyM.js} +1 -1
  162. package/dist/client/assets/{select-C-lRFMd0.js → select-Cofdiz7g.js} +1 -1
  163. package/dist/client/assets/{select-model-CnP2KvlX.js → select-model-CQjdy8JP.js} +1 -1
  164. package/dist/client/assets/{self-tool-result-WKXfGLIo.js → self-tool-result-CZ8BrxAv.js} +1 -1
  165. package/dist/client/assets/{seo-editor-DDHhP88k.js → seo-editor-Bg3KN1r0.js} +1 -1
  166. package/dist/client/assets/{settings-layout-Bv0OyYHJ.js → settings-layout-BO3edXkv.js} +1 -1
  167. package/dist/client/assets/{settings-section-DcvaTSLo.js → settings-section-CW4yLPtI.js} +1 -1
  168. package/dist/client/assets/{shell-controls-7jsmZLrB.js → shell-controls-cEHP32Pv.js} +1 -1
  169. package/dist/client/assets/{shell-layout-CxYEqHLt.js → shell-layout-BbDwMSR1.js} +1 -1
  170. package/dist/client/assets/{sidebar-BAm9qD2e.js → sidebar-CsCKy7i2.js} +1 -1
  171. package/dist/client/assets/{skeleton-rk4WuHqh.js → skeleton-C6T-49IJ.js} +1 -1
  172. package/dist/client/assets/{sso-CzAtA7Zs.js → sso-D-Fm27Br.js} +1 -1
  173. package/dist/client/assets/{store-DTElmzZA.js → store-BizgsZ6V.js} +1 -1
  174. package/dist/client/assets/store-registry-BSBzU8Cs.js +2 -0
  175. package/dist/client/assets/{studio-tools-B1eVxu6k.js → studio-tools-BgcbqxiX.js} +1 -1
  176. package/dist/client/assets/{switch-DItIkDat.js → switch-CcOR9vLu.js} +1 -1
  177. package/dist/client/assets/{table-Cp9c4BcU.js → table-BAGpdfFB.js} +1 -1
  178. package/dist/client/assets/{tabs-D7y8E5Ya.js → tabs-BBIq1chp.js} +1 -1
  179. package/dist/client/assets/{textarea-uMNP0LCC.js → textarea-Cu9wZQ0x.js} +1 -1
  180. package/dist/client/assets/{toggle-group-BqEa1TEc.js → toggle-group-3NzAw3cD.js} +1 -1
  181. package/dist/client/assets/{toolbar-Dk_EQcxK.js → toolbar-BCd7IYjs.js} +1 -1
  182. package/dist/client/assets/{toolbar-icon-button-B3a3a06z.js → toolbar-icon-button-CdCR26vG.js} +1 -1
  183. package/dist/client/assets/{tooltip-D1kWwXpZ.js → tooltip-Du-iZy7N.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-laCpnXdd.js → use-ai-providers-DVcvRuW8.js} +1 -1
  185. package/dist/client/assets/{use-api-keys-CsDXZwqL.js → use-api-keys-V0LOyd3c.js} +1 -1
  186. package/dist/client/assets/{use-automations-BfXgjd_V.js → use-automations-CEI45ay4.js} +1 -1
  187. package/dist/client/assets/{use-autosave-BAraq6AW.js → use-autosave-CJsA34KG.js} +1 -1
  188. package/dist/client/assets/{use-capability-DzC2Klfd.js → use-capability-Cx0l8hzs.js} +1 -1
  189. package/dist/client/assets/{use-clock-tick-DRjNjgqA.js → use-clock-tick-C_-xNV1u.js} +1 -1
  190. package/dist/client/assets/{use-connection-Bmwh1M0H.js → use-connection-IvaPXMMI.js} +1 -1
  191. package/dist/client/assets/{use-copy-CnoszhL7.js → use-copy-B_1XRnig.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-BsqQsVxp.js → use-create-virtual-mcp-CIJjVQB3.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-BCK-z4zD.js → use-debounced-autosave-Br4PVksK.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-CV3OhKhZ.js → use-debounced-value-DbPd-3pt.js} +1 -1
  195. package/dist/client/assets/{use-deco-credits-DJYZaYfn.js → use-deco-credits-FKsuCiez.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-CJAX9qbZ.js → use-decopilot-events-DbYP1aYj.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-BbE8VrIR.js → use-delete-connection-5AZ2BCY9.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-BB1Jrj8e.js → use-deployment-admin-3b1R1FZS.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-dIk120-N.js → use-file-configs-VWs6VY08.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-B7e1w8Ad.js → use-infinite-scroll-BZi9tXU0.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-BuakQTEO.js → use-join-requests-CsMCalmA.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-DUPES28-.js → use-mcp-auth-status-DnXazVhb.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-B36Osh-D.js → use-mcp-client-D_VzqTLh.js} +1 -1
  204. package/dist/client/assets/{use-mcp-tools-C_xSJpE0.js → use-mcp-tools-DjkP_M1a.js} +1 -1
  205. package/dist/client/assets/{use-members-B218nv1M.js → use-members-DV4j3UXl.js} +1 -1
  206. package/dist/client/assets/{use-mobile--PifyK00.js → use-mobile-CWC5nRCB.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-BBbQ-aHe.js → use-navigate-to-agent-DroDm4RE.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-DK6Nh6IP.js → use-org-auth-client-BCUT78RS.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-DZihocwz.js → use-org-sso-Dv2OfSjz.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-CdFvxl4s.js → use-organization-roles-CoETHAsw.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-CAH1_Gfq.js → use-organization-settings-U7F2Hhh2.js} +1 -1
  212. package/dist/client/assets/{use-registry-app-Bs5fLaKB.js → use-registry-app-CXrI3NDe.js} +1 -1
  213. package/dist/client/assets/{use-registry-connections-C0Ibblmm.js → use-registry-connections-BUuKAzIu.js} +1 -1
  214. package/dist/client/assets/{use-secrets-BTSjhTGA.js → use-secrets-r-sdg8_V.js} +1 -1
  215. package/dist/client/assets/{use-status-sounds-CMNbO4bj.js → use-status-sounds-D7DlFxOJ.js} +1 -1
  216. package/dist/client/assets/{use-view-mode-CPAZulMe.js → use-view-mode-ZZSYMSJV.js} +1 -1
  217. package/dist/client/assets/{use-virtual-mcp-CQaiGnUU.js → use-virtual-mcp-CBDJvgVd.js} +1 -1
  218. package/dist/client/assets/useInfiniteQuery-xktR2NpE.js +1 -0
  219. package/dist/client/assets/{useQueries-CF9YH8lZ.js → useQueries-CJGiUc5a.js} +1 -1
  220. package/dist/client/assets/{useRouterState-C8-zqAk7.js → useRouterState-v18d10us.js} +1 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-CvxvsZx8.js +1 -0
  222. package/dist/client/assets/{users-BC5ArrE1.js → users-DB009SMi.js} +1 -1
  223. package/dist/client/assets/{variant-calendar-B8wZWFL-.js → variant-calendar-ZP0jU61K.js} +1 -1
  224. package/dist/client/assets/{view-mode-toggle-Bmph2BY4.js → view-mode-toggle-Dnn6UOzU.js} +1 -1
  225. package/dist/client/index.html +2 -2
  226. package/dist/server/cli.js +1 -1
  227. package/dist/server/server.js +1 -1
  228. package/package.json +1 -1
  229. package/dist/client/assets/index-BUug5fNW.css +0 -1
  230. package/dist/client/assets/page-seo-sheet-BqtOe7CO.js +0 -1
  231. package/dist/client/assets/project-app-view-QX-ZdCUU.js +0 -1
  232. package/dist/client/assets/record-editor-Bl1Ur8U7.js +0 -1
  233. package/dist/client/assets/registry-7xJw8GM7.js +0 -2
  234. package/dist/client/assets/store-registry-BuSUDYda.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-ByuEOZ10.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-BVdkw7ML.js +0 -1
@@ -1 +1 @@
1
- import{W as Ut,X as qt,c as $,b as V,Y as gt,Z as pt,e as Xt,j as t,a as oe,B as ne,r as H,aH as Wt,d as Re,m as X,s as Qt,t as G,w as Yt,k as ke,p as R,F as ae,L as Jt,f as ht,u as xt,D as Zt,I as en,G as tn,K as ot,o as nn,n as sn}from"./index-DAtTWfgt.js";import{t as jt}from"./ChevronDown-BeuEDkJI.js";import{A as vt,h as on,b as an}from"./agent-icon-D8X6NgHQ.js";import{T as Ce,a as ye,c as Se}from"./tooltip-D1kWwXpZ.js";import{u as bt,d as Ct,c as yt}from"./sidebar-BAm9qD2e.js";import{a as it,i as rn,f as cn,S as ln,u as dn}from"./use-mcp-client-B36Osh-D.js";import{a as un,u as mn}from"./use-virtual-mcp-CQaiGnUU.js";import{a as Be,b as St,P as wt}from"./popover-6uiYyt5u.js";import{i as Ee}from"./Check-BqbTs6Sp.js";import{s as we}from"./Plus-BHn273te.js";import{i as _t}from"./SearchMd-ZOU8eHm5.js";import{s as Nt}from"./XClose-CRX1ODGE.js";import{c as fn,d as gn,b as pn,f as hn,e as xn,a as jn,A as vn}from"./alert-dialog-BbSxHfpk.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as bn,e as ee}from"./form-CBy1yFE7.js";import{I as ie}from"./input-BTaZQTwt.js";import{S as Cn}from"./chat-context-Bnmr5Esu.js";import{T as Dt}from"./toolbar-icon-button-B3a3a06z.js";import{S as yn}from"./skeleton-rk4WuHqh.js";import{D as kt,a as At,b as It,c as Sn,d as wn,e as _n,f as Nn}from"./drawer-CemU5qiA.js";import{u as Pt}from"./use-mobile--PifyK00.js";import{G as Dn}from"./use-registry-app-Bs5fLaKB.js";import{G as kn}from"./github-repo-picker-WGLIOn68.js";import{b as An,a as Tt}from"./hooks-DO_GgbQ9.js";import{u as In,g as Pn,a as Tn,b as On}from"./use-navigate-to-agent-BBbQ-aHe.js";import{u as Ot}from"./shell-layout-CxYEqHLt.js";import{f as zt}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-2V1qih3c.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-BP-6YHKf.js";import{u as Mt,a as $t,g as Bn,C as Je}from"./connection-card-DrMoCtl4.js";import{e as Ft,d as Lt,a as Bt,b as Et,h as En,c as Vn}from"./dialog-poX5N6OF.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-C-lRFMd0.js";import{T as Un}from"./textarea-uMNP0LCC.js";import{b as Vt}from"./use-connection-Bmwh1M0H.js";import{n as Le,i as Ze}from"./Tool02-9ZNic0qo.js";import{s as et}from"./Star01-CXoaBlcx.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-jobllNge.js";import{a as tt}from"./authenticate-and-persist-oauth-Bkljayza.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-u1HJ_eBo.js";import{u as ut}from"./use-infinite-scroll-B7e1w8Ad.js";import{B as Fe}from"./badge-DF-If9rp.js";import{u as es}from"./useSuspenseInfiniteQuery-BVdkw7ML.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-B1eVxu6k.js";import{u as ns}from"./use-ai-providers-laCpnXdd.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Ut({name:qt().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let c;e[1]!==o?(c=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await oe.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==c?(m={mutationFn:c,onSuccess:d},e[4]=c,e[5]=m):m=e[5];const u=Xt(m);let g;e[6]!==u.error||e[7]!==o?(g=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=g):g=e[8];const l=g;let p;e[9]!==o?(p=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=p):p=e[10];let C;e[11]!==p?(C=t.jsx(fn,{children:p}),e[11]=p,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let h;e[15]!==x?(h=t.jsx(gn,{children:x}),e[15]=x,e[16]=h):h=e[16];let j;e[17]!==C||e[18]!==h?(j=t.jsxs(pn,{children:[C,h]}),e[17]=C,e[18]=h,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(bn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==l?(N=l&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:l}),e[31]=l,e[32]=N):N=e[32];const A=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(hn,{disabled:A,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Cn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(xn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let I;e[56]!==a||e[57]!==k?(I=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=I):I=e[58];let z;e[59]!==j||e[60]!==I?(z=t.jsxs(jn,{children:[j,I]}),e[59]=j,e[60]=I,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(vn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Rt(){const n=H.useContext(Wt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let c;e[0]!==r?(c=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==c||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:c,style:d,children:m}),e[9]=c,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await oe.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Yt();let d;try{d=(await oe.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},c=async()=>{o(!0);try{const d=await oe.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!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(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),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(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Qt(),{invitations:c,refetch:d}=Rt();let m;e[0]!==s?(m=(k,I)=>k.slug===s?-1:I.slug===s?1:k.name.localeCompare(I.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[g,l]=H.useState(""),p=g.toLowerCase(),C=p?u.filter(k=>k.name.toLowerCase().includes(p)||k.slug.toLowerCase().includes(p)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{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=k=>l(k.target.value),e[3]=h):h=e[3];let j;e[4]!==g?(j=k=>k.key==="Escape"&&g&&l(""),e[4]=g,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==g||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:g,onChange:h,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=g,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let A;e[15]!==y||e[16]!==N?(A=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=A):A=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==c||e[19]!==g||e[20]!==d?(f=!g&&c.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=c,e[19]=g,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:g?r("header.orgSwitcher.noOrganizationsMatch",{query:g}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==A?(P=t.jsxs(t.Fragment,{children:[A,v]}),e[29]=v,e[30]=A,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,c=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[g,l]=H.useState(!1);let p;e[0]!==s?(p=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=p):p=e[1];const C=String(m);let x;e[2]!==d?(x=A=>{u(!1),d({to:"/$org",params:{org:A}})},e[2]=d,e[3]=x):x=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u(!1),l(!0)},e[4]=h):h=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:h},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==c||e[11]!==j?(b=t.jsx(St,{side:c,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=c,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==p||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[p,b]}),e[13]=m,e[14]=p,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==g?(w=t.jsx(os,{open:g,onOpenChange:l}),e[17]=g,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:c,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const g=d?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==g?(l=X("flex items-center gap-2.5 h-12 px-4",g),e[2]=g,e[3]=l):l=e[3];let p;e[4]!==c?(p=c?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=p):p=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let h;e[14]!==l||e[15]!==p||e[16]!==x?(h=t.jsxs("label",{className:l,children:[p,x]}),e[14]=l,e[15]=p,e[16]=x,e[17]=h):h=e[17];let j;return e[18]!==u||e[19]!==h?(j=t.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Ht(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==o?(c=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=c):c=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==c?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Jt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=r,e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Gt,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Dn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=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:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==i?(c=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=c):c=e[7];let d;return e[8]!==a||e[9]!==c?(d=t.jsx(Gt,{action:a,children:c}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==c?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:c,children:d}),e[7]=r,e[8]=a,e[9]=c,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let g;e[10]!==u?(g=t.jsx("span",{children:u}),e[10]=u,e[11]=g):g=e[11];let l;return e[12]!==a||e[13]!==c||e[14]!==d||e[15]!==g?(l=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:c,onClick:d,children:[m,g]})}),e[12]=a,e[13]=c,e[14]=d,e[15]=g,e[16]=l):l=e[16],l}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(It,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let c;return e[5]!==o||e[6]!==r?(c=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==u?(g=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:c,children:[d,u]})}),e[10]=a,e[11]=c,e[12]=u,e[13]=g):g=e[13];let l;e[14]!==g||e[15]!==s?(l=s(g),e[14]=g,e[15]=s,e[16]=l):l=e[16];let p;return e[17]!==l?(p=t.jsx(Ct,{children:l}),e[17]=l,e[18]=p):p=e[18],p}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let c;return e[6]!==o||e[7]!==a?(c=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8],c}function _s(n){const e=$.c(4),s=Re(),{create:i}=An();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(vt,{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 d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let g;e[12]!==i?(g=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=g):g=e[13];let l;return e[14]!==o||e[15]!==a||e[16]!==c||e[17]!==u||e[18]!==g?(l=t.jsxs("button",{type:"button",onClick:o,className:a,children:[c,u,g]}),e[14]=o,e[15]=a,e[16]=c,e[17]=u,e[18]=g,e[19]=l):l=e[19],l}function Gt(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,c]=H.useState(""),d=un(),m=d??[],{org:u}=ae(),{data:g}=oe.useSession(),l=g?.user?.id??"anon",p=Pn(d),C=Tn(),x=_s(u.slug),h=fs(d),j=a.toLowerCase(),b=m.filter(Is).filter(L=>!h.has(L.id)).filter(As).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),A=!a||N.title.toLowerCase().includes(j),O=!!(i&&A);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),c("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),c("");return}On({orgId:u.id,userId:l},L.id,p),C(),s(),c(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:c}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&A&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),I=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==I||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,I,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=I,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Ht(n.metadata)}function ks(n){return Ht(n.metadata)}function As(n){return!cn(n.id)}function Is(n){return!rn(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:c,align:d}=s,m=i===void 0?!1:i,u=c===void 0?"right":c,g=d===void 0?"start":d,[l,p]=H.useState(!1),[C,x]=H.useState(!1),h=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=I=>b?t.jsx(ws,{children:I}):I,e[2]=b,e[3]=w):w=e[3];const N=w;let A;e[4]!==h||e[5]!==j?(A=()=>{p(!1),h&&j(!1)},e[4]=h,e[5]=j,e[6]=A):A=e[6];const O=A;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==l||e[13]!==a?(T=l&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(yn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=l,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==g||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==h||e[20]!==l||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=h?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:p,emptyCtaClass:y})):t.jsx(bs,{setOpen:p,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:l,onOpenChange:p,direction:"bottom",children:t.jsxs(At,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:l,onOpenChange:I=>{I&&!l&&R("agent_browser_opened",{surface:"desktop_popover"}),p(I)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:g,children:S})]}),e[15]=g,e[16]=m,e[17]=y,e[18]=b,e[19]=h,e[20]=l,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(kn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag 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 Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=mn(s)??i??null,c=a?.title??"Super Agent",d=`Open ${c} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==c?(u=t.jsx(vt,{icon:m,name:c,size:"xs"}),e[0]=m,e[1]=c,e[2]=u):u=e[2];let g;e[3]!==o||e[4]!==d||e[5]!==u?(g=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag 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:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=g):g=e[6];let l;e[7]!==c?(l=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:c}),e[7]=c,e[8]=l):l=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=p):p=e[9];let C;e[10]!==l?(C=t.jsxs("button",{type:"button",className:Ts,children:[l,p]}),e[10]=l,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let h;return e[16]!==g||e[17]!==x?(h=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[g,x]}),e[16]=g,e[17]=x,e[18]=h):h=e[18],h}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),c=Rt().invitations.length>0,d=r==="collapsed"||a,m=c?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==d?(g=c&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=c,e[5]=d,e[6]=g):g=e[6];let l;e[7]!==u||e[8]!==g?(l=t.jsxs("span",{className:"relative inline-flex",children:[u,g]}),e[7]=u,e[8]=g,e[9]=l):l=e[9];let p;e[10]!==o.name||e[11]!==i?(p=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=p):p=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==l||e[16]!==p?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag 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:[l,p,C]})}),e[14]=m,e[15]=l,e[16]=p,e[17]=x):x=e[17];let h;e[18]!==o.slug||e[19]!==x?(h=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=h):h=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==h?(b=t.jsxs(Se,{children:[h,j]}),e[23]=j,e[24]=h,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const c=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:g}=oe.useSession(),{setTaskId:l,createNewTask:p}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,h=x.id,j=c.taskId?m.virtualmcpid??h:h;let b;e[6]!==p||e[7]!==h||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==g?.user?.id||e[12]!==l||e[13]!==u?(b=f=>{if(!f||f===h){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=zt(u,f,g?.user?.id);_?l(_.id,f):p(f),i?.()},e[6]=p,e[7]=h,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=g?.user?.id,e[12]=l,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===h?x:void 0;let A;e[16]!==j||e[17]!==y?(A=()=>y(j),e[16]=j,e[17]=y,e[18]=A):A=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==A?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:A,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=A,e[23]=O):O=e[23],O}function Ro(){const n=$.c(23),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:c}=Tt(),{data:d}=oe.useSession(),{setTaskId:m,createNewTask:u}=Ot();let g;n[2]!==s.id?(g=it(s.id),n[2]=s.id,n[3]=g):g=n[3];const l=g.id,p=o.taskId?a.virtualmcpid??l:l;let C;n[4]!==p||n[5]!==u||n[6]!==d?.user?.id||n[7]!==m||n[8]!==c?(C=()=>{const A=zt(c,p,d?.user?.id);A?m(A.id,p):u(p)},n[4]=p,n[5]=u,n[6]=d?.user?.id,n[7]=m,n[8]=c,n[9]=C):C=n[9];const x=C;let h;n[10]!==e?(h=e("sidebar.taskGroupsList.newChat"),n[10]=e,n[11]=h):h=n[11];let j;n[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:16}),n[12]=j):j=n[12];let b;n[13]!==x||n[14]!==h?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":h,className:"wco-no-drag 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:j})}),n[13]=x,n[14]=h,n[15]=b):b=n[15];let y;n[16]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[16]=e,n[17]=y):y=n[17];let w;n[18]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[18]=y,n[19]=w):w=n[19];let N;return n[20]!==b||n[21]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[20]=b,n[21]=w,n[22]=N):N=n[22],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=oe.useSession(),{stdioEnabled:a}=Zt(),c=Pt(),d=Vt(),m=Mt(),g=$t(m,"").items,l=pt({resolver:gt(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:[]}}),p=l.watch("ui_type"),C=l.watch("connection_url"),x=l.watch("npx_package"),h=$e({uiType:p,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:p,connectionUrl:C??"",registryItems:g}),j=f=>{const _=f.trim();if(!_)return;const T=!!l.formState.dirtyFields.title,S=!!l.formState.dirtyFields.description,v=!!l.formState.dirtyFields.env_vars,P=I=>{if(I&&(!T&&!l.getValues("title").trim()&&I.title&&l.setValue("title",I.title,{shouldDirty:!1}),!S&&!(l.getValues("description")??"").trim()&&I.description&&l.setValue("description",I.description,{shouldDirty:!1}),!v&&I.envVarKeys?.length)){const z=l.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=I.envVarKeys.filter(M=>!B.has(M));E.length>0&&l.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",k.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const I=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";l.setValue("ui_type",I,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:I,connectionUrl:_})??dt({uiType:I,connectionUrl:_,registryItems:g}));return}p==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||l.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.icon??null,app_name:null,app_id:null,connection_headers:v,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),A=l.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(an,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),p==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:h?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:h?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.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:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(Sn,{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(It,{children:w}),t.jsx(wn,{className:"mt-1",children:N})]}),t.jsx(_n,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(Nn,{children:t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:A})})]})})]})}):t.jsx(Ft,{open:n,onOpenChange:b,children:t.jsxs(Lt,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Et,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:A})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:c,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:g,defaultTab:l}=n,p=s===void 0?"add":s,C=l===void 0?"connected":l,x=V(),{org:h}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[A,O]=en(tn.connectionsTab(h.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==A||e[5]!==O?(f=D=>{D!==A&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=A,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==h.id||e[8]!==h.slug?(T={connectionId:ln,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=T):T=e[9];const S=dn(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},I=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,h.id,"","CONNECTIONS",I),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=Mt(),re=$t(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=A==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ae;e[10]!==o?(Ae=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ae):Ae=e[11];const Ke=Ae;let Ie;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==p||e[17]!==r||e[18]!==g||e[19]!==a||e[20]!==x?(Ie=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(p==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),g?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=p,e[17]=r,e[18]=g,e[19]=a,e[20]=x,e[21]=Ie):Ie=e[21];const Pe=Ie;let Te;e[22]!==d||e[23]!==p||e[24]!==c||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{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")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),c(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=p,e[24]=c,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==A||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:A,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=A,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Kt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{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"})]}),We=W&&_e.map(lt),Qe=W&&Ne.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"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Kt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==A||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(A==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=A,e[59]=K.length,e[60]=Ne,e[61]=m,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 ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",c="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{c&&R("agent_connection_attached",{agent_id:c,connection_id:S,app_name:v,mode:P})},[g,l]=H.useState(null),[p,C]=H.useState(i),[x,h]=H.useState(!1),{org:j}=ae(),{data:b}=oe.useSession(),y=Vt(),w=nn(),N=Re(),A=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{l(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:I,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:I,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:I,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(I);return}z.ran&&await f(I,"clone"),u(I,S.app_name??null,"clone"),m(I)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},T=async S=>{if(!(!j||!b?.user?.id)){l(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,I=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!I){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return t.jsxs(Ft,{open:n,onOpenChange:e,children:[t.jsxs(Lt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Et,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:p,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:c,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:g,search:p,onCreateConnection:()=>h(!0),onBrowseNavigate:A,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:h,onCreated:async S=>{h(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(h=>h.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:c}=sn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const h=ft.get(n.id);u.current.get(n.id)&&h!=null&&d>h&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-h,previous_balance_cents:h,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const g=!!i,l=d!=null&&d>0,p=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:g,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:l,isZeroBalance:p,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:c,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Ht as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
1
+ import{W as Ut,X as qt,c as $,b as V,Y as gt,Z as pt,e as Xt,j as t,a as oe,B as ne,r as H,aH as Wt,d as Re,m as X,s as Qt,t as G,w as Yt,k as ke,p as R,F as ae,L as Jt,f as ht,u as xt,D as Zt,I as en,G as tn,K as ot,o as nn,n as sn}from"./index-C7paW5qO.js";import{t as jt}from"./ChevronDown-Bx3JuxA4.js";import{A as vt,h as on,b as an}from"./agent-icon-ibE4Mzzu.js";import{T as Ce,a as ye,c as Se}from"./tooltip-Du-iZy7N.js";import{u as bt,d as Ct,c as yt}from"./sidebar-CsCKy7i2.js";import{a as it,i as rn,f as cn,S as ln,u as dn}from"./use-mcp-client-D_VzqTLh.js";import{a as un,u as mn}from"./use-virtual-mcp-CBDJvgVd.js";import{a as Be,b as St,P as wt}from"./popover-BARdtmQ6.js";import{i as Ee}from"./Check-BdLBTBRG.js";import{s as we}from"./Plus-CyjW8iPH.js";import{i as _t}from"./SearchMd-DkKUttLm.js";import{s as Nt}from"./XClose-CcoerXx4.js";import{c as fn,d as gn,b as pn,f as hn,e as xn,a as jn,A as vn}from"./alert-dialog-BWhpN8gU.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as bn,e as ee}from"./form-BOHVNPhz.js";import{I as ie}from"./input-B7NjdaWP.js";import{S as Cn}from"./chat-context-DoZ1baNe.js";import{T as Dt}from"./toolbar-icon-button-CdCR26vG.js";import{S as yn}from"./skeleton-C6T-49IJ.js";import{D as kt,a as At,b as It,c as Sn,d as wn,e as _n,f as Nn}from"./drawer-DQHW9t04.js";import{u as Pt}from"./use-mobile-CWC5nRCB.js";import{G as Dn}from"./use-registry-app-CXrI3NDe.js";import{G as kn}from"./github-repo-picker-DcHCLyjR.js";import{b as An,a as Tt}from"./hooks-C9juaECv.js";import{u as In,g as Pn,a as Tn,b as On}from"./use-navigate-to-agent-DroDm4RE.js";import{u as Ot}from"./shell-layout-BbDwMSR1.js";import{f as zt}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-5eKJWC8a.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-C_r5IGMb.js";import{u as Mt,a as $t,g as Bn,C as Je}from"./connection-card-Cdfh1gnU.js";import{e as Ft,d as Lt,a as Bt,b as Et,h as En,c as Vn}from"./dialog-CKP-t2d8.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-Cofdiz7g.js";import{T as Un}from"./textarea-Cu9wZQ0x.js";import{b as Vt}from"./use-connection-IvaPXMMI.js";import{n as Le,i as Ze}from"./Tool02-_NBLVeeV.js";import{s as et}from"./Star01-Hbm6yGaD.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-ofcrOZAr.js";import{a as tt}from"./authenticate-and-persist-oauth-D2zBt4t0.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-CNvc5FXj.js";import{u as ut}from"./use-infinite-scroll-BZi9tXU0.js";import{B as Fe}from"./badge-Coz8TMU0.js";import{u as es}from"./useSuspenseInfiniteQuery-CvxvsZx8.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-BgcbqxiX.js";import{u as ns}from"./use-ai-providers-DVcvRuW8.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Ut({name:qt().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let c;e[1]!==o?(c=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await oe.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==c?(m={mutationFn:c,onSuccess:d},e[4]=c,e[5]=m):m=e[5];const u=Xt(m);let g;e[6]!==u.error||e[7]!==o?(g=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=g):g=e[8];const l=g;let p;e[9]!==o?(p=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=p):p=e[10];let C;e[11]!==p?(C=t.jsx(fn,{children:p}),e[11]=p,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let h;e[15]!==x?(h=t.jsx(gn,{children:x}),e[15]=x,e[16]=h):h=e[16];let j;e[17]!==C||e[18]!==h?(j=t.jsxs(pn,{children:[C,h]}),e[17]=C,e[18]=h,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(bn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==l?(N=l&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:l}),e[31]=l,e[32]=N):N=e[32];const A=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(hn,{disabled:A,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Cn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(xn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let I;e[56]!==a||e[57]!==k?(I=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=I):I=e[58];let z;e[59]!==j||e[60]!==I?(z=t.jsxs(jn,{children:[j,I]}),e[59]=j,e[60]=I,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(vn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Rt(){const n=H.useContext(Wt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let c;e[0]!==r?(c=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==c||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:c,style:d,children:m}),e[9]=c,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await oe.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Yt();let d;try{d=(await oe.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},c=async()=>{o(!0);try{const d=await oe.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!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(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),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(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Qt(),{invitations:c,refetch:d}=Rt();let m;e[0]!==s?(m=(k,I)=>k.slug===s?-1:I.slug===s?1:k.name.localeCompare(I.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[g,l]=H.useState(""),p=g.toLowerCase(),C=p?u.filter(k=>k.name.toLowerCase().includes(p)||k.slug.toLowerCase().includes(p)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{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=k=>l(k.target.value),e[3]=h):h=e[3];let j;e[4]!==g?(j=k=>k.key==="Escape"&&g&&l(""),e[4]=g,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==g||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:g,onChange:h,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=g,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let A;e[15]!==y||e[16]!==N?(A=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=A):A=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==c||e[19]!==g||e[20]!==d?(f=!g&&c.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=c,e[19]=g,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:g?r("header.orgSwitcher.noOrganizationsMatch",{query:g}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==A?(P=t.jsxs(t.Fragment,{children:[A,v]}),e[29]=v,e[30]=A,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,c=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[g,l]=H.useState(!1);let p;e[0]!==s?(p=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=p):p=e[1];const C=String(m);let x;e[2]!==d?(x=A=>{u(!1),d({to:"/$org",params:{org:A}})},e[2]=d,e[3]=x):x=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u(!1),l(!0)},e[4]=h):h=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:h},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==c||e[11]!==j?(b=t.jsx(St,{side:c,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=c,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==p||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[p,b]}),e[13]=m,e[14]=p,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==g?(w=t.jsx(os,{open:g,onOpenChange:l}),e[17]=g,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:c,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const g=d?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==g?(l=X("flex items-center gap-2.5 h-12 px-4",g),e[2]=g,e[3]=l):l=e[3];let p;e[4]!==c?(p=c?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=p):p=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let h;e[14]!==l||e[15]!==p||e[16]!==x?(h=t.jsxs("label",{className:l,children:[p,x]}),e[14]=l,e[15]=p,e[16]=x,e[17]=h):h=e[17];let j;return e[18]!==u||e[19]!==h?(j=t.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Ht(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==o?(c=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=c):c=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==c?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Jt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=r,e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Gt,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Dn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=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:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==i?(c=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=c):c=e[7];let d;return e[8]!==a||e[9]!==c?(d=t.jsx(Gt,{action:a,children:c}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==c?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:c,children:d}),e[7]=r,e[8]=a,e[9]=c,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let g;e[10]!==u?(g=t.jsx("span",{children:u}),e[10]=u,e[11]=g):g=e[11];let l;return e[12]!==a||e[13]!==c||e[14]!==d||e[15]!==g?(l=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:c,onClick:d,children:[m,g]})}),e[12]=a,e[13]=c,e[14]=d,e[15]=g,e[16]=l):l=e[16],l}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(It,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let c;return e[5]!==o||e[6]!==r?(c=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==u?(g=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:c,children:[d,u]})}),e[10]=a,e[11]=c,e[12]=u,e[13]=g):g=e[13];let l;e[14]!==g||e[15]!==s?(l=s(g),e[14]=g,e[15]=s,e[16]=l):l=e[16];let p;return e[17]!==l?(p=t.jsx(Ct,{children:l}),e[17]=l,e[18]=p):p=e[18],p}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let c;return e[6]!==o||e[7]!==a?(c=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8],c}function _s(n){const e=$.c(4),s=Re(),{create:i}=An();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(vt,{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 d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let g;e[12]!==i?(g=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=g):g=e[13];let l;return e[14]!==o||e[15]!==a||e[16]!==c||e[17]!==u||e[18]!==g?(l=t.jsxs("button",{type:"button",onClick:o,className:a,children:[c,u,g]}),e[14]=o,e[15]=a,e[16]=c,e[17]=u,e[18]=g,e[19]=l):l=e[19],l}function Gt(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,c]=H.useState(""),d=un(),m=d??[],{org:u}=ae(),{data:g}=oe.useSession(),l=g?.user?.id??"anon",p=Pn(d),C=Tn(),x=_s(u.slug),h=fs(d),j=a.toLowerCase(),b=m.filter(Is).filter(L=>!h.has(L.id)).filter(As).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),A=!a||N.title.toLowerCase().includes(j),O=!!(i&&A);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),c("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),c("");return}On({orgId:u.id,userId:l},L.id,p),C(),s(),c(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:c}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&A&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),I=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==I||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,I,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=I,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Ht(n.metadata)}function ks(n){return Ht(n.metadata)}function As(n){return!cn(n.id)}function Is(n){return!rn(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:c,align:d}=s,m=i===void 0?!1:i,u=c===void 0?"right":c,g=d===void 0?"start":d,[l,p]=H.useState(!1),[C,x]=H.useState(!1),h=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=I=>b?t.jsx(ws,{children:I}):I,e[2]=b,e[3]=w):w=e[3];const N=w;let A;e[4]!==h||e[5]!==j?(A=()=>{p(!1),h&&j(!1)},e[4]=h,e[5]=j,e[6]=A):A=e[6];const O=A;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==l||e[13]!==a?(T=l&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(yn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=l,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==g||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==h||e[20]!==l||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=h?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:p,emptyCtaClass:y})):t.jsx(bs,{setOpen:p,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:l,onOpenChange:p,direction:"bottom",children:t.jsxs(At,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:l,onOpenChange:I=>{I&&!l&&R("agent_browser_opened",{surface:"desktop_popover"}),p(I)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:g,children:S})]}),e[15]=g,e[16]=m,e[17]=y,e[18]=b,e[19]=h,e[20]=l,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(kn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag 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 Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=mn(s)??i??null,c=a?.title??"Super Agent",d=`Open ${c} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==c?(u=t.jsx(vt,{icon:m,name:c,size:"xs"}),e[0]=m,e[1]=c,e[2]=u):u=e[2];let g;e[3]!==o||e[4]!==d||e[5]!==u?(g=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag 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:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=g):g=e[6];let l;e[7]!==c?(l=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:c}),e[7]=c,e[8]=l):l=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=p):p=e[9];let C;e[10]!==l?(C=t.jsxs("button",{type:"button",className:Ts,children:[l,p]}),e[10]=l,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let h;return e[16]!==g||e[17]!==x?(h=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[g,x]}),e[16]=g,e[17]=x,e[18]=h):h=e[18],h}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),c=Rt().invitations.length>0,d=r==="collapsed"||a,m=c?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==d?(g=c&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=c,e[5]=d,e[6]=g):g=e[6];let l;e[7]!==u||e[8]!==g?(l=t.jsxs("span",{className:"relative inline-flex",children:[u,g]}),e[7]=u,e[8]=g,e[9]=l):l=e[9];let p;e[10]!==o.name||e[11]!==i?(p=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=p):p=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==l||e[16]!==p?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag 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:[l,p,C]})}),e[14]=m,e[15]=l,e[16]=p,e[17]=x):x=e[17];let h;e[18]!==o.slug||e[19]!==x?(h=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=h):h=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==h?(b=t.jsxs(Se,{children:[h,j]}),e[23]=j,e[24]=h,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const c=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:g}=oe.useSession(),{setTaskId:l,createNewTask:p}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,h=x.id,j=c.taskId?m.virtualmcpid??h:h;let b;e[6]!==p||e[7]!==h||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==g?.user?.id||e[12]!==l||e[13]!==u?(b=f=>{if(!f||f===h){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=zt(u,f,g?.user?.id);_?l(_.id,f):p(f),i?.()},e[6]=p,e[7]=h,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=g?.user?.id,e[12]=l,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===h?x:void 0;let A;e[16]!==j||e[17]!==y?(A=()=>y(j),e[16]=j,e[17]=y,e[18]=A):A=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==A?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:A,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=A,e[23]=O):O=e[23],O}function Ro(){const n=$.c(23),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:c}=Tt(),{data:d}=oe.useSession(),{setTaskId:m,createNewTask:u}=Ot();let g;n[2]!==s.id?(g=it(s.id),n[2]=s.id,n[3]=g):g=n[3];const l=g.id,p=o.taskId?a.virtualmcpid??l:l;let C;n[4]!==p||n[5]!==u||n[6]!==d?.user?.id||n[7]!==m||n[8]!==c?(C=()=>{const A=zt(c,p,d?.user?.id);A?m(A.id,p):u(p)},n[4]=p,n[5]=u,n[6]=d?.user?.id,n[7]=m,n[8]=c,n[9]=C):C=n[9];const x=C;let h;n[10]!==e?(h=e("sidebar.taskGroupsList.newChat"),n[10]=e,n[11]=h):h=n[11];let j;n[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:16}),n[12]=j):j=n[12];let b;n[13]!==x||n[14]!==h?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":h,className:"wco-no-drag 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:j})}),n[13]=x,n[14]=h,n[15]=b):b=n[15];let y;n[16]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[16]=e,n[17]=y):y=n[17];let w;n[18]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[18]=y,n[19]=w):w=n[19];let N;return n[20]!==b||n[21]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[20]=b,n[21]=w,n[22]=N):N=n[22],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=oe.useSession(),{stdioEnabled:a}=Zt(),c=Pt(),d=Vt(),m=Mt(),g=$t(m,"").items,l=pt({resolver:gt(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:[]}}),p=l.watch("ui_type"),C=l.watch("connection_url"),x=l.watch("npx_package"),h=$e({uiType:p,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:p,connectionUrl:C??"",registryItems:g}),j=f=>{const _=f.trim();if(!_)return;const T=!!l.formState.dirtyFields.title,S=!!l.formState.dirtyFields.description,v=!!l.formState.dirtyFields.env_vars,P=I=>{if(I&&(!T&&!l.getValues("title").trim()&&I.title&&l.setValue("title",I.title,{shouldDirty:!1}),!S&&!(l.getValues("description")??"").trim()&&I.description&&l.setValue("description",I.description,{shouldDirty:!1}),!v&&I.envVarKeys?.length)){const z=l.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=I.envVarKeys.filter(M=>!B.has(M));E.length>0&&l.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",k.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const I=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";l.setValue("ui_type",I,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:I,connectionUrl:_})??dt({uiType:I,connectionUrl:_,registryItems:g}));return}p==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||l.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.icon??null,app_name:null,app_id:null,connection_headers:v,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),A=l.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(an,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),p==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:h?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:h?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.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:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(Sn,{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(It,{children:w}),t.jsx(wn,{className:"mt-1",children:N})]}),t.jsx(_n,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(Nn,{children:t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:A})})]})})]})}):t.jsx(Ft,{open:n,onOpenChange:b,children:t.jsxs(Lt,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Et,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:A})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:c,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:g,defaultTab:l}=n,p=s===void 0?"add":s,C=l===void 0?"connected":l,x=V(),{org:h}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[A,O]=en(tn.connectionsTab(h.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==A||e[5]!==O?(f=D=>{D!==A&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=A,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==h.id||e[8]!==h.slug?(T={connectionId:ln,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=T):T=e[9];const S=dn(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},I=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,h.id,"","CONNECTIONS",I),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=Mt(),re=$t(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=A==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ae;e[10]!==o?(Ae=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ae):Ae=e[11];const Ke=Ae;let Ie;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==p||e[17]!==r||e[18]!==g||e[19]!==a||e[20]!==x?(Ie=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(p==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),g?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=p,e[17]=r,e[18]=g,e[19]=a,e[20]=x,e[21]=Ie):Ie=e[21];const Pe=Ie;let Te;e[22]!==d||e[23]!==p||e[24]!==c||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{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")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),c(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=p,e[24]=c,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==A||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:A,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=A,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Kt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{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"})]}),We=W&&_e.map(lt),Qe=W&&Ne.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"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Kt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==A||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(A==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=A,e[59]=K.length,e[60]=Ne,e[61]=m,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 ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",c="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{c&&R("agent_connection_attached",{agent_id:c,connection_id:S,app_name:v,mode:P})},[g,l]=H.useState(null),[p,C]=H.useState(i),[x,h]=H.useState(!1),{org:j}=ae(),{data:b}=oe.useSession(),y=Vt(),w=nn(),N=Re(),A=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{l(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:I,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:I,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:I,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(I);return}z.ran&&await f(I,"clone"),u(I,S.app_name??null,"clone"),m(I)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},T=async S=>{if(!(!j||!b?.user?.id)){l(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,I=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!I){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return t.jsxs(Ft,{open:n,onOpenChange:e,children:[t.jsxs(Lt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Et,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:p,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:c,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:g,search:p,onCreateConnection:()=>h(!0),onBrowseNavigate:A,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:h,onCreated:async S=>{h(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(h=>h.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:c}=sn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const h=ft.get(n.id);u.current.get(n.id)&&h!=null&&d>h&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-h,previous_balance_cents:h,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const g=!!i,l=d!=null&&d>0,p=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:g,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:l,isZeroBalance:p,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:c,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Ht as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-DAtTWfgt.js";import{d as R,D as u}from"./decopilot-sse-pool-BuymyfF0.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-C7paW5qO.js";import{d as R,D as u}from"./decopilot-sse-pool-BjZ-wPbg.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,F as se,o as ie,r as ce,t as Y,b1 as re,b2 as ae}from"./index-DAtTWfgt.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-BbSxHfpk.js";import{u as de}from"./studio-tools-B1eVxu6k.js";function ue(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=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 H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,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]!==w||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:w,onOpenChange:m,children:j}),e[31]=w,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 v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=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]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,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 F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let b;e[58]!==A||e[59]!==F?(b=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=b):b=e[60];let I;e[61]!==y||e[62]!==b?(I=n.jsxs(V,{children:[y,b]}),e[61]=y,e[62]=b,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 K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==I||e[77]!==K?($=n.jsxs(te,{children:[I,K]}),e[76]=I,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==N||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:N,children:$}),e[79]=J,e[80]=N,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==p||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[p,k]}),e[83]=p,e[84]=k,e[85]=Q):Q=e[85],Q}function De({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=de(),[d,c]=ce.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{re(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===ae&&l.queryKey[3]===o})},m=o=>{t(),w(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{ue as D,De as u};
1
+ import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,b1 as re,b2 as ae}from"./index-C7paW5qO.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-BWhpN8gU.js";import{u as de}from"./studio-tools-BgcbqxiX.js";function ue(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=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 H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,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]!==w||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:w,onOpenChange:m,children:j}),e[31]=w,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 v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=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]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,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 F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let b;e[58]!==A||e[59]!==F?(b=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=b):b=e[60];let I;e[61]!==y||e[62]!==b?(I=n.jsxs(V,{children:[y,b]}),e[61]=y,e[62]=b,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 K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==I||e[77]!==K?($=n.jsxs(te,{children:[I,K]}),e[76]=I,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==N||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:N,children:$}),e[79]=J,e[80]=N,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==p||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[p,k]}),e[83]=p,e[84]=k,e[85]=Q):Q=e[85],Q}function De({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=de(),[d,c]=ce.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{re(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===ae&&l.queryKey[3]===o})},m=o=>{t(),w(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{ue as D,De as u};
@@ -1 +1 @@
1
- import{c as s,n as m,K as c}from"./index-DAtTWfgt.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,n as m,K as c}from"./index-C7paW5qO.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,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-DAtTWfgt.js";import{u as f}from"./studio-tools-B1eVxu6k.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.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}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.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],d(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.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],F(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.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],F(l)}export{I as a,q as b,_ as c,m as u};
1
+ import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-C7paW5qO.js";import{u as f}from"./studio-tools-BgcbqxiX.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.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}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.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],d(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.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],F(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.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],F(l)}export{I as a,q as b,_ as c,m as u};
@@ -1 +1 @@
1
- import{aK as d,dU as l,dV as v,r as i}from"./index-DAtTWfgt.js";var p=class extends d{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:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(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{p as I,b as u};
1
+ import{aK as d,dU as l,dV as v,r as i}from"./index-C7paW5qO.js";var p=class extends d{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:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(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{p as I,b as u};
@@ -1 +1 @@
1
- import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-DAtTWfgt.js";import{a as S}from"./use-capability-DzC2Klfd.js";import{u as O}from"./studio-tools-B1eVxu6k.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
1
+ import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-C7paW5qO.js";import{a as S}from"./use-capability-Cx0l8hzs.js";import{u as O}from"./studio-tools-BgcbqxiX.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
@@ -1 +1 @@
1
- import{r as R,aC as $,aA as V,j as a,bA as W,ax as x,aB as I,bB as Y,aD as C,bC as w,bD as Q,az as A,bz as X,by as J,c as S,b as Z,z as ee,av as oe,F as te,K as re,x as se}from"./index-DAtTWfgt.js";import{B as _}from"./badge-DF-If9rp.js";import{c as k,T as E,a as P,b as ae}from"./tooltip-D1kWwXpZ.js";import{g as ne}from"./index-yo4ZLMjW.js";import{s as ie}from"./Eye-Bk2Xgrvg.js";import{s as ce}from"./Star01-CXoaBlcx.js";import{aC as le}from"./agent-icon-D8X6NgHQ.js";import{i as de}from"./mcp-oauth-DjzzahSx.js";var g="Radio",[ue,N]=A(g),[pe,fe]=ue(g),T=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:n,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...f}=d,[u,v]=R.useState(null),p=I(e,h=>v(h)),m=R.useRef(!1),y=u?l||!!u.closest("form"):!0;return a.jsxs(pe,{scope:t,checked:o,disabled:s,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":L(o),"data-disabled":s?"":void 0,disabled:s,value:i,...f,ref:p,onClick:C(d.onClick,h=>{o||c?.(),y&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),y&&a.jsx(K,{control:u,bubbles:!m.current,name:n,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});T.displayName=g;var G="RadioIndicator",D=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:n,...o}=d,r=fe(G,t);return a.jsx(Q,{present:n||r.checked,children:a.jsx(x.span,{"data-state":L(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});D.displayName=G;var ve="RadioBubbleInput",K=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:n=!0,...o},r)=>{const s=R.useRef(null),i=I(s,r),c=X(t),l=J(e);return R.useEffect(()=>{const f=s.current;if(!f)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&p){const m=new Event("click",{bubbles:n});p.call(f,t),f.dispatchEvent(m)}},[c,t,n]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});K.displayName=ve;function L(d){return d?"checked":"unchecked"}var me=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[Re]=A(b,[w,N]),O=w(),B=N(),[ye,he]=Re(b),M=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...v}=d,p=O(t),m=$(l),[y,h]=V({prop:r,defaultProp:o??null,onChange:u,caller:b});return a.jsx(ye,{scope:t,name:n,required:s,disabled:i,value:y,onValueChange:h,children:a.jsx(W,{asChild:!0,...p,orientation:c,dir:m,loop:f,children:a.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});M.displayName=b;var U="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:n,...o}=d,r=he(U,t),s=r.disabled||n,i=O(t),c=B(t),l=R.useRef(null),f=I(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const p=y=>{me.includes(y.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),a.jsx(Y,{asChild:!0,...i,focusable:!s,active:u,children:a.jsx(T,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:f,onCheck:()=>r.onValueChange(o.value),onKeyDown:C(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:C(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=U;var xe="RadioGroupIndicator",q=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...n}=d,o=B(t);return a.jsx(D,{...o,...n,ref:e})});q.displayName=xe;var we=M,Ae=F,Se=q;const be=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:ie,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:ee,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:oe,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:ce,variant:"outline"}];function Ne(d){const e=S.c(22),{annotations:t,_meta:n}=d,o=Z();let r;e[0]!==n?(r=ne(n),e[0]=n,e[1]=r):r=e[1];const s=!!r;let i,c,l,f,u;if(e[2]!==t||e[3]!==s||e[4]!==o){u=Symbol.for("react.early_return_sentinel");e:{const m=t?be.filter(h=>t[h.key]===!0):[];if(m.length===0&&!s){u=null;break e}i=ae,c="flex gap-1 flex-nowrap",e[10]!==s||e[11]!==o?(l=s&&a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:a.jsx(le,{})})}),a.jsx(P,{children:o("tools.toolsList.interactive")})]}),e[10]=s,e[11]=o,e[12]=l):l=e[12];let y;e[13]!==o?(y=h=>{const{labelKey:j,Icon:z,variant:H}=h;return a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:H,className:"size-6 p-1",children:a.jsx(z,{})})}),a.jsx(P,{children:o(j)})]},j)},e[13]=o,e[14]=y):y=e[14],f=m.map(y)}e[2]=t,e[3]=s,e[4]=o,e[5]=i,e[6]=c,e[7]=l,e[8]=f,e[9]=u}else i=e[5],c=e[6],l=e[7],f=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let v;e[15]!==c||e[16]!==l||e[17]!==f?(v=a.jsxs("div",{className:c,children:[l,f]}),e[15]=c,e[16]=l,e[17]=f,e[18]=v):v=e[18];let p;return e[19]!==i||e[20]!==v?(p=a.jsx(i,{children:v}),e[19]=i,e[20]=v,e[21]=p):p=e[21],p}function Te(d){const e=S.c(11),{connectionId:t}=d,{org:n}=te();let o,r,s;e[0]!==t||e[1]!==n.slug?(o=new URL(`/api/${n.slug}/mcp/${t}`,window.location.origin),s=se,r=re.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=n.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==n.id?(i=()=>de({url:o.href,token:null,orgId:n.id}),e[5]=o,e[6]=n.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}export{Ae as I,we as R,Ne as T,Se as a,Te as u};
1
+ import{r as R,aC as $,aA as V,j as a,bA as W,ax as x,aB as I,bB as Y,aD as C,bC as w,bD as Q,az as A,bz as X,by as J,c as S,b as Z,z as ee,av as oe,F as te,K as re,x as se}from"./index-C7paW5qO.js";import{B as _}from"./badge-Coz8TMU0.js";import{c as k,T as E,a as P,b as ae}from"./tooltip-Du-iZy7N.js";import{g as ne}from"./index-CpkyNb-g.js";import{s as ie}from"./Eye-BBuEG2Wd.js";import{s as ce}from"./Star01-Hbm6yGaD.js";import{aC as le}from"./agent-icon-ibE4Mzzu.js";import{i as de}from"./mcp-oauth-iPqAJoGm.js";var g="Radio",[ue,N]=A(g),[pe,fe]=ue(g),T=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:n,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...f}=d,[u,v]=R.useState(null),p=I(e,h=>v(h)),m=R.useRef(!1),y=u?l||!!u.closest("form"):!0;return a.jsxs(pe,{scope:t,checked:o,disabled:s,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":L(o),"data-disabled":s?"":void 0,disabled:s,value:i,...f,ref:p,onClick:C(d.onClick,h=>{o||c?.(),y&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),y&&a.jsx(K,{control:u,bubbles:!m.current,name:n,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});T.displayName=g;var G="RadioIndicator",D=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:n,...o}=d,r=fe(G,t);return a.jsx(Q,{present:n||r.checked,children:a.jsx(x.span,{"data-state":L(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});D.displayName=G;var ve="RadioBubbleInput",K=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:n=!0,...o},r)=>{const s=R.useRef(null),i=I(s,r),c=X(t),l=J(e);return R.useEffect(()=>{const f=s.current;if(!f)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&p){const m=new Event("click",{bubbles:n});p.call(f,t),f.dispatchEvent(m)}},[c,t,n]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});K.displayName=ve;function L(d){return d?"checked":"unchecked"}var me=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[Re]=A(b,[w,N]),O=w(),B=N(),[ye,he]=Re(b),M=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...v}=d,p=O(t),m=$(l),[y,h]=V({prop:r,defaultProp:o??null,onChange:u,caller:b});return a.jsx(ye,{scope:t,name:n,required:s,disabled:i,value:y,onValueChange:h,children:a.jsx(W,{asChild:!0,...p,orientation:c,dir:m,loop:f,children:a.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});M.displayName=b;var U="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:n,...o}=d,r=he(U,t),s=r.disabled||n,i=O(t),c=B(t),l=R.useRef(null),f=I(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const p=y=>{me.includes(y.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),a.jsx(Y,{asChild:!0,...i,focusable:!s,active:u,children:a.jsx(T,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:f,onCheck:()=>r.onValueChange(o.value),onKeyDown:C(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:C(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=U;var xe="RadioGroupIndicator",q=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...n}=d,o=B(t);return a.jsx(D,{...o,...n,ref:e})});q.displayName=xe;var we=M,Ae=F,Se=q;const be=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:ie,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:ee,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:oe,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:ce,variant:"outline"}];function Ne(d){const e=S.c(22),{annotations:t,_meta:n}=d,o=Z();let r;e[0]!==n?(r=ne(n),e[0]=n,e[1]=r):r=e[1];const s=!!r;let i,c,l,f,u;if(e[2]!==t||e[3]!==s||e[4]!==o){u=Symbol.for("react.early_return_sentinel");e:{const m=t?be.filter(h=>t[h.key]===!0):[];if(m.length===0&&!s){u=null;break e}i=ae,c="flex gap-1 flex-nowrap",e[10]!==s||e[11]!==o?(l=s&&a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:a.jsx(le,{})})}),a.jsx(P,{children:o("tools.toolsList.interactive")})]}),e[10]=s,e[11]=o,e[12]=l):l=e[12];let y;e[13]!==o?(y=h=>{const{labelKey:j,Icon:z,variant:H}=h;return a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:H,className:"size-6 p-1",children:a.jsx(z,{})})}),a.jsx(P,{children:o(j)})]},j)},e[13]=o,e[14]=y):y=e[14],f=m.map(y)}e[2]=t,e[3]=s,e[4]=o,e[5]=i,e[6]=c,e[7]=l,e[8]=f,e[9]=u}else i=e[5],c=e[6],l=e[7],f=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let v;e[15]!==c||e[16]!==l||e[17]!==f?(v=a.jsxs("div",{className:c,children:[l,f]}),e[15]=c,e[16]=l,e[17]=f,e[18]=v):v=e[18];let p;return e[19]!==i||e[20]!==v?(p=a.jsx(i,{children:v}),e[19]=i,e[20]=v,e[21]=p):p=e[21],p}function Te(d){const e=S.c(11),{connectionId:t}=d,{org:n}=te();let o,r,s;e[0]!==t||e[1]!==n.slug?(o=new URL(`/api/${n.slug}/mcp/${t}`,window.location.origin),s=se,r=re.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=n.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==n.id?(i=()=>de({url:o.href,token:null,orgId:n.id}),e[5]=o,e[6]=n.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}export{Ae as I,we as R,Ne as T,Se as a,Te as u};