@piwitests/server 0.24.0 → 0.25.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 (438) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{DbmGeOus.js → 5nOoVJzL.js} +1 -1
  3. package/.output/public/_nuxt/6DSY_93j.js +1 -0
  4. package/.output/public/_nuxt/7vRR5W2L.js +1 -0
  5. package/.output/public/_nuxt/{DM3bDZC6.js → 9Dtlg-K4.js} +1 -1
  6. package/.output/public/_nuxt/9Yziijlb.js +1 -0
  7. package/.output/public/_nuxt/{BakMHV79.js → B-onBCAB.js} +1 -1
  8. package/.output/public/_nuxt/B2bK5uNR.js +1 -0
  9. package/.output/public/_nuxt/{BkM2KXUo.js → B63B19Iv.js} +2 -2
  10. package/.output/public/_nuxt/{BFxvHlO9.js → B77w1Eib.js} +1 -1
  11. package/.output/public/_nuxt/{Drw8yQg6.js → BC5bqlfM.js} +1 -1
  12. package/.output/public/_nuxt/{CJ1rmnk4.js → BF5JDf9_.js} +1 -1
  13. package/.output/public/_nuxt/BFVrl1ss.js +1 -0
  14. package/.output/public/_nuxt/{CjtjQV60.js → BIHMeNW-.js} +1 -1
  15. package/.output/public/_nuxt/BKqOGcst.js +1 -0
  16. package/.output/public/_nuxt/{Bme1UkOl.js → BLqooxh5.js} +1 -1
  17. package/.output/public/_nuxt/{D0Kop4bS.js → BMfTUMYy.js} +1 -1
  18. package/.output/public/_nuxt/{V9p3z39z.js → BOrnSpTA.js} +1 -1
  19. package/.output/public/_nuxt/{DEvYVl9M.js → BPQNVV4M.js} +1 -1
  20. package/.output/public/_nuxt/{DuOH5jcQ.js → BSKLNgre.js} +1 -1
  21. package/.output/public/_nuxt/BTCWUyBX.js +1 -0
  22. package/.output/public/_nuxt/BUYmGTVP.js +1 -0
  23. package/.output/public/_nuxt/{CgkXEZMo.js → BWddBCom.js} +1 -1
  24. package/.output/public/_nuxt/{B33YjaHr.js → BYQ9lXQb.js} +1 -1
  25. package/.output/public/_nuxt/BYWQ47QQ.js +5 -0
  26. package/.output/public/_nuxt/{BvAfKk6C.js → BYnqoVCE.js} +1 -1
  27. package/.output/public/_nuxt/{-COcylA_.js → BaU2hm4B.js} +1 -1
  28. package/.output/public/_nuxt/{6Z_ZwH8I.js → BbXvpkBp.js} +1 -1
  29. package/.output/public/_nuxt/Bb_925DD.js +1 -0
  30. package/.output/public/_nuxt/BcHU1KNK.js +1 -0
  31. package/.output/public/_nuxt/BdUGUwvE.js +1 -0
  32. package/.output/public/_nuxt/{DPZBpFOX.js → BeQq85yJ.js} +2 -2
  33. package/.output/public/_nuxt/Bg8yOdSf.js +1 -0
  34. package/.output/public/_nuxt/BhzfJaPC.js +1 -0
  35. package/.output/public/_nuxt/{D1vqYZsL.js → Bkb-0yS0.js} +4 -4
  36. package/.output/public/_nuxt/BmweLu9g.js +2 -0
  37. package/.output/public/_nuxt/Boyv6hLW.js +1 -0
  38. package/.output/public/_nuxt/{BtSGUY-7.js → Bq4xEWLF.js} +4 -4
  39. package/.output/public/_nuxt/{CMuzkARi.js → BraJd4EA.js} +1 -1
  40. package/.output/public/_nuxt/BvXrhZ8k.js +1 -0
  41. package/.output/public/_nuxt/{B8H4XydJ.js → Bw4oIhct.js} +1 -1
  42. package/.output/public/_nuxt/BxSrScjV.js +1 -0
  43. package/.output/public/_nuxt/Byqt8JHG.js +1 -0
  44. package/.output/public/_nuxt/{C5TrTuWv.js → BzBaMPgu.js} +3 -3
  45. package/.output/public/_nuxt/{BKrWWV14.js → C1-8_6cB.js} +1 -1
  46. package/.output/public/_nuxt/{CjBktNrC.js → C7SG50jD.js} +1 -1
  47. package/.output/public/_nuxt/{BkxRbXIj.js → C8WgBDU1.js} +1 -1
  48. package/.output/public/_nuxt/C8uZoJVq.js +1 -0
  49. package/.output/public/_nuxt/{Bg93Rnts.js → CBQXv4bU.js} +2 -2
  50. package/.output/public/_nuxt/CDEmotIt.js +1 -0
  51. package/.output/public/_nuxt/CIBOv3Ge.js +2 -0
  52. package/.output/public/_nuxt/CO7j4p5r.js +1 -0
  53. package/.output/public/_nuxt/COMhp7lz.js +1 -0
  54. package/.output/public/_nuxt/{CsV7pmcT.js → CPiLUjjx.js} +1 -1
  55. package/.output/public/_nuxt/{D_y2VS8k.js → CTYlay1H.js} +1 -1
  56. package/.output/public/_nuxt/{VACXezo0.js → CVEk4D8I.js} +1 -1
  57. package/.output/public/_nuxt/{P5uOaRUZ.js → CbuK1HIv.js} +1 -1
  58. package/.output/public/_nuxt/{opyDpgSw.js → CdLqOMvN.js} +1 -1
  59. package/.output/public/_nuxt/CdM2qNYM.js +2 -0
  60. package/.output/public/_nuxt/Ch8sGLqE.js +1 -0
  61. package/.output/public/_nuxt/CkdznmkX.js +1 -0
  62. package/.output/public/_nuxt/{B1LUinhp.js → Cmuwgbf4.js} +1 -1
  63. package/.output/public/_nuxt/{Ce5_Tq63.js → CnRNwiuE.js} +1 -1
  64. package/.output/public/_nuxt/{Bp3FRuEm.js → CnsaoeEq.js} +1 -1
  65. package/.output/public/_nuxt/{BUnwEAjq.js → Cp0V2FeW.js} +1 -1
  66. package/.output/public/_nuxt/Cvw4EFTy.js +17 -0
  67. package/.output/public/_nuxt/CwDej2Lz.js +1 -0
  68. package/.output/public/_nuxt/D-wlhH6J.js +1 -0
  69. package/.output/public/_nuxt/D5Mhpp98.js +1 -0
  70. package/.output/public/_nuxt/{CDTeSrLO.js → D8ixf-ZR.js} +5 -5
  71. package/.output/public/_nuxt/{DMWfVJCj.js → DBvdRbTA.js} +2 -2
  72. package/.output/public/_nuxt/DDho3MJD.js +1 -0
  73. package/.output/public/_nuxt/DEGHW4pO.js +1 -0
  74. package/.output/public/_nuxt/{BoNKdx5o.js → DHSYRMJp.js} +1 -1
  75. package/.output/public/_nuxt/DH_LEqhd.js +2 -0
  76. package/.output/public/_nuxt/{BVLqydCr.js → DIqik40e.js} +1 -1
  77. package/.output/public/_nuxt/DLwuL-qR.js +1 -0
  78. package/.output/public/_nuxt/{CIpF9l75.js → DPDFGVb_.js} +2 -2
  79. package/.output/public/_nuxt/DRNHuVn4.js +2 -0
  80. package/.output/public/_nuxt/{DcR0Mmdl.js → DUtYU4Sb.js} +1 -1
  81. package/.output/public/_nuxt/{opwuUqHG.js → DWl73MJR.js} +1 -1
  82. package/.output/public/_nuxt/{BCGljaM0.js → DWz_bHNP.js} +1 -1
  83. package/.output/public/_nuxt/{DGq4A2Pd.js → D_SCB-z2.js} +1 -1
  84. package/.output/public/_nuxt/{DMAiMrNr.js → D_j436ND.js} +1 -1
  85. package/.output/public/_nuxt/DamzjN7l.js +1 -0
  86. package/.output/public/_nuxt/Db5xe__T.js +1 -0
  87. package/.output/public/_nuxt/{CpcrljrH.js → DcUBmKKE.js} +1 -1
  88. package/.output/public/_nuxt/DiP18sFE.js +1 -0
  89. package/.output/public/_nuxt/Die1200X.js +1 -0
  90. package/.output/public/_nuxt/{BN1zZw5b.js → DihSeDlY.js} +4 -4
  91. package/.output/public/_nuxt/{DzZpIs4W.js → DkGXOZRW.js} +1 -1
  92. package/.output/public/_nuxt/{C7fq_rHE.js → DnOtRv65.js} +1 -1
  93. package/.output/public/_nuxt/DnV-BkUA.js +1 -0
  94. package/.output/public/_nuxt/DpeRrg68.js +1 -0
  95. package/.output/public/_nuxt/Dq6_-84R.js +1 -0
  96. package/.output/public/_nuxt/DqKFKS1b.js +1 -0
  97. package/.output/public/_nuxt/DrbO0dl5.js +6 -0
  98. package/.output/public/_nuxt/{Qo6oszaF.js → Ds8_6Fzl.js} +1 -1
  99. package/.output/public/_nuxt/{BtbpLWDs.js → DvewDI9t.js} +1 -1
  100. package/.output/public/_nuxt/E26Y1NWH.js +1 -0
  101. package/.output/public/_nuxt/Hp-_W7z4.js +1 -0
  102. package/.output/public/_nuxt/OanUGF_v.js +1 -0
  103. package/.output/public/_nuxt/{CX_G-FHC.js → RSS6R9Te.js} +13 -13
  104. package/.output/public/_nuxt/{BmzxRbcg.js → VqLetC2g.js} +1 -1
  105. package/.output/public/_nuxt/WCZdf9Ln.js +1 -0
  106. package/.output/public/_nuxt/{DF6Mes5z.js → Yl6iqHwK.js} +4 -4
  107. package/.output/public/_nuxt/builds/latest.json +1 -1
  108. package/.output/public/_nuxt/builds/meta/03f2d81b-8c58-4ea8-9a9d-7553c8ca4af6.json +1 -0
  109. package/.output/public/_nuxt/{entry.DzPSf_u5.css → entry.DVKh2Fd6.css} +1 -1
  110. package/.output/public/_nuxt/iUf7K_JR.js +1 -0
  111. package/.output/public/_nuxt/{C8Paf_V1.js → kDEwM7SQ.js} +1 -1
  112. package/.output/public/_nuxt/{Bd8B-yeR.js → knaDbxMJ.js} +1 -1
  113. package/.output/public/_nuxt/lnpLc047.js +1 -0
  114. package/.output/public/_nuxt/{CD8ZzAFC.js → mhvG7mu8.js} +1 -1
  115. package/.output/public/_nuxt/{BgABj4Ty.js → qUaN2ZW8.js} +4 -4
  116. package/.output/public/_nuxt/qeqzb80l.js +1 -0
  117. package/.output/public/_nuxt/{Fsw2W4TA.js → uj92NYTx.js} +2 -2
  118. package/.output/public/_nuxt/vOZZ2cLi.js +1 -0
  119. package/.output/public/_nuxt/{CGHV0Y2d.js → zAFiz2Mg.js} +1 -1
  120. package/.output/public/demo/seed.version.json +2 -2
  121. package/.output/server/chunks/build/{Alert-He-UxEt6.mjs → Alert-BhTWQzM5.mjs} +2 -2
  122. package/.output/server/chunks/build/Alert-BhTWQzM5.mjs.map +1 -0
  123. package/.output/server/chunks/build/{Breadcrumb-DEP2dVCZ.mjs → Breadcrumb-BJnPB2AW.mjs} +3 -3
  124. package/.output/server/chunks/build/Breadcrumb-BJnPB2AW.mjs.map +1 -0
  125. package/.output/server/chunks/build/{BreadcrumbNav-y6nMDYcR.mjs → BreadcrumbNav-C6Cun6tF.mjs} +3 -3
  126. package/.output/server/chunks/build/BreadcrumbNav-C6Cun6tF.mjs.map +1 -0
  127. package/.output/server/chunks/build/{BrowserBadge-DIASU8Gf.mjs → BrowserBadge-T1KRMIXA.mjs} +4 -4
  128. package/.output/server/chunks/build/BrowserBadge-T1KRMIXA.mjs.map +1 -0
  129. package/.output/server/chunks/build/{ChartCard-ZTsCvItQ.mjs → ChartCard-D_asI_WF.mjs} +2 -2
  130. package/.output/server/chunks/build/ChartCard-D_asI_WF.mjs.map +1 -0
  131. package/.output/server/chunks/build/{ChartMarkerTooltip-u_1DUHh-.mjs → ChartMarkerTooltip-DscESDg7.mjs} +3 -3
  132. package/.output/server/chunks/build/ChartMarkerTooltip-DscESDg7.mjs.map +1 -0
  133. package/.output/server/chunks/build/{Checkbox-BisdHf8n.mjs → Checkbox-Y9ZiIRkJ.mjs} +6 -6
  134. package/.output/server/chunks/build/Checkbox-Y9ZiIRkJ.mjs.map +1 -0
  135. package/.output/server/chunks/build/{CodeBlock-B8BNtZAe.mjs → CodeBlock-Bnn_ps9O.mjs} +4 -4
  136. package/.output/server/chunks/build/CodeBlock-Bnn_ps9O.mjs.map +1 -0
  137. package/.output/server/chunks/build/{DashboardNavbar-D7-3zBUU.mjs → DashboardNavbar-D37dPEtR.mjs} +3 -3
  138. package/.output/server/chunks/build/DashboardNavbar-D37dPEtR.mjs.map +1 -0
  139. package/.output/server/chunks/build/{DashboardSidebarToggle-C3HdHvlE.mjs → DashboardSidebarToggle-DzwsZHVx.mjs} +2 -2
  140. package/.output/server/chunks/build/DashboardSidebarToggle-DzwsZHVx.mjs.map +1 -0
  141. package/.output/server/chunks/build/{DataLocationCard-CC2-lHiP.mjs → DataLocationCard-CUXgZQEs.mjs} +4 -4
  142. package/.output/server/chunks/build/DataLocationCard-CUXgZQEs.mjs.map +1 -0
  143. package/.output/server/chunks/build/{DesktopRunLocallyButton-iNzrDsEs.mjs → DesktopRunLocallyButton-BCmQklj6.mjs} +15 -76
  144. package/.output/server/chunks/build/DesktopRunLocallyButton-BCmQklj6.mjs.map +1 -0
  145. package/.output/server/chunks/build/{DiagnosisPanel-BVb2LgHu.mjs → DiagnosisPanel-haHS2azn.mjs} +7 -7
  146. package/.output/server/chunks/build/DiagnosisPanel-haHS2azn.mjs.map +1 -0
  147. package/.output/server/chunks/build/{DiagnosisResult-xVgZlfKK.mjs → DiagnosisResult-DqTIOelM.mjs} +10 -10
  148. package/.output/server/chunks/build/DiagnosisResult-DqTIOelM.mjs.map +1 -0
  149. package/.output/server/chunks/build/{DurationValue-UX9uajQJ.mjs → DurationValue-D6fQEi5S.mjs} +2 -2
  150. package/.output/server/chunks/build/DurationValue-D6fQEi5S.mjs.map +1 -0
  151. package/.output/server/chunks/build/{EmptyState-DC2q_7TD.mjs → EmptyState-C-mCzGhO.mjs} +2 -2
  152. package/.output/server/chunks/build/EmptyState-C-mCzGhO.mjs.map +1 -0
  153. package/.output/server/chunks/build/{EntityLinks-Dzn73fbq.mjs → EntityLinks-CRJQM9Vy.mjs} +3 -3
  154. package/.output/server/chunks/build/EntityLinks-CRJQM9Vy.mjs.map +1 -0
  155. package/.output/server/chunks/build/{EnvManagedBadge-C-agmABK.mjs → EnvManagedBadge-hyelwXrw.mjs} +4 -4
  156. package/.output/server/chunks/build/EnvManagedBadge-hyelwXrw.mjs.map +1 -0
  157. package/.output/server/chunks/build/{ErrorState-CktYyeEZ.mjs → ErrorState-9UPssp7w.mjs} +2 -2
  158. package/.output/server/chunks/build/ErrorState-9UPssp7w.mjs.map +1 -0
  159. package/.output/server/chunks/build/{FeatureUnavailable-DHFkwI7t.mjs → FeatureUnavailable-CDw3__eq.mjs} +3 -3
  160. package/.output/server/chunks/build/FeatureUnavailable-CDw3__eq.mjs.map +1 -0
  161. package/.output/server/chunks/build/{FormField-GYHKiSI6.mjs → FormField-8vSc-3mb.mjs} +2 -2
  162. package/.output/server/chunks/build/FormField-8vSc-3mb.mjs.map +1 -0
  163. package/.output/server/chunks/build/{GetStartedWizard-BpcGYsm2.mjs → GetStartedWizard-Dp_tjhry.mjs} +4 -4
  164. package/.output/server/chunks/build/GetStartedWizard-Dp_tjhry.mjs.map +1 -0
  165. package/.output/server/chunks/build/{HelpHint-plioHKA0.mjs → HelpHint-Bfyo3ar6.mjs} +4 -4
  166. package/.output/server/chunks/build/HelpHint-Bfyo3ar6.mjs.map +1 -0
  167. package/.output/server/chunks/build/{LoadingState-CwpfmI0W.mjs → LoadingState-CxfFwac9.mjs} +2 -2
  168. package/.output/server/chunks/build/LoadingState-CxfFwac9.mjs.map +1 -0
  169. package/.output/server/chunks/build/{MarkerBadge-Biz5--h2.mjs → MarkerBadge-DmubzeuF.mjs} +2 -2
  170. package/.output/server/chunks/build/MarkerBadge-DmubzeuF.mjs.map +1 -0
  171. package/.output/server/chunks/build/{MetaStripGroup-A0a72vt5.mjs → MetaStripGroup-C-cNBfC9.mjs} +6 -6
  172. package/.output/server/chunks/build/MetaStripGroup-C-cNBfC9.mjs.map +1 -0
  173. package/.output/server/chunks/build/{Modal-hKLvVFNp.mjs → Modal-DcNzjvnm.mjs} +2 -2
  174. package/.output/server/chunks/build/Modal-DcNzjvnm.mjs.map +1 -0
  175. package/.output/server/chunks/build/{NavbarActions-_YjrSUat.mjs → NavbarActions-VCHW0u67.mjs} +2 -2
  176. package/.output/server/chunks/build/NavbarActions-VCHW0u67.mjs.map +1 -0
  177. package/.output/server/chunks/build/{NavigationMenu-RfBOyS32.mjs → NavigationMenu-DG6V0R9Y.mjs} +4 -4
  178. package/.output/server/chunks/build/NavigationMenu-DG6V0R9Y.mjs.map +1 -0
  179. package/.output/server/chunks/build/{OpenInIdeLink-Jp6SzEtD.mjs → OpenInIdeLink-CLj2cTkc.mjs} +5 -5
  180. package/.output/server/chunks/build/{OpenInIdeLink-Jp6SzEtD.mjs.map → OpenInIdeLink-CLj2cTkc.mjs.map} +1 -1
  181. package/.output/server/chunks/build/{ProjectTestCasesTable-DxOTfhi4.mjs → ProjectTestCasesTable-BNd5Fn_G.mjs} +15 -15
  182. package/.output/server/chunks/build/{ProjectTestCasesTable-DxOTfhi4.mjs.map → ProjectTestCasesTable-BNd5Fn_G.mjs.map} +1 -1
  183. package/.output/server/chunks/build/{RovingFocusItem-BOSx1Z9Z.mjs → RovingFocusItem-DkZadRuK.mjs} +2 -2
  184. package/.output/server/chunks/build/RovingFocusItem-DkZadRuK.mjs.map +1 -0
  185. package/.output/server/chunks/build/{RunReports-nuLb-Nm3.mjs → RunReports-CnyGcU8K.mjs} +3 -3
  186. package/.output/server/chunks/build/RunReports-CnyGcU8K.mjs.map +1 -0
  187. package/.output/server/chunks/build/{RunStatusBadge-CvWmcFYM.mjs → RunStatusBadge-DTqX18X-.mjs} +3 -3
  188. package/.output/server/chunks/build/RunStatusBadge-DTqX18X-.mjs.map +1 -0
  189. package/.output/server/chunks/build/{SectionCard-DHAFvJxm.mjs → SectionCard-taTpPtua.mjs} +3 -3
  190. package/.output/server/chunks/build/SectionCard-taTpPtua.mjs.map +1 -0
  191. package/.output/server/chunks/build/{Select-CEyw7HGK.mjs → Select-BChKOOsc.mjs} +3 -3
  192. package/.output/server/chunks/build/Select-BChKOOsc.mjs.map +1 -0
  193. package/.output/server/chunks/build/{SelectMenu-C02Hs2_F.mjs → SelectMenu-DLkMyBsW.mjs} +4 -4
  194. package/.output/server/chunks/build/{SelectMenu-C02Hs2_F.mjs.map → SelectMenu-DLkMyBsW.mjs.map} +1 -1
  195. package/.output/server/chunks/build/{Separator-lrN70ODV.mjs → Separator-Dn-4PN3P.mjs} +2 -2
  196. package/.output/server/chunks/build/Separator-Dn-4PN3P.mjs.map +1 -0
  197. package/.output/server/chunks/build/{SettingsField-tRmytcEJ.mjs → SettingsField-BLO1C7uY.mjs} +6 -6
  198. package/.output/server/chunks/build/SettingsField-BLO1C7uY.mjs.map +1 -0
  199. package/.output/server/chunks/build/{Slideover-D6cRIqch.mjs → Slideover-BiDJaQrt.mjs} +3 -3
  200. package/.output/server/chunks/build/Slideover-BiDJaQrt.mjs.map +1 -0
  201. package/.output/server/chunks/build/{Switch-R2n82ncQ.mjs → Switch-Ca3fYrSH.mjs} +4 -4
  202. package/.output/server/chunks/build/Switch-Ca3fYrSH.mjs.map +1 -0
  203. package/.output/server/chunks/build/{Table-qZdnm9t2.mjs → Table-DQb34a0A.mjs} +2 -2
  204. package/.output/server/chunks/build/Table-DQb34a0A.mjs.map +1 -0
  205. package/.output/server/chunks/build/{Tabs-BDP7MWl4.mjs → Tabs-_ALhm_oG.mjs} +3 -3
  206. package/.output/server/chunks/build/Tabs-_ALhm_oG.mjs.map +1 -0
  207. package/.output/server/chunks/build/{TestCaseHistoryChart-CKDXQ2GI.mjs → TestCaseHistoryChart-D-TEUsZ8.mjs} +3 -3
  208. package/.output/server/chunks/build/TestCaseHistoryChart-D-TEUsZ8.mjs.map +1 -0
  209. package/.output/server/chunks/build/{TestMetaBadges-BlyKmfeP.mjs → TestMetaBadges-G2dAHnT-.mjs} +2 -2
  210. package/.output/server/chunks/build/TestMetaBadges-G2dAHnT-.mjs.map +1 -0
  211. package/.output/server/chunks/build/{TestStatusBar-CvsmKJ4D.mjs → TestStatusBar-CseETAdn.mjs} +2 -2
  212. package/.output/server/chunks/build/TestStatusBar-CseETAdn.mjs.map +1 -0
  213. package/.output/server/chunks/build/{Textarea-DpmpM-lN.mjs → Textarea-CXOoRq7y.mjs} +2 -2
  214. package/.output/server/chunks/build/Textarea-CXOoRq7y.mjs.map +1 -0
  215. package/.output/server/chunks/build/{Tooltip-BI3WQErw.mjs → Tooltip-trltUr5c.mjs} +2 -2
  216. package/.output/server/chunks/build/Tooltip-trltUr5c.mjs.map +1 -0
  217. package/.output/server/chunks/build/{VisuallyHiddenInput-D4E5aJCQ.mjs → VisuallyHiddenInput-CGURvg3N.mjs} +2 -2
  218. package/.output/server/chunks/build/VisuallyHiddenInput-CGURvg3N.mjs.map +1 -0
  219. package/.output/server/chunks/build/{_id_-w7YCSiiy.mjs → _id_-B-G4eG5U.mjs} +40 -40
  220. package/.output/server/chunks/build/{_id_-w7YCSiiy.mjs.map → _id_-B-G4eG5U.mjs.map} +1 -1
  221. package/.output/server/chunks/build/{_id_-T965GKYC.mjs → _id_-Cnzg8n21.mjs} +41 -38
  222. package/.output/server/chunks/build/_id_-Cnzg8n21.mjs.map +1 -0
  223. package/.output/server/chunks/build/{_id_-wiULjAVc.mjs → _id_-Dp_d6gT7.mjs} +62 -54
  224. package/.output/server/chunks/build/{_id_-wiULjAVc.mjs.map → _id_-Dp_d6gT7.mjs.map} +1 -1
  225. package/.output/server/chunks/build/{_id_-26komi8G.mjs → _id_-t2AWaYuK.mjs} +46 -46
  226. package/.output/server/chunks/build/{_id_-26komi8G.mjs.map → _id_-t2AWaYuK.mjs.map} +1 -1
  227. package/.output/server/chunks/build/{about-B3V_OEiu.mjs → about-BFsHkJwE.mjs} +8 -8
  228. package/.output/server/chunks/build/about-BFsHkJwE.mjs.map +1 -0
  229. package/.output/server/chunks/build/{account-DpBdYE46.mjs → account-CZAq8kVg.mjs} +8 -8
  230. package/.output/server/chunks/build/account-CZAq8kVg.mjs.map +1 -0
  231. package/.output/server/chunks/build/{ai-DYhpzbqp.mjs → ai-BGP3GcCR.mjs} +20 -20
  232. package/.output/server/chunks/build/{ai-DYhpzbqp.mjs.map → ai-BGP3GcCR.mjs.map} +1 -1
  233. package/.output/server/chunks/build/{analytics-CZJEU0an.mjs → analytics-CXl5OWV-.mjs} +25 -25
  234. package/.output/server/chunks/build/{analytics-CZJEU0an.mjs.map → analytics-CXl5OWV-.mjs.map} +1 -1
  235. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  236. package/.output/server/chunks/build/{default-CQa_bmAf.mjs → default-4ixAePum.mjs} +208 -76
  237. package/.output/server/chunks/build/default-4ixAePum.mjs.map +1 -0
  238. package/.output/server/chunks/build/{docs-C8bndVXg.mjs → docs-Cgsd01H9.mjs} +16 -16
  239. package/.output/server/chunks/build/{docs-C8bndVXg.mjs.map → docs-Cgsd01H9.mjs.map} +1 -1
  240. package/.output/server/chunks/build/{edit-BdfF9er2.mjs → edit-BEQ-ozj9.mjs} +436 -40
  241. package/.output/server/chunks/build/edit-BEQ-ozj9.mjs.map +1 -0
  242. package/.output/server/chunks/build/{fetch-tkz5_OA-.mjs → fetch-B5TVXZ1s.mjs} +2 -2
  243. package/.output/server/chunks/build/fetch-B5TVXZ1s.mjs.map +1 -0
  244. package/.output/server/chunks/build/{forgot-password-swZRcvXE.mjs → forgot-password-mqE1mpDI.mjs} +4 -4
  245. package/.output/server/chunks/build/forgot-password-mqE1mpDI.mjs.map +1 -0
  246. package/.output/server/chunks/build/{help-content-C876a9WD.mjs → help-content-Bc99BajS.mjs} +6 -1
  247. package/.output/server/chunks/build/help-content-Bc99BajS.mjs.map +1 -0
  248. package/.output/server/chunks/build/{import-B27Sv7h5.mjs → import-DqDDTcSc.mjs} +14 -14
  249. package/.output/server/chunks/build/import-DqDDTcSc.mjs.map +1 -0
  250. package/.output/server/chunks/build/{index-ID913tUa.mjs → index-Bpdj6TXV.mjs} +5 -5
  251. package/.output/server/chunks/build/index-Bpdj6TXV.mjs.map +1 -0
  252. package/.output/server/chunks/build/{index-Dq6nk6OB.mjs → index-DBFsIsjA.mjs} +180 -188
  253. package/.output/server/chunks/build/{index-Dq6nk6OB.mjs.map → index-DBFsIsjA.mjs.map} +1 -1
  254. package/.output/server/chunks/build/{index-C7m32bRI.mjs → index-DSufXCZq.mjs} +22 -18
  255. package/.output/server/chunks/build/index-DSufXCZq.mjs.map +1 -0
  256. package/.output/server/chunks/build/{index-BdZmxLtC.mjs → index-WXE60AXk.mjs} +24 -24
  257. package/.output/server/chunks/build/{index-BdZmxLtC.mjs.map → index-WXE60AXk.mjs.map} +1 -1
  258. package/.output/server/chunks/build/{index-ByWTzqF6.mjs → index-okKjrRhL.mjs} +15 -4
  259. package/.output/server/chunks/build/index-okKjrRhL.mjs.map +1 -0
  260. package/.output/server/chunks/build/{isValueEqualOrExist-D4lZ8uRY.mjs → isValueEqualOrExist-C-9DzL4K.mjs} +2 -2
  261. package/.output/server/chunks/build/isValueEqualOrExist-C-9DzL4K.mjs.map +1 -0
  262. package/.output/server/chunks/build/{login-hxCF06JT.mjs → login-eQ88UoBW.mjs} +6 -6
  263. package/.output/server/chunks/build/login-eQ88UoBW.mjs.map +1 -0
  264. package/.output/server/chunks/build/{mcp-BVW1llyW.mjs → mcp-frcSP2Zg.mjs} +13 -13
  265. package/.output/server/chunks/build/mcp-frcSP2Zg.mjs.map +1 -0
  266. package/.output/server/chunks/build/{notifications-Dn-evqXM.mjs → notifications-DAtRd5V6.mjs} +14 -14
  267. package/.output/server/chunks/build/notifications-DAtRd5V6.mjs.map +1 -0
  268. package/.output/server/chunks/build/{performance-CV8qm94u.mjs → performance-BcQzGXE7.mjs} +13 -13
  269. package/.output/server/chunks/build/performance-BcQzGXE7.mjs.map +1 -0
  270. package/.output/server/chunks/build/{pr-feedback-gKDz8LyA.mjs → pr-feedback-BHtgvegy.mjs} +11 -11
  271. package/.output/server/chunks/build/pr-feedback-BHtgvegy.mjs.map +1 -0
  272. package/.output/server/chunks/build/{reset-password-DtEISa1I.mjs → reset-password-DMHrp14-.mjs} +4 -4
  273. package/.output/server/chunks/build/reset-password-DMHrp14-.mjs.map +1 -0
  274. package/.output/server/chunks/build/server.mjs +32 -32
  275. package/.output/server/chunks/build/{settings-BJDnuLpc.mjs → settings-Bo5OETop.mjs} +11 -11
  276. package/.output/server/chunks/build/settings-Bo5OETop.mjs.map +1 -0
  277. package/.output/server/chunks/build/{settings-metadata-DnAK4Rzg.mjs → settings-metadata-BHbsWQ2g.mjs} +2 -2
  278. package/.output/server/chunks/build/settings-metadata-BHbsWQ2g.mjs.map +1 -0
  279. package/.output/server/chunks/build/{setup-BO9tXa_G.mjs → setup-DAXcxuNY.mjs} +18 -18
  280. package/.output/server/chunks/build/{setup-BO9tXa_G.mjs.map → setup-DAXcxuNY.mjs.map} +1 -1
  281. package/.output/server/chunks/build/{storage-zN92cA9q.mjs → storage-BPK0fVwx.mjs} +12 -12
  282. package/.output/server/chunks/build/storage-BPK0fVwx.mjs.map +1 -0
  283. package/.output/server/chunks/build/{tags-CJFnoyQc.mjs → tags-CoxErA5m.mjs} +8 -8
  284. package/.output/server/chunks/build/tags-CoxErA5m.mjs.map +1 -0
  285. package/.output/server/chunks/build/{test-cases-0Q6rT73d.mjs → test-cases-D8rn-0le.mjs} +27 -27
  286. package/.output/server/chunks/build/test-cases-D8rn-0le.mjs.map +1 -0
  287. package/.output/server/chunks/build/{test-functions-DVRJgiWo.mjs → test-functions-pWs9mhbJ.mjs} +12 -12
  288. package/.output/server/chunks/build/test-functions-pWs9mhbJ.mjs.map +1 -0
  289. package/.output/server/chunks/build/{useCopyRich-BM9GTjJi.mjs → useCopyRich-BqVfhnoH.mjs} +27 -16
  290. package/.output/server/chunks/build/{useCopyRich-BM9GTjJi.mjs.map → useCopyRich-BqVfhnoH.mjs.map} +1 -1
  291. package/.output/server/chunks/build/{useDesktopDownload-Dyf0fR47.mjs → useDesktopDownload-l80DQJ9e.mjs} +2 -2
  292. package/.output/server/chunks/build/useDesktopDownload-l80DQJ9e.mjs.map +1 -0
  293. package/.output/server/chunks/build/{useDesktopLocalRuns-k7Gw3Fv3.mjs → useDesktopLocalRuns-Dil3YzyU.mjs} +68 -6
  294. package/.output/server/chunks/build/useDesktopLocalRuns-Dil3YzyU.mjs.map +1 -0
  295. package/.output/server/chunks/build/{useDesktopProjectLink-WwLte59P.mjs → useDesktopProjectLink-BnIONB--.mjs} +21 -4
  296. package/.output/server/chunks/build/useDesktopProjectLink-BnIONB--.mjs.map +1 -0
  297. package/.output/server/chunks/build/{useFormControl-8skMOTIf.mjs → useFormControl-CXKztoWk.mjs} +2 -2
  298. package/.output/server/chunks/build/useFormControl-CXKztoWk.mjs.map +1 -0
  299. package/.output/server/chunks/build/{useOpenInIde-D74FmDNg.mjs → useOpenInIde-CbbYW3pd.mjs} +2 -2
  300. package/.output/server/chunks/build/useOpenInIde-CbbYW3pd.mjs.map +1 -0
  301. package/.output/server/chunks/build/{useSettingsNav-BLTHducV.mjs → useSettingsNav-C6NpD4Ab.mjs} +2 -2
  302. package/.output/server/chunks/build/useSettingsNav-C6NpD4Ab.mjs.map +1 -0
  303. package/.output/server/chunks/build/{users-C9bjOBde.mjs → users-C2MuCf5G.mjs} +9 -9
  304. package/.output/server/chunks/build/users-C2MuCf5G.mjs.map +1 -0
  305. package/.output/server/chunks/nitro/nitro.mjs +677 -670
  306. package/.output/server/package.json +1 -1
  307. package/package.json +1 -1
  308. package/.output/public/_nuxt/03FA4-rI.js +0 -1
  309. package/.output/public/_nuxt/5a7jHE9s.js +0 -1
  310. package/.output/public/_nuxt/7ZHq6PCI.js +0 -1
  311. package/.output/public/_nuxt/98sAB6Gu.js +0 -1
  312. package/.output/public/_nuxt/B--J7VNt.js +0 -1
  313. package/.output/public/_nuxt/B69RP95P.js +0 -1
  314. package/.output/public/_nuxt/B8Xm4_S_.js +0 -1
  315. package/.output/public/_nuxt/BBhrClA9.js +0 -1
  316. package/.output/public/_nuxt/BPXqL9vK.js +0 -1
  317. package/.output/public/_nuxt/BWMSVSNM.js +0 -1
  318. package/.output/public/_nuxt/B_r0xHVS.js +0 -1
  319. package/.output/public/_nuxt/BevElZaK.js +0 -1
  320. package/.output/public/_nuxt/BfA6lfg4.js +0 -1
  321. package/.output/public/_nuxt/BjaRappk.js +0 -1
  322. package/.output/public/_nuxt/Bn0jaRxI.js +0 -1
  323. package/.output/public/_nuxt/BrUBOQ0y.js +0 -1
  324. package/.output/public/_nuxt/BwEN1fJ1.js +0 -1
  325. package/.output/public/_nuxt/C-XjxjG5.js +0 -1
  326. package/.output/public/_nuxt/C3W_wyr9.js +0 -1
  327. package/.output/public/_nuxt/C7D5Wl7T.js +0 -1
  328. package/.output/public/_nuxt/COuZu9FO.js +0 -2
  329. package/.output/public/_nuxt/CX5Q0dZ8.js +0 -1
  330. package/.output/public/_nuxt/Cf4MFOuf.js +0 -1
  331. package/.output/public/_nuxt/Cq33x7yV.js +0 -1
  332. package/.output/public/_nuxt/Cu2Q4iPh.js +0 -1
  333. package/.output/public/_nuxt/CyLcEDg2.js +0 -2
  334. package/.output/public/_nuxt/D1Y43xM1.js +0 -2
  335. package/.output/public/_nuxt/D2rZosKf.js +0 -6
  336. package/.output/public/_nuxt/D7jpwkRG.js +0 -5
  337. package/.output/public/_nuxt/D8NAb7VE.js +0 -1
  338. package/.output/public/_nuxt/D8vguZKg.js +0 -17
  339. package/.output/public/_nuxt/DH5H1DJh.js +0 -1
  340. package/.output/public/_nuxt/DL8knjzi.js +0 -1
  341. package/.output/public/_nuxt/DMsm-RGQ.js +0 -1
  342. package/.output/public/_nuxt/DMtrFQqi.js +0 -2
  343. package/.output/public/_nuxt/DVEGfqtt.js +0 -2
  344. package/.output/public/_nuxt/DaNC-xl1.js +0 -1
  345. package/.output/public/_nuxt/DcLbz6DV.js +0 -1
  346. package/.output/public/_nuxt/DhYznn-U.js +0 -1
  347. package/.output/public/_nuxt/DhuRRlmK.js +0 -1
  348. package/.output/public/_nuxt/DuO5wfAC.js +0 -1
  349. package/.output/public/_nuxt/DvEsAuE9.js +0 -1
  350. package/.output/public/_nuxt/Dz6g_QJT.js +0 -1
  351. package/.output/public/_nuxt/DzzNS-K1.js +0 -1
  352. package/.output/public/_nuxt/LwoTUb-r.js +0 -1
  353. package/.output/public/_nuxt/OfPjZaky.js +0 -1
  354. package/.output/public/_nuxt/T5UuMUxA.js +0 -1
  355. package/.output/public/_nuxt/UY8pjaZA.js +0 -1
  356. package/.output/public/_nuxt/YmCeJkZ2.js +0 -1
  357. package/.output/public/_nuxt/builds/meta/70224ee0-4d1f-45d2-b380-2ecb18064bf1.json +0 -1
  358. package/.output/public/_nuxt/fXUwH_3d.js +0 -1
  359. package/.output/public/_nuxt/sVV8xB9f.js +0 -1
  360. package/.output/public/_nuxt/xa5UHCot.js +0 -1
  361. package/.output/server/chunks/build/Alert-He-UxEt6.mjs.map +0 -1
  362. package/.output/server/chunks/build/Breadcrumb-DEP2dVCZ.mjs.map +0 -1
  363. package/.output/server/chunks/build/BreadcrumbNav-y6nMDYcR.mjs.map +0 -1
  364. package/.output/server/chunks/build/BrowserBadge-DIASU8Gf.mjs.map +0 -1
  365. package/.output/server/chunks/build/ChartCard-ZTsCvItQ.mjs.map +0 -1
  366. package/.output/server/chunks/build/ChartMarkerTooltip-u_1DUHh-.mjs.map +0 -1
  367. package/.output/server/chunks/build/Checkbox-BisdHf8n.mjs.map +0 -1
  368. package/.output/server/chunks/build/CodeBlock-B8BNtZAe.mjs.map +0 -1
  369. package/.output/server/chunks/build/DashboardNavbar-D7-3zBUU.mjs.map +0 -1
  370. package/.output/server/chunks/build/DashboardSidebarToggle-C3HdHvlE.mjs.map +0 -1
  371. package/.output/server/chunks/build/DataLocationCard-CC2-lHiP.mjs.map +0 -1
  372. package/.output/server/chunks/build/DesktopRunLocallyButton-iNzrDsEs.mjs.map +0 -1
  373. package/.output/server/chunks/build/DiagnosisPanel-BVb2LgHu.mjs.map +0 -1
  374. package/.output/server/chunks/build/DiagnosisResult-xVgZlfKK.mjs.map +0 -1
  375. package/.output/server/chunks/build/DurationValue-UX9uajQJ.mjs.map +0 -1
  376. package/.output/server/chunks/build/EmptyState-DC2q_7TD.mjs.map +0 -1
  377. package/.output/server/chunks/build/EntityLinks-Dzn73fbq.mjs.map +0 -1
  378. package/.output/server/chunks/build/EnvManagedBadge-C-agmABK.mjs.map +0 -1
  379. package/.output/server/chunks/build/ErrorState-CktYyeEZ.mjs.map +0 -1
  380. package/.output/server/chunks/build/FeatureUnavailable-DHFkwI7t.mjs.map +0 -1
  381. package/.output/server/chunks/build/FormField-GYHKiSI6.mjs.map +0 -1
  382. package/.output/server/chunks/build/GetStartedWizard-BpcGYsm2.mjs.map +0 -1
  383. package/.output/server/chunks/build/HelpHint-plioHKA0.mjs.map +0 -1
  384. package/.output/server/chunks/build/LoadingState-CwpfmI0W.mjs.map +0 -1
  385. package/.output/server/chunks/build/MarkerBadge-Biz5--h2.mjs.map +0 -1
  386. package/.output/server/chunks/build/MetaStripGroup-A0a72vt5.mjs.map +0 -1
  387. package/.output/server/chunks/build/Modal-hKLvVFNp.mjs.map +0 -1
  388. package/.output/server/chunks/build/NavbarActions-_YjrSUat.mjs.map +0 -1
  389. package/.output/server/chunks/build/NavigationMenu-RfBOyS32.mjs.map +0 -1
  390. package/.output/server/chunks/build/RovingFocusItem-BOSx1Z9Z.mjs.map +0 -1
  391. package/.output/server/chunks/build/RunReports-nuLb-Nm3.mjs.map +0 -1
  392. package/.output/server/chunks/build/RunStatusBadge-CvWmcFYM.mjs.map +0 -1
  393. package/.output/server/chunks/build/SectionCard-DHAFvJxm.mjs.map +0 -1
  394. package/.output/server/chunks/build/Select-CEyw7HGK.mjs.map +0 -1
  395. package/.output/server/chunks/build/Separator-lrN70ODV.mjs.map +0 -1
  396. package/.output/server/chunks/build/SettingsField-tRmytcEJ.mjs.map +0 -1
  397. package/.output/server/chunks/build/Slideover-D6cRIqch.mjs.map +0 -1
  398. package/.output/server/chunks/build/Switch-R2n82ncQ.mjs.map +0 -1
  399. package/.output/server/chunks/build/Table-qZdnm9t2.mjs.map +0 -1
  400. package/.output/server/chunks/build/Tabs-BDP7MWl4.mjs.map +0 -1
  401. package/.output/server/chunks/build/TestCaseHistoryChart-CKDXQ2GI.mjs.map +0 -1
  402. package/.output/server/chunks/build/TestMetaBadges-BlyKmfeP.mjs.map +0 -1
  403. package/.output/server/chunks/build/TestStatusBar-CvsmKJ4D.mjs.map +0 -1
  404. package/.output/server/chunks/build/Textarea-DpmpM-lN.mjs.map +0 -1
  405. package/.output/server/chunks/build/Tooltip-BI3WQErw.mjs.map +0 -1
  406. package/.output/server/chunks/build/VisuallyHiddenInput-D4E5aJCQ.mjs.map +0 -1
  407. package/.output/server/chunks/build/_id_-T965GKYC.mjs.map +0 -1
  408. package/.output/server/chunks/build/about-B3V_OEiu.mjs.map +0 -1
  409. package/.output/server/chunks/build/account-DpBdYE46.mjs.map +0 -1
  410. package/.output/server/chunks/build/default-CQa_bmAf.mjs.map +0 -1
  411. package/.output/server/chunks/build/edit-BdfF9er2.mjs.map +0 -1
  412. package/.output/server/chunks/build/fetch-tkz5_OA-.mjs.map +0 -1
  413. package/.output/server/chunks/build/forgot-password-swZRcvXE.mjs.map +0 -1
  414. package/.output/server/chunks/build/help-content-C876a9WD.mjs.map +0 -1
  415. package/.output/server/chunks/build/import-B27Sv7h5.mjs.map +0 -1
  416. package/.output/server/chunks/build/index-ByWTzqF6.mjs.map +0 -1
  417. package/.output/server/chunks/build/index-C7m32bRI.mjs.map +0 -1
  418. package/.output/server/chunks/build/index-ID913tUa.mjs.map +0 -1
  419. package/.output/server/chunks/build/isValueEqualOrExist-D4lZ8uRY.mjs.map +0 -1
  420. package/.output/server/chunks/build/login-hxCF06JT.mjs.map +0 -1
  421. package/.output/server/chunks/build/mcp-BVW1llyW.mjs.map +0 -1
  422. package/.output/server/chunks/build/notifications-Dn-evqXM.mjs.map +0 -1
  423. package/.output/server/chunks/build/performance-CV8qm94u.mjs.map +0 -1
  424. package/.output/server/chunks/build/pr-feedback-gKDz8LyA.mjs.map +0 -1
  425. package/.output/server/chunks/build/reset-password-DtEISa1I.mjs.map +0 -1
  426. package/.output/server/chunks/build/settings-BJDnuLpc.mjs.map +0 -1
  427. package/.output/server/chunks/build/settings-metadata-DnAK4Rzg.mjs.map +0 -1
  428. package/.output/server/chunks/build/storage-zN92cA9q.mjs.map +0 -1
  429. package/.output/server/chunks/build/tags-CJFnoyQc.mjs.map +0 -1
  430. package/.output/server/chunks/build/test-cases-0Q6rT73d.mjs.map +0 -1
  431. package/.output/server/chunks/build/test-functions-DVRJgiWo.mjs.map +0 -1
  432. package/.output/server/chunks/build/useDesktopDownload-Dyf0fR47.mjs.map +0 -1
  433. package/.output/server/chunks/build/useDesktopLocalRuns-k7Gw3Fv3.mjs.map +0 -1
  434. package/.output/server/chunks/build/useDesktopProjectLink-WwLte59P.mjs.map +0 -1
  435. package/.output/server/chunks/build/useFormControl-8skMOTIf.mjs.map +0 -1
  436. package/.output/server/chunks/build/useOpenInIde-D74FmDNg.mjs.map +0 -1
  437. package/.output/server/chunks/build/useSettingsNav-BLTHducV.mjs.map +0 -1
  438. package/.output/server/chunks/build/users-C9bjOBde.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
- import{_ as es}from"./Cu2Q4iPh.js";import{_ as ts}from"./Qo6oszaF.js";import{d as re,o as s,f as v,g as u,i as o,j as r,t as c,c as a,F as U,y as te,k as e,s as pe,m as f,v as i,D as pt,q as Z,p as ce,h as C,G as Pe,_ as Ie,b as ss,B as yt,l as ge,r as A,ab as $e,J as xe,ac as ns,A as Oe,R as Ce,u as as,a as os,w as mt,e as rs,ad as is,N as ls}from"./C5TrTuWv.js";import{d as cs,e as us,h as He,a as ds,b as ms,c as fs,_ as gs,n as ps,o as ys,p as hs,u as xs,f as vs,i as _s,j as ks,k as bs,l as ws,m as $s}from"./D7jpwkRG.js";import{_ as Cs}from"./CyLcEDg2.js";import{_ as Ts}from"./Drw8yQg6.js";import{_ as Ss,a as Is}from"./opyDpgSw.js";import{_ as Rs,a as js,b as Ls,c as zs}from"./Dz6g_QJT.js";import{_ as Re}from"./LwoTUb-r.js";import{_ as Ms}from"./98sAB6Gu.js";import{_ as Ns}from"./CMuzkARi.js";import{_ as ht}from"./D0Kop4bS.js";import{_ as xt}from"./CJ1rmnk4.js";import{_ as vt}from"./BakMHV79.js";import{_ as _t,a as kt}from"./B69RP95P.js";import{_ as Ds}from"./BWMSVSNM.js";import{_ as Ps}from"./C8Paf_V1.js";import{_ as As,d as Us,e as Bs,f as Fs,g as Vs,h as Es,a as bt,i as Te,b as De,c as Os}from"./CX_G-FHC.js";import{f as Se,m as Hs,c as Ks,e as Ws,n as wt,o as Ke,q as We,a as Gs,j as Js,r as ft}from"./DMtrFQqi.js";import{_ as $t}from"./DuOH5jcQ.js";import{_ as ye}from"./DMAiMrNr.js";import{_ as qs}from"./BfA6lfg4.js";import{u as Qs}from"./CGHV0Y2d.js";import{_ as Ge}from"./DhYznn-U.js";import{_ as Je}from"./DcLbz6DV.js";import{_ as Ct}from"./CD8ZzAFC.js";import{f as we}from"./D-c8ZSws.js";import{_ as Zs}from"./B1LUinhp.js";import{_ as Xs}from"./Bp3FRuEm.js";import{_ as Ys}from"./Bg93Rnts.js";import{_ as en}from"./DbmGeOus.js";import{_ as tn}from"./BFxvHlO9.js";import{_ as sn}from"./DM3bDZC6.js";import{b as nn}from"./CX5Q0dZ8.js";import{a as an,u as gt}from"./T5UuMUxA.js";import"./BCGljaM0.js";import"./BrUBOQ0y.js";import"./CsV7pmcT.js";import"./fXUwH_3d.js";import"./BBhrClA9.js";import"./6Z_ZwH8I.js";import"./Ce5_Tq63.js";import"./DaNC-xl1.js";import"./DH5H1DJh.js";import"./D_y2VS8k.js";import"./C-XjxjG5.js";import"./03FA4-rI.js";import"./DMsm-RGQ.js";import"./Bn0jaRxI.js";import"./BjaRappk.js";import"./DEvYVl9M.js";import"./V9p3z39z.js";import"./DGq4A2Pd.js";import"./BvAfKk6C.js";import"./D7W_4Sqc.js";import"./P5uOaRUZ.js";const on={class:"text-sm font-semibold truncate min-w-0"},rn={class:"flex items-center gap-3 ml-auto max-sm:hidden"},ln={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},cn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},un={class:"text-gray-700 dark:text-gray-300"},dn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},mn={class:"text-gray-700 dark:text-gray-300"},fn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},gn={class:"text-gray-700 dark:text-gray-300"},pn={key:0,class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},yn={class:"text-gray-700 dark:text-gray-300"},hn={class:"@container"},xn={class:"space-y-3"},vn={class:"flex items-start gap-2.5 pr-8"},_n={class:"min-w-0 flex-1"},kn={class:"flex items-center gap-2 flex-wrap"},bn={class:"text-base font-bold truncate max-w-full"},wn={class:"text-xs text-gray-500 mt-0.5 flex items-center gap-x-2 gap-y-0.5 flex-wrap"},$n=["title"],Cn={key:1},Tn={key:0,class:"flex items-center gap-2 text-sm"},Sn={class:"text-gray-700 dark:text-gray-300 truncate"},In={key:0,class:"text-gray-500 shrink-0"},Rn={key:1,class:"flex items-center gap-1.5 text-sm"},jn={key:0,class:"font-medium"},Ln=["title"],zn={key:2,class:"text-muted"},Mn=["title"],Nn={key:0,class:"rounded-full border border-default px-2 py-0.5 text-xs bg-elevated/60"},Dn={key:1},Pn=["href"],An={key:1},Un={class:"text-muted"},Bn={key:0,class:"tabular-nums text-muted"},Fn={key:0,class:"text-dimmed"},Vn=re({__name:"TestCaseSummary",props:{testCase:{},scmInfo:{},ciInfo:{},browser:{},environment:{},stepsCount:{},historicalTiming:{},stableLinks:{},projectKey:{},projectName:{}},emits:["refresh"],setup(t){const _=t,h=C(()=>{const n=_.testCase;if(!n)return[];const l=[];return n.isNewRegression&&l.push({label:"New regression",color:"error",title:"Passed in the baseline run, failing here"}),n.isNewFlaky&&l.push({label:"New flaky",color:"warning",title:"Newly started passing only on retry"}),n.status==="passed"&&(n.retries??0)>0&&l.push({label:"Passed on retry",color:"warning",title:"This test failed then passed on a retry"}),l}),w=C(()=>(_.testCase?.testAnnotations??[]).filter(n=>!Hs(n.type))),$=C(()=>_.testCase?.startedAt??null),g=C(()=>!!(_.ciInfo||_.environment));return(n,l)=>{const d=Rs,P=Re,D=Ms,b=pe,x=Ns,V=ht,M=pt,m=xt,j=vt,F=ce,B=_t,S=Ls,G=Ds,q=js,z=Ps,ne=As;return s(),v(ne,{"storage-key":"test-case"},{folded:u(()=>[r(d,{status:t.testCase?.status??"",size:"sm"},null,8,["status"]),o("span",on,c(t.testCase?.title),1),o("div",rn,[o("span",ln,[l[1]||(l[1]=f(" Dur: ",-1)),r(P,{ms:t.testCase?.duration,class:"font-bold text-gray-700 dark:text-gray-300"},null,8,["ms"])]),o("span",cn,[l[2]||(l[2]=f(" Retries: ",-1)),o("strong",un,c(t.testCase?.retries??0),1)]),o("span",dn,[l[3]||(l[3]=f(" Steps: ",-1)),o("strong",mn,c(t.stepsCount),1)]),o("span",fn,[l[4]||(l[4]=f(" Worker: ",-1)),o("strong",gn,c(t.testCase?.workerIndex??"—"),1)]),t.testCase?.shardIndex!=null?(s(),a("span",pn,[l[5]||(l[5]=f(" Shard: ",-1)),o("strong",yn,c(t.testCase.shardIndex),1)])):i("",!0)]),t.browser?(s(),v(D,{key:0,browser:t.browser,size:"sm",class:"shrink-0 max-sm:hidden"},null,8,["browser"])):i("",!0)]),default:u(()=>[o("div",hn,[r(z,{class:"shadow-xs",ui:{footer:"px-4 py-2.5 sm:px-4 bg-muted/30"}},{footer:u(()=>[r(q,null,{default:u(()=>[t.scmInfo?(s(),v(S,{key:0,label:"Source",icon:"i-lucide-git-branch"},{default:u(()=>[t.scmInfo.branch?(s(),a("span",jn,c(t.scmInfo.branch),1)):i("",!0),t.scmInfo.commit?(s(),a("code",{key:1,class:"text-xs font-mono bg-zinc-100 dark:bg-zinc-800 px-1 py-0.5 rounded",title:t.scmInfo.commit},c(t.scmInfo.commit.length>=8?t.scmInfo.commit.substring(0,8):t.scmInfo.commit),9,Ln)):i("",!0),t.scmInfo.author?(s(),a("span",zn,c(t.scmInfo.author),1)):i("",!0),t.scmInfo.commitMessage?(s(),a("span",{key:3,class:"text-xs text-dimmed truncate max-w-[40ch]",title:t.scmInfo.commitMessage},c(t.scmInfo.commitMessage),9,Mn)):i("",!0)]),_:1})):i("",!0),e(g)?(s(),v(S,{key:1,label:"CI & environment",icon:"i-lucide-cloud",help:"run.ci-env"},{default:u(()=>[t.environment?(s(),a("span",Nn,c(t.environment),1)):i("",!0),t.ciInfo?.provider?(s(),a("span",Dn,c(t.ciInfo.provider),1)):i("",!0),t.ciInfo?.buildNumber||t.ciInfo?.buildUrl?(s(),a(U,{key:2},[l[12]||(l[12]=o("span",{class:"text-dimmed"},"·",-1)),t.ciInfo?.buildUrl?(s(),a("a",{key:0,href:t.ciInfo.buildUrl,target:"_blank",class:"text-primary hover:underline"},c(t.ciInfo?.buildNumber?`Build #${t.ciInfo.buildNumber}`:"View build"),9,Pn)):(s(),a("span",An,"Build #"+c(t.ciInfo.buildNumber),1))],64)):i("",!0),t.ciInfo?.workflow||t.ciInfo?.jobName?(s(),a(U,{key:3},[l[13]||(l[13]=o("span",{class:"text-dimmed"},"·",-1)),o("span",Un,[t.ciInfo?.workflow?(s(),a(U,{key:0},[f(c(t.ciInfo.workflow),1)],64)):i("",!0),t.ciInfo?.workflow&&t.ciInfo?.jobName?(s(),a(U,{key:1},[f(" · ")],64)):i("",!0),t.ciInfo?.jobName?(s(),a(U,{key:2},[f(c(t.ciInfo.jobName),1)],64)):i("",!0)])],64)):i("",!0)]),_:1})):i("",!0),t.browser?(s(),v(S,{key:2,label:"Browser"},{default:u(()=>[r(D,{browser:{...t.browser,viewport:void 0},size:"sm"},null,8,["browser"]),t.browser.viewport?(s(),a("span",Bn,[f(c(t.browser.viewport.width)+"×"+c(t.browser.viewport.height)+" ",1),t.browser.deviceScaleFactor&&t.browser.deviceScaleFactor!==1?(s(),a("span",Fn,"@"+c(t.browser.deviceScaleFactor)+"x",1)):i("",!0)])):i("",!0)]),_:1})):i("",!0),r(S,{label:"Links",icon:"i-lucide-link"},{default:u(()=>[t.testCase?.id?(s(),v(G,{key:0,"entity-type":"test_case","entity-id":t.testCase.id,links:t.stableLinks??null,onUpdated:l[0]||(l[0]=E=>n.$emit("refresh"))},null,8,["entity-id","links"])):i("",!0)]),_:1})]),_:1})]),default:u(()=>[o("div",xn,[o("div",vn,[r(d,{status:t.testCase?.status??"",class:"mt-0.5"},null,8,["status"]),o("div",_n,[o("div",kn,[o("h2",bn,c(t.testCase?.title),1),(s(!0),a(U,null,te(e(h),E=>(s(),v(b,{key:E.label,color:E.color,variant:"subtle",size:"xs",title:E.title},{default:u(()=>[f(c(E.label),1)]),_:2},1032,["color","title"]))),128)),(s(!0),a(U,null,te(e(w),(E,ue)=>(s(),v(b,{key:`ann-${ue}`,color:"neutral",variant:"soft",size:"xs",class:"font-mono",title:E.description||E.type},{default:u(()=>[f(" @"+c(E.type),1)]),_:2},1032,["title"]))),128)),r(x,{tags:t.testCase?.tags,meta:t.testCase?.testMeta},null,8,["tags","meta"])]),o("p",wn,[t.testCase?.location?(s(),v(V,{key:0,location:t.testCase.location,"project-key":t.projectKey,"project-name":t.projectName},null,8,["location","project-key","project-name"])):i("",!0),r(M,null,{default:u(()=>[e($)?(s(),a("span",{key:0,class:"text-gray-400",title:new Date(e($)).toLocaleString()}," started "+c(("formatRelativeTime"in n?n.formatRelativeTime:e(Se))(e($))),9,$n)):i("",!0)]),_:1}),t.historicalTiming?(s(),a("span",Cn,[l[6]||(l[6]=f(" Avg ",-1)),r(P,{ms:t.historicalTiming.avg},null,8,["ms"]),l[7]||(l[7]=f(" · ",-1)),o("span",{class:Z(t.historicalTiming.diff>0?"text-red-600":"text-green-600")},c(t.historicalTiming.diff>0?"+":"")+c(t.historicalTiming.pct)+"% ",3)])):i("",!0)])])]),r(j,null,{default:u(()=>[r(m,{label:"Duration"},{default:u(()=>[r(P,{ms:t.testCase?.duration},null,8,["ms"])]),_:1}),r(m,{label:"Retries",value:t.testCase?.retries??0},null,8,["value"]),r(m,{label:"Steps",value:t.stepsCount},null,8,["value"]),r(m,{label:"Worker",value:t.testCase?.workerIndex??"—"},null,8,["value"])]),_:1}),t.testCase?.slowestStep?(s(),a("div",Tn,[r(F,{name:"i-lucide-zap",class:"size-4 text-amber-500 shrink-0"}),l[10]||(l[10]=o("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Slowest step:",-1)),o("span",Sn,c(t.testCase.slowestStep),1),t.testCase.slowestStepDuration?(s(),a("span",In,[l[8]||(l[8]=f("(",-1)),r(P,{ms:t.testCase.slowestStepDuration},null,8,["ms"]),l[9]||(l[9]=f(")",-1))])):i("",!0)])):i("",!0),(t.testCase?.wastedTimeMs??0)>0?(s(),a("div",Rn,[r(F,{name:"i-lucide-hourglass",class:"size-4 text-amber-500 shrink-0"}),l[11]||(l[11]=o("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Wasted in fixed waits:",-1)),r(P,{ms:t.testCase?.wastedTimeMs,class:"text-gray-700 dark:text-gray-300"},null,8,["ms"]),r(B,{topic:"case.wasted-time"})])):i("",!0)])]),_:1})])]),_:1})}}}),En=Object.assign(Vn,{__name:"TestCaseSummary"}),On={class:"space-y-3"},Hn={key:0,class:"flex flex-wrap gap-1.5"},Kn={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Wn={class:"text-gray-800 dark:text-gray-200"},Gn={key:1},Jn={class:"flex items-center gap-1 flex-wrap"},qn=re({__name:"TestCaseVerdictCard",props:{testCase:{},history:{},currentId:{}},setup(t){const _=t,h=l=>l==="failed"||l==="timedOut"||l==="timedout",w=C(()=>{const l=_.testCase;if(!l)return[];const d=[];return l.isNewRegression&&d.push({label:"New regression",color:"error",icon:"i-lucide-git-pull-request-arrow",title:"Passed in the baseline run, failing here — likely fallout from the latest change"}),l.isNewFlaky&&d.push({label:"New flaky",color:"warning",icon:"i-lucide-shuffle",title:"Newly started passing only on retry — intermittent failure"}),l.status==="timedOut"&&d.push({label:"Timed out",color:"warning",icon:"i-lucide-timer-off",title:"The test exceeded its timeout"}),(l.retries??0)>0&&d.push({label:l.status==="passed"?`Passed on retry ${l.retries}`:`Retried ${l.retries}×`,color:l.status==="passed"?"warning":"neutral",icon:"i-lucide-refresh-cw",title:`This execution retried ${l.retries} time${l.retries===1?"":"s"}`}),d}),$=C(()=>_.history.slice(0,24).slice().reverse()),g=C(()=>{const l=_.history;if(!l.length)return null;const d=Math.max(0,l.findIndex(b=>b.id===_.currentId));let P=0;for(let b=d;b<l.length&&h(l[b].status);b++)P++;let D=null;for(let b=d+1;b<l.length;b++)if(l[b].status==="passed"){D=l[b];break}return{streak:P,lastPass:D,total:l.length,anchorFailing:h(l[d]?.status)}}),n=l=>({"bg-red-500 hover:bg-red-600":h(l),"bg-green-500 hover:bg-green-600":l==="passed","bg-yellow-500 hover:bg-yellow-600":l==="skipped","bg-gray-400 hover:bg-gray-500":!h(l)&&!["passed","skipped"].includes(l)});return(l,d)=>{const P=ce,D=pe,b=Pe,x=$t,V=pt,M=ye;return s(),v(M,{icon:"i-lucide-clipboard-check","icon-class":"text-amber-500",title:"Verdict",help:"case.verdict"},{default:u(()=>[o("div",On,[e(w).length?(s(),a("div",Hn,[(s(!0),a(U,null,te(e(w),m=>(s(),v(D,{key:m.label,color:m.color,variant:"subtle",size:"sm",title:m.title,class:"inline-flex items-center gap-1"},{default:u(()=>[r(P,{name:m.icon,class:"size-3 shrink-0"},null,8,["name"]),f(" "+c(m.label),1)]),_:2},1032,["color","title"]))),128))])):i("",!0),r(V,null,{default:u(()=>[e(g)?(s(),a("p",Kn,[e(g).streak>=1?(s(),a(U,{key:0},[d[1]||(d[1]=f(" Failing for ",-1)),o("strong",Wn,c(e(g).streak),1),f(" consecutive run"+c(e(g).streak===1?"":"s")+". ",1),e(g).lastPass?(s(),a(U,{key:0},[d[0]||(d[0]=f(" Last passed in ",-1)),r(b,{to:`/test-run-cases/${e(g).lastPass.id}`,class:"text-primary hover:underline"},{default:u(()=>[f(" run #"+c(e(g).lastPass.runId),1)]),_:1},8,["to"]),f(" ("+c(("formatRelativeTime"in l?l.formatRelativeTime:e(Se))(e(g).lastPass.startTime))+"). ",1)],64)):e(g).total>1?(s(),a(U,{key:1},[f(" No passing run in the last "+c(e(g).total)+" recorded. ",1)],64)):(s(),a(U,{key:2},[f(" First recorded run of this test. ")],64))],64)):t.testCase?.status==="passed"?(s(),a(U,{key:1},[f(" This execution passed. ")],64)):i("",!0)])):i("",!0),e($).length>1?(s(),a("div",Gn,[d[2]||(d[2]=o("p",{class:"text-xs text-gray-400 mb-1"},"Recent runs (oldest → newest)",-1)),o("div",Jn,[(s(!0),a(U,null,te(e($),m=>(s(),v(x,{key:m.id,text:`Run #${m.runId}: ${m.status}`},{default:u(()=>[r(b,{to:`/test-run-cases/${m.id}`,class:Z(["size-3.5 rounded-sm inline-block transition-colors",[n(m.status),m.id===t.currentId?"ring-2 ring-offset-1 ring-primary":""]])},null,8,["to","class"])]),_:2},1032,["text"]))),128))])])):i("",!0)]),_:1})])]),_:1})}}}),Qn=Object.assign(qn,{__name:"TestCaseVerdictCard"}),Zn={class:"space-y-3"},Xn={class:"space-y-1.5"},Yn={class:"flex items-center gap-2 flex-wrap"},ea={class:"text-xs text-gray-500"},ta=["title"],sa={class:"text-xs text-gray-500 dark:text-gray-400"},na={key:0,class:"rounded-lg border border-default bg-elevated/40 p-2.5 space-y-1"},aa={class:"flex items-center gap-1.5 flex-wrap"},oa={class:"text-xs text-gray-600 dark:text-gray-400 line-clamp-3"},ra=["title"],ia=re({__name:"FailureClusterCard",props:{cluster:{}},setup(t){const _=t,h=C(()=>Math.max(0,_.cluster.sameRunCaseCount-1)),w=C(()=>{const g=_.cluster.diagnosis;return g&&g.status==="completed"&&g.summary?g:null}),$=g=>g==="high"?"success":g==="medium"?"warning":"neutral";return(g,n)=>{const l=pe,d=Pe,P=ce,D=Ie,b=ye;return s(),v(b,{icon:"i-lucide-layers","icon-class":"text-primary",title:"Failure cluster",help:"cluster.concept"},{actions:u(()=>[t.cluster.isNew?(s(),v(l,{key:0,color:"warning",variant:"subtle",size:"sm"},{default:u(()=>[...n[0]||(n[0]=[f("New",-1)])]),_:1})):i("",!0),t.cluster.status&&t.cluster.status!=="open"?(s(),v(l,{key:1,color:t.cluster.status==="resolved"?"success":"neutral",variant:"subtle",size:"sm",class:"capitalize"},{default:u(()=>[f(c(t.cluster.status),1)]),_:1},8,["color"])):i("",!0)]),default:u(()=>[o("div",Zn,[o("div",Xn,[o("div",Yn,[t.cluster.errorType?(s(),v(l,{key:0,color:e(Ks)(t.cluster.errorType),variant:"soft",size:"sm"},{default:u(()=>[f(c(t.cluster.errorType),1)]),_:1},8,["color"])):i("",!0),o("span",ea,c(t.cluster.occurrences??0)+" occurrence"+c((t.cluster.occurrences??0)===1?"":"s"),1)]),o("p",{class:"font-mono text-xs text-gray-600 dark:text-gray-400 break-all line-clamp-2",title:t.cluster.signature},c(t.cluster.signature),9,ta)]),o("p",sa,[e(h)>0?(s(),a(U,{key:0},[f(" Matches "+c(e(h))+" other failing "+c(e(h)===1?"test":"tests")+" in this run. ",1)],64)):i("",!0),t.cluster.isNew?(s(),a(U,{key:2},[f("Opened a new cluster in this run.")],64)):(s(),a(U,{key:1},[n[1]||(n[1]=f(" Known failure — first seen in ",-1)),r(d,{to:`/test-runs/${t.cluster.firstSeenRunId}`,class:"text-primary hover:underline"},{default:u(()=>[f(" run #"+c(t.cluster.firstSeenRunId),1)]),_:1},8,["to"]),t.cluster.firstSeenAt?(s(),a(U,{key:0},[f(" ("+c(("formatRelativeTime"in g?g.formatRelativeTime:e(Se))(t.cluster.firstSeenAt))+")",1)],64)):i("",!0),n[2]||(n[2]=f(". ",-1))],64))]),e(w)?(s(),a("div",na,[o("div",aa,[r(P,{name:"i-lucide-sparkles",class:"size-3.5 text-primary shrink-0"}),n[3]||(n[3]=o("span",{class:"text-xs font-medium"},"AI verdict",-1)),e(w).category?(s(),v(l,{key:0,color:"neutral",variant:"soft",size:"xs"},{default:u(()=>[f(c(e(w).category),1)]),_:1})):i("",!0),e(w).confidence?(s(),v(l,{key:1,color:$(e(w).confidence),variant:"soft",size:"xs"},{default:u(()=>[f(c(e(w).confidence)+" confidence ",1)]),_:1},8,["color"])):i("",!0)]),o("p",oa,c(e(w).summary),1)])):i("",!0),t.cluster.triageNote?(s(),a("p",{key:1,class:"text-xs italic text-gray-500 dark:text-gray-400",title:t.cluster.triageNote}," “"+c(t.cluster.triageNote)+"” ",9,ra)):i("",!0),r(D,{to:`/failure-clusters/${t.cluster.id}`,size:"sm",color:"primary",variant:"solid",block:"","trailing-icon":"i-lucide-arrow-right"},{default:u(()=>[...n[4]||(n[4]=[f(" Open cluster investigation ",-1)])]),_:1},8,["to"])])]),_:1})}}}),la=Object.assign(ia,{__name:"FailureClusterCard"}),ca={class:"space-y-3"},ua={class:"text-xs text-gray-400 inline-flex items-center gap-1"},da={key:0,class:"text-primary"},ma={key:0,class:"flex items-center justify-between gap-2 rounded-lg border border-default bg-elevated/40 p-2.5"},fa={class:"inline-flex items-center gap-2 text-sm text-gray-500"},ga={key:1,class:"flex items-center gap-2"},pa={key:2,class:"rounded-lg border border-dashed border-default p-4 text-center text-gray-400"},ya={class:"text-sm inline-flex items-center gap-1 justify-center"},ha={class:"pt-1 text-center"},xa=re({__name:"TestCaseAiCard",props:{testRunsCaseId:{}},setup(t){const _=t,{aiStatus:h}=Qs(),w=ss(),$=A(null),g=A(!1),n=A(null),l=A([]),d=A(0),P=A(0),D=A(null),b=A(!1),x=A(!1),V=A(null),M=A(!1),m=A("");async function j(){b.value=!0;try{const k=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis-context`,{query:{format:"json"}});n.value=k.text,l.value=k.sections,d.value=k.tokenEstimate,P.value=k.imageTokenEstimate??0,D.value=k.coverage}catch{n.value=null,l.value=[],d.value=0,D.value=null}finally{b.value=!1}}async function F(){try{const k=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis`);$.value=k.diagnosis}catch{}}yt(()=>{F(),j()});const B=C(()=>{const k=$.value?.details;if(!k)return[];const L=[];if(Array.isArray(k.evidence)&&L.push(...k.evidence),Array.isArray(k.hypotheses))for(const ae of k.hypotheses)Array.isArray(ae?.evidence)&&L.push(...ae.evidence);return Es(L)});function S(k){V.value=k,x.value=!0}function G(k){m.value=m.value?`${m.value}
1
+ import{_ as es}from"./D5Mhpp98.js";import{_ as ts}from"./Ds8_6Fzl.js";import{d as re,o as s,e as v,f as u,g as o,h as r,t as c,c as a,F as U,z as te,b as e,m as pe,k as f,l as i,E as pt,i as Z,_ as ce,v as C,H as Pe,j as Ie,q as ss,C as yt,x as ge,r as A,ab as $e,a as xe,ac as ns,B as Oe,R as Ce,u as as,p as os,w as mt,s as rs,ad as is,N as ls}from"./BzBaMPgu.js";import{d as cs,e as us,h as He,a as ds,b as ms,c as fs,_ as gs,n as ps,o as ys,p as hs,u as xs,f as vs,i as _s,j as ks,k as bs,l as ws,m as $s}from"./BYWQ47QQ.js";import{_ as Cs}from"./DH_LEqhd.js";import{_ as Ts}from"./BC5bqlfM.js";import{_ as Ss,a as Is}from"./CdLqOMvN.js";import{_ as Rs,a as js,b as Ls,c as zs}from"./iUf7K_JR.js";import{_ as Re}from"./Ch8sGLqE.js";import{_ as Ms}from"./OanUGF_v.js";import{_ as Ns}from"./BraJd4EA.js";import{_ as ht}from"./BMfTUMYy.js";import{_ as xt}from"./BF5JDf9_.js";import{_ as vt}from"./B-onBCAB.js";import{_ as _t,a as kt}from"./qeqzb80l.js";import{_ as Ds}from"./DLwuL-qR.js";import{_ as Ps}from"./kDEwM7SQ.js";import{_ as As,d as Us,e as Bs,f as Fs,g as Vs,h as Es,a as bt,i as Te,b as De,c as Os}from"./RSS6R9Te.js";import{f as Se,m as Hs,c as Ks,e as Ws,n as wt,o as Ke,q as We,u as Gs,j as qs,r as ft}from"./CdM2qNYM.js";import{_ as $t}from"./BSKLNgre.js";import{_ as ye}from"./D_j436ND.js";import{_ as Js}from"./Die1200X.js";import{u as Qs}from"./zAFiz2Mg.js";import{_ as Ge}from"./Dq6_-84R.js";import{_ as qe}from"./Hp-_W7z4.js";import{_ as Ct}from"./mhvG7mu8.js";import{f as we}from"./D-c8ZSws.js";import{_ as Zs}from"./Cmuwgbf4.js";import{_ as Xs}from"./CnsaoeEq.js";import{_ as Ys}from"./CBQXv4bU.js";import{_ as en}from"./5nOoVJzL.js";import{_ as tn}from"./B77w1Eib.js";import{_ as sn}from"./9Dtlg-K4.js";import{b as nn}from"./7vRR5W2L.js";import{a as an,u as gt}from"./CDEmotIt.js";import"./DWz_bHNP.js";import"./BTCWUyBX.js";import"./CPiLUjjx.js";import"./E26Y1NWH.js";import"./Db5xe__T.js";import"./BbXvpkBp.js";import"./BFVrl1ss.js";import"./CnRNwiuE.js";import"./DDho3MJD.js";import"./Bg8yOdSf.js";import"./CTYlay1H.js";import"./C8uZoJVq.js";import"./WCZdf9Ln.js";import"./Boyv6hLW.js";import"./vOZZ2cLi.js";import"./BcHU1KNK.js";import"./BPQNVV4M.js";import"./BOrnSpTA.js";import"./D_SCB-z2.js";import"./BYnqoVCE.js";import"./D7W_4Sqc.js";import"./CbuK1HIv.js";const on={class:"text-sm font-semibold truncate min-w-0"},rn={class:"flex items-center gap-3 ml-auto max-sm:hidden"},ln={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},cn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},un={class:"text-gray-700 dark:text-gray-300"},dn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},mn={class:"text-gray-700 dark:text-gray-300"},fn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},gn={class:"text-gray-700 dark:text-gray-300"},pn={key:0,class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},yn={class:"text-gray-700 dark:text-gray-300"},hn={class:"@container"},xn={class:"space-y-3"},vn={class:"flex items-start gap-2.5 pr-8"},_n={class:"min-w-0 flex-1"},kn={class:"flex items-center gap-2 flex-wrap"},bn={class:"text-base font-bold truncate max-w-full"},wn={class:"text-xs text-gray-500 mt-0.5 flex items-center gap-x-2 gap-y-0.5 flex-wrap"},$n=["title"],Cn={key:1},Tn={key:0,class:"flex items-center gap-2 text-sm"},Sn={class:"text-gray-700 dark:text-gray-300 truncate"},In={key:0,class:"text-gray-500 shrink-0"},Rn={key:1,class:"flex items-center gap-1.5 text-sm"},jn={key:0,class:"font-medium"},Ln=["title"],zn={key:2,class:"text-muted"},Mn=["title"],Nn={key:0,class:"rounded-full border border-default px-2 py-0.5 text-xs bg-elevated/60"},Dn={key:1},Pn=["href"],An={key:1},Un={class:"text-muted"},Bn={key:0,class:"tabular-nums text-muted"},Fn={key:0,class:"text-dimmed"},Vn=re({__name:"TestCaseSummary",props:{testCase:{},scmInfo:{},ciInfo:{},browser:{},environment:{},stepsCount:{},historicalTiming:{},stableLinks:{},projectKey:{},projectName:{}},emits:["refresh"],setup(t){const _=t,h=C(()=>{const n=_.testCase;if(!n)return[];const l=[];return n.isNewRegression&&l.push({label:"New regression",color:"error",title:"Passed in the baseline run, failing here"}),n.isNewFlaky&&l.push({label:"New flaky",color:"warning",title:"Newly started passing only on retry"}),n.status==="passed"&&(n.retries??0)>0&&l.push({label:"Passed on retry",color:"warning",title:"This test failed then passed on a retry"}),l}),w=C(()=>(_.testCase?.testAnnotations??[]).filter(n=>!Hs(n.type))),$=C(()=>_.testCase?.startedAt??null),g=C(()=>!!(_.ciInfo||_.environment));return(n,l)=>{const d=Rs,P=Re,D=Ms,b=pe,x=Ns,V=ht,M=pt,m=xt,j=vt,F=ce,B=_t,S=Ls,G=Ds,J=js,z=Ps,ne=As;return s(),v(ne,{"storage-key":"test-case"},{folded:u(()=>[r(d,{status:t.testCase?.status??"",size:"sm"},null,8,["status"]),o("span",on,c(t.testCase?.title),1),o("div",rn,[o("span",ln,[l[1]||(l[1]=f(" Dur: ",-1)),r(P,{ms:t.testCase?.duration,class:"font-bold text-gray-700 dark:text-gray-300"},null,8,["ms"])]),o("span",cn,[l[2]||(l[2]=f(" Retries: ",-1)),o("strong",un,c(t.testCase?.retries??0),1)]),o("span",dn,[l[3]||(l[3]=f(" Steps: ",-1)),o("strong",mn,c(t.stepsCount),1)]),o("span",fn,[l[4]||(l[4]=f(" Worker: ",-1)),o("strong",gn,c(t.testCase?.workerIndex??"—"),1)]),t.testCase?.shardIndex!=null?(s(),a("span",pn,[l[5]||(l[5]=f(" Shard: ",-1)),o("strong",yn,c(t.testCase.shardIndex),1)])):i("",!0)]),t.browser?(s(),v(D,{key:0,browser:t.browser,size:"sm",class:"shrink-0 max-sm:hidden"},null,8,["browser"])):i("",!0)]),default:u(()=>[o("div",hn,[r(z,{class:"shadow-xs",ui:{footer:"px-4 py-2.5 sm:px-4 bg-muted/30"}},{footer:u(()=>[r(J,null,{default:u(()=>[t.scmInfo?(s(),v(S,{key:0,label:"Source",icon:"i-lucide-git-branch"},{default:u(()=>[t.scmInfo.branch?(s(),a("span",jn,c(t.scmInfo.branch),1)):i("",!0),t.scmInfo.commit?(s(),a("code",{key:1,class:"text-xs font-mono bg-zinc-100 dark:bg-zinc-800 px-1 py-0.5 rounded",title:t.scmInfo.commit},c(t.scmInfo.commit.length>=8?t.scmInfo.commit.substring(0,8):t.scmInfo.commit),9,Ln)):i("",!0),t.scmInfo.author?(s(),a("span",zn,c(t.scmInfo.author),1)):i("",!0),t.scmInfo.commitMessage?(s(),a("span",{key:3,class:"text-xs text-dimmed truncate max-w-[40ch]",title:t.scmInfo.commitMessage},c(t.scmInfo.commitMessage),9,Mn)):i("",!0)]),_:1})):i("",!0),e(g)?(s(),v(S,{key:1,label:"CI & environment",icon:"i-lucide-cloud",help:"run.ci-env"},{default:u(()=>[t.environment?(s(),a("span",Nn,c(t.environment),1)):i("",!0),t.ciInfo?.provider?(s(),a("span",Dn,c(t.ciInfo.provider),1)):i("",!0),t.ciInfo?.buildNumber||t.ciInfo?.buildUrl?(s(),a(U,{key:2},[l[12]||(l[12]=o("span",{class:"text-dimmed"},"·",-1)),t.ciInfo?.buildUrl?(s(),a("a",{key:0,href:t.ciInfo.buildUrl,target:"_blank",class:"text-primary hover:underline"},c(t.ciInfo?.buildNumber?`Build #${t.ciInfo.buildNumber}`:"View build"),9,Pn)):(s(),a("span",An,"Build #"+c(t.ciInfo.buildNumber),1))],64)):i("",!0),t.ciInfo?.workflow||t.ciInfo?.jobName?(s(),a(U,{key:3},[l[13]||(l[13]=o("span",{class:"text-dimmed"},"·",-1)),o("span",Un,[t.ciInfo?.workflow?(s(),a(U,{key:0},[f(c(t.ciInfo.workflow),1)],64)):i("",!0),t.ciInfo?.workflow&&t.ciInfo?.jobName?(s(),a(U,{key:1},[f(" · ")],64)):i("",!0),t.ciInfo?.jobName?(s(),a(U,{key:2},[f(c(t.ciInfo.jobName),1)],64)):i("",!0)])],64)):i("",!0)]),_:1})):i("",!0),t.browser?(s(),v(S,{key:2,label:"Browser"},{default:u(()=>[r(D,{browser:{...t.browser,viewport:void 0},size:"sm"},null,8,["browser"]),t.browser.viewport?(s(),a("span",Bn,[f(c(t.browser.viewport.width)+"×"+c(t.browser.viewport.height)+" ",1),t.browser.deviceScaleFactor&&t.browser.deviceScaleFactor!==1?(s(),a("span",Fn,"@"+c(t.browser.deviceScaleFactor)+"x",1)):i("",!0)])):i("",!0)]),_:1})):i("",!0),r(S,{label:"Links",icon:"i-lucide-link"},{default:u(()=>[t.testCase?.id?(s(),v(G,{key:0,"entity-type":"test_case","entity-id":t.testCase.id,links:t.stableLinks??null,onUpdated:l[0]||(l[0]=E=>n.$emit("refresh"))},null,8,["entity-id","links"])):i("",!0)]),_:1})]),_:1})]),default:u(()=>[o("div",xn,[o("div",vn,[r(d,{status:t.testCase?.status??"",class:"mt-0.5"},null,8,["status"]),o("div",_n,[o("div",kn,[o("h2",bn,c(t.testCase?.title),1),(s(!0),a(U,null,te(e(h),E=>(s(),v(b,{key:E.label,color:E.color,variant:"subtle",size:"xs",title:E.title},{default:u(()=>[f(c(E.label),1)]),_:2},1032,["color","title"]))),128)),(s(!0),a(U,null,te(e(w),(E,ue)=>(s(),v(b,{key:`ann-${ue}`,color:"neutral",variant:"soft",size:"xs",class:"font-mono",title:E.description||E.type},{default:u(()=>[f(" @"+c(E.type),1)]),_:2},1032,["title"]))),128)),r(x,{tags:t.testCase?.tags,meta:t.testCase?.testMeta},null,8,["tags","meta"])]),o("p",wn,[t.testCase?.location?(s(),v(V,{key:0,location:t.testCase.location,"project-key":t.projectKey,"project-name":t.projectName},null,8,["location","project-key","project-name"])):i("",!0),r(M,null,{default:u(()=>[e($)?(s(),a("span",{key:0,class:"text-gray-400",title:new Date(e($)).toLocaleString()}," started "+c(("formatRelativeTime"in n?n.formatRelativeTime:e(Se))(e($))),9,$n)):i("",!0)]),_:1}),t.historicalTiming?(s(),a("span",Cn,[l[6]||(l[6]=f(" Avg ",-1)),r(P,{ms:t.historicalTiming.avg},null,8,["ms"]),l[7]||(l[7]=f(" · ",-1)),o("span",{class:Z(t.historicalTiming.diff>0?"text-red-600":"text-green-600")},c(t.historicalTiming.diff>0?"+":"")+c(t.historicalTiming.pct)+"% ",3)])):i("",!0)])])]),r(j,null,{default:u(()=>[r(m,{label:"Duration"},{default:u(()=>[r(P,{ms:t.testCase?.duration},null,8,["ms"])]),_:1}),r(m,{label:"Retries",value:t.testCase?.retries??0},null,8,["value"]),r(m,{label:"Steps",value:t.stepsCount},null,8,["value"]),r(m,{label:"Worker",value:t.testCase?.workerIndex??"—"},null,8,["value"])]),_:1}),t.testCase?.slowestStep?(s(),a("div",Tn,[r(F,{name:"i-lucide-zap",class:"size-4 text-amber-500 shrink-0"}),l[10]||(l[10]=o("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Slowest step:",-1)),o("span",Sn,c(t.testCase.slowestStep),1),t.testCase.slowestStepDuration?(s(),a("span",In,[l[8]||(l[8]=f("(",-1)),r(P,{ms:t.testCase.slowestStepDuration},null,8,["ms"]),l[9]||(l[9]=f(")",-1))])):i("",!0)])):i("",!0),(t.testCase?.wastedTimeMs??0)>0?(s(),a("div",Rn,[r(F,{name:"i-lucide-hourglass",class:"size-4 text-amber-500 shrink-0"}),l[11]||(l[11]=o("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Wasted in fixed waits:",-1)),r(P,{ms:t.testCase?.wastedTimeMs,class:"text-gray-700 dark:text-gray-300"},null,8,["ms"]),r(B,{topic:"case.wasted-time"})])):i("",!0)])]),_:1})])]),_:1})}}}),En=Object.assign(Vn,{__name:"TestCaseSummary"}),On={class:"space-y-3"},Hn={key:0,class:"flex flex-wrap gap-1.5"},Kn={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Wn={class:"text-gray-800 dark:text-gray-200"},Gn={key:1},qn={class:"flex items-center gap-1 flex-wrap"},Jn=re({__name:"TestCaseVerdictCard",props:{testCase:{},history:{},currentId:{}},setup(t){const _=t,h=l=>l==="failed"||l==="timedOut"||l==="timedout",w=C(()=>{const l=_.testCase;if(!l)return[];const d=[];return l.isNewRegression&&d.push({label:"New regression",color:"error",icon:"i-lucide-git-pull-request-arrow",title:"Passed in the baseline run, failing here — likely fallout from the latest change"}),l.isNewFlaky&&d.push({label:"New flaky",color:"warning",icon:"i-lucide-shuffle",title:"Newly started passing only on retry — intermittent failure"}),l.status==="timedOut"&&d.push({label:"Timed out",color:"warning",icon:"i-lucide-timer-off",title:"The test exceeded its timeout"}),(l.retries??0)>0&&d.push({label:l.status==="passed"?`Passed on retry ${l.retries}`:`Retried ${l.retries}×`,color:l.status==="passed"?"warning":"neutral",icon:"i-lucide-refresh-cw",title:`This execution retried ${l.retries} time${l.retries===1?"":"s"}`}),d}),$=C(()=>_.history.slice(0,24).slice().reverse()),g=C(()=>{const l=_.history;if(!l.length)return null;const d=Math.max(0,l.findIndex(b=>b.id===_.currentId));let P=0;for(let b=d;b<l.length&&h(l[b].status);b++)P++;let D=null;for(let b=d+1;b<l.length;b++)if(l[b].status==="passed"){D=l[b];break}return{streak:P,lastPass:D,total:l.length,anchorFailing:h(l[d]?.status)}}),n=l=>({"bg-red-500 hover:bg-red-600":h(l),"bg-green-500 hover:bg-green-600":l==="passed","bg-yellow-500 hover:bg-yellow-600":l==="skipped","bg-gray-400 hover:bg-gray-500":!h(l)&&!["passed","skipped"].includes(l)});return(l,d)=>{const P=ce,D=pe,b=Pe,x=$t,V=pt,M=ye;return s(),v(M,{icon:"i-lucide-clipboard-check","icon-class":"text-amber-500",title:"Verdict",help:"case.verdict"},{default:u(()=>[o("div",On,[e(w).length?(s(),a("div",Hn,[(s(!0),a(U,null,te(e(w),m=>(s(),v(D,{key:m.label,color:m.color,variant:"subtle",size:"sm",title:m.title,class:"inline-flex items-center gap-1"},{default:u(()=>[r(P,{name:m.icon,class:"size-3 shrink-0"},null,8,["name"]),f(" "+c(m.label),1)]),_:2},1032,["color","title"]))),128))])):i("",!0),r(V,null,{default:u(()=>[e(g)?(s(),a("p",Kn,[e(g).streak>=1?(s(),a(U,{key:0},[d[1]||(d[1]=f(" Failing for ",-1)),o("strong",Wn,c(e(g).streak),1),f(" consecutive run"+c(e(g).streak===1?"":"s")+". ",1),e(g).lastPass?(s(),a(U,{key:0},[d[0]||(d[0]=f(" Last passed in ",-1)),r(b,{to:`/test-run-cases/${e(g).lastPass.id}`,class:"text-primary hover:underline"},{default:u(()=>[f(" run #"+c(e(g).lastPass.runId),1)]),_:1},8,["to"]),f(" ("+c(("formatRelativeTime"in l?l.formatRelativeTime:e(Se))(e(g).lastPass.startTime))+"). ",1)],64)):e(g).total>1?(s(),a(U,{key:1},[f(" No passing run in the last "+c(e(g).total)+" recorded. ",1)],64)):(s(),a(U,{key:2},[f(" First recorded run of this test. ")],64))],64)):t.testCase?.status==="passed"?(s(),a(U,{key:1},[f(" This execution passed. ")],64)):i("",!0)])):i("",!0),e($).length>1?(s(),a("div",Gn,[d[2]||(d[2]=o("p",{class:"text-xs text-gray-400 mb-1"},"Recent runs (oldest → newest)",-1)),o("div",qn,[(s(!0),a(U,null,te(e($),m=>(s(),v(x,{key:m.id,text:`Run #${m.runId}: ${m.status}`},{default:u(()=>[r(b,{to:`/test-run-cases/${m.id}`,class:Z(["size-3.5 rounded-sm inline-block transition-colors",[n(m.status),m.id===t.currentId?"ring-2 ring-offset-1 ring-primary":""]])},null,8,["to","class"])]),_:2},1032,["text"]))),128))])])):i("",!0)]),_:1})])]),_:1})}}}),Qn=Object.assign(Jn,{__name:"TestCaseVerdictCard"}),Zn={class:"space-y-3"},Xn={class:"space-y-1.5"},Yn={class:"flex items-center gap-2 flex-wrap"},ea={class:"text-xs text-gray-500"},ta=["title"],sa={class:"text-xs text-gray-500 dark:text-gray-400"},na={key:0,class:"rounded-lg border border-default bg-elevated/40 p-2.5 space-y-1"},aa={class:"flex items-center gap-1.5 flex-wrap"},oa={class:"text-xs text-gray-600 dark:text-gray-400 line-clamp-3"},ra=["title"],ia=re({__name:"FailureClusterCard",props:{cluster:{}},setup(t){const _=t,h=C(()=>Math.max(0,_.cluster.sameRunCaseCount-1)),w=C(()=>{const g=_.cluster.diagnosis;return g&&g.status==="completed"&&g.summary?g:null}),$=g=>g==="high"?"success":g==="medium"?"warning":"neutral";return(g,n)=>{const l=pe,d=Pe,P=ce,D=Ie,b=ye;return s(),v(b,{icon:"i-lucide-layers","icon-class":"text-primary",title:"Failure cluster",help:"cluster.concept"},{actions:u(()=>[t.cluster.isNew?(s(),v(l,{key:0,color:"warning",variant:"subtle",size:"sm"},{default:u(()=>[...n[0]||(n[0]=[f("New",-1)])]),_:1})):i("",!0),t.cluster.status&&t.cluster.status!=="open"?(s(),v(l,{key:1,color:t.cluster.status==="resolved"?"success":"neutral",variant:"subtle",size:"sm",class:"capitalize"},{default:u(()=>[f(c(t.cluster.status),1)]),_:1},8,["color"])):i("",!0)]),default:u(()=>[o("div",Zn,[o("div",Xn,[o("div",Yn,[t.cluster.errorType?(s(),v(l,{key:0,color:e(Ks)(t.cluster.errorType),variant:"soft",size:"sm"},{default:u(()=>[f(c(t.cluster.errorType),1)]),_:1},8,["color"])):i("",!0),o("span",ea,c(t.cluster.occurrences??0)+" occurrence"+c((t.cluster.occurrences??0)===1?"":"s"),1)]),o("p",{class:"font-mono text-xs text-gray-600 dark:text-gray-400 break-all line-clamp-2",title:t.cluster.signature},c(t.cluster.signature),9,ta)]),o("p",sa,[e(h)>0?(s(),a(U,{key:0},[f(" Matches "+c(e(h))+" other failing "+c(e(h)===1?"test":"tests")+" in this run. ",1)],64)):i("",!0),t.cluster.isNew?(s(),a(U,{key:2},[f("Opened a new cluster in this run.")],64)):(s(),a(U,{key:1},[n[1]||(n[1]=f(" Known failure — first seen in ",-1)),r(d,{to:`/test-runs/${t.cluster.firstSeenRunId}`,class:"text-primary hover:underline"},{default:u(()=>[f(" run #"+c(t.cluster.firstSeenRunId),1)]),_:1},8,["to"]),t.cluster.firstSeenAt?(s(),a(U,{key:0},[f(" ("+c(("formatRelativeTime"in g?g.formatRelativeTime:e(Se))(t.cluster.firstSeenAt))+")",1)],64)):i("",!0),n[2]||(n[2]=f(". ",-1))],64))]),e(w)?(s(),a("div",na,[o("div",aa,[r(P,{name:"i-lucide-sparkles",class:"size-3.5 text-primary shrink-0"}),n[3]||(n[3]=o("span",{class:"text-xs font-medium"},"AI verdict",-1)),e(w).category?(s(),v(l,{key:0,color:"neutral",variant:"soft",size:"xs"},{default:u(()=>[f(c(e(w).category),1)]),_:1})):i("",!0),e(w).confidence?(s(),v(l,{key:1,color:$(e(w).confidence),variant:"soft",size:"xs"},{default:u(()=>[f(c(e(w).confidence)+" confidence ",1)]),_:1},8,["color"])):i("",!0)]),o("p",oa,c(e(w).summary),1)])):i("",!0),t.cluster.triageNote?(s(),a("p",{key:1,class:"text-xs italic text-gray-500 dark:text-gray-400",title:t.cluster.triageNote}," “"+c(t.cluster.triageNote)+"” ",9,ra)):i("",!0),r(D,{to:`/failure-clusters/${t.cluster.id}`,size:"sm",color:"primary",variant:"solid",block:"","trailing-icon":"i-lucide-arrow-right"},{default:u(()=>[...n[4]||(n[4]=[f(" Open cluster investigation ",-1)])]),_:1},8,["to"])])]),_:1})}}}),la=Object.assign(ia,{__name:"FailureClusterCard"}),ca={class:"space-y-3"},ua={class:"text-xs text-gray-400 inline-flex items-center gap-1"},da={key:0,class:"text-primary"},ma={key:0,class:"flex items-center justify-between gap-2 rounded-lg border border-default bg-elevated/40 p-2.5"},fa={class:"inline-flex items-center gap-2 text-sm text-gray-500"},ga={key:1,class:"flex items-center gap-2"},pa={key:2,class:"rounded-lg border border-dashed border-default p-4 text-center text-gray-400"},ya={class:"text-sm inline-flex items-center gap-1 justify-center"},ha={class:"pt-1 text-center"},xa=re({__name:"TestCaseAiCard",props:{testRunsCaseId:{}},setup(t){const _=t,{aiStatus:h}=Qs(),w=ss(),$=A(null),g=A(!1),n=A(null),l=A([]),d=A(0),P=A(0),D=A(null),b=A(!1),x=A(!1),V=A(null),M=A(!1),m=A("");async function j(){b.value=!0;try{const k=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis-context`,{query:{format:"json"}});n.value=k.text,l.value=k.sections,d.value=k.tokenEstimate,P.value=k.imageTokenEstimate??0,D.value=k.coverage}catch{n.value=null,l.value=[],d.value=0,D.value=null}finally{b.value=!1}}async function F(){try{const k=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis`);$.value=k.diagnosis}catch{}}yt(()=>{F(),j()});const B=C(()=>{const k=$.value?.details;if(!k)return[];const L=[];if(Array.isArray(k.evidence)&&L.push(...k.evidence),Array.isArray(k.hypotheses))for(const ae of k.hypotheses)Array.isArray(ae?.evidence)&&L.push(...ae.evidence);return Es(L)});function S(k){V.value=k,x.value=!0}function G(k){m.value=m.value?`${m.value}
2
2
 
3
- ${k}`:k,M.value=!0}async function q(k=!1){g.value=!0;try{const L=k?`/api/test-run-cases/${_.testRunsCaseId}/diagnose?force=true`:`/api/test-run-cases/${_.testRunsCaseId}/diagnose`,ae=m.value.trim()?{additionalContext:m.value.trim()}:void 0;$.value=await $fetch(L,{method:"POST",body:ae})}catch(L){const ae=L?.statusCode;ae===409?(w.add({title:"Diagnosis already running",color:"warning"}),F()):ae===503?w.add({title:"AI diagnosis is not configured",color:"warning"}):w.add({title:"Diagnosis failed",description:Ws(L),color:"error"})}finally{g.value=!1}}function z(k){return k.status==="running"&&Date.now()-new Date(k.updatedAt).getTime()>300*1e3}const ne=C(()=>$.value&&($.value.status==="completed"||$.value.status==="failed")),E=C(()=>!$.value||$.value.status==="failed"||$.value.status==="running"&&z($.value)),ue=C(()=>$.value?.status==="running"&&!z($.value)&&!g.value);return(k,L)=>{const ae=Vs,y=ce,T=Us,H=qs,J=Ie,X=Bs,Y=_t,K=Fs,Q=Pe,ee=ye;return s(),v(ee,{icon:"i-lucide-sparkles","icon-class":"text-primary",title:"AI diagnosis",help:"case.ai"},{actions:u(()=>[r(ae,{"context-endpoint":`/api/test-run-cases/${t.testRunsCaseId}/diagnosis-context`},null,8,["context-endpoint"])]),default:u(()=>[o("div",ca,[o("p",ua,[r(y,{name:"i-lucide-triangle-alert",class:"size-3 shrink-0"}),L[6]||(L[6]=f(" AI-generated — verify before applying. ",-1))]),e(h)?.configured?(s(),v(T,{key:0,sections:e(l),"not-applicable":e(D)?.notApplicable,"token-estimate":e(d),loading:e(b),onViewSection:S,onOpen:L[0]||(L[0]=se=>x.value=!0)},null,8,["sections","not-applicable","token-estimate","loading"])):i("",!0),e(h)?.configured?(s(),a(U,{key:1},[o("div",null,[o("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onClick:L[1]||(L[1]=se=>M.value=!e(M))},[r(y,{name:e(M)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),L[7]||(L[7]=f(" Additional context ",-1)),e(m).trim()?(s(),a("span",da,"(1)")):i("",!0)]),e(M)?(s(),v(H,{key:0,modelValue:e(m),"onUpdate:modelValue":L[2]||(L[2]=se=>ge(m)?m.value=se:null),placeholder:"e.g. We deployed a new auth middleware yesterday…",rows:3,class:"w-full text-sm mt-1"},null,8,["modelValue"])):i("",!0)]),e(ue)?(s(),a("div",ma,[o("span",fa,[r(y,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-primary shrink-0"}),L[8]||(L[8]=f(" Diagnosis in progress… ",-1))]),r(J,{size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-refresh-cw",loading:e(g),onClick:F},{default:u(()=>[...L[9]||(L[9]=[f(" Refresh ",-1)])]),_:1},8,["loading"])])):(s(),a("div",ga,[e(E)?(s(),v(J,{key:0,icon:"i-lucide-sparkles",size:"sm",color:"primary",variant:"solid",loading:e(g),onClick:L[3]||(L[3]=se=>q(e($)?.status==="running"))},{default:u(()=>[f(c(e($)?.status==="running"?"Restart diagnosis":"Diagnose with AI"),1)]),_:1},8,["loading"])):e($)?.status==="completed"?(s(),v(J,{key:1,icon:"i-lucide-refresh-cw",size:"xs",color:"primary",variant:"soft",loading:e(g),onClick:L[4]||(L[4]=se=>q(!0))},{default:u(()=>[...L[10]||(L[10]=[f(" Re-diagnose ",-1)])]),_:1},8,["loading"])):i("",!0)])),e(ne)?(s(),v(X,{key:2,diagnosis:e($),onViewSection:S,onPrefillContext:G},null,8,["diagnosis"])):i("",!0)],64)):(s(),a("div",pa,[o("p",ya,[L[11]||(L[11]=f(" AI diagnosis is not configured ",-1)),r(Y,{topic:"cluster.ai-setup"})]),L[13]||(L[13]=o("p",{class:"text-xs mt-2 max-w-xs mx-auto"},[f(" Use "),o("strong",null,"Export → AI context"),f(" in the header to grab the full evidence bundle for your own AI tool, or configure a provider. ")],-1)),r(J,{to:"/settings/ai",size:"xs",color:"neutral",variant:"outline",class:"mt-3"},{default:u(()=>[...L[12]||(L[12]=[f(" Configure in Settings ",-1)])]),_:1})])),r(K,{open:e(x),sections:e(l),"token-estimate":e(d),"image-token-estimate":e(P),loading:e(b),"focus-section":e(V),"cited-sections":e(B),"not-applicable-sections":e(D)?.notApplicable,"onUpdate:open":L[5]||(L[5]=se=>{x.value=se,se||(V.value=null)}),onRefresh:j},null,8,["open","sections","token-estimate","image-token-estimate","loading","focus-section","cited-sections","not-applicable-sections"]),o("div",ha,[r(Q,{to:"/mcp",class:"inline-flex items-center gap-1 text-xs text-gray-400 hover:text-primary transition-colors"},{default:u(()=>[r(y,{name:"i-lucide-bot",class:"size-3"}),L[14]||(L[14]=f(" Query this failure from your AI agent via MCP ",-1))]),_:1})])])]),_:1})}}}),va=Object.assign(xa,{__name:"TestCaseAiCard"});function Tt(t,_,h){const w=A(null),$=A(!1),g=A(!1);async function n(){const l=t();if(!(!l||!$e(_)||$.value)){g.value=!0,$.value=!0;try{w.value=await $fetch(l)}catch{w.value=null}finally{$.value=!1}}}return yt(()=>{xe(()=>$e(_),l=>{l&&(h||g.value)&&!w.value&&n()},{immediate:!0})}),{data:w,pending:$,load:n}}function _a(t,_,h,w={}){return Tt(()=>{const $=$e(t),g=$e(_);return $&&g?`/api/test-runs/${$}/cases/${g}/trace-stacks`:null},h,w.auto??!0)}function ka(t,_,h,w={}){return Tt(()=>{const $=$e(t),g=$e(_);return $&&g?`/api/test-runs/${$}/cases/${g}/trace-network`:null},h,w.auto??!1)}const ba={class:"max-h-[32rem] overflow-y-auto"},wa={key:0,class:"mb-2 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},$a={key:0,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},Ca=re({__name:"TestSourceCard",props:{frames:{},testSource:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean},projectKey:{},projectName:{},storageKey:{}},setup(t,{expose:_}){const h=t,{data:w,pending:$}=_a(()=>h.runId,()=>h.testRunsCaseId,()=>h.hasTrace,{auto:!0}),g=C(()=>w.value?.status==="ok"?w.value.frames??[]:[]),n=C(()=>g.value.length>0),l=C(()=>h.frames?.length??0),d=C(()=>l.value>0||!!h.testSource),P=A(null),D=C({get:()=>P.value??(n.value?"trace":"captured"),set:M=>{P.value=M}}),b=C(()=>[{label:`Full stack (${g.value.length})`,value:"trace"},{label:`Captured (${l.value||1})`,value:"captured"}]),x=C(()=>D.value==="trace"&&n.value?g.value.length:l.value||null),V=A(null);return _({reveal:()=>V.value?.reveal()}),(M,m)=>{const j=Ge,F=ce,B=cs,S=us,G=bt,q=Je,z=kt,ne=He;return s(),v(ne,{ref_key:"card",ref:V,"storage-key":t.storageKey,icon:"i-lucide-code",count:e(x),title:"Test source",help:"case.test-source"},ns({folded:u(()=>[e(D)==="trace"&&e(n)?(s(),a(U,{key:0},[f(" Full call stack from the trace"+c(e(w)?.hasSources===!1?" (recorded without sources)":""),1)],64)):e(l)>1?(s(),a(U,{key:1},[f(" The failing line and "+c(e(l)-1)+" caller"+c(e(l)-1===1?"":"s"),1)],64)):(s(),a(U,{key:2},[f("Source around the failing assertion")],64))]),default:u(()=>[o("div",ba,[e(D)==="trace"&&e(n)?(s(),a(U,{key:0},[e(w)?.hasSources===!1?(s(),a("p",wa,[r(F,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),m[1]||(m[1]=f(" Trace recorded without sources — frame list only. ",-1))])):i("",!0),r(B,{frames:e(g),"project-key":t.projectKey,"project-name":t.projectName},null,8,["frames","project-key","project-name"])],64)):(s(),a(U,{key:1},[t.frames?.length?(s(),v(S,{key:0,frames:t.frames,"project-key":t.projectKey,"project-name":t.projectName},null,8,["frames","project-key","project-name"])):t.testSource?(s(),v(G,{key:1,text:"```typescript\n"+t.testSource+"\n```"},null,8,["text"])):t.hasTrace&&e($)?(s(),v(q,{key:2,text:"Loading call stack from trace…"})):i("",!0)],64))]),t.hasTrace?i("",!0):(s(),a("p",$a,[r(F,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),o("span",null,[m[3]||(m[3]=f(" Want to go deeper? Record traces (",-1)),m[4]||(m[4]=o("code",null,"trace: 'retain-on-failure'",-1)),m[5]||(m[5]=f(") to see the full call stack with source here. ",-1)),r(z,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:u(()=>[...m[2]||(m[2]=[f("Learn more",-1)])]),_:1})])]))]),_:2},[e(n)&&e(d)?{name:"actions",fn:u(()=>[r(j,{modelValue:e(D),"onUpdate:modelValue":m[0]||(m[0]=E=>ge(D)?D.value=E:null),items:e(b),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])]),key:"0"}:void 0]),1032,["storage-key","count"])}}}),Ta=Object.assign(Ca,{__name:"TestSourceCard"}),Sa={class:"space-y-3"},Ia={class:"divide-y divide-default"},Ra={class:"flex items-center gap-2 min-w-0"},ja={class:"text-sm truncate"},La={key:0,class:"text-xs text-gray-400 shrink-0"},za=re({__name:"TestCaseEvidenceCard",props:{attachments:{},traces:{},storageKey:{}},setup(t,{expose:_}){const h=t,w=Oe(),$=C(()=>h.attachments.filter(x=>Te(x.path,x.contentType)).length),g=C(()=>h.attachments.filter(x=>De(x.path,x.contentType)).length),n=C(()=>h.attachments.filter(x=>!Te(x.path,x.contentType)&&!De(x.path,x.contentType))),l=C(()=>$.value+g.value+h.traces.length+n.value.length),d=C(()=>{const x=[];return $.value&&x.push(`${$.value} screenshot${$.value===1?"":"s"}`),g.value&&x.push(`${g.value} video${g.value===1?"":"s"}`),h.traces.length&&x.push(`${h.traces.length} trace${h.traces.length===1?"":"s"}`),n.value.length&&x.push(`${n.value.length} file${n.value.length===1?"":"s"}`),x.join(" · ")||"No evidence captured"});function P(x,V){return wt(x,V,w.app?.baseURL)}function D(x){return x.split("/").pop()||x}const b=A(null);return _({reveal:()=>b.value?.reveal?.()}),(x,V)=>{const M=ds,m=ms,j=fs,F=ce,B=Ie,S=gs,G=Ct,q=He;return s(),v(q,{ref_key:"card",ref:b,"storage-key":t.storageKey,icon:"i-lucide-camera",title:"Failure evidence",count:e(l),help:"case.evidence"},{folded:u(()=>[f(c(e(d)),1)]),default:u(()=>[o("div",Sa,[r(M,{attachments:t.attachments},null,8,["attachments"]),r(m,{attachments:t.attachments},null,8,["attachments"]),r(j,{traces:t.traces},null,8,["traces"]),e(n).length?(s(),v(S,{key:0,icon:"i-lucide-paperclip",label:"Attachments",count:e(n).length,collapsible:!1},{default:u(()=>[o("div",Ia,[(s(!0),a(U,null,te(e(n),z=>(s(),a("div",{key:z.id,class:"flex items-center justify-between gap-2 px-3 py-2"},[o("div",Ra,[r(F,{name:"i-lucide-file",class:"size-4 text-gray-400 shrink-0"}),o("span",ja,c(D(z.path)),1),z.size?(s(),a("span",La,c(("formatBytes"in x?x.formatBytes:e(we))(z.size)),1)):i("",!0)]),r(B,{to:P(z.path,z.contentType),target:"_blank",icon:"i-lucide-external-link",size:"xs",color:"neutral",variant:"soft",label:"Open"},null,8,["to"])]))),128))])]),_:1},8,["count"])):i("",!0),e(l)===0?(s(),v(G,{key:1,icon:"i-lucide-camera-off",title:"No screenshots, video or traces captured",text:"Evidence comes from Playwright's own capture settings — set trace, screenshot and video in your config (trace: 'retain-on-failure' is the usual starting point).",doc:"reporter"})):i("",!0)])]),_:1},8,["storage-key","count"])}}}),Ma=Object.assign(za,{__name:"TestCaseEvidenceCard"}),Na={class:"space-y-1 max-h-80 overflow-y-auto"},Da={class:"min-w-0 flex-1"},Pa={class:"flex items-center gap-2"},Aa={class:"truncate"},Ua={key:0,class:"text-xs text-gray-400 mt-0.5 ml-0"},Ba=re({__name:"TestCaseConsoleCard",props:{entries:{}},setup(t){function _(w){switch(w){case"error":return"error";case"warning":return"warning";case"assert":return"error";default:return"neutral"}}function h(w){switch(w){case"error":return"i-lucide-octagon-x";case"warning":return"i-lucide-alert-triangle";case"assert":return"i-lucide-octagon-x";default:return"i-lucide-message-square"}}return(w,$)=>{const g=ce,n=pe,l=ye;return t.entries.length>0?(s(),v(l,{key:0,icon:"i-lucide-terminal",title:"Console output",count:t.entries.length,help:"case.console"},{default:u(()=>[o("div",Na,[(s(!0),a(U,null,te(t.entries,(d,P)=>(s(),a("div",{key:P,class:"flex items-start gap-2 py-1.5 px-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800 text-sm"},[r(g,{name:h(d.type),class:Z([d.type==="error"||d.type==="assert"?"text-red-500":d.type==="warning"?"text-amber-500":"text-gray-400","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),o("div",Da,[o("div",Pa,[r(n,{color:_(d.type),variant:"soft",size:"xs",class:"shrink-0"},{default:u(()=>[f(c(d.type),1)]),_:2},1032,["color"]),o("span",Aa,c(d.text),1)]),d.location?(s(),a("div",Ua,c(d.location),1)):i("",!0)])]))),128))])]),_:1},8,["count"])):i("",!0)}}}),Fa=Object.assign(Ba,{__name:"TestCaseConsoleCard"}),Va={key:0,class:"space-y-4 text-sm"},Ea={class:"space-y-1.5"},Oa={class:"flex items-center gap-2"},Ha={key:0,class:"text-xs text-gray-500"},Ka={class:"block text-xs break-all text-gray-700 dark:text-gray-300"},Wa={key:0,class:"text-xs text-red-600 dark:text-red-400 font-mono"},Ga={class:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-400"},Ja={key:0,class:"font-mono"},qa={key:1,class:"font-mono"},Qa={key:2},Za={key:3,title:"Bytes on the wire"},Xa={key:0},Ya={class:"flex h-2 rounded overflow-hidden bg-gray-100 dark:bg-gray-800"},eo=["title"],to={class:"flex flex-wrap gap-x-3 gap-y-1 mt-1.5 text-xs text-gray-500"},so={class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5 capitalize"},no={key:0,class:"rounded border border-default divide-y divide-default max-h-48 overflow-y-auto"},ao={class:"text-gray-500 dark:text-gray-400 shrink-0"},oo={class:"break-all text-gray-700 dark:text-gray-300"},ro={key:1,class:"text-xs text-gray-400"},io={key:1},lo={key:0,class:"rounded border border-default p-2"},co=["src","alt"],uo={key:1,class:"max-h-96 overflow-y-auto"},mo={key:0,class:"mt-1 text-xs text-gray-400"},fo={key:2,class:"text-xs text-gray-400"},go={key:2,class:"text-xs text-gray-400"},po=re({__name:"TraceNetworkDrawer",props:{open:{type:Boolean},entry:{},runId:{},testRunsCaseId:{}},emits:["update:open"],setup(t,{emit:_}){const h=t,w=_,$=[{key:"dns",label:"DNS",color:"bg-sky-400"},{key:"connect",label:"Connect",color:"bg-violet-400"},{key:"ssl",label:"TLS",color:"bg-rose-400"},{key:"send",label:"Send",color:"bg-amber-400"},{key:"wait",label:"Wait",color:"bg-blue-400"},{key:"receive",label:"Receive",color:"bg-emerald-400"}],g=C(()=>{const b=h.entry?.timings;return b?$.map(x=>({...x,value:b[x.key]??-1})).filter(x=>typeof x.value=="number"&&x.value>=0):[]}),n=C(()=>g.value.reduce((b,x)=>b+x.value,0)),l=C(()=>{const b=h.entry?.requestPostData??"";return b.startsWith("{")||b.startsWith("[")}),d=A(null),P=A(!1),D=new Map;return xe(()=>[h.open,h.entry?.bodySha1],async([b,x])=>{if(d.value=null,!b||!x||!h.runId)return;const V=D.get(x);if(V){d.value=V;return}P.value=!0;try{const M=await $fetch(`/api/test-runs/${h.runId}/cases/${h.testRunsCaseId}/trace-network-body`,{query:{sha1:x}});D.set(x,M),d.value=M}catch{d.value={status:"not-found"}}finally{P.value=!1}},{immediate:!0}),(b,x)=>{const V=pe,M=Re,m=Zs,j=Je,F=Xs;return s(),v(F,{open:t.open,title:"Request detail",ui:{content:"max-w-xl"},"onUpdate:open":x[0]||(x[0]=B=>w("update:open",B))},{body:u(()=>[t.entry?(s(),a("div",Va,[o("div",Ea,[o("div",Oa,[r(V,{color:("httpMethodColor"in b?b.httpMethodColor:e(Ke))(t.entry.method),variant:"soft",size:"sm",class:"font-mono shrink-0"},{default:u(()=>[f(c(t.entry.method),1)]),_:1},8,["color"]),r(V,{color:("httpStatusColor"in b?b.httpStatusColor:e(We))(t.entry.status),variant:"soft",size:"sm",class:"font-mono shrink-0 tabular-nums"},{default:u(()=>[f(c(t.entry.status>0?t.entry.status:"—"),1)]),_:1},8,["color"]),t.entry.statusText?(s(),a("span",Ha,c(t.entry.statusText),1)):i("",!0)]),o("code",Ka,c(t.entry.url),1),t.entry.failureText?(s(),a("p",Wa,c(t.entry.failureText),1)):i("",!0),o("div",Ga,[t.entry.resourceType?(s(),a("span",Ja,c(t.entry.resourceType),1)):i("",!0),t.entry.mimeType?(s(),a("span",qa,c(t.entry.mimeType),1)):i("",!0),t.entry.responseBodySize!=null?(s(),a("span",Qa,c(("formatBytes"in b?b.formatBytes:e(we))(t.entry.responseBodySize)),1)):i("",!0),t.entry.transferSize!=null?(s(),a("span",Za,c(("formatBytes"in b?b.formatBytes:e(we))(t.entry.transferSize))+" transferred",1)):i("",!0),r(M,{ms:t.entry.duration},null,8,["ms"]),t.entry.duringFailure?(s(),v(V,{key:4,color:"error",variant:"subtle",size:"xs"},{default:u(()=>[...x[1]||(x[1]=[f("During failing action",-1)])]),_:1})):i("",!0)])]),e(g).length>0&&e(n)>0?(s(),a("div",Xa,[x[2]||(x[2]=o("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Timing",-1)),o("div",Ya,[(s(!0),a(U,null,te(e(g),B=>(s(),a("div",{key:B.key,class:Z(B.color),style:Ce({width:`${Math.max(.5,B.value/e(n)*100)}%`}),title:`${B.label}: ${("formatDuration"in b?b.formatDuration:e(Gs))(B.value)}`},null,14,eo))),128))]),o("div",to,[(s(!0),a(U,null,te(e(g),B=>(s(),a("span",{key:B.key,class:"inline-flex items-center gap-1"},[o("span",{class:Z(["size-2 rounded-full",B.color])},null,2),f(" "+c(B.label)+" ",1),r(M,{ms:B.value,"no-title":""},null,8,["ms"])]))),128))])])):i("",!0),(s(),a(U,null,te(["request","response"],B=>o("div",{key:B},[o("p",so,c(B)+" headers",1),(B==="request"?t.entry.requestHeaders:t.entry.responseHeaders).length>0?(s(),a("div",no,[(s(!0),a(U,null,te(B==="request"?t.entry.requestHeaders:t.entry.responseHeaders,S=>(s(),a("div",{key:`${B}-${S.name}`,class:"px-2 py-1 text-xs font-mono flex gap-2"},[o("span",ao,c(S.name)+":",1),o("span",oo,c(S.value),1)]))),128))])):(s(),a("p",ro,"None recorded."))])),64)),t.entry.requestPostData?(s(),a("div",io,[x[3]||(x[3]=o("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Request body",-1)),r(m,{code:t.entry.requestPostData,lang:e(l)?"json":"text"},null,8,["code","lang"])])):i("",!0),o("div",null,[x[4]||(x[4]=o("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Response body",-1)),e(P)?(s(),v(j,{key:0,text:"Loading body…",padded:!1})):e(d)?(s(),a(U,{key:1},[e(d).status==="ok"&&e(d).kind==="image"?(s(),a("div",lo,[o("img",{src:e(d).dataUri,alt:t.entry.url,class:"max-w-full max-h-96"},null,8,co)])):e(d).status==="ok"?(s(),a("div",uo,[r(m,{code:e(d).content??"",lang:e(d).kind==="json"?"json":"text"},null,8,["code","lang"]),e(d).truncated?(s(),a("p",mo,"Preview truncated.")):i("",!0)])):(s(),a("p",fo,c(e(d).status==="too-large"?`Body too large to preview (${("formatBytes"in b?b.formatBytes:e(we))(e(d).size??0)}) — open the trace viewer to inspect it.`:e(d).status==="unsupported"?`No preview for ${e(d).mimeType||"this content type"} — open the trace viewer to inspect it.`:"Body not stored in the trace."),1))],64)):t.entry.bodySha1?i("",!0):(s(),a("p",go,"No body captured for this request."))])])):i("",!0)]),_:1},8,["open"])}}}),yo=Object.assign(po,{__name:"TraceNetworkDrawer"}),ho={class:"flex items-center justify-between gap-2 mb-2"},xo={key:0,class:"hidden sm:flex items-center gap-1.5 text-xs text-gray-400"},vo={class:"space-y-1 max-h-[28rem] overflow-y-auto"},_o=["title","onClick"],ko={class:"flex items-center gap-2 text-sm min-w-0"},bo={class:"truncate text-xs flex-1 min-w-0"},wo={key:0,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline"},$o={key:1,class:"shrink-0 text-xs text-gray-400 tabular-nums hidden sm:inline"},Co={class:"relative h-1.5 mt-1 rounded bg-gray-100 dark:bg-gray-800 overflow-hidden"},To={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},So=re({__name:"TraceNetworkList",props:{data:{},runId:{},testRunsCaseId:{}},setup(t){const _=t,h=A("all"),w=C(()=>_.data.requests??[]),$=C(()=>({total:w.value.length,failed:w.value.filter(j=>j.failed).length,duringFailure:w.value.filter(j=>j.duringFailure).length})),g=C(()=>[{label:`All (${$.value.total})`,value:"all"},{label:`Failed (${$.value.failed})`,value:"failed",disabled:$.value.failed===0},{label:`During failure (${$.value.duringFailure})`,value:"duringFailure",disabled:$.value.duringFailure===0}]),n=C(()=>h.value==="failed"?w.value.filter(j=>j.failed):h.value==="duringFailure"?w.value.filter(j=>j.duringFailure):w.value);function l(j){try{return new URL(j).pathname||j}catch{return j}}const d=C(()=>Math.max(1,_.data.timelineDuration??1));function P(j){const F=Math.max(0,Math.min(100,j.start/d.value*100)),B=Math.min(100-F,Math.max(1.5,j.duration/d.value*100));return{left:`${F}%`,width:`${B}%`}}const D=C(()=>{const j=_.data.failingWindow;if(!j||j.end<=j.start)return null;const F=Math.max(0,Math.min(100,j.start/d.value*100)),B=Math.max(.5,Math.min(100-F,(j.end-j.start)/d.value*100));return{left:`${F}%`,width:`${B}%`}});function b(j){return j.failed?"bg-red-500":j.duration>1e3?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}function x(j){return j.failed?"border-l-2 border-l-red-400 dark:border-l-red-600":j.duringFailure?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}const V=A(null),M=A(!1);function m(j){V.value=j,M.value=!0}return(j,F)=>{const B=Ge,S=pe,G=Re,q=yo;return s(),a("div",null,[o("div",ho,[r(B,{modelValue:e(h),"onUpdate:modelValue":F[0]||(F[0]=z=>ge(h)?h.value=z:null),items:e(g),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"]),t.data.failingWindow?(s(),a("span",xo,[...F[2]||(F[2]=[o("span",{class:"inline-block w-3 h-2 rounded-sm bg-red-500/10 border border-red-300 dark:border-red-800"},null,-1),f(" failing action ",-1)])])):i("",!0)]),o("div",vo,[(s(!0),a(U,null,te(e(n),z=>(s(),a("button",{key:z.index,type:"button",class:Z([x(z),"w-full rounded bg-gray-50/60 dark:bg-gray-800/40 py-1.5 px-2 text-left cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800"]),title:z.url,onClick:ne=>m(z)},[o("div",ko,[r(S,{color:("httpMethodColor"in j?j.httpMethodColor:e(Ke))(z.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:u(()=>[f(c(z.method),1)]),_:2},1032,["color"]),r(S,{color:("httpStatusColor"in j?j.httpStatusColor:e(We))(z.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums",title:z.failureText||z.statusText},{default:u(()=>[f(c(z.status>0?z.status:"—"),1)]),_:2},1032,["color","title"]),o("code",bo,c(l(z.url)),1),z.resourceType?(s(),a("span",wo,c(z.resourceType),1)):i("",!0),z.responseBodySize!=null?(s(),a("span",$o,c(("formatBytes"in j?j.formatBytes:e(we))(z.responseBodySize)),1)):i("",!0),o("span",{class:Z(["ml-1 shrink-0 text-xs tabular-nums",z.duration>1e3?"text-red-600 font-medium":z.duration>500?"text-orange-500":"text-gray-500"])},[r(G,{ms:z.duration,"unit-class":"opacity-60"},null,8,["ms"])],2)]),o("div",Co,[e(D)?(s(),a("div",{key:0,class:"absolute inset-y-0 bg-red-500/10 border-x border-red-300/60 dark:border-red-800/60",style:Ce(e(D))},null,4)):i("",!0),o("div",{class:Z(["absolute inset-y-0 rounded-full",b(z)]),style:Ce(P(z))},null,6)])],10,_o))),128))]),t.data.truncated?(s(),a("p",To," Showing the first "+c(e(w).length)+" of "+c(t.data.totalBeforeCap)+" requests recorded in the trace. ",1)):i("",!0),r(q,{open:e(M),"onUpdate:open":F[1]||(F[1]=z=>ge(M)?M.value=z:null),entry:e(V),"run-id":t.runId,"test-runs-case-id":t.testRunsCaseId},null,8,["open","entry","run-id","test-runs-case-id"])])}}}),Io=Object.assign(So,{__name:"TraceNetworkList"}),Ro={class:"flex flex-wrap items-center gap-x-3 gap-y-1"},jo={key:0,class:"flex items-center gap-2 text-xs"},Lo={key:0,class:"flex items-center gap-1 text-red-600 dark:text-red-400"},zo={key:1,class:"flex items-center gap-1 text-amber-600 dark:text-amber-400"},Mo={key:2,class:"text-xs text-gray-400 py-2"},No={key:1,class:"space-y-1 max-h-[28rem] overflow-y-auto"},Do=["disabled","onClick"],Po={key:1,class:"size-3.5 shrink-0"},Ao=["title"],Uo=["title"],Bo=["title"],Fo=["title"],Vo=["title"],Eo=["title"],Oo={key:0,class:"px-2 pt-1.5 pb-2 pl-7 space-y-1"},Ho={class:"flex items-center gap-1.5 text-[11px] uppercase tracking-wide text-gray-400"},Ko=["title"],Wo={key:0,class:"shrink-0 text-[10px] uppercase text-gray-400 font-mono hidden sm:inline"},Go={class:"relative flex-1 h-3 rounded bg-gray-100 dark:bg-gray-800 min-w-0"},Jo={key:1,class:"px-2 pb-2 pl-7 space-y-1.5"},qo={class:"flex items-start gap-2"},Qo={key:0,class:"text-gray-400 shrink-0 font-mono"},Zo={class:"font-mono break-all text-gray-700 dark:text-gray-300 flex-1 min-w-0"},Xo=["title"],Yo={key:0,class:"mt-1.5"},er=["onClick"],tr={key:0,class:"mt-1 whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-gray-500 dark:text-gray-400 max-h-48 overflow-y-auto"},sr={key:2,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},nr={key:3,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},ar=re({__name:"TestCaseNetworkRequests",props:{requests:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean}},setup(t,{expose:_}){const h=t,w=A("all"),{data:$,pending:g,load:n}=ka(()=>h.runId,()=>h.testRunsCaseId,()=>!!h.hasTrace),l=A(null),d=C({get:()=>l.value??(h.requests.length===0&&h.hasTrace?"trace":"captured"),set:y=>{l.value=y}});xe(()=>d.value==="trace",y=>{y&&n()},{immediate:!0});const P=C(()=>$.value?.status==="ok"?$.value.requests?.length??0:null),D=C(()=>[{label:`Captured (${h.requests.length})`,value:"captured",disabled:h.requests.length===0},{label:P.value!=null?`Full trace (${P.value})`:"Full trace",value:"trace"}]);function b(){h.hasTrace&&(l.value="trace")}_({showTraceMode:b});const x=A(new Set);function V(y){const T=new Set(x.value);T.has(y)?T.delete(y):T.add(y),x.value=T}const M=A(new Set);function m(y){const T=new Set(M.value);T.has(y)?T.delete(y):T.add(y),M.value=T}function j(y){if(y.length===0)return[];const T=Math.min(...y.map(K=>K.startMs)),H=Math.max(...y.map(K=>K.startMs+K.durMs)),J=Math.max(1,H-T),X=new Map(y.map(K=>[K.id,K])),Y=K=>{let Q=0,ee=K;const se=new Set;for(;ee?.parentId&&X.has(ee.parentId)&&!se.has(ee.id)&&(se.add(ee.id),ee=X.get(ee.parentId),Q++,!(Q>8)););return Q};return[...y].sort((K,Q)=>K.startMs-Q.startMs||Q.durMs-K.durMs).map(K=>({...K,offsetPct:(K.startMs-T)/J*100,widthPct:Math.max(1.5,K.durMs/J*100),depth:Y(K)}))}function F(y){return y.status==="error"?"bg-red-400 dark:bg-red-500":y.kind==="db"?"bg-violet-400 dark:bg-violet-500":y.kind==="client"?"bg-sky-400 dark:bg-sky-500":y.kind==="internal"?"bg-gray-400 dark:bg-gray-500":"bg-emerald-400 dark:bg-emerald-500"}function B(y){const T=y.toLowerCase();return T==="critical"||T==="fatal"?3:T==="error"?2:T==="warning"||T==="warn"?1:0}function S(y){const T=B(y);if(T>=2)return"error";if(T===1)return"warning";const H=y.toLowerCase();return H==="info"||H==="information"?"info":"neutral"}function G(y){try{return new URL(y).pathname||y}catch{return y}}function q(y){return(y.split("/")[1]??y).replace(/^vnd\.[^+]*\+?/,"").replace(/^x-/,"")||y}function z(y){return y?new Date(y).toLocaleString():""}const ne=C(()=>h.requests.map((y,T)=>{const H=Array.isArray(y.serverLogs)?y.serverLogs:[],J=Array.isArray(y.serverTraces)?y.serverTraces:[];let X=0,Y=0;for(const Q of H){const ee=B(Q.level);ee>=2?X++:ee===1&&Y++}const K=J.find(Q=>!Q.parentId)??J[0];return{...y,_index:T,logs:[...H].sort((Q,ee)=>Q.timestamp-ee.timestamp),spans:J,serverMs:K?K.durMs:null,errorLogCount:X,warnLogCount:Y,failed:y.status>=400,hasDetail:H.length>0||J.length>0,path:G(y.url)}})),E=C(()=>{let y=0,T=0,H=0,J=0,X=0;for(const Y of ne.value)Y.failed&&y++,Y.logs.length>0&&T++,Y.spans.length>0&&H++,J+=Y.errorLogCount,X+=Y.warnLogCount;return{total:ne.value.length,failed:y,withLogs:T,withSpans:H,errorLogs:J,warnLogs:X}}),ue=C(()=>{let y=ne.value;return w.value==="failed"?y=y.filter(T=>T.failed):w.value==="logs"&&(y=y.filter(T=>T.logs.length>0)),[...y].sort((T,H)=>{const J=X=>(X.errorLogCount>0?3:0)+(X.failed?2:0)+(X.logs.length>0?1:0);return J(H)-J(T)||T._index-H._index})}),k=C(()=>[{label:`All (${E.value.total})`,value:"all"},{label:`Failed (${E.value.failed})`,value:"failed",disabled:E.value.failed===0},{label:`With logs (${E.value.withLogs})`,value:"logs",disabled:E.value.withLogs===0}]),L=C(()=>E.value.withLogs>0);function ae(y){return y.errorLogCount>0||y.status>=500?"border-l-2 border-l-red-400 dark:border-l-red-600":y.failed||y.warnLogCount>0?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}return(y,T)=>{const H=ce,J=Ge,X=Je,Y=Io,K=pe,Q=Re,ee=kt,se=ye;return s(),v(se,{icon:"i-lucide-network",title:"Network & backend logs",count:e(d)==="trace"?e(P):e(E).total,help:"case.network"},{actions:u(()=>[o("div",Ro,[e(d)==="captured"?(s(),a(U,{key:0},[e(E).errorLogs>0||e(E).warnLogs>0?(s(),a("div",jo,[e(E).errorLogs>0?(s(),a("span",Lo,[r(H,{name:"i-lucide-octagon-alert",class:"size-3.5"}),f(c(e(E).errorLogs),1)])):i("",!0),e(E).warnLogs>0?(s(),a("span",zo,[r(H,{name:"i-lucide-triangle-alert",class:"size-3.5"}),f(c(e(E).warnLogs),1)])):i("",!0)])):i("",!0),r(J,{modelValue:e(w),"onUpdate:modelValue":T[0]||(T[0]=N=>ge(w)?w.value=N:null),items:e(k),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])],64)):i("",!0),t.hasTrace?(s(),v(J,{key:1,modelValue:e(d),"onUpdate:modelValue":T[1]||(T[1]=N=>ge(d)?d.value=N:null),items:e(D),size:"xs",variant:"pill",ui:{list:"gap-1 p-0.5",trigger:"px-2"}},null,8,["modelValue","items"])):i("",!0)])]),default:u(()=>[e(d)==="trace"?(s(),a(U,{key:0},[e(g)||!e($)?(s(),v(X,{key:0,text:"Parsing trace network stream…"})):e($).status==="ok"?(s(),v(Y,{key:1,data:e($),"run-id":t.runId??null,"test-runs-case-id":t.testRunsCaseId??0},null,8,["data","run-id","test-runs-case-id"])):(s(),a("p",Mo,"No network activity recorded in this trace."))],64)):(s(),a("div",No,[(s(!0),a(U,null,te(e(ue),N=>(s(),a("div",{key:N._index,class:Z([ae(N),"rounded bg-gray-50/60 dark:bg-gray-800/40"])},[o("button",{type:"button",class:Z(["w-full flex items-center gap-2 py-1.5 px-2 text-sm text-left",N.hasDetail?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800":"cursor-default"]),disabled:!N.hasDetail,onClick:W=>N.hasDetail&&V(N._index)},[N.hasDetail?(s(),v(H,{key:0,name:e(x).has(N._index)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0 text-gray-400"},null,8,["name"])):(s(),a("span",Po)),r(K,{color:("httpMethodColor"in y?y.httpMethodColor:e(Ke))(N.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:u(()=>[f(c(N.method),1)]),_:2},1032,["color"]),r(K,{color:("httpStatusColor"in y?y.httpStatusColor:e(We))(N.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums"},{default:u(()=>[f(c(N.status||"—"),1)]),_:2},1032,["color"]),o("code",{class:"truncate text-xs flex-1 min-w-0",title:N.url},c(N.path),9,Ao),N.contentType?(s(),a("span",{key:2,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline",title:`Response content type: ${N.contentType}`},c(q(N.contentType)),9,Uo)):i("",!0),N.errorLogCount>0?(s(),a("span",{key:3,class:"shrink-0 inline-flex items-center gap-1 text-xs text-red-600 dark:text-red-400",title:`${N.errorLogCount} backend error log(s)`},[r(H,{name:"i-lucide-octagon-alert",class:"size-3.5"}),f(c(N.errorLogCount),1)],8,Bo)):i("",!0),N.warnLogCount>0?(s(),a("span",{key:4,class:"shrink-0 inline-flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",title:`${N.warnLogCount} backend warning log(s)`},[r(H,{name:"i-lucide-triangle-alert",class:"size-3.5"}),f(c(N.warnLogCount),1)],8,Fo)):i("",!0),N.serverMs!=null?(s(),a("span",{key:5,class:"shrink-0 inline-flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400 tabular-nums",title:`Server-side processing time (${N.spans.length} span${N.spans.length===1?"":"s"})`},[r(H,{name:"i-lucide-server",class:"size-3.5"}),r(Q,{ms:N.serverMs,"no-title":""},null,8,["ms"])],8,Vo)):i("",!0),N.startTime?(s(),a("span",{key:6,class:"shrink-0 text-xs text-gray-400 hidden sm:inline",title:z(N.startTime)},c(("formatRelativeTime"in y?y.formatRelativeTime:e(Se))(N.startTime)),9,Eo)):i("",!0),o("span",{class:Z(["ml-1 shrink-0 text-xs tabular-nums",(N.duration??0)>1e3?"text-red-600 font-medium":(N.duration??0)>500?"text-orange-500":"text-gray-500"])},[r(Q,{ms:N.duration,"unit-class":"opacity-60"},null,8,["ms"])],2)],10,Do),N.spans.length>0&&e(x).has(N._index)?(s(),a("div",Oo,[o("div",Ho,[r(H,{name:"i-lucide-waypoints",class:"size-3.5"}),T[2]||(T[2]=f("Server trace ",-1))]),(s(!0),a(U,null,te(j(N.spans),W=>(s(),a("div",{key:W.id,class:"flex items-center gap-2 text-xs",title:W.status==="error"?`${W.name} (error)`:W.name},[o("div",{class:"w-40 sm:w-56 shrink-0 flex items-center gap-1 min-w-0",style:Ce({paddingLeft:`${W.depth*12}px`})},[W.kind?(s(),a("span",Wo,c(W.kind),1)):i("",!0),o("span",{class:Z(["truncate font-mono",W.status==="error"?"text-red-600 dark:text-red-400":"text-gray-600 dark:text-gray-300"])},c(W.name),3)],4),o("div",Go,[o("div",{class:Z(["absolute top-0 h-3 rounded",F(W)]),style:Ce({left:`${W.offsetPct}%`,width:`${W.widthPct}%`})},null,6)]),r(Q,{ms:W.durMs,class:"w-12 shrink-0 text-right text-gray-500"},null,8,["ms"])],8,Ko))),128))])):i("",!0),N.logs.length>0&&e(x).has(N._index)?(s(),a("div",Jo,[(s(!0),a(U,null,te(N.logs,(W,ve)=>(s(),a("div",{key:ve,class:"rounded border border-default bg-white dark:bg-gray-900/60 p-2 text-xs"},[o("div",qo,[r(K,{color:S(W.level),variant:"soft",size:"xs",class:"shrink-0 capitalize"},{default:u(()=>[f(c(W.level),1)]),_:2},1032,["color"]),W.category?(s(),a("span",Qo,"["+c(W.category)+"]",1)):i("",!0),o("span",Zo,c(W.message),1),W.timestamp?(s(),a("span",{key:1,class:"shrink-0 text-gray-400 tabular-nums",title:z(W.timestamp)},c(("formatRelativeTime"in y?y.formatRelativeTime:e(Se))(W.timestamp)),9,Xo)):i("",!0)]),W.stack?(s(),a("div",Yo,[o("button",{type:"button",class:"inline-flex items-center gap-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",onClick:Ae=>m(`${N._index}:${ve}`)},[r(H,{name:e(M).has(`${N._index}:${ve}`)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3"},null,8,["name"]),T[3]||(T[3]=f(" Stack trace ",-1))],8,er),e(M).has(`${N._index}:${ve}`)?(s(),a("pre",tr,c(W.stack),1)):i("",!0)])):i("",!0)]))),128))])):i("",!0)],2))),128))])),e(d)==="captured"&&!e(L)?(s(),a("p",sr,[r(H,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),T[5]||(T[5]=f(" No backend server logs captured — install ",-1)),r(ee,{to:"backend-logs","no-icon":"",class:"underline"},{default:u(()=>[...T[4]||(T[4]=[f("a Piwi backend integration",-1)])]),_:1}),T[6]||(T[6]=f(" to see server-side warnings and errors under each request. ",-1))])):i("",!0),t.hasTrace?i("",!0):(s(),a("p",nr,[r(H,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),o("span",null,[T[8]||(T[8]=f(" Want to go deeper? Record traces (",-1)),T[9]||(T[9]=o("code",null,"trace: 'retain-on-failure'",-1)),T[10]||(T[10]=f(") to see every request with headers, timing and bodies here. ",-1)),r(ee,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:u(()=>[...T[7]||(T[7]=[f("Learn more",-1)])]),_:1})])]))]),_:1},8,["count"])}}}),or=Object.assign(ar,{__name:"TestCaseNetworkRequests"}),rr={class:"space-y-2"},ir=re({__name:"TestCaseTracesCard",props:{traces:{}},setup(t){return(_,h)=>{const w=ps,$=ye;return t.traces.length>0?(s(),v($,{key:0,icon:"i-lucide-bug-play",title:"Traces",count:t.traces.length,help:"case.traces"},{default:u(()=>[o("div",rr,[(s(!0),a(U,null,te(t.traces,g=>(s(),v(w,{key:g.id,trace:g,class:"py-2 px-3 rounded-lg border"},null,8,["trace"]))),128))])]),_:1},8,["count"])):i("",!0)}}}),lr=Object.assign(ir,{__name:"TestCaseTracesCard"}),cr={class:"space-y-3"},ur={class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-800/50 border-b"},dr={class:"flex items-center gap-2 min-w-0"},mr={class:"text-sm font-medium truncate"},fr={key:0,class:"text-xs text-gray-400 shrink-0"},gr={class:"text-xs text-gray-400"},pr={class:"flex items-center gap-1 shrink-0"},yr=["href"],hr={key:0,class:"bg-gray-100 dark:bg-gray-900"},xr=["src","alt","onClick"],vr={key:1,class:"bg-black"},_r={key:2,class:"bg-gray-50 dark:bg-gray-900"},kr={key:0,class:"flex items-center justify-center py-8"},br={key:1,class:"p-4 text-red-500 text-sm"},wr={key:2,class:"p-4 overflow-auto max-h-96"},$r={class:"text-sm whitespace-pre-wrap font-sans leading-relaxed"},Cr=re({__name:"TestCaseAttachmentsCard",props:{attachments:{}},setup(t){const _=t,h=Oe(),w=A(null),$=C(()=>_.attachments.filter(S=>Te(S.path,S.contentType)).map(S=>({src:D(S.path,S.contentType),name:S.name||b(S.path)})));function g(S){w.value=S}const n=new Set([".md",".mdx",".markdown"]),l=new Set(["text/markdown","text/x-markdown"]);function d(S){return S.toLowerCase().split(".").pop()||""}function P(S,G){return!!(n.has(d(S))||G&&l.has(G.toLowerCase()))}function D(S,G){return wt(S,G,h.app?.baseURL)}function b(S){return S.split("/").pop()||S}function x(S){return S==null?"":we(S)}const V=A({}),M=A({}),m=A({}),j=A(new Set);async function F(S){if(V.value[S.id]===void 0&&!m.value[S.id]){m.value[S.id]=!0,M.value[S.id]=null;try{const G=await $fetch(D(S.path,S.contentType),{responseType:"text"});V.value[S.id]=G}catch{M.value[S.id]="Failed to load preview"}finally{m.value[S.id]=!1}}}function B(S,G){const q=new Set(j.value);q.has(S)?q.delete(S):(q.add(S),F(G)),j.value=q}return(S,G)=>{const q=ce,z=Ie,ne=ys,E=hs,ue=ye;return t.attachments.length>0?(s(),v(ue,{key:0,icon:"i-lucide-paperclip",title:"Attachments",count:t.attachments.length},{default:u(()=>[o("div",cr,[(s(!0),a(U,null,te(t.attachments,k=>(s(),a("div",{key:k.id,class:"rounded-lg border overflow-hidden"},[o("div",ur,[o("div",dr,[r(q,{name:e(Te)(k.path,k.contentType)?"i-lucide-image":e(De)(k.path,k.contentType)?"i-lucide-video":P(k.path,k.contentType)?"i-lucide-file-text":"i-lucide-file",class:"size-4 text-gray-400 shrink-0"},null,8,["name"]),o("span",mr,c(b(k.path)),1),k.name&&k.name!==b(k.path)?(s(),a("span",fr,c(k.name),1)):i("",!0),o("span",gr,c(x(k.size)),1)]),o("div",pr,[P(k.path,k.contentType)?(s(),v(z,{key:0,size:"xs",color:"neutral",variant:"soft",onClick:L=>B(k.id,k)},{default:u(()=>[f(c(e(j).has(k.id)?"Hide preview":"Preview"),1)]),_:2},1032,["onClick"])):i("",!0),o("a",{href:D(k.path,k.contentType),target:"_blank",class:"text-primary hover:underline text-xs shrink-0"},"Open",8,yr)])]),e(Te)(k.path,k.contentType)?(s(),a("div",hr,[o("img",{src:D(k.path,k.contentType),alt:k.name||"Screenshot",class:"max-w-full max-h-96 object-contain mx-auto cursor-pointer hover:opacity-90 transition-opacity",loading:"lazy",onClick:L=>g(e($).findIndex(ae=>ae.src===D(k.path,k.contentType)))},null,8,xr)])):e(De)(k.path,k.contentType)?(s(),a("div",vr,[r(ne,{src:D(k.path,k.contentType)},null,8,["src"])])):P(k.path,k.contentType)&&e(j).has(k.id)?(s(),a("div",_r,[e(m)[k.id]?(s(),a("div",kr,[r(q,{name:"i-lucide-loader-circle",class:"size-5 animate-spin text-gray-400"})])):e(M)[k.id]?(s(),a("div",br,c(e(M)[k.id]),1)):e(V)[k.id]?(s(),a("div",wr,[o("pre",$r,c(e(V)[k.id]),1)])):i("",!0)])):i("",!0)]))),128))]),r(E,{modelValue:e(w),"onUpdate:modelValue":G[0]||(G[0]=k=>ge(w)?w.value=k:null),images:e($)},null,8,["modelValue","images"])]),_:1},8,["count"])):i("",!0)}}}),Tr=Object.assign(Cr,{__name:"TestCaseAttachmentsCard"});function Sr(t){return Array.isArray(t)?t.some(_=>_&&typeof _.type=="string"&&_.type.toLowerCase()==="slow"):!1}function Ir(t){const _=[];if(!t)return _;const h=t.steps||[],$=h.filter(n=>n.category==="navigation").filter(n=>n.duration>3e3);if($.length>0){const n=$.sort((l,d)=>d.duration-l.duration)[0];_.push({type:"warning",message:"Slow navigation detected",details:`"${n.title}" took ${(n.duration/1e3).toFixed(1)}s. The tested page may have performance issues (slow server response, heavy JS bundles, etc.).`})}h.length>20&&_.push({type:"info",message:"Many sequential actions",details:`This test has ${h.length} steps. Consider splitting it into smaller, focused tests for better isolation and faster feedback.`}),t.status==="passed"&&(t.retries||0)>0&&_.push({type:"warning",message:"Flaky test — passed after retries",details:`This test needed ${t.retries} ${t.retries===1?"retry":"retries"} to pass. Consider reviewing locator strategies, adding explicit waits, or checking for race conditions.`});const g=h.filter(n=>n.category==="assertion"&&n.duration>2e3);if(g.length>0){const n=g.sort((l,d)=>d.duration-l.duration)[0];_.push({type:"info",message:"Slow assertions detected",details:`"${n.title}" took ${(n.duration/1e3).toFixed(1)}s. The UI may be slow to render or the assertion timeout may need tuning.`})}return Sr(t.testAnnotations)&&typeof t.duration=="number"&&t.duration<1e4&&_.push({type:"info",message:"test.slow() may be unnecessary",details:`This run finished in ${(t.duration/1e3).toFixed(1)}s, yet the test is marked test.slow(), which triples its timeout budget. If it is consistently this fast, removing test.slow() lets a failure surface sooner.`}),typeof t.timeout=="number"&&t.timeout>0&&typeof t.duration=="number"&&t.duration>0&&t.timeout>=4*t.duration&&t.timeout-t.duration>=3e4&&_.push({type:"info",message:"Oversized timeout",details:`The timeout is ${(t.timeout/1e3).toFixed(0)}s but this run took ${(t.duration/1e3).toFixed(1)}s. A large timeout means a hang or failure waits far longer than necessary — consider lowering it toward the test's real duration.`}),_}function Rr(t,_){const h=t.search(/\n at /);if(h===-1)return _!==void 0&&t.length>_?t.slice(0,_)+`
3
+ ${k}`:k,M.value=!0}async function J(k=!1){g.value=!0;try{const L=k?`/api/test-run-cases/${_.testRunsCaseId}/diagnose?force=true`:`/api/test-run-cases/${_.testRunsCaseId}/diagnose`,ae=m.value.trim()?{additionalContext:m.value.trim()}:void 0;$.value=await $fetch(L,{method:"POST",body:ae})}catch(L){const ae=L?.statusCode;ae===409?(w.add({title:"Diagnosis already running",color:"warning"}),F()):ae===503?w.add({title:"AI diagnosis is not configured",color:"warning"}):w.add({title:"Diagnosis failed",description:Ws(L),color:"error"})}finally{g.value=!1}}function z(k){return k.status==="running"&&Date.now()-new Date(k.updatedAt).getTime()>300*1e3}const ne=C(()=>$.value&&($.value.status==="completed"||$.value.status==="failed")),E=C(()=>!$.value||$.value.status==="failed"||$.value.status==="running"&&z($.value)),ue=C(()=>$.value?.status==="running"&&!z($.value)&&!g.value);return(k,L)=>{const ae=Vs,y=ce,T=Us,H=Js,q=Ie,X=Bs,Y=_t,K=Fs,Q=Pe,ee=ye;return s(),v(ee,{icon:"i-lucide-sparkles","icon-class":"text-primary",title:"AI diagnosis",help:"case.ai"},{actions:u(()=>[r(ae,{"context-endpoint":`/api/test-run-cases/${t.testRunsCaseId}/diagnosis-context`},null,8,["context-endpoint"])]),default:u(()=>[o("div",ca,[o("p",ua,[r(y,{name:"i-lucide-triangle-alert",class:"size-3 shrink-0"}),L[6]||(L[6]=f(" AI-generated — verify before applying. ",-1))]),e(h)?.configured?(s(),v(T,{key:0,sections:e(l),"not-applicable":e(D)?.notApplicable,"token-estimate":e(d),loading:e(b),onViewSection:S,onOpen:L[0]||(L[0]=se=>x.value=!0)},null,8,["sections","not-applicable","token-estimate","loading"])):i("",!0),e(h)?.configured?(s(),a(U,{key:1},[o("div",null,[o("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onClick:L[1]||(L[1]=se=>M.value=!e(M))},[r(y,{name:e(M)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),L[7]||(L[7]=f(" Additional context ",-1)),e(m).trim()?(s(),a("span",da,"(1)")):i("",!0)]),e(M)?(s(),v(H,{key:0,modelValue:e(m),"onUpdate:modelValue":L[2]||(L[2]=se=>ge(m)?m.value=se:null),placeholder:"e.g. We deployed a new auth middleware yesterday…",rows:3,class:"w-full text-sm mt-1"},null,8,["modelValue"])):i("",!0)]),e(ue)?(s(),a("div",ma,[o("span",fa,[r(y,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-primary shrink-0"}),L[8]||(L[8]=f(" Diagnosis in progress… ",-1))]),r(q,{size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-refresh-cw",loading:e(g),onClick:F},{default:u(()=>[...L[9]||(L[9]=[f(" Refresh ",-1)])]),_:1},8,["loading"])])):(s(),a("div",ga,[e(E)?(s(),v(q,{key:0,icon:"i-lucide-sparkles",size:"sm",color:"primary",variant:"solid",loading:e(g),onClick:L[3]||(L[3]=se=>J(e($)?.status==="running"))},{default:u(()=>[f(c(e($)?.status==="running"?"Restart diagnosis":"Diagnose with AI"),1)]),_:1},8,["loading"])):e($)?.status==="completed"?(s(),v(q,{key:1,icon:"i-lucide-refresh-cw",size:"xs",color:"primary",variant:"soft",loading:e(g),onClick:L[4]||(L[4]=se=>J(!0))},{default:u(()=>[...L[10]||(L[10]=[f(" Re-diagnose ",-1)])]),_:1},8,["loading"])):i("",!0)])),e(ne)?(s(),v(X,{key:2,diagnosis:e($),onViewSection:S,onPrefillContext:G},null,8,["diagnosis"])):i("",!0)],64)):(s(),a("div",pa,[o("p",ya,[L[11]||(L[11]=f(" AI diagnosis is not configured ",-1)),r(Y,{topic:"cluster.ai-setup"})]),L[13]||(L[13]=o("p",{class:"text-xs mt-2 max-w-xs mx-auto"},[f(" Use "),o("strong",null,"Export → AI context"),f(" in the header to grab the full evidence bundle for your own AI tool, or configure a provider. ")],-1)),r(q,{to:"/settings/ai",size:"xs",color:"neutral",variant:"outline",class:"mt-3"},{default:u(()=>[...L[12]||(L[12]=[f(" Configure in Settings ",-1)])]),_:1})])),r(K,{open:e(x),sections:e(l),"token-estimate":e(d),"image-token-estimate":e(P),loading:e(b),"focus-section":e(V),"cited-sections":e(B),"not-applicable-sections":e(D)?.notApplicable,"onUpdate:open":L[5]||(L[5]=se=>{x.value=se,se||(V.value=null)}),onRefresh:j},null,8,["open","sections","token-estimate","image-token-estimate","loading","focus-section","cited-sections","not-applicable-sections"]),o("div",ha,[r(Q,{to:"/mcp",class:"inline-flex items-center gap-1 text-xs text-gray-400 hover:text-primary transition-colors"},{default:u(()=>[r(y,{name:"i-lucide-bot",class:"size-3"}),L[14]||(L[14]=f(" Query this failure from your AI agent via MCP ",-1))]),_:1})])])]),_:1})}}}),va=Object.assign(xa,{__name:"TestCaseAiCard"});function Tt(t,_,h){const w=A(null),$=A(!1),g=A(!1);async function n(){const l=t();if(!(!l||!$e(_)||$.value)){g.value=!0,$.value=!0;try{w.value=await $fetch(l)}catch{w.value=null}finally{$.value=!1}}}return yt(()=>{xe(()=>$e(_),l=>{l&&(h||g.value)&&!w.value&&n()},{immediate:!0})}),{data:w,pending:$,load:n}}function _a(t,_,h,w={}){return Tt(()=>{const $=$e(t),g=$e(_);return $&&g?`/api/test-runs/${$}/cases/${g}/trace-stacks`:null},h,w.auto??!0)}function ka(t,_,h,w={}){return Tt(()=>{const $=$e(t),g=$e(_);return $&&g?`/api/test-runs/${$}/cases/${g}/trace-network`:null},h,w.auto??!1)}const ba={class:"max-h-[32rem] overflow-y-auto"},wa={key:0,class:"mb-2 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},$a={key:0,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},Ca=re({__name:"TestSourceCard",props:{frames:{},testSource:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean},projectKey:{},projectName:{},storageKey:{}},setup(t,{expose:_}){const h=t,{data:w,pending:$}=_a(()=>h.runId,()=>h.testRunsCaseId,()=>h.hasTrace,{auto:!0}),g=C(()=>w.value?.status==="ok"?w.value.frames??[]:[]),n=C(()=>g.value.length>0),l=C(()=>h.frames?.length??0),d=C(()=>l.value>0||!!h.testSource),P=A(null),D=C({get:()=>P.value??(n.value?"trace":"captured"),set:M=>{P.value=M}}),b=C(()=>[{label:`Full stack (${g.value.length})`,value:"trace"},{label:`Captured (${l.value||1})`,value:"captured"}]),x=C(()=>D.value==="trace"&&n.value?g.value.length:l.value||null),V=A(null);return _({reveal:()=>V.value?.reveal()}),(M,m)=>{const j=Ge,F=ce,B=cs,S=us,G=bt,J=qe,z=kt,ne=He;return s(),v(ne,{ref_key:"card",ref:V,"storage-key":t.storageKey,icon:"i-lucide-code",count:e(x),title:"Test source",help:"case.test-source"},ns({folded:u(()=>[e(D)==="trace"&&e(n)?(s(),a(U,{key:0},[f(" Full call stack from the trace"+c(e(w)?.hasSources===!1?" (recorded without sources)":""),1)],64)):e(l)>1?(s(),a(U,{key:1},[f(" The failing line and "+c(e(l)-1)+" caller"+c(e(l)-1===1?"":"s"),1)],64)):(s(),a(U,{key:2},[f("Source around the failing assertion")],64))]),default:u(()=>[o("div",ba,[e(D)==="trace"&&e(n)?(s(),a(U,{key:0},[e(w)?.hasSources===!1?(s(),a("p",wa,[r(F,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),m[1]||(m[1]=f(" Trace recorded without sources — frame list only. ",-1))])):i("",!0),r(B,{frames:e(g),"project-key":t.projectKey,"project-name":t.projectName},null,8,["frames","project-key","project-name"])],64)):(s(),a(U,{key:1},[t.frames?.length?(s(),v(S,{key:0,frames:t.frames,"project-key":t.projectKey,"project-name":t.projectName},null,8,["frames","project-key","project-name"])):t.testSource?(s(),v(G,{key:1,text:"```typescript\n"+t.testSource+"\n```"},null,8,["text"])):t.hasTrace&&e($)?(s(),v(J,{key:2,text:"Loading call stack from trace…"})):i("",!0)],64))]),t.hasTrace?i("",!0):(s(),a("p",$a,[r(F,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),o("span",null,[m[3]||(m[3]=f(" Want to go deeper? Record traces (",-1)),m[4]||(m[4]=o("code",null,"trace: 'retain-on-failure'",-1)),m[5]||(m[5]=f(") to see the full call stack with source here. ",-1)),r(z,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:u(()=>[...m[2]||(m[2]=[f("Learn more",-1)])]),_:1})])]))]),_:2},[e(n)&&e(d)?{name:"actions",fn:u(()=>[r(j,{modelValue:e(D),"onUpdate:modelValue":m[0]||(m[0]=E=>ge(D)?D.value=E:null),items:e(b),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])]),key:"0"}:void 0]),1032,["storage-key","count"])}}}),Ta=Object.assign(Ca,{__name:"TestSourceCard"}),Sa={class:"space-y-3"},Ia={class:"divide-y divide-default"},Ra={class:"flex items-center gap-2 min-w-0"},ja={class:"text-sm truncate"},La={key:0,class:"text-xs text-gray-400 shrink-0"},za=re({__name:"TestCaseEvidenceCard",props:{attachments:{},traces:{},storageKey:{}},setup(t,{expose:_}){const h=t,w=Oe(),$=C(()=>h.attachments.filter(x=>Te(x.path,x.contentType)).length),g=C(()=>h.attachments.filter(x=>De(x.path,x.contentType)).length),n=C(()=>h.attachments.filter(x=>!Te(x.path,x.contentType)&&!De(x.path,x.contentType))),l=C(()=>$.value+g.value+h.traces.length+n.value.length),d=C(()=>{const x=[];return $.value&&x.push(`${$.value} screenshot${$.value===1?"":"s"}`),g.value&&x.push(`${g.value} video${g.value===1?"":"s"}`),h.traces.length&&x.push(`${h.traces.length} trace${h.traces.length===1?"":"s"}`),n.value.length&&x.push(`${n.value.length} file${n.value.length===1?"":"s"}`),x.join(" · ")||"No evidence captured"});function P(x,V){return wt(x,V,w.app?.baseURL)}function D(x){return x.split("/").pop()||x}const b=A(null);return _({reveal:()=>b.value?.reveal?.()}),(x,V)=>{const M=ds,m=ms,j=fs,F=ce,B=Ie,S=gs,G=Ct,J=He;return s(),v(J,{ref_key:"card",ref:b,"storage-key":t.storageKey,icon:"i-lucide-camera",title:"Failure evidence",count:e(l),help:"case.evidence"},{folded:u(()=>[f(c(e(d)),1)]),default:u(()=>[o("div",Sa,[r(M,{attachments:t.attachments},null,8,["attachments"]),r(m,{attachments:t.attachments},null,8,["attachments"]),r(j,{traces:t.traces},null,8,["traces"]),e(n).length?(s(),v(S,{key:0,icon:"i-lucide-paperclip",label:"Attachments",count:e(n).length,collapsible:!1},{default:u(()=>[o("div",Ia,[(s(!0),a(U,null,te(e(n),z=>(s(),a("div",{key:z.id,class:"flex items-center justify-between gap-2 px-3 py-2"},[o("div",Ra,[r(F,{name:"i-lucide-file",class:"size-4 text-gray-400 shrink-0"}),o("span",ja,c(D(z.path)),1),z.size?(s(),a("span",La,c(("formatBytes"in x?x.formatBytes:e(we))(z.size)),1)):i("",!0)]),r(B,{to:P(z.path,z.contentType),target:"_blank",icon:"i-lucide-external-link",size:"xs",color:"neutral",variant:"soft",label:"Open"},null,8,["to"])]))),128))])]),_:1},8,["count"])):i("",!0),e(l)===0?(s(),v(G,{key:1,icon:"i-lucide-camera-off",title:"No screenshots, video or traces captured",text:"Evidence comes from Playwright's own capture settings — set trace, screenshot and video in your config (trace: 'retain-on-failure' is the usual starting point).",doc:"reporter"})):i("",!0)])]),_:1},8,["storage-key","count"])}}}),Ma=Object.assign(za,{__name:"TestCaseEvidenceCard"}),Na={class:"space-y-1 max-h-80 overflow-y-auto"},Da={class:"min-w-0 flex-1"},Pa={class:"flex items-center gap-2"},Aa={class:"truncate"},Ua={key:0,class:"text-xs text-gray-400 mt-0.5 ml-0"},Ba=re({__name:"TestCaseConsoleCard",props:{entries:{}},setup(t){function _(w){switch(w){case"error":return"error";case"warning":return"warning";case"assert":return"error";default:return"neutral"}}function h(w){switch(w){case"error":return"i-lucide-octagon-x";case"warning":return"i-lucide-alert-triangle";case"assert":return"i-lucide-octagon-x";default:return"i-lucide-message-square"}}return(w,$)=>{const g=ce,n=pe,l=ye;return t.entries.length>0?(s(),v(l,{key:0,icon:"i-lucide-terminal",title:"Console output",count:t.entries.length,help:"case.console"},{default:u(()=>[o("div",Na,[(s(!0),a(U,null,te(t.entries,(d,P)=>(s(),a("div",{key:P,class:"flex items-start gap-2 py-1.5 px-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800 text-sm"},[r(g,{name:h(d.type),class:Z([d.type==="error"||d.type==="assert"?"text-red-500":d.type==="warning"?"text-amber-500":"text-gray-400","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),o("div",Da,[o("div",Pa,[r(n,{color:_(d.type),variant:"soft",size:"xs",class:"shrink-0"},{default:u(()=>[f(c(d.type),1)]),_:2},1032,["color"]),o("span",Aa,c(d.text),1)]),d.location?(s(),a("div",Ua,c(d.location),1)):i("",!0)])]))),128))])]),_:1},8,["count"])):i("",!0)}}}),Fa=Object.assign(Ba,{__name:"TestCaseConsoleCard"}),Va={key:0,class:"space-y-4 text-sm"},Ea={class:"space-y-1.5"},Oa={class:"flex items-center gap-2"},Ha={key:0,class:"text-xs text-gray-500"},Ka={class:"block text-xs break-all text-gray-700 dark:text-gray-300"},Wa={key:0,class:"text-xs text-red-600 dark:text-red-400 font-mono"},Ga={class:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-400"},qa={key:0,class:"font-mono"},Ja={key:1,class:"font-mono"},Qa={key:2},Za={key:3,title:"Bytes on the wire"},Xa={key:0},Ya={class:"flex h-2 rounded overflow-hidden bg-gray-100 dark:bg-gray-800"},eo=["title"],to={class:"flex flex-wrap gap-x-3 gap-y-1 mt-1.5 text-xs text-gray-500"},so={class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5 capitalize"},no={key:0,class:"rounded border border-default divide-y divide-default max-h-48 overflow-y-auto"},ao={class:"text-gray-500 dark:text-gray-400 shrink-0"},oo={class:"break-all text-gray-700 dark:text-gray-300"},ro={key:1,class:"text-xs text-gray-400"},io={key:1},lo={key:0,class:"rounded border border-default p-2"},co=["src","alt"],uo={key:1,class:"max-h-96 overflow-y-auto"},mo={key:0,class:"mt-1 text-xs text-gray-400"},fo={key:2,class:"text-xs text-gray-400"},go={key:2,class:"text-xs text-gray-400"},po=re({__name:"TraceNetworkDrawer",props:{open:{type:Boolean},entry:{},runId:{},testRunsCaseId:{}},emits:["update:open"],setup(t,{emit:_}){const h=t,w=_,$=[{key:"dns",label:"DNS",color:"bg-sky-400"},{key:"connect",label:"Connect",color:"bg-violet-400"},{key:"ssl",label:"TLS",color:"bg-rose-400"},{key:"send",label:"Send",color:"bg-amber-400"},{key:"wait",label:"Wait",color:"bg-blue-400"},{key:"receive",label:"Receive",color:"bg-emerald-400"}],g=C(()=>{const b=h.entry?.timings;return b?$.map(x=>({...x,value:b[x.key]??-1})).filter(x=>typeof x.value=="number"&&x.value>=0):[]}),n=C(()=>g.value.reduce((b,x)=>b+x.value,0)),l=C(()=>{const b=h.entry?.requestPostData??"";return b.startsWith("{")||b.startsWith("[")}),d=A(null),P=A(!1),D=new Map;return xe(()=>[h.open,h.entry?.bodySha1],async([b,x])=>{if(d.value=null,!b||!x||!h.runId)return;const V=D.get(x);if(V){d.value=V;return}P.value=!0;try{const M=await $fetch(`/api/test-runs/${h.runId}/cases/${h.testRunsCaseId}/trace-network-body`,{query:{sha1:x}});D.set(x,M),d.value=M}catch{d.value={status:"not-found"}}finally{P.value=!1}},{immediate:!0}),(b,x)=>{const V=pe,M=Re,m=Zs,j=qe,F=Xs;return s(),v(F,{open:t.open,title:"Request detail",ui:{content:"max-w-xl"},"onUpdate:open":x[0]||(x[0]=B=>w("update:open",B))},{body:u(()=>[t.entry?(s(),a("div",Va,[o("div",Ea,[o("div",Oa,[r(V,{color:("httpMethodColor"in b?b.httpMethodColor:e(Ke))(t.entry.method),variant:"soft",size:"sm",class:"font-mono shrink-0"},{default:u(()=>[f(c(t.entry.method),1)]),_:1},8,["color"]),r(V,{color:("httpStatusColor"in b?b.httpStatusColor:e(We))(t.entry.status),variant:"soft",size:"sm",class:"font-mono shrink-0 tabular-nums"},{default:u(()=>[f(c(t.entry.status>0?t.entry.status:"—"),1)]),_:1},8,["color"]),t.entry.statusText?(s(),a("span",Ha,c(t.entry.statusText),1)):i("",!0)]),o("code",Ka,c(t.entry.url),1),t.entry.failureText?(s(),a("p",Wa,c(t.entry.failureText),1)):i("",!0),o("div",Ga,[t.entry.resourceType?(s(),a("span",qa,c(t.entry.resourceType),1)):i("",!0),t.entry.mimeType?(s(),a("span",Ja,c(t.entry.mimeType),1)):i("",!0),t.entry.responseBodySize!=null?(s(),a("span",Qa,c(("formatBytes"in b?b.formatBytes:e(we))(t.entry.responseBodySize)),1)):i("",!0),t.entry.transferSize!=null?(s(),a("span",Za,c(("formatBytes"in b?b.formatBytes:e(we))(t.entry.transferSize))+" transferred",1)):i("",!0),r(M,{ms:t.entry.duration},null,8,["ms"]),t.entry.duringFailure?(s(),v(V,{key:4,color:"error",variant:"subtle",size:"xs"},{default:u(()=>[...x[1]||(x[1]=[f("During failing action",-1)])]),_:1})):i("",!0)])]),e(g).length>0&&e(n)>0?(s(),a("div",Xa,[x[2]||(x[2]=o("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Timing",-1)),o("div",Ya,[(s(!0),a(U,null,te(e(g),B=>(s(),a("div",{key:B.key,class:Z(B.color),style:Ce({width:`${Math.max(.5,B.value/e(n)*100)}%`}),title:`${B.label}: ${("formatDuration"in b?b.formatDuration:e(Gs))(B.value)}`},null,14,eo))),128))]),o("div",to,[(s(!0),a(U,null,te(e(g),B=>(s(),a("span",{key:B.key,class:"inline-flex items-center gap-1"},[o("span",{class:Z(["size-2 rounded-full",B.color])},null,2),f(" "+c(B.label)+" ",1),r(M,{ms:B.value,"no-title":""},null,8,["ms"])]))),128))])])):i("",!0),(s(),a(U,null,te(["request","response"],B=>o("div",{key:B},[o("p",so,c(B)+" headers",1),(B==="request"?t.entry.requestHeaders:t.entry.responseHeaders).length>0?(s(),a("div",no,[(s(!0),a(U,null,te(B==="request"?t.entry.requestHeaders:t.entry.responseHeaders,S=>(s(),a("div",{key:`${B}-${S.name}`,class:"px-2 py-1 text-xs font-mono flex gap-2"},[o("span",ao,c(S.name)+":",1),o("span",oo,c(S.value),1)]))),128))])):(s(),a("p",ro,"None recorded."))])),64)),t.entry.requestPostData?(s(),a("div",io,[x[3]||(x[3]=o("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Request body",-1)),r(m,{code:t.entry.requestPostData,lang:e(l)?"json":"text"},null,8,["code","lang"])])):i("",!0),o("div",null,[x[4]||(x[4]=o("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Response body",-1)),e(P)?(s(),v(j,{key:0,text:"Loading body…",padded:!1})):e(d)?(s(),a(U,{key:1},[e(d).status==="ok"&&e(d).kind==="image"?(s(),a("div",lo,[o("img",{src:e(d).dataUri,alt:t.entry.url,class:"max-w-full max-h-96"},null,8,co)])):e(d).status==="ok"?(s(),a("div",uo,[r(m,{code:e(d).content??"",lang:e(d).kind==="json"?"json":"text"},null,8,["code","lang"]),e(d).truncated?(s(),a("p",mo,"Preview truncated.")):i("",!0)])):(s(),a("p",fo,c(e(d).status==="too-large"?`Body too large to preview (${("formatBytes"in b?b.formatBytes:e(we))(e(d).size??0)}) — open the trace viewer to inspect it.`:e(d).status==="unsupported"?`No preview for ${e(d).mimeType||"this content type"} — open the trace viewer to inspect it.`:"Body not stored in the trace."),1))],64)):t.entry.bodySha1?i("",!0):(s(),a("p",go,"No body captured for this request."))])])):i("",!0)]),_:1},8,["open"])}}}),yo=Object.assign(po,{__name:"TraceNetworkDrawer"}),ho={class:"flex items-center justify-between gap-2 mb-2"},xo={key:0,class:"hidden sm:flex items-center gap-1.5 text-xs text-gray-400"},vo={class:"space-y-1 max-h-[28rem] overflow-y-auto"},_o=["title","onClick"],ko={class:"flex items-center gap-2 text-sm min-w-0"},bo={class:"truncate text-xs flex-1 min-w-0"},wo={key:0,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline"},$o={key:1,class:"shrink-0 text-xs text-gray-400 tabular-nums hidden sm:inline"},Co={class:"relative h-1.5 mt-1 rounded bg-gray-100 dark:bg-gray-800 overflow-hidden"},To={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},So=re({__name:"TraceNetworkList",props:{data:{},runId:{},testRunsCaseId:{}},setup(t){const _=t,h=A("all"),w=C(()=>_.data.requests??[]),$=C(()=>({total:w.value.length,failed:w.value.filter(j=>j.failed).length,duringFailure:w.value.filter(j=>j.duringFailure).length})),g=C(()=>[{label:`All (${$.value.total})`,value:"all"},{label:`Failed (${$.value.failed})`,value:"failed",disabled:$.value.failed===0},{label:`During failure (${$.value.duringFailure})`,value:"duringFailure",disabled:$.value.duringFailure===0}]),n=C(()=>h.value==="failed"?w.value.filter(j=>j.failed):h.value==="duringFailure"?w.value.filter(j=>j.duringFailure):w.value);function l(j){try{return new URL(j).pathname||j}catch{return j}}const d=C(()=>Math.max(1,_.data.timelineDuration??1));function P(j){const F=Math.max(0,Math.min(100,j.start/d.value*100)),B=Math.min(100-F,Math.max(1.5,j.duration/d.value*100));return{left:`${F}%`,width:`${B}%`}}const D=C(()=>{const j=_.data.failingWindow;if(!j||j.end<=j.start)return null;const F=Math.max(0,Math.min(100,j.start/d.value*100)),B=Math.max(.5,Math.min(100-F,(j.end-j.start)/d.value*100));return{left:`${F}%`,width:`${B}%`}});function b(j){return j.failed?"bg-red-500":j.duration>1e3?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}function x(j){return j.failed?"border-l-2 border-l-red-400 dark:border-l-red-600":j.duringFailure?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}const V=A(null),M=A(!1);function m(j){V.value=j,M.value=!0}return(j,F)=>{const B=Ge,S=pe,G=Re,J=yo;return s(),a("div",null,[o("div",ho,[r(B,{modelValue:e(h),"onUpdate:modelValue":F[0]||(F[0]=z=>ge(h)?h.value=z:null),items:e(g),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"]),t.data.failingWindow?(s(),a("span",xo,[...F[2]||(F[2]=[o("span",{class:"inline-block w-3 h-2 rounded-sm bg-red-500/10 border border-red-300 dark:border-red-800"},null,-1),f(" failing action ",-1)])])):i("",!0)]),o("div",vo,[(s(!0),a(U,null,te(e(n),z=>(s(),a("button",{key:z.index,type:"button",class:Z([x(z),"w-full rounded bg-gray-50/60 dark:bg-gray-800/40 py-1.5 px-2 text-left cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800"]),title:z.url,onClick:ne=>m(z)},[o("div",ko,[r(S,{color:("httpMethodColor"in j?j.httpMethodColor:e(Ke))(z.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:u(()=>[f(c(z.method),1)]),_:2},1032,["color"]),r(S,{color:("httpStatusColor"in j?j.httpStatusColor:e(We))(z.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums",title:z.failureText||z.statusText},{default:u(()=>[f(c(z.status>0?z.status:"—"),1)]),_:2},1032,["color","title"]),o("code",bo,c(l(z.url)),1),z.resourceType?(s(),a("span",wo,c(z.resourceType),1)):i("",!0),z.responseBodySize!=null?(s(),a("span",$o,c(("formatBytes"in j?j.formatBytes:e(we))(z.responseBodySize)),1)):i("",!0),o("span",{class:Z(["ml-1 shrink-0 text-xs tabular-nums",z.duration>1e3?"text-red-600 font-medium":z.duration>500?"text-orange-500":"text-gray-500"])},[r(G,{ms:z.duration,"unit-class":"opacity-60"},null,8,["ms"])],2)]),o("div",Co,[e(D)?(s(),a("div",{key:0,class:"absolute inset-y-0 bg-red-500/10 border-x border-red-300/60 dark:border-red-800/60",style:Ce(e(D))},null,4)):i("",!0),o("div",{class:Z(["absolute inset-y-0 rounded-full",b(z)]),style:Ce(P(z))},null,6)])],10,_o))),128))]),t.data.truncated?(s(),a("p",To," Showing the first "+c(e(w).length)+" of "+c(t.data.totalBeforeCap)+" requests recorded in the trace. ",1)):i("",!0),r(J,{open:e(M),"onUpdate:open":F[1]||(F[1]=z=>ge(M)?M.value=z:null),entry:e(V),"run-id":t.runId,"test-runs-case-id":t.testRunsCaseId},null,8,["open","entry","run-id","test-runs-case-id"])])}}}),Io=Object.assign(So,{__name:"TraceNetworkList"}),Ro={class:"flex flex-wrap items-center gap-x-3 gap-y-1"},jo={key:0,class:"flex items-center gap-2 text-xs"},Lo={key:0,class:"flex items-center gap-1 text-red-600 dark:text-red-400"},zo={key:1,class:"flex items-center gap-1 text-amber-600 dark:text-amber-400"},Mo={key:2,class:"text-xs text-gray-400 py-2"},No={key:1,class:"space-y-1 max-h-[28rem] overflow-y-auto"},Do=["disabled","onClick"],Po={key:1,class:"size-3.5 shrink-0"},Ao=["title"],Uo=["title"],Bo=["title"],Fo=["title"],Vo=["title"],Eo=["title"],Oo={key:0,class:"px-2 pt-1.5 pb-2 pl-7 space-y-1"},Ho={class:"flex items-center gap-1.5 text-[11px] uppercase tracking-wide text-gray-400"},Ko=["title"],Wo={key:0,class:"shrink-0 text-[10px] uppercase text-gray-400 font-mono hidden sm:inline"},Go={class:"relative flex-1 h-3 rounded bg-gray-100 dark:bg-gray-800 min-w-0"},qo={key:1,class:"px-2 pb-2 pl-7 space-y-1.5"},Jo={class:"flex items-start gap-2"},Qo={key:0,class:"text-gray-400 shrink-0 font-mono"},Zo={class:"font-mono break-all text-gray-700 dark:text-gray-300 flex-1 min-w-0"},Xo=["title"],Yo={key:0,class:"mt-1.5"},er=["onClick"],tr={key:0,class:"mt-1 whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-gray-500 dark:text-gray-400 max-h-48 overflow-y-auto"},sr={key:2,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},nr={key:3,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},ar=re({__name:"TestCaseNetworkRequests",props:{requests:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean}},setup(t,{expose:_}){const h=t,w=A("all"),{data:$,pending:g,load:n}=ka(()=>h.runId,()=>h.testRunsCaseId,()=>!!h.hasTrace),l=A(null),d=C({get:()=>l.value??(h.requests.length===0&&h.hasTrace?"trace":"captured"),set:y=>{l.value=y}});xe(()=>d.value==="trace",y=>{y&&n()},{immediate:!0});const P=C(()=>$.value?.status==="ok"?$.value.requests?.length??0:null),D=C(()=>[{label:`Captured (${h.requests.length})`,value:"captured",disabled:h.requests.length===0},{label:P.value!=null?`Full trace (${P.value})`:"Full trace",value:"trace"}]);function b(){h.hasTrace&&(l.value="trace")}_({showTraceMode:b});const x=A(new Set);function V(y){const T=new Set(x.value);T.has(y)?T.delete(y):T.add(y),x.value=T}const M=A(new Set);function m(y){const T=new Set(M.value);T.has(y)?T.delete(y):T.add(y),M.value=T}function j(y){if(y.length===0)return[];const T=Math.min(...y.map(K=>K.startMs)),H=Math.max(...y.map(K=>K.startMs+K.durMs)),q=Math.max(1,H-T),X=new Map(y.map(K=>[K.id,K])),Y=K=>{let Q=0,ee=K;const se=new Set;for(;ee?.parentId&&X.has(ee.parentId)&&!se.has(ee.id)&&(se.add(ee.id),ee=X.get(ee.parentId),Q++,!(Q>8)););return Q};return[...y].sort((K,Q)=>K.startMs-Q.startMs||Q.durMs-K.durMs).map(K=>({...K,offsetPct:(K.startMs-T)/q*100,widthPct:Math.max(1.5,K.durMs/q*100),depth:Y(K)}))}function F(y){return y.status==="error"?"bg-red-400 dark:bg-red-500":y.kind==="db"?"bg-violet-400 dark:bg-violet-500":y.kind==="client"?"bg-sky-400 dark:bg-sky-500":y.kind==="internal"?"bg-gray-400 dark:bg-gray-500":"bg-emerald-400 dark:bg-emerald-500"}function B(y){const T=y.toLowerCase();return T==="critical"||T==="fatal"?3:T==="error"?2:T==="warning"||T==="warn"?1:0}function S(y){const T=B(y);if(T>=2)return"error";if(T===1)return"warning";const H=y.toLowerCase();return H==="info"||H==="information"?"info":"neutral"}function G(y){try{return new URL(y).pathname||y}catch{return y}}function J(y){return(y.split("/")[1]??y).replace(/^vnd\.[^+]*\+?/,"").replace(/^x-/,"")||y}function z(y){return y?new Date(y).toLocaleString():""}const ne=C(()=>h.requests.map((y,T)=>{const H=Array.isArray(y.serverLogs)?y.serverLogs:[],q=Array.isArray(y.serverTraces)?y.serverTraces:[];let X=0,Y=0;for(const Q of H){const ee=B(Q.level);ee>=2?X++:ee===1&&Y++}const K=q.find(Q=>!Q.parentId)??q[0];return{...y,_index:T,logs:[...H].sort((Q,ee)=>Q.timestamp-ee.timestamp),spans:q,serverMs:K?K.durMs:null,errorLogCount:X,warnLogCount:Y,failed:y.status>=400,hasDetail:H.length>0||q.length>0,path:G(y.url)}})),E=C(()=>{let y=0,T=0,H=0,q=0,X=0;for(const Y of ne.value)Y.failed&&y++,Y.logs.length>0&&T++,Y.spans.length>0&&H++,q+=Y.errorLogCount,X+=Y.warnLogCount;return{total:ne.value.length,failed:y,withLogs:T,withSpans:H,errorLogs:q,warnLogs:X}}),ue=C(()=>{let y=ne.value;return w.value==="failed"?y=y.filter(T=>T.failed):w.value==="logs"&&(y=y.filter(T=>T.logs.length>0)),[...y].sort((T,H)=>{const q=X=>(X.errorLogCount>0?3:0)+(X.failed?2:0)+(X.logs.length>0?1:0);return q(H)-q(T)||T._index-H._index})}),k=C(()=>[{label:`All (${E.value.total})`,value:"all"},{label:`Failed (${E.value.failed})`,value:"failed",disabled:E.value.failed===0},{label:`With logs (${E.value.withLogs})`,value:"logs",disabled:E.value.withLogs===0}]),L=C(()=>E.value.withLogs>0);function ae(y){return y.errorLogCount>0||y.status>=500?"border-l-2 border-l-red-400 dark:border-l-red-600":y.failed||y.warnLogCount>0?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}return(y,T)=>{const H=ce,q=Ge,X=qe,Y=Io,K=pe,Q=Re,ee=kt,se=ye;return s(),v(se,{icon:"i-lucide-network",title:"Network & backend logs",count:e(d)==="trace"?e(P):e(E).total,help:"case.network"},{actions:u(()=>[o("div",Ro,[e(d)==="captured"?(s(),a(U,{key:0},[e(E).errorLogs>0||e(E).warnLogs>0?(s(),a("div",jo,[e(E).errorLogs>0?(s(),a("span",Lo,[r(H,{name:"i-lucide-octagon-alert",class:"size-3.5"}),f(c(e(E).errorLogs),1)])):i("",!0),e(E).warnLogs>0?(s(),a("span",zo,[r(H,{name:"i-lucide-triangle-alert",class:"size-3.5"}),f(c(e(E).warnLogs),1)])):i("",!0)])):i("",!0),r(q,{modelValue:e(w),"onUpdate:modelValue":T[0]||(T[0]=N=>ge(w)?w.value=N:null),items:e(k),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])],64)):i("",!0),t.hasTrace?(s(),v(q,{key:1,modelValue:e(d),"onUpdate:modelValue":T[1]||(T[1]=N=>ge(d)?d.value=N:null),items:e(D),size:"xs",variant:"pill",ui:{list:"gap-1 p-0.5",trigger:"px-2"}},null,8,["modelValue","items"])):i("",!0)])]),default:u(()=>[e(d)==="trace"?(s(),a(U,{key:0},[e(g)||!e($)?(s(),v(X,{key:0,text:"Parsing trace network stream…"})):e($).status==="ok"?(s(),v(Y,{key:1,data:e($),"run-id":t.runId??null,"test-runs-case-id":t.testRunsCaseId??0},null,8,["data","run-id","test-runs-case-id"])):(s(),a("p",Mo,"No network activity recorded in this trace."))],64)):(s(),a("div",No,[(s(!0),a(U,null,te(e(ue),N=>(s(),a("div",{key:N._index,class:Z([ae(N),"rounded bg-gray-50/60 dark:bg-gray-800/40"])},[o("button",{type:"button",class:Z(["w-full flex items-center gap-2 py-1.5 px-2 text-sm text-left",N.hasDetail?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800":"cursor-default"]),disabled:!N.hasDetail,onClick:W=>N.hasDetail&&V(N._index)},[N.hasDetail?(s(),v(H,{key:0,name:e(x).has(N._index)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0 text-gray-400"},null,8,["name"])):(s(),a("span",Po)),r(K,{color:("httpMethodColor"in y?y.httpMethodColor:e(Ke))(N.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:u(()=>[f(c(N.method),1)]),_:2},1032,["color"]),r(K,{color:("httpStatusColor"in y?y.httpStatusColor:e(We))(N.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums"},{default:u(()=>[f(c(N.status||"—"),1)]),_:2},1032,["color"]),o("code",{class:"truncate text-xs flex-1 min-w-0",title:N.url},c(N.path),9,Ao),N.contentType?(s(),a("span",{key:2,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline",title:`Response content type: ${N.contentType}`},c(J(N.contentType)),9,Uo)):i("",!0),N.errorLogCount>0?(s(),a("span",{key:3,class:"shrink-0 inline-flex items-center gap-1 text-xs text-red-600 dark:text-red-400",title:`${N.errorLogCount} backend error log(s)`},[r(H,{name:"i-lucide-octagon-alert",class:"size-3.5"}),f(c(N.errorLogCount),1)],8,Bo)):i("",!0),N.warnLogCount>0?(s(),a("span",{key:4,class:"shrink-0 inline-flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",title:`${N.warnLogCount} backend warning log(s)`},[r(H,{name:"i-lucide-triangle-alert",class:"size-3.5"}),f(c(N.warnLogCount),1)],8,Fo)):i("",!0),N.serverMs!=null?(s(),a("span",{key:5,class:"shrink-0 inline-flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400 tabular-nums",title:`Server-side processing time (${N.spans.length} span${N.spans.length===1?"":"s"})`},[r(H,{name:"i-lucide-server",class:"size-3.5"}),r(Q,{ms:N.serverMs,"no-title":""},null,8,["ms"])],8,Vo)):i("",!0),N.startTime?(s(),a("span",{key:6,class:"shrink-0 text-xs text-gray-400 hidden sm:inline",title:z(N.startTime)},c(("formatRelativeTime"in y?y.formatRelativeTime:e(Se))(N.startTime)),9,Eo)):i("",!0),o("span",{class:Z(["ml-1 shrink-0 text-xs tabular-nums",(N.duration??0)>1e3?"text-red-600 font-medium":(N.duration??0)>500?"text-orange-500":"text-gray-500"])},[r(Q,{ms:N.duration,"unit-class":"opacity-60"},null,8,["ms"])],2)],10,Do),N.spans.length>0&&e(x).has(N._index)?(s(),a("div",Oo,[o("div",Ho,[r(H,{name:"i-lucide-waypoints",class:"size-3.5"}),T[2]||(T[2]=f("Server trace ",-1))]),(s(!0),a(U,null,te(j(N.spans),W=>(s(),a("div",{key:W.id,class:"flex items-center gap-2 text-xs",title:W.status==="error"?`${W.name} (error)`:W.name},[o("div",{class:"w-40 sm:w-56 shrink-0 flex items-center gap-1 min-w-0",style:Ce({paddingLeft:`${W.depth*12}px`})},[W.kind?(s(),a("span",Wo,c(W.kind),1)):i("",!0),o("span",{class:Z(["truncate font-mono",W.status==="error"?"text-red-600 dark:text-red-400":"text-gray-600 dark:text-gray-300"])},c(W.name),3)],4),o("div",Go,[o("div",{class:Z(["absolute top-0 h-3 rounded",F(W)]),style:Ce({left:`${W.offsetPct}%`,width:`${W.widthPct}%`})},null,6)]),r(Q,{ms:W.durMs,class:"w-12 shrink-0 text-right text-gray-500"},null,8,["ms"])],8,Ko))),128))])):i("",!0),N.logs.length>0&&e(x).has(N._index)?(s(),a("div",qo,[(s(!0),a(U,null,te(N.logs,(W,ve)=>(s(),a("div",{key:ve,class:"rounded border border-default bg-white dark:bg-gray-900/60 p-2 text-xs"},[o("div",Jo,[r(K,{color:S(W.level),variant:"soft",size:"xs",class:"shrink-0 capitalize"},{default:u(()=>[f(c(W.level),1)]),_:2},1032,["color"]),W.category?(s(),a("span",Qo,"["+c(W.category)+"]",1)):i("",!0),o("span",Zo,c(W.message),1),W.timestamp?(s(),a("span",{key:1,class:"shrink-0 text-gray-400 tabular-nums",title:z(W.timestamp)},c(("formatRelativeTime"in y?y.formatRelativeTime:e(Se))(W.timestamp)),9,Xo)):i("",!0)]),W.stack?(s(),a("div",Yo,[o("button",{type:"button",class:"inline-flex items-center gap-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",onClick:Ae=>m(`${N._index}:${ve}`)},[r(H,{name:e(M).has(`${N._index}:${ve}`)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3"},null,8,["name"]),T[3]||(T[3]=f(" Stack trace ",-1))],8,er),e(M).has(`${N._index}:${ve}`)?(s(),a("pre",tr,c(W.stack),1)):i("",!0)])):i("",!0)]))),128))])):i("",!0)],2))),128))])),e(d)==="captured"&&!e(L)?(s(),a("p",sr,[r(H,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),T[5]||(T[5]=f(" No backend server logs captured — install ",-1)),r(ee,{to:"backend-logs","no-icon":"",class:"underline"},{default:u(()=>[...T[4]||(T[4]=[f("a Piwi backend integration",-1)])]),_:1}),T[6]||(T[6]=f(" to see server-side warnings and errors under each request. ",-1))])):i("",!0),t.hasTrace?i("",!0):(s(),a("p",nr,[r(H,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),o("span",null,[T[8]||(T[8]=f(" Want to go deeper? Record traces (",-1)),T[9]||(T[9]=o("code",null,"trace: 'retain-on-failure'",-1)),T[10]||(T[10]=f(") to see every request with headers, timing and bodies here. ",-1)),r(ee,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:u(()=>[...T[7]||(T[7]=[f("Learn more",-1)])]),_:1})])]))]),_:1},8,["count"])}}}),or=Object.assign(ar,{__name:"TestCaseNetworkRequests"}),rr={class:"space-y-2"},ir=re({__name:"TestCaseTracesCard",props:{traces:{}},setup(t){return(_,h)=>{const w=ps,$=ye;return t.traces.length>0?(s(),v($,{key:0,icon:"i-lucide-bug-play",title:"Traces",count:t.traces.length,help:"case.traces"},{default:u(()=>[o("div",rr,[(s(!0),a(U,null,te(t.traces,g=>(s(),v(w,{key:g.id,trace:g,class:"py-2 px-3 rounded-lg border"},null,8,["trace"]))),128))])]),_:1},8,["count"])):i("",!0)}}}),lr=Object.assign(ir,{__name:"TestCaseTracesCard"}),cr={class:"space-y-3"},ur={class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-800/50 border-b"},dr={class:"flex items-center gap-2 min-w-0"},mr={class:"text-sm font-medium truncate"},fr={key:0,class:"text-xs text-gray-400 shrink-0"},gr={class:"text-xs text-gray-400"},pr={class:"flex items-center gap-1 shrink-0"},yr=["href"],hr={key:0,class:"bg-gray-100 dark:bg-gray-900"},xr=["src","alt","onClick"],vr={key:1,class:"bg-black"},_r={key:2,class:"bg-gray-50 dark:bg-gray-900"},kr={key:0,class:"flex items-center justify-center py-8"},br={key:1,class:"p-4 text-red-500 text-sm"},wr={key:2,class:"p-4 overflow-auto max-h-96"},$r={class:"text-sm whitespace-pre-wrap font-sans leading-relaxed"},Cr=re({__name:"TestCaseAttachmentsCard",props:{attachments:{}},setup(t){const _=t,h=Oe(),w=A(null),$=C(()=>_.attachments.filter(S=>Te(S.path,S.contentType)).map(S=>({src:D(S.path,S.contentType),name:S.name||b(S.path)})));function g(S){w.value=S}const n=new Set([".md",".mdx",".markdown"]),l=new Set(["text/markdown","text/x-markdown"]);function d(S){return S.toLowerCase().split(".").pop()||""}function P(S,G){return!!(n.has(d(S))||G&&l.has(G.toLowerCase()))}function D(S,G){return wt(S,G,h.app?.baseURL)}function b(S){return S.split("/").pop()||S}function x(S){return S==null?"":we(S)}const V=A({}),M=A({}),m=A({}),j=A(new Set);async function F(S){if(V.value[S.id]===void 0&&!m.value[S.id]){m.value[S.id]=!0,M.value[S.id]=null;try{const G=await $fetch(D(S.path,S.contentType),{responseType:"text"});V.value[S.id]=G}catch{M.value[S.id]="Failed to load preview"}finally{m.value[S.id]=!1}}}function B(S,G){const J=new Set(j.value);J.has(S)?J.delete(S):(J.add(S),F(G)),j.value=J}return(S,G)=>{const J=ce,z=Ie,ne=ys,E=hs,ue=ye;return t.attachments.length>0?(s(),v(ue,{key:0,icon:"i-lucide-paperclip",title:"Attachments",count:t.attachments.length},{default:u(()=>[o("div",cr,[(s(!0),a(U,null,te(t.attachments,k=>(s(),a("div",{key:k.id,class:"rounded-lg border overflow-hidden"},[o("div",ur,[o("div",dr,[r(J,{name:e(Te)(k.path,k.contentType)?"i-lucide-image":e(De)(k.path,k.contentType)?"i-lucide-video":P(k.path,k.contentType)?"i-lucide-file-text":"i-lucide-file",class:"size-4 text-gray-400 shrink-0"},null,8,["name"]),o("span",mr,c(b(k.path)),1),k.name&&k.name!==b(k.path)?(s(),a("span",fr,c(k.name),1)):i("",!0),o("span",gr,c(x(k.size)),1)]),o("div",pr,[P(k.path,k.contentType)?(s(),v(z,{key:0,size:"xs",color:"neutral",variant:"soft",onClick:L=>B(k.id,k)},{default:u(()=>[f(c(e(j).has(k.id)?"Hide preview":"Preview"),1)]),_:2},1032,["onClick"])):i("",!0),o("a",{href:D(k.path,k.contentType),target:"_blank",class:"text-primary hover:underline text-xs shrink-0"},"Open",8,yr)])]),e(Te)(k.path,k.contentType)?(s(),a("div",hr,[o("img",{src:D(k.path,k.contentType),alt:k.name||"Screenshot",class:"max-w-full max-h-96 object-contain mx-auto cursor-pointer hover:opacity-90 transition-opacity",loading:"lazy",onClick:L=>g(e($).findIndex(ae=>ae.src===D(k.path,k.contentType)))},null,8,xr)])):e(De)(k.path,k.contentType)?(s(),a("div",vr,[r(ne,{src:D(k.path,k.contentType)},null,8,["src"])])):P(k.path,k.contentType)&&e(j).has(k.id)?(s(),a("div",_r,[e(m)[k.id]?(s(),a("div",kr,[r(J,{name:"i-lucide-loader-circle",class:"size-5 animate-spin text-gray-400"})])):e(M)[k.id]?(s(),a("div",br,c(e(M)[k.id]),1)):e(V)[k.id]?(s(),a("div",wr,[o("pre",$r,c(e(V)[k.id]),1)])):i("",!0)])):i("",!0)]))),128))]),r(E,{modelValue:e(w),"onUpdate:modelValue":G[0]||(G[0]=k=>ge(w)?w.value=k:null),images:e($)},null,8,["modelValue","images"])]),_:1},8,["count"])):i("",!0)}}}),Tr=Object.assign(Cr,{__name:"TestCaseAttachmentsCard"});function Sr(t){return Array.isArray(t)?t.some(_=>_&&typeof _.type=="string"&&_.type.toLowerCase()==="slow"):!1}function Ir(t){const _=[];if(!t)return _;const h=t.steps||[],$=h.filter(n=>n.category==="navigation").filter(n=>n.duration>3e3);if($.length>0){const n=$.sort((l,d)=>d.duration-l.duration)[0];_.push({type:"warning",message:"Slow navigation detected",details:`"${n.title}" took ${(n.duration/1e3).toFixed(1)}s. The tested page may have performance issues (slow server response, heavy JS bundles, etc.).`})}h.length>20&&_.push({type:"info",message:"Many sequential actions",details:`This test has ${h.length} steps. Consider splitting it into smaller, focused tests for better isolation and faster feedback.`}),t.status==="passed"&&(t.retries||0)>0&&_.push({type:"warning",message:"Flaky test — passed after retries",details:`This test needed ${t.retries} ${t.retries===1?"retry":"retries"} to pass. Consider reviewing locator strategies, adding explicit waits, or checking for race conditions.`});const g=h.filter(n=>n.category==="assertion"&&n.duration>2e3);if(g.length>0){const n=g.sort((l,d)=>d.duration-l.duration)[0];_.push({type:"info",message:"Slow assertions detected",details:`"${n.title}" took ${(n.duration/1e3).toFixed(1)}s. The UI may be slow to render or the assertion timeout may need tuning.`})}return Sr(t.testAnnotations)&&typeof t.duration=="number"&&t.duration<1e4&&_.push({type:"info",message:"test.slow() may be unnecessary",details:`This run finished in ${(t.duration/1e3).toFixed(1)}s, yet the test is marked test.slow(), which triples its timeout budget. If it is consistently this fast, removing test.slow() lets a failure surface sooner.`}),typeof t.timeout=="number"&&t.timeout>0&&typeof t.duration=="number"&&t.duration>0&&t.timeout>=4*t.duration&&t.timeout-t.duration>=3e4&&_.push({type:"info",message:"Oversized timeout",details:`The timeout is ${(t.timeout/1e3).toFixed(0)}s but this run took ${(t.duration/1e3).toFixed(1)}s. A large timeout means a hang or failure waits far longer than necessary — consider lowering it toward the test's real duration.`}),_}function Rr(t,_){const h=t.search(/\n at /);if(h===-1)return _!==void 0&&t.length>_?t.slice(0,_)+`
4
4
  [truncated]`:t;const w=t.slice(0,h),g=t.slice(h).split(`
5
5
  `),n=[];let l=0;const d=()=>{l>0&&(n.push(`… (${l} internal frame${l>1?"s":""})`),l=0)};for(const D of g){const b=D.trimStart();b.startsWith("at ")?D.includes("node_modules")||b.startsWith("at node:")?l++:(d(),n.push(D)):(b===""||d(),n.push(D))}d();let P=w+`
6
6
  `+n.join(`
7
7
  `);return _!==void 0&&P.length>_&&(P=P.slice(0,_)+`
8
- [truncated]`),P}const jr={class:"space-y-4"},Lr=["innerHTML"],zr={class:"grid grid-cols-1 xl:grid-cols-[3fr_2fr] gap-4"},Mr={class:"space-y-4 xl:order-2"},Nr={class:"space-y-4 xl:order-1 min-w-0"},Dr={class:"max-h-96 overflow-y-auto"},Pr={class:"space-y-3"},Ar={key:0},Ur={class:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs mb-3"},Br={class:"font-medium text-gray-600 dark:text-gray-300"},Fr={class:"tabular-nums text-gray-500 dark:text-gray-400"},Vr={class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Er={key:0,class:"inline-flex items-center justify-center size-5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 text-xs leading-none",title:"Step failed"},Or={key:1,class:"inline-flex items-center justify-center size-5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400 text-xs leading-none",title:"Step passed"},Hr={class:"flex items-center gap-2"},Kr={key:0,class:"text-xs text-red-500 mt-1 whitespace-pre-wrap break-words font-mono"},Wr={class:"min-w-[6rem]"},Gr={class:"flex items-center justify-between gap-2"},Jr={key:0,class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},qr={class:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},Qr={class:"space-y-4 pt-4"},Zr={key:3,class:"flex flex-col items-center justify-center py-12 text-gray-400"},Xr={class:"space-y-4 pt-1"},Yr={key:0,class:"space-y-2"},ei={class:"flex items-start gap-2"},ti={class:"space-y-4"},si={key:3,class:"text-xs text-gray-400 pt-1"},ni={class:"bg-gray-100 dark:bg-gray-800 px-1 rounded"},ai={class:"space-y-4 pt-4"},oi={key:0,class:"space-y-4"},ri={class:"flex items-center justify-end"},ii={class:"text-xs whitespace-nowrap"},li={class:"text-gray-500"},ci={class:"text-gray-400 ml-1"},ui={key:1,class:"text-gray-400"},di=["title"],gl=re({__name:"[id]",async setup(t){let _,h;const w=as(),$=os(),g=w.params.id,{data:n,refresh:l}=([_,h]=mt(()=>gt(`/api/test-run-cases/${g}`,"$rX1OuZQOSq")),_=await _,h(),_),d=A([]);xe(()=>n.value?.testCaseId,async p=>{if(p)try{d.value=await $fetch(`/api/test-cases/${p}/history`)}catch{d.value=[]}else d.value=[]},{immediate:!0});const{data:P,refresh:D}=([_,h]=mt(()=>gt(`/api/test-run-cases/${g}/traces`,"$bq3dlhiM5e")),_=await _,h(),_),b=C(()=>(P.value?.length??0)>0);rs(C(()=>({title:n.value?.title?`${n.value.title} — execution — Piwi Dashboard`:`Execution #${g} — Piwi Dashboard`})));const x=C(()=>!!n.value?.error),V=C(()=>n.value?Ir(n.value):[]),M=C(()=>n.value?.steps?n.value.steps:[]),m=C(()=>n.value?.webVitals??null),j=C(()=>n.value?.aiUsage?.intents??null),F=C(()=>n.value?.networkRequests??[]),B=C(()=>{if(!d.value||d.value.length<2||!n.value?.duration)return null;const p=d.value.filter(le=>le.duration!==null&&le.id!==n.value?.id);if(p.length===0)return null;const I=p.reduce((le,fe)=>le+(fe.duration||0),0)/p.length,O=n.value.duration,oe=O-I,me=I>0?Math.round(oe/I*100):0;return{avg:Math.round(I),current:O,diff:Math.round(oe),pct:me}}),S=C(()=>n.value?.testRun?.metadata),G=C(()=>{const p=S.value;return p?.scm?p.scm:null}),q=C(()=>{const p=S.value;return p?.ci?p.ci:null}),z=C(()=>n.value?.failureCluster??null),ne=C(()=>{const p=[];return x.value&&p.push({label:"Diagnosis",icon:"i-lucide-stethoscope",value:"diagnosis",slot:"diagnosis"}),p.push({label:`Steps (${M.value.length})`,icon:"i-lucide-list-checks",value:"steps",slot:"steps"}),x.value||p.push({label:"Artifacts",icon:"i-lucide-paperclip",value:"artifacts",slot:"artifacts"}),p.push({label:"Performance",icon:"i-lucide-gauge",value:"performance",slot:"performance"}),p.push({label:`History${d.value?.length?` (${d.value.length})`:""}`,icon:"i-lucide-trending-up",value:"history",slot:"history"}),p}),E=C(()=>ne.value.map(p=>p.value));function ue(){return x.value?"diagnosis":"steps"}function k(p){let I=typeof p=="string"?p:"";return I==="error"&&(I="diagnosis"),I==="traces"&&(I=x.value?"diagnosis":"artifacts"),E.value.includes(I)?I:ue()}const L=A(k(w.query.tab));xe(E,p=>{p.includes(L.value)||(L.value=k(w.query.tab))}),xe(L,p=>{w.query.tab!==p&&$.replace({query:{...w.query,tab:p}})},{immediate:!0});const ae=[{accessorKey:"startTime",header:"Date"},{accessorKey:"status",header:"Status"},{accessorKey:"duration",header:"Duration"},{accessorKey:"retries",header:"Retries"},{accessorKey:"runId",header:"Run"},{accessorKey:"error",header:"Error"}],y={navigation:"info",assertion:"success",action:"warning",input:"warning",api:"info",wait:"neutral",hook:"neutral",fixture:"neutral"},T=[{id:"index",header:"#",meta:{class:{th:"w-12",td:"w-12"}}},{id:"status",header:"",meta:{class:{th:"w-10",td:"w-10"}}},{accessorKey:"category",header:"Category",meta:{class:{th:"w-28",td:"w-28"}}},{accessorKey:"title",header:"Step"},{accessorKey:"duration",header:"Duration",meta:{class:{th:"w-44",td:"w-44"}}}],H=C(()=>{const p=new Map;for(const I of M.value){const O=p.get(I.category)??{count:0,duration:0};O.count+=1,O.duration+=I.duration||0,p.set(I.category,O)}return Array.from(p,([I,O])=>({category:I,...O})).sort((I,O)=>O.duration-I.duration)}),J=C(()=>{let p=-1,I=-1;return M.value.forEach((O,oe)=>{(O.duration||0)>I&&(I=O.duration||0,p=oe)}),p}),X=C(()=>M.value.reduce((p,I)=>Math.max(p,I.duration||0),0)),Y=C(()=>M.value.length>0&&M.value.every(p=>typeof p.startTime=="number")),K=C(()=>n.value?.startedAt??(Y.value?Math.min(...M.value.map(p=>p.startTime)):0)),Q=C(()=>{const p=n.value?.duration??0;if(p>0)return p;if(Y.value){const I=Math.max(...M.value.map(O=>O.startTime+(O.duration||0)));return Math.max(1,I-K.value)}return 0});function ee(p){if(Y.value&&Q.value>0){const O=Math.max(0,Math.min(100,(p.startTime-K.value)/Q.value*100)),oe=Math.min(100-O,Math.max(1.5,(p.duration||0)/Q.value*100));return{left:`${O}%`,width:`${oe}%`}}return{left:"0%",width:`${X.value>0?Math.max(2,(p.duration||0)/X.value*100):0}%`}}function se(p){const I=n.value?.duration??0;if(I<=0)return"";const O=p/I*100;return O>0&&O<1?"<1%":`${Math.round(O)}%`}function N(p){return p>2e3?"text-red-600 font-medium":p>500?"text-orange-500":"text-gray-500"}function W(p){return p>2e3?"bg-red-500":p>500?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}const ve=C(()=>n.value?.testRun?.environment),Ae=C(()=>[{filePath:n.value?.filePath??"",title:n.value?.title??"",line:n.value?.line??null,projectName:n.value?.browser?.projectName??null}]),St=C(()=>nn(Ae.value)),{copy:It,copied:qe}=an(),Rt=C(()=>[{label:qe.value?"Copied":"Retry command",icon:qe.value?"i-lucide-check":"i-lucide-play",onClick:()=>It(St.value,{toast:"Retry command copied"})},{label:"Refresh",icon:"i-lucide-refresh-cw",onClick:()=>l()}]),jt=!!Oe().public.demoMode;let he=null;const Qe=C(()=>{const p=n.value?.testRun?.status;return p==="running"||p==="finalizing"});function Lt(){if(jt||he)return;const p=n.value?.testRun?.id;p&&(he=new EventSource(`/api/test-runs/${p}/stream`),he.onmessage=I=>{try{const O=JSON.parse(I.data);O.type==="case-files"&&O.data?.testRunsCaseId===Number(g)?(l(),D()):O.type==="run-finished"&&(l(),D(),Ue())}catch{}},he.onerror=()=>{})}function Ue(){he&&(he.close(),he=null)}xe(Qe,p=>{p?Lt():Ue()},{immediate:!0}),is(Ue);const{copyRich:zt,copied:Ze}=xs();function Mt(){const p=n.value;if(!p?.error)return;const I=window.location.origin,O=p.title??"Unknown test",oe=p.location??"",me=p.error.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,""),le=be=>be.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),fe=z.value?`${I}/failure-clusters/${z.value.id}`:null,Me=`${I}/test-run-cases/${g}?tab=diagnosis`,ke=n.value?.testCaseId?`${I}/test-cases/${n.value.testCaseId}`:null,Fe=[`❌ Test failed: ${O}`,oe?`Location: ${oe}`:null,"","Error:",me,"",fe?`Failure cluster: ${fe}`:null,`Execution: ${Me}`,ke?`History: ${ke}`:null].filter(be=>be!==null).join(`
9
- `),Ve=[`<p><strong>❌ Test failed: ${le(O)}</strong>${oe?`<br><code>${le(oe)}</code>`:""}</p>`,`<p><strong>Error:</strong></p><pre>${ft(p.error)}</pre>`,`<p>🔗 ${fe?`<a href="${fe}">View failure cluster</a> · `:""}<a href="${Me}">Execution details</a>${ke?` · <a href="${ke}">Test history</a>`:""}</p>`].join("");zt(Fe,Ve,{toast:"Failure copied"})}const Be=A(null),Xe=A(null),je=A(null),Le=A(null),Ye=A(null),ze=A(null),et=A(null),tt=A(null),st=A(null),nt=A(null);function _e(p){p?.scrollIntoView({behavior:"smooth",block:"start"})}const at={sampleError:()=>_e(Be.value),executionError:()=>_e(Be.value),testSource:()=>Le.value?.reveal(),sourceFiles:()=>Le.value?.reveal(),environmentDiff:()=>et.value?.reveal(),visualDiff:()=>tt.value?.reveal(),domSnapshot:()=>st.value?.reveal(),ariaSnapshot:()=>nt.value?.reveal(),screenshots:()=>ze.value?.reveal(),tracePointers:()=>ze.value?.reveal(),artifacts:()=>ze.value?.reveal(),console:()=>_e(Xe.value),networkRequests:()=>_e(je.value),serverTraces:()=>_e(je.value),traceCallStack:()=>Le.value?.reveal(),traceNetwork:()=>{Ye.value?.showTraceMode(),_e(je.value)},steps:()=>{L.value="steps"},failingSteps:()=>{L.value="steps"}};return ls(Os,{canLocate:p=>p in at,open:p=>at[p]?.()}),(p,I)=>{const O=es,oe=ts,me=ce,le=Pe,fe=$s,Me=Cs,ke=Ts,Fe=Is,Ve=En,be=Ie,Nt=$t,ot=ye,Dt=Qn,Pt=la,At=va,Ut=Ta,Bt=Ma,Ft=_s,Vt=ks,Et=bs,rt=Fa,it=or,lt=vs,Ot=bt,Ht=He,Kt=ws,Ne=pe,ie=Re,Wt=ht,ct=Ys,ut=en,dt=tn,Gt=lr,Jt=Tr,de=xt,Ee=vt,qt=Ct,Qt=sn,Zt=zs,Xt=Ss;return s(),v(Xt,{id:"test-run-case-detail"},{header:u(()=>[r(Fe,null,{leading:u(()=>[r(O),r(oe,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},...e(n)?.testRun?.project?.id?[{label:e(n).testRun.project.name||"Project",to:`/projects/${e(n).testRun.project.id}`}]:[{label:"Project"}],...e(n)?.testRun?.id?[{label:`Run #${e(n).testRun.id}`+(e(n).testRun.label?` — ${e(n).testRun.label}`:""),to:`/test-runs/${e(n).testRun.id}`}]:[{label:"Test run"}],{label:e(n)?.title||`Execution #${e(g)}`}]},null,8,["items"])]),right:u(()=>[e(n)?.testCaseId?(s(),v(le,{key:0,to:`/test-cases/${e(n).testCaseId}`,class:"text-xs text-gray-500 hover:text-primary mr-2 flex items-center gap-1",title:"View test case evolution and history"},{default:u(()=>[r(me,{name:"i-lucide-trending-up",class:"size-3.5"}),I[2]||(I[2]=o("span",{class:"hidden sm:inline"},"Evolution",-1))]),_:1},8,["to"])):i("",!0),e(n)?(s(),v(fe,{key:1,endpoint:`/api/test-run-cases/${e(n).id}/export`,"base-name":`piwi-execution-${e(n).id}`,class:"mr-2"},null,8,["endpoint","base-name"])):i("",!0),r(Me,{"project-id":e(n)?.testRun?.project?.id,"project-label":e(n)?.testRun?.project?.label??e(n)?.testRun?.project?.name,cases:e(Ae),class:"mr-2"},null,8,["project-id","project-label","cases"]),r(ke,{actions:e(Rt)},null,8,["actions"])]),_:1})]),body:u(()=>[r(Zt,{modelValue:e(L),"onUpdate:modelValue":I[1]||(I[1]=R=>ge(L)?L.value=R:null),"tab-items":e(ne)},{summary:u(()=>[r(Ve,{"test-case":e(n)??null,"scm-info":e(G),"ci-info":e(q),browser:e(n)?.browser??null,environment:e(ve),"steps-count":e(M).length,"historical-timing":e(B),"stable-links":e(n)?.stableLinks??null,"project-key":e(n)?.testRun?.project?.id,"project-name":e(n)?.testRun?.project?.name,onRefresh:I[0]||(I[0]=R=>e(l)())},null,8,["test-case","scm-info","ci-info","browser","environment","steps-count","historical-timing","stable-links","project-key","project-name"])]),"tab-diagnosis":u(()=>[o("div",jr,[o("div",{ref_key:"errorEl",ref:Be,class:"scroll-mt-4"},[e(n)?.error?(s(),v(ot,{key:0,icon:"i-lucide-circle-x","icon-class":"text-red-500",title:"Error"},{actions:u(()=>[r(Nt,{text:e(Ze)?"Copied!":"Copy failure"},{default:u(()=>[r(be,{size:"xs",variant:"ghost",color:"neutral",icon:e(Ze)?"i-lucide-check":"i-lucide-clipboard",onClick:Mt},null,8,["icon"])]),_:1},8,["text"])]),default:u(()=>[o("div",{class:"text-xs font-mono whitespace-pre-wrap break-words max-h-96 overflow-y-auto rounded bg-red-50 dark:bg-red-950/20 p-3",innerHTML:e(ft)(e(Rr)(e(n).error))},null,8,Lr)]),_:1})):i("",!0)],512),o("div",zr,[o("div",Mr,[r(Dt,{"test-case":e(n)??null,history:e(d),"current-id":Number(e(g))},null,8,["test-case","history","current-id"]),e(z)?(s(),v(Pt,{key:0,cluster:e(z)},null,8,["cluster"])):i("",!0),r(At,{"test-runs-case-id":Number(e(g))},null,8,["test-runs-case-id"])]),o("div",Nr,[e(n)?.testSourceFrames?.length||e(n)?.testSource||e(b)?(s(),v(Ut,{key:0,ref_key:"testSourceCard",ref:Le,"storage-key":"case-test-source",frames:e(n)?.testSourceFrames??null,"test-source":e(n)?.testSource??null,"run-id":e(n)?.testRun?.id??null,"test-runs-case-id":Number(e(g)),"has-trace":e(b),"project-key":e(n)?.testRun?.project?.id,"project-name":e(n)?.testRun?.project?.name},null,8,["frames","test-source","run-id","test-runs-case-id","has-trace","project-key","project-name"])):i("",!0),r(Bt,{ref_key:"evidenceCard",ref:ze,"storage-key":"case-evidence",attachments:e(n)?.attachments??[],traces:e(P)??[]},null,8,["attachments","traces"]),e(n)?.testRun?.id?(s(),v(Ft,{key:1,"storage-key":"case-locators","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g)),"ai-intents":e(j)},null,8,["run-id","test-runs-case-id","ai-intents"])):i("",!0),e(n)?.testRun?.id?(s(),v(Vt,{key:2,ref_key:"envDiffCard",ref:et,"storage-key":"case-env-diff","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g))},null,8,["run-id","test-runs-case-id"])):i("",!0),e(n)?.testRun?.id?(s(),v(Et,{key:3,ref_key:"visualDiffCard",ref:tt,"storage-key":"case-visual-diff","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g))},null,8,["run-id","test-runs-case-id"])):i("",!0),e(n)?.consoleLogs?.length?(s(),a("div",{key:4,ref_key:"consoleEl",ref:Xe,class:"scroll-mt-4"},[r(rt,{entries:e(n)?.consoleLogs??[]},null,8,["entries"])],512)):i("",!0),e(F).length>0||e(b)?(s(),a("div",{key:5,ref_key:"networkEl",ref:je,class:"scroll-mt-4"},[r(it,{ref_key:"networkCard",ref:Ye,requests:e(F),"run-id":e(n)?.testRun?.id??null,"test-runs-case-id":Number(e(g)),"has-trace":e(b)},null,8,["requests","run-id","test-runs-case-id","has-trace"])],512)):i("",!0),e(n)?.pageState?(s(),v(lt,{key:6,"storage-key":"case-page-state","page-state":e(n).pageState},null,8,["page-state"])):i("",!0),e(n)?.ariaSnapshot?(s(),v(Ht,{key:7,ref_key:"ariaCard",ref:nt,"storage-key":"case-aria",icon:"i-lucide-scan-text",title:"ARIA snapshot",help:"case.aria"},{folded:u(()=>[...I[3]||(I[3]=[f("Accessibility tree captured at the moment of failure",-1)])]),default:u(()=>[o("div",Dr,[r(Ot,{text:"```yaml\n"+e(n).ariaSnapshot+"\n```"},null,8,["text"])])]),_:1},512)):i("",!0),e(n)?.testRun?.id?(s(),v(Kt,{key:8,ref_key:"domSnapshotCard",ref:st,"storage-key":"case-dom-snapshot","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g))},null,8,["run-id","test-runs-case-id"])):i("",!0)])])])]),"tab-steps":u(()=>[o("div",Pr,[e(M).length>0?(s(),a("div",Ar,[o("div",Ur,[o("span",Br,c(e(M).length)+" steps",1),I[4]||(I[4]=o("span",{class:"text-gray-300 dark:text-gray-600"},"·",-1)),(s(!0),a(U,null,te(e(H),R=>(s(),a("span",{key:R.category,class:"inline-flex items-center gap-1"},[r(Ne,{color:y[R.category]||"neutral",variant:"soft",size:"xs"},{default:u(()=>[f(c(R.category),1)]),_:2},1032,["color"]),o("span",Fr,[f("×"+c(R.count)+" · ",1),r(ie,{ms:R.duration},null,8,["ms"])])]))),128))]),r(ut,{"min-width":"40rem",bleed:!1},{default:u(()=>[r(ct,{data:e(M),columns:T,ui:{base:"table-fixed w-full border-separate border-spacing-0 min-w-[40rem]",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default align-top"}},{"index-cell":u(({row:R})=>[o("span",Vr,c(R.index+1),1)]),"status-cell":u(({row:R})=>[R.original.failed?(s(),a("span",Er,"✗")):(s(),a("span",Or,"✓"))]),"category-cell":u(({row:R})=>[r(Ne,{color:y[R.original.category]||"neutral",variant:"soft",size:"xs"},{default:u(()=>[f(c(R.original.category),1)]),_:2},1032,["color"])]),"title-cell":u(({row:R})=>[o("div",Hr,[o("span",{class:Z(R.original.failed?"text-red-600 dark:text-red-400 font-medium":"")},c(R.original.title),3),R.index===e(J)?(s(),v(Ne,{key:0,color:"warning",variant:"subtle",size:"xs",class:"shrink-0",title:"Slowest step in this test"},{default:u(()=>[...I[5]||(I[5]=[f(" slowest ",-1)])]),_:1})):i("",!0)]),R.original.failed&&R.original.error?.message?(s(),a("p",Kr,c(R.original.error.message),1)):i("",!0),R.original.location?(s(),v(Wt,{key:1,location:R.original.location,"project-key":e(n)?.testRun?.project?.id,"project-name":e(n)?.testRun?.project?.name,class:"text-xs text-gray-400 dark:text-gray-500 mt-0.5"},null,8,["location","project-key","project-name"])):i("",!0)]),"duration-cell":u(({row:R})=>[o("div",Wr,[o("div",Gr,[r(ie,{ms:R.original.duration,class:Z(`text-sm ${N(R.original.duration)}`),"unit-class":"opacity-60"},null,8,["ms","class"]),se(R.original.duration)?(s(),a("span",Jr,c(se(R.original.duration)),1)):i("",!0)]),o("div",qr,[o("div",{class:Z(["absolute inset-y-0 rounded-full",W(R.original.duration)]),style:Ce(ee(R.original))},null,6)])])]),_:1},8,["data"])]),_:1})])):(s(),v(dt,{key:1,icon:"i-lucide-list-checks",text:"No steps recorded for this execution"}))])]),"tab-artifacts":u(()=>[o("div",Qr,[r(Gt,{traces:e(P)||[]},null,8,["traces"]),r(Jt,{attachments:e(n)?.attachments??[]},null,8,["attachments"]),e(n)?.pageState?(s(),v(lt,{key:0,"storage-key":"case-page-state","page-state":e(n).pageState},null,8,["page-state"])):i("",!0),e(n)?.consoleLogs?.length?(s(),v(rt,{key:1,entries:e(n)?.consoleLogs??[]},null,8,["entries"])):i("",!0),e(F).length>0||e(b)?(s(),v(it,{key:2,requests:e(F),"run-id":e(n)?.testRun?.id??null,"test-runs-case-id":Number(e(g)),"has-trace":e(b)},null,8,["requests","run-id","test-runs-case-id","has-trace"])):i("",!0),!e(P)?.length&&!e(n)?.attachments?.length&&!e(n)?.consoleLogs?.length&&!e(F).length?(s(),a("div",Zr,[e(Qe)?(s(),a(U,{key:0},[r(me,{name:"i-lucide-loader-circle",class:"size-8 mb-2 animate-spin"}),I[6]||(I[6]=o("p",{class:"text-sm"}," Run in progress — traces and attachments appear here as soon as they are uploaded. ",-1))],64)):(s(),a(U,{key:1},[r(me,{name:"i-lucide-inbox",class:"size-8 mb-2"}),I[7]||(I[7]=o("p",{class:"text-sm"},"No traces, console logs, or network requests captured for this test case.",-1))],64))])):i("",!0)])]),"tab-performance":u(()=>[o("div",Xr,[e(V).length>0?(s(),a("div",Yr,[(s(!0),a(U,null,te(e(V),(R,Yt)=>(s(),a("div",{key:Yt,class:Z(["p-3 rounded-lg border",R.type==="warning"?"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800"])},[o("div",ei,[r(me,{name:R.type==="warning"?"i-lucide-alert-triangle":"i-lucide-lightbulb",class:Z([R.type==="warning"?"text-amber-600":"text-blue-600","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),o("div",null,[o("p",{class:Z(R.type==="warning"?"text-amber-800 dark:text-amber-200 font-medium":"text-blue-800 dark:text-blue-200 font-medium")},c(R.message),3),o("p",{class:Z([R.type==="warning"?"text-amber-700 dark:text-amber-300":"text-blue-700 dark:text-blue-300","mt-1"])},c(R.details),3)])])],2))),128))])):i("",!0),e(m)?(s(),v(ot,{key:1,icon:"i-lucide-gauge",title:"Browser performance (Web Vitals)",help:"case.web-vitals"},{default:u(()=>[o("div",ti,[e(m).navigation?(s(),v(Ee,{key:0,"min-tile-width":"10rem"},{default:u(()=>[r(de,{label:"TTFB",hint:"Time to first byte","value-class":e(m).navigation.ttfb>600?"text-red-600":e(m).navigation.ttfb>200?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.ttfb},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"DOM Interactive",hint:"DOM interactive","value-class":e(m).navigation.domInteractive>3e3?"text-red-600":e(m).navigation.domInteractive>1500?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.domInteractive},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"DOMContentLoaded",hint:"DOMContentLoaded","value-class":e(m).navigation.domContentLoaded>3e3?"text-red-600":e(m).navigation.domContentLoaded>1500?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.domContentLoaded},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"Load Complete",hint:"Page fully loaded","value-class":e(m).navigation.loadComplete>5e3?"text-red-600":e(m).navigation.loadComplete>3e3?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.loadComplete},null,8,["ms"])]),_:1},8,["value-class"])]),_:1})):i("",!0),e(m).paint&&(e(m).paint.firstPaint||e(m).paint.firstContentfulPaint)?(s(),v(Ee,{key:1,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:u(()=>[e(m).paint.firstPaint!==void 0?(s(),v(de,{key:0,label:"First Paint (FP)"},{default:u(()=>[r(ie,{ms:e(m).paint.firstPaint},null,8,["ms"])]),_:1})):i("",!0),e(m).paint.firstContentfulPaint!==void 0?(s(),v(de,{key:1,label:"First Contentful Paint (FCP)","value-class":e(m).paint.firstContentfulPaint>3e3?"text-red-600":e(m).paint.firstContentfulPaint>1800?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).paint.firstContentfulPaint},null,8,["ms"])]),_:1},8,["value-class"])):i("",!0)]),_:1})):i("",!0),e(m).vitals?(s(),v(Ee,{key:2,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:u(()=>[r(de,{label:"Largest Contentful Paint (LCP)","value-class":e(m).vitals.lcp==null?"text-gray-400":e(m).vitals.lcp>4e3?"text-red-600":e(m).vitals.lcp>2500?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).vitals.lcp,fallback:"n/a"},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"Cumulative Layout Shift (CLS)",value:e(m).vitals.cls!=null?String(e(m).vitals.cls):"n/a","value-class":e(m).vitals.cls==null?"text-gray-400":e(m).vitals.cls>.25?"text-red-600":e(m).vitals.cls>.1?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),r(de,{label:"Interaction to Next Paint (INP)","value-class":e(m).vitals.inp==null?"text-gray-400":e(m).vitals.inp>500?"text-red-600":e(m).vitals.inp>200?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).vitals.inp,fallback:"n/a"},null,8,["ms"])]),_:1},8,["value-class"])]),_:1})):i("",!0),e(m).navigation?.url?(s(),a("div",si,[I[8]||(I[8]=f(" Page: ",-1)),o("code",ni,c(e(m).navigation.url),1)])):i("",!0)])]),_:1})):i("",!0),e(V).length===0&&!e(m)?(s(),v(qt,{key:2,icon:"i-lucide-gauge",title:"No performance hints or Web Vitals for this execution",text:"Web Vitals and step timing come from the Piwi capture fixtures — extend your Playwright test with piwiFixtures to collect them.",doc:"capture-fixtures"})):i("",!0)])]),"tab-history":u(()=>[o("div",ai,[e(d)&&e(d).length>0?(s(),a("div",oi,[o("div",ri,[e(n)?.testCaseId?(s(),v(be,{key:0,to:`/test-cases/${e(n).testCaseId}`,size:"xs",variant:"outline",color:"neutral","trailing-icon":"i-lucide-arrow-right"},{default:u(()=>[...I[9]||(I[9]=[f(" View full test history ",-1)])]),_:1},8,["to"])):i("",!0)]),r(Qt,{data:e(d),height:200},null,8,["data"]),r(ut,{"min-width":"44rem",bleed:!1},{default:u(()=>[r(ct,{data:e(d),columns:ae,ui:{base:"table-fixed border-separate border-spacing-0 min-w-[44rem]",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default"}},{"startTime-cell":u(({row:R})=>[o("span",ii,[o("span",li,c(new Date(R.original.startTime).toLocaleDateString("en-US",{month:"short",day:"numeric"})),1),o("span",ci,c(new Date(R.original.startTime).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})),1)])]),"status-cell":u(({row:R})=>[r(Ne,{color:("getStatusColor"in p?p.getStatusColor:e(Js))(R.original.status),variant:"subtle",class:"capitalize"},{default:u(()=>[f(c(R.original.status),1)]),_:2},1032,["color"])]),"duration-cell":u(({row:R})=>[R.original.duration!==null?(s(),v(ie,{key:0,ms:R.original.duration},null,8,["ms"])):(s(),a("span",ui,"—"))]),"runId-cell":u(({row:R})=>[r(le,{to:`/test-runs/${R.original.runId}`,class:"text-primary hover:underline"},{default:u(()=>[f(" #"+c(R.original.runId),1)]),_:2},1032,["to"])]),"error-cell":u(({row:R})=>[R.original.error?(s(),a("span",{key:0,class:"text-red-600 text-xs truncate max-w-xs block",title:R.original.error},c(R.original.error.length>80?`${R.original.error.substring(0,80)}…`:R.original.error),9,di)):i("",!0)]),_:1},8,["data"])]),_:1})])):(s(),v(dt,{key:1,icon:"i-lucide-trending-up",text:"No prior executions of this test yet."},{default:u(()=>[...I[10]||(I[10]=[o("p",{class:"text-xs text-gray-400"}," This is the first recorded run. Once it runs again, its status and duration trend appear here. ",-1)])]),_:1}))])]),_:1},8,["modelValue","tab-items"])]),_:1})}}});export{gl as default};
8
+ [truncated]`),P}const jr={class:"space-y-4"},Lr=["innerHTML"],zr={class:"grid grid-cols-1 xl:grid-cols-[3fr_2fr] gap-4"},Mr={class:"space-y-4 xl:order-2"},Nr={class:"space-y-4 xl:order-1 min-w-0"},Dr={class:"max-h-96 overflow-y-auto"},Pr={class:"space-y-3"},Ar={key:0},Ur={class:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs mb-3"},Br={class:"font-medium text-gray-600 dark:text-gray-300"},Fr={class:"tabular-nums text-gray-500 dark:text-gray-400"},Vr={class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Er={key:0,class:"inline-flex items-center justify-center size-5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 text-xs leading-none",title:"Step failed"},Or={key:1,class:"inline-flex items-center justify-center size-5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400 text-xs leading-none",title:"Step passed"},Hr={class:"flex items-center gap-2"},Kr={key:0,class:"text-xs text-red-500 mt-1 whitespace-pre-wrap break-words font-mono"},Wr={class:"min-w-[6rem]"},Gr={class:"flex items-center justify-between gap-2"},qr={key:0,class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Jr={class:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},Qr={class:"space-y-4 pt-4"},Zr={key:3,class:"flex flex-col items-center justify-center py-12 text-gray-400"},Xr={class:"space-y-4 pt-1"},Yr={key:0,class:"space-y-2"},ei={class:"flex items-start gap-2"},ti={class:"space-y-4"},si={key:3,class:"text-xs text-gray-400 pt-1"},ni={class:"bg-gray-100 dark:bg-gray-800 px-1 rounded"},ai={class:"space-y-4 pt-4"},oi={key:0,class:"space-y-4"},ri={class:"flex items-center justify-end"},ii={class:"text-xs whitespace-nowrap"},li={class:"text-gray-500"},ci={class:"text-gray-400 ml-1"},ui={key:1,class:"text-gray-400"},di=["title"],pl=re({__name:"[id]",async setup(t){let _,h;const w=as(),$=os(),g=w.params.id,{data:n,refresh:l}=([_,h]=mt(()=>gt(`/api/test-run-cases/${g}`,"$rX1OuZQOSq")),_=await _,h(),_),d=A([]);xe(()=>n.value?.testCaseId,async p=>{if(p)try{d.value=await $fetch(`/api/test-cases/${p}/history`)}catch{d.value=[]}else d.value=[]},{immediate:!0});const{data:P,refresh:D}=([_,h]=mt(()=>gt(`/api/test-run-cases/${g}/traces`,"$bq3dlhiM5e")),_=await _,h(),_),b=C(()=>(P.value?.length??0)>0);rs(C(()=>({title:n.value?.title?`${n.value.title} — execution — Piwi Dashboard`:`Execution #${g} — Piwi Dashboard`})));const x=C(()=>!!n.value?.error),V=C(()=>n.value?Ir(n.value):[]),M=C(()=>n.value?.steps?n.value.steps:[]),m=C(()=>n.value?.webVitals??null),j=C(()=>n.value?.aiUsage?.intents??null),F=C(()=>n.value?.networkRequests??[]),B=C(()=>{if(!d.value||d.value.length<2||!n.value?.duration)return null;const p=d.value.filter(le=>le.duration!==null&&le.id!==n.value?.id);if(p.length===0)return null;const I=p.reduce((le,fe)=>le+(fe.duration||0),0)/p.length,O=n.value.duration,oe=O-I,me=I>0?Math.round(oe/I*100):0;return{avg:Math.round(I),current:O,diff:Math.round(oe),pct:me}}),S=C(()=>n.value?.testRun?.metadata),G=C(()=>{const p=S.value;return p?.scm?p.scm:null}),J=C(()=>{const p=S.value;return p?.ci?p.ci:null}),z=C(()=>n.value?.failureCluster??null),ne=C(()=>{const p=[];return x.value&&p.push({label:"Diagnosis",icon:"i-lucide-stethoscope",value:"diagnosis",slot:"diagnosis"}),p.push({label:`Steps (${M.value.length})`,icon:"i-lucide-list-checks",value:"steps",slot:"steps"}),x.value||p.push({label:"Artifacts",icon:"i-lucide-paperclip",value:"artifacts",slot:"artifacts"}),p.push({label:"Performance",icon:"i-lucide-gauge",value:"performance",slot:"performance"}),p.push({label:`History${d.value?.length?` (${d.value.length})`:""}`,icon:"i-lucide-trending-up",value:"history",slot:"history"}),p}),E=C(()=>ne.value.map(p=>p.value));function ue(){return x.value?"diagnosis":"steps"}function k(p){let I=typeof p=="string"?p:"";return I==="error"&&(I="diagnosis"),I==="traces"&&(I=x.value?"diagnosis":"artifacts"),E.value.includes(I)?I:ue()}const L=A(k(w.query.tab));xe(E,p=>{p.includes(L.value)||(L.value=k(w.query.tab))}),xe(L,p=>{w.query.tab!==p&&$.replace({query:{...w.query,tab:p}})},{immediate:!0});const ae=[{accessorKey:"startTime",header:"Date"},{accessorKey:"status",header:"Status"},{accessorKey:"duration",header:"Duration"},{accessorKey:"retries",header:"Retries"},{accessorKey:"runId",header:"Run"},{accessorKey:"error",header:"Error"}],y={navigation:"info",assertion:"success",action:"warning",input:"warning",api:"info",wait:"neutral",hook:"neutral",fixture:"neutral"},T=[{id:"index",header:"#",meta:{class:{th:"w-12",td:"w-12"}}},{id:"status",header:"",meta:{class:{th:"w-10",td:"w-10"}}},{accessorKey:"category",header:"Category",meta:{class:{th:"w-28",td:"w-28"}}},{accessorKey:"title",header:"Step"},{accessorKey:"duration",header:"Duration",meta:{class:{th:"w-44",td:"w-44"}}}],H=C(()=>{const p=new Map;for(const I of M.value){const O=p.get(I.category)??{count:0,duration:0};O.count+=1,O.duration+=I.duration||0,p.set(I.category,O)}return Array.from(p,([I,O])=>({category:I,...O})).sort((I,O)=>O.duration-I.duration)}),q=C(()=>{let p=-1,I=-1;return M.value.forEach((O,oe)=>{(O.duration||0)>I&&(I=O.duration||0,p=oe)}),p}),X=C(()=>M.value.reduce((p,I)=>Math.max(p,I.duration||0),0)),Y=C(()=>M.value.length>0&&M.value.every(p=>typeof p.startTime=="number")),K=C(()=>n.value?.startedAt??(Y.value?Math.min(...M.value.map(p=>p.startTime)):0)),Q=C(()=>{const p=n.value?.duration??0;if(p>0)return p;if(Y.value){const I=Math.max(...M.value.map(O=>O.startTime+(O.duration||0)));return Math.max(1,I-K.value)}return 0});function ee(p){if(Y.value&&Q.value>0){const O=Math.max(0,Math.min(100,(p.startTime-K.value)/Q.value*100)),oe=Math.min(100-O,Math.max(1.5,(p.duration||0)/Q.value*100));return{left:`${O}%`,width:`${oe}%`}}return{left:"0%",width:`${X.value>0?Math.max(2,(p.duration||0)/X.value*100):0}%`}}function se(p){const I=n.value?.duration??0;if(I<=0)return"";const O=p/I*100;return O>0&&O<1?"<1%":`${Math.round(O)}%`}function N(p){return p>2e3?"text-red-600 font-medium":p>500?"text-orange-500":"text-gray-500"}function W(p){return p>2e3?"bg-red-500":p>500?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}const ve=C(()=>n.value?.testRun?.environment),Ae=C(()=>[{filePath:n.value?.filePath??"",title:n.value?.title??"",line:n.value?.line??null,projectName:n.value?.browser?.projectName??null}]),St=C(()=>nn(Ae.value)),{copy:It,copied:Je}=an(),Rt=C(()=>[{label:Je.value?"Copied":"Retry command",icon:Je.value?"i-lucide-check":"i-lucide-play",onClick:()=>It(St.value,{toast:"Retry command copied"})},{label:"Refresh",icon:"i-lucide-refresh-cw",onClick:()=>l()}]),jt=!!Oe().public.demoMode;let he=null;const Qe=C(()=>{const p=n.value?.testRun?.status;return p==="running"||p==="finalizing"});function Lt(){if(jt||he)return;const p=n.value?.testRun?.id;p&&(he=new EventSource(`/api/test-runs/${p}/stream`),he.onmessage=I=>{try{const O=JSON.parse(I.data);O.type==="case-files"&&O.data?.testRunsCaseId===Number(g)?(l(),D()):O.type==="run-finished"&&(l(),D(),Ue())}catch{}},he.onerror=()=>{})}function Ue(){he&&(he.close(),he=null)}xe(Qe,p=>{p?Lt():Ue()},{immediate:!0}),is(Ue);const{copyRich:zt,copied:Ze}=xs();function Mt(){const p=n.value;if(!p?.error)return;const I=window.location.origin,O=p.title??"Unknown test",oe=p.location??"",me=p.error.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,""),le=be=>be.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),fe=z.value?`${I}/failure-clusters/${z.value.id}`:null,Me=`${I}/test-run-cases/${g}?tab=diagnosis`,ke=n.value?.testCaseId?`${I}/test-cases/${n.value.testCaseId}`:null,Fe=[`❌ Test failed: ${O}`,oe?`Location: ${oe}`:null,"","Error:",me,"",fe?`Failure cluster: ${fe}`:null,`Execution: ${Me}`,ke?`History: ${ke}`:null].filter(be=>be!==null).join(`
9
+ `),Ve=[`<p><strong>❌ Test failed: ${le(O)}</strong>${oe?`<br><code>${le(oe)}</code>`:""}</p>`,`<p><strong>Error:</strong></p><pre>${ft(p.error)}</pre>`,`<p>🔗 ${fe?`<a href="${fe}">View failure cluster</a> · `:""}<a href="${Me}">Execution details</a>${ke?` · <a href="${ke}">Test history</a>`:""}</p>`].join("");zt(Fe,Ve,{toast:"Failure copied"})}const Be=A(null),Xe=A(null),je=A(null),Le=A(null),Ye=A(null),ze=A(null),et=A(null),tt=A(null),st=A(null),nt=A(null);function _e(p){p?.scrollIntoView({behavior:"smooth",block:"start"})}const at={sampleError:()=>_e(Be.value),executionError:()=>_e(Be.value),testSource:()=>Le.value?.reveal(),sourceFiles:()=>Le.value?.reveal(),environmentDiff:()=>et.value?.reveal(),visualDiff:()=>tt.value?.reveal(),domSnapshot:()=>st.value?.reveal(),ariaSnapshot:()=>nt.value?.reveal(),screenshots:()=>ze.value?.reveal(),tracePointers:()=>ze.value?.reveal(),artifacts:()=>ze.value?.reveal(),console:()=>_e(Xe.value),networkRequests:()=>_e(je.value),serverTraces:()=>_e(je.value),traceCallStack:()=>Le.value?.reveal(),traceNetwork:()=>{Ye.value?.showTraceMode(),_e(je.value)},steps:()=>{L.value="steps"},failingSteps:()=>{L.value="steps"}};return ls(Os,{canLocate:p=>p in at,open:p=>at[p]?.()}),(p,I)=>{const O=es,oe=ts,me=ce,le=Pe,fe=$s,Me=Cs,ke=Ts,Fe=Is,Ve=En,be=Ie,Nt=$t,ot=ye,Dt=Qn,Pt=la,At=va,Ut=Ta,Bt=Ma,Ft=_s,Vt=ks,Et=bs,rt=Fa,it=or,lt=vs,Ot=bt,Ht=He,Kt=ws,Ne=pe,ie=Re,Wt=ht,ct=Ys,ut=en,dt=tn,Gt=lr,qt=Tr,de=xt,Ee=vt,Jt=Ct,Qt=sn,Zt=zs,Xt=Ss;return s(),v(Xt,{id:"test-run-case-detail"},{header:u(()=>[r(Fe,null,{leading:u(()=>[r(O),r(oe,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},...e(n)?.testRun?.project?.id?[{label:e(n).testRun.project.name||"Project",to:`/projects/${e(n).testRun.project.id}`}]:[{label:"Project"}],...e(n)?.testRun?.id?[{label:`Run #${e(n).testRun.id}`+(e(n).testRun.label?` — ${e(n).testRun.label}`:""),to:`/test-runs/${e(n).testRun.id}`}]:[{label:"Test run"}],{label:e(n)?.title||`Execution #${e(g)}`}]},null,8,["items"])]),right:u(()=>[e(n)?.testCaseId?(s(),v(le,{key:0,to:`/test-cases/${e(n).testCaseId}`,class:"text-xs text-gray-500 hover:text-primary mr-2 flex items-center gap-1",title:"View test case evolution and history"},{default:u(()=>[r(me,{name:"i-lucide-trending-up",class:"size-3.5"}),I[2]||(I[2]=o("span",{class:"hidden sm:inline"},"Evolution",-1))]),_:1},8,["to"])):i("",!0),e(n)?(s(),v(fe,{key:1,endpoint:`/api/test-run-cases/${e(n).id}/export`,"base-name":`piwi-execution-${e(n).id}`,class:"mr-2"},null,8,["endpoint","base-name"])):i("",!0),r(Me,{"project-id":e(n)?.testRun?.project?.id,"project-label":e(n)?.testRun?.project?.label??e(n)?.testRun?.project?.name,cases:e(Ae),class:"mr-2"},null,8,["project-id","project-label","cases"]),r(ke,{actions:e(Rt)},null,8,["actions"])]),_:1})]),body:u(()=>[r(Zt,{modelValue:e(L),"onUpdate:modelValue":I[1]||(I[1]=R=>ge(L)?L.value=R:null),"tab-items":e(ne)},{summary:u(()=>[r(Ve,{"test-case":e(n)??null,"scm-info":e(G),"ci-info":e(J),browser:e(n)?.browser??null,environment:e(ve),"steps-count":e(M).length,"historical-timing":e(B),"stable-links":e(n)?.stableLinks??null,"project-key":e(n)?.testRun?.project?.id,"project-name":e(n)?.testRun?.project?.name,onRefresh:I[0]||(I[0]=R=>e(l)())},null,8,["test-case","scm-info","ci-info","browser","environment","steps-count","historical-timing","stable-links","project-key","project-name"])]),"tab-diagnosis":u(()=>[o("div",jr,[o("div",{ref_key:"errorEl",ref:Be,class:"scroll-mt-4"},[e(n)?.error?(s(),v(ot,{key:0,icon:"i-lucide-circle-x","icon-class":"text-red-500",title:"Error"},{actions:u(()=>[r(Nt,{text:e(Ze)?"Copied!":"Copy failure"},{default:u(()=>[r(be,{size:"xs",variant:"ghost",color:"neutral",icon:e(Ze)?"i-lucide-check":"i-lucide-clipboard",onClick:Mt},null,8,["icon"])]),_:1},8,["text"])]),default:u(()=>[o("div",{class:"text-xs font-mono whitespace-pre-wrap break-words max-h-96 overflow-y-auto rounded bg-red-50 dark:bg-red-950/20 p-3",innerHTML:e(ft)(e(Rr)(e(n).error))},null,8,Lr)]),_:1})):i("",!0)],512),o("div",zr,[o("div",Mr,[r(Dt,{"test-case":e(n)??null,history:e(d),"current-id":Number(e(g))},null,8,["test-case","history","current-id"]),e(z)?(s(),v(Pt,{key:0,cluster:e(z)},null,8,["cluster"])):i("",!0),r(At,{"test-runs-case-id":Number(e(g))},null,8,["test-runs-case-id"])]),o("div",Nr,[e(n)?.testSourceFrames?.length||e(n)?.testSource||e(b)?(s(),v(Ut,{key:0,ref_key:"testSourceCard",ref:Le,"storage-key":"case-test-source",frames:e(n)?.testSourceFrames??null,"test-source":e(n)?.testSource??null,"run-id":e(n)?.testRun?.id??null,"test-runs-case-id":Number(e(g)),"has-trace":e(b),"project-key":e(n)?.testRun?.project?.id,"project-name":e(n)?.testRun?.project?.name},null,8,["frames","test-source","run-id","test-runs-case-id","has-trace","project-key","project-name"])):i("",!0),r(Bt,{ref_key:"evidenceCard",ref:ze,"storage-key":"case-evidence",attachments:e(n)?.attachments??[],traces:e(P)??[]},null,8,["attachments","traces"]),e(n)?.testRun?.id?(s(),v(Ft,{key:1,"storage-key":"case-locators","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g)),"ai-intents":e(j)},null,8,["run-id","test-runs-case-id","ai-intents"])):i("",!0),e(n)?.testRun?.id?(s(),v(Vt,{key:2,ref_key:"envDiffCard",ref:et,"storage-key":"case-env-diff","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g))},null,8,["run-id","test-runs-case-id"])):i("",!0),e(n)?.testRun?.id?(s(),v(Et,{key:3,ref_key:"visualDiffCard",ref:tt,"storage-key":"case-visual-diff","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g))},null,8,["run-id","test-runs-case-id"])):i("",!0),e(n)?.consoleLogs?.length?(s(),a("div",{key:4,ref_key:"consoleEl",ref:Xe,class:"scroll-mt-4"},[r(rt,{entries:e(n)?.consoleLogs??[]},null,8,["entries"])],512)):i("",!0),e(F).length>0||e(b)?(s(),a("div",{key:5,ref_key:"networkEl",ref:je,class:"scroll-mt-4"},[r(it,{ref_key:"networkCard",ref:Ye,requests:e(F),"run-id":e(n)?.testRun?.id??null,"test-runs-case-id":Number(e(g)),"has-trace":e(b)},null,8,["requests","run-id","test-runs-case-id","has-trace"])],512)):i("",!0),e(n)?.pageState?(s(),v(lt,{key:6,"storage-key":"case-page-state","page-state":e(n).pageState},null,8,["page-state"])):i("",!0),e(n)?.ariaSnapshot?(s(),v(Ht,{key:7,ref_key:"ariaCard",ref:nt,"storage-key":"case-aria",icon:"i-lucide-scan-text",title:"ARIA snapshot",help:"case.aria"},{folded:u(()=>[...I[3]||(I[3]=[f("Accessibility tree captured at the moment of failure",-1)])]),default:u(()=>[o("div",Dr,[r(Ot,{text:"```yaml\n"+e(n).ariaSnapshot+"\n```"},null,8,["text"])])]),_:1},512)):i("",!0),e(n)?.testRun?.id?(s(),v(Kt,{key:8,ref_key:"domSnapshotCard",ref:st,"storage-key":"case-dom-snapshot","run-id":e(n).testRun.id,"test-runs-case-id":Number(e(g))},null,8,["run-id","test-runs-case-id"])):i("",!0)])])])]),"tab-steps":u(()=>[o("div",Pr,[e(M).length>0?(s(),a("div",Ar,[o("div",Ur,[o("span",Br,c(e(M).length)+" steps",1),I[4]||(I[4]=o("span",{class:"text-gray-300 dark:text-gray-600"},"·",-1)),(s(!0),a(U,null,te(e(H),R=>(s(),a("span",{key:R.category,class:"inline-flex items-center gap-1"},[r(Ne,{color:y[R.category]||"neutral",variant:"soft",size:"xs"},{default:u(()=>[f(c(R.category),1)]),_:2},1032,["color"]),o("span",Fr,[f("×"+c(R.count)+" · ",1),r(ie,{ms:R.duration},null,8,["ms"])])]))),128))]),r(ut,{"min-width":"40rem",bleed:!1},{default:u(()=>[r(ct,{data:e(M),columns:T,ui:{base:"table-fixed w-full border-separate border-spacing-0 min-w-[40rem]",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default align-top"}},{"index-cell":u(({row:R})=>[o("span",Vr,c(R.index+1),1)]),"status-cell":u(({row:R})=>[R.original.failed?(s(),a("span",Er,"✗")):(s(),a("span",Or,"✓"))]),"category-cell":u(({row:R})=>[r(Ne,{color:y[R.original.category]||"neutral",variant:"soft",size:"xs"},{default:u(()=>[f(c(R.original.category),1)]),_:2},1032,["color"])]),"title-cell":u(({row:R})=>[o("div",Hr,[o("span",{class:Z(R.original.failed?"text-red-600 dark:text-red-400 font-medium":"")},c(R.original.title),3),R.index===e(q)?(s(),v(Ne,{key:0,color:"warning",variant:"subtle",size:"xs",class:"shrink-0",title:"Slowest step in this test"},{default:u(()=>[...I[5]||(I[5]=[f(" slowest ",-1)])]),_:1})):i("",!0)]),R.original.failed&&R.original.error?.message?(s(),a("p",Kr,c(R.original.error.message),1)):i("",!0),R.original.location?(s(),v(Wt,{key:1,location:R.original.location,"project-key":e(n)?.testRun?.project?.id,"project-name":e(n)?.testRun?.project?.name,class:"text-xs text-gray-400 dark:text-gray-500 mt-0.5"},null,8,["location","project-key","project-name"])):i("",!0)]),"duration-cell":u(({row:R})=>[o("div",Wr,[o("div",Gr,[r(ie,{ms:R.original.duration,class:Z(`text-sm ${N(R.original.duration)}`),"unit-class":"opacity-60"},null,8,["ms","class"]),se(R.original.duration)?(s(),a("span",qr,c(se(R.original.duration)),1)):i("",!0)]),o("div",Jr,[o("div",{class:Z(["absolute inset-y-0 rounded-full",W(R.original.duration)]),style:Ce(ee(R.original))},null,6)])])]),_:1},8,["data"])]),_:1})])):(s(),v(dt,{key:1,icon:"i-lucide-list-checks",text:"No steps recorded for this execution"}))])]),"tab-artifacts":u(()=>[o("div",Qr,[r(Gt,{traces:e(P)||[]},null,8,["traces"]),r(qt,{attachments:e(n)?.attachments??[]},null,8,["attachments"]),e(n)?.pageState?(s(),v(lt,{key:0,"storage-key":"case-page-state","page-state":e(n).pageState},null,8,["page-state"])):i("",!0),e(n)?.consoleLogs?.length?(s(),v(rt,{key:1,entries:e(n)?.consoleLogs??[]},null,8,["entries"])):i("",!0),e(F).length>0||e(b)?(s(),v(it,{key:2,requests:e(F),"run-id":e(n)?.testRun?.id??null,"test-runs-case-id":Number(e(g)),"has-trace":e(b)},null,8,["requests","run-id","test-runs-case-id","has-trace"])):i("",!0),!e(P)?.length&&!e(n)?.attachments?.length&&!e(n)?.consoleLogs?.length&&!e(F).length?(s(),a("div",Zr,[e(Qe)?(s(),a(U,{key:0},[r(me,{name:"i-lucide-loader-circle",class:"size-8 mb-2 animate-spin"}),I[6]||(I[6]=o("p",{class:"text-sm"}," Run in progress — traces and attachments appear here as soon as they are uploaded. ",-1))],64)):(s(),a(U,{key:1},[r(me,{name:"i-lucide-inbox",class:"size-8 mb-2"}),I[7]||(I[7]=o("p",{class:"text-sm"},"No traces, console logs, or network requests captured for this test case.",-1))],64))])):i("",!0)])]),"tab-performance":u(()=>[o("div",Xr,[e(V).length>0?(s(),a("div",Yr,[(s(!0),a(U,null,te(e(V),(R,Yt)=>(s(),a("div",{key:Yt,class:Z(["p-3 rounded-lg border",R.type==="warning"?"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800"])},[o("div",ei,[r(me,{name:R.type==="warning"?"i-lucide-alert-triangle":"i-lucide-lightbulb",class:Z([R.type==="warning"?"text-amber-600":"text-blue-600","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),o("div",null,[o("p",{class:Z(R.type==="warning"?"text-amber-800 dark:text-amber-200 font-medium":"text-blue-800 dark:text-blue-200 font-medium")},c(R.message),3),o("p",{class:Z([R.type==="warning"?"text-amber-700 dark:text-amber-300":"text-blue-700 dark:text-blue-300","mt-1"])},c(R.details),3)])])],2))),128))])):i("",!0),e(m)?(s(),v(ot,{key:1,icon:"i-lucide-gauge",title:"Browser performance (Web Vitals)",help:"case.web-vitals"},{default:u(()=>[o("div",ti,[e(m).navigation?(s(),v(Ee,{key:0,"min-tile-width":"10rem"},{default:u(()=>[r(de,{label:"TTFB",hint:"Time to first byte","value-class":e(m).navigation.ttfb>600?"text-red-600":e(m).navigation.ttfb>200?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.ttfb},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"DOM Interactive",hint:"DOM interactive","value-class":e(m).navigation.domInteractive>3e3?"text-red-600":e(m).navigation.domInteractive>1500?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.domInteractive},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"DOMContentLoaded",hint:"DOMContentLoaded","value-class":e(m).navigation.domContentLoaded>3e3?"text-red-600":e(m).navigation.domContentLoaded>1500?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.domContentLoaded},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"Load Complete",hint:"Page fully loaded","value-class":e(m).navigation.loadComplete>5e3?"text-red-600":e(m).navigation.loadComplete>3e3?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).navigation.loadComplete},null,8,["ms"])]),_:1},8,["value-class"])]),_:1})):i("",!0),e(m).paint&&(e(m).paint.firstPaint||e(m).paint.firstContentfulPaint)?(s(),v(Ee,{key:1,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:u(()=>[e(m).paint.firstPaint!==void 0?(s(),v(de,{key:0,label:"First Paint (FP)"},{default:u(()=>[r(ie,{ms:e(m).paint.firstPaint},null,8,["ms"])]),_:1})):i("",!0),e(m).paint.firstContentfulPaint!==void 0?(s(),v(de,{key:1,label:"First Contentful Paint (FCP)","value-class":e(m).paint.firstContentfulPaint>3e3?"text-red-600":e(m).paint.firstContentfulPaint>1800?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).paint.firstContentfulPaint},null,8,["ms"])]),_:1},8,["value-class"])):i("",!0)]),_:1})):i("",!0),e(m).vitals?(s(),v(Ee,{key:2,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:u(()=>[r(de,{label:"Largest Contentful Paint (LCP)","value-class":e(m).vitals.lcp==null?"text-gray-400":e(m).vitals.lcp>4e3?"text-red-600":e(m).vitals.lcp>2500?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).vitals.lcp,fallback:"n/a"},null,8,["ms"])]),_:1},8,["value-class"]),r(de,{label:"Cumulative Layout Shift (CLS)",value:e(m).vitals.cls!=null?String(e(m).vitals.cls):"n/a","value-class":e(m).vitals.cls==null?"text-gray-400":e(m).vitals.cls>.25?"text-red-600":e(m).vitals.cls>.1?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),r(de,{label:"Interaction to Next Paint (INP)","value-class":e(m).vitals.inp==null?"text-gray-400":e(m).vitals.inp>500?"text-red-600":e(m).vitals.inp>200?"text-orange-500":"text-green-600"},{default:u(()=>[r(ie,{ms:e(m).vitals.inp,fallback:"n/a"},null,8,["ms"])]),_:1},8,["value-class"])]),_:1})):i("",!0),e(m).navigation?.url?(s(),a("div",si,[I[8]||(I[8]=f(" Page: ",-1)),o("code",ni,c(e(m).navigation.url),1)])):i("",!0)])]),_:1})):i("",!0),e(V).length===0&&!e(m)?(s(),v(Jt,{key:2,icon:"i-lucide-gauge",title:"No performance hints or Web Vitals for this execution",text:"Web Vitals and step timing come from the Piwi capture fixtures — extend your Playwright test with piwiFixtures to collect them.",doc:"capture-fixtures"})):i("",!0)])]),"tab-history":u(()=>[o("div",ai,[e(d)&&e(d).length>0?(s(),a("div",oi,[o("div",ri,[e(n)?.testCaseId?(s(),v(be,{key:0,to:`/test-cases/${e(n).testCaseId}`,size:"xs",variant:"outline",color:"neutral","trailing-icon":"i-lucide-arrow-right"},{default:u(()=>[...I[9]||(I[9]=[f(" View full test history ",-1)])]),_:1},8,["to"])):i("",!0)]),r(Qt,{data:e(d),height:200},null,8,["data"]),r(ut,{"min-width":"44rem",bleed:!1},{default:u(()=>[r(ct,{data:e(d),columns:ae,ui:{base:"table-fixed border-separate border-spacing-0 min-w-[44rem]",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default"}},{"startTime-cell":u(({row:R})=>[o("span",ii,[o("span",li,c(new Date(R.original.startTime).toLocaleDateString("en-US",{month:"short",day:"numeric"})),1),o("span",ci,c(new Date(R.original.startTime).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})),1)])]),"status-cell":u(({row:R})=>[r(Ne,{color:("getStatusColor"in p?p.getStatusColor:e(qs))(R.original.status),variant:"subtle",class:"capitalize"},{default:u(()=>[f(c(R.original.status),1)]),_:2},1032,["color"])]),"duration-cell":u(({row:R})=>[R.original.duration!==null?(s(),v(ie,{key:0,ms:R.original.duration},null,8,["ms"])):(s(),a("span",ui,"—"))]),"runId-cell":u(({row:R})=>[r(le,{to:`/test-runs/${R.original.runId}`,class:"text-primary hover:underline"},{default:u(()=>[f(" #"+c(R.original.runId),1)]),_:2},1032,["to"])]),"error-cell":u(({row:R})=>[R.original.error?(s(),a("span",{key:0,class:"text-red-600 text-xs truncate max-w-xs block",title:R.original.error},c(R.original.error.length>80?`${R.original.error.substring(0,80)}…`:R.original.error),9,di)):i("",!0)]),_:1},8,["data"])]),_:1})])):(s(),v(dt,{key:1,icon:"i-lucide-trending-up",text:"No prior executions of this test yet."},{default:u(()=>[...I[10]||(I[10]=[o("p",{class:"text-xs text-gray-400"}," This is the first recorded run. Once it runs again, its status and duration trend appear here. ",-1)])]),_:1}))])]),_:1},8,["modelValue","tab-items"])]),_:1})}}});export{pl as default};
@@ -1 +1 @@
1
- import{r}from"./C5TrTuWv.js";function n(i){const o=`piwi-tree-view-${i}`,t=r(!1);try{const e=document.cookie.match(new RegExp(`(?:^|;\\s*)${o}=([^;]*)`));e&&(t.value=e[1]==="true")}catch{}function c(e){t.value=e,document.cookie=`${o}=${e}; path=/; max-age=31536000; sameSite=lax`}return{treeView:t,setTreeView:c}}export{n as u};
1
+ import{r}from"./BzBaMPgu.js";function n(i){const o=`piwi-tree-view-${i}`,t=r(!1);try{const e=document.cookie.match(new RegExp(`(?:^|;\\s*)${o}=([^;]*)`));e&&(t.value=e[1]==="true")}catch{}function c(e){t.value=e,document.cookie=`${o}=${e}; path=/; max-age=31536000; sameSite=lax`}return{treeView:t,setTreeView:c}}export{n as u};
@@ -1 +1 @@
1
- import{_ as L}from"./C7D5Wl7T.js";import{d as z,b as O,w as P,c as u,i as t,k as s,f as j,v as w,j as a,g as r,F as x,D as M,o as c,p as N,m as p,y as A,t as i,_ as W,l as q,r as y}from"./C5TrTuWv.js";import{_ as G}from"./COuZu9FO.js";import{_ as K}from"./DMAiMrNr.js";import{_ as Z}from"./Ce5_Tq63.js";import{_ as H}from"./DH5H1DJh.js";import{_ as J}from"./6Z_ZwH8I.js";import{f as B}from"./D-c8ZSws.js";import{e as Q,g as X}from"./B69RP95P.js";import{u as Y}from"./T5UuMUxA.js";import"./DuOH5jcQ.js";import"./C8Paf_V1.js";import"./DaNC-xl1.js";import"./D_y2VS8k.js";import"./BjaRappk.js";const ee={class:"space-y-6"},te={class:"space-y-3"},se={class:"flex items-center gap-2 text-sm text-muted"},oe={class:"grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"},ae={class:"text-muted"},ne={class:"flex items-center gap-2 font-mono"},le={class:"text-xs"},ie={key:0,class:"flex items-center gap-2 py-4 text-muted"},re={key:1,class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},de={class:"space-y-1"},ce={class:"text-2xl font-semibold"},me={class:"space-y-1"},ue={class:"text-2xl font-semibold"},pe={class:"space-y-1"},_e={class:"text-2xl font-semibold"},fe={class:"space-y-1"},ge={class:"text-2xl font-semibold"},ve={class:"space-y-1"},xe={class:"text-2xl font-semibold"},ye={class:"space-y-1"},be={class:"text-2xl font-semibold"},he={class:"space-y-1"},Ce={class:"text-2xl font-semibold"},ke={class:"flex flex-col sm:flex-row items-start sm:items-center gap-4"},je=z({__name:"storage",async setup(Se){let _,b;const h=O(),{data:n,refresh:C,pending:k}=([_,b]=P(()=>Y("/api/admin/stats","$phmoZI6KTi")),_=await _,b(),_),T=Q("storage").map(o=>({name:o,...X(o)})),$=[{label:"7 days",value:7},{label:"14 days",value:14},{label:"30 days",value:30},{label:"60 days",value:60},{label:"90 days",value:90},{label:"180 days",value:180},{label:"1 year",value:365}],d=y(30),m=y(!1),f=y(!1);async function D(){m.value=!1,f.value=!0;try{const o=await $fetch("/api/admin/cleanup",{method:"DELETE",body:{olderThanDays:d.value}});h.add({title:"Cleanup complete",description:`Deleted ${o.deletedRuns} test run(s) older than ${d.value} days.`,color:"success"}),await C()}catch(o){const e=o&&typeof o=="object"&&"data"in o?o.data?.message:void 0;h.add({title:"Cleanup failed",description:e||"An error occurred",color:"error"})}finally{f.value=!1}}return(o,e)=>{const V=L,S=N,E=G,v=K,g=W,F=Z,R=H,U=J,I=M;return c(),u(x,null,[t("div",ee,[s(n)?(c(),j(V,{key:0,database:s(n).databaseLocation,storage:s(n).storageLocation},null,8,["database","storage"])):w("",!0),a(v,{icon:"i-lucide-server",title:"Storage backend",help:"settings.storage-backend"},{subtitle:r(()=>[...e[5]||(e[5]=[p(" Configured through environment variables. The active backend is shown read-only. ",-1)])]),default:r(()=>[t("div",te,[t("div",se,[a(S,{name:"i-lucide-info",class:"size-4"}),e[6]||(e[6]=p(" Storage backend selection (local disk or S3) and its credentials are set via the environment. Each variable below is shown read-only — hover the lock to see what it controls. ",-1))]),t("div",oe,[(c(!0),u(x,null,A(s(T),l=>(c(),u(x,{key:l.name},[t("div",ae,i(l.name.replace("PIWI_S3_","S3 ").replace("PIWI_STORAGE_","Storage ")),1),t("div",ne,[t("code",le,i(l.name),1),a(E,{"env-vars":[l.name]},null,8,["env-vars"])])],64))),128))])])]),_:1}),a(v,{icon:"i-lucide-database",title:"Storage statistics",help:"settings.storage-stats"},{footer:r(()=>[a(g,{icon:"i-lucide-refresh-cw",variant:"outline",size:"sm",loading:s(k),label:"Refresh",onClick:e[0]||(e[0]=l=>s(C)())},null,8,["loading"])]),default:r(()=>[s(k)?(c(),u("div",ie,[a(S,{name:"i-lucide-loader-2",class:"animate-spin"}),e[7]||(e[7]=p(" Loading… ",-1))])):s(n)?(c(),u("div",re,[t("div",de,[e[8]||(e[8]=t("p",{class:"text-sm text-muted"},"Projects",-1)),t("p",ce,i(s(n).totalProjects),1)]),t("div",me,[e[9]||(e[9]=t("p",{class:"text-sm text-muted"},"Test runs",-1)),t("p",ue,i(s(n).totalRuns),1)]),t("div",pe,[e[10]||(e[10]=t("p",{class:"text-sm text-muted"},"Test cases (unique)",-1)),t("p",_e,i(s(n).totalTestCases),1)]),t("div",fe,[e[11]||(e[11]=t("p",{class:"text-sm text-muted"},"Test results",-1)),t("p",ge,i(s(n).totalRunsCases),1)]),t("div",ve,[e[12]||(e[12]=t("p",{class:"text-sm text-muted"},"Stored files",-1)),t("p",xe,i(s(n).totalFiles),1)]),t("div",ye,[e[13]||(e[13]=t("p",{class:"text-sm text-muted"},"File size (DB)",-1)),t("p",be,i(("formatBytes"in o?o.formatBytes:s(B))(s(n).totalFileSize)),1)]),t("div",he,[e[14]||(e[14]=t("p",{class:"text-sm text-muted"},"Storage on disk",-1)),t("p",Ce,i(("formatBytes"in o?o.formatBytes:s(B))(s(n).storageSizeOnDisk)),1)])])):w("",!0)]),_:1}),a(v,{icon:"i-lucide-trash-2",title:"Cleanup old test runs",help:"settings.cleanup"},{default:r(()=>[t("div",ke,[a(R,{label:"Delete runs older than",name:"period"},{default:r(()=>[a(F,{modelValue:s(d),"onUpdate:modelValue":e[1]||(e[1]=l=>q(d)?d.value=l:null),items:$},null,8,["modelValue"])]),_:1}),a(g,{icon:"i-lucide-trash-2",color:"error",variant:"soft",loading:s(f),label:"Run cleanup",class:"mt-4 sm:mt-5",onClick:e[2]||(e[2]=l=>m.value=!0)},null,8,["loading"])])]),_:1})]),a(I,null,{default:r(()=>[a(U,{open:s(m),title:"Confirm cleanup","onUpdate:open":e[4]||(e[4]=l=>m.value=l)},{body:r(()=>[t("p",null,[e[15]||(e[15]=p(" This will permanently delete all test runs older than ",-1)),t("strong",null,i(s(d))+" days",1),e[16]||(e[16]=p(", along with their associated reports, traces, and test results. This action cannot be undone. ",-1))])]),footer:r(()=>[a(g,{color:"neutral",variant:"ghost",label:"Cancel",onClick:e[3]||(e[3]=l=>m.value=!1)}),a(g,{color:"error",label:"Delete",icon:"i-lucide-trash-2",loading:s(f),onClick:D},null,8,["loading"])]),_:1},8,["open"])]),_:1})],64)}}});export{je as default};
1
+ import{_ as I}from"./CkdznmkX.js";import{d as L,q as O,w as P,c as u,g as t,b as s,e as j,l as w,h as a,f as r,F as x,E as M,o as c,_ as N,k as p,z as A,t as i,j as q,x as W,r as y}from"./BzBaMPgu.js";import{_ as G}from"./DRNHuVn4.js";import{_ as K}from"./D_j436ND.js";import{_ as Z}from"./CnRNwiuE.js";import{_ as H}from"./Bg8yOdSf.js";import{_ as J}from"./BbXvpkBp.js";import{f as B}from"./D-c8ZSws.js";import{e as Q,g as X}from"./qeqzb80l.js";import{u as Y}from"./CDEmotIt.js";import"./BSKLNgre.js";import"./kDEwM7SQ.js";import"./DDho3MJD.js";import"./CTYlay1H.js";import"./BcHU1KNK.js";const ee={class:"space-y-6"},te={class:"space-y-3"},se={class:"flex items-center gap-2 text-sm text-muted"},oe={class:"grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"},ae={class:"text-muted"},ne={class:"flex items-center gap-2 font-mono"},le={class:"text-xs"},ie={key:0,class:"flex items-center gap-2 py-4 text-muted"},re={key:1,class:"grid grid-cols-2 sm:grid-cols-3 gap-4"},de={class:"space-y-1"},ce={class:"text-2xl font-semibold"},me={class:"space-y-1"},ue={class:"text-2xl font-semibold"},pe={class:"space-y-1"},_e={class:"text-2xl font-semibold"},fe={class:"space-y-1"},ge={class:"text-2xl font-semibold"},ve={class:"space-y-1"},xe={class:"text-2xl font-semibold"},ye={class:"space-y-1"},be={class:"text-2xl font-semibold"},he={class:"space-y-1"},Ce={class:"text-2xl font-semibold"},ke={class:"flex flex-col sm:flex-row items-start sm:items-center gap-4"},je=L({__name:"storage",async setup(Se){let _,b;const h=O(),{data:n,refresh:C,pending:k}=([_,b]=P(()=>Y("/api/admin/stats","$phmoZI6KTi")),_=await _,b(),_),T=Q("storage").map(o=>({name:o,...X(o)})),$=[{label:"7 days",value:7},{label:"14 days",value:14},{label:"30 days",value:30},{label:"60 days",value:60},{label:"90 days",value:90},{label:"180 days",value:180},{label:"1 year",value:365}],d=y(30),m=y(!1),f=y(!1);async function E(){m.value=!1,f.value=!0;try{const o=await $fetch("/api/admin/cleanup",{method:"DELETE",body:{olderThanDays:d.value}});h.add({title:"Cleanup complete",description:`Deleted ${o.deletedRuns} test run(s) older than ${d.value} days.`,color:"success"}),await C()}catch(o){const e=o&&typeof o=="object"&&"data"in o?o.data?.message:void 0;h.add({title:"Cleanup failed",description:e||"An error occurred",color:"error"})}finally{f.value=!1}}return(o,e)=>{const V=I,S=N,D=G,v=K,g=q,F=Z,R=H,U=J,z=M;return c(),u(x,null,[t("div",ee,[s(n)?(c(),j(V,{key:0,database:s(n).databaseLocation,storage:s(n).storageLocation},null,8,["database","storage"])):w("",!0),a(v,{icon:"i-lucide-server",title:"Storage backend",help:"settings.storage-backend"},{subtitle:r(()=>[...e[5]||(e[5]=[p(" Configured through environment variables. The active backend is shown read-only. ",-1)])]),default:r(()=>[t("div",te,[t("div",se,[a(S,{name:"i-lucide-info",class:"size-4"}),e[6]||(e[6]=p(" Storage backend selection (local disk or S3) and its credentials are set via the environment. Each variable below is shown read-only — hover the lock to see what it controls. ",-1))]),t("div",oe,[(c(!0),u(x,null,A(s(T),l=>(c(),u(x,{key:l.name},[t("div",ae,i(l.name.replace("PIWI_S3_","S3 ").replace("PIWI_STORAGE_","Storage ")),1),t("div",ne,[t("code",le,i(l.name),1),a(D,{"env-vars":[l.name]},null,8,["env-vars"])])],64))),128))])])]),_:1}),a(v,{icon:"i-lucide-database",title:"Storage statistics",help:"settings.storage-stats"},{footer:r(()=>[a(g,{icon:"i-lucide-refresh-cw",variant:"outline",size:"sm",loading:s(k),label:"Refresh",onClick:e[0]||(e[0]=l=>s(C)())},null,8,["loading"])]),default:r(()=>[s(k)?(c(),u("div",ie,[a(S,{name:"i-lucide-loader-2",class:"animate-spin"}),e[7]||(e[7]=p(" Loading… ",-1))])):s(n)?(c(),u("div",re,[t("div",de,[e[8]||(e[8]=t("p",{class:"text-sm text-muted"},"Projects",-1)),t("p",ce,i(s(n).totalProjects),1)]),t("div",me,[e[9]||(e[9]=t("p",{class:"text-sm text-muted"},"Test runs",-1)),t("p",ue,i(s(n).totalRuns),1)]),t("div",pe,[e[10]||(e[10]=t("p",{class:"text-sm text-muted"},"Test cases (unique)",-1)),t("p",_e,i(s(n).totalTestCases),1)]),t("div",fe,[e[11]||(e[11]=t("p",{class:"text-sm text-muted"},"Test results",-1)),t("p",ge,i(s(n).totalRunsCases),1)]),t("div",ve,[e[12]||(e[12]=t("p",{class:"text-sm text-muted"},"Stored files",-1)),t("p",xe,i(s(n).totalFiles),1)]),t("div",ye,[e[13]||(e[13]=t("p",{class:"text-sm text-muted"},"File size (DB)",-1)),t("p",be,i(("formatBytes"in o?o.formatBytes:s(B))(s(n).totalFileSize)),1)]),t("div",he,[e[14]||(e[14]=t("p",{class:"text-sm text-muted"},"Storage on disk",-1)),t("p",Ce,i(("formatBytes"in o?o.formatBytes:s(B))(s(n).storageSizeOnDisk)),1)])])):w("",!0)]),_:1}),a(v,{icon:"i-lucide-trash-2",title:"Cleanup old test runs",help:"settings.cleanup"},{default:r(()=>[t("div",ke,[a(R,{label:"Delete runs older than",name:"period"},{default:r(()=>[a(F,{modelValue:s(d),"onUpdate:modelValue":e[1]||(e[1]=l=>W(d)?d.value=l:null),items:$},null,8,["modelValue"])]),_:1}),a(g,{icon:"i-lucide-trash-2",color:"error",variant:"soft",loading:s(f),label:"Run cleanup",class:"mt-4 sm:mt-5",onClick:e[2]||(e[2]=l=>m.value=!0)},null,8,["loading"])])]),_:1})]),a(z,null,{default:r(()=>[a(U,{open:s(m),title:"Confirm cleanup","onUpdate:open":e[4]||(e[4]=l=>m.value=l)},{body:r(()=>[t("p",null,[e[15]||(e[15]=p(" This will permanently delete all test runs older than ",-1)),t("strong",null,i(s(d))+" days",1),e[16]||(e[16]=p(", along with their associated reports, traces, and test results. This action cannot be undone. ",-1))])]),footer:r(()=>[a(g,{color:"neutral",variant:"ghost",label:"Cancel",onClick:e[3]||(e[3]=l=>m.value=!1)}),a(g,{color:"error",label:"Delete",icon:"i-lucide-trash-2",loading:s(f),onClick:E},null,8,["loading"])]),_:1},8,["open"])]),_:1})],64)}}});export{je as default};
@@ -0,0 +1 @@
1
+ import{v as h}from"./BzBaMPgu.js";function r(s){if(!s.location)return s.title;const o=s.location.match(/^(.*):(\d+):(\d+)$/);return`${o?o[1]:s.location}::${s.title}`}function C(s,o){const c=h(()=>{if(!s.value?.testCases||!o.value?.testCases)return[];const d=new Map;for(const t of s.value.testCases)d.set(r(t),t);const u=[];for(const t of o.value.testCases){const a=d.get(r(t)),l=a?.duration??null,n=t.duration??null;let e=null,f=null;l!==null&&n!==null&&(e=n-l,f=l>0?Math.round((n-l)/l*100):null),u.push({title:t.title,location:t.location??null,statusA:a?.status??null,statusB:t.status,durationA:l,durationB:n,delta:e,percentChange:f})}const i=new Set(o.value.testCases.map(r));for(const t of s.value.testCases)i.has(r(t))||u.push({title:t.title,location:t.location??null,statusA:t.status,statusB:null,durationA:t.duration??null,durationB:null,delta:null,percentChange:null});return u.sort((t,a)=>Math.abs(a.delta??0)-Math.abs(t.delta??0))}),p=h(()=>{let u=0,i=0,t=0,a=0,l=0,n=0;for(const e of c.value)e.statusA==="passed"&&e.statusB==="failed"?a++:e.statusA==="failed"&&e.statusB==="passed"?l++:e.statusA==="failed"&&e.statusB==="failed"&&n++,e.percentChange!==null&&(e.percentChange<-10?u++:e.percentChange>10?i++:t++);return{improved:u,regressed:i,unchanged:t,newFailures:a,recovered:l,stillFailing:n}});return{comparisonData:c,comparisonSummary:p}}export{C as u};