decocms 4.50.0 → 4.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/client/assets/{AlertCircle-LLoHSm66.js → AlertCircle-Ct7weZuE.js} +1 -1
  2. package/dist/client/assets/ArrowUp-CLqVzt5Z.js +1 -0
  3. package/dist/client/assets/{ArrowUpRight-BjGLdnBk.js → ArrowUpRight-gaoM5S0k.js} +1 -1
  4. package/dist/client/assets/{Check-CyDp0HHq.js → Check-C6rOtSdY.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BsNta-Ep.js → CheckCircle-CREoH7p2.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-XDfXJ8c0.js → ChevronDown-BfrTp1Ch.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-B94RwHdB.js → ChevronRight-CvPpz1Nq.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-C4k7gPJV.js → ChevronUp-MSW-WrWs.js} +1 -1
  9. package/dist/client/assets/{Circle-lBEUhCw0.js → Circle-ow_NDQHR.js} +1 -1
  10. package/dist/client/assets/{Copy01-DYqwaYOh.js → Copy01-DDhuzJaA.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-cUEvC4nC.js → DotsVertical-CB7QN8Ws.js} +1 -1
  12. package/dist/client/assets/{Eye-D2mf0D8Z.js → Eye-C1XDNiGB.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BUh4z1rJ.js → FilterLines-eP80xxCy.js} +1 -1
  14. package/dist/client/assets/{Globe01-DQWcSqrm.js → Globe01-3_GHOe2E.js} +1 -1
  15. package/dist/client/assets/{Globe04-C3OwaDqP.js → Globe04-BAF3P1k9.js} +1 -1
  16. package/dist/client/assets/{HardDrive-mwKZuWq1.js → HardDrive-DW6eIDxP.js} +1 -1
  17. package/dist/client/assets/{Key01-nwRWTzli.js → Key01-BVXgUn29.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-3gTwXMjX.js → LayoutLeft-DKGWBMNA.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-DGD0-cUX.js → LinkExternal01-BM0S_VFU.js} +1 -1
  20. package/dist/client/assets/{List-DvLwT2sF.js → List-vHTogdj7.js} +1 -1
  21. package/dist/client/assets/Loading02-Bt_dLUWn.js +1 -0
  22. package/dist/client/assets/{Monitor01-Dcv5mQJu.js → Monitor01-2j67L_aU.js} +1 -1
  23. package/dist/client/assets/{Palette-_1E1A8wi.js → Palette-D5rmfc3a.js} +1 -1
  24. package/dist/client/assets/{Play-CSN3IBqZ.js → Play-Bv09TV2w.js} +1 -1
  25. package/dist/client/assets/{Plus-Bya9qA7w.js → Plus-D9m58hN2.js} +1 -1
  26. package/dist/client/assets/{SearchLg-DG8S0kSO.js → SearchLg-6CR82X0W.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BvfQkVfc.js → SearchMd-BfevlctH.js} +1 -1
  28. package/dist/client/assets/{Settings02-D43Hv2qD.js → Settings02-f8loRSef.js} +1 -1
  29. package/dist/client/assets/{Shield01-FpkCBVew.js → Shield01-DPzSiB-T.js} +1 -1
  30. package/dist/client/assets/{Star01-B50-Zz32.js → Star01-DoabU7Hn.js} +1 -1
  31. package/dist/client/assets/{Stars01-DDFSzCqN.js → Stars01-Q9LxQc27.js} +1 -1
  32. package/dist/client/assets/{Stars02-EYiMdQNh.js → Stars02-DaEgHmQI.js} +1 -1
  33. package/dist/client/assets/{Sun-B6_FjvE1.js → Sun-CclxevtX.js} +1 -1
  34. package/dist/client/assets/SwitchHorizontal01-sGYV2dsM.js +1 -0
  35. package/dist/client/assets/{Tool01-BXbLpzEO.js → Tool01-Bfw6sadd.js} +1 -1
  36. package/dist/client/assets/{Trash01-GK3td3R2.js → Trash01-TYv08n93.js} +1 -1
  37. package/dist/client/assets/{Upload01-C2z_o2K2.js → Upload01-bdtJr5BI.js} +1 -1
  38. package/dist/client/assets/{User01-C8wnkoj-.js → User01-BZEdjS8N.js} +1 -1
  39. package/dist/client/assets/{Users01-KFvngVMF.js → Users01-D0TsDHjS.js} +1 -1
  40. package/dist/client/assets/{Users03-CUk17u5x.js → Users03-B4feTEaY.js} +1 -1
  41. package/dist/client/assets/{X-BQ5WLsJO.js → X-CJDTMZdu.js} +1 -1
  42. package/dist/client/assets/{XCircle-DT7o53Jo.js → XCircle-F9-2oAiq.js} +1 -1
  43. package/dist/client/assets/{XClose-NAXlP6pU.js → XClose-BKoSgWfP.js} +1 -1
  44. package/dist/client/assets/{Zap-DnLTz7zL.js → Zap-GCvYK6cT.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-BIlVCAPP.js → ZapSquare-BBu4b6r_.js} +1 -1
  46. package/dist/client/assets/{ZoomOut-DV7icxu5.js → ZoomOut-ox9YzR1a.js} +1 -1
  47. package/dist/client/assets/access-gate-Yfi4ekhF.js +1 -0
  48. package/dist/client/assets/{add-section-modal-Dcy-j_ej.js → add-section-modal-d8gKomF9.js} +1 -1
  49. package/dist/client/assets/admin-fetch-CCSvjTk1.js +1 -0
  50. package/dist/client/assets/agent-capabilities-BrHWT2H6.js +1 -0
  51. package/dist/client/assets/agent-icon-C2ANw4X5.js +1 -0
  52. package/dist/client/assets/agents-list-DcAZyk1U.js +1 -0
  53. package/dist/client/assets/ai-providers-CLLgcR35.js +1 -0
  54. package/dist/client/assets/{alert-NMrYI6J1.js → alert-BLw4eidn.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-zzII-GLz.js → alert-dialog-BglRhrg0.js} +3 -3
  56. package/dist/client/assets/app-editor-Be9j6Psz.js +1 -0
  57. package/dist/client/assets/{auth-GNn2tq-H.js → auth-DKsARQye.js} +1 -1
  58. package/dist/client/assets/{auth-catchall-CGcrsXBA.js → auth-catchall-DwgEjeTg.js} +1 -1
  59. package/dist/client/assets/{auth-entry-Dqw51exT.js → auth-entry-CQlhwp6I.js} +1 -1
  60. package/dist/client/assets/{auth-split-layout-C1eMIc9O.js → auth-split-layout-CZ_OCZxj.js} +1 -1
  61. package/dist/client/assets/{authenticate-and-persist-oauth-L6dbdQ7o.js → authenticate-and-persist-oauth-DWDcBYz0.js} +1 -1
  62. package/dist/client/assets/{automation-list-row-fCAMQYn8.js → automation-list-row-Bq-loDW7.js} +1 -1
  63. package/dist/client/assets/{automation-runs-Dn4JyN79.js → automation-runs-DoqJWooa.js} +1 -1
  64. package/dist/client/assets/automations-C-RHUi9C.js +1 -0
  65. package/dist/client/assets/{autosend-Ct6Ky0VH.js → autosend-CYyCczkd.js} +1 -1
  66. package/dist/client/assets/{avatar-kqh_R_sO.js → avatar-BvMZq_TI.js} +1 -1
  67. package/dist/client/assets/{badge-BIeSlTFN.js → badge-7J4kgEzC.js} +1 -1
  68. package/dist/client/assets/{block-document-DtK0em8F.js → block-document-CEQDI6GW.js} +1 -1
  69. package/dist/client/assets/brand-context-B-G2N5Cc.js +1 -0
  70. package/dist/client/assets/{breadcrumb-CC1t3dB8.js → breadcrumb-DX6VmR2b.js} +1 -1
  71. package/dist/client/assets/{buckets-Kas60ugl.js → buckets-BnVc6A5T.js} +1 -1
  72. package/dist/client/assets/bulk-category-panel-dwWBDZdx.js +1 -0
  73. package/dist/client/assets/{calendar-CmKLRVVf.js → calendar-DlspiiCF.js} +1 -1
  74. package/dist/client/assets/capability-load-error-BM3-quVD.js +1 -0
  75. package/dist/client/assets/{card-BDVrEmLp.js → card-DJEMjLyN.js} +1 -1
  76. package/dist/client/assets/category-editor-D49qQ_5A.js +1 -0
  77. package/dist/client/assets/{chat-context-BRtcUB0n.js → chat-context-DWWQ8fi_.js} +1 -1
  78. package/dist/client/assets/{checkbox-VOodo84Q.js → checkbox-BW3fb6zN.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-Bz0CFpow.js → cli-auth-success-CYZtnqJM.js} +1 -1
  80. package/dist/client/assets/collection-detail-CuUENpdt.js +1 -0
  81. package/dist/client/assets/collection-display-button-CwpKpIcC.js +1 -0
  82. package/dist/client/assets/{collection-search-DYDYxnUQ.js → collection-search-C_SgZaX4.js} +1 -1
  83. package/dist/client/assets/collection-table-wrapper-CtK9vkZI.js +1 -0
  84. package/dist/client/assets/{collection-tabs-AuL-kePL.js → collection-tabs-DcJTaWg5.js} +1 -1
  85. package/dist/client/assets/{command-Cixc9wEL.js → command-BK76iADW.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-CacbF47W.js +1 -0
  87. package/dist/client/assets/connect-desktop-dialog-BVhGL3hA.js +1 -0
  88. package/dist/client/assets/connection-card-BZCmFzT0.js +1 -0
  89. package/dist/client/assets/connection-detail-B8lH7kfR.js +1 -0
  90. package/dist/client/assets/{connection-form-helpers-RrOycYCJ.js → connection-form-helpers-DsmizTyk.js} +1 -1
  91. package/dist/client/assets/connections-DaqgHt93.js +1 -0
  92. package/dist/client/assets/{decopilot-sse-pool-BRzo80Bm.js → decopilot-sse-pool-CQt0Qt9t.js} +1 -1
  93. package/dist/client/assets/{dialog-Cm_JTJHQ.js → dialog-VQoq6ED0.js} +1 -1
  94. package/dist/client/assets/domain-settings-DQrCzdxW.js +1 -0
  95. package/dist/client/assets/{drawer-DXXRpEpp.js → drawer-BiUeA1xK.js} +1 -1
  96. package/dist/client/assets/{dropdown-menu-B9mY8yAx.js → dropdown-menu-Q9JsQJsN.js} +1 -1
  97. package/dist/client/assets/{empty-state-Byg9A0S5.js → empty-state-Bx2oDYyE.js} +1 -1
  98. package/dist/client/assets/{extract-connection-data-CPpWEnHj.js → extract-connection-data-CBaWfjW4.js} +1 -1
  99. package/dist/client/assets/file-explorer-NjBXraWZ.js +2 -0
  100. package/dist/client/assets/{file-type-icon-D-OAQV03.js → file-type-icon-Byym_Yq8.js} +1 -1
  101. package/dist/client/assets/{files-B4ht4ofh.js → files-Bzx4vIyM.js} +1 -1
  102. package/dist/client/assets/{form-zzanm0Lq.js → form-Ck57FY_v.js} +1 -1
  103. package/dist/client/assets/format-time-BnbuEtat.js +1 -0
  104. package/dist/client/assets/general-DTNBl6eM.js +1 -0
  105. package/dist/client/assets/github-repo-picker-Cv4fHpMw.js +1 -0
  106. package/dist/client/assets/{hooks-_AjVT69_.js → hooks-BCy5e9GO.js} +5 -5
  107. package/dist/client/assets/{index-CTF3Zt5P.js → index-2V8OIw2c.js} +1 -1
  108. package/dist/client/assets/{index-CAREMFyV.js → index-BNkKptlK.js} +1 -1
  109. package/dist/client/assets/{index-CcwE9LIu.js → index-BkSsc9os.js} +1 -1
  110. package/dist/client/assets/index-BxDQDgZD.js +1 -0
  111. package/dist/client/assets/{index-CRyiDc_E.js → index-CA5Ck5O8.js} +3 -3
  112. package/dist/client/assets/{index-Df52FR_E.js → index-CP0NJqZH.js} +6 -6
  113. package/dist/client/assets/{index-BF0lZnTX.js → index-ChTrjmId.js} +4 -4
  114. package/dist/client/assets/index-Cz1AR3Zz.js +1 -0
  115. package/dist/client/assets/{index-Dzsixt0K.js → index-D-yF_uFs.js} +1 -1
  116. package/dist/client/assets/index-D1Oy1H9B.js +1 -0
  117. package/dist/client/assets/{index-Ds4Whp7g.js → index-D544QCka.js} +1 -1
  118. package/dist/client/assets/{index-BQha_puu.js → index-DAFO_OTU.js} +14 -14
  119. package/dist/client/assets/{index-BEXxcuG9.js → index-RzCbz7G4.js} +28 -28
  120. package/dist/client/assets/index-ZbSNKPKh.css +1 -0
  121. package/dist/client/assets/{index-BzAV5OLi.js → index-iSSICeOA.js} +1 -1
  122. package/dist/client/assets/{index-redirect-DxwkWHHM.js → index-redirect-BTf9IrPi.js} +1 -1
  123. package/dist/client/assets/{input-DOlqYG5a.js → input-CmS4IhfL.js} +1 -1
  124. package/dist/client/assets/{integration-icon-CpH20lR5.js → integration-icon-B64oCP0F.js} +1 -1
  125. package/dist/client/assets/invite-member-dialog-BoCPYFUb.js +3 -0
  126. package/dist/client/assets/{label-T5OklXhW.js → label-BRuRKPr0.js} +1 -1
  127. package/dist/client/assets/layout-CT250kMb.js +1 -0
  128. package/dist/client/assets/{login-BjUYS2gE.js → login-CldG7DZa.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-2FfcUYbt.js → mcp-oauth-C23-dwpq.js} +1 -1
  130. package/dist/client/assets/members-CNrOGJa0.js +1 -0
  131. package/dist/client/assets/{monaco-editor-B0B3S1UH.js → monaco-editor-DR7220lx.js} +2 -2
  132. package/dist/client/assets/{monitoring-stats-row-D4UqaZfc.js → monitoring-stats-row-BZL3Rvz8.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-DaHU35EG.js → oauth-callback-DcfZfqGm.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-ai-provider-BgNzGCxS.js → oauth-callback-ai-provider-Ce9G5qtJ.js} +1 -1
  135. package/dist/client/assets/{onboarding-BO0FAzn-.js → onboarding-B25kyk06.js} +1 -1
  136. package/dist/client/assets/org-install-Bji_kE_8.js +1 -0
  137. package/dist/client/assets/{org-layout-DE1jB_dg.js → org-layout-CKR3WJzm.js} +1 -1
  138. package/dist/client/assets/{organization-choice-C4tHSipw.js → organization-choice-DTClrrnJ.js} +1 -1
  139. package/dist/client/assets/orgs-BwjlPx55.js +1 -0
  140. package/dist/client/assets/page-seo-sheet-BgXbK0SD.js +1 -0
  141. package/dist/client/assets/{popover-gaw1l3iF.js → popover-DOYlXTug.js} +1 -1
  142. package/dist/client/assets/post-editor-C_RBUxWZ.js +1 -0
  143. package/dist/client/assets/{primitives-CeZhQIsS.js → primitives-h6UMy2ac.js} +1 -1
  144. package/dist/client/assets/{profile-B0IQdA0A.js → profile-BeG5MWeA.js} +1 -1
  145. package/dist/client/assets/project-app-view-CJsN01Kq.js +1 -0
  146. package/dist/client/assets/record-editor-Cxnw_s7-.js +1 -0
  147. package/dist/client/assets/registry-CO3wS9en.js +2 -0
  148. package/dist/client/assets/{registry-layout-BMfOeqCW.js → registry-layout-B3NcP7G9.js} +1 -1
  149. package/dist/client/assets/{require-capability-BFcZEdaS.js → require-capability-BwJAyhw_.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-U3sz_fBb.js → required-auth-layout-BnUL76ZK.js} +1 -1
  151. package/dist/client/assets/{reset-password-BakBFzDW.js → reset-password-DXMG8bNT.js} +1 -1
  152. package/dist/client/assets/roles-Cr24Ru3H.js +1 -0
  153. package/dist/client/assets/{search-input-BnVx2RlI.js → search-input-Cvhmar4S.js} +1 -1
  154. package/dist/client/assets/{secrets-DJfg04nj.js → secrets-C_rz33jP.js} +1 -1
  155. package/dist/client/assets/{sections-editor-QRCx35k3.js → sections-editor-DB_WyCzE.js} +2 -2
  156. package/dist/client/assets/{select-DKTr-Z9b.js → select-cLkB0xx3.js} +1 -1
  157. package/dist/client/assets/{select-model-BgppBnWo.js → select-model-C6Zl96g0.js} +2 -2
  158. package/dist/client/assets/seo-editor-CKENU8Ce.js +1 -0
  159. package/dist/client/assets/{seo-save-Cu7NCoMs.js → seo-save-CcM551vP.js} +1 -1
  160. package/dist/client/assets/settings-layout-PBMPJvHi.js +1 -0
  161. package/dist/client/assets/{settings-section-DWX2rUfA.js → settings-section-B5s6i1AE.js} +1 -1
  162. package/dist/client/assets/{shell-controls-L-vKBQgs.js → shell-controls-DFx9R0D_.js} +1 -1
  163. package/dist/client/assets/shell-layout-P9zH_bFZ.js +1 -0
  164. package/dist/client/assets/{sidebar-DSvrZgJz.js → sidebar-Dg_hr7dR.js} +1 -1
  165. package/dist/client/assets/{skeleton-ucOVZIBH.js → skeleton-CZJQcXjJ.js} +1 -1
  166. package/dist/client/assets/sso-Bn2_Oeeg.js +1 -0
  167. package/dist/client/assets/store-Cy3LEKoA.js +1 -0
  168. package/dist/client/assets/store-registry-CNggLKId.js +2 -0
  169. package/dist/client/assets/studio-tools-D1WvthcJ.js +1 -0
  170. package/dist/client/assets/{switch-D0e_Fa-2.js → switch-DvI4Ivs6.js} +1 -1
  171. package/dist/client/assets/{table-CtNmLy1D.js → table-Rcs576gh.js} +1 -1
  172. package/dist/client/assets/{tabs-6x1enb8Y.js → tabs-BYqpHacd.js} +1 -1
  173. package/dist/client/assets/{textarea-CmkZCAoI.js → textarea-DfbK_YWl.js} +1 -1
  174. package/dist/client/assets/{toggle-group-CgJXfKwl.js → toggle-group-DPk7hBEB.js} +1 -1
  175. package/dist/client/assets/{toolbar-icon-button-DdeBzFPT.js → toolbar-icon-button-BfscRxQb.js} +1 -1
  176. package/dist/client/assets/{toolbar-CMOzw9Ju.js → toolbar-spKhA4Pi.js} +1 -1
  177. package/dist/client/assets/tools-list-GD_nS-CN.js +1 -0
  178. package/dist/client/assets/{tooltip-BH7LSMRB.js → tooltip-D9y133qH.js} +1 -1
  179. package/dist/client/assets/{types-CNnnCskz.js → types-u5_F63vr.js} +3 -3
  180. package/dist/client/assets/use-ai-providers-Be4jiLlp.js +1 -0
  181. package/dist/client/assets/use-automations-Bj7ea45i.js +1 -0
  182. package/dist/client/assets/use-capability-BAJSmOR6.js +1 -0
  183. package/dist/client/assets/{use-clock-tick-B9a2jRAC.js → use-clock-tick-DiAMyzbm.js} +1 -1
  184. package/dist/client/assets/{use-collections-C-b-oWAo.js → use-collections-B0fmzWMT.js} +1 -1
  185. package/dist/client/assets/use-connection-CoNk61jl.js +1 -0
  186. package/dist/client/assets/{use-copy-kgTvYpOm.js → use-copy-CC8l0MM4.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-g9-_Rcyf.js → use-create-virtual-mcp-DHvF-qx5.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave--JR4uBNu.js → use-debounced-autosave-DVAOELdx.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-BvgnfNxM.js → use-debounced-value-BUPZwZxl.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-BDKklrBp.js → use-decopilot-events-CwboOo9R.js} +1 -1
  191. package/dist/client/assets/use-delete-connection-BRROztaa.js +1 -0
  192. package/dist/client/assets/use-deployment-admin-DjDR8kPw.js +1 -0
  193. package/dist/client/assets/use-file-configs-CiH7freP.js +1 -0
  194. package/dist/client/assets/{use-infinite-scroll-BGkzzb-h.js → use-infinite-scroll-CLzTjnPW.js} +1 -1
  195. package/dist/client/assets/use-join-requests-wFFDbE5s.js +1 -0
  196. package/dist/client/assets/{use-mcp-client-CI2G-Ic_.js → use-mcp-client-D3e9ceNa.js} +4 -4
  197. package/dist/client/assets/{use-mcp-prompts-fw4k6acS.js → use-mcp-prompts-D_i1iWd2.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-DolAuxKF.js → use-mcp-tools-eYiXWlAi.js} +1 -1
  199. package/dist/client/assets/use-members-oJt5povW.js +1 -0
  200. package/dist/client/assets/{use-mobile-pdwi54ih.js → use-mobile-BD37jY8Y.js} +1 -1
  201. package/dist/client/assets/use-navigate-to-agent-C_szOIys.js +1 -0
  202. package/dist/client/assets/use-org-auth-client-BbOBgx1F.js +1 -0
  203. package/dist/client/assets/{use-org-sso-D6HxuEGW.js → use-org-sso-C5MQ0Bj7.js} +1 -1
  204. package/dist/client/assets/use-organization-roles-PP5Ze7E4.js +1 -0
  205. package/dist/client/assets/use-organization-settings-BPsQDYqA.js +1 -0
  206. package/dist/client/assets/use-registry-connections-sVBXNIyN.js +1 -0
  207. package/dist/client/assets/use-secrets-C4J7nZmF.js +1 -0
  208. package/dist/client/assets/{use-status-sounds-pUvF1ErZ.js → use-status-sounds-BEcDaP-9.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-6xlaoXZV.js → use-view-mode-B8ZvyTJu.js} +1 -1
  210. package/dist/client/assets/use-virtual-mcp-D1vadQaQ.js +1 -0
  211. package/dist/client/assets/useInfiniteQuery-FvBo89pe.js +1 -0
  212. package/dist/client/assets/useRouterState-CKoYWt4i.js +1 -0
  213. package/dist/client/assets/useSuspenseInfiniteQuery-CmezFxqW.js +1 -0
  214. package/dist/client/assets/users-C0Qc7Jal.js +1 -0
  215. package/dist/client/assets/variant-calendar-BTZUazZ2.js +1 -0
  216. package/dist/client/assets/{view-mode-toggle-BcbRpEXT.js → view-mode-toggle-CcfquXZC.js} +1 -1
  217. package/dist/client/index.html +2 -2
  218. package/dist/server/cli.js +481 -481
  219. package/dist/server/migrate.js +1 -1
  220. package/dist/server/server.js +314 -314
  221. package/package.json +1 -1
  222. package/dist/client/assets/Loading02-DmLZ2g2B.js +0 -1
  223. package/dist/client/assets/SwitchHorizontal01-D67LazcU.js +0 -1
  224. package/dist/client/assets/access-gate-BQbMpKdU.js +0 -1
  225. package/dist/client/assets/agent-capabilities-HhrysT_w.js +0 -1
  226. package/dist/client/assets/agent-icon-UjMOBthG.js +0 -1
  227. package/dist/client/assets/agents-list-SCoLgLsg.js +0 -1
  228. package/dist/client/assets/ai-providers-DYC1C3Be.js +0 -1
  229. package/dist/client/assets/app-editor-ByLKe9nE.js +0 -1
  230. package/dist/client/assets/automations-C0LDrJY8.js +0 -1
  231. package/dist/client/assets/brand-context-CiWrh9Tp.js +0 -1
  232. package/dist/client/assets/bulk-category-panel-BdfGBo1k.js +0 -1
  233. package/dist/client/assets/capability-load-error-DvRPl7Zx.js +0 -1
  234. package/dist/client/assets/category-editor-DAkUx56U.js +0 -1
  235. package/dist/client/assets/collection-detail-Ca6rG8pS.js +0 -1
  236. package/dist/client/assets/collection-display-button-BooDHrmY.js +0 -1
  237. package/dist/client/assets/collection-table-wrapper-DTPpaVou.js +0 -1
  238. package/dist/client/assets/commerce-onboarding-BAWnNz1n.js +0 -1
  239. package/dist/client/assets/connect-desktop-dialog-Bcv-omrf.js +0 -1
  240. package/dist/client/assets/connection-card-BzhsE4VC.js +0 -1
  241. package/dist/client/assets/connection-detail-D4uMQyqJ.js +0 -1
  242. package/dist/client/assets/connections-C-UWMZNt.js +0 -1
  243. package/dist/client/assets/domain-settings-D9W8BqCW.js +0 -1
  244. package/dist/client/assets/file-explorer-B5MVdbD4.js +0 -2
  245. package/dist/client/assets/format-time-Cy7tTmZp.js +0 -1
  246. package/dist/client/assets/general-CeL0XYkm.js +0 -1
  247. package/dist/client/assets/github-repo-picker-DUIwdWjX.js +0 -1
  248. package/dist/client/assets/index--sjDJiSu.js +0 -1
  249. package/dist/client/assets/index-BGfwJ8lg.js +0 -1
  250. package/dist/client/assets/index-DghDaK_7.js +0 -1
  251. package/dist/client/assets/index-b3V1CkLW.css +0 -1
  252. package/dist/client/assets/invite-member-dialog-BgegP8b6.js +0 -3
  253. package/dist/client/assets/members-Bb5Y2TPs.js +0 -1
  254. package/dist/client/assets/org-install-BU09O3MM.js +0 -1
  255. package/dist/client/assets/page-seo-sheet-DgAThAJq.js +0 -1
  256. package/dist/client/assets/post-editor-CVNK7-4T.js +0 -1
  257. package/dist/client/assets/project-app-view-DgcudGM1.js +0 -1
  258. package/dist/client/assets/record-editor-BHjkzJTf.js +0 -1
  259. package/dist/client/assets/registry-EKAQ-5zM.js +0 -2
  260. package/dist/client/assets/roles-Bg0Z3HSx.js +0 -1
  261. package/dist/client/assets/seo-editor-DMr350Rq.js +0 -1
  262. package/dist/client/assets/settings-layout-Be1AUfeq.js +0 -1
  263. package/dist/client/assets/shell-layout-DyvbooVs.js +0 -1
  264. package/dist/client/assets/sso-D59LXZju.js +0 -1
  265. package/dist/client/assets/store-P1_xWzY2.js +0 -1
  266. package/dist/client/assets/store-registry-BYzbgX-N.js +0 -2
  267. package/dist/client/assets/studio-tools-C6hAFyaI.js +0 -1
  268. package/dist/client/assets/tools-list-BMssVc1_.js +0 -1
  269. package/dist/client/assets/use-ai-providers-CH2PteE8.js +0 -1
  270. package/dist/client/assets/use-automations-BQg7WZhM.js +0 -1
  271. package/dist/client/assets/use-capability-CYD9NNKO.js +0 -1
  272. package/dist/client/assets/use-connection-iepx6B9p.js +0 -1
  273. package/dist/client/assets/use-delete-connection-CahtCNX0.js +0 -1
  274. package/dist/client/assets/use-file-configs-BuWEiOlF.js +0 -1
  275. package/dist/client/assets/use-join-requests-CxRcqwjo.js +0 -1
  276. package/dist/client/assets/use-members-BDmuUoGB.js +0 -1
  277. package/dist/client/assets/use-navigate-to-agent-23eRt0Ca.js +0 -1
  278. package/dist/client/assets/use-org-auth-client-En1yKL33.js +0 -1
  279. package/dist/client/assets/use-organization-roles-CXNao2lg.js +0 -1
  280. package/dist/client/assets/use-organization-settings-CJjj4PxV.js +0 -1
  281. package/dist/client/assets/use-registry-connections-DdT1ny1j.js +0 -1
  282. package/dist/client/assets/use-secrets-CZ3m8_SO.js +0 -1
  283. package/dist/client/assets/use-virtual-mcp-BtDjGJgx.js +0 -1
  284. package/dist/client/assets/useInfiniteQuery-EYFPMSDT.js +0 -1
  285. package/dist/client/assets/useSuspenseInfiniteQuery-DjA2HpiO.js +0 -1
  286. package/dist/client/assets/variant-calendar-BuoXANqL.js +0 -1
@@ -1,8 +1,8 @@
1
- import{c as oe,r as K,b as yt,$ as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,ag as rs,u as os,M as xt,P as ls}from"./index-BEXxcuG9.js";import{S as as}from"./search-input-BnVx2RlI.js";import{P as De}from"./index-BzAV5OLi.js";import{E as St}from"./empty-state-Byg9A0S5.js";import{R as ns}from"./require-capability-BFcZEdaS.js";import{N as Tt,A as is,Q as cs,U as Mt,V as Ze,W as Pt,X as ft,Y as ds,Z as _t,_ as At,L as ms,$ as us,a0 as xs,a1 as pt}from"./automation-runs-Dn4JyN79.js";import{u as vt}from"./use-connection-iepx6B9p.js";import{g as Vt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-BIeSlTFN.js";import{P as ct,a as dt,b as mt}from"./popover-gaw1l3iF.js";import{T as et,a as tt,b as st}from"./tooltip-BH7LSMRB.js";import{i as ht}from"./Check-CyDp0HHq.js";import{a as Xe}from"./Copy01-DYqwaYOh.js";import{n as Dt}from"./Globe01-DQWcSqrm.js";import{i as Ut}from"./FilterLines-BUh4z1rJ.js";import{i as fs}from"./Key01-nwRWTzli.js";import{i as ps}from"./Play-CSN3IBqZ.js";import{at as hs,W as gs}from"./agent-icon-UjMOBthG.js";import{M as Lt}from"./monaco-editor-B0B3S1UH.js";import{u as js}from"./use-members-BDmuUoGB.js";import{u as vs}from"./use-mcp-client-CI2G-Ic_.js";import{a as Ns}from"./use-virtual-mcp-BtDjGJgx.js";import{S as bs,W as ys}from"./constants-B72Xmt_K.js";import{n as Ge}from"./XCircle-DT7o53Jo.js";import{c as ws}from"./SwitchHorizontal01-D67LazcU.js";import{s as Ss}from"./Plus-Bya9qA7w.js";import{s as Is}from"./Trash01-GK3td3R2.js";import{I as Qe}from"./input-DOlqYG5a.js";import{c as ot,d as lt,S as at,b as Re,a as nt}from"./select-DKTr-Z9b.js";import{t as Kt}from"./ChevronDown-XDfXJ8c0.js";import{s as Cs}from"./Stars02-EYiMdQNh.js";import{C as ks}from"./calendar-CmKLRVVf.js";import{a as Ts}from"./Loading02-DmLZ2g2B.js";import{T as Ms}from"./textarea-CmkZCAoI.js";import{C as qt}from"./collection-tabs-AuL-kePL.js";import{S as _s}from"./switch-D0e_Fa-2.js";import{L as Ds}from"./label-T5OklXhW.js";import{I as qe}from"./integration-icon-CpH20lR5.js";import{A as Bt}from"./avatar-kqh_R_sO.js";import{A as Ls,a as $s,b as Fs}from"./alert-NMrYI6J1.js";import{C as Ht}from"./card-BDVrEmLp.js";import{K as Me}from"./monitoring-stats-row-D4UqaZfc.js";import{u as Jt}from"./studio-tools-C6hAFyaI.js";import{u as Rs}from"./useSuspenseInfiniteQuery-DjA2HpiO.js";import{o as zs,m as Os,p as Es,q as Ps}from"./sidebar-DSvrZgJz.js";import{T as $e,a as ut,b as Qt,c as Gt,d as Wt,e as ae}from"./table-CtNmLy1D.js";import{n as As}from"./ChevronUp-C4k7gPJV.js";import{u as Vs}from"./use-infinite-scroll-BGkzzb-h.js";import{c as Us,b as Ks}from"./use-automations-BQg7WZhM.js";import"./SearchMd-BvfQkVfc.js";import"./use-capability-CYD9NNKO.js";import"./access-gate-BQbMpKdU.js";import"./capability-load-error-DvRPl7Zx.js";import"./useInfiniteQuery-EYFPMSDT.js";import"./use-clock-tick-B9a2jRAC.js";import"./AlertCircle-LLoHSm66.js";import"./CheckCircle-BsNta-Ep.js";import"./Circle-lBEUhCw0.js";import"./checkbox-VOodo84Q.js";import"./command-Cixc9wEL.js";import"./index-Dzsixt0K.js";import"./dialog-Cm_JTJHQ.js";import"./X-BQ5WLsJO.js";import"./Stars01-DDFSzCqN.js";import"./ChevronRight-B94RwHdB.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-kgTvYpOm.js";import"./file-type-icon-D-OAQV03.js";import"./ZoomOut-DV7icxu5.js";import"./use-mobile-pdwi54ih.js";import"./tab-id-bb-jjgGv.js";import"./types-CNnnCskz.js";import"./chat-context-BRtcUB0n.js";import"./autosend-Ct6Ky0VH.js";import"./hooks-_AjVT69_.js";import"./decopilot-sse-pool-BRzo80Bm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CH2PteE8.js";import"./use-decopilot-events-BDKklrBp.js";import"./use-organization-settings-CJjj4PxV.js";import"./Eye-D2mf0D8Z.js";import"./Star01-B50-Zz32.js";import"./XClose-NAXlP6pU.js";import"./ZapSquare-BIlVCAPP.js";import"./Tool01-BXbLpzEO.js";import"./Monitor01-Dcv5mQJu.js";import"./Upload01-C2z_o2K2.js";import"./shell-layout-DyvbooVs.js";import"./Users03-CUk17u5x.js";import"./SearchLg-DG8S0kSO.js";import"./Zap-DnLTz7zL.js";import"./alert-dialog-zzII-GLz.js";import"./required-auth-layout-U3sz_fBb.js";import"./use-org-sso-D6HxuEGW.js";import"./LinkExternal01-DGD0-cUX.js";import"./ArrowUpRight-BjGLdnBk.js";import"./Palette-_1E1A8wi.js";import"./use-navigate-to-agent-23eRt0Ca.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-fw4k6acS.js";import"./form-zzanm0Lq.js";import"./use-collections-C-b-oWAo.js";import"./Settings02-D43Hv2qD.js";import"./DotsVertical-cUEvC4nC.js";import"./Globe04-C3OwaDqP.js";import"./HardDrive-mwKZuWq1.js";import"./LayoutLeft-3gTwXMjX.js";import"./List-DvLwT2sF.js";import"./Sun-B6_FjvE1.js";import"./Shield01-FpkCBVew.js";import"./User01-C8wnkoj-.js";import"./Users01-KFvngVMF.js";import"./index-CRyiDc_E.js";import"./use-org-auth-client-En1yKL33.js";import"./auth-GNn2tq-H.js";import"./index-CcwE9LIu.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Fe(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${o}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,o,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:o||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
- `)}function $t(s){return s.trim()?s.split(`
1
+ import{c as oe,r as K,b as yt,a1 as Be,j as t,B as Z,t as Se,l as de,K as it,m as wt,ah as rs,u as os,R as xt,U as ls}from"./index-RzCbz7G4.js";import{S as as}from"./search-input-Cvhmar4S.js";import{P as De}from"./index-iSSICeOA.js";import{E as St}from"./empty-state-Bx2oDYyE.js";import{R as ns}from"./require-capability-BwJAyhw_.js";import{N as Tt,A as is,Q as cs,U as Mt,V as Ze,W as At,X as ft,Y as ds,Z as _t,_ as Pt,L as ms,$ as us,a0 as xs,a1 as pt}from"./automation-runs-DoqJWooa.js";import{u as vt}from"./use-connection-CoNk61jl.js";import{g as Ut}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-7J4kgEzC.js";import{P as ct,a as dt,b as mt}from"./popover-DOYlXTug.js";import{T as et,a as tt,b as st}from"./tooltip-D9y133qH.js";import{i as ht}from"./Check-C6rOtSdY.js";import{a as Xe}from"./Copy01-DDhuzJaA.js";import{n as Dt}from"./Globe01-3_GHOe2E.js";import{i as Vt}from"./FilterLines-eP80xxCy.js";import{i as fs}from"./Key01-BVXgUn29.js";import{i as ps}from"./Play-Bv09TV2w.js";import{au as hs,W as gs}from"./agent-icon-C2ANw4X5.js";import{M as Lt}from"./monaco-editor-DR7220lx.js";import{u as js}from"./use-members-oJt5povW.js";import{u as vs}from"./use-mcp-client-D3e9ceNa.js";import{a as Ns}from"./use-virtual-mcp-D1vadQaQ.js";import{S as bs,W as ys}from"./constants-B72Xmt_K.js";import{n as Ge}from"./XCircle-F9-2oAiq.js";import{c as ws}from"./SwitchHorizontal01-sGYV2dsM.js";import{s as Ss}from"./Plus-D9m58hN2.js";import{s as Is}from"./Trash01-TYv08n93.js";import{I as Qe}from"./input-CmS4IhfL.js";import{a as ot,b as lt,c as at,d as $e,S as nt}from"./select-cLkB0xx3.js";import{t as Kt}from"./ChevronDown-BfrTp1Ch.js";import{s as Cs}from"./Stars02-DaEgHmQI.js";import{C as ks}from"./calendar-DlspiiCF.js";import{a as Ts}from"./Loading02-Bt_dLUWn.js";import{T as Ms}from"./textarea-DfbK_YWl.js";import{C as qt}from"./collection-tabs-DcJTaWg5.js";import{S as _s}from"./switch-DvI4Ivs6.js";import{L as Ds}from"./label-BRuRKPr0.js";import{I as qe}from"./integration-icon-B64oCP0F.js";import{A as Bt}from"./avatar-BvMZq_TI.js";import{A as Ls,a as Rs,b as Fs}from"./alert-BLw4eidn.js";import{C as Ht}from"./card-DJEMjLyN.js";import{K as Me}from"./monitoring-stats-row-BZL3Rvz8.js";import{u as Jt}from"./studio-tools-D1WvthcJ.js";import{u as $s}from"./useSuspenseInfiniteQuery-CmezFxqW.js";import{o as zs,m as Os,p as Es,q as As}from"./sidebar-Dg_hr7dR.js";import{T as Re,a as ut,b as Qt,c as Gt,d as Wt,e as ae}from"./table-Rcs576gh.js";import{n as Ps}from"./ChevronUp-MSW-WrWs.js";import{u as Us}from"./use-infinite-scroll-CLzTjnPW.js";import{c as Vs,b as Ks}from"./use-automations-Bj7ea45i.js";import"./SearchMd-BfevlctH.js";import"./use-capability-BAJSmOR6.js";import"./access-gate-Yfi4ekhF.js";import"./capability-load-error-BM3-quVD.js";import"./useInfiniteQuery-FvBo89pe.js";import"./use-clock-tick-DiAMyzbm.js";import"./AlertCircle-Ct7weZuE.js";import"./CheckCircle-CREoH7p2.js";import"./Circle-ow_NDQHR.js";import"./checkbox-BW3fb6zN.js";import"./command-BK76iADW.js";import"./index-D-yF_uFs.js";import"./dialog-VQoq6ED0.js";import"./X-CJDTMZdu.js";import"./Stars01-Q9LxQc27.js";import"./ChevronRight-CvPpz1Nq.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CC8l0MM4.js";import"./file-type-icon-Byym_Yq8.js";import"./ZoomOut-ox9YzR1a.js";import"./use-mobile-BD37jY8Y.js";import"./tab-id-bb-jjgGv.js";import"./types-u5_F63vr.js";import"./chat-context-DWWQ8fi_.js";import"./autosend-CYyCczkd.js";import"./hooks-BCy5e9GO.js";import"./decopilot-sse-pool-CQt0Qt9t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-Be4jiLlp.js";import"./use-decopilot-events-CwboOo9R.js";import"./use-organization-settings-BPsQDYqA.js";import"./Eye-C1XDNiGB.js";import"./Star01-DoabU7Hn.js";import"./XClose-BKoSgWfP.js";import"./ZapSquare-BBu4b6r_.js";import"./Tool01-Bfw6sadd.js";import"./Monitor01-2j67L_aU.js";import"./Upload01-bdtJr5BI.js";import"./shell-layout-P9zH_bFZ.js";import"./Users03-B4feTEaY.js";import"./SearchLg-6CR82X0W.js";import"./Zap-GCvYK6cT.js";import"./alert-dialog-BglRhrg0.js";import"./required-auth-layout-BnUL76ZK.js";import"./use-org-sso-C5MQ0Bj7.js";import"./LinkExternal01-BM0S_VFU.js";import"./ArrowUpRight-gaoM5S0k.js";import"./Palette-D5rmfc3a.js";import"./use-navigate-to-agent-C_szOIys.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-D_i1iWd2.js";import"./form-Ck57FY_v.js";import"./use-collections-B0fmzWMT.js";import"./ArrowUp-CLqVzt5Z.js";import"./Settings02-f8loRSef.js";import"./DotsVertical-CB7QN8Ws.js";import"./Globe04-BAF3P1k9.js";import"./HardDrive-DW6eIDxP.js";import"./LayoutLeft-DKGWBMNA.js";import"./List-vHTogdj7.js";import"./Sun-CclxevtX.js";import"./Shield01-DPzSiB-T.js";import"./User01-BZEdjS8N.js";import"./Users01-D0TsDHjS.js";import"./index-CA5Ck5O8.js";import"./use-org-auth-client-BbOBgx1F.js";import"./auth-DKsARQye.js";import"./index-BkSsc9os.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Fe(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${o}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,o,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:o||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
+ `)}function Rt(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...o]=e.split("=");return{key:r||"",operator:"eq",value:o.join("=")}}if(e.includes("~")){const[r,...o]=e.split("~");return{key:r||"",operator:"contains",value:o.join("~")}}if(e.includes("@")){const[r,...o]=e.split("@");return{key:r||"",operator:"in",value:o.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},o=[],a={};for(const l of s)if(l.key.trim())switch(l.operator){case"eq":l.value&&(e[l.key]=l.value);break;case"contains":l.value&&(r[l.key]=`%${l.value}%`);break;case"exists":o.push(l.key);break;case"in":l.value&&(a[l.key]=l.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:o.length>0?o:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Ft(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
4
4
 
5
- ... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Hs(s){const e=oe.c(117),{log:r}=s,[o,a]=K.useState(!1),[l,c]=K.useState(!1),i=yt(),{org:n}=Be(),d=vt(),f=Ft(r.input),p=Ft(r.output),v=Js;let b;e[0]!==r.input||e[1]!==r.output?(b=async se=>{const ee=v(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(ee),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Se.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=b):b=e[2];const u=b;let F;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(F=se=>{const ee=v(se==="input"?r.input:r.output),le=new Blob([ee],{type:"application/json"}),he=URL.createObjectURL(le),be=document.createElement("a");be.href=he,be.download=`${r.toolName}-${se}-${r.id}.json`,be.click(),URL.revokeObjectURL(he)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=F):F=e[7];const h=F;let j;e[8]!==d||e[9]!==r.connectionId||e[10]!==r.input||e[11]!==r.toolName||e[12]!==i||e[13]!==n?(j=()=>{const se=d.find(le=>le.id===r.connectionId);if(!se){Se.error("Could not find the connection for this tool call");return}const ee=crypto.randomUUID();sessionStorage.setItem(`replay-${ee}`,JSON.stringify(r.input)),i({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:n.slug,appSlug:Vt(se),collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:ee}})},e[8]=d,e[9]=r.connectionId,e[10]=r.input,e[11]=r.toolName,e[12]=i,e[13]=n,e[14]=j):j=e[14];const m=j,[C,S]=K.useState(!1);let g;e[15]!==r.requestId?(g=async()=>{try{await navigator.clipboard.writeText(r.requestId),S(!0),setTimeout(()=>S(!1),2e3)}catch{Se.error("Failed to copy to clipboard")}},e[15]=r.requestId,e[16]=g):g=e[16];const _=g;let I;e[17]!==r.timestamp?(I=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[17]=r.timestamp,e[18]=I):I=e[18];const x=I,$="text-sm px-5 md:px-6 py-5 space-y-5";let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[19]=w):w=e[19];let D;e[20]!==x?(D=t.jsxs("div",{children:[w,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[20]=x,e[21]=D):D=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[22]=k):k=e[22];let O;e[23]!==r.durationMs?(O=t.jsxs("div",{children:[k,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[23]=r.durationMs,e[24]=O):O=e[24];let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[25]=R):R=e[25];let J;e[26]!==r.userName?(J=t.jsxs("div",{children:[R,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[26]=r.userName,e[27]=J):J=e[27];let P;e[28]!==r.virtualMcpName?(P=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[28]=r.virtualMcpName,e[29]=P):P=e[29];let X;e[30]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[30]=X):X=e[30];let y;e[31]!==r.requestId?(y=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[31]=r.requestId,e[32]=y):y=e[32];let T;e[33]!==C?(T=C?t.jsx(ht,{size:12}):t.jsx(Xe,{size:12}),e[33]=C,e[34]=T):T=e[34];let L;e[35]!==_||e[36]!==T?(L=t.jsx(Z,{size:"icon",variant:"ghost",onClick:_,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:T}),e[35]=_,e[36]=T,e[37]=L):L=e[37];let z;e[38]!==y||e[39]!==L?(z=t.jsxs("div",{children:[X,t.jsxs("div",{className:"flex items-center gap-1",children:[y,L]})]}),e[38]=y,e[39]=L,e[40]=z):z=e[40];let E;e[41]!==r.userAgent?(E=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[41]=r.userAgent,e[42]=E):E=e[42];let U;e[43]!==r.properties||e[44]!==i||e[45]!==n?(U=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[ee,le]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[ee,"=",le]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const he={key:ee,operator:"eq",value:le};i({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Fe([he])}})},children:[t.jsx(Ut,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${ee}=${le}`),Se.success("Copied filter to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ee),Se.success("Copied key to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(fs,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(le),Se.success("Copied value to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(hs,{size:14,className:"mr-2"}),"Copy value"]})]})})]},ee)})})]}),e[43]=r.properties,e[44]=i,e[45]=n,e[46]=U):U=e[46];let q;e[47]!==O||e[48]!==J||e[49]!==P||e[50]!==z||e[51]!==E||e[52]!==U||e[53]!==D?(q=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[D,O,J,P,z,E,U]}),e[47]=O,e[48]=J,e[49]=P,e[50]=z,e[51]=E,e[52]=U,e[53]=D,e[54]=q):q=e[54];let V;e[55]!==r.errorMessage?(V=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[55]=r.errorMessage,e[56]=V):V=e[56];const Y="space-y-4";let B;e[57]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[57]=B):B=e[57];const Q=f.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(f.originalSize)," - truncated)"]});let A;e[58]!==Q?(A=t.jsxs("div",{className:"flex items-center gap-2",children:[B,Q]}),e[58]=Q,e[59]=A):A=e[59];let N;e[60]!==m||e[61]!==r.input?(N=r.input&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:m,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(ps,{size:14})})}),t.jsx(st,{children:"Replay tool call"})]}),e[60]=m,e[61]=r.input,e[62]=N):N=e[62];let M;e[63]!==h||e[64]!==f?(M=f.isTruncated&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Dt,{size:14})})}),t.jsx(st,{children:"Download full input"})]}),e[63]=h,e[64]=f,e[65]=M):M=e[65];let H;e[66]!==u?(H=()=>u("input"),e[66]=u,e[67]=H):H=e[67];let te;e[68]!==o?(te=o?t.jsx(ht,{size:14}):t.jsx(Xe,{size:14}),e[68]=o,e[69]=te):te=e[69];let G;e[70]!==H||e[71]!==te?(G=t.jsx(Z,{size:"icon",variant:"ghost",onClick:H,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:te}),e[70]=H,e[71]=te,e[72]=G):G=e[72];let re;e[73]!==N||e[74]!==M||e[75]!==G?(re=t.jsxs("div",{className:"flex items-center gap-1",children:[N,M,G]}),e[73]=N,e[74]=M,e[75]=G,e[76]=re):re=e[76];let W;e[77]!==A||e[78]!==re?(W=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[A,re]}),e[77]=A,e[78]=re,e[79]=W):W=e[79];let ne;e[80]!==f?(ne=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Lt,{code:f.content,language:"json",height:"100%",readOnly:!0})}),e[80]=f,e[81]=ne):ne=e[81];let ce;e[82]!==W||e[83]!==ne?(ce=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[W,ne]})}),e[82]=W,e[83]=ne,e[84]=ce):ce=e[84];const ze="rounded-lg overflow-hidden border border-border",Ie="flex items-center justify-between p-1 pl-4 border-b border-border",Ce="flex items-center gap-2";let ie;e[85]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[85]=ie):ie=e[85];const Le=p.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(p.originalSize)," - truncated)"]});let ge;e[86]!==ie||e[87]!==Le?(ge=t.jsxs("div",{className:Ce,children:[ie,Le]}),e[86]=ie,e[87]=Le,e[88]=ge):ge=e[88];let je;e[89]!==h||e[90]!==p.isTruncated?(je=p.isTruncated&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Dt,{size:14})})}),t.jsx(st,{children:"Download full output"})]}),e[89]=h,e[90]=p.isTruncated,e[91]=je):je=e[91];let ve;e[92]!==u?(ve=()=>u("output"),e[92]=u,e[93]=ve):ve=e[93];let me;e[94]!==l?(me=l?t.jsx(ht,{size:14}):t.jsx(Xe,{size:14}),e[94]=l,e[95]=me):me=e[95];let Ne;e[96]!==ve||e[97]!==me?(Ne=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:me}),e[96]=ve,e[97]=me,e[98]=Ne):Ne=e[98];let ue;e[99]!==je||e[100]!==Ne?(ue=t.jsxs("div",{className:"flex items-center gap-1",children:[je,Ne]}),e[99]=je,e[100]=Ne,e[101]=ue):ue=e[101];let xe;e[102]!==ge||e[103]!==ue?(xe=t.jsxs("div",{className:Ie,children:[ge,ue]}),e[102]=ge,e[103]=ue,e[104]=xe):xe=e[104];let fe;e[105]!==p.content?(fe=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Lt,{code:p.content,language:"json",height:"100%",readOnly:!0})}),e[105]=p.content,e[106]=fe):fe=e[106];let pe;e[107]!==xe||e[108]!==fe?(pe=t.jsx("div",{children:t.jsxs("div",{className:ze,children:[xe,fe]})}),e[107]=xe,e[108]=fe,e[109]=pe):pe=e[109];let ke;e[110]!==ce||e[111]!==pe?(ke=t.jsxs("div",{className:Y,children:[ce,pe]}),e[110]=ce,e[111]=pe,e[112]=ke):ke=e[112];let we;return e[113]!==q||e[114]!==V||e[115]!==ke?(we=t.jsxs("div",{className:$,children:[q,V,ke]}),e[113]=q,e[114]=V,e[115]=ke,e[116]=we):we=e[116],we}function Js(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Qs={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const o=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:o,unit:a}}function ye(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const o=Yt(e);if(!o)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,l=new Date(a);if(o.offset===0||!o.unit)return{valid:!0,date:l};switch(o.unit){case"m":l.setMinutes(l.getMinutes()-o.offset);break;case"h":l.setHours(l.getHours()-o.offset);break;case"d":l.setDate(l.getDate()-o.offset);break;case"w":l.setDate(l.getDate()-o.offset*7);break;case"M":l.setMonth(l.getMonth()-o.offset);break}return{valid:!0,date:l}}function Gs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function Rt(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const l=ye(e);return l.valid&&l.date?Gs(l.date):e}const o=Qs[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${o}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Ws(s,e){const r=es.find(o=>o.from===s&&o.to===e);return r?r.label:`${Rt(s)} to ${Rt(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),o=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),l=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${o} ${a}:${l}:${c}`}function Xs(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,o,a,l,c,i]=e,n=new Date(Number(r),Number(o)-1,Number(a),Number(l),Number(c),Number(i));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=ye(s);return e.valid&&e.date?Je(e.date):s}function zt({value:s,onChange:e,placeholder:r="now or now-2d",className:o,disabled:a,error:l}){const[c,i]=K.useState(!1),[n,d]=K.useState(()=>gt(s)),[f,p]=K.useState(),[v,b]=K.useState(!1),u=K.useRef(s);u.current!==s&&(u.current=s,v||d(gt(s)));const F=x=>{const $=x.target.value;d($),p(void 0)},h=()=>{b(!0)},j=()=>{b(!1);const x=n.trim();if(Zt(x)){p(void 0),e(x);return}const $=Xs(x);if($){p(void 0),e($.toISOString()),d(Je($));return}const w=ye(x);if(w.valid&&w.date){p(void 0),e(x),d(Je(w.date));return}d(gt(s)),p(void 0)},m=x=>{if(x){const w=ye(s).date||new Date;x.setHours(w.getHours()),x.setMinutes(w.getMinutes()),x.setSeconds(0),x.setMilliseconds(0);const D=x.toISOString();d(Je(x)),e(D),p(void 0)}i(!1)},C=x=>{const[$,w]=x.target.value.split(":").map(Number),k=ye(s).date||new Date;k.setHours($||0),k.setMinutes(w||0),k.setSeconds(0),k.setMilliseconds(0);const O=k.toISOString();d(Je(k)),e(O)},S=ye(s),g=S.valid?S.date:new Date,_=g?`${String(g.getHours()).padStart(2,"0")}:${String(g.getMinutes()).padStart(2,"0")}`:"",I=l||f;return t.jsxs("div",{className:de("flex gap-1",o),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Qe,{value:n,onChange:F,onFocus:h,onBlur:j,placeholder:r,disabled:a,className:de("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:i,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(Ts,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(ks,{mode:"single",selected:g||void 0,onSelect:m,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Qe,{type:"time",value:_,onChange:C,className:"text-sm h-8"})]})]})]})]})}function Ys({value:s,onChange:e,className:r,disabled:o,quickRanges:a=es}){const[l,c]=K.useState(!1),[i,n]=K.useState(s.from),[d,f]=K.useState(s.to),[p,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),f(s.to));const u=m=>{b.current={from:m.from,to:m.to},n(m.from),f(m.to),c(!1),e({from:m.from,to:m.to})},F=()=>{const m=ye(i),C=ye(d);if(!m.valid||!m.date){v("Invalid 'From' date");return}if(!C.valid||!C.date){v("Invalid 'To' date");return}if(m.date>=C.date){v("'From' must be before 'To'");return}v(null),e({from:i,to:d}),c(!1)},h=m=>s.from===m.from&&s.to===m.to,j=Ws(s.from,s.to);return t.jsxs(ct,{open:l,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:de("gap-1.5 min-w-[160px] justify-between",r),disabled:o,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Cs,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:j})]}),t.jsx(Kt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:m=>m.preventDefault(),style:l?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(zt,{value:i,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(zt,{value:d,onChange:f,placeholder:"now"})]}),p&&t.jsx("p",{className:"text-xs text-destructive",children:p}),t.jsx(Z,{onClick:F,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(m=>{const C=h(m);return t.jsx("button",{type:"button",onClick:()=>u(m),className:de("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",C&&"bg-accent text-accent-foreground font-medium"),children:m.label},m.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){return await s.call("MONITORING_STATS",e)}function Zs(s,e){const r=oe.c(12),{org:o}=Be(),a=Jt();let l,c,i;r[0]!==o.id||r[1]!==s?(i={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},c=wt,l=it.monitoringStatsToolCalls(o.id,JSON.stringify(i)),r[0]=o.id,r[1]=s,r[2]=l,r[3]=c,r[4]=i):(l=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==l||r[10]!==n?(d={queryKey:l,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=l,r[10]=n,r[11]=d):d=r[11],c(d)}function er(s,e){const r=oe.c(12),{org:o}=Be(),a=Jt();let l,c,i;r[0]!==o.id||r[1]!==s?(i={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},c=wt,l=it.monitoringStatsLlm(o.id,JSON.stringify(i)),r[0]=o.id,r[1]=s,r[2]=l,r[3]=c,r[4]=i):(l=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==l||r[10]!==n?(d={queryKey:l,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=l,r[10]=n,r[11]=d):d=r[11],c(d)}function _e(s){const e=oe.c(20),{title:r,value:o,action:a,children:l,className:c}=s;let i;e[0]!==c?(i=de("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=i):i=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let d;e[4]!==o?(d=t.jsx("span",{className:"text-4xl font-normal",children:o}),e[4]=o,e[5]=d):d=e[5];let f;e[6]!==n||e[7]!==d?(f=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,d]}),e[6]=n,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==a?(p=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=p):p=e[10];let v;e[11]!==f||e[12]!==p?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[f,p]}),e[11]=f,e[12]=p,e[13]=v):v=e[13];let b;e[14]!==l?(b=l&&t.jsx("div",{className:"flex flex-col gap-6",children:l}),e[14]=l,e[15]=b):b=e[15];let u;return e[16]!==i||e[17]!==v||e[18]!==b?(u=t.jsxs(Ht,{className:i,children:[v,b]}),e[16]=i,e[17]=v,e[18]=b,e[19]=u):u=e[19],u}function jt(s){const e=oe.c(14),{metrics:r,connections:o,mode:a,total:l}=s,{org:c}=Be(),i=yt();let n,d,f;if(e[0]!==o||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==c||e[5]!==l){f=Symbol.for("react.early_return_sentinel");e:{const v=o??[],b=new Map(r.map(sr));let u;e[9]!==a?(u=(h,j)=>{const m=_t(h.metric,a);return _t(j.metric,a)-m},e[9]=a,e[10]=u):u=e[10];const F=v.map(h=>({connection:h,metric:b.get(h.id)})).filter(tr).sort(u).slice(0,4);if(F.length===0){f=null;break e}n="flex flex-col",d=F.map((h,j)=>{const{connection:m,metric:C}=h,S=l>0?(C.calls/l*100).toFixed(1):"0.0",g=a==="errors"?`${C.errorRate.toFixed(1)}%`:`${S}%`,_=j===F.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!_&&"border-b border-border/50"),onClick:()=>i({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Vt(m)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:m.icon,name:m.title,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:m.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:g}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:ds(C,a)})]})]},m.id)})}e[0]=o,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=l,e[6]=n,e[7]=d,e[8]=f}else n=e[6],d=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;return e[11]!==n||e[12]!==d?(p=t.jsx("div",{className:n,children:d}),e[11]=n,e[12]=d,e[13]=p):p=e[13],p}function tr(s){return s.metric}function sr(s){return[s.connectionId,s]}const Ot=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Et(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Ot[e%Ot.length]}function He(s){const e=oe.c(21),{models:r,mode:o}=s,a=o===void 0?"calls":o;if(r.length===0)return null;let l;e[0]!==a?(l=u=>a==="tokens"?(u.inputTokens??0)+(u.outputTokens??0):a==="cost"?u.costUsd??0:u.calls,e[0]=a,e[1]=l):l=e[1];const c=l;let i;e[2]!==a?(i=u=>a==="cost"?Pt(u):a==="tokens"?Ze(u):u.toLocaleString(),e[2]=a,e[3]=i):i=e[3];const n=i;let d;e[4]!==c?(d=(u,F)=>u+c(F),e[4]=c,e[5]=d):d=e[5];const f=r.reduce(d,0);let p,v;if(e[6]!==n||e[7]!==r||e[8]!==f||e[9]!==c){let u;e[12]!==c?(u=(j,m)=>c(m)-c(j),e[12]=c,e[13]=u):u=e[13];const F=[...r].sort(u).slice(0,4);p="flex flex-col";let h;e[14]!==n||e[15]!==f||e[16]!==c?(h=(j,m,C)=>{const S=c(j),g=f>0?(S/f*100).toFixed(1):"0.0",_=m===C.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3",!_&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Et(j.toolName)} 18%, transparent)`},children:t.jsx(Ge,{size:14,style:{color:Et(j.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:j.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[g,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},j.toolName)},e[14]=n,e[15]=f,e[16]=c,e[17]=h):h=e[17],v=F.map(h),e[6]=n,e[7]=r,e[8]=f,e[9]=c,e[10]=p,e[11]=v}else p=e[10],v=e[11];let b;return e[18]!==p||e[19]!==v?(b=t.jsx("div",{className:p,children:v}),e[18]=p,e[19]=v,e[20]=b):b=e[20],b}function rr(s){const e=oe.c(48),{displayDateRange:r,connectionIds:o,excludeConnectionIds:a,toolName:l,status:c,connections:i,isStreaming:n,streamingRefetchInterval:d,llmUserIds:f}=s,p=cs(r),v=n?d:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:u,isError:F}=Zs({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:o.length>0?o:void 0,excludeConnectionIds:a,toolNames:l?[l]:void 0,status:c},b);let h;e[2]!==v?(h={refetchInterval:v},e[2]=v,e[3]=h):h=e[3];const{data:j,isError:m}=er({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:f?.length?f:void 0},h),C=F||m,S=u?{totalCalls:u.totalCalls,totalErrors:u.totalErrors,avgDurationMs:u.avgDurationMs,p95DurationMs:u.p95DurationMs,data:Mt(u.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},g=j?{totalCalls:j.totalCalls,totalErrors:j.totalErrors,avgDurationMs:j.avgDurationMs,p95DurationMs:j.p95DurationMs,data:Mt(j.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let _;e[4]!==j?.topTools?(_=j?.topTools??[],e[4]=j?.topTools,e[5]=_):_=e[5];const I=_,x=j?.totalInputTokens??0,$=j?.totalOutputTokens??0,w=j?.totalTokens??0,D=j?.totalCostUsd??0;let k;e[6]!==u?.connectionBreakdown?(k=u?.connectionBreakdown??[],e[6]=u?.connectionBreakdown,e[7]=k):k=e[7];const O=k,[R,J]=K.useState("avg");let P;e[8]!==C?(P=C&&t.jsxs(Ls,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx($s,{children:"Failed to load monitoring data"}),t.jsx(Fs,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=C,e[9]=P):P=e[9];let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=ce=>J(ce),e[10]=X):X=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ot,{className:"w-[120px]",children:t.jsx(lt,{})}),e[11]=y):y=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(at,{children:[t.jsx(Re,{value:"avg",children:"Avg"}),t.jsx(Re,{value:"p95",children:"P95"})]}),e[12]=T):T=e[12];let L;e[13]!==R?(L=t.jsxs(nt,{value:R,onValueChange:X,children:[y,T]}),e[13]=R,e[14]=L):L=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=z):z=e[15];let E;e[16]!==I?(E=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=E):E=e[17];let U;e[18]!==w?(U=Ze(w),e[18]=w,e[19]=U):U=e[19];let q;e[20]!==x?(q=Ze(x),e[20]=x,e[21]=q):q=e[21];let V;e[22]!==$?(V=Ze($),e[22]=$,e[23]=V):V=e[23];let Y;e[24]!==q||e[25]!==V?(Y=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",V," out"]}),e[24]=q,e[25]=V,e[26]=Y):Y=e[26];let B;e[27]!==I?(B=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=B):B=e[28];let Q;e[29]!==D?(Q=D>0?Pt(D):"—",e[29]=D,e[30]=Q):Q=e[30];let A;e[31]!==D?(A=D===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=D,e[32]=A):A=e[32];let N;e[33]!==I||e[34]!==D?(N=D>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=D,e[35]=N):N=e[35];let M;e[36]!==I?(M=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=M):M=e[37];const H=_e,te="AI Errors",G=g.totalErrors.toLocaleString();let re;e[38]!==g.data?(re=t.jsx(Me,{data:g.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=g.data,e[39]=re):re=e[39];let W;e[40]!==I||e[41]!==g.totalErrors?(W=g.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=g.totalErrors,e[42]=W):W=e[42];let ne;return e[43]!==H||e[44]!==G||e[45]!==re||e[46]!==W?(ne=t.jsxs(H,{title:te,value:G,children:[re,W]}),e[43]=H,e[44]=G,e[45]=re,e[46]=W,e[47]=ne):ne=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[P,t.jsxs(_e,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:O,connections:i,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"Latency",value:ft(R==="avg"?S.avgDurationMs:S.p95DurationMs),action:L,children:[t.jsx(Me,{data:S.data,dataKey:R,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:O,connections:i,mode:"latency",total:S.totalCalls})]}),t.jsxs(_e,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:O,connections:i,mode:"errors",total:S.totalErrors})]})]}),z,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(_e,{title:"AI Calls",value:g.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:g.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),E]}),t.jsxs(_e,{title:"Tokens",value:U,action:Y,children:[t.jsx(Me,{data:g.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),B]}),t.jsxs(_e,{title:"Cost",value:Q,action:A,children:[t.jsx(Me,{data:g.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"AI Latency",value:ft(g.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",ft(g.p95DurationMs)]}),children:[t.jsx(Me,{data:g.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),M]}),ne]})]})}function Ke(s){const e=oe.c(8),{className:r}=s;let o;e[0]!==r?(o=de("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=l):l=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(or),e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-6",children:[l,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=i):i=e[5];let n;return e[6]!==o?(n=t.jsxs(Ht,{className:o,children:[a,i]}),e[6]=o,e[7]=n):n=e[7],n}function or(s,e){return t.jsxs("div",{className:de("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function lr(){const s=oe.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,o;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),o=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=o):(r=s[1],o=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function ar(s){const e=oe.c(46),{log:r,connection:o,virtualMcpName:a,virtualMcpIcon:l,onClick:c,lastLogRef:i}=s;let n,d;if(e[0]!==r.timestamp){const R=new Date(r.timestamp);n=R.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=R.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=d}else n=e[1],d=e[2];const f=d,p=o?.icon||null,v=o?.title??r.connectionId;let b;e[3]!==p||e[4]!==v?(b=t.jsx($e,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:p,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=p,e[4]=v,e[5]=b):b=e[5];let u;e[6]!==r.toolName?(u=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=u):u=e[7];const F=o?.title??r.connectionId;let h;e[8]!==F?(h=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:F}),e[8]=F,e[9]=h):h=e[9];let j;e[10]!==u||e[11]!==h?(j=t.jsxs($e,{className:"min-w-0 pr-2 md:pr-4",children:[u,h]}),e[10]=u,e[11]=h,e[12]=j):j=e[12];let m;e[13]!==l||e[14]!==a?(m=t.jsx($e,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:l,name:a,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=l,e[14]=a,e[15]=m):m=e[15];let C;e[16]!==r.userImage||e[17]!==r.userName?(C=t.jsx(Bt,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=C):C=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let g;e[21]!==C||e[22]!==S?(g=t.jsx($e,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,S]})}),e[21]=C,e[22]=S,e[23]=g):g=e[23];let _;e[24]!==n?(_=t.jsx("div",{children:n}),e[24]=n,e[25]=_):_=e[25];let I;e[26]!==f?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:f}),e[26]=f,e[27]=I):I=e[27];let x;e[28]!==_||e[29]!==I?(x=t.jsxs($e,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[_,I]}),e[28]=_,e[29]=I,e[30]=x):x=e[30];let $;e[31]!==r.durationMs?($=t.jsxs($e,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=$):$=e[32];const w=r.isError?"destructive":"success",D=r.isError?"Error":"OK";let k;e[33]!==w||e[34]!==D?(k=t.jsx($e,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:w,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:D})})}),e[33]=w,e[34]=D,e[35]=k):k=e[35];let O;return e[36]!==i||e[37]!==c||e[38]!==g||e[39]!==x||e[40]!==$||e[41]!==k||e[42]!==b||e[43]!==j||e[44]!==m?(O=t.jsxs(ut,{ref:i,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,j,m,g,x,$,k]}),e[36]=i,e[37]=c,e[38]=g,e[39]=x,e[40]=$,e[41]=k,e[42]=b,e[43]=j,e[44]=m,e[45]=O):O=e[45],O}function nr(s){const e=oe.c(26),{connectionIds:r,virtualMcpIds:o,tool:a,status:l,search:c,logs:i,hasMore:n,onLoadMore:d,isLoadingMore:f,connections:p,virtualMcps:v,membersData:b,client:u}=s,F=p??[],h=v??[],[j,m]=K.useState(null),C=Vs(d,n,f),S=At(b),g=new Map(S.map(mr)),_=new Map(h.map(dr));let x=i.map(N=>{const M=g.get(N.userId??""),H=N.virtualMcpId?_.get(N.virtualMcpId):null;return{...N,userName:M?.name??N.userId??"Unknown",userImage:M?.image??void 0,virtualMcpName:H?.title??null,virtualMcpIcon:H?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=M=>r.includes(M.connectionId),e[0]=r,e[1]=N):N=e[1],x=x.filter(N)}if(o.length>1){let N;e[2]!==o?(N=M=>M.virtualMcpId&&o.includes(M.virtualMcpId),e[2]=o,e[3]=N):N=e[3],x=x.filter(N)}const $=new Map(F.map(cr));if(c){const N=c.toLowerCase();x=x.filter(M=>M.toolName.toLowerCase().includes(N)||($.get(M.connectionId)?.title??M.connectionId).toLowerCase().includes(N)||M.errorMessage?.toLowerCase().includes(N))}const w=j!==null?x[j]??null:null,D=wt({queryKey:it.monitoringLogDetail(w?.id??""),queryFn:async()=>{if(!u)throw new Error("MCP client is not available");const N=await u.callTool({name:"MONITORING_LOG_GET",arguments:{id:w.id}});return N.structuredContent??N},enabled:w!==null}),k=D.data?.log,O=w&&k?{...w,input:k.input,output:k.output}:w;if(x.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const M=c||r.length>0||o.length>0||a||l!=="all"?"No logs match your filters":"No logs found in this time range";let H;return e[5]!==M?(H=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(St,{image:N,title:"No logs found",description:M})}),e[5]=M,e[6]=H):H=e[6],H}const R="flex-1 flex flex-col min-w-0",J="flex-1 min-w-0 pt-1",P="min-w-[600px] md:min-w-0",X=Gt,y="w-full border-collapse";let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(ae,{className:"w-5"}),t.jsx(ae,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(ae,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(ae,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[7]=T):T=e[7];const L=Qt,z=x.map((N,M)=>t.jsx(ar,{log:N,connection:$.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>m(M),lastLogRef:M===x.length-1?C:void 0},N.id));let E;e[8]!==L||e[9]!==z?(E=t.jsx(L,{children:z}),e[8]=L,e[9]=z,e[10]=E):E=e[10];let U;e[11]!==X||e[12]!==T||e[13]!==E?(U=t.jsx("div",{className:J,children:t.jsx("div",{className:P,children:t.jsxs(X,{className:y,children:[T,E]})})}),e[11]=X,e[12]=T,e[13]=E,e[14]=U):U=e[14];const q=j!==null;let V;e[15]!==m?(V=N=>{N||m(null)},e[15]=m,e[16]=V):V=e[16];const Y=w&&j!==null&&t.jsxs(t.Fragment,{children:[t.jsx(zs,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:$.get(w.connectionId)?.icon||null,name:$.get(w.connectionId)?.title??w.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Os,{className:"text-sm leading-snug truncate",children:w.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:$.get(w.connectionId)?.title??w.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(ir),disabled:j===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(As,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(N=>N!==null&&N<x.length-1?N+1:N),disabled:j===x.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(Kt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:D.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):D.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>D.refetch(),children:"Retry"})]}):t.jsx(Hs,{log:O})})]});let B;e[17]!==Y?(B=t.jsx(Es,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:Y}),e[17]=Y,e[18]=B):B=e[18];let Q;e[19]!==V||e[20]!==B||e[21]!==q?(Q=t.jsx(Ps,{open:q,onOpenChange:V,children:B}),e[19]=V,e[20]=B,e[21]=q,e[22]=Q):Q=e[22];let A;return e[23]!==Q||e[24]!==U?(A=t.jsxs("div",{className:R,children:[U,Q]}),e[23]=Q,e[24]=U,e[25]=A):A=e[25],A}function ir(s){return s!==null&&s>0?s-1:s}function cr(s){return[s.id,s]}function dr(s){return[s.id,s]}function mr(s){return[s.userId,s.user]}function ur(){const s=oe.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ae,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ae,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ae,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=o):o=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ae,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let l;s[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=l):l=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let i;s[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,o,a,l,c,t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=i):i=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Gt,{className:"w-full border-collapse",children:[i,t.jsx(Qt,{children:Array.from({length:8}).map(xr)})]})})}),s[7]=n):n=s[7],n}function xr(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const bt=Object.assign(nr,{Skeleton:ur});function fr(s){const e=oe.c(34),{client:r,locator:o,baseParams:a,pageSize:l,isStreaming:c,streamingRefetchInterval:i,connectionIds:n,virtualMcpIds:d,tool:f,status:p,searchQuery:v,allConnections:b,allVirtualMcps:u,membersData:F}=s;let h;e[0]!==a||e[1]!==o?(h=it.monitoringLogsInfinite(o,JSON.stringify(a)),e[0]=a,e[1]=o,e[2]=h):h=e[2];let j;e[3]!==a||e[4]!==r||e[5]!==l?(j=async J=>{const{pageParam:P}=J,X=P===void 0?0:P;if(!r)throw new Error("MCP client is not available");const y=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:l,offset:X}});return y.structuredContent??y},e[3]=a,e[4]=r,e[5]=l,e[6]=j):j=e[6];let m;e[7]!==l?(m=(J,P)=>{if(!((J?.logs?.length??0)<l))return P.length*l},e[7]=l,e[8]=m):m=e[8];const C=c?i:!1;let S;e[9]!==h||e[10]!==j||e[11]!==m||e[12]!==C?(S={queryKey:h,queryFn:j,initialPageParam:0,getNextPageParam:m,staleTime:0,refetchInterval:C},e[9]=h,e[10]=j,e[11]=m,e[12]=C,e[13]=S):S=e[13];const{data:g,fetchNextPage:_,hasNextPage:I,isFetchingNextPage:x}=Rs(S);let $;e[14]!==g.pages?($=g.pages.flatMap(pr),e[14]=g.pages,e[15]=$):$=e[15];const w=$;let D;e[16]!==_||e[17]!==I||e[18]!==x?(D=()=>{I&&!x&&_()},e[16]=_,e[17]=I,e[18]=x,e[19]=D):D=e[19];const k=D,O=I??!1;let R;return e[20]!==b||e[21]!==u||e[22]!==r||e[23]!==n||e[24]!==k||e[25]!==x||e[26]!==F||e[27]!==w||e[28]!==v||e[29]!==p||e[30]!==O||e[31]!==f||e[32]!==d?(R=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(bt,{connectionIds:n,virtualMcpIds:d,tool:f,status:p,search:v,logs:w,hasMore:O,onLoadMore:k,isLoadingMore:x,connections:b,virtualMcps:u,membersData:F,client:r})})})}),e[20]=b,e[21]=u,e[22]=r,e[23]=n,e[24]=k,e[25]=x,e[26]=F,e[27]=w,e[28]=v,e[29]=p,e[30]=O,e[31]=f,e[32]=d,e[33]=R):R=e[33],R}function pr(s){return s.logs??[]}function hr(s){const e=oe.c(15),{dateRange:r}=s,{data:o,isLoading:a}=Us(void 0);let l;e[0]!==o?(l=o===void 0?[]:o,e[0]=o,e[1]=l):l=e[1];const c=l,[i,n]=K.useState(null),d=i??c[0]?.id??null,{data:f}=Ks(d??"");let p;e[2]!==r.startDate?(p=r.startDate.toISOString(),e[2]=r.startDate,e[3]=p):p=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==p||e[7]!==v?(b={startDate:p,endDate:v},e[6]=p,e[7]=v,e[8]=b):b=e[8];const u=b;let F;return e[9]!==f||e[10]!==c||e[11]!==d||e[12]!==a||e[13]!==u?(F=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(St,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:d??"",onValueChange:h=>n(h),children:[t.jsx(ot,{className:"w-72",children:t.jsx(lt,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(jr)})]})}),f?t.jsx(ms,{automationId:f.id,triggerIds:f.triggers.map(gr),range:u}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=f,e[10]=c,e[11]=d,e[12]=a,e[13]=u,e[14]=F):F=e[14],F}function gr(s){return s.id}function jr(s){return t.jsx(Re,{value:s.id,children:s.name},s.id)}const vr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Nr({connectionIds:s,virtualMcpIds:e,tool:r,status:o,hideSystem:a,propertyFilters:l,connectionOptions:c,virtualMcpOptions:i,activeFiltersCount:n,onUpdateFilters:d,onConnectionSearchChange:f,memberOptions:p,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:u}){const[F,h]=K.useState(!1),[j,m]=K.useState("form"),[C,S]=K.useState(r),[g,_]=K.useState(l),[I,x]=K.useState(Ye(l)),$=K.useRef(r),w=K.useRef(Fe(l));$.current!==r&&($.current=r,C!==r&&S(r));const D=Fe(l);w.current!==D&&(w.current=D,_(l),x(Ye(l)));const k=(y,T)=>{const L=[...g],z=L[y];z&&(L[y]={key:T.key??z.key,operator:T.operator??z.operator,value:T.value??z.value},_(L))},O=()=>{_([...g,{key:"",operator:"eq",value:""}])},R=y=>{const T=g.filter((L,z)=>z!==y);_(T),x(Ye(T)),d({propertyFilters:Fe(T)})},J=()=>{d({propertyFilters:Fe(g)})},P=()=>{const y=$t(I);_(y),d({propertyFilters:Fe(y)})},X=()=>{if(j==="raw"){const y=$t(I);_(y),m("form")}else x(Ye(g)),m("raw")};return t.jsxs(ct,{open:F,onOpenChange:h,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(Ut,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ds,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(_s,{id:"hide-system-calls",checked:a,onCheckedChange:y=>d({hideSystem:!!y})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(pt,{options:c,defaultValue:s,onValueChange:y=>d({connectionId:y}),onSearchChange:f,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(pt,{options:i,defaultValue:e,onValueChange:y=>d({virtualMcpId:y}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),u&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(pt,{options:p??[],defaultValue:v,onValueChange:y=>b?.(y),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Qe,{id:"filter-tool",placeholder:"Filter by tool...",value:C,onChange:y=>S(y.target.value),onBlur:()=>{C!==r&&d({tool:C})},onKeyDown:y=>{y.key==="Enter"&&C!==r&&d({tool:C})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:o,onValueChange:y=>d({status:y}),children:[t.jsx(ot,{className:"w-full",children:t.jsx(lt,{})}),t.jsxs(at,{children:[t.jsx(Re,{value:"all",children:"All Status"}),t.jsx(Re,{value:"success",children:"Success Only"}),t.jsx(Re,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:X,children:j==="raw"?t.jsx(ws,{size:14}):t.jsx(gs,{size:14})})}),t.jsx(st,{children:j==="raw"?"Switch to form view":"Switch to raw text"})]})]}),j==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ms,{placeholder:`Paste property filters here:
5
+ ... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Hs(s){const e=oe.c(117),{log:r}=s,[o,a]=K.useState(!1),[l,c]=K.useState(!1),i=yt(),{org:n}=Be(),d=vt(),f=Ft(r.input),p=Ft(r.output),v=Js;let b;e[0]!==r.input||e[1]!==r.output?(b=async se=>{const ee=v(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(ee),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Se.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=b):b=e[2];const u=b;let F;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(F=se=>{const ee=v(se==="input"?r.input:r.output),le=new Blob([ee],{type:"application/json"}),he=URL.createObjectURL(le),be=document.createElement("a");be.href=he,be.download=`${r.toolName}-${se}-${r.id}.json`,be.click(),URL.revokeObjectURL(he)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=F):F=e[7];const h=F;let j;e[8]!==d||e[9]!==r.connectionId||e[10]!==r.input||e[11]!==r.toolName||e[12]!==i||e[13]!==n?(j=()=>{const se=d.find(le=>le.id===r.connectionId);if(!se){Se.error("Could not find the connection for this tool call");return}const ee=crypto.randomUUID();sessionStorage.setItem(`replay-${ee}`,JSON.stringify(r.input)),i({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:n.slug,appSlug:Ut(se),collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:ee}})},e[8]=d,e[9]=r.connectionId,e[10]=r.input,e[11]=r.toolName,e[12]=i,e[13]=n,e[14]=j):j=e[14];const m=j,[C,S]=K.useState(!1);let g;e[15]!==r.requestId?(g=async()=>{try{await navigator.clipboard.writeText(r.requestId),S(!0),setTimeout(()=>S(!1),2e3)}catch{Se.error("Failed to copy to clipboard")}},e[15]=r.requestId,e[16]=g):g=e[16];const _=g;let I;e[17]!==r.timestamp?(I=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[17]=r.timestamp,e[18]=I):I=e[18];const x=I,R="text-sm px-5 md:px-6 py-5 space-y-5";let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[19]=w):w=e[19];let D;e[20]!==x?(D=t.jsxs("div",{children:[w,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[20]=x,e[21]=D):D=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[22]=k):k=e[22];let O;e[23]!==r.durationMs?(O=t.jsxs("div",{children:[k,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[23]=r.durationMs,e[24]=O):O=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[25]=$):$=e[25];let J;e[26]!==r.userName?(J=t.jsxs("div",{children:[$,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[26]=r.userName,e[27]=J):J=e[27];let A;e[28]!==r.virtualMcpName?(A=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[28]=r.virtualMcpName,e[29]=A):A=e[29];let X;e[30]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[30]=X):X=e[30];let y;e[31]!==r.requestId?(y=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[31]=r.requestId,e[32]=y):y=e[32];let T;e[33]!==C?(T=C?t.jsx(ht,{size:12}):t.jsx(Xe,{size:12}),e[33]=C,e[34]=T):T=e[34];let L;e[35]!==_||e[36]!==T?(L=t.jsx(Z,{size:"icon",variant:"ghost",onClick:_,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:T}),e[35]=_,e[36]=T,e[37]=L):L=e[37];let z;e[38]!==y||e[39]!==L?(z=t.jsxs("div",{children:[X,t.jsxs("div",{className:"flex items-center gap-1",children:[y,L]})]}),e[38]=y,e[39]=L,e[40]=z):z=e[40];let E;e[41]!==r.userAgent?(E=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[41]=r.userAgent,e[42]=E):E=e[42];let V;e[43]!==r.properties||e[44]!==i||e[45]!==n?(V=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[ee,le]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[ee,"=",le]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const he={key:ee,operator:"eq",value:le};i({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Fe([he])}})},children:[t.jsx(Vt,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${ee}=${le}`),Se.success("Copied filter to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ee),Se.success("Copied key to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(fs,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(le),Se.success("Copied value to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(hs,{size:14,className:"mr-2"}),"Copy value"]})]})})]},ee)})})]}),e[43]=r.properties,e[44]=i,e[45]=n,e[46]=V):V=e[46];let q;e[47]!==O||e[48]!==J||e[49]!==A||e[50]!==z||e[51]!==E||e[52]!==V||e[53]!==D?(q=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[D,O,J,A,z,E,V]}),e[47]=O,e[48]=J,e[49]=A,e[50]=z,e[51]=E,e[52]=V,e[53]=D,e[54]=q):q=e[54];let U;e[55]!==r.errorMessage?(U=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[55]=r.errorMessage,e[56]=U):U=e[56];const Y="space-y-4";let B;e[57]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[57]=B):B=e[57];const Q=f.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(f.originalSize)," - truncated)"]});let P;e[58]!==Q?(P=t.jsxs("div",{className:"flex items-center gap-2",children:[B,Q]}),e[58]=Q,e[59]=P):P=e[59];let N;e[60]!==m||e[61]!==r.input?(N=r.input&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:m,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(ps,{size:14})})}),t.jsx(st,{children:"Replay tool call"})]}),e[60]=m,e[61]=r.input,e[62]=N):N=e[62];let M;e[63]!==h||e[64]!==f?(M=f.isTruncated&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Dt,{size:14})})}),t.jsx(st,{children:"Download full input"})]}),e[63]=h,e[64]=f,e[65]=M):M=e[65];let H;e[66]!==u?(H=()=>u("input"),e[66]=u,e[67]=H):H=e[67];let te;e[68]!==o?(te=o?t.jsx(ht,{size:14}):t.jsx(Xe,{size:14}),e[68]=o,e[69]=te):te=e[69];let G;e[70]!==H||e[71]!==te?(G=t.jsx(Z,{size:"icon",variant:"ghost",onClick:H,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:te}),e[70]=H,e[71]=te,e[72]=G):G=e[72];let re;e[73]!==N||e[74]!==M||e[75]!==G?(re=t.jsxs("div",{className:"flex items-center gap-1",children:[N,M,G]}),e[73]=N,e[74]=M,e[75]=G,e[76]=re):re=e[76];let W;e[77]!==P||e[78]!==re?(W=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[P,re]}),e[77]=P,e[78]=re,e[79]=W):W=e[79];let ne;e[80]!==f?(ne=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Lt,{code:f.content,language:"json",height:"100%",readOnly:!0})}),e[80]=f,e[81]=ne):ne=e[81];let ce;e[82]!==W||e[83]!==ne?(ce=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[W,ne]})}),e[82]=W,e[83]=ne,e[84]=ce):ce=e[84];const ze="rounded-lg overflow-hidden border border-border",Ie="flex items-center justify-between p-1 pl-4 border-b border-border",Ce="flex items-center gap-2";let ie;e[85]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[85]=ie):ie=e[85];const Le=p.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(p.originalSize)," - truncated)"]});let ge;e[86]!==ie||e[87]!==Le?(ge=t.jsxs("div",{className:Ce,children:[ie,Le]}),e[86]=ie,e[87]=Le,e[88]=ge):ge=e[88];let je;e[89]!==h||e[90]!==p.isTruncated?(je=p.isTruncated&&t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Dt,{size:14})})}),t.jsx(st,{children:"Download full output"})]}),e[89]=h,e[90]=p.isTruncated,e[91]=je):je=e[91];let ve;e[92]!==u?(ve=()=>u("output"),e[92]=u,e[93]=ve):ve=e[93];let me;e[94]!==l?(me=l?t.jsx(ht,{size:14}):t.jsx(Xe,{size:14}),e[94]=l,e[95]=me):me=e[95];let Ne;e[96]!==ve||e[97]!==me?(Ne=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:me}),e[96]=ve,e[97]=me,e[98]=Ne):Ne=e[98];let ue;e[99]!==je||e[100]!==Ne?(ue=t.jsxs("div",{className:"flex items-center gap-1",children:[je,Ne]}),e[99]=je,e[100]=Ne,e[101]=ue):ue=e[101];let xe;e[102]!==ge||e[103]!==ue?(xe=t.jsxs("div",{className:Ie,children:[ge,ue]}),e[102]=ge,e[103]=ue,e[104]=xe):xe=e[104];let fe;e[105]!==p.content?(fe=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(Lt,{code:p.content,language:"json",height:"100%",readOnly:!0})}),e[105]=p.content,e[106]=fe):fe=e[106];let pe;e[107]!==xe||e[108]!==fe?(pe=t.jsx("div",{children:t.jsxs("div",{className:ze,children:[xe,fe]})}),e[107]=xe,e[108]=fe,e[109]=pe):pe=e[109];let ke;e[110]!==ce||e[111]!==pe?(ke=t.jsxs("div",{className:Y,children:[ce,pe]}),e[110]=ce,e[111]=pe,e[112]=ke):ke=e[112];let we;return e[113]!==q||e[114]!==U||e[115]!==ke?(we=t.jsxs("div",{className:R,children:[q,U,ke]}),e[113]=q,e[114]=U,e[115]=ke,e[116]=we):we=e[116],we}function Js(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Qs={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const o=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:o,unit:a}}function ye(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const o=Yt(e);if(!o)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,l=new Date(a);if(o.offset===0||!o.unit)return{valid:!0,date:l};switch(o.unit){case"m":l.setMinutes(l.getMinutes()-o.offset);break;case"h":l.setHours(l.getHours()-o.offset);break;case"d":l.setDate(l.getDate()-o.offset);break;case"w":l.setDate(l.getDate()-o.offset*7);break;case"M":l.setMonth(l.getMonth()-o.offset);break}return{valid:!0,date:l}}function Gs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function $t(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const l=ye(e);return l.valid&&l.date?Gs(l.date):e}const o=Qs[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${o}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Ws(s,e){const r=es.find(o=>o.from===s&&o.to===e);return r?r.label:`${$t(s)} to ${$t(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),o=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),l=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${o} ${a}:${l}:${c}`}function Xs(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,o,a,l,c,i]=e,n=new Date(Number(r),Number(o)-1,Number(a),Number(l),Number(c),Number(i));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=ye(s);return e.valid&&e.date?Je(e.date):s}function zt({value:s,onChange:e,placeholder:r="now or now-2d",className:o,disabled:a,error:l}){const[c,i]=K.useState(!1),[n,d]=K.useState(()=>gt(s)),[f,p]=K.useState(),[v,b]=K.useState(!1),u=K.useRef(s);u.current!==s&&(u.current=s,v||d(gt(s)));const F=x=>{const R=x.target.value;d(R),p(void 0)},h=()=>{b(!0)},j=()=>{b(!1);const x=n.trim();if(Zt(x)){p(void 0),e(x);return}const R=Xs(x);if(R){p(void 0),e(R.toISOString()),d(Je(R));return}const w=ye(x);if(w.valid&&w.date){p(void 0),e(x),d(Je(w.date));return}d(gt(s)),p(void 0)},m=x=>{if(x){const w=ye(s).date||new Date;x.setHours(w.getHours()),x.setMinutes(w.getMinutes()),x.setSeconds(0),x.setMilliseconds(0);const D=x.toISOString();d(Je(x)),e(D),p(void 0)}i(!1)},C=x=>{const[R,w]=x.target.value.split(":").map(Number),k=ye(s).date||new Date;k.setHours(R||0),k.setMinutes(w||0),k.setSeconds(0),k.setMilliseconds(0);const O=k.toISOString();d(Je(k)),e(O)},S=ye(s),g=S.valid?S.date:new Date,_=g?`${String(g.getHours()).padStart(2,"0")}:${String(g.getMinutes()).padStart(2,"0")}`:"",I=l||f;return t.jsxs("div",{className:de("flex gap-1",o),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Qe,{value:n,onChange:F,onFocus:h,onBlur:j,placeholder:r,disabled:a,className:de("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:i,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(Ts,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(ks,{mode:"single",selected:g||void 0,onSelect:m,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Qe,{type:"time",value:_,onChange:C,className:"text-sm h-8"})]})]})]})]})}function Ys({value:s,onChange:e,className:r,disabled:o,quickRanges:a=es}){const[l,c]=K.useState(!1),[i,n]=K.useState(s.from),[d,f]=K.useState(s.to),[p,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),f(s.to));const u=m=>{b.current={from:m.from,to:m.to},n(m.from),f(m.to),c(!1),e({from:m.from,to:m.to})},F=()=>{const m=ye(i),C=ye(d);if(!m.valid||!m.date){v("Invalid 'From' date");return}if(!C.valid||!C.date){v("Invalid 'To' date");return}if(m.date>=C.date){v("'From' must be before 'To'");return}v(null),e({from:i,to:d}),c(!1)},h=m=>s.from===m.from&&s.to===m.to,j=Ws(s.from,s.to);return t.jsxs(ct,{open:l,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:de("gap-1.5 min-w-[160px] justify-between",r),disabled:o,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Cs,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:j})]}),t.jsx(Kt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:m=>m.preventDefault(),style:l?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(zt,{value:i,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(zt,{value:d,onChange:f,placeholder:"now"})]}),p&&t.jsx("p",{className:"text-xs text-destructive",children:p}),t.jsx(Z,{onClick:F,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(m=>{const C=h(m);return t.jsx("button",{type:"button",onClick:()=>u(m),className:de("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",C&&"bg-accent text-accent-foreground font-medium"),children:m.label},m.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){return await s.call("MONITORING_STATS",e)}function Zs(s,e){const r=oe.c(12),{org:o}=Be(),a=Jt();let l,c,i;r[0]!==o.id||r[1]!==s?(i={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},c=wt,l=it.monitoringStatsToolCalls(o.id,JSON.stringify(i)),r[0]=o.id,r[1]=s,r[2]=l,r[3]=c,r[4]=i):(l=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==l||r[10]!==n?(d={queryKey:l,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=l,r[10]=n,r[11]=d):d=r[11],c(d)}function er(s,e){const r=oe.c(12),{org:o}=Be(),a=Jt();let l,c,i;r[0]!==o.id||r[1]!==s?(i={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},c=wt,l=it.monitoringStatsLlm(o.id,JSON.stringify(i)),r[0]=o.id,r[1]=s,r[2]=l,r[3]=c,r[4]=i):(l=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==l||r[10]!==n?(d={queryKey:l,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=l,r[10]=n,r[11]=d):d=r[11],c(d)}function _e(s){const e=oe.c(20),{title:r,value:o,action:a,children:l,className:c}=s;let i;e[0]!==c?(i=de("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=i):i=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let d;e[4]!==o?(d=t.jsx("span",{className:"text-4xl font-normal",children:o}),e[4]=o,e[5]=d):d=e[5];let f;e[6]!==n||e[7]!==d?(f=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,d]}),e[6]=n,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==a?(p=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=p):p=e[10];let v;e[11]!==f||e[12]!==p?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[f,p]}),e[11]=f,e[12]=p,e[13]=v):v=e[13];let b;e[14]!==l?(b=l&&t.jsx("div",{className:"flex flex-col gap-6",children:l}),e[14]=l,e[15]=b):b=e[15];let u;return e[16]!==i||e[17]!==v||e[18]!==b?(u=t.jsxs(Ht,{className:i,children:[v,b]}),e[16]=i,e[17]=v,e[18]=b,e[19]=u):u=e[19],u}function jt(s){const e=oe.c(14),{metrics:r,connections:o,mode:a,total:l}=s,{org:c}=Be(),i=yt();let n,d,f;if(e[0]!==o||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==c||e[5]!==l){f=Symbol.for("react.early_return_sentinel");e:{const v=o??[],b=new Map(r.map(sr));let u;e[9]!==a?(u=(h,j)=>{const m=_t(h.metric,a);return _t(j.metric,a)-m},e[9]=a,e[10]=u):u=e[10];const F=v.map(h=>({connection:h,metric:b.get(h.id)})).filter(tr).sort(u).slice(0,4);if(F.length===0){f=null;break e}n="flex flex-col",d=F.map((h,j)=>{const{connection:m,metric:C}=h,S=l>0?(C.calls/l*100).toFixed(1):"0.0",g=a==="errors"?`${C.errorRate.toFixed(1)}%`:`${S}%`,_=j===F.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!_&&"border-b border-border/50"),onClick:()=>i({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Ut(m)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:m.icon,name:m.title,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:m.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:g}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:ds(C,a)})]})]},m.id)})}e[0]=o,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=l,e[6]=n,e[7]=d,e[8]=f}else n=e[6],d=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;return e[11]!==n||e[12]!==d?(p=t.jsx("div",{className:n,children:d}),e[11]=n,e[12]=d,e[13]=p):p=e[13],p}function tr(s){return s.metric}function sr(s){return[s.connectionId,s]}const Ot=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Et(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Ot[e%Ot.length]}function He(s){const e=oe.c(21),{models:r,mode:o}=s,a=o===void 0?"calls":o;if(r.length===0)return null;let l;e[0]!==a?(l=u=>a==="tokens"?(u.inputTokens??0)+(u.outputTokens??0):a==="cost"?u.costUsd??0:u.calls,e[0]=a,e[1]=l):l=e[1];const c=l;let i;e[2]!==a?(i=u=>a==="cost"?At(u):a==="tokens"?Ze(u):u.toLocaleString(),e[2]=a,e[3]=i):i=e[3];const n=i;let d;e[4]!==c?(d=(u,F)=>u+c(F),e[4]=c,e[5]=d):d=e[5];const f=r.reduce(d,0);let p,v;if(e[6]!==n||e[7]!==r||e[8]!==f||e[9]!==c){let u;e[12]!==c?(u=(j,m)=>c(m)-c(j),e[12]=c,e[13]=u):u=e[13];const F=[...r].sort(u).slice(0,4);p="flex flex-col";let h;e[14]!==n||e[15]!==f||e[16]!==c?(h=(j,m,C)=>{const S=c(j),g=f>0?(S/f*100).toFixed(1):"0.0",_=m===C.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3",!_&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Et(j.toolName)} 18%, transparent)`},children:t.jsx(Ge,{size:14,style:{color:Et(j.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:j.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[g,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},j.toolName)},e[14]=n,e[15]=f,e[16]=c,e[17]=h):h=e[17],v=F.map(h),e[6]=n,e[7]=r,e[8]=f,e[9]=c,e[10]=p,e[11]=v}else p=e[10],v=e[11];let b;return e[18]!==p||e[19]!==v?(b=t.jsx("div",{className:p,children:v}),e[18]=p,e[19]=v,e[20]=b):b=e[20],b}function rr(s){const e=oe.c(48),{displayDateRange:r,connectionIds:o,excludeConnectionIds:a,toolName:l,status:c,connections:i,isStreaming:n,streamingRefetchInterval:d,llmUserIds:f}=s,p=cs(r),v=n?d:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:u,isError:F}=Zs({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:o.length>0?o:void 0,excludeConnectionIds:a,toolNames:l?[l]:void 0,status:c},b);let h;e[2]!==v?(h={refetchInterval:v},e[2]=v,e[3]=h):h=e[3];const{data:j,isError:m}=er({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:f?.length?f:void 0},h),C=F||m,S=u?{totalCalls:u.totalCalls,totalErrors:u.totalErrors,avgDurationMs:u.avgDurationMs,p95DurationMs:u.p95DurationMs,data:Mt(u.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},g=j?{totalCalls:j.totalCalls,totalErrors:j.totalErrors,avgDurationMs:j.avgDurationMs,p95DurationMs:j.p95DurationMs,data:Mt(j.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let _;e[4]!==j?.topTools?(_=j?.topTools??[],e[4]=j?.topTools,e[5]=_):_=e[5];const I=_,x=j?.totalInputTokens??0,R=j?.totalOutputTokens??0,w=j?.totalTokens??0,D=j?.totalCostUsd??0;let k;e[6]!==u?.connectionBreakdown?(k=u?.connectionBreakdown??[],e[6]=u?.connectionBreakdown,e[7]=k):k=e[7];const O=k,[$,J]=K.useState("avg");let A;e[8]!==C?(A=C&&t.jsxs(Ls,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Rs,{children:"Failed to load monitoring data"}),t.jsx(Fs,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=C,e[9]=A):A=e[9];let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=ce=>J(ce),e[10]=X):X=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ot,{className:"w-[120px]",children:t.jsx(lt,{})}),e[11]=y):y=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(at,{children:[t.jsx($e,{value:"avg",children:"Avg"}),t.jsx($e,{value:"p95",children:"P95"})]}),e[12]=T):T=e[12];let L;e[13]!==$?(L=t.jsxs(nt,{value:$,onValueChange:X,children:[y,T]}),e[13]=$,e[14]=L):L=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=z):z=e[15];let E;e[16]!==I?(E=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=E):E=e[17];let V;e[18]!==w?(V=Ze(w),e[18]=w,e[19]=V):V=e[19];let q;e[20]!==x?(q=Ze(x),e[20]=x,e[21]=q):q=e[21];let U;e[22]!==R?(U=Ze(R),e[22]=R,e[23]=U):U=e[23];let Y;e[24]!==q||e[25]!==U?(Y=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",U," out"]}),e[24]=q,e[25]=U,e[26]=Y):Y=e[26];let B;e[27]!==I?(B=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=B):B=e[28];let Q;e[29]!==D?(Q=D>0?At(D):"—",e[29]=D,e[30]=Q):Q=e[30];let P;e[31]!==D?(P=D===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=D,e[32]=P):P=e[32];let N;e[33]!==I||e[34]!==D?(N=D>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=D,e[35]=N):N=e[35];let M;e[36]!==I?(M=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=M):M=e[37];const H=_e,te="AI Errors",G=g.totalErrors.toLocaleString();let re;e[38]!==g.data?(re=t.jsx(Me,{data:g.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=g.data,e[39]=re):re=e[39];let W;e[40]!==I||e[41]!==g.totalErrors?(W=g.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=g.totalErrors,e[42]=W):W=e[42];let ne;return e[43]!==H||e[44]!==G||e[45]!==re||e[46]!==W?(ne=t.jsxs(H,{title:te,value:G,children:[re,W]}),e[43]=H,e[44]=G,e[45]=re,e[46]=W,e[47]=ne):ne=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[A,t.jsxs(_e,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:O,connections:i,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"Latency",value:ft($==="avg"?S.avgDurationMs:S.p95DurationMs),action:L,children:[t.jsx(Me,{data:S.data,dataKey:$,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:O,connections:i,mode:"latency",total:S.totalCalls})]}),t.jsxs(_e,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:O,connections:i,mode:"errors",total:S.totalErrors})]})]}),z,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(_e,{title:"AI Calls",value:g.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:g.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),E]}),t.jsxs(_e,{title:"Tokens",value:V,action:Y,children:[t.jsx(Me,{data:g.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),B]}),t.jsxs(_e,{title:"Cost",value:Q,action:P,children:[t.jsx(Me,{data:g.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"AI Latency",value:ft(g.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",ft(g.p95DurationMs)]}),children:[t.jsx(Me,{data:g.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),M]}),ne]})]})}function Ke(s){const e=oe.c(8),{className:r}=s;let o;e[0]!==r?(o=de("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=l):l=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(or),e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-6",children:[l,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=i):i=e[5];let n;return e[6]!==o?(n=t.jsxs(Ht,{className:o,children:[a,i]}),e[6]=o,e[7]=n):n=e[7],n}function or(s,e){return t.jsxs("div",{className:de("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function lr(){const s=oe.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,o;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),o=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=o):(r=s[1],o=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function ar(s){const e=oe.c(46),{log:r,connection:o,virtualMcpName:a,virtualMcpIcon:l,onClick:c,lastLogRef:i}=s;let n,d;if(e[0]!==r.timestamp){const $=new Date(r.timestamp);n=$.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=$.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=d}else n=e[1],d=e[2];const f=d,p=o?.icon||null,v=o?.title??r.connectionId;let b;e[3]!==p||e[4]!==v?(b=t.jsx(Re,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:p,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=p,e[4]=v,e[5]=b):b=e[5];let u;e[6]!==r.toolName?(u=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=u):u=e[7];const F=o?.title??r.connectionId;let h;e[8]!==F?(h=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:F}),e[8]=F,e[9]=h):h=e[9];let j;e[10]!==u||e[11]!==h?(j=t.jsxs(Re,{className:"min-w-0 pr-2 md:pr-4",children:[u,h]}),e[10]=u,e[11]=h,e[12]=j):j=e[12];let m;e[13]!==l||e[14]!==a?(m=t.jsx(Re,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:l,name:a,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=l,e[14]=a,e[15]=m):m=e[15];let C;e[16]!==r.userImage||e[17]!==r.userName?(C=t.jsx(Bt,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=C):C=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let g;e[21]!==C||e[22]!==S?(g=t.jsx(Re,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,S]})}),e[21]=C,e[22]=S,e[23]=g):g=e[23];let _;e[24]!==n?(_=t.jsx("div",{children:n}),e[24]=n,e[25]=_):_=e[25];let I;e[26]!==f?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:f}),e[26]=f,e[27]=I):I=e[27];let x;e[28]!==_||e[29]!==I?(x=t.jsxs(Re,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[_,I]}),e[28]=_,e[29]=I,e[30]=x):x=e[30];let R;e[31]!==r.durationMs?(R=t.jsxs(Re,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=R):R=e[32];const w=r.isError?"destructive":"success",D=r.isError?"Error":"OK";let k;e[33]!==w||e[34]!==D?(k=t.jsx(Re,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:w,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:D})})}),e[33]=w,e[34]=D,e[35]=k):k=e[35];let O;return e[36]!==i||e[37]!==c||e[38]!==g||e[39]!==x||e[40]!==R||e[41]!==k||e[42]!==b||e[43]!==j||e[44]!==m?(O=t.jsxs(ut,{ref:i,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,j,m,g,x,R,k]}),e[36]=i,e[37]=c,e[38]=g,e[39]=x,e[40]=R,e[41]=k,e[42]=b,e[43]=j,e[44]=m,e[45]=O):O=e[45],O}function nr(s){const e=oe.c(26),{connectionIds:r,virtualMcpIds:o,tool:a,status:l,search:c,logs:i,hasMore:n,onLoadMore:d,isLoadingMore:f,connections:p,virtualMcps:v,membersData:b,client:u}=s,F=p??[],h=v??[],[j,m]=K.useState(null),C=Us(d,n,f),S=Pt(b),g=new Map(S.map(mr)),_=new Map(h.map(dr));let x=i.map(N=>{const M=g.get(N.userId??""),H=N.virtualMcpId?_.get(N.virtualMcpId):null;return{...N,userName:M?.name??N.userId??"Unknown",userImage:M?.image??void 0,virtualMcpName:H?.title??null,virtualMcpIcon:H?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=M=>r.includes(M.connectionId),e[0]=r,e[1]=N):N=e[1],x=x.filter(N)}if(o.length>1){let N;e[2]!==o?(N=M=>M.virtualMcpId&&o.includes(M.virtualMcpId),e[2]=o,e[3]=N):N=e[3],x=x.filter(N)}const R=new Map(F.map(cr));if(c){const N=c.toLowerCase();x=x.filter(M=>M.toolName.toLowerCase().includes(N)||(R.get(M.connectionId)?.title??M.connectionId).toLowerCase().includes(N)||M.errorMessage?.toLowerCase().includes(N))}const w=j!==null?x[j]??null:null,D=wt({queryKey:it.monitoringLogDetail(w?.id??""),queryFn:async()=>{if(!u)throw new Error("MCP client is not available");const N=await u.callTool({name:"MONITORING_LOG_GET",arguments:{id:w.id}});return N.structuredContent??N},enabled:w!==null}),k=D.data?.log,O=w&&k?{...w,input:k.input,output:k.output}:w;if(x.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const M=c||r.length>0||o.length>0||a||l!=="all"?"No logs match your filters":"No logs found in this time range";let H;return e[5]!==M?(H=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(St,{image:N,title:"No logs found",description:M})}),e[5]=M,e[6]=H):H=e[6],H}const $="flex-1 flex flex-col min-w-0",J="flex-1 min-w-0 pt-1",A="min-w-[600px] md:min-w-0",X=Gt,y="w-full border-collapse";let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(ae,{className:"w-5"}),t.jsx(ae,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(ae,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(ae,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[7]=T):T=e[7];const L=Qt,z=x.map((N,M)=>t.jsx(ar,{log:N,connection:R.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>m(M),lastLogRef:M===x.length-1?C:void 0},N.id));let E;e[8]!==L||e[9]!==z?(E=t.jsx(L,{children:z}),e[8]=L,e[9]=z,e[10]=E):E=e[10];let V;e[11]!==X||e[12]!==T||e[13]!==E?(V=t.jsx("div",{className:J,children:t.jsx("div",{className:A,children:t.jsxs(X,{className:y,children:[T,E]})})}),e[11]=X,e[12]=T,e[13]=E,e[14]=V):V=e[14];const q=j!==null;let U;e[15]!==m?(U=N=>{N||m(null)},e[15]=m,e[16]=U):U=e[16];const Y=w&&j!==null&&t.jsxs(t.Fragment,{children:[t.jsx(zs,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:R.get(w.connectionId)?.icon||null,name:R.get(w.connectionId)?.title??w.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Os,{className:"text-sm leading-snug truncate",children:w.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:R.get(w.connectionId)?.title??w.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(ir),disabled:j===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(Ps,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(N=>N!==null&&N<x.length-1?N+1:N),disabled:j===x.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(Kt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:D.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):D.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>D.refetch(),children:"Retry"})]}):t.jsx(Hs,{log:O})})]});let B;e[17]!==Y?(B=t.jsx(Es,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:Y}),e[17]=Y,e[18]=B):B=e[18];let Q;e[19]!==U||e[20]!==B||e[21]!==q?(Q=t.jsx(As,{open:q,onOpenChange:U,children:B}),e[19]=U,e[20]=B,e[21]=q,e[22]=Q):Q=e[22];let P;return e[23]!==Q||e[24]!==V?(P=t.jsxs("div",{className:$,children:[V,Q]}),e[23]=Q,e[24]=V,e[25]=P):P=e[25],P}function ir(s){return s!==null&&s>0?s-1:s}function cr(s){return[s.id,s]}function dr(s){return[s.id,s]}function mr(s){return[s.userId,s.user]}function ur(){const s=oe.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ae,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ae,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ae,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=o):o=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ae,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let l;s[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=l):l=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let i;s[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,o,a,l,c,t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=i):i=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Gt,{className:"w-full border-collapse",children:[i,t.jsx(Qt,{children:Array.from({length:8}).map(xr)})]})})}),s[7]=n):n=s[7],n}function xr(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const bt=Object.assign(nr,{Skeleton:ur});function fr(s){const e=oe.c(34),{client:r,locator:o,baseParams:a,pageSize:l,isStreaming:c,streamingRefetchInterval:i,connectionIds:n,virtualMcpIds:d,tool:f,status:p,searchQuery:v,allConnections:b,allVirtualMcps:u,membersData:F}=s;let h;e[0]!==a||e[1]!==o?(h=it.monitoringLogsInfinite(o,JSON.stringify(a)),e[0]=a,e[1]=o,e[2]=h):h=e[2];let j;e[3]!==a||e[4]!==r||e[5]!==l?(j=async J=>{const{pageParam:A}=J,X=A===void 0?0:A;if(!r)throw new Error("MCP client is not available");const y=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:l,offset:X}});return y.structuredContent??y},e[3]=a,e[4]=r,e[5]=l,e[6]=j):j=e[6];let m;e[7]!==l?(m=(J,A)=>{if(!((J?.logs?.length??0)<l))return A.length*l},e[7]=l,e[8]=m):m=e[8];const C=c?i:!1;let S;e[9]!==h||e[10]!==j||e[11]!==m||e[12]!==C?(S={queryKey:h,queryFn:j,initialPageParam:0,getNextPageParam:m,staleTime:0,refetchInterval:C},e[9]=h,e[10]=j,e[11]=m,e[12]=C,e[13]=S):S=e[13];const{data:g,fetchNextPage:_,hasNextPage:I,isFetchingNextPage:x}=$s(S);let R;e[14]!==g.pages?(R=g.pages.flatMap(pr),e[14]=g.pages,e[15]=R):R=e[15];const w=R;let D;e[16]!==_||e[17]!==I||e[18]!==x?(D=()=>{I&&!x&&_()},e[16]=_,e[17]=I,e[18]=x,e[19]=D):D=e[19];const k=D,O=I??!1;let $;return e[20]!==b||e[21]!==u||e[22]!==r||e[23]!==n||e[24]!==k||e[25]!==x||e[26]!==F||e[27]!==w||e[28]!==v||e[29]!==p||e[30]!==O||e[31]!==f||e[32]!==d?($=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(bt,{connectionIds:n,virtualMcpIds:d,tool:f,status:p,search:v,logs:w,hasMore:O,onLoadMore:k,isLoadingMore:x,connections:b,virtualMcps:u,membersData:F,client:r})})})}),e[20]=b,e[21]=u,e[22]=r,e[23]=n,e[24]=k,e[25]=x,e[26]=F,e[27]=w,e[28]=v,e[29]=p,e[30]=O,e[31]=f,e[32]=d,e[33]=$):$=e[33],$}function pr(s){return s.logs??[]}function hr(s){const e=oe.c(15),{dateRange:r}=s,{data:o,isLoading:a}=Vs(void 0);let l;e[0]!==o?(l=o===void 0?[]:o,e[0]=o,e[1]=l):l=e[1];const c=l,[i,n]=K.useState(null),d=i??c[0]?.id??null,{data:f}=Ks(d??"");let p;e[2]!==r.startDate?(p=r.startDate.toISOString(),e[2]=r.startDate,e[3]=p):p=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==p||e[7]!==v?(b={startDate:p,endDate:v},e[6]=p,e[7]=v,e[8]=b):b=e[8];const u=b;let F;return e[9]!==f||e[10]!==c||e[11]!==d||e[12]!==a||e[13]!==u?(F=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(St,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:d??"",onValueChange:h=>n(h),children:[t.jsx(ot,{className:"w-72",children:t.jsx(lt,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(jr)})]})}),f?t.jsx(ms,{automationId:f.id,triggerIds:f.triggers.map(gr),range:u}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=f,e[10]=c,e[11]=d,e[12]=a,e[13]=u,e[14]=F):F=e[14],F}function gr(s){return s.id}function jr(s){return t.jsx($e,{value:s.id,children:s.name},s.id)}const vr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Nr({connectionIds:s,virtualMcpIds:e,tool:r,status:o,hideSystem:a,propertyFilters:l,connectionOptions:c,virtualMcpOptions:i,activeFiltersCount:n,onUpdateFilters:d,onConnectionSearchChange:f,memberOptions:p,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:u}){const[F,h]=K.useState(!1),[j,m]=K.useState("form"),[C,S]=K.useState(r),[g,_]=K.useState(l),[I,x]=K.useState(Ye(l)),R=K.useRef(r),w=K.useRef(Fe(l));R.current!==r&&(R.current=r,C!==r&&S(r));const D=Fe(l);w.current!==D&&(w.current=D,_(l),x(Ye(l)));const k=(y,T)=>{const L=[...g],z=L[y];z&&(L[y]={key:T.key??z.key,operator:T.operator??z.operator,value:T.value??z.value},_(L))},O=()=>{_([...g,{key:"",operator:"eq",value:""}])},$=y=>{const T=g.filter((L,z)=>z!==y);_(T),x(Ye(T)),d({propertyFilters:Fe(T)})},J=()=>{d({propertyFilters:Fe(g)})},A=()=>{const y=Rt(I);_(y),d({propertyFilters:Fe(y)})},X=()=>{if(j==="raw"){const y=Rt(I);_(y),m("form")}else x(Ye(g)),m("raw")};return t.jsxs(ct,{open:F,onOpenChange:h,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(Vt,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ds,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(_s,{id:"hide-system-calls",checked:a,onCheckedChange:y=>d({hideSystem:!!y})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(pt,{options:c,defaultValue:s,onValueChange:y=>d({connectionId:y}),onSearchChange:f,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(pt,{options:i,defaultValue:e,onValueChange:y=>d({virtualMcpId:y}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),u&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(pt,{options:p??[],defaultValue:v,onValueChange:y=>b?.(y),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Qe,{id:"filter-tool",placeholder:"Filter by tool...",value:C,onChange:y=>S(y.target.value),onBlur:()=>{C!==r&&d({tool:C})},onKeyDown:y=>{y.key==="Enter"&&C!==r&&d({tool:C})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:o,onValueChange:y=>d({status:y}),children:[t.jsx(ot,{className:"w-full",children:t.jsx(lt,{})}),t.jsxs(at,{children:[t.jsx($e,{value:"all",children:"All Status"}),t.jsx($e,{value:"success",children:"Success Only"}),t.jsx($e,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(et,{children:[t.jsx(tt,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:X,children:j==="raw"?t.jsx(ws,{size:14}):t.jsx(gs,{size:14})})}),t.jsx(st,{children:j==="raw"?"Switch to form view":"Switch to raw text"})]})]}),j==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ms,{placeholder:`Paste property filters here:
6
6
  thread_id=abc123
7
7
  user~test
8
- debug?`,value:I,onChange:y=>x(y.target.value),onBlur:P,onKeyDown:y=>{y.key==="Enter"&&y.metaKey&&P()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[g.map((y,T)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>R(T),children:t.jsx(Is,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Qe,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Fe(z)}))},children:[t.jsx(ot,{className:"w-28",children:t.jsx(lt,{})}),t.jsx(at,{children:vr.map(L=>t.jsx(Re,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Qe,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(Ss,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=oe.c(113),{tab:r,dateRange:o,displayDateRange:a,connectionIds:l,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:F,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=Ns(),{data:_}=js(),[I,x]=K.useState(""),$=I||void 0;let w;e[0]!==$?(w={searchTerm:$},e[0]=$,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const R=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const P=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:bs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=vs(z);let U;e[11]!==F?(U=Bs(F),e[11]=F,e[12]=U):U=e[12];const q=U;let V;e[13]!==p||e[14]!==T.id?(V=p?[ys.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=V):V=e[15];const Y=V;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[Q,A]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[G,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(G.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=At(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==o.startDate?(Ce=o.startDate.toISOString(),e[21]=o.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==o.endDate?(ie=o.endDate.toISOString(),e[23]=o.endDate,e[24]=ie):ie=e[24];const Le=l.length===1?l[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Threads"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let le;e[44]!==v||e[45]!==l||e[46]!==R||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==Q||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==F||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==P?(le=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:l,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:F,connectionOptions:R,virtualMcpOptions:P,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:Q,onLlmUserIdsChange:A,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=l,e[46]=R,e[47]=I,e[48]=p,e[49]=f,e[50]=Q,e[51]=Ie,e[52]=m,e[53]=h,e[54]=F,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=P,e[60]=le):le=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==G||e[67]!==P?(he=r==="threads"&&t.jsx(us,{filterAgentIds:M,filterUserIds:G,filterStatus:W,virtualMcpOptions:P,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=G,e[67]=P,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==le||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[le,he,Oe]}),e[75]=le,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ee||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==h||e[83]!==d||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==l||e[94]!==o||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==Q||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==G||e[107]!==i||e[108]!==c?(Ue=r==="automations"?t.jsx(hr,{dateRange:o}):r==="threads"?t.jsx(xs,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:o,searchQuery:d,filterAgentIds:M,filterUserIds:G,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:l,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:l,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:Q})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=l,e[94]=o,e[95]=a,e[96]=Y,e[97]=f,e[98]=Q,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=G,e[107]=i,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:o=>{const{className:a}=o;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Super Agent";return{value:s.id??"",label:r,icon:o=>{const{className:a}=o;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:o=>{const{className:a}=o;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Ol(){const s=oe.c(83),{org:e}=Be(),r=yt();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/monitor"},s[0]=o):o=s[0];const a=os(o),{tab:l,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:F}=a,h=l===void 0?"overview":l;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=F===void 0?!1:F;let x,$,w,D,k,O,R;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let A;s[24]!==r||s[25]!==e.slug||s[26]!==a?(A=G=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...G}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=A):A=s[27],R=A;let N;s[28]!==R?(N=G=>{R({from:G.from,to:G.to})},s[28]=R,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const G=ye(c),re=ye(i);H=G.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],$=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=$,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=R}else x=s[17],$=s[18],w=s[19],D=s[20],k=s[21],O=s[22],R=s[23];const J=O;J.length>0&&(x=x+J.length);let P;s[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=P):P=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[P,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==R?(L=A=>R({tab:A}),s[43]=R,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(lr,{})}),s[48]=h,s[49]=E):E=s[49];let U;s[50]!==z||s[51]!==E?(U=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=U):U=s[52];let q;s[53]!==D?(q=A=>{xt("monitoring_time_range_changed",{from:A.from,to:A.to}),D(A)},s[53]=D,s[54]=q):q=s[54];let V;s[55]!==g||s[56]!==R?(V=()=>{xt("monitoring_live_toggled",{enabled:!g}),R({streaming:!g})},s[55]=g,s[56]=R,s[57]=V):V=s[57];let Y;s[58]!==h||s[59]!==R?(Y=A=>{A!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:A}),R({tab:A})},s[58]=h,s[59]=R,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==$||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==V||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==R||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:$,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:R,onTimeRangeChange:q,onStreamingToggle:V,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=$,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=V,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=R,s[78]=S,s[79]=B):B=s[79];let Q;return s[80]!==U||s[81]!==B?(Q=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(ls,{fallback:X,children:t.jsx(K.Suspense,{fallback:U,children:B})})})}),s[80]=U,s[81]=B,s[82]=Q):Q=s[82],Q}function Ir(s){return s.key.trim()}export{Ol as default};
8
+ debug?`,value:I,onChange:y=>x(y.target.value),onBlur:A,onKeyDown:y=>{y.key==="Enter"&&y.metaKey&&A()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[g.map((y,T)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>$(T),children:t.jsx(Is,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Qe,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Fe(z)}))},children:[t.jsx(ot,{className:"w-28",children:t.jsx(lt,{})}),t.jsx(at,{children:vr.map(L=>t.jsx($e,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Qe,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(Ss,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=oe.c(113),{tab:r,dateRange:o,displayDateRange:a,connectionIds:l,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:F,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=Ns(),{data:_}=js(),[I,x]=K.useState(""),R=I||void 0;let w;e[0]!==R?(w={searchTerm:R},e[0]=R,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const $=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const A=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:bs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=vs(z);let V;e[11]!==F?(V=Bs(F),e[11]=F,e[12]=V):V=e[12];const q=V;let U;e[13]!==p||e[14]!==T.id?(U=p?[ys.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=U):U=e[15];const Y=U;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[Q,P]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[G,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(G.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=Pt(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==o.startDate?(Ce=o.startDate.toISOString(),e[21]=o.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==o.endDate?(ie=o.endDate.toISOString(),e[23]=o.endDate,e[24]=ie):ie=e[24];const Le=l.length===1?l[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Threads"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let le;e[44]!==v||e[45]!==l||e[46]!==$||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==Q||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==F||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==A?(le=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:l,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:F,connectionOptions:$,virtualMcpOptions:A,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:Q,onLlmUserIdsChange:P,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=l,e[46]=$,e[47]=I,e[48]=p,e[49]=f,e[50]=Q,e[51]=Ie,e[52]=m,e[53]=h,e[54]=F,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=A,e[60]=le):le=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==G||e[67]!==A?(he=r==="threads"&&t.jsx(us,{filterAgentIds:M,filterUserIds:G,filterStatus:W,virtualMcpOptions:A,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=G,e[67]=A,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==le||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[le,he,Oe]}),e[75]=le,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Ae;e[79]!==ee||e[80]!==Ee?(Ae=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Ae):Ae=e[81];let Pe;e[82]!==h||e[83]!==d||e[84]!==r?(Pe=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Pe):Pe=e[85];let Ue;e[86]!==Ae||e[87]!==Pe?(Ue=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Ae,Pe]})}),e[86]=Ae,e[87]=Pe,e[88]=Ue):Ue=e[88];let Ve;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==l||e[94]!==o||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==Q||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==G||e[107]!==i||e[108]!==c?(Ve=r==="automations"?t.jsx(hr,{dateRange:o}):r==="threads"?t.jsx(xs,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:o,searchQuery:d,filterAgentIds:M,filterUserIds:G,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:l,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:l,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:Q})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=l,e[94]=o,e[95]=a,e[96]=Y,e[97]=f,e[98]=Q,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=G,e[107]=i,e[108]=c,e[109]=Ve):Ve=e[109];let We;return e[110]!==Ue||e[111]!==Ve?(We=t.jsxs(t.Fragment,{children:[Ue,Ve]}),e[110]=Ue,e[111]=Ve,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:o=>{const{className:a}=o;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Super Agent";return{value:s.id??"",label:r,icon:o=>{const{className:a}=o;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:o=>{const{className:a}=o;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Ge,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function El(){const s=oe.c(83),{org:e}=Be(),r=yt();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/monitor"},s[0]=o):o=s[0];const a=os(o),{tab:l,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:F}=a,h=l===void 0?"overview":l;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=F===void 0?!1:F;let x,R,w,D,k,O,$;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let P;s[24]!==r||s[25]!==e.slug||s[26]!==a?(P=G=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...G}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=P):P=s[27],$=P;let N;s[28]!==$?(N=G=>{$({from:G.from,to:G.to})},s[28]=$,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const G=ye(c),re=ye(i);H=G.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],R=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=R,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=$}else x=s[17],R=s[18],w=s[19],D=s[20],k=s[21],O=s[22],$=s[23];const J=O;J.length>0&&(x=x+J.length);let A;s[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=A):A=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[A,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==$?(L=P=>$({tab:P}),s[43]=$,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(lr,{})}),s[48]=h,s[49]=E):E=s[49];let V;s[50]!==z||s[51]!==E?(V=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=V):V=s[52];let q;s[53]!==D?(q=P=>{xt("monitoring_time_range_changed",{from:P.from,to:P.to}),D(P)},s[53]=D,s[54]=q):q=s[54];let U;s[55]!==g||s[56]!==$?(U=()=>{xt("monitoring_live_toggled",{enabled:!g}),$({streaming:!g})},s[55]=g,s[56]=$,s[57]=U):U=s[57];let Y;s[58]!==h||s[59]!==$?(Y=P=>{P!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:P}),$({tab:P})},s[58]=h,s[59]=$,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==R||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==U||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==$||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:R,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:$,onTimeRangeChange:q,onStreamingToggle:U,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=R,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=U,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=$,s[78]=S,s[79]=B):B=s[79];let Q;return s[80]!==V||s[81]!==B?(Q=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(ls,{fallback:X,children:t.jsx(K.Suspense,{fallback:V,children:B})})})}),s[80]=V,s[81]=B,s[82]=Q):Q=s[82],Q}function Ir(s){return s.key.trim()}export{El as default};
@@ -0,0 +1 @@
1
+ import{c as g,a1 as x,a as h,r as j,j as l,N as c,a8 as I}from"./index-RzCbz7G4.js";import{a as R}from"./constants-B72Xmt_K.js";import{a as y}from"./hooks-BCy5e9GO.js";import{d as C}from"./use-organization-settings-BPsQDYqA.js";import{f as S}from"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-client-D3e9ceNa.js";import"./auth-DKsARQye.js";import"./decopilot-sse-pool-CQt0Qt9t.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-D1WvthcJ.js";function H(){const t=g.c(11),{org:s}=x(),m=C(),a=R(s.id).id,{data:u}=h.useSession(),{threads:p,status:d}=y(),[f]=j.useState(b);if(m){let e;return t[0]!==s.slug?(e=l.jsx(c,{to:"/commerce-onboarding",search:{org:s.slug},replace:!0}),t[0]=s.slug,t[1]=e):e=t[1],e}if(d.kind==="loading"){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx(I,{}),t[2]=e):e=t[2],e}const n=S(p,a,u?.user?.id)?.id??f;let o;t[3]!==s.slug||t[4]!==n?(o={org:s.slug,taskId:n},t[3]=s.slug,t[4]=n,t[5]=o):o=t[5];let r;t[6]!==a?(r={virtualmcpid:a},t[6]=a,t[7]=r):r=t[7];let i;return t[8]!==o||t[9]!==r?(i=l.jsx(c,{to:"/$org/$taskId",params:o,search:r,replace:!0}),t[8]=o,t[9]=r,t[10]=i):i=t[10],i}function b(){return crypto.randomUUID()}export{H as default};
@@ -1 +1 @@
1
- import{r as n,aS as q,cq as R,cr as Ee,cs as ke,ct as Se,bM as xe,cu as j}from"./index-BEXxcuG9.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
1
+ import{r as n,aT as q,dJ as R,cK as Ee,cM as ke,cO as Se,bN as xe,dK as j}from"./index-RzCbz7G4.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Ke=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Ke.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Fe(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",K="data-value",Pe=(t,l,r)=>Fe(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=F(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=F(()=>new Set),u=F(()=>new Map),c=F(()=>new Map),d=F(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:N=!1,vimBindings:A=!0,...O}=t,T=q(),ne=q(),U=q(),M=n.useRef(null),w=Je();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),J(),w(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(U);y?y.focus():(a=document.getElementById(T))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),H=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{J(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),J(),r.current.value||W(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&W(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:T,inputId:U,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function J(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${K}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function W(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(K);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(K))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(K))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ue(s,V):He(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(K)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:H.inputId,id:H.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:H},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;N(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function N(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:T,forceMount:ne,keywords:U,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:N,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ne=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Te=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ne,Loading:Te});function Ue(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function He(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function F(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(K,v),u.current=v}),u}var Je=()=>{let[t,l]=n.useState(),r=F(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function We(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(We(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};