@decocms/mesh 2.125.3 → 2.127.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 (212) hide show
  1. package/dist/client/assets/{AlertCircle-CAn1onHH.js → AlertCircle-DJ052zqS.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-ChcnKW7P.js → AlertOctagon-DCNCOxEl.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-Suhq71Ba.js → AlertTriangle-MQM19F_y.js} +1 -1
  4. package/dist/client/assets/{ArrowDown-BQn3fvf7.js → ArrowDown-Bn9Nw2BD.js} +1 -1
  5. package/dist/client/assets/{ArrowLeft-DkojAdWe.js → ArrowLeft-BSPqreiE.js} +1 -1
  6. package/dist/client/assets/{ArrowUp-CCTJ8tar.js → ArrowUp-BLFAP4Oh.js} +1 -1
  7. package/dist/client/assets/{Check-2BTd1528.js → Check-BXz-Aa3Y.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-DUsP9qJl.js → CheckCircle-DmsV77x1.js} +1 -1
  9. package/dist/client/assets/{CheckDone01-Bs5yfbwu.js → CheckDone01-CQuFbmYi.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-D9LvEg4-.js → CheckVerified02-C2uVr9FW.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-BK0Z-3ss.js → ChevronDown-CEb48ZDu.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-CpFHeZ-k.js → ChevronRight-CQS5xbc3.js} +1 -1
  13. package/dist/client/assets/{Clock-DWLl74MU.js → Clock-X1ZnQ0e8.js} +1 -1
  14. package/dist/client/assets/{Code01-D7rt1C5k.js → Code01-CVF-mmmz.js} +1 -1
  15. package/dist/client/assets/{Container-Dkua_wx6.js → Container-D3N8SS-J.js} +1 -1
  16. package/dist/client/assets/{Copy01-CWD2XYkN.js → Copy01-CFXdI8SF.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-dIUcYa_e.js → Dataflow03-BvFbR-2p.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-R03fSXLm.js → DotsHorizontal-BlKZUIAr.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-nJGFqnIJ.js → DotsVertical-CJJQe-sw.js} +1 -1
  20. package/dist/client/assets/{Download01-w53nljTi.js → Download01-BuGXWPUb.js} +1 -1
  21. package/dist/client/assets/{Edit01-Een9NeGa.js → Edit01-vxAH-tv6.js} +1 -1
  22. package/dist/client/assets/{Eye-cRMKwlob.js → Eye-Cqy0OQfO.js} +1 -1
  23. package/dist/client/assets/{File02-BiHbI-Bs.js → File02-CYWnFy5E.js} +1 -1
  24. package/dist/client/assets/{File06-DK6hozGp.js → File06-p-mGMfLu.js} +1 -1
  25. package/dist/client/assets/{FilterLines-DcFfiBYv.js → FilterLines-B-D6srZC.js} +1 -1
  26. package/dist/client/assets/{Globe01-zBSU4RrG.js → Globe01-Di6WS1d0.js} +1 -1
  27. package/dist/client/assets/{Globe02-BzI-D3XF.js → Globe02-CL5aTFno.js} +1 -1
  28. package/dist/client/assets/{Grid01-DtWTP079.js → Grid01-BGPoEeik.js} +1 -1
  29. package/dist/client/assets/{Hash02-B_cIkiva.js → Hash02-BWg3CKrn.js} +1 -1
  30. package/dist/client/assets/{Home02-B0J9-6Fj.js → Home02-Atzompjz.js} +1 -1
  31. package/dist/client/assets/{Image01-DuLPJrbP.js → Image01-B-9nWGvT.js} +1 -1
  32. package/dist/client/assets/{Inbox01-DkeOZ2C_.js → Inbox01-CWbCHIve.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-v_Zi3ix-.js → InfoCircle-BxNpDB4f.js} +1 -1
  34. package/dist/client/assets/{Key01-FdWHEw6c.js → Key01-BBHw8-AF.js} +1 -1
  35. package/dist/client/assets/{LinkExternal01-BvWelMzx.js → LinkExternal01-BH7m2QmL.js} +1 -1
  36. package/dist/client/assets/{List-D1SXIq-Q.js → List-DZq_3WJK.js} +1 -1
  37. package/dist/client/assets/{Loading01-BntQXW3R.js → Loading01-Bm0RmGTq.js} +1 -1
  38. package/dist/client/assets/{Lock01-Ca25inpJ.js → Lock01-BY0MGONc.js} +1 -1
  39. package/dist/client/assets/{Pin01-D5SNXGno.js → Pin01-BQxfi8aj.js} +1 -1
  40. package/dist/client/assets/{Play-Dv6XoPC1.js → Play-CGUn4LDu.js} +1 -1
  41. package/dist/client/assets/{Plus-BpJ1F9ED.js → Plus-CfD4U7h2.js} +1 -1
  42. package/dist/client/assets/{RefreshCcw01-C6HpBrM2.js → RefreshCcw01-ClQUpEVA.js} +1 -1
  43. package/dist/client/assets/{RefreshCw01-BLvlqjIJ.js → RefreshCw01-DsYl6Nso.js} +1 -1
  44. package/dist/client/assets/{Rows03-Bw2KmPLF.js → Rows03-BmDCzA2B.js} +1 -1
  45. package/dist/client/assets/{Save01-C7Op6P3G.js → Save01-CVm8Nhi5.js} +1 -1
  46. package/dist/client/assets/{SearchMd-B22BWSrE.js → SearchMd-rBeGYVN8.js} +1 -1
  47. package/dist/client/assets/{Settings01-39eYdV1s.js → Settings01-BCU61Dg3.js} +1 -1
  48. package/dist/client/assets/{Shield01-D5vtlDrS.js → Shield01-D73wrcGm.js} +1 -1
  49. package/dist/client/assets/{Terminal-jwgZ8meH.js → Terminal-B7IR3GOF.js} +1 -1
  50. package/dist/client/assets/Tool01-D4p-h1gd.js +1 -0
  51. package/dist/client/assets/{Trash01-NHvYJiOw.js → Trash01-CNjhe6V_.js} +1 -1
  52. package/dist/client/assets/{Upload01-B7z0chWz.js → Upload01-KtFgXqwG.js} +1 -1
  53. package/dist/client/assets/{Users03-CfBv5uVc.js → Users03-DNxW_fja.js} +1 -1
  54. package/dist/client/assets/{X-nbY3n5YX.js → X-OID4YrAs.js} +1 -1
  55. package/dist/client/assets/{XCircle-CdrNrzcr.js → XCircle-LfPUm5IL.js} +1 -1
  56. package/dist/client/assets/{XClose-DHV8bqGR.js → XClose-CVjVP425.js} +1 -1
  57. package/dist/client/assets/{agent-connections-preview-D2nPeCg-.js → agent-connections-preview-BPhKy-Id.js} +1 -1
  58. package/dist/client/assets/agent-detail-HyuxH4Ve.js +2 -0
  59. package/dist/client/assets/agents-Bc9eRkDe.js +1 -0
  60. package/dist/client/assets/{alert-dialog-DIblcPQC.js → alert-dialog-9GjsXnzK.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-lueUuNUs.js → auth-catchall-Bsy9nmf9.js} +1 -1
  62. package/dist/client/assets/{avatar-DAde4Coq.js → avatar-D7LZZNPu.js} +1 -1
  63. package/dist/client/assets/{badge-EvnzqGBM.js → badge-CQ9R9pkG.js} +1 -1
  64. package/dist/client/assets/{binder-DtqSnmtn.js → binder-BRFblyKj.js} +1 -1
  65. package/dist/client/assets/{breadcrumb-Dit0z7A7.js → breadcrumb-_jAneXHm.js} +1 -1
  66. package/dist/client/assets/{button-DDY6hri1.js → button-BjJbLzI1.js} +1 -1
  67. package/dist/client/assets/{card-CHcjH7V4.js → card-BiNPXwY7.js} +1 -1
  68. package/dist/client/assets/{chart-BEZIHLHA.js → chart-Cye540qd.js} +5 -5
  69. package/dist/client/assets/{checkbox-_pZquTsv.js → checkbox-ClNyXMEe.js} +1 -1
  70. package/dist/client/assets/{circle-alert-8my-DdYx.js → circle-alert-BwBTOPt2.js} +1 -1
  71. package/dist/client/assets/collection-detail-CgUzsg7m.js +26 -0
  72. package/dist/client/assets/collection-search-D9lLlfmK.js +1 -0
  73. package/dist/client/assets/collection-tab-CK-Q89lj.js +1 -0
  74. package/dist/client/assets/collection-table-wrapper-HJznMrYU.js +1 -0
  75. package/dist/client/assets/{collection-tabs-CMMj9apF.js → collection-tabs-D0BDRIQH.js} +1 -1
  76. package/dist/client/assets/{command-D0lPyqX9.js → command-CmCm6EpS.js} +1 -1
  77. package/dist/client/assets/{connect-jPJQySxH.js → connect-D_vBcyxr.js} +1 -1
  78. package/dist/client/assets/{connection-card-C36z_Zfo.js → connection-card-O78FPkKW.js} +1 -1
  79. package/dist/client/assets/connection-detail-CqECx5w9.js +1 -0
  80. package/dist/client/assets/connections-DcBskx9Y.js +1 -0
  81. package/dist/client/assets/{constants-BWuwqVaf.js → constants-Bz_J8k2h.js} +1 -1
  82. package/dist/client/assets/constants-CQfW12Qo.js +1 -0
  83. package/dist/client/assets/{context-BoqYBHof.js → context-DPw3JrfP.js} +1 -1
  84. package/dist/client/assets/{create-organization-dialog-DZ-29KA3.js → create-organization-dialog-ChDwEIL0.js} +1 -1
  85. package/dist/client/assets/{create-project-dialog-5JWgj7o1.js → create-project-dialog-D_pqfYAD.js} +1 -1
  86. package/dist/client/assets/{deco-constants-Lndb0_Fi.js → deco-constants-CGrimklY.js} +1 -1
  87. package/dist/client/assets/{dialog-AmArt43J.js → dialog-CsS26GNP.js} +1 -1
  88. package/dist/client/assets/{dropdown-menu-CMr4pVGd.js → dropdown-menu-Bx6HZEO6.js} +1 -1
  89. package/dist/client/assets/{dynamic-plugin-layout-B-RWLbim.js → dynamic-plugin-layout-ChDoP95P.js} +1 -1
  90. package/dist/client/assets/editable-thread-title-DG8vSbP7.js +16 -0
  91. package/dist/client/assets/{empty-state-BxqfhnZC.js → empty-state-BIKMZA4A.js} +1 -1
  92. package/dist/client/assets/{env-vars-editor-CeWJLU0d.js → env-vars-editor-Bu4z6L63.js} +1 -1
  93. package/dist/client/assets/{error-boundary-BbdoNwwk.js → error-boundary-BOjL_3iE.js} +1 -1
  94. package/dist/client/assets/{extract-connection-data-FghvIcuN.js → extract-connection-data-9qHOXLXC.js} +1 -1
  95. package/dist/client/assets/{file-browser-BRNDEG3O.js → file-browser-DlsvWnR4.js} +2 -2
  96. package/dist/client/assets/{form-Bsyh-cQj.js → form-BcYKMkAo.js} +1 -1
  97. package/dist/client/assets/{grid-view-BjxbyS3V.js → grid-view-DKE_LwVv.js} +1 -1
  98. package/dist/client/assets/{home-BqlHZV0D.js → home-CfX1o6Ev.js} +1 -1
  99. package/dist/client/assets/index-B7FUMscm.css +1 -0
  100. package/dist/client/assets/{index-ClGhCbA0.js → index-BFnklquP.js} +72 -62
  101. package/dist/client/assets/{index-IwkUYudi.js → index-BqwppNxk.js} +1 -1
  102. package/dist/client/assets/{index-CMIePc8v.js → index-CKXRhh0t.js} +37 -37
  103. package/dist/client/assets/{index-7GX9Z2_E.js → index-DbG6jisP.js} +1 -1
  104. package/dist/client/assets/{index-BwsTCLNe.js → index-Ds78Hq48.js} +1 -1
  105. package/dist/client/assets/index-LVMAuFW8.js +1 -0
  106. package/dist/client/assets/{index-_qbzL5MU.js → index-kQL4iCgd.js} +1 -1
  107. package/dist/client/assets/{index-Ck8tqNHK.js → index-lC9RbQEq.js} +1 -1
  108. package/dist/client/assets/{index-MmPZuevW.js → index-nl6bR4T8.js} +1 -1
  109. package/dist/client/assets/{infiniteQueryObserver-DuAdiH0n.js → infiniteQueryObserver-C_YVCa9u.js} +1 -1
  110. package/dist/client/assets/{input-Je9XV62u.js → input-BPPp7fkV.js} +1 -1
  111. package/dist/client/assets/{integration-icon-DeiJ75EP.js → integration-icon-CaUI1jG_.js} +1 -1
  112. package/dist/client/assets/{label-Ct-IE-k2.js → label-Ce-8MeXM.js} +1 -1
  113. package/dist/client/assets/{layout-BWtcS0Q2.js → layout-B_vm2aCi.js} +1 -1
  114. package/dist/client/assets/{localstorage-keys-B-4HWrAO.js → localstorage-keys-D7-2hl7K.js} +1 -1
  115. package/dist/client/assets/{login-swb3IsCw.js → login-BZjy-JZF.js} +1 -1
  116. package/dist/client/assets/{markdown-BshJmJUr.js → markdown-CL_nEHz6.js} +1 -1
  117. package/dist/client/assets/mcp-oauth-6gipdrl8.js +1 -0
  118. package/dist/client/assets/{mcp-server-card-DJ-C7iNn.js → mcp-server-card-k65UbfnQ.js} +1 -1
  119. package/dist/client/assets/mcp-server-detail-DOi3A41L.js +2 -0
  120. package/dist/client/assets/members-DyXednFN.js +3 -0
  121. package/dist/client/assets/{monitoring-Dkzs8zLr.js → monitoring-CbDWX7qw.js} +2 -2
  122. package/dist/client/assets/{monitoring-dashboard-edit-6Jd7ItfF.js → monitoring-dashboard-edit-Xu9WaY0f.js} +1 -1
  123. package/dist/client/assets/{monitoring-dashboard-view-NmZHmCWV.js → monitoring-dashboard-view-BnJZoOh6.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-hu62EGGB.js → oauth-callback-CLQrXT_i.js} +1 -1
  125. package/dist/client/assets/page-NSWxyYqB.js +1 -0
  126. package/dist/client/assets/page-tLMAT584.js +1 -0
  127. package/dist/client/assets/{plugin-empty-state-BfDH4uPn.js → plugin-empty-state-D5Ff5dMm.js} +1 -1
  128. package/dist/client/assets/{plugin-empty-state-DRRVQKmb.js → plugin-empty-state-WLlCNcH0.js} +1 -1
  129. package/dist/client/assets/{plugin-header-BPNBXPjM.js → plugin-header-DBNmWz2Z.js} +1 -1
  130. package/dist/client/assets/{plugin-header-8kNYjC6n.js → plugin-header-D_CX7196.js} +1 -1
  131. package/dist/client/assets/{popover-CdPr2kUy.js → popover-Dz4mFPzW.js} +1 -1
  132. package/dist/client/assets/{project-layout-bgteQ5fY.js → project-layout-L7FdQtTW.js} +1 -1
  133. package/dist/client/assets/projects-list-DFLeaqhB.js +1 -0
  134. package/dist/client/assets/{ranking-layout-BxRgmZtS.js → ranking-layout-CLhL84_g.js} +1 -1
  135. package/dist/client/assets/{readme-viewer-ym80L_hw.js → readme-viewer-BAJaQnye.js} +1 -1
  136. package/dist/client/assets/{registry-layout-C8Ew4flr.js → registry-layout-CLL316VY.js} +1 -1
  137. package/dist/client/assets/{registry-utils-DBAgugDf.js → registry-utils-C_nLhlWN.js} +1 -1
  138. package/dist/client/assets/{reports-layout-BoIJWhiW.js → reports-layout-DnfAta3q.js} +2 -2
  139. package/dist/client/assets/{reset-password-DY5mUItc.js → reset-password-Cpx9ZUFt.js} +1 -1
  140. package/dist/client/assets/{resizable-8m39GKGn.js → resizable-TMJNEC5w.js} +1 -1
  141. package/dist/client/assets/{save-actions-DnxE-Bzm.js → save-actions-BYQZP6Sr.js} +1 -1
  142. package/dist/client/assets/{scroll-area-C-RNU2ZC.js → scroll-area-D6nBfX1Y.js} +4 -4
  143. package/dist/client/assets/{select-B9AjxT2Q.js → select-CwR5iwKr.js} +1 -1
  144. package/dist/client/assets/shell-layout-BnW-yUkb.js +3 -0
  145. package/dist/client/assets/{skeleton-BAWgWTH6.js → skeleton-DzMO4E_x.js} +1 -1
  146. package/dist/client/assets/{spinner-C5H8EOvR.js → spinner-B4HBT9r3.js} +1 -1
  147. package/dist/client/assets/{store-invite-BSP87zro.js → store-invite-DR-2VUII.js} +1 -1
  148. package/dist/client/assets/{switch-Bnxx_fFZ.js → switch-DkAfY5Xp.js} +1 -1
  149. package/dist/client/assets/{table-Bt31_DyV.js → table-BDxbk9kk.js} +1 -1
  150. package/dist/client/assets/tasks-JeX1dzU3.js +1 -0
  151. package/dist/client/assets/{textarea-Dfcf9iVI.js → textarea-C7R7dq5L.js} +1 -1
  152. package/dist/client/assets/{time-range-picker-VoxMdMGw.js → time-range-picker-CPtVWgsO.js} +1 -1
  153. package/dist/client/assets/{toggle-group-BYr6H2N2.js → toggle-group-BsC04HU0.js} +1 -1
  154. package/dist/client/assets/tools-list-C1FJexpR.js +1 -0
  155. package/dist/client/assets/{tooltip-Kun6OEqc.js → tooltip-C-TvyUPP.js} +1 -1
  156. package/dist/client/assets/{topbar-portal-BYkDxjeH.js → topbar-portal-BlsIm0Za.js} +1 -1
  157. package/dist/client/assets/types-DWiNuJXJ.js +155 -0
  158. package/dist/client/assets/{use-binding-Bt6opM01.js → use-binding-DtOyQ6H-.js} +1 -1
  159. package/dist/client/assets/{use-connection-CZeLlUDa.js → use-connection-CU1wdNM8.js} +1 -1
  160. package/dist/client/assets/{use-copy-BLt7-cw9.js → use-copy-C-xyAEAK.js} +1 -1
  161. package/dist/client/assets/{use-create-virtual-mcp-BWbRPuCZ.js → use-create-virtual-mcp-CdmTVIKM.js} +1 -1
  162. package/dist/client/assets/use-deco-chat-open-yra_c3Dw.js +1 -0
  163. package/dist/client/assets/{use-install-from-registry-BsUBgwfp.js → use-install-from-registry-Dpg6ludv.js} +1 -1
  164. package/dist/client/assets/{use-list-state-B_n0GZwG.js → use-list-state-DEj8YIwi.js} +1 -1
  165. package/dist/client/assets/{use-llm-CBsUcVLv.js → use-llm-Bjuj_MKF.js} +1 -1
  166. package/dist/client/assets/use-mcp-prompts-C2SxEfwc.js +1 -0
  167. package/dist/client/assets/{use-mcp-tools-BED8kPD7.js → use-mcp-tools-aLeNmzej.js} +1 -1
  168. package/dist/client/assets/{use-mobile-DLzBblnh.js → use-mobile-B6wwiLld.js} +1 -1
  169. package/dist/client/assets/{use-organization-settings-BTKBql6r.js → use-organization-settings-DdF3cHOT.js} +1 -1
  170. package/dist/client/assets/{use-project-Dgs5h9hm.js → use-project-Bmqhspht.js} +1 -1
  171. package/dist/client/assets/{use-settings-modal-CL7KNbwO.js → use-settings-modal-BQGLflyF.js} +1 -1
  172. package/dist/client/assets/{use-view-mode-Cm6MlS0B.js → use-view-mode-D5ZS-ZdB.js} +1 -1
  173. package/dist/client/assets/{use-virtual-mcp-chylq6BL.js → use-virtual-mcp-DqbEku8h.js} +1 -1
  174. package/dist/client/assets/useInfiniteQuery-DgzNofe0.js +1 -0
  175. package/dist/client/assets/{useMutation-CTU78J7M.js → useMutation-D2jNlXyR.js} +1 -1
  176. package/dist/client/assets/useQuery-6KDecjjg.js +1 -0
  177. package/dist/client/assets/useSuspenseInfiniteQuery-B2-Ew4j-.js +1 -0
  178. package/dist/client/assets/workflow-DJP52hJ3.js +1 -0
  179. package/dist/client/index.html +2 -2
  180. package/dist/server/cli.js +5 -5
  181. package/dist/server/migrate.js +2 -2
  182. package/dist/server/server.js +5 -5
  183. package/package.json +2 -1
  184. package/dist/client/assets/agent-detail-CAAcyNFf.js +0 -2
  185. package/dist/client/assets/agents-IxYsoQkx.js +0 -1
  186. package/dist/client/assets/collection-detail-BPjVfY9E.js +0 -26
  187. package/dist/client/assets/collection-search-BhyeAK8D.js +0 -1
  188. package/dist/client/assets/collection-tab-DYRZjIfR.js +0 -1
  189. package/dist/client/assets/collection-table-wrapper-DF0r5l64.js +0 -1
  190. package/dist/client/assets/connection-detail-D4fpJvP6.js +0 -1
  191. package/dist/client/assets/connections-Dd7R3YoP.js +0 -1
  192. package/dist/client/assets/constants-alL-orOw.js +0 -1
  193. package/dist/client/assets/empty-state-CUU2GnRG.js +0 -1
  194. package/dist/client/assets/index-D1eaSCBW.css +0 -1
  195. package/dist/client/assets/index-DFjHyz2s.js +0 -1
  196. package/dist/client/assets/mcp-oauth-DtHeHoWJ.js +0 -1
  197. package/dist/client/assets/mcp-server-detail-Du1aBWwk.js +0 -2
  198. package/dist/client/assets/members-BLWGtvj7.js +0 -3
  199. package/dist/client/assets/page-C-wJ53x_.js +0 -1
  200. package/dist/client/assets/page-Y1SYGnRN.js +0 -1
  201. package/dist/client/assets/projects-list-DngofdiO.js +0 -1
  202. package/dist/client/assets/shell-layout-DY2c6Efx.js +0 -3
  203. package/dist/client/assets/tasks-OIFCJv2K.js +0 -1
  204. package/dist/client/assets/tools-list-CMPsf87L.js +0 -1
  205. package/dist/client/assets/typewriter-title-ir44iZyu.js +0 -16
  206. package/dist/client/assets/use-deco-chat-open-DqF5WsjN.js +0 -1
  207. package/dist/client/assets/use-mcp-prompts-CTAKOvKB.js +0 -1
  208. package/dist/client/assets/useInfiniteQuery-B4zFsz_-.js +0 -1
  209. package/dist/client/assets/useQuery-CL8s1AaN.js +0 -1
  210. package/dist/client/assets/useSuspenseInfiniteQuery-CnNOZleg.js +0 -1
  211. package/dist/client/assets/view-mode-toggle-lRAyyRMm.js +0 -1
  212. package/dist/client/assets/workflow-CH4Jfjr7.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as f,b1 as Ke,bs as nn,bR as sn,c as U,j as n,u as Me,m as on,b as Ze,n as ln,K as at,t as Ot,O as Re,a as cn}from"./index-CMIePc8v.js";import{C as un}from"./collection-search-BhyeAK8D.js";import{P as ge}from"./index-Ck8tqNHK.js";import{B as dn,a as mn,b as fn,c as pn}from"./breadcrumb-Dit0z7A7.js";import{E as Kt}from"./empty-state-CUU2GnRG.js";import{E as qe}from"./error-boundary-BbdoNwwk.js";import{E as hn,i as vn,d as gn,e as Qt,b as xn,M as yn,T as bn,p as Qe,s as Le,a as Jt}from"./time-range-picker-VoxMdMGw.js";import{I as He}from"./integration-icon-DeiJ75EP.js";import{B as it}from"./badge-EvnzqGBM.js";import{c as Se,B as be}from"./button-DDY6hri1.js";import{t as Et}from"./ChevronDown-BK0Z-3ss.js";import{i as jn}from"./ChevronRight-CpFHeZ-k.js";import{c as he,b as Mt,d as wn,e as Nn,a as Pn,T as ye}from"./table-Bt31_DyV.js";import{aC as On,aD as Je,a9 as Ee,i as Ve,aE as aa,r as Fe,a1 as gt,aF as na,a3 as xt,aG as V,a4 as H,aH as $e,aI as ot,m as lt,aJ as Ce,aK as er,L as Be,aa as Sn,ae as Ft,aL as In,aM as kn,aN as Cn,aO as An,a5 as ze,ac as Tt,A as En,p as me,q as Ie,aP as Mn,w as Pe,z as Oe,F as Wt,B as Tn,E as ct,I as sa,D as yt,h as bt,R as ia,S as oa,J as la,M as jt,N as ca,O as ua,U as da,V as Dn,P as ma,j as Ge,W as _n,X as Ln,Z as wt,Y as fa,_ as $n,$ as Nt,a0 as tr,a7 as pa,a8 as ha,s as va,ab as Rn,aQ as Bn,ai as zn,t as Kn,x as Te,y as De,aR as ga,aS as Fn,aT as Wn,H as rr,aU as qn,aV as ar,K as Vn,aW as Hn,aX as xa,c as Gn,d as ya,aY as Un,aZ as Zn,a_ as nr,a$ as Yn,a6 as Xn,ax as ba,ay as ja,az as wa,aA as Qn,aB as Na}from"./chart-BEZIHLHA.js";import{u as qt,a as Vt,W as Jn}from"./constants-BWuwqVaf.js";import{i as es}from"./DotsVertical-nJGFqnIJ.js";import{s as Pa}from"./Plus-BpJ1F9ED.js";import{s as Oa}from"./Trash01-NHvYJiOw.js";import{C as ts}from"./connection-card-C36z_Zfo.js";import{D as rs,a as as,b as ns,c as sr}from"./dropdown-menu-CMr4pVGd.js";import{f as ss,a as is,b as os,c as ls,d as cs,e as us,A as ds,g as ms}from"./alert-dialog-DIblcPQC.js";import{f as fs,c as ps,a as ir,d as hs,C as vs,e as gs,u as xs}from"./command-D0lPyqX9.js";import{u as ys}from"./useSuspenseInfiniteQuery-CnNOZleg.js";import{h as Ht}from"./use-connection-CZeLlUDa.js";import{b as Sa}from"./use-virtual-mcp-chylq6BL.js";import{i as bs}from"./Code01-D7rt1C5k.js";import{i as js}from"./FilterLines-DcFfiBYv.js";import{c as ws}from"./Grid01-DtWTP079.js";import{I as St}from"./input-Je9XV62u.js";import{C as or}from"./checkbox-_pZquTsv.js";import{P as Ia,a as ka,b as Ca}from"./popover-CdPr2kUy.js";import{S as lr,a as cr,b as ur,c as dr,d as et}from"./select-B9AjxT2Q.js";import{T as Ns}from"./textarea-Dfcf9iVI.js";import{T as Ps,a as Os,b as Ss}from"./tooltip-Kun6OEqc.js";import{C as Is}from"./collection-tabs-CMMj9apF.js";import{S as ks}from"./switch-Bnxx_fFZ.js";import{L as Cs}from"./label-Ct-IE-k2.js";import{n as Dt}from"./Container-Dkua_wx6.js";import{u as As}from"./use-mcp-tools-BED8kPD7.js";import{T as Es,a as It}from"./toggle-group-BYr6H2N2.js";import{t as Ms}from"./Users03-CfBv5uVc.js";import"./Loading01-BntQXW3R.js";import"./SearchMd-B22BWSrE.js";import"./use-mobile-DLzBblnh.js";import"./X-nbY3n5YX.js";import"./AlertTriangle-Suhq71Ba.js";import"./Check-2BTd1528.js";import"./Copy01-CWD2XYkN.js";import"./Download01-w53nljTi.js";import"./Key01-FdWHEw6c.js";import"./Play-Dv6XoPC1.js";import"./scroll-area-C-RNU2ZC.js";import"./spinner-C5H8EOvR.js";import"./Clock-DWLl74MU.js";import"./index-7GX9Z2_E.js";import"./card-CHcjH7V4.js";import"./index-MmPZuevW.js";import"./infiniteQueryObserver-DuAdiH0n.js";import"./useMutation-CTU78J7M.js";import"./index-IwkUYudi.js";import"./useQuery-CL8s1AaN.js";const _t=({size:t=24,color:e="currentColor",...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},f.createElement("path",{d:"M21 21H6.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C3 19.48 3 18.92 3 17.8V3m4 7.5v7m4.5-12v12m4.5-7v7m4.5-12v12"}));_t.displayName="BarChart07";const Aa=({size:t=24,color:e="currentColor",...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},f.createElement("path",{d:"M9.5 15V9m5 6V9m7.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Aa.displayName="PauseCircle";const Ea=({size:t=24,color:e="currentColor",...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},f.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),f.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}));Ea.displayName="PlayCircle";const Ma=Math.cos,ut=Math.sin,fe=Math.sqrt,dt=Math.PI,Pt=2*dt,Gt={draw(t,e){const r=fe(e/dt);t.moveTo(r,0),t.arc(0,0,r,0,Pt)}},Ts={draw(t,e){const r=fe(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Ta=fe(1/3),Ds=Ta*2,_s={draw(t,e){const r=fe(e/Ds),a=r*Ta;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},Ls={draw(t,e){const r=fe(e),a=-r/2;t.rect(a,a,r,r)}},$s=.8908130915292852,Da=ut(dt/10)/ut(7*dt/10),Rs=ut(Pt/10)*Da,Bs=-Ma(Pt/10)*Da,zs={draw(t,e){const r=fe(e*$s),a=Rs*r,s=Bs*r;t.moveTo(0,-r),t.lineTo(a,s);for(let i=1;i<5;++i){const o=Pt*i/5,c=Ma(o),l=ut(o);t.lineTo(l*r,-c*r),t.lineTo(c*a-l*s,l*a+c*s)}t.closePath()}},kt=fe(3),Ks={draw(t,e){const r=-fe(e/(kt*3));t.moveTo(0,r*2),t.lineTo(-kt*r,-r),t.lineTo(kt*r,-r),t.closePath()}},ae=-.5,ne=fe(3)/2,Lt=1/fe(12),Fs=(Lt/2+1)*3,Ws={draw(t,e){const r=fe(e/Fs),a=r/2,s=r*Lt,i=a,o=r*Lt+r,c=-i,l=o;t.moveTo(a,s),t.lineTo(i,o),t.lineTo(c,l),t.lineTo(ae*a-ne*s,ne*a+ae*s),t.lineTo(ae*i-ne*o,ne*i+ae*o),t.lineTo(ae*c-ne*l,ne*c+ae*l),t.lineTo(ae*a+ne*s,ae*s-ne*a),t.lineTo(ae*i+ne*o,ae*o-ne*i),t.lineTo(ae*c+ne*l,ae*l-ne*c),t.closePath()}};function qs(t,e){let r=null,a=On(s);t=typeof t=="function"?t:Je(t||Gt),e=typeof e=="function"?e:Je(e===void 0?64:+e);function s(){let i;if(r||(r=i=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(t=typeof i=="function"?i:Je(i),s):t},s.size=function(i){return arguments.length?(e=typeof i=="function"?i:Je(+i),s):e},s.context=function(i){return arguments.length?(r=i??null,s):r},s}var Vs=["type","size","sizeType"];function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},$t.apply(null,arguments)}function mr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function fr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mr(Object(r),!0).forEach(function(a){Hs(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Hs(t,e,r){return(e=Gs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gs(t){var e=Us(t,"string");return typeof e=="symbol"?e:e+""}function Us(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zs(t,e){if(t==null)return{};var r,a,s=Ys(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Ys(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var _a={symbolCircle:Gt,symbolCross:Ts,symbolDiamond:_s,symbolSquare:Ls,symbolStar:zs,symbolTriangle:Ks,symbolWye:Ws},Xs=Math.PI/180,Qs=t=>{var e="symbol".concat(aa(t));return _a[e]||Gt},Js=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*Xs;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ei=(t,e)=>{_a["symbol".concat(aa(t))]=e},La=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,s=Zs(t,Vs),i=fr(fr({},s),{},{type:e,size:r,sizeType:a}),o="circle";typeof e=="string"&&(o=e);var c=()=>{var m=Qs(o),y=qs().type(m).size(Js(r,a,o)),g=y();if(g!==null)return g},{className:l,cx:u,cy:d}=i,p=Ee(i);return Ve(u)&&Ve(d)&&Ve(r)?f.createElement("path",$t({},p,{className:Ke("recharts-symbols",l),transform:"translate(".concat(u,", ").concat(d,")"),d:c()})):null};La.registerSymbol=ei;var ti=["radius"],ri=["radius"],pr,hr,vr,gr,xr,yr,br,jr,wr,Nr;function Pr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function Or(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pr(Object(r),!0).forEach(function(a){ai(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ai(t,e,r){return(e=ni(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ni(t){var e=si(t,"string");return typeof e=="symbol"?e:e+""}function si(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},mt.apply(null,arguments)}function Sr(t,e){if(t==null)return{};var r,a,s=ii(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ii(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function ve(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Ir=(t,e,r,a,s)=>{var i=$e(r),o=$e(a),c=Math.min(Math.abs(i)/2,Math.abs(o)/2),l=o>=0?1:-1,u=i>=0?1:-1,d=o>=0&&i>=0||o<0&&i<0?1:0,p;if(c>0&&Array.isArray(s)){for(var m=[0,0,0,0],y=0,g=4;y<g;y++){var x,b=(x=s[y])!==null&&x!==void 0?x:0;m[y]=b>c?c:b}p=V(pr||(pr=ve(["M",",",""])),t,e+l*m[0]),m[0]>0&&(p+=V(hr||(hr=ve(["A ",",",",0,0,",",",",",""])),m[0],m[0],d,t+u*m[0],e)),p+=V(vr||(vr=ve(["L ",",",""])),t+r-u*m[1],e),m[1]>0&&(p+=V(gr||(gr=ve(["A ",",",",0,0,",`,
1
+ import{r as f,b1 as Ke,bP as nn,cc as sn,c as U,j as n,u as Me,m as on,b as Ze,n as ln,K as at,t as Ot,O as Re,a as cn}from"./index-CKXRhh0t.js";import{E as Kt,C as un}from"./collection-search-D9lLlfmK.js";import{P as ge}from"./index-lC9RbQEq.js";import{B as dn,a as mn,b as fn,c as pn}from"./breadcrumb-_jAneXHm.js";import{E as qe}from"./error-boundary-BOjL_3iE.js";import{E as hn,i as vn,d as gn,e as Qt,b as xn,M as yn,T as bn,p as Qe,s as Le,a as Jt}from"./time-range-picker-CPtVWgsO.js";import{I as He}from"./integration-icon-CaUI1jG_.js";import{B as it}from"./badge-CQ9R9pkG.js";import{c as Se,B as be}from"./button-BjJbLzI1.js";import{t as Et}from"./ChevronDown-CEb48ZDu.js";import{i as jn}from"./ChevronRight-CQS5xbc3.js";import{c as he,b as Mt,d as wn,e as Nn,a as Pn,T as ye}from"./table-BDxbk9kk.js";import{aC as On,aD as Je,a9 as Ee,i as Ve,aE as aa,r as Fe,a1 as gt,aF as na,a3 as xt,aG as V,a4 as H,aH as $e,aI as ot,m as lt,aJ as Ce,aK as er,L as Be,aa as Sn,ae as Ft,aL as In,aM as kn,aN as Cn,aO as An,a5 as ze,ac as Tt,A as En,p as me,q as Ie,aP as Mn,w as Pe,z as Oe,F as Wt,B as Tn,E as ct,I as sa,D as yt,h as bt,R as ia,S as oa,J as la,M as jt,N as ca,O as ua,U as da,V as Dn,P as ma,j as Ge,W as _n,X as Ln,Z as wt,Y as fa,_ as $n,$ as Nt,a0 as tr,a7 as pa,a8 as ha,s as va,ab as Rn,aQ as Bn,ai as zn,t as Kn,x as Te,y as De,aR as ga,aS as Fn,aT as Wn,H as rr,aU as qn,aV as ar,K as Vn,aW as Hn,aX as xa,c as Gn,d as ya,aY as Un,aZ as Zn,a_ as nr,a$ as Yn,a6 as Xn,ax as ba,ay as ja,az as wa,aA as Qn,aB as Na}from"./chart-Cye540qd.js";import{u as qt,a as Vt,W as Jn}from"./constants-Bz_J8k2h.js";import{i as es}from"./DotsVertical-CJJQe-sw.js";import{s as Pa}from"./Plus-CfD4U7h2.js";import{s as Oa}from"./Trash01-CNjhe6V_.js";import{C as ts}from"./connection-card-O78FPkKW.js";import{D as rs,a as as,b as ns,c as sr}from"./dropdown-menu-Bx6HZEO6.js";import{f as ss,a as is,b as os,c as ls,d as cs,e as us,A as ds,g as ms}from"./alert-dialog-9GjsXnzK.js";import{f as fs,c as ps,a as ir,d as hs,C as vs,e as gs,u as xs}from"./command-CmCm6EpS.js";import{u as ys}from"./useSuspenseInfiniteQuery-B2-Ew4j-.js";import{h as Ht}from"./use-connection-CU1wdNM8.js";import{b as Sa}from"./use-virtual-mcp-DqbEku8h.js";import{i as bs}from"./Code01-CVF-mmmz.js";import{i as js}from"./FilterLines-B-D6srZC.js";import{c as ws}from"./Grid01-BGPoEeik.js";import{I as St}from"./input-BPPp7fkV.js";import{C as or}from"./checkbox-ClNyXMEe.js";import{P as Ia,a as ka,b as Ca}from"./popover-Dz4mFPzW.js";import{S as lr,a as cr,b as ur,c as dr,d as et}from"./select-CwR5iwKr.js";import{T as Ns}from"./textarea-C7R7dq5L.js";import{T as Ps,a as Os,b as Ss}from"./tooltip-C-TvyUPP.js";import{C as Is}from"./collection-tabs-D0BDRIQH.js";import{S as ks}from"./switch-DkAfY5Xp.js";import{L as Cs}from"./label-Ce-8MeXM.js";import{n as Dt}from"./Container-D3N8SS-J.js";import{u as As}from"./use-mcp-tools-aLeNmzej.js";import{T as Es,a as It}from"./toggle-group-BsC04HU0.js";import{t as Ms}from"./Users03-DNxW_fja.js";import"./Loading01-Bm0RmGTq.js";import"./SearchMd-rBeGYVN8.js";import"./use-mobile-B6wwiLld.js";import"./X-OID4YrAs.js";import"./AlertTriangle-MQM19F_y.js";import"./Check-BXz-Aa3Y.js";import"./Copy01-CFXdI8SF.js";import"./Download01-BuGXWPUb.js";import"./Key01-BBHw8-AF.js";import"./Play-CGUn4LDu.js";import"./scroll-area-D6nBfX1Y.js";import"./spinner-B4HBT9r3.js";import"./Clock-X1ZnQ0e8.js";import"./index-DbG6jisP.js";import"./card-BiNPXwY7.js";import"./index-nl6bR4T8.js";import"./infiniteQueryObserver-C_YVCa9u.js";import"./useMutation-D2jNlXyR.js";import"./index-BqwppNxk.js";import"./useQuery-6KDecjjg.js";const _t=({size:t=24,color:e="currentColor",...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},f.createElement("path",{d:"M21 21H6.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C3 19.48 3 18.92 3 17.8V3m4 7.5v7m4.5-12v12m4.5-7v7m4.5-12v12"}));_t.displayName="BarChart07";const Aa=({size:t=24,color:e="currentColor",...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},f.createElement("path",{d:"M9.5 15V9m5 6V9m7.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Aa.displayName="PauseCircle";const Ea=({size:t=24,color:e="currentColor",...r})=>f.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},f.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),f.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}));Ea.displayName="PlayCircle";const Ma=Math.cos,ut=Math.sin,fe=Math.sqrt,dt=Math.PI,Pt=2*dt,Gt={draw(t,e){const r=fe(e/dt);t.moveTo(r,0),t.arc(0,0,r,0,Pt)}},Ts={draw(t,e){const r=fe(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Ta=fe(1/3),Ds=Ta*2,_s={draw(t,e){const r=fe(e/Ds),a=r*Ta;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},Ls={draw(t,e){const r=fe(e),a=-r/2;t.rect(a,a,r,r)}},$s=.8908130915292852,Da=ut(dt/10)/ut(7*dt/10),Rs=ut(Pt/10)*Da,Bs=-Ma(Pt/10)*Da,zs={draw(t,e){const r=fe(e*$s),a=Rs*r,s=Bs*r;t.moveTo(0,-r),t.lineTo(a,s);for(let i=1;i<5;++i){const o=Pt*i/5,c=Ma(o),l=ut(o);t.lineTo(l*r,-c*r),t.lineTo(c*a-l*s,l*a+c*s)}t.closePath()}},kt=fe(3),Ks={draw(t,e){const r=-fe(e/(kt*3));t.moveTo(0,r*2),t.lineTo(-kt*r,-r),t.lineTo(kt*r,-r),t.closePath()}},ae=-.5,ne=fe(3)/2,Lt=1/fe(12),Fs=(Lt/2+1)*3,Ws={draw(t,e){const r=fe(e/Fs),a=r/2,s=r*Lt,i=a,o=r*Lt+r,c=-i,l=o;t.moveTo(a,s),t.lineTo(i,o),t.lineTo(c,l),t.lineTo(ae*a-ne*s,ne*a+ae*s),t.lineTo(ae*i-ne*o,ne*i+ae*o),t.lineTo(ae*c-ne*l,ne*c+ae*l),t.lineTo(ae*a+ne*s,ae*s-ne*a),t.lineTo(ae*i+ne*o,ae*o-ne*i),t.lineTo(ae*c+ne*l,ae*l-ne*c),t.closePath()}};function qs(t,e){let r=null,a=On(s);t=typeof t=="function"?t:Je(t||Gt),e=typeof e=="function"?e:Je(e===void 0?64:+e);function s(){let i;if(r||(r=i=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(t=typeof i=="function"?i:Je(i),s):t},s.size=function(i){return arguments.length?(e=typeof i=="function"?i:Je(+i),s):e},s.context=function(i){return arguments.length?(r=i??null,s):r},s}var Vs=["type","size","sizeType"];function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},$t.apply(null,arguments)}function mr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function fr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mr(Object(r),!0).forEach(function(a){Hs(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Hs(t,e,r){return(e=Gs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gs(t){var e=Us(t,"string");return typeof e=="symbol"?e:e+""}function Us(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zs(t,e){if(t==null)return{};var r,a,s=Ys(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Ys(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var _a={symbolCircle:Gt,symbolCross:Ts,symbolDiamond:_s,symbolSquare:Ls,symbolStar:zs,symbolTriangle:Ks,symbolWye:Ws},Xs=Math.PI/180,Qs=t=>{var e="symbol".concat(aa(t));return _a[e]||Gt},Js=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*Xs;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ei=(t,e)=>{_a["symbol".concat(aa(t))]=e},La=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,s=Zs(t,Vs),i=fr(fr({},s),{},{type:e,size:r,sizeType:a}),o="circle";typeof e=="string"&&(o=e);var c=()=>{var m=Qs(o),y=qs().type(m).size(Js(r,a,o)),g=y();if(g!==null)return g},{className:l,cx:u,cy:d}=i,p=Ee(i);return Ve(u)&&Ve(d)&&Ve(r)?f.createElement("path",$t({},p,{className:Ke("recharts-symbols",l),transform:"translate(".concat(u,", ").concat(d,")"),d:c()})):null};La.registerSymbol=ei;var ti=["radius"],ri=["radius"],pr,hr,vr,gr,xr,yr,br,jr,wr,Nr;function Pr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function Or(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pr(Object(r),!0).forEach(function(a){ai(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ai(t,e,r){return(e=ni(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ni(t){var e=si(t,"string");return typeof e=="symbol"?e:e+""}function si(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},mt.apply(null,arguments)}function Sr(t,e){if(t==null)return{};var r,a,s=ii(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function ii(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function ve(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Ir=(t,e,r,a,s)=>{var i=$e(r),o=$e(a),c=Math.min(Math.abs(i)/2,Math.abs(o)/2),l=o>=0?1:-1,u=i>=0?1:-1,d=o>=0&&i>=0||o<0&&i<0?1:0,p;if(c>0&&Array.isArray(s)){for(var m=[0,0,0,0],y=0,g=4;y<g;y++){var x,b=(x=s[y])!==null&&x!==void 0?x:0;m[y]=b>c?c:b}p=V(pr||(pr=ve(["M",",",""])),t,e+l*m[0]),m[0]>0&&(p+=V(hr||(hr=ve(["A ",",",",0,0,",",",",",""])),m[0],m[0],d,t+u*m[0],e)),p+=V(vr||(vr=ve(["L ",",",""])),t+r-u*m[1],e),m[1]>0&&(p+=V(gr||(gr=ve(["A ",",",",0,0,",`,
2
2
  `,",",""])),m[1],m[1],d,t+r,e+l*m[1])),p+=V(xr||(xr=ve(["L ",",",""])),t+r,e+a-l*m[2]),m[2]>0&&(p+=V(yr||(yr=ve(["A ",",",",0,0,",`,
3
3
  `,",",""])),m[2],m[2],d,t+r-u*m[2],e+a)),p+=V(br||(br=ve(["L ",",",""])),t+u*m[3],e+a),m[3]>0&&(p+=V(jr||(jr=ve(["A ",",",",0,0,",`,
4
4
  `,",",""])),m[3],m[3],d,t,e+a-l*m[3])),p+="Z"}else if(c>0&&s===+s&&s>0){var v=Math.min(c,s);p=V(wr||(wr=ve(["M ",",",`
@@ -28,4 +28,4 @@ import{r as f,b1 as Ke,bs as nn,bR as sn,c as U,j as n,u as Me,m as on,b as Ze,n
28
28
  A`,",",",0,0,",",",",","Z"])),S.x,S.y,i,i,+(d<0),w.x,w.y,a,a,+(I>180),+(d>0),j.x,j.y,i,i,+(d<0),N.x,N.y)}else h+=V(_r||(_r=Ae(["L",",","Z"])),e,r);return h},ui={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},di=t=>{var e=Fe(t,ui),{cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:l,startAngle:u,endAngle:d,className:p}=e;if(i<s||u===d)return null;var m=Ke("recharts-sector",p),y=i-s,g=ot(o,y,0,!0),x;return g>0&&Math.abs(u-d)<360?x=ci({cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:Math.min(g,y/2),forceCornerRadius:c,cornerIsExternal:l,startAngle:u,endAngle:d}):x=$a({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:u,endAngle:d}),f.createElement("path",Rt({},Ee(e),{className:m,d:x}))},Ut=t=>null;Ut.displayName="Cell";var Ct={},Lr;function mi(){return Lr||(Lr=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${s}]`}let a=r;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(r)===a}t.isPlainObject=e})(Ct)),Ct}var At,$r;function fi(){return $r||($r=1,At=mi().isPlainObject),At}var pi=fi();const hi=nn(pi);var Rr,Br,zr,Kr,Fr;function Wr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function qr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(r),!0).forEach(function(a){vi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function vi(t,e,r){return(e=gi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gi(t){var e=xi(t,"string");return typeof e=="symbol"?e:e+""}function xi(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ft(){return ft=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},ft.apply(null,arguments)}function We(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Vr=(t,e,r,a,s)=>{var i=r-a,o;return o=V(Rr||(Rr=We(["M ",",",""])),t,e),o+=V(Br||(Br=We(["L ",",",""])),t+r,e),o+=V(zr||(zr=We(["L ",",",""])),t+r-i/2,e+s),o+=V(Kr||(Kr=We(["L ",",",""])),t+r-i/2-a,e+s),o+=V(Fr||(Fr=We(["L ",","," Z"])),t,e),o},yi={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bi=t=>{var e=Fe(t,yi),{x:r,y:a,upperWidth:s,lowerWidth:i,height:o,className:c}=e,{animationEasing:l,animationDuration:u,animationBegin:d,isUpdateAnimationActive:p}=e,m=f.useRef(null),[y,g]=f.useState(-1),x=f.useRef(s),b=f.useRef(i),v=f.useRef(o),h=f.useRef(r),j=f.useRef(a),N=gt(t,"trapezoid-");if(f.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var k=m.current.getTotalLength();k&&g(k)}catch{}},[]),r!==+r||a!==+a||s!==+s||i!==+i||o!==+o||s===0&&i===0||o===0)return null;var P=Ke("recharts-trapezoid",c);if(!p)return f.createElement("g",null,f.createElement("path",ft({},Ee(e),{className:P,d:Vr(r,a,s,i,o)})));var w=x.current,S=b.current,O=v.current,I=h.current,E=j.current,D="0px ".concat(y===-1?1:y,"px"),T="".concat(y,"px 0px"),C=na(["strokeDasharray"],u,l);return f.createElement(xt,{animationId:N,key:N,canBegin:y>0,duration:u,easing:l,isActive:p,begin:d},k=>{var M=H(w,s,k),_=H(S,i,k),L=H(O,o,k),z=H(I,r,k),$=H(E,a,k);m.current&&(x.current=M,b.current=_,v.current=L,h.current=z,j.current=$);var K=k>0?{transition:C,strokeDasharray:T}:{strokeDasharray:D};return f.createElement("path",ft({},Ee(e),{className:P,d:Vr(z,$,M,_,L),ref:m,style:qr(qr({},K),e.style)}))})},ji=["option","shapeType","activeClassName"];function wi(t,e){if(t==null)return{};var r,a,s=Ni(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Ni(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Hr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function pt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(r),!0).forEach(function(a){Pi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Pi(t,e,r){return(e=Oi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oi(t){var e=Si(t,"string");return typeof e=="symbol"?e:e+""}function Si(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ii(t,e){return pt(pt({},e),t)}function ki(t,e){return t==="symbols"}function Gr(t){var{shapeType:e,elementProps:r}=t;switch(e){case"rectangle":return f.createElement(oi,r);case"trapezoid":return f.createElement(bi,r);case"sector":return f.createElement(di,r);case"symbols":if(ki(e))return f.createElement(La,r);break;case"curve":return f.createElement(Sn,r);default:return null}}function Ci(t){return f.isValidElement(t)?t.props:t}function Ra(t){var{option:e,shapeType:r,activeClassName:a="recharts-active-shape"}=t,s=wi(t,ji),i;if(f.isValidElement(e))i=f.cloneElement(e,pt(pt({},s),Ci(e)));else if(typeof e=="function")i=e(s,s.index);else if(hi(e)&&typeof e!="boolean"){var o=Ii(e,s);i=f.createElement(Gr,{shapeType:r,elementProps:o})}else{var c=s;i=f.createElement(Gr,{shapeType:r,elementProps:c})}return s.isActive?f.createElement(Be,{className:a},i):i}var Ba=(t,e,r)=>{var a=Ft();return(s,i)=>o=>{t?.(s,i,o),a(In({activeIndex:String(i),activeDataKey:e,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},za=t=>{var e=Ft();return(r,a)=>s=>{t?.(r,a,s),e(kn())}},Ka=(t,e,r)=>{var a=Ft();return(s,i)=>o=>{t?.(s,i,o),a(Cn({activeIndex:String(i),activeDataKey:e,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},Ur=(t,e,r)=>{var a=r??t;if(!ze(a))return ot(a,e,0)},Ai=(t,e,r)=>{var a={},s=t.filter(An),i=t.filter(u=>u.stackId==null),o=s.reduce((u,d)=>{var p=u[d.stackId];return p==null&&(p=[]),p.push(d),u[d.stackId]=p,u},a),c=Object.entries(o).map(u=>{var d,[p,m]=u,y=m.map(x=>x.dataKey),g=Ur(e,r,(d=m[0])===null||d===void 0?void 0:d.barSize);return{stackId:p,dataKeys:y,barSize:g}}),l=i.map(u=>{var d=[u.dataKey].filter(m=>m!=null),p=Ur(e,r,u.barSize);return{stackId:void 0,dataKeys:d,barSize:p}});return[...c,...l]};function Zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(r),!0).forEach(function(a){Ei(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Ei(t,e,r){return(e=Mi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mi(t){var e=Ti(t,"string");return typeof e=="symbol"?e:e+""}function Ti(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Di(t,e,r,a,s){var i,o=a.length;if(!(o<1)){var c=ot(t,r,0,!0),l,u=[];if(Tt((i=a[0])===null||i===void 0?void 0:i.barSize)){var d=!1,p=r/o,m=a.reduce((h,j)=>h+(j.barSize||0),0);m+=(o-1)*c,m>=r&&(m-=(o-1)*c,c=0),m>=r&&p>0&&(d=!0,p*=.9,m=o*p);var y=(r-m)/2>>0,g={offset:y-c,size:0};l=a.reduce((h,j)=>{var N,P={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:g.offset+g.size+c,size:d?p:(N=j.barSize)!==null&&N!==void 0?N:0}},w=[...h,P];return g=P.position,w},u)}else{var x=ot(e,r,0,!0);r-2*x-(o-1)*c<=0&&(c=0);var b=(r-2*x-(o-1)*c)/o;b>1&&(b>>=0);var v=Tt(s)?Math.min(b,s):b;l=a.reduce((h,j,N)=>[...h,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:x+(b+c)*N+(b-v)/2,size:v}}],u)}return l}}var _i=(t,e,r,a,s,i,o)=>{var c=ze(o)?e:o,l=Di(r,a,s!==i?s:i,t,c);return s!==i&&l!=null&&(l=l.map(u=>rt(rt({},u),{},{position:rt(rt({},u.position),{},{offset:u.position.offset-s/2})}))),l},Li=(t,e)=>{var r=En(e);if(!(!t||r==null||e==null)){var{stackId:a}=e;if(a!=null){var s=t[a];if(s){var{stackedData:i}=s;if(i)return i.find(o=>o.key===r)}}}},$i=(t,e)=>{if(!(t==null||e==null)){var r=t.find(a=>a.stackId===e.stackId&&e.dataKey!=null&&a.dataKeys.includes(e.dataKey));if(r!=null)return r.position}};function Ri(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&Tt(t.zIndex)?t.zIndex:e}var Bi=["children"];function zi(t,e){if(t==null)return{};var r,a,s=Ki(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Ki(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Fi={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Wi=f.createContext(Fi);function Fa(t){var{children:e}=t,r=zi(t,Bi);return f.createElement(Wi.Provider,{value:r},e)}var Wa=(t,e,r,a)=>Pe(t,"xAxis",e,a),qa=(t,e,r,a)=>Oe(t,"xAxis",e,a),Va=(t,e,r,a)=>Pe(t,"yAxis",r,a),Ha=(t,e,r,a)=>Oe(t,"yAxis",r,a),qi=me([Ie,Wa,Va,qa,Ha],(t,e,r,a,s)=>Tn(t,"xAxis")?ct(e,a,!1):ct(r,s,!1)),Vi=(t,e,r,a,s)=>s;function Hi(t){return t.type==="line"}var Gi=me([Wt,Vi],(t,e)=>t.filter(Hi).find(r=>r.id===e)),Ui=me([Ie,Wa,Va,qa,Ha,Gi,qi,Mn],(t,e,r,a,s,i,o,c)=>{var{chartData:l,dataStartIndex:u,dataEndIndex:d}=c;if(!(i==null||e==null||r==null||a==null||s==null||a.length===0||s.length===0||o==null||t!=="horizontal"&&t!=="vertical")){var{dataKey:p,data:m}=i,y;if(m!=null&&m.length>0?y=m:y=l?.slice(u,d+1),y!=null)return ho({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:s,dataKey:p,bandSize:o,displayedData:y})}}),Zi=["id"],Yi=["type","layout","connectNulls","needClip","shape"],Xi=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Ue(){return Ue=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ue.apply(null,arguments)}function Yr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function xe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(r),!0).forEach(function(a){Qi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Qi(t,e,r){return(e=Ji(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ji(t){var e=eo(t,"string");return typeof e=="symbol"?e:e+""}function eo(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zt(t,e){if(t==null)return{};var r,a,s=to(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function to(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ro=t=>{var{dataKey:e,name:r,stroke:a,legendType:s,hide:i}=t;return[{inactive:i,dataKey:e,type:s,color:a,value:jt(r,e),payload:t}]},ao=f.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:s,fill:i,name:o,hide:c,unit:l,tooltipType:u,id:d}=t,p={dataDefinedOnItem:r,getPosition:ua,settings:{stroke:a,strokeWidth:s,fill:i,dataKey:e,nameKey:void 0,name:jt(o,e),hide:c,type:u,color:a,unit:l,graphicalItemId:d}};return f.createElement(ca,{tooltipEntrySettings:p})}),Ga=(t,e)=>"".concat(e,"px ").concat(t-e,"px");function no(t,e){for(var r=t.length%2!==0?[...t,0]:t,a=[],s=0;s<e;++s)a=[...a,...r];return a}var so=(t,e,r)=>{var a=r.reduce((y,g)=>y+g);if(!a)return Ga(e,t);for(var s=Math.floor(t/a),i=t%a,o=e-t,c=[],l=0,u=0;l<r.length;u+=(d=r[l])!==null&&d!==void 0?d:0,++l){var d,p=r[l];if(p!=null&&u+p>i){c=[...r.slice(0,l),i-u];break}}var m=c.length%2===0?[0,o]:[o];return[...no(r,s),...c,...m].map(y=>"".concat(y,"px")).join(", ")};function io(t){var{clipPathId:e,points:r,props:a}=t,{dot:s,dataKey:i,needClip:o}=a,{id:c}=a,l=Zt(a,Zi),u=va(l);return f.createElement(Rn,{points:r,dot:s,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:u,needClip:o,clipPathId:e})}function oo(t){var{showLabels:e,children:r,points:a}=t,s=f.useMemo(()=>a?.map(i=>{var o,c,l={x:(o=i.x)!==null&&o!==void 0?o:0,y:(c=i.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return xe(xe({},l),{},{value:i.value,payload:i.payload,viewBox:l,parentViewBox:void 0,fill:void 0})}),[a]);return f.createElement(ha,{value:e?s:void 0},r)}function Xr(t){var{clipPathId:e,pathRef:r,points:a,strokeDasharray:s,props:i}=t,{type:o,layout:c,connectNulls:l,needClip:u,shape:d}=i,p=Zt(i,Yi),m=xe(xe({},Ee(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(e,")"):void 0,points:a,type:o,layout:c,connectNulls:l,strokeDasharray:s??i.strokeDasharray});return f.createElement(f.Fragment,null,a?.length>1&&f.createElement(Ra,Ue({shapeType:"curve",option:d},m,{pathRef:r})),f.createElement(io,{points:a,clipPathId:e,props:i}))}function lo(t){try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch{return 0}}function co(t){var{clipPathId:e,props:r,pathRef:a,previousPointsRef:s,longestAnimatedLengthRef:i}=t,{points:o,strokeDasharray:c,isAnimationActive:l,animationBegin:u,animationDuration:d,animationEasing:p,animateNewValues:m,width:y,height:g,onAnimationEnd:x,onAnimationStart:b}=r,v=s.current,h=gt(o,"recharts-line-"),j=f.useRef(h),[N,P]=f.useState(!1),w=!N,S=f.useCallback(()=>{typeof x=="function"&&x(),P(!1)},[x]),O=f.useCallback(()=>{typeof b=="function"&&b(),P(!0)},[b]),I=lo(a.current),E=f.useRef(0);j.current!==h&&(E.current=i.current,j.current=h);var D=E.current;return f.createElement(oo,{points:o,showLabels:w},r.children,f.createElement(xt,{animationId:h,begin:u,duration:d,isActive:l,easing:p,onAnimationEnd:S,onAnimationStart:O,key:h},T=>{var C=H(D,I+D,T),k=Math.min(C,I),M;if(l)if(c){var _="".concat(c).split(/[,\s]+/gim).map($=>parseFloat($));M=so(k,I,_)}else M=Ga(I,k);else M=c==null?void 0:String(c);if(T>0&&I>0&&(s.current=o,i.current=Math.max(i.current,k)),v){var L=v.length/o.length,z=T===1?o:o.map(($,K)=>{var B=Math.floor(K*L);if(v[B]){var A=v[B];return xe(xe({},$),{},{x:H(A.x,$.x,T),y:H(A.y,$.y,T)})}return m?xe(xe({},$),{},{x:H(y*2,$.x,T),y:H(g/2,$.y,T)}):xe(xe({},$),{},{x:$.x,y:$.y})});return s.current=z,f.createElement(Xr,{props:r,points:z,clipPathId:e,pathRef:a,strokeDasharray:M})}return f.createElement(Xr,{props:r,points:o,clipPathId:e,pathRef:a,strokeDasharray:M})}),f.createElement(pa,{label:r.label}))}function uo(t){var{clipPathId:e,props:r}=t,a=f.useRef(null),s=f.useRef(0),i=f.useRef(null);return f.createElement(co,{props:r,clipPathId:e,previousPointsRef:a,longestAnimatedLengthRef:s,pathRef:i})}var mo=(t,e)=>{var r,a;return{x:(r=t.x)!==null&&r!==void 0?r:void 0,y:(a=t.y)!==null&&a!==void 0?a:void 0,value:t.value,errorVal:Nt(t.payload,e)}};class fo extends f.Component{render(){var{hide:e,dot:r,points:a,className:s,xAxisId:i,yAxisId:o,top:c,left:l,width:u,height:d,id:p,needClip:m,zIndex:y}=this.props;if(e)return null;var g=Ke("recharts-line",s),x=p,{r:b,strokeWidth:v}=_n(r),h=Ln(r),j=b*2+v,N=m?"url(#clipPath-".concat(h?"":"dots-").concat(x,")"):void 0;return f.createElement(wt,{zIndex:y},f.createElement(Be,{className:g},m&&f.createElement("defs",null,f.createElement(fa,{clipPathId:x,xAxisId:i,yAxisId:o}),!h&&f.createElement("clipPath",{id:"clipPath-dots-".concat(x)},f.createElement("rect",{x:l-j/2,y:c-j/2,width:u+j,height:d+j}))),f.createElement(Fa,{xAxisId:i,yAxisId:o,data:a,dataPointFormatter:mo,errorBarOffset:0},f.createElement(uo,{props:this.props,clipPathId:x}))),f.createElement($n,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:N}))}}var Ua={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:yt.line,type:"linear"};function po(t){var e=Fe(t,Ua),{activeDot:r,animateNewValues:a,animationBegin:s,animationDuration:i,animationEasing:o,connectNulls:c,dot:l,hide:u,isAnimationActive:d,label:p,legendType:m,xAxisId:y,yAxisId:g,id:x}=e,b=Zt(e,Xi),{needClip:v}=da(y,g),h=Dn(),j=ma(),N=bt(),P=Ge(E=>Ui(E,y,g,N,x));if(j!=="horizontal"&&j!=="vertical"||P==null||h==null)return null;var{height:w,width:S,x:O,y:I}=h;return f.createElement(fo,Ue({},b,{id:x,connectNulls:c,dot:l,activeDot:r,animateNewValues:a,animationBegin:s,animationDuration:i,animationEasing:o,isAnimationActive:d,hide:u,label:p,legendType:m,xAxisId:y,yAxisId:g,points:P,layout:j,height:w,width:S,left:O,top:I,needClip:v}))}function ho(t){var{layout:e,xAxis:r,yAxis:a,xAxisTicks:s,yAxisTicks:i,dataKey:o,bandSize:c,displayedData:l}=t;return l.map((u,d)=>{var p=Nt(u,o);if(e==="horizontal"){var m=tr({axis:r,ticks:s,bandSize:c,entry:u,index:d}),y=ze(p)?null:a.scale.map(p);return{x:m,y:y??null,value:p,payload:u}}var g=ze(p)?null:r.scale.map(p),x=tr({axis:a,ticks:i,bandSize:c,entry:u,index:d});return g==null||x==null?null:{x:g,y:x,value:p,payload:u}}).filter(Boolean)}function vo(t){var e=Fe(t,Ua),r=bt();return f.createElement(ia,{id:e.id,type:"line"},a=>f.createElement(f.Fragment,null,f.createElement(oa,{legendPayload:ro(e)}),f.createElement(ao,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),f.createElement(la,{type:"line",id:a,data:e.data,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,hide:e.hide,isPanorama:r}),f.createElement(po,Ue({},e,{id:a}))))}var Za=f.memo(vo,sa);Za.displayName="Line";function Bt(){return Bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Bt.apply(null,arguments)}function ht(t){return f.createElement(Ra,Bt({shapeType:"rectangle",activeClassName:"recharts-active-bar"},t))}var go=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(a,s)=>{if(Ve(e))return e;var i=Ve(a)||ze(a);return i?e(a,s):(i||sn(!1),r)}},xo=(t,e,r)=>r,yo=(t,e)=>e,Ye=me([Wt,yo],(t,e)=>t.filter(r=>r.type==="bar").find(r=>r.id===e)),bo=me([Ye],t=>t?.maxBarSize),jo=(t,e,r,a)=>a,wo=me([Ie,Wt,Te,De,xo],(t,e,r,a,s)=>e.filter(i=>t==="horizontal"?i.xAxisId===r:i.yAxisId===a).filter(i=>i.isPanorama===s).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),No=(t,e,r)=>{var a=Ie(t),s=Te(t,e),i=De(t,e);if(!(s==null||i==null))return a==="horizontal"?rr(t,"yAxis",i,r):rr(t,"xAxis",s,r)},Po=(t,e)=>{var r=Ie(t),a=Te(t,e),s=De(t,e);if(!(a==null||s==null))return r==="horizontal"?ar(t,"xAxis",a):ar(t,"yAxis",s)},Oo=me([wo,qn,Po],Ai),So=(t,e,r)=>{var a,s,i=Ye(t,e);if(i==null)return 0;var o=Te(t,e),c=De(t,e);if(o==null||c==null)return 0;var l=Ie(t),u=ga(t),{maxBarSize:d}=i,p=ze(d)?u:d,m,y;return l==="horizontal"?(m=Pe(t,"xAxis",o,r),y=Oe(t,"xAxis",o,r)):(m=Pe(t,"yAxis",c,r),y=Oe(t,"yAxis",c,r)),(a=(s=ct(m,y,!0))!==null&&s!==void 0?s:p)!==null&&a!==void 0?a:0},Ya=(t,e,r)=>{var a=Ie(t),s=Te(t,e),i=De(t,e);if(!(s==null||i==null)){var o,c;return a==="horizontal"?(o=Pe(t,"xAxis",s,r),c=Oe(t,"xAxis",s,r)):(o=Pe(t,"yAxis",i,r),c=Oe(t,"yAxis",i,r)),ct(o,c)}},Io=me([Oo,ga,Fn,Wn,So,Ya,bo],_i),ko=(t,e,r)=>{var a=Te(t,e);if(a!=null)return Pe(t,"xAxis",a,r)},Co=(t,e,r)=>{var a=De(t,e);if(a!=null)return Pe(t,"yAxis",a,r)},Ao=(t,e,r)=>{var a=Te(t,e);if(a!=null)return Oe(t,"xAxis",a,r)},Eo=(t,e,r)=>{var a=De(t,e);if(a!=null)return Oe(t,"yAxis",a,r)},Mo=me([Io,Ye],$i),To=me([No,Ye],Li),Do=me([Bn,zn,ko,Co,Ao,Eo,Mo,Ie,Kn,Ya,To,Ye,jo],(t,e,r,a,s,i,o,c,l,u,d,p,m)=>{var{chartData:y,dataStartIndex:g,dataEndIndex:x}=l;if(!(p==null||o==null||e==null||c!=="horizontal"&&c!=="vertical"||r==null||a==null||s==null||i==null||u==null)){var{data:b}=p,v;if(b!=null&&b.length>0?v=b:v=y?.slice(g,x+1),v!=null)return ll({layout:c,barSettings:p,pos:o,parentViewBox:e,bandSize:u,xAxis:r,yAxis:a,xAxisTicks:s,yAxisTicks:i,stackedData:d,displayedData:v,offset:t,cells:m,dataStartIndex:g})}}),_o=["index"];function zt(){return zt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},zt.apply(null,arguments)}function Lo(t,e){if(t==null)return{};var r,a,s=$o(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function $o(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Xa=f.createContext(void 0),Ro=t=>{var e=f.useContext(Xa);if(e!=null)return e.stackId;if(t!=null)return Vn(t)},Bo=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),zo=t=>{var e=f.useContext(Xa);if(e!=null){var{stackId:r}=e;return"url(#".concat(Bo(r,t),")")}},Qa=t=>{var{index:e}=t,r=Lo(t,_o),a=zo(e);return f.createElement(Be,zt({className:"recharts-bar-stack-layer",clipPath:a},r))},Ko=["onMouseEnter","onMouseLeave","onClick"],Fo=["value","background","tooltipPosition"],Wo=["id"],qo=["onMouseEnter","onClick","onMouseLeave"];function je(){return je=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},je.apply(null,arguments)}function Qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(r),!0).forEach(function(a){Vo(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Vo(t,e,r){return(e=Ho(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ho(t){var e=Go(t,"string");return typeof e=="symbol"?e:e+""}function Go(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vt(t,e){if(t==null)return{};var r,a,s=Uo(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(s[r]=t[r])}return s}function Uo(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Zo=t=>{var{dataKey:e,name:r,fill:a,legendType:s,hide:i}=t;return[{inactive:i,dataKey:e,type:s,color:a,value:jt(r,e),payload:t}]},Yo=f.memo(t=>{var{dataKey:e,stroke:r,strokeWidth:a,fill:s,name:i,hide:o,unit:c,tooltipType:l,id:u}=t,d={dataDefinedOnItem:void 0,getPosition:ua,settings:{stroke:r,strokeWidth:a,fill:s,dataKey:e,nameKey:void 0,name:jt(i,e),hide:o,type:l,color:s,unit:c,graphicalItemId:u}};return f.createElement(ca,{tooltipEntrySettings:d})});function Xo(t){var e=Ge(xa),{data:r,dataKey:a,background:s,allOtherBarProps:i}=t,{onMouseEnter:o,onMouseLeave:c,onClick:l}=i,u=vt(i,Ko),d=Ba(o,a,i.id),p=za(c),m=Ka(l,a,i.id);if(!s||r==null)return null;var y=Gn(s);return f.createElement(wt,{zIndex:Ri(s,yt.barBackground)},r.map((g,x)=>{var{value:b,background:v,tooltipPosition:h}=g,j=vt(g,Fo);if(!v)return null;var N=d(g,x),P=p(g,x),w=m(g,x),S=J(J(J(J(J({option:s,isActive:String(x)===e},j),{},{fill:"#eee"},v),y),ya(u,g,x)),{},{onMouseEnter:N,onMouseLeave:P,onClick:w,dataKey:a,index:x,className:"recharts-bar-background-rectangle"});return f.createElement(ht,je({key:"background-bar-".concat(x)},S))}))}function Qo(t){var{showLabels:e,children:r,rects:a}=t,s=a?.map(i=>{var o={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return J(J({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return f.createElement(ha,{value:e?s:void 0},r)}function Jo(t){var{shape:e,activeBar:r,baseProps:a,entry:s,index:i,dataKey:o}=t,c=Ge(xa),l=Ge(Yn),u=r&&String(i)===c&&(l==null||o===l),d=u?r:e;return u?f.createElement(wt,{zIndex:yt.activeBar},f.createElement(Qa,{index:i},f.createElement(ht,je({},a,{name:String(a.name)},s,{isActive:u,option:d,index:i,dataKey:o})))):f.createElement(ht,je({},a,{name:String(a.name)},s,{isActive:u,option:d,index:i,dataKey:o}))}function el(t){var{shape:e,baseProps:r,entry:a,index:s,dataKey:i}=t;return f.createElement(ht,je({},r,{name:String(r.name)},a,{isActive:!1,option:e,index:s,dataKey:i}))}function tl(t){var e,{data:r,props:a}=t,s=(e=va(a))!==null&&e!==void 0?e:{},{id:i}=s,o=vt(s,Wo),{shape:c,dataKey:l,activeBar:u}=a,{onMouseEnter:d,onClick:p,onMouseLeave:m}=a,y=vt(a,qo),g=Ba(d,l,i),x=za(m),b=Ka(p,l,i);return r?f.createElement(f.Fragment,null,r.map((v,h)=>f.createElement(Qa,je({index:h,key:"rectangle-".concat(v?.x,"-").concat(v?.y,"-").concat(v?.value,"-").concat(h),className:"recharts-bar-rectangle"},ya(y,v,h),{onMouseEnter:g(v,h),onMouseLeave:x(v,h),onClick:b(v,h)}),u?f.createElement(Jo,{shape:c,activeBar:u,baseProps:o,entry:v,index:h,dataKey:l}):f.createElement(el,{shape:c,baseProps:o,entry:v,index:h,dataKey:l})))):null}function rl(t){var{props:e,previousRectanglesRef:r}=t,{data:a,layout:s,isAnimationActive:i,animationBegin:o,animationDuration:c,animationEasing:l,onAnimationEnd:u,onAnimationStart:d}=e,p=r.current,m=gt(e,"recharts-bar-"),[y,g]=f.useState(!1),x=!y,b=f.useCallback(()=>{typeof u=="function"&&u(),g(!1)},[u]),v=f.useCallback(()=>{typeof d=="function"&&d(),g(!0)},[d]);return f.createElement(Qo,{showLabels:x,rects:a},f.createElement(xt,{animationId:m,begin:o,duration:c,isActive:i,easing:l,onAnimationEnd:b,onAnimationStart:v,key:m},h=>{var j=h===1?a:a?.map((N,P)=>{var w=p&&p[P];if(w)return J(J({},N),{},{x:H(w.x,N.x,h),y:H(w.y,N.y,h),width:H(w.width,N.width,h),height:H(w.height,N.height,h)});if(s==="horizontal"){var S=H(0,N.height,h),O=H(N.stackedBarStart,N.y,h);return J(J({},N),{},{y:O,height:S})}var I=H(0,N.width,h),E=H(N.stackedBarStart,N.x,h);return J(J({},N),{},{width:I,x:E})});return h>0&&(r.current=j??null),j==null?null:f.createElement(Be,null,f.createElement(tl,{props:e,data:j}))}),f.createElement(pa,{label:e.label}),e.children)}function al(t){var e=f.useRef(null);return f.createElement(rl,{previousRectanglesRef:e,props:t})}var Ja=0,nl=(t,e)=>{var r=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:r,errorVal:Nt(t,e)}};class sl extends f.PureComponent{render(){var{hide:e,data:r,dataKey:a,className:s,xAxisId:i,yAxisId:o,needClip:c,background:l,id:u}=this.props;if(e||r==null)return null;var d=Ke("recharts-bar",s),p=u;return f.createElement(Be,{className:d,id:u},c&&f.createElement("defs",null,f.createElement(fa,{clipPathId:p,xAxisId:i,yAxisId:o})),f.createElement(Be,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(p,")"):void 0},f.createElement(Xo,{data:r,dataKey:a,background:l,allOtherBarProps:this.props}),f.createElement(al,this.props)))}}var il={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Ja,xAxisId:0,yAxisId:0,zIndex:yt.bar};function ol(t){var{xAxisId:e,yAxisId:r,hide:a,legendType:s,minPointSize:i,activeBar:o,animationBegin:c,animationDuration:l,animationEasing:u,isAnimationActive:d}=t,{needClip:p}=da(e,r),m=ma(),y=bt(),g=Hn(t.children,Ut),x=Ge(h=>Do(h,t.id,y,g));if(m!=="vertical"&&m!=="horizontal")return null;var b,v=x?.[0];return v==null||v.height==null||v.width==null?b=0:b=m==="vertical"?v.height/2:v.width/2,f.createElement(Fa,{xAxisId:e,yAxisId:r,data:x,dataPointFormatter:nl,errorBarOffset:b},f.createElement(sl,je({},t,{layout:m,needClip:p,data:x,xAxisId:e,yAxisId:r,hide:a,legendType:s,minPointSize:i,activeBar:o,animationBegin:c,animationDuration:l,animationEasing:u,isAnimationActive:d})))}function ll(t){var{layout:e,barSettings:{dataKey:r,minPointSize:a},pos:s,bandSize:i,xAxis:o,yAxis:c,xAxisTicks:l,yAxisTicks:u,stackedData:d,displayedData:p,offset:m,cells:y,parentViewBox:g,dataStartIndex:x}=t,b=e==="horizontal"?c:o,v=d?b.scale.domain():null,h=Un({numericAxis:b}),j=b.scale.map(h);return p.map((N,P)=>{var w,S,O,I,E,D;if(d){var T=d[P+x];if(T==null)return null;w=Zn(T,v)}else w=Nt(N,r),Array.isArray(w)||(w=[h,w]);var C=go(a,Ja)(w[1],P);if(e==="horizontal"){var k,M=c.scale.map(w[0]),_=c.scale.map(w[1]);if(M==null||_==null)return null;S=nr({axis:o,ticks:l,bandSize:i,offset:s.offset,entry:N,index:P}),O=(k=_??M)!==null&&k!==void 0?k:void 0,I=s.size;var L=M-_;if(E=Xn(L)?0:L,D={x:S,y:m.top,width:I,height:m.height},Math.abs(C)>0&&Math.abs(E)<Math.abs(C)){var z=lt(E||C)*(Math.abs(C)-Math.abs(E));O-=z,E+=z}}else{var $=o.scale.map(w[0]),K=o.scale.map(w[1]);if($==null||K==null)return null;if(S=$,O=nr({axis:c,ticks:u,bandSize:i,offset:s.offset,entry:N,index:P}),I=K-$,E=s.size,D={x:m.left,y:O,width:m.width,height:E},Math.abs(C)>0&&Math.abs(I)<Math.abs(C)){var B=lt(I||C)*(Math.abs(C)-Math.abs(I));I+=B}}if(S==null||O==null||I==null||E==null)return null;var A=J(J({},N),{},{stackedBarStart:j,x:S,y:O,width:I,height:E,value:d?w:w[1],payload:N,background:D,tooltipPosition:{x:S+I/2,y:O+E/2},parentViewBox:g},y&&y[P]&&y[P].props);return A}).filter(Boolean)}function cl(t){var e=Fe(t,il),r=Ro(e.stackId),a=bt();return f.createElement(ia,{id:e.id,type:"bar"},s=>f.createElement(f.Fragment,null,f.createElement(oa,{legendPayload:Zo(e)}),f.createElement(Yo,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:s}),f.createElement(la,{type:"bar",id:s,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:r,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:a}),f.createElement(wt,{zIndex:e.zIndex},f.createElement(ol,je({},e,{id:s})))))}var en=f.memo(cl,sa);en.displayName="Bar";var ul=["axis"],dl=f.forwardRef((t,e)=>f.createElement(ba,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ul,tooltipPayloadSearcher:ja,categoricalChartProps:t,ref:e})),ml=["axis","item"],fl=f.forwardRef((t,e)=>f.createElement(ba,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ml,tooltipPayloadSearcher:ja,categoricalChartProps:t,ref:e}));function pl(t){const e=U.c(49),{log:r,isExpanded:a,connection:s,virtualMcpName:i,onToggle:o,lastLogRef:c}=t;let l,u;if(e[0]!==r.timestamp){const k=new Date(r.timestamp);l=k.toLocaleDateString("en-US",{month:"short",day:"numeric"}),u=k.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=l,e[2]=u}else l=e[1],u=e[2];const d=u,p=a?"bg-muted/30 hover:bg-accent/80":"hover:bg-muted/40";let m;e[3]!==p?(m=Se("h-14 md:h-16 transition-colors cursor-pointer",p),e[3]=p,e[4]=m):m=e[4];let y;e[5]!==a?(y=n.jsx(he,{className:"w-10 md:w-12 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:a?n.jsx(Et,{size:16,className:"text-muted-foreground"}):n.jsx(jn,{size:16,className:"text-muted-foreground"})})}),e[5]=a,e[6]=y):y=e[6];const g=s?.icon||null;let x;e[7]!==r.connectionTitle||e[8]!==g?(x=n.jsx(he,{className:"w-12 md:w-16 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:n.jsx(He,{icon:g,name:r.connectionTitle,size:"xs",className:"shadow-sm"})})}),e[7]=r.connectionTitle,e[8]=g,e[9]=x):x=e[9];let b;e[10]!==r.toolName?(b=n.jsx("div",{className:"text-xs font-medium text-foreground truncate block",children:r.toolName}),e[10]=r.toolName,e[11]=b):b=e[11];let v;e[12]!==r.connectionTitle?(v=n.jsx("div",{className:"text-xs text-muted-foreground truncate block",children:r.connectionTitle}),e[12]=r.connectionTitle,e[13]=v):v=e[13];let h;e[14]!==b||e[15]!==v?(h=n.jsxs(he,{className:"min-w-0 pr-2 md:pr-4",children:[b,v]}),e[14]=b,e[15]=v,e[16]=h):h=e[16];let j;e[17]!==i?(j=n.jsx(he,{className:"w-24 md:w-32 px-2 md:px-3 text-xs text-muted-foreground",children:n.jsx("div",{className:"truncate",children:i})}),e[17]=i,e[18]=j):j=e[18];let N;e[19]!==r.userName?(N=n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:r.userName}),e[19]=r.userName,e[20]=N):N=e[20];let P;e[21]!==l?(P=n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:l}),e[21]=l,e[22]=P):P=e[22];let w;e[23]!==d?(w=n.jsx(he,{className:"w-20 md:w-28 px-2 md:px-3 text-xs text-muted-foreground",children:d}),e[23]=d,e[24]=w):w=e[24];let S;e[25]!==r.durationMs?(S=n.jsxs(he,{className:"w-16 md:w-20 px-2 md:px-3 text-xs text-muted-foreground font-mono text-right",children:[r.durationMs,"ms"]}),e[25]=r.durationMs,e[26]=S):S=e[26];const O=r.isError?"destructive":"success",I=r.isError?"Error":"OK";let E;e[27]!==O||e[28]!==I?(E=n.jsx(he,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"flex items-center justify-end",children:n.jsx(it,{variant:O,className:"text-xs px-1.5 md:px-2 py-0.5 md:py-1",children:I})})}),e[27]=O,e[28]=I,e[29]=E):E=e[29];let D;e[30]!==c||e[31]!==o||e[32]!==j||e[33]!==N||e[34]!==P||e[35]!==w||e[36]!==S||e[37]!==E||e[38]!==m||e[39]!==y||e[40]!==x||e[41]!==h?(D=n.jsxs(Mt,{ref:c,className:m,onClick:o,children:[y,x,h,j,N,P,w,S,E]}),e[30]=c,e[31]=o,e[32]=j,e[33]=N,e[34]=P,e[35]=w,e[36]=S,e[37]=E,e[38]=m,e[39]=y,e[40]=x,e[41]=h,e[42]=D):D=e[42];let T;e[43]!==a||e[44]!==r?(T=a&&n.jsx(Mt,{children:n.jsx(he,{colSpan:9,className:"p-0",children:n.jsx(hn,{log:r})})}),e[43]=a,e[44]=r,e[45]=T):T=e[45];let C;return e[46]!==D||e[47]!==T?(C=n.jsxs(f.Fragment,{children:[D,T]}),e[46]=D,e[47]=T,e[48]=C):C=e[48],C}function ke(t){const e=U.c(24),{title:r,description:a,action:s,children:i,className:o,noPadding:c,onTitleClick:l}=t,u=c===void 0?!1:c;let d;e[0]!==r?(d=typeof r=="string"?n.jsx("div",{className:"text-sm font-medium text-foreground",children:r}):r,e[0]=r,e[1]=d):d=e[1];const p=d;let m;e[2]!==o?(m=Se("bg-background flex flex-col",o),e[2]=o,e[3]=m):m=e[3];let y;e[4]!==l||e[5]!==p?(y=l?n.jsx("button",{onClick:l,className:"text-left hover:text-foreground transition-colors cursor-pointer",children:p}):p,e[4]=l,e[5]=p,e[6]=y):y=e[6];let g;e[7]!==a?(g=a?n.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a}):null,e[7]=a,e[8]=g):g=e[8];let x;e[9]!==y||e[10]!==g?(x=n.jsxs("div",{className:"min-w-0",children:[y,g]}),e[9]=y,e[10]=g,e[11]=x):x=e[11];let b;e[12]!==s?(b=s?n.jsx("div",{className:"shrink-0",children:s}):null,e[12]=s,e[13]=b):b=e[13];let v;e[14]!==x||e[15]!==b?(v=n.jsxs("header",{className:"flex items-center justify-between gap-4 p-5",children:[x,b]}),e[14]=x,e[15]=b,e[16]=v):v=e[16];let h;e[17]!==i||e[18]!==u?(h=u?n.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-h-0",children:i}):n.jsx("div",{className:"px-5 pb-5 pt-2",children:i}),e[17]=i,e[18]=u,e[19]=h):h=e[19];let j;return e[20]!==m||e[21]!==v||e[22]!==h?(j=n.jsxs("div",{className:m,children:[v,h]}),e[20]=m,e[21]=v,e[22]=h,e[23]=j):j=e[23],j}function hl(t,e){if(t.length===0)return 0;const r=[...t].sort((s,i)=>s-i),a=Math.max(0,Math.min(r.length-1,Math.ceil(e*r.length)-1));return r[a]??0}function vl(t,e){return e<=9e7?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function gl(t,e){const o=e-t;return o<=36e5?Math.max(1,Math.min(60,Math.ceil(o/6e4))):o<=9e7?Math.max(1,Math.min(25,Math.ceil(o/36e5))):Math.max(1,Math.min(31,Math.ceil(o/864e5)))}function xl(t,e,r,a){const s=e.getTime(),i=r.getTime(),o=Math.max(1,i-s),c=gl(s,i),l=Math.max(1,Math.floor(o/c)),u=[];for(let d=0;d<c;d++){const p=new Date(s+d*l),m=p.toISOString();u.push({t:m,ts:p.getTime(),label:vl(p,o),calls:0,errors:0,durations:[]})}for(const d of t){const p=new Date(d.timestamp).getTime(),m=Math.floor((p-s)/l),y=Math.max(0,Math.min(c-1,m)),g=u[y];g&&(g.calls+=1,d.isError&&(g.errors+=1),Number.isFinite(d.durationMs)&&g.durations.push(d.durationMs))}return u.map(d=>({t:d.t,ts:d.ts,label:d.label,calls:d.calls,errors:d.errors,errorRate:d.calls>0?d.errors/d.calls*100:0,p95:Math.round(hl(d.durations,.95))}))}function yl(t,e,r,a){const s=a??t.length,i=t.filter(l=>l.isError).length,o=t.length>0?t.reduce((l,u)=>l+u.durationMs,0)/t.length:0,c=xl(t,e.startDate,e.endDate);return{totalCalls:s,totalErrors:i,avgDurationMs:o,data:c}}function bl(t){const e=U.c(29),{data:r,dataKey:a,colorNum:s,chartHeight:i}=t,o=`var(--chart-${s})`;let c;e[0]!==i?(c=Se(i,"w-full"),e[0]=i,e[1]=c):c=e[1];let l;e[2]!==o||e[3]!==a?(l={label:a,color:o},e[2]=o,e[3]=a,e[4]=l):l=e[4];let u;e[5]!==a||e[6]!==l?(u={[a]:l},e[5]=a,e[6]=l,e[7]=u):u=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d={left:0,right:0,top:0,bottom:0},e[8]=d):d=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(wa,{content:n.jsx(Qn,{indicator:"line",labelFormatter:jl})}),e[9]=p):p=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=[0,0,0,0],e[10]=m):m=e[10];let y;if(e[11]!==o||e[12]!==r||e[13]!==a){let v;e[15]!==o||e[16]!==a?(v=(h,j)=>n.jsx(Ut,{fill:h[a]===0?"var(--muted-foreground)":o,fillOpacity:h[a]===0?.25:1},`cell-${j}`),e[15]=o,e[16]=a,e[17]=v):v=e[17],y=r.map(v),e[11]=o,e[12]=r,e[13]=a,e[14]=y}else y=e[14];let g;e[18]!==o||e[19]!==a||e[20]!==y?(g=n.jsx(en,{dataKey:a,fill:o,radius:m,minPointSize:1,children:y}),e[18]=o,e[19]=a,e[20]=y,e[21]=g):g=e[21];let x;e[22]!==r||e[23]!==g?(x=n.jsxs(fl,{data:r,margin:d,children:[p,g]}),e[22]=r,e[23]=g,e[24]=x):x=e[24];let b;return e[25]!==c||e[26]!==u||e[27]!==x?(b=n.jsx(Na,{className:c,config:u,children:x}),e[25]=c,e[26]=u,e[27]=x,e[28]=b):b=e[28],b}function jl(t,e){const r=Array.isArray(e)?e[0]:void 0;return r&&typeof r=="object"&&"payload"in r?r.payload?.label??"":""}const wl=[{label:"Tool Calls",dataKey:"calls",colorNum:1,getValue:t=>t.totalCalls.toLocaleString()},{label:"Errors",dataKey:"errors",colorNum:3,getValue:t=>t.totalErrors.toLocaleString()},{label:"Latency",dataKey:"p95",colorNum:4,getValue:t=>`${Math.round(t.avgDurationMs)}ms`}];function Nl(t){const e=U.c(14),{stats:r,chartHeight:a,showDateLabels:s,dateRange:i,compact:o,onKPIClick:c}=t,l=a===void 0?"h-[40px]":a,u=s===void 0?!1:s,d=o===void 0?!1:o,p=Pl,m=d?"flex flex-col gap-0.5 md:gap-1":"flex flex-col gap-1",y=d?"text-xs md:text-sm text-muted-foreground":"text-sm text-muted-foreground",g=d?"text-sm md:text-lg font-medium":"text-lg font-medium";let x;e[0]!==i||e[1]!==u?(x=u&&i&&n.jsxs("div",{className:"flex items-start justify-between text-xs text-muted-foreground w-full",children:[n.jsx("p",{children:p(i.startDate)}),n.jsx("p",{children:p(i.endDate)})]}),e[0]=i,e[1]=u,e[2]=x):x=e[2];const b=x,v=!!c;let h;e[3]!==l||e[4]!==b||e[5]!==v||e[6]!==y||e[7]!==c||e[8]!==r||e[9]!==m||e[10]!==g?(h=wl.map(N=>{const{label:P,dataKey:w,colorNum:S,getValue:O}=N;return n.jsx(ke,{title:n.jsxs("div",{className:m,children:[n.jsx("p",{className:y,children:P}),n.jsx("p",{className:g,children:O(r)})]}),children:n.jsxs("div",{className:Se("flex flex-col gap-2 w-full",v&&"cursor-pointer hover:opacity-80 transition-opacity"),onClick:c?()=>c(w):void 0,children:[n.jsx(bl,{data:r.data,dataKey:w,colorNum:S,chartHeight:l}),b]})},w)}),e[3]=l,e[4]=b,e[5]=v,e[6]=y,e[7]=c,e[8]=r,e[9]=m,e[10]=g,e[11]=h):h=e[11];let j;return e[12]!==h?(j=n.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:h}),e[12]=h,e[13]=j):j=e[13],j}function Pl(t){return t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function Ol(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(Sl)}),t[0]=e):e=t[0],e}function Sl(t,e){return n.jsx(ke,{title:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-6 w-16 rounded bg-muted animate-pulse"})]}),children:n.jsx("div",{className:"flex flex-col gap-2 w-full",children:n.jsx("div",{className:"h-[40px] w-full rounded bg-muted animate-pulse"})})},e)}function Il(){const{org:t,project:e,locator:r}=Me(),a=on(),s=Ze(),i=qt({connectionId:Vt,orgId:t.id}),[o,c]=f.useState(null),[l,u]=f.useState(!1),[d,p]=f.useState(!1),{data:m}=ln({queryKey:at.monitoringDashboards(r),queryFn:async()=>{if(!i)throw new Error("MCP client is not available");const h=await i.callTool({name:"MONITORING_DASHBOARD_LIST",arguments:{}});return h.structuredContent??h}}),y=m?.dashboards??[],g=async()=>{if(i){p(!0);try{const h=await i.callTool({name:"MONITORING_DASHBOARD_CREATE",arguments:{name:"Untitled Dashboard",widgets:[{id:crypto.randomUUID(),name:"New Widget",type:"metric",source:{path:"$.usage.total_tokens",from:"output"},aggregation:{fn:"sum"}}]}}),j=(h.structuredContent??h).id;a.invalidateQueries({queryKey:at.monitoringDashboards(r)}),s({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:j}})}catch(h){Ot.error("Failed to create dashboard"),console.error(h)}finally{p(!1)}}},x=h=>{s({to:"/$org/$project/monitoring/dashboards/$dashboardId",params:{org:t.slug,project:e.slug,dashboardId:h}})},b=h=>{s({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:h}})},v=async h=>{if(i){u(!0);try{await i.callTool({name:"MONITORING_DASHBOARD_DELETE",arguments:{id:h}}),Ot.success("Dashboard deleted"),a.invalidateQueries({queryKey:at.monitoringDashboards(r)})}catch(j){Ot.error("Failed to delete dashboard"),console.error(j)}finally{u(!1),c(null)}}};return n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[y.length===0?n.jsx(Kt,{title:"No dashboards yet",description:"Create a dashboard to aggregate and visualize your monitoring data",image:n.jsx(_t,{size:48,className:"text-muted-foreground/50"}),actions:n.jsxs(be,{onClick:g,size:"sm",disabled:d,children:[n.jsx(Pa,{size:16,className:"mr-1.5"}),"Create Dashboard"]})}):n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:y.map(h=>n.jsx(ts,{connection:{id:h.id,title:h.name,description:h.description},fallbackIcon:n.jsx(_t,{}),onClick:()=>x(h.id),headerActions:n.jsxs(rs,{children:[n.jsx(as,{asChild:!0,children:n.jsx(be,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:j=>j.stopPropagation(),children:n.jsx(es,{size:20})})}),n.jsxs(ns,{align:"end",onClick:j=>j.stopPropagation(),children:[n.jsxs(sr,{onClick:()=>b(h.id),children:[n.jsx(vn,{size:16}),"Edit"]}),n.jsxs(sr,{onClick:()=>c(h.id),className:"text-destructive",children:[n.jsx(Oa,{size:16}),"Delete"]})]})]}),footer:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[n.jsxs("span",{children:[h.widgets.length," widget",h.widgets.length!==1?"s":""]}),n.jsx("span",{children:"·"}),n.jsx("span",{children:new Date(h.createdAt).toLocaleDateString()})]})},h.id))}),n.jsx(ss,{open:!!o,onOpenChange:()=>c(null),children:n.jsxs(is,{children:[n.jsxs(os,{children:[n.jsx(ls,{children:"Delete Dashboard"}),n.jsx(cs,{children:"Are you sure you want to delete this dashboard? This action cannot be undone."})]}),n.jsxs(us,{children:[n.jsx(ds,{disabled:l,children:"Cancel"}),n.jsx(ms,{disabled:l,onClick:()=>o&&v(o),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:l?"Deleting...":"Delete"})]})]})})]})}function kl(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"h-6 w-40 bg-muted rounded animate-pulse"}),n.jsx("div",{className:"h-4 w-64 bg-muted rounded animate-pulse mt-2"})]}),n.jsx("div",{className:"h-8 w-32 bg-muted rounded animate-pulse"})]}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[e,n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(Cl)})]}),t[1]=r):r=t[1],r}function Cl(t){return n.jsxs("div",{className:"border rounded-lg p-4",children:[n.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse mb-2"}),n.jsx("div",{className:"h-4 w-full bg-muted rounded animate-pulse mb-3"}),n.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]},t)}function Al(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboards"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(qe,{fallback:e,children:n.jsx(f.Suspense,{fallback:n.jsx(kl,{}),children:n.jsx(Il,{})})}),t[1]=r):r=t[1],r}function El(t,e,r=!1){const a=f.useRef(null),s=f.useRef(t),i=f.useRef(e),o=f.useRef(r);return s.current=t,i.current=e,o.current=r,l=>{a.current&&a.current.disconnect(),a.current=new IntersectionObserver(u=>{u[0]?.isIntersecting&&i.current&&!o.current&&s.current()}),l&&a.current.observe(l)}}function Jr(t){const e=U.c(72),{options:r,onValueChange:a,defaultValue:s,placeholder:i,variant:o,animation:c,maxCount:l,modalPopover:u,asChild:d,className:p,disabled:m}=t;let y;e[0]!==s?(y=s===void 0?[]:s,e[0]=s,e[1]=y):y=e[1];const g=y,x=i===void 0?"Select items":i,b=o===void 0?"default":o,v=c===void 0?0:c,h=l===void 0?3:l,j=u===void 0?!1:u,N=d===void 0?!1:d,P=m===void 0?!1:m,[w,S]=f.useState(g),[O,I]=f.useState(!1);let E,D;e[2]!==g||e[3]!==w?(E=()=>{JSON.stringify(w)!==JSON.stringify(g)&&S(g)},D=[g,w],e[2]=g,e[3]=w,e[4]=E,e[5]=D):(E=e[4],D=e[5]),f.useEffect(E,D);let T;e[6]!==a||e[7]!==w?(T=W=>{if(W.key==="Enter")I(!0);else if(W.key==="Backspace"&&!W.currentTarget.value){const q=[...w];q.pop(),S(q),a(q)}},e[6]=a,e[7]=w,e[8]=T):T=e[8];const C=T;let k;e[9]!==a||e[10]!==w?(k=W=>{const q=w.includes(W.value)?w.filter(te=>te!==W.value):[...w,W.value];S(q),a(q)},e[9]=a,e[10]=w,e[11]=k):k=e[11];const M=k;let _;e[12]!==a?(_=()=>{S([]),a([])},e[12]=a,e[13]=_):_=e[13];const L=_;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{I(_l)},e[14]=z):z=e[14];const $=z;let K;e[15]!==L||e[16]!==a||e[17]!==r||e[18]!==w.length?(K=()=>{if(w.length===r.length)L();else{const W=r.map(Dl);S(W),a(W)}},e[15]=L,e[16]=a,e[17]=r,e[18]=w.length,e[19]=K):K=e[19];const B=K;let A;e[20]!==N?(A=N?{}:{variant:"outline"},e[20]=N,e[21]=A):A=e[21];let R;e[22]!==p?(R=Se("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",p),e[22]=p,e[23]=R):R=e[23];let F;e[24]!==v||e[25]!==h||e[26]!==r||e[27]!==x||e[28]!==w||e[29]!==b?(F=w.length>0?n.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[w.slice(0,h).map(W=>{const q=r.find(pe=>pe.value===W),te=q?.icon;return n.jsxs(it,{variant:b==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${v}s`},children:[te&&n.jsx(te,{className:"h-3 w-3 shrink-0"}),n.jsx("span",{className:"truncate",children:q?.label})]},W)}),w.length>h&&n.jsxs(it,{variant:b==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${v}s`},children:["+",w.length-h]})]}),n.jsx("div",{className:"flex items-center shrink-0 ml-2",children:n.jsx(Et,{size:20,className:"shrink-0 opacity-50"})})]}):n.jsxs("div",{className:"flex items-center justify-between w-full",children:[n.jsx("span",{className:"text-sm text-muted-foreground",children:x}),n.jsx(Et,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=v,e[25]=h,e[26]=r,e[27]=x,e[28]=w,e[29]=b,e[30]=F):F=e[30];let Z;e[31]!==P||e[32]!==A||e[33]!==R||e[34]!==F?(Z=n.jsx(Ia,{asChild:!0,children:n.jsx(be,{ref:null,...A,onClick:$,className:R,disabled:P,children:F})}),e[31]=P,e[32]=A,e[33]=R,e[34]=F,e[35]=Z):Z=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>I(!1),e[36]=Y):Y=e[36];let G;e[37]!==C?(G=n.jsx(fs,{placeholder:"Search...",onKeyDown:C,className:"rounded-t-xl"}),e[37]=C,e[38]=G):G=e[38];let Q;e[39]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx(ps,{children:"No results found."}),e[39]=Q):Q=e[39];let X;e[40]!==B?(X=()=>{B()},e[40]=B,e[41]=X):X=e[41];let ee;e[42]!==B?(ee=W=>{W.stopPropagation(),B()},e[42]=B,e[43]=ee):ee=e[43];const se=w.length===r.length&&r.length>0;let ie;e[44]!==se||e[45]!==B?(ie=n.jsx(or,{checked:se,onCheckedChange:B,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Tl}),e[44]=se,e[45]=B,e[46]=ie):ie=e[46];let we;e[47]===Symbol.for("react.memo_cache_sentinel")?(we=n.jsx("span",{children:"(Select All)"}),e[47]=we):we=e[47];let oe;e[48]!==ee||e[49]!==ie?(oe=n.jsxs("div",{className:"flex items-center w-full",onClick:ee,children:[ie,we]}),e[48]=ee,e[49]=ie,e[50]=oe):oe=e[50];let le;e[51]!==X||e[52]!==oe?(le=n.jsx(ir,{onSelect:X,className:"cursor-pointer",children:oe},"all"),e[51]=X,e[52]=oe,e[53]=le):le=e[53];let ce;if(e[54]!==r||e[55]!==w||e[56]!==M){let W;e[58]!==w||e[59]!==M?(W=q=>{const te=w.includes(q.value);return n.jsx(ir,{onSelect:()=>{M(q)},className:"cursor-pointer",children:n.jsxs("div",{className:"flex items-center w-full",onClick:pe=>{pe.stopPropagation(),M(q)},children:[n.jsx(or,{checked:te,onCheckedChange:()=>{M(q)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Ml}),q.icon&&n.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),n.jsx("span",{children:q.label})]})},q.value)},e[58]=w,e[59]=M,e[60]=W):W=e[60],ce=r.map(W),e[54]=r,e[55]=w,e[56]=M,e[57]=ce}else ce=e[57];let Ne;e[61]!==le||e[62]!==ce?(Ne=n.jsxs(hs,{className:"rounded-b-xl",children:[Q,n.jsxs(vs,{children:[le,ce]})]}),e[61]=le,e[62]=ce,e[63]=Ne):Ne=e[63];let ue;e[64]!==G||e[65]!==Ne?(ue=n.jsx(ka,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:Y,children:n.jsxs(gs,{className:"rounded-xl",children:[G,Ne]})}),e[64]=G,e[65]=Ne,e[66]=ue):ue=e[66];let de;return e[67]!==O||e[68]!==j||e[69]!==Z||e[70]!==ue?(de=n.jsxs(Ca,{open:O,onOpenChange:I,modal:j,children:[Z,ue]}),e[67]=O,e[68]=j,e[69]=Z,e[70]=ue,e[71]=de):de=e[71],de}function Ml(t){return t.stopPropagation()}function Tl(t){return t.stopPropagation()}function Dl(t){return t.value}function _l(t){return!t}function Ll(){const t=Date.now(),e=300*1e3,r=Math.floor(t/e)*e,a=new Date(r);return{startDate:new Date(r-1440*60*1e3).toISOString(),endDate:a.toISOString()}}function Yt(){const t=U.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ll(),t[0]=e):e=t[0];const r=e,{org:a}=Me();let s;t[1]!==a.id?(s={connectionId:Vt,orgId:a.id},t[1]=a.id,t[2]=s):s=t[2];const i=qt(s);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o={...r,limit:2e3,offset:0},t[3]=o):o=t[3];let c;t[4]!==i?(c={client:i,toolName:"MONITORING_LOGS_LIST",toolArguments:o,staleTime:3e4,select:$l},t[4]=i,t[5]=c):c=t[5];const l=As(c);let u;return t[6]!==l?(u={...l,dateRange:r},t[6]=l,t[7]=u):u=t[7],u}function $l(t){return t.structuredContent??t}function Rl(t,e,r,a=10){const i=e.getTime(),c=(r.getTime()-i)/24,l=new Map;for(const g of t){const x=g.toolName||"Unknown",b=l.get(x);l.set(x,{count:(b?.count??0)+1,connectionId:b?.connectionId||g.connectionId})}const u=[...l.entries()].sort((g,x)=>x[1].count-g[1].count).slice(0,a).map(([g,x])=>({name:g,connectionId:x.connectionId})),d=[],p=u.map(g=>g.name);for(let g=0;g<24;g++){const x=new Date(i+g*c),b={t:x.toISOString(),ts:x.getTime(),label:x.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};for(const v of p)b[v]=0;d.push(b)}for(const g of t){const x=new Date(g.timestamp).getTime(),b=Math.floor((x-i)/c),v=Math.max(0,Math.min(23,b)),h=d[v];if(!h)continue;const j=g.toolName||"Unknown";p.includes(j)&&(h[j]=h[j]+1)}const m={},y=new Map;return u.forEach((g,x)=>{const v=`var(--chart-${x%5+1})`;y.set(g.name,v),m[g.name]={label:g.name,color:v}}),{buckets:d,topTools:u,chartConfig:m,toolColors:y}}function Bl(t){const e=U.c(4),{org:r}=Me(),a=Ze(),s=Ht()??[],{data:i,dateRange:o}=Yt(),c=i?.logs??[],l=new Date(o.startDate),u=new Date(o.endDate),{buckets:d,topTools:p,chartConfig:m,toolColors:y}=Rl(c,l,u,10),g=new Map(s.map(Kl));let x;e[0]!==a||e[1]!==r.slug?(x=()=>{a({to:"/$org/$project/monitoring",params:{org:r.slug,project:Re}})},e[0]=a,e[1]=r.slug,e[2]=x):x=e[2];const b=x,v=zl;let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Top Tools"}),e[3]=h):h=e[3],n.jsx(ke,{title:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[h,n.jsx("div",{className:"flex items-center gap-3",children:p.slice(0,3).map(j=>{const N=g.get(j.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(He,{icon:N?.icon||null,name:j.name,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0 size-4! min-w-4! aspect-square rounded-sm"}),n.jsx("span",{className:"text-[10px] text-foreground truncate max-w-32",children:j.name})]},j.name)})})]}),onTitleClick:b,children:p.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No tool activity in the last 24 hours"}):n.jsxs("div",{className:"flex flex-col gap-2 w-full h-full cursor-pointer hover:opacity-80 transition-opacity",children:[n.jsx(Na,{className:"flex-1 min-h-0 max-h-[120px] w-full",config:m,children:n.jsxs(dl,{data:d,margin:{left:0,right:0,top:5,bottom:5},children:[n.jsx(wa,{content:j=>{const{active:N,payload:P}=j;if(!N||!P||P.length===0)return null;const w=P[0]&&typeof P[0]=="object"&&"payload"in P[0]?P[0].payload?.label??"":"";return n.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[n.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:w}),n.jsx("div",{className:"flex flex-col gap-1",children:P.map(S=>{const O=String(S.dataKey??""),I=typeof S.value=="number"?S.value:0,E=typeof S.color=="string"?S.color:void 0;if(!I||I===0)return null;const D=p.find(C=>C.name===O),T=g.get(D?.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:E}}),n.jsx(He,{icon:T?.icon||null,name:O,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0"}),n.jsxs("span",{className:"text-xs font-medium",children:[O,":"]}),n.jsx("span",{className:"text-xs font-bold",children:I})]},O)})})]})}}),p.map(j=>n.jsx(Za,{type:"monotone",dataKey:j.name,stroke:y.get(j.name),strokeWidth:2,dot:!1,activeDot:{r:4}},j.name))]})}),n.jsxs("div",{className:"flex items-start justify-between text-xs text-muted-foreground w-full",children:[n.jsx("p",{children:v(l)}),n.jsx("p",{children:v(u)})]})]})})}function zl(t){return t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function Kl(t){return[t.id,t]}function Fl(){const t=U.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[e,n.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:3}).map(Wl)})]}),t[1]=r):r=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex-1 min-h-0 max-h-[120px] w-full rounded bg-muted animate-pulse"}),t[2]=a):a=t[2];let s;return t[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ke,{title:r,children:n.jsxs("div",{className:"flex flex-col gap-2 w-full h-full",children:[a,n.jsxs("div",{className:"flex items-start justify-between w-full",children:[n.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"})]})]})}),t[3]=s):s=t[3],s}function Wl(t,e){return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"size-4 aspect-square rounded-md bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-16 rounded bg-muted animate-pulse"})]},e)}const ea={Content:Bl,Skeleton:Fl};function ql(t){const e=new Map;for(const a of t){if(!a.connectionId)continue;const s=e.get(a.connectionId)??{requests:0,errors:0,totalLatency:0};e.set(a.connectionId,{requests:s.requests+1,errors:s.errors+(a.isError?1:0),totalLatency:s.totalLatency+a.durationMs})}const r=new Map;for(const[a,s]of e)r.set(a,{connectionId:a,requests:s.requests,errors:s.errors,errorRate:s.requests>0?s.errors/s.requests*100:0,avgLatencyMs:s.requests>0?s.totalLatency/s.requests:0});return r}function Vl(t,e){switch(e){case"requests":return t.requests.toLocaleString();case"errors":return`${t.errorRate.toFixed(1)}%`;case"latency":return`${Math.round(t.avgLatencyMs)}ms`}}function nt(t,e){switch(e){case"requests":return t.requests;case"errors":return t.errorRate;case"latency":return t.avgLatencyMs}}function Hl(t,e,r){if(e===0)return 0;const a=nt(t,r);return Math.min(a/e*100,100)}function Gl(t){const e=U.c(19),{metricsMode:r,onMetricsModeChange:a}=t,{org:s}=Me(),i=Ze(),o=Ht({pageSize:100})??[],{data:c}=Yt(),l=c?.logs??[],u=ql(l);let d;e[0]!==r?(d=(O,I)=>nt(I.metric,r)-nt(O.metric,r),e[0]=r,e[1]=d):d=e[1];const p=o.map(O=>({connection:O,metric:u.get(O.id)})).filter(Ul).sort(d).slice(0,15),m=p[0]?.metric,y=m?nt(m,r):1;let g;e[2]!==r||e[3]!==i||e[4]!==s.slug?(g=O=>{i({to:"/$org/$project/monitoring",params:{org:s.slug,project:Re},search:{from:"now-24h",to:"now",connectionId:[O],...r==="errors"&&{status:"errors"}}})},e[2]=r,e[3]=i,e[4]=s.slug,e[5]=g):g=e[5];const x=g;let b;e[6]!==i||e[7]!==s.slug?(b=()=>{i({to:"/$org/$project/mcps",params:{org:s.slug,project:Re}})},e[6]=i,e[7]=s.slug,e[8]=b):b=e[8];const v=b,h=r==="requests"?"bg-chart-1":r==="errors"?"bg-chart-3":"bg-chart-4",j=ke;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Connections"}),e[9]=N):N=e[9];let P;e[10]!==r||e[11]!==a?(P=a?n.jsxs(Es,{type:"single",value:r,onValueChange:O=>O&&a(O),variant:"outline",size:"sm",children:[n.jsx(It,{value:"requests",className:"text-xs px-2 cursor-pointer",children:"Calls"}),n.jsx(It,{value:"errors",className:"text-xs px-2 cursor-pointer",children:"Errors"}),n.jsx(It,{value:"latency",className:"text-xs px-2 cursor-pointer",children:"Latency"})]}):null,e[10]=r,e[11]=a,e[12]=P):P=e[12];const w=p.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No server activity in the last 24 hours"}):n.jsx("div",{className:"space-y-3 w-full",children:p.map(O=>{const{connection:I,metric:E}=O,D=Hl(E,y,r);return n.jsxs("div",{className:"group cursor-pointer flex items-center gap-2",onClick:()=>x(I.id),children:[n.jsx(He,{icon:I.icon,name:I.title,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0"}),n.jsx("span",{className:"text-xs font-medium text-foreground truncate min-w-0 w-32",children:I.title}),n.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1",children:n.jsx("div",{className:Se("h-full transition-all duration-500 ease-out group-hover:opacity-80",h),style:{width:`${D}%`}})}),n.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-normal",children:Vl(E,r)})]},I.id)})});let S;return e[13]!==j||e[14]!==v||e[15]!==N||e[16]!==P||e[17]!==w?(S=n.jsx(j,{title:N,onTitleClick:v,action:P,children:w}),e[13]=j,e[14]=v,e[15]=N,e[16]=P,e[17]=w,e[18]=S):S=e[18],S}function Ul(t){return t.metric}function Zl(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Connections"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ke,{title:e,children:n.jsx("div",{className:"space-y-3 w-full",children:Array.from({length:8}).map(Yl)})}),t[1]=r):r=t[1],r}function Yl(t,e){return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-6 w-6 bg-muted animate-pulse rounded-md shrink-0"}),n.jsx("div",{className:"h-3 w-32 bg-muted animate-pulse rounded shrink-0"}),n.jsx("div",{className:"h-2 bg-muted animate-pulse flex-1"}),n.jsx("div",{className:"h-3 w-12 bg-muted animate-pulse rounded shrink-0"})]},e)}const ta={Content:Gl,Skeleton:Zl};function Xl(t){const e=new Map;for(const a of t){if(!a.virtualMcpId)continue;const s=e.get(a.virtualMcpId)??{requests:0,errors:0,totalLatency:0};e.set(a.virtualMcpId,{requests:s.requests+1,errors:s.errors+(a.isError?1:0),totalLatency:s.totalLatency+a.durationMs})}const r=new Map;for(const[a,s]of e)r.set(a,{virtualMcpId:a,requests:s.requests,errors:s.errors,errorRate:s.requests>0?s.errors/s.requests*100:0,avgLatencyMs:s.requests>0?s.totalLatency/s.requests:0});return r}function Ql(t,e){switch(e){case"requests":return t.requests.toLocaleString();case"errors":return`${t.errorRate.toFixed(1)}%`;case"latency":return`${Math.round(t.avgLatencyMs)}ms`}}function st(t,e){switch(e){case"requests":return t.requests;case"errors":return t.errorRate;case"latency":return t.avgLatencyMs}}function Jl(t,e,r){if(e===0)return 0;const a=st(t,r);return Math.min(a/e*100,100)}function ec(t){const e=U.c(15),{metricsMode:r}=t,{org:a}=Me(),s=Ze(),i=Sa({pageSize:100})??[],{data:o}=Yt(),c=o?.logs??[],l=Xl(c);let u;e[0]!==r?(u=(w,S)=>st(S.metric,r)-st(w.metric,r),e[0]=r,e[1]=u):u=e[1];const d=i.map(w=>({virtualMcp:w,metric:l.get(w.id??"")})).filter(tc).sort(u).slice(0,15),p=d[0]?.metric,m=p?st(p,r):1;let y;e[2]!==r||e[3]!==s||e[4]!==a.slug?(y=w=>{s({to:"/$org/$project/monitoring",params:{org:a.slug,project:Re},search:{from:"now-24h",to:"now",virtualMcpId:[w],...r==="errors"&&{status:"errors"}}})},e[2]=r,e[3]=s,e[4]=a.slug,e[5]=y):y=e[5];const g=y;let x;e[6]!==s||e[7]!==a.slug?(x=()=>{s({to:"/$org/$project/agents",params:{org:a.slug,project:Re}})},e[6]=s,e[7]=a.slug,e[8]=x):x=e[8];const b=x,v=r==="requests"?"bg-chart-1":r==="errors"?"bg-chart-3":"bg-chart-4",h=ke;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Agents"}),e[9]=j):j=e[9];const N=d.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No agent activity in the last 24 hours"}):n.jsx("div",{className:"space-y-3 w-full",children:d.map(w=>{const{virtualMcp:S,metric:O}=w,I=Jl(O,m,r);return n.jsxs("div",{className:"group cursor-pointer flex items-center gap-2",onClick:()=>g(S.id??""),children:[n.jsx(He,{icon:S.icon,name:S.title,size:"xs",fallbackIcon:n.jsx(Ms,{}),className:"shrink-0"}),n.jsx("span",{className:"text-xs font-medium text-foreground truncate min-w-0 w-32",children:S.title}),n.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1",children:n.jsx("div",{className:Se("h-full transition-all duration-500 ease-out group-hover:opacity-80",v),style:{width:`${I}%`}})}),n.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-normal",children:Ql(O,r)})]},S.id??"default")})});let P;return e[10]!==h||e[11]!==b||e[12]!==j||e[13]!==N?(P=n.jsx(h,{title:j,onTitleClick:b,children:N}),e[10]=h,e[11]=b,e[12]=j,e[13]=N,e[14]=P):P=e[14],P}function tc(t){return t.metric!==void 0}function rc(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("p",{className:"text-sm text-muted-foreground",children:"Agents"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ke,{title:e,children:n.jsx("div",{className:"space-y-3 w-full",children:Array.from({length:8}).map(ac)})}),t[1]=r):r=t[1],r}function ac(t,e){return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"h-6 w-6 bg-muted animate-pulse rounded-md shrink-0"}),n.jsx("div",{className:"h-3 w-32 bg-muted animate-pulse rounded shrink-0"}),n.jsx("div",{className:"h-2 bg-muted animate-pulse flex-1"}),n.jsx("div",{className:"h-3 w-12 bg-muted animate-pulse rounded shrink-0"})]},e)}const ra={Content:ec,Skeleton:rc};function nc(){const t=U.c(18),[e,r]=f.useState("requests");let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load top tools"}),t[0]=a):a=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ea.Skeleton,{}),t[1]=s):s=t[1];let i;t[2]!==e?(i=n.jsx("div",{className:"border-b bg-background shrink-0",children:n.jsx(qe,{fallback:a,children:n.jsx(f.Suspense,{fallback:s,children:n.jsx(ea.Content,{metricsMode:e})})})}),t[2]=e,t[3]=i):i=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load top servers"}),t[4]=o):o=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ta.Skeleton,{}),t[5]=c):c=t[5];let l;t[6]!==e?(l=n.jsx("div",{className:"bg-background overflow-auto",children:n.jsx(qe,{fallback:o,children:n.jsx(f.Suspense,{fallback:c,children:n.jsx(ta.Content,{metricsMode:e,onMetricsModeChange:r})})})}),t[6]=e,t[7]=l):l=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load top agents"}),t[8]=u):u=t[8];let d;t[9]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ra.Skeleton,{}),t[9]=d):d=t[9];let p;t[10]!==e?(p=n.jsx("div",{className:"bg-background overflow-auto",children:n.jsx(qe,{fallback:u,children:n.jsx(f.Suspense,{fallback:d,children:n.jsx(ra.Content,{metricsMode:e})})})}),t[10]=e,t[11]=p):p=t[11];let m;t[12]!==l||t[13]!==p?(m=n.jsxs("div",{className:"flex-1 grid grid-cols-1 lg:grid-cols-2 gap-[0.5px] bg-border min-h-0",children:[l,p]}),t[12]=l,t[13]=p,t[14]=m):m=t[14];let y;return t[15]!==i||t[16]!==m?(y=n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto",children:[i,m]}),t[15]=i,t[16]=m,t[17]=y):y=t[17],y}function sc(t){const e=U.c(11),{displayDateRange:r,connectionIds:a,logs:s,total:i}=t;let o=s;if(a.length>1){let p;if(e[0]!==a||e[1]!==o){let m;e[3]!==a?(m=y=>a.includes(y.connectionId),e[3]=a,e[4]=m):m=e[4],p=o.filter(m),e[0]=a,e[1]=o,e[2]=p}else p=e[2];o=p}const c=a.length>1?void 0:i;let l;e[5]!==r||e[6]!==o||e[7]!==c?(l=yl(o,r,void 0,c),e[5]=r,e[6]=o,e[7]=c,e[8]=l):l=e[8];const u=l;let d;return e[9]!==u?(d=n.jsx(Nl,{stats:u,chartHeight:"h-[30px] md:h-[40px]",compact:!0}),e[9]=u,e[10]=d):d=e[10],d}const tn=Object.assign(sc,{Skeleton:Ol}),ic=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function oc({connectionIds:t,virtualMcpIds:e,tool:r,status:a,hideSystem:s,propertyFilters:i,connectionOptions:o,virtualMcpOptions:c,activeFiltersCount:l,onUpdateFilters:u}){const[d,p]=f.useState(!1),[m,y]=f.useState("raw"),[g,x]=f.useState(r),[b,v]=f.useState(i),[h,j]=f.useState(Qe(i)),N=f.useRef(r),P=f.useRef(Le(i));N.current!==r&&(N.current=r,g!==r&&x(r));const w=Le(i);P.current!==w&&(P.current=w,v(i),j(Qe(i)));const S=(C,k)=>{const M=[...b],_=M[C];_&&(M[C]={key:k.key??_.key,operator:k.operator??_.operator,value:k.value??_.value},v(M))},O=()=>{v([...b,{key:"",operator:"eq",value:""}])},I=C=>{const k=b.filter((M,_)=>_!==C);v(k),j(Qe(k)),u({propertyFilters:Le(k)})},E=()=>{u({propertyFilters:Le(b)})},D=()=>{const C=Jt(h);v(C),u({propertyFilters:Le(C)})},T=()=>{if(m==="raw"){const C=Jt(h);v(C),y("form")}else j(Qe(b)),y("raw")};return n.jsxs(Ca,{open:d,onOpenChange:p,children:[n.jsx(Ia,{asChild:!0,children:n.jsxs(be,{variant:"outline",size:"sm",children:[n.jsx(js,{size:16}),"Filters",l>0&&n.jsx(it,{variant:"default",className:"ml-1 h-5 w-5 rounded-full p-0 flex items-center justify-center text-xs",children:l})]})}),n.jsx(ka,{align:"end",className:"w-[320px]",children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{children:n.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(Cs,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),n.jsx(ks,{id:"hide-system-calls",checked:s,onCheckedChange:C=>u({hideSystem:!!C})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),n.jsx(Jr,{options:o,defaultValue:t,onValueChange:C=>u({connectionId:C}),placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),n.jsx(Jr,{options:c,defaultValue:e,onValueChange:C=>u({virtualMcpId:C}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),n.jsx(St,{id:"filter-tool",placeholder:"Filter by tool...",value:g,onChange:C=>x(C.target.value),onBlur:()=>{g!==r&&u({tool:g})},onKeyDown:C=>{C.key==="Enter"&&g!==r&&u({tool:g})},className:"w-full"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),n.jsxs(lr,{value:a,onValueChange:C=>u({status:C}),children:[n.jsx(cr,{className:"w-full",children:n.jsx(ur,{})}),n.jsxs(dr,{children:[n.jsx(et,{value:"all",children:"All Status"}),n.jsx(et,{value:"success",children:"Success Only"}),n.jsx(et,{value:"errors",children:"Errors Only"})]})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),n.jsxs(Ps,{children:[n.jsx(Os,{asChild:!0,children:n.jsx(be,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:T,children:m==="raw"?n.jsx(ws,{size:14}):n.jsx(bs,{size:14})})}),n.jsx(Ss,{children:m==="raw"?"Switch to form view":"Switch to raw text"})]})]}),m==="raw"?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(Ns,{placeholder:`Paste property filters here:
29
29
  thread_id=abc123
30
30
  user~test
31
- debug?`,value:h,onChange:C=>j(C.target.value),onBlur:D,onKeyDown:C=>{C.key==="Enter"&&C.metaKey&&D()},className:"font-mono text-sm min-h-[80px] resize-none"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):n.jsxs("div",{className:"space-y-3",children:[b.map((C,k)=>n.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",k+1]}),n.jsx(be,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>I(k),children:n.jsx(Oa,{size:12})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(St,{placeholder:"Key (e.g., thread_id)",value:C.key,onChange:M=>S(k,{key:M.target.value}),onBlur:E,onKeyDown:M=>{M.key==="Enter"&&E()},className:"flex-1 font-mono text-sm"}),n.jsxs(lr,{value:C.operator,onValueChange:M=>{const _=[...b],L=_[k];L&&(_[k]={...L,operator:M,value:M==="exists"?"":L.value},v(_),u({propertyFilters:Le(_)}))},children:[n.jsx(cr,{className:"w-28",children:n.jsx(ur,{})}),n.jsx(dr,{children:ic.map(M=>n.jsx(et,{value:M.value,children:M.label},M.value))})]})]}),C.operator!=="exists"&&n.jsx(St,{placeholder:"Value",value:C.value,onChange:M=>S(k,{value:M.target.value}),onBlur:E,onKeyDown:M=>{M.key==="Enter"&&E()},className:"w-full font-mono text-sm"})]},k)),n.jsxs(be,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[n.jsx(Pa,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),l>0&&n.jsx(be,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{x(""),v([]),j(""),u({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),p(!1)},children:"Clear all filters"})]})})]})}function lc(t){const e=U.c(17),{connectionIds:r,virtualMcpIds:a,tool:s,status:i,search:o,logs:c,hasMore:l,onLoadMore:u,isLoadingMore:d,connections:p,virtualMcps:m,membersData:y}=t,g=p??[],x=m??[];let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=new Set,e[0]=b):b=e[0];const[v,h]=f.useState(b),j=El(u,l,d),N=y?.data?.members??[],P=new Map(N.map(dc)),w=new Map(x.map(uc));let O=c.map(A=>{const R=P.get(A.userId??""),F=A.virtualMcpId?w.get(A.virtualMcpId):null;return{...A,userName:R?.name??A.userId??"Unknown",userImage:R?.image,virtualMcpName:F?.title??null}});if(r.length>1){let A;e[1]!==r?(A=R=>r.includes(R.connectionId),e[1]=r,e[2]=A):A=e[2],O=O.filter(A)}if(a.length>1){let A;e[3]!==a?(A=R=>R.virtualMcpId&&a.includes(R.virtualMcpId),e[3]=a,e[4]=A):A=e[4],O=O.filter(A)}if(o){const A=o.toLowerCase();O=O.filter(R=>R.toolName.toLowerCase().includes(A)||R.connectionTitle.toLowerCase().includes(A)||R.errorMessage?.toLowerCase().includes(A))}let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{h(R=>{const F=new Set(R);return F.has(A.id)?F.delete(A.id):F.add(A.id),F})},e[5]=I):I=e[5];const E=I,D=new Map(g.map(cc));if(O.length===0){let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=A):A=e[6];const R=o||r.length>0||a.length>0||s||i!=="all"?"No logs match your filters":"No logs found in this time range";let F;return e[7]!==R?(F=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Kt,{image:A,title:"No logs found",description:R})}),e[7]=R,e[8]=F):F=e[8],F}const T="flex-1 flex flex-col overflow-hidden",C="flex-1 overflow-auto",k="min-w-[600px] md:min-w-0 bg-background",M=Nn,_="w-full border-collapse";let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pn,{className:"border-b-0 z-20",children:n.jsxs(Mt,{className:"h-9 hover:bg-transparent border-b border-border",children:[n.jsx(ye,{className:"w-10 md:w-12 px-2 md:px-4"}),n.jsx(ye,{className:"w-5"}),n.jsx(ye,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),n.jsx(ye,{className:"w-24 md:w-32 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),n.jsx(ye,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User Name"}),n.jsx(ye,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),n.jsx(ye,{className:"w-20 md:w-28 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Time"}),n.jsx(ye,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Latency"}),n.jsx(ye,{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[9]=L):L=e[9];const z=wn,$=O.map((A,R)=>n.jsx(pl,{log:A,isExpanded:v.has(A.id),connection:D.get(A.connectionId),virtualMcpName:A.virtualMcpName??"",onToggle:()=>E(A),lastLogRef:R===O.length-1?j:void 0},A.id));let K;e[10]!==z||e[11]!==$?(K=n.jsx(z,{children:$}),e[10]=z,e[11]=$,e[12]=K):K=e[12];let B;return e[13]!==M||e[14]!==L||e[15]!==K?(B=n.jsx("div",{className:T,children:n.jsx("div",{className:C,children:n.jsx("div",{className:k,children:n.jsxs(M,{className:_,children:[L,K]})})})}),e[13]=M,e[14]=L,e[15]=K,e[16]=B):B=e[16],B}function cc(t){return[t.id,t]}function uc(t){return[t.id,t]}function dc(t){return[t.userId,t.user]}function mc(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading logs..."})}),t[0]=e):e=t[0],e}const rn=Object.assign(lc,{Skeleton:mc});function fc(t){const e=U.c(86),{tab:r,dateRange:a,displayDateRange:s,connectionIds:i,virtualMcpIds:o,tool:c,status:l,search:u,streaming:d,hideSystem:p,activeFiltersCount:m,from:y,to:g,propertyFilters:x,onUpdateFilters:b,onTimeRangeChange:v,onStreamingToggle:h,onTabChange:j}=t,N=Ht(),P=Sa(),{data:w}=xs();let S;e[0]!==N?(S=N??[],e[0]=N,e[1]=S):S=e[1];let O;e[2]!==S?(O=S.map(vc),e[2]=S,e[3]=O):O=e[3];const I=O;let E;e[4]!==P?(E=P.map(hc),e[4]=P,e[5]=E):E=e[5];const D=E,{pageSize:T,streamingRefetchInterval:C}=yn,{org:k,locator:M}=Me();let _;e[6]!==k.id?(_={connectionId:Vt,orgId:k.id},e[6]=k.id,e[7]=_):_=e[7];const L=qt(_);let z,$,K;if(e[8]!==i[0]||e[9]!==i.length||e[10]!==a.endDate||e[11]!==a.startDate||e[12]!==p||e[13]!==M||e[14]!==k.id||e[15]!==x||e[16]!==l||e[17]!==c||e[18]!==o[0]||e[19]!==o.length){const re=xn(x),_e=p?[Jn.SELF(k.id)]:void 0;z={startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:i.length===1?i[0]:void 0,excludeConnectionIds:_e,virtualMcpId:o.length===1?o[0]:void 0,toolName:c||void 0,isError:l==="errors"?!0:l==="success"?!1:void 0,...re},K=ys,$=at.monitoringLogsInfinite(M,JSON.stringify(z)),e[8]=i[0],e[9]=i.length,e[10]=a.endDate,e[11]=a.startDate,e[12]=p,e[13]=M,e[14]=k.id,e[15]=x,e[16]=l,e[17]=c,e[18]=o[0],e[19]=o.length,e[20]=z,e[21]=$,e[22]=K}else z=e[20],$=e[21],K=e[22];let B;e[23]!==z||e[24]!==L?(B=async re=>{const{pageParam:_e}=re,an=_e===void 0?0:_e;if(!L)throw new Error("MCP client is not available");const Xt=await L.callTool({name:"MONITORING_LOGS_LIST",arguments:{...z,limit:T,offset:an}});return Xt.structuredContent??Xt},e[23]=z,e[24]=L,e[25]=B):B=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=(re,_e)=>{if(!((re?.logs?.length??0)<T))return _e.length*T},e[26]=A):A=e[26];const R=d?C:!1;let F;e[27]!==$||e[28]!==B||e[29]!==R?(F={queryKey:$,queryFn:B,initialPageParam:0,getNextPageParam:A,staleTime:0,refetchInterval:R},e[27]=$,e[28]=B,e[29]=R,e[30]=F):F=e[30];const{data:Z,fetchNextPage:Y,hasNextPage:G,isFetchingNextPage:Q}=K(F);let X;e[31]!==Z?.pages?(X=Z?.pages.flatMap(pc)??[],e[31]=Z?.pages,e[32]=X):X=e[32];const ee=X,se=Z?.pages[0]?.total;let ie;e[33]!==Y||e[34]!==G||e[35]!==Q?(ie=()=>{G&&!Q&&Y()},e[33]=Y,e[34]=G,e[35]=Q,e[36]=ie):ie=e[36];const we=ie;let oe;e[37]===Symbol.for("react.memo_cache_sentinel")?(oe={id:"logs",label:"Logs"},e[37]=oe):oe=e[37];let le;e[38]===Symbol.for("react.memo_cache_sentinel")?(le={id:"analytics",label:"Analytics"},e[38]=le):le=e[38];let ce;e[39]===Symbol.for("react.memo_cache_sentinel")?(ce=[oe,le,{id:"dashboards",label:"Dashboards"}],e[39]=ce):ce=e[39];const Ne=ce;let ue;e[40]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(ge.Header.Left,{children:n.jsx(dn,{children:n.jsx(mn,{children:n.jsx(fn,{children:n.jsx(pn,{children:"Monitoring"})})})})}),e[40]=ue):ue=e[40];let de;e[41]!==m||e[42]!==i||e[43]!==I||e[44]!==y||e[45]!==p||e[46]!==d||e[47]!==h||e[48]!==v||e[49]!==b||e[50]!==x||e[51]!==l||e[52]!==r||e[53]!==g||e[54]!==c||e[55]!==o||e[56]!==D?(de=r==="logs"&&n.jsx(ge.Header.Right,{children:n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(oc,{connectionIds:i,virtualMcpIds:o,tool:c,status:l,hideSystem:p,propertyFilters:x,connectionOptions:I,virtualMcpOptions:D,activeFiltersCount:m,onUpdateFilters:b}),n.jsxs(be,{variant:d?"secondary":"outline",size:"sm",className:Se("h-7 px-2 sm:px-3 gap-1.5",d&&"bg-muted hover:bg-muted/80"),onClick:h,children:[d?n.jsx(Aa,{size:16,className:"animate-pulse"}):n.jsx(Ea,{size:16}),n.jsx("span",{className:"hidden sm:inline",children:d?"Streaming":"Stream"})]}),n.jsx(bn,{value:{from:y,to:g},onChange:v})]})}),e[41]=m,e[42]=i,e[43]=I,e[44]=y,e[45]=p,e[46]=d,e[47]=h,e[48]=v,e[49]=b,e[50]=x,e[51]=l,e[52]=r,e[53]=g,e[54]=c,e[55]=o,e[56]=D,e[57]=de):de=e[57];let W;e[58]!==de?(W=n.jsxs(ge.Header,{children:[ue,de]}),e[58]=de,e[59]=W):W=e[59];let q;e[60]!==j?(q=re=>j(re),e[60]=j,e[61]=q):q=e[61];let te;e[62]!==q||e[63]!==r?(te=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(Is,{tabs:Ne,activeTab:r,onTabChange:q})}),e[62]=q,e[63]=r,e[64]=te):te=e[64];let pe;e[65]!==N||e[66]!==ee||e[67]!==P||e[68]!==i||e[69]!==s||e[70]!==we||e[71]!==G||e[72]!==Q||e[73]!==w||e[74]!==b||e[75]!==u||e[76]!==l||e[77]!==r||e[78]!==c||e[79]!==se||e[80]!==o?(pe=r==="dashboards"?n.jsx(Al,{}):r==="logs"?n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx(tn,{displayDateRange:s,connectionIds:i,logs:ee,total:se}),n.jsx(un,{value:u,onChange:re=>b({search:re}),placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:re=>{re.key==="Escape"&&(b({search:""}),re.target.blur())}}),n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx(rn,{connectionIds:i,virtualMcpIds:o,tool:c,status:l,search:u,logs:ee,hasMore:G??!1,onLoadMore:we,isLoadingMore:Q,connections:N,virtualMcps:P,membersData:w})})]}):n.jsx(nc,{}),e[65]=N,e[66]=ee,e[67]=P,e[68]=i,e[69]=s,e[70]=we,e[71]=G,e[72]=Q,e[73]=w,e[74]=b,e[75]=u,e[76]=l,e[77]=r,e[78]=c,e[79]=se,e[80]=o,e[81]=pe):pe=e[81];let Xe;return e[82]!==W||e[83]!==te||e[84]!==pe?(Xe=n.jsxs(n.Fragment,{children:[W,te,pe]}),e[82]=W,e[83]=te,e[84]=pe,e[85]=Xe):Xe=e[85],Xe}function pc(t){return t?.logs??[]}function hc(t){return{value:t.id??"",label:t.title??"Decopilot"}}function vc(t){return{value:t.id,label:t.title||t.id}}function Ou(){const t=U.c(68),{org:e}=Me(),r=Ze();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/$project/monitoring"},t[0]=a):a=t[0];const s=cn(a),{tab:i,from:o,to:c,connectionId:l,virtualMcpId:u,tool:d,search:p,status:m,streaming:y,propertyFilters:g,hideSystem:x}=s,b=i===void 0?"logs":i;let v;t[1]!==l?(v=l===void 0?[]:l,t[1]=l,t[2]=v):v=t[2];const h=v;let j;t[3]!==u?(j=u===void 0?[]:u,t[3]=u,t[4]=j):j=t[4];const N=j,P=y===void 0?!0:y,w=g===void 0?"":g,S=x===void 0?!1:x;let O,I,E,D,T,C,k;if(t[5]!==h.length||t[6]!==o||t[7]!==S||t[8]!==r||t[9]!==e.slug||t[10]!==w||t[11]!==s||t[12]!==m||t[13]!==P||t[14]!==c||t[15]!==d||t[16]!==N.length){T=gn(w);let F;t[24]!==r||t[25]!==e.slug||t[26]!==s?(F=X=>{r({to:"/$org/$project/monitoring",params:{org:e.slug,project:Re},search:{...s,...X}})},t[24]=r,t[25]=e.slug,t[26]=s,t[27]=F):F=t[27],k=F;let Z;t[28]!==k?(Z=X=>{k({from:X.from,to:X.to})},t[28]=k,t[29]=Z):Z=t[29],D=Z;let Y,G;if(t[30]!==o||t[31]!==P||t[32]!==c){const X=Qt(o),ee=Qt(c);G=X.date||new Date(Date.now()-864e5);const se=ee.date||new Date;E={startDate:G,endDate:se},Y=se,P&&c==="now"&&(Y=new Date(se),Y.setHours(Y.getHours()+1)),t[30]=o,t[31]=P,t[32]=c,t[33]=E,t[34]=Y,t[35]=G}else E=t[33],Y=t[34],G=t[35];let Q;t[36]!==Y||t[37]!==G?(Q={startDate:G,endDate:Y},t[36]=Y,t[37]=G,t[38]=Q):Q=t[38],I=Q,O=0,h.length>0&&O++,N.length>0&&O++,d&&O++,m!=="all"&&O++,S&&O++,C=T.filter(gc),t[5]=h.length,t[6]=o,t[7]=S,t[8]=r,t[9]=e.slug,t[10]=w,t[11]=s,t[12]=m,t[13]=P,t[14]=c,t[15]=d,t[16]=N.length,t[17]=O,t[18]=I,t[19]=E,t[20]=D,t[21]=T,t[22]=C,t[23]=k}else O=t[17],I=t[18],E=t[19],D=t[20],T=t[21],C=t[22],k=t[23];const M=C;M.length>0&&(O=O+M.length);let _;t[39]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ge.Header,{children:n.jsx(ge.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=_):_=t[39];let L;t[40]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=L):L=t[40];let z;t[41]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(n.Fragment,{children:[_,n.jsx(ge.Content,{children:n.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[L,n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Kt,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=z):z=t[41];let $;t[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(ge.Header,{children:n.jsx(ge.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[42]=$):$=t[42];let K;t[43]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsxs(n.Fragment,{children:[$,n.jsx(ge.Content,{children:n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx(tn.Skeleton,{}),n.jsx(rn.Skeleton,{})]})})]}),t[43]=K):K=t[43];let B;t[44]!==P||t[45]!==k?(B=()=>k({streaming:!P}),t[44]=P,t[45]=k,t[46]=B):B=t[46];let A;t[47]!==k?(A=F=>k({tab:F}),t[47]=k,t[48]=A):A=t[48];let R;return t[49]!==O||t[50]!==h||t[51]!==I||t[52]!==E||t[53]!==o||t[54]!==D||t[55]!==S||t[56]!==T||t[57]!==p||t[58]!==m||t[59]!==P||t[60]!==B||t[61]!==A||t[62]!==b||t[63]!==c||t[64]!==d||t[65]!==k||t[66]!==N?(R=n.jsx(ge,{children:n.jsx(qe,{fallback:z,children:n.jsx(f.Suspense,{fallback:K,children:n.jsx(fc,{tab:b,dateRange:I,displayDateRange:E,connectionIds:h,virtualMcpIds:N,tool:d,status:m,search:p,streaming:P,hideSystem:S,activeFiltersCount:O,from:o,to:c,propertyFilters:T,onUpdateFilters:k,onTimeRangeChange:D,onStreamingToggle:B,onTabChange:A})})})}),t[49]=O,t[50]=h,t[51]=I,t[52]=E,t[53]=o,t[54]=D,t[55]=S,t[56]=T,t[57]=p,t[58]=m,t[59]=P,t[60]=B,t[61]=A,t[62]=b,t[63]=c,t[64]=d,t[65]=k,t[66]=N,t[67]=R):R=t[67],R}function gc(t){return t.key.trim()}export{Ou as default};
31
+ debug?`,value:h,onChange:C=>j(C.target.value),onBlur:D,onKeyDown:C=>{C.key==="Enter"&&C.metaKey&&D()},className:"font-mono text-sm min-h-[80px] resize-none"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):n.jsxs("div",{className:"space-y-3",children:[b.map((C,k)=>n.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",k+1]}),n.jsx(be,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>I(k),children:n.jsx(Oa,{size:12})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(St,{placeholder:"Key (e.g., thread_id)",value:C.key,onChange:M=>S(k,{key:M.target.value}),onBlur:E,onKeyDown:M=>{M.key==="Enter"&&E()},className:"flex-1 font-mono text-sm"}),n.jsxs(lr,{value:C.operator,onValueChange:M=>{const _=[...b],L=_[k];L&&(_[k]={...L,operator:M,value:M==="exists"?"":L.value},v(_),u({propertyFilters:Le(_)}))},children:[n.jsx(cr,{className:"w-28",children:n.jsx(ur,{})}),n.jsx(dr,{children:ic.map(M=>n.jsx(et,{value:M.value,children:M.label},M.value))})]})]}),C.operator!=="exists"&&n.jsx(St,{placeholder:"Value",value:C.value,onChange:M=>S(k,{value:M.target.value}),onBlur:E,onKeyDown:M=>{M.key==="Enter"&&E()},className:"w-full font-mono text-sm"})]},k)),n.jsxs(be,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[n.jsx(Pa,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),l>0&&n.jsx(be,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{x(""),v([]),j(""),u({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),p(!1)},children:"Clear all filters"})]})})]})}function lc(t){const e=U.c(17),{connectionIds:r,virtualMcpIds:a,tool:s,status:i,search:o,logs:c,hasMore:l,onLoadMore:u,isLoadingMore:d,connections:p,virtualMcps:m,membersData:y}=t,g=p??[],x=m??[];let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=new Set,e[0]=b):b=e[0];const[v,h]=f.useState(b),j=El(u,l,d),N=y?.data?.members??[],P=new Map(N.map(dc)),w=new Map(x.map(uc));let O=c.map(A=>{const R=P.get(A.userId??""),F=A.virtualMcpId?w.get(A.virtualMcpId):null;return{...A,userName:R?.name??A.userId??"Unknown",userImage:R?.image,virtualMcpName:F?.title??null}});if(r.length>1){let A;e[1]!==r?(A=R=>r.includes(R.connectionId),e[1]=r,e[2]=A):A=e[2],O=O.filter(A)}if(a.length>1){let A;e[3]!==a?(A=R=>R.virtualMcpId&&a.includes(R.virtualMcpId),e[3]=a,e[4]=A):A=e[4],O=O.filter(A)}if(o){const A=o.toLowerCase();O=O.filter(R=>R.toolName.toLowerCase().includes(A)||R.connectionTitle.toLowerCase().includes(A)||R.errorMessage?.toLowerCase().includes(A))}let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{h(R=>{const F=new Set(R);return F.has(A.id)?F.delete(A.id):F.add(A.id),F})},e[5]=I):I=e[5];const E=I,D=new Map(g.map(cc));if(O.length===0){let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=A):A=e[6];const R=o||r.length>0||a.length>0||s||i!=="all"?"No logs match your filters":"No logs found in this time range";let F;return e[7]!==R?(F=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Kt,{image:A,title:"No logs found",description:R})}),e[7]=R,e[8]=F):F=e[8],F}const T="flex-1 flex flex-col overflow-hidden",C="flex-1 overflow-auto",k="min-w-[600px] md:min-w-0 bg-background",M=Nn,_="w-full border-collapse";let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(Pn,{className:"border-b-0 z-20",children:n.jsxs(Mt,{className:"h-9 hover:bg-transparent border-b border-border",children:[n.jsx(ye,{className:"w-10 md:w-12 px-2 md:px-4"}),n.jsx(ye,{className:"w-5"}),n.jsx(ye,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),n.jsx(ye,{className:"w-24 md:w-32 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),n.jsx(ye,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User Name"}),n.jsx(ye,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),n.jsx(ye,{className:"w-20 md:w-28 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Time"}),n.jsx(ye,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Latency"}),n.jsx(ye,{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[9]=L):L=e[9];const z=wn,$=O.map((A,R)=>n.jsx(pl,{log:A,isExpanded:v.has(A.id),connection:D.get(A.connectionId),virtualMcpName:A.virtualMcpName??"",onToggle:()=>E(A),lastLogRef:R===O.length-1?j:void 0},A.id));let K;e[10]!==z||e[11]!==$?(K=n.jsx(z,{children:$}),e[10]=z,e[11]=$,e[12]=K):K=e[12];let B;return e[13]!==M||e[14]!==L||e[15]!==K?(B=n.jsx("div",{className:T,children:n.jsx("div",{className:C,children:n.jsx("div",{className:k,children:n.jsxs(M,{className:_,children:[L,K]})})})}),e[13]=M,e[14]=L,e[15]=K,e[16]=B):B=e[16],B}function cc(t){return[t.id,t]}function uc(t){return[t.id,t]}function dc(t){return[t.userId,t.user]}function mc(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading logs..."})}),t[0]=e):e=t[0],e}const rn=Object.assign(lc,{Skeleton:mc});function fc(t){const e=U.c(86),{tab:r,dateRange:a,displayDateRange:s,connectionIds:i,virtualMcpIds:o,tool:c,status:l,search:u,streaming:d,hideSystem:p,activeFiltersCount:m,from:y,to:g,propertyFilters:x,onUpdateFilters:b,onTimeRangeChange:v,onStreamingToggle:h,onTabChange:j}=t,N=Ht(),P=Sa(),{data:w}=xs();let S;e[0]!==N?(S=N??[],e[0]=N,e[1]=S):S=e[1];let O;e[2]!==S?(O=S.map(vc),e[2]=S,e[3]=O):O=e[3];const I=O;let E;e[4]!==P?(E=P.map(hc),e[4]=P,e[5]=E):E=e[5];const D=E,{pageSize:T,streamingRefetchInterval:C}=yn,{org:k,locator:M}=Me();let _;e[6]!==k.id?(_={connectionId:Vt,orgId:k.id},e[6]=k.id,e[7]=_):_=e[7];const L=qt(_);let z,$,K;if(e[8]!==i[0]||e[9]!==i.length||e[10]!==a.endDate||e[11]!==a.startDate||e[12]!==p||e[13]!==M||e[14]!==k.id||e[15]!==x||e[16]!==l||e[17]!==c||e[18]!==o[0]||e[19]!==o.length){const re=xn(x),_e=p?[Jn.SELF(k.id)]:void 0;z={startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:i.length===1?i[0]:void 0,excludeConnectionIds:_e,virtualMcpId:o.length===1?o[0]:void 0,toolName:c||void 0,isError:l==="errors"?!0:l==="success"?!1:void 0,...re},K=ys,$=at.monitoringLogsInfinite(M,JSON.stringify(z)),e[8]=i[0],e[9]=i.length,e[10]=a.endDate,e[11]=a.startDate,e[12]=p,e[13]=M,e[14]=k.id,e[15]=x,e[16]=l,e[17]=c,e[18]=o[0],e[19]=o.length,e[20]=z,e[21]=$,e[22]=K}else z=e[20],$=e[21],K=e[22];let B;e[23]!==z||e[24]!==L?(B=async re=>{const{pageParam:_e}=re,an=_e===void 0?0:_e;if(!L)throw new Error("MCP client is not available");const Xt=await L.callTool({name:"MONITORING_LOGS_LIST",arguments:{...z,limit:T,offset:an}});return Xt.structuredContent??Xt},e[23]=z,e[24]=L,e[25]=B):B=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=(re,_e)=>{if(!((re?.logs?.length??0)<T))return _e.length*T},e[26]=A):A=e[26];const R=d?C:!1;let F;e[27]!==$||e[28]!==B||e[29]!==R?(F={queryKey:$,queryFn:B,initialPageParam:0,getNextPageParam:A,staleTime:0,refetchInterval:R},e[27]=$,e[28]=B,e[29]=R,e[30]=F):F=e[30];const{data:Z,fetchNextPage:Y,hasNextPage:G,isFetchingNextPage:Q}=K(F);let X;e[31]!==Z?.pages?(X=Z?.pages.flatMap(pc)??[],e[31]=Z?.pages,e[32]=X):X=e[32];const ee=X,se=Z?.pages[0]?.total;let ie;e[33]!==Y||e[34]!==G||e[35]!==Q?(ie=()=>{G&&!Q&&Y()},e[33]=Y,e[34]=G,e[35]=Q,e[36]=ie):ie=e[36];const we=ie;let oe;e[37]===Symbol.for("react.memo_cache_sentinel")?(oe={id:"logs",label:"Logs"},e[37]=oe):oe=e[37];let le;e[38]===Symbol.for("react.memo_cache_sentinel")?(le={id:"analytics",label:"Analytics"},e[38]=le):le=e[38];let ce;e[39]===Symbol.for("react.memo_cache_sentinel")?(ce=[oe,le,{id:"dashboards",label:"Dashboards"}],e[39]=ce):ce=e[39];const Ne=ce;let ue;e[40]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(ge.Header.Left,{children:n.jsx(dn,{children:n.jsx(mn,{children:n.jsx(fn,{children:n.jsx(pn,{children:"Monitoring"})})})})}),e[40]=ue):ue=e[40];let de;e[41]!==m||e[42]!==i||e[43]!==I||e[44]!==y||e[45]!==p||e[46]!==d||e[47]!==h||e[48]!==v||e[49]!==b||e[50]!==x||e[51]!==l||e[52]!==r||e[53]!==g||e[54]!==c||e[55]!==o||e[56]!==D?(de=r==="logs"&&n.jsx(ge.Header.Right,{children:n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(oc,{connectionIds:i,virtualMcpIds:o,tool:c,status:l,hideSystem:p,propertyFilters:x,connectionOptions:I,virtualMcpOptions:D,activeFiltersCount:m,onUpdateFilters:b}),n.jsxs(be,{variant:d?"secondary":"outline",size:"sm",className:Se("h-7 px-2 sm:px-3 gap-1.5",d&&"bg-muted hover:bg-muted/80"),onClick:h,children:[d?n.jsx(Aa,{size:16,className:"animate-pulse"}):n.jsx(Ea,{size:16}),n.jsx("span",{className:"hidden sm:inline",children:d?"Streaming":"Stream"})]}),n.jsx(bn,{value:{from:y,to:g},onChange:v})]})}),e[41]=m,e[42]=i,e[43]=I,e[44]=y,e[45]=p,e[46]=d,e[47]=h,e[48]=v,e[49]=b,e[50]=x,e[51]=l,e[52]=r,e[53]=g,e[54]=c,e[55]=o,e[56]=D,e[57]=de):de=e[57];let W;e[58]!==de?(W=n.jsxs(ge.Header,{children:[ue,de]}),e[58]=de,e[59]=W):W=e[59];let q;e[60]!==j?(q=re=>j(re),e[60]=j,e[61]=q):q=e[61];let te;e[62]!==q||e[63]!==r?(te=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(Is,{tabs:Ne,activeTab:r,onTabChange:q})}),e[62]=q,e[63]=r,e[64]=te):te=e[64];let pe;e[65]!==N||e[66]!==ee||e[67]!==P||e[68]!==i||e[69]!==s||e[70]!==we||e[71]!==G||e[72]!==Q||e[73]!==w||e[74]!==b||e[75]!==u||e[76]!==l||e[77]!==r||e[78]!==c||e[79]!==se||e[80]!==o?(pe=r==="dashboards"?n.jsx(Al,{}):r==="logs"?n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx(tn,{displayDateRange:s,connectionIds:i,logs:ee,total:se}),n.jsx(un,{value:u,onChange:re=>b({search:re}),placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:re=>{re.key==="Escape"&&(b({search:""}),re.target.blur())}}),n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx(rn,{connectionIds:i,virtualMcpIds:o,tool:c,status:l,search:u,logs:ee,hasMore:G??!1,onLoadMore:we,isLoadingMore:Q,connections:N,virtualMcps:P,membersData:w})})]}):n.jsx(nc,{}),e[65]=N,e[66]=ee,e[67]=P,e[68]=i,e[69]=s,e[70]=we,e[71]=G,e[72]=Q,e[73]=w,e[74]=b,e[75]=u,e[76]=l,e[77]=r,e[78]=c,e[79]=se,e[80]=o,e[81]=pe):pe=e[81];let Xe;return e[82]!==W||e[83]!==te||e[84]!==pe?(Xe=n.jsxs(n.Fragment,{children:[W,te,pe]}),e[82]=W,e[83]=te,e[84]=pe,e[85]=Xe):Xe=e[85],Xe}function pc(t){return t?.logs??[]}function hc(t){return{value:t.id??"",label:t.title??"Decopilot"}}function vc(t){return{value:t.id,label:t.title||t.id}}function Pu(){const t=U.c(68),{org:e}=Me(),r=Ze();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/$project/monitoring"},t[0]=a):a=t[0];const s=cn(a),{tab:i,from:o,to:c,connectionId:l,virtualMcpId:u,tool:d,search:p,status:m,streaming:y,propertyFilters:g,hideSystem:x}=s,b=i===void 0?"logs":i;let v;t[1]!==l?(v=l===void 0?[]:l,t[1]=l,t[2]=v):v=t[2];const h=v;let j;t[3]!==u?(j=u===void 0?[]:u,t[3]=u,t[4]=j):j=t[4];const N=j,P=y===void 0?!0:y,w=g===void 0?"":g,S=x===void 0?!1:x;let O,I,E,D,T,C,k;if(t[5]!==h.length||t[6]!==o||t[7]!==S||t[8]!==r||t[9]!==e.slug||t[10]!==w||t[11]!==s||t[12]!==m||t[13]!==P||t[14]!==c||t[15]!==d||t[16]!==N.length){T=gn(w);let F;t[24]!==r||t[25]!==e.slug||t[26]!==s?(F=X=>{r({to:"/$org/$project/monitoring",params:{org:e.slug,project:Re},search:{...s,...X}})},t[24]=r,t[25]=e.slug,t[26]=s,t[27]=F):F=t[27],k=F;let Z;t[28]!==k?(Z=X=>{k({from:X.from,to:X.to})},t[28]=k,t[29]=Z):Z=t[29],D=Z;let Y,G;if(t[30]!==o||t[31]!==P||t[32]!==c){const X=Qt(o),ee=Qt(c);G=X.date||new Date(Date.now()-864e5);const se=ee.date||new Date;E={startDate:G,endDate:se},Y=se,P&&c==="now"&&(Y=new Date(se),Y.setHours(Y.getHours()+1)),t[30]=o,t[31]=P,t[32]=c,t[33]=E,t[34]=Y,t[35]=G}else E=t[33],Y=t[34],G=t[35];let Q;t[36]!==Y||t[37]!==G?(Q={startDate:G,endDate:Y},t[36]=Y,t[37]=G,t[38]=Q):Q=t[38],I=Q,O=0,h.length>0&&O++,N.length>0&&O++,d&&O++,m!=="all"&&O++,S&&O++,C=T.filter(gc),t[5]=h.length,t[6]=o,t[7]=S,t[8]=r,t[9]=e.slug,t[10]=w,t[11]=s,t[12]=m,t[13]=P,t[14]=c,t[15]=d,t[16]=N.length,t[17]=O,t[18]=I,t[19]=E,t[20]=D,t[21]=T,t[22]=C,t[23]=k}else O=t[17],I=t[18],E=t[19],D=t[20],T=t[21],C=t[22],k=t[23];const M=C;M.length>0&&(O=O+M.length);let _;t[39]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ge.Header,{children:n.jsx(ge.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=_):_=t[39];let L;t[40]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=L):L=t[40];let z;t[41]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(n.Fragment,{children:[_,n.jsx(ge.Content,{children:n.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[L,n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Kt,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=z):z=t[41];let $;t[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(ge.Header,{children:n.jsx(ge.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[42]=$):$=t[42];let K;t[43]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsxs(n.Fragment,{children:[$,n.jsx(ge.Content,{children:n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx(tn.Skeleton,{}),n.jsx(rn.Skeleton,{})]})})]}),t[43]=K):K=t[43];let B;t[44]!==P||t[45]!==k?(B=()=>k({streaming:!P}),t[44]=P,t[45]=k,t[46]=B):B=t[46];let A;t[47]!==k?(A=F=>k({tab:F}),t[47]=k,t[48]=A):A=t[48];let R;return t[49]!==O||t[50]!==h||t[51]!==I||t[52]!==E||t[53]!==o||t[54]!==D||t[55]!==S||t[56]!==T||t[57]!==p||t[58]!==m||t[59]!==P||t[60]!==B||t[61]!==A||t[62]!==b||t[63]!==c||t[64]!==d||t[65]!==k||t[66]!==N?(R=n.jsx(ge,{children:n.jsx(qe,{fallback:z,children:n.jsx(f.Suspense,{fallback:K,children:n.jsx(fc,{tab:b,dateRange:I,displayDateRange:E,connectionIds:h,virtualMcpIds:N,tool:d,status:m,search:p,streaming:P,hideSystem:S,activeFiltersCount:O,from:o,to:c,propertyFilters:T,onUpdateFilters:k,onTimeRangeChange:D,onStreamingToggle:B,onTabChange:A})})})}),t[49]=O,t[50]=h,t[51]=I,t[52]=E,t[53]=o,t[54]=D,t[55]=S,t[56]=T,t[57]=p,t[58]=m,t[59]=P,t[60]=B,t[61]=A,t[62]=b,t[63]=c,t[64]=d,t[65]=k,t[66]=N,t[67]=R):R=t[67],R}function gc(t){return t.key.trim()}export{Pu as default};
@@ -1 +1 @@
1
- import{r as N,c as we,e as Te,j as t,u as Ee,m as Me,n as Re,K as ve,aE as ze,t as pe}from"./index-CMIePc8v.js";import{E as Ae}from"./error-boundary-BbdoNwwk.js";import{h as Le}from"./use-connection-CZeLlUDa.js";import{u as Oe,a as We}from"./constants-BWuwqVaf.js";import{B as re}from"./button-DDY6hri1.js";import{I as le}from"./input-Je9XV62u.js";import{I as ke}from"./integration-icon-DeiJ75EP.js";import{C as $e}from"./checkbox-_pZquTsv.js";import{b as Ve,P as Ue,a as Ge}from"./popover-CdPr2kUy.js";import{t as Fe}from"./ChevronDown-BK0Z-3ss.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as He}from"./select-B9AjxT2Q.js";import{s as Ke}from"./Hash02-B_cIkiva.js";import{i as qe}from"./Play-Dv6XoPC1.js";import{s as Qe}from"./Plus-BpJ1F9ED.js";import{s as Ie}from"./RefreshCw01-BLvlqjIJ.js";import{s as Je}from"./Trash01-NHvYJiOw.js";import{T as Ye,a as Se}from"./toggle-group-BYr6H2N2.js";import{a as Ze,V as Xe}from"./layout-BWtcS0Q2.js";import{S as et}from"./save-actions-DnxE-Bzm.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-Dit0z7A7.js";import"./AlertTriangle-Suhq71Ba.js";import"./useMutation-CTU78J7M.js";import"./Container-Dkua_wx6.js";import"./Check-2BTd1528.js";import"./index-IwkUYudi.js";import"./index-Ck8tqNHK.js";import"./use-mobile-DLzBblnh.js";import"./X-nbY3n5YX.js";import"./tooltip-Kun6OEqc.js";import"./Save01-C7Op6P3G.js";import"./Loading01-BntQXW3R.js";import"./ChevronRight-CpFHeZ-k.js";const Be=({size:l=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M16 10H3m17-4H3m17 8H3m13 4H3"}));Be.displayName="AlignLeft";const _e=({size:l=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const h=s.matchedRecords??0;let x;e[6]!==h?(x=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[h," records matched"]}),e[6]=h,e[7]=x):x=e[7];let f;return e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"text-center py-4",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let h;return e[18]!==c||e[19]!==m?(h=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=h):h=e[20],h}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,S)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},S),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let h;e[30]!==s.timeseries.length?(h=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=h):h=e[31];let x;return e[32]!==m||e[33]!==h?(x=t.jsxs("div",{className:"py-2",children:[m,h]}),e[32]=m,e[33]=h,e[34]=x):x=e[34],x}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:h,onPreview:x,previewResult:f,isPreviewing:u}=l,S=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(He,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==S?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:S,children:z}),e[1]=d,e[2]=S,e[3]=D):D=e[3];const ae=!h;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Fe,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let C;e[11]!==s.type?(C=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=C):C=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let B;e[15]!==k||e[16]!==C||e[17]!==F?(B=t.jsxs("div",{className:"flex items-center gap-2",children:[k,C,F]}),e[15]=k,e[16]=C,e[17]=F,e[18]=B):B=e[18];let P;e[19]!==u?(P=u?t.jsx(Ie,{size:14,className:"animate-spin"}):t.jsx(qe,{size:14}),e[19]=u,e[20]=P):P=e[20];let _;e[21]!==u||e[22]!==x||e[23]!==P?(_=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:x,disabled:u,children:P}),e[21]=u,e[22]=x,e[23]=P,e[24]=_):_=e[24];const A=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Je,{size:14}),e[27]=L):L=e[27];let E;e[28]!==j||e[29]!==A||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:A,style:T,children:L}),e[28]=j,e[29]=A,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==_||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[_,E]}),e[32]=_,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==B||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[B,M]}),e[35]=B,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(Ke,{size:14})}),e[49]=I):I=e[49];let O;e[50]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=O):O=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Be,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,O,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let $;e[55]!==n||e[56]!==W?($=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=$):$=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let H;e[67]!==U||e[68]!==G?(H=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=H):H=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let K;e[71]!==o||e[72]!==s?(K=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=K):K=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let q;e[76]!==K||e[77]!==s.sourceFrom?(q=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:K,children:[me,de]})]}),e[76]=K,e[77]=s.sourceFrom,e[78]=q):q=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let he;e[83]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=he):he=e[83];let xe;e[84]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=xe):xe=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[he,xe]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==q||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[q,J]}),e[88]=q,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==$||e[98]!==H||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[$,H,Y,Z,X]}),e[97]=$,e[98]=H,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=Oe({connectionId:We,orgId:e.id}),d=Le(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,h]=N.useState(c?.name??""),[x,f]=N.useState(c?.description??""),[u,S]=N.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=N.useState(!1),[ae,g]=N.useState(!1),[p,k]=N.useState(c?.filters?.connectionIds??[]),[C,F]=N.useState(c?.filters?.toolNames?.[0]??""),[B,P]=N.useState({}),[_,A]=N.useState(new Set),ie=()=>{S([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{S(u.filter((a,n)=>n!==r)),g(!0)},L=(r,a)=>{const n=[...u];n[r]=a,S(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){A(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),C.trim()&&(v.toolNames=[C.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(O=>({...O,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{A(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),C.trim()&&(r.toolNames=[C.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:x.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{h(c?.name??""),f(c?.description??""),S(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{h(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:x,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Ve,{children:[t.jsx(Ue,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Fe,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ge,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx($e,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:C,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>L(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,S(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,S(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:B[r.id]??null,isPreviewing:_.has(r.id)},r.id))})]})]})})]})}function Ut(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Te(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Ae,{fallback:o,children:t.jsx(N.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Ut as default};
1
+ import{r as N,c as we,e as Te,j as t,u as Ee,m as Me,n as Re,K as ve,aE as ze,t as pe}from"./index-CKXRhh0t.js";import{E as Ae}from"./error-boundary-BOjL_3iE.js";import{h as Le}from"./use-connection-CU1wdNM8.js";import{u as Oe,a as We}from"./constants-Bz_J8k2h.js";import{B as re}from"./button-BjJbLzI1.js";import{I as le}from"./input-BPPp7fkV.js";import{I as ke}from"./integration-icon-CaUI1jG_.js";import{C as $e}from"./checkbox-ClNyXMEe.js";import{b as Ve,P as Ue,a as Ge}from"./popover-Dz4mFPzW.js";import{t as Fe}from"./ChevronDown-CEb48ZDu.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as He}from"./select-CwR5iwKr.js";import{s as Ke}from"./Hash02-BWg3CKrn.js";import{i as qe}from"./Play-CGUn4LDu.js";import{s as Qe}from"./Plus-CfD4U7h2.js";import{s as Ie}from"./RefreshCw01-DsYl6Nso.js";import{s as Je}from"./Trash01-CNjhe6V_.js";import{T as Ye,a as Se}from"./toggle-group-BsC04HU0.js";import{a as Ze,V as Xe}from"./layout-B_vm2aCi.js";import{S as et}from"./save-actions-BYQZP6Sr.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-_jAneXHm.js";import"./AlertTriangle-MQM19F_y.js";import"./useMutation-D2jNlXyR.js";import"./Container-D3N8SS-J.js";import"./Check-BXz-Aa3Y.js";import"./index-BqwppNxk.js";import"./index-lC9RbQEq.js";import"./use-mobile-B6wwiLld.js";import"./X-OID4YrAs.js";import"./tooltip-C-TvyUPP.js";import"./Save01-CVm8Nhi5.js";import"./Loading01-Bm0RmGTq.js";import"./ChevronRight-CQS5xbc3.js";const Be=({size:l=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M16 10H3m17-4H3m17 8H3m13 4H3"}));Be.displayName="AlignLeft";const _e=({size:l=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const h=s.matchedRecords??0;let x;e[6]!==h?(x=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[h," records matched"]}),e[6]=h,e[7]=x):x=e[7];let f;return e[8]!==m||e[9]!==x?(f=t.jsxs("div",{className:"text-center py-4",children:[m,x]}),e[8]=m,e[9]=x,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let h;return e[18]!==c||e[19]!==m?(h=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=h):h=e[20],h}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,S)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},S),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let h;e[30]!==s.timeseries.length?(h=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=h):h=e[31];let x;return e[32]!==m||e[33]!==h?(x=t.jsxs("div",{className:"py-2",children:[m,h]}),e[32]=m,e[33]=h,e[34]=x):x=e[34],x}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:h,onPreview:x,previewResult:f,isPreviewing:u}=l,S=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(He,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==S?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:S,children:z}),e[1]=d,e[2]=S,e[3]=D):D=e[3];const ae=!h;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Fe,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let C;e[11]!==s.type?(C=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=C):C=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let B;e[15]!==k||e[16]!==C||e[17]!==F?(B=t.jsxs("div",{className:"flex items-center gap-2",children:[k,C,F]}),e[15]=k,e[16]=C,e[17]=F,e[18]=B):B=e[18];let P;e[19]!==u?(P=u?t.jsx(Ie,{size:14,className:"animate-spin"}):t.jsx(qe,{size:14}),e[19]=u,e[20]=P):P=e[20];let _;e[21]!==u||e[22]!==x||e[23]!==P?(_=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:x,disabled:u,children:P}),e[21]=u,e[22]=x,e[23]=P,e[24]=_):_=e[24];const A=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let L;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Je,{size:14}),e[27]=L):L=e[27];let E;e[28]!==j||e[29]!==A||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:A,style:T,children:L}),e[28]=j,e[29]=A,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==_||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[_,E]}),e[32]=_,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==B||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[B,M]}),e[35]=B,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(Ke,{size:14})}),e[49]=I):I=e[49];let O;e[50]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=O):O=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Be,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,O,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let $;e[55]!==n||e[56]!==W?($=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=$):$=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let H;e[67]!==U||e[68]!==G?(H=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=H):H=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let K;e[71]!==o||e[72]!==s?(K=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=K):K=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let q;e[76]!==K||e[77]!==s.sourceFrom?(q=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:K,children:[me,de]})]}),e[76]=K,e[77]=s.sourceFrom,e[78]=q):q=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let he;e[83]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=he):he=e[83];let xe;e[84]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=xe):xe=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[he,xe]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==q||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[q,J]}),e[88]=q,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==$||e[98]!==H||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[$,H,Y,Z,X]}),e[97]=$,e[98]=H,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=Oe({connectionId:We,orgId:e.id}),d=Le(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,h]=N.useState(c?.name??""),[x,f]=N.useState(c?.description??""),[u,S]=N.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=N.useState(!1),[ae,g]=N.useState(!1),[p,k]=N.useState(c?.filters?.connectionIds??[]),[C,F]=N.useState(c?.filters?.toolNames?.[0]??""),[B,P]=N.useState({}),[_,A]=N.useState(new Set),ie=()=>{S([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{S(u.filter((a,n)=>n!==r)),g(!0)},L=(r,a)=>{const n=[...u];n[r]=a,S(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){A(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),C.trim()&&(v.toolNames=[C.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(O=>({...O,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{A(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),C.trim()&&(r.toolNames=[C.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:x.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{h(c?.name??""),f(c?.description??""),S(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{h(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:x,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Ve,{children:[t.jsx(Ue,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Fe,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ge,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx($e,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:C,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>L(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,S(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,S(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:B[r.id]??null,isPreviewing:_.has(r.id)},r.id))})]})]})})]})}function Ut(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Te(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Ie,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Ae,{fallback:o,children:t.jsx(N.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Ut as default};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t,c as D,m as xe,u as fe,n as ne,K as oe,aE as ge,e as pe,b as he}from"./index-CMIePc8v.js";import{a as je,u as be}from"./constants-BWuwqVaf.js";import{B as R}from"./button-DDY6hri1.js";import{p as ee,a as ce,s as ye,b as ve,e as me,i as Ne,T as we}from"./time-range-picker-VoxMdMGw.js";import{s as re}from"./RefreshCw01-BLvlqjIJ.js";import{E as ke}from"./error-boundary-BbdoNwwk.js";import{V as Se,a as Ce}from"./layout-BWtcS0Q2.js";import{b as de,c as $e,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-Dit0z7A7.js";import{B as _e}from"./badge-EvnzqGBM.js";import{I as ue}from"./input-Je9XV62u.js";import{b as Pe,P as Ie,a as Me}from"./popover-CdPr2kUy.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-B9AjxT2Q.js";import{T as Ke}from"./textarea-Dfcf9iVI.js";import{T as Le,a as Ve,b as qe}from"./tooltip-Kun6OEqc.js";import{i as Qe}from"./Code01-D7rt1C5k.js";import{i as We}from"./FilterLines-DcFfiBYv.js";import{c as Ge}from"./Grid01-DtWTP079.js";import{s as He}from"./Plus-BpJ1F9ED.js";import{s as Ye}from"./Trash01-NHvYJiOw.js";import{s as Ue}from"./XClose-DHV8bqGR.js";import"./Check-2BTd1528.js";import"./Copy01-CWD2XYkN.js";import"./Download01-w53nljTi.js";import"./Key01-FdWHEw6c.js";import"./Play-Dv6XoPC1.js";import"./scroll-area-C-RNU2ZC.js";import"./spinner-C5H8EOvR.js";import"./ChevronDown-BK0Z-3ss.js";import"./Clock-DWLl74MU.js";import"./ChevronRight-CpFHeZ-k.js";import"./AlertTriangle-Suhq71Ba.js";import"./index-Ck8tqNHK.js";import"./use-mobile-DLzBblnh.js";import"./X-nbY3n5YX.js";import"./index-IwkUYudi.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=$.useState(!1),[l,n]=$.useState("raw"),[c,o]=$.useState(s),[m,d]=$.useState(ee(s)),g=$.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter((C,F)=>F!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Me,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
1
+ import{r as $,j as t,c as D,m as xe,u as fe,n as ne,K as oe,aE as ge,e as pe,b as he}from"./index-CKXRhh0t.js";import{a as je,u as be}from"./constants-Bz_J8k2h.js";import{B as R}from"./button-BjJbLzI1.js";import{p as ee,a as ce,s as ye,b as ve,e as me,i as Ne,T as we}from"./time-range-picker-CPtVWgsO.js";import{s as re}from"./RefreshCw01-DsYl6Nso.js";import{E as ke}from"./error-boundary-BOjL_3iE.js";import{V as Se,a as Ce}from"./layout-B_vm2aCi.js";import{b as de,c as $e,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-_jAneXHm.js";import{B as _e}from"./badge-CQ9R9pkG.js";import{I as ue}from"./input-BPPp7fkV.js";import{b as Pe,P as Ie,a as Me}from"./popover-Dz4mFPzW.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-CwR5iwKr.js";import{T as Ke}from"./textarea-C7R7dq5L.js";import{T as Le,a as Ve,b as qe}from"./tooltip-C-TvyUPP.js";import{i as Qe}from"./Code01-CVF-mmmz.js";import{i as We}from"./FilterLines-B-D6srZC.js";import{c as Ge}from"./Grid01-BGPoEeik.js";import{s as He}from"./Plus-CfD4U7h2.js";import{s as Ye}from"./Trash01-CNjhe6V_.js";import{s as Ue}from"./XClose-CVjVP425.js";import"./Check-BXz-Aa3Y.js";import"./Copy01-CFXdI8SF.js";import"./Download01-BuGXWPUb.js";import"./Key01-BBHw8-AF.js";import"./Play-CGUn4LDu.js";import"./scroll-area-D6nBfX1Y.js";import"./spinner-B4HBT9r3.js";import"./ChevronDown-CEb48ZDu.js";import"./Clock-X1ZnQ0e8.js";import"./ChevronRight-CQS5xbc3.js";import"./AlertTriangle-MQM19F_y.js";import"./index-lC9RbQEq.js";import"./use-mobile-B6wwiLld.js";import"./X-OID4YrAs.js";import"./index-BqwppNxk.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=$.useState(!1),[l,n]=$.useState("raw"),[c,o]=$.useState(s),[m,d]=$.useState(ee(s)),g=$.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter((C,F)=>F!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Me,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
2
2
  thread_id=abc123
3
3
  user~test
4
4
  debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.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:[c.map((a,x)=>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 ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(ze,{value:a.operator,onValueChange:u=>{const h=[...c],C=h[x];C&&(h[x]={...C,operator:u,value:u==="exists"?"":C.value},o(h),e(h.filter(F=>F.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Je.map(u=>t.jsx(Ae,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),C=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],C)}),t.jsx("span",{children:x.toLocaleString([],C)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:je,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=be(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ye(N);k=N.length>0?ve(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:C,isRefetching:F}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==C?.results?(H=new Map(C?.results?.map(nt)??[]),e[29]=C?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx(Fe,{asChild:!0,children:t.jsx(ge,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{}),e[37]=U):U=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx($e,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let J;e[40]!==_||e[41]!==P?(J=t.jsx(De,{children:t.jsxs(Te,{children:[_,U,P]})}),e[40]=_,e[41]=P,e[42]=J):J=e[42];const te=J;let I;e[43]!==n?(I=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(Ne,{size:14})}),e[43]=n,e[44]=I):I=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let M;e[46]!==c?(M=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=M):M=e[47];let z;e[48]!==m||e[49]!==l?(z=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=z):z=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(we,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==I||e[58]!==M||e[59]!==z||e[60]!==E?(O=t.jsxs(Se,{children:[I,M,z,E]}),e[57]=I,e[58]=M,e[59]=z,e[60]=E,e[61]=O):O=e[61];let A;e[62]!==y.description?(A=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=A):A=e[63];let K;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],K=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=K}else K=e[66];let L;e[69]!==K?(L=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:K}),e[69]=K,e[70]=L):L=e[70];let V;e[71]!==F?(V=F&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=F,e[72]=V):V=e[72];let q;e[73]!==A||e[74]!==L||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[A,L,V]}),e[73]=A,e[74]=L,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs(Ce,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=$.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=$.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ke,{fallback:j,children:t.jsx($.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Qt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=pe(e),{org:i,project:l}=fe(),n=he();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Qt as default};
@@ -1 +1 @@
1
- import{r as i,j as e}from"./index-CMIePc8v.js";import{i as n}from"./Loading01-BntQXW3R.js";import{h as l}from"./mcp-oauth-DtHeHoWJ.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
1
+ import{r as i,j as e}from"./index-CKXRhh0t.js";import{i as n}from"./Loading01-Bm0RmGTq.js";import{h as l}from"./mcp-oauth-6gipdrl8.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};