@piwitests/server 0.15.0 → 0.16.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 (457) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{DzbOHjZH.js → -KQO1A4C.js} +1 -1
  3. package/.output/public/_nuxt/{BEKwVcvQ.js → 1AB111xL.js} +1 -1
  4. package/.output/public/_nuxt/{CokbKVE6.js → 2xvsvjLO.js} +1 -1
  5. package/.output/public/_nuxt/{CNzoIhwN.js → ABGJk0pu.js} +1 -1
  6. package/.output/public/_nuxt/{Cgr8IKY4.js → B2lYFco4.js} +1 -1
  7. package/.output/public/_nuxt/B33X4zrC.js +1 -0
  8. package/.output/public/_nuxt/{V1BQiRoh.js → B3NbDoBP.js} +1 -1
  9. package/.output/public/_nuxt/{ChWPXucC.js → B3sNtVnf.js} +1 -1
  10. package/.output/public/_nuxt/{too3WhRB.js → B43OGXzV.js} +1 -1
  11. package/.output/public/_nuxt/{Cf3RuiXF.js → B6Jp7fpa.js} +4 -4
  12. package/.output/public/_nuxt/{B32ySRXg.js → B7yG1G_l.js} +1 -1
  13. package/.output/public/_nuxt/{BgR7oL4p.js → BBdfPriC.js} +1 -1
  14. package/.output/public/_nuxt/{DNP5tTJo.js → BGYbnqA7.js} +1 -1
  15. package/.output/public/_nuxt/{DAeYEeCC.js → BIf1R_fu.js} +1 -1
  16. package/.output/public/_nuxt/{nUsJV5qo.js → BIksQZfR.js} +1 -1
  17. package/.output/public/_nuxt/{B8fs6GU9.js → BPKwYP2Q.js} +31 -31
  18. package/.output/public/_nuxt/{DjCfCT_5.js → BP_SWi7S.js} +1 -1
  19. package/.output/public/_nuxt/{CrFCPOnY.js → BQrSEuzu.js} +1 -1
  20. package/.output/public/_nuxt/{BpepjHwc.js → BR9H8k-L.js} +1 -1
  21. package/.output/public/_nuxt/{Dejf0f7D.js → BRKa6EQR.js} +3 -3
  22. package/.output/public/_nuxt/{BMQIO38j.js → BS0gKVuF.js} +1 -1
  23. package/.output/public/_nuxt/{BW1UOxWn.js → BV83yObd.js} +1 -1
  24. package/.output/public/_nuxt/{o5WQ5Z7k.js → BVW5qIDP.js} +1 -1
  25. package/.output/public/_nuxt/{rvaZFYoE.js → BY4oA2IH.js} +1 -1
  26. package/.output/public/_nuxt/{DZoSxwj6.js → BZekCf_x.js} +1 -1
  27. package/.output/public/_nuxt/{lRMjXqiA.js → Bb64FEFL.js} +1 -1
  28. package/.output/public/_nuxt/{2PU-adwy.js → BdFEUAlx.js} +1 -1
  29. package/.output/public/_nuxt/{CBrCcDzR.js → Bf62wdzp.js} +1 -1
  30. package/.output/public/_nuxt/{DYDGGqZ3.js → BkDfdHFm.js} +1 -1
  31. package/.output/public/_nuxt/{CqA3gM8h.js → BoRFLTAO.js} +1 -1
  32. package/.output/public/_nuxt/{DxXZN6ed.js → BpIsBP5g.js} +1 -1
  33. package/.output/public/_nuxt/{DkFbpSsi.js → BpNqHxg2.js} +1 -1
  34. package/.output/public/_nuxt/{DFw8I2FL.js → BpceIssd.js} +1 -1
  35. package/.output/public/_nuxt/{n7Htv9PJ.js → Br2K9yi_.js} +1 -1
  36. package/.output/public/_nuxt/{D4nLD93c.js → BuZOa2M3.js} +1 -1
  37. package/.output/public/_nuxt/{B32-7cBF.js → Bvfmwzgw.js} +1 -1
  38. package/.output/public/_nuxt/{h-e-Ca3f.js → Bzl2H_vl.js} +1 -1
  39. package/.output/public/_nuxt/{IdQR_Djw.js → C1K3r_fc.js} +1 -1
  40. package/.output/public/_nuxt/C219JuBV.js +1 -0
  41. package/.output/public/_nuxt/{B_80i5Ge.js → C38aZbFJ.js} +1 -1
  42. package/.output/public/_nuxt/{DHVmXA9K.js → C3r_Sv1p.js} +1 -1
  43. package/.output/public/_nuxt/{O1A-LRgV.js → C8RBRg7I.js} +1 -1
  44. package/.output/public/_nuxt/{60-Zii7v.js → CCRRqXez.js} +1 -1
  45. package/.output/public/_nuxt/{__m3KqHO.js → CJFqA_QW.js} +1 -1
  46. package/.output/public/_nuxt/{Surk4Lw-.js → CKB_doYB.js} +1 -1
  47. package/.output/public/_nuxt/{DaKVSp-6.js → CMYQpoOI.js} +1 -1
  48. package/.output/public/_nuxt/CQeMb57w.js +1 -0
  49. package/.output/public/_nuxt/{Bq2ZPvIH.js → CSYJwpXG.js} +1 -1
  50. package/.output/public/_nuxt/{ETOCcsVw.js → CTdvGdc2.js} +1 -1
  51. package/.output/public/_nuxt/CX1dcT4v.js +1 -0
  52. package/.output/public/_nuxt/{evCxpgbd.js → CdME81ij.js} +2 -2
  53. package/.output/public/_nuxt/{DKTDub7I.js → CgoAUz76.js} +1 -1
  54. package/.output/public/_nuxt/{0KrkW531.js → CoHGrO41.js} +1 -1
  55. package/.output/public/_nuxt/{BGsuOpiq.js → CpO-ABDW.js} +1 -1
  56. package/.output/public/_nuxt/CuYYdFBL.js +1 -0
  57. package/.output/public/_nuxt/{CHMpVLqo.js → D2jhe9JK.js} +1 -1
  58. package/.output/public/_nuxt/{C7RarFGi.js → D33On6AX.js} +1 -1
  59. package/.output/public/_nuxt/{Dv2B_nw_.js → D4VpoHDP.js} +1 -1
  60. package/.output/public/_nuxt/{CKZn0TUX.js → DAWn6Z7h.js} +1 -1
  61. package/.output/public/_nuxt/{rWwWS3Kj.js → DCpmQ47_.js} +1 -1
  62. package/.output/public/_nuxt/{B59-l1Cv.js → DIkLLyR6.js} +1 -1
  63. package/.output/public/_nuxt/{CFn3w5jn.js → DJS3Bf50.js} +1 -1
  64. package/.output/public/_nuxt/{F07TcX0U.js → DL20rwkA.js} +1 -1
  65. package/.output/public/_nuxt/DOuoR2Pk.js +34 -0
  66. package/.output/public/_nuxt/{BC_Wu-fv.js → DRtTLQri.js} +1 -1
  67. package/.output/public/_nuxt/{DiUGa0CT.js → DbeHHTk-.js} +1 -1
  68. package/.output/public/_nuxt/DcCNnjKl.js +1 -0
  69. package/.output/public/_nuxt/{PPFO8UVt.js → DdbrJwT-.js} +1 -1
  70. package/.output/public/_nuxt/{Cfk2_UCm.js → DfcAIbcX.js} +1 -1
  71. package/.output/public/_nuxt/{OG2n3p77.js → DgYM3eyi.js} +1 -1
  72. package/.output/public/_nuxt/{BBJ9Pu3M.js → DhA17dqR.js} +1 -1
  73. package/.output/public/_nuxt/{DvdOsTLb.js → DjZKuUMz.js} +1 -1
  74. package/.output/public/_nuxt/{DCCMLWel.js → DqnyWaSQ.js} +1 -1
  75. package/.output/public/_nuxt/Dsk4Ic18.js +7 -0
  76. package/.output/public/_nuxt/{BCK4f6Y3.js → DszOHBMG.js} +1 -1
  77. package/.output/public/_nuxt/{Cpquifvd.js → DuBBqqbF.js} +1 -1
  78. package/.output/public/_nuxt/{DWzdeQ3Z.js → DuMv-ugy.js} +1 -1
  79. package/.output/public/_nuxt/{BfshMo9k.js → Dz55UR7w.js} +2 -2
  80. package/.output/public/_nuxt/{BkhdAGx0.js → Dzz9_Z0u.js} +1 -1
  81. package/.output/public/_nuxt/{DgZlpN9l.js → HoKG9cc2.js} +1 -1
  82. package/.output/public/_nuxt/{C9jjVEQU.js → IFqRT_xJ.js} +1 -1
  83. package/.output/public/_nuxt/{i38YGG9S.js → JCFZINev.js} +1 -1
  84. package/.output/public/_nuxt/{B9Q_4Mjt.js → Kc7La4sL.js} +1 -1
  85. package/.output/public/_nuxt/N3pCB6-m.js +4 -0
  86. package/.output/public/_nuxt/{CFXonrwQ.js → WctJXszi.js} +1 -1
  87. package/.output/public/_nuxt/{CHgsEM4U.js → bAfTAihV.js} +1 -1
  88. package/.output/public/_nuxt/builds/latest.json +1 -1
  89. package/.output/public/_nuxt/builds/meta/5182c9fb-56a6-4df2-9685-4020a08ce7a5.json +1 -0
  90. package/.output/public/_nuxt/{4fB15L_7.js → d5ZB3uxF.js} +1 -1
  91. package/.output/public/_nuxt/{CIOQo6gB.js → e1zUTrBb.js} +1 -1
  92. package/.output/public/_nuxt/entry.BsmKRJzR.css +1 -0
  93. package/.output/public/_nuxt/{BtJkQ3to.js → iwD5atI2.js} +1 -1
  94. package/.output/public/_nuxt/jIF87ALb.js +1 -0
  95. package/.output/public/_nuxt/{CvCF77E-.js → k-z_VVTK.js} +2 -2
  96. package/.output/public/_nuxt/{CHSkT2s0.js → l0gdGdar.js} +1 -1
  97. package/.output/public/_nuxt/{DVdOm5Bg.js → mGJLLqyN.js} +1 -1
  98. package/.output/public/_nuxt/{CU-OXXdh.js → mfzslNx_.js} +1 -1
  99. package/.output/public/_nuxt/{CD-xwM9N.js → nCjfWTGm.js} +1 -1
  100. package/.output/public/_nuxt/{DQpa8F03.js → oNq5pd3r.js} +1 -1
  101. package/.output/public/_nuxt/qzAP_nm7.js +1 -0
  102. package/.output/public/_nuxt/{3SnTawZW.js → r3SBLxtE.js} +1 -1
  103. package/.output/public/_nuxt/{DI_-kFec.js → uKeO2H7F.js} +1 -1
  104. package/.output/public/_nuxt/{DZLrAp2i.js → xUrLy-Zn.js} +1 -1
  105. package/.output/public/_nuxt/{BY0AkhJh.js → ze9-Ill2.js} +1 -1
  106. package/.output/public/demo/seed.version.json +2 -2
  107. package/.output/public/sw.js +1 -1
  108. package/.output/server/chunks/_/markers.mjs +1 -1
  109. package/.output/server/chunks/_/users.mjs +1 -1
  110. package/.output/server/chunks/build/{BrowserBadge-BTA4QU_J.mjs → BrowserBadge-DNCp9pF-.mjs} +3 -3
  111. package/.output/server/chunks/build/BrowserBadge-DNCp9pF-.mjs.map +1 -0
  112. package/.output/server/chunks/build/{ChartCard-BqAhMip2.mjs → ChartCard-Fr557IbV.mjs} +2 -2
  113. package/.output/server/chunks/build/ChartCard-Fr557IbV.mjs.map +1 -0
  114. package/.output/server/chunks/build/{Checkbox-_1nGm_DR.mjs → Checkbox-7ZiMz60w.mjs} +5 -5
  115. package/.output/server/chunks/build/Checkbox-7ZiMz60w.mjs.map +1 -0
  116. package/.output/server/chunks/build/{CiEnvCard-DAufYuJw.mjs → CiEnvCard-DNxBVvx4.mjs} +5 -5
  117. package/.output/server/chunks/build/CiEnvCard-DNxBVvx4.mjs.map +1 -0
  118. package/.output/server/chunks/build/{CodeBlock-BVKHuYjU.mjs → CodeBlock-BGwNmJ8J.mjs} +2 -2
  119. package/.output/server/chunks/build/CodeBlock-BGwNmJ8J.mjs.map +1 -0
  120. package/.output/server/chunks/build/{DashboardNavbar-BR6j4VLd.mjs → DashboardNavbar-Bdp-OwTN.mjs} +2 -2
  121. package/.output/server/chunks/build/DashboardNavbar-Bdp-OwTN.mjs.map +1 -0
  122. package/.output/server/chunks/build/DashboardSidebarToggle-Ji6ADuqF.mjs +1 -1
  123. package/.output/server/chunks/build/{DiagnosisPanel-BnrdXDvd.mjs → DiagnosisPanel-DV1xwGu4.mjs} +6 -6
  124. package/.output/server/chunks/build/DiagnosisPanel-DV1xwGu4.mjs.map +1 -0
  125. package/.output/server/chunks/build/EntityLinks-DeOP13Kr.mjs +1 -1
  126. package/.output/server/chunks/build/{EnvManagedBadge-DdnEtjIl.mjs → EnvManagedBadge-Qpn58Nmr.mjs} +5 -5
  127. package/.output/server/chunks/build/EnvManagedBadge-Qpn58Nmr.mjs.map +1 -0
  128. package/.output/server/chunks/build/{HelpHint-D_GJzMpW.mjs → HelpHint-YEMWtKu1.mjs} +18 -2
  129. package/.output/server/chunks/build/HelpHint-YEMWtKu1.mjs.map +1 -0
  130. package/.output/server/chunks/build/{Modal-COIjm3js.mjs → Modal-CfA78Hm1.mjs} +2 -2
  131. package/.output/server/chunks/build/Modal-CfA78Hm1.mjs.map +1 -0
  132. package/.output/server/chunks/build/{OpenInIdeLink-D97W6On1.mjs → OpenInIdeLink-B92wosXu.mjs} +3 -3
  133. package/.output/server/chunks/build/{OpenInIdeLink-D97W6On1.mjs.map → OpenInIdeLink-B92wosXu.mjs.map} +1 -1
  134. package/.output/server/chunks/build/{PageStateCard-C1HFN4Nv.mjs → PageStateCard-Bwee6JTk.mjs} +10 -10
  135. package/.output/server/chunks/build/{PageStateCard-C1HFN4Nv.mjs.map → PageStateCard-Bwee6JTk.mjs.map} +1 -1
  136. package/.output/server/chunks/build/{ProjectTestCasesTable-XFBPQGIX.mjs → ProjectTestCasesTable-9418EI8J.mjs} +9 -9
  137. package/.output/server/chunks/build/ProjectTestCasesTable-9418EI8J.mjs.map +1 -0
  138. package/.output/server/chunks/build/{RunReports-ChNkmuWa.mjs → RunReports-BpJqLHY9.mjs} +2 -2
  139. package/.output/server/chunks/build/RunReports-BpJqLHY9.mjs.map +1 -0
  140. package/.output/server/chunks/build/{RunStatusBadge-CXpuCUGQ.mjs → RunStatusBadge-BhmJ_RKM.mjs} +2 -2
  141. package/.output/server/chunks/build/RunStatusBadge-BhmJ_RKM.mjs.map +1 -0
  142. package/.output/server/chunks/build/{SectionCard-zs9FDzps.mjs → SectionCard-COd9TuDq.mjs} +2 -2
  143. package/.output/server/chunks/build/SectionCard-COd9TuDq.mjs.map +1 -0
  144. package/.output/server/chunks/build/{Select-r3S5nkSY.mjs → Select-COwTIQlV.mjs} +3 -3
  145. package/.output/server/chunks/build/Select-COwTIQlV.mjs.map +1 -0
  146. package/.output/server/chunks/build/{SelectMenu-Dk6f8i9o.mjs → SelectMenu-BkyAHFCM.mjs} +4 -4
  147. package/.output/server/chunks/build/{SelectMenu-Dk6f8i9o.mjs.map → SelectMenu-BkyAHFCM.mjs.map} +1 -1
  148. package/.output/server/chunks/build/{Separator-pqpPG0up.mjs → Separator-CxZdx8kw.mjs} +2 -2
  149. package/.output/server/chunks/build/Separator-CxZdx8kw.mjs.map +1 -0
  150. package/.output/server/chunks/build/{SettingsField-Wdpzlt13.mjs → SettingsField-DDD4oqys.mjs} +5 -5
  151. package/.output/server/chunks/build/SettingsField-DDD4oqys.mjs.map +1 -0
  152. package/.output/server/chunks/build/{Slideover-02XjJjn0.mjs → Slideover-B95Rj237.mjs} +3 -3
  153. package/.output/server/chunks/build/Slideover-B95Rj237.mjs.map +1 -0
  154. package/.output/server/chunks/build/{Switch-gx_JXgCo.mjs → Switch-htSKgC38.mjs} +2 -2
  155. package/.output/server/chunks/build/Switch-htSKgC38.mjs.map +1 -0
  156. package/.output/server/chunks/build/{Table-C64RrBp3.mjs → Table-CPhhVzDv.mjs} +3 -3
  157. package/.output/server/chunks/build/Table-CPhhVzDv.mjs.map +1 -0
  158. package/.output/server/chunks/build/{TestStatusBar--u4VX_Xf.mjs → TestStatusBar-CEzt76wk.mjs} +2 -2
  159. package/.output/server/chunks/build/TestStatusBar-CEzt76wk.mjs.map +1 -0
  160. package/.output/server/chunks/build/{Tooltip-ui_BVvqr.mjs → Tooltip-7vwuDPrZ.mjs} +3 -3
  161. package/.output/server/chunks/build/Tooltip-7vwuDPrZ.mjs.map +1 -0
  162. package/.output/server/chunks/build/{VisuallyHiddenInput-mMsqmkjz.mjs → VisuallyHiddenInput-C9eJVpPW.mjs} +2 -2
  163. package/.output/server/chunks/build/VisuallyHiddenInput-C9eJVpPW.mjs.map +1 -0
  164. package/.output/server/chunks/build/{_id_-CFVnSs8B.mjs → _id_-BDqvTM9D.mjs} +19 -18
  165. package/.output/server/chunks/build/{_id_-CFVnSs8B.mjs.map → _id_-BDqvTM9D.mjs.map} +1 -1
  166. package/.output/server/chunks/build/{_id_-pkxJKe17.mjs → _id_-CE0Gso6i.mjs} +11 -11
  167. package/.output/server/chunks/build/_id_-CE0Gso6i.mjs.map +1 -0
  168. package/.output/server/chunks/build/{_id_-R6KGfZOC.mjs → _id_-CnwAyvvS.mjs} +257 -84
  169. package/.output/server/chunks/build/_id_-CnwAyvvS.mjs.map +1 -0
  170. package/.output/server/chunks/build/{_id_-DXJQABO8.mjs → _id_-Dy67M9Dj.mjs} +25 -25
  171. package/.output/server/chunks/build/{_id_-DXJQABO8.mjs.map → _id_-Dy67M9Dj.mjs.map} +1 -1
  172. package/.output/server/chunks/build/{about-CmtGYbC6.mjs → about-FB9PYAHK.mjs} +5 -5
  173. package/.output/server/chunks/build/about-FB9PYAHK.mjs.map +1 -0
  174. package/.output/server/chunks/build/{account-AbLuwiZP.mjs → account-Cn-eZqXM.mjs} +4 -4
  175. package/.output/server/chunks/build/account-Cn-eZqXM.mjs.map +1 -0
  176. package/.output/server/chunks/build/{ai-DR_slopS.mjs → ai-V3YOh3yx.mjs} +17 -17
  177. package/.output/server/chunks/build/ai-V3YOh3yx.mjs.map +1 -0
  178. package/.output/server/chunks/build/{analytics-BbT2-Tr-.mjs → analytics-BBlAEmj5.mjs} +235 -64
  179. package/.output/server/chunks/build/analytics-BBlAEmj5.mjs.map +1 -0
  180. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  181. package/.output/server/chunks/build/{db.client-DlA_u5y9.mjs → db.client-aHcD0wyX.mjs} +47 -22
  182. package/.output/server/chunks/build/db.client-aHcD0wyX.mjs.map +1 -0
  183. package/.output/server/chunks/build/{default-D6diRCW0.mjs → default-BfMirIgG.mjs} +17 -16
  184. package/.output/server/chunks/build/default-BfMirIgG.mjs.map +1 -0
  185. package/.output/server/chunks/build/{docs-DbYoZafk.mjs → docs-DtNcJCyb.mjs} +5 -5
  186. package/.output/server/chunks/build/{docs-DbYoZafk.mjs.map → docs-DtNcJCyb.mjs.map} +1 -1
  187. package/.output/server/chunks/build/{edit-CNV4xdYj.mjs → edit-Dsf11mL5.mjs} +8 -8
  188. package/.output/server/chunks/build/edit-Dsf11mL5.mjs.map +1 -0
  189. package/.output/server/chunks/build/fetch-8kznMtBM.mjs +1 -1
  190. package/.output/server/chunks/build/{help-content-BMumoQQF.mjs → help-content-DmFnuhNu.mjs} +6 -1
  191. package/.output/server/chunks/build/help-content-DmFnuhNu.mjs.map +1 -0
  192. package/.output/server/chunks/build/{index-Dw526KXV.mjs → index-BR9hw6qk.mjs} +10 -10
  193. package/.output/server/chunks/build/index-BR9hw6qk.mjs.map +1 -0
  194. package/.output/server/chunks/build/{index-dwYB76GO.mjs → index-Ba-Fifra.mjs} +4 -4
  195. package/.output/server/chunks/build/index-Ba-Fifra.mjs.map +1 -0
  196. package/.output/server/chunks/build/{index-rSHkKNna.mjs → index-BgpEKTSq.mjs} +505 -84
  197. package/.output/server/chunks/build/index-BgpEKTSq.mjs.map +1 -0
  198. package/.output/server/chunks/build/{index-DmHBPf7T.mjs → index-CULN3-en.mjs} +11 -2
  199. package/.output/server/chunks/build/index-CULN3-en.mjs.map +1 -0
  200. package/.output/server/chunks/build/{index-C3Ou18qD.mjs → index-DzEgjHlB.mjs} +14 -14
  201. package/.output/server/chunks/build/{index-C3Ou18qD.mjs.map → index-DzEgjHlB.mjs.map} +1 -1
  202. package/.output/server/chunks/build/{isValueEqualOrExist-DTJ5ejZs.mjs → isValueEqualOrExist-DBZjbD_3.mjs} +3 -3
  203. package/.output/server/chunks/build/isValueEqualOrExist-DBZjbD_3.mjs.map +1 -0
  204. package/.output/server/chunks/build/{login-Da5C8jP2.mjs → login-D2XZDuek.mjs} +3 -3
  205. package/.output/server/chunks/build/login-D2XZDuek.mjs.map +1 -0
  206. package/.output/server/chunks/build/{mcp-DM1t-9L_.mjs → mcp-CXwa3xU3.mjs} +8 -8
  207. package/.output/server/chunks/build/mcp-CXwa3xU3.mjs.map +1 -0
  208. package/.output/server/chunks/build/{notifications-BTPF0xA7.mjs → notifications-hJj8tbAT.mjs} +11 -11
  209. package/.output/server/chunks/build/notifications-hJj8tbAT.mjs.map +1 -0
  210. package/.output/server/chunks/build/server.mjs +37 -28
  211. package/.output/server/chunks/build/{settings-Bmw_JdBS.mjs → settings-Ci_7EXYQ.mjs} +8 -7
  212. package/.output/server/chunks/build/settings-Ci_7EXYQ.mjs.map +1 -0
  213. package/.output/server/chunks/build/{settings-metadata-CksLgMun.mjs → settings-metadata-Cp0dx0vm.mjs} +12 -3
  214. package/.output/server/chunks/build/settings-metadata-Cp0dx0vm.mjs.map +1 -0
  215. package/.output/server/chunks/build/{storage-BqR4acgi.mjs → storage-CM-Pd-9E.mjs} +191 -14
  216. package/.output/server/chunks/build/storage-CM-Pd-9E.mjs.map +1 -0
  217. package/.output/server/chunks/build/{tags-miPAzIr3.mjs → tags-DrCQ7QSw.mjs} +6 -6
  218. package/.output/server/chunks/build/tags-DrCQ7QSw.mjs.map +1 -0
  219. package/.output/server/chunks/build/{test-cases-D-LqhLpk.mjs → test-cases-DkGQB027.mjs} +14 -14
  220. package/.output/server/chunks/build/test-cases-DkGQB027.mjs.map +1 -0
  221. package/.output/server/chunks/build/timeout-hygiene-CNs71Iah.mjs +318 -0
  222. package/.output/server/chunks/build/timeout-hygiene-CNs71Iah.mjs.map +1 -0
  223. package/.output/server/chunks/build/{useAiStatus-FwqbA4gz.mjs → useAiStatus-ZO987RY7.mjs} +8 -7
  224. package/.output/server/chunks/build/useAiStatus-ZO987RY7.mjs.map +1 -0
  225. package/.output/server/chunks/build/{useSettingsNav-v_dFuTw9.mjs → useSettingsNav-D2knPCqF.mjs} +6 -6
  226. package/.output/server/chunks/build/useSettingsNav-D2knPCqF.mjs.map +1 -0
  227. package/.output/server/chunks/build/{users-D-GDKZmZ.mjs → users-NmAUZs3i.mjs} +6 -6
  228. package/.output/server/chunks/build/users-NmAUZs3i.mjs.map +1 -0
  229. package/.output/server/chunks/build/{virtualizer-BcC1XuFf.mjs → virtualizer-0-UBy7xl.mjs} +4 -4
  230. package/.output/server/chunks/build/virtualizer-0-UBy7xl.mjs.map +1 -0
  231. package/.output/server/chunks/build/{wasted-time-CFmeT_e2.mjs → wasted-time-L4kBV5Nh.mjs} +8 -8
  232. package/.output/server/chunks/build/wasted-time-L4kBV5Nh.mjs.map +1 -0
  233. package/.output/server/chunks/nitro/nitro.mjs +949 -684
  234. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  235. package/.output/server/chunks/routes/__piwi/session.get.mjs +51 -0
  236. package/.output/server/chunks/routes/__piwi/session.get.mjs.map +1 -0
  237. package/.output/server/chunks/routes/api/admin/stats.get.mjs +5 -1
  238. package/.output/server/chunks/routes/api/admin/stats.get.mjs.map +1 -1
  239. package/.output/server/chunks/routes/api/analytics/_widget_.get.mjs +75 -6
  240. package/.output/server/chunks/routes/api/analytics/_widget_.get.mjs.map +1 -1
  241. package/.output/server/chunks/routes/api/auth/change-password.post.mjs +1 -1
  242. package/.output/server/chunks/routes/api/auth/forgot-password.post.mjs +1 -1
  243. package/.output/server/chunks/routes/api/auth/login.post.mjs +1 -1
  244. package/.output/server/chunks/routes/api/auth/logout.post.mjs +1 -1
  245. package/.output/server/chunks/routes/api/auth/me.get.mjs +1 -1
  246. package/.output/server/chunks/routes/api/auth/oauth/_provider/callback.get.mjs +1 -1
  247. package/.output/server/chunks/routes/api/auth/oauth/_provider/login.get.mjs +1 -1
  248. package/.output/server/chunks/routes/api/auth/oauth/_provider/unlink.post.mjs +1 -1
  249. package/.output/server/chunks/routes/api/auth/reset-password.post.mjs +1 -1
  250. package/.output/server/chunks/routes/api/auth/send-verify-email.post.mjs +1 -1
  251. package/.output/server/chunks/routes/api/auth/setup.get.mjs +1 -1
  252. package/.output/server/chunks/routes/api/auth/setup.post.mjs +1 -1
  253. package/.output/server/chunks/routes/api/auth/verify-email.get.mjs +1 -1
  254. package/.output/server/chunks/routes/api/channels/_id/test.post.mjs +1 -1
  255. package/.output/server/chunks/routes/api/channels/_id_.delete.mjs +1 -1
  256. package/.output/server/chunks/routes/api/cluster-merge-suggestions/_id/approve.post.mjs +1 -1
  257. package/.output/server/chunks/routes/api/cluster-merge-suggestions/_id/reject.post.mjs +1 -1
  258. package/.output/server/chunks/routes/api/desktop/reporter-config.get.mjs +45 -0
  259. package/.output/server/chunks/routes/api/desktop/reporter-config.get.mjs.map +1 -0
  260. package/.output/server/chunks/routes/api/failure-clusters/_id/base-commit.patch.mjs +1 -1
  261. package/.output/server/chunks/routes/api/failure-clusters/_id/branches.get.mjs +1 -1
  262. package/.output/server/chunks/routes/api/failure-clusters/_id/commit-diff.get.mjs +1 -1
  263. package/.output/server/chunks/routes/api/failure-clusters/_id/commits.get.mjs +1 -1
  264. package/.output/server/chunks/routes/api/failure-clusters/_id/context.get.mjs +1 -1
  265. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose/stream.post.mjs +1 -1
  266. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose.post.mjs +1 -1
  267. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnoses.get.mjs +1 -1
  268. package/.output/server/chunks/routes/api/failure-clusters/_id/diagnosis.get.mjs +1 -1
  269. package/.output/server/chunks/routes/api/failure-clusters/_id/extract-cases.post.mjs +1 -1
  270. package/.output/server/chunks/routes/api/failure-clusters/_id/status.patch.mjs +1 -1
  271. package/.output/server/chunks/routes/api/failure-clusters/_id_.get.mjs +1 -1
  272. package/.output/server/chunks/routes/api/failure-diagnoses/_id/feedback.patch.mjs +1 -1
  273. package/.output/server/chunks/routes/api/files/_...path_.get.mjs +1 -1
  274. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  275. package/.output/server/chunks/routes/api/index.get.mjs +1 -1
  276. package/.output/server/chunks/routes/api/index.get2.mjs +1 -1
  277. package/.output/server/chunks/routes/api/index.get3.mjs +1 -1
  278. package/.output/server/chunks/routes/api/index.get4.mjs +1 -1
  279. package/.output/server/chunks/routes/api/index.get5.mjs +1 -1
  280. package/.output/server/chunks/routes/api/index.post.mjs +1 -1
  281. package/.output/server/chunks/routes/api/index.post2.mjs +1 -1
  282. package/.output/server/chunks/routes/api/index.post3.mjs +1 -1
  283. package/.output/server/chunks/routes/api/index.post4.mjs +1 -1
  284. package/.output/server/chunks/routes/api/index.post5.mjs +1 -1
  285. package/.output/server/chunks/routes/api/index.post6.mjs +1 -1
  286. package/.output/server/chunks/routes/api/links/_id/refresh.post.mjs +1 -1
  287. package/.output/server/chunks/routes/api/links/_id_.delete.mjs +1 -1
  288. package/.output/server/chunks/routes/api/links/_id_.patch.mjs +1 -1
  289. package/.output/server/chunks/routes/api/markers/_id_.delete.mjs +1 -1
  290. package/.output/server/chunks/routes/api/markers/_id_.put.mjs +1 -1
  291. package/.output/server/chunks/routes/api/notifications/stream.get.mjs +1 -1
  292. package/.output/server/chunks/routes/api/projects/_id/cluster-merge-suggestions.get.mjs +1 -1
  293. package/.output/server/chunks/routes/api/projects/_id/failure-clusters.get.mjs +1 -1
  294. package/.output/server/chunks/routes/api/projects/_id/flaky-classify.post.mjs +1 -1
  295. package/.output/server/chunks/routes/api/projects/_id/flaky-tests.get.mjs +1 -1
  296. package/.output/server/chunks/routes/api/projects/_id/latest-run.get.mjs +1 -1
  297. package/.output/server/chunks/routes/api/projects/_id/markers.get.mjs +1 -1
  298. package/.output/server/chunks/routes/api/projects/_id/markers.post.mjs +1 -1
  299. package/.output/server/chunks/routes/api/projects/_id/members.get.mjs +1 -1
  300. package/.output/server/chunks/routes/api/projects/_id/members.put.mjs +1 -1
  301. package/.output/server/chunks/routes/api/projects/_id/performance.get.mjs +1 -1
  302. package/.output/server/chunks/routes/api/projects/_id/slow-tests.get.mjs +1 -1
  303. package/.output/server/chunks/routes/api/projects/_id/spec-health.get.mjs +1 -1
  304. package/.output/server/chunks/routes/api/projects/_id/test-cases.get.mjs +1 -1
  305. package/.output/server/chunks/routes/api/projects/_id/timeout-opportunities.get.mjs +50 -0
  306. package/.output/server/chunks/routes/api/projects/_id/timeout-opportunities.get.mjs.map +1 -0
  307. package/.output/server/chunks/routes/api/projects/_id_.delete.mjs +1 -1
  308. package/.output/server/chunks/routes/api/projects/_id_.get.mjs +1 -1
  309. package/.output/server/chunks/routes/api/projects/_id_.put.mjs +1 -1
  310. package/.output/server/chunks/routes/api/projects/menu.get.mjs +1 -1
  311. package/.output/server/chunks/routes/api/projects/overview.get.mjs +1 -1
  312. package/.output/server/chunks/routes/api/projects.get.mjs +1 -1
  313. package/.output/server/chunks/routes/api/search.get.mjs +1 -1
  314. package/.output/server/chunks/routes/api/settings/ai/limits.get.mjs +1 -1
  315. package/.output/server/chunks/routes/api/settings/ai/limits.put.mjs +1 -1
  316. package/.output/server/chunks/routes/api/settings/ai/test.post.mjs +1 -1
  317. package/.output/server/chunks/routes/api/settings/ai/usage.get.mjs +1 -1
  318. package/.output/server/chunks/routes/api/settings/ai.get.mjs +1 -1
  319. package/.output/server/chunks/routes/api/settings/ai.put.mjs +1 -1
  320. package/.output/server/chunks/routes/api/settings/smtp/test.post.mjs +1 -1
  321. package/.output/server/chunks/routes/api/settings/smtp.get.mjs +1 -1
  322. package/.output/server/chunks/routes/api/settings/timeout-hygiene.get.mjs +40 -0
  323. package/.output/server/chunks/routes/api/settings/timeout-hygiene.get.mjs.map +1 -0
  324. package/.output/server/chunks/routes/api/settings/timeout-hygiene.put.mjs +46 -0
  325. package/.output/server/chunks/routes/api/settings/timeout-hygiene.put.mjs.map +1 -0
  326. package/.output/server/chunks/routes/api/settings/wasted-waits.get.mjs +1 -1
  327. package/.output/server/chunks/routes/api/settings/wasted-waits.put.mjs +1 -1
  328. package/.output/server/chunks/routes/api/stream.get.mjs +1 -1
  329. package/.output/server/chunks/routes/api/subscriptions/_id_.delete.mjs +1 -1
  330. package/.output/server/chunks/routes/api/subscriptions/_id_.patch.mjs +1 -1
  331. package/.output/server/chunks/routes/api/tags/_id_.delete.mjs +1 -1
  332. package/.output/server/chunks/routes/api/tags/_id_.put.mjs +1 -1
  333. package/.output/server/chunks/routes/api/test-cases/_id/history.get.mjs +1 -1
  334. package/.output/server/chunks/routes/api/test-cases/_id/stability-trend.get.mjs +1 -1
  335. package/.output/server/chunks/routes/api/test-cases/_id_.get.mjs +1 -1
  336. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnose.post.mjs +1 -1
  337. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis-context.get.mjs +1 -1
  338. package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis.get.mjs +1 -1
  339. package/.output/server/chunks/routes/api/test-run-cases/_id/traces.get.mjs +1 -1
  340. package/.output/server/chunks/routes/api/test-run-cases/_id_.get.mjs +1 -1
  341. package/.output/server/chunks/routes/api/test-runs/_id/begin.post.mjs +1 -1
  342. package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs +1 -1
  343. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs +1 -1
  344. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/environment-diff.get.mjs +1 -1
  345. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-healing.get.mjs +1 -1
  346. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-pick.post.mjs +1 -1
  347. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network-body.get.mjs +1 -1
  348. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network.get.mjs +1 -1
  349. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-stacks.get.mjs +1 -1
  350. package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/visual-diff.get.mjs +1 -1
  351. package/.output/server/chunks/routes/api/test-runs/_id/events.post.mjs +1 -1
  352. package/.output/server/chunks/routes/api/test-runs/_id/failure-groups.get.mjs +1 -1
  353. package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs +1 -1
  354. package/.output/server/chunks/routes/api/test-runs/_id/heartbeat.post.mjs +1 -1
  355. package/.output/server/chunks/routes/api/test-runs/_id/insights.get.mjs +1 -1
  356. package/.output/server/chunks/routes/api/test-runs/_id/network-requests.get.mjs +1 -1
  357. package/.output/server/chunks/routes/api/test-runs/_id/regression-context.get.mjs +1 -1
  358. package/.output/server/chunks/routes/api/test-runs/_id/stream.get.mjs +1 -1
  359. package/.output/server/chunks/routes/api/test-runs/_id/summary.get.mjs +1 -1
  360. package/.output/server/chunks/routes/api/test-runs/_id_.delete.mjs +1 -1
  361. package/.output/server/chunks/routes/api/test-runs/_id_.get.mjs +1 -1
  362. package/.output/server/chunks/routes/api/test-runs/_id_.patch.mjs +1 -1
  363. package/.output/server/chunks/routes/api/test-runs/recent.get.mjs +1 -1
  364. package/.output/server/chunks/routes/api/test-runs/setup.post.mjs +1 -1
  365. package/.output/server/chunks/routes/api/test-runs/start.post.mjs +1 -1
  366. package/.output/server/chunks/routes/api/test-runs/submit.post.mjs +3 -1
  367. package/.output/server/chunks/routes/api/test-runs/submit.post.mjs.map +1 -1
  368. package/.output/server/chunks/routes/api/test-runs/upload.post.mjs +2 -1
  369. package/.output/server/chunks/routes/api/test-runs/upload.post.mjs.map +1 -1
  370. package/.output/server/chunks/routes/api/traces/check.post.mjs +1 -1
  371. package/.output/server/chunks/routes/api/users/_id/api-keys/_keyId_.delete.mjs +1 -1
  372. package/.output/server/chunks/routes/api/users/_id/index.get.mjs +1 -1
  373. package/.output/server/chunks/routes/api/users/_id/index.post.mjs +1 -1
  374. package/.output/server/chunks/routes/api/users/_id/invite.post.mjs +1 -1
  375. package/.output/server/chunks/routes/api/users/_id/projects.get.mjs +1 -1
  376. package/.output/server/chunks/routes/api/users/_id/projects.put.mjs +1 -1
  377. package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
  378. package/.output/server/chunks/routes/api/users/_id_.patch.mjs +1 -1
  379. package/.output/server/chunks/routes/api/version.get.mjs +1 -1
  380. package/.output/server/chunks/routes/mcp.post.mjs +1 -1
  381. package/.output/server/chunks/routes/renderer.mjs +1 -1
  382. package/.output/server/database/migrations/0037_tired_hellion.sql +1 -0
  383. package/.output/server/database/migrations/0038_glamorous_ulik.sql +1 -0
  384. package/.output/server/database/migrations/meta/0037_snapshot.json +3384 -0
  385. package/.output/server/database/migrations/meta/0038_snapshot.json +3391 -0
  386. package/.output/server/database/migrations/meta/_journal.json +14 -0
  387. package/.output/server/database/migrations-pg/0038_tranquil_moira_mactaggert.sql +1 -0
  388. package/.output/server/database/migrations-pg/0039_fat_starjammers.sql +1 -0
  389. package/.output/server/database/migrations-pg/meta/0038_snapshot.json +4027 -0
  390. package/.output/server/database/migrations-pg/meta/0039_snapshot.json +4033 -0
  391. package/.output/server/database/migrations-pg/meta/_journal.json +14 -0
  392. package/.output/server/index.mjs +1 -1
  393. package/.output/server/package.json +1 -1
  394. package/package.json +1 -1
  395. package/.output/public/_nuxt/2kfkdDTz.js +0 -1
  396. package/.output/public/_nuxt/BXEDsEwG.js +0 -1
  397. package/.output/public/_nuxt/BbgBGuMG.js +0 -1
  398. package/.output/public/_nuxt/CJGJI2Of.js +0 -34
  399. package/.output/public/_nuxt/Ce4EdfL_.js +0 -4
  400. package/.output/public/_nuxt/CkpB9oBr.js +0 -1
  401. package/.output/public/_nuxt/D1tZEdSi.js +0 -1
  402. package/.output/public/_nuxt/DK9uMTYX.js +0 -1
  403. package/.output/public/_nuxt/YDWXnWou.js +0 -1
  404. package/.output/public/_nuxt/builds/meta/f549de31-8db6-4504-b526-482778a55eba.json +0 -1
  405. package/.output/public/_nuxt/entry.BxXHl1Vy.css +0 -1
  406. package/.output/public/_nuxt/wCQds5_f.js +0 -1
  407. package/.output/server/chunks/build/BrowserBadge-BTA4QU_J.mjs.map +0 -1
  408. package/.output/server/chunks/build/ChartCard-BqAhMip2.mjs.map +0 -1
  409. package/.output/server/chunks/build/Checkbox-_1nGm_DR.mjs.map +0 -1
  410. package/.output/server/chunks/build/CiEnvCard-DAufYuJw.mjs.map +0 -1
  411. package/.output/server/chunks/build/CodeBlock-BVKHuYjU.mjs.map +0 -1
  412. package/.output/server/chunks/build/DashboardNavbar-BR6j4VLd.mjs.map +0 -1
  413. package/.output/server/chunks/build/DiagnosisPanel-BnrdXDvd.mjs.map +0 -1
  414. package/.output/server/chunks/build/EnvManagedBadge-DdnEtjIl.mjs.map +0 -1
  415. package/.output/server/chunks/build/HelpHint-D_GJzMpW.mjs.map +0 -1
  416. package/.output/server/chunks/build/Modal-COIjm3js.mjs.map +0 -1
  417. package/.output/server/chunks/build/ProjectTestCasesTable-XFBPQGIX.mjs.map +0 -1
  418. package/.output/server/chunks/build/RunReports-ChNkmuWa.mjs.map +0 -1
  419. package/.output/server/chunks/build/RunStatusBadge-CXpuCUGQ.mjs.map +0 -1
  420. package/.output/server/chunks/build/SectionCard-zs9FDzps.mjs.map +0 -1
  421. package/.output/server/chunks/build/Select-r3S5nkSY.mjs.map +0 -1
  422. package/.output/server/chunks/build/Separator-pqpPG0up.mjs.map +0 -1
  423. package/.output/server/chunks/build/SettingsField-Wdpzlt13.mjs.map +0 -1
  424. package/.output/server/chunks/build/Slideover-02XjJjn0.mjs.map +0 -1
  425. package/.output/server/chunks/build/Switch-gx_JXgCo.mjs.map +0 -1
  426. package/.output/server/chunks/build/Table-C64RrBp3.mjs.map +0 -1
  427. package/.output/server/chunks/build/TestStatusBar--u4VX_Xf.mjs.map +0 -1
  428. package/.output/server/chunks/build/Tooltip-ui_BVvqr.mjs.map +0 -1
  429. package/.output/server/chunks/build/VisuallyHiddenInput-mMsqmkjz.mjs.map +0 -1
  430. package/.output/server/chunks/build/_id_-R6KGfZOC.mjs.map +0 -1
  431. package/.output/server/chunks/build/_id_-pkxJKe17.mjs.map +0 -1
  432. package/.output/server/chunks/build/about-CmtGYbC6.mjs.map +0 -1
  433. package/.output/server/chunks/build/account-AbLuwiZP.mjs.map +0 -1
  434. package/.output/server/chunks/build/ai-DR_slopS.mjs.map +0 -1
  435. package/.output/server/chunks/build/analytics-BbT2-Tr-.mjs.map +0 -1
  436. package/.output/server/chunks/build/db.client-DlA_u5y9.mjs.map +0 -1
  437. package/.output/server/chunks/build/default-D6diRCW0.mjs.map +0 -1
  438. package/.output/server/chunks/build/edit-CNV4xdYj.mjs.map +0 -1
  439. package/.output/server/chunks/build/help-content-BMumoQQF.mjs.map +0 -1
  440. package/.output/server/chunks/build/index-DmHBPf7T.mjs.map +0 -1
  441. package/.output/server/chunks/build/index-Dw526KXV.mjs.map +0 -1
  442. package/.output/server/chunks/build/index-dwYB76GO.mjs.map +0 -1
  443. package/.output/server/chunks/build/index-rSHkKNna.mjs.map +0 -1
  444. package/.output/server/chunks/build/isValueEqualOrExist-DTJ5ejZs.mjs.map +0 -1
  445. package/.output/server/chunks/build/login-Da5C8jP2.mjs.map +0 -1
  446. package/.output/server/chunks/build/mcp-DM1t-9L_.mjs.map +0 -1
  447. package/.output/server/chunks/build/notifications-BTPF0xA7.mjs.map +0 -1
  448. package/.output/server/chunks/build/settings-Bmw_JdBS.mjs.map +0 -1
  449. package/.output/server/chunks/build/settings-metadata-CksLgMun.mjs.map +0 -1
  450. package/.output/server/chunks/build/storage-BqR4acgi.mjs.map +0 -1
  451. package/.output/server/chunks/build/tags-miPAzIr3.mjs.map +0 -1
  452. package/.output/server/chunks/build/test-cases-D-LqhLpk.mjs.map +0 -1
  453. package/.output/server/chunks/build/useAiStatus-FwqbA4gz.mjs.map +0 -1
  454. package/.output/server/chunks/build/useSettingsNav-v_dFuTw9.mjs.map +0 -1
  455. package/.output/server/chunks/build/users-D-GDKZmZ.mjs.map +0 -1
  456. package/.output/server/chunks/build/virtualizer-BcC1XuFf.mjs.map +0 -1
  457. package/.output/server/chunks/build/wasted-time-CFmeT_e2.mjs.map +0 -1
@@ -0,0 +1,4 @@
1
+ import{_ as Gt}from"./Bvfmwzgw.js";import{_ as Jt}from"./ze9-Ill2.js";import{d as se,o as t,f as w,g,i as n,p as W,k as e,j as d,t as r,c as o,F as B,y as ee,s as ge,m as y,q as l,P as gt,v as re,h as $,x as Ae,_ as De,b as qt,C as pt,l as fe,r as j,a9 as $e,B as ve,aa as Qt,K as Ee,O as Ce,u as Zt,a as Xt,w as dt,e as Yt,ab as es,J as ts}from"./BPKwYP2Q.js";import{_ as ss}from"./BIksQZfR.js";import{_ as ns,a as as}from"./IFqRT_xJ.js";import{_ as os,a as rs,b as is,c as ls,d as us}from"./DuBBqqbF.js";import{_ as cs}from"./DcCNnjKl.js";import{_ as yt,a as Oe}from"./CQeMb57w.js";import{_ as ds}from"./B7yG1G_l.js";import{_ as ms}from"./BR9H8k-L.js";import{u as fs,_ as gs,e as ps,f as ys,g as hs,h as vs,j as xs,a as ht,i as Te,b as je,c as _s,k as ks,d as bs}from"./Dz55UR7w.js";import{f as Se,h as q,c as ws,e as $s,k as we,l as vt,m as He,n as Ke,o as Cs,i as Ts,r as mt}from"./k-z_VVTK.js";import{_ as xt}from"./BpceIssd.js";import{_ as pe}from"./DhA17dqR.js";import{_ as Ss}from"./ABGJk0pu.js";import{u as _t}from"./DuMv-ugy.js";import{_ as We}from"./DszOHBMG.js";import{d as Ds,e as Is,h as Ge,a as Rs,b as Ls,c as zs,_ as Ms,m as Ns,n as js,o as As,f as Ps,i as Us,j as Bs,k as Fs,l as Vs}from"./B3sNtVnf.js";import{_ as Je}from"./CgoAUz76.js";import{_ as kt}from"./xUrLy-Zn.js";import{_ as Es}from"./CoHGrO41.js";import{_ as Os}from"./B3NbDoBP.js";import{_ as Hs}from"./BdFEUAlx.js";import{_ as Ks}from"./BuZOa2M3.js";import{_ as Ws}from"./BBdfPriC.js";import{_ as Gs,a as Js}from"./B2lYFco4.js";import{_ as qs}from"./BkDfdHFm.js";import{b as Qs}from"./Bb64FEFL.js";import{u as ft}from"./BIf1R_fu.js";import"./iwD5atI2.js";import"./C1K3r_fc.js";import"./jIF87ALb.js";import"./r3SBLxtE.js";import"./nCjfWTGm.js";import"./Br2K9yi_.js";import"./C38aZbFJ.js";import"./DgYM3eyi.js";import"./d5ZB3uxF.js";import"./CTdvGdc2.js";import"./oNq5pd3r.js";import"./D7W_4Sqc.js";import"./BV83yObd.js";const Zs={class:"text-sm font-semibold truncate min-w-0"},Xs={class:"flex items-center gap-3 ml-auto max-sm:hidden"},Ys={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},en={class:"text-gray-700 dark:text-gray-300"},tn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},sn={class:"text-gray-700 dark:text-gray-300"},nn={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},an={class:"text-gray-700 dark:text-gray-300"},on={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},rn={class:"text-gray-700 dark:text-gray-300"},ln={key:0,class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},un={class:"text-gray-700 dark:text-gray-300"},cn={class:"grid grid-cols-1 lg:grid-cols-12 gap-4"},dn={class:"space-y-3"},mn={class:"flex items-start gap-3"},fn={class:"min-w-0 flex-1"},gn={class:"flex items-center gap-2 flex-wrap"},pn={class:"text-base font-bold truncate"},yn={class:"text-xs text-gray-500 mt-0.5"},hn={key:0},vn=["title"],xn={key:1,class:"ml-2"},_n={class:"grid grid-cols-2 sm:grid-cols-4 gap-2"},kn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},bn={class:"text-xl font-bold mt-0.5"},wn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},$n={class:"text-xl font-bold mt-0.5"},Cn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},Tn={class:"text-xl font-bold mt-0.5"},Sn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},Dn={class:"text-xl font-bold mt-0.5"},In={key:0,class:"flex items-center gap-2 text-sm"},Rn={class:"text-gray-700 dark:text-gray-300 truncate"},Ln={key:0,class:"text-gray-500 shrink-0"},zn={key:1,class:"flex items-center gap-1.5 text-sm"},Mn={class:"text-gray-700 dark:text-gray-300"},Nn=se({__name:"TestCaseSummary",props:{testCase:{},scmInfo:{},ciInfo:{},browser:{},environment:{},stepsCount:{},historicalTiming:{},stableLinks:{}},emits:["refresh"],setup(s){const _=s,v=$(()=>{const u=_.testCase;if(!u)return[];const i=[];return u.isNewRegression&&i.push({label:"New regression",color:"error",title:"Passed in the baseline run, failing here"}),u.isNewFlaky&&i.push({label:"New flaky",color:"warning",title:"Newly started passing only on retry"}),u.status==="passed"&&(u.retries??0)>0&&i.push({label:"Passed on retry",color:"warning",title:"This test failed then passed on a retry"}),i}),k=$(()=>_.testCase?.testAnnotations??[]),I=$(()=>_.testCase?.startedAt??null),{summaryColSpanClass:h,blockColSpanClass:a}=fs(()=>{let u=0;return _.scmInfo&&u++,(_.ciInfo||_.environment||_.browser)&&u++,u++,u});return(u,i)=>{const P=os,U=cs,b=ge,x=gt,F=re,N=yt,p=ds,C=rs,R=is,H=ms,L=ls,K=gs;return t(),w(K,{"storage-key":"test-case"},{folded:g(()=>[d(P,{status:s.testCase?.status??"",size:"sm"},null,8,["status"]),n("span",Zs,r(s.testCase?.title),1),n("div",Xs,[n("span",Ys,[i[0]||(i[0]=y(" Dur: ",-1)),n("strong",en,r(("formatDuration"in u?u.formatDuration:e(q))(s.testCase?.duration)),1)]),n("span",tn,[i[1]||(i[1]=y(" Retries: ",-1)),n("strong",sn,r(s.testCase?.retries??0),1)]),n("span",nn,[i[2]||(i[2]=y(" Steps: ",-1)),n("strong",an,r(s.stepsCount),1)]),n("span",on,[i[3]||(i[3]=y(" Worker: ",-1)),n("strong",rn,r(s.testCase?.workerIndex??"—"),1)]),s.testCase?.shardIndex!=null?(t(),o("span",ln,[i[4]||(i[4]=y(" Shard: ",-1)),n("strong",un,r(s.testCase.shardIndex),1)])):l("",!0)]),s.browser?(t(),w(U,{key:0,browser:s.browser,size:"sm",class:"shrink-0 max-sm:hidden"},null,8,["browser"])):l("",!0)]),default:g(()=>[n("div",cn,[n("div",{class:W(e(h))},[d(p,{class:"shadow-xs h-full"},{default:g(()=>[n("div",dn,[n("div",mn,[d(P,{status:s.testCase?.status??"",size:"md"},null,8,["status"]),n("div",fn,[n("div",gn,[n("h2",pn,r(s.testCase?.title),1),(t(!0),o(B,null,ee(e(v),D=>(t(),w(b,{key:D.label,color:D.color,variant:"subtle",size:"xs",title:D.title},{default:g(()=>[y(r(D.label),1)]),_:2},1032,["color","title"]))),128)),(t(!0),o(B,null,ee(e(k),(D,Q)=>(t(),w(b,{key:`ann-${Q}`,color:"neutral",variant:"soft",size:"xs",class:"font-mono",title:D.description||D.type},{default:g(()=>[y(" @"+r(D.type),1)]),_:2},1032,["title"]))),128))]),n("p",yn,[s.testCase?.location?(t(),o("span",hn,r(s.testCase.location),1)):l("",!0),d(x,null,{default:g(()=>[e(I)?(t(),o("span",{key:0,class:"ml-2 text-gray-400",title:new Date(e(I)).toLocaleString()}," started "+r(("formatRelativeTime"in u?u.formatRelativeTime:e(Se))(e(I))),9,vn)):l("",!0)]),_:1}),s.historicalTiming?(t(),o("span",xn,[y(" Avg "+r(("formatDuration"in u?u.formatDuration:e(q))(s.historicalTiming.avg))+" · ",1),n("span",{class:W(s.historicalTiming.diff>0?"text-red-600":"text-green-600")},r(s.historicalTiming.diff>0?"+":"")+r(s.historicalTiming.pct)+"% ",3)])):l("",!0)])])]),n("div",_n,[n("div",kn,[i[5]||(i[5]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Duration",-1)),n("p",bn,r(("formatDuration"in u?u.formatDuration:e(q))(s.testCase?.duration)),1)]),n("div",wn,[i[6]||(i[6]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Retries",-1)),n("p",$n,r(s.testCase?.retries??0),1)]),n("div",Cn,[i[7]||(i[7]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Steps",-1)),n("p",Tn,r(s.stepsCount),1)]),n("div",Sn,[i[8]||(i[8]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Worker",-1)),n("p",Dn,r(s.testCase?.workerIndex??"—"),1)])]),s.testCase?.slowestStep?(t(),o("div",In,[d(F,{name:"i-lucide-zap",class:"size-4 text-amber-500 shrink-0"}),i[9]||(i[9]=n("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Slowest step:",-1)),n("span",Rn,r(s.testCase.slowestStep),1),s.testCase.slowestStepDuration?(t(),o("span",Ln,"("+r(("formatDuration"in u?u.formatDuration:e(q))(s.testCase.slowestStepDuration))+")",1)):l("",!0)])):l("",!0),(s.testCase?.wastedTimeMs??0)>0?(t(),o("div",zn,[d(F,{name:"i-lucide-hourglass",class:"size-4 text-amber-500 shrink-0"}),i[10]||(i[10]=n("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Wasted in fixed waits:",-1)),n("span",Mn,r(("formatDuration"in u?u.formatDuration:e(q))(s.testCase?.wastedTimeMs)),1),d(N,{topic:"case.wasted-time"})])):l("",!0)])]),_:1})],2),s.scmInfo?(t(),w(C,{key:0,scm:s.scmInfo,class:W(e(a))},null,8,["scm","class"])):l("",!0),s.ciInfo||s.environment||s.browser?(t(),w(R,{key:1,ci:s.ciInfo,environment:s.environment,browser:s.browser,class:W(e(a))},null,8,["ci","environment","browser","class"])):l("",!0),d(L,{class:W(e(a)),title:"Links",icon:"i-lucide-link"},{default:g(()=>[s.testCase?.id?(t(),w(H,{key:0,"entity-type":"test_case","entity-id":s.testCase.id,links:s.stableLinks??null},null,8,["entity-id","links"])):l("",!0)]),_:1},8,["class"])])]),_:1})}}}),jn=Object.assign(Nn,{__name:"TestCaseSummary"}),An={class:"space-y-3"},Pn={key:0,class:"flex flex-wrap gap-1.5"},Un={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},Bn={class:"text-gray-800 dark:text-gray-200"},Fn={key:1},Vn={class:"flex items-center gap-1 flex-wrap"},En=se({__name:"TestCaseVerdictCard",props:{testCase:{},history:{},currentId:{}},setup(s){const _=s,v=u=>u==="failed"||u==="timedOut"||u==="timedout",k=$(()=>{const u=_.testCase;if(!u)return[];const i=[];return u.isNewRegression&&i.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"}),u.isNewFlaky&&i.push({label:"New flaky",color:"warning",icon:"i-lucide-shuffle",title:"Newly started passing only on retry — intermittent failure"}),u.status==="timedOut"&&i.push({label:"Timed out",color:"warning",icon:"i-lucide-timer-off",title:"The test exceeded its timeout"}),(u.retries??0)>0&&i.push({label:u.status==="passed"?`Passed on retry ${u.retries}`:`Retried ${u.retries}×`,color:u.status==="passed"?"warning":"neutral",icon:"i-lucide-refresh-cw",title:`This execution retried ${u.retries} time${u.retries===1?"":"s"}`}),i}),I=$(()=>_.history.slice(0,24).slice().reverse()),h=$(()=>{const u=_.history;if(!u.length)return null;const i=Math.max(0,u.findIndex(b=>b.id===_.currentId));let P=0;for(let b=i;b<u.length&&v(u[b].status);b++)P++;let U=null;for(let b=i+1;b<u.length;b++)if(u[b].status==="passed"){U=u[b];break}return{streak:P,lastPass:U,total:u.length,anchorFailing:v(u[i]?.status)}}),a=u=>({"bg-red-500 hover:bg-red-600":v(u),"bg-green-500 hover:bg-green-600":u==="passed","bg-yellow-500 hover:bg-yellow-600":u==="skipped","bg-gray-400 hover:bg-gray-500":!v(u)&&!["passed","skipped"].includes(u)});return(u,i)=>{const P=re,U=ge,b=Ae,x=xt,F=gt,N=pe;return t(),w(N,{icon:"i-lucide-clipboard-check","icon-class":"text-amber-500",title:"Verdict",help:"case.verdict"},{default:g(()=>[n("div",An,[e(k).length?(t(),o("div",Pn,[(t(!0),o(B,null,ee(e(k),p=>(t(),w(U,{key:p.label,color:p.color,variant:"subtle",size:"sm",title:p.title,class:"inline-flex items-center gap-1"},{default:g(()=>[d(P,{name:p.icon,class:"size-3 shrink-0"},null,8,["name"]),y(" "+r(p.label),1)]),_:2},1032,["color","title"]))),128))])):l("",!0),d(F,null,{default:g(()=>[e(h)?(t(),o("p",Un,[e(h).streak>=1?(t(),o(B,{key:0},[i[1]||(i[1]=y(" Failing for ",-1)),n("strong",Bn,r(e(h).streak),1),y(" consecutive run"+r(e(h).streak===1?"":"s")+". ",1),e(h).lastPass?(t(),o(B,{key:0},[i[0]||(i[0]=y(" Last passed in ",-1)),d(b,{to:`/test-run-cases/${e(h).lastPass.id}`,class:"text-primary hover:underline"},{default:g(()=>[y(" run #"+r(e(h).lastPass.runId),1)]),_:1},8,["to"]),y(" ("+r(("formatRelativeTime"in u?u.formatRelativeTime:e(Se))(e(h).lastPass.startTime))+"). ",1)],64)):e(h).total>1?(t(),o(B,{key:1},[y(" No passing run in the last "+r(e(h).total)+" recorded. ",1)],64)):(t(),o(B,{key:2},[y(" First recorded run of this test. ")],64))],64)):s.testCase?.status==="passed"?(t(),o(B,{key:1},[y(" This execution passed. ")],64)):l("",!0)])):l("",!0),e(I).length>1?(t(),o("div",Fn,[i[2]||(i[2]=n("p",{class:"text-xs text-gray-400 mb-1"},"Recent runs (oldest → newest)",-1)),n("div",Vn,[(t(!0),o(B,null,ee(e(I),p=>(t(),w(x,{key:p.id,text:`Run #${p.runId}: ${p.status}`},{default:g(()=>[d(b,{to:`/test-run-cases/${p.id}`,class:W(["size-3.5 rounded-sm inline-block transition-colors",[a(p.status),p.id===s.currentId?"ring-2 ring-offset-1 ring-primary":""]])},null,8,["to","class"])]),_:2},1032,["text"]))),128))])])):l("",!0)]),_:1})])]),_:1})}}}),On=Object.assign(En,{__name:"TestCaseVerdictCard"}),Hn={class:"space-y-3"},Kn={class:"space-y-1.5"},Wn={class:"flex items-center gap-2 flex-wrap"},Gn={class:"text-xs text-gray-500"},Jn=["title"],qn={class:"text-xs text-gray-500 dark:text-gray-400"},Qn={key:0,class:"rounded-lg border border-default bg-elevated/40 p-2.5 space-y-1"},Zn={class:"flex items-center gap-1.5 flex-wrap"},Xn={class:"text-xs text-gray-600 dark:text-gray-400 line-clamp-3"},Yn=["title"],ea=se({__name:"FailureClusterCard",props:{cluster:{}},setup(s){const _=s,v=$(()=>Math.max(0,_.cluster.sameRunCaseCount-1)),k=$(()=>{const h=_.cluster.diagnosis;return h&&h.status==="completed"&&h.summary?h:null}),I=h=>h==="high"?"success":h==="medium"?"warning":"neutral";return(h,a)=>{const u=ge,i=Ae,P=re,U=De,b=pe;return t(),w(b,{icon:"i-lucide-layers","icon-class":"text-primary",title:"Failure cluster",help:"cluster.concept"},{actions:g(()=>[s.cluster.isNew?(t(),w(u,{key:0,color:"warning",variant:"subtle",size:"sm"},{default:g(()=>[...a[0]||(a[0]=[y("New",-1)])]),_:1})):l("",!0),s.cluster.status&&s.cluster.status!=="open"?(t(),w(u,{key:1,color:s.cluster.status==="resolved"?"success":"neutral",variant:"subtle",size:"sm",class:"capitalize"},{default:g(()=>[y(r(s.cluster.status),1)]),_:1},8,["color"])):l("",!0)]),default:g(()=>[n("div",Hn,[n("div",Kn,[n("div",Wn,[s.cluster.errorType?(t(),w(u,{key:0,color:e(ws)(s.cluster.errorType),variant:"soft",size:"sm"},{default:g(()=>[y(r(s.cluster.errorType),1)]),_:1},8,["color"])):l("",!0),n("span",Gn,r(s.cluster.occurrences??0)+" occurrence"+r((s.cluster.occurrences??0)===1?"":"s"),1)]),n("p",{class:"font-mono text-xs text-gray-600 dark:text-gray-400 break-all line-clamp-2",title:s.cluster.signature},r(s.cluster.signature),9,Jn)]),n("p",qn,[e(v)>0?(t(),o(B,{key:0},[y(" Matches "+r(e(v))+" other failing "+r(e(v)===1?"test":"tests")+" in this run. ",1)],64)):l("",!0),s.cluster.isNew?(t(),o(B,{key:2},[y("Opened a new cluster in this run.")],64)):(t(),o(B,{key:1},[a[1]||(a[1]=y(" Known failure — first seen in ",-1)),d(i,{to:`/test-runs/${s.cluster.firstSeenRunId}`,class:"text-primary hover:underline"},{default:g(()=>[y(" run #"+r(s.cluster.firstSeenRunId),1)]),_:1},8,["to"]),s.cluster.firstSeenAt?(t(),o(B,{key:0},[y(" ("+r(("formatRelativeTime"in h?h.formatRelativeTime:e(Se))(s.cluster.firstSeenAt))+")",1)],64)):l("",!0),a[2]||(a[2]=y(". ",-1))],64))]),e(k)?(t(),o("div",Qn,[n("div",Zn,[d(P,{name:"i-lucide-sparkles",class:"size-3.5 text-primary shrink-0"}),a[3]||(a[3]=n("span",{class:"text-xs font-medium"},"AI verdict",-1)),e(k).category?(t(),w(u,{key:0,color:"neutral",variant:"soft",size:"xs"},{default:g(()=>[y(r(e(k).category),1)]),_:1})):l("",!0),e(k).confidence?(t(),w(u,{key:1,color:I(e(k).confidence),variant:"soft",size:"xs"},{default:g(()=>[y(r(e(k).confidence)+" confidence ",1)]),_:1},8,["color"])):l("",!0)]),n("p",Xn,r(e(k).summary),1)])):l("",!0),s.cluster.triageNote?(t(),o("p",{key:1,class:"text-xs italic text-gray-500 dark:text-gray-400",title:s.cluster.triageNote}," “"+r(s.cluster.triageNote)+"” ",9,Yn)):l("",!0),d(U,{to:`/failure-clusters/${s.cluster.id}`,size:"sm",color:"primary",variant:"solid",block:"","trailing-icon":"i-lucide-arrow-right"},{default:g(()=>[...a[4]||(a[4]=[y(" Open cluster investigation ",-1)])]),_:1},8,["to"])])]),_:1})}}}),ta=Object.assign(ea,{__name:"FailureClusterCard"}),sa={class:"space-y-3"},na={class:"text-xs text-gray-400 inline-flex items-center gap-1"},aa={key:0,class:"text-primary"},oa={key:0,class:"flex items-center justify-between gap-2 rounded-lg border border-default bg-elevated/40 p-2.5"},ra={class:"inline-flex items-center gap-2 text-sm text-gray-500"},ia={key:1,class:"flex items-center gap-2"},la={key:2,class:"rounded-lg border border-dashed border-default p-4 text-center text-gray-400"},ua={class:"text-sm inline-flex items-center gap-1 justify-center"},ca={class:"pt-1 text-center"},da=se({__name:"TestCaseAiCard",props:{testRunsCaseId:{}},setup(s){const _=s,{aiStatus:v}=ps(),k=qt(),{copy:I,copied:h}=_t(),a=j(null),u=j(!1),i=j(null),P=j([]),U=j(0),b=j(0),x=j(null),F=j(!1),N=j(!1),p=j(null),C=j(!1),R=j("");async function H(){F.value=!0;try{const m=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis-context`,{query:{format:"json"}});i.value=m.text,P.value=m.sections,U.value=m.tokenEstimate,b.value=m.imageTokenEstimate??0,x.value=m.coverage}catch{i.value=null,P.value=[],U.value=0,x.value=null}finally{F.value=!1}}async function L(){try{const m=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis`);a.value=m.diagnosis}catch{}}pt(()=>{L(),H()});const K=$(()=>{const m=a.value?.details;if(!m)return[];const f=[];if(Array.isArray(m.evidence)&&f.push(...m.evidence),Array.isArray(m.hypotheses))for(const A of m.hypotheses)Array.isArray(A?.evidence)&&f.push(...A.evidence);return xs(f)});function D(m){p.value=m,N.value=!0}function Q(m){R.value=R.value?`${R.value}
2
+
3
+ ${m}`:m,C.value=!0}function ae(){i.value&&I(i.value,{toast:"AI context copied"})}async function J(m=!1){u.value=!0;try{const f=m?`/api/test-run-cases/${_.testRunsCaseId}/diagnose?force=true`:`/api/test-run-cases/${_.testRunsCaseId}/diagnose`,A=R.value.trim()?{additionalContext:R.value.trim()}:void 0;a.value=await $fetch(f,{method:"POST",body:A})}catch(f){const A=f?.statusCode;A===409?(k.add({title:"Diagnosis already running",color:"warning"}),L()):A===503?k.add({title:"AI diagnosis is not configured",color:"warning"}):k.add({title:"Diagnosis failed",description:$s(f),color:"error"})}finally{u.value=!1}}function ie(m){return m.status==="running"&&Date.now()-new Date(m.updatedAt).getTime()>300*1e3}const z=$(()=>a.value&&(a.value.status==="completed"||a.value.status==="failed")),ye=$(()=>!a.value||a.value.status==="failed"||a.value.status==="running"&&ie(a.value)),ue=$(()=>a.value?.status==="running"&&!ie(a.value)&&!u.value);return(m,f)=>{const A=De,G=re,Z=ys,te=Ss,O=hs,Y=yt,X=vs,ce=Ae,M=pe;return t(),w(M,{icon:"i-lucide-sparkles","icon-class":"text-primary",title:"AI diagnosis",help:"case.ai"},{actions:g(()=>[d(A,{size:"xs",color:"neutral",variant:"outline",icon:e(h)?"i-lucide-check":"i-lucide-clipboard",loading:e(F),disabled:!e(i),title:"Copy the full evidence context to paste into your own AI assistant",onClick:ae},{default:g(()=>[y(r(e(h)?"Copied":"Copy AI context"),1)]),_:1},8,["icon","loading","disabled"])]),default:g(()=>[n("div",sa,[n("p",na,[d(G,{name:"i-lucide-triangle-alert",class:"size-3 shrink-0"}),f[6]||(f[6]=y(" AI-generated — verify before applying. ",-1))]),e(v)?.configured?(t(),w(Z,{key:0,sections:e(P),"not-applicable":e(x)?.notApplicable,"token-estimate":e(U),loading:e(F),onViewSection:D,onOpen:f[0]||(f[0]=V=>N.value=!0)},null,8,["sections","not-applicable","token-estimate","loading"])):l("",!0),e(v)?.configured?(t(),o(B,{key:1},[n("div",null,[n("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:f[1]||(f[1]=V=>C.value=!e(C))},[d(G,{name:e(C)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),f[7]||(f[7]=y(" Additional context ",-1)),e(R).trim()?(t(),o("span",aa,"(1)")):l("",!0)]),e(C)?(t(),w(te,{key:0,modelValue:e(R),"onUpdate:modelValue":f[2]||(f[2]=V=>fe(R)?R.value=V:null),placeholder:"e.g. We deployed a new auth middleware yesterday…",rows:3,class:"w-full text-sm mt-1"},null,8,["modelValue"])):l("",!0)]),e(ue)?(t(),o("div",oa,[n("span",ra,[d(G,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-primary shrink-0"}),f[8]||(f[8]=y(" Diagnosis in progress… ",-1))]),d(A,{size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-refresh-cw",loading:e(u),onClick:L},{default:g(()=>[...f[9]||(f[9]=[y(" Refresh ",-1)])]),_:1},8,["loading"])])):(t(),o("div",ia,[e(ye)?(t(),w(A,{key:0,icon:"i-lucide-sparkles",size:"sm",color:"primary",variant:"solid",loading:e(u),onClick:f[3]||(f[3]=V=>J(e(a)?.status==="running"))},{default:g(()=>[y(r(e(a)?.status==="running"?"Restart diagnosis":"Diagnose with AI"),1)]),_:1},8,["loading"])):e(a)?.status==="completed"?(t(),w(A,{key:1,icon:"i-lucide-refresh-cw",size:"xs",color:"primary",variant:"soft",loading:e(u),onClick:f[4]||(f[4]=V=>J(!0))},{default:g(()=>[...f[10]||(f[10]=[y(" Re-diagnose ",-1)])]),_:1},8,["loading"])):l("",!0)])),e(z)?(t(),w(O,{key:2,diagnosis:e(a),onViewSection:D,onPrefillContext:Q},null,8,["diagnosis"])):l("",!0)],64)):(t(),o("div",la,[n("p",ua,[f[11]||(f[11]=y(" AI diagnosis is not configured ",-1)),d(Y,{topic:"cluster.ai-setup"})]),f[13]||(f[13]=n("p",{class:"text-xs mt-2 max-w-xs mx-auto"},[y(" Use "),n("strong",null,"Copy AI context"),y(" above to grab the full evidence bundle for your own AI tool, or configure a provider. ")],-1)),d(A,{to:"/settings/ai",size:"xs",color:"neutral",variant:"outline",class:"mt-3"},{default:g(()=>[...f[12]||(f[12]=[y(" Configure in Settings ",-1)])]),_:1})])),d(X,{open:e(N),sections:e(P),"token-estimate":e(U),"image-token-estimate":e(b),loading:e(F),"focus-section":e(p),"cited-sections":e(K),"not-applicable-sections":e(x)?.notApplicable,"onUpdate:open":f[5]||(f[5]=V=>{N.value=V,V||(p.value=null)}),onRefresh:H},null,8,["open","sections","token-estimate","image-token-estimate","loading","focus-section","cited-sections","not-applicable-sections"]),n("div",ca,[d(ce,{to:"/mcp",class:"inline-flex items-center gap-1 text-xs text-gray-400 hover:text-primary transition-colors"},{default:g(()=>[d(G,{name:"i-lucide-bot",class:"size-3"}),f[14]||(f[14]=y(" Query this failure from your AI agent via MCP ",-1))]),_:1})])])]),_:1})}}}),ma=Object.assign(da,{__name:"TestCaseAiCard"});function bt(s,_,v){const k=j(null),I=j(!1),h=j(!1);async function a(){const u=s();if(!(!u||!$e(_)||I.value)){h.value=!0,I.value=!0;try{k.value=await $fetch(u)}catch{k.value=null}finally{I.value=!1}}}return pt(()=>{ve(()=>$e(_),u=>{u&&(v||h.value)&&!k.value&&a()},{immediate:!0})}),{data:k,pending:I,load:a}}function fa(s,_,v,k={}){return bt(()=>{const I=$e(s),h=$e(_);return I&&h?`/api/test-runs/${I}/cases/${h}/trace-stacks`:null},v,k.auto??!0)}function ga(s,_,v,k={}){return bt(()=>{const I=$e(s),h=$e(_);return I&&h?`/api/test-runs/${I}/cases/${h}/trace-network`:null},v,k.auto??!1)}const pa={class:"max-h-[32rem] overflow-y-auto"},ya={key:0,class:"mb-2 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},ha={key:0,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},va=se({__name:"TestSourceCard",props:{frames:{},testSource:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean},projectKey:{},projectName:{},storageKey:{}},setup(s,{expose:_}){const v=s,{data:k,pending:I}=fa(()=>v.runId,()=>v.testRunsCaseId,()=>v.hasTrace,{auto:!0}),h=$(()=>k.value?.status==="ok"?k.value.frames??[]:[]),a=$(()=>h.value.length>0),u=$(()=>v.frames?.length??0),i=$(()=>u.value>0||!!v.testSource),P=j(null),U=$({get:()=>P.value??(a.value?"trace":"captured"),set:N=>{P.value=N}}),b=$(()=>[{label:`Full stack (${h.value.length})`,value:"trace"},{label:`Captured (${u.value||1})`,value:"captured"}]),x=$(()=>U.value==="trace"&&a.value?h.value.length:u.value||null),F=j(null);return _({reveal:()=>F.value?.reveal()}),(N,p)=>{const C=We,R=re,H=Ds,L=Is,K=ht,D=Je,Q=Oe,ae=Ge;return t(),w(ae,{ref_key:"card",ref:F,"storage-key":s.storageKey,icon:"i-lucide-code",count:e(x),title:"Test source",help:"case.test-source"},Qt({folded:g(()=>[e(U)==="trace"&&e(a)?(t(),o(B,{key:0},[y(" Full call stack from the trace"+r(e(k)?.hasSources===!1?" (recorded without sources)":""),1)],64)):e(u)>1?(t(),o(B,{key:1},[y(" The failing line and "+r(e(u)-1)+" caller"+r(e(u)-1===1?"":"s"),1)],64)):(t(),o(B,{key:2},[y("Source around the failing assertion")],64))]),default:g(()=>[n("div",pa,[e(U)==="trace"&&e(a)?(t(),o(B,{key:0},[e(k)?.hasSources===!1?(t(),o("p",ya,[d(R,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),p[1]||(p[1]=y(" Trace recorded without sources — frame list only. ",-1))])):l("",!0),d(H,{frames:e(h),"project-key":s.projectKey,"project-name":s.projectName},null,8,["frames","project-key","project-name"])],64)):(t(),o(B,{key:1},[s.frames?.length?(t(),w(L,{key:0,frames:s.frames,"project-key":s.projectKey,"project-name":s.projectName},null,8,["frames","project-key","project-name"])):s.testSource?(t(),w(K,{key:1,text:"```typescript\n"+s.testSource+"\n```"},null,8,["text"])):s.hasTrace&&e(I)?(t(),w(D,{key:2,text:"Loading call stack from trace…"})):l("",!0)],64))]),s.hasTrace?l("",!0):(t(),o("p",ha,[d(R,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),n("span",null,[p[3]||(p[3]=y(" Want to go deeper? Record traces (",-1)),p[4]||(p[4]=n("code",null,"trace: 'retain-on-failure'",-1)),p[5]||(p[5]=y(") to see the full call stack with source here. ",-1)),d(Q,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:g(()=>[...p[2]||(p[2]=[y("Learn more",-1)])]),_:1})])]))]),_:2},[e(a)&&e(i)?{name:"actions",fn:g(()=>[d(C,{modelValue:e(U),"onUpdate:modelValue":p[0]||(p[0]=J=>fe(U)?U.value=J: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"])}}}),xa=Object.assign(va,{__name:"TestSourceCard"}),_a={class:"space-y-3"},ka={class:"divide-y divide-default"},ba={class:"flex items-center gap-2 min-w-0"},wa={class:"text-sm truncate"},$a={key:0,class:"text-xs text-gray-400 shrink-0"},Ca=se({__name:"TestCaseEvidenceCard",props:{attachments:{},traces:{},storageKey:{}},setup(s,{expose:_}){const v=s,k=Ee(),I=$(()=>v.attachments.filter(x=>Te(x.path,x.contentType)).length),h=$(()=>v.attachments.filter(x=>je(x.path,x.contentType)).length),a=$(()=>v.attachments.filter(x=>!Te(x.path,x.contentType)&&!je(x.path,x.contentType))),u=$(()=>I.value+h.value+v.traces.length+a.value.length),i=$(()=>{const x=[];return I.value&&x.push(`${I.value} screenshot${I.value===1?"":"s"}`),h.value&&x.push(`${h.value} video${h.value===1?"":"s"}`),v.traces.length&&x.push(`${v.traces.length} trace${v.traces.length===1?"":"s"}`),a.value.length&&x.push(`${a.value.length} file${a.value.length===1?"":"s"}`),x.join(" · ")||"No evidence captured"});function P(x,F){return vt(x,F,k.app?.baseURL)}function U(x){return x.split("/").pop()||x}const b=j(null);return _({reveal:()=>b.value?.reveal?.()}),(x,F)=>{const N=Rs,p=Ls,C=zs,R=re,H=De,L=Ms,K=kt,D=Ge;return t(),w(D,{ref_key:"card",ref:b,"storage-key":s.storageKey,icon:"i-lucide-camera",title:"Failure evidence",count:e(u),help:"case.evidence"},{folded:g(()=>[y(r(e(i)),1)]),default:g(()=>[n("div",_a,[d(N,{attachments:s.attachments},null,8,["attachments"]),d(p,{attachments:s.attachments},null,8,["attachments"]),d(C,{traces:s.traces},null,8,["traces"]),e(a).length?(t(),w(L,{key:0,icon:"i-lucide-paperclip",label:"Attachments",count:e(a).length,collapsible:!1},{default:g(()=>[n("div",ka,[(t(!0),o(B,null,ee(e(a),Q=>(t(),o("div",{key:Q.id,class:"flex items-center justify-between gap-2 px-3 py-2"},[n("div",ba,[d(R,{name:"i-lucide-file",class:"size-4 text-gray-400 shrink-0"}),n("span",wa,r(U(Q.path)),1),Q.size?(t(),o("span",$a,r(("formatBytes"in x?x.formatBytes:e(we))(Q.size)),1)):l("",!0)]),d(H,{to:P(Q.path,Q.contentType),target:"_blank",icon:"i-lucide-external-link",size:"xs",color:"neutral",variant:"soft",label:"Open"},null,8,["to"])]))),128))])]),_:1},8,["count"])):l("",!0),e(u)===0?(t(),w(K,{key:1,icon:"i-lucide-camera-off",text:"No screenshots, video or traces captured"})):l("",!0)])]),_:1},8,["storage-key","count"])}}}),Ta=Object.assign(Ca,{__name:"TestCaseEvidenceCard"}),Sa={class:"space-y-1 max-h-80 overflow-y-auto"},Da={class:"min-w-0 flex-1"},Ia={class:"flex items-center gap-2"},Ra={class:"truncate"},La={key:0,class:"text-xs text-gray-400 mt-0.5 ml-0"},za=se({__name:"TestCaseConsoleCard",props:{entries:{}},setup(s){function _(k){switch(k){case"error":return"error";case"warning":return"warning";case"assert":return"error";default:return"neutral"}}function v(k){switch(k){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(k,I)=>{const h=re,a=ge,u=pe;return s.entries.length>0?(t(),w(u,{key:0,icon:"i-lucide-terminal",title:"Console output",count:s.entries.length,help:"case.console"},{default:g(()=>[n("div",Sa,[(t(!0),o(B,null,ee(s.entries,(i,P)=>(t(),o("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"},[d(h,{name:v(i.type),class:W([i.type==="error"||i.type==="assert"?"text-red-500":i.type==="warning"?"text-amber-500":"text-gray-400","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),n("div",Da,[n("div",Ia,[d(a,{color:_(i.type),variant:"soft",size:"xs",class:"shrink-0"},{default:g(()=>[y(r(i.type),1)]),_:2},1032,["color"]),n("span",Ra,r(i.text),1)]),i.location?(t(),o("div",La,r(i.location),1)):l("",!0)])]))),128))])]),_:1},8,["count"])):l("",!0)}}}),Ma=Object.assign(za,{__name:"TestCaseConsoleCard"}),Na={key:0,class:"space-y-4 text-sm"},ja={class:"space-y-1.5"},Aa={class:"flex items-center gap-2"},Pa={key:0,class:"text-xs text-gray-500"},Ua={class:"block text-xs break-all text-gray-700 dark:text-gray-300"},Ba={key:0,class:"text-xs text-red-600 dark:text-red-400 font-mono"},Fa={class:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-400"},Va={key:0,class:"font-mono"},Ea={key:1,class:"font-mono"},Oa={key:2},Ha={key:3,title:"Bytes on the wire"},Ka={class:"tabular-nums"},Wa={key:0},Ga={class:"flex h-2 rounded overflow-hidden bg-gray-100 dark:bg-gray-800"},Ja=["title"],qa={class:"flex flex-wrap gap-x-3 gap-y-1 mt-1.5 text-xs text-gray-500"},Qa={class:"tabular-nums"},Za={class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5 capitalize"},Xa={key:0,class:"rounded border border-default divide-y divide-default max-h-48 overflow-y-auto"},Ya={class:"text-gray-500 dark:text-gray-400 shrink-0"},eo={class:"break-all text-gray-700 dark:text-gray-300"},to={key:1,class:"text-xs text-gray-400"},so={key:1},no={key:0,class:"rounded border border-default p-2"},ao=["src","alt"],oo={key:1,class:"max-h-96 overflow-y-auto"},ro={key:0,class:"mt-1 text-xs text-gray-400"},io={key:2,class:"text-xs text-gray-400"},lo={key:2,class:"text-xs text-gray-400"},uo=se({__name:"TraceNetworkDrawer",props:{open:{type:Boolean},entry:{},runId:{},testRunsCaseId:{}},emits:["update:open"],setup(s,{emit:_}){const v=s,k=_,I=[{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"}],h=$(()=>{const b=v.entry?.timings;return b?I.map(x=>({...x,value:b[x.key]??-1})).filter(x=>typeof x.value=="number"&&x.value>=0):[]}),a=$(()=>h.value.reduce((b,x)=>b+x.value,0)),u=$(()=>{const b=v.entry?.requestPostData??"";return b.startsWith("{")||b.startsWith("[")}),i=j(null),P=j(!1),U=new Map;return ve(()=>[v.open,v.entry?.bodySha1],async([b,x])=>{if(i.value=null,!b||!x||!v.runId)return;const F=U.get(x);if(F){i.value=F;return}P.value=!0;try{const N=await $fetch(`/api/test-runs/${v.runId}/cases/${v.testRunsCaseId}/trace-network-body`,{query:{sha1:x}});U.set(x,N),i.value=N}catch{i.value={status:"not-found"}}finally{P.value=!1}},{immediate:!0}),(b,x)=>{const F=ge,N=Es,p=Je,C=Os;return t(),w(C,{open:s.open,title:"Request detail",ui:{content:"max-w-xl"},"onUpdate:open":x[0]||(x[0]=R=>k("update:open",R))},{body:g(()=>[s.entry?(t(),o("div",Na,[n("div",ja,[n("div",Aa,[d(F,{color:("httpMethodColor"in b?b.httpMethodColor:e(He))(s.entry.method),variant:"soft",size:"sm",class:"font-mono shrink-0"},{default:g(()=>[y(r(s.entry.method),1)]),_:1},8,["color"]),d(F,{color:("httpStatusColor"in b?b.httpStatusColor:e(Ke))(s.entry.status),variant:"soft",size:"sm",class:"font-mono shrink-0 tabular-nums"},{default:g(()=>[y(r(s.entry.status>0?s.entry.status:"—"),1)]),_:1},8,["color"]),s.entry.statusText?(t(),o("span",Pa,r(s.entry.statusText),1)):l("",!0)]),n("code",Ua,r(s.entry.url),1),s.entry.failureText?(t(),o("p",Ba,r(s.entry.failureText),1)):l("",!0),n("div",Fa,[s.entry.resourceType?(t(),o("span",Va,r(s.entry.resourceType),1)):l("",!0),s.entry.mimeType?(t(),o("span",Ea,r(s.entry.mimeType),1)):l("",!0),s.entry.responseBodySize!=null?(t(),o("span",Oa,r(("formatBytes"in b?b.formatBytes:e(we))(s.entry.responseBodySize)),1)):l("",!0),s.entry.transferSize!=null?(t(),o("span",Ha,r(("formatBytes"in b?b.formatBytes:e(we))(s.entry.transferSize))+" transferred",1)):l("",!0),n("span",Ka,r(("formatDuration"in b?b.formatDuration:e(q))(s.entry.duration)),1),s.entry.duringFailure?(t(),w(F,{key:4,color:"error",variant:"subtle",size:"xs"},{default:g(()=>[...x[1]||(x[1]=[y("During failing action",-1)])]),_:1})):l("",!0)])]),e(h).length>0&&e(a)>0?(t(),o("div",Wa,[x[2]||(x[2]=n("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Timing",-1)),n("div",Ga,[(t(!0),o(B,null,ee(e(h),R=>(t(),o("div",{key:R.key,class:W(R.color),style:Ce({width:`${Math.max(.5,R.value/e(a)*100)}%`}),title:`${R.label}: ${("formatDuration"in b?b.formatDuration:e(q))(R.value)}`},null,14,Ja))),128))]),n("div",qa,[(t(!0),o(B,null,ee(e(h),R=>(t(),o("span",{key:R.key,class:"inline-flex items-center gap-1"},[n("span",{class:W(["size-2 rounded-full",R.color])},null,2),y(" "+r(R.label)+" ",1),n("span",Qa,r(("formatDuration"in b?b.formatDuration:e(q))(R.value)),1)]))),128))])])):l("",!0),(t(),o(B,null,ee(["request","response"],R=>n("div",{key:R},[n("p",Za,r(R)+" headers",1),(R==="request"?s.entry.requestHeaders:s.entry.responseHeaders).length>0?(t(),o("div",Xa,[(t(!0),o(B,null,ee(R==="request"?s.entry.requestHeaders:s.entry.responseHeaders,H=>(t(),o("div",{key:`${R}-${H.name}`,class:"px-2 py-1 text-xs font-mono flex gap-2"},[n("span",Ya,r(H.name)+":",1),n("span",eo,r(H.value),1)]))),128))])):(t(),o("p",to,"None recorded."))])),64)),s.entry.requestPostData?(t(),o("div",so,[x[3]||(x[3]=n("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Request body",-1)),d(N,{code:s.entry.requestPostData,lang:e(u)?"json":"text"},null,8,["code","lang"])])):l("",!0),n("div",null,[x[4]||(x[4]=n("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Response body",-1)),e(P)?(t(),w(p,{key:0,text:"Loading body…",padded:!1})):e(i)?(t(),o(B,{key:1},[e(i).status==="ok"&&e(i).kind==="image"?(t(),o("div",no,[n("img",{src:e(i).dataUri,alt:s.entry.url,class:"max-w-full max-h-96"},null,8,ao)])):e(i).status==="ok"?(t(),o("div",oo,[d(N,{code:e(i).content??"",lang:e(i).kind==="json"?"json":"text"},null,8,["code","lang"]),e(i).truncated?(t(),o("p",ro,"Preview truncated.")):l("",!0)])):(t(),o("p",io,r(e(i).status==="too-large"?`Body too large to preview (${("formatBytes"in b?b.formatBytes:e(we))(e(i).size??0)}) — open the trace viewer to inspect it.`:e(i).status==="unsupported"?`No preview for ${e(i).mimeType||"this content type"} — open the trace viewer to inspect it.`:"Body not stored in the trace."),1))],64)):s.entry.bodySha1?l("",!0):(t(),o("p",lo,"No body captured for this request."))])])):l("",!0)]),_:1},8,["open"])}}}),co=Object.assign(uo,{__name:"TraceNetworkDrawer"}),mo={class:"flex items-center justify-between gap-2 mb-2"},fo={key:0,class:"hidden sm:flex items-center gap-1.5 text-xs text-gray-400"},go={class:"space-y-1 max-h-[28rem] overflow-y-auto"},po=["title","onClick"],yo={class:"flex items-center gap-2 text-sm min-w-0"},ho={class:"truncate text-xs flex-1 min-w-0"},vo={key:0,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline"},xo={key:1,class:"shrink-0 text-xs text-gray-400 tabular-nums hidden sm:inline"},_o={class:"relative h-1.5 mt-1 rounded bg-gray-100 dark:bg-gray-800 overflow-hidden"},ko={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},bo=se({__name:"TraceNetworkList",props:{data:{},runId:{},testRunsCaseId:{}},setup(s){const _=s,v=j("all"),k=$(()=>_.data.requests??[]),I=$(()=>({total:k.value.length,failed:k.value.filter(C=>C.failed).length,duringFailure:k.value.filter(C=>C.duringFailure).length})),h=$(()=>[{label:`All (${I.value.total})`,value:"all"},{label:`Failed (${I.value.failed})`,value:"failed",disabled:I.value.failed===0},{label:`During failure (${I.value.duringFailure})`,value:"duringFailure",disabled:I.value.duringFailure===0}]),a=$(()=>v.value==="failed"?k.value.filter(C=>C.failed):v.value==="duringFailure"?k.value.filter(C=>C.duringFailure):k.value);function u(C){try{return new URL(C).pathname||C}catch{return C}}const i=$(()=>Math.max(1,_.data.timelineDuration??1));function P(C){const R=Math.max(0,Math.min(100,C.start/i.value*100)),H=Math.min(100-R,Math.max(1.5,C.duration/i.value*100));return{left:`${R}%`,width:`${H}%`}}const U=$(()=>{const C=_.data.failingWindow;if(!C||C.end<=C.start)return null;const R=Math.max(0,Math.min(100,C.start/i.value*100)),H=Math.max(.5,Math.min(100-R,(C.end-C.start)/i.value*100));return{left:`${R}%`,width:`${H}%`}});function b(C){return C.failed?"bg-red-500":C.duration>1e3?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}function x(C){return C.failed?"border-l-2 border-l-red-400 dark:border-l-red-600":C.duringFailure?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}const F=j(null),N=j(!1);function p(C){F.value=C,N.value=!0}return(C,R)=>{const H=We,L=ge,K=co;return t(),o("div",null,[n("div",mo,[d(H,{modelValue:e(v),"onUpdate:modelValue":R[0]||(R[0]=D=>fe(v)?v.value=D:null),items:e(h),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"]),s.data.failingWindow?(t(),o("span",fo,[...R[2]||(R[2]=[n("span",{class:"inline-block w-3 h-2 rounded-sm bg-red-500/10 border border-red-300 dark:border-red-800"},null,-1),y(" failing action ",-1)])])):l("",!0)]),n("div",go,[(t(!0),o(B,null,ee(e(a),D=>(t(),o("button",{key:D.index,type:"button",class:W([x(D),"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:D.url,onClick:Q=>p(D)},[n("div",yo,[d(L,{color:("httpMethodColor"in C?C.httpMethodColor:e(He))(D.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:g(()=>[y(r(D.method),1)]),_:2},1032,["color"]),d(L,{color:("httpStatusColor"in C?C.httpStatusColor:e(Ke))(D.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums",title:D.failureText||D.statusText},{default:g(()=>[y(r(D.status>0?D.status:"—"),1)]),_:2},1032,["color","title"]),n("code",ho,r(u(D.url)),1),D.resourceType?(t(),o("span",vo,r(D.resourceType),1)):l("",!0),D.responseBodySize!=null?(t(),o("span",xo,r(("formatBytes"in C?C.formatBytes:e(we))(D.responseBodySize)),1)):l("",!0),n("span",{class:W(["ml-1 shrink-0 text-xs tabular-nums",D.duration>1e3?"text-red-600 font-medium":D.duration>500?"text-orange-500":"text-gray-500"])},r(("formatDuration"in C?C.formatDuration:e(q))(D.duration)),3)]),n("div",_o,[e(U)?(t(),o("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(U))},null,4)):l("",!0),n("div",{class:W(["absolute inset-y-0 rounded-full",b(D)]),style:Ce(P(D))},null,6)])],10,po))),128))]),s.data.truncated?(t(),o("p",ko," Showing the first "+r(e(k).length)+" of "+r(s.data.totalBeforeCap)+" requests recorded in the trace. ",1)):l("",!0),d(K,{open:e(N),"onUpdate:open":R[1]||(R[1]=D=>fe(N)?N.value=D:null),entry:e(F),"run-id":s.runId,"test-runs-case-id":s.testRunsCaseId},null,8,["open","entry","run-id","test-runs-case-id"])])}}}),wo=Object.assign(bo,{__name:"TraceNetworkList"}),$o={class:"tabular-nums"},Co=se({__name:"DurationValue",props:{ms:{default:null},fallback:{default:"—"},unitClass:{default:"text-gray-400/70 dark:text-gray-500/70"}},setup(s){const _=s,v=$(()=>Cs(_.ms));return(k,I)=>(t(),o("span",$o,[e(v)?(t(),o(B,{key:0},[y(r(e(v).value),1),n("span",{class:W(s.unitClass)},r(e(v).unit),3)],64)):(t(),o(B,{key:1},[y(r(s.fallback),1)],64))]))}}),To=Object.assign(Co,{__name:"DurationValue"}),So={class:"flex flex-wrap items-center gap-x-3 gap-y-1"},Do={key:0,class:"flex items-center gap-2 text-xs"},Io={key:0,class:"flex items-center gap-1 text-red-600 dark:text-red-400"},Ro={key:1,class:"flex items-center gap-1 text-amber-600 dark:text-amber-400"},Lo={key:2,class:"text-xs text-gray-400 py-2"},zo={key:1,class:"space-y-1 max-h-[28rem] overflow-y-auto"},Mo=["disabled","onClick"],No={key:1,class:"size-3.5 shrink-0"},jo=["title"],Ao=["title"],Po=["title"],Uo=["title"],Bo=["title"],Fo=["title"],Vo={key:0,class:"px-2 pt-1.5 pb-2 pl-7 space-y-1"},Eo={class:"flex items-center gap-1.5 text-[11px] uppercase tracking-wide text-gray-400"},Oo=["title"],Ho={key:0,class:"shrink-0 text-[10px] uppercase text-gray-400 font-mono hidden sm:inline"},Ko={class:"relative flex-1 h-3 rounded bg-gray-100 dark:bg-gray-800 min-w-0"},Wo={key:1,class:"px-2 pb-2 pl-7 space-y-1.5"},Go={class:"flex items-start gap-2"},Jo={key:0,class:"text-gray-400 shrink-0 font-mono"},qo={class:"font-mono break-all text-gray-700 dark:text-gray-300 flex-1 min-w-0"},Qo=["title"],Zo={key:0,class:"mt-1.5"},Xo=["onClick"],Yo={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"},er={key:2,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},tr={key:3,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},sr=se({__name:"TestCaseNetworkRequests",props:{requests:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean}},setup(s,{expose:_}){const v=s,k=j("all"),{data:I,pending:h,load:a}=ga(()=>v.runId,()=>v.testRunsCaseId,()=>!!v.hasTrace),u=j(null),i=$({get:()=>u.value??(v.requests.length===0&&v.hasTrace?"trace":"captured"),set:m=>{u.value=m}});ve(()=>i.value==="trace",m=>{m&&a()},{immediate:!0});const P=$(()=>I.value?.status==="ok"?I.value.requests?.length??0:null),U=$(()=>[{label:`Captured (${v.requests.length})`,value:"captured",disabled:v.requests.length===0},{label:P.value!=null?`Full trace (${P.value})`:"Full trace",value:"trace"}]);function b(){v.hasTrace&&(u.value="trace")}_({showTraceMode:b});const x=j(new Set);function F(m){const f=new Set(x.value);f.has(m)?f.delete(m):f.add(m),x.value=f}const N=j(new Set);function p(m){const f=new Set(N.value);f.has(m)?f.delete(m):f.add(m),N.value=f}function C(m){if(m.length===0)return[];const f=Math.min(...m.map(O=>O.startMs)),A=Math.max(...m.map(O=>O.startMs+O.durMs)),G=Math.max(1,A-f),Z=new Map(m.map(O=>[O.id,O])),te=O=>{let Y=0,X=O;const ce=new Set;for(;X?.parentId&&Z.has(X.parentId)&&!ce.has(X.id)&&(ce.add(X.id),X=Z.get(X.parentId),Y++,!(Y>8)););return Y};return[...m].sort((O,Y)=>O.startMs-Y.startMs||Y.durMs-O.durMs).map(O=>({...O,offsetPct:(O.startMs-f)/G*100,widthPct:Math.max(1.5,O.durMs/G*100),depth:te(O)}))}function R(m){return m.status==="error"?"bg-red-400 dark:bg-red-500":m.kind==="db"?"bg-violet-400 dark:bg-violet-500":m.kind==="client"?"bg-sky-400 dark:bg-sky-500":m.kind==="internal"?"bg-gray-400 dark:bg-gray-500":"bg-emerald-400 dark:bg-emerald-500"}function H(m){const f=m.toLowerCase();return f==="critical"||f==="fatal"?3:f==="error"?2:f==="warning"||f==="warn"?1:0}function L(m){const f=H(m);if(f>=2)return"error";if(f===1)return"warning";const A=m.toLowerCase();return A==="info"||A==="information"?"info":"neutral"}function K(m){try{return new URL(m).pathname||m}catch{return m}}function D(m){return(m.split("/")[1]??m).replace(/^vnd\.[^+]*\+?/,"").replace(/^x-/,"")||m}function Q(m){return m?new Date(m).toLocaleString():""}const ae=$(()=>v.requests.map((m,f)=>{const A=Array.isArray(m.serverLogs)?m.serverLogs:[],G=Array.isArray(m.serverTraces)?m.serverTraces:[];let Z=0,te=0;for(const Y of A){const X=H(Y.level);X>=2?Z++:X===1&&te++}const O=G.find(Y=>!Y.parentId)??G[0];return{...m,_index:f,logs:[...A].sort((Y,X)=>Y.timestamp-X.timestamp),spans:G,serverMs:O?O.durMs:null,errorLogCount:Z,warnLogCount:te,failed:m.status>=400,hasDetail:A.length>0||G.length>0,path:K(m.url)}})),J=$(()=>{let m=0,f=0,A=0,G=0,Z=0;for(const te of ae.value)te.failed&&m++,te.logs.length>0&&f++,te.spans.length>0&&A++,G+=te.errorLogCount,Z+=te.warnLogCount;return{total:ae.value.length,failed:m,withLogs:f,withSpans:A,errorLogs:G,warnLogs:Z}}),ie=$(()=>{let m=ae.value;return k.value==="failed"?m=m.filter(f=>f.failed):k.value==="logs"&&(m=m.filter(f=>f.logs.length>0)),[...m].sort((f,A)=>{const G=Z=>(Z.errorLogCount>0?3:0)+(Z.failed?2:0)+(Z.logs.length>0?1:0);return G(A)-G(f)||f._index-A._index})}),z=$(()=>[{label:`All (${J.value.total})`,value:"all"},{label:`Failed (${J.value.failed})`,value:"failed",disabled:J.value.failed===0},{label:`With logs (${J.value.withLogs})`,value:"logs",disabled:J.value.withLogs===0}]),ye=$(()=>J.value.withLogs>0);function ue(m){return m.errorLogCount>0||m.status>=500?"border-l-2 border-l-red-400 dark:border-l-red-600":m.failed||m.warnLogCount>0?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}return(m,f)=>{const A=re,G=We,Z=Je,te=wo,O=ge,Y=To,X=Oe,ce=pe;return t(),w(ce,{icon:"i-lucide-network",title:"Network & backend logs",count:e(i)==="trace"?e(P):e(J).total,help:"case.network"},{actions:g(()=>[n("div",So,[e(i)==="captured"?(t(),o(B,{key:0},[e(J).errorLogs>0||e(J).warnLogs>0?(t(),o("div",Do,[e(J).errorLogs>0?(t(),o("span",Io,[d(A,{name:"i-lucide-octagon-alert",class:"size-3.5"}),y(r(e(J).errorLogs),1)])):l("",!0),e(J).warnLogs>0?(t(),o("span",Ro,[d(A,{name:"i-lucide-triangle-alert",class:"size-3.5"}),y(r(e(J).warnLogs),1)])):l("",!0)])):l("",!0),d(G,{modelValue:e(k),"onUpdate:modelValue":f[0]||(f[0]=M=>fe(k)?k.value=M:null),items:e(z),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])],64)):l("",!0),s.hasTrace?(t(),w(G,{key:1,modelValue:e(i),"onUpdate:modelValue":f[1]||(f[1]=M=>fe(i)?i.value=M:null),items:e(U),size:"xs",variant:"pill",ui:{list:"gap-1 p-0.5",trigger:"px-2"}},null,8,["modelValue","items"])):l("",!0)])]),default:g(()=>[e(i)==="trace"?(t(),o(B,{key:0},[e(h)||!e(I)?(t(),w(Z,{key:0,text:"Parsing trace network stream…"})):e(I).status==="ok"?(t(),w(te,{key:1,data:e(I),"run-id":s.runId??null,"test-runs-case-id":s.testRunsCaseId??0},null,8,["data","run-id","test-runs-case-id"])):(t(),o("p",Lo,"No network activity recorded in this trace."))],64)):(t(),o("div",zo,[(t(!0),o(B,null,ee(e(ie),M=>(t(),o("div",{key:M._index,class:W([ue(M),"rounded bg-gray-50/60 dark:bg-gray-800/40"])},[n("button",{type:"button",class:W(["w-full flex items-center gap-2 py-1.5 px-2 text-sm text-left",M.hasDetail?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800":"cursor-default"]),disabled:!M.hasDetail,onClick:V=>M.hasDetail&&F(M._index)},[M.hasDetail?(t(),w(A,{key:0,name:e(x).has(M._index)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0 text-gray-400"},null,8,["name"])):(t(),o("span",No)),d(O,{color:("httpMethodColor"in m?m.httpMethodColor:e(He))(M.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:g(()=>[y(r(M.method),1)]),_:2},1032,["color"]),d(O,{color:("httpStatusColor"in m?m.httpStatusColor:e(Ke))(M.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums"},{default:g(()=>[y(r(M.status||"—"),1)]),_:2},1032,["color"]),n("code",{class:"truncate text-xs flex-1 min-w-0",title:M.url},r(M.path),9,jo),M.contentType?(t(),o("span",{key:2,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline",title:`Response content type: ${M.contentType}`},r(D(M.contentType)),9,Ao)):l("",!0),M.errorLogCount>0?(t(),o("span",{key:3,class:"shrink-0 inline-flex items-center gap-1 text-xs text-red-600 dark:text-red-400",title:`${M.errorLogCount} backend error log(s)`},[d(A,{name:"i-lucide-octagon-alert",class:"size-3.5"}),y(r(M.errorLogCount),1)],8,Po)):l("",!0),M.warnLogCount>0?(t(),o("span",{key:4,class:"shrink-0 inline-flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",title:`${M.warnLogCount} backend warning log(s)`},[d(A,{name:"i-lucide-triangle-alert",class:"size-3.5"}),y(r(M.warnLogCount),1)],8,Uo)):l("",!0),M.serverMs!=null?(t(),o("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 (${M.spans.length} span${M.spans.length===1?"":"s"})`},[d(A,{name:"i-lucide-server",class:"size-3.5"}),y(r(("formatDuration"in m?m.formatDuration:e(q))(M.serverMs)),1)],8,Bo)):l("",!0),M.startTime?(t(),o("span",{key:6,class:"shrink-0 text-xs text-gray-400 hidden sm:inline",title:Q(M.startTime)},r(("formatRelativeTime"in m?m.formatRelativeTime:e(Se))(M.startTime)),9,Fo)):l("",!0),n("span",{class:W(["ml-1 shrink-0 text-xs tabular-nums",(M.duration??0)>1e3?"text-red-600 font-medium":(M.duration??0)>500?"text-orange-500":"text-gray-500"])},r(("formatDuration"in m?m.formatDuration:e(q))(M.duration)),3)],10,Mo),M.spans.length>0&&e(x).has(M._index)?(t(),o("div",Vo,[n("div",Eo,[d(A,{name:"i-lucide-waypoints",class:"size-3.5"}),f[2]||(f[2]=y("Server trace ",-1))]),(t(!0),o(B,null,ee(C(M.spans),V=>(t(),o("div",{key:V.id,class:"flex items-center gap-2 text-xs",title:V.status==="error"?`${V.name} (error)`:V.name},[n("div",{class:"w-40 sm:w-56 shrink-0 flex items-center gap-1 min-w-0",style:Ce({paddingLeft:`${V.depth*12}px`})},[V.kind?(t(),o("span",Ho,r(V.kind),1)):l("",!0),n("span",{class:W(["truncate font-mono",V.status==="error"?"text-red-600 dark:text-red-400":"text-gray-600 dark:text-gray-300"])},r(V.name),3)],4),n("div",Ko,[n("div",{class:W(["absolute top-0 h-3 rounded",R(V)]),style:Ce({left:`${V.offsetPct}%`,width:`${V.widthPct}%`})},null,6)]),d(Y,{ms:V.durMs,class:"w-12 shrink-0 text-right text-gray-500"},null,8,["ms"])],8,Oo))),128))])):l("",!0),M.logs.length>0&&e(x).has(M._index)?(t(),o("div",Wo,[(t(!0),o(B,null,ee(M.logs,(V,xe)=>(t(),o("div",{key:xe,class:"rounded border border-default bg-white dark:bg-gray-900/60 p-2 text-xs"},[n("div",Go,[d(O,{color:L(V.level),variant:"soft",size:"xs",class:"shrink-0 capitalize"},{default:g(()=>[y(r(V.level),1)]),_:2},1032,["color"]),V.category?(t(),o("span",Jo,"["+r(V.category)+"]",1)):l("",!0),n("span",qo,r(V.message),1),V.timestamp?(t(),o("span",{key:1,class:"shrink-0 text-gray-400 tabular-nums",title:Q(V.timestamp)},r(("formatRelativeTime"in m?m.formatRelativeTime:e(Se))(V.timestamp)),9,Qo)):l("",!0)]),V.stack?(t(),o("div",Zo,[n("button",{type:"button",class:"inline-flex items-center gap-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",onClick:qe=>p(`${M._index}:${xe}`)},[d(A,{name:e(N).has(`${M._index}:${xe}`)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3"},null,8,["name"]),f[3]||(f[3]=y(" Stack trace ",-1))],8,Xo),e(N).has(`${M._index}:${xe}`)?(t(),o("pre",Yo,r(V.stack),1)):l("",!0)])):l("",!0)]))),128))])):l("",!0)],2))),128))])),e(i)==="captured"&&!e(ye)?(t(),o("p",er,[d(A,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),f[5]||(f[5]=y(" No backend server logs captured — install ",-1)),d(X,{to:"backend-logs","no-icon":"",class:"underline"},{default:g(()=>[...f[4]||(f[4]=[y("a Piwi backend integration",-1)])]),_:1}),f[6]||(f[6]=y(" to see server-side warnings and errors under each request. ",-1))])):l("",!0),s.hasTrace?l("",!0):(t(),o("p",tr,[d(A,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),n("span",null,[f[8]||(f[8]=y(" Want to go deeper? Record traces (",-1)),f[9]||(f[9]=n("code",null,"trace: 'retain-on-failure'",-1)),f[10]||(f[10]=y(") to see every request with headers, timing and bodies here. ",-1)),d(X,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:g(()=>[...f[7]||(f[7]=[y("Learn more",-1)])]),_:1})])]))]),_:1},8,["count"])}}}),nr=Object.assign(sr,{__name:"TestCaseNetworkRequests"}),ar={class:"space-y-2"},or=se({__name:"TestCaseTracesCard",props:{traces:{}},setup(s){return(_,v)=>{const k=Ns,I=pe;return s.traces.length>0?(t(),w(I,{key:0,icon:"i-lucide-bug-play",title:"Traces",count:s.traces.length,help:"case.traces"},{default:g(()=>[n("div",ar,[(t(!0),o(B,null,ee(s.traces,h=>(t(),w(k,{key:h.id,trace:h,class:"py-2 px-3 rounded-lg border"},null,8,["trace"]))),128))])]),_:1},8,["count"])):l("",!0)}}}),rr=Object.assign(or,{__name:"TestCaseTracesCard"}),ir={class:"space-y-3"},lr={class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-800/50 border-b"},ur={class:"flex items-center gap-2 min-w-0"},cr={class:"text-sm font-medium truncate"},dr={key:0,class:"text-xs text-gray-400 shrink-0"},mr={class:"text-xs text-gray-400"},fr={class:"flex items-center gap-1 shrink-0"},gr=["href"],pr={key:0,class:"bg-gray-100 dark:bg-gray-900"},yr=["src","alt","onClick"],hr={key:1,class:"bg-black"},vr={key:2,class:"bg-gray-50 dark:bg-gray-900"},xr={key:0,class:"flex items-center justify-center py-8"},_r={key:1,class:"p-4 text-red-500 text-sm"},kr={key:2,class:"p-4 overflow-auto max-h-96"},br={class:"text-sm whitespace-pre-wrap font-sans leading-relaxed"},wr=se({__name:"TestCaseAttachmentsCard",props:{attachments:{}},setup(s){const _=s,v=Ee(),k=j(null),I=$(()=>_.attachments.filter(L=>Te(L.path,L.contentType)).map(L=>({src:U(L.path,L.contentType),name:L.name||b(L.path)})));function h(L){k.value=L}const a=new Set([".md",".mdx",".markdown"]),u=new Set(["text/markdown","text/x-markdown"]);function i(L){return L.toLowerCase().split(".").pop()||""}function P(L,K){return!!(a.has(i(L))||K&&u.has(K.toLowerCase()))}function U(L,K){return vt(L,K,v.app?.baseURL)}function b(L){return L.split("/").pop()||L}function x(L){return L==null?"":we(L)}const F=j({}),N=j({}),p=j({}),C=j(new Set);async function R(L){if(F.value[L.id]===void 0&&!p.value[L.id]){p.value[L.id]=!0,N.value[L.id]=null;try{const K=await $fetch(U(L.path,L.contentType),{responseType:"text"});F.value[L.id]=K}catch{N.value[L.id]="Failed to load preview"}finally{p.value[L.id]=!1}}}function H(L,K){const D=new Set(C.value);D.has(L)?D.delete(L):(D.add(L),R(K)),C.value=D}return(L,K)=>{const D=re,Q=De,ae=js,J=As,ie=pe;return s.attachments.length>0?(t(),w(ie,{key:0,icon:"i-lucide-paperclip",title:"Attachments",count:s.attachments.length},{default:g(()=>[n("div",ir,[(t(!0),o(B,null,ee(s.attachments,z=>(t(),o("div",{key:z.id,class:"rounded-lg border overflow-hidden"},[n("div",lr,[n("div",ur,[d(D,{name:e(Te)(z.path,z.contentType)?"i-lucide-image":e(je)(z.path,z.contentType)?"i-lucide-video":P(z.path,z.contentType)?"i-lucide-file-text":"i-lucide-file",class:"size-4 text-gray-400 shrink-0"},null,8,["name"]),n("span",cr,r(b(z.path)),1),z.name&&z.name!==b(z.path)?(t(),o("span",dr,r(z.name),1)):l("",!0),n("span",mr,r(x(z.size)),1)]),n("div",fr,[P(z.path,z.contentType)?(t(),w(Q,{key:0,size:"xs",color:"neutral",variant:"soft",onClick:ye=>H(z.id,z)},{default:g(()=>[y(r(e(C).has(z.id)?"Hide preview":"Preview"),1)]),_:2},1032,["onClick"])):l("",!0),n("a",{href:U(z.path,z.contentType),target:"_blank",class:"text-primary hover:underline text-xs shrink-0"},"Open",8,gr)])]),e(Te)(z.path,z.contentType)?(t(),o("div",pr,[n("img",{src:U(z.path,z.contentType),alt:z.name||"Screenshot",class:"max-w-full max-h-96 object-contain mx-auto cursor-pointer hover:opacity-90 transition-opacity",loading:"lazy",onClick:ye=>h(e(I).findIndex(ue=>ue.src===U(z.path,z.contentType)))},null,8,yr)])):e(je)(z.path,z.contentType)?(t(),o("div",hr,[d(ae,{src:U(z.path,z.contentType)},null,8,["src"])])):P(z.path,z.contentType)&&e(C).has(z.id)?(t(),o("div",vr,[e(p)[z.id]?(t(),o("div",xr,[d(D,{name:"i-lucide-loader-circle",class:"size-5 animate-spin text-gray-400"})])):e(N)[z.id]?(t(),o("div",_r,r(e(N)[z.id]),1)):e(F)[z.id]?(t(),o("div",kr,[n("pre",br,r(e(F)[z.id]),1)])):l("",!0)])):l("",!0)]))),128))]),d(J,{modelValue:e(k),"onUpdate:modelValue":K[0]||(K[0]=z=>fe(k)?k.value=z:null),images:e(I)},null,8,["modelValue","images"])]),_:1},8,["count"])):l("",!0)}}}),$r=Object.assign(wr,{__name:"TestCaseAttachmentsCard"});function Cr(s){return Array.isArray(s)?s.some(_=>_&&typeof _.type=="string"&&_.type.toLowerCase()==="slow"):!1}function Tr(s){const _=[];if(!s)return _;const v=s.steps||[],I=v.filter(a=>a.category==="navigation").filter(a=>a.duration>3e3);if(I.length>0){const a=I.sort((u,i)=>i.duration-u.duration)[0];_.push({type:"warning",message:"Slow navigation detected",details:`"${a.title}" took ${(a.duration/1e3).toFixed(1)}s. The tested page may have performance issues (slow server response, heavy JS bundles, etc.).`})}v.length>20&&_.push({type:"info",message:"Many sequential actions",details:`This test has ${v.length} steps. Consider splitting it into smaller, focused tests for better isolation and faster feedback.`}),s.status==="passed"&&(s.retries||0)>0&&_.push({type:"warning",message:"Flaky test — passed after retries",details:`This test needed ${s.retries} ${s.retries===1?"retry":"retries"} to pass. Consider reviewing locator strategies, adding explicit waits, or checking for race conditions.`});const h=v.filter(a=>a.category==="assertion"&&a.duration>2e3);if(h.length>0){const a=h.sort((u,i)=>i.duration-u.duration)[0];_.push({type:"info",message:"Slow assertions detected",details:`"${a.title}" took ${(a.duration/1e3).toFixed(1)}s. The UI may be slow to render or the assertion timeout may need tuning.`})}return Cr(s.testAnnotations)&&typeof s.duration=="number"&&s.duration<1e4&&_.push({type:"info",message:"test.slow() may be unnecessary",details:`This run finished in ${(s.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 s.timeout=="number"&&s.timeout>0&&typeof s.duration=="number"&&s.duration>0&&s.timeout>=4*s.duration&&s.timeout-s.duration>=3e4&&_.push({type:"info",message:"Oversized timeout",details:`The timeout is ${(s.timeout/1e3).toFixed(0)}s but this run took ${(s.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.`}),_}const Sr={class:"space-y-4"},Dr=["innerHTML"],Ir={class:"grid grid-cols-1 xl:grid-cols-[3fr_2fr] gap-4"},Rr={class:"space-y-4 xl:order-2"},Lr={class:"space-y-4 xl:order-1 min-w-0"},zr={class:"max-h-96 overflow-y-auto"},Mr={class:"space-y-3"},Nr={key:0},jr={class:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs mb-3"},Ar={class:"font-medium text-gray-600 dark:text-gray-300"},Pr={class:"tabular-nums text-gray-500 dark:text-gray-400"},Ur={class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Br={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"},Fr={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"},Vr={class:"flex items-center gap-2"},Er={key:0,class:"text-xs text-red-500 mt-1 whitespace-pre-wrap break-words font-mono"},Or={class:"min-w-[6rem]"},Hr={class:"flex items-center justify-between gap-2"},Kr={key:0,class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Wr={class:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},Gr={class:"space-y-4 pt-4"},Jr={key:3,class:"flex flex-col items-center justify-center py-12 text-gray-400"},qr={class:"space-y-4 pt-1"},Qr={key:0,class:"space-y-2"},Zr={class:"flex items-start gap-2"},Xr={class:"space-y-4"},Yr={key:3,class:"text-xs text-gray-400 pt-1"},ei={class:"bg-gray-100 dark:bg-gray-800 px-1 rounded"},ti={class:"text-xs text-gray-400"},si={class:"space-y-4 pt-4"},ni={key:0,class:"space-y-4"},ai={class:"flex items-center justify-end"},oi={class:"text-xs whitespace-nowrap"},ri={class:"text-gray-500"},ii={class:"text-gray-400 ml-1"},li={key:0},ui={key:1,class:"text-gray-400"},ci=["title"],Yi=se({__name:"[id]",async setup(s){let _,v;const k=Zt(),I=Xt(),h=k.params.id,{data:a,refresh:u}=([_,v]=dt(()=>ft(`/api/test-run-cases/${h}`,"$cViH4nbiGI")),_=await _,v(),_),i=j([]);ve(()=>a.value?.testCaseId,async c=>{if(c)try{i.value=await $fetch(`/api/test-cases/${c}/history`)}catch{i.value=[]}else i.value=[]},{immediate:!0});const{data:P,refresh:U}=([_,v]=dt(()=>ft(`/api/test-run-cases/${h}/traces`,"$GsSNbTq_Ec")),_=await _,v(),_),b=$(()=>(P.value?.length??0)>0);Yt($(()=>({title:`${a.value?.title||`Test run case #${h}`} — Piwi Dashboard`})));const x=$(()=>!!a.value?.error),F=$(()=>a.value?Tr(a.value):[]),N=$(()=>a.value?.steps?a.value.steps:[]),p=$(()=>a.value?.webVitals??null),C=$(()=>a.value?.networkRequests??[]),R=$(()=>{if(!i.value||i.value.length<2||!a.value?.duration)return null;const c=i.value.filter(oe=>oe.duration!==null&&oe.id!==a.value?.id);if(c.length===0)return null;const T=c.reduce((oe,me)=>oe+(me.duration||0),0)/c.length,E=a.value.duration,ne=E-T,de=T>0?Math.round(ne/T*100):0;return{avg:Math.round(T),current:E,diff:Math.round(ne),pct:de}}),H=$(()=>a.value?.testRun?.metadata),L=$(()=>{const c=H.value;return c?.scm?c.scm:null}),K=$(()=>{const c=H.value;return c?.ci?c.ci:null}),D=$(()=>a.value?.failureCluster??null),Q=$(()=>{const c=[];return x.value&&c.push({label:"Diagnosis",icon:"i-lucide-stethoscope",value:"diagnosis",slot:"diagnosis"}),c.push({label:`Steps (${N.value.length})`,icon:"i-lucide-list-checks",value:"steps",slot:"steps"}),x.value||c.push({label:"Artifacts",icon:"i-lucide-paperclip",value:"artifacts",slot:"artifacts"}),c.push({label:"Performance",icon:"i-lucide-gauge",value:"performance",slot:"performance"}),c.push({label:`History${i.value?.length?` (${i.value.length})`:""}`,icon:"i-lucide-trending-up",value:"history",slot:"history"}),c}),ae=$(()=>Q.value.map(c=>c.value));function J(){return x.value?"diagnosis":"steps"}function ie(c){let T=typeof c=="string"?c:"";return T==="error"&&(T="diagnosis"),T==="traces"&&(T=x.value?"diagnosis":"artifacts"),ae.value.includes(T)?T:J()}const z=j(ie(k.query.tab));ve(ae,c=>{c.includes(z.value)||(z.value=ie(k.query.tab))}),ve(z,c=>{k.query.tab!==c&&I.replace({query:{...k.query,tab:c}})},{immediate:!0});const ye=[{accessorKey:"startTime",header:"Date"},{accessorKey:"status",header:"Status"},{accessorKey:"duration",header:"Duration"},{accessorKey:"retries",header:"Retries"},{accessorKey:"runId",header:"Run"},{accessorKey:"error",header:"Error"}],ue={navigation:"info",assertion:"success",action:"warning",input:"warning",api:"info",wait:"neutral",hook:"neutral",fixture:"neutral"},m=[{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"}}}],f=$(()=>{const c=new Map;for(const T of N.value){const E=c.get(T.category)??{count:0,duration:0};E.count+=1,E.duration+=T.duration||0,c.set(T.category,E)}return Array.from(c,([T,E])=>({category:T,...E})).sort((T,E)=>E.duration-T.duration)}),A=$(()=>{let c=-1,T=-1;return N.value.forEach((E,ne)=>{(E.duration||0)>T&&(T=E.duration||0,c=ne)}),c}),G=$(()=>N.value.reduce((c,T)=>Math.max(c,T.duration||0),0)),Z=$(()=>N.value.length>0&&N.value.every(c=>typeof c.startTime=="number")),te=$(()=>a.value?.startedAt??(Z.value?Math.min(...N.value.map(c=>c.startTime)):0)),O=$(()=>{const c=a.value?.duration??0;if(c>0)return c;if(Z.value){const T=Math.max(...N.value.map(E=>E.startTime+(E.duration||0)));return Math.max(1,T-te.value)}return 0});function Y(c){if(Z.value&&O.value>0){const E=Math.max(0,Math.min(100,(c.startTime-te.value)/O.value*100)),ne=Math.min(100-E,Math.max(1.5,(c.duration||0)/O.value*100));return{left:`${E}%`,width:`${ne}%`}}return{left:"0%",width:`${G.value>0?Math.max(2,(c.duration||0)/G.value*100):0}%`}}function X(c){const T=a.value?.duration??0;if(T<=0)return"";const E=c/T*100;return E>0&&E<1?"<1%":`${Math.round(E)}%`}function ce(c){return c>2e3?"text-red-600 font-medium":c>500?"text-orange-500":"text-gray-500"}function M(c){return c>2e3?"bg-red-500":c>500?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}const V=$(()=>a.value?.testRun?.environment),xe=$(()=>Qs([{filePath:a.value?.filePath??"",title:a.value?.title??"",line:a.value?.line??null,projectName:a.value?.browser?.projectName??null}])),{copy:qe,copied:Qe}=_t(),wt=$(()=>[{label:Qe.value?"Copied":"Retry command",icon:Qe.value?"i-lucide-check":"i-lucide-play",onClick:()=>qe(xe.value,{toast:"Retry command copied"})},{label:"Refresh",icon:"i-lucide-refresh-cw",onClick:()=>u()}]),$t=!!Ee().public.demoMode;let he=null;const Ze=$(()=>{const c=a.value?.testRun?.status;return c==="running"||c==="finalizing"});function Ct(){if($t||he)return;const c=a.value?.testRun?.id;c&&(he=new EventSource(`/api/test-runs/${c}/stream`),he.onmessage=T=>{try{const E=JSON.parse(T.data);E.type==="case-files"&&E.data?.testRunsCaseId===Number(h)?(u(),U()):E.type==="run-finished"&&(u(),U(),Pe())}catch{}},he.onerror=()=>{})}function Pe(){he&&(he.close(),he=null)}ve(Ze,c=>{c?Ct():Pe()},{immediate:!0}),es(Pe);const{copyRich:Tt,copied:Xe}=_s();function St(){const c=a.value;if(!c?.error)return;const T=window.location.origin,E=c.title??"Unknown test",ne=c.location??"",de=c.error.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,""),oe=be=>be.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),me=D.value?`${T}/failure-clusters/${D.value.id}`:null,ze=`${T}/test-run-cases/${h}?tab=diagnosis`,ke=a.value?.testCaseId?`${T}/test-cases/${a.value.testCaseId}`:null,Me=[`❌ Test failed: ${E}`,ne?`Location: ${ne}`:null,"","Error:",de,"",me?`Failure cluster: ${me}`:null,`Execution: ${ze}`,ke?`History: ${ke}`:null].filter(be=>be!==null).join(`
4
+ `),Be=[`<p><strong>❌ Test failed: ${oe(E)}</strong>${ne?`<br><code>${oe(ne)}</code>`:""}</p>`,`<p><strong>Error:</strong></p><pre>${mt(c.error)}</pre>`,`<p>🔗 ${me?`<a href="${me}">View failure cluster</a> · `:""}<a href="${ze}">Execution details</a>${ke?` · <a href="${ke}">Test history</a>`:""}</p>`].join("");Tt(Me,Be,{toast:"Failure copied"})}const Ue=j(null),Ye=j(null),Ie=j(null),Re=j(null),et=j(null),Le=j(null),tt=j(null),st=j(null),nt=j(null),at=j(null);function _e(c){c?.scrollIntoView({behavior:"smooth",block:"start"})}const ot={sampleError:()=>_e(Ue.value),executionError:()=>_e(Ue.value),testSource:()=>Re.value?.reveal(),sourceFiles:()=>Re.value?.reveal(),environmentDiff:()=>tt.value?.reveal(),visualDiff:()=>st.value?.reveal(),domSnapshot:()=>nt.value?.reveal(),ariaSnapshot:()=>at.value?.reveal(),screenshots:()=>Le.value?.reveal(),tracePointers:()=>Le.value?.reveal(),artifacts:()=>Le.value?.reveal(),console:()=>_e(Ye.value),networkRequests:()=>_e(Ie.value),serverTraces:()=>_e(Ie.value),traceCallStack:()=>Re.value?.reveal(),traceNetwork:()=>{et.value?.showTraceMode(),_e(Ie.value)},steps:()=>{z.value="steps"},failingSteps:()=>{z.value="steps"}};return ts(bs,{canLocate:c=>c in ot,open:c=>ot[c]?.()}),(c,T)=>{const E=Gt,ne=Jt,de=re,oe=Ae,me=ss,ze=as,ke=jn,Me=De,Be=xt,be=pe,Dt=On,It=ta,Rt=ma,Lt=xa,zt=Ta,Mt=Us,Nt=Bs,jt=Fs,rt=Ma,it=nr,lt=Ps,At=ht,Pt=Ge,Ut=Vs,Ne=ge,Bt=Hs,ut=Ks,ct=Ws,Fe=kt,Ft=rr,Vt=$r,le=Js,Ve=Gs,Et=Oe,Ot=qs,Ht=us,Kt=ns;return t(),w(Kt,{id:"test-run-case-detail"},{header:g(()=>[d(ze,null,{leading:g(()=>[d(E),d(ne,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},...e(a)?.testRun?.project?.id?[{label:e(a).testRun.project.name||"Project",to:`/projects/${e(a).testRun.project.id}`}]:[{label:"Project"}],...e(a)?.testRun?.id?[{label:`Run #${e(a).testRun.id}`+(e(a).testRun.label?` — ${e(a).testRun.label}`:""),to:`/test-runs/${e(a).testRun.id}`}]:[{label:"Test run"}],{label:e(a)?.title||`Test run case #${e(h)}`}]},null,8,["items"])]),right:g(()=>[e(a)?.testCaseId?(t(),w(oe,{key:0,to:`/test-cases/${e(a).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:g(()=>[d(de,{name:"i-lucide-trending-up",class:"size-3.5"}),T[2]||(T[2]=n("span",{class:"hidden sm:inline"},"Evolution",-1))]),_:1},8,["to"])):l("",!0),d(me,{actions:e(wt)},null,8,["actions"])]),_:1})]),body:g(()=>[d(Ht,{modelValue:e(z),"onUpdate:modelValue":T[1]||(T[1]=S=>fe(z)?z.value=S:null),"tab-items":e(Q)},{summary:g(()=>[d(ke,{"test-case":e(a)??null,"scm-info":e(L),"ci-info":e(K),browser:e(a)?.browser??null,environment:e(V),"steps-count":e(N).length,"historical-timing":e(R),"stable-links":e(a)?.stableLinks??null,onRefresh:T[0]||(T[0]=S=>e(u)())},null,8,["test-case","scm-info","ci-info","browser","environment","steps-count","historical-timing","stable-links"])]),"tab-diagnosis":g(()=>[n("div",Sr,[n("div",{ref_key:"errorEl",ref:Ue,class:"scroll-mt-4"},[e(a)?.error?(t(),w(be,{key:0,icon:"i-lucide-circle-x","icon-class":"text-red-500",title:"Error"},{actions:g(()=>[d(Be,{text:e(Xe)?"Copied!":"Copy failure"},{default:g(()=>[d(Me,{size:"xs",variant:"ghost",color:"neutral",icon:e(Xe)?"i-lucide-check":"i-lucide-clipboard",onClick:St},null,8,["icon"])]),_:1},8,["text"])]),default:g(()=>[n("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(mt)(e(ks)(e(a).error))},null,8,Dr)]),_:1})):l("",!0)],512),n("div",Ir,[n("div",Rr,[d(Dt,{"test-case":e(a)??null,history:e(i),"current-id":Number(e(h))},null,8,["test-case","history","current-id"]),e(D)?(t(),w(It,{key:0,cluster:e(D)},null,8,["cluster"])):l("",!0),d(Rt,{"test-runs-case-id":Number(e(h))},null,8,["test-runs-case-id"])]),n("div",Lr,[e(a)?.testSourceFrames?.length||e(a)?.testSource||e(b)?(t(),w(Lt,{key:0,ref_key:"testSourceCard",ref:Re,"storage-key":"case-test-source",frames:e(a)?.testSourceFrames??null,"test-source":e(a)?.testSource??null,"run-id":e(a)?.testRun?.id??null,"test-runs-case-id":Number(e(h)),"has-trace":e(b),"project-key":e(a)?.testRun?.project?.id,"project-name":e(a)?.testRun?.project?.name},null,8,["frames","test-source","run-id","test-runs-case-id","has-trace","project-key","project-name"])):l("",!0),d(zt,{ref_key:"evidenceCard",ref:Le,"storage-key":"case-evidence",attachments:e(a)?.attachments??[],traces:e(P)??[]},null,8,["attachments","traces"]),e(a)?.testRun?.id?(t(),w(Mt,{key:1,"storage-key":"case-locators","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(h))},null,8,["run-id","test-runs-case-id"])):l("",!0),e(a)?.testRun?.id?(t(),w(Nt,{key:2,ref_key:"envDiffCard",ref:tt,"storage-key":"case-env-diff","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(h))},null,8,["run-id","test-runs-case-id"])):l("",!0),e(a)?.testRun?.id?(t(),w(jt,{key:3,ref_key:"visualDiffCard",ref:st,"storage-key":"case-visual-diff","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(h))},null,8,["run-id","test-runs-case-id"])):l("",!0),e(a)?.consoleLogs?.length?(t(),o("div",{key:4,ref_key:"consoleEl",ref:Ye,class:"scroll-mt-4"},[d(rt,{entries:e(a)?.consoleLogs??[]},null,8,["entries"])],512)):l("",!0),e(C).length>0||e(b)?(t(),o("div",{key:5,ref_key:"networkEl",ref:Ie,class:"scroll-mt-4"},[d(it,{ref_key:"networkCard",ref:et,requests:e(C),"run-id":e(a)?.testRun?.id??null,"test-runs-case-id":Number(e(h)),"has-trace":e(b)},null,8,["requests","run-id","test-runs-case-id","has-trace"])],512)):l("",!0),e(a)?.pageState?(t(),w(lt,{key:6,"storage-key":"case-page-state","page-state":e(a).pageState},null,8,["page-state"])):l("",!0),e(a)?.ariaSnapshot?(t(),w(Pt,{key:7,ref_key:"ariaCard",ref:at,"storage-key":"case-aria",icon:"i-lucide-scan-text",title:"ARIA snapshot",help:"case.aria"},{folded:g(()=>[...T[3]||(T[3]=[y("Accessibility tree captured at the moment of failure",-1)])]),default:g(()=>[n("div",zr,[d(At,{text:"```yaml\n"+e(a).ariaSnapshot+"\n```"},null,8,["text"])])]),_:1},512)):l("",!0),e(a)?.testRun?.id?(t(),w(Ut,{key:8,ref_key:"domSnapshotCard",ref:nt,"storage-key":"case-dom-snapshot","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(h))},null,8,["run-id","test-runs-case-id"])):l("",!0)])])])]),"tab-steps":g(()=>[n("div",Mr,[e(N).length>0?(t(),o("div",Nr,[n("div",jr,[n("span",Ar,r(e(N).length)+" steps",1),T[4]||(T[4]=n("span",{class:"text-gray-300 dark:text-gray-600"},"·",-1)),(t(!0),o(B,null,ee(e(f),S=>(t(),o("span",{key:S.category,class:"inline-flex items-center gap-1"},[d(Ne,{color:ue[S.category]||"neutral",variant:"soft",size:"xs"},{default:g(()=>[y(r(S.category),1)]),_:2},1032,["color"]),n("span",Pr,"×"+r(S.count)+" · "+r(("formatDuration"in c?c.formatDuration:e(q))(S.duration)),1)]))),128))]),d(ct,{"min-width":"40rem",bleed:!1},{default:g(()=>[d(ut,{data:e(N),columns:m,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":g(({row:S})=>[n("span",Ur,r(S.index+1),1)]),"status-cell":g(({row:S})=>[S.original.failed?(t(),o("span",Br,"✗")):(t(),o("span",Fr,"✓"))]),"category-cell":g(({row:S})=>[d(Ne,{color:ue[S.original.category]||"neutral",variant:"soft",size:"xs"},{default:g(()=>[y(r(S.original.category),1)]),_:2},1032,["color"])]),"title-cell":g(({row:S})=>[n("div",Vr,[n("span",{class:W(S.original.failed?"text-red-600 dark:text-red-400 font-medium":"")},r(S.original.title),3),S.index===e(A)?(t(),w(Ne,{key:0,color:"warning",variant:"subtle",size:"xs",class:"shrink-0",title:"Slowest step in this test"},{default:g(()=>[...T[5]||(T[5]=[y(" slowest ",-1)])]),_:1})):l("",!0)]),S.original.failed&&S.original.error?.message?(t(),o("p",Er,r(S.original.error.message),1)):l("",!0),S.original.location?(t(),w(Bt,{key:1,location:S.original.location,"project-key":e(a)?.testRun?.project?.id,"project-name":e(a)?.testRun?.project?.name,class:"text-xs text-gray-400 dark:text-gray-500 mt-0.5"},null,8,["location","project-key","project-name"])):l("",!0)]),"duration-cell":g(({row:S})=>[n("div",Or,[n("div",Hr,[n("span",{class:W(`text-sm tabular-nums ${ce(S.original.duration)}`)},r(("formatDuration"in c?c.formatDuration:e(q))(S.original.duration)),3),X(S.original.duration)?(t(),o("span",Kr,r(X(S.original.duration)),1)):l("",!0)]),n("div",Wr,[n("div",{class:W(["absolute inset-y-0 rounded-full",M(S.original.duration)]),style:Ce(Y(S.original))},null,6)])])]),_:1},8,["data"])]),_:1})])):(t(),w(Fe,{key:1,icon:"i-lucide-list-checks",text:"No steps recorded for this execution"}))])]),"tab-artifacts":g(()=>[n("div",Gr,[d(Ft,{traces:e(P)||[]},null,8,["traces"]),d(Vt,{attachments:e(a)?.attachments??[]},null,8,["attachments"]),e(a)?.pageState?(t(),w(lt,{key:0,"storage-key":"case-page-state","page-state":e(a).pageState},null,8,["page-state"])):l("",!0),e(a)?.consoleLogs?.length?(t(),w(rt,{key:1,entries:e(a)?.consoleLogs??[]},null,8,["entries"])):l("",!0),e(C).length>0||e(b)?(t(),w(it,{key:2,requests:e(C),"run-id":e(a)?.testRun?.id??null,"test-runs-case-id":Number(e(h)),"has-trace":e(b)},null,8,["requests","run-id","test-runs-case-id","has-trace"])):l("",!0),!e(P)?.length&&!e(a)?.attachments?.length&&!e(a)?.consoleLogs?.length&&!e(C).length?(t(),o("div",Jr,[e(Ze)?(t(),o(B,{key:0},[d(de,{name:"i-lucide-loader-circle",class:"size-8 mb-2 animate-spin"}),T[6]||(T[6]=n("p",{class:"text-sm"}," Run in progress — traces and attachments appear here as soon as they are uploaded. ",-1))],64)):(t(),o(B,{key:1},[d(de,{name:"i-lucide-inbox",class:"size-8 mb-2"}),T[7]||(T[7]=n("p",{class:"text-sm"},"No traces, console logs, or network requests captured for this test case.",-1))],64))])):l("",!0)])]),"tab-performance":g(()=>[n("div",qr,[e(F).length>0?(t(),o("div",Qr,[(t(!0),o(B,null,ee(e(F),(S,Wt)=>(t(),o("div",{key:Wt,class:W(["p-3 rounded-lg border",S.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"])},[n("div",Zr,[d(de,{name:S.type==="warning"?"i-lucide-alert-triangle":"i-lucide-lightbulb",class:W([S.type==="warning"?"text-amber-600":"text-blue-600","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),n("div",null,[n("p",{class:W(S.type==="warning"?"text-amber-800 dark:text-amber-200 font-medium":"text-blue-800 dark:text-blue-200 font-medium")},r(S.message),3),n("p",{class:W([S.type==="warning"?"text-amber-700 dark:text-amber-300":"text-blue-700 dark:text-blue-300","mt-1"])},r(S.details),3)])])],2))),128))])):l("",!0),e(p)?(t(),w(be,{key:1,icon:"i-lucide-gauge",title:"Browser performance (Web Vitals)",help:"case.web-vitals"},{default:g(()=>[n("div",Xr,[e(p).navigation?(t(),w(Ve,{key:0,"min-tile-width":"10rem"},{default:g(()=>[d(le,{label:"TTFB",value:("formatDuration"in c?c.formatDuration:e(q))(e(p).navigation.ttfb),hint:"Time to first byte","value-class":e(p).navigation.ttfb>600?"text-red-600":e(p).navigation.ttfb>200?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),d(le,{label:"DOM Interactive",value:("formatDuration"in c?c.formatDuration:e(q))(e(p).navigation.domInteractive),hint:"DOM interactive","value-class":e(p).navigation.domInteractive>3e3?"text-red-600":e(p).navigation.domInteractive>1500?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),d(le,{label:"DOMContentLoaded",value:("formatDuration"in c?c.formatDuration:e(q))(e(p).navigation.domContentLoaded),hint:"DOMContentLoaded","value-class":e(p).navigation.domContentLoaded>3e3?"text-red-600":e(p).navigation.domContentLoaded>1500?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),d(le,{label:"Load Complete",value:("formatDuration"in c?c.formatDuration:e(q))(e(p).navigation.loadComplete),hint:"Page fully loaded","value-class":e(p).navigation.loadComplete>5e3?"text-red-600":e(p).navigation.loadComplete>3e3?"text-orange-500":"text-green-600"},null,8,["value","value-class"])]),_:1})):l("",!0),e(p).paint&&(e(p).paint.firstPaint||e(p).paint.firstContentfulPaint)?(t(),w(Ve,{key:1,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:g(()=>[e(p).paint.firstPaint!==void 0?(t(),w(le,{key:0,label:"First Paint (FP)",value:("formatDuration"in c?c.formatDuration:e(q))(e(p).paint.firstPaint)},null,8,["value"])):l("",!0),e(p).paint.firstContentfulPaint!==void 0?(t(),w(le,{key:1,label:"First Contentful Paint (FCP)",value:("formatDuration"in c?c.formatDuration:e(q))(e(p).paint.firstContentfulPaint),"value-class":e(p).paint.firstContentfulPaint>3e3?"text-red-600":e(p).paint.firstContentfulPaint>1800?"text-orange-500":"text-green-600"},null,8,["value","value-class"])):l("",!0)]),_:1})):l("",!0),e(p).vitals?(t(),w(Ve,{key:2,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:g(()=>[d(le,{label:"Largest Contentful Paint (LCP)",value:e(p).vitals.lcp!=null?("formatDuration"in c?c.formatDuration:e(q))(e(p).vitals.lcp):"n/a","value-class":e(p).vitals.lcp==null?"text-gray-400":e(p).vitals.lcp>4e3?"text-red-600":e(p).vitals.lcp>2500?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),d(le,{label:"Cumulative Layout Shift (CLS)",value:e(p).vitals.cls!=null?String(e(p).vitals.cls):"n/a","value-class":e(p).vitals.cls==null?"text-gray-400":e(p).vitals.cls>.25?"text-red-600":e(p).vitals.cls>.1?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),d(le,{label:"Interaction to Next Paint (INP)",value:e(p).vitals.inp!=null?("formatDuration"in c?c.formatDuration:e(q))(e(p).vitals.inp):"n/a","value-class":e(p).vitals.inp==null?"text-gray-400":e(p).vitals.inp>500?"text-red-600":e(p).vitals.inp>200?"text-orange-500":"text-green-600"},null,8,["value","value-class"])]),_:1})):l("",!0),e(p).navigation?.url?(t(),o("div",Yr,[T[8]||(T[8]=y(" Page: ",-1)),n("code",ei,r(e(p).navigation.url),1)])):l("",!0)])]),_:1})):l("",!0),e(F).length===0&&!e(p)?(t(),w(Fe,{key:2,icon:"i-lucide-gauge",text:"No performance hints or Web Vitals were captured for this execution."},{default:g(()=>[n("p",ti,[T[10]||(T[10]=y(" Web Vitals and timing come from the ",-1)),d(Et,{to:"capture-fixtures"},{default:g(()=>[...T[9]||(T[9]=[y("capture fixtures",-1)])]),_:1}),T[11]||(T[11]=y(". ",-1))])]),_:1})):l("",!0)])]),"tab-history":g(()=>[n("div",si,[e(i)&&e(i).length>0?(t(),o("div",ni,[n("div",ai,[e(a)?.testCaseId?(t(),w(Me,{key:0,to:`/test-cases/${e(a).testCaseId}`,size:"xs",variant:"outline",color:"neutral","trailing-icon":"i-lucide-arrow-right"},{default:g(()=>[...T[12]||(T[12]=[y(" View full test history ",-1)])]),_:1},8,["to"])):l("",!0)]),d(Ot,{data:e(i),height:200},null,8,["data"]),d(ct,{"min-width":"44rem",bleed:!1},{default:g(()=>[d(ut,{data:e(i),columns:ye,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":g(({row:S})=>[n("span",oi,[n("span",ri,r(new Date(S.original.startTime).toLocaleDateString("en-US",{month:"short",day:"numeric"})),1),n("span",ii,r(new Date(S.original.startTime).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})),1)])]),"status-cell":g(({row:S})=>[d(Ne,{color:("getStatusColor"in c?c.getStatusColor:e(Ts))(S.original.status),class:"capitalize"},{default:g(()=>[y(r(S.original.status),1)]),_:2},1032,["color"])]),"duration-cell":g(({row:S})=>[S.original.duration!==null?(t(),o("span",li,r(("formatDuration"in c?c.formatDuration:e(q))(S.original.duration)),1)):(t(),o("span",ui,"—"))]),"runId-cell":g(({row:S})=>[d(oe,{to:`/test-runs/${S.original.runId}`,class:"text-primary hover:underline"},{default:g(()=>[y(" #"+r(S.original.runId),1)]),_:2},1032,["to"])]),"error-cell":g(({row:S})=>[S.original.error?(t(),o("span",{key:0,class:"text-red-600 text-xs truncate max-w-xs block",title:S.original.error},r(S.original.error.length>80?`${S.original.error.substring(0,80)}…`:S.original.error),9,ci)):l("",!0)]),_:1},8,["data"])]),_:1})])):(t(),w(Fe,{key:1,icon:"i-lucide-trending-up",text:"No prior executions of this test yet."},{default:g(()=>[...T[13]||(T[13]=[n("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{Yi as default};
@@ -1,3 +1,3 @@
1
- import{_ as U,a as O}from"./C9jjVEQU.js";import{_ as z}from"./n7Htv9PJ.js";import{d as L,e as M,f,g as i,K as E,o as d,i as e,k as o,q as B,j as r,c as y,F as N,y as G,v as Y,t as l,m as s,_ as F,h as a}from"./B8fs6GU9.js";import{_ as H}from"./BBJ9Pu3M.js";import{_ as K}from"./0KrkW531.js";import{_ as W}from"./BCK4f6Y3.js";import"./BtJkQ3to.js";import"./wCQds5_f.js";import"./3SnTawZW.js";import"./DWzdeQ3Z.js";import"./B32ySRXg.js";import"./CvCF77E-.js";import"./B_80i5Ge.js";const $=[{name:"list_projects",description:"List all projects with stats: total runs, test cases, latest run status and branch. Use this first to discover available projects and their IDs.",inputSchema:{type:"object",properties:{}}},{name:"get_project",description:"Get project details and its recent test runs with pass/fail counts. Results are paginated — use pageSize and cursor for the runs list.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Project ID from list_projects"},pageSize:{type:"number",description:"Runs per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of runs"}},required:["id"]}},{name:"list_runs",description:"List test runs for a project with filters.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["passed","failed","running","initialising","aborted"],description:"Filter by status"},branch:{type:"string",description:"Filter by branch name (exact match against SCM metadata)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_run",description:"Get a test run summary plus its test cases (paginated), with status, truncated error text, and failure cluster IDs. Filter by status and page with pageSize/cursor.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"},status_filter:{type:"string",enum:["failed","flaky","all"],description:'Which test cases to include (default: "failed" — only failed+timedOut; "flaky" — only flaky; "all" — every case)'},pageSize:{type:"number",description:"Cases per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response for the next page of cases"}},required:["id"]}},{name:"list_failed_cases",description:"List failed and timed-out test cases across recent runs for a project.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"},runId:{type:"number",description:"Optional: restrict to a specific run"}},required:["projectId"]}},{name:"list_flaky_tests",description:"List flaky tests for a project with flakiness scores.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Number of recent runs to analyze (default 50, max 200)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response. Cursor is the flakyScore value (descending)."}},required:["projectId"]}},{name:"get_test_case",description:"Get test case details including aggregated pass/fail stats, flakiness metrics, and recent executions (paginated). Use testCaseId (stable identity), not the per-run caseId.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (testCaseId from list_failed_cases or list_flaky_tests)"},pageSize:{type:"number",description:"Executions per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of executions"}},required:["id"]}},{name:"list_clusters",description:"List failure clusters for a project. Each cluster groups similar failures by error fingerprint.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"Filter by triage status (default: all statuses)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_cluster",description:"Get full details for a failure cluster including all affected test cases, a compact diagnosis summary, and locator healing suggestions for up to 5 affected cases. Each healing entry includes the failing locator, the recommended fix, and the number of alternatives available. Use get_cluster_diagnosis for the full diagnosis text, or get_cluster_context for the raw AI evidence.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID from list_clusters"}},required:["id"]}},{name:"get_cluster_diagnosis",description:"Get the stored AI diagnosis for a failure cluster. Returns category, confidence, root cause, evidence, and suggested fix. Returns null if no diagnosis has been run yet.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"}},required:["id"]}},{name:"get_test_case_context",description:"Get the AI evidence context for a specific test-run-case (execution scope). Use this when debugging a single test failure — it provides the execution-scoped evidence including steps, console, network, and SCM diff.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID"}},required:["id"]}},{name:"get_case_screenshots",description:"Get screenshots for a test-run-case. By default returns metadata only (name, type, size). Set content=true to include base64-encoded image data (max 3, capped at ~100 KB each). Call metadata-only first to discover what exists, then request content for the ones you need.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID"},content:{type:"boolean",description:"Include base64 image data (default false — metadata only)"}},required:["testRunsCaseId"]}},{name:"get_cluster_context",description:"Get the full AI evidence context for a failure cluster — the same data sent to the diagnosis AI. Includes error samples, stack traces, test steps, console logs, network failures, ARIA snapshots, SCM diff (changed files since last green run), and a per-section breakdown with char counts and truncation flags. This is the richest available evidence for debugging a failure.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},baseCommit:{type:"string",description:"Optional: override the baseline commit SHA for SCM diff comparison"},selectedCommitShas:{type:"array",items:{type:"string"},description:"Optional: specific commit SHAs to include in the diff context (max 10)"}},required:["id"]}},{name:"search_test_cases",description:"Search test cases by title or file path within a project. Accepts a free-text query and returns matching test cases with basic stats. Use this to find a test case when you don't know its ID.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},q:{type:"string",description:"Search query — matched against title and file path (case-insensitive)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId","q"]}},{name:"get_test_run_case",description:"Get a single test-run-case execution record with full (untruncated) error text plus steps, console logs, web vitals, and ARIA snapshot. Use include to fetch only the blobs you need. The ID is the executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID (executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases)"},include:{type:"array",items:{type:"string",enum:["steps","console","webVitals","aria","source"]},description:"Optional: which heavy blobs to include (default: all). The error, status, and summary are always returned."}},required:["id"]}},{name:"list_recent_activity",description:"List the most recent test runs across all projects. No projectId required — returns a cross-project view of recent CI activity. Paginated by startTime descending.",inputSchema:{type:"object",properties:{pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_repo_commits",description:"List recent commits for a project's repository. Requires SCM token configuration (per-project or global). Returns commit details (SHA, message, author, date).",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},branch:{type:"string",description:"Branch name (default: repository default branch)"},limit:{type:"number",description:"Max commits (default 20, max 100)"}},required:["projectId"]}},{name:"get_repo_diff",description:"Get the diff (changed files with patches) for a single commit in a project's repository. Requires SCM token configuration (per-project or global). Useful for inspecting what code changed in a specific commit suspected of causing a failure.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},sha:{type:"string",description:"Full commit SHA"}},required:["projectId","sha"]}},{name:"get_run_insights",description:'Compare a run to its last green baseline: pass-rate delta, new regressions, recurrences, recovered tests, new flaky tests, biggest perf improvements/regressions, worker imbalance, and newly opened clusters. Use this to answer "what changed?" and "did my fix work?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_spec_health",description:"Per-spec-file health for a project: pass rate, flaky rate, failure count, test count, and average duration grouped by spec-file prefix over the last N days. Use to find which areas of the suite are unhealthy.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},days:{type:"number",description:"Lookback window in days (default 30, max 90)"}},required:["projectId"]}},{name:"get_slow_tests",description:"Slowest test cases in a project by average duration, with max/min and trend direction across recent runs. Use to target performance work.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Recent runs to analyze (default 50, max 100)"}},required:["projectId"]}},{name:"get_performance_trend",description:'Time series of run duration, average test duration, and p90 test duration for a project. Use to answer "is the suite getting slower?".',inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},limit:{type:"number",description:"Number of recent runs (default 30, max 100)"}},required:["projectId"]}},{name:"get_test_stability_trend",description:'Time-series stability for a single test case: flaky rate, pass rate, and average duration bucketed over its recent execution history. Use to answer "is this test getting flakier?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (stable testCaseId)"},buckets:{type:"number",description:"Number of time buckets (default 20, 5–50)"}},required:["id"]}},{name:"get_network_requests",description:"A run's network requests aggregated by method + normalized route, sorted by average duration, with status codes and captured backend server logs. Use to pin a UI failure on a slow or failing endpoint.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_failure_groups",description:"One run's failures grouped by failure cluster, with per-group affected cases and worker correlation. Run-scoped counterpart to list_clusters.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_locator_healing",description:"Ranked alternative locators for a failing test-run-case: the failing locator, the recommended durable fix, and the full alternative lists (from prior success, element match, and ARIA snapshot). Use when fixing a broken selector.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"search",description:"Global search across all in-scope projects, runs (by label or numeric id), and test cases (by title). Use to find a run by its label or locate an entity across projects.",inputSchema:{type:"object",properties:{q:{type:"string",description:"Search query (min 2 chars)"}},required:["q"]}},{name:"list_case_traces",description:"List Playwright trace files for a test-run-case, with a download path for each. Fetch the bytes via GET /api/files/<path>.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"list_links",description:"List external entity links (Jira, GitHub PR/issue, etc.) attached to a run, test-run-case, or test case, with provider and unfurled status.",inputSchema:{type:"object",properties:{entityType:{type:"string",enum:["test_run","test_runs_case","test_case"],description:"Which entity the links are attached to"},id:{type:"number",description:"The entity ID matching entityType"}},required:["entityType","id"]}},{name:"list_tags",description:"List the project tag catalog (id, text, color).",inputSchema:{type:"object",properties:{}}},{name:"get_project_test_catalog",description:"The full test-case catalog for a project with aggregated pass/fail/flaky counts, average duration, and last status per test. Offset-paginated bulk companion to get_test_case.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},offset:{type:"number",description:"Row offset for paging (default 0)"},query:{type:"string",description:"Optional case-insensitive substring filter on title or file path"}},required:["projectId"]}},{name:"list_open_clusters",description:"Open failure clusters across all in-scope projects, ranked by occurrences — a cross-project triage queue. Filter by status; paginate with pageSize/cursor.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["open","resolved","ignored"],description:"Triage status (default: open)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_instance_stats",description:"Instance-wide counts (projects, runs, test cases, executions, files) and total storage size. Admin only.",inputSchema:{type:"object",properties:{}}},{name:"explain_failure",description:"One-call evidence bundle for a single failing execution: error, steps, console, ARIA snapshot, the recommended locator fix, a screenshot count, and the AI diagnosis context. Prefer this over chaining get_test_run_case + get_locator_healing + get_test_case_context.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"set_cluster_status",description:"Triage a failure cluster: set its status to open, resolved, or ignored with an optional note. Requires reporter or admin access. Use after fixing the underlying issue.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"New triage status"},triageNote:{type:"string",description:"Optional note explaining the status change"}},required:["id","status"]}},{name:"set_cluster_base_commit",description:'Pin the baseline commit SHA a cluster uses for its SCM-diff diagnosis context, so "what changed since green" is accurate. Requires reporter or admin access.',inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},commit:{type:"string",description:"Baseline commit SHA (empty to clear)"}},required:["id","commit"]}},{name:"submit_diagnosis_feedback",description:"Record thumbs up/down feedback on a stored diagnosis, with an optional note. Requires reporter or admin access.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Diagnosis ID"},feedback:{type:"string",enum:["up","down"],description:"Rating (omit to clear)"},feedbackNote:{type:"string",description:"Optional note"}},required:["id"]}},{name:"run_cluster_diagnosis",description:"Trigger an AI diagnosis for a failure cluster and return the result (category, confidence, root cause, suggested fix). Returns the existing completed diagnosis unless force is set. Requires reporter or admin access and a configured AI provider.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},force:{type:"boolean",description:"Re-run even if a completed diagnosis exists (default false)"},baseCommit:{type:"string",description:"Optional baseline commit SHA for SCM-diff context"}},required:["id"]}}];function V(h){return new URL(globalThis.location.href)}const J={class:"max-w-3xl mx-auto p-6 space-y-6"},Q={class:"flex flex-col gap-1.5"},X={class:"min-w-0"},Z={class:"text-sm font-mono font-semibold text-foreground"},ee={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},te={class:"space-y-3"},se={class:"space-y-3"},re={class:"space-y-3"},ie={class:"space-y-3"},oe={class:"space-y-3"},ne={class:"space-y-3"},ae={class:"space-y-2"},ce={class:"flex items-center gap-2"},pe={class:"flex-1 px-3 py-2 bg-muted rounded-md text-sm font-mono break-all"},ve=L({__name:"mcp",setup(h){const m=E(),g=m.public.demoMode,b=V(),n=a(()=>`${m.public.siteUrl||b.origin}/mcp`);M({title:"MCP server — Piwi Dashboard"});const _=$,x=[{label:"Claude Code",slot:"claude-code"},{label:"Cursor",slot:"cursor"},{label:"VS Code",slot:"vscode"},{label:"Claude Desktop",slot:"claude-desktop"},{label:"Gemini CLI",slot:"gemini"},{label:"Windsurf / Continue",slot:"windsurf"}],I=a(()=>`claude mcp add --transport http piwi ${n.value} \\
1
+ import{_ as U,a as O}from"./IFqRT_xJ.js";import{_ as z}from"./Br2K9yi_.js";import{d as L,e as M,f,g as i,K as E,o as d,i as e,k as o,q as B,j as r,c as y,F as N,y as G,v as Y,t as l,m as s,_ as F,h as a}from"./BPKwYP2Q.js";import{_ as H}from"./DhA17dqR.js";import{_ as K}from"./CoHGrO41.js";import{_ as W}from"./DszOHBMG.js";import"./iwD5atI2.js";import"./CQeMb57w.js";import"./r3SBLxtE.js";import"./DuMv-ugy.js";import"./B7yG1G_l.js";import"./k-z_VVTK.js";import"./C38aZbFJ.js";const $=[{name:"list_projects",description:"List all projects with stats: total runs, test cases, latest run status and branch. Use this first to discover available projects and their IDs.",inputSchema:{type:"object",properties:{}}},{name:"get_project",description:"Get project details and its recent test runs with pass/fail counts. Results are paginated — use pageSize and cursor for the runs list.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Project ID from list_projects"},pageSize:{type:"number",description:"Runs per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of runs"}},required:["id"]}},{name:"list_runs",description:"List test runs for a project with filters.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["passed","failed","running","initialising","aborted"],description:"Filter by status"},branch:{type:"string",description:"Filter by branch name (exact match against SCM metadata)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_run",description:"Get a test run summary plus its test cases (paginated), with status, truncated error text, and failure cluster IDs. Filter by status and page with pageSize/cursor.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"},status_filter:{type:"string",enum:["failed","flaky","all"],description:'Which test cases to include (default: "failed" — only failed+timedOut; "flaky" — only flaky; "all" — every case)'},pageSize:{type:"number",description:"Cases per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response for the next page of cases"}},required:["id"]}},{name:"list_failed_cases",description:"List failed and timed-out test cases across recent runs for a project.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"},runId:{type:"number",description:"Optional: restrict to a specific run"}},required:["projectId"]}},{name:"list_flaky_tests",description:"List flaky tests for a project with flakiness scores.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Number of recent runs to analyze (default 50, max 200)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response. Cursor is the flakyScore value (descending)."}},required:["projectId"]}},{name:"get_test_case",description:"Get test case details including aggregated pass/fail stats, flakiness metrics, and recent executions (paginated). Use testCaseId (stable identity), not the per-run caseId.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (testCaseId from list_failed_cases or list_flaky_tests)"},pageSize:{type:"number",description:"Executions per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page of executions"}},required:["id"]}},{name:"list_clusters",description:"List failure clusters for a project. Each cluster groups similar failures by error fingerprint.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"Filter by triage status (default: all statuses)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId"]}},{name:"get_cluster",description:"Get full details for a failure cluster including all affected test cases, a compact diagnosis summary, and locator healing suggestions for up to 5 affected cases. Each healing entry includes the failing locator, the recommended fix, and the number of alternatives available. Use get_cluster_diagnosis for the full diagnosis text, or get_cluster_context for the raw AI evidence.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID from list_clusters"}},required:["id"]}},{name:"get_cluster_diagnosis",description:"Get the stored AI diagnosis for a failure cluster. Returns category, confidence, root cause, evidence, and suggested fix. Returns null if no diagnosis has been run yet.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"}},required:["id"]}},{name:"get_test_case_context",description:"Get the AI evidence context for a specific test-run-case (execution scope). Use this when debugging a single test failure — it provides the execution-scoped evidence including steps, console, network, and SCM diff.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID"}},required:["id"]}},{name:"get_case_screenshots",description:"Get screenshots for a test-run-case. By default returns metadata only (name, type, size). Set content=true to include base64-encoded image data (max 3, capped at ~100 KB each). Call metadata-only first to discover what exists, then request content for the ones you need.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID"},content:{type:"boolean",description:"Include base64 image data (default false — metadata only)"}},required:["testRunsCaseId"]}},{name:"get_cluster_context",description:"Get the full AI evidence context for a failure cluster — the same data sent to the diagnosis AI. Includes error samples, stack traces, test steps, console logs, network failures, ARIA snapshots, SCM diff (changed files since last green run), and a per-section breakdown with char counts and truncation flags. This is the richest available evidence for debugging a failure.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},baseCommit:{type:"string",description:"Optional: override the baseline commit SHA for SCM diff comparison"},selectedCommitShas:{type:"array",items:{type:"string"},description:"Optional: specific commit SHAs to include in the diff context (max 10)"}},required:["id"]}},{name:"search_test_cases",description:"Search test cases by title or file path within a project. Accepts a free-text query and returns matching test cases with basic stats. Use this to find a test case when you don't know its ID.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},q:{type:"string",description:"Search query — matched against title and file path (case-insensitive)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}},required:["projectId","q"]}},{name:"get_test_run_case",description:"Get a single test-run-case execution record with full (untruncated) error text plus steps, console logs, web vitals, and ARIA snapshot. Use include to fetch only the blobs you need. The ID is the executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run case ID (executionId from get_run.cases or testRunsCaseId from get_cluster.affectedTestCases)"},include:{type:"array",items:{type:"string",enum:["steps","console","webVitals","aria","source"]},description:"Optional: which heavy blobs to include (default: all). The error, status, and summary are always returned."}},required:["id"]}},{name:"list_recent_activity",description:"List the most recent test runs across all projects. No projectId required — returns a cross-project view of recent CI activity. Paginated by startTime descending.",inputSchema:{type:"object",properties:{pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_repo_commits",description:"List recent commits for a project's repository. Requires SCM token configuration (per-project or global). Returns commit details (SHA, message, author, date).",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},branch:{type:"string",description:"Branch name (default: repository default branch)"},limit:{type:"number",description:"Max commits (default 20, max 100)"}},required:["projectId"]}},{name:"get_repo_diff",description:"Get the diff (changed files with patches) for a single commit in a project's repository. Requires SCM token configuration (per-project or global). Useful for inspecting what code changed in a specific commit suspected of causing a failure.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},sha:{type:"string",description:"Full commit SHA"}},required:["projectId","sha"]}},{name:"get_run_insights",description:'Compare a run to its last green baseline: pass-rate delta, new regressions, recurrences, recovered tests, new flaky tests, biggest perf improvements/regressions, worker imbalance, and newly opened clusters. Use this to answer "what changed?" and "did my fix work?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_spec_health",description:"Per-spec-file health for a project: pass rate, flaky rate, failure count, test count, and average duration grouped by spec-file prefix over the last N days. Use to find which areas of the suite are unhealthy.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},days:{type:"number",description:"Lookback window in days (default 30, max 90)"}},required:["projectId"]}},{name:"get_slow_tests",description:"Slowest test cases in a project by average duration, with max/min and trend direction across recent runs. Use to target performance work.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},runs:{type:"number",description:"Recent runs to analyze (default 50, max 100)"}},required:["projectId"]}},{name:"get_performance_trend",description:'Time series of run duration, average test duration, and p90 test duration for a project. Use to answer "is the suite getting slower?".',inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},limit:{type:"number",description:"Number of recent runs (default 30, max 100)"}},required:["projectId"]}},{name:"get_test_stability_trend",description:'Time-series stability for a single test case: flaky rate, pass rate, and average duration bucketed over its recent execution history. Use to answer "is this test getting flakier?".',inputSchema:{type:"object",properties:{id:{type:"number",description:"Test case ID (stable testCaseId)"},buckets:{type:"number",description:"Number of time buckets (default 20, 5–50)"}},required:["id"]}},{name:"get_network_requests",description:"A run's network requests aggregated by method + normalized route, sorted by average duration, with status codes and captured backend server logs. Use to pin a UI failure on a slow or failing endpoint.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_failure_groups",description:"One run's failures grouped by failure cluster, with per-group affected cases and worker correlation. Run-scoped counterpart to list_clusters.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Test run ID"}},required:["id"]}},{name:"get_locator_healing",description:"Ranked alternative locators for a failing test-run-case: the failing locator, the recommended durable fix, and the full alternative lists (from prior success, element match, and ARIA snapshot). Use when fixing a broken selector.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"search",description:"Global search across all in-scope projects, runs (by label or numeric id), and test cases (by title). Use to find a run by its label or locate an entity across projects.",inputSchema:{type:"object",properties:{q:{type:"string",description:"Search query (min 2 chars)"}},required:["q"]}},{name:"list_case_traces",description:"List Playwright trace files for a test-run-case, with a download path for each. Fetch the bytes via GET /api/files/<path>.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"list_links",description:"List external entity links (Jira, GitHub PR/issue, etc.) attached to a run, test-run-case, or test case, with provider and unfurled status.",inputSchema:{type:"object",properties:{entityType:{type:"string",enum:["test_run","test_runs_case","test_case"],description:"Which entity the links are attached to"},id:{type:"number",description:"The entity ID matching entityType"}},required:["entityType","id"]}},{name:"list_tags",description:"List the project tag catalog (id, text, color).",inputSchema:{type:"object",properties:{}}},{name:"get_project_test_catalog",description:"The full test-case catalog for a project with aggregated pass/fail/flaky counts, average duration, and last status per test. Offset-paginated bulk companion to get_test_case.",inputSchema:{type:"object",properties:{projectId:{type:"number",description:"Project ID"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},offset:{type:"number",description:"Row offset for paging (default 0)"},query:{type:"string",description:"Optional case-insensitive substring filter on title or file path"}},required:["projectId"]}},{name:"list_open_clusters",description:"Open failure clusters across all in-scope projects, ranked by occurrences — a cross-project triage queue. Filter by status; paginate with pageSize/cursor.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["open","resolved","ignored"],description:"Triage status (default: open)"},pageSize:{type:"number",description:"Results per page (default 10, max 50)"},cursor:{type:"string",description:"Opaque cursor from a previous response to get the next page"}}}},{name:"get_instance_stats",description:"Instance-wide counts (projects, runs, test cases, executions, files) and total storage size. Admin only.",inputSchema:{type:"object",properties:{}}},{name:"explain_failure",description:"One-call evidence bundle for a single failing execution: error, steps, console, ARIA snapshot, the recommended locator fix, a screenshot count, and the AI diagnosis context. Prefer this over chaining get_test_run_case + get_locator_healing + get_test_case_context.",inputSchema:{type:"object",properties:{testRunsCaseId:{type:"number",description:"Test run case ID (executionId)"}},required:["testRunsCaseId"]}},{name:"set_cluster_status",description:"Triage a failure cluster: set its status to open, resolved, or ignored with an optional note. Requires reporter or admin access. Use after fixing the underlying issue.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},status:{type:"string",enum:["open","resolved","ignored"],description:"New triage status"},triageNote:{type:"string",description:"Optional note explaining the status change"}},required:["id","status"]}},{name:"set_cluster_base_commit",description:'Pin the baseline commit SHA a cluster uses for its SCM-diff diagnosis context, so "what changed since green" is accurate. Requires reporter or admin access.',inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},commit:{type:"string",description:"Baseline commit SHA (empty to clear)"}},required:["id","commit"]}},{name:"submit_diagnosis_feedback",description:"Record thumbs up/down feedback on a stored diagnosis, with an optional note. Requires reporter or admin access.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Diagnosis ID"},feedback:{type:"string",enum:["up","down"],description:"Rating (omit to clear)"},feedbackNote:{type:"string",description:"Optional note"}},required:["id"]}},{name:"run_cluster_diagnosis",description:"Trigger an AI diagnosis for a failure cluster and return the result (category, confidence, root cause, suggested fix). Returns the existing completed diagnosis unless force is set. Requires reporter or admin access and a configured AI provider.",inputSchema:{type:"object",properties:{id:{type:"number",description:"Cluster ID"},force:{type:"boolean",description:"Re-run even if a completed diagnosis exists (default false)"},baseCommit:{type:"string",description:"Optional baseline commit SHA for SCM-diff context"}},required:["id"]}}];function V(h){return new URL(globalThis.location.href)}const J={class:"max-w-3xl mx-auto p-6 space-y-6"},Q={class:"flex flex-col gap-1.5"},X={class:"min-w-0"},Z={class:"text-sm font-mono font-semibold text-foreground"},ee={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},te={class:"space-y-3"},se={class:"space-y-3"},re={class:"space-y-3"},ie={class:"space-y-3"},oe={class:"space-y-3"},ne={class:"space-y-3"},ae={class:"space-y-2"},ce={class:"flex items-center gap-2"},pe={class:"flex-1 px-3 py-2 bg-muted rounded-md text-sm font-mono break-all"},ve=L({__name:"mcp",setup(h){const m=E(),g=m.public.demoMode,b=V(),n=a(()=>`${m.public.siteUrl||b.origin}/mcp`);M({title:"MCP server — Piwi Dashboard"});const _=$,x=[{label:"Claude Code",slot:"claude-code"},{label:"Cursor",slot:"cursor"},{label:"VS Code",slot:"vscode"},{label:"Claude Desktop",slot:"claude-desktop"},{label:"Gemini CLI",slot:"gemini"},{label:"Windsurf / Continue",slot:"windsurf"}],I=a(()=>`claude mcp add --transport http piwi ${n.value} \\
2
2
  --header "Authorization: Bearer pd_YOUR_API_KEY"`),j=a(()=>JSON.stringify({mcpServers:{piwi:{url:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2)),v=a(()=>JSON.stringify({servers:{piwi:{type:"http",url:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2)),w=a(()=>JSON.stringify({mcpServers:{piwi:{type:"http",url:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2)),S=a(()=>`gemini mcp add --transport http piwi ${n.value} \\
3
3
  --header "Authorization: Bearer pd_YOUR_API_KEY"`),k=a(()=>JSON.stringify({mcpServers:{piwi:{serverUrl:n.value,headers:{Authorization:"Bearer pd_YOUR_API_KEY"}}}},null,2));return(C,t)=>{const q=O,R=z,A=Y,p=H,c=K,P=W,D=F,T=U;return d(),f(T,null,{header:i(()=>[r(q,{title:"MCP server"})]),body:i(()=>[e("div",J,[o(g)?(d(),f(R,{key:0,color:"info",icon:"i-lucide-bot",title:"Feature preview",description:"The MCP endpoint is not active in this demo — it requires a real Piwi backend. The tools and client setup shown below reflect what your own deployment exposes."})):B("",!0),r(p,{icon:"i-lucide-bot",title:"What it provides",help:"mcp.tools"},{default:i(()=>[e("div",Q,[(d(!0),y(N,null,G(o(_),u=>(d(),y("div",{key:u.name,class:"flex items-start gap-3 px-3 py-2.5 rounded-md bg-elevated/50 border border-default hover:bg-elevated transition-colors"},[r(A,{name:"i-lucide-wrench",class:"size-4 mt-0.5 shrink-0 text-primary"}),e("div",X,[e("p",Z,l(u.name),1),e("p",ee,l(u.description),1)])]))),128))])]),_:1}),r(p,{icon:"i-lucide-key",title:"Authentication",help:"mcp.auth"},{default:i(()=>[...t[0]||(t[0]=[e("div",{class:"space-y-3 text-sm text-gray-600 dark:text-gray-400"},[e("p",null,[s(" MCP requests are authenticated with the same API keys used by the REST API. API keys start with "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_"),s(". ")]),e("p",null,[s(" Generate a key in "),e("strong",null,"Settings → Users → [your account] → API keys"),s(", then replace "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_YOUR_API_KEY"),s(" in the snippets below. ")]),e("p",{class:"text-xs text-gray-400"},[s(" When authentication is disabled ("),e("code",{class:"font-mono"},"PIWI_AUTH_ENABLED"),s(" not set), any request is accepted without a key. ")])],-1)])]),_:1}),r(p,{icon:"i-lucide-settings-2",title:"Client setup",help:"mcp.client-setup"},{default:i(()=>[t[13]||(t[13]=e("p",{class:"text-sm text-gray-500 dark:text-gray-400 mb-4"},[s(" Replace "),e("code",{class:"px-1 py-0.5 bg-muted rounded text-xs font-mono"},"pd_YOUR_API_KEY"),s(" with your actual API key. The MCP URL shown below is auto-detected from your current browser origin. ")],-1)),r(P,{items:x,ui:{list:"mb-4"}},{"claude-code":i(()=>[e("div",te,[t[1]||(t[1]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"}," Run once in any terminal. Claude Code stores the server in your global MCP config. ",-1)),r(c,{code:o(I),lang:"sh"},null,8,["code"]),t[2]||(t[2]=e("p",{class:"text-xs text-gray-400"},[s(" After adding, restart Claude Code and use "),e("code",{class:"font-mono"},"/mcp"),s(" to verify "),e("strong",null,"piwi"),s(" is connected. Claude will call the tools automatically when you ask about test results or failures. ")],-1))])]),cursor:i(()=>[e("div",se,[t[3]||(t[3]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to "),e("code",{class:"font-mono text-xs"},"~/.cursor/mcp.json"),s(" (global) or "),e("code",{class:"font-mono text-xs"},".cursor/mcp.json"),s(" in your project root: ")],-1)),r(c,{code:o(j),lang:"json"},null,8,["code"]),t[4]||(t[4]=e("p",{class:"text-xs text-gray-400"}," Restart Cursor, then enable the MCP server in Cursor Settings → MCP. ",-1))])]),vscode:i(()=>[e("div",re,[t[5]||(t[5]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to "),e("code",{class:"font-mono text-xs"},".vscode/mcp.json"),s(" in your workspace (VS Code Copilot agent mode, version 1.99+): ")],-1)),r(c,{code:o(v),lang:"json"},null,8,["code"]),t[6]||(t[6]=e("p",{class:"text-xs text-gray-400"}," The server appears in the Copilot chat agent drop-down once the file is saved. ",-1))])]),"claude-desktop":i(()=>[e("div",ie,[t[7]||(t[7]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},"Add to your Claude Desktop config file:",-1)),t[8]||(t[8]=e("ul",{class:"text-xs text-gray-400 space-y-0.5 mb-2"},[e("li",null,[e("strong",null,"macOS:"),e("code",{class:"font-mono"},"~/Library/Application Support/Claude/claude_desktop_config.json")]),e("li",null,[e("strong",null,"Windows:"),e("code",{class:"font-mono"},"%APPDATA%\\Claude\\claude_desktop_config.json")])],-1)),r(c,{code:o(w),lang:"json"},null,8,["code"]),t[9]||(t[9]=e("p",{class:"text-xs text-gray-400"}," Requires Claude Desktop with remote MCP support (released early 2025). Restart the app after saving. ",-1))])]),gemini:i(()=>[e("div",oe,[t[10]||(t[10]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},"Run once to register the server with Gemini CLI:",-1)),r(c,{code:o(S),lang:"sh"},null,8,["code"]),t[11]||(t[11]=e("p",{class:"text-xs text-gray-400"}," Gemini CLI fetches the tool list on startup and makes them available in agent mode. ",-1))])]),windsurf:i(()=>[e("div",ne,[t[12]||(t[12]=e("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[s(" Add to your Windsurf or Continue MCP config. For Windsurf: "),e("code",{class:"font-mono text-xs"},"~/.codeium/windsurf/mcp_config.json"),s(". For Continue: "),e("code",{class:"font-mono text-xs"},"~/.continue/config.json"),s(" under "),e("code",{class:"font-mono text-xs"},"mcpServers"),s(". ")],-1)),r(c,{code:o(k),lang:"json"},null,8,["code"])])]),_:1})]),_:1}),r(p,{icon:"i-lucide-link",title:"Server URL"},{default:i(()=>[e("div",ae,[e("div",ce,[e("code",pe,l(o(n)),1),r(D,{icon:"i-lucide-external-link",size:"sm",color:"neutral",variant:"outline",title:"Open API docs",to:"/docs",external:!o(g)},{default:i(()=>[...t[14]||(t[14]=[s(" REST API docs ",-1)])]),_:1},8,["external"])]),t[15]||(t[15]=e("p",{class:"text-xs text-gray-400"},[s(" This is your Piwi instance's MCP endpoint. It is also the server URL to paste into client configs above. The server requires a valid Bearer token (or no auth if "),e("code",{class:"font-mono"},"PIWI_AUTH_ENABLED"),s(" is not set). ")],-1))])]),_:1})])]),_:1})}}});export{ve as default};
@@ -1,2 +1,2 @@
1
- import{d as _,o as l,f as p,g as u,j as d,v as f,p as g,k as a,h as o}from"./B8fs6GU9.js";import{_ as v}from"./DFw8I2FL.js";import{g as x}from"./wCQds5_f.js";const h=_({__name:"EnvManagedBadge",props:{envVars:{},size:{default:"sm"}},setup(r){const s=r,c=o(()=>{switch(s.size){case"xs":return"size-3";case"md":return"size-4";default:return"size-3.5"}}),i=o(()=>{if(!s.envVars?.length)return"Managed by environment variable";const e=s.envVars.map(n=>{const t=x(n).description;return t?`${n} — ${t}`:n});return e.length===1?`Set via ${e[0]}`:["Set via environment variables:",...e].join(`
1
+ import{d as _,o as l,f as p,g as u,j as d,v as f,p as g,k as a,h as o}from"./BPKwYP2Q.js";import{_ as v}from"./BpceIssd.js";import{g as x}from"./CQeMb57w.js";const h=_({__name:"EnvManagedBadge",props:{envVars:{},size:{default:"sm"}},setup(r){const s=r,c=o(()=>{switch(s.size){case"xs":return"size-3";case"md":return"size-4";default:return"size-3.5"}}),i=o(()=>{if(!s.envVars?.length)return"Managed by environment variable";const e=s.envVars.map(n=>{const t=x(n).description;return t?`${n} — ${t}`:n});return e.length===1?`Set via ${e[0]}`:["Set via environment variables:",...e].join(`
2
2
  `)});return(e,n)=>{const t=f,m=v;return l(),p(m,{text:a(i),ui:{content:"whitespace-pre-line max-w-sm"}},{default:u(()=>[d(t,{name:"i-lucide-lock",class:g(["text-gray-400",a(c)])},null,8,["class"])]),_:1},8,["text"])}}}),b=Object.assign(h,{__name:"EnvManagedBadge"});export{b as _};
@@ -1 +1 @@
1
- {"id":"f549de31-8db6-4504-b526-482778a55eba","timestamp":1784481462428}
1
+ {"id":"5182c9fb-56a6-4df2-9685-4020a08ce7a5","timestamp":1784747904034}
@@ -0,0 +1 @@
1
+ {"id":"5182c9fb-56a6-4df2-9685-4020a08ce7a5","timestamp":1784747904034,"prerendered":[]}
@@ -1 +1 @@
1
- import{k as C,B as W,al as N,az as P,cc as j,h as B}from"./B8fs6GU9.js";function H(l,h,t){const e=new Array(l);return new Proxy(e,{get(s,i,o){if(typeof i=="string"){const n=i.charCodeAt(0);if(n>=48&&n<=57){const r=+i;if(Number.isInteger(r)&&r>=0&&r<l){let a=s[r];if(!a){const d=h[r*2];a=s[r]={index:r,key:t(r),start:d,size:h[r*2+1],end:d+h[r*2+1],lane:0}}return a}}if(i==="length")return l}return Reflect.get(s,i,o)}})}function z(l,h,t){let e=t.initialDeps??[],s,i=!0;function o(){const n=l();return(n.length!==e.length||n.some((a,d)=>e[d]!==a))&&(e=n,s=h(...n),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return o.updateDeps=n=>{e=n},o}function L(l,h){if(l===void 0)throw new Error("Unexpected undefined");return l}const J=(l,h)=>Math.abs(l-h)<1.01,U=(l,h,t)=>{let e;return function(...s){l.clearTimeout(e),e=l.setTimeout(()=>h.apply(this,s),t)}};let M;const R=()=>{if(M!==void 0)return M;if(typeof navigator>"u")return M=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return M=!0;const l=navigator.maxTouchPoints;return M=navigator.platform==="MacIntel"&&l!==void 0&&l>0},V=l=>{const{offsetWidth:h,offsetHeight:t}=l;return{width:h,height:t}},q=l=>l,X=l=>{const h=Math.max(l.startIndex-l.overscan,0),e=Math.min(l.endIndex+l.overscan,l.count-1)-h+1,s=new Array(e);for(let i=0;i<e;i++)s[i]=h+i;return s},$=(l,h)=>{const t=l.scrollElement;if(!t)return;const e=l.targetWindow;if(!e)return;const s=o=>{const{width:n,height:r}=o;h({width:Math.round(n),height:Math.round(r)})};if(s(V(t)),!e.ResizeObserver)return()=>{};const i=new e.ResizeObserver(o=>{const n=()=>{const r=o[0];if(r?.borderBoxSize){const a=r.borderBoxSize[0];if(a){s({width:a.inlineSize,height:a.blockSize});return}}s(V(t))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},A={passive:!0},G=typeof window>"u"?!0:"onscrollend"in window,Q=(l,h,t)=>{const e=l.scrollElement;if(!e)return;const s=l.targetWindow;if(!s)return;const i=l.options.useScrollendEvent&&G;let o=0;const n=i?null:U(s,()=>h(o,!1),l.options.isScrollingResetDelay),r=m=>()=>{o=t(e),n?.(),h(o,m)},a=r(!0),d=r(!1);return e.addEventListener("scroll",a,A),i&&e.addEventListener("scrollend",d,A),()=>{e.removeEventListener("scroll",a),i&&e.removeEventListener("scrollend",d)}},Y=(l,h)=>Q(l,h,t=>{const{horizontal:e,isRtl:s}=l.options;return e?t.scrollLeft*(s&&-1||1):t.scrollTop}),Z=(l,h,t)=>{if(t.options.useCachedMeasurements){const e=t.indexFromElement(l),s=t.options.getItemKey(e);return t.itemSizeCache.get(s)??t.options.estimateSize(e)}if(h?.borderBoxSize){const e=h.borderBoxSize[0];if(e)return Math.round(e[t.options.horizontal?"inlineSize":"blockSize"])}if(!h){const e=t.indexFromElement(l),s=t.options.getItemKey(e),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},tt=(l,{adjustments:h=0,behavior:t},e)=>{var s,i;(i=(s=e.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[e.options.horizontal?"left":"top"]:l+h,behavior:t})},et=tt;class st{constructor(h){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,e,s;return((s=(e=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:e.now)==null?void 0:s.call(e))??Date.now()},this.observer=(()=>{let t=null;const e=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const o=()=>{const n=i.target,r=this.indexFromElement(n);if(!n.isConnected){this.observer.unobserve(n);for(const[a,d]of this.elementsCache)if(d===n){this.elementsCache.delete(a);break}return}this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=e())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=e())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=e())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var e,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:q,rangeExtractor:X,onChange:()=>{},measureElement:Z,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const u in t){const g=t[u];g!==void 0&&(i[u]=g)}const o=this.options;let n=null,r=null,a=!1;if(o!==void 0&&o.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const u=o.count,g=i.count,S=this.getMeasurements(),E=u>0?((e=S[0])==null?void 0:e.key)??o.getItemKey(0):null,O=u>0?((s=S[u-1])==null?void 0:s.key)??o.getItemKey(u-1):null;if(g!==u||u>0&&g>0&&(i.getItemKey(0)!==E||i.getItemKey(g-1)!==O)){a=!0;const b=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;b&&(n=[b.key,this.getScrollOffset()-b.start]);const v=i.followOnAppend===!0?"auto":i.followOnAppend||null;v&&g>u&&this.isAtEnd(o.scrollEndThreshold)&&(u===0||i.getItemKey(g-1)!==O)&&(r=v)}}this.options=i,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,m=0;if(n&&this.scrollOffset!==null){const[u,g]=n,S=this.getMeasurements(),{count:E,getItemKey:O}=this.options;let c=0;for(;c<E&&O(c)!==u;)c++;if(c<E){const f=S[c];if(f){const b=f.start+g;b!==this.scrollOffset&&(m=b-this.scrollOffset,this.scrollOffset=b,d=!0)}}}(d||r)&&(this.pendingScrollAnchor=[d?n[0]:null,d?n[1]:0,r,m])},this.notify=t=>{var e,s;(s=(e=this.options).onChange)==null||s.call(e,this,t)},this.maybeNotify=z(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{if(o&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const n=this.getScrollOffset();this.scrollDirection=o?n===i?this.scrollDirection:n<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,o=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!R()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",o,A),i.addEventListener("touchend",n,A),this.unsubs.push(()=>{i.removeEventListener("touchstart",o),i.removeEventListener("touchend",n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,o,n,r]=s;i!==null&&!n&&(R()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?r!==0&&(this._iosDeferredAdjustment+=r):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),n&&this.scrollToEnd({behavior:n})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),e=this.getMaxScrollOffset();if(t<0||t>e)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=z(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,e,s,i,o,n,r,a)=>(this.prevLanes!==void 0&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMin=null,{count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:r,gap:a}),{key:!1}),this.getMeasurements=z(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:r,gap:a},d)=>{const m=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const c of this.laneAssignments.keys())c>=t&&this.laneAssignments.delete(c);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),n===1){const c=t*2;let f=this._flatMeasurements;if(!f||f.length<c){const p=new Float64Array(c);f&&u>0&&p.set(f.subarray(0,u*2)),f=p,this._flatMeasurements=f}let b;if(u===0)b=e+s;else{const p=u-1;b=f[p*2]+f[p*2+1]+a}for(let p=u;p<t;p++){const T=i(p),w=m.get(T),x=typeof w=="number"?w:this.options.estimateSize(p);f[p*2]=b,f[p*2+1]=x,b+=x+a}const v=H(t,f,i);return this.measurementsCache=v,v}const g=this.measurementsCache.slice(0,u),S=new Array(n).fill(void 0),E=new Float64Array(n);let O=0;for(let c=0;c<u;c++){const f=g[c];f&&(S[f.lane]===void 0&&O++,S[f.lane]=c,E[f.lane]=f.end)}for(let c=u;c<t;c++){const f=i(c),b=this.laneAssignments.get(c);let v,p;const T=r==="estimate"||m.has(f);if(b!==void 0&&this.options.lanes>1){v=b;const y=S[v],I=y!==void 0?g[y]:void 0;p=I?I.end+a:e+s}else if(O===n){let y=0,I=E[0],D=S[0];for(let _=1;_<n;_++){const F=E[_];(F<I||F===I&&S[_]<D)&&(y=_,I=F,D=S[_])}v=y,p=I+a,T&&this.laneAssignments.set(c,v)}else v=c%this.options.lanes,p=e+s,T&&this.laneAssignments.set(c,v);const w=m.get(f),x=typeof w=="number"?w:this.options.estimateSize(c),k=p+x;g[c]={index:c,start:p,size:x,end:k,key:f,lane:v},S[v]===void 0&&O++,S[v]=c,E[v]=k}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=z(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,s,i)=>t.length===0||e===0?(this.range=null,null):(this.range=nt(t,e,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=z(()=>{let t=null,e=null;const s=this.calculateRange();return s&&(t=s.startIndex,e=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,s,i,o)=>i===null||o===null?[]:t({startIndex:i,endIndex:o,overscan:e,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const e=this.options.indexAttribute,s=t.getAttribute(e);return s?parseInt(s,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var e;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((e=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:e.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,s-i),n=Math.min(this.options.count-1,s+i);return t>=o&&t<=n}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,n)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(n))});return}const e=this.indexFromElement(t),s=this.options.getItemKey(e),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(e)&&this.resizeItem(e,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,e)=>{var s,i;if(t<0||t>=this.options.count)return;let o,n,r;const a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)r=this.options.getItemKey(t),n=a[t*2],o=a[t*2+1];else{const u=this.measurementsCache[t];if(!u)return;r=u.key,n=u.start,o=u.size}const d=this.itemSizeCache.get(r)??o,m=e-d;if(m!==0){const u=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=u?this.getTotalSize():0,S=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:r,start:n,size:o,end:n+o,lane:0},m,this):n<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(r)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(r,e),this.itemSizeCacheVersion++,u?this.applyScrollAdjustment(this.getTotalSize()-g):S&&this.applyScrollAdjustment(m),this.notify(!1)}},this.getVirtualItems=z(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{const s=[];for(let i=0,o=t.length;i<o;i++){const n=t[i],r=e[n];s.push(r)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const e=this.getMeasurements();if(e.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,o=K(0,e.length-1,i?n=>s[n*2]:n=>L(e[n]).start,t);return L(e[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,e,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=t>=o+i?"end":"start"),e==="center"?t+=(s-i)/2:e==="end"&&(t-=i);const n=this.getMaxScrollOffset();return Math.max(Math.min(n,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(e==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)e="end";else if(o.start<=i+this.options.scrollPaddingStart)e="start";else return[i,e];if(e==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];const n=e==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,e,o.size),e]},this.scrollToOffset=(t,{align:e="start",behavior:s="auto"}={})=>{const i=this.getOffsetForAlignment(t,e),o=this.now();this.scrollState={index:null,align:e,behavior:s,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:e="auto",behavior:s="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,e);if(!i)return;const[o,n]=i,r=this.now();this.scrollState={index:t,align:n,behavior:s,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:e="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:e,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const e=this.getMeasurements();let s;if(e.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=e.length-1,o=this._flatMeasurements;o!=null?s=o[i*2]+o[i*2+1]:s=((t=e[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let o=e.length-1;for(;o>=0&&i.some(n=>n===null);){const n=e[o];i[n.lane]===null&&(i[n.lane]=n.end),o--}s=Math.max(...i.filter(n=>n!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const e=this.getMeasurements();for(const s of e)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:e,behavior:s})=>{this._intendedScrollOffset=t+(e??0),this.options.scrollToFn(t,{behavior:s,adjustments:e},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(h)}applyScrollAdjustment(h,t){h!==0&&(R()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=h:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=h,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=e?e[0]:this.scrollState.lastTargetOffset,i=1,o=s!==this.scrollState.lastTargetOffset;if(!o&&J(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const n=this.getSize()||600,r=Math.abs(s-this.getScrollOffset()),a=this.scrollState.behavior==="smooth"&&r>n;this.scrollState.lastTargetOffset=s,a||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:a?"smooth":"auto"})}this.scheduleScrollReconcile()}}const K=(l,h,t,e)=>{for(;l<=h;){const s=(l+h)/2|0,i=t(s);if(i<e)l=s+1;else if(i>e)h=s-1;else return s}return l>0?l-1:0};function it(l,h,t){let e=0;for(;e<=h;){const s=(e+h)/2|0,i=l[s*2];if(i<t)e=s+1;else if(i>t)h=s-1;else return s}return e>0?e-1:0}function nt(l,h,t,e,s){const i=l.length-1;if(l.length<=e)return{startIndex:0,endIndex:i};if(e===1&&s!==null){const a=it(s,i,t);let d=a;const m=t+h;for(;d<i&&s[d*2]+s[d*2+1]<m;)d++;return{startIndex:a,endIndex:d}}let n=K(0,i,a=>l[a].start,t),r=n;if(e===1)for(;r<i&&l[r].end<t+h;)r++;else if(e>1){const a=Array(e).fill(0);for(;r<i&&a.some(m=>m<t+h);){const m=l[r];a[m.lane]=m.end,r++}const d=Array(e).fill(t+h);for(;n>=0&&d.some(m=>m>=t);){const m=l[n];d[m.lane]=m.start,n--}n=Math.max(0,n-n%e),r=Math.min(i,r+(e-1-r%e))}return{startIndex:n,endIndex:r}}function ot(l){const h=new st(C(l)),t=P(h),e=h._didMount();return W(()=>C(l).getScrollElement(),s=>{s&&h._willUpdate()},{immediate:!0}),W(()=>C(l),s=>{h.setOptions({...s,onChange:(i,o)=>{var n;j(t),(n=s.onChange)==null||n.call(s,i,o)}}),h._willUpdate(),j(t)},{immediate:!0}),N(e),t}function rt(l){return ot(B(()=>({observeElementRect:$,observeElementOffset:Y,scrollToFn:et,...C(l)})))}export{rt as u};
1
+ import{k as C,B as W,al as N,az as P,cb as j,h as B}from"./BPKwYP2Q.js";function H(l,h,t){const e=new Array(l);return new Proxy(e,{get(s,i,o){if(typeof i=="string"){const n=i.charCodeAt(0);if(n>=48&&n<=57){const r=+i;if(Number.isInteger(r)&&r>=0&&r<l){let a=s[r];if(!a){const d=h[r*2];a=s[r]={index:r,key:t(r),start:d,size:h[r*2+1],end:d+h[r*2+1],lane:0}}return a}}if(i==="length")return l}return Reflect.get(s,i,o)}})}function z(l,h,t){let e=t.initialDeps??[],s,i=!0;function o(){const n=l();return(n.length!==e.length||n.some((a,d)=>e[d]!==a))&&(e=n,s=h(...n),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return o.updateDeps=n=>{e=n},o}function L(l,h){if(l===void 0)throw new Error("Unexpected undefined");return l}const J=(l,h)=>Math.abs(l-h)<1.01,U=(l,h,t)=>{let e;return function(...s){l.clearTimeout(e),e=l.setTimeout(()=>h.apply(this,s),t)}};let M;const R=()=>{if(M!==void 0)return M;if(typeof navigator>"u")return M=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return M=!0;const l=navigator.maxTouchPoints;return M=navigator.platform==="MacIntel"&&l!==void 0&&l>0},V=l=>{const{offsetWidth:h,offsetHeight:t}=l;return{width:h,height:t}},q=l=>l,X=l=>{const h=Math.max(l.startIndex-l.overscan,0),e=Math.min(l.endIndex+l.overscan,l.count-1)-h+1,s=new Array(e);for(let i=0;i<e;i++)s[i]=h+i;return s},$=(l,h)=>{const t=l.scrollElement;if(!t)return;const e=l.targetWindow;if(!e)return;const s=o=>{const{width:n,height:r}=o;h({width:Math.round(n),height:Math.round(r)})};if(s(V(t)),!e.ResizeObserver)return()=>{};const i=new e.ResizeObserver(o=>{const n=()=>{const r=o[0];if(r?.borderBoxSize){const a=r.borderBoxSize[0];if(a){s({width:a.inlineSize,height:a.blockSize});return}}s(V(t))};l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},A={passive:!0},G=typeof window>"u"?!0:"onscrollend"in window,Q=(l,h,t)=>{const e=l.scrollElement;if(!e)return;const s=l.targetWindow;if(!s)return;const i=l.options.useScrollendEvent&&G;let o=0;const n=i?null:U(s,()=>h(o,!1),l.options.isScrollingResetDelay),r=m=>()=>{o=t(e),n?.(),h(o,m)},a=r(!0),d=r(!1);return e.addEventListener("scroll",a,A),i&&e.addEventListener("scrollend",d,A),()=>{e.removeEventListener("scroll",a),i&&e.removeEventListener("scrollend",d)}},Y=(l,h)=>Q(l,h,t=>{const{horizontal:e,isRtl:s}=l.options;return e?t.scrollLeft*(s&&-1||1):t.scrollTop}),Z=(l,h,t)=>{if(t.options.useCachedMeasurements){const e=t.indexFromElement(l),s=t.options.getItemKey(e);return t.itemSizeCache.get(s)??t.options.estimateSize(e)}if(h?.borderBoxSize){const e=h.borderBoxSize[0];if(e)return Math.round(e[t.options.horizontal?"inlineSize":"blockSize"])}if(!h){const e=t.indexFromElement(l),s=t.options.getItemKey(e),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},tt=(l,{adjustments:h=0,behavior:t},e)=>{var s,i;(i=(s=e.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[e.options.horizontal?"left":"top"]:l+h,behavior:t})},et=tt;class st{constructor(h){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,e,s;return((s=(e=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:e.now)==null?void 0:s.call(e))??Date.now()},this.observer=(()=>{let t=null;const e=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const o=()=>{const n=i.target,r=this.indexFromElement(n);if(!n.isConnected){this.observer.unobserve(n);for(const[a,d]of this.elementsCache)if(d===n){this.elementsCache.delete(a);break}return}this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=e())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=e())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=e())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var e,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:q,rangeExtractor:X,onChange:()=>{},measureElement:Z,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const u in t){const g=t[u];g!==void 0&&(i[u]=g)}const o=this.options;let n=null,r=null,a=!1;if(o!==void 0&&o.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const u=o.count,g=i.count,S=this.getMeasurements(),E=u>0?((e=S[0])==null?void 0:e.key)??o.getItemKey(0):null,O=u>0?((s=S[u-1])==null?void 0:s.key)??o.getItemKey(u-1):null;if(g!==u||u>0&&g>0&&(i.getItemKey(0)!==E||i.getItemKey(g-1)!==O)){a=!0;const b=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;b&&(n=[b.key,this.getScrollOffset()-b.start]);const v=i.followOnAppend===!0?"auto":i.followOnAppend||null;v&&g>u&&this.isAtEnd(o.scrollEndThreshold)&&(u===0||i.getItemKey(g-1)!==O)&&(r=v)}}this.options=i,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,m=0;if(n&&this.scrollOffset!==null){const[u,g]=n,S=this.getMeasurements(),{count:E,getItemKey:O}=this.options;let c=0;for(;c<E&&O(c)!==u;)c++;if(c<E){const f=S[c];if(f){const b=f.start+g;b!==this.scrollOffset&&(m=b-this.scrollOffset,this.scrollOffset=b,d=!0)}}}(d||r)&&(this.pendingScrollAnchor=[d?n[0]:null,d?n[1]:0,r,m])},this.notify=t=>{var e,s;(s=(e=this.options).onChange)==null||s.call(e,this,t)},this.maybeNotify=z(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{if(o&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const n=this.getScrollOffset();this.scrollDirection=o?n===i?this.scrollDirection:n<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,o=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!R()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",o,A),i.addEventListener("touchend",n,A),this.unsubs.push(()=>{i.removeEventListener("touchstart",o),i.removeEventListener("touchend",n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,o,n,r]=s;i!==null&&!n&&(R()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?r!==0&&(this._iosDeferredAdjustment+=r):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),n&&this.scrollToEnd({behavior:n})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),e=this.getMaxScrollOffset();if(t<0||t>e)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=z(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,e,s,i,o,n,r,a)=>(this.prevLanes!==void 0&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMin=null,{count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:r,gap:a}),{key:!1}),this.getMeasurements=z(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:r,gap:a},d)=>{const m=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const c of this.laneAssignments.keys())c>=t&&this.laneAssignments.delete(c);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),n===1){const c=t*2;let f=this._flatMeasurements;if(!f||f.length<c){const p=new Float64Array(c);f&&u>0&&p.set(f.subarray(0,u*2)),f=p,this._flatMeasurements=f}let b;if(u===0)b=e+s;else{const p=u-1;b=f[p*2]+f[p*2+1]+a}for(let p=u;p<t;p++){const T=i(p),w=m.get(T),x=typeof w=="number"?w:this.options.estimateSize(p);f[p*2]=b,f[p*2+1]=x,b+=x+a}const v=H(t,f,i);return this.measurementsCache=v,v}const g=this.measurementsCache.slice(0,u),S=new Array(n).fill(void 0),E=new Float64Array(n);let O=0;for(let c=0;c<u;c++){const f=g[c];f&&(S[f.lane]===void 0&&O++,S[f.lane]=c,E[f.lane]=f.end)}for(let c=u;c<t;c++){const f=i(c),b=this.laneAssignments.get(c);let v,p;const T=r==="estimate"||m.has(f);if(b!==void 0&&this.options.lanes>1){v=b;const y=S[v],I=y!==void 0?g[y]:void 0;p=I?I.end+a:e+s}else if(O===n){let y=0,I=E[0],D=S[0];for(let _=1;_<n;_++){const F=E[_];(F<I||F===I&&S[_]<D)&&(y=_,I=F,D=S[_])}v=y,p=I+a,T&&this.laneAssignments.set(c,v)}else v=c%this.options.lanes,p=e+s,T&&this.laneAssignments.set(c,v);const w=m.get(f),x=typeof w=="number"?w:this.options.estimateSize(c),k=p+x;g[c]={index:c,start:p,size:x,end:k,key:f,lane:v},S[v]===void 0&&O++,S[v]=c,E[v]=k}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=z(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,s,i)=>t.length===0||e===0?(this.range=null,null):(this.range=nt(t,e,s,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=z(()=>{let t=null,e=null;const s=this.calculateRange();return s&&(t=s.startIndex,e=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,s,i,o)=>i===null||o===null?[]:t({startIndex:i,endIndex:o,overscan:e,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const e=this.options.indexAttribute,s=t.getAttribute(e);return s?parseInt(s,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var e;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((e=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:e.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,s-i),n=Math.min(this.options.count-1,s+i);return t>=o&&t<=n}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,n)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(n))});return}const e=this.indexFromElement(t),s=this.options.getItemKey(e),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(e)&&this.resizeItem(e,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,e)=>{var s,i;if(t<0||t>=this.options.count)return;let o,n,r;const a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)r=this.options.getItemKey(t),n=a[t*2],o=a[t*2+1];else{const u=this.measurementsCache[t];if(!u)return;r=u.key,n=u.start,o=u.size}const d=this.itemSizeCache.get(r)??o,m=e-d;if(m!==0){const u=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=u?this.getTotalSize():0,S=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:r,start:n,size:o,end:n+o,lane:0},m,this):n<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(r)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(r,e),this.itemSizeCacheVersion++,u?this.applyScrollAdjustment(this.getTotalSize()-g):S&&this.applyScrollAdjustment(m),this.notify(!1)}},this.getVirtualItems=z(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{const s=[];for(let i=0,o=t.length;i<o;i++){const n=t[i],r=e[n];s.push(r)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const e=this.getMeasurements();if(e.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,o=K(0,e.length-1,i?n=>s[n*2]:n=>L(e[n]).start,t);return L(e[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,e,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=t>=o+i?"end":"start"),e==="center"?t+=(s-i)/2:e==="end"&&(t-=i);const n=this.getMaxScrollOffset();return Math.max(Math.min(n,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(e==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)e="end";else if(o.start<=i+this.options.scrollPaddingStart)e="start";else return[i,e];if(e==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];const n=e==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,e,o.size),e]},this.scrollToOffset=(t,{align:e="start",behavior:s="auto"}={})=>{const i=this.getOffsetForAlignment(t,e),o=this.now();this.scrollState={index:null,align:e,behavior:s,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:e="auto",behavior:s="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,e);if(!i)return;const[o,n]=i,r=this.now();this.scrollState={index:t,align:n,behavior:s,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:e="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:e,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const e=this.getMeasurements();let s;if(e.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=e.length-1,o=this._flatMeasurements;o!=null?s=o[i*2]+o[i*2+1]:s=((t=e[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let o=e.length-1;for(;o>=0&&i.some(n=>n===null);){const n=e[o];i[n.lane]===null&&(i[n.lane]=n.end),o--}s=Math.max(...i.filter(n=>n!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const e=this.getMeasurements();for(const s of e)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:e,behavior:s})=>{this._intendedScrollOffset=t+(e??0),this.options.scrollToFn(t,{behavior:s,adjustments:e},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(h)}applyScrollAdjustment(h,t){h!==0&&(R()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=h:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=h,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=e?e[0]:this.scrollState.lastTargetOffset,i=1,o=s!==this.scrollState.lastTargetOffset;if(!o&&J(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const n=this.getSize()||600,r=Math.abs(s-this.getScrollOffset()),a=this.scrollState.behavior==="smooth"&&r>n;this.scrollState.lastTargetOffset=s,a||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:a?"smooth":"auto"})}this.scheduleScrollReconcile()}}const K=(l,h,t,e)=>{for(;l<=h;){const s=(l+h)/2|0,i=t(s);if(i<e)l=s+1;else if(i>e)h=s-1;else return s}return l>0?l-1:0};function it(l,h,t){let e=0;for(;e<=h;){const s=(e+h)/2|0,i=l[s*2];if(i<t)e=s+1;else if(i>t)h=s-1;else return s}return e>0?e-1:0}function nt(l,h,t,e,s){const i=l.length-1;if(l.length<=e)return{startIndex:0,endIndex:i};if(e===1&&s!==null){const a=it(s,i,t);let d=a;const m=t+h;for(;d<i&&s[d*2]+s[d*2+1]<m;)d++;return{startIndex:a,endIndex:d}}let n=K(0,i,a=>l[a].start,t),r=n;if(e===1)for(;r<i&&l[r].end<t+h;)r++;else if(e>1){const a=Array(e).fill(0);for(;r<i&&a.some(m=>m<t+h);){const m=l[r];a[m.lane]=m.end,r++}const d=Array(e).fill(t+h);for(;n>=0&&d.some(m=>m>=t);){const m=l[n];d[m.lane]=m.start,n--}n=Math.max(0,n-n%e),r=Math.min(i,r+(e-1-r%e))}return{startIndex:n,endIndex:r}}function ot(l){const h=new st(C(l)),t=P(h),e=h._didMount();return W(()=>C(l).getScrollElement(),s=>{s&&h._willUpdate()},{immediate:!0}),W(()=>C(l),s=>{h.setOptions({...s,onChange:(i,o)=>{var n;j(t),(n=s.onChange)==null||n.call(s,i,o)}}),h._willUpdate(),j(t)},{immediate:!0}),N(e),t}function rt(l){return ot(B(()=>({observeElementRect:$,observeElementOffset:Y,scrollToFn:et,...C(l)})))}export{rt as u};
@@ -1 +1 @@
1
- import{d as ee,w as te,b as oe,L as ae,c as A,i as n,k as t,f as u,g as s,j as a,F as le,P as se,o as d,_ as ne,q as m,t as j,O as re,v as ie,D as ce,M as q,ai as M,m as S,h as P,r as v,I as B,K as de}from"./B8fs6GU9.js";import{_ as ue}from"./o5WQ5Z7k.js";import{_ as me}from"./D4nLD93c.js";import{_ as pe}from"./BBJ9Pu3M.js";import{_ as ge}from"./PPFO8UVt.js";import{o as fe,s as N,_ as xe}from"./DzbOHjZH.js";import{_ as _e}from"./CD-xwM9N.js";import{p as ve}from"./CvCF77E-.js";import{u as be}from"./DAeYEeCC.js";import"./4fB15L_7.js";import"./wCQds5_f.js";import"./3SnTawZW.js";import"./DWzdeQ3Z.js";import"./B32ySRXg.js";import"./BC_Wu-fv.js";const ye={class:"space-y-6"},Te={class:"flex items-center gap-2"},Ce={class:"text-sm font-mono text-muted"},ke={class:"text-sm text-muted"},he={class:"flex gap-1 justify-end"},$e={class:"text-center py-12"},Ue={class:"flex justify-center mb-4"},Ve={class:"flex items-center gap-3"},we={key:0,class:"mt-2"},Ae={class:"flex items-center gap-3"},De={key:0,class:"mt-2"},b="#6366f1",Ge=ee({__name:"tags",async setup(Fe){let y,D;const{data:z,refresh:U}=([y,D]=te(()=>be("/api/tags","$WIWNTsOq96")),y=await y,D(),y),p=oe(),{authState:I}=ae(),K=de(),V=P(()=>z.value?.tags||[]),T=P(()=>K.public.authEnabled?I.value.user?.role==="administrator":!0),L=[{accessorKey:"text",header:"Tag"},{accessorKey:"color",header:"Color"},{accessorKey:"createdAt",header:"Created"},{accessorKey:"actions",header:""}],g=v(!1),F=fe({text:N().min(1,"Tag text is required").max(50,"Tag text must be at most 50 characters"),color:N().min(1,"Color is required")}),r=B({text:"",color:b}),x=v(!1),C=v(null),i=B({text:"",color:b});function R(l){C.value=l,i.text=l.text,i.color=l.color,x.value=!0}async function W(){try{await $fetch("/api/tags",{method:"POST",body:r}),p.add({title:"Tag created",description:`Tag "${r.text}" has been created successfully`,color:"success"}),g.value=!1,r.text="",r.color=b,await U()}catch(l){const e=l&&typeof l=="object"&&"data"in l?l.data?.message:void 0;p.add({title:"Failed to create tag",description:e||"An error occurred",color:"error"})}}async function G(){if(C.value)try{await $fetch(`/api/tags/${C.value.id}`,{method:"PUT",body:{text:i.text,color:i.color}}),p.add({title:"Tag updated",description:"Tag has been updated successfully",color:"success"}),x.value=!1,C.value=null,await U()}catch(l){const e=l&&typeof l=="object"&&"data"in l?l.data?.message:void 0;p.add({title:"Failed to update tag",description:e||"An error occurred",color:"error"})}}const _=v(!1),f=v(null);function H(l){f.value=l,_.value=!0}async function J(){const l=f.value;if(l){_.value=!1,f.value=null;try{await $fetch(`/api/tags/${l.id}`,{method:"DELETE"}),p.add({title:"Tag deleted",description:`Tag "${l.text}" has been deleted`,color:"success"}),await U()}catch(e){const c=e&&typeof e=="object"&&"data"in e?e.data?.message:void 0;p.add({title:"Failed to delete tag",description:c||"An error occurred",color:"error"})}}}return(l,e)=>{const c=ne,k=ue,Q=me,E=pe,X=ie,h=ce,$=ge,O=xe,w=_e,Y=se;return d(),A(le,null,[n("div",ye,[t(V).length>0?(d(),u(E,{key:0,title:"Tags",count:t(V).length,help:"settings.tags"},{actions:s(()=>[t(T)?(d(),u(c,{key:0,label:"Add tag",icon:"i-lucide-tag",size:"sm",onClick:e[0]||(e[0]=o=>g.value=!0)})):m("",!0)]),default:s(()=>[a(Q,{data:t(V),columns:L},{"text-cell":s(({row:o})=>[a(k,{text:o.original.text,color:o.original.color},null,8,["text","color"])]),"color-cell":s(({row:o})=>[n("div",Te,[n("span",{class:"inline-block w-4 h-4 rounded-full border border-black/10",style:re({backgroundColor:o.original.color})},null,4),n("span",Ce,j(o.original.color),1)])]),"createdAt-cell":s(({row:o})=>[n("span",ke,j(("prettyDateFormat"in l?l.prettyDateFormat:t(ve))(o.original.createdAt,{dateOnly:!0})),1)]),"actions-cell":s(({row:o})=>[n("div",he,[t(T)?(d(),u(c,{key:0,icon:"i-lucide-pencil",color:"neutral",variant:"ghost",size:"sm",onClick:Z=>R(o.original)},null,8,["onClick"])):m("",!0),t(T)?(d(),u(c,{key:1,icon:"i-lucide-trash-2",color:"error",variant:"ghost",size:"sm",onClick:Z=>H(o.original)},null,8,["onClick"])):m("",!0)])]),_:1},8,["data"])]),_:1},8,["count"])):(d(),u(E,{key:1,title:"Tags",count:0,help:"settings.tags"},{default:s(()=>[n("div",$e,[n("div",Ue,[a(X,{name:"i-lucide-tags",class:"text-4xl text-muted"})]),e[14]||(e[14]=n("h3",{class:"text-lg font-semibold mb-2"},"No tags yet",-1)),e[15]||(e[15]=n("p",{class:"text-muted mb-4"},"Create tags to categorize and filter your projects",-1)),t(T)?(d(),u(c,{key:0,label:"Add tag",icon:"i-lucide-tag",onClick:e[1]||(e[1]=o=>g.value=!0)})):m("",!0)])]),_:1}))]),a(Y,null,{default:s(()=>[a(w,{open:t(g),title:"Add new tag","onUpdate:open":e[6]||(e[6]=o=>g.value=o)},{body:s(()=>[a(O,{schema:t(F),state:t(r)},{default:s(()=>[a($,{label:"Tag text",name:"text",required:"",class:"mb-4"},{default:s(()=>[a(h,{modelValue:t(r).text,"onUpdate:modelValue":e[2]||(e[2]=o=>t(r).text=o),placeholder:"Enter tag name"},null,8,["modelValue"])]),_:1}),a($,{label:"Color",name:"color",required:"",class:"mb-4"},{default:s(()=>[n("div",Ve,[q(n("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>t(r).color=o),type:"color",class:"w-10 h-10 rounded cursor-pointer border border-default","aria-label":"Pick tag color"},null,512),[[M,t(r).color]]),a(h,{modelValue:t(r).color,"onUpdate:modelValue":e[4]||(e[4]=o=>t(r).color=o),class:"flex-1 font-mono",placeholder:"#6366f1"},null,8,["modelValue"])])]),_:1}),t(r).text?(d(),A("div",we,[e[16]||(e[16]=n("span",{class:"text-sm text-muted mr-2"},"Preview:",-1)),a(k,{text:t(r).text,color:t(r).color||b},null,8,["text","color"])])):m("",!0)]),_:1},8,["schema","state"])]),footer:s(()=>[a(c,{type:"button",color:"neutral",variant:"ghost",label:"Cancel",onClick:e[5]||(e[5]=o=>g.value=!1)}),a(c,{type:"submit",label:"Create tag",icon:"i-lucide-tag",onClick:W})]),_:1},8,["open"]),a(w,{open:t(x),title:"Edit tag","onUpdate:open":e[11]||(e[11]=o=>x.value=o)},{body:s(()=>[a(O,{schema:t(F),state:t(i)},{default:s(()=>[a($,{label:"Tag text",name:"text",required:"",class:"mb-4"},{default:s(()=>[a(h,{modelValue:t(i).text,"onUpdate:modelValue":e[7]||(e[7]=o=>t(i).text=o),placeholder:"Enter tag name"},null,8,["modelValue"])]),_:1}),a($,{label:"Color",name:"color",required:"",class:"mb-4"},{default:s(()=>[n("div",Ae,[q(n("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>t(i).color=o),type:"color",class:"w-10 h-10 rounded cursor-pointer border border-default","aria-label":"Pick tag color"},null,512),[[M,t(i).color]]),a(h,{modelValue:t(i).color,"onUpdate:modelValue":e[9]||(e[9]=o=>t(i).color=o),class:"flex-1 font-mono",placeholder:"#6366f1"},null,8,["modelValue"])])]),_:1}),t(i).text?(d(),A("div",De,[e[17]||(e[17]=n("span",{class:"text-sm text-muted mr-2"},"Preview:",-1)),a(k,{text:t(i).text,color:t(i).color||b},null,8,["text","color"])])):m("",!0)]),_:1},8,["schema","state"])]),footer:s(()=>[a(c,{type:"button",color:"neutral",variant:"ghost",label:"Cancel",onClick:e[10]||(e[10]=o=>x.value=!1)}),a(c,{type:"submit",label:"Save changes",icon:"i-lucide-check",onClick:G})]),_:1},8,["open"]),a(w,{open:t(_),title:"Delete tag","onUpdate:open":e[13]||(e[13]=o=>_.value=o)},{body:s(()=>[n("p",null,[e[18]||(e[18]=S(" Are you sure you want to delete tag ",-1)),t(f)?(d(),u(k,{key:0,text:t(f).text,color:t(f).color,class:"inline-flex"},null,8,["text","color"])):m("",!0),e[19]||(e[19]=S("? It will be removed from all projects. ",-1))])]),footer:s(()=>[a(c,{color:"neutral",variant:"ghost",label:"Cancel",onClick:e[12]||(e[12]=o=>_.value=!1)}),a(c,{color:"error",label:"Delete",icon:"i-lucide-trash-2",onClick:J})]),_:1},8,["open"])]),_:1})],64)}}});export{Ge as default};
1
+ import{d as ee,w as te,b as oe,L as ae,c as A,i as n,k as t,f as u,g as s,j as a,F as le,P as se,o as d,_ as ne,q as m,t as j,O as re,v as ie,D as ce,M as q,ai as M,m as S,h as P,r as v,I as B,K as de}from"./BPKwYP2Q.js";import{_ as ue}from"./BVW5qIDP.js";import{_ as me}from"./BuZOa2M3.js";import{_ as pe}from"./DhA17dqR.js";import{_ as ge}from"./DdbrJwT-.js";import{o as fe,s as N,_ as xe}from"./-KQO1A4C.js";import{_ as _e}from"./nCjfWTGm.js";import{p as ve}from"./k-z_VVTK.js";import{u as be}from"./BIf1R_fu.js";import"./d5ZB3uxF.js";import"./CQeMb57w.js";import"./r3SBLxtE.js";import"./DuMv-ugy.js";import"./B7yG1G_l.js";import"./DRtTLQri.js";const ye={class:"space-y-6"},Te={class:"flex items-center gap-2"},Ce={class:"text-sm font-mono text-muted"},ke={class:"text-sm text-muted"},he={class:"flex gap-1 justify-end"},$e={class:"text-center py-12"},Ue={class:"flex justify-center mb-4"},Ve={class:"flex items-center gap-3"},we={key:0,class:"mt-2"},Ae={class:"flex items-center gap-3"},De={key:0,class:"mt-2"},b="#6366f1",Ge=ee({__name:"tags",async setup(Fe){let y,D;const{data:z,refresh:U}=([y,D]=te(()=>be("/api/tags","$WIWNTsOq96")),y=await y,D(),y),p=oe(),{authState:I}=ae(),K=de(),V=P(()=>z.value?.tags||[]),T=P(()=>K.public.authEnabled?I.value.user?.role==="administrator":!0),L=[{accessorKey:"text",header:"Tag"},{accessorKey:"color",header:"Color"},{accessorKey:"createdAt",header:"Created"},{accessorKey:"actions",header:""}],g=v(!1),F=fe({text:N().min(1,"Tag text is required").max(50,"Tag text must be at most 50 characters"),color:N().min(1,"Color is required")}),r=B({text:"",color:b}),x=v(!1),C=v(null),i=B({text:"",color:b});function R(l){C.value=l,i.text=l.text,i.color=l.color,x.value=!0}async function W(){try{await $fetch("/api/tags",{method:"POST",body:r}),p.add({title:"Tag created",description:`Tag "${r.text}" has been created successfully`,color:"success"}),g.value=!1,r.text="",r.color=b,await U()}catch(l){const e=l&&typeof l=="object"&&"data"in l?l.data?.message:void 0;p.add({title:"Failed to create tag",description:e||"An error occurred",color:"error"})}}async function G(){if(C.value)try{await $fetch(`/api/tags/${C.value.id}`,{method:"PUT",body:{text:i.text,color:i.color}}),p.add({title:"Tag updated",description:"Tag has been updated successfully",color:"success"}),x.value=!1,C.value=null,await U()}catch(l){const e=l&&typeof l=="object"&&"data"in l?l.data?.message:void 0;p.add({title:"Failed to update tag",description:e||"An error occurred",color:"error"})}}const _=v(!1),f=v(null);function H(l){f.value=l,_.value=!0}async function J(){const l=f.value;if(l){_.value=!1,f.value=null;try{await $fetch(`/api/tags/${l.id}`,{method:"DELETE"}),p.add({title:"Tag deleted",description:`Tag "${l.text}" has been deleted`,color:"success"}),await U()}catch(e){const c=e&&typeof e=="object"&&"data"in e?e.data?.message:void 0;p.add({title:"Failed to delete tag",description:c||"An error occurred",color:"error"})}}}return(l,e)=>{const c=ne,k=ue,Q=me,E=pe,X=ie,h=ce,$=ge,O=xe,w=_e,Y=se;return d(),A(le,null,[n("div",ye,[t(V).length>0?(d(),u(E,{key:0,title:"Tags",count:t(V).length,help:"settings.tags"},{actions:s(()=>[t(T)?(d(),u(c,{key:0,label:"Add tag",icon:"i-lucide-tag",size:"sm",onClick:e[0]||(e[0]=o=>g.value=!0)})):m("",!0)]),default:s(()=>[a(Q,{data:t(V),columns:L},{"text-cell":s(({row:o})=>[a(k,{text:o.original.text,color:o.original.color},null,8,["text","color"])]),"color-cell":s(({row:o})=>[n("div",Te,[n("span",{class:"inline-block w-4 h-4 rounded-full border border-black/10",style:re({backgroundColor:o.original.color})},null,4),n("span",Ce,j(o.original.color),1)])]),"createdAt-cell":s(({row:o})=>[n("span",ke,j(("prettyDateFormat"in l?l.prettyDateFormat:t(ve))(o.original.createdAt,{dateOnly:!0})),1)]),"actions-cell":s(({row:o})=>[n("div",he,[t(T)?(d(),u(c,{key:0,icon:"i-lucide-pencil",color:"neutral",variant:"ghost",size:"sm",onClick:Z=>R(o.original)},null,8,["onClick"])):m("",!0),t(T)?(d(),u(c,{key:1,icon:"i-lucide-trash-2",color:"error",variant:"ghost",size:"sm",onClick:Z=>H(o.original)},null,8,["onClick"])):m("",!0)])]),_:1},8,["data"])]),_:1},8,["count"])):(d(),u(E,{key:1,title:"Tags",count:0,help:"settings.tags"},{default:s(()=>[n("div",$e,[n("div",Ue,[a(X,{name:"i-lucide-tags",class:"text-4xl text-muted"})]),e[14]||(e[14]=n("h3",{class:"text-lg font-semibold mb-2"},"No tags yet",-1)),e[15]||(e[15]=n("p",{class:"text-muted mb-4"},"Create tags to categorize and filter your projects",-1)),t(T)?(d(),u(c,{key:0,label:"Add tag",icon:"i-lucide-tag",onClick:e[1]||(e[1]=o=>g.value=!0)})):m("",!0)])]),_:1}))]),a(Y,null,{default:s(()=>[a(w,{open:t(g),title:"Add new tag","onUpdate:open":e[6]||(e[6]=o=>g.value=o)},{body:s(()=>[a(O,{schema:t(F),state:t(r)},{default:s(()=>[a($,{label:"Tag text",name:"text",required:"",class:"mb-4"},{default:s(()=>[a(h,{modelValue:t(r).text,"onUpdate:modelValue":e[2]||(e[2]=o=>t(r).text=o),placeholder:"Enter tag name"},null,8,["modelValue"])]),_:1}),a($,{label:"Color",name:"color",required:"",class:"mb-4"},{default:s(()=>[n("div",Ve,[q(n("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>t(r).color=o),type:"color",class:"w-10 h-10 rounded cursor-pointer border border-default","aria-label":"Pick tag color"},null,512),[[M,t(r).color]]),a(h,{modelValue:t(r).color,"onUpdate:modelValue":e[4]||(e[4]=o=>t(r).color=o),class:"flex-1 font-mono",placeholder:"#6366f1"},null,8,["modelValue"])])]),_:1}),t(r).text?(d(),A("div",we,[e[16]||(e[16]=n("span",{class:"text-sm text-muted mr-2"},"Preview:",-1)),a(k,{text:t(r).text,color:t(r).color||b},null,8,["text","color"])])):m("",!0)]),_:1},8,["schema","state"])]),footer:s(()=>[a(c,{type:"button",color:"neutral",variant:"ghost",label:"Cancel",onClick:e[5]||(e[5]=o=>g.value=!1)}),a(c,{type:"submit",label:"Create tag",icon:"i-lucide-tag",onClick:W})]),_:1},8,["open"]),a(w,{open:t(x),title:"Edit tag","onUpdate:open":e[11]||(e[11]=o=>x.value=o)},{body:s(()=>[a(O,{schema:t(F),state:t(i)},{default:s(()=>[a($,{label:"Tag text",name:"text",required:"",class:"mb-4"},{default:s(()=>[a(h,{modelValue:t(i).text,"onUpdate:modelValue":e[7]||(e[7]=o=>t(i).text=o),placeholder:"Enter tag name"},null,8,["modelValue"])]),_:1}),a($,{label:"Color",name:"color",required:"",class:"mb-4"},{default:s(()=>[n("div",Ae,[q(n("input",{"onUpdate:modelValue":e[8]||(e[8]=o=>t(i).color=o),type:"color",class:"w-10 h-10 rounded cursor-pointer border border-default","aria-label":"Pick tag color"},null,512),[[M,t(i).color]]),a(h,{modelValue:t(i).color,"onUpdate:modelValue":e[9]||(e[9]=o=>t(i).color=o),class:"flex-1 font-mono",placeholder:"#6366f1"},null,8,["modelValue"])])]),_:1}),t(i).text?(d(),A("div",De,[e[17]||(e[17]=n("span",{class:"text-sm text-muted mr-2"},"Preview:",-1)),a(k,{text:t(i).text,color:t(i).color||b},null,8,["text","color"])])):m("",!0)]),_:1},8,["schema","state"])]),footer:s(()=>[a(c,{type:"button",color:"neutral",variant:"ghost",label:"Cancel",onClick:e[10]||(e[10]=o=>x.value=!1)}),a(c,{type:"submit",label:"Save changes",icon:"i-lucide-check",onClick:G})]),_:1},8,["open"]),a(w,{open:t(_),title:"Delete tag","onUpdate:open":e[13]||(e[13]=o=>_.value=o)},{body:s(()=>[n("p",null,[e[18]||(e[18]=S(" Are you sure you want to delete tag ",-1)),t(f)?(d(),u(k,{key:0,text:t(f).text,color:t(f).color,class:"inline-flex"},null,8,["text","color"])):m("",!0),e[19]||(e[19]=S("? It will be removed from all projects. ",-1))])]),footer:s(()=>[a(c,{color:"neutral",variant:"ghost",label:"Cancel",onClick:e[12]||(e[12]=o=>_.value=!1)}),a(c,{color:"error",label:"Delete",icon:"i-lucide-trash-2",onClick:J})]),_:1},8,["open"])]),_:1})],64)}}});export{Ge as default};