decocms 3.107.0 → 3.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/client/assets/{AlertCircle-CMPJVwbr.js → AlertCircle-ByTXkYNI.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BZym3T1n.js → ArrowUpRight-CL9n-WDh.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-QaRkyWTy.js → CheckCircle-p0O3wB_Y.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-MjAOnuHm.js → ChevronDown-DRuvsGxX.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-CaEi0Ql6.js → ChevronLeft-B_yoXR4i.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-Bggdd2Qb.js → ChevronRight-Cepv8z09.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BI8Q0KCd.js → ChevronUp-B4RIEAN8.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-h9OltsuW.js → DotsVertical-BFFxg8UG.js} +1 -1
  9. package/dist/client/assets/{Eye-CiHeAXBi.js → Eye-Bo7-1RF1.js} +1 -1
  10. package/dist/client/assets/{FilterLines-B44v5Lx3.js → FilterLines-DsHV7fvW.js} +1 -1
  11. package/dist/client/assets/{Globe01-D3B0ZpoQ.js → Globe01-Bezpb3Ky.js} +1 -1
  12. package/dist/client/assets/{Globe04-CZGzaUeg.js → Globe04-D2hdgzHN.js} +1 -1
  13. package/dist/client/assets/{HardDrive-DOlIuOW5.js → HardDrive-BkUNrUlz.js} +1 -1
  14. package/dist/client/assets/{Key01-7V_ke0M2.js → Key01-D3DEaNZK.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-CJtrx6Ua.js → LayoutLeft-BhegPG-z.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BrCl9X8s.js → LinkExternal01-DOxfhY3w.js} +1 -1
  17. package/dist/client/assets/{Monitor01-DmJn0Xdx.js → Monitor01-XY8uqELa.js} +1 -1
  18. package/dist/client/assets/{Palette-yYRvf-TN.js → Palette-DYjuOwIi.js} +1 -1
  19. package/dist/client/assets/{Play-Cu-3YV7r.js → Play-HcwDsAmD.js} +1 -1
  20. package/dist/client/assets/{Plus-B-FGzVUP.js → Plus-DGbYQT29.js} +1 -1
  21. package/dist/client/assets/{SearchLg-BFWxMS9X.js → SearchLg-B-a8ssOn.js} +1 -1
  22. package/dist/client/assets/{SearchMd-Byi6dKBM.js → SearchMd-DdqVVqfH.js} +1 -1
  23. package/dist/client/assets/{Settings02-BShYLaZd.js → Settings02-DXB9q0iO.js} +1 -1
  24. package/dist/client/assets/{Shield01-uufcEZDy.js → Shield01-CT2F2VR2.js} +1 -1
  25. package/dist/client/assets/{Star01-zfVBP9ir.js → Star01-RheQH995.js} +1 -1
  26. package/dist/client/assets/{Stars01-BPAFwodm.js → Stars01-neUtYSmu.js} +1 -1
  27. package/dist/client/assets/{Stars02-BSNSGyod.js → Stars02-BCjErCQw.js} +1 -1
  28. package/dist/client/assets/{Sun-1-Hvx1Ew.js → Sun-BIUxe_Po.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-B3GndgYh.js → SwitchHorizontal01-BCSu95F_.js} +1 -1
  30. package/dist/client/assets/{Tool01-CtsjPgQT.js → Tool01-CUGuq3hx.js} +1 -1
  31. package/dist/client/assets/{Trash01-BOlMGjjk.js → Trash01-C6IjS63F.js} +1 -1
  32. package/dist/client/assets/{Upload01-DT20S4kC.js → Upload01-C1fp_vNV.js} +1 -1
  33. package/dist/client/assets/{User01-MlOAkWV2.js → User01-CHVyllbt.js} +1 -1
  34. package/dist/client/assets/{Users01-xtXb7Nfj.js → Users01-B8kQ2xbG.js} +1 -1
  35. package/dist/client/assets/{Users03-BW0GYkX3.js → Users03-C_NmkZGE.js} +1 -1
  36. package/dist/client/assets/{X-B8sLr84E.js → X-Ct1DS1Iw.js} +1 -1
  37. package/dist/client/assets/{XCircle-brEJ5T3F.js → XCircle-B9_OLXTb.js} +1 -1
  38. package/dist/client/assets/{XClose-C7BFv2WT.js → XClose-3hOkuPOL.js} +1 -1
  39. package/dist/client/assets/{Zap-JwJYg7mG.js → Zap-B9WYRqZJ.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-DZRGZSZa.js → ZapSquare-CwqvGdec.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-BTdqGEzT.js → ZoomOut-9_3XTXkT.js} +1 -1
  42. package/dist/client/assets/{access-gate-D-ENz8ic.js → access-gate-CgXbiECq.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-DWwTmyTY.js → add-section-modal-MZ_EDgox.js} +1 -1
  44. package/dist/client/assets/{agent-icon-B_o3wufy.js → agent-icon-DbfWF8aS.js} +1 -1
  45. package/dist/client/assets/{agents-list-BmacdMx-.js → agents-list-49XIQVqz.js} +1 -1
  46. package/dist/client/assets/{ai-providers-1J-5ov2d.js → ai-providers-D3o8GfQk.js} +1 -1
  47. package/dist/client/assets/{alert-4WTxROsk.js → alert-Dqz-4n4y.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-P0HjjxBt.js → alert-dialog-iFQJsxnA.js} +1 -1
  49. package/dist/client/assets/app-editor-Bcvm45uJ.js +1 -0
  50. package/dist/client/assets/{auth-B4aNCnK1.js → auth-9yXjZraX.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-DA62NHq9.js → auth-catchall-DZap-_Ic.js} +1 -1
  52. package/dist/client/assets/{auth-entry-DOnzMaqv.js → auth-entry-BdCiqBMy.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-Dzsy7Wh-.js → auth-split-layout-Dirm-xKL.js} +1 -1
  54. package/dist/client/assets/{authenticate-and-persist-oauth-Cf_RluiA.js → authenticate-and-persist-oauth-DyAyQAmh.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-BGfOIH5A.js → automation-list-row-f1279Y0k.js} +1 -1
  56. package/dist/client/assets/{automation-runs-BpjM5lgm.js → automation-runs-B3DiZ3Tr.js} +1 -1
  57. package/dist/client/assets/{automations-Cr5_dGMq.js → automations-CZMUHd8h.js} +1 -1
  58. package/dist/client/assets/{avatar-DVWIK2_g.js → avatar-Du-WMTON.js} +1 -1
  59. package/dist/client/assets/{badge-DjgeHK0H.js → badge-vPySVXPf.js} +1 -1
  60. package/dist/client/assets/{block-document-Cazj3EmL.js → block-document-CDbxWna3.js} +1 -1
  61. package/dist/client/assets/{brand-context-CavCacnS.js → brand-context-DF1u1XAA.js} +1 -1
  62. package/dist/client/assets/{buckets-D7ind9F_.js → buckets-BHi3KCLA.js} +1 -1
  63. package/dist/client/assets/bulk-category-panel-c25cch3x.js +1 -0
  64. package/dist/client/assets/{capability-load-error-BM4sOhb_.js → capability-load-error-R_U0MZpN.js} +1 -1
  65. package/dist/client/assets/{card-BoMxvMNj.js → card-DY_MHU46.js} +1 -1
  66. package/dist/client/assets/category-editor-Wb2Vpif9.js +1 -0
  67. package/dist/client/assets/{chat-context-BNm8gbce.js → chat-context-_fclfdYm.js} +1 -1
  68. package/dist/client/assets/{checkbox-C0jia2rg.js → checkbox-AQTpliB1.js} +1 -1
  69. package/dist/client/assets/{cli-auth-success-dXy3stat.js → cli-auth-success-BcPmokPO.js} +1 -1
  70. package/dist/client/assets/collection-detail-DBKCkbpA.js +1 -0
  71. package/dist/client/assets/{collection-display-button-CXTwGitF.js → collection-display-button-BSpr_buk.js} +1 -1
  72. package/dist/client/assets/{collection-search-CTWT2tOk.js → collection-search-DX9gHVQL.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-QOIvDftU.js → collection-tabs-CF8CdOrB.js} +1 -1
  74. package/dist/client/assets/{command-BF5cH0fj.js → command-B3IYAlxC.js} +1 -1
  75. package/dist/client/assets/{commerce-onboarding-B2t05Fby.js → commerce-onboarding-BDSmR88W.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-B06-h5Nw.js → connect-desktop-dialog-D0T3_ZVN.js} +1 -1
  77. package/dist/client/assets/{connection-card-C1lQp9ha.js → connection-card-B58bof-I.js} +1 -1
  78. package/dist/client/assets/connection-detail-DnnHcJZU.js +1 -0
  79. package/dist/client/assets/{connection-form-helpers-CZdUpiQP.js → connection-form-helpers-CnS4SROV.js} +1 -1
  80. package/dist/client/assets/{connections-D54uxQNk.js → connections-0x8vuulY.js} +1 -1
  81. package/dist/client/assets/{context-menu-DjpSQHDd.js → context-menu-J8Xrq6FF.js} +1 -1
  82. package/dist/client/assets/{decopilot-B1xAdfGk.js → decopilot-B4m6jb6c.js} +1 -1
  83. package/dist/client/assets/{decopilot-sse-pool-CHxQ_LL4.js → decopilot-sse-pool-B-bUekW0.js} +1 -1
  84. package/dist/client/assets/{dialog-D5pyPA9N.js → dialog-BJ02tcBq.js} +1 -1
  85. package/dist/client/assets/{domain-settings-DxSkbwuB.js → domain-settings-CKmKvsJ7.js} +1 -1
  86. package/dist/client/assets/{drawer-CL-lpG-j.js → drawer-DPe1ut4R.js} +1 -1
  87. package/dist/client/assets/{dropdown-menu-4WYZIGjr.js → dropdown-menu-Byix_6pc.js} +1 -1
  88. package/dist/client/assets/{empty-state-CXRWIWhf.js → empty-state-DyaJkwvA.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-T901gsUX.js → extract-connection-data-DuZ3Dejy.js} +1 -1
  90. package/dist/client/assets/file-explorer-CNBKgyqq.js +2 -0
  91. package/dist/client/assets/{file-type-icon-B2x2Y-0k.js → file-type-icon-BEEcT8Af.js} +1 -1
  92. package/dist/client/assets/{files-DFAdeLGv.js → files-kKGnWQCo.js} +1 -1
  93. package/dist/client/assets/{form-BF9w4WAV.js → form-CX-RAYCX.js} +1 -1
  94. package/dist/client/assets/{general-C7NRKQTh.js → general-Bcw588Pj.js} +1 -1
  95. package/dist/client/assets/{github-repo-picker-BSRE_ZP0.js → github-repo-picker-oROJDNqA.js} +1 -1
  96. package/dist/client/assets/{hooks-CaH8V-Zq.js → hooks-CRLFC8sB.js} +1 -1
  97. package/dist/client/assets/{import-from-deco-dialog-1mHtJ6UG.js → import-from-deco-dialog-lZYACG3R.js} +1 -1
  98. package/dist/client/assets/{index-Cudx1rWQ.js → index-0tLTtmwB.js} +1 -1
  99. package/dist/client/assets/{index-DUu26rMc.js → index-2B7-drxg.js} +1 -1
  100. package/dist/client/assets/{index-D9iADi6F.js → index-7EkiStPn.js} +1 -1
  101. package/dist/client/assets/{index-Blp6eom1.js → index-BGKmLxz1.js} +1 -1
  102. package/dist/client/assets/{index-D5EcXFQR.js → index-BHkBXhV0.js} +3 -3
  103. package/dist/client/assets/index-CB2wkPWa.js +3 -0
  104. package/dist/client/assets/index-CfOjCWn4.js +1 -0
  105. package/dist/client/assets/{index-C875GEAf.js → index-CiVn05Iz.js} +1 -1
  106. package/dist/client/assets/{index-CpAR8E3g.js → index-CxEMW1N7.js} +1 -1
  107. package/dist/client/assets/{index-CWOvdf1E.js → index-D2RQBpeW.js} +1 -1
  108. package/dist/client/assets/{index-CXvlCk1u.js → index-DQ93_JaH.js} +1 -1
  109. package/dist/client/assets/index-DSfcfP5-.js +503 -0
  110. package/dist/client/assets/index-GahqUWc8.css +1 -0
  111. package/dist/client/assets/{index-BmfLcGiW.js → index-QAeYiuQ2.js} +1 -1
  112. package/dist/client/assets/{index-NjnKq7aT.js → index-mTBM5n68.js} +1 -1
  113. package/dist/client/assets/{index-redirect-PGR2Z-TP.js → index-redirect-CoJ7MKNw.js} +1 -1
  114. package/dist/client/assets/{input-DexDCoKo.js → input-Bu2wOv0I.js} +1 -1
  115. package/dist/client/assets/{integration-icon-BdO2TGzi.js → integration-icon-CFb063uO.js} +1 -1
  116. package/dist/client/assets/{label-B7b8_W98.js → label-BTIw2INj.js} +1 -1
  117. package/dist/client/assets/{login-DRQ6ivKI.js → login-BHR_96ri.js} +1 -1
  118. package/dist/client/assets/{mcp-oauth-75_G3vbg.js → mcp-oauth-BgpoWtrX.js} +1 -1
  119. package/dist/client/assets/{members-iTiwktiS.js → members-Cn8-RhnY.js} +1 -1
  120. package/dist/client/assets/{monaco-editor-wofwNzGP.js → monaco-editor-C_7lEEIk.js} +1 -1
  121. package/dist/client/assets/{monitoring-stats-row-DZOpV8wR.js → monitoring-stats-row-BM7_cUGX.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-DBGVioja.js → oauth-callback-DIAnuAim.js} +1 -1
  123. package/dist/client/assets/{oauth-callback-ai-provider-C8hnh5JQ.js → oauth-callback-ai-provider-cPjqSqya.js} +1 -1
  124. package/dist/client/assets/{onboarding-BTkLuvSt.js → onboarding-CElpynNs.js} +1 -1
  125. package/dist/client/assets/{org-install-DsqI-XSV.js → org-install-CRlIEgIV.js} +1 -1
  126. package/dist/client/assets/{org-layout-CT-wybPj.js → org-layout-CL32pGic.js} +1 -1
  127. package/dist/client/assets/{organization-choice-DA6cRlb9.js → organization-choice-J_TihfbS.js} +1 -1
  128. package/dist/client/assets/{page-seo-form-f48UrvLZ.js → page-seo-form-DBvGQjZP.js} +1 -1
  129. package/dist/client/assets/page-seo-sheet-XHnORJDs.js +1 -0
  130. package/dist/client/assets/{popover-C4g-9bIR.js → popover-pSrKZc6j.js} +1 -1
  131. package/dist/client/assets/post-editor-BSN5fmHu.js +1 -0
  132. package/dist/client/assets/{preview-dialog-BkD-jMTL.js → preview-dialog-Ce9BBUBn.js} +1 -1
  133. package/dist/client/assets/{primitives-HnexUalB.js → primitives-B2II6G8J.js} +1 -1
  134. package/dist/client/assets/{profile-OgZpsKBH.js → profile-BEkdw1X4.js} +1 -1
  135. package/dist/client/assets/project-app-view-CnwfCIJ2.js +1 -0
  136. package/dist/client/assets/record-editor-EzOdM6ok.js +1 -0
  137. package/dist/client/assets/registry-Ci6TDk-z.js +2 -0
  138. package/dist/client/assets/{registry-layout-DR6jY145.js → registry-layout-Dq-MrEnN.js} +1 -1
  139. package/dist/client/assets/{require-capability-ByP8JmqW.js → require-capability-CeQNVfO-.js} +1 -1
  140. package/dist/client/assets/{required-auth-layout-BZ3khNc4.js → required-auth-layout-C9PH_rT6.js} +1 -1
  141. package/dist/client/assets/{reset-password-ByXWgQFi.js → reset-password-BPszdTZq.js} +1 -1
  142. package/dist/client/assets/{roles-C6FLJAxG.js → roles-D_zrTkro.js} +1 -1
  143. package/dist/client/assets/{scroll-area-mIEylF_b.js → scroll-area-DtIUkwvE.js} +1 -1
  144. package/dist/client/assets/{search-input-B5RoY0Jt.js → search-input-nqbG7oml.js} +1 -1
  145. package/dist/client/assets/{secrets-Cx_0x5Jk.js → secrets-BSJ_dca9.js} +1 -1
  146. package/dist/client/assets/{sections-editor-kz5N2Ax7.js → sections-editor-B9qnTgiE.js} +1 -1
  147. package/dist/client/assets/{select-DsHZ_cKM.js → select-B3rcyOl9.js} +1 -1
  148. package/dist/client/assets/{select-model-CXSEoijG.js → select-model-DRyo275c.js} +1 -1
  149. package/dist/client/assets/seo-editor-IdwA_Pqr.js +1 -0
  150. package/dist/client/assets/{settings-layout-B6rSZndR.js → settings-layout-D6QOzZYd.js} +1 -1
  151. package/dist/client/assets/{settings-section-DpPoYwII.js → settings-section-DDqq7Zua.js} +1 -1
  152. package/dist/client/assets/{sheet-BdP-CT3V.js → sheet-CIXBrgbr.js} +1 -1
  153. package/dist/client/assets/{shell-controls-BB7F5nRc.js → shell-controls-C57HJ_F4.js} +1 -1
  154. package/dist/client/assets/{shell-layout-fxMd_ce_.js → shell-layout-DDhAtCDL.js} +1 -1
  155. package/dist/client/assets/{shell-route-loading-DK2BrXSy.js → shell-route-loading-CF72Id57.js} +1 -1
  156. package/dist/client/assets/{sidebar-CUMG6X23.js → sidebar-D-Q_IsJd.js} +1 -1
  157. package/dist/client/assets/{skeleton-718IFt3P.js → skeleton-BzYGuvDX.js} +1 -1
  158. package/dist/client/assets/{sortable.esm-DK8NQ3hM.js → sortable.esm-DlvjRguW.js} +1 -1
  159. package/dist/client/assets/{sso-CtblN5Bz.js → sso-DfsY2Z-S.js} +1 -1
  160. package/dist/client/assets/{store-DPFq6Slo.js → store-DRJmawh3.js} +1 -1
  161. package/dist/client/assets/store-registry-CAzxZK7k.js +2 -0
  162. package/dist/client/assets/{studio-tools-BeOJw07q.js → studio-tools-D0e93l39.js} +1 -1
  163. package/dist/client/assets/{switch-CciXYGhm.js → switch-DavcV3JF.js} +1 -1
  164. package/dist/client/assets/{table-CKTQNmJo.js → table-EZy9WPu1.js} +1 -1
  165. package/dist/client/assets/{tabs-Ba2CnUCA.js → tabs-ItGZsFFe.js} +1 -1
  166. package/dist/client/assets/{task-status-Bynq6HkU.js → task-status-ItX8X7G2.js} +1 -1
  167. package/dist/client/assets/{textarea-y2Cb87mk.js → textarea-jURA3g-f.js} +1 -1
  168. package/dist/client/assets/{toggle-group-DULNiKJE.js → toggle-group-DDhKVine.js} +1 -1
  169. package/dist/client/assets/{toolbar-DMe8NxOq.js → toolbar-Dp0IpFuJ.js} +1 -1
  170. package/dist/client/assets/tools-list-BWEiH9XH.js +1 -0
  171. package/dist/client/assets/{tooltip-9uXVN57R.js → tooltip-DZabSBoT.js} +1 -1
  172. package/dist/client/assets/{types-DZW_H5GK.js → types-dii4poB0.js} +1 -1
  173. package/dist/client/assets/{use-ai-providers-B2EJOvgZ.js → use-ai-providers-FXpeT4l1.js} +1 -1
  174. package/dist/client/assets/{use-automations-CypyQIO7.js → use-automations-DhY2_UKp.js} +1 -1
  175. package/dist/client/assets/{use-capability-miGh5F03.js → use-capability-DUUcgzLu.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-BSiLW2Hc.js → use-clock-tick-LVSHr5RL.js} +1 -1
  177. package/dist/client/assets/{use-collections-C-3QxROQ.js → use-collections-BnqjBLvA.js} +1 -1
  178. package/dist/client/assets/{use-connection-BoLZLoix.js → use-connection-BxMOpR7v.js} +1 -1
  179. package/dist/client/assets/{use-copy-BoWvAcv1.js → use-copy-jr-NBNeX.js} +1 -1
  180. package/dist/client/assets/{use-create-virtual-mcp-DS79wqg7.js → use-create-virtual-mcp-DTcp2RkL.js} +1 -1
  181. package/dist/client/assets/{use-debounced-autosave-CEZtOBxe.js → use-debounced-autosave-CwC7gafx.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-B_dMYSTS.js → use-debounced-value-BrPDK119.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-BSwabbME.js → use-decopilot-events-Bp7wu-e-.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-CeUx32Ek.js → use-delete-connection-BV1vDNfG.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-CsGZaFDN.js → use-file-configs-C12rfJvN.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-DjBZ07EY.js → use-infinite-scroll-CDO2Ct0t.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-HvnfXtOh.js → use-join-requests-BquUgUR_.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-CllRpcn8.js → use-mcp-client-CKeOAxYW.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-B8n4vAIv.js → use-mcp-prompts-Cg-EvqQG.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-xIECjag4.js → use-mcp-tools-B0CkDXV_.js} +1 -1
  191. package/dist/client/assets/{use-members-C_0IATXJ.js → use-members-CMO_Es9m.js} +1 -1
  192. package/dist/client/assets/{use-mobile-DOKfF7z_.js → use-mobile-a5Hrfmrd.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-DP_Quce2.js → use-navigate-to-agent-uqBZEmLg.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-C5SxR9m4.js → use-org-auth-client-0Iw1_jcR.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-DKt2yrJB.js → use-org-fs-BeubyX8z.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-BfAMhOu1.js → use-org-sso-CUQYjyiq.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-ChVGS5c6.js → use-organization-roles-CERws3lq.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-Cn568Sdu.js → use-organization-settings-OEEAHdZN.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-Dc5qWDtU.js → use-registry-connections-u2KlLX6F.js} +1 -1
  200. package/dist/client/assets/{use-secrets-DFpbRD2F.js → use-secrets-DShjbaPZ.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-BBLiZ08j.js → use-status-sounds-BNzkDsWj.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-g5gry7KE.js → use-view-mode-BVyyJ9PY.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-D7sKQkq9.js → use-virtual-mcp-Cyl1De35.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-Fqo8ShVg.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-DrJXy5Va.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-DqEFpcN_.js → useSuspenseQueries-BKKO2wzE.js} +1 -1
  207. package/dist/client/assets/{variant-calendar-CtaHCIb0.js → variant-calendar-DK2egew4.js} +1 -1
  208. package/dist/client/assets/{view-mode-toggle-Bwq7ahqB.js → view-mode-toggle-C97FE6jH.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +439 -423
  211. package/dist/server/server.js +284 -284
  212. package/package.json +1 -1
  213. package/dist/client/assets/app-editor-CVQWSZwr.js +0 -1
  214. package/dist/client/assets/category-editor-BZfTM8Jr.js +0 -1
  215. package/dist/client/assets/collection-detail-BI_jJDe8.js +0 -1
  216. package/dist/client/assets/connection-detail-D6FqPYcQ.js +0 -1
  217. package/dist/client/assets/file-explorer-gfciE6Oz.js +0 -2
  218. package/dist/client/assets/index-BADtduG9.css +0 -1
  219. package/dist/client/assets/index-D2Fo5pUK.js +0 -3
  220. package/dist/client/assets/index-DDhGpRHB.js +0 -503
  221. package/dist/client/assets/index-DlbygLez.js +0 -1
  222. package/dist/client/assets/page-seo-sheet-x1Ndtspw.js +0 -1
  223. package/dist/client/assets/post-editor-BjFZW5Xv.js +0 -1
  224. package/dist/client/assets/project-app-view-C_tJkaVI.js +0 -1
  225. package/dist/client/assets/record-editor-DzUsMR47.js +0 -1
  226. package/dist/client/assets/registry-DGqifiQi.js +0 -2
  227. package/dist/client/assets/seo-editor-42whDzUC.js +0 -1
  228. package/dist/client/assets/store-registry-DMtj-ygY.js +0 -2
  229. package/dist/client/assets/useInfiniteQuery-Ljssdqza.js +0 -1
  230. package/dist/client/assets/useSuspenseInfiniteQuery-D7uGd-6e.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.107.0",
3
+ "version": "3.109.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-D5EcXFQR.js";import{i as je}from"./ChevronRight-Bggdd2Qb.js";import{S as ke}from"./scroll-area-mIEylF_b.js";import{A as _e}from"./add-section-modal-DWwTmyTY.js";import{ap as Be,aq as we,ar as Ae,j as Ne,k as Re,as as Ce,Y as Ee,at as Ke,ac as Te}from"./index-DDhGpRHB.js";import"./agent-icon-B_o3wufy.js";import"./AlertCircle-CMPJVwbr.js";import"./Tool01-CtsjPgQT.js";import"./SwitchHorizontal01-B3GndgYh.js";import"./Settings02-BShYLaZd.js";import"./XCircle-brEJ5T3F.js";import"./ArrowUpRight-BZym3T1n.js";import"./ZapSquare-DZRGZSZa.js";import"./Users03-BW0GYkX3.js";import"./CheckCircle-QaRkyWTy.js";import"./ChevronUp-BI8Q0KCd.js";import"./ChevronDown-MjAOnuHm.js";import"./ChevronLeft-CaEi0Ql6.js";import"./DotsVertical-h9OltsuW.js";import"./Stars02-BSNSGyod.js";import"./Eye-CiHeAXBi.js";import"./ZoomOut-BTdqGEzT.js";import"./Globe01-D3B0ZpoQ.js";import"./FilterLines-B44v5Lx3.js";import"./Star01-zfVBP9ir.js";import"./Globe04-CZGzaUeg.js";import"./HardDrive-DOlIuOW5.js";import"./Key01-7V_ke0M2.js";import"./LayoutLeft-CJtrx6Ua.js";import"./LinkExternal01-BrCl9X8s.js";import"./Monitor01-DmJn0Xdx.js";import"./Sun-1-Hvx1Ew.js";import"./Palette-yYRvf-TN.js";import"./Play-Cu-3YV7r.js";import"./Plus-B-FGzVUP.js";import"./SearchLg-BFWxMS9X.js";import"./SearchMd-Byi6dKBM.js";import"./Shield01-uufcEZDy.js";import"./Stars01-BPAFwodm.js";import"./Trash01-BOlMGjjk.js";import"./Upload01-DT20S4kC.js";import"./User01-MlOAkWV2.js";import"./Users01-xtXb7Nfj.js";import"./XClose-C7BFv2WT.js";import"./X-B8sLr84E.js";import"./Zap-JwJYg7mG.js";import"./use-clock-tick-BSiLW2Hc.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BoWvAcv1.js";import"./tooltip-9uXVN57R.js";import"./file-type-icon-B2x2Y-0k.js";import"./dialog-D5pyPA9N.js";import"./use-mobile-DOKfF7z_.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-DZW_H5GK.js";import"./use-mcp-client-CllRpcn8.js";import"./auth-B4aNCnK1.js";import"./chat-context-BNm8gbce.js";import"./hooks-CaH8V-Zq.js";import"./decopilot-sse-pool-CHxQ_LL4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-D7sKQkq9.js";import"./use-collections-C-3QxROQ.js";import"./use-ai-providers-B2EJOvgZ.js";import"./studio-tools-BeOJw07q.js";import"./use-decopilot-events-BSwabbME.js";import"./use-organization-settings-Cn568Sdu.js";import"./shell-layout-fxMd_ce_.js";import"./avatar-DVWIK2_g.js";import"./required-auth-layout-BZ3khNc4.js";import"./use-org-sso-BfAMhOu1.js";import"./sheet-BdP-CT3V.js";import"./integration-icon-BdO2TGzi.js";import"./use-navigate-to-agent-DP_Quce2.js";import"./use-connection-BoLZLoix.js";import"./use-mcp-prompts-B8n4vAIv.js";import"./form-BF9w4WAV.js";import"./label-B7b8_W98.js";import"./input-DexDCoKo.js";import"./select-DsHZ_cKM.js";import"./index-D2Fo5pUK.js";import"./drawer-CL-lpG-j.js";import"./collection-search-CTWT2tOk.js";import"./tabs-Ba2CnUCA.js";import"./toggle-group-DULNiKJE.js";import"./sortable.esm-DK8NQ3hM.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C1lQp9ha.js";import"./use-registry-connections-Dc5qWDtU.js";import"./useInfiniteQuery-Ljssdqza.js";import"./use-infinite-scroll-DjBZ07EY.js";import"./extract-connection-data-T901gsUX.js";import"./card-BoMxvMNj.js";import"./collection-tabs-QOIvDftU.js";import"./badge-DjgeHK0H.js";import"./textarea-y2Cb87mk.js";import"./connection-form-helpers-CZdUpiQP.js";import"./authenticate-and-persist-oauth-Cf_RluiA.js";import"./mcp-oauth-75_G3vbg.js";import"./useSuspenseInfiniteQuery-D7uGd-6e.js";import"./connect-desktop-dialog-B06-h5Nw.js";import"./decopilot-B1xAdfGk.js";import"./checkbox-C0jia2rg.js";import"./skeleton-718IFt3P.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DpPoYwII.js";import"./popover-C4g-9bIR.js";import"./command-BF5cH0fj.js";import"./index-Blp6eom1.js";import"./use-org-fs-DKt2yrJB.js";import"./dropdown-menu-4WYZIGjr.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BBLiZ08j.js";import"./empty-state-CXRWIWhf.js";import"./toolbar-DMe8NxOq.js";import"./preview-dialog-BkD-jMTL.js";import"./index-CWOvdf1E.js";import"./use-mcp-tools-xIECjag4.js";import"./use-capability-miGh5F03.js";import"./shell-route-loading-DK2BrXSy.js";import"./index-DlbygLez.js";import"./alert-dialog-P0HjjxBt.js";import"./switch-CciXYGhm.js";import"./use-debounced-autosave-CEZtOBxe.js";import"./index-NjnKq7aT.js";import"./sidebar-CUMG6X23.js";import"./search-input-B5RoY0Jt.js";import"./github-repo-picker-BSRE_ZP0.js";import"./use-debounced-value-B_dMYSTS.js";import"./use-secrets-DFpbRD2F.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-Bwq7ahqB.js";import"./automation-runs-BpjM5lgm.js";import"./table-CKTQNmJo.js";import"./use-members-C_0IATXJ.js";import"./use-org-auth-client-C5SxR9m4.js";import"./task-status-Bynq6HkU.js";import"./use-automations-CypyQIO7.js";import"./use-file-configs-CsGZaFDN.js";import"./monaco-editor-wofwNzGP.js";import"./select-model-CXSEoijG.js";import"./automation-list-row-BGfOIH5A.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function yr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,Y=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const G=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:J,isPending:Q}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const W=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const X=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let V;e[34]!==c||e[35]!==J||e[36]!==W?(V=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await W.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),J()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=J,e[36]=W,e[37]=V):V=e[37];const y=V;let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=t=>{P.current=t.append,re(!0)},e[38]=I):I=e[38];const ve=I;let U;e[39]!==y?(U=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=U):U=e[40];const le=U;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==Q?(j=o.jsx(Ke,{isPending:Q,isError:!1}),e[48]=Q,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==G||e[61]!==s||e[62]!==u||e[63]!==X||e[64]!==h||e[65]!==Y?(_=o.jsx(ke,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:G?o.jsx(Te,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:X,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):Y?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=G,e[61]=s,e[62]=u,e[63]=X,e[64]=h,e[65]=Y,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{yr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as W,r as S,l as q,j as t,B as U,i as Q,t as I}from"./index-D5EcXFQR.js";import{i as X}from"./XCircle-brEJ5T3F.js";import{aB as Y,V as T}from"./agent-icon-B_o3wufy.js";import{n as Z}from"./LinkExternal01-BrCl9X8s.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as st,g as it}from"./alert-dialog-P0HjjxBt.js";import{I as M}from"./input-DexDCoKo.js";import{L}from"./label-B7b8_W98.js";import{au as at,av as nt,aD as mt,at as lt,aw as R,ay as pt,aE as ct}from"./index-DDhGpRHB.js";import{c as dt,B as ut,a as gt}from"./block-document-Cazj3EmL.js";import{u as xt,s as v,E as ht}from"./primitives-HnexUalB.js";import{t as ft}from"./ChevronDown-MjAOnuHm.js";import{f as yt,h as jt,e as vt}from"./scroll-area-mIEylF_b.js";import"./AlertCircle-CMPJVwbr.js";import"./Tool01-CtsjPgQT.js";import"./SwitchHorizontal01-B3GndgYh.js";import"./Settings02-BShYLaZd.js";import"./ArrowUpRight-BZym3T1n.js";import"./ZapSquare-DZRGZSZa.js";import"./Users03-BW0GYkX3.js";import"./CheckCircle-QaRkyWTy.js";import"./ChevronUp-BI8Q0KCd.js";import"./ChevronLeft-CaEi0Ql6.js";import"./ChevronRight-Bggdd2Qb.js";import"./DotsVertical-h9OltsuW.js";import"./Stars02-BSNSGyod.js";import"./Eye-CiHeAXBi.js";import"./ZoomOut-BTdqGEzT.js";import"./Globe01-D3B0ZpoQ.js";import"./FilterLines-B44v5Lx3.js";import"./Star01-zfVBP9ir.js";import"./Globe04-CZGzaUeg.js";import"./HardDrive-DOlIuOW5.js";import"./Key01-7V_ke0M2.js";import"./LayoutLeft-CJtrx6Ua.js";import"./Monitor01-DmJn0Xdx.js";import"./Sun-1-Hvx1Ew.js";import"./Palette-yYRvf-TN.js";import"./Play-Cu-3YV7r.js";import"./Plus-B-FGzVUP.js";import"./SearchLg-BFWxMS9X.js";import"./SearchMd-Byi6dKBM.js";import"./Shield01-uufcEZDy.js";import"./Stars01-BPAFwodm.js";import"./Trash01-BOlMGjjk.js";import"./Upload01-DT20S4kC.js";import"./User01-MlOAkWV2.js";import"./Users01-xtXb7Nfj.js";import"./XClose-C7BFv2WT.js";import"./X-B8sLr84E.js";import"./Zap-JwJYg7mG.js";import"./index-D2Fo5pUK.js";import"./chat-context-BNm8gbce.js";import"./hooks-CaH8V-Zq.js";import"./use-mcp-client-CllRpcn8.js";import"./auth-B4aNCnK1.js";import"./decopilot-sse-pool-CHxQ_LL4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-D7sKQkq9.js";import"./use-collections-C-3QxROQ.js";import"./use-ai-providers-B2EJOvgZ.js";import"./studio-tools-BeOJw07q.js";import"./use-decopilot-events-BSwabbME.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-Cn568Sdu.js";import"./tooltip-9uXVN57R.js";import"./dialog-D5pyPA9N.js";import"./drawer-CL-lpG-j.js";import"./collection-search-CTWT2tOk.js";import"./use-mobile-DOKfF7z_.js";import"./use-mcp-prompts-B8n4vAIv.js";import"./shell-layout-fxMd_ce_.js";import"./avatar-DVWIK2_g.js";import"./required-auth-layout-BZ3khNc4.js";import"./use-org-sso-BfAMhOu1.js";import"./form-BF9w4WAV.js";import"./select-DsHZ_cKM.js";import"./tabs-Ba2CnUCA.js";import"./toggle-group-DULNiKJE.js";import"./sortable.esm-DK8NQ3hM.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C1lQp9ha.js";import"./use-registry-connections-Dc5qWDtU.js";import"./use-connection-BoLZLoix.js";import"./useInfiniteQuery-Ljssdqza.js";import"./use-infinite-scroll-DjBZ07EY.js";import"./extract-connection-data-T901gsUX.js";import"./card-BoMxvMNj.js";import"./integration-icon-BdO2TGzi.js";import"./collection-tabs-QOIvDftU.js";import"./badge-DjgeHK0H.js";import"./textarea-y2Cb87mk.js";import"./connection-form-helpers-CZdUpiQP.js";import"./authenticate-and-persist-oauth-Cf_RluiA.js";import"./mcp-oauth-75_G3vbg.js";import"./useSuspenseInfiniteQuery-D7uGd-6e.js";import"./connect-desktop-dialog-B06-h5Nw.js";import"./decopilot-B1xAdfGk.js";import"./checkbox-C0jia2rg.js";import"./skeleton-718IFt3P.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DpPoYwII.js";import"./popover-C4g-9bIR.js";import"./command-BF5cH0fj.js";import"./index-Blp6eom1.js";import"./use-org-fs-DKt2yrJB.js";import"./dropdown-menu-4WYZIGjr.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BBLiZ08j.js";import"./empty-state-CXRWIWhf.js";import"./toolbar-DMe8NxOq.js";import"./preview-dialog-BkD-jMTL.js";import"./index-CWOvdf1E.js";import"./file-type-icon-B2x2Y-0k.js";import"./use-mcp-tools-xIECjag4.js";import"./types-DZW_H5GK.js";import"./use-capability-miGh5F03.js";import"./shell-route-loading-DK2BrXSy.js";import"./index-DlbygLez.js";import"./switch-CciXYGhm.js";import"./use-debounced-autosave-CEZtOBxe.js";import"./index-NjnKq7aT.js";import"./sidebar-CUMG6X23.js";import"./sheet-BdP-CT3V.js";import"./search-input-B5RoY0Jt.js";import"./github-repo-picker-BSRE_ZP0.js";import"./use-debounced-value-B_dMYSTS.js";import"./use-navigate-to-agent-DP_Quce2.js";import"./use-secrets-DFpbRD2F.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./view-mode-toggle-Bwq7ahqB.js";import"./automation-runs-BpjM5lgm.js";import"./table-CKTQNmJo.js";import"./use-members-C_0IATXJ.js";import"./use-org-auth-client-C5SxR9m4.js";import"./task-status-Bynq6HkU.js";import"./use-automations-CypyQIO7.js";import"./use-file-configs-CsGZaFDN.js";import"./monaco-editor-wofwNzGP.js";import"./select-model-CXSEoijG.js";import"./automation-list-row-BGfOIH5A.js";import"./use-clock-tick-BSiLW2Hc.js";import"./use-copy-BoWvAcv1.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=W.c(18),{icon:f,title:m,defaultOpen:b,children:u}=k,D=b===void 0?!1:b,[h,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let s;e[2]!==m?(s=t.jsx("span",{className:"flex-1 text-left",children:m}),e[2]=m,e[3]=s):s=e[3];const y=h&&"rotate-180";let r;e[4]!==y?(r=q("transition-transform",y),e[4]=y,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ft,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==s||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,s,p]})}),e[8]=l,e[9]=s,e[10]=p,e[11]=c):c=e[11];let i;e[12]!==u?(i=t.jsx(jt,{className:"px-2 pt-4",children:u}),e[12]=u,e[13]=i):i=e[13];let g;return e[14]!==h||e[15]!==c||e[16]!==i?(g=t.jsxs(vt,{open:h,onOpenChange:A,className:"mt-4",children:[c,i]}),e[14]=h,e[15]=c,e[16]=i,e[17]=g):g=e[17],g}function ar({orgSlug:k,virtualMcpId:e,branch:f,blockKey:m,block:b,decofile:u,meta:D,onManagePosts:h,onOpenPost:A,previewBaseUrl:l}){const s=at({orgSlug:k,virtualMcpId:e,branch:f}),y=nt(b,"categories"),[r,p,c]=xt(y,o=>{s.mutate({blockKey:m,data:R(m,"categories",o)})}),i=(o,w)=>p({...r,[o]:w}),g=dt({decofile:u,category:r,previewBaseUrl:l}),a=v(r.slug),[B,j]=S.useState(a),[n,C]=S.useState(null),[N,E]=S.useState(!1),$=a?mt(u).filter(o=>o.categorySlugs.includes(a)):[],d=$.length,G=o=>i("slug",o),H=async(o,w)=>{const V=v(r.name);E(!0);try{let x=0;for(const{key:O,payload:P}of pt(u,"posts")){const F=ct(P,o,{name:V,slug:w});F!==P&&(await s.mutateAsync({blockKey:O,data:R(O,"posts",F)}),x+=1)}const z={...r,slug:w};await s.mutateAsync({blockKey:m,data:R(m,"categories",z)}),c(z),I.success(x>0?`Renamed slug and updated ${x} ${x===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(x){j(o),C(null),I.error(x instanceof Error?x.message:"Rename failed")}finally{E(!1)}},J=()=>{const o=B.trim();if(o===a){B!==o&&j(o);return}if(!o){j(a);return}if(d===0){G(o);return}C({oldSlug:a,newSlug:o,count:d})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:s.isPending,isError:s.isError}),g&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(g,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ht,{value:v(r.name),onChange:o=>i("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(M,{id:"category-slug",value:B,onChange:o=>j(o.target.value),onBlur:J,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(M,{id:"category-description",value:v(r.description),onChange:o=>i("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>i("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[d," ",d===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?d===0?"Go to the posts list to add posts to this category":"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts",onClick:()=>h(d===0?"":a),children:[d===0?"Add posts":"Manage posts",t.jsx(X,{size:14})]})]}),d>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!n,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:n?`Changing the slug from "${n.oldSlug}" to "${n.newSlug}" will update ${n.count} ${n.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(st,{disabled:N,children:"Cancel"}),t.jsx(it,{onClick:o=>{o.preventDefault(),n&&H(n.oldSlug,n.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(Q,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{ar as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as Z,o as Ge,s as se,E as Pe,r as T,D as ie,p as Qe,l as V,bg as Ye,u as Ze,G,t as Xe,e as ae,b2 as ke}from"./index-D5EcXFQR.js";import{E as Ee}from"./empty-state-CXRWIWhf.js";import{u as et,a as Ae}from"./use-collections-C-3QxROQ.js";import{u as ce}from"./use-mcp-client-CllRpcn8.js";import{F as ne,a as tt,b as de,d as me}from"./form-BF9w4WAV.js";import{I as ue}from"./input-DexDCoKo.js";import{T as re}from"./textarea-y2Cb87mk.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-BmfLcGiW.js";import{ak as rt,y as it,a9 as at,al as ct,Z as dt,am as mt,N as be}from"./agent-icon-B_o3wufy.js";import{g as ut,M as xt,a as Ne}from"./types-DZW_H5GK.js";import{A as pt,a as ft,b as ht}from"./alert-4WTxROsk.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-DsHZ_cKM.js";import{c as gt,T as Ce,a as Ie,b as $e}from"./tooltip-9uXVN57R.js";import{i as jt}from"./AlertCircle-CMPJVwbr.js";import{s as bt}from"./Stars02-BSNSGyod.js";import{a as Nt}from"./Eye-CiHeAXBi.js";import{i as vt}from"./Play-Cu-3YV7r.js";import{i as St}from"./ChevronRight-Bggdd2Qb.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-DlbygLez.js";import{a as Oe,u as Re}from"./use-connection-BoLZLoix.js";import{a as It}from"./use-mcp-tools-xIECjag4.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-BdO2TGzi.js";import{i as Tt,l as Pt}from"./chat-context-BNm8gbce.js";import{b as kt}from"./shell-layout-fxMd_ce_.js";import{M as Et}from"./monaco-editor-wofwNzGP.js";import{n as At}from"./XCircle-brEJ5T3F.js";import"./auth-B4aNCnK1.js";import"./label-B7b8_W98.js";import"./index-NjnKq7aT.js";import"./sidebar-CUMG6X23.js";import"./LayoutLeft-CJtrx6Ua.js";import"./use-mobile-DOKfF7z_.js";import"./sheet-BdP-CT3V.js";import"./X-B8sLr84E.js";import"./ZoomOut-BTdqGEzT.js";import"./Key01-7V_ke0M2.js";import"./extract-connection-data-T901gsUX.js";import"./use-registry-connections-Dc5qWDtU.js";import"./use-organization-settings-Cn568Sdu.js";import"./studio-tools-BeOJw07q.js";import"./Plus-B-FGzVUP.js";import"./index-C875GEAf.js";import"./index-Blp6eom1.js";import"./popover-C4g-9bIR.js";import"./use-virtual-mcp-D7sKQkq9.js";import"./ChevronUp-BI8Q0KCd.js";import"./SearchMd-Byi6dKBM.js";import"./Users03-BW0GYkX3.js";import"./use-create-virtual-mcp-DS79wqg7.js";import"./use-navigate-to-agent-DP_Quce2.js";import"./Tool01-CtsjPgQT.js";import"./SwitchHorizontal01-B3GndgYh.js";import"./Settings02-BShYLaZd.js";import"./ArrowUpRight-BZym3T1n.js";import"./ZapSquare-DZRGZSZa.js";import"./CheckCircle-QaRkyWTy.js";import"./ChevronDown-MjAOnuHm.js";import"./ChevronLeft-CaEi0Ql6.js";import"./DotsVertical-h9OltsuW.js";import"./Globe01-D3B0ZpoQ.js";import"./FilterLines-B44v5Lx3.js";import"./Star01-zfVBP9ir.js";import"./Globe04-CZGzaUeg.js";import"./HardDrive-DOlIuOW5.js";import"./LinkExternal01-BrCl9X8s.js";import"./Monitor01-DmJn0Xdx.js";import"./Sun-1-Hvx1Ew.js";import"./Palette-yYRvf-TN.js";import"./SearchLg-BFWxMS9X.js";import"./Shield01-uufcEZDy.js";import"./Stars01-BPAFwodm.js";import"./Trash01-BOlMGjjk.js";import"./Upload01-DT20S4kC.js";import"./User01-MlOAkWV2.js";import"./Users01-xtXb7Nfj.js";import"./XClose-C7BFv2WT.js";import"./Zap-JwJYg7mG.js";import"./mcp-oauth-75_G3vbg.js";import"./badge-DjgeHK0H.js";import"./hooks-CaH8V-Zq.js";import"./decopilot-sse-pool-CHxQ_LL4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-B2EJOvgZ.js";import"./use-decopilot-events-BSwabbME.js";import"./tab-id-BptcWVWa.js";import"./avatar-DVWIK2_g.js";import"./dialog-D5pyPA9N.js";import"./required-auth-layout-BZ3khNc4.js";import"./use-org-sso-BfAMhOu1.js";import"./index-CWOvdf1E.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Mt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Dt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Ze({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,X]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(X("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const je=Number(h[M]);Number.isNaN(je)||(h[M]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(Me,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&D==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(z,d),onTeardown:()=>A?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Z,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async D=>{r&&await R.update.mutateAsync({id:r,data:D})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(Me,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(De,{children:[N,A,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let D;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(D=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function zn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{zn as default};
@@ -1 +0,0 @@
1
- import{o as fe,aF as Ie,b7 as Ae,s as le,aD as De,c as P,j as t,i as ge,B as E,r as G,l as je,D as J,q as $e,K as ne,b as Y,ab as ce,z as Pe,b8 as Oe,E as ze,e as Me,b9 as Ve,m as Ee,p as Ue,n as Fe,t as q,ba as Re}from"./index-D5EcXFQR.js";import{a as Le}from"./extract-connection-data-T901gsUX.js";import{E as ve}from"./empty-state-CXRWIWhf.js";import{E as Be,c as He,r as We,b as Xe,d as qe}from"./connection-form-helpers-CZdUpiQP.js";import{c as Ge,S as Ke,V as Qe}from"./index-BmfLcGiW.js";import{u as be,T as Je}from"./index-DlbygLez.js";import{u as Ye}from"./use-members-C_0IATXJ.js";import{A as Ze}from"./avatar-DVWIK2_g.js";import{a as Ne,b as ye,u as et}from"./use-connection-BoLZLoix.js";import{u as _e}from"./use-mcp-client-CllRpcn8.js";import{a as tt}from"./use-mcp-tools-xIECjag4.js";import{a as st}from"./use-mcp-prompts-B8n4vAIv.js";import{i as nt,a as ot}from"./mcp-oauth-75_G3vbg.js";import{I as oe}from"./integration-icon-BdO2TGzi.js";import{s as it}from"./Plus-B-FGzVUP.js";import{B as at,D as rt,aj as lt,a8 as ct}from"./agent-icon-B_o3wufy.js";import{a as Se,s as dt}from"./Settings02-BShYLaZd.js";import{s as ae}from"./Trash01-BOlMGjjk.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-BdP-CT3V.js";import{F as L,b as B,c as H,d as V,e as W,f as ft,a as gt}from"./form-BF9w4WAV.js";import{I as X}from"./input-DexDCoKo.js";import{u as jt,D as vt}from"./use-delete-connection-CeUx32Ek.js";import{c as bt,C as Nt,B as yt,a as _t,b as St,d as Ct,e as wt}from"./monitoring-stats-row-DZOpV8wR.js";import{u as kt}from"./studio-tools-BeOJw07q.js";import{u as Tt}from"./use-virtual-mcp-D7sKQkq9.js";import{i as Ce}from"./ChevronRight-Bggdd2Qb.js";import{a as we}from"./Users03-BW0GYkX3.js";import{T as ee,a as It,b as te,c as At}from"./tabs-Ba2CnUCA.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-DZRGZSZa.js";import{c as $t}from"./Tool01-CtsjPgQT.js";import{g as re,M as Pt}from"./types-DZW_H5GK.js";import{C as Ot}from"./collection-search-CTWT2tOk.js";import{C as zt}from"./card-BoMxvMNj.js";import{B as Mt}from"./badge-DjgeHK0H.js";import{D as Vt,a as Et,b as Ut,c as de}from"./dropdown-menu-4WYZIGjr.js";import{d as me,b as ue,c as xe,S as pe,a as R}from"./select-DsHZ_cKM.js";import{i as Ft}from"./CheckCircle-QaRkyWTy.js";import{t as Rt}from"./ChevronDown-MjAOnuHm.js";import{n as Lt}from"./XCircle-brEJ5T3F.js";import{s as se}from"./Star01-zfVBP9ir.js";import{s as Bt}from"./XClose-C7BFv2WT.js";import"./index-NjnKq7aT.js";import"./sidebar-CUMG6X23.js";import"./LayoutLeft-CJtrx6Ua.js";import"./use-mobile-DOKfF7z_.js";import"./tooltip-9uXVN57R.js";import"./ZoomOut-BTdqGEzT.js";import"./Key01-7V_ke0M2.js";import"./auth-B4aNCnK1.js";import"./use-registry-connections-Dc5qWDtU.js";import"./use-organization-settings-Cn568Sdu.js";import"./index-C875GEAf.js";import"./index-Blp6eom1.js";import"./popover-C4g-9bIR.js";import"./ChevronUp-BI8Q0KCd.js";import"./SearchMd-Byi6dKBM.js";import"./use-create-virtual-mcp-DS79wqg7.js";import"./use-navigate-to-agent-DP_Quce2.js";import"./Eye-CiHeAXBi.js";import"./use-org-auth-client-C5SxR9m4.js";import"./User01-MlOAkWV2.js";import"./use-collections-C-3QxROQ.js";import"./AlertCircle-CMPJVwbr.js";import"./SwitchHorizontal01-B3GndgYh.js";import"./ArrowUpRight-BZym3T1n.js";import"./ChevronLeft-CaEi0Ql6.js";import"./DotsVertical-h9OltsuW.js";import"./Stars02-BSNSGyod.js";import"./Globe01-D3B0ZpoQ.js";import"./FilterLines-B44v5Lx3.js";import"./Globe04-CZGzaUeg.js";import"./HardDrive-DOlIuOW5.js";import"./LinkExternal01-BrCl9X8s.js";import"./Monitor01-DmJn0Xdx.js";import"./Sun-1-Hvx1Ew.js";import"./Palette-yYRvf-TN.js";import"./Play-Cu-3YV7r.js";import"./SearchLg-BFWxMS9X.js";import"./Shield01-uufcEZDy.js";import"./Stars01-BPAFwodm.js";import"./Upload01-DT20S4kC.js";import"./Users01-xtXb7Nfj.js";import"./X-B8sLr84E.js";import"./Zap-JwJYg7mG.js";import"./label-B7b8_W98.js";import"./alert-dialog-P0HjjxBt.js";const Ht=fe({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:fe({}),outputSchema:Ht}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let f;e[2]!==d?(f=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=f):f=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let C;e[24]!==n||e[25]!==a?(C=()=>a(n),e[24]=n,e[25]=a,e[26]=C):C=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Se,{size:13}),e[27]=y):y=e[27];let I;e[28]!==C?(I=t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:C,title:"Configure",children:y}),e[28]=C,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let S;e[34]!==_?(S=t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=S):S=e[35];let h;e[36]!==I||e[37]!==S||e[38]!==N||e[39]!==T?(h=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,S]}),e[36]=I,e[37]=S,e[38]=N,e[39]=T,e[40]=h):h=e[40];let w;return e[41]!==h||e[42]!==f||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:f,children:[g,j,h]}),e[41]=h,e[42]=f,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(E,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(E,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let f;e[8]!==x||e[9]!==d?(f=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=f):f=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:a}),children:t.jsx(Xt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==f||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,v]}),e[24]=f,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=kt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(St,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(Ct,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=G.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,f]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const C=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?C.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):C;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=S):S=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:f,placeholder:"Search apps...",onKeyDown:S}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(h=>{const w=re(h._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let f;e[4]!==d||e[5]!==o?(f=d?ke(d):o,e[4]=d,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let C;e[17]!==n.length?(C=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==C||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[C,y,I,_]})}),e[23]=C,e[24]=y,e[25]=k):k=e[25];let S;e[26]!==b||e[27]!==n?(S=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=S):S=e[28];let h;e[29]!==S?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[29]=S,e[30]=h):h=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==h||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,h,w,O,M]})}),e[44]=k,e[45]=h,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ds(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(V,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(V,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(X,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Vt,{children:[t.jsx(Et,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>d.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Bt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function ps(s){return s.command==="npx"}function hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function fs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const a=s.connection_headers,r=We(a.envVars);if(ps(a)){const i=hs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=fs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ee(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],C=f??s,y=T.find(m=>m.userId===C.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},S=Ge(k,Wt),h=Ue({resolver:Fe(He),values:he(f??s)}),w=h.formState.isDirty,z=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=gs(D),F=f?.id??e;await x.update.mutateAsync({id:F,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){q.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();q.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:f?.title??s.title}),t.jsx(ht,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:f??s,form:h,hasMcpBinding:S,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(E,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(E,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(E,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=f??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),q.success(D==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",d=p||null;let f;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(f={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=f):f=s[7];const g=_e(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Cs):(x?.tools??[]).map(Ss);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:C}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ve(y);let _;s[19]!==C?.prompts?(_=C?.prompts??[],s[19]=C?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const S=k;let h;s[23]!==I?.resources?(h=I?.resources??[],s[23]=I?.resources,s[24]=h):h=s[24];let w;s[25]!==h?(w=h.map(bs),s[25]=h,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(E,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==S||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:S,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=S,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function ro(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{ro as default};
@@ -1,2 +0,0 @@
1
- import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-D5EcXFQR.js";import{F as mt,l as pt}from"./index-CWOvdf1E.js";import{i as ht,ax as xt,ay as gt,az as ae,aA as yt,V as $e}from"./agent-icon-B_o3wufy.js";import{a as wt}from"./Tool01-CtsjPgQT.js";import{s as jt}from"./XClose-C7BFv2WT.js";import{S as bt}from"./scroll-area-mIEylF_b.js";import{T as Re,a as Oe,b as ze}from"./tooltip-9uXVN57R.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-P0HjjxBt.js";import{u as Et}from"./chat-context-BNm8gbce.js";import{b as Pt}from"./shell-layout-fxMd_ce_.js";import{am as le,an as Ae,ao as Tt}from"./index-DDhGpRHB.js";import{a as $t,b as Rt,c as Ot,D as zt,d as At,e as Wt}from"./dialog-D5pyPA9N.js";import{I as We}from"./input-DexDCoKo.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-DjpSQHDd.js";import{t as Vt}from"./ChevronDown-MjAOnuHm.js";import{i as Bt}from"./ChevronRight-Bggdd2Qb.js";import{a as Gt}from"./ZoomOut-BTdqGEzT.js";import{E as qt,q as Me,r as he,s as Qt,t as Ut,u as Ht,v as M,w as ce,g as xe,x as ge,y as Jt,z as Xt,A as ye,B as de,C as we,D as Yt,G as Zt}from"./preview-dialog-BkD-jMTL.js";import"./AlertCircle-CMPJVwbr.js";import"./SwitchHorizontal01-B3GndgYh.js";import"./Settings02-BShYLaZd.js";import"./XCircle-brEJ5T3F.js";import"./ArrowUpRight-BZym3T1n.js";import"./ZapSquare-DZRGZSZa.js";import"./Users03-BW0GYkX3.js";import"./CheckCircle-QaRkyWTy.js";import"./ChevronUp-BI8Q0KCd.js";import"./ChevronLeft-CaEi0Ql6.js";import"./DotsVertical-h9OltsuW.js";import"./Stars02-BSNSGyod.js";import"./Eye-CiHeAXBi.js";import"./Globe01-D3B0ZpoQ.js";import"./FilterLines-B44v5Lx3.js";import"./Star01-zfVBP9ir.js";import"./Globe04-CZGzaUeg.js";import"./HardDrive-DOlIuOW5.js";import"./Key01-7V_ke0M2.js";import"./LayoutLeft-CJtrx6Ua.js";import"./LinkExternal01-BrCl9X8s.js";import"./Monitor01-DmJn0Xdx.js";import"./Sun-1-Hvx1Ew.js";import"./Palette-yYRvf-TN.js";import"./Play-Cu-3YV7r.js";import"./Plus-B-FGzVUP.js";import"./SearchLg-BFWxMS9X.js";import"./SearchMd-Byi6dKBM.js";import"./Shield01-uufcEZDy.js";import"./Stars01-BPAFwodm.js";import"./Trash01-BOlMGjjk.js";import"./Upload01-DT20S4kC.js";import"./User01-MlOAkWV2.js";import"./Users01-xtXb7Nfj.js";import"./X-B8sLr84E.js";import"./Zap-JwJYg7mG.js";import"./use-clock-tick-BSiLW2Hc.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BoWvAcv1.js";import"./file-type-icon-B2x2Y-0k.js";import"./use-mobile-DOKfF7z_.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-DZW_H5GK.js";import"./use-mcp-client-CllRpcn8.js";import"./auth-B4aNCnK1.js";import"./hooks-CaH8V-Zq.js";import"./decopilot-sse-pool-CHxQ_LL4.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BeOJw07q.js";import"./sheet-BdP-CT3V.js";import"./integration-icon-BdO2TGzi.js";import"./use-virtual-mcp-D7sKQkq9.js";import"./use-collections-C-3QxROQ.js";import"./use-navigate-to-agent-DP_Quce2.js";import"./use-connection-BoLZLoix.js";import"./use-mcp-prompts-B8n4vAIv.js";import"./form-BF9w4WAV.js";import"./label-B7b8_W98.js";import"./select-DsHZ_cKM.js";import"./use-ai-providers-B2EJOvgZ.js";import"./use-decopilot-events-BSwabbME.js";import"./use-organization-settings-Cn568Sdu.js";import"./avatar-DVWIK2_g.js";import"./required-auth-layout-BZ3khNc4.js";import"./use-org-sso-BfAMhOu1.js";import"./index-D2Fo5pUK.js";import"./drawer-CL-lpG-j.js";import"./collection-search-CTWT2tOk.js";import"./tabs-Ba2CnUCA.js";import"./toggle-group-DULNiKJE.js";import"./sortable.esm-DK8NQ3hM.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C1lQp9ha.js";import"./use-registry-connections-Dc5qWDtU.js";import"./useInfiniteQuery-Ljssdqza.js";import"./use-infinite-scroll-DjBZ07EY.js";import"./extract-connection-data-T901gsUX.js";import"./card-BoMxvMNj.js";import"./collection-tabs-QOIvDftU.js";import"./badge-DjgeHK0H.js";import"./textarea-y2Cb87mk.js";import"./connection-form-helpers-CZdUpiQP.js";import"./authenticate-and-persist-oauth-Cf_RluiA.js";import"./mcp-oauth-75_G3vbg.js";import"./useSuspenseInfiniteQuery-D7uGd-6e.js";import"./connect-desktop-dialog-B06-h5Nw.js";import"./decopilot-B1xAdfGk.js";import"./checkbox-C0jia2rg.js";import"./skeleton-718IFt3P.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DpPoYwII.js";import"./popover-C4g-9bIR.js";import"./command-BF5cH0fj.js";import"./index-Blp6eom1.js";import"./use-org-fs-DKt2yrJB.js";import"./dropdown-menu-4WYZIGjr.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BBLiZ08j.js";import"./empty-state-CXRWIWhf.js";import"./toolbar-DMe8NxOq.js";import"./use-mcp-tools-xIECjag4.js";import"./use-capability-miGh5F03.js";import"./shell-route-loading-DK2BrXSy.js";import"./index-DlbygLez.js";import"./switch-CciXYGhm.js";import"./use-debounced-autosave-CEZtOBxe.js";import"./index-NjnKq7aT.js";import"./sidebar-CUMG6X23.js";import"./search-input-B5RoY0Jt.js";import"./github-repo-picker-BSRE_ZP0.js";import"./use-debounced-value-B_dMYSTS.js";import"./use-secrets-DFpbRD2F.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-Bwq7ahqB.js";import"./automation-runs-BpjM5lgm.js";import"./table-CKTQNmJo.js";import"./use-members-C_0IATXJ.js";import"./use-org-auth-client-C5SxR9m4.js";import"./task-status-Bynq6HkU.js";import"./use-automations-CypyQIO7.js";import"./use-file-configs-CsGZaFDN.js";import"./monaco-editor-wofwNzGP.js";import"./select-model-CXSEoijG.js";import"./automation-list-row-BGfOIH5A.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Bi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
- `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,Y=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Xe(J)},children:"Delete"})]})]})})]})}export{Bi as FileExplorer};