decocms 4.325.2 → 4.325.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/dist/client/assets/{AlertCircle-B0exjy2G.js → AlertCircle-Wbx84J6P.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BbyZpwNl.js → AreaChart-Cld_d890.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DDVITG8K.js → ArrowLeft-BJlpl6z3.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DY0nxQiU.js → ArrowUp-BSj9TnDQ.js} +1 -1
  5. package/dist/client/assets/{Check-DFnPCTEg.js → Check-AnkVYvzC.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-DLOuSHro.js → CheckCircle-DwmOpGug.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BcTQG1DI.js → ChevronRight-pYTAY0dL.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-DMK3FCxp.js → ChevronSelectorVertical-BbsmXbxd.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-CVSn4-gi.js → ChevronUp-3g3WN6eT.js} +1 -1
  10. package/dist/client/assets/{Copy01-DXf2ReD_.js → Copy01-sos155fT.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-Dufq2QQE.js → CreditCard01-VG7XqKoo.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CqFpz0HG.js → DotsVertical-DuuOH2An.js} +1 -1
  13. package/dist/client/assets/{Download01-GnhueTng.js → Download01-DcuqUkne.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-7Y0x3JBZ.js → ErrorBarContext-BM4rcvvu.js} +1 -1
  15. package/dist/client/assets/{Eye-CHLagXa7.js → Eye-UqfDVX8c.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-CQRzbSyx.js → GitBranch01-DLsJ2eA8.js} +1 -1
  17. package/dist/client/assets/{Globe01-DyhA33s1.js → Globe01-g_WhroPz.js} +1 -1
  18. package/dist/client/assets/{HardDrive-eC4I4aqw.js → HardDrive-DZFCo6aQ.js} +1 -1
  19. package/dist/client/assets/{Image01-D6KzR28r.js → Image01-BZ7eP3sg.js} +1 -1
  20. package/dist/client/assets/{Key01-CNitiCfD.js → Key01-ladeKbIs.js} +1 -1
  21. package/dist/client/assets/{Link01-BHe0dd0_.js → Link01-Cx-fsoFK.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CvQ-ylaK.js → LinkExternal01-Ct6ls10Y.js} +1 -1
  23. package/dist/client/assets/{Monitor01-SbvebE9T.js → Monitor01-CHYJhnW7.js} +1 -1
  24. package/dist/client/assets/{Package-BIDQhscg.js → Package-DlB0zfSe.js} +1 -1
  25. package/dist/client/assets/{Palette-DgVW07vN.js → Palette-Cwg4Tz5U.js} +1 -1
  26. package/dist/client/assets/{Play-CR4MAXKW.js → Play-CNXxnEyG.js} +1 -1
  27. package/dist/client/assets/{Plus-D-mogJXC.js → Plus-CjjCgafZ.js} +1 -1
  28. package/dist/client/assets/{SearchMd-BYpvO9Ao.js → SearchMd-CZf0Jno3.js} +1 -1
  29. package/dist/client/assets/{Sector-CorkPUdM.js → Sector-D6LGQ5el.js} +1 -1
  30. package/dist/client/assets/{Settings02-B2gnPQ3Q.js → Settings02-DA_70bcH.js} +1 -1
  31. package/dist/client/assets/{Share07-Bu5e840D.js → Share07-B_yFA1PQ.js} +1 -1
  32. package/dist/client/assets/{Shield01-BAHmK5_B.js → Shield01-P1rLU6cR.js} +1 -1
  33. package/dist/client/assets/{Stars01-CCTPiWmK.js → Stars01-izYFmAbe.js} +1 -1
  34. package/dist/client/assets/{Sun-aWHPBk6T.js → Sun-DwCUi13i.js} +1 -1
  35. package/dist/client/assets/{Tool01-DbPhfEvg.js → Tool01-Z3QYZ79t.js} +1 -1
  36. package/dist/client/assets/{Tool02-8qVRgTeE.js → Tool02-BQmdN0LJ.js} +1 -1
  37. package/dist/client/assets/{Trash01-CV8Q1VzZ.js → Trash01-B8XVvUnv.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-yPe3UG0T.js → TrendUp01-CP0vQywV.js} +1 -1
  39. package/dist/client/assets/{Upload01-B1Qytz_u.js → Upload01-CbAoc2QM.js} +1 -1
  40. package/dist/client/assets/{User01-DmJKrYPV.js → User01-Ct0i24vv.js} +1 -1
  41. package/dist/client/assets/{UserSquare-HSvWRq_9.js → UserSquare-BYbdOYH9.js} +1 -1
  42. package/dist/client/assets/{Users01-B4HgX8Cb.js → Users01-BYaxTYGQ.js} +1 -1
  43. package/dist/client/assets/{Users03-CMpVHpdR.js → Users03-jn24Kly8.js} +1 -1
  44. package/dist/client/assets/{XCircle-BN22j-Jn.js → XCircle-DlF5M8M0.js} +1 -1
  45. package/dist/client/assets/{XClose-N8lMtUXr.js → XClose-CakjP9Y8.js} +1 -1
  46. package/dist/client/assets/{Zap-BMyl5tLM.js → Zap-Bf8uxQjq.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-BUSsAg6c.js → ZoomOut-fURlNFfr.js} +1 -1
  48. package/dist/client/assets/{access-gate-BsoMn5at.js → access-gate-65i3zTD_.js} +1 -1
  49. package/dist/client/assets/{agent-icon-DyMYbwSC.js → agent-icon-Sp3pGLLY.js} +1 -1
  50. package/dist/client/assets/agents-list-BZ7PpN5S.js +1 -0
  51. package/dist/client/assets/ai-providers-DlXNHZZI.js +1 -0
  52. package/dist/client/assets/{alert-vGXUrUMH.js → alert-Covq9TpT.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-Bb1OlmEm.js → alert-dialog-Cj0fNCkE.js} +1 -1
  54. package/dist/client/assets/{analytics-tab-CLBd26bq.js → analytics-tab-BGfMFYes.js} +1 -1
  55. package/dist/client/assets/{api-keys-AQ1KvOAI.js → api-keys-CwoRMmEY.js} +1 -1
  56. package/dist/client/assets/api-keys-Dcjx1Kt1.js +1 -0
  57. package/dist/client/assets/app-editor-BXmBcjlO.js +1 -0
  58. package/dist/client/assets/{auth-Dy3Ai_hi.js → auth-DzRAXSGB.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-CAeQDale.js → auth-catchall-C0obfXjs.js} +1 -1
  60. package/dist/client/assets/{auth-entry-Bw_OxH2J.js → auth-entry-DpCTb7jI.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-zISyI7ol.js → auth-split-layout-TPhGW0ur.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-DBIvzM9b.js → authenticate-and-persist-oauth-B1cWso3x.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-Cm527FOk.js → automation-list-row-BR_7Wuv2.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CHfOqm8r.js → automation-runs-Bt1_onfP.js} +1 -1
  65. package/dist/client/assets/automations-qhDCv6KW.js +1 -0
  66. package/dist/client/assets/{avatar-B8b2hWV1.js → avatar-B5NKRFBP.js} +1 -1
  67. package/dist/client/assets/{badge-DiXK5Efu.js → badge-BmwbVsh5.js} +1 -1
  68. package/dist/client/assets/{block-document-ItsWS1DV.js → block-document-DsxmquN5.js} +1 -1
  69. package/dist/client/assets/{breadcrumb-C5kFXgQY.js → breadcrumb-B_bU6eJc.js} +1 -1
  70. package/dist/client/assets/{buckets-BapAtm2k.js → buckets-CJXf1hSG.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-D9GBldVp.js → bulk-category-panel-CEbuB3eE.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-RzShLZ2L.js → capability-load-error-Du-FbaTG.js} +1 -1
  73. package/dist/client/assets/{cards-BdTZBvrL.js → cards-D4AMs5hh.js} +1 -1
  74. package/dist/client/assets/category-editor-Q8mnyuVW.js +1 -0
  75. package/dist/client/assets/{cdn-tab-BL4NoAOo.js → cdn-tab-YI9cEF0c.js} +1 -1
  76. package/dist/client/assets/{chart-kfhwAaMN.js → chart-Dodu1xOc.js} +1 -1
  77. package/dist/client/assets/chat-context-C0gBnrEt.js +35 -0
  78. package/dist/client/assets/{checkbox-CusZZICa.js → checkbox-DnuAdak3.js} +1 -1
  79. package/dist/client/assets/{choose-editor-Cojs0lHL.js → choose-editor-z_RSHVAe.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-DtWzwr_V.js → cli-auth-success-B04DqfZh.js} +1 -1
  81. package/dist/client/assets/{client-icons-CIbINaqs.js → client-icons-DyKPA_If.js} +1 -1
  82. package/dist/client/assets/collection-detail-Bmgm6Xpz.js +1 -0
  83. package/dist/client/assets/{collection-display-button-BA2fqyxJ.js → collection-display-button-BjYcW4FZ.js} +1 -1
  84. package/dist/client/assets/{collection-search-gbLnoGWa.js → collection-search-CDZk-ZPx.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-C4Ljyh7l.js → collection-table-wrapper-CGGQrcHR.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-BGNThV3i.js → collection-tabs-D1lKbsAt.js} +1 -1
  87. package/dist/client/assets/{command-CeyGqPmM.js → command-Ci-j3lot.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-YVPg5HyO.js → commerce-onboarding-Q76OphjB.js} +1 -1
  89. package/dist/client/assets/{connect-D9TGqvpE.js → connect-CE0PvrLj.js} +1 -1
  90. package/dist/client/assets/{connect-layout-fngCpQZ1.js → connect-layout-CmPm31Qh.js} +1 -1
  91. package/dist/client/assets/{connection-card-D-rWqndL.js → connection-card-Cuu-NGPd.js} +1 -1
  92. package/dist/client/assets/connection-detail-CQJhxj9a.js +1 -0
  93. package/dist/client/assets/{connection-form-helpers-nmBh-twk.js → connection-form-helpers-CBOILzhO.js} +1 -1
  94. package/dist/client/assets/{connection-pv2H4wMd.js → connection-gqBIrJrp.js} +1 -1
  95. package/dist/client/assets/{connections-C6rPB7TJ.js → connections-k4235kPb.js} +1 -1
  96. package/dist/client/assets/{create-organization-dialog-BZKwvpuX.js → create-organization-dialog-C3yQmz3P.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool-xVL-mPxb.js → decopilot-sse-pool-CdJPh08p.js} +1 -1
  98. package/dist/client/assets/{dialog-Do-ZnJpa.js → dialog-CWKQw2WC.js} +1 -1
  99. package/dist/client/assets/{domain-settings-gHV_ko81.js → domain-settings-BSba6mpG.js} +1 -1
  100. package/dist/client/assets/download-app-dialog-BEy2Wnzj.js +1 -0
  101. package/dist/client/assets/{drawer-D4J_5BCc.js → drawer-ClX3akJx.js} +1 -1
  102. package/dist/client/assets/{dropdown-menu-C9hHhEdP.js → dropdown-menu-DUEIZWiX.js} +1 -1
  103. package/dist/client/assets/e2e-tab-DC0rCpOL.js +1 -0
  104. package/dist/client/assets/{editor-CgtWB5x3.js → editor-DeUxecc_.js} +1 -1
  105. package/dist/client/assets/{empty-state-BPIeTQLP.js → empty-state-C-9VdPkJ.js} +1 -1
  106. package/dist/client/assets/{empty-state-CRtvF4Xb.js → empty-state-DYE3rkmB.js} +1 -1
  107. package/dist/client/assets/{extract-connection-data-Cq3FrLyn.js → extract-connection-data-KaTj8mHV.js} +1 -1
  108. package/dist/client/assets/file-explorer-D4SVt02z.js +2 -0
  109. package/dist/client/assets/{file-type-icon-BoulZj-0.js → file-type-icon-CB7H_Wiy.js} +1 -1
  110. package/dist/client/assets/{folder-icon-P0KHTdfp.js → folder-icon-C6cEeAnl.js} +1 -1
  111. package/dist/client/assets/{form-j23QTiVs.js → form-CUXIC19o.js} +1 -1
  112. package/dist/client/assets/{general-BNkDnICW.js → general-DW9bVist.js} +1 -1
  113. package/dist/client/assets/github-repo-picker-9AcEQIzR.js +1 -0
  114. package/dist/client/assets/hooks-DquOZ-Xk.js +15 -0
  115. package/dist/client/assets/{hosting-tab-Bvp0zXsU.js → hosting-tab-fN4y3bIT.js} +1 -1
  116. package/dist/client/assets/{index-DkQlXscT.js → index-BRMuylL4.js} +1 -1
  117. package/dist/client/assets/{index-CaFXU7vU.js → index-BfWwYPwx.js} +1 -1
  118. package/dist/client/assets/{index-CxLq_ov_.js → index-BkawI5he.js} +3 -3
  119. package/dist/client/assets/{index-BMAJGR3J.js → index-Cdu9R7BQ.js} +1 -1
  120. package/dist/client/assets/index-CnZuejsK.js +1 -0
  121. package/dist/client/assets/index-D-9OW3Wb.js +823 -0
  122. package/dist/client/assets/{index-BVzdbF4_.js → index-D821QKnk.js} +1 -1
  123. package/dist/client/assets/{index-Bmvq3ihr.js → index-DGNeXmXN.js} +1 -1
  124. package/dist/client/assets/index-Dpj-HbFs.js +1 -0
  125. package/dist/client/assets/{index-SiTXPFii.js → index-m6p9dAul.js} +2 -2
  126. package/dist/client/assets/{index-redirect-CJiAolND.js → index-redirect-1cfJeTJH.js} +1 -1
  127. package/dist/client/assets/{infra-billing-Y3GfCRPw.js → infra-billing-H5rZU-k1.js} +1 -1
  128. package/dist/client/assets/{input-t2vq_Yhz.js → input-fTgot4-g.js} +1 -1
  129. package/dist/client/assets/{integration-icon-Cr-roc4W.js → integration-icon-BLOQWR7d.js} +1 -1
  130. package/dist/client/assets/{invite-member-dialog-CEk-b8tU.js → invite-member-dialog-BIgrWqr7.js} +1 -1
  131. package/dist/client/assets/{label-HkRxmwei.js → label-CDt53aWD.js} +1 -1
  132. package/dist/client/assets/{layout-Dxu31OnK.js → layout-C_t6Nu2o.js} +1 -1
  133. package/dist/client/assets/{login-Cx8SbtxE.js → login-C7qvLy5B.js} +1 -1
  134. package/dist/client/assets/{markdown-DFiEgKZj.js → markdown-Dzj7KfMq.js} +1 -1
  135. package/dist/client/assets/{mcp-oauth-BHYwKN2k.js → mcp-oauth-PBuEj92n.js} +1 -1
  136. package/dist/client/assets/{members-D2oEyQo4.js → members-D_XPbFzI.js} +1 -1
  137. package/dist/client/assets/{monaco-editor-BFa0VsLo.js → monaco-editor-DAtKorVX.js} +1 -1
  138. package/dist/client/assets/{monitoring-stats-row-BQP-lBLM.js → monitoring-stats-row-zC9HU0u6.js} +1 -1
  139. package/dist/client/assets/{multi-select-DtPXBo_Z.js → multi-select-Dnr7PAJj.js} +1 -1
  140. package/dist/client/assets/{oauth-callback-ccYetd0V.js → oauth-callback-Cyp9j0ys.js} +1 -1
  141. package/dist/client/assets/{oauth-callback-ai-provider-9CMbhleP.js → oauth-callback-ai-provider-BkDqDLNZ.js} +1 -1
  142. package/dist/client/assets/{onboarding-BFJvKMEA.js → onboarding-CvnwGB6M.js} +1 -1
  143. package/dist/client/assets/org-layout-DItAI5Di.js +1 -0
  144. package/dist/client/assets/{organization-choice-VRNC0lDk.js → organization-choice-Brz54IKk.js} +1 -1
  145. package/dist/client/assets/{orgs-C2coJyQH.js → orgs-CcUI9HgJ.js} +1 -1
  146. package/dist/client/assets/{page-seo-form-C6r-7uaM.js → page-seo-form-OTDku7Z1.js} +1 -1
  147. package/dist/client/assets/{popover-CpTW2alp.js → popover-DjscXujA.js} +1 -1
  148. package/dist/client/assets/post-calendar-BcunQFOG.js +1 -0
  149. package/dist/client/assets/post-editor-N40xpPkk.js +1 -0
  150. package/dist/client/assets/{primitives-MHQnCsXb.js → primitives-_Vnzju1y.js} +1 -1
  151. package/dist/client/assets/{profile-A_0trZ37.js → profile-B_l90EbD.js} +1 -1
  152. package/dist/client/assets/project-app-view-Dq7iYeXJ.js +1 -0
  153. package/dist/client/assets/{project-icon-BY6MP5uE.js → project-icon-D7jcmH3z.js} +1 -1
  154. package/dist/client/assets/{prompts-DM7CdEW3.js → prompts-fLxWWgz-.js} +1 -1
  155. package/dist/client/assets/record-editor-Ci_NDgeT.js +1 -0
  156. package/dist/client/assets/redirect-editor-BePOP1Ph.js +1 -0
  157. package/dist/client/assets/registry-Bh5jhzbl.js +2 -0
  158. package/dist/client/assets/{registry-layout-f961NKWZ.js → registry-layout-CLY27ukG.js} +1 -1
  159. package/dist/client/assets/{reports-Cs0DFjxC.js → reports-CGghkfg_.js} +1 -1
  160. package/dist/client/assets/{require-capability-B5tbYFX0.js → require-capability-D2jyLdx0.js} +1 -1
  161. package/dist/client/assets/{required-auth-layout-LhCq4pE1.js → required-auth-layout-ZGcoBsTU.js} +1 -1
  162. package/dist/client/assets/{reset-password-CCpghMSK.js → reset-password-Dkrm3cHn.js} +1 -1
  163. package/dist/client/assets/{review-settings-CDYWi0EQ.js → review-settings-DLtdjNmr.js} +1 -1
  164. package/dist/client/assets/{roles-BBW1oHcq.js → roles-CcvMkry_.js} +1 -1
  165. package/dist/client/assets/{schema-ChmhgfCW.js → schema-C5E0ePqu.js} +1 -1
  166. package/dist/client/assets/{scroll-area-B3TTluOZ.js → scroll-area-F200w2mh.js} +1 -1
  167. package/dist/client/assets/{search-input-D0Aw5sb3.js → search-input-DJIbu8BB.js} +1 -1
  168. package/dist/client/assets/{secrets-CgpThP8p.js → secrets-DMZxvEj_.js} +1 -1
  169. package/dist/client/assets/{sections-editor-CBOJB7Hp.js → sections-editor-DwiAEnZ7.js} +2 -2
  170. package/dist/client/assets/{select-CNhOTIVN.js → select-aD2SqHOW.js} +1 -1
  171. package/dist/client/assets/{select-model-BHenBcjH.js → select-model-BAm7L9iK.js} +1 -1
  172. package/dist/client/assets/{self-tool-result-gsJsfaVf.js → self-tool-result-j5kSv4ca.js} +1 -1
  173. package/dist/client/assets/seo-editor-Cm_lDZye.js +1 -0
  174. package/dist/client/assets/settings-layout-DLlpPiRj.js +1 -0
  175. package/dist/client/assets/{settings-sidebar-CqkH_Jwa.js → settings-sidebar-CFckzuH2.js} +1 -1
  176. package/dist/client/assets/{shell-controls-DnEVv7XR.js → shell-controls-B6jpfAPG.js} +1 -1
  177. package/dist/client/assets/shell-layout-BBeCMSA6.js +1 -0
  178. package/dist/client/assets/{skill-preview-D5ZuDhd0.js → skill-preview-Crvic_gM.js} +1 -1
  179. package/dist/client/assets/{skills-BjJLGoK9.js → skills-CJys28KJ.js} +1 -1
  180. package/dist/client/assets/{sso-BEJGla7K.js → sso-BbCXtvEm.js} +1 -1
  181. package/dist/client/assets/{store-DDqzPQql.js → store-DxhB5rKM.js} +1 -1
  182. package/dist/client/assets/store-registry-DECUw0kw.js +2 -0
  183. package/dist/client/assets/{switch--G1maXos.js → switch-BImv-gvt.js} +1 -1
  184. package/dist/client/assets/synced-repos-Y5DAHAzN.js +1 -0
  185. package/dist/client/assets/{table-Bi-psIbe.js → table-svMfP7N5.js} +1 -1
  186. package/dist/client/assets/{tabs-DZInEuUb.js → tabs-DX2hIJ3b.js} +1 -1
  187. package/dist/client/assets/{task-board-CcPPQONZ.js → task-board-CU2obT3r.js} +1 -1
  188. package/dist/client/assets/task-route-DCBGrQpz.js +1 -0
  189. package/dist/client/assets/{tasks-CTHZjHVD.js → tasks-g-5mQjJo.js} +1 -1
  190. package/dist/client/assets/{textarea-DFMKKUyA.js → textarea-DJdAgtmk.js} +1 -1
  191. package/dist/client/assets/{toggle-group-HQ3bB1sR.js → toggle-group-BtNaSJHm.js} +1 -1
  192. package/dist/client/assets/{toolbar-icon-button-DEqW4Jpo.js → toolbar-icon-button-DI6yIlPy.js} +1 -1
  193. package/dist/client/assets/{toolbar-CSNy9NkF.js → toolbar-kq9Y7nNF.js} +1 -1
  194. package/dist/client/assets/{track-C5SbOoh_.js → track-X0YKsDzo.js} +1 -1
  195. package/dist/client/assets/{types-hwFA5Ktg.js → types-BeDjBiKO.js} +1 -1
  196. package/dist/client/assets/{use-ai-providers-DRa-WP8c.js → use-ai-providers-AGwxnFdj.js} +1 -1
  197. package/dist/client/assets/{use-automations-Cppk9Xar.js → use-automations-CmwM0DEc.js} +1 -1
  198. package/dist/client/assets/{use-autosave-H5fEY0zQ.js → use-autosave-lN3i2RtH.js} +1 -1
  199. package/dist/client/assets/{use-connection-B3hf1saX.js → use-connection-CsZlLbEZ.js} +1 -1
  200. package/dist/client/assets/{use-copy-DvOjkuTL.js → use-copy-DHyeBoZ8.js} +1 -1
  201. package/dist/client/assets/{use-create-virtual-mcp-59Af3Rsa.js → use-create-virtual-mcp-BOvsC0DW.js} +1 -1
  202. package/dist/client/assets/{use-debounced-autosave-DQmx8pBf.js → use-debounced-autosave-8VnwrEMs.js} +1 -1
  203. package/dist/client/assets/{use-debounced-value-BLtVz2Ja.js → use-debounced-value-3IbXIZAk.js} +1 -1
  204. package/dist/client/assets/{use-decopilot-events-CkAI1xCS.js → use-decopilot-events-WOaP0SQC.js} +1 -1
  205. package/dist/client/assets/{use-delete-connection-BdxhtyUk.js → use-delete-connection-Df_yxWGf.js} +1 -1
  206. package/dist/client/assets/{use-deployment-admin-DSVf8vXV.js → use-deployment-admin-CMRSZLUJ.js} +1 -1
  207. package/dist/client/assets/{use-destination-route-BePPmQxb.js → use-destination-route-B2O150Yr.js} +1 -1
  208. package/dist/client/assets/{use-file-configs-BEZ_kwp8.js → use-file-configs-B45QMkT9.js} +1 -1
  209. package/dist/client/assets/{use-infinite-scroll-D8hgBz9p.js → use-infinite-scroll-PS5OvGme.js} +1 -1
  210. package/dist/client/assets/{use-join-requests-D-_6MxTr.js → use-join-requests-DPn5Hwkp.js} +1 -1
  211. package/dist/client/assets/{use-mcp-auth-status-CC8-P5tO.js → use-mcp-auth-status-CaPfR8Sa.js} +1 -1
  212. package/dist/client/assets/{use-mcp-client-Bzii9bW9.js → use-mcp-client-DxE4Ab64.js} +1 -1
  213. package/dist/client/assets/{use-mcp-prompts-BTyLUk2o.js → use-mcp-prompts-BNrqL_f0.js} +1 -1
  214. package/dist/client/assets/{use-members-CEM7zlP_.js → use-members-Nvqy7Dzy.js} +1 -1
  215. package/dist/client/assets/use-navigate-to-agent-Cf-IaJUb.js +5 -0
  216. package/dist/client/assets/{use-org-auth-client-Crsb07JJ.js → use-org-auth-client-BR0PCT04.js} +1 -1
  217. package/dist/client/assets/{use-org-sso-DTBnbTx7.js → use-org-sso-CblCPla_.js} +1 -1
  218. package/dist/client/assets/{use-organization-roles-6Vfaalz_.js → use-organization-roles-PibAy9Wd.js} +1 -1
  219. package/dist/client/assets/{use-organization-settings-DRchtNm3.js → use-organization-settings-BV17wl2V.js} +1 -1
  220. package/dist/client/assets/{use-panel-navigate-DSf87ewD.js → use-panel-navigate-BG-ooS17.js} +1 -1
  221. package/dist/client/assets/{use-registry-connections-DndEI7JT.js → use-registry-connections-CdSZH0XX.js} +1 -1
  222. package/dist/client/assets/{use-secrets-DmVRsGO4.js → use-secrets-BjE52mie.js} +1 -1
  223. package/dist/client/assets/{use-section-preview-base-Z9XEvq4w.js → use-section-preview-base-BmQOZ8go.js} +1 -1
  224. package/dist/client/assets/{use-status-sounds-D9cQQiox.js → use-status-sounds-tS7pmMWO.js} +1 -1
  225. package/dist/client/assets/{use-tags-C4M9TEep.js → use-tags-B-KgG3zC.js} +1 -1
  226. package/dist/client/assets/{use-view-mode-BVUyWYvX.js → use-view-mode-DRYLjqJC.js} +1 -1
  227. package/dist/client/assets/{use-virtual-mcp-Drh4_cTK.js → use-virtual-mcp-DT_fCnuE.js} +1 -1
  228. package/dist/client/assets/useInfiniteQuery-Din4IYlF.js +1 -0
  229. package/dist/client/assets/useSuspenseInfiniteQuery-BeASDmXg.js +1 -0
  230. package/dist/client/assets/{users-CxuT9c7Z.js → users-ByFjNqYU.js} +1 -1
  231. package/dist/client/assets/variant-calendar-CJr-jUZm.js +1 -0
  232. package/dist/client/assets/{view-mode-toggle-DdtTJc3o.js → view-mode-toggle-DTFhAaHw.js} +1 -1
  233. package/dist/client/index.html +1 -1
  234. package/dist/server/cli.js +1 -1
  235. package/dist/server/server.js +1 -1
  236. package/package.json +1 -1
  237. package/dist/client/assets/agents-list-DS28B9dy.js +0 -1
  238. package/dist/client/assets/ai-providers-D5QrIBul.js +0 -1
  239. package/dist/client/assets/api-keys-onistOjb.js +0 -1
  240. package/dist/client/assets/app-editor-CO72zzFt.js +0 -1
  241. package/dist/client/assets/automations-ZjgouUBF.js +0 -1
  242. package/dist/client/assets/category-editor-C2R7fccg.js +0 -1
  243. package/dist/client/assets/chat-context-D2SP0J5D.js +0 -35
  244. package/dist/client/assets/collection-detail-BW5w3jba.js +0 -1
  245. package/dist/client/assets/connection-detail-eknzRIjb.js +0 -1
  246. package/dist/client/assets/e2e-tab-0aOWE4gZ.js +0 -1
  247. package/dist/client/assets/file-explorer-DFCGDD7E.js +0 -2
  248. package/dist/client/assets/github-repo-picker-CuXoDtLm.js +0 -1
  249. package/dist/client/assets/hooks-D1D8x6_l.js +0 -15
  250. package/dist/client/assets/index-B1coIP-x.js +0 -827
  251. package/dist/client/assets/index-CeYSBtaz.js +0 -1
  252. package/dist/client/assets/index-ZeDNJ_1q.js +0 -1
  253. package/dist/client/assets/org-layout-DY_zUSdZ.js +0 -1
  254. package/dist/client/assets/post-calendar-op-KKH1q.js +0 -1
  255. package/dist/client/assets/post-editor-ClKCgdAj.js +0 -1
  256. package/dist/client/assets/project-app-view-CsHhCOz6.js +0 -1
  257. package/dist/client/assets/record-editor-BTQg6PKa.js +0 -1
  258. package/dist/client/assets/redirect-editor-CXHphZOh.js +0 -1
  259. package/dist/client/assets/registry-CT_YquLV.js +0 -2
  260. package/dist/client/assets/seo-editor-CXcll4p8.js +0 -1
  261. package/dist/client/assets/settings-layout-BuGaWoZD.js +0 -1
  262. package/dist/client/assets/shell-layout-CAB27XFS.js +0 -1
  263. package/dist/client/assets/store-registry-Ds5fAPeG.js +0 -2
  264. package/dist/client/assets/synced-repos-_n1sYI3v.js +0 -1
  265. package/dist/client/assets/task-route-GdQl-L3H.js +0 -1
  266. package/dist/client/assets/thread-intent-BCmi7agT.js +0 -1
  267. package/dist/client/assets/thread-route-Ckn7Kp8P.js +0 -1
  268. package/dist/client/assets/use-mcp-tools-3xoGjo6f.js +0 -1
  269. package/dist/client/assets/use-navigate-to-agent-CUFdthzD.js +0 -1
  270. package/dist/client/assets/useInfiniteQuery-Cy80sU-k.js +0 -1
  271. package/dist/client/assets/useSuspenseInfiniteQuery-DKd6bR20.js +0 -1
  272. package/dist/client/assets/variant-calendar-CGeSmoC0.js +0 -1
@@ -1,35 +0,0 @@
1
- import{c as O,Z as Ke,u as qe,aY as nt,n as Le,W as Y,K as re,t as ae,H as ue,J as de,d as He,cW as at,y as rt,r as M,m as ot,a7 as it,e as ct,aq as lt,j as X,b as Ae,a as ut,v as dt,cK as pt,aw as ft,o as ht}from"./index-CxLq_ov_.js";import{u as Ge,a as mt}from"./use-panel-navigate-DSf87ewD.js";import{c as gt,d as yt,A as Xe,e as St,f as vt,w as Tt}from"./thread-route-Ckn7Kp8P.js";import{w as Ue,e as je}from"./thread-intent-BCmi7agT.js";import{S as kt,c as Mt,f as It,u as bt}from"./hooks-D1D8x6_l.js";import{u as xt}from"./use-is-desktop-app-BNujXJc_.js";import{u as Ct}from"./use-mcp-client-Bzii9bW9.js";import{S as wt}from"./constants-DNuUCxmW.js";import{f as At,d as Et}from"./use-virtual-mcp-Drh4_cTK.js";import{u as Ye,p as $t,b as ye,i as _t,c as Pt}from"./use-ai-providers-DRa-WP8c.js";import{o as Rt,b as Dt}from"./location-oTTXFrSF.js";import{u as Ot}from"./use-decopilot-events-CkAI1xCS.js";import{D as Nt}from"./use-destination-route-BePPmQxb.js";import{b as qt}from"./use-organization-settings-DRchtNm3.js";function Lt(t,e=[]){return t==="stop"?"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const Qe={"claude-code-desktop":"claude-code","codex-desktop":"codex","opencode-desktop":"opencode"};function Ft(t){return t==="claude-code"?"claude-code-desktop":t==="codex"?"codex-desktop":t==="opencode"?"opencode-desktop":null}function Ut({pendingOption:t,lockedHarness:e}){return e?Ft(e):t}function jt(t){return t.thread?.harness_id!=null?{}:{branch:t.globals.branch??null}}const Qt=new Set(["decopilot","claude-code"]);function Bt({isDesktopApp:t,harnessId:e}){return e!=null&&!Qt.has(e)}function Wt(t){const e=O.c(19);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=s):s=e[0];const n=Ke(s);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const r=qe(a),o=Ge();let i;e[2]!==o||e[3]!==r?(i=nt(o)?.path??r.preview??r.skill??r.brand??null,e[2]=o,e[3]=r,e[4]=i):i=e[4];const u=i;let f;if(e[5]!==n?.params.appSlug||e[6]!==n?.params.collectionName||e[7]!==n?.params.itemId||e[8]!==u||e[9]!==t){if(f=[],t&&f.push(`### Selected Agent
2
- - ID: ${t}`),u){let b;e[11]!==u?(b=Rt(u),e[11]=u,e[12]=b):b=e[12];const w=b;let d;e[13]!==u?(d=Dt(u),e[13]=u,e[14]=d):d=e[14],f.push(`### Currently Open File
3
- The user has this file open in the Library and is most likely referring to it:
4
- - Name: ${d}
5
- - Library path: ${u}${w?`
6
- - Read/edit it with your file tools at: \`${w}\``:""}
7
-
8
- When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let h;e[15]!==n?.params.appSlug||e[16]!==n?.params.collectionName||e[17]!==n?.params.itemId?(h=[],n?.params.appSlug&&h.push(`- Connection ID: ${n?.params.appSlug}`),n?.params.collectionName&&h.push(`- Collection: ${n?.params.collectionName}`),n?.params.itemId&&h.push(`- Item ID: ${n?.params.itemId}`),e[15]=n?.params.appSlug,e[16]=n?.params.collectionName,e[17]=n?.params.itemId,e[18]=h):h=e[18],h.length>0&&f.push(`### Current Resource
9
- The user is viewing the following resource:
10
- ${h.join(`
11
- `)}
12
-
13
- Help the user understand and work with this resource.`),e[5]=n?.params.appSlug,e[6]=n?.params.collectionName,e[7]=n?.params.itemId,e[8]=u,e[9]=t,e[10]=f}else f=e[10];return f.join(`
14
-
15
- `)}function Vt(){const t=O.c(5),e=Le(),{org:s}=Y();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=n):n=t[0];const a=Ke(n);let r;return t[1]!==a?.params||t[2]!==s||t[3]!==e?(r=o=>{const u=o.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!u||!u[1])return;const f=u[1],h=a?.params.appSlug;if(!h)return;e.invalidateQueries({queryKey:re.collection(s.slug,h,f)});const b=f.toLowerCase().replace(/_/g," ");ae.success(`${b} updated`)},t[1]=a?.params,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}function Kt(){const t=O.c(4),{org:e,project:s}=Y(),n=`${e.id}/${s.id}`;let a;t[0]!==n?(a=de.taskLastViewed(n),t[0]=n,t[1]=a):a=t[1];const[,r]=ue(a,Ht);let o;return t[2]!==r?(o={markTaskRead:u=>{r(f=>({...f,[u]:new Date().toISOString()}))}},t[2]=r,t[3]=o):o=t[3],o}function Ht(t){return t??{}}function Ze(){const t=O.c(11),e=He(),{org:s}=Y(),n=gt(),a=yt(),r=Ge();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const i=qe(o);let u;t[1]!==r||t[2]!==e||t[3]!==s||t[4]!==i||t[5]!==a?(u=(b,w)=>{const d=r&&!at(r)?r:void 0,x=d?rt(d):null;e({to:Nt.agents,params:{org:s.slug,panel:x?.panel},search:{virtualmcpid:w?.virtualMcpId??a,thread:b,...x?.payload??{},...typeof i.sidepanel=="boolean"?{sidepanel:i.sidepanel}:{},...w?.autosend?{autosend:Xe}:{}}})},t[1]=r,t[2]=e,t[3]=s,t[4]=i,t[5]=a,t[6]=u):u=t[6];const f=u;let h;return t[7]!==f||t[8]!==n||t[9]!==a?(h={virtualMcpId:a,taskId:n,navigateToTask:f},t[7]=f,t[8]=n,t[9]=a,t[10]=h):h=t[10],h}function Gt(t,e){const{mimeType:s,data:n}=t;if(s.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(n),r=>r.charCodeAt(0)));return[{type:"text",text:`${e}
16
- ${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${s};base64,${n}`,filename:e,mediaType:s}]}function Be(t,e){const s=[];for(const n of t)!n||typeof n!="object"||("text"in n&&n.text?s.push({type:"text",text:`[${e}]
17
- ${n.text}`}):"blob"in n&&n.blob&&n.mimeType&&s.push({type:"file",url:`data:${n.mimeType};base64,${n.blob}`,filename:String(n.uri),mediaType:String(n.mimeType)}));return s}function Xt(t,e){const s=(t.files??[]).filter(o=>o.content?.trim()),n=t.omittedPaths??[];if(s.length===0&&n.length===0)return[];const a=s.map(o=>`<skill-file path="${o.relPath}">
18
- ${o.content.trim()}
19
- </skill-file>`).join(`
20
-
21
- `),r=n.length>0?`
22
-
23
- Other files in \`${t.sandboxPath}/\`: ${n.join(", ")}`:"";return[{type:"text",text:`[${e}]
24
- ${a}${r}`}]}function Yt(t,e){const s=[];for(const n of t){if(n.role!=="user"||!n.content)continue;const a=Array.isArray(n.content)?n.content:[n.content];for(const r of a)switch(r.type){case"text":{const o=r.text?.trim();if(!o)continue;s.push({type:"text",text:`[${e}]
25
- ${o}`});break}case"image":case"audio":{if(!r.data||!r.mimeType)continue;s.push({type:"file",url:`data:${r.mimeType};base64,${r.data}`,mediaType:r.mimeType});break}case"resource":{const o=r.resource;if(!o||!o.mimeType)continue;o&&("text"in o&&o.text?s.push({type:"text",text:`[${e}]
26
- ${o.text}`}):"blob"in o&&o.blob&&o.mimeType&&s.push({type:"file",url:`data:${o.mimeType};base64,${o.blob}`,filename:String(o.uri),mediaType:String(o.mimeType)}));break}}}return s}function ze(t){if(!t)return[];const e=[];let s="";const n=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")s+=a.text;else if(a.type==="mention"&&a.attrs){const r=a.attrs.char??"/",o=`${r}${a.attrs.name}`;if(a.attrs.kind==="task"){const i=a.attrs.metadata,u=i?.title??a.attrs.name??"",f=i?.context?.trim()||[u,i?.description?.trim()].filter(Boolean).join(`
27
-
28
- `);f&&e.push({type:"text",text:f});return}if(s+=o,r==="@"){const i=a.attrs.metadata;i&&typeof i=="object"&&!Array.isArray(i)&&"agentId"in i?e.push({type:"text",text:`[DELEGATE TO AGENT: ${i.title??a.attrs.name} (agent_id: ${i.agentId})]
29
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(i)&&e.push(...Be(i,o))}else if(a.attrs.kind==="skill"){const i=a.attrs.metadata;i&&!Array.isArray(i)&&Array.isArray(i.files)&&e.push(...Xt(i,o))}else{const i=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(i)&&i.length>0&&typeof i[0]=="object"&&i[0]!==null&&"role"in i[0]?e.push(...Yt(i,o)):Array.isArray(i)&&e.push(...Be(i,o))}}else if(a.type==="file"&&a.attrs){const r=a.attrs,o=`[file:://${encodeURIComponent(r.name)}]`;s+=o,e.push(...Gt(r,o))}if("content"in a&&Array.isArray(a.content))for(const r of a.content)n(r)}};return n(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}function Ks(t){const e=ze(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Hs(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Zt(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function Gs(t){return t.filter(e=>e.status==="queued").sort((e,s)=>e.enqueuedAt-s.enqueuedAt)}function zt(t,e){return t.some(s=>s.messageId===e.messageId)?t:[...t,e]}function Jt(t,e){return t.filter(s=>s.messageId!==e)}const te=new Map,es=200;function ts(t){if(te.size<es||te.has(t))return;const e=te.keys().next().value;if(e!==void 0){te.delete(e),Ee.delete(e);for(const s of pe.keys())s.startsWith(`${e}:`)&&pe.delete(s)}}const Ee=new Set;function ss(t){Ee.add(t)}function ns(t){return Ee.has(t)}function as(t){Ee.delete(t)}function ve(t){const e=te.get(t);if(e)return te.delete(t),te.set(t,e),e;ts(t);const s=new kt([]);return te.set(t,s),s}function Je(t,e){ve(t).update(s=>zt(s,e))}function Ne(t,e){ve(t).update(s=>Jt(s,e))}function rs(t,e){ve(t).set(e)}const pe=new Map;function os(t,e){pe.set(`${t}:${e.id}`,e)}function is(t,e){const s=`${t}:${e}`,n=pe.get(s);return pe.delete(s),n}function We(t,e){pe.delete(`${t}:${e}`)}async function ee(t,e){try{const s=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!s.ok)return;const n=await s.json();rs(e,n.items??[])}catch{}}function Xs(t){const e=O.c(2);let s;e[0]!==t?(s=ve(t),e[0]=t,e[1]=s):s=e[1];const n=s;return M.useSyncExternalStore(n.subscribe,n.get,n.get)}function cs(){const{org:t}=Y();return{enqueue:Je,refresh:e=>ee(t.slug,e),cancel:async(e,s)=>{const n=`thread-run:${e}:${s}`;Ne(e,s);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(n)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return ae.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await ee(t.slug,e)}}}}function we(t,e){return t.find(s=>s!=null&&e.has(s.keyId))??null}function ls(t,e,s){const n=a=>we([a],s);return{tiers:{fast:we([e.tiers.fast,t.tiers.fast],s),smart:we([e.tiers.smart,t.tiers.smart],s),thinking:we([e.tiers.thinking,t.tiers.thinking],s),image:n(t.tiers.image),web_search:n(t.tiers.web_search),deep_research:n(t.tiers.deep_research)}}}const Se={tiers:{}};function us(){const t=O.c(7),{org:e}=Y();let s;t[0]!==e.id?(s=re.userModelPreferences(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==e.slug?(n=async()=>{const r=await lt(e.slug,"USER_MODEL_PREFERENCES_GET",{});return r?.tiers?r:Se},t[2]=e.slug,t[3]=n):n=t[3];let a;return t[4]!==s||t[5]!==n?(a={queryKey:s,queryFn:n,staleTime:6e4},t[4]=s,t[5]=n,t[6]=a):a=t[6],ot(a)}function ds(){return us().data??Se}function Ys(){const t=O.c(19),{org:e}=Y(),s=it(),n=Le();let a;t[0]!==e.id?(a=re.userModelPreferences(e.id),t[0]=e.id,t[1]=a):a=t[1];const r=a;let o;t[2]!==r||t[3]!==n||t[4]!==s?(o=async w=>{const d=n.getQueryData(r)??Se;return await s.call("USER_MODEL_PREFERENCES_UPDATE",d)??d},t[2]=r,t[3]=n,t[4]=s,t[5]=o):o=t[5];let i,u,f,h;t[6]!==r||t[7]!==n?(i=w=>{const{tier:d,slot:x}=w,N=n.getQueryData(r),q=N??Se;return n.setQueryData(r,{tiers:{...q.tiers,[d]:x}}),{prev:N}},u=(w,d,x)=>{n.setQueryData(r,x?.prev??Se)},f=w=>{n.setQueryData(r,w)},h=()=>{n.isMutating({mutationKey:r})===1&&n.invalidateQueries({queryKey:r})},t[6]=r,t[7]=n,t[8]=i,t[9]=u,t[10]=f,t[11]=h):(i=t[8],u=t[9],f=t[10],h=t[11]);let b;return t[12]!==r||t[13]!==o||t[14]!==i||t[15]!==u||t[16]!==f||t[17]!==h?(b={mutationKey:r,mutationFn:o,onMutate:i,onError:u,onSuccess:f,onSettled:h},t[12]=r,t[13]=o,t[14]=i,t[15]=u,t[16]=f,t[17]=h,t[18]=b):b=t[18],ct(b)}function ps(){const t=O.c(4),e=qt(),s=ds(),n=Ye();let a;return t[0]!==n||t[1]!==e||t[2]!==s?(a=ls(e,s,new Set(n.map(fs))),t[0]=n,t[1]=e,t[2]=s,t[3]=a):a=t[3],a}function fs(t){return t.id}function ne(t,e,s,n){if(!t)return null;const a=e.find(o=>o.id===t.keyId);if(!a)return null;const r=s.find(o=>o.modelId===t.modelId);return r?{...r,keyId:t.keyId}:{modelId:t.modelId,title:n??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function hs(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function ms(t,e,s,n){if(!s||n.length===0)return null;const a=e.find(u=>u.id===s);if(!a)return null;const r=$t([a],{[s]:n}),o=t==="fast"?r.chat.fast:t==="thinking"?r.chat.thinking:r.chat.smart;if(!o)return null;const i=n.find(u=>u.modelId===o.modelId);return i?{...i,keyId:s}:null}const Ve=new Set,J=new Set;function le(t){return M.useSyncExternalStore(t.subscribe,t.get,t.get)}function gs(t){return t.kind==="loading"?"ready":t.kind}function et(t){return t&&typeof t=="object"&&"type"in t?{tiptapDoc:t}:t}const ys=1e4,Ss=10,Te=M.createContext(null),$e=M.createContext(null),Fe=M.createContext(null),tt=M.createContext(null);function vs(t){const e=O.c(3),{value:s,children:n}=t;let a;return e[0]!==n||e[1]!==s?(a=X.jsx(Te.Provider,{value:s,children:n}),e[0]=n,e[1]=s,e[2]=a):a=e[2],a}function Zs(t){const e=O.c(2),{children:s}=t;let n;return e[0]!==s?(n=X.jsx(Te.Provider,{value:null,children:X.jsx($e.Provider,{value:null,children:s})}),e[0]=s,e[1]=n):n=e[1],n}function Ts({children:t}){const{locator:e}=Y(),{virtualMcpId:s}=Ze(),[n,a]=ue(de.chatSelectedImageModel(e),null),[r,o]=ue(de.chatSelectedWebSearchModel(e),null),[i,u]=ue(de.chatSelectedDeepResearchModel(e),null),[f,h]=M.useState(null),[b,w]=M.useState("default"),d=ps(),[x,N]=ue(de.chatSimpleModeTier(e),null),q=hs(x),T=Ye(),C=d.tiers[q],U=T.some(c=>c.id===C?.keyId)?C?.keyId:void 0,j=f&&T.some(c=>c.id===f)?f:U??T[0]?.id??null,{models:P,isLoading:A}=ye(j??void 0),{models:E}=ye(U),Z=T.some(c=>c.id===d.tiers.image?.keyId)?d.tiers.image?.keyId:void 0,{models:se}=ye(Z),R=T.some(c=>c.id===d.tiers.web_search?.keyId)?d.tiers.web_search?.keyId:void 0,{models:Q}=ye(R),L=T.some(c=>c.id===d.tiers.deep_research?.keyId)?d.tiers.deep_research?.keyId:void 0,{models:V}=ye(L),K=ne(C,T,E,C?.title)??ms(q,T,j,P),H=A,G=P.filter(c=>c.capabilities?.includes("image")),B=ne(n,T,G),g=ne(d.tiers.image,T,se,d.tiers.image?.title)??B??G[0]??null,v=P.filter(_t),k=ne(r,T,v),F=v.find(c=>c.modelId==="perplexity/sonar")??v[0]??null,z=ne(d.tiers.web_search,T,Q,d.tiers.web_search?.title)??k??F,oe=P.filter(Pt),_e=ne(i,T,oe),D=oe.find(c=>c.modelId==="perplexity/deep-research")??oe.find(c=>c.asyncResearch===!0)??oe[0]??null,fe=ne(d.tiers.deep_research,T,V,d.tiers.deep_research?.title)??_e??D,Pe=At(s),ke=Et().find(c=>c.id===s),Re=Pe??ke??{id:s,title:"",description:null,icon:null},[Me,he]=M.useState({}),Ie=(c,y)=>{const I=[];for(const m of y.content??[])m.type==="text"&&m.text?.trim()&&I.push(m.text.trim());const S=I.join(`
30
- `);if(!S){ie(c);return}new TextEncoder().encode(S).length>ys||he(m=>Object.keys(m).length>=Ss&&!(c in m)?m:{...m,[c]:S})},ie=c=>{he(y=>{const{[c]:I,...S}=y;return S})},[De,Oe]=ue(de.chatLastAgentOption(e),c=>c&&c in Qe?c:null),be=_s(),xe=Ut({pendingOption:De,lockedHarness:be?.isThreadLocked?be.lockedHarness:null}),Ce=xe?Qe[xe]:null,[me,l]=M.useState(void 0),p=M.useRef(me);p.current=me;const $={selectedModel:K,setModel:()=>{},credentialId:j,setCredentialId:h,allModelsConnections:T,isModelsLoading:H,selectedVirtualMcp:Re,imageModel:g,setImageModel:c=>{a(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:z,setWebSearchModel:c=>{o(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:fe,setDeepResearchModel:c=>{u(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:b,setChatMode:w,appContexts:Me,setAppContext:Ie,clearAppContext:ie,tiptapDoc:me,setTiptapDoc:l,tiptapDocRef:p,resetInteraction:()=>{},simpleModeTier:q,setSimpleModeTier:c=>N(c),pendingAgentOption:xe,setPendingAgentOption:Oe,pendingHarnessId:Ce};return X.jsx(Fe.Provider,{value:$,children:t})}function zs(t){const e=O.c(41),{virtualMcpId:s,task:n,children:a}=t,{locator:r}=Y(),{data:o}=ut.useSession(),i=o?.user??null,{taskId:u,virtualMcpId:f,navigateToTask:h}=Ze(),[b]=dt(),{markTaskRead:w}=Kt(),d=bt(),x=u,N=f,q=Wt(N);let T;e[0]!==w||e[1]!==h?(T=(v,k)=>{w(v),h(v,{virtualMcpId:k?.virtualMcpId,autosend:k?.autosend})},e[0]=w,e[1]=h,e[2]=T):T=e[2];const C=T,U=x!==null&&n?.id===x?n:null,j=U?.harness_id??null,P=U?.branch??null,A=j!=null,E=P;let Z;e[3]!==E||e[4]!==r||e[5]!==C||e[6]!==d||e[7]!==s?(Z=v=>{const k=crypto.randomUUID(),F=v?.branch??E;return Ue(sessionStorage,r,k,{...v?.runtime?{runtime:v.runtime}:{},...F?{branch:F}:{}}),d.create({id:k,virtual_mcp_id:s,...F?{branch:F}:{},...v?.runtime?{runtime:v.runtime}:{}}).then(()=>{je(sessionStorage,r,k),C(k)}).catch(()=>{C(k)}),k},e[3]=E,e[4]=r,e[5]=C,e[6]=d,e[7]=s,e[8]=Z):Z=e[8];const se=Z;let R;e[9]!==E||e[10]!==r||e[11]!==C||e[12]!==d||e[13]!==s?(R=v=>{const k=crypto.randomUUID(),F=v.virtualMcpId??s,z=F===s?E:null;Tt(sessionStorage,r,k,v.message),z&&Ue(sessionStorage,r,k,{branch:z}),d.create({id:k,virtual_mcp_id:F,...z?{branch:z}:{}}).then(()=>{je(sessionStorage,r,k),C(k,{virtualMcpId:v.virtualMcpId,autosend:!0})}).catch(()=>{C(k,{virtualMcpId:v.virtualMcpId,autosend:!0})})},e[9]=E,e[10]=r,e[11]=C,e[12]=d,e[13]=s,e[14]=R):R=e[14];const Q=R;let L;e[15]!==x||e[16]!==d?(L=v=>{x&&d.setBranch(x,v)},e[15]=x,e[16]=d,e[17]=L):L=e[17];let V;e[18]!==U||e[19]!==se||e[20]!==Q||e[21]!==E||e[22]!==x||e[23]!==N||e[24]!==A||e[25]!==P||e[26]!==j||e[27]!==C||e[28]!==L?(V={virtualMcpId:N,taskId:x,openTask:C,createTask:se,createTaskWithMessage:Q,activeTask:U,isThreadLocked:A,lockedHarness:j,lockedBranch:P,currentBranch:E,setCurrentTaskBranch:L},e[18]=U,e[19]=se,e[20]=Q,e[21]=E,e[22]=x,e[23]=N,e[24]=A,e[25]=P,e[26]=j,e[27]=C,e[28]=L,e[29]=V):V=e[29];const K=V;let H;e[30]!==q||e[31]!==b||e[32]!==h||e[33]!==i?(H={user:i,contextPrompt:q,preferences:b,rawNavigateToTask:h},e[30]=q,e[31]=b,e[32]=h,e[33]=i,e[34]=H):H=e[34];const G=H;let B;e[35]!==a||e[36]!==G?(B=X.jsx(Ts,{children:X.jsx(tt.Provider,{value:G,children:a})}),e[35]=a,e[36]=G,e[37]=B):B=e[37];let g;return e[38]!==B||e[39]!==K?(g=X.jsx($e.Provider,{value:K,children:B}),e[38]=B,e[39]=K,e[40]=g):g=e[40],g}const ks=[];function Js(t){const e=O.c(5),{children:s}=t,{createTaskWithMessage:n}=st();let a;e[0]!==n?(a={messages:ks,status:"ready",sendMessage:async i=>{n({message:et(i)})},editQueuedMessage:Es,stop:As,submit:ws,removeLocalMessage:Cs,isSendInFlight:xs,error:null,clearError:bs,finishReason:null,runStatusStage:null,clearFinishReason:Is,isStreaming:!1,isChatEmpty:!0,isWaitingForApprovals:!1,isRunInProgress:!1,hasMoreOlder:!1,isFetchingOlder:!1,fetchOlderMessages:Ms},e[0]=n,e[1]=a):a=e[1];const r=a;let o;return e[2]!==s||e[3]!==r?(o=X.jsx(vs,{value:r,children:s}),e[2]=s,e[3]=r,e[4]=o):o=e[4],o}async function Ms(){}function Is(){}function bs(){}function xs(){return!1}function Cs(){}async function ws(){}function As(){}async function Es(){return!1}function en({taskId:t,children:e}){const s=Ae(),n=xt(),{virtualMcpId:a,activeTask:r,currentBranch:o}=st(),i=Bt({isDesktopApp:n,harnessId:r?.harness_id}),u=s("chat.input.codingAgentRequiresDesktop");Ve.has(t)||(Ve.add(t),ht("chat_opened",{thread_id:t}));const{imageModel:f,webSearchModel:h,deepResearchModel:b,chatMode:w,setChatMode:d,appContexts:x,setTiptapDoc:N,simpleModeTier:q}=$s(),T=M.useContext(tt);if(!T)throw new Error(s("chat.chatContext.activeTaskProviderMissingContext"));const{user:C,contextPrompt:U,preferences:j,rawNavigateToTask:P}=T,{org:A,locator:E}=Y(),Z=cs(),[se,R]=M.useState(null),Q=()=>{R(new Error(u))},L=Vt(),V=Le(),K=Mt(),H=He(),{openPanel:G}=mt(),B=Ct({connectionId:wt,orgId:A.id,orgSlug:A.slug}),g=It(A.slug,t,{client:B});M.use(g.ready);const v=le(g.messages),k=le(g.status),F=le(g.finishReason),z=le(g.runStatusStage),oe=le(g.hasMoreOlder),_e=le(g.isFetchingOlder),D=M.useRef({onToolCall:L,queryClient:V,rawNavigateToTask:P,taskId:t,manager:K,navigate:H,openPanel:G,orgId:A.id,orgSlug:A.slug});D.current={onToolCall:L,queryClient:V,rawNavigateToTask:P,taskId:t,manager:K,navigate:H,openPanel:G,orgId:A.id,orgSlug:A.slug},Ot({orgSlug:A.slug,taskId:t,onTaskStatus:l=>{const p=D.current,$=l.data.message_id;if(l.data.status==="in_progress"&&$){Ne(p.taskId,$);const c=is(p.taskId,$);c&&g.applyLocalMessage(c),ee(p.orgSlug,p.taskId)}ns(p.taskId)&&(async()=>(await ee(p.orgSlug,p.taskId),await g.reconcileFromServer()&&ve(p.taskId).get().length===0&&as(p.taskId)))()}}),M.useEffect(()=>{const l={onData:y=>{if(y.type==="data-thread-title"){const I=y.data;if(!I?.title)return;const S=D.current;if(!S.taskId)return;S.manager.patchThread({id:S.taskId,title:I.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const I=y.data;if(!I?.path)return;const S=I.path,m=D.current;m.queryClient.invalidateQueries({queryKey:re.orgFsStat(m.orgId,"home",S)}),m.queryClient.invalidateQueries({queryKey:re.orgFsRecent(m.orgId)}),m.openPanel(pt(S));return}if(y.type==="data-open-preview"){const I=y.data,S=D.current,m=S.taskId;if(m){const ce=S.manager.threads.get().find(W=>W.id===m);S.manager.patchThread({id:m,...I?.branch?{branch:I.branch}:{},metadata:{...ce?.metadata??{},...I?.githubRepo?{githubRepo:I.githubRepo}:{},...I?.sandboxMap?{sandboxMap:I.sandboxMap}:{}}})}S.openPanel("site-editor");return}},onFinish:(y,I,S)=>{const m=D.current;m.taskId&&ee(m.orgSlug,m.taskId),m.taskId&&m.manager.patchThread({id:m.taskId,status:Lt(S,y.parts),updated_at:new Date().toISOString()});const ce=y.parts?.some(_=>{const ge=_;return(ge.type==="tool-bash"||ge.type==="tool-write")&&ge.state==="output-available"});if(m.taskId&&ce){const _=re.threadOutputs(m.taskId);for(const ge of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{m.queryClient.invalidateQueries({queryKey:_})},ge)}m.queryClient.invalidateQueries({queryKey:re.homeNextActions(m.orgSlug)});const W=y.metadata?.thread_id;W&&W!==m.taskId&&m.rawNavigateToTask(W)},onError:y=>{R(y),console.error("[chat] Error",y)},onToolCall:y=>D.current.onToolCall(y)};g.observer=l,ee(D.current.orgSlug,D.current.taskId);const p=y=>y==="submitted"||y==="streaming";let $=p(g.status.get().kind);const c=g.status.subscribe(()=>{const y=p(g.status.get().kind);if(y===$)return;$=y;const I=D.current;ee(I.orgSlug,I.taskId)});return()=>{g.observer===l&&(g.observer=null),c()}},[g]);const fe=k.kind==="submitted"||k.kind==="streaming",Pe=v.length===0,ke=v.at(-1),Re=!fe&&ke?.role==="assistant"&&ke.parts.some(l=>"state"in l&&l.state==="approval-requested"),Me=r,he=(Me?.status==="in_progress"||Me?.status==="expired")&&k.kind==="ready"&&v.length>0;async function Ie(l){const p=t,$=a;if(i)return Q(),J.delete(p),!1;const c=Object.entries(x),y=c.length>0?c.map(([W,_])=>`### App Context: ${W}
31
- ${_}`).join(`
32
-
33
- `):"",I=[U,y].filter(Boolean).join(`
34
-
35
- `);let S=w;S==="gen-image"&&!f&&(S="default"),S==="web-search"&&!h&&(S="default"),S==="deep-research"&&!b&&(S="default"),(S==="web-search"||S==="deep-research")&&d("default");const m=jt({thread:r?{harness_id:r.harness_id??null,branch:r.branch??null}:null,globals:{branch:o}});r?.harness_id||K.patchThread({id:p,harness_id:"decopilot",updated_at:new Date().toISOString()});const ce={tier:q,mode:S,toolApprovalLevel:j.toolApprovalLevel??ft(),system:I||void 0,agent:{id:$},thread_id:p,...m};try{if(fe||he){let W=!0;try{os(p,l),await g.enqueue(l,ce),Je(p,{workflowId:`thread-run:${p}:${l.id}`,messageId:l.id,text:Zt(l.parts),hasAttachments:l.parts.some(_=>_.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),ss(p)}catch(_){W=!1,We(p,l.id),Ne(p,l.id),R(_ instanceof Error?_:new Error(String(_))),ae.error(_ instanceof Error?_.message:s("chat.chatContext.failedToQueueMessage"))}return ee(A.slug,p),W}return await g.submit({kind:"message",message:l},ce),!0}finally{J.delete(p)}}async function ie(l){const p=l.parts??ze(l.tiptapDoc);if(p.length===0||J.has(t))return;J.add(t),R(null),N(void 0);const $={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}},c={id:crypto.randomUUID(),role:"user",parts:p,metadata:$};await Ie(c)}async function De(l,p){if(i)return Q(),!1;if(J.has(t))return ae.info(s("chat.chatContext.stillSendingPreviousMessage")),!1;if(J.add(t),!await Z.cancel(t,l))return J.delete(t),ae.error(s("chat.chatContext.couldNotRemoveOriginalMessage")),!1;We(t,l),g.removeLocalMessage(l);const c={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:p}],metadata:{created_at:new Date().toISOString(),user:{avatar:C?.image??void 0,name:C?.name??"you"}}};try{return await Ie(c)}catch(y){return ae.error(y instanceof Error?y.message:s("chat.chatContext.failedToSendEditedMessage")),!1}}const Oe=async()=>{g.stop();try{const l=await fetch(`/api/${A.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const p=await l.json().catch(()=>({}));throw new Error(p.message??s("chat.chatContext.cancelFailedStatus",{status:l.status}))}}catch(l){const p=l instanceof Error?l.message:s("chat.chatContext.failedToCancel");ae.error(p),console.error("[chat] cancelRun",l)}},be=l=>ie(et(l)),Ce=qe({strict:!1}).autosend===Xe;M.useEffect(()=>{if(!Ce||v.length>0||i)return;const l=St(sessionStorage,E,t);l&&ie(l.message).then(()=>{vt(sessionStorage,E,t)})},[Ce,v.length,i,E,t,ie]);const me={messages:v,status:gs(k),sendMessage:be,editQueuedMessage:De,stop:()=>{if(i){Q();return}Oe()},submit:async(l,p)=>{if(i){Q();return}await g.submit(l,p)},removeLocalMessage:l=>g.removeLocalMessage(l),isSendInFlight:()=>J.has(t),error:se,clearError:()=>R(null),finishReason:F,runStatusStage:z,clearFinishReason:()=>g.finishReason.set(null),isStreaming:fe,isChatEmpty:Pe,isWaitingForApprovals:Re??!1,isRunInProgress:he,hasMoreOlder:oe,isFetchingOlder:_e,fetchOlderMessages:g.fetchOlderMessages.bind(g)};return X.jsx(Te.Provider,{value:me,children:e})}function tn(){const t=Ae(),e=M.useContext(Te);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function sn(){return M.useContext(Te)}function st(){const t=Ae(),e=M.useContext($e);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function $s(){const t=Ae(),e=M.useContext(Fe);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function nn(){return M.useContext(Fe)}function _s(){return M.useContext($e)}export{en as A,Ts as C,Zs as D,Js as T,tn as a,_s as b,st as c,Xs as d,cs as e,We as f,we as g,us as h,Ys as i,ps as j,sn as k,Bt as l,zs as m,Hs as n,ze as o,Ze as p,nn as q,Gs as s,Ks as t,$s as u};
@@ -1 +0,0 @@
1
- import{c as L,j as t,B as W,h as X,ae as Ye,ag as ie,b as K,E as De,r as D,W as xe,c8 as Ge,c9 as Ee,ar as Xe,u as Ze,L as te,a3 as et,a4 as Se,a1 as ye,a2 as we,t as tt,f as fe,ca as Oe}from"./index-CxLq_ov_.js";import{E as Re}from"./empty-state-BPIeTQLP.js";import{u as he}from"./use-mcp-client-Bzii9bW9.js";import{d as re,F as st,a as ae,b as ce}from"./form-j23QTiVs.js";import{I as ue}from"./input-t2vq_Yhz.js";import{T as pe}from"./textarea-DFMKKUyA.js";import{a as ot,b as nt,V as ge,O as lt,M as it}from"./index-CaFXU7vU.js";import{aU as rt,T as at,aV as ct,az as dt,al as mt,am as ut,aW as pt,w as Ce}from"./agent-icon-DyMYbwSC.js";import{g as xt,M as ft,a as Ie}from"./types-hwFA5Ktg.js";import{A as ht,a as gt,b as jt}from"./alert-vGXUrUMH.js";import{S as Te,a as $e,b as Pe,c as ke,d as de}from"./select-CNhOTIVN.js";import{B as Fe,a as Me,b as Y,c as se,d as oe,e as ze}from"./breadcrumb-C5kFXgQY.js";import{i as bt}from"./AlertCircle-B0exjy2G.js";import{a as Nt}from"./Copy01-DXf2ReD_.js";import{i as vt}from"./Play-CR4MAXKW.js";import{g as St}from"./connection-slug-CITJ0kGN.js";import{u as yt,T as wt}from"./use-mcp-auth-status-CC8-P5tO.js";import{a as Be,u as Le}from"./use-connection-B3hf1saX.js";import{a as Ct}from"./use-mcp-tools-3xoGjo6f.js";import{M as It,c as Tt}from"./monaco-editor-BFa0VsLo.js";import{I as Ae}from"./integration-icon-Cr-roc4W.js";import{k as $t,q as Pt}from"./chat-context-D2SP0J5D.js";import{u as kt}from"./shell-layout-CAB27XFS.js";import{E as At}from"./empty-state-CRtvF4Xb.js";import{n as Dt}from"./Tool02-8qVRgTeE.js";import"./constants-DNuUCxmW.js";import"./auth-Dy3Ai_hi.js";import"./label-HkRxmwei.js";import"./Key01-CNitiCfD.js";import"./extract-connection-data-Cq3FrLyn.js";import"./metadata-dUsYcpuu.js";import"./connection-pv2H4wMd.js";import"./use-registry-connections-DndEI7JT.js";import"./use-organization-settings-DRchtNm3.js";import"./schema-ChmhgfCW.js";import"./task-board-CcPPQONZ.js";import"./Plus-D-mogJXC.js";import"./index-BVzdbF4_.js";import"./index-BMAJGR3J.js";import"./index-DkQlXscT.js";import"./popover-CpTW2alp.js";import"./use-virtual-mcp-Drh4_cTK.js";import"./Check-DFnPCTEg.js";import"./SearchMd-BYpvO9Ao.js";import"./Users03-CMpVHpdR.js";import"./use-create-virtual-mcp-59Af3Rsa.js";import"./use-navigate-to-agent-CUFdthzD.js";import"./use-destination-route-BePPmQxb.js";import"./hooks-D1D8x6_l.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-xVL-mPxb.js";import"./thread-intent-BCmi7agT.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-COLY3wWI.js";import"./Tool01-DbPhfEvg.js";import"./ArrowUp-DY0nxQiU.js";import"./ArrowLeft-DDVITG8K.js";import"./XCircle-BN22j-Jn.js";import"./TrendUp01-yPe3UG0T.js";import"./ZoomOut-BUSsAg6c.js";import"./CheckCircle-DLOuSHro.js";import"./ChevronUp-CVSn4-gi.js";import"./ChevronRight-BcTQG1DI.js";import"./ChevronSelectorVertical-DMK3FCxp.js";import"./DotsVertical-CqFpz0HG.js";import"./UserSquare-HSvWRq_9.js";import"./CreditCard01-Dufq2QQE.js";import"./Download01-GnhueTng.js";import"./Settings02-B2gnPQ3Q.js";import"./Eye-CHLagXa7.js";import"./Share07-Bu5e840D.js";import"./GitBranch01-CQRzbSyx.js";import"./Globe01-DyhA33s1.js";import"./XClose-N8lMtUXr.js";import"./HardDrive-eC4I4aqw.js";import"./Image01-D6KzR28r.js";import"./Link01-BHe0dd0_.js";import"./LinkExternal01-CvQ-ylaK.js";import"./Monitor01-SbvebE9T.js";import"./Sun-aWHPBk6T.js";import"./Package-BIDQhscg.js";import"./Palette-DgVW07vN.js";import"./Shield01-BAHmK5_B.js";import"./Stars01-CCTPiWmK.js";import"./Trash01-CV8Q1VzZ.js";import"./Upload01-B1Qytz_u.js";import"./User01-DmJKrYPV.js";import"./Users01-B4HgX8Cb.js";import"./Zap-BMyl5tLM.js";import"./badge-DiXK5Efu.js";import"./mcp-oauth-BHYwKN2k.js";import"./editor-CgtWB5x3.js";import"./use-panel-navigate-DSf87ewD.js";import"./thread-route-Ckn7Kp8P.js";import"./dialog-Do-ZnJpa.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DRa-WP8c.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CkAI1xCS.js";import"./avatar-B8b2hWV1.js";import"./project-icon-BY6MP5uE.js";import"./command-CeyGqPmM.js";import"./required-auth-layout-LhCq4pE1.js";import"./use-org-sso-DTBnbTx7.js";function Et(s){const e=L.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:a,undoLabel:u}=s,c=a===void 0?"Save":a,n=u===void 0?"Undo":u;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 g;e[1]!==i||e[2]!==o||e[3]!==n?(g=t.jsxs(W,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":n,children:[x,n]}),e[1]=i,e[2]=o,e[3]=n,e[4]=g):g=e[4];let m;e[5]!==i?(m=i?t.jsx(X,{className:"size-3.5"}):t.jsx(at,{size:14}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==c||e[10]!==m?(f=t.jsxs(W,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":c,children:[m,c]}),e[7]=i,e[8]=r,e[9]=c,e[10]=m,e[11]=f):f=e[11];let p;return e[12]!==g||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[g,f]}),e[12]=g,e[13]=f,e[14]=p):p=e[14],p}Ye({title:ie().min(1),description:ie().nullable(),body:ie()});function me(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ot(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Rt(s){const e=L.c(43),{form:r}=s,o=K();let l;e[0]!==o?(l=o("details.prompt.details"),e[0]=o,e[1]=l):l=e[1];let i;e[2]!==l?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:l}),e[2]=l,e[3]=i):i=e[3];let a;e[4]!==o?(a=w=>{const{field:b}=w;return t.jsxs(ae,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:o("details.prompt.title")}),t.jsx(ce,{children:t.jsx(ue,{...b,placeholder:o("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=o,e[5]=a):a=e[5];let u;e[6]!==r.control||e[7]!==a?(u=t.jsx(re,{control:r.control,name:"title",render:a}),e[6]=r.control,e[7]=a,e[8]=u):u=e[8];let c;e[9]!==o?(c=w=>{const{field:b}=w;return t.jsxs(ae,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:o("details.prompt.description")}),t.jsx(ce,{children:t.jsx(ue,{...b,value:b.value??"",placeholder:o("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=o,e[10]=c):c=e[10];let n;e[11]!==r.control||e[12]!==c?(n=t.jsx(re,{control:r.control,name:"description",render:c}),e[11]=r.control,e[12]=c,e[13]=n):n=e[13];let x;e[14]!==u||e[15]!==n?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u,n]}),e[14]=u,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==i||e[18]!==x?(g=t.jsxs("div",{className:"flex flex-col gap-4",children:[i,x]}),e[17]=i,e[18]=x,e[19]=g):g=e[19];let m;e[20]!==o?(m=o("details.prompt.message"),e[20]=o,e[21]=m):m=e[21];let f;e[22]!==m?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:m}),e[22]=m,e[23]=f):f=e[23];let p;e[24]!==o?(p=o("details.prompt.messageDescription"),e[24]=o,e[25]=p):p=e[25];let j;e[26]!==p?(j=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=j):j=e[27];let N;e[28]!==o?(N=w=>{const{field:b}=w;return t.jsx(ae,{children:t.jsx(ce,{children:t.jsx(pe,{...b,value:b.value??"",placeholder:o("details.prompt.bodyPlaceholder"),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"})})})},e[28]=o,e[29]=N):N=e[29];let S;e[30]!==r.control||e[31]!==N?(S=t.jsx(re,{control:r.control,name:"body",render:N}),e[30]=r.control,e[31]=N,e[32]=S):S=e[32];let $;e[33]!==f||e[34]!==j||e[35]!==S?($=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,j,S]}),e[33]=f,e[34]=j,e[35]=S,e[36]=$):$=e[36];let y;e[37]!==$||e[38]!==g?(y=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:[g,$]}),e[37]=$,e[38]=g,e[39]=y):y=e[39];let P;return e[40]!==r||e[41]!==y?(P=t.jsx(st,{...r,children:y}),e[40]=r,e[41]=y,e[42]=P):P=e[42],P}function Ft(s){const e=L.c(42),{providerId:r,promptId:o}=s,l=K(),{org:i}=xe(),a=r||null;let u;e[0]!==i.id||e[1]!==i.slug||e[2]!==a?(u={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=a,e[3]=u):u=e[3];const c=he(u),n=Ge(r,"PROMPT",o,c),x=Ee(r,"PROMPT",c),g=x.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:me(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let f;e[6]!==m?(f={values:m},e[6]=m,e[7]=f):f=e[7];const p=Xe(f);let j;e[8]!==p||e[9]!==n?(j=()=>{n&&p.reset({title:n.title,description:n.description??null,body:me(n)})},e[8]=p,e[9]=n,e[10]=j):j=e[10];const N=j;let S;e[11]!==x.update||e[12]!==p||e[13]!==o?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:o,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:me(I)})}),e[11]=x.update,e[12]=p,e[13]=o,e[14]=S):S=e[14];const $=S;if(!n){let C;e[15]!==l?(C=l("details.prompt.notFoundTitle"),e[15]=l,e[16]=C):C=e[16];let I;e[17]!==l?(I=l("details.prompt.notFoundDescription"),e[17]=l,e[18]=I):I=e[18];let O;return e[19]!==C||e[20]!==I?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Re,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=O):O=e[21],O}let y;e[22]!==n.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[22]=n.title,e[23]=y):y=e[23];let P;e[24]!==n.description?(P=n.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:n.description})]}):null,e[24]=n.description,e[25]=P):P=e[25];let w;e[26]!==y||e[27]!==P?(w=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[26]=y,e[27]=P,e[28]=w):w=e[28];let b;e[29]!==$?(b=()=>{$()},e[29]=$,e[30]=b):b=e[30];let k;e[31]!==p.formState.isDirty||e[32]!==g||e[33]!==N||e[34]!==b?(k=t.jsx(ot,{children:t.jsx(Et,{onSave:b,onUndo:N,isDirty:p.formState.isDirty,isSaving:g})}),e[31]=p.formState.isDirty,e[32]=g,e[33]=N,e[34]=b,e[35]=k):k=e[35];let A;e[36]!==p?(A=t.jsx("div",{className:"h-full",children:t.jsx(Rt,{form:p})}),e[36]=p,e[37]=A):A=e[37];let E;return e[38]!==k||e[39]!==A||e[40]!==w?(E=t.jsxs(ge,{children:[w,k,A]}),e[38]=k,e[39]=A,e[40]=w,e[41]=E):E=e[41],E}function Mt(s){const e=L.c(10),{itemId:r}=s,o=K();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Ot(),e[0]=l):l=e[0];const i=l;if(!i){let u;e[1]!==o?(u=o("details.prompt.notFoundTitle"),e[1]=o,e[2]=u):u=e[2];let c;e[3]!==o?(c=o("details.prompt.missingConnectionDescription"),e[3]=o,e[4]=c):c=e[4];let n;return e[5]!==u||e[6]!==c?(n=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Re,{title:u,description:c})}),e[5]=u,e[6]=c,e[7]=n):n=e[7],n}let a;return e[8]!==r?(a=t.jsx(De,{children:t.jsx(D.Suspense,{fallback:null,children:t.jsx(Ft,{providerId:i,promptId:r})})}),e[8]=r,e[9]=a):a=e[9],a}const zt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Bt(s){const e=L.c(12),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:a}=s,u=K();let c;e[0]!==o?(c={connectionId:o},e[0]=o,e[1]=c):c=e[1];const n=yt(c);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==a||e[4]!==u?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(lt,{onAuthenticate:()=>a(),buttonText:u("details.tool.goBackToAuthenticate")}):t.jsx(it,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=a,e[4]=u,e[5]=m):m=e[5],m}const x=`${o}:${r}`;let g;return e[6]!==o||e[7]!==i||e[8]!==l||e[9]!==x||e[10]!==r?(g=t.jsx(Lt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},x),e[6]=o,e[7]=i,e[8]=l,e[9]=x,e[10]=r,e[11]=g):g=e[11],g}function Lt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const l=K(),{replayId:i}=Ze({strict:!1}),a=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),u=(()=>{if(!a)return null;const d={};for(const[h,T]of Object.entries(a))T!==null&&typeof T=="object"?d[h]=JSON.stringify(T,null,2):d[h]=T;return d})(),[c,n]=D.useState(u??{}),[x,g]=D.useState(a?JSON.stringify(a,null,2):"{}"),[m,f]=D.useState(null),[p,j]=D.useState(null),[N,S]=D.useState(null),[$,y]=D.useState(null),[P,w]=D.useState(!1),[b,k]=D.useState(null),{org:A}=xe(),E=Be(e),C=$t(),I=Pt(),{openSidePanel:O}=kt(),U=`${e}:${s}`,F=he({connectionId:e,orgId:A.id,orgSlug:A.slug}),V=Ct({client:F}),v=V.data?.tools?.find(d=>d.name===s),R=xt(v?._meta),J=d=>{if(!C)return;const h=Tt(d.content);h.content.length>0&&(O(),C.sendMessage({tiptapDoc:h}))},[M,z]=D.useState("json"),[q,Q]=D.useState(!1);R&&!q&&(z("ui"),Q(!0));const _=v?.inputSchema?.properties,je=_?Object.keys(_):[],G=je.length>0,Z={};if(G&&v?.inputSchema?.properties)for(const d of je)Z[d]=v.inputSchema.required?.includes(d)?"":void 0;const ne=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{w(!0),y(null),f(null),j(null),S(null),k(null);const d=performance.now();try{if(!F)throw new Error("MCP client is not available");const h=G?{...Z,...c}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();G&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof h[B]=="string")try{h[B]=JSON.parse(h[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof h[B]=="string"&&h[B]!==""){const ve=Number(h[B]);Number.isNaN(ve)||(h[B]=ve)}});const T=await F.callTool({name:s,arguments:h}),ee=T.structuredContent??T,We=performance.now(),Ke=Math.round(We-d);f(ee),j(T),S(h);const Qe=JSON.stringify(ee),Ne=new TextEncoder().encode(Qe).length;k({duration:`${Ke}ms`,bytes:`${Ne} bytes`,tokens:`~${Math.ceil(Ne/4)} tokens`,cost:"$0.0000"})}catch(h){const T=h instanceof Error?h.message:String(h);y(T||"Unknown error occurred");const ee=performance.now();k({duration:`${Math.round(ee-d)}ms`})}finally{w(!1)}},le=(d,h)=>{n(T=>({...T,[d]:h}))},Ve=()=>{f(null),j(null),S(null),y(null),k(null)},_e=v?.name??zt(s),Je=t.jsx(Fe,{children:t.jsxs(Me,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:A.slug},children:l("details.tool.connections")})})}),t.jsx(oe,{}),E&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:A.slug,appSlug:St(E)},search:{tab:"tools"},children:E.title})})}),t.jsx(oe,{})]}),t.jsx(Y,{children:t.jsx(ze,{children:_e})})]})}),be=r.length>1&&t.jsxs(Te,{value:e,onValueChange:o,children:[t.jsx($e,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(Pe,{})}),t.jsx(ke,{children:r.map(d=>t.jsx(de,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ae,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),qe=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:l("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",l("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:G&&v?.inputSchema?.properties?Object.entries(v.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,v.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive 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(pe,{className:"font-mono text-xs",value:ne(d)?c[d]??"":Z[d]??"",onChange:T=>le(d,T.target.value),placeholder:l("details.tool.enterAsJson",{key:d}),rows:3}):h.type==="boolean"?t.jsxs(Te,{value:ne(d)?String(c[d]??""):"",onValueChange:T=>le(d,T==="true"),children:[t.jsx($e,{children:t.jsx(Pe,{placeholder:l("details.tool.selectTrueOrFalse")})}),t.jsxs(ke,{children:[t.jsx(de,{value:"true",children:"true"}),t.jsx(de,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ne(d)?c[d]??"":Z[d]??"",onChange:T=>le(d,T.target.value),placeholder:l("details.tool.enter",{key:d})})]},d)):v?.inputSchema&&!G?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:l("details.tool.rawJsonInput")}),t.jsx(pe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:d=>g(d.target.value),placeholder:l("details.tool.rawJsonExample")})]}):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:l("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:P?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(ct,{className:"h-3.5 w-3.5"}),l("details.tool.cancel")]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),l("details.tool.executeTool")]})})]}),He=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:l("details.tool.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(dt,{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(mt,{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(ut,{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})})]}),R&&t.jsx(et,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Se,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(W,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>z("ui"),children:t.jsx(pt,{size:14})})}),t.jsx(we,{children:l("details.tool.interactiveView")})]}),t.jsxs(Se,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(W,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>z("json"),children:t.jsx(Ce,{size:14})})}),t.jsx(we,{children:l("details.tool.jsonView")})]})]})})]})]}),$&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ht,{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(bt,{className:"h-4 w-4"}),t.jsx(gt,{className:"mb-0",children:l("details.tool.executionFailed")})]}),t.jsx(jt,{className:"text-xs text-destructive",children:$})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:R&&M==="ui"&&F?t.jsx(D.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(X,{className:"size-4"}),t.jsx("span",{className:"text-sm",children:l("details.tool.loadingApp")})]})}),children:t.jsx(ft,{resourceURI:R,toolInfo:v?{tool:v}:void 0,toolInput:N??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:Ie.view.minHeight,maxHeight:Ie.view.maxHeight,client:F,onMessage:J,onUpdateModelContext:d=>I?.setAppContext(U,d),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(It,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{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)),tt.success(l("details.tool.copiedToClipboard"))},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(Ce,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:l("details.tool.runToolToSeeResults")})]})})]});return t.jsx(ge,{breadcrumb:Je,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(Ae,{icon:E?.icon||null,name:E?.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:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(X,{className:"size-[10px] text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx(wt,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:be})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),r.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:l("details.tool.instance")}),be]}),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:qe}),He]})})]})})}function Ut(s){const e=L.c(20),{itemId:r,siblings:o,onBack:l}=s,i=K(),[a,u]=D.useState(o[0]?.id??"");let c;e[0]!==a||e[1]!==o?(c=o.find(f=>f.id===a)?.id??o[0]?.id??"",e[0]=a,e[1]=o,e[2]=c):c=e[2];const n=c;if(!Be(n||void 0)||!n){let f;e[3]!==i?(f=i("details.tool.connectionNotFound"),e[3]=i,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let j;e[7]!==i?(j=i("details.tool.connectionNotFoundMessage"),e[7]=i,e[8]=j):j=e[8];let N;e[9]!==j?(N=t.jsx("p",{className:"text-sm text-muted-foreground",children:j}),e[9]=j,e[10]=N):N=e[10];let S;return e[11]!==p||e[12]!==N?(S=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:[p,N]})}),e[11]=p,e[12]=N,e[13]=S):S=e[13],S}let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{className:"size-8 text-muted-foreground"})}),e[14]=g):g=e[14];let m;return e[15]!==n||e[16]!==l||e[17]!==o||e[18]!==r?(m=t.jsx(D.Suspense,{fallback:g,children:t.jsx(Bt,{toolName:r,connectionId:n,siblings:o,onSelectInstance:u,onBack:l})}),e[15]=n,e[16]=l,e[17]=o,e[18]=r,e[19]=m):m=e[19],m}const Vt={prompt:Mt};function _t(){const s=L.c(9),e=Oe();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=fe(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const a=Le(i);let u;s[3]!==e.history?(u=()=>{e.history.back()},s[3]=e.history,s[4]=u):u=s[4];const c=u,n=Jt;let x;return s[5]!==c||s[6]!==l||s[7]!==a?(x=t.jsx(Ut,{itemId:l,siblings:a,onBack:c,onUpdate:n}),s[5]=c,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Jt(s){return Promise.resolve()}function qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ht(){const s=L.c(52),e=Oe();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=fe(r),l=K(),i=decodeURIComponent(o.collectionName),a=decodeURIComponent(o.itemId);let u;s[1]!==e.history?(u=()=>{e.history.back()},s[1]=e.history,s[2]=u):u=s[2];const c=u,{org:n}=xe();let x;s[3]!==o.appSlug?(x={slug:o.appSlug},s[3]=o.appSlug,s[4]=x):x=s[4];const m=Le(x)[0]??null,f=m?.id??"",p=f||"no-connection",j=f??null;let N;s[5]!==n.id||s[6]!==n.slug||s[7]!==j?(N={connectionId:j,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=j,s[8]=N):N=s[8];const S=he(N),$=Ee(p,i,S);let y;s[9]!==$||s[10]!==a?(y=async _=>{a&&await $.update.mutateAsync({id:a,data:_})},s[9]=$,s[10]=a,s[11]=y):y=s[11];const P=y;let w;s[12]!==i?(w=i?.toLowerCase(),s[12]=i,s[13]=w):w=s[13];const b=w,k=b&&Vt[b];let A;s[14]!==i?(A=qt(i),s[14]=i,s[15]=A):A=s[15];const E=A;let C;s[16]!==n.slug?(C=t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(oe,{}),s[18]=I):I=s[18];let O;s[19]!==i||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(O=m&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:i},children:m.title})})}),t.jsx(oe,{})]}),s[19]=i,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=O):O=s[23];let U;s[24]!==E?(U=t.jsx(Y,{children:t.jsx(ze,{children:E})}),s[24]=E,s[25]=U):U=s[25];let F;s[26]!==O||s[27]!==U||s[28]!==C?(F=t.jsx(Fe,{children:t.jsxs(Me,{children:[C,I,O,U]})}),s[26]=O,s[27]=U,s[28]=C,s[29]=F):F=s[29];const V=F;if(k){let _;return s[30]!==k||s[31]!==c||s[32]!==P||s[33]!==a?(_=t.jsx(k,{itemId:a,onBack:c,onUpdate:P}),s[30]=k,s[31]=c,s[32]=P,s[33]=a,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Dt,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let R;s[36]!==l?(R=l("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=l,s[37]=R):R=s[37];let J;s[38]!==l?(J=l("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=l,s[39]=J):J=s[39];let M;s[40]!==l?(M=l("orgs.collectionDetail.goBackButton"),s[40]=l,s[41]=M):M=s[41];let z;s[42]!==c||s[43]!==M?(z={onClick:c,children:M},s[42]=c,s[43]=M,s[44]=z):z=s[44];let q;s[45]!==R||s[46]!==J||s[47]!==z?(q=t.jsx(At,{icon:v,title:R,description:J,buttonProps:z}),s[45]=R,s[46]=J,s[47]=z,s[48]=q):q=s[48];let Q;return s[49]!==V||s[50]!==q?(Q=t.jsx(ge,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=Q):Q=s[51],Q}function Wt(){const s=L.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 r=fe(e);if(decodeURIComponent(r.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(_t,{}),s[1]=a):a=s[1],a}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ht,{}),s[2]=i):i=s[2],i}function Ho(){const s=L.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(De,{children:t.jsx(D.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Wt,{})})}),s[0]=e):e=s[0],e}export{Ho as default};
@@ -1 +0,0 @@
1
- import{ae as ve,ak as $e,ao as Oe,ag as me,af as Me,c as U,b as L,j as t,h as Ne,B as q,r as Z,l as Se,W as se,a7 as ze,x as ue,K as te,d as ne,b3 as Ee,b6 as xe,F as Re,E as Ue,f as Ve,c4 as Fe,n as Le,ar as Be,as as qe,bk as Ge,bj as He,bh as Ke,bi as Qe,c5 as We,t as Y}from"./index-CxLq_ov_.js";import{g as Xe}from"./extract-connection-data-Cq3FrLyn.js";import{E as ye}from"./empty-state-BPIeTQLP.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-nmBh-twk.js";import{c as st,S as nt,V as it}from"./index-CaFXU7vU.js";import{u as Ce,T as ot}from"./use-mcp-auth-status-CC8-P5tO.js";import{a as at}from"./use-members-CEM7zlP_.js";import{A as lt}from"./avatar-B8b2hWV1.js";import{a as _e,b as we,u as rt}from"./use-connection-B3hf1saX.js";import{u as ke}from"./use-mcp-client-Bzii9bW9.js";import{a as ct}from"./use-mcp-tools-3xoGjo6f.js";import{a as dt}from"./use-mcp-prompts-BTyLUk2o.js";import{i as mt,a as ut}from"./mcp-oauth-BHYwKN2k.js";import{I as le}from"./integration-icon-Cr-roc4W.js";import{s as xt}from"./Plus-D-mogJXC.js";import{R as pt,S as ft,u as ht,aT as gt,s as ie}from"./agent-icon-DyMYbwSC.js";import{a as Ie,s as jt}from"./Settings02-B2gnPQ3Q.js";import{s as ce}from"./Trash01-CV8Q1VzZ.js";import{d as K,a as Q,e as W,b as B,c as X,f as bt,F as vt}from"./form-j23QTiVs.js";import{I as J}from"./input-t2vq_Yhz.js";import{u as Nt,D as St}from"./use-delete-connection-BdxhtyUk.js";import{c as yt,B as Ct,a as _t,C as wt}from"./monitoring-stats-row-BQP-lBLM.js";import{C as kt,a as It,b as Tt}from"./chart-kfhwAaMN.js";import{b as At}from"./use-virtual-mcp-Drh4_cTK.js";import{i as Te}from"./ChevronRight-BcTQG1DI.js";import{b as Ae}from"./Users03-CMpVHpdR.js";import{b as oe,c as Pt,T as ae,a as Dt}from"./tabs-DZInEuUb.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{b as $t}from"./Tool01-DbPhfEvg.js";import{g as de,M as Ot}from"./types-hwFA5Ktg.js";import{C as Mt}from"./collection-search-gbLnoGWa.js";import{B as zt}from"./badge-DiXK5Efu.js";import{c as Et,D as Rt,b as Ut,a as pe}from"./dropdown-menu-C9hHhEdP.js";import{S as fe,a as he,b as ge,c as je,d as H}from"./select-CNhOTIVN.js";import{i as Vt}from"./CheckCircle-DLOuSHro.js";import{t as Ft}from"./ChevronUp-CVSn4-gi.js";import{n as Lt}from"./Tool02-8qVRgTeE.js";import{b as Bt}from"./UserSquare-HSvWRq_9.js";import{s as qt}from"./XClose-N8lMtUXr.js";import{p as Gt,i as Ht}from"./connection-pv2H4wMd.js";import"./metadata-dUsYcpuu.js";import"./constants-DNuUCxmW.js";import"./Key01-CNitiCfD.js";import"./auth-Dy3Ai_hi.js";import"./use-registry-connections-DndEI7JT.js";import"./use-organization-settings-DRchtNm3.js";import"./schema-ChmhgfCW.js";import"./task-board-CcPPQONZ.js";import"./index-BVzdbF4_.js";import"./index-BMAJGR3J.js";import"./index-DkQlXscT.js";import"./popover-CpTW2alp.js";import"./Check-DFnPCTEg.js";import"./SearchMd-BYpvO9Ao.js";import"./use-create-virtual-mcp-59Af3Rsa.js";import"./use-navigate-to-agent-CUFdthzD.js";import"./use-destination-route-BePPmQxb.js";import"./hooks-D1D8x6_l.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-xVL-mPxb.js";import"./thread-intent-BCmi7agT.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-COLY3wWI.js";import"./Eye-CHLagXa7.js";import"./use-org-auth-client-Crsb07JJ.js";import"./User01-DmJKrYPV.js";import"./AlertCircle-B0exjy2G.js";import"./ArrowUp-DY0nxQiU.js";import"./ArrowLeft-DDVITG8K.js";import"./XCircle-BN22j-Jn.js";import"./TrendUp01-yPe3UG0T.js";import"./ZoomOut-BUSsAg6c.js";import"./ChevronSelectorVertical-DMK3FCxp.js";import"./DotsVertical-CqFpz0HG.js";import"./Copy01-DXf2ReD_.js";import"./CreditCard01-Dufq2QQE.js";import"./Download01-GnhueTng.js";import"./Share07-Bu5e840D.js";import"./GitBranch01-CQRzbSyx.js";import"./Globe01-DyhA33s1.js";import"./HardDrive-eC4I4aqw.js";import"./Image01-D6KzR28r.js";import"./Link01-BHe0dd0_.js";import"./LinkExternal01-CvQ-ylaK.js";import"./Monitor01-SbvebE9T.js";import"./Sun-aWHPBk6T.js";import"./Package-BIDQhscg.js";import"./Palette-DgVW07vN.js";import"./Play-CR4MAXKW.js";import"./Shield01-BAHmK5_B.js";import"./Stars01-CCTPiWmK.js";import"./Upload01-B1Qytz_u.js";import"./Users01-B4HgX8Cb.js";import"./Zap-BMyl5tLM.js";import"./label-HkRxmwei.js";import"./alert-dialog-Bb1OlmEm.js";import"./AreaChart-BbyZpwNl.js";import"./ErrorBarContext-7Y0x3JBZ.js";import"./Sector-CorkPUdM.js";const Kt=ve({scopes:Me(me()).describe("List of scopes available"),stateSchema:$e(me(),Oe()).describe("JSON Schema (draft-07) defining the state structure")}),Qt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Kt}];function Wt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=L();let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const p=Ce(d),r=!(n.connection_type==="VIRTUAL")&&p.supportsOAuth&&!p.isAuthenticated,f=n.status!=="active",u=r||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==r||e[12]!==a?(S=r?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=r,e[12]=a,e[13]=S):S=e[13];let v;e[14]!==j||e[15]!==S?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=v):v=e[16];let y;e[17]!==n||e[18]!==r||e[19]!==o||e[20]!==a?(y=r&&t.jsx(q,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=r,e[19]=o,e[20]=a,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(P=f?t.jsxs(q,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=P):P=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let _;e[30]!==a?(_=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=_):_=e[31];let M;e[32]!==a?(M=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Ie,{size:13}),e[34]=T):T=e[34];let $;e[35]!==D||e[36]!==_||e[37]!==M?($=t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:_,"aria-label":M,children:T}),e[35]=D,e[36]=_,e[37]=M,e[38]=$):$=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let N;e[42]!==a?(N=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=N):N=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==N||e[49]!==b?(z=t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:N,"aria-label":b,children:E}),e[47]=I,e[48]=N,e[49]=b,e[50]=z):z=e[50];let k;e[51]!==$||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,$,z]}),e[51]=$,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==v?(A=t.jsxs("div",{className:h,children:[g,v,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=v,e[60]=A):A=e[60],A}function Xt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let d;e[8]!==o?(d=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=d):d=e[9];let p;e[10]!==o?(p=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=p):p=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:13}),e[12]=m):m=e[12];let r;e[13]!==a||e[14]!==d||e[15]!==p?(r=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(q,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:d,"aria-label":p,children:m})}),e[13]=a,e[14]=d,e[15]=p,e[16]=r):r=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==r?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,r]}),e[17]=i,e[18]=l,e[19]=r,e[20]=f):f=e[20],f}function Jt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:d}=s,p=L();if(n.length===0)return null;let m;e[0]!==n.length||e[1]!==p?(m=n.length===1?p("details.connectionInstancesPanel.instance"):p("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=p,e[2]=m):m=e[2];let r;e[3]!==m?(r=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[3]=m,e[4]=r):r=e[4];let f;e[5]!==d?(f=d?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=d,e[6]=f):f=e[6];let u;e[7]!==p?(u=p("details.connectionInstancesPanel.addInstance"),e[7]=p,e[8]=u):u=e[8];let h;e[9]!==d||e[10]!==a||e[11]!==f||e[12]!==u?(h=t.jsxs(q,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:d,children:[f,u]}),e[9]=d,e[10]=a,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==r||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[r,h]}),e[14]=r,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Xt,{instance:P,onConfigure:c}),children:t.jsx(Wt,{instance:P,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},P.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let v;return e[30]!==g||e[31]!==S?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=v):v=e[32],v}function Yt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=L(),l=ze(),a=es(o),{data:d}=ue({queryKey:te.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:p}=ue({queryKey:te.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),m=yt(d?.logs??[],a,void 0,d?.total,p?.total),r=m.data,f=m.totalCalls>0,u=Yt(d?.logs??[]),h=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:m.totalCalls.toLocaleString()}),j]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(kt,{config:ts,className:"h-16 w-full",children:t.jsxs(Ct,{data:r,barCategoryGap:"4%",children:[t.jsx(It,{content:t.jsx(Tt,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:r.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:r[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:r[r.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),u.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:u.map(ns)})]})]})}function ns(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function is(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=U.c(22),{connectionId:n}=s,c=L(),[o,i]=Z.useState("14d"),{org:l}=se();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let d;e[2]!==a?(d=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=d):d=e[3];let p;e[4]!==c?(p=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=p):p=e[5];let m;e[6]!==o?(m=Zt.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=m):m=e[7];let r;e[8]!==p||e[9]!==m?(r=t.jsx("div",{role:"group","aria-label":p,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[8]=p,e[9]=m,e[10]=r):r=e[10];let f;e[11]!==d||e[12]!==r?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[d,r]}),e[11]=d,e[12]=r,e[13]=f):f=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(as,{}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Z.Suspense,{fallback:u,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function rs(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=ne();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const r=crypto.randomUUID();o({to:"/$org/$taskId",params:{org:c,taskId:r},search:{virtualmcpid:n.id}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ae,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let d;e[8]!==n.title?(d=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=d):d=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Te,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=p):p=e[10];let m;return e[11]!==i||e[12]!==a||e[13]!==d?(m=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[a,d,p]}),e[11]=i,e[12]=a,e[13]=d,e[14]=m):m=e[14],m}function cs(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(rs,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function ds(s){const e=U.c(13),{connection:n}=s,c=L(),{org:o}=se();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=At(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let d;e[3]!==c?(d=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=d):d=e[4];let p;e[5]!==d?(p=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:d})}),e[5]=d,e[6]=p):p=e[6];let m;e[7]!==o.slug||e[8]!==l?(m=t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=m):m=e[9];let r;return e[10]!==p||e[11]!==m?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,m]}),e[10]=p,e[11]=m,e[12]=r):r=e[12],r}function ms(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=L(),l=ne(),{org:a}=se();let d;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const p=ke(d),m=_e(c);let r;e[4]!==m||e[5]!==c?(r=m?Pe(m):c,e[4]=m,e[5]=c,e[6]=r):r=e[6];const f=r,[u,h]=Z.useState("");let g,j,S,v;if(e[7]!==f||e[8]!==p||e[9]!==l||e[10]!==o||e[11]!==u||e[12]!==i||e[13]!==n){const D=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?D.filter(b=>b.name.toLowerCase().includes(_)||b.description&&b.description.toLowerCase().includes(_)):D;let T;e[18]!==f||e[19]!==l||e[20]!==o?(T=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=T):T=e[21];const $=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=N):N=e[24],e[25]!==u||e[26]!==I?(v=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:N}),e[25]=u,e[26]=I,e[27]=v):v=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(ye,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=de(b._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>$(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:p})}),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:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=f,e[8]=p,e[9]=l,e[10]=o,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=v}else g=e[14],j=e[15],S=e[16],v=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==v||e[33]!==y?(P=t.jsxs("div",{className:S,children:[v,y]}),e[31]=S,e[32]=v,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function re(s){const e=U.c(5),{label:n}=s,c=L();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function xs(s){const e=U.c(72),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s;let a;e[0]!==c?(a=c===void 0?[]:c,e[0]=c,e[1]=a):a=e[1];const d=a;let p;e[2]!==o?(p=o===void 0?[]:o,e[2]=o,e[3]=p):p=e[3];const m=p,r=L(),f=ne(),u=_e(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Pe(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let j;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(j=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=j):j=e[11];const S=j;let v;e[12]!==i||e[13]!==l||e[14]!==n?(v=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=v):v=e[15];const y=v;if(n.length+d.length+m.length===0){let C;e[16]!==r?(C=r("details.connectionCapabilities.capabilities"),e[16]=r,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let G;e[20]!==r?(G=r("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=r,e[21]=G):G=e[21];let F;e[22]!==G?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:G}),e[22]=G,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let D;e[27]!==r||e[28]!==n.length?(D=r("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=r,e[28]=n.length,e[29]=D):D=e[29];let _;e[30]!==D?(_=t.jsx(oe,{value:"tools",variant:"underline",children:D}),e[30]=D,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==r?(M=y&&t.jsx(oe,{value:"apps",variant:"underline",children:r("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=r,e[34]=M):M=e[34];let T;e[35]!==r?(T=r("details.connectionCapabilities.promptsTab"),e[35]=r,e[36]=T):T=e[36];let $;e[37]!==T?($=t.jsx(oe,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=$):$=e[38];let I;e[39]!==r?(I=r("details.connectionCapabilities.resourcesTab"),e[39]=r,e[40]=I):I=e[40];let N;e[41]!==I?(N=t.jsx(oe,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=N):N=e[42];let b;e[43]!==M||e[44]!==$||e[45]!==N||e[46]!==_?(b=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Pt,{variant:"underline",className:"gap-1",children:[_,M,$,N]})}),e[43]=M,e[44]=$,e[45]=N,e[46]=_,e[47]=b):b=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>S(C.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($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:De(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Te,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(ae,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(ae,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==d?(A=d.length>0?d.map(fs):t.jsx(re,{label:"prompts"}),e[58]=d,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(ae,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let x;e[62]!==m?(x=m.length>0?m.map(ps):t.jsx(re,{label:"resources"}),e[62]=m,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(ae,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==b||e[67]!==z||e[68]!==k||e[69]!==R||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Dt,{defaultValue:"tools",variant:"underline",children:[b,z,k,R,w]})}),e[66]=b,e[67]=z,e[68]=k,e[69]=R,e[70]=w,e[71]=O):O=e[71],O}function ps(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{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:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function hs(s){return de(s._meta)}function gs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(le,{icon:n.icon,name:o,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:o})}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let d;e[7]!==l||e[8]!==a?(d=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=d):d=e[9];let p;return e[10]!==i||e[11]!==d?(p=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,d]}),e[10]=i,e[11]=d,e[12]=p):p=e[12],p}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=L(),l=xe({control:s.control,name:"ui_type"}),a=xe({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Re(),p=(()=>{if(typeof a!="string"||!a)return!1;try{const u=new URL(a);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=d||e.connection_type==="STDIO",r=e.connection_type==="VIRTUAL",f=r?Gt(e.connection_url):null;return r?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Ae,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(fe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(B,{children:t.jsxs(he,{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(ie,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(ge,{})]})}),t.jsxs(je,{children:[t.jsx(H,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(H,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(H,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(H,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(Q,{className:"flex-1 min-w-0",children:t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(fe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(B,{children:t.jsx(he,{className:"h-10",children:t.jsx(ge,{})})}),t.jsxs(je,{children:[t.jsx(H,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ie,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(H,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ie,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(H,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ie,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(H,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(H,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(B,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i(p?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(pe,{onClick:c,children:[t.jsx(jt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(pe,{variant:"destructive",onClick:o,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(qt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{children:t.jsx(J,{type:"password",placeholder:i(p?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),p&&t.jsxs(bt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(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"&&Ht(s.connection_headers)){const c=s.connection_headers,o=Ze(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,o=null;return s.ui_type==="NPX"?(e="STDIO",n="",o=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",o=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...o&&{connection_headers:o},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const d=L(),p=ne({from:"/$org/settings/connections/$appSlug"}),m=Le(),r=we(),{org:f}=se(),u=Nt({onSuccess:()=>{a.length<=1&&p({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),v=Ce({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],D=h??s,_=P.find(x=>x.userId===D.created_by),T=s?.connection_type==="VIRTUAL"||v.isAuthenticated,$={...s,tools:o},I=st($,Qt),N=Be({resolver:qe(Ye),values:be(h??s)}),b=N.formState.isDirty,E=async()=>{if(!await N.trigger())return;const w=N.getValues(),O=Ss(w),C=h?.id??e;await r.update.mutateAsync({id:C,data:O}),N.reset(w)},z=()=>{N.reset(be(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ut({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(d("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await r.update.mutateAsync({id:x,data:{connection_token:O}});else try{await r.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await r.update.mutateAsync({id:x,data:{connection_token:O}})}else await r.update.mutateAsync({id:x,data:{connection_token:O}});const G=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await m.invalidateQueries({queryKey:te.isMCPAuthenticated(G.href,null)}),await m.invalidateQueries({queryKey:te.mcpClientPrefix()}),Y.success(d("details.connection.authSuccess"))},A=()=>k(s.id),R=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();Y.error(d("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await m.invalidateQueries({queryKey:te.isMCPAuthenticated(w.href,null)}),Y.success(d("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),Y.error(d("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(St,{...u}),t.jsx(Ge,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(He,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ke,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Qe,{className:"text-base",children:h?.title??s.title}),t.jsx(We,{className:"text-xs",children:d("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:d("details.connection.connectedBy")}),t.jsx(lt,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(vt,{...N,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(K,{control:N.control,name:"title",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(W,{children:d("details.connection.nameLabel")}),t.jsx(B,{children:t.jsx(J,{...x})}),t.jsx(X,{})]})}),t.jsx(K,{control:N.control,name:"description",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(W,{children:d("details.connection.descriptionLabel")}),t.jsx(B,{children:t.jsx(J,{...x,value:x.value||""})}),t.jsx(X,{})]})})]}),t.jsx(js,{form:N,connection:h??s,hasOAuthToken:v.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:N,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:v.supportsOAuth,isServerError:v.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(q,{onClick:E,disabled:!b||c,className:"flex-1",children:d(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(q,{variant:"outline",onClick:z,children:d("details.connection.undoButton")}),t.jsxs(q,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),d("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=a[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:a,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await r.update.mutateAsync({id:x.id,data:{status:w}}),Y.success(d(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(d("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const x=a[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=a.length+1,C=`${w} (${O})`,V=Xe("conn");await r.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const G=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await mt({url:G.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=ne(n);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=Ve(o),{org:a}=se(),d=we();let p;s[2]!==i?(p={slug:i},s[2]=i,s[3]=p):p=s[3];const m=rt(p),r=m[0]??null,f=r?.id??"",u=f||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==u?(h={connectionId:u,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=u,s[7]=h):h=s[7];const g=ke(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let v;if(s[10]!==r?.tools||s[11]!==f||s[12]!==m||s[13]!==S){const k=S?S.tools.map(As):(r?.tools??[]).map(Ts);e:{if(m.length<=1){v=k;break e}const A=new Set,R=[],x=ks;for(const w of m){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),R.push(C))}v=R.length>0?R:k}s[10]=r?.tools,s[11]=f,s[12]=m,s[13]=S,s[14]=v}else v=s[14];const y=v;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:D}=dt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==D?.prompts?(T=D?.prompts??[],s[19]=D?.prompts,s[20]=T):T=s[20];let $;s[21]!==T?($=T.map(ws),s[21]=T,s[22]=$):$=s[22];const I=$;let N;s[23]!==M?.resources?(N=M?.resources??[],s[23]=M?.resources,s[24]=N):N=s[24];let b;s[25]!==N?(b=N.map(_s),s[25]=N,s[26]=b):b=s[26];const E=b;if(!r){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==R||s[37]!==x?(w=t.jsx(q,{variant:"outline",onClick:R,children:x}),s[36]=R,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ye,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==d.update.isPending||s[44]!==y||s[45]!==r||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==m?(z=t.jsx(ys,{org:l,connection:r,connectionId:f,isUpdating:d.update.isPending,tools:y,prompts:I,resources:E,siblings:m}),s[43]=d.update.isPending,s[44]=y,s[45]=r,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=m,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ue,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function _i(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{_i as default};
@@ -1 +0,0 @@
1
- import{c as U,b as Ee,m as ze,j as t,b5 as $e,l as Ve,K as xe,bi as $t,c5 as Dt,bh as zt,bj as _t,bk as Et,B as ge,r as pe,C as Rt,W as Lt,n as He,e as Ae,t as be}from"./index-CxLq_ov_.js";import{f as ke}from"./TrendUp01-yPe3UG0T.js";import{t as it}from"./ChevronUp-CVSn4-gi.js";import{i as ot}from"./ChevronRight-BcTQG1DI.js";import{az as Je,bd as Ft,be as Ut,bf as Mt,bg as ct,a7 as At}from"./agent-icon-DyMYbwSC.js";import{s as dt}from"./Trash01-CV8Q1VzZ.js";import{B as te}from"./badge-DiXK5Efu.js";import{I as It}from"./input-t2vq_Yhz.js";import{L as Be}from"./label-HkRxmwei.js";import{c as mt,d as ut,b as ft,f as xt,g as pt,e as ht,a as bt,A as gt}from"./alert-dialog-Bb1OlmEm.js";import{b as qt,D as Vt,c as Ot,d as Kt,e as Bt}from"./dialog-Do-ZnJpa.js";import{S as lt,a as nt,b as at,c as rt,d as jt}from"./select-CNhOTIVN.js";import{c as We,e as Ye,a as we,d as W,b as Ge,T as Y}from"./table-Bi-psIbe.js";import{E as De}from"./empty-state-CRtvF4Xb.js";import{u as Qt}from"./use-virtual-mcp-Drh4_cTK.js";import{r as Ht}from"./site-slug-uya6Wp4-.js";import{i as Re}from"./CheckCircle-DLOuSHro.js";import{a as Jt}from"./DotsVertical-CqFpz0HG.js";import{n as Tt}from"./LinkExternal01-CvQ-ylaK.js";import{i as Wt}from"./Monitor01-SbvebE9T.js";import{b as Yt}from"./UserSquare-HSvWRq_9.js";import{a as Xe}from"./XCircle-BN22j-Jn.js";import{al as Gt,am as Xt,an as Zt}from"./automation-runs-CHfOqm8r.js";import{b as es,c as ts,T as ss,a as ls}from"./tabs-DZInEuUb.js";import"./AlertCircle-B0exjy2G.js";import"./Tool01-DbPhfEvg.js";import"./ArrowUp-DY0nxQiU.js";import"./ArrowLeft-DDVITG8K.js";import"./Tool02-8qVRgTeE.js";import"./ZoomOut-BUSsAg6c.js";import"./Users03-CMpVHpdR.js";import"./Check-DFnPCTEg.js";import"./ChevronSelectorVertical-DMK3FCxp.js";import"./Copy01-DXf2ReD_.js";import"./CreditCard01-Dufq2QQE.js";import"./Download01-GnhueTng.js";import"./Settings02-B2gnPQ3Q.js";import"./Eye-CHLagXa7.js";import"./Share07-Bu5e840D.js";import"./GitBranch01-CQRzbSyx.js";import"./Globe01-DyhA33s1.js";import"./XClose-N8lMtUXr.js";import"./HardDrive-eC4I4aqw.js";import"./Image01-D6KzR28r.js";import"./Key01-CNitiCfD.js";import"./Link01-BHe0dd0_.js";import"./Sun-aWHPBk6T.js";import"./Package-BIDQhscg.js";import"./Palette-DgVW07vN.js";import"./Play-CR4MAXKW.js";import"./Plus-D-mogJXC.js";import"./SearchMd-BYpvO9Ao.js";import"./Shield01-BAHmK5_B.js";import"./Stars01-CCTPiWmK.js";import"./Upload01-B1Qytz_u.js";import"./User01-DmJKrYPV.js";import"./Users01-B4HgX8Cb.js";import"./Zap-BMyl5tLM.js";import"./use-mcp-client-Bzii9bW9.js";import"./constants-DNuUCxmW.js";import"./auth-Dy3Ai_hi.js";import"./useInfiniteQuery-Cy80sU-k.js";import"./use-infinite-scroll-D8hgBz9p.js";import"./use-connection-B3hf1saX.js";import"./empty-state-BPIeTQLP.js";import"./use-members-CEM7zlP_.js";import"./use-org-auth-client-Crsb07JJ.js";import"./use-automations-Cppk9Xar.js";import"./useSuspenseInfiniteQuery-DKd6bR20.js";import"./avatar-B8b2hWV1.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DvOjkuTL.js";import"./markdown-DFiEgKZj.js";import"./use-panel-navigate-DSf87ewD.js";import"./use-destination-route-BePPmQxb.js";import"./hooks-D1D8x6_l.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-xVL-mPxb.js";import"./task-board-CcPPQONZ.js";import"./schema-ChmhgfCW.js";import"./chat-context-D2SP0J5D.js";import"./thread-route-Ckn7Kp8P.js";import"./thread-intent-BCmi7agT.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-DRa-WP8c.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CkAI1xCS.js";import"./use-organization-settings-DRchtNm3.js";import"./monaco-editor-BFa0VsLo.js";import"./editor-CgtWB5x3.js";import"./types-hwFA5Ktg.js";import"./shell-layout-CAB27XFS.js";import"./project-icon-BY6MP5uE.js";import"./github-repo-COLY3wWI.js";import"./command-CeyGqPmM.js";import"./index-DkQlXscT.js";import"./required-auth-layout-LhCq4pE1.js";import"./use-org-sso-DTBnbTx7.js";import"./integration-icon-Cr-roc4W.js";import"./use-navigate-to-agent-CUFdthzD.js";import"./use-mcp-prompts-BTyLUk2o.js";import"./form-j23QTiVs.js";import"./file-type-icon-BoulZj-0.js";function ns(a){const e=a instanceof Error?a.message.toLowerCase():"";return e.includes("unauthorized")||e.includes("401")}async function as(a){const e=await fetch(a),s=await e.json().catch(()=>({}));if(!e.ok){const l=s&&typeof s=="object"&&"error"in s?String(s.error):`request failed (${e.status})`;throw new Error(l)}return s}function Le(a){return a==null||!Number.isFinite(a)?"—":a>=1e3?`${(a/1e3).toFixed(a>=1e4?0:1)}s`:`${Math.round(a)}ms`}function Ze(a){const e=(a??"").toLowerCase();return e==="pass"||e==="passed"||e==="ok"||e==="success"}function Se(a){const e=(a??"").toLowerCase();return e==="fail"||e==="failed"||e==="error"}function vt(a){const e=(a??"").toLowerCase();return e==="skip"||e==="skipped"}function Qe(a,e){return a.viewport&&a.viewport.trim()?a.viewport:`viewport-${e}`}function et(a){const e=U.c(12),{status:s,t:l}=a;if(Se(s)){let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Xe,{className:"size-3"}),e[0]=r):r=e[0];let o;e[1]!==l?(o=l("mainPanelTabs.e2eTab.statusFailed"),e[1]=l,e[2]=o):o=e[2];let c;return e[3]!==o?(c=t.jsxs(te,{variant:"destructive",children:[r,o]}),e[3]=o,e[4]=c):c=e[4],c}if(Ze(s)){let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Re,{className:"size-3"}),e[5]=r):r=e[5];let o;e[6]!==l?(o=l("mainPanelTabs.e2eTab.statusPassed"),e[6]=l,e[7]=o):o=e[7];let c;return e[8]!==o?(c=t.jsxs(te,{variant:"success",children:[r,o]}),e[8]=o,e[9]=c):c=e[9],c}const n=s??"—";let i;return e[10]!==n?(i=t.jsx(te,{variant:"secondary",children:n}),e[10]=n,e[11]=i):i=e[11],i}function rs(a){const e=U.c(4),{status:s}=a;if(Ze(s)){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Re,{className:"size-4 shrink-0 text-success"}),e[0]=n):n=e[0],n}if(Se(s)){let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Xe,{className:"size-4 shrink-0 text-destructive"}),e[1]=n):n=e[1],n}if(vt(s)){let n;return e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Mt,{className:"size-4 shrink-0 text-muted-foreground"}),e[2]=n):n=e[2],n}let l;return e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Jt,{className:"size-4 shrink-0 text-muted-foreground/60"}),e[3]=l):l=e[3],l}function is(a){return Ze(a)?"bg-success":Se(a)?"bg-destructive":vt(a)?"bg-muted-foreground/40":"bg-muted-foreground/25"}function os(a){const e=U.c(4),{steps:s}=a;if(s.length===0)return null;let l;e[0]!==s?(l=s.map(cs),e[0]=s,e[1]=l):l=e[1];let n;return e[2]!==l?(n=t.jsx("div",{className:"flex flex-wrap items-center gap-1",children:l}),e[2]=l,e[3]=n):n=e[3],n}function cs(a,e){return t.jsx("span",{title:a.name??`step ${e+1}`,className:Ve("size-1.5 rounded-full",is(a.status))},e)}const ds=[{key:"lcp",label:"LCP",good:2500,poor:4e3,unit:"ms"},{key:"inp",label:"INP",good:200,poor:500,unit:"ms"},{key:"cls",label:"CLS",good:.1,poor:.25,unit:"cls"},{key:"fcp",label:"FCP",good:1800,poor:3e3,unit:"ms"},{key:"ttfb",label:"TTFB",good:800,poor:1800,unit:"ms"}];function Nt(a){const e=U.c(7),{vitals:s}=a;let l,n,i;if(e[0]!==s){i=Symbol.for("react.early_return_sentinel");e:{const o=ds.filter(c=>{const{key:m}=c,d=s[m];return d!=null&&Number.isFinite(d)});if(o.length===0){i=null;break e}l="grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-5",n=o.map(c=>{const{key:m,label:d,good:u,poor:T,unit:p}=c,f=s[m],x=f<=u?"text-success":f<=T?"text-warning":"text-destructive",v=p==="cls"?f.toFixed(3):Le(f);return t.jsxs("div",{className:"flex flex-col gap-1 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[t.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:d}),t.jsx("span",{className:Ve("font-mono text-sm font-semibold tabular-nums",x),children:v})]},m)})}e[0]=s,e[1]=l,e[2]=n,e[3]=i}else l=e[1],n=e[2],i=e[3];if(i!==Symbol.for("react.early_return_sentinel"))return i;let r;return e[4]!==l||e[5]!==n?(r=t.jsx("div",{className:l,children:n}),e[4]=l,e[5]=n,e[6]=r):r=e[6],r}function Ue(a){const e=U.c(17),{icon:s,label:l,badge:n,defaultOpen:i,children:r}=a,o=i===void 0?!1:i,[c,m]=pe.useState(o);let d;e[0]!==c?(d=c?t.jsx(it,{className:"size-4 text-muted-foreground"}):t.jsx(ot,{className:"size-4 text-muted-foreground"}),e[0]=c,e[1]=d):d=e[1];let u;e[2]!==l?(u=t.jsx("span",{className:"text-sm font-medium text-foreground",children:l}),e[2]=l,e[3]=u):u=e[3];let T;e[4]!==n?(T=n!=null&&t.jsx("span",{className:"ml-auto",children:n}),e[4]=n,e[5]=T):T=e[5];let p;e[6]!==s||e[7]!==d||e[8]!==u||e[9]!==T?(p=t.jsxs(Gt,{className:"flex w-full items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-left hover:bg-muted/40",children:[d,s,u,T]}),e[6]=s,e[7]=d,e[8]=u,e[9]=T,e[10]=p):p=e[10];let f;e[11]!==r?(f=t.jsx(Xt,{className:"pt-2",children:r}),e[11]=r,e[12]=f):f=e[12];let x;return e[13]!==c||e[14]!==p||e[15]!==f?(x=t.jsxs(Zt,{open:c,onOpenChange:m,children:[p,f]}),e[13]=c,e[14]=p,e[15]=f,e[16]=x):x=e[16],x}function ms(a){const e=U.c(51),{step:s,index:l,t:n}=a;let i;e[0]!==s.status?(i=Se(s.status),e[0]=s.status,e[1]=i):i=e[1];const r=i;let o;e[2]!==s.status?(o=t.jsx(rs,{status:s.status}),e[2]=s.status,e[3]=o):o=e[3];const c=s.step??l+1;let m;e[4]!==c?(m=t.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/60 tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];let d;e[6]!==o||e[7]!==m?(d=t.jsxs("div",{className:"flex flex-col items-center gap-1",children:[o,m]}),e[6]=o,e[7]=m,e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==s.actionDescription||e[11]!==s.name||e[12]!==n?(u=s.name??s.actionDescription??`${n("mainPanelTabs.e2eTab.steps")} ${l+1}`,e[9]=l,e[10]=s.actionDescription,e[11]=s.name,e[12]=n,e[13]=u):u=e[13];let T;e[14]!==s.critical||e[15]!==n?(T=s.critical&&t.jsx(te,{variant:"warning",className:"ml-2 align-middle",children:n("mainPanelTabs.e2eTab.critical")}),e[14]=s.critical,e[15]=n,e[16]=T):T=e[16];let p;e[17]!==u||e[18]!==T?(p=t.jsxs("span",{className:"truncate text-sm font-medium text-foreground",children:[u,T]}),e[17]=u,e[18]=T,e[19]=p):p=e[19];let f;e[20]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Je,{className:"size-3"}),e[20]=f):f=e[20];let x;e[21]!==s.durationMs?(x=Le(s.durationMs),e[21]=s.durationMs,e[22]=x):x=e[22];let v;e[23]!==x?(v=t.jsxs("span",{className:"flex shrink-0 items-center gap-1 font-mono text-[11px] text-muted-foreground tabular-nums",children:[f,x]}),e[23]=x,e[24]=v):v=e[24];let y;e[25]!==v||e[26]!==p?(y=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p,v]}),e[25]=v,e[26]=p,e[27]=y):y=e[27];let h;e[28]!==s.actionDescription||e[29]!==s.name?(h=s.actionDescription&&s.actionDescription!==s.name&&t.jsx("p",{className:"text-xs text-muted-foreground",children:s.actionDescription}),e[28]=s.actionDescription,e[29]=s.name,e[30]=h):h=e[30];let P;e[31]!==s.usedSelector?(P=s.usedSelector&&t.jsxs("code",{className:"flex w-fit items-center gap-1 rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground/70",children:[t.jsx(Ut,{className:"size-3 text-muted-foreground"}),s.usedSelector]}),e[31]=s.usedSelector,e[32]=P):P=e[32];let g;e[33]!==r||e[34]!==s.errorDetail||e[35]!==n?(g=r&&s.errorDetail&&t.jsxs("div",{className:"flex items-start gap-1.5 rounded-lg bg-destructive/10 px-2.5 py-2 text-xs text-destructive",children:[t.jsx(Rt,{className:"mt-0.5 size-3.5 shrink-0"}),t.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[s.errorDetail.slug&&t.jsx("span",{className:"break-words",children:n("mainPanelTabs.e2eTab.missingSelector",{slug:s.errorDetail.slug})}),s.errorDetail.expected&&t.jsx("span",{className:"break-words text-destructive/80",children:n("mainPanelTabs.e2eTab.expected",{value:s.errorDetail.expected})}),s.errorDetail.suggestion&&t.jsx("span",{className:"break-words text-destructive/80",children:s.errorDetail.suggestion})]})]}),e[33]=r,e[34]=s.errorDetail,e[35]=n,e[36]=g):g=e[36];let b;e[37]!==l||e[38]!==s.name||e[39]!==s.screenshotUrl||e[40]!==n?(b=s.screenshotUrl&&t.jsx("a",{href:s.screenshotUrl,target:"_blank",rel:"noreferrer",className:"mt-1 w-fit","aria-label":n("mainPanelTabs.e2eTab.viewScreenshot"),children:t.jsx("img",{src:s.screenshotUrl,alt:s.name??`step ${l+1}`,loading:"lazy",className:"max-h-44 rounded-lg border border-border"})}),e[37]=l,e[38]=s.name,e[39]=s.screenshotUrl,e[40]=n,e[41]=b):b=e[41];let N;e[42]!==y||e[43]!==h||e[44]!==P||e[45]!==g||e[46]!==b?(N=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[y,h,P,g,b]}),e[42]=y,e[43]=h,e[44]=P,e[45]=g,e[46]=b,e[47]=N):N=e[47];let j;return e[48]!==N||e[49]!==d?(j=t.jsxs("li",{className:"flex gap-3 py-2.5",children:[d,N]}),e[48]=N,e[49]=d,e[50]=j):j=e[50],j}function us(a){const e=U.c(8),{entries:s,t:l}=a;if(s.length===0){let r;e[0]!==l?(r=l("mainPanelTabs.e2eTab.noConsole"),e[0]=l,e[1]=r):r=e[1];let o;return e[2]!==r?(o=t.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3],o}let n;e[4]!==s?(n=s.map(fs),e[4]=s,e[5]=n):n=e[5];let i;return e[6]!==n?(i=t.jsx("div",{className:"flex max-h-72 flex-col overflow-y-auto rounded-lg border border-border",children:n}),e[6]=n,e[7]=i):i=e[7],i}function fs(a,e){const s=(a.type??"").toLowerCase(),l=s==="error"?"text-destructive":s==="warning"||s==="warn"?"text-warning":"text-foreground/70";return t.jsx("div",{className:"border-b border-border/60 px-2.5 py-1.5 font-mono text-[11px] last:border-b-0",children:t.jsx("span",{className:Ve("break-words",l),children:a.text})},e)}function xs(a){const e=U.c(8),{entries:s,t:l}=a;if(s.length===0){let r;e[0]!==l?(r=l("mainPanelTabs.e2eTab.noNetwork"),e[0]=l,e[1]=r):r=e[1];let o;return e[2]!==r?(o=t.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=o):o=e[3],o}let n;e[4]!==s?(n=s.map(ps),e[4]=s,e[5]=n):n=e[5];let i;return e[6]!==n?(i=t.jsx("div",{className:"flex max-h-72 flex-col overflow-y-auto rounded-lg border border-border",children:n}),e[6]=n,e[7]=i):i=e[7],i}function ps(a,e){const s=(a.status??0)>=400;return t.jsxs("div",{className:"flex items-center gap-2 border-b border-border/60 px-2.5 py-1.5 font-mono text-[11px] last:border-b-0",children:[t.jsx("span",{className:Ve("tabular-nums",s?"text-destructive":"text-muted-foreground"),children:a.status??"—"}),t.jsx("span",{className:"w-10 shrink-0 text-muted-foreground/70",children:a.method}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-foreground/70",children:a.url}),a.resourceType&&t.jsx("span",{className:"shrink-0 text-muted-foreground/50",children:a.resourceType})]},e)}function hs(a){const e=U.c(57),{run:s,page:l,t:n}=a;let i;e[0]!==s.steps?(i=s.steps??[],e[0]=s.steps,e[1]=i):i=e[1];const r=i;let o;e[2]!==r?(o=r.filter(gs),e[2]=r,e[3]=o):o=e[3];const c=o.length;let m;e[4]!==s.console?(m=s.console??[],e[4]=s.console,e[5]=m):m=e[5];const d=m;let u;e[6]!==s.network?(u=s.network??[],e[6]=s.network,e[7]=u):u=e[7];const T=u;let p;e[8]!==d?(p=d.some(bs),e[8]=d,e[9]=p):p=e[9];const f=p;let x;e[10]!==s.verdict||e[11]!==n?(x=t.jsx(et,{status:s.verdict,t:n}),e[10]=s.verdict,e[11]=n,e[12]=x):x=e[12];let v;e[13]!==s.funnelVerdict||e[14]!==s.verdict||e[15]!==n?(v=s.funnelVerdict&&s.funnelVerdict!==s.verdict&&t.jsxs("span",{children:[n("mainPanelTabs.e2eTab.funnel"),":"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.funnelVerdict})]}),e[13]=s.funnelVerdict,e[14]=s.verdict,e[15]=n,e[16]=v):v=e[16];let y;e[17]!==s.durationMs?(y=s.durationMs!=null&&t.jsxs("span",{className:"flex items-center gap-1 tabular-nums",children:[t.jsx(Je,{className:"size-3"}),Le(s.durationMs)]}),e[17]=s.durationMs,e[18]=y):y=e[18];let h;e[19]!==l?(h=l?.status!=null&&t.jsxs(te,{variant:l.status<400?"secondary":"destructive",children:["HTTP ",l.status]}),e[19]=l,e[20]=h):h=e[20];let P;e[21]!==x||e[22]!==v||e[23]!==y||e[24]!==h?(P=t.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[x,v,y,h]}),e[21]=x,e[22]=v,e[23]=y,e[24]=h,e[25]=P):P=e[25];let g;e[26]!==r?(g=r.length>0&&t.jsx(os,{steps:r}),e[26]=r,e[27]=g):g=e[27];let b;e[28]!==l||e[29]!==n?(b=l?.vitals&&t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h4",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n("mainPanelTabs.e2eTab.vitals")}),t.jsx(Nt,{vitals:l.vitals})]}),e[28]=l,e[29]=n,e[30]=b):b=e[30];let N;e[31]!==c||e[32]!==r||e[33]!==n?(N=r.length>0&&t.jsx(Ue,{defaultOpen:!0,icon:t.jsx(Re,{className:"size-4 text-muted-foreground"}),label:n("mainPanelTabs.e2eTab.steps"),badge:c>0?t.jsx(te,{variant:"destructive",children:n("mainPanelTabs.e2eTab.failCount",{count:String(c)})}):t.jsx(te,{variant:"secondary",children:n("mainPanelTabs.e2eTab.stepsCount",{count:String(r.length)})}),children:t.jsx("ol",{className:"divide-y divide-border/60 rounded-lg border border-border px-3",children:r.map((D,_)=>t.jsx(ms,{step:D,index:_,t:n},_))})}),e[31]=c,e[32]=r,e[33]=n,e[34]=N):N=e[34];let j;e[35]!==d||e[36]!==f||e[37]!==n?(j=d.length>0&&t.jsx(Ue,{icon:t.jsx(Yt,{className:"size-4 text-muted-foreground"}),label:n("mainPanelTabs.e2eTab.console"),badge:t.jsx(te,{variant:f?"destructive":"secondary",children:d.length}),children:t.jsx(us,{entries:d,t:n})}),e[35]=d,e[36]=f,e[37]=n,e[38]=j):j=e[38];let w;e[39]!==T||e[40]!==n?(w=T.length>0&&t.jsx(Ue,{icon:t.jsx(Wt,{className:"size-4 text-muted-foreground"}),label:n("mainPanelTabs.e2eTab.network"),badge:t.jsx(te,{variant:"secondary",children:T.length}),children:t.jsx(xs,{entries:T,t:n})}),e[39]=T,e[40]=n,e[41]=w):w=e[41];let S;e[42]!==s.videoUrl||e[43]!==n?(S=s.videoUrl&&t.jsx(Ue,{icon:t.jsx(Ft,{className:"size-4 text-muted-foreground"}),label:n("mainPanelTabs.e2eTab.video"),children:t.jsx("video",{controls:!0,src:s.videoUrl,className:"max-h-80 w-full rounded-lg border border-border"})}),e[42]=s.videoUrl,e[43]=n,e[44]=S):S=e[44];let C;e[45]!==s.traceUrl||e[46]!==n?(C=s.traceUrl&&t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsx(ge,{size:"sm",variant:"secondary",asChild:!0,children:t.jsxs("a",{href:`https://trace.playwright.dev/?trace=${encodeURIComponent(s.traceUrl)}`,target:"_blank",rel:"noreferrer",children:[t.jsx(Tt,{className:"size-4"}),n("mainPanelTabs.e2eTab.openTrace")]})}),t.jsx("a",{href:s.traceUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground hover:text-foreground hover:underline",children:n("mainPanelTabs.e2eTab.downloadTrace")})]}),e[45]=s.traceUrl,e[46]=n,e[47]=C):C=e[47];let k;return e[48]!==P||e[49]!==g||e[50]!==b||e[51]!==N||e[52]!==j||e[53]!==w||e[54]!==S||e[55]!==C?(k=t.jsxs("div",{className:"flex flex-col gap-4 pt-4",children:[P,g,b,N,j,w,S,C]}),e[48]=P,e[49]=g,e[50]=b,e[51]=N,e[52]=j,e[53]=w,e[54]=S,e[55]=C,e[56]=k):k=e[56],k}function bs(a){return(a.type??"").toLowerCase()==="error"}function gs(a){return Se(a.status)}function yt(a){const e=U.c(7),{artifacts:s,t:l}=a;let n;if(e[0]!==s||e[1]!==l){const i=s.filter(Ts),r=s.filter(js);let o;e[3]!==l?(o=l("mainPanelTabs.e2eTab.artifacts"),e[3]=l,e[4]=o):o=e[4];let c;e[5]!==o?(c=t.jsx("h4",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:o}),e[5]=o,e[6]=c):c=e[6],n=t.jsxs("section",{className:"flex flex-col gap-2",children:[c,s.length===0?t.jsx("p",{className:"text-xs text-muted-foreground",children:l("mainPanelTabs.e2eTab.noArtifacts")}):t.jsxs("div",{className:"flex flex-col gap-2",children:[i.length>0&&t.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:i.map((m,d)=>t.jsx("a",{href:m.url,target:"_blank",rel:"noreferrer","aria-label":m.name??l("mainPanelTabs.e2eTab.viewScreenshot"),children:t.jsx("img",{src:m.url,alt:m.name??"screenshot",loading:"lazy",className:"w-full rounded-lg border border-border"})},`${m.name??"img"}-${d}`))}),r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((m,d)=>t.jsxs("a",{href:m.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-2.5 py-1 font-mono text-[11px] text-foreground/80 hover:bg-muted/40",children:[m.name??l("mainPanelTabs.e2eTab.openArtifact"),t.jsx(Tt,{className:"size-3 text-muted-foreground"})]},`${m.name??"artifact"}-${d}`))})]})]}),e[0]=s,e[1]=l,e[2]=n}else n=e[2];return n}function js(a){return!/\.png$/i.test(a.name??"")}function Ts(a){return/\.png$/i.test(a.name??"")}function vs(a){const e=U.c(9),{checks:s,artifacts:l,t:n}=a;let i;e[0]!==s||e[1]!==n?(i=s.length>0?t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h4",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n("mainPanelTabs.e2eTab.checksTitle")}),t.jsx("div",{className:"rounded-lg border border-border",children:t.jsxs(We,{children:[t.jsx(Ye,{children:t.jsxs(we,{children:[t.jsx(W,{children:n("mainPanelTabs.e2eTab.colCheck")}),t.jsx(W,{children:n("mainPanelTabs.e2eTab.colStatus")}),t.jsx(W,{children:n("mainPanelTabs.e2eTab.colViewport")}),t.jsx(W,{className:"text-right",children:n("mainPanelTabs.e2eTab.colDuration")})]})}),t.jsx(Ge,{children:s.map((c,m)=>t.jsxs(we,{children:[t.jsx(Y,{className:"text-xs text-foreground",children:c.name??"—"}),t.jsx(Y,{children:t.jsx(et,{status:c.status,t:n})}),t.jsx(Y,{className:"font-mono text-xs text-muted-foreground",children:c.viewport??"—"}),t.jsx(Y,{className:"text-right font-mono text-xs text-muted-foreground tabular-nums",children:Le(c.durationMs)})]},`${c.name??"check"}-${m}`))})]})})]}):t.jsx("p",{className:"text-sm text-muted-foreground",children:n("mainPanelTabs.e2eTab.noReport")}),e[0]=s,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==l||e[4]!==n?(r=t.jsx(yt,{artifacts:l,t:n}),e[3]=l,e[4]=n,e[5]=r):r=e[5];let o;return e[6]!==i||e[7]!==r?(o=t.jsxs("div",{className:"flex flex-col gap-5",children:[i,r]}),e[6]=i,e[7]=r,e[8]=o):o=e[8],o}function Ns(a){const e=U.c(46),{data:s,t:l}=a,n=s.report??null;let i;e[0]!==n?.runs?(i=n?.runs??[],e[0]=n?.runs,e[1]=i):i=e[1];const r=i;let o;e[2]!==s.checks?(o=s.checks??[],e[2]=s.checks,e[3]=o):o=e[3];const c=o;let m;e[4]!==s.artifacts?(m=s.artifacts??[],e[4]=s.artifacts,e[5]=m):m=e[5];const d=m;let u;if(e[6]!==n?.pages){u=new Map;for(const h of n?.pages??[])h.viewport&&!u.has(h.viewport)&&u.set(h.viewport,h);e[6]=n?.pages,e[7]=u}else u=e[7];const T=r[0];if(n&&T){let h;e[8]!==T?(h=Qe(T,0),e[8]=T,e[9]=h):h=e[9];let P;if(e[10]!==r||e[11]!==l){let S;e[13]!==l?(S=(C,k)=>{const D=Qe(C,k);return t.jsxs(es,{value:D,variant:"underline",className:"gap-1.5",children:[Se(C.verdict)?t.jsx(Xe,{className:"size-3.5 text-destructive"}):t.jsx(Re,{className:"size-3.5 text-success"}),C.viewport??`${l("mainPanelTabs.e2eTab.viewport")} ${k+1}`]},D)},e[13]=l,e[14]=S):S=e[14],P=r.map(S),e[10]=r,e[11]=l,e[12]=P}else P=e[12];let g;e[15]!==P?(g=t.jsx(ts,{variant:"underline",className:"flex-wrap",children:P}),e[15]=P,e[16]=g):g=e[16];let b;if(e[17]!==u||e[18]!==r||e[19]!==l){let S;e[21]!==u||e[22]!==l?(S=(C,k)=>{const D=Qe(C,k);return t.jsx(ss,{value:D,children:t.jsx(hs,{run:C,page:C.viewport?u.get(C.viewport):void 0,t:l})},D)},e[21]=u,e[22]=l,e[23]=S):S=e[23],b=r.map(S),e[17]=u,e[18]=r,e[19]=l,e[20]=b}else b=e[20];let N;e[24]!==h||e[25]!==g||e[26]!==b?(N=t.jsxs(ls,{variant:"underline",defaultValue:h,children:[g,b]}),e[24]=h,e[25]=g,e[26]=b,e[27]=N):N=e[27];let j;e[28]!==d||e[29]!==l?(j=d.length>0&&t.jsx(yt,{artifacts:d,t:l}),e[28]=d,e[29]=l,e[30]=j):j=e[30];let w;return e[31]!==N||e[32]!==j?(w=t.jsxs("div",{className:"flex flex-col gap-5",children:[N,j]}),e[31]=N,e[32]=j,e[33]=w):w=e[33],w}let p;e[34]!==n?.pages?(p=(n?.pages??[]).find(ys)?.vitals,e[34]=n?.pages,e[35]=p):p=e[35];const f=p;let x;e[36]!==f||e[37]!==l?(x=f&&t.jsxs("section",{className:"flex flex-col gap-2",children:[t.jsx("h4",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:l("mainPanelTabs.e2eTab.vitals")}),t.jsx(Nt,{vitals:f})]}),e[36]=f,e[37]=l,e[38]=x):x=e[38];let v;e[39]!==d||e[40]!==c||e[41]!==l?(v=t.jsx(vs,{checks:c,artifacts:d,t:l}),e[39]=d,e[40]=c,e[41]=l,e[42]=v):v=e[42];let y;return e[43]!==x||e[44]!==v?(y=t.jsxs("div",{className:"flex flex-col gap-5",children:[x,v]}),e[43]=x,e[44]=v,e[45]=y):y=e[45],y}function ys(a){return a.vitals}function Ps(a){const e=U.c(50),{base:s,orgSlug:l,site:n,run:i,onOpenChange:r}=a,o=Ee(),c=i?.runId??"",m=i!=null;let d;e[0]!==l||e[1]!==c||e[2]!==n?(d=xe.e2eRun(l,n,c),e[0]=l,e[1]=c,e[2]=n,e[3]=d):d=e[3];let u;e[4]!==s||e[5]!==c?(u=()=>as(`${s}/e2e/runs/${encodeURIComponent(c)}`),e[4]=s,e[5]=c,e[6]=u):u=e[6];const T=m&&!!c;let p;e[7]!==d||e[8]!==u||e[9]!==T?(p={queryKey:d,queryFn:u,enabled:T,retry:!1,staleTime:0,gcTime:0,refetchOnMount:"always"},e[7]=d,e[8]=u,e[9]=T,e[10]=p):p=e[10];const f=ze(p),x=f.data,v=x?.status??i?.status??null,y=i?.summary?.command??null,h=i?.summary?.url??null,P=x?.report?.totalDurationMs??null,g=x?.report?.platform??null;let b;e[11]!==o||e[12]!==v?(b=t.jsx(et,{status:v,t:o}),e[11]=o,e[12]=v,e[13]=b):b=e[13];let N;e[14]!==c?(N=t.jsx($t,{className:"font-mono text-sm text-foreground",children:c}),e[14]=c,e[15]=N):N=e[15];let j;e[16]!==b||e[17]!==N?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[b,N]}),e[16]=b,e[17]=N,e[18]=j):j=e[18];let w;e[19]!==y||e[20]!==o?(w=y&&t.jsxs("span",{children:[o("mainPanelTabs.e2eTab.command")," ",t.jsx("span",{className:"font-medium text-foreground",children:y})]}),e[19]=y,e[20]=o,e[21]=w):w=e[21];let S;e[22]!==g?(S=g&&t.jsx("span",{className:"font-medium text-foreground/70",children:g}),e[22]=g,e[23]=S):S=e[23];let C;e[24]!==P?(C=P!=null&&t.jsxs("span",{className:"flex items-center gap-1 tabular-nums",children:[t.jsx(Je,{className:"size-3"}),Le(P)]}),e[24]=P,e[25]=C):C=e[25];let k;e[26]!==h?(k=h&&t.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"truncate font-mono text-foreground/70 hover:underline",children:h.replace(/^https?:\/\//,"")}),e[26]=h,e[27]=k):k=e[27];let D;e[28]!==C||e[29]!==k||e[30]!==w||e[31]!==S?(D=t.jsx(Dt,{asChild:!0,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[w,S,C,k]})}),e[28]=C,e[29]=k,e[30]=w,e[31]=S,e[32]=D):D=e[32];let _;e[33]!==D||e[34]!==j?(_=t.jsxs(zt,{className:"border-b border-border",children:[j,D]}),e[33]=D,e[34]=j,e[35]=_):_=e[35];let F;e[36]!==x||e[37]!==f.error||e[38]!==f.isLoading||e[39]!==o?(F=ns(f.error)?t.jsx(De,{icon:t.jsx(Re,{className:"size-5"}),title:o("mainPanelTabs.e2eTab.notConnectedTitle"),description:o("mainPanelTabs.e2eTab.notConnectedDescription")}):f.isLoading?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx($e,{className:"h-9 w-full"}),t.jsx($e,{className:"h-24 w-full"}),t.jsx($e,{className:"h-40 w-full"})]}):f.error?t.jsx("p",{className:"text-sm text-muted-foreground",children:o("mainPanelTabs.e2eTab.detailError")}):x?t.jsx(Ns,{data:x,t:o}):null,e[36]=x,e[37]=f.error,e[38]=f.isLoading,e[39]=o,e[40]=F):F=e[40];let R;e[41]!==F?(R=t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:F}),e[41]=F,e[42]=R):R=e[42];let L;e[43]!==_||e[44]!==R?(L=t.jsxs(_t,{side:"right",className:"w-full gap-0 p-0 sm:max-w-2xl",children:[_,R]}),e[43]=_,e[44]=R,e[45]=L):L=e[45];let E;return e[46]!==r||e[47]!==m||e[48]!==L?(E=t.jsx(Et,{open:m,onOpenChange:r,children:L}),e[46]=r,e[47]=m,e[48]=L,e[49]=E):E=e[49],E}const Me="once",ws=[{value:Me,labelKey:"mainPanelTabs.e2eTab.scheduleOnce"},{value:"0 * * * *",labelKey:"mainPanelTabs.e2eTab.scheduleHourly"},{value:"0 8 * * *",labelKey:"mainPanelTabs.e2eTab.scheduleDaily"},{value:"0 8 * * 1",labelKey:"mainPanelTabs.e2eTab.scheduleWeekly"}];function Ss(a){const e=U.c(16),{phase:s,t:l}=a,n=(s??"").toLowerCase();if(n==="running"){let o;e[0]!==l?(o=l("mainPanelTabs.e2eTab.statusRunning"),e[0]=l,e[1]=o):o=e[1];let c;return e[2]!==o?(c=t.jsx(te,{variant:"warning",children:o}),e[2]=o,e[3]=c):c=e[3],c}if(n==="succeeded"){let o;e[4]!==l?(o=l("mainPanelTabs.e2eTab.phaseRan"),e[4]=l,e[5]=o):o=e[5];let c;return e[6]!==o?(c=t.jsx(te,{variant:"secondary",children:o}),e[6]=o,e[7]=c):c=e[7],c}if(n==="failed"){let o;e[8]!==l?(o=l("mainPanelTabs.e2eTab.phaseErrored"),e[8]=l,e[9]=o):o=e[9];let c;return e[10]!==o?(c=t.jsx(te,{variant:"destructive",children:o}),e[10]=o,e[11]=c):c=e[11],c}let i;e[12]!==l?(i=l("mainPanelTabs.e2eTab.phasePending"),e[12]=l,e[13]=i):i=e[13];let r;return e[14]!==i?(r=t.jsx(te,{variant:"secondary",children:i}),e[14]=i,e[15]=r):r=e[15],r}function _e(a,e){if(Array.isArray(a))return a;if(a&&typeof a=="object"){const s=a[e];if(Array.isArray(s))return s}return[]}function Pt(a){const e=(a??"").toLowerCase();return e.includes("pass")||e.includes("success")||e.includes("ok")?"success":e.includes("fail")||e.includes("error")?"destructive":e.includes("run")||e.includes("pend")||e.includes("progress")?"warning":"secondary"}function Cs(a,e){const s=Pt(a);return s==="success"?e("mainPanelTabs.e2eTab.statusPassed"):s==="destructive"?e("mainPanelTabs.e2eTab.statusFailed"):s==="warning"?e("mainPanelTabs.e2eTab.statusRunning"):a??"—"}function ks(a,e){const s=[],l=a.summary?.exitCode;typeof l=="number"&&s.push(e("mainPanelTabs.e2eTab.summaryExitCode",{code:String(l)}));const n=a.summary?.fileCount;return typeof n=="number"&&s.push(e("mainPanelTabs.e2eTab.summaryFiles",{count:String(n)})),s.length>0?s.join(" · "):"—"}function wt(a){if(!a)return"—";const e=new Date(a).getTime();if(Number.isNaN(e))return"—";const s=Math.round((Date.now()-e)/1e3),l=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"}),n=[["year",31536e3],["month",2592e3],["day",86400],["hour",3600],["minute",60]];for(const[i,r]of n)if(Math.abs(s)>=r)return l.format(-Math.round(s/r),i);return l.format(-s,"second")}function $s(a){const e=a instanceof Error?a.message.toLowerCase():"";return e.includes("unauthorized")||e.includes("401")}function Oe(a){return a instanceof Error?a.message:String(a)}async function Ie(a){const e=await fetch(a),s=await e.json().catch(()=>({}));if(!e.ok){const l=s&&typeof s=="object"&&"error"in s?String(s.error):`request failed (${e.status})`;throw new Error(l)}return s}async function qe(a,e,s){const l=await fetch(a,{method:e,headers:s!==void 0?{"Content-Type":"application/json"}:{},body:s!==void 0?JSON.stringify(s):void 0}),n=await l.json().catch(()=>({}));if(!l.ok){const i=n&&typeof n=="object"&&"error"in n?String(n.error):`request failed (${l.status})`;throw new Error(i)}return n}function St(a){const e=U.c(15),{title:s,count:l,action:n,children:i}=a;let r;e[0]!==s?(r=t.jsx("h3",{className:"text-sm font-medium text-foreground",children:s}),e[0]=s,e[1]=r):r=e[1];let o;e[2]!==l?(o=typeof l=="number"&&l>0&&t.jsx(te,{variant:"secondary",className:"tabular-nums",children:l}),e[2]=l,e[3]=o):o=e[3];let c;e[4]!==n?(c=n?t.jsx("div",{className:"ml-auto",children:n}):null,e[4]=n,e[5]=c):c=e[5];let m;e[6]!==r||e[7]!==o||e[8]!==c?(m=t.jsxs("header",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[r,o,c]}),e[6]=r,e[7]=o,e[8]=c,e[9]=m):m=e[9];let d;e[10]!==i?(d=t.jsx("div",{className:"p-2",children:i}),e[10]=i,e[11]=d):d=e[11];let u;return e[12]!==m||e[13]!==d?(u=t.jsxs("section",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,d]}),e[12]=m,e[13]=d,e[14]=u):u=e[14],u}function Ct(a){const e=U.c(3),{cols:s}=a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[0,1,2],e[0]=l):l=e[0];let n;return e[1]!==s?(n=t.jsx("div",{className:"flex flex-col gap-2 p-2",children:l.map(i=>t.jsx("div",{className:"flex gap-3",children:Array.from({length:s}).map(Ds)},i))}),e[1]=s,e[2]=n):n=e[2],n}function Ds(a,e){return t.jsx($e,{className:"h-4 flex-1"},e)}function kt(a){const e=U.c(2),{children:s}=a;let l;return e[0]!==s?(l=t.jsx("div",{className:"px-3 py-6 text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1],l}function zs(a){const e=U.c(117),{base:s,orgSlug:l,site:n}=a,i=Ee(),r=He(),[o,c]=pe.useState(!1),[m,d]=pe.useState(""),[u,T]=pe.useState(Me),[p,f]=pe.useState("");let x;e[0]!==l||e[1]!==n?(x=xe.e2eTypes(l,n),e[0]=l,e[1]=n,e[2]=x):x=e[2];let v;e[3]!==s?(v=()=>Ie(`${s}/e2e/types`),e[3]=s,e[4]=v):v=e[4];let y;e[5]!==o||e[6]!==x||e[7]!==v?(y={queryKey:x,queryFn:v,enabled:o,retry:!1,staleTime:6e4},e[5]=o,e[6]=x,e[7]=v,e[8]=y):y=e[8];const h=ze(y),P=_e(h.data,"items");let g;e[9]!==s?(g=me=>{const tt=me.schedule===Me?"":me.schedule,st=me.url.trim();return qe(`${s}/e2e/runs`,"POST",{command:me.command,...tt?{schedule:tt}:{},...st?{url:st}:{}})},e[9]=s,e[10]=g):g=e[10];let b;e[11]!==l||e[12]!==r||e[13]!==n||e[14]!==i?(b=()=>{r.invalidateQueries({queryKey:xe.e2eRuns(l,n)}),r.invalidateQueries({queryKey:xe.e2eChecks(l,n)}),be.success(i("mainPanelTabs.e2eTab.toastRunQueued")),c(!1),d(""),T(Me),f("")},e[11]=l,e[12]=r,e[13]=n,e[14]=i,e[15]=b):b=e[15];let N;e[16]!==g||e[17]!==b?(N={mutationFn:g,onSuccess:b,onError:Es},e[16]=g,e[17]=b,e[18]=N):N=e[18];const j=Ae(N);let w;e[19]!==m?(w=me=>me.id===m,e[19]=m,e[20]=w):w=e[20];const S=P.find(w);let C,k;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=()=>c(!0),k=t.jsx(ct,{className:"size-4"}),e[21]=C,e[22]=k):(C=e[21],k=e[22]);let D;e[23]!==i?(D=i("mainPanelTabs.e2eTab.runTest"),e[23]=i,e[24]=D):D=e[24];let _;e[25]!==D?(_=t.jsxs(ge,{size:"sm",onClick:C,children:[k,D]}),e[25]=D,e[26]=_):_=e[26];const F=Vt,R=qt,L="sm:max-w-md";let E;e[27]!==i?(E=i("mainPanelTabs.e2eTab.runTestTitle"),e[27]=i,e[28]=E):E=e[28];let B;e[29]!==E?(B=t.jsx(Ot,{children:t.jsx(Kt,{children:E})}),e[29]=E,e[30]=B):B=e[30];const G="flex flex-col gap-3";let de;e[31]!==i?(de=i("mainPanelTabs.e2eTab.runTestDescription"),e[31]=i,e[32]=de):de=e[32];let M;e[33]!==de?(M=t.jsx("p",{className:"text-sm text-muted-foreground",children:de}),e[33]=de,e[34]=M):M=e[34];let A;e[35]!==i?(A=i("mainPanelTabs.e2eTab.targetUrl"),e[35]=i,e[36]=A):A=e[36];let I;e[37]!==A?(I=t.jsx(Be,{htmlFor:"e2e-url",children:A}),e[37]=A,e[38]=I):I=e[38];let X;e[39]!==i?(X=i("mainPanelTabs.e2eTab.targetUrlPlaceholder"),e[39]=i,e[40]=X):X=e[40];let Z;e[41]===Symbol.for("react.memo_cache_sentinel")?(Z=me=>f(me.target.value),e[41]=Z):Z=e[41];let q;e[42]!==j.isPending||e[43]!==X||e[44]!==p?(q=t.jsx(It,{id:"e2e-url",type:"url",inputMode:"url",placeholder:X,value:p,onChange:Z,className:"font-mono text-xs",disabled:j.isPending}),e[42]=j.isPending,e[43]=X,e[44]=p,e[45]=q):q=e[45];let V;e[46]!==i?(V=i("mainPanelTabs.e2eTab.targetUrlHint"),e[46]=i,e[47]=V):V=e[47];let O;e[48]!==V?(O=t.jsx("p",{className:"text-xs text-muted-foreground",children:V}),e[48]=V,e[49]=O):O=e[49];let Q;e[50]!==I||e[51]!==q||e[52]!==O?(Q=t.jsxs("div",{className:"flex flex-col gap-2",children:[I,q,O]}),e[50]=I,e[51]=q,e[52]=O,e[53]=Q):Q=e[53];const se="flex flex-col gap-2";let z;e[54]!==i?(z=i("mainPanelTabs.e2eTab.selectType"),e[54]=i,e[55]=z):z=e[55];let ee;e[56]!==z?(ee=t.jsx(Be,{children:z}),e[56]=z,e[57]=ee):ee=e[57];const Ce=h.isLoading?t.jsx($e,{className:"h-9 w-full"}):h.error?t.jsx("p",{className:"text-xs text-destructive",children:i("mainPanelTabs.e2eTab.typesError")}):P.length===0?t.jsx("p",{className:"text-xs text-muted-foreground",children:i("mainPanelTabs.e2eTab.noTypes")}):t.jsxs(lt,{value:m,onValueChange:d,children:[t.jsx(nt,{className:"w-full",children:t.jsx(at,{placeholder:i("mainPanelTabs.e2eTab.selectTypePlaceholder")})}),t.jsx(rt,{children:P.map(_s)})]});let le;e[58]!==S?(le=S?.description&&t.jsx("p",{className:"text-xs text-muted-foreground",children:S.description}),e[58]=S,e[59]=le):le=e[59];let ne;e[60]!==ee||e[61]!==Ce||e[62]!==le?(ne=t.jsxs("div",{className:se,children:[ee,Ce,le]}),e[60]=ee,e[61]=Ce,e[62]=le,e[63]=ne):ne=e[63];let ae;e[64]!==i?(ae=i("mainPanelTabs.e2eTab.scheduleLabel"),e[64]=i,e[65]=ae):ae=e[65];let he;e[66]!==ae?(he=t.jsx(Be,{children:ae}),e[66]=ae,e[67]=he):he=e[67];let ue;e[68]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(nt,{className:"w-full",children:t.jsx(at,{})}),e[68]=ue):ue=e[68];let re;e[69]!==i?(re=ws.map(me=>t.jsx(jt,{value:me.value,children:i(me.labelKey)},me.value||"once")),e[69]=i,e[70]=re):re=e[70];let ie;e[71]!==re?(ie=t.jsx(rt,{children:re}),e[71]=re,e[72]=ie):ie=e[72];let oe;e[73]!==u||e[74]!==ie?(oe=t.jsxs(lt,{value:u,onValueChange:T,children:[ue,ie]}),e[73]=u,e[74]=ie,e[75]=oe):oe=e[75];let ce;e[76]!==he||e[77]!==oe?(ce=t.jsxs("div",{className:"flex flex-col gap-2",children:[he,oe]}),e[76]=he,e[77]=oe,e[78]=ce):ce=e[78];let fe;e[79]!==M||e[80]!==Q||e[81]!==ne||e[82]!==ce?(fe=t.jsxs("div",{className:G,children:[M,Q,ne,ce]}),e[79]=M,e[80]=Q,e[81]=ne,e[82]=ce,e[83]=fe):fe=e[83];let $;e[84]===Symbol.for("react.memo_cache_sentinel")?($=()=>c(!1),e[84]=$):$=e[84];const H=j.isPending;let K;e[85]!==i?(K=i("mainPanelTabs.e2eTab.cancel"),e[85]=i,e[86]=K):K=e[86];let J;e[87]!==j.isPending||e[88]!==K?(J=t.jsx(ge,{variant:"outline",type:"button",onClick:$,disabled:H,children:K}),e[87]=j.isPending,e[88]=K,e[89]=J):J=e[89];let je;e[90]!==m||e[91]!==j||e[92]!==u||e[93]!==p?(je=()=>m&&j.mutate({command:m,schedule:u,url:p}),e[90]=m,e[91]=j,e[92]=u,e[93]=p,e[94]=je):je=e[94];const Ke=!m||j.isPending;let Te;e[95]!==j.isPending||e[96]!==i?(Te=j.isPending?i("mainPanelTabs.e2eTab.running"):i("mainPanelTabs.e2eTab.runConfirm"),e[95]=j.isPending,e[96]=i,e[97]=Te):Te=e[97];let ve;e[98]!==je||e[99]!==Ke||e[100]!==Te?(ve=t.jsx(ge,{type:"button",onClick:je,disabled:Ke,children:Te}),e[98]=je,e[99]=Ke,e[100]=Te,e[101]=ve):ve=e[101];let Ne;e[102]!==J||e[103]!==ve?(Ne=t.jsxs(Bt,{children:[J,ve]}),e[102]=J,e[103]=ve,e[104]=Ne):Ne=e[104];let ye;e[105]!==R||e[106]!==B||e[107]!==fe||e[108]!==Ne?(ye=t.jsxs(R,{className:L,children:[B,fe,Ne]}),e[105]=R,e[106]=B,e[107]=fe,e[108]=Ne,e[109]=ye):ye=e[109];let Pe;e[110]!==F||e[111]!==o||e[112]!==ye?(Pe=t.jsx(F,{open:o,onOpenChange:c,children:ye}),e[110]=F,e[111]=o,e[112]=ye,e[113]=Pe):Pe=e[113];let Fe;return e[114]!==_||e[115]!==Pe?(Fe=t.jsxs(t.Fragment,{children:[_,Pe]}),e[114]=_,e[115]=Pe,e[116]=Fe):Fe=e[116],Fe}function _s(a){return t.jsx(jt,{value:a.id,textValue:a.label??a.id,children:t.jsx("span",{className:"text-sm",children:a.label??a.id})},a.id)}function Es(a){return be.error(Oe(a))}function Rs(){const a=U.c(17),e=Ee(),[s,l]=pe.useState(!1);let n;a[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>l(Ls),a[0]=n):n=a[0];let i;a[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(At,{className:"size-4 text-muted-foreground"}),a[1]=i):i=a[1];let r;a[2]!==e?(r=e("mainPanelTabs.e2eTab.helpTitle"),a[2]=e,a[3]=r):r=a[3];let o;a[4]!==r?(o=t.jsx("span",{className:"text-sm font-medium text-foreground",children:r}),a[4]=r,a[5]=o):o=a[5];let c;a[6]!==s?(c=s?t.jsx(it,{className:"ml-auto size-4 text-muted-foreground"}):t.jsx(ot,{className:"ml-auto size-4 text-muted-foreground"}),a[6]=s,a[7]=c):c=a[7];let m;a[8]!==o||a[9]!==c?(m=t.jsxs("button",{type:"button",onClick:n,className:"flex w-full items-center gap-2 px-4 py-3 text-left",children:[i,o,c]}),a[8]=o,a[9]=c,a[10]=m):m=a[10];let d;a[11]!==s||a[12]!==e?(d=s&&t.jsxs("div",{className:"flex flex-col gap-2 border-t border-border px-4 py-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:e("mainPanelTabs.e2eTab.helpIntro")}),t.jsx("p",{children:e("mainPanelTabs.e2eTab.helpTypes")}),t.jsx("p",{children:e("mainPanelTabs.e2eTab.helpRun")}),t.jsx("p",{children:e("mainPanelTabs.e2eTab.helpResults")})]}),a[11]=s,a[12]=e,a[13]=d):d=a[13];let u;return a[14]!==m||a[15]!==d?(u=t.jsxs("div",{className:"rounded-xl border border-border bg-card",children:[m,d]}),a[14]=m,a[15]=d,a[16]=u):u=a[16],u}function Ls(a){return!a}function Fs(a){const e=U.c(71),{base:s,orgSlug:l,site:n,enabled:i}=a,r=Ee(),o=He(),[c,m]=pe.useState(!1);let d;e[0]!==l||e[1]!==n?(d=xe.e2eChecks(l,n),e[0]=l,e[1]=n,e[2]=d):d=e[2];let u;e[3]!==s?(u=()=>Ie(`${s}/e2e/checks`),e[3]=s,e[4]=u):u=e[4];let T;e[5]!==i||e[6]!==d||e[7]!==u?(T={queryKey:d,queryFn:u,enabled:i,retry:!1,staleTime:15e3,refetchInterval:As},e[5]=i,e[6]=d,e[7]=u,e[8]=T):T=e[8];const p=ze(T),f=_e(p.data,"items");let x;e[9]!==l||e[10]!==o||e[11]!==n?(x=()=>{o.invalidateQueries({queryKey:xe.e2eChecks(l,n)}),o.invalidateQueries({queryKey:xe.e2eRuns(l,n)})},e[9]=l,e[10]=o,e[11]=n,e[12]=x):x=e[12];const v=x;let y;e[13]!==s?(y=z=>qe(`${s}/e2e/runs`,"POST",{command:z}),e[13]=s,e[14]=y):y=e[14];let h;e[15]!==v||e[16]!==r?(h=()=>{v(),be.success(r("mainPanelTabs.e2eTab.toastRunQueued"))},e[15]=v,e[16]=r,e[17]=h):h=e[17];let P;e[18]!==y||e[19]!==h?(P={mutationFn:y,onSuccess:h,onError:Ms},e[18]=y,e[19]=h,e[20]=P):P=e[20];const g=Ae(P);let b;e[21]!==s?(b=()=>qe(`${s}/e2e/checks`,"DELETE"),e[21]=s,e[22]=b):b=e[22];let N;e[23]!==v||e[24]!==r?(N=()=>{v(),be.success(r("mainPanelTabs.e2eTab.toastCheckDeleted")),m(!1)},e[23]=v,e[24]=r,e[25]=N):N=e[25];let j;e[26]!==b||e[27]!==N?(j={mutationFn:b,onSuccess:N,onError:Us},e[26]=b,e[27]=N,e[28]=j):j=e[28];const w=Ae(j),S=g.isPending||w.isPending,C=St;let k;e[29]!==r?(k=r("mainPanelTabs.e2eTab.checksSection"),e[29]=r,e[30]=k):k=e[30];const D=f.length,_=f.length>0?t.jsxs(ge,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>m(!0),disabled:S,children:[t.jsx(dt,{className:"size-4"}),r("mainPanelTabs.e2eTab.deleteAllChecks")]}):null,F=p.isLoading?t.jsx(Ct,{cols:6}):p.error?t.jsx(kt,{children:r("mainPanelTabs.e2eTab.checksError")}):f.length===0?t.jsx(De,{icon:t.jsx(ke,{className:"size-5"}),title:r("mainPanelTabs.e2eTab.noChecks")}):t.jsxs(We,{children:[t.jsx(Ye,{children:t.jsxs(we,{children:[t.jsx(W,{children:r("mainPanelTabs.e2eTab.colStatus")}),t.jsx(W,{children:r("mainPanelTabs.e2eTab.colCommand")}),t.jsx(W,{children:r("mainPanelTabs.e2eTab.colSchedule")}),t.jsx(W,{children:r("mainPanelTabs.e2eTab.url")}),t.jsx(W,{children:r("mainPanelTabs.e2eTab.colUpdated")}),t.jsx(W,{className:"w-[1%]"})]})}),t.jsx(Ge,{children:f.map((z,ee)=>t.jsxs(we,{children:[t.jsx(Y,{children:t.jsx(Ss,{phase:z.phase,t:r})}),t.jsx(Y,{className:"font-mono text-xs text-muted-foreground",children:z.command??"—"}),t.jsx(Y,{className:"font-mono text-xs text-muted-foreground",children:z.schedule?z.schedule:"—"}),t.jsx(Y,{className:"max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:z.url??"—"}),t.jsx(Y,{className:"text-xs text-muted-foreground whitespace-nowrap",children:wt(z.updatedAt)}),t.jsx(Y,{className:"text-right align-middle whitespace-nowrap",children:t.jsx(ge,{size:"icon-sm",variant:"ghost","aria-label":r("mainPanelTabs.e2eTab.rerun"),title:r("mainPanelTabs.e2eTab.rerun"),onClick:()=>z.command&&g.mutate(z.command),disabled:S||!z.command,children:t.jsx(ct,{className:"size-4"})})})]},`${z.subject??n}-${z.command??""}-${ee}`))})]});let R;e[31]!==r?(R=r("mainPanelTabs.e2eTab.confirmDeleteCheckTitle"),e[31]=r,e[32]=R):R=e[32];let L;e[33]!==R?(L=t.jsx(mt,{children:R}),e[33]=R,e[34]=L):L=e[34];let E;e[35]!==r?(E=r("mainPanelTabs.e2eTab.confirmDeleteCheck"),e[35]=r,e[36]=E):E=e[36];let B;e[37]!==E?(B=t.jsx(ut,{children:E}),e[37]=E,e[38]=B):B=e[38];let G;e[39]!==L||e[40]!==B?(G=t.jsxs(ft,{children:[L,B]}),e[39]=L,e[40]=B,e[41]=G):G=e[41];const de=w.isPending;let M;e[42]!==r?(M=r("mainPanelTabs.e2eTab.cancel"),e[42]=r,e[43]=M):M=e[43];let A;e[44]!==w.isPending||e[45]!==M?(A=t.jsx(xt,{disabled:de,children:M}),e[44]=w.isPending,e[45]=M,e[46]=A):A=e[46];let I;e[47]!==w?(I=z=>{z.preventDefault(),w.mutate()},e[47]=w,e[48]=I):I=e[48];const X=w.isPending;let Z;e[49]!==r?(Z=r("mainPanelTabs.e2eTab.delete"),e[49]=r,e[50]=Z):Z=e[50];let q;e[51]!==w.isPending||e[52]!==I||e[53]!==Z?(q=t.jsx(pt,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:I,disabled:X,children:Z}),e[51]=w.isPending,e[52]=I,e[53]=Z,e[54]=q):q=e[54];let V;e[55]!==A||e[56]!==q?(V=t.jsxs(ht,{children:[A,q]}),e[55]=A,e[56]=q,e[57]=V):V=e[57];let O;e[58]!==G||e[59]!==V?(O=t.jsxs(bt,{children:[G,V]}),e[58]=G,e[59]=V,e[60]=O):O=e[60];let Q;e[61]!==c||e[62]!==O?(Q=t.jsx(gt,{open:c,onOpenChange:m,children:O}),e[61]=c,e[62]=O,e[63]=Q):Q=e[63];let se;return e[64]!==C||e[65]!==f||e[66]!==k||e[67]!==_||e[68]!==F||e[69]!==Q?(se=t.jsxs(C,{title:k,count:D,action:_,children:[F,Q]}),e[64]=C,e[65]=f,e[66]=k,e[67]=_,e[68]=F,e[69]=Q,e[70]=se):se=e[70],se}function Us(a){return be.error(Oe(a))}function Ms(a){return be.error(Oe(a))}function As(a){return _e(a.state.data,"items").some(Is)?5e3:!1}function Is(a){const e=(a.phase??"").toLowerCase();return e===""||e==="running"||e==="pending"}function Vn(a){const e=U.c(107),{virtualMcpId:s}=a,l=Ee(),{org:n}=Lt(),i=Qt(s),r=Ht(i),o=!!r,c=r?`/api/${n.slug}/hosting/${encodeURIComponent(r)}`:"",m=He(),[d,u]=pe.useState(null),[T,p]=pe.useState(null);let f;e[0]!==c?(f=()=>Ie(`${c}/e2e/checks`),e[0]=c,e[1]=f):f=e[1];const x=ze({queryKey:xe.e2eChecks(n.slug,r??""),queryFn:f,enabled:o,retry:!1,staleTime:15e3}),v=_e(x.data,"items").some(Vs);let y;e[2]!==c?(y=()=>Ie(`${c}/e2e/runs`),e[2]=c,e[3]=y):y=e[3];const h=ze({queryKey:xe.e2eRuns(n.slug,r??""),queryFn:y,enabled:o,retry:!1,staleTime:3e4,refetchInterval:v?5e3:!1});let P;e[4]!==c?(P=$=>qe(`${c}/e2e/runs/${encodeURIComponent($)}`,"DELETE"),e[4]=c,e[5]=P):P=e[5];const g=Ae({mutationFn:P,onSuccess:()=>{m.invalidateQueries({queryKey:xe.e2eRuns(n.slug,r??"")}),be.success(l("mainPanelTabs.e2eTab.toastRunDeleted")),p(null)},onError:qs});if(!r){let $;e[6]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ke,{className:"size-5"}),e[6]=$):$=e[6];let H;e[7]!==l?(H=l("mainPanelTabs.e2eTab.noSiteTitle"),e[7]=l,e[8]=H):H=e[8];let K;e[9]!==l?(K=l("mainPanelTabs.e2eTab.noSiteDescription"),e[9]=l,e[10]=K):K=e[10];let J;return e[11]!==H||e[12]!==K?(J=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(De,{icon:$,title:H,description:K})}),e[11]=H,e[12]=K,e[13]=J):J=e[13],J}if($s(h.error)){let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(ke,{className:"size-5"}),e[14]=$):$=e[14];let H;e[15]!==l?(H=l("mainPanelTabs.e2eTab.notConnectedTitle"),e[15]=l,e[16]=H):H=e[16];let K;e[17]!==l?(K=l("mainPanelTabs.e2eTab.notConnectedDescription"),e[17]=l,e[18]=K):K=e[18];let J;return e[19]!==H||e[20]!==K?(J=t.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:t.jsx(De,{icon:$,title:H,description:K})}),e[19]=H,e[20]=K,e[21]=J):J=e[21],J}const b=_e(h.data,"items"),N="h-full min-h-0 overflow-y-auto",j="mx-auto flex max-w-4xl flex-col gap-6 p-6";let w;e[22]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(ke,{className:"size-[18px] text-muted-foreground"}),e[22]=w):w=e[22];let S;e[23]!==l?(S=l("mainPanelTabs.e2eTab.title"),e[23]=l,e[24]=S):S=e[24];let C;e[25]!==S?(C=t.jsxs("div",{className:"flex items-center gap-2",children:[w,t.jsx("h2",{className:"text-base font-semibold text-foreground",children:S})]}),e[25]=S,e[26]=C):C=e[26];const k=l("mainPanelTabs.e2eTab.subtitle",{site:r});let D;e[27]!==k?(D=t.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[27]=k,e[28]=D):D=e[28];let _;e[29]!==D||e[30]!==C?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[C,D]}),e[29]=D,e[30]=C,e[31]=_):_=e[31];let F;e[32]!==c||e[33]!==n.slug||e[34]!==r?(F=t.jsx(zs,{base:c,orgSlug:n.slug,site:r}),e[32]=c,e[33]=n.slug,e[34]=r,e[35]=F):F=e[35];let R;e[36]!==_||e[37]!==F?(R=t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[_,F]}),e[36]=_,e[37]=F,e[38]=R):R=e[38];let L;e[39]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Rs,{}),e[39]=L):L=e[39];let E;e[40]!==c||e[41]!==o||e[42]!==n.slug||e[43]!==r?(E=t.jsx(Fs,{base:c,orgSlug:n.slug,site:r,enabled:o}),e[40]=c,e[41]=o,e[42]=n.slug,e[43]=r,e[44]=E):E=e[44];const B=St;let G;e[45]!==l?(G=l("mainPanelTabs.e2eTab.runs"),e[45]=l,e[46]=G):G=e[46];const de=h.isLoading?t.jsx(Ct,{cols:5}):h.error?t.jsx(kt,{children:l("mainPanelTabs.e2eTab.runsError")}):b.length===0?t.jsx(De,{icon:t.jsx(ke,{className:"size-5"}),title:l("mainPanelTabs.e2eTab.noRuns")}):t.jsxs(We,{children:[t.jsx(Ye,{children:t.jsxs(we,{children:[t.jsx(W,{children:l("mainPanelTabs.e2eTab.colRun")}),t.jsx(W,{children:l("mainPanelTabs.e2eTab.colStatus")}),t.jsx(W,{children:l("mainPanelTabs.e2eTab.colCommand")}),t.jsx(W,{children:l("mainPanelTabs.e2eTab.colStarted")}),t.jsx(W,{children:l("mainPanelTabs.e2eTab.colSummary")}),t.jsx(W,{className:"w-[1%]"})]})}),t.jsx(Ge,{children:b.map($=>t.jsxs(we,{className:"cursor-pointer",onClick:()=>u($),children:[t.jsx(Y,{className:"font-mono text-xs",children:$.runId}),t.jsx(Y,{children:t.jsx(te,{variant:Pt($.status),children:Cs($.status,l)})}),t.jsx(Y,{className:"font-mono text-xs text-muted-foreground",children:$.summary?.command??"—"}),t.jsx(Y,{className:"text-xs text-muted-foreground whitespace-nowrap",children:wt($.startedAt)}),t.jsx(Y,{className:"text-xs text-muted-foreground whitespace-nowrap tabular-nums",children:ks($,l)}),t.jsx(Y,{className:"text-right align-middle",children:t.jsx(ge,{size:"icon-sm",variant:"ghost","aria-label":l("mainPanelTabs.e2eTab.deleteRun"),onClick:H=>{H.stopPropagation(),p($)},disabled:g.isPending,children:t.jsx(dt,{className:"size-4"})})})]},$.runId))})]});let M;e[47]!==B||e[48]!==b||e[49]!==G||e[50]!==de?(M=t.jsx(B,{title:G,count:b.length,children:de}),e[47]=B,e[48]=b,e[49]=G,e[50]=de,e[51]=M):M=e[51];let A;e[52]!==R||e[53]!==L||e[54]!==E||e[55]!==M?(A=t.jsxs("div",{className:j,children:[R,L,E,M]}),e[52]=R,e[53]=L,e[54]=E,e[55]=M,e[56]=A):A=e[56];let I;e[57]!==u?(I=$=>{$||u(null)},e[57]=u,e[58]=I):I=e[58];let X;e[59]!==c||e[60]!==n.slug||e[61]!==d||e[62]!==r||e[63]!==I?(X=t.jsx(Ps,{base:c,orgSlug:n.slug,site:r,run:d,onOpenChange:I}),e[59]=c,e[60]=n.slug,e[61]=d,e[62]=r,e[63]=I,e[64]=X):X=e[64];const Z=T!=null;let q;e[65]!==p?(q=$=>{$||p(null)},e[65]=p,e[66]=q):q=e[66];let V;e[67]!==l?(V=l("mainPanelTabs.e2eTab.confirmDeleteRunTitle"),e[67]=l,e[68]=V):V=e[68];let O;e[69]!==V?(O=t.jsx(mt,{children:V}),e[69]=V,e[70]=O):O=e[70];const Q=T?.runId??"";let se;e[71]!==l||e[72]!==Q?(se=l("mainPanelTabs.e2eTab.confirmDeleteRun",{runId:Q}),e[71]=l,e[72]=Q,e[73]=se):se=e[73];let z;e[74]!==se?(z=t.jsx(ut,{children:se}),e[74]=se,e[75]=z):z=e[75];let ee;e[76]!==O||e[77]!==z?(ee=t.jsxs(ft,{children:[O,z]}),e[76]=O,e[77]=z,e[78]=ee):ee=e[78];const Ce=g.isPending;let le;e[79]!==l?(le=l("mainPanelTabs.e2eTab.cancel"),e[79]=l,e[80]=le):le=e[80];let ne;e[81]!==g.isPending||e[82]!==le?(ne=t.jsx(xt,{disabled:Ce,children:le}),e[81]=g.isPending,e[82]=le,e[83]=ne):ne=e[83];let ae;e[84]!==g||e[85]!==T?(ae=$=>{$.preventDefault(),T&&g.mutate(T.runId)},e[84]=g,e[85]=T,e[86]=ae):ae=e[86];const he=g.isPending;let ue;e[87]!==l?(ue=l("mainPanelTabs.e2eTab.delete"),e[87]=l,e[88]=ue):ue=e[88];let re;e[89]!==g.isPending||e[90]!==ae||e[91]!==ue?(re=t.jsx(pt,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:ae,disabled:he,children:ue}),e[89]=g.isPending,e[90]=ae,e[91]=ue,e[92]=re):re=e[92];let ie;e[93]!==ne||e[94]!==re?(ie=t.jsxs(ht,{children:[ne,re]}),e[93]=ne,e[94]=re,e[95]=ie):ie=e[95];let oe;e[96]!==ee||e[97]!==ie?(oe=t.jsxs(bt,{children:[ee,ie]}),e[96]=ee,e[97]=ie,e[98]=oe):oe=e[98];let ce;e[99]!==Z||e[100]!==q||e[101]!==oe?(ce=t.jsx(gt,{open:Z,onOpenChange:q,children:oe}),e[99]=Z,e[100]=q,e[101]=oe,e[102]=ce):ce=e[102];let fe;return e[103]!==A||e[104]!==X||e[105]!==ce?(fe=t.jsxs("div",{className:N,children:[A,X,ce]}),e[103]=A,e[104]=X,e[105]=ce,e[106]=fe):fe=e[106],fe}function qs(a){return be.error(Oe(a))}function Vs(a){const e=(a.phase??"").toLowerCase();return e===""||e==="running"||e==="pending"}export{Vn as E2eTab};
@@ -1,2 +0,0 @@
1
- import{c as se,b as Te,r as d,j as r,h as pe,B as Re,fl as en,bn as tn,bt as ge,fm as nn,fn as rn,fo as on,fp as sn,cM as an,fq as ln,fr as dt,bp as cn,fs as dn,ft as un,fu as fn,fv as pn,fw as mn,fx as xn,fy as hn,fz as gn,fA as bn,l as le,n as yn,t as te,a4 as tt,a1 as nt,a2 as rt,K as ot}from"./index-CxLq_ov_.js";import{aa as vn,bi as Cn,bj as wn}from"./agent-icon-DyMYbwSC.js";import{s as Nn}from"./XClose-N8lMtUXr.js";import{S as jn}from"./scroll-area-B3TTluOZ.js";import{a as En}from"./chat-context-D2SP0J5D.js";import{F as Sn}from"./editor-CgtWB5x3.js";import{u as Dn}from"./shell-layout-CAB27XFS.js";import{s as je,a as st,f as Mn,b as Rn}from"./index-B1coIP-x.js";import{d as Tn,h as Pn,c as Fn,e as kn,b as An,D as Ln}from"./dialog-Do-ZnJpa.js";import{I as at}from"./input-t2vq_Yhz.js";import{c as On,d as In,b as Kn,f as zn,g as $n,e as _n,a as Gn,A as Bn}from"./alert-dialog-Bb1OlmEm.js";import{t as Vn}from"./ChevronUp-CVSn4-gi.js";import{i as Un}from"./ChevronRight-BcTQG1DI.js";import{i as qn}from"./Share07-Bu5e840D.js";import{i as Hn,E as Wn,e as Oe,h as Qn,j as Xn,k as Yn,l as Jn,t as re,m as Ee,n as Ie,o as Se,g as Ke,p as ze,q as Zn,s as er,v as tr,r as $e,u as De,w as _e,x as nr,y as rr,z as or,A as sr}from"./skill-preview-D5ZuDhd0.js";import"./AlertCircle-B0exjy2G.js";import"./Tool01-DbPhfEvg.js";import"./ArrowUp-DY0nxQiU.js";import"./ArrowLeft-DDVITG8K.js";import"./Tool02-8qVRgTeE.js";import"./XCircle-BN22j-Jn.js";import"./TrendUp01-yPe3UG0T.js";import"./ZoomOut-BUSsAg6c.js";import"./Users03-CMpVHpdR.js";import"./CheckCircle-DLOuSHro.js";import"./Check-DFnPCTEg.js";import"./ChevronSelectorVertical-DMK3FCxp.js";import"./DotsVertical-CqFpz0HG.js";import"./UserSquare-HSvWRq_9.js";import"./Copy01-DXf2ReD_.js";import"./CreditCard01-Dufq2QQE.js";import"./Download01-GnhueTng.js";import"./Settings02-B2gnPQ3Q.js";import"./Eye-CHLagXa7.js";import"./GitBranch01-CQRzbSyx.js";import"./Globe01-DyhA33s1.js";import"./HardDrive-eC4I4aqw.js";import"./Image01-D6KzR28r.js";import"./Key01-CNitiCfD.js";import"./Link01-BHe0dd0_.js";import"./LinkExternal01-CvQ-ylaK.js";import"./Monitor01-SbvebE9T.js";import"./Sun-aWHPBk6T.js";import"./Package-BIDQhscg.js";import"./Palette-DgVW07vN.js";import"./Play-CR4MAXKW.js";import"./Plus-D-mogJXC.js";import"./SearchMd-BYpvO9Ao.js";import"./Shield01-BAHmK5_B.js";import"./Stars01-CCTPiWmK.js";import"./Trash01-CV8Q1VzZ.js";import"./Upload01-B1Qytz_u.js";import"./User01-DmJKrYPV.js";import"./Users01-B4HgX8Cb.js";import"./Zap-BMyl5tLM.js";import"./select-CNhOTIVN.js";import"./use-panel-navigate-DSf87ewD.js";import"./use-destination-route-BePPmQxb.js";import"./thread-route-Ckn7Kp8P.js";import"./constants-DNuUCxmW.js";import"./thread-intent-BCmi7agT.js";import"./slugify-CEUa2lfQ.js";import"./hooks-D1D8x6_l.js";import"./use-mcp-client-Bzii9bW9.js";import"./auth-Dy3Ai_hi.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-xVL-mPxb.js";import"./task-board-CcPPQONZ.js";import"./schema-ChmhgfCW.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Drh4_cTK.js";import"./use-ai-providers-DRa-WP8c.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CkAI1xCS.js";import"./use-organization-settings-DRchtNm3.js";import"./avatar-B8b2hWV1.js";import"./project-icon-BY6MP5uE.js";import"./github-repo-COLY3wWI.js";import"./command-CeyGqPmM.js";import"./index-DkQlXscT.js";import"./required-auth-layout-LhCq4pE1.js";import"./use-org-sso-DTBnbTx7.js";import"./automation-runs-CHfOqm8r.js";import"./useInfiniteQuery-Cy80sU-k.js";import"./use-infinite-scroll-D8hgBz9p.js";import"./use-connection-B3hf1saX.js";import"./table-Bi-psIbe.js";import"./empty-state-BPIeTQLP.js";import"./use-members-CEM7zlP_.js";import"./use-org-auth-client-Crsb07JJ.js";import"./use-automations-Cppk9Xar.js";import"./useSuspenseInfiniteQuery-DKd6bR20.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DvOjkuTL.js";import"./markdown-DFiEgKZj.js";import"./monaco-editor-BFa0VsLo.js";import"./types-hwFA5Ktg.js";import"./integration-icon-Cr-roc4W.js";import"./use-navigate-to-agent-CUFdthzD.js";import"./use-mcp-prompts-BTyLUk2o.js";import"./form-j23QTiVs.js";import"./label-HkRxmwei.js";import"./file-type-icon-BoulZj-0.js";import"./drawer-D4J_5BCc.js";import"./collection-search-gbLnoGWa.js";import"./use-mcp-tools-3xoGjo6f.js";import"./tabs-DZInEuUb.js";import"./toggle-group-HQ3bB1sR.js";import"./task-route-GdQl-L3H.js";import"./toolbar-icon-button-DEqW4Jpo.js";import"./popover-CpTW2alp.js";import"./github-repo-picker-CuXoDtLm.js";import"./use-debounced-value-BLtVz2Ja.js";import"./authenticate-and-persist-oauth-DBIvzM9b.js";import"./mcp-oauth-BHYwKN2k.js";import"./extract-connection-data-Cq3FrLyn.js";import"./metadata-dUsYcpuu.js";import"./connection-pv2H4wMd.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./connection-card-D-rWqndL.js";import"./use-registry-connections-DndEI7JT.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DFMKKUyA.js";import"./connection-form-helpers-nmBh-twk.js";import"./collection-tabs-BGNThV3i.js";import"./badge-DiXK5Efu.js";import"./use-file-configs-BEZ_kwp8.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-C9hHhEdP.js";import"./get-initials-D-f_fDFw.js";import"./select-model-BHenBcjH.js";import"./checkbox-CusZZICa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-P0KHTdfp.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D9cQQiox.js";import"./toolbar-CSNy9NkF.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-DQmx8pBf.js";import"./search-input-D0Aw5sb3.js";import"./use-mcp-auth-status-CC8-P5tO.js";import"./switch--G1maXos.js";import"./use-secrets-DmVRsGO4.js";import"./client-icons-CIbINaqs.js";import"./connect-layout-fngCpQZ1.js";import"./self-tool-result-gsJsfaVf.js";import"./track-C5SbOoh_.js";import"./use-tags-C4M9TEep.js";import"./breadcrumb-C5kFXgQY.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-Cm527FOk.js";import"./site-error--i37Vnuw.js";import"./cards-BdTZBvrL.js";const ar={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function ir(a){const e=se.c(71),{open:s,mode:i,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=a,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ar[i];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let z;e[3]!==h||e[4]!==f||e[5]!==u?(z=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=z):z=e[6];const L=z;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Tn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Pn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(Fn,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(at,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let k;e[25]!==j?(k=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=k):k=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let $;e[28]!==C.placeholderKey||e[29]!==x?($=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=$):$=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==$?(Y=r.jsx(at,{id:"file-explorer-name",value:f,onChange:q,placeholder:$,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=$,e[34]=Y):Y=e[34];let J;e[35]!==k||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[k,Y]}),e[35]=k,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{className:"size-3.5"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let F;e[59]!==H||e[60]!==G?(F=r.jsxs(kn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=F):F=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==F||e[65]!==N?(B=r.jsx(An,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,F]})}),e[62]=L,e[63]=ee,e[64]=F,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Ln,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(a){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:i,fsActionPending:l,onOpenChange:m,onConfirm:y}=a,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(On,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==i.length||e[13]!==u?(g=i.length>0&&r.jsxs(r.Fragment,{children:[" ",i.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:i.length})]}),e[12]=i.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(In,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let z;e[20]!==R||e[21]!==f?(z=r.jsxs(Kn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=z):z=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(zn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx($n,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(_n,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==z||e[41]!==M?(j=r.jsxs(Gn,{children:[z,M]}),e[40]=z,e[41]=M,e[42]=j):j=e[42];let k;return e[43]!==m||e[44]!==E||e[45]!==j?(k=r.jsx(Bn,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=k):k=e[46],k}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=a=>{const{__scopeContextMenu:e,children:s,onOpenChange:i,dir:l,modal:m=!0}=a,[y,u]=d.useState(!1),b=Z(e),E=an(i),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,disabled:i=!1,...l}=a,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{i&&h()},[i,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":i?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:i?a.onContextMenu:ge(a.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:i?a.onPointerDown:ge(a.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:i?a.onPointerMove:ge(a.onPointerMove,Me(h)),onPointerCancel:i?a.onPointerCancel:ge(a.onPointerCancel,Me(h)),onPointerUp:i?a.onPointerUp:ge(a.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=a=>{const{__scopeContextMenu:e,...s}=a,i=Z(e);return r.jsx(on,{...i,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...i,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{a.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{a.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(dn,{...l,...i,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(un,{...l,...i,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(nn,{...l,...i,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(fn,{...l,...i,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(pn,{...l,...i,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(mn,{...l,...i,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(xn,{...l,...i,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(rn,{...l,...i,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(hn,{...l,...i,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(gn,{...l,...i,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(bn,{...l,...i,ref:e,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pr.displayName=Tr;function Me(a){return e=>e.pointerType!=="mouse"?a(e):void 0}var Fr=ft,kr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(Fr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=i):i=e[3],i}function zr(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(kr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=i):i=e[3],i}function $r(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...i})}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}function fe(a){const e=se.c(12);let s,i,l,m;e[0]!==a?({className:s,inset:i,variant:m,...l}=a,e[0]=a,e[1]=s,e[2]=i,e[3]=l,e[4]=m):(s=e[1],i=e[2],l=e[3],m=e[4]);const y=m===void 0?"default":m;let u;e[5]!==s?(u=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=u):u=e[6];let b;return e[7]!==i||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":i,"data-variant":y,className:u,...l}),e[7]=i,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function it(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Ir,{"data-slot":"context-menu-separator",className:l,...i}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(a){const e=se.c(63),{node:s,depth:i,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=a,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:z,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${i*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==z||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{className:"size-3.5 shrink-0 text-muted-foreground"}):l?r.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(qn,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(z,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=z,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let k;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(k=r.jsx(zr,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=k):k=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let $;e[23]!==h||e[24]!==q?($=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=$):$=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(it,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(it,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let F;e[45]!==X||e[46]!==G?(F=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=F):F=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==$||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==F||e[58]!==V?(Q=r.jsxs($r,{className:"w-52",children:[$,J,ee,A,K,W,F,V]}),e[53]=$,e[54]=J,e[55]=A,e[56]=K,e[57]=F,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==k?(ne=r.jsxs(Kr,{children:[k,Q]}),e[60]=Q,e[61]=k,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(a,e){return Rn(a,e)}function qr(a){const e=se.c(9),{text:s,query:i}=a;let l,m,y;if(e[0]!==i||e[1]!==s){const{leadingEllipsis:b,segments:E}=Zn(s,i);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=i,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(a,e){return a.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:a.text},e):r.jsx("span",{children:a.text},e)}function Ba({orgSlug:a,virtualMcpId:e,branch:s,threadId:i,openPath:l}){const m={orgSlug:a,virtualMcpId:e,branch:s,threadId:i},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,z]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[k,q]=d.useState(!1),[$,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),F=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ae,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[Fe,ke]=d.useState(null),[ve,Ce]=d.useState(!1);async function ie(t,n){const o=await fetch(Ur(m,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=or(t);if(!n)return;const o=`${a}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(a,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>Ee(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=Ee(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Et(t){const n=Ee(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of ze(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Se(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),ke(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=tr(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,Ft]=d.useState(null),w=Te();if(l&&l!==Pt){Ft(l);const t=l;queueMicrotask(()=>{Hn(t)&&he(t)})}async function Ae(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?sr(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function kt(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!$e(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await kt(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of ze(n)){if(!$e(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Wn});qe(n,!1,t),Y(!0)}catch{$&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=er(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){F.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==F.current)return;T(nr(o,t,ct))}catch{if(n!==F.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==F.current)return;D(rr(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==F.current)return;D([]),j(!1)}finally{n===F.current&&N(!1)}}function zt(t){const n=t.trim(),o=++F.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function $t(t){if(z(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{zt(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ie("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await Mn(m);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if($e(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=ze(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Se(X.path):f?Se(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Qn(b,E),Je=Xn(Qt,h),Le=L?.length??0,Ze=Yn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=Fe?jt(Fe.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Ke(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),Ct(),vt({parts:[{type:"text",text:n.join(`
2
- `)}]}),be(null)}return k&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:R,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),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"})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Ye("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Ye("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!R&&Je.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=h.has(n.path),v=X?.path===n.path,ce=Jn(n.path,n.kind),Ne=c&&ee.has(n.path);return r.jsx(Gr,{node:n,depth:o,isExpanded:p,isSelected:v,isLoading:Ne,fileVisual:Ie(n.name),onSelect:()=>I(n),onOpen:()=>{c?qt(n.path,p):he(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>Be(w,"Path",Ee(n.path)),onCopyRelativePath:()=>Be(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>ke(n)},n.path)}),!R&&$&&Je.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),R&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Le>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Le,Le>=ct?"+":""]})]}),L!==null&&L.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),L?.map(t=>{const n=t.split("/").pop()??t,o=Se(t),{Icon:c,color:p}=Ie(n),v=f===t;return r.jsxs("button",{type:"button",onClick:()=>he(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",v&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),R&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),et>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[et,M?"+":""]}),S&&r.jsx(pe,{className:"size-[10px]"})]}),!S&&P!==null&&Ze.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ze.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Ie(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>_t(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(qr,{text:p.text,query:R})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[C.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:C.map(t=>{const n=me.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=f===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{O(t),We(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),Vt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.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 o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Zt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&be(null)}}),r.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:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:f&&ue?.loaded?r.jsx(Sn,{language:Ke(f),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ue.editorValue,path:f,onChange:t=>{const n=f;n&&de(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Jt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 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}}},f):f&&!ue?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),f&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:f}),r.jsxs("span",{children:[w(Xt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Ke(f)]})]})]}),r.jsx(ir,{open:U!==null,mode:U?.mode??"new-file",initialName:U?.mode==="rename"?U.node.name:"",parentLabel:U&&U.mode!=="rename"?U.parentDir==="/"?"/":re(U.parentDir):void 0,isPending:ve,onSubmit:t=>Tt(w,t),onOpenChange:t=>{!t&&!ve&&oe(null)}}),r.jsx(lr,{deleteTarget:Fe,deleteDirtyPaths:Yt,fsActionPending:ve,onOpenChange:t=>{!t&&!ve&&ke(null)},onConfirm:t=>{Rt(w,t)}})]})}export{Ba as FileExplorer};