@vostride/agent-qa-dashboard-ui 0.1.18 → 0.1.20

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 (209) hide show
  1. package/dist/assets/{arrow-up-down-CwmMJuHC.js → arrow-up-down-B4k_G_pz.js} +1 -1
  2. package/dist/assets/badge-DHCU59H0.js +1 -0
  3. package/dist/assets/batch-action-bar-Dd_8W0p9.js +1 -0
  4. package/dist/assets/{circle-alert-RZI0g_tD.js → circle-alert-TPWM0719.js} +1 -1
  5. package/dist/assets/{circle-x-CcGlHxRU.js → circle-x-ITZ_DbXH.js} +1 -1
  6. package/dist/assets/config-DMv2WZOF.js +10 -0
  7. package/dist/assets/{copy-CWpai22Y.js → copy-D-NZb7QZ.js} +1 -1
  8. package/dist/assets/{cssMode-BB-fH2D6.js → cssMode-Ci86QdEV.js} +1 -1
  9. package/dist/assets/{display-step-nrAd20yH.js → display-step-CYKXUkbs.js} +1 -1
  10. package/dist/assets/dist-_gv57K8d.js +1 -0
  11. package/dist/assets/empty-state-3cB27tBp.js +1 -0
  12. package/dist/assets/{external-link-xaS9gsyo.js → external-link-DvyIDphy.js} +1 -1
  13. package/dist/assets/{eye-BmHDIr7J.js → eye-DkGk2gsF.js} +1 -1
  14. package/dist/assets/{file-code-B22xRpxi.js → file-code-DDa3GwxK.js} +1 -1
  15. package/dist/assets/{file-search-CeDGqauF.js → file-search-NMd1pdjr.js} +1 -1
  16. package/dist/assets/filename-validation-CaFIUcWo.js +1 -0
  17. package/dist/assets/{freemarker2-BZ9nT_ca.js → freemarker2-BAginoYi.js} +1 -1
  18. package/dist/assets/{grip-vertical-CJUfU7Zx.js → grip-vertical-MY-i_r9J.js} +1 -1
  19. package/dist/assets/{handlebars-CcFgORss.js → handlebars-C6jsxsLs.js} +1 -1
  20. package/dist/assets/hook-editor-Cjix8FD5.js +1 -0
  21. package/dist/assets/hook-runtime-DCkWsFrF.js +5 -0
  22. package/dist/assets/hook-viewer-Ca73H02j.js +1 -0
  23. package/dist/assets/hooks-3zdPj97l.js +1 -0
  24. package/dist/assets/{html-C5cEOw4y.js → html-Cyb0M0oP.js} +1 -1
  25. package/dist/assets/{htmlMode-B54wW7aG.js → htmlMode-DshMgI5s.js} +1 -1
  26. package/dist/assets/{id-badge-DO71VWC9.js → id-badge-CIlIhfqv.js} +2 -2
  27. package/dist/assets/index-Bu0wLCES.css +2 -0
  28. package/dist/assets/index-CWwAjH9Q.js +58 -0
  29. package/dist/assets/insights-_VG03kv7.js +1 -0
  30. package/dist/assets/{insights-line-grid-CJdb529A.js → insights-line-grid-eCcWaGgD.js} +5 -5
  31. package/dist/assets/{javascript-jZJvS0Ev.js → javascript-BsU_m_4o.js} +1 -1
  32. package/dist/assets/{jsonMode-BJu_sWuN.js → jsonMode-DUKNqYzB.js} +1 -1
  33. package/dist/assets/{lib-hhwTCYTD.js → lib-B4PNeU44.js} +1 -1
  34. package/dist/assets/{liquid-B0Wk3SRC.js → liquid-BYz2oQ7r.js} +1 -1
  35. package/dist/assets/live-run-CL1uuNh1.js +1 -0
  36. package/dist/assets/{lspLanguageFeatures-Bn8JS-MZ.js → lspLanguageFeatures-CPMJ3OMK.js} +1 -1
  37. package/dist/assets/{mdx-BE6dqG5T.js → mdx-Bfn3OASJ.js} +1 -1
  38. package/dist/assets/memory-CAPirlHn.js +1 -0
  39. package/dist/assets/memory-product-CBcChlmH.js +2 -0
  40. package/dist/assets/{monaco-editor-inner-C0PbrlIr.js → monaco-editor-inner-B2iWC3vK.js} +3 -3
  41. package/dist/assets/monaco-editor-q3UYuc-5.js +2 -0
  42. package/dist/assets/{monaco.contribution-Bq7keHQp.js → monaco.contribution-B-XUbmv5.js} +2 -2
  43. package/dist/assets/observation-block-DR8MBlgg.js +1 -0
  44. package/dist/assets/observation-markdown-BOJNfOw1.js +1 -0
  45. package/dist/assets/{pencil-Dga__f-A.js → pencil-DBjmgk_1.js} +1 -1
  46. package/dist/assets/plus-DWwmmJlz.js +1 -0
  47. package/dist/assets/popover-CuqW26_E.js +1 -0
  48. package/dist/assets/{python-DYEP_Px-.js → python-D7QiYvsM.js} +1 -1
  49. package/dist/assets/{razor-BARiZmvH.js → razor-ByxQWcvk.js} +1 -1
  50. package/dist/assets/{refresh-cw-Dhidp9m2.js → refresh-cw-BtT1wl9S.js} +1 -1
  51. package/dist/assets/resizable-C3bJVUPo.js +1 -0
  52. package/dist/assets/run-detail-Bo30AusG.js +1 -0
  53. package/dist/assets/runs-BDWggMSA.js +1 -0
  54. package/dist/assets/scroll-area-CPuygHdB.js +1 -0
  55. package/dist/assets/select-DF8sGWfv.js +1 -0
  56. package/dist/assets/shortcut-hints-CUbl8p3Z.js +1 -0
  57. package/dist/assets/split-button-BKCtgFiC.js +1 -0
  58. package/dist/assets/square-CEW9RAjr.js +1 -0
  59. package/dist/assets/step-name-pills-RalYL-ZJ.js +1 -0
  60. package/dist/assets/suite-editor-DMnWq7BC.js +5 -0
  61. package/dist/assets/suite-navbar-D9wliAeW.js +1 -0
  62. package/dist/assets/suite-viewer-D55qWO4b.js +1 -0
  63. package/dist/assets/suites-C02UROvF.js +1 -0
  64. package/dist/assets/switch-CgiZ-8Q1.js +1 -0
  65. package/dist/assets/tab-console-vamiKOKH.js +1 -0
  66. package/dist/assets/table-cLA2Rr2t.js +1 -0
  67. package/dist/assets/{tabs-C3NqUdx9.js → tabs-xxRH91gb.js} +1 -1
  68. package/dist/assets/test-editor-SQG9pODg.js +9 -0
  69. package/dist/assets/test-navbar-DGyMPxYJ.js +7 -0
  70. package/dist/assets/test-viewer-D3UUL8p1.js +1 -0
  71. package/dist/assets/tests-Dz-BuO2B.js +1 -0
  72. package/dist/assets/{tests-suites-table-widths-CPWjMEBc.js → tests-suites-table-widths-CAr7nQWt.js} +1 -1
  73. package/dist/assets/textarea-wN2tIsDn.js +1 -0
  74. package/dist/assets/{trash-2-sbLDCPlz.js → trash-2-B2a3jDA4.js} +1 -1
  75. package/dist/assets/{tsMode-BHB8FsID.js → tsMode-CPlGHPm6.js} +1 -1
  76. package/dist/assets/{typescript-BrDOgG8S.js → typescript-BAelS_Yl.js} +1 -1
  77. package/dist/assets/use-hook-run-session-RU-LfCyB.js +1 -0
  78. package/dist/assets/{use-keyboard-shortcuts-BM0qq0DE.js → use-keyboard-shortcuts-O6nfytzm.js} +1 -1
  79. package/dist/assets/use-page-title-C_f72ri7.js +1 -0
  80. package/dist/assets/use-run-status-favicon-CoVHCGAy.js +1 -0
  81. package/dist/assets/use-selection-queue-3FNZ4lRr.js +1 -0
  82. package/dist/assets/{viewer-url-state-BgjmiiI7.js → viewer-url-state-Dsu1DY22.js} +1 -1
  83. package/dist/assets/{workers-BbHjH3Kx.js → workers-Br5uqX4Z.js} +1 -1
  84. package/dist/assets/{xml-6YL6VXLw.js → xml-DB-ZrZ2e.js} +1 -1
  85. package/dist/assets/{yaml-sHG1-XNr.js → yaml-BeKBVxAt.js} +1 -1
  86. package/dist/assets/{zap-DwOV0Yov.js → zap-CHRkZMyJ.js} +1 -1
  87. package/dist/index.html +2 -2
  88. package/package.json +2 -2
  89. package/dist/assets/badge-D56AWxFv.js +0 -1
  90. package/dist/assets/batch-action-bar-DI05CPwy.js +0 -1
  91. package/dist/assets/config-BafxmOwJ.js +0 -10
  92. package/dist/assets/dist-CyWxUoCv.js +0 -1
  93. package/dist/assets/dist-DaacWHUX.js +0 -1
  94. package/dist/assets/dist-itgTE_D5.js +0 -1
  95. package/dist/assets/empty-state-DEbHhF9f.js +0 -1
  96. package/dist/assets/filename-validation-Dabe2ngK.js +0 -1
  97. package/dist/assets/hook-editor-CmPzPqnr.js +0 -1
  98. package/dist/assets/hook-runtime-D7L2zX15.js +0 -5
  99. package/dist/assets/hook-viewer-BvNgWI6w.js +0 -1
  100. package/dist/assets/hooks-C1lVbVNu.js +0 -1
  101. package/dist/assets/index-B5JVEaaS.css +0 -2
  102. package/dist/assets/index-C_HfATr4.js +0 -57
  103. package/dist/assets/insights-EjXDNx86.js +0 -1
  104. package/dist/assets/live-run-CnQOMMWG.js +0 -1
  105. package/dist/assets/memory-BSLWD6RW.js +0 -1
  106. package/dist/assets/memory-product-0B7_AV3X.js +0 -2
  107. package/dist/assets/monaco-editor-BYBlJAjA.js +0 -2
  108. package/dist/assets/observation-block-DvMkTmgC.js +0 -1
  109. package/dist/assets/observation-markdown-Bgcyet5t.js +0 -1
  110. package/dist/assets/plus-BhWnvE6F.js +0 -1
  111. package/dist/assets/popover-Boe1excX.js +0 -1
  112. package/dist/assets/resizable-o8j3Lihm.js +0 -1
  113. package/dist/assets/run-detail-CPo5ENE6.js +0 -1
  114. package/dist/assets/runs-CvH2p_Ks.js +0 -1
  115. package/dist/assets/scroll-area-B8cRs7wd.js +0 -1
  116. package/dist/assets/select-BE8tKMJy.js +0 -1
  117. package/dist/assets/shortcut-hints-BGIo5sip.js +0 -1
  118. package/dist/assets/split-button-CcR2TDPY.js +0 -1
  119. package/dist/assets/square-8TpalBCd.js +0 -1
  120. package/dist/assets/step-name-pills-0sDNmrmn.js +0 -1
  121. package/dist/assets/suite-editor-BUzpsLUR.js +0 -5
  122. package/dist/assets/suite-navbar-COFDYHho.js +0 -1
  123. package/dist/assets/suite-viewer-B62crjkX.js +0 -1
  124. package/dist/assets/suites-vH7UvBPg.js +0 -1
  125. package/dist/assets/switch-A6NW_YxI.js +0 -1
  126. package/dist/assets/tab-console-BXF3HNpW.js +0 -1
  127. package/dist/assets/table-D4kdbpq8.js +0 -1
  128. package/dist/assets/test-editor-BnD3gcCG.js +0 -9
  129. package/dist/assets/test-navbar-ZDxlwtJH.js +0 -7
  130. package/dist/assets/test-viewer-B-G8G6FH.js +0 -1
  131. package/dist/assets/tests-BcPHa9Nc.js +0 -1
  132. package/dist/assets/textarea-87HpNno6.js +0 -1
  133. package/dist/assets/use-hook-run-session-n1RKgcn6.js +0 -1
  134. package/dist/assets/use-page-title-CyHzJAcR.js +0 -1
  135. package/dist/assets/use-run-status-favicon-DTTz9_8q.js +0 -1
  136. package/dist/assets/use-selection-queue-CIpsCzay.js +0 -1
  137. /package/dist/assets/{abap-tccnpReA.js → abap-BEq1sfI-.js} +0 -0
  138. /package/dist/assets/{apex-BKVkKsbj.js → apex-B44QgtCx.js} +0 -0
  139. /package/dist/assets/{azcli-BRcTI6AW.js → azcli-DMZ9GGL6.js} +0 -0
  140. /package/dist/assets/{bat-CY1d4Jjr.js → bat-C9UmLmb8.js} +0 -0
  141. /package/dist/assets/{bicep--LouBhCq.js → bicep-DftblL_H.js} +0 -0
  142. /package/dist/assets/{cameligo-DSekJmSA.js → cameligo-CzLnGslK.js} +0 -0
  143. /package/dist/assets/{clojure-GBhsYY7r.js → clojure-ByLwyAQs.js} +0 -0
  144. /package/dist/assets/{coffee-9z_JJIkP.js → coffee-68kO868m.js} +0 -0
  145. /package/dist/assets/{cpp-D7LwQw_o.js → cpp-DzwB3t3R.js} +0 -0
  146. /package/dist/assets/{csharp-Df6S3RJJ.js → csharp-DYYXYf_U.js} +0 -0
  147. /package/dist/assets/{csp-AyuN80rc.js → csp-CM2i4rGd.js} +0 -0
  148. /package/dist/assets/{css-CYIs0S-t.js → css-DeSoHz_W.js} +0 -0
  149. /package/dist/assets/{cypher-CWTgbj6F.js → cypher-BKNyhJD3.js} +0 -0
  150. /package/dist/assets/{dart-BkjNQt7D.js → dart-BQc3JPCX.js} +0 -0
  151. /package/dist/assets/{dockerfile-jNxF4_km.js → dockerfile-BGxPbctm.js} +0 -0
  152. /package/dist/assets/{ecl-CybE3oEZ.js → ecl-CKjBzfQ2.js} +0 -0
  153. /package/dist/assets/{editor.api2-DEGvZ9jW.js → editor.api2-CX0IWJmc.js} +0 -0
  154. /package/dist/assets/{elixir-CdaOBnQZ.js → elixir-BBLR1E4J.js} +0 -0
  155. /package/dist/assets/{flow9-0HKoddfT.js → flow9-DZyS6Im9.js} +0 -0
  156. /package/dist/assets/{format-BpI4TiHn.js → format-Y_Dbfary.js} +0 -0
  157. /package/dist/assets/{fsharp-B4rCGS2D.js → fsharp-B_k18Kji.js} +0 -0
  158. /package/dist/assets/{go-BMkOAZO-.js → go-B5m-VPlE.js} +0 -0
  159. /package/dist/assets/{graphql-CT1i0Azo.js → graphql-B4NvZBRl.js} +0 -0
  160. /package/dist/assets/{hcl-Dqo24S10.js → hcl-CXiUP62m.js} +0 -0
  161. /package/dist/assets/{ini-B2qo6Bwi.js → ini-DIf6wU5x.js} +0 -0
  162. /package/dist/assets/{java-BIPaikgB.js → java-CpjOue3Z.js} +0 -0
  163. /package/dist/assets/{julia-DaOMlCPl.js → julia-dxHeF5LM.js} +0 -0
  164. /package/dist/assets/{kotlin-Bu1Cf0EE.js → kotlin-DRRSuc55.js} +0 -0
  165. /package/dist/assets/{less-CkzKMiAu.js → less-tNOoNPeH.js} +0 -0
  166. /package/dist/assets/{lexon-TKzNnbcT.js → lexon-zuaObGAE.js} +0 -0
  167. /package/dist/assets/{lua-6W3WJOvj.js → lua-BDGwBzPZ.js} +0 -0
  168. /package/dist/assets/{m3-B_B1XtJr.js → m3-FllEI98A.js} +0 -0
  169. /package/dist/assets/{markdown-LT3qFBoR.js → markdown-Dg9O28Mh.js} +0 -0
  170. /package/dist/assets/{marked.esm-Ba5AUJng.js → marked.esm-DGP46SGL.js} +0 -0
  171. /package/dist/assets/{mips-BuZ0JnPP.js → mips-BSEXxt-j.js} +0 -0
  172. /package/dist/assets/{msdax-BHMmXeIF.js → msdax-BUYxl4Gb.js} +0 -0
  173. /package/dist/assets/{mysql-B1RGnQ_F.js → mysql-CKjgZvko.js} +0 -0
  174. /package/dist/assets/{objective-c-CFGQUdp0.js → objective-c-CMAdlqWg.js} +0 -0
  175. /package/dist/assets/{pascal-Bunb0gdj.js → pascal-DnrBRw9P.js} +0 -0
  176. /package/dist/assets/{pascaligo-Ci9pazxY.js → pascaligo-DGZxRh0P.js} +0 -0
  177. /package/dist/assets/{perl-Brcsz0QG.js → perl-CKcCV5P6.js} +0 -0
  178. /package/dist/assets/{pgsql-BeM5icw2.js → pgsql-D117QWhR.js} +0 -0
  179. /package/dist/assets/{php-D_0c0usD.js → php-B7LpRV3v.js} +0 -0
  180. /package/dist/assets/{pla-BXJXsrLp.js → pla-75s5EwYc.js} +0 -0
  181. /package/dist/assets/{postiats-Bh7pQpS0.js → postiats-FKqEVO_y.js} +0 -0
  182. /package/dist/assets/{powerquery-17x2qNlN.js → powerquery-D2B9xeZA.js} +0 -0
  183. /package/dist/assets/{powershell-BK7CP1HA.js → powershell-DVyjSbmt.js} +0 -0
  184. /package/dist/assets/{protobuf-BIk_BSvx.js → protobuf-BBsLf-fq.js} +0 -0
  185. /package/dist/assets/{pug-AfVB1dqb.js → pug-CWV-ph9P.js} +0 -0
  186. /package/dist/assets/{qsharp-DdD7_Hjo.js → qsharp-QhIGXK1X.js} +0 -0
  187. /package/dist/assets/{r-BGqTutCA.js → r-BQomAm4N.js} +0 -0
  188. /package/dist/assets/{redis-Dlp6Na1w.js → redis-DzIifZp4.js} +0 -0
  189. /package/dist/assets/{redshift-i2kKyIGQ.js → redshift-C4TPhoa0.js} +0 -0
  190. /package/dist/assets/{restructuredtext-LmY6AGSd.js → restructuredtext-Dapr4eTe.js} +0 -0
  191. /package/dist/assets/{ruby-BxBoU2eR.js → ruby-BfU5yBGC.js} +0 -0
  192. /package/dist/assets/{rust-D9N2vQ1K.js → rust-BkuRlY3p.js} +0 -0
  193. /package/dist/assets/{sb-BLTMTQei.js → sb-C5vEAPYs.js} +0 -0
  194. /package/dist/assets/{scala-Ctl2an6m.js → scala-CUr1vafD.js} +0 -0
  195. /package/dist/assets/{scheme-DWYXU9Gm.js → scheme-wTgw6IJZ.js} +0 -0
  196. /package/dist/assets/{scss-Fo6PaAQp.js → scss-D_2qOFds.js} +0 -0
  197. /package/dist/assets/{shell-gQZQk28C.js → shell-CYPHnmAv.js} +0 -0
  198. /package/dist/assets/{solidity-np-sz1ji.js → solidity-Dg-teBwM.js} +0 -0
  199. /package/dist/assets/{sophia-Cpc3f9d7.js → sophia-BZcSzYf2.js} +0 -0
  200. /package/dist/assets/{sparql-BM_09I__.js → sparql-B198P2td.js} +0 -0
  201. /package/dist/assets/{sql-wg3M4gQ8.js → sql-DTwIGDsL.js} +0 -0
  202. /package/dist/assets/{st-CRbYFk1r.js → st-DRydv-vG.js} +0 -0
  203. /package/dist/assets/{swift-B8HA7HL5.js → swift-DsJ-FzuB.js} +0 -0
  204. /package/dist/assets/{systemverilog-Dm-upaoS.js → systemverilog-BfzGNA0B.js} +0 -0
  205. /package/dist/assets/{tcl-BroSe0zp.js → tcl-i-A18rYd.js} +0 -0
  206. /package/dist/assets/{twig-C-LV7gG6.js → twig-BcTx4v-O.js} +0 -0
  207. /package/dist/assets/{typespec-DxaoVH5m.js → typespec-C8pW8LGC.js} +0 -0
  208. /package/dist/assets/{vb-qvhMNncD.js → vb-DhhgAOPk.js} +0 -0
  209. /package/dist/assets/{wgsl-CZM87x1c.js → wgsl-CLi0cHxr.js} +0 -0
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./use-run-status-favicon-CoVHCGAy.js";import{c as u,d,f as ee,l as f,s as p}from"./tab-console-vamiKOKH.js";import{i as te,n as ne,o as re,s as ie,t as ae,u as oe}from"./select-DF8sGWfv.js";import{t as m}from"./circle-alert-TPWM0719.js";import{t as se}from"./copy-D-NZb7QZ.js";import{t as ce}from"./external-link-DvyIDphy.js";import{t as le}from"./file-search-NMd1pdjr.js";import{n as h,r as ue}from"./shortcut-hints-CUbl8p3Z.js";import{i as de,n as fe,r as pe,t as me}from"./tabs-xxRH91gb.js";import{Cr as he,Er as ge,F as _e,Ft as ve,H as g,I as ye,K as be,Kt as _,L as xe,M as Se,Nn as Ce,O as we,P as Te,Pn as Ee,R as De,S as v,Sr as Oe,U as y,Xt as b,en as x,fr as S,gn as ke,hn as Ae,hr as je,ir as Me,mr as Ne,n as Pe,wn as Fe,xr as Ie,z as C}from"./index-CWwAjH9Q.js";import{t as w}from"./badge-DHCU59H0.js";import{t as Le}from"./use-page-title-C_f72ri7.js";import{t as T}from"./scroll-area-CPuygHdB.js";import{n as Re,r as ze,t as Be}from"./resizable-C3bJVUPo.js";import{t as Ve}from"./empty-state-3cB27tBp.js";import{t as He}from"./use-keyboard-shortcuts-O6nfytzm.js";import{t as E}from"./format-Y_Dbfary.js";import{i as Ue,n as We}from"./display-step-CYKXUkbs.js";var Ge=b(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),D=b(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),O=b(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),k=b(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),A=e(ge(),1),j=x();function Ke({status:e}){switch(e){case`passed`:return(0,j.jsx)(w,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,j.jsx)(w,{variant:`destructive`,children:`Failed`});case`healed`:return(0,j.jsx)(w,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,j.jsx)(w,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`skipped`:return(0,j.jsx)(w,{variant:`secondary`,children:`Skipped`});case`cancelled`:return(0,j.jsx)(w,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,j.jsx)(w,{variant:`outline`,children:e})}}function qe({run:e,steps:t,shortcutsOpen:n,onToggleShortcuts:a,onOpenArtifacts:o}){let s=Ie(),c=t.reduce((e,t)=>e+(t.totalTokens??0),0),l=t.reduce((e,t)=>e+(t.promptTokens??0),0),u=t.reduce((e,t)=>e+(t.completionTokens??0),0),f=e.suiteId!=null&&e.parentRunId==null,p=f&&e.suiteId?S.suiteView(e.suiteId):e.testId?S.testView(e.testId):null,te=f&&e.suiteId?`Open suite`:`Open test`,ne=r(e.id,e.videoPath),re=e.metadata?.farmSessionUrl;return(0,j.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,j.jsx)(`button`,{onClick:()=>s(S.runs),className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Runs`}),(0,j.jsx)(_,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,j.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),p?(0,j.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,"aria-label":te,className:`shrink-0 text-muted-foreground transition-colors hover:text-foreground`,children:(0,j.jsx)(i,{className:`h-3.5 w-3.5`})}):null,(0,j.jsx)(Ke,{status:e.status})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[e.modelName&&(0,j.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,j.jsx)(ee,{className:`h-3.5 w-3.5`}),e.modelName]}),c>0&&(0,j.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1 cursor-default`,title:`Prompt tokens / Completion tokens`,children:[(0,j.jsx)(Ge,{className:`h-3.5 w-3.5`}),E(l),` / `,E(u)]}),(0,j.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,j.jsx)(d,{className:`h-3.5 w-3.5`}),be(e.duration)]}),(0,j.jsx)(`div`,{className:`h-4 w-px bg-border`}),(0,j.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run artifacts`,title:`Run details (I/C/M)`,onClick:()=>o?.(`attributes`),children:(0,j.jsx)(D,{className:`h-3.5 w-3.5`})}),(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,"aria-expanded":n,title:`Shortcuts (Shift+?)`,onClick:a,children:(0,j.jsx)(ue,{className:`h-3.5 w-3.5`})}),n?(0,j.jsx)(`div`,{role:`dialog`,"aria-label":`Keyboard shortcuts`,className:`absolute right-0 top-full z-50 mt-2 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md`,children:(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Navigation`}),(0,j.jsx)(h,{hints:[{key:`↑ / K`,label:`Previous item`},{key:`↓ / J`,label:`Next item`},{key:`Shift+↑`,label:`Previous step`},{key:`Shift+↓`,label:`Next step`}]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Tabs`}),(0,j.jsx)(h,{hints:[{key:`1`,label:`Overview`},{key:`2`,label:`Env`},{key:`3`,label:`Network`},{key:`4`,label:`Console`},{key:`5`,label:`ARIA`},{key:`6`,label:`A11y`}]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Screenshots`}),(0,j.jsx)(h,{hints:[{key:`B`,label:`Before screenshot`},{key:`A`,label:`After screenshot`}]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Phases`}),(0,j.jsx)(h,{hints:[{key:`Shift+1`,label:`Toggle Observe`},{key:`Shift+2`,label:`Toggle Plan`},{key:`Shift+3`,label:`Toggle Execute`},{key:`Shift+4`,label:`Toggle Verify`}]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,j.jsx)(h,{hints:[{key:`I`,label:`Details: Attributes`},{key:`C`,label:`Artifacts: Config`},{key:`M`,label:`Artifacts: Memory`},{key:`R`,label:`Re-run`},{key:`V`,label:`Video`},{key:`Shift+?`,label:`Shortcuts`},{key:`Esc`,label:`Close`}]})]})]})}):null]}),(0,j.jsx)(g,{variant:`ghost`,size:`icon-sm`,"aria-label":`Re-run`,title:`Re-run (R)`,onClick:()=>{let t=e.attributes[`agent-qa.runner`]===`local`;Me({file:e.filePath??e.name,local:t}).then(e=>{v.success(`Re-run started`),s(S.runLive(e.runId))}).catch(()=>v.error(`Failed to start re-run`))},children:(0,j.jsx)(O,{className:`h-3.5 w-3.5`})}),ne&&(0,j.jsx)(`a`,{href:ne,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Open recording`,title:`Recording (V)`,children:(0,j.jsx)(g,{variant:`ghost`,size:`icon-sm`,children:(0,j.jsx)(k,{className:`h-3.5 w-3.5`})})}),re&&(0,j.jsx)(`a`,{href:re,target:`_blank`,rel:`noopener noreferrer`,title:`BrowserStack`,children:(0,j.jsx)(g,{variant:`ghost`,size:`icon-sm`,children:(0,j.jsx)(ce,{className:`h-3.5 w-3.5`})})})]})]})}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){return Array.isArray(e)}function P(e,t=`Not captured`){return e===void 0?t:e===null?`None`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?Number.isFinite(e)?String(e):`None`:typeof e==`string`?e.length>0?e:`None`:Array.isArray(e)?`${e.length} ${e.length===1?`item`:`items`}`:M(e)?`${Object.keys(e).length} ${Object.keys(e).length===1?`field`:`fields`}`:String(e)}function Je({section:e}){return(0,j.jsxs)(`div`,{className:`rounded-[2px] border border-border px-4 py-4 text-sm text-muted-foreground`,children:[e,` was not captured for this run.`]})}function F({title:e,badges:t=[],children:n,className:r}){return(0,j.jsxs)(`section`,{className:y(`rounded-[2px] border border-border bg-transparent`,r),children:[(0,j.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b px-4 py-3`,children:[(0,j.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:e}),t.map(e=>(0,j.jsx)(w,{variant:`outline`,className:`text-[10px]`,children:e},e))]}),(0,j.jsx)(`div`,{className:`space-y-3 px-4 py-4`,children:n})]})}function Ye({rows:e}){return(0,j.jsx)(`div`,{className:`divide-y divide-border/50`,children:e.map(e=>(0,j.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,j.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:e.label}),(0,j.jsx)(`dd`,{className:y(`min-w-0 break-words text-foreground`,e.mono&&`break-all font-mono`),children:e.value})]},e.label))})}function I({value:e}){return(0,j.jsx)(`span`,{className:y(`break-words`,(e==null||typeof e==`boolean`||typeof e==`number`)&&`font-mono text-[11px]`,e==null?`text-muted-foreground`:`text-foreground`),children:P(e)})}function L({value:e,label:t=`root`,level:n=0}){if(N(e))return(0,j.jsxs)(p,{children:[(0,j.jsxs)(f,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,j.jsx)(_,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,j.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[e.length,` `,e.length===1?`item`:`items`]})]}),(0,j.jsx)(u,{children:(0,j.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:e.length===0?(0,j.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):e.map((e,r)=>(0,j.jsx)(L,{label:`${r}`,value:e,level:n+1},`${t}-${r}`))})})]});if(M(e)){let r=Object.entries(e);return(0,j.jsxs)(p,{defaultOpen:n===0,children:[(0,j.jsxs)(f,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,j.jsx)(_,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,j.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[r.length,` `,r.length===1?`field`:`fields`]})]}),(0,j.jsx)(u,{children:(0,j.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:r.length===0?(0,j.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):r.map(([e,t])=>(0,j.jsx)(L,{label:e,value:t,level:n+1},e))})})]})}return(0,j.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,j.jsx)(`span`,{className:`min-w-0 break-words font-medium text-muted-foreground`,children:t}),(0,j.jsx)(I,{value:e})]})}function Xe({label:e,content:t}){return t?(0,j.jsxs)(p,{children:[(0,j.jsxs)(f,{className:`group flex w-full items-center gap-1.5 rounded-[2px] py-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,j.jsx)(_,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e]}),(0,j.jsx)(u,{children:(0,j.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-x-auto overflow-y-auto rounded-[2px] border border-border bg-muted/30 p-3 font-mono text-[11px] leading-relaxed whitespace-pre text-foreground`,children:t})})]}):null}function R(e,t){return e?e[t]:void 0}function z(e,t){let n=R(e,t);return typeof n==`string`&&n.length>0?n:null}function B(e,t){let n=R(e,t);return M(n)?n:null}function Ze(e,t){let n=R(e,t);return N(n)?n:[]}function Qe(e){return M(e)&&[z(e,`code`),z(e,`phase`),z(e,`message`)].filter(Boolean).join(` - `)||null}function $e(e){let t=z(e,`kind`);return t===`test`||t===`suite`?t:`unknown`}function et(e,t){let n=z(e,`childRunId`);if(n)return n;let r=z(e,`testId`),i=z(e,`name`);return t.children.find(({run:e})=>!!(r&&e.testId===r||i&&e.name===i))?.run.id??null}function tt({config:e}){let t=B(e,`envFile`),n=B(e,`secretsFile`),r=Ze(e,`hooks`),i=B(e,`model`),a=z(n,`path`),o=z(n,`status`),s=typeof R(n,`count`)==`number`?R(n,`count`):null;return(0,j.jsx)(Ye,{rows:[{label:`Raw config`,value:z(e,`rawConfigContent`)?`Captured`:`Not captured`},{label:`Env file`,value:P(z(t,`path`))},{label:`Secrets file`,value:n?(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,j.jsx)(`span`,{className:`break-all font-mono text-xs`,children:P(a)}),o?(0,j.jsx)(w,{variant:`outline`,className:`text-[10px]`,children:o}):null,s===null?null:(0,j.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s,` secret`,s===1?``:`s`]})]}):`Not captured`},{label:`CLI vars`,value:P(Object.keys(B(e,`cliVars`)??{}).length),mono:!0},{label:`Inline vars`,value:P(Object.keys(B(e,`inlineVars`)??{}).length),mono:!0},{label:`Hooks`,value:P(r.length),mono:!0},{label:`Model`,value:i?(0,j.jsx)(L,{label:`model`,value:i}):`Not captured`}]})}function V({source:e}){let t=$e(e),n=Qe(R(e,`error`));return(0,j.jsx)(Ye,{rows:[{label:`Kind`,value:t,mono:!0},{label:`Name`,value:P(z(e,`name`))},{label:t===`suite`?`Suite ID`:`Test ID`,value:P(z(e,t===`suite`?`suiteId`:`testId`)),mono:!0},{label:`Path`,value:P(z(e,`filePath`)),mono:!0},{label:`Load status`,value:P(z(e,`loadStatus`)),mono:!0},{label:`Error`,value:n??`None`}]})}function H({source:e,response:t}){let n=Ze(e,`members`).filter(M).sort((e,t)=>(typeof e.index==`number`?e.index:0)-(typeof t.index==`number`?t.index:0));return n.length===0?null:(0,j.jsx)(F,{title:`Suite Members`,badges:[`${n.length} members`],children:(0,j.jsx)(`div`,{className:`space-y-3`,children:n.map(e=>{let n=B(e,`ref`),r=typeof e.index==`number`?e.index:0,i=et(e,t),a=Qe(R(e,`error`));return(0,j.jsxs)(`div`,{"data-suite-member-index":r,className:`rounded-[2px] border border-border p-3`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,j.jsxs)(w,{variant:`outline`,className:`text-[10px]`,children:[`#`,r+1]}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-sm font-medium`,children:z(e,`name`)??z(n,`test`)??`Unnamed member`}),(0,j.jsx)(w,{variant:`outline`,className:`text-[10px]`,children:P(z(e,`loadStatus`))})]}),(0,j.jsx)(Ye,{rows:[{label:`Test ID`,value:P(z(e,`testId`)),mono:!0},{label:`Ref`,value:P(z(n,`test`)),mono:!0},{label:`Ref ID`,value:P(z(n,`id`)),mono:!0},{label:`Path`,value:P(z(e,`filePath`)),mono:!0},{label:`Target`,value:P(z(e,`target`))},{label:`Child run`,value:i?(0,j.jsx)(`a`,{className:`break-all text-primary hover:underline`,href:S.runDetail(i),children:i}):`Not captured`,mono:!!i},{label:`Error`,value:a??`None`}]}),(0,j.jsxs)(p,{children:[(0,j.jsxs)(f,{className:`group mt-2 flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,j.jsx)(_,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),`Member snapshots`]}),(0,j.jsxs)(u,{className:`mt-2 space-y-2`,children:[(0,j.jsx)(Xe,{label:`Raw member YAML`,content:z(e,`rawYaml`)}),R(e,`resolvedDefinition`)===void 0?null:(0,j.jsx)(L,{label:`resolvedDefinition`,value:R(e,`resolvedDefinition`)})]})]})]},`${r}-${z(e,`testId`)??z(n,`test`)??`member`}`)})})})}function U({response:e}){let t=e.artifact,n=t?.payload??{schemaVersion:1},r=M(n)?n:{schemaVersion:1},i=B(r,`config`),a=B(r,`source`),o=B(r,`runtime`),s=Ze(r,`errors`),c=new Set(e.missingSections),l=$e(a);return(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsx)(F,{title:`Run Summary`,badges:[t?.kind??`unknown`],children:(0,j.jsx)(Ye,{rows:[{label:`Run`,value:e.run.name},{label:`Run ID`,value:e.run.id,mono:!0},{label:`Artifact kind`,value:t?.kind??`unknown`,mono:!0},{label:`Schema version`,value:t?.schemaVersion??r.schemaVersion??`Not captured`,mono:!0},{label:`Finalized`,value:t?.finalizedAt??`Not finalized`,mono:!0},{label:`Test ID`,value:P(e.run.testId),mono:!0},{label:`Suite ID`,value:P(e.run.suiteId),mono:!0},{label:`Platform`,value:P(e.run.platform)},{label:`Target`,value:P(e.run.targetName)}]})}),(0,j.jsx)(F,{title:`Global Config`,children:c.has(`config`)||!i?(0,j.jsx)(Je,{section:`Config`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(tt,{config:i}),R(i,`parsedConfig`)===void 0?null:(0,j.jsx)(L,{label:`parsedConfig`,value:R(i,`parsedConfig`)}),(0,j.jsx)(Xe,{label:`Raw global config`,content:z(i,`rawConfigContent`)})]})}),(0,j.jsx)(F,{title:`Effective Config`,children:c.has(`config`)||!i?(0,j.jsx)(Je,{section:`Config`}):(0,j.jsx)(L,{label:`effectiveConfig`,value:R(i,`effectiveConfig`)})}),(0,j.jsx)(F,{title:`Source Snapshot`,badges:[l],children:c.has(`source`)||!a?(0,j.jsx)(Je,{section:`Source`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(V,{source:a}),(0,j.jsx)(Xe,{label:l===`suite`?`Raw suite YAML`:`Raw test YAML`,content:z(a,`rawYaml`)}),R(a,`resolvedDefinition`)===void 0?null:(0,j.jsx)(L,{label:`resolvedDefinition`,value:R(a,`resolvedDefinition`)})]})}),a?(0,j.jsx)(H,{source:a,response:e}):null,o||s.length>0?(0,j.jsxs)(F,{title:`Runtime and Errors`,badges:s.length>0?[`${s.length} errors`]:[],children:[o?(0,j.jsx)(L,{label:`runtime`,value:o}):null,s.length>0?(0,j.jsx)(`div`,{className:`space-y-2`,children:s.map((e,t)=>(0,j.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm`,children:Qe(e)??JSON.stringify(e)},t))}):null]}):null]})}var W=[{action:`add`,title:`Added`,className:`border-emerald-500/20 bg-emerald-500/5 text-emerald-500`,railClassName:`border-l-emerald-500/80`,surfaceClassName:`bg-emerald-500/[0.04]`},{action:`confirm`,title:`Updated/Confirmed`,className:`border-blue-500/20 bg-blue-500/5 text-blue-500`,railClassName:`border-l-blue-500/80`,surfaceClassName:`bg-blue-500/[0.04]`},{action:`deprecate`,title:`Deprecated`,className:`border-amber-500/25 bg-amber-500/5 text-amber-500`,railClassName:`border-l-amber-500/80`,surfaceClassName:`bg-amber-500/[0.04]`},{action:`delete`,title:`Deleted`,className:`border-red-500/20 bg-red-500/5 text-red-500`,railClassName:`border-l-red-500/80`,surfaceClassName:`bg-red-500/[0.04]`}];function G(e,t){return e?e[t]:void 0}function K(e,t){let n=G(e,t);return typeof n==`string`&&n.length>0?n:null}function q(e,t){let n=G(e,t);return typeof n==`number`&&Number.isFinite(n)?n:null}function J(e){if(!M(e))return null;let t=K(e,`id`),n=K(e,`title`),r=K(e,`content`),i=q(e,`trust`),a=q(e,`confirmed_count`),o=q(e,`contradicted_count`);return!t||!n||!r||i===null||a===null||o===null?null:{id:t,title:n,content:r,trust:i,last_confirmed:K(e,`last_confirmed`)??`Not captured`,confirmed_count:a,contradicted_count:o,source_test:K(e,`source_test`)??`Not captured`}}function Y(e){if(!M(e))return null;let t=K(e,`action`);if(t!==`add`&&t!==`confirm`&&t!==`deprecate`&&t!==`delete`)return null;let n=K(e,`tier`);return n!==`products`&&n!==`suites`&&n!==`tests`?null:{action:t,tier:n,scope:K(e,`scope`)??`unknown`,observationId:K(e,`observationId`)??J(G(e,`after`))?.id??J(G(e,`before`))?.id??`unknown`,reasoning:K(e,`reasoning`)??`No curator reasoning captured.`,before:J(G(e,`before`)),after:J(G(e,`after`)),error:K(e,`error`)??void 0}}function X(e){return M(e)?[`added`,`confirmed`,`deprecated`,`deleted`,`deltas`,`errors`,`curatorDuration`,`tokenUsage`].some(t=>t in e):!1}function nt(e){let t=e?.payload;if(!M(t))return null;let n=G(t,`memory`);if(!M(n))return null;let r=G(n,`log`);return X(r)?r:null}function rt(e){if(!e)return null;try{let t=JSON.parse(e);return X(t)?t:null}catch{return null}}function it(e){let t=[];for(let n of e.children){let e=nt(n.artifact);if(e){t.push(e);continue}let r=rt(n.run.memoryLog);r&&t.push(r)}return t}function Z(e,t){return e.reduce((e,n)=>e+(q(n,t)??0),0)}function at(e){let t=!1,n={promptTokens:0,completionTokens:0,totalTokens:0};for(let r of e){let e=G(r,`tokenUsage`);M(e)&&(t=!0,n.promptTokens+=q(e,`promptTokens`)??0,n.completionTokens+=q(e,`completionTokens`)??0,n.totalTokens+=q(e,`totalTokens`)??0)}return t?n:void 0}function ot(e){if(e.length===0)return null;let t=e.flatMap(e=>{let t=G(e,`deltas`);return N(t)?t:[]}),n=e.flatMap(e=>{let t=G(e,`errors`);return N(t)?t:[]}),r={added:Z(e,`added`),confirmed:Z(e,`confirmed`),deprecated:Z(e,`deprecated`),deleted:Z(e,`deleted`),errors:n,curatorDuration:Z(e,`curatorDuration`),deltas:t},i=at(e);return i&&(r.tokenUsage=i),r}function st(e){let t=nt(e.artifact);if(t)return t;let n=it(e);return n.length>0?ot(n):rt(e.run.memoryLog)}function ct(e){let t=G(e,`deltas`);return N(t)?t.map(Y).filter(e=>!!e):[]}function Q(e){return Object.fromEntries(W.map(t=>[t.action,e.filter(e=>e.action===t.action)]))}function $(e,t,n){return q(e,t===`confirm`?`confirmed`:t===`add`?`added`:t===`deprecate`?`deprecated`:`deleted`)??n}function lt(e,t){if(e==null||t==null)return null;let n=Math.round((t-e)*1e3)/1e3;return n===0?`0`:n>0?`+${n}`:String(n)}function ut(e,t){return!e||!t?[]:[`title`,`content`,`trust`,`confirmed_count`,`contradicted_count`,`last_confirmed`,`source_test`].filter(n=>e[n]!==t[n])}function dt({log:e,counts:t}){let n=G(e,`tokenUsage`),r=q(e,`curatorDuration`),i=M(n)?q(n,`promptTokens`):null,a=M(n)?q(n,`completionTokens`):null,o=M(n)?q(n,`totalTokens`):null;return(0,j.jsxs)(`section`,{className:`rounded-[2px] border border-border/60 bg-muted/20 px-3 py-3`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:W.map(e=>(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:e.title}),(0,j.jsx)(`div`,{className:`mt-1 font-mono text-lg text-foreground`,children:t[e.action]})]},e.action))}),(0,j.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3 border-t border-border/40 pt-2 text-xs text-muted-foreground`,children:[(0,j.jsxs)(`span`,{children:[`Curator duration: `,r==null?`Not captured`:be(r)]}),(0,j.jsxs)(`span`,{children:[`Tokens: `,o==null?`Not captured`:`${E(i??0)} / ${E(a??0)} / ${E(o)}`]})]})]})}function ft({label:e,observation:t}){return t?(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`div`,{className:`text-[11px] font-semibold text-muted-foreground`,children:e}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 break-words`,children:[`Title `,(0,j.jsx)(`span`,{className:`text-foreground`,children:t.title})]}),(0,j.jsxs)(`span`,{className:`font-mono`,children:[`Trust `,t.trust]}),(0,j.jsxs)(`span`,{className:`font-mono`,children:[`Confirmed `,t.confirmed_count]}),(0,j.jsxs)(`span`,{className:`font-mono`,children:[`Contradicted `,t.contradicted_count]}),(0,j.jsxs)(`span`,{className:`min-w-0 break-all font-mono`,children:[`ID `,t.id]}),(0,j.jsxs)(`span`,{className:`min-w-0 break-all font-mono`,children:[`Source `,t.source_test]}),(0,j.jsxs)(`span`,{className:`font-mono`,children:[`Last `,t.last_confirmed]})]}),(0,j.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm leading-6 text-foreground`,children:t.content})]}):null}function pt({delta:e,group:t}){let n=e.after?.title??e.before?.title??e.observationId,r=lt(e.before?.trust,e.after?.trust),i=lt(e.before?.confirmed_count,e.after?.confirmed_count),a=lt(e.before?.contradicted_count,e.after?.contradicted_count),o=ut(e.before,e.after);return(0,j.jsx)(p,{children:(0,j.jsxs)(`div`,{className:y(`border-y border-l-2 border-border/55 px-4 py-3`,t.railClassName,t.surfaceClassName),children:[(0,j.jsxs)(f,{className:`group flex w-full min-w-0 items-start gap-2 text-left`,children:[(0,j.jsx)(_,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,j.jsx)(`h4`,{className:`min-w-0 flex-1 break-words text-sm font-medium text-foreground`,children:n}),(0,j.jsx)(w,{variant:`outline`,className:y(`text-[10px]`,t.className),children:W.find(t=>t.action===e.action)?.title??e.action}),(0,j.jsxs)(w,{variant:`outline`,className:`max-w-full whitespace-normal break-all text-left text-[10px]`,children:[e.tier,`/`,e.scope]})]}),(0,j.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground`,children:[(0,j.jsx)(`span`,{className:`break-all`,children:e.observationId}),r?(0,j.jsxs)(`span`,{children:[`trust `,r]}):null,i?(0,j.jsxs)(`span`,{children:[`confirmed `,i]}):null,a?(0,j.jsxs)(`span`,{children:[`contradicted `,a]}):null]}),(0,j.jsx)(`p`,{className:`mt-2 line-clamp-2 break-words text-xs text-muted-foreground`,children:e.reasoning})]})]}),(0,j.jsxs)(u,{className:`mt-3 space-y-3`,children:[o.length>0?(0,j.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Changed fields: `,(0,j.jsx)(`span`,{className:`font-mono text-foreground`,children:o.join(`, `)})]}):(0,j.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Changed fields: None captured`}),e.error?(0,j.jsxs)(`div`,{className:`text-xs text-red-500`,children:[`Error: `,e.error]}):null,e.action===`add`?(0,j.jsx)(ft,{label:`After`,observation:e.after}):e.action===`delete`?(0,j.jsx)(ft,{label:`Before`,observation:e.before}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ft,{label:`Before`,observation:e.before}),(0,j.jsx)(ft,{label:`After`,observation:e.after})]})]})]})})}function mt({response:e}){let t=st(e);if(!t)return(0,j.jsx)(`div`,{className:`rounded-[2px] border border-border px-4 py-4 text-sm text-muted-foreground`,children:`Memory was not captured for this run.`});let n=Q(ct(t)),r={add:$(t,`add`,n.add.length),confirm:$(t,`confirm`,n.confirm.length),deprecate:$(t,`deprecate`,n.deprecate.length),delete:$(t,`delete`,n.delete.length)},i=r.add+r.confirm+r.deprecate+r.delete;return(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsx)(dt,{log:t,counts:r}),i===0?(0,j.jsxs)(`div`,{className:`rounded-[2px] border border-border px-4 py-4`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No memory changes`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Memory completed without adding, updating, deprecating, or deleting observations.`})]}):null,W.map(e=>{let t=n[e.action];return(0,j.jsxs)(`section`,{className:`scroll-mt-4 space-y-3`,children:[(0,j.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 px-1`,children:[(0,j.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:e.title}),(0,j.jsxs)(w,{variant:`outline`,className:`text-[10px]`,children:[r[e.action],` changes`]})]}),(0,j.jsx)(`div`,{"data-memory-group":e.title,className:`space-y-3`,children:t.length===0?(0,j.jsxs)(`div`,{className:`px-1 text-sm text-muted-foreground`,children:[`No `,e.title.toLowerCase(),` changes.`]}):t.map(t=>(0,j.jsx)(pt,{delta:t,group:e},`${t.action}-${t.observationId}`))})]},e.action)}),N(G(t,`errors`))&&G(t,`errors`).length>0?(0,j.jsxs)(`section`,{className:`space-y-3`,children:[(0,j.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 px-1`,children:[(0,j.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,children:`Memory Errors`}),(0,j.jsxs)(w,{variant:`outline`,className:`text-[10px]`,children:[G(t,`errors`).length,` errors`]})]}),(0,j.jsx)(`div`,{className:`space-y-2`,children:G(t,`errors`).map((e,t)=>(0,j.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm text-red-500`,children:P(e)},t))})]}):null]})}function ht(){return(0,j.jsxs)(`div`,{className:`space-y-4`,"aria-label":`Loading artifact data`,children:[(0,j.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading artifact data...`}),[0,1,2].map(e=>(0,j.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,j.jsx)(Te,{className:`h-4 w-40`}),(0,j.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,j.jsx)(Te,{className:`h-3 w-full`}),(0,j.jsx)(Te,{className:`h-3 w-5/6`}),(0,j.jsx)(Te,{className:`h-3 w-3/5`})]})]},e))]})}function gt({error:e,onRetry:t}){return(0,j.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-4`,children:(0,j.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,j.jsx)(m,{className:`mt-0.5 h-4 w-4 shrink-0 text-red-500`}),(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Could not load artifact data`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Retry the request. If it continues, verify the dashboard server can read run artifacts.`}),(0,j.jsx)(`p`,{className:`mt-2 break-words font-mono text-xs text-red-500`,children:e}),(0,j.jsx)(g,{className:`mt-3`,size:`sm`,variant:`outline`,onClick:t,children:`Retry`})]})]})})}function _t(){return(0,j.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Artifact data is not available for this run`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run does not have a persisted artifact record.`})]})}function vt(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=e[t];return n&&typeof n==`object`&&!Array.isArray(n)?n:null}function yt(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return Object.fromEntries(t)}function bt(e){let t=yt(e.run.attributes);if(Object.keys(t).length>0)return t;let n=e.artifact?.payload;return yt(vt(vt(n,`metadata`),`attributes`))}function xt(e){return Object.entries(e).sort(([e],[t])=>{let n=e.startsWith(`agent-qa.`);return n===t.startsWith(`agent-qa.`)?e.localeCompare(t):n?-1:1})}function St(e){navigator.clipboard?.writeText(e)}function Ct({response:e}){let t=xt(bt(e));return t.length===0?(0,j.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,j.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No run attributes`}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run did not record any attributes.`})]}):(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsx)(`div`,{className:`flex justify-end`,children:(0,j.jsxs)(g,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>St(JSON.stringify(Object.fromEntries(t),null,2)),children:[(0,j.jsx)(se,{className:`size-4`}),`Copy JSON`]})}),(0,j.jsx)(`div`,{className:`overflow-hidden rounded-[2px] border border-border`,children:(0,j.jsx)(`table`,{className:`w-full table-fixed text-sm`,children:(0,j.jsx)(`tbody`,{children:t.map(([e,t])=>(0,j.jsxs)(`tr`,{className:`border-b border-border/70 last:border-b-0`,children:[(0,j.jsx)(`th`,{className:`w-[240px] align-top px-3 py-2 text-left font-mono text-xs font-medium text-muted-foreground`,children:e}),(0,j.jsx)(`td`,{className:`align-top px-3 py-2`,children:(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,j.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono text-xs text-foreground`,children:t}),(0,j.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy ${e} value`,title:`Copy value`,onClick:()=>St(t),children:(0,j.jsx)(se,{className:`size-3.5`})})]})})]},e))})})})]})}function wt({tab:e,response:t}){return e===`attributes`?(0,j.jsx)(Ct,{response:t}):e===`config`?(0,j.jsx)(U,{response:t}):(0,j.jsx)(mt,{response:t})}function Tt({tab:e,response:t,loading:n,error:r,onRetry:i}){return n?(0,j.jsx)(ht,{}):r?(0,j.jsx)(gt,{error:r,onRetry:i}):!t||e!==`attributes`&&!t.artifact?(0,j.jsx)(_t,{}):(0,j.jsx)(wt,{tab:e,response:t})}function Et({run:e,open:t,tab:n,response:r,loading:i,error:a,onOpenChange:o,onTabChange:s,onRetry:c}){let l=r?.artifact??null,u=e.name||`Run ${e.id}`;return(0,j.jsx)(_e,{open:t,onOpenChange:o,children:(0,j.jsxs)(ye,{side:`right`,className:`w-[min(820px,92vw)] sm:max-w-none gap-0 overflow-hidden p-0`,children:[(0,j.jsxs)(De,{className:`border-b px-4 py-3 pr-12`,children:[(0,j.jsx)(C,{className:`text-base leading-snug`,children:`Run details`}),(0,j.jsx)(xe,{className:`truncate text-xs`,children:u}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1 text-xs text-muted-foreground`,children:[(0,j.jsx)(`span`,{className:`break-all font-mono`,children:e.id}),l?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{variant:`outline`,className:`text-[10px]`,children:l.kind}),(0,j.jsxs)(w,{variant:`outline`,className:`text-[10px]`,children:[`schema `,l.schemaVersion]}),(0,j.jsx)(w,{variant:`outline`,className:y(`text-[10px]`,l.finalizedAt?`border-emerald-500/20 text-emerald-500`:`border-amber-500/25 text-amber-500`),children:l.finalizedAt?`finalized`:`open`})]}):null]})]}),(0,j.jsxs)(me,{value:n,onValueChange:e=>s(e),className:`min-h-0 flex-1 overflow-hidden`,children:[(0,j.jsx)(`div`,{className:`border-b px-3`,children:(0,j.jsxs)(pe,{variant:`line`,className:`h-9 w-full justify-start`,children:[(0,j.jsx)(de,{value:`attributes`,className:`max-w-32 flex-none`,children:`Attributes`}),(0,j.jsx)(de,{value:`config`,className:`max-w-32 flex-none`,children:`Config`}),(0,j.jsx)(de,{value:`memory`,className:`max-w-32 flex-none`,children:`Memory`})]})}),(0,j.jsxs)(T,{className:`min-h-0 flex-1`,children:[(0,j.jsx)(fe,{value:`attributes`,className:`m-0 px-4 py-4`,children:(0,j.jsx)(Tt,{tab:`attributes`,response:r,loading:i,error:a,onRetry:c})}),(0,j.jsx)(fe,{value:`config`,className:`m-0 px-4 py-4`,children:(0,j.jsx)(Tt,{tab:`config`,response:r,loading:i,error:a,onRetry:c})}),(0,j.jsx)(fe,{value:`memory`,className:`m-0 px-4 py-4`,children:(0,j.jsx)(Tt,{tab:`memory`,response:r,loading:i,error:a,onRetry:c})})]})]})]})})}function Dt({status:e}){let t=Ne(e);return(0,j.jsx)(w,{className:je(t.tone),children:t.label})}function Ot(e,t){let n=e.split(/\s+/);return n.length<=t?{truncated:e,isTruncated:!1}:{truncated:n.slice(0,t).join(` `)+`...`,isTruncated:!0}}function kt({summary:e}){let[t,n]=(0,A.useState)(!1),[r,i]=(0,A.useState)(!1),{truncated:a,isTruncated:o}=Ot(e,20);return(0,j.jsx)(`div`,{className:`mx-2 mt-2 rounded-[2px] border border-red-500/20 bg-red-500/5 px-3 py-2 shrink-0`,children:(0,j.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,j.jsx)(m,{className:`h-4 w-4 text-red-400 shrink-0 mt-0.5`}),(0,j.jsx)(`span`,{className:`flex-1 text-sm text-foreground/80 select-text`,children:t?e:a}),(0,j.jsx)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)},className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,title:`Copy failure summary`,children:r?(0,j.jsx)(oe,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,j.jsx)(se,{className:`h-3.5 w-3.5 text-muted-foreground`})}),o&&(0,j.jsx)(`button`,{onClick:()=>n(e=>!e),className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,children:(0,j.jsx)(_,{className:y(`h-3.5 w-3.5 text-muted-foreground transition-transform`,t&&`rotate-90`)})})]})})}function At(e,t){let n=new Map(t.map((e,t)=>[e.id,t]));return[...e].sort((e,t)=>{let r=n.get(e.runId)??0,i=n.get(t.runId)??0;return r===i?e.stepOrder-t.stepOrder:r-i})}function jt(e){return e?.suiteId!=null&&e.parentRunId==null}function Mt(e,t,n,r){return Ue((r&&n===`all`&&t.length>0?At(e,t):[...e].sort((e,t)=>e.stepOrder-t.stepOrder)).map(We))}function Nt(e,t,n){let r=t.get(`step`),i=t.get(`run`),a=t.get(`sub`);if(r){let t=Number.parseInt(r,10),o=e.find(e=>e.rawStepOrder===t?n&&i?e.rawRunId===i:!0:!1);if(o)return a==null?{type:`step`,stepId:o.id}:{type:`subaction`,stepId:o.id,subIndex:Number.parseInt(a,10)}}return e.length>0?{type:`step`,stepId:e[0].id}:null}function Pt(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top+12,a=n.bottom-12;if(r.top>=i&&r.bottom<=a)return;let o=r.top<i?e.scrollTop+(r.top-i):e.scrollTop+(r.bottom-a),s=Math.max(0,o);if(typeof e.scrollTo==`function`){e.scrollTo({top:s,behavior:`smooth`});return}e.scrollTop=s}function Ft(){let{id:e}=Oe(),i=Ie(),[d,ee]=he(),oe=we()?.recordRunDetailStatus,[m,se]=(0,A.useState)(null);Le(m?`Run - ${m.name}`:`Run`),a(l(m?.status));let[ce,h]=(0,A.useState)([]),[ue,de]=(0,A.useState)([]),[fe,pe]=(0,A.useState)(null),[me,ge]=(0,A.useState)(!0),[_e,ye]=(0,A.useState)(!1),[be,xe]=(0,A.useState)(!1),[Te,De]=(0,A.useState)(1),b=(0,A.useRef)(null),x=(0,A.useRef)(null),je=(0,A.useRef)(null),Ne=(0,A.useRef)(null),[C,w]=(0,A.useState)([]),[T,Ue]=(0,A.useState)(`all`),[We,Ge]=(0,A.useState)([]),[D,O]=(0,A.useState)(null),[k,Ke]=(0,A.useState)([]),[M,N]=(0,A.useState)(null),[P,Je]=(0,A.useState)(!1),[F,Ye]=(0,A.useState)(null),[I,L]=(0,A.useState)(!1),[Xe,R]=(0,A.useState)(`attributes`),[z,B]=(0,A.useState)(null),[Ze,Qe]=(0,A.useState)(!1),[$e,et]=(0,A.useState)(null),tt=(0,A.useRef)(null),V=(0,A.useRef)(0),[H,U]=(0,A.useState)(()=>{let e=d.get(`tab`);return e===`screenshot`?`overview`:e??`overview`});(0,A.useEffect)(()=>{m?.status&&oe?.(m.status)},[oe,m?.status]),(0,A.useEffect)(()=>{if(!e)return;Ne.current=null;let t=!1,n=0;async function r(){try{let{executions:n}=await ke();if(t)return;if(n.some(t=>t.runId===e)){i(S.runLive(e),{replace:!0});return}}catch{}try{let n=await Ce(e);if(t)return;if(se(n.run),jt(n.run)&&n.tests&&n.tests.length>0){w(n.tests),Ue(`all`);let e=[];for(let r of n.tests)try{let n=await Ce(r.id);if(t)return;e.push(...n.steps)}catch{}Ge(e),h(e),O(Nt(Mt(e,n.tests,`all`,!0),d,!0))}else{h(n.steps);let e=n.attempts??[];if(de(e),e.length>0){let n=e[e.length-1];pe(n.id);let r=await Ce(n.id);t||(h(r.steps),O(Nt(Mt(r.steps,[],``,!1),d,!1)))}else O(Nt(Mt(n.steps,[],``,!1),d,!1))}}catch(e){if(t)return;if(e instanceof Error&&e.message.includes(`404`)){if(n<5){n++,setTimeout(()=>{t||r()},1e3);return}ye(!0)}else v.error(`Failed to load run`)}finally{t||ge(!1)}}return r(),()=>{t=!0}},[e,i]),(0,A.useEffect)(()=>{if(!e||me)return;let t=!1;return Fe(e).then(({logs:e})=>{t||Ke(e)}).catch(()=>{}),()=>{t=!0}},[e,me]),(0,A.useEffect)(()=>{tt.current=null,V.current+=1,B(null),et(null),Qe(!1)},[m?.id]);let W=(0,A.useCallback)(async()=>{if(!m?.id)return;let e=V.current+1;V.current=e,Qe(!0),et(null);try{let t=await Ee(m.id);if(V.current!==e)return;tt.current=m.id,B(t)}catch(t){if(V.current!==e)return;et(t instanceof Error?t.message:`Failed to load artifact data`)}finally{V.current===e&&Qe(!1)}},[m?.id]);(0,A.useEffect)(()=>{!I||!m?.id||Ze||$e||tt.current===m.id&&z||W()},[I,$e,Ze,z,W,m?.id]);let G=(0,A.useCallback)(e=>{R(e),L(!0)},[]),K=(0,A.useMemo)(()=>Mt(ce,C,T,jt(m)),[ce,C,T,m]),q=(0,A.useMemo)(()=>o(D)?K.find(e=>e.id===D.stepId)??null:null,[D,K]),J=q?.rawRunId??m?.id??null;(0,A.useEffect)(()=>{if(!J){N(null);return}N(null);let e=!1;return Ae(J).then(t=>{e||N(t)}).catch(()=>{e||N(null)}),()=>{e=!0}},[J]);let Y=(0,A.useMemo)(()=>!c(D)||!q?null:q.subActionsData?.[D.subIndex]??null,[D,q]),X=(0,A.useMemo)(()=>{if(!q)return null;if(Y){let e=Y.screenshotBeforePath??null,t=Y.screenshotAfterPath??null;return!e&&!t?null:{key:[q.id,`sub`,Y.index,e??``,t??``].join(`|`),beforePath:e,afterPath:t}}let e=q.screenshotBeforePath,t=q.screenshotPath;return!e&&!t?null:{key:[q.id,`step`,e??``,t??``].join(`|`),beforePath:e,afterPath:t}},[q,Y]),nt=X&&F?.key===X.key?F.side:void 0,rt=o(D)?D.stepId:null,it=(0,A.useMemo)(()=>k.filter(e=>e.stepId===null&&e.phase===`setup`),[k]),Z=(0,A.useMemo)(()=>k.filter(e=>e.stepId===null&&e.phase===`teardown`),[k]),at=(0,A.useMemo)(()=>k.filter(e=>e.stepId!==null),[k]),ot=(0,A.useMemo)(()=>q?at.filter(e=>e.stepId===q.id?!0:!e.stepId||q.rawRunId&&e.runId&&q.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===q.rawStepOrder):[],[at,q]),st=(0,A.useMemo)(()=>D?.type===`hook`?k.find(e=>e.id===D.hookId)??null:null,[D,k]),ct=(0,A.useMemo)(()=>D?.type===`execution`?k.find(e=>e.id===D.logId)??null:null,[D,k]),Q=(0,A.useMemo)(()=>{let e=[],t=jt(m)&&T===`all`&&C.length>0,n=t?new Set(C.map(e=>e.id)):null;for(let t of it)(!n||!n.has(t.runId))&&e.push({type:`hook`,logId:t.id});if(t){let t=new Map;for(let e of K){let n=e.rawRunId??e.id,r=t.get(n)??[];r.push(e),t.set(n,r)}for(let[n,r]of t){for(let t of it)t.runId===n&&e.push({type:`hook`,logId:t.id});for(let t of r)if(e.push({type:`step`,stepId:t.id}),t.id===rt){let n=at.filter(e=>e.stepId===t.id?!0:!e.stepId||t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder);for(let r of n)e.push({type:`exec`,stepId:t.id,logId:r.id});t.subActionsData&&t.subActionsData.forEach((n,r)=>{e.push({type:`sub`,stepId:t.id,subIndex:r})})}for(let t of Z)t.runId===n&&e.push({type:`hook`,logId:t.id})}}else for(let t of K)if(e.push({type:`step`,stepId:t.id}),t.id===rt){let n=at.filter(e=>e.stepId===t.id?!0:!e.stepId||t.rawRunId&&e.runId&&t.rawRunId!==e.runId?!1:Number.parseInt(e.stepId,10)===t.rawStepOrder);for(let r of n)e.push({type:`exec`,stepId:t.id,logId:r.id});t.subActionsData&&t.subActionsData.forEach((n,r)=>{e.push({type:`sub`,stepId:t.id,subIndex:r})})}for(let t of Z)(!n||!n.has(t.runId))&&e.push({type:`hook`,logId:t.id});return e},[K,rt,at,it,Z,m,T,C]),$=(0,A.useMemo)(()=>D?Q.findIndex(e=>D.type===`hook`&&e.type===`hook`?e.logId===D.hookId:D.type===`step`&&e.type===`step`?e.stepId===D.stepId:D.type===`subaction`&&e.type===`sub`?e.stepId===D.stepId&&e.subIndex===D.subIndex:D.type===`execution`&&e.type===`exec`?e.logId===D.logId:!1):-1,[Q,D]);function lt(e){return e.type===`hook`?{type:`hook`,hookId:e.logId}:e.type===`step`?{type:`step`,stepId:e.stepId}:e.type===`exec`?{type:`execution`,stepId:e.stepId,logId:e.logId}:{type:`subaction`,stepId:e.stepId,subIndex:e.subIndex}}let ut=[`overview`,`env`,`network`,`console`,`aria`,`a11y`],dt=(0,A.useCallback)(e=>{H===`overview`&&X&&(e===`before`?X.beforePath:X.afterPath)&&Ye({key:X.key,side:e})},[H,X]);He((0,A.useMemo)(()=>{let e={arrowdown:()=>{Q.length!==0&&O(lt($===-1?Q[0]:Q[Math.min($+1,Q.length-1)]))},arrowup:()=>{Q.length!==0&&O(lt($===-1?Q[Q.length-1]:Q[Math.max($-1,0)]))},j:()=>{e.arrowdown({})},k:()=>{e.arrowup({})},"shift+arrowdown":()=>{if(Q.length===0)return;let e=Q.findIndex((e,t)=>t>$&&e.type===`step`);e!==-1&&O(lt(Q[e]))},"shift+arrowup":()=>{if(Q.length===0)return;let e=-1;for(let t=$-1;t>=0;t--)if(Q[t].type===`step`){e=t;break}e!==-1&&O(lt(Q[e]))},1:()=>U(ut[0]),2:()=>U(ut[1]),3:()=>U(ut[2]),4:()=>U(ut[3]),5:()=>U(ut[4]),6:()=>U(ut[5]),a:()=>dt(`after`),b:()=>dt(`before`),i:()=>G(`attributes`),c:()=>G(`config`),m:()=>G(`memory`),r:()=>{if(!m)return;let e=m.attributes[`agent-qa.runner`]===`local`;Me({file:m.filePath??m.name,local:e}).then(e=>{v.success(`Re-run started`),i(S.runLive(e.runId))}).catch(()=>v.error(`Failed to start re-run`))},escape:()=>{I?L(!1):be?xe(!1):O(null)},v:()=>{m?.videoPath&&xe(!0)},"shift+?":()=>Je(e=>!e),"shift+!":()=>x.current?.togglePhase(0),"shift+@":()=>x.current?.togglePhase(1),"shift+#":()=>x.current?.togglePhase(2),"shift+$":()=>x.current?.togglePhase(3)};return e},[Q,$,D,m,i,I,be,x,dt,G])),(0,A.useEffect)(()=>{let e=o(D)?K.find(e=>e.id===D.stepId):null,t=e?.rawStepOrder,n=e?.rawRunId,r=new URLSearchParams(d);t==null?r.delete(`step`):r.set(`step`,String(t)),jt(m)&&T===`all`&&n?r.set(`run`,n):r.delete(`run`),c(D)?r.set(`sub`,String(D.subIndex)):r.delete(`sub`),H===`overview`?r.delete(`tab`):r.set(`tab`,H),r.toString()!==d.toString()&&ee(r,{replace:!0})},[D,H,K,m,T,d,ee]),(0,A.useEffect)(()=>{if(!o(D))return;let e=je.current;if(!e)return;if(D.type===`step`&&!d.has(`step`)&&!d.has(`sub`)&&K[0]?.id===D.stepId){Ne.current=D.stepId;return}Ne.current=null;let t=D.type===`step`?`[data-step-id="${D.stepId}"]`:D.type===`execution`?`[data-execution-id="${D.logId}"]`:c(D)?`[data-sub-action-id="${D.stepId}-${D.subIndex}"]`:null;if(!t)return;let n=requestAnimationFrame(()=>{let n=e.querySelector(t);n&&Pt(e,n)});return()=>cancelAnimationFrame(n)},[D,K,d]);let ft=(0,A.useCallback)(async e=>{pe(e);try{let t=await Ce(e);h(t.steps),O(Nt(Mt(t.steps,[],``,!1),d,!1))}catch{v.error(`Failed to load attempt`)}},[d]),pt=(0,A.useCallback)(async t=>{if(Ue(t),t===`all`)h(We),O(Nt(Mt(We,C,`all`,jt(m)),d,!0)),e&&Fe(e).then(({logs:e})=>Ke(e)).catch(()=>{});else try{let e=await Ce(t);h(e.steps);let{logs:n}=await Fe(t);Ke(n),O(Nt(Mt(e.steps,[],t,!1),d,!1))}catch{v.error(`Failed to load test steps`)}},[We,e,m,d,C]);if(me)return(0,j.jsx)(Pe,{});if(_e||!m)return(0,j.jsx)(Ve,{icon:le,title:`Run not found`,description:`This test run doesn't exist or has been deleted`,actionLabel:`View All Runs`,onAction:()=>i(S.runs)});let mt=r(m.id,m.videoPath);return(0,j.jsx)(Se,{children:(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,j.jsx)(qe,{run:m,steps:ce,shortcutsOpen:P,onToggleShortcuts:()=>Je(e=>!e),onOpenArtifacts:G}),(0,j.jsxs)(ze,{orientation:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,children:[(0,j.jsx)(Re,{defaultSize:35,minSize:20,children:(0,j.jsxs)(`div`,{ref:je,className:`flex h-full min-h-0 min-w-0 flex-col overflow-y-auto`,children:[jt(m)&&C.length>0?(0,j.jsx)(`div`,{className:`border-b px-3 py-2 shrink-0`,children:(0,j.jsxs)(ae,{value:T,onValueChange:pt,children:[(0,j.jsx)(re,{className:`w-full h-8 text-xs`,children:(0,j.jsx)(ie,{})}),(0,j.jsxs)(ne,{children:[(0,j.jsxs)(te,{value:`all`,children:[`All Tests (`,C.length,`)`]}),C.map(e=>(0,j.jsx)(te,{value:e.id,children:(0,j.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.name,(0,j.jsx)(Dt,{status:e.status})]})},e.id))]})]})}):ue.length>0?(0,j.jsx)(`div`,{className:`flex gap-1 border-b px-3 py-2 shrink-0`,children:ue.map(e=>(0,j.jsxs)(`button`,{onClick:()=>ft(e.id),className:y(`px-3 py-1 text-xs rounded-sm border-b-2 transition-colors`,fe===e.id?`border-primary text-foreground font-medium`:`border-transparent text-muted-foreground hover:text-foreground`),children:[`Attempt `,e.attemptNumber,(0,j.jsx)(`span`,{className:`ml-1.5`,children:(0,j.jsx)(Dt,{status:e.status})})]},e.id))}):null,m.status===`failed`&&m.failureSummary&&(0,j.jsx)(kt,{summary:m.failureSummary}),m.status===`failed`&&m.errorLog&&(0,j.jsxs)(p,{className:`mx-2 mt-1`,children:[(0,j.jsxs)(f,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,j.jsx)(_,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,j.jsx)(`span`,{children:`Error Details`})]}),(0,j.jsx)(u,{children:(0,j.jsx)(`pre`,{className:`mt-1 text-xs font-mono bg-muted/30 border border-border/50 rounded-[2px] px-3 py-2 overflow-x-auto whitespace-pre-wrap max-h-60 overflow-y-auto text-foreground/70 select-text`,children:m.errorLog})})]}),m.memoryLog&&(()=>{let e=JSON.parse(m.memoryLog);return(0,j.jsxs)(p,{className:`mx-2 mt-1`,children:[(0,j.jsxs)(f,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,j.jsx)(_,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,j.jsx)(`span`,{children:`Memory`}),(0,j.jsxs)(`span`,{className:`ml-1 text-[10px] opacity-60`,children:[e.added,`A `,e.confirmed,`C `,e.deprecated,`D`]})]}),(0,j.jsx)(u,{children:(0,j.jsxs)(`div`,{className:`mt-1 grid grid-cols-2 gap-x-6 gap-y-1 text-xs px-3 py-2 bg-muted/30 border border-border/50 rounded-[2px]`,children:[(0,j.jsxs)(`div`,{className:`flex justify-between`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Added`}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.added})]}),(0,j.jsxs)(`div`,{className:`flex justify-between`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Confirmed`}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.confirmed})]}),(0,j.jsxs)(`div`,{className:`flex justify-between`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Deprecated`}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.deprecated})]}),(0,j.jsxs)(`div`,{className:`flex justify-between`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Errors`}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.errors.length})]}),(0,j.jsxs)(`div`,{className:`flex justify-between`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Curator Duration`}),(0,j.jsxs)(`span`,{className:`font-mono`,children:[(e.curatorDuration/1e3).toFixed(1),`s`]})]}),(0,j.jsxs)(`div`,{className:`flex justify-between`,children:[(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`Tokens`}),(0,j.jsx)(`span`,{className:`font-mono`,children:e.tokenUsage?`${E(e.tokenUsage.promptTokens)} / ${E(e.tokenUsage.completionTokens)}`:`—`})]})]})})]})})(),(0,j.jsx)(t,{steps:K,selection:D,onSelect:O,suiteTests:jt(m)?C:void 0,suiteSelectedView:T,setupHooks:it,teardownHooks:Z,inlineLogs:at})]})}),(0,j.jsx)(Be,{withHandle:!0}),(0,j.jsx)(Re,{defaultSize:65,minSize:30,"data-tour-id":`tour-run-detail-reasoning`,children:(0,j.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:D?.type===`hook`&&st?(0,j.jsx)(n,{log:st}):D?.type===`execution`&&ct?(0,j.jsx)(n,{log:ct}):(0,j.jsx)(s,{activeTab:H,onTabChange:U,step:q,subAction:Y,runId:q?.rawRunId??m.id,allSteps:K,executionLogs:ot,accessibilitySummary:M,platform:m.platform,screenshotSide:nt,onScreenshotSideChange:dt,pipelineRef:x})})})]}),I?(0,j.jsx)(Et,{run:m,open:I,tab:Xe,response:z,loading:Ze,error:$e,onOpenChange:L,onTabChange:R,onRetry:W}):null,be&&mt&&(0,j.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center`,onClick:()=>xe(!1),children:[(0,j.jsx)(g,{variant:`secondary`,size:`icon-sm`,className:`absolute top-4 right-4 h-8 w-8 bg-background/80 backdrop-blur-sm z-10`,onClick:()=>xe(!1),children:(0,j.jsx)(ve,{className:`h-4 w-4`})}),(0,j.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,onClick:e=>e.stopPropagation(),children:[(0,j.jsx)(`video`,{ref:b,src:mt,controls:!0,autoPlay:!0,className:`rounded-lg`,style:{maxWidth:`90vw`,maxHeight:`calc(90vh - 3rem)`},onLoadedMetadata:()=>{b.current&&(b.current.playbackRate=Te)}}),(0,j.jsx)(`div`,{className:`flex items-center gap-1 bg-background/80 backdrop-blur-sm rounded-full px-1 py-0.5`,children:[.5,1,1.5,2,3,4].map(e=>(0,j.jsxs)(`button`,{onClick:()=>{De(e),b.current&&(b.current.playbackRate=e)},className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors ${Te===e?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`}`,children:[e,`x`]},e))})]})]})]})})}export{Ft as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-B4k_G_pz.js";import{i as n,l as r,n as i,o as a,s as o,t as s}from"./select-DF8sGWfv.js";import{n as c}from"./split-button-BKCtgFiC.js";import{n as l,r as u}from"./shortcut-hints-CUbl8p3Z.js";import{t as d}from"./plus-DWwmmJlz.js";import{t as f}from"./trash-2-B2a3jDA4.js";import{n as p,t as m}from"./batch-action-bar-Dd_8W0p9.js";import{n as h,r as g,t as _}from"./popover-CuqW26_E.js";import{i as v,r as y,t as b}from"./tabs-xxRH91gb.js";import{A as x,Bt as ee,Cr as S,Er as te,Fn as ne,Ft as C,G as re,H as w,In as T,K as ie,Kt as ae,Ln as oe,M as se,Mn as ce,N as le,Rt as ue,S as E,U as D,V as O,W as de,Zn as k,a as fe,en as A,fr as pe,gn as me,hr as j,ir as he,j as M,mr as N,q as P,un as F,xr as ge}from"./index-CWwAjH9Q.js";import{t as I}from"./badge-DHCU59H0.js";import{t as _e}from"./use-page-title-C_f72ri7.js";import{n as ve,o as ye,r as L,t as be}from"./lib-B4PNeU44.js";import{a as xe,i as R,n as Se,o as z,r as B,t as Ce}from"./table-cLA2Rr2t.js";import{n as we,t as Te}from"./scroll-area-CPuygHdB.js";import{t as Ee}from"./empty-state-3cB27tBp.js";import{t as De}from"./use-keyboard-shortcuts-O6nfytzm.js";import{n as Oe,t as ke}from"./use-selection-queue-3FNZ4lRr.js";var V=e(te(),1),H=A();function Ae({startedAt:e}){let[t,n]=(0,V.useState)(()=>{let t=new Date(P(e)).getTime();return Math.max(0,Math.floor((Date.now()-t)/1e3))});return(0,V.useEffect)(()=>{let t=new Date(P(e)).getTime(),r=setInterval(()=>{n(Math.max(0,Math.floor((Date.now()-t)/1e3)))},1e3);return()=>clearInterval(r)},[e]),(0,H.jsxs)(`span`,{className:`text-blue-500 tabular-nums`,children:[Math.floor(t/60),`m `,t%60,`s`]})}var je={select:`44px`,status:`136px`,target:`180px`,attributes:`260px`,duration:`104px`,createdAt:`128px`},U=[`agent-qa.trigger`,`agent-qa.runner`];function W(e){return e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1)}function G(e){return`${e.targetName?.trim()||`No target`} (${W(e.platform)})`}function K(e){return e.suiteId!=null&&e.parentRunId==null}function q(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=new Map(U.map((e,t)=>[e,t]));return Object.entries(e??{}).filter(([,e])=>typeof e==`string`).sort(([e],[t])=>{let i=n.get(e),a=n.get(t);if(i!==void 0||a!==void 0)return(i??2**53-1)-(a??2**53-1);let o=r.get(e),s=r.get(t);return o!==void 0||s!==void 0?(o??2**53-1)-(s??2**53-1):e.localeCompare(t)})}function J({attributes:e,activeKeys:t}){let n=q(e,t);if(n.length===0)return(0,H.jsx)(`span`,{className:`text-[12px] text-muted-foreground`,children:`No attributes`});let r=n.length>2?1:2,i=n.slice(0,r),a=n.length-i.length;return(0,H.jsxs)(x,{children:[(0,H.jsx)(le,{asChild:!0,children:(0,H.jsxs)(`div`,{className:`max-h-[38px] overflow-hidden text-[12px] leading-[18px]`,"aria-label":n.map(([e,t])=>`${e}=${t}`).join(`, `),children:[i.map(([e,t])=>(0,H.jsxs)(`div`,{className:`min-w-0 truncate font-mono`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`=`]}),(0,H.jsx)(`span`,{className:`text-foreground`,children:t})]},e)),a>0?(0,H.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,a,` more`]}):null]})}),(0,H.jsx)(M,{side:`top`,align:`start`,className:`max-w-[420px] p-2`,children:(0,H.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-[11px] leading-5`,children:n.map(([e,t])=>(0,H.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,H.jsx)(`span`,{className:`truncate text-foreground`,children:t})]},e))})})]})}function Y(e){return e.mode===`regex`?`${e.key} matches ${e.value}`:`${e.key} = ${e.value}`}function Me({predicates:e,onChange:t}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(`exact`),[u,p]=(0,V.useState)(null),[m,v]=(0,V.useState)([]),[y,b]=(0,V.useState)([]);(0,V.useEffect)(()=>{if(!n)return;let e=!1;return ne({q:i,limit:8}).then(t=>{e||v(t.keys)}).catch(()=>{e||v([])}),()=>{e=!0}},[i,n]),(0,V.useEffect)(()=>{if(!n||!i.trim()){b([]);return}let e=!1;return T(i.trim(),{q:o,limit:8}).then(t=>{e||b(t.values)}).catch(()=>{e||b([])}),()=>{e=!0}},[i,n,o]);function x(){let n=i.trim(),r=o.trim();if(!n||!r){p(`Enter an attribute key and value, or remove this filter.`);return}if(c===`regex`)try{new RegExp(r)}catch{p(`Enter a valid regular expression.`);return}p(null);let u=e.filter(e=>e.key!==n);t?.([...u,{key:n,value:r,mode:c}]),a(``),s(``),l(`exact`)}function ee(n){t?.(e.filter((e,t)=>t!==n))}return(0,H.jsxs)(_,{open:n,onOpenChange:r,children:[(0,H.jsx)(g,{asChild:!0,children:(0,H.jsxs)(w,{type:`button`,variant:e.length>0?`secondary`:`outline`,size:`sm`,"aria-label":`Filter by attributes`,className:`h-9 gap-2`,children:[(0,H.jsx)(ue,{className:`size-4`}),`Attributes`,e.length>0?` (${e.length})`:``]})}),(0,H.jsxs)(h,{align:`start`,className:`w-[380px] p-0`,children:[(0,H.jsx)(`div`,{className:`border-b px-3 py-2`,children:(0,H.jsx)(`h3`,{className:`text-sm font-medium`,children:`Filter by attributes`})}),(0,H.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-key`,children:`Key`}),(0,H.jsx)(O,{id:`run-attribute-key`,value:i,onChange:e=>{a(e.target.value),p(null)},placeholder:`git.branch`}),(0,H.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:m.length>0?m.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>a(e.key),children:[(0,H.jsx)(`span`,{className:`truncate font-mono`,children:e.key}),(0,H.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.key)):(0,H.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No attributes found`})})]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-value`,children:`Value`}),(0,H.jsx)(O,{id:`run-attribute-value`,value:o,onChange:e=>{s(e.target.value),p(null)},placeholder:c===`regex`?`^(master|main)$`:`master`,"aria-describedby":u?`run-attribute-filter-error`:void 0}),(0,H.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:y.length>0?y.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>s(e.value),children:[(0,H.jsx)(`span`,{className:`truncate font-mono`,children:e.value}),(0,H.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.value)):(0,H.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No values found for this key`})})]})]}),(0,H.jsxs)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[(0,H.jsx)(`button`,{type:`button`,className:D(`rounded-[2px] px-2 py-1 text-xs`,c===`exact`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`exact`,onClick:()=>l(`exact`),children:`Exact match`}),(0,H.jsx)(`button`,{type:`button`,className:D(`rounded-[2px] px-2 py-1 text-xs`,c===`regex`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`regex`,onClick:()=>l(`regex`),children:`Regex`})]}),u?(0,H.jsx)(`p`,{id:`run-attribute-filter-error`,className:`text-xs text-destructive`,children:u}):null,(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(w,{type:`button`,size:`sm`,onClick:x,children:[(0,H.jsx)(d,{className:`size-4`}),`Apply filter`]}),(0,H.jsx)(w,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t?.([]),disabled:e.length===0,children:`Clear attributes`})]}),e.length>0?(0,H.jsx)(`div`,{className:`space-y-1 border-t pt-3`,children:e.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono`,children:Y(e)}),(0,H.jsx)(w,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e.key} filter`,onClick:()=>ee(t),children:(0,H.jsx)(f,{className:`size-3.5`})})]},`${e.key}-${e.mode}`))}):null]})]})]})}function X({status:e}){let t=N(e);return(0,H.jsx)(I,{className:j(t.tone),children:t.label})}function Ne({column:e,label:n}){return(0,H.jsx)(`div`,{className:`flex justify-end`,children:(0,H.jsxs)(w,{type:`button`,variant:`ghost`,size:`xs`,"data-runs-sort-button":`compact`,className:`h-7 max-w-full shrink justify-end px-1.5 text-[12px] leading-none text-foreground/90`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[(0,H.jsx)(`span`,{className:`truncate`,children:n}),(0,H.jsx)(t,{})]})})}var Pe=[{accessorKey:`status`,header:({column:e})=>(0,H.jsxs)(w,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Status`,(0,H.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{accessorKey:`name`,header:({column:e})=>(0,H.jsxs)(w,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,H.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`target`,accessorFn:e=>`${e.targetName??`No target`} ${e.platform}`,header:({column:e})=>(0,H.jsxs)(w,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,H.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`attributes`,accessorFn:e=>Object.entries(e.attributes??{}).map(([e,t])=>`${e}=${t}`).join(` `),header:`Attributes`},{accessorKey:`duration`,header:({column:e})=>(0,H.jsx)(Ne,{column:e,label:`Duration`})},{accessorKey:`createdAt`,header:({column:e})=>(0,H.jsx)(Ne,{column:e,label:`Started`})}];function Fe(e){e.stopPropagation()}function Ie(e,t){if(e.length===0)return!1;let n=e.filter(e=>t.has(e)).length;return n===0?!1:n===e.length?!0:`indeterminate`}function Le(e){let t=je[e];if(t)return{width:t,minWidth:t}}function Z(e){return D(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`&&`w-11 px-2 text-center`,e===`status`&&`w-[136px] px-3`,e===`name`&&`px-3`,e===`target`&&`w-[180px] px-3`,e===`attributes`&&`w-[260px] px-3`,e===`duration`&&`w-[104px] px-3 text-right`,e===`createdAt`&&`w-[128px] px-3 text-right`)}function Q(e,t){return D(`py-2 align-top`,e===`select`&&`w-11 px-2`,e===`status`&&`w-[136px] px-3`,e===`name`&&D(`max-w-0 px-3`,t&&`pl-8`),e===`target`&&`w-[180px] max-w-0 px-3 text-muted-foreground`,e===`attributes`&&`w-[260px] max-w-0 px-3`,e===`duration`&&`w-[104px] px-3 text-right tabular-nums`,e===`createdAt`&&`w-[128px] px-3 text-right tabular-nums`)}function $({isActive:e,isBatchSelected:t,isChild:n}){return D(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10`,n&&`bg-muted/[0.04]`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function Re(e,t){let n=[];for(let r of e)if(n.push({id:r.id,run:r,isChild:!1,parentId:null}),!(!K(r)||!t.has(r.id)))for(let e of r.tests??[])n.push({id:e.id,run:e,isChild:!0,parentId:r.id});return n}function ze(e,t){return e.length===t.length?e.every((e,n)=>{let r=t[n];return!!r&&e.id===r.id&&e.isChild===r.isChild&&e.parentId===r.parentId&&e.run===r.run}):!1}function Be({runs:e,total:t,isLoading:c,page:l,onPageChange:u,onSearchChange:d,searchValue:f,selectedRunId:m=null,onSelectedRunIdChange:h,expandedSuites:g=new Set,onToggleSuite:_,onOpenRun:v,onVisibleRunsChange:y,platformFilter:b=``,onPlatformChange:ee,targetFilter:S=``,targetOptions:te=[],onTargetChange:ne,attributePredicates:C=[],onAttributePredicatesChange:T,sorting:oe,onSortingChange:ce,headerActions:ue,topSlot:E,enableSelection:D=!1,selectedRunIds:k=new Set,onToggleRunSelection:fe,onToggleVisibleSelection:A}){let[pe,me]=(0,V.useState)([]),j=oe??pe,he=ce??me,N=ve({data:e,columns:[...D?[{id:`select`,header:({table:e})=>(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(p,{checked:Ie(e.getRowModel().rows.map(e=>e.original.id),k),onCheckedChange:t=>A?.(e.getRowModel().rows.map(e=>e.original),t===!0),onClick:e=>e.stopPropagation(),"aria-label":`Select all`})}),enableSorting:!1}]:[],...Pe],getRowId:e=>e.id,getCoreRowModel:L(),getSortedRowModel:ye(),onSortingChange:he,state:{sorting:j}}),P=N.getHeaderGroups(),F=N.getRowModel().rows,ge=(0,V.useMemo)(()=>F.map(e=>e.original),[F]),I=(0,V.useMemo)(()=>Re(ge,g),[g,ge]),_e=Math.ceil(t/50),Ee=l*50+1,De=Math.min((l+1)*50,t),Oe=Array.from(new Set([S,...te].filter(e=>!!e))),ke=[...D?[`select`]:[],`status`,`name`,`target`,`attributes`,`duration`,`createdAt`],je=(0,V.useMemo)(()=>C.map(e=>e.key),[C]),U=(0,V.useRef)([]);(0,V.useEffect)(()=>{y&&(ze(U.current,I)||(U.current=I,y(I)))},[y,I]),(0,V.useEffect)(()=>{if(!m)return;let e=document.querySelector(`[data-runs-row-surface="${m}"]`);e&&document.activeElement!==e&&e.focus()},[m]);function W(e){return e.status===`running`&&e.startedAt?(0,H.jsx)(`span`,{className:`text-sm tabular-nums`,children:(0,H.jsx)(Ae,{startedAt:e.startedAt})}):e.status===`running`?(0,H.jsx)(`span`,{className:`text-sm text-blue-500`,children:`Starting...`}):(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:ie(e.duration)})}function q(e,t){h?.(e.id),v?.(e,t)}function Y(e,t){t.key===`Enter`&&(t.preventDefault(),q(e,t))}return(0,H.jsx)(se,{children:(0,H.jsxs)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`shrink-0 space-y-4`,children:[E,(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(O,{placeholder:`Search runs...`,value:f,onChange:e=>d(e.target.value),className:`max-w-[220px]`}),ee&&(0,H.jsxs)(s,{value:b||`all`,onValueChange:e=>ee(e===`all`?``:e),children:[(0,H.jsx)(a,{className:`w-[140px]`,children:(0,H.jsx)(o,{placeholder:`All platforms`})}),(0,H.jsxs)(i,{children:[(0,H.jsx)(n,{value:`all`,children:`All platforms`}),(0,H.jsx)(n,{value:`web`,children:`Web`}),(0,H.jsx)(n,{value:`android`,children:`Android`}),(0,H.jsx)(n,{value:`ios`,children:`iOS`})]})]}),ne&&(0,H.jsxs)(s,{value:S||`all`,onValueChange:e=>ne(e===`all`?``:e),children:[(0,H.jsx)(a,{className:`w-[180px]`,children:(0,H.jsx)(o,{placeholder:`All targets`})}),(0,H.jsxs)(i,{children:[(0,H.jsx)(n,{value:`all`,children:`All targets`}),Oe.map(e=>(0,H.jsx)(n,{value:e,children:e},e))]})]}),T&&(0,H.jsx)(Me,{predicates:C,onChange:T}),(0,H.jsx)(`div`,{className:`flex-1`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,H.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}),ue]})]})]}),(0,H.jsxs)(Te,{"data-tour-id":`tour-runs-table`,className:`min-h-0 flex-1 rounded-md border`,children:[(0,H.jsxs)(Ce,{className:`min-w-full table-fixed`,children:[(0,H.jsx)(`colgroup`,{children:ke.map(e=>(0,H.jsx)(`col`,{style:Le(e)},e))}),(0,H.jsx)(xe,{children:P.map(e=>(0,H.jsx)(z,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,H.jsx)(R,{className:Z(e.column.id),children:e.isPlaceholder?null:be(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,H.jsx)(Se,{children:F.length?F.map(e=>{let t=e.original,n=K(t),i=n&&g.has(t.id),a=t.tests??[],o=a.filter(e=>e.status===`passed`).length,s=m===t.id,c=k.has(t.id);return(0,H.jsxs)(V.Fragment,{children:[(0,H.jsxs)(z,{tabIndex:s?0:-1,"data-runs-row-surface":t.id,"data-active":String(s),"data-state":c?`selected`:void 0,"aria-selected":s,className:$({isActive:s,isBatchSelected:c,isChild:!1}),onClick:e=>q(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>Y(t,e),children:[D&&(0,H.jsx)(B,{className:Q(`select`,!1),onClick:e=>e.stopPropagation(),children:(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(p,{checked:k.has(t.id),onCheckedChange:e=>fe?.(t,e===!0),"aria-label":`Select row`})})}),(0,H.jsx)(B,{className:Q(`status`,!1),children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(X,{status:t.status}),n&&a.length>0&&(0,H.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/80 tabular-nums`,children:[o,`/`,a.length]})]})}),(0,H.jsx)(B,{className:Q(`name`,!1),children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[n&&(0,H.jsx)(`button`,{type:`button`,className:`rounded p-0.5 hover:bg-muted`,onClick:e=>{Fe(e),_?.(t.id)},children:i?(0,H.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}):(0,H.jsx)(ae,{className:`h-4 w-4 text-muted-foreground`})}),(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:t.name})]})}),(0,H.jsx)(B,{className:Q(`target`,!1),children:(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-[13px] leading-snug text-muted-foreground/90`,children:G(t)})}),(0,H.jsx)(B,{className:Q(`attributes`,!1),children:(0,H.jsx)(J,{attributes:t.attributes,activeKeys:je})}),(0,H.jsx)(B,{className:Q(`duration`,!1),children:W(t)}),(0,H.jsx)(B,{className:Q(`createdAt`,!1),children:(0,H.jsxs)(x,{children:[(0,H.jsx)(le,{asChild:!0,children:(0,H.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:de(t.createdAt)})}),(0,H.jsx)(M,{children:re(t.createdAt)})]})})]}),i&&a.map(t=>{let n=m===t.id;return(0,H.jsxs)(z,{tabIndex:n?0:-1,"data-runs-row-surface":t.id,"data-active":String(n),"aria-selected":n,className:$({isActive:n,isBatchSelected:!1,isChild:!0}),onClick:e=>q(t,e),onFocus:()=>h?.(t.id),onKeyDown:e=>Y(t,e),children:[D&&(0,H.jsx)(B,{className:Q(`select`,!0)}),(0,H.jsx)(B,{className:Q(`status`,!0),children:(0,H.jsx)(X,{status:t.status})}),(0,H.jsx)(B,{className:Q(`name`,!0),children:(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-foreground/90`,children:t.name})}),(0,H.jsx)(B,{className:Q(`target`,!0),children:(0,H.jsx)(`span`,{className:`block whitespace-normal break-words text-[13px] leading-snug text-muted-foreground`,children:G(t)})}),(0,H.jsx)(B,{className:Q(`attributes`,!0),children:(0,H.jsx)(J,{attributes:t.attributes,activeKeys:je})}),(0,H.jsx)(B,{className:Q(`duration`,!0),children:W(t)}),(0,H.jsx)(B,{className:Q(`createdAt`,!0),children:(0,H.jsxs)(x,{children:[(0,H.jsx)(le,{asChild:!0,children:(0,H.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:de(t.createdAt)})}),(0,H.jsx)(M,{children:re(t.createdAt)})]})})]},`${e.id}-child-${t.id}`)})]},e.id)}):(0,H.jsx)(z,{children:(0,H.jsx)(B,{colSpan:ke.length,className:`h-24 text-center`,children:`No results.`})})})]}),(0,H.jsx)(we,{orientation:`horizontal`})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t>0?`Showing ${Ee}-${De} of ${t}`:`No runs found`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>u(l-1),disabled:l===0,children:`Previous`}),(0,H.jsx)(w,{variant:`outline`,size:`sm`,onClick:()=>u(l+1),disabled:l>=_e-1||_e===0,children:`Next`})]})]})]})})}var Ve=new Set([`all`,`running`,`queued`,`completed`,`failed`]),He=new Set([`asc`,`desc`]);function Ue(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function We(e){let t=new URLSearchParams;e.tab!==`all`&&t.set(`tab`,e.tab),e.search&&t.set(`search`,e.search),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target);for(let n of e.attributePredicates){if(!n.key||!n.value)continue;let e=n.mode===`regex`?`attributes[${n.key}][regex]`:`attributes[${n.key}]`;t.set(e,n.value)}return e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function Ge(e){let t=[];for(let[n,r]of e.entries()){let e=/^attributes\[([^\]]+)\](?:\[(regex)\])?$/.exec(n);!e||!r||t.push({key:e[1],value:r,mode:e[2]===`regex`?`regex`:`exact`})}return t}function Ke(){let[e,t]=S(),n=e.get(`tab`),r=n&&Ve.has(n)?n:`all`,i=e.get(`search`)??``,a=e.get(`platform`)??``,o=e.get(`target`)??``,s=(0,V.useMemo)(()=>Ge(e),[e]),c=e.get(`sort`)??``,l=e.get(`order`)??`desc`,u=He.has(l)?l:`desc`,d=Ue(e.get(`page`)),f=(0,V.useMemo)(()=>c?[{id:c,desc:u===`desc`}]:[],[c,u]),p=(0,V.useRef)(f);p.current=f;let m=(0,V.useMemo)(()=>({tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d}),[r,i,a,o,s,c,u,d]);(0,V.useEffect)(()=>{let n=We(m);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,m]);let h=(0,V.useCallback)((e,n)=>{let r={...m,...e};n?.resetPage&&(r.page=1),t(We(r),{replace:!0})},[t,m]);return{tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d,sorting:f,onSortingChange:(0,V.useCallback)(e=>{let t=typeof e==`function`?e(p.current):e;t.length>0?h({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):h({sort:``,order:`desc`})},[h]),setTab:(0,V.useCallback)(e=>h({tab:e},{resetPage:!0}),[h]),setSearch:(0,V.useCallback)(e=>h({search:e},{resetPage:!0}),[h]),setPlatform:(0,V.useCallback)(e=>h({platform:e},{resetPage:!0}),[h]),setTarget:(0,V.useCallback)(e=>h({target:e},{resetPage:!0}),[h]),setAttributePredicates:(0,V.useCallback)(e=>h({attributePredicates:e},{resetPage:!0}),[h]),setPage:(0,V.useCallback)(e=>h({page:e}),[h])}}var qe={all:``,running:`running`,queued:`pending`,completed:`passed`,failed:`failed`};function Je(e,t){let n=e.trim().toLowerCase();if(!n)return!0;let r=t.runId.toLowerCase().includes(n),i=(t.testName??``).toLowerCase().includes(n);return r||i}function Ye(){_e(`Runs`);let e=ge(),[t,n]=(0,V.useState)([]),[r,i]=(0,V.useState)(0),[a,o]=(0,V.useState)([]),[s,d]=(0,V.useState)(!0),{tab:f,search:p,platform:h,target:g,attributePredicates:_,page:S,sorting:te,onSortingChange:ne,setTab:re,setSearch:T,setPlatform:ie,setTarget:ae,setAttributePredicates:ue,setPage:D}=Ke(),[O,de]=(0,V.useState)(!1),[A,j]=(0,V.useState)(null),[N,P]=(0,V.useState)([]),[ve,ye]=(0,V.useState)(()=>new Set),[L,be]=(0,V.useState)(null),[xe,R]=(0,V.useState)(!1),[Se,z]=(0,V.useState)(!1),[B,Ce]=(0,V.useState)(!0),[we,Te]=(0,V.useState)(!0),{hasFarm:Ae,isLoading:je}=c(),U=(0,V.useCallback)(async(e,t,r,a)=>{try{if(r&&r!==`running`){n(e),i(t);return}let{executions:o}=await me();if(o.length===0){n(e),i(t);return}let s=new Set(e.map(e=>e.id)),c=o.filter(e=>!s.has(e.runId)).filter(e=>Je(a,e)).map(e=>({id:e.runId,name:e.testName??`Running test...`,filePath:null,status:`running`,duration:e.duration,attributes:{},environment:null,metadata:null,startedAt:e.startedAt,endedAt:null,videoPath:null,failureSummary:null,errorLog:null,memoryLog:null,testId:null,suiteId:null,platform:`web`,testFileContent:null,modelName:null,llmProvider:null,parentRunId:null,attemptNumber:1,retryCount:0,maxRetries:0,createdAt:e.startedAt}));n([...c,...e]),i(t+c.length)}catch{n(e),i(t)}},[]),W=(0,V.useCallback)(e=>({limit:50,offset:(e.page-1)*50,name:e.name||void 0,status:e.status||void 0,platform:e.platform||void 0,target:e.target||void 0,attributes:e.attributes}),[]),G=qe[f]??``,K=(0,V.useCallback)(async e=>{try{d(!0);let[t,n]=await Promise.all([oe(W(e)),ce()]);be(n),o(t.targets??[]),await U(t.runs,t.total,e.status,e.name)}catch{E.error(`Failed to load runs`)}finally{d(!1),de(!0)}},[U,W]),q=(0,V.useCallback)(async e=>{try{let[t,n]=await Promise.all([oe(W(e)),ce()]);be(n),o(t.targets??[]),await U(t.runs,t.total,e.status,e.name)}catch{}},[U,W]),J=(0,V.useMemo)(()=>({page:S,name:p,status:G,platform:h,target:g,attributes:_}),[S,p,G,h,g,_]);(0,V.useEffect)(()=>{K(J)},[K,J]),(0,V.useEffect)(()=>{if(!O)return;let e=setInterval(()=>{q(J)},5e3);return()=>clearInterval(e)},[O,q,J]),(0,V.useEffect)(()=>{j(null),ye(new Set),P([])},[f,p,h,g,_,S]),(0,V.useEffect)(()=>{A&&(N.some(e=>e.id===A)||j(t.find(e=>e.tests?.some(e=>e.id===A))?.id??null))},[t,A,N]);let Y=ke({items:t,getId:e=>e.id,visibleIds:t.map(e=>e.id)}),Me=Y.selectedIds,X=Y.selectedItems,Ne=(0,V.useCallback)(()=>{Y.clearSelection(),z(!1),Ce(!0),Te(!0)},[Y]),Pe=(0,V.useCallback)(async e=>{if(X.length===0)return;let t=X.flatMap(e=>e.filePath?[e.filePath]:[]);if(t.length===0){E.error(`No selected runs can be rerun`);return}R(!0);try{let n=await Promise.allSettled(t.map(t=>he({file:t,local:e,noCache:!B,noMemory:!we}))),r=n.filter(e=>e.status===`fulfilled`).length,i=n.length-r;i>0?E.error(`${r} runs queued, ${i} failed`):E.success(`${r} runs queued`),z(!1)}finally{R(!1)}},[X,B,we]),Fe=(0,V.useCallback)(async()=>{if(X.length===0)return;let e=Array.from(new Set(X.flatMap(e=>e.filePath?[e.filePath]:[])));if(e.length===0){E.error(`No selected runs have file paths to purge`);return}R(!0);try{let t=await Promise.allSettled(e.map(e=>k({file:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.filter(e=>e.status===`fulfilled`).reduce((e,t)=>e+t.value.purged,0),i=t.length-n;i>0?E.error(`Purged ${r} plans from ${n} tests, ${i} failed`):E.success(`Purged ${r} cached plan${r===1?``:`s`} from ${n} test${n===1?``:`s`}`)}finally{R(!1)}},[X]),Ie=(0,V.useCallback)(async()=>{if(X.length!==0){R(!0);try{let e=await Promise.allSettled(X.map(e=>F(e.id))),t=X.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(e.flatMap(e=>e.status===`fulfilled`?e.value.deletedRunIds:[])),a=e.length-t.length;t.length>0&&(Y.setItemsSelected(t,!1),n(e=>e.filter(e=>!r.has(e.id))),i(e=>Math.max(0,e-t.length)),z(!1)),a>0?E.error(`Deleted ${t.length} run${t.length===1?``:`s`}, ${a} failed`):E.success(`Deleted ${t.length} run${t.length===1?``:`s`}`)}finally{R(!1)}}},[X,Y]),Le=(0,V.useCallback)(e=>{ye(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Z=(0,V.useCallback)((t,n)=>{let r=pe.runDetailOrLive(t.id,t.status);if(n?.metaKey||n?.ctrlKey||n?.button===1){window.open(r,`_blank`,`noopener,noreferrer`);return}e(r)},[e]),Q=(0,V.useCallback)((e,t)=>{Z(e,t)},[Z]),$=(0,V.useMemo)(()=>N.findIndex(e=>e.id===A),[A,N]);De((0,V.useMemo)(()=>{let e=e=>{if(N.length!==0){if($===-1){j(e>0?N[0].id:N[N.length-1].id);return}j(N[Math.max(0,Math.min($+e,N.length-1))].id)}},t=()=>e(1),n=()=>e(-1);return{j:t,arrowdown:t,k:n,arrowup:n,enter:e=>{$<0||Z(N[$].run,e)}}},[Z,$,N]));let Re=L?.running.count??0,ze=L?.pending.count??0,Ve=ze>0||Re>0;if(!O)return(0,H.jsx)(fe,{});let He=!!p||f!==`all`||!!h||!!g||_.length>0;if(t.length===0&&!He)return(0,H.jsx)(`div`,{"data-tour-id":`tour-runs-table`,children:(0,H.jsx)(Ee,{icon:ee,title:`No test runs yet`,description:`Run your first test to see results here`,actionLabel:`View Tests`,onAction:()=>e(pe.tests)})});let Ue=(0,H.jsx)(b,{value:f,onValueChange:re,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(y,{variant:`line`,children:[(0,H.jsx)(v,{value:`all`,children:`All`}),(0,H.jsxs)(v,{value:`running`,children:[`Running`,Re>0&&(0,H.jsx)(I,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Re})]}),(0,H.jsxs)(v,{value:`queued`,children:[`Queued`,ze>0&&(0,H.jsx)(I,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:ze})]}),(0,H.jsx)(v,{value:`completed`,children:`Completed`}),(0,H.jsx)(v,{value:`failed`,children:`Failed`})]}),Ve&&L&&(0,H.jsxs)(I,{variant:`outline`,className:`text-xs`,children:[L.activeSlots,`/`,L.concurrency,` slots`]})]})});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4 overflow-hidden`,children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3`,children:[(0,H.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Runs`}),(0,H.jsx)(se,{children:(0,H.jsxs)(x,{children:[(0,H.jsx)(le,{asChild:!0,children:(0,H.jsx)(w,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,H.jsx)(u,{className:`h-4 w-4`})})}),(0,H.jsx)(M,{side:`bottom`,className:`p-3`,children:(0,H.jsx)(l,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open run`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]})})]}),(0,H.jsx)(Be,{topSlot:Ue,runs:t,total:r,isLoading:s,page:S-1,onPageChange:e=>D(e+1),onSearchChange:T,searchValue:p,selectedRunId:A,onSelectedRunIdChange:j,expandedSuites:ve,onToggleSuite:Le,onOpenRun:Q,onVisibleRunsChange:P,platformFilter:h,onPlatformChange:ie,targetFilter:g,targetOptions:a,onTargetChange:ae,attributePredicates:_,onAttributePredicatesChange:ue,sorting:te,onSortingChange:ne,enableSelection:!0,selectedRunIds:Y.selectedIdSet,onToggleRunSelection:Y.setItemSelected,onToggleVisibleSelection:Y.setItemsSelected}),(0,H.jsx)(m,{selectedCount:Me.length,summaryMeta:Y.hiddenCount>0?`${Y.hiddenCount} hidden by filters`:void 0,secondaryIcon:(0,H.jsx)(C,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:Ie,actionSlot:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Oe,{selectedCount:Y.selectedCount,hiddenCount:Y.hiddenCount,useCache:B,useMemory:we,browserStackAvailable:!je&&Ae,open:Se,onOpenChange:z,onUseCacheChange:Ce,onUseMemoryChange:Te,onRunLocal:()=>Pe(!0),onRunBrowserStack:()=>Pe(!1),disabled:xe}),(0,H.jsx)(w,{variant:`outline`,size:`sm`,onClick:Fe,disabled:xe,children:`Purge cache`})]}),onCancel:Ne,isRunning:xe})]})}export{Ye as default};
@@ -0,0 +1 @@
1
+ import"./chunk-CilyBKbf.js";import{Er as e,U as t,en as n}from"./index-CWwAjH9Q.js";e();var r=n();function i({className:e,children:n,type:i,scrollHideDelay:a,...o}){return(0,r.jsx)(`div`,{"data-slot":`scroll-area`,className:t(`relative overflow-auto [scrollbar-width:thin]`,e),...o,children:(0,r.jsx)(`div`,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:!block`,children:n})})}function a({orientation:e=`vertical`,...t}){return null}export{a as n,i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{$ as t,At as n,Dt as r,Er as i,Et as a,Mt as o,Ot as s,Pt as c,Q as l,St as u,Tr as d,Tt as f,U as p,Xt as m,_t as h,bt as g,en as _,et as v,gt as y,ht as b,kt as x,mt as S,nt as C,tt as w,vt as ee,wt as T,xt as E,yt as D}from"./index-CWwAjH9Q.js";var O=m(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),k=m(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),A=m(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),j=e(d(),1),M=e(i(),1);function N(e){let t=M.useRef({value:e,previous:e});return M.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function P(e,[t,n]){return Math.min(n,Math.max(t,e))}var F=_(),I=[` `,`Enter`,`ArrowUp`,`ArrowDown`],L=[` `,`Enter`],R=`Select`,[z,B,V]=r(R),[H,U]=s(R,[V,C]),W=C(),[te,G]=H(R),[ne,re]=H(R),K=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:f,disabled:p,required:m,form:h}=e,g=W(t),[_,v]=M.useState(null),[y,b]=M.useState(null),[x,S]=M.useState(!1),C=E(l),[ee,D]=T({prop:r,defaultProp:i??!1,onChange:a,caller:R}),[O,k]=T({prop:o,defaultProp:s,onChange:c,caller:R}),A=M.useRef(null),j=_?h||!!_.closest(`form`):!0,[N,P]=M.useState(new Set),I=Array.from(N).map(e=>e.props.value).join(`;`);return(0,F.jsx)(w,{...g,children:(0,F.jsxs)(te,{required:m,scope:t,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:u(),value:O,onValueChange:k,open:ee,onOpenChange:D,dir:C,triggerPointerDownPosRef:A,disabled:p,children:[(0,F.jsx)(z.Provider,{scope:t,children:(0,F.jsx)(ne,{scope:e.__scopeSelect,onNativeOptionAdd:M.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:M.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),j?(0,F.jsxs)(Ge,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:e=>k(e.target.value),disabled:p,form:h,children:[O===void 0?(0,F.jsx)(`option`,{value:``}):null,Array.from(N)]},I):null]})})};K.displayName=R;var ie=`SelectTrigger`,q=M.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:i=!1,...o}=e,s=W(r),u=G(ie,r),d=u.disabled||i,f=c(t,u.onTriggerChange),p=B(r),m=M.useRef(`touch`),[h,g,_]=qe(e=>{let t=p().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===u.value));n!==void 0&&u.onValueChange(n.value)}),v=e=>{d||(u.onOpenChange(!0),_()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,F.jsx)(l,{asChild:!0,...s,children:(0,F.jsx)(n.button,{type:`button`,role:`combobox`,"aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":`none`,dir:u.dir,"data-state":u.open?`open`:`closed`,disabled:d,"data-disabled":d?``:void 0,"data-placeholder":Ke(u.value)?``:void 0,...o,ref:f,onClick:a(o.onClick,e=>{e.currentTarget.focus(),m.current!==`mouse`&&v(e)}),onPointerDown:a(o.onPointerDown,e=>{m.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(v(e),e.preventDefault())}),onKeyDown:a(o.onKeyDown,e=>{let t=h.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&g(e.key),!(t&&e.key===` `)&&I.includes(e.key)&&(v(),e.preventDefault())})})})});q.displayName=ie;var ae=`SelectValue`,oe=M.forwardRef((e,t)=>{let{__scopeSelect:r,className:i,style:a,children:o,placeholder:s=``,...l}=e,u=G(ae,r),{onValueNodeHasChildrenChange:d}=u,p=o!==void 0,m=c(t,u.onValueNodeChange);return f(()=>{d(p)},[d,p]),(0,F.jsx)(n.span,{...l,ref:m,style:{pointerEvents:`none`},children:Ke(u.value)?(0,F.jsx)(F.Fragment,{children:s}):o})});oe.displayName=ae;var se=`SelectIcon`,ce=M.forwardRef((e,t)=>{let{__scopeSelect:r,children:i,...a}=e;return(0,F.jsx)(n.span,{"aria-hidden":!0,...a,ref:t,children:i||`▼`})});ce.displayName=se;var le=`SelectPortal`,ue=e=>(0,F.jsx)(h,{asChild:!0,...e});ue.displayName=le;var J=`SelectContent`,de=M.forwardRef((e,t)=>{let n=G(J,e.__scopeSelect),[r,i]=M.useState();if(f(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?j.createPortal((0,F.jsx)(fe,{scope:e.__scopeSelect,children:(0,F.jsx)(z.Slot,{scope:e.__scopeSelect,children:(0,F.jsx)(`div`,{children:e.children})})}),t):null}return(0,F.jsx)(he,{...e,ref:t})});de.displayName=J;var Y=10,[fe,X]=H(J),pe=`SelectContentImpl`,me=o(`SelectContent.RemoveScroll`),he=M.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...x}=e,C=G(J,n),[w,T]=M.useState(null),[E,O]=M.useState(null),k=c(t,e=>T(e)),[A,j]=M.useState(null),[N,P]=M.useState(null),I=B(n),[L,R]=M.useState(!1),z=M.useRef(!1);M.useEffect(()=>{if(w)return S(w)},[w]),y();let V=M.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==i))return},[I,E]),H=M.useCallback(()=>V([A,w]),[V,A,w]);M.useEffect(()=>{L&&H()},[L,H]);let{onOpenChange:U,triggerPointerDownPosRef:W}=C;M.useEffect(()=>{if(w){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(W.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||U(!1),document.removeEventListener(`pointermove`,t),W.current=null};return W.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[w,U,W]),M.useEffect(()=>{let e=()=>U(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[U]);let[te,ne]=qe(e=>{let t=I().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),re=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(C.value!==void 0&&C.value===t||r)&&(j(e),r&&(z.current=!0))},[C.value]),K=M.useCallback(()=>w?.focus(),[w]),ie=M.useCallback((e,t,n)=>{let r=!z.current&&!n;(C.value!==void 0&&C.value===t||r)&&P(e)},[C.value]),q=r===`popper`?ye:_e,ae=q===ye?{side:l,sideOffset:u,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,F.jsx)(fe,{scope:n,content:w,viewport:E,onViewportChange:O,itemRefCallback:re,selectedItem:A,onItemLeave:K,itemTextRefCallback:ie,focusSelectedItem:H,selectedItemText:N,position:r,isPositioned:L,searchRef:te,children:(0,F.jsx)(b,{as:me,allowPinchZoom:!0,children:(0,F.jsx)(ee,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:a(i,e=>{C.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,F.jsx)(D,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,F.jsx)(q,{role:`listbox`,id:C.contentId,"data-state":C.open?`open`:`closed`,dir:C.dir,onContextMenu:e=>e.preventDefault(),...x,...ae,onPlaced:()=>R(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...x.style},onKeyDown:a(x.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});he.displayName=pe;var ge=`SelectItemAlignedPosition`,_e=M.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:i,...a}=e,o=G(J,r),s=X(J,r),[l,u]=M.useState(null),[d,p]=M.useState(null),m=c(t,e=>p(e)),h=B(r),g=M.useRef(!1),_=M.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,S=M.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&v&&y&&b){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if(o.dir!==`rtl`){let i=r.left-t.left,a=n.left-i,o=e.left-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-Y,d=P(a,[Y,Math.max(Y,u-c)]);l.style.minWidth=s+`px`,l.style.left=d+`px`}else{let i=t.right-r.right,a=window.innerWidth-n.right-i,o=window.innerWidth-e.right-a,s=e.width+o,c=Math.max(s,t.width),u=window.innerWidth-Y,d=P(a,[Y,Math.max(Y,u-c)]);l.style.minWidth=s+`px`,l.style.right=d+`px`}let a=h(),s=window.innerHeight-Y*2,c=v.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),_=parseInt(u.paddingBottom,10),x=f+p+c+_+m,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),ee=parseInt(C.paddingBottom,10),T=e.top+e.height/2-Y,E=s-T,D=y.offsetHeight/2,O=y.offsetTop+D,k=f+p+O,A=x-k;if(k<=T){let e=a.length>0&&y===a[a.length-1].ref.current;l.style.bottom=`0px`;let t=d.clientHeight-v.offsetTop-v.offsetHeight,n=k+Math.max(E,D+(e?ee:0)+t+m);l.style.height=n+`px`}else{let e=a.length>0&&y===a[0].ref.current;l.style.top=`0px`;let t=Math.max(T,f+v.offsetTop+(e?w:0)+D)+A;l.style.height=t+`px`,v.scrollTop=k-T+v.offsetTop}l.style.margin=`${Y}px 0`,l.style.minHeight=S+`px`,l.style.maxHeight=s+`px`,i?.(),requestAnimationFrame(()=>g.current=!0)}},[h,o.trigger,o.valueNode,l,d,v,y,b,o.dir,i]);f(()=>S(),[S]);let[C,w]=M.useState();return f(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,F.jsx)(be,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:M.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]),children:(0,F.jsx)(`div`,{ref:u,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,F.jsx)(n.div,{...a,ref:m,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})});_e.displayName=ge;var ve=`SelectPopperPosition`,ye=M.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=W(n);return(0,F.jsx)(v,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ye.displayName=ve;var[be,xe]=H(J,{}),Se=`SelectViewport`,Ce=M.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:i,...o}=e,s=X(Se,r),l=xe(Se,r),u=c(t,s.onViewportChange),d=M.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,F.jsx)(z.Slot,{scope:r,children:(0,F.jsx)(n.div,{"data-radix-select-viewport":``,role:`presentation`,...o,ref:u,style:{position:`relative`,flex:1,overflow:`hidden auto`,...o.style},onScroll:a(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){let e=Math.abs(d.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}d.current=t.scrollTop})})})]})});Ce.displayName=Se;var we=`SelectGroup`,[Te,Ee]=H(we),De=M.forwardRef((e,t)=>{let{__scopeSelect:r,...i}=e,a=u();return(0,F.jsx)(Te,{scope:r,id:a,children:(0,F.jsx)(n.div,{role:`group`,"aria-labelledby":a,...i,ref:t})})});De.displayName=we;var Oe=`SelectLabel`,ke=M.forwardRef((e,t)=>{let{__scopeSelect:r,...i}=e,a=Ee(Oe,r);return(0,F.jsx)(n.div,{id:a.id,...i,ref:t})});ke.displayName=Oe;var Z=`SelectItem`,[Ae,je]=H(Z),Me=M.forwardRef((e,t)=>{let{__scopeSelect:r,value:i,disabled:o=!1,textValue:s,...l}=e,d=G(Z,r),f=X(Z,r),p=d.value===i,[m,h]=M.useState(s??``),[g,_]=M.useState(!1),v=c(t,e=>f.itemRefCallback?.(e,i,o)),y=u(),b=M.useRef(`touch`),x=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};if(i===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,F.jsx)(Ae,{scope:r,value:i,disabled:o,textId:y,isSelected:p,onItemTextChange:M.useCallback(e=>{h(t=>t||(e?.textContent??``).trim())},[]),children:(0,F.jsx)(z.ItemSlot,{scope:r,value:i,disabled:o,textValue:m,children:(0,F.jsx)(n.div,{role:`option`,"aria-labelledby":y,"data-highlighted":g?``:void 0,"aria-selected":p&&g,"data-state":p?`checked`:`unchecked`,"aria-disabled":o||void 0,"data-disabled":o?``:void 0,tabIndex:o?void 0:-1,...l,ref:v,onFocus:a(l.onFocus,()=>_(!0)),onBlur:a(l.onBlur,()=>_(!1)),onClick:a(l.onClick,()=>{b.current!==`mouse`&&x()}),onPointerUp:a(l.onPointerUp,()=>{b.current===`mouse`&&x()}),onPointerDown:a(l.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:a(l.onPointerMove,e=>{b.current=e.pointerType,o?f.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:a(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:a(l.onKeyDown,e=>{f.searchRef?.current!==``&&e.key===` `||(L.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})});Me.displayName=Z;var Q=`SelectItemText`,Ne=M.forwardRef((e,t)=>{let{__scopeSelect:r,className:i,style:a,...o}=e,s=G(Q,r),l=X(Q,r),u=je(Q,r),d=re(Q,r),[p,m]=M.useState(null),h=c(t,e=>m(e),u.onItemTextChange,e=>l.itemTextRefCallback?.(e,u.value,u.disabled)),g=p?.textContent,_=M.useMemo(()=>(0,F.jsx)(`option`,{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return f(()=>(v(_),()=>y(_)),[v,y,_]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(n.span,{id:u.textId,...o,ref:h}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?j.createPortal(o.children,s.valueNode):null]})});Ne.displayName=Q;var Pe=`SelectItemIndicator`,Fe=M.forwardRef((e,t)=>{let{__scopeSelect:r,...i}=e;return je(Pe,r).isSelected?(0,F.jsx)(n.span,{"aria-hidden":!0,...i,ref:t}):null});Fe.displayName=Pe;var Ie=`SelectScrollUpButton`,Le=M.forwardRef((e,t)=>{let n=X(Ie,e.__scopeSelect),r=xe(Ie,e.__scopeSelect),[i,a]=M.useState(!1),o=c(t,r.onScrollButtonChange);return f(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(Be,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Le.displayName=Ie;var Re=`SelectScrollDownButton`,ze=M.forwardRef((e,t)=>{let n=X(Re,e.__scopeSelect),r=xe(Re,e.__scopeSelect),[i,a]=M.useState(!1),o=c(t,r.onScrollButtonChange);return f(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,F.jsx)(Be,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ze.displayName=Re;var Be=M.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:i,...o}=e,s=X(`SelectScrollButton`,r),c=M.useRef(null),l=B(r),u=M.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return M.useEffect(()=>()=>u(),[u]),f(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,F.jsx)(n.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:a(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:a(o.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:a(o.onPointerLeave,()=>{u()})})}),Ve=`SelectSeparator`,He=M.forwardRef((e,t)=>{let{__scopeSelect:r,...i}=e;return(0,F.jsx)(n.div,{"aria-hidden":!0,...i,ref:t})});He.displayName=Ve;var $=`SelectArrow`,Ue=M.forwardRef((e,n)=>{let{__scopeSelect:r,...i}=e,a=W(r),o=G($,r),s=X($,r);return o.open&&s.position===`popper`?(0,F.jsx)(t,{...a,...i,ref:n}):null});Ue.displayName=$;var We=`SelectBubbleInput`,Ge=M.forwardRef(({__scopeSelect:e,value:t,...r},i)=>{let a=M.useRef(null),o=c(i,a),s=N(t);return M.useEffect(()=>{let e=a.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(s!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[s,t]),(0,F.jsx)(n.select,{...r,style:{...x,...r.style},ref:o,defaultValue:t})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=g(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=K,Ze=q,Qe=oe,$e=ce,et=ue,tt=de,nt=Ce,rt=De,it=ke,at=Me,ot=Ne,st=Fe,ct=Le,lt=ze;function ut({...e}){return(0,F.jsx)(Xe,{"data-slot":`select`,...e})}function dt({...e}){return(0,F.jsx)(rt,{"data-slot":`select-group`,...e})}function ft({...e}){return(0,F.jsx)(Qe,{"data-slot":`select-value`,...e})}function pt({className:e,size:t=`default`,children:n,...r}){return(0,F.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:p(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,F.jsx)($e,{asChild:!0,children:(0,F.jsx)(k,{className:`size-4 opacity-50`})})]})}function mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,F.jsx)(et,{children:(0,F.jsxs)(tt,{"data-slot":`select-content`,className:p(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,F.jsx)(_t,{}),(0,F.jsx)(nt,{className:p(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,F.jsx)(vt,{})]})})}function ht({className:e,...t}){return(0,F.jsx)(it,{"data-slot":`select-label`,className:p(`px-2 py-1.5 text-xs text-muted-foreground`,e),...t})}function gt({className:e,children:t,...n}){return(0,F.jsxs)(at,{"data-slot":`select-item`,className:p(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,F.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(st,{children:(0,F.jsx)(O,{className:`size-4`})})}),(0,F.jsx)(ot,{children:t})]})}function _t({className:e,...t}){return(0,F.jsx)(ct,{"data-slot":`select-scroll-up-button`,className:p(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(A,{className:`size-4`})})}function vt({className:e,...t}){return(0,F.jsx)(lt,{"data-slot":`select-scroll-down-button`,className:p(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,F.jsx)(k,{className:`size-4`})})}export{ht as a,N as c,gt as i,k as l,mt as n,pt as o,dt as r,ft as s,ut as t,O as u};
@@ -0,0 +1 @@
1
+ import{U as e,Xt as t,en as n}from"./index-CWwAjH9Q.js";var r=t(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),i=n();function a({shortcut:t,className:n}){return(0,i.jsx)(`kbd`,{className:e(`text-[10px] font-mono px-1.5 py-0.5 rounded border bg-muted text-muted-foreground`,n),children:t})}function o({hints:e}){return(0,i.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5`,children:e.map(e=>(0,i.jsxs)(`div`,{className:`contents`,children:[(0,i.jsx)(a,{shortcut:e.key}),(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.label})]},e.key))})}export{o as n,r,a as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{l as t}from"./select-DF8sGWfv.js";import{t as n}from"./shortcut-hints-CUbl8p3Z.js";import{Bt as r,C as i,D as a,E as o,Er as s,H as c,Sn as l,T as u,U as d,Xt as f,en as p,w as m}from"./index-CWwAjH9Q.js";var h=f(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),g=f(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_=e(s(),1),v=null,y=null;function b(){let[e,t]=(0,_.useState)(()=>v?{...v,isLoading:!1}:{defaultRunMode:`local`,hasFarm:!1,isLoading:!0});return(0,_.useEffect)(()=>{if(v){t({...v,isLoading:!1});return}y||=l().then(e=>{let t=e.config,n=t.farm;v={defaultRunMode:t.defaultRunMode===`farm`?`farm`:`local`,hasFarm:!!n?.provider}}).catch(()=>{v={defaultRunMode:`local`,hasFarm:!1}}).finally(()=>{y=null}),y.then(()=>{t({...v,isLoading:!1})})},[]),e}var x=p();function S({onRun:e,onRunNoCache:s,onPurgeCache:l,disabled:f=!1,size:p=`default`,className:_,label:v,shortcutKey:y,runButtonTourId:S}){let{hasFarm:C}=b(),w=C||!!s||!!l,T=v??`Run`,E=y?(0,x.jsx)(n,{shortcut:y,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`}):null;return w?(0,x.jsxs)(`div`,{className:d(`inline-flex items-center`,_),children:[(0,x.jsxs)(c,{size:p,disabled:f,onClick:()=>e(!0),className:`rounded-r-none`,"data-tour-id":S,children:[(0,x.jsx)(r,{className:`size-4`}),T,E]}),(0,x.jsxs)(i,{children:[(0,x.jsx)(a,{asChild:!0,children:(0,x.jsx)(c,{variant:`default`,size:p,disabled:f,className:`rounded-l-none border-l border-l-primary-foreground/20 px-2`,children:(0,x.jsx)(t,{className:`h-4 w-4`})})}),(0,x.jsxs)(m,{align:`end`,children:[(0,x.jsxs)(u,{onClick:()=>e(!0),children:[(0,x.jsx)(g,{className:`mr-2 h-4 w-4`}),`Run Local`]}),C&&(0,x.jsxs)(u,{onClick:()=>e(!1),children:[(0,x.jsx)(h,{className:`mr-2 h-4 w-4`}),`Run on Farm`]}),(s||l)&&(0,x.jsx)(o,{}),s&&(0,x.jsx)(u,{onClick:()=>s(!0),children:`Run without cache`}),l&&(0,x.jsx)(u,{onClick:l,children:`Purge cache`})]})]})]}):(0,x.jsxs)(c,{size:p,disabled:f,onClick:()=>e(!0),className:_,"data-tour-id":S,children:[(0,x.jsx)(r,{className:`size-4`}),T,E]})}export{h as i,b as n,g as r,S as t};
@@ -0,0 +1 @@
1
+ import{Xt as e}from"./index-CWwAjH9Q.js";var t=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{A as e,N as t,U as n,en as r,j as i}from"./index-CWwAjH9Q.js";var a=r(),o={env:`env (.env file)`,inline:`inline (test config)`,suite:`suite (suite config)`,cli:`cli (--var flag)`,capture:`capture (captured from screen)`,hook:`hook (hook output)`,step:`step (set by agent)`,runJS:`runJS (inline JavaScript)`,runHook:`runHook uses the stable hook ID from the configured hooks file`,secret:`secret (runtime only)`};function s(e){switch(e){case`env`:return`bg-blue-500/15 border border-blue-500/20`;case`capture`:return`bg-emerald-500/15 border border-emerald-500/20`;case`cli`:return`bg-purple-500/15 border border-purple-500/20`;case`inline`:return`bg-amber-500/15 border border-amber-500/20`;case`suite`:return`bg-cyan-500/15 border border-cyan-500/20`;case`hook`:return`bg-orange-500/15 border border-orange-500/20`;case`step`:return`bg-teal-500/15 border border-teal-500/20`;case`runJS`:return`bg-yellow-500/15 border border-yellow-500/20`;case`runHook`:return`bg-orange-600/15 border border-orange-600/20`;case`secret`:return`bg-rose-500/15 border border-rose-500/20`;default:return`bg-accent/20 border border-accent/20`}}function c(e){let t=/\[secret:(\w+)\]/g,n=[],r=0,i;for(;(i=t.exec(e))!==null;){let[t,a]=i;i.index>r&&n.push({type:`text`,value:e.slice(r,i.index)}),n.push({type:`pill`,resolvedValue:t,varName:a,namespace:`secret`,templateSyntax:`{{secret:${a}}}`}),r=i.index+t.length}return r<e.length&&n.push({type:`text`,value:e.slice(r)}),n.length>0?n:[{type:`text`,value:e}]}function l(e,t,n){let r=/\{\{(\w+):([^}]*(?:\{[^}]*\}[^}]*)*)\}\}/g,i=[],a;for(;(a=r.exec(e))!==null;)i.push({index:a.index,fullMatch:a[0],namespace:a[1],key:a[2]});if(i.length===0)return t.length>0?[{type:`text`,value:t}]:[];let o=[],s=0;for(let t of i)t.index>s&&o.push({kind:`literal`,text:e.slice(s,t.index)}),t.namespace===`env`?o.push({kind:`env`,varName:t.key,templateSyntax:t.fullMatch}):t.namespace===`secret`?o.push({kind:`secret`,varName:t.key,templateSyntax:t.fullMatch}):o.push({kind:`other`,templateSyntax:t.fullMatch}),s=t.index+t.fullMatch.length;s<e.length&&o.push({kind:`literal`,text:e.slice(s)});let c=[],l=0;for(let e=0;e<o.length;e++){let r=o[e];if(r.kind===`literal`){let e=t.indexOf(r.text,l);e>=0&&(e>l&&c.push({type:`text`,value:t.slice(l,e)}),r.text.length>0&&c.push({type:`text`,value:r.text}),l=e+r.text.length)}else if(r.kind===`env`){let e=n?.[r.varName]?.value??null,i=e??r.templateSyntax,a=t.indexOf(i,l);a>=0&&(a>l&&c.push({type:`text`,value:t.slice(l,a)}),e===null?c.push({type:`text`,value:r.templateSyntax}):c.push({type:`pill`,resolvedValue:i,varName:r.varName,namespace:`env`,templateSyntax:r.templateSyntax}),l=a+i.length)}else if(r.kind===`secret`){let e=`[secret:${r.varName}]`,n=t.indexOf(e,l),i=t.indexOf(r.templateSyntax,l),a=n>=0&&(i===-1||n<=i)?e:r.templateSyntax,o=t.indexOf(a,l);o>=0?(o>l&&c.push({type:`text`,value:t.slice(l,o)}),c.push({type:`pill`,resolvedValue:e,varName:r.varName,namespace:`secret`,templateSyntax:r.templateSyntax}),l=o+a.length):c.push({type:`pill`,resolvedValue:e,varName:r.varName,namespace:`secret`,templateSyntax:r.templateSyntax})}else if(r.kind===`other`){let i=t.length;for(let r=e+1;r<o.length;r++){let e=o[r];if(e.kind===`literal`){let n=t.indexOf(e.text,l);if(n>=0){i=n;break}}else if(e.kind===`env`){let r=n?.[e.varName]?.value;if(r){let e=t.indexOf(r,l);if(e>=0){i=e;break}}}else if(e.kind===`secret`){let n=`[secret:${e.varName}]`,r=t.indexOf(n,l),a=t.indexOf(e.templateSyntax,l),o=r>=0&&(a===-1||r<=a)?r:a;if(o>=0){i=o;break}}}let a=t.slice(l,i),s=r.templateSyntax.match(/^\{\{(\w+):(.+)\}\}$/),u=s?.[1]??`unknown`,d=s?.[2]??r.templateSyntax;c.push({type:`pill`,resolvedValue:a,varName:d,namespace:u,templateSyntax:r.templateSyntax}),l=i}}return l<t.length&&c.push({type:`text`,value:t.slice(l)}),c}function u({step:r}){return(0,a.jsx)(`span`,{className:`flex-1 min-w-0 text-sm break-all`,children:(r.originalStepName?l(r.originalStepName,r.name,r.variableSnapshot):c(r.name)).map((c,l)=>{if(c.type===`text`)return(0,a.jsx)(`span`,{children:c.value},l);let u=r.variableSnapshot?.[c.varName],d=u?o[u.source]??u.source:o[c.namespace]??c.namespace;return(0,a.jsxs)(e,{children:[(0,a.jsx)(t,{asChild:!0,children:(0,a.jsx)(`span`,{className:n(`rounded-sm px-1 py-px cursor-default`,s(u?.source??c.namespace)),"aria-label":`variable: ${c.varName}`,children:c.resolvedValue})}),(0,a.jsx)(i,{className:`max-w-xs`,children:(0,a.jsxs)(`div`,{className:`space-y-1`,children:[(0,a.jsx)(`div`,{className:`text-xs font-medium`,children:c.varName}),(0,a.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground`,children:c.templateSyntax}),(0,a.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:c.resolvedValue}),(0,a.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:d})]})})]},l)})})}export{u as n,s as r,o as t};
@@ -0,0 +1,5 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./id-badge-CIlIhfqv.js";import{t as n}from"./monaco-editor-q3UYuc-5.js";import{n as r}from"./split-button-BKCtgFiC.js";import{a as i,c as a,i as ee,l as te,n as o,o as s,r as ne,s as re,t as c}from"./filename-validation-CaFIUcWo.js";import{a as ie,n as ae}from"./dist-_gv57K8d.js";import{i as oe,n as se,r as ce,t as le}from"./tabs-xxRH91gb.js";import{A as ue,Cr as de,Er as l,F as fe,Ht as pe,I as me,J as he,L as ge,N as _e,R as ve,S as u,Sn as ye,Sr as be,Ut as xe,V as Se,Vn as Ce,an as we,cr as Te,en as Ee,er as De,fr as d,ir as Oe,j as ke,on as Ae,r as je,tn as Me,ur as Ne,xr as Pe,yn as Fe,z as Ie}from"./index-CWwAjH9Q.js";import{t as Le}from"./use-page-title-C_f72ri7.js";import{n as f,r as Re,t as ze}from"./resizable-C3bJVUPo.js";import{t as Be}from"./empty-state-3cB27tBp.js";import{t as Ve}from"./use-keyboard-shortcuts-O6nfytzm.js";import{i as He,n as Ue,r as We,t as Ge}from"./suite-navbar-D9wliAeW.js";var p=e(l(),1);function Ke(e,t){return c(e,t,`suiteMatch`)}var m=Ee(),qe=`name: My Suite
2
+ target: ""
3
+ tests: []
4
+ `;function Je(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Ye(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Xe({text:e}){return(0,m.jsxs)(ue,{children:[(0,m.jsx)(_e,{asChild:!0,children:(0,m.jsx)(pe,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,m.jsx)(ke,{className:`max-w-[250px] text-[13px]`,children:e})]})}function h(){let e=be()[`suite-id`]??``,c=Pe(),[ue]=de(),l=he(),{defaultRunMode:pe}=r(),{targets:_e,globalUse:Ee,isLoading:ke}=t(),h=!e,Ze=ue.get(`live`)===`1`,g=(0,p.useRef)(null),_=(0,p.useRef)(null),Qe=(0,p.useRef)(()=>{}),$e=(0,p.useRef)(!1),v=(0,p.useRef)(null),y=(0,p.useRef)(null),[b,x]=(0,p.useState)(h?qe:``),[et,tt]=(0,p.useState)(``),[S,nt]=(0,p.useState)(``),[C,rt]=(0,p.useState)(!h),[w,it]=(0,p.useState)(!1),[at,ot]=(0,p.useState)(!1),[st,ct]=(0,p.useState)(!1),[lt,ut]=(0,p.useState)(!1),[T,dt]=(0,p.useState)(null),[ft,pt]=(0,p.useState)(!1),[mt,ht]=(0,p.useState)(!1),[gt,_t]=(0,p.useState)([]),[E,D]=(0,p.useState)(null),[O,k]=(0,p.useState)(null),[A,j]=(0,p.useState)(!1),[M,N]=(0,p.useState)(!1),[P,F]=(0,p.useState)(null),[vt,I]=(0,p.useState)(`reasoning`),[yt,L]=(0,p.useState)(null),[R,z]=(0,p.useState)({setup:[],teardown:[]}),[bt,xt]=(0,p.useState)([]),[St,Ct]=(0,p.useState)(!1),[B,wt]=(0,p.useState)(``),Tt=!h&&b!==et,Et=h&&S?Ke(S.trim(),gt):null,Dt=h&&!!S&&!!Et,{suggestions:Ot}=o(null),kt=(0,p.useMemo)(()=>Ot.filter(e=>e.namespace!==`capture`),[Ot]),V=(0,p.useMemo)(()=>We(b),[b]),At=V?.suiteId??``,jt=V?.name||(h?`New Suite`:B),H=i(E,{tests:(0,p.useMemo)(()=>V?V.tests.map(e=>({draftId:e.id,testId:e.id,path:e.test,name:e.test.split(`/`).pop()??e.test,steps:[],setup:[],teardown:[]})):[],[V]),setupHooks:R.setup,teardownHooks:R.teardown,allowReconnect:!1}),U=H.terminateSession;_.current=E,Qe.current=U;let Mt=V?.target?.trim()??``,W=M?`connecting`:H.connectionState,G=E!==null,K=G&&H.platform===`web`&&Mt?Mt:null,Nt=(0,p.useMemo)(()=>ee(b),[b]),q=G&&V!==null&&(!Je(V.setup??[],R.setup)||!Je(V.teardown??[],R.teardown)),Pt=G&&W===`connected`&&V!==null&&V.tests.length>0,Ft=M||G,It=M||G||lt||T!==null||h||V===null||!V?.target.trim()||ke;Le((0,p.useMemo)(()=>G&&O!==null?`Live #${O} — ${V?.name?.trim()||jt||`Suite`}`:h?`New Suite`:`Edit Suite`,[G,O,V?.name,jt,h]));let J=(0,p.useMemo)(()=>{if(V)return{suiteName:V.name,suiteContext:V.context||void 0}},[V]),Lt=(0,p.useMemo)(()=>P===`ended`?{reason:`ended`,title:`Live session ended`,description:`The current draft is unchanged. Close live mode or start a fresh disposable session from this target.`}:P===`disconnected`?{reason:`disconnected`,title:`Live session disconnected`,description:`The connection dropped and the disposable session was terminated. Start a fresh session to reconnect.`}:null,[P]);(0,p.useEffect)(()=>{if(h)return;let t=!1;return Ce(e).then(e=>{t||(x(e.content),tt(e.content),wt(e.path),rt(!1))}).catch(()=>{t||(it(!0),rt(!1))}),()=>{t=!0}},[e,h]),(0,p.useEffect)(()=>{let e=!1;return ye().then(t=>{if(e)return;let n=t.config?.workspace?.suiteMatch;Array.isArray(n)&&_t(n)}).catch(()=>{}),()=>{e=!0}},[]),(0,p.useEffect)(()=>{h&&x(e=>He(e,[`suite-id`],ae()))},[h]),(0,p.useEffect)(()=>{if(h||C)return;let e=We(b);e&&!e.suiteId&&x(e=>He(e,[`suite-id`],ae()))},[h,C,et]);let Y=(0,p.useCallback)(async()=>{ot(!0);try{if(h){let e=Ke(S.trim(),gt);if(e){u.error(e);return}await Ae(S.trim(),b),u.success(`Suite file created`);let t=V?.suiteId??``;if(!t){u.error(`Created suite is missing suite-id; please reload`);return}c(d.suiteEdit(t))}else await Te(e,b),tt(b),u.success(`Saved`)}catch(e){e instanceof Me&&e.missingTests&&e.missingTests.length>0?u.error(`Cannot save — referenced tests not found: ${e.missingTests.map(e=>e.test).join(`, `)}`):u.error(`Failed to save: ${e instanceof Error?e.message:String(e)}`)}finally{ot(!1)}},[h,S,gt,b,e,V?.suiteId,c]),Rt=(0,p.useCallback)(async()=>{ct(!0);try{let e=await Ne(b);e.valid?u.success(`Valid suite`):u.error(e.errors.map(e=>e.message).join(`
5
+ `))}catch(e){u.error(`Validation failed: ${e instanceof Error?e.message:String(e)}`)}finally{ct(!1)}},[b]),zt=(0,p.useCallback)(async e=>{if(!h){ut(!0);try{dt((await Oe({file:B,local:e})).runId),u.success(`Suite run started`)}catch(e){u.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{ut(!1)}}},[h,B]),Bt=(0,p.useCallback)(()=>dt(null),[]),X=(0,p.useCallback)(()=>{s(`page`,`closing live mode`,{liveSessionId:E??void 0,terminalReason:P??void 0}),g.current?.abort(),g.current=null,E&&U(),N(!1),D(null),k(null),F(null),L(null),v.current=null,y.current=null,z({setup:[],teardown:[]}),j(!1)},[E,P,U]),Vt=(0,p.useCallback)(()=>{s(`page`,`ending live session from UI`,{liveSessionId:E??void 0}),g.current?.abort(),g.current=null,E&&U(),N(!1),D(null),k(null),F(`ended`),L(null),v.current=null,y.current=null,z({setup:[],teardown:[]}),j(!1)},[E,U]),Z=(0,p.useCallback)(async(e,t)=>{let n=e.target.trim();if(!n){u.error(`Select a target before starting live mode`);return}let r=new AbortController;g.current?.abort(),g.current=r,j(!0),F(null),I(`reasoning`),L(null),v.current=null,y.current=null,N(!0);try{t?.replaceCurrentSession&&_.current&&(U(),D(null),k(null));let i=ne({content:b,targetName:n,targets:_e,globalUse:Ee});s(`page`,`requesting live session`,{targetName:n,platform:i.platform,headless:i.headless??void 0,replacingSession:t?.replaceCurrentSession??!1});let a=[...e.setup??[]],ee=[...e.teardown??[]],te=e.suiteId?{type:`suite`,id:e.suiteId}:void 0,{sessionId:o,sessionNumber:re}=await we({...i,setupHooks:a,teardownHooks:ee,entity:te},r.signal);if(r.signal.aborted)return;z({setup:a,teardown:ee}),D(o),k(re),s(`page`,`live session created`,{sessionId:o,targetName:n})}catch(e){Ye(e)||(s(`page`,`failed to create live session`,{error:e instanceof Error?e.message:String(e),targetName:n}),u.error(e instanceof Error?e.message:`Failed to start live session`)),t?.replaceCurrentSession||j(!1)}finally{g.current===r&&(g.current=null),N(!1)}},[b,Ee,_e,U]),Q=(0,p.useCallback)(async()=>{if(!It){if(!V){u.error(`Fix YAML errors before starting live mode`);return}await Z(V)}},[V,Z,It]),Ht=(0,p.useCallback)(async()=>{if(G){if(!V){u.error(`Fix YAML errors before restarting live mode`);return}await Z(V,{replaceCurrentSession:!0})}},[V,G,Z]),$=(0,p.useCallback)(async()=>{if(!K){xt([]);return}try{xt((await Fe({target:K})).authStates)}catch{xt([])}},[K]);(0,p.useEffect)(()=>{$()},[$]);let Ut=(0,p.useCallback)(async e=>{if(!E||!K)throw Error(`Could not save auth state "${e.name}" for target "${K??`selected target`}".`);let t=`Could not save auth state "${e.name}" for target "${K}".`;Ct(!0);try{await De(E,{name:e.name,replace:e.replace}),u.success(`Saved auth state "${e.name}" for target "${K}".`),await $()}catch{throw Error(t)}finally{Ct(!1)}},[K,E,$]),Wt=(0,p.useCallback)(e=>{if(e){j(!0);return}X()},[X]),Gt=(0,p.useCallback)((e,t)=>{if(!G){u.error(`Start a live session first.`);return}let n=(e===`setup`?H.setupHooks:H.teardownHooks).find(e=>e.id===t);n&&L({type:`suite-hook`,phase:e,hookId:n.id}),I(`reasoning`),H.executeHookById(e,t)},[G,H]),Kt=(0,p.useCallback)(e=>{L({type:`test`,testIndex:e}),I(`reasoning`),H.executeTestByIndex(e,J)},[J,H]);if((0,p.useEffect)(()=>()=>{g.current?.abort(),_.current&&Qe.current()},[]),(0,p.useEffect)(()=>{E&&W===`disconnected`&&(s(`page`,`live session moved to terminal state`,{liveSessionId:E,liveConnectionState:W}),D(null),k(null),N(!1),F(`disconnected`),L(null),v.current=null,y.current=null,z({setup:[],teardown:[]}),j(!0))},[W,E]),(0,p.useEffect)(()=>{if(!A||H.runningTestIndex===null)return;let e=`${H.tests[H.runningTestIndex]?.testExecutionId??`pending`}:${H.runningTestIndex}`;v.current!==e&&(v.current=e,L({type:`test`,testIndex:H.runningTestIndex}),I(`reasoning`))},[H.runningTestIndex,H.tests,A]),(0,p.useEffect)(()=>{if(!A||H.runningTestIndex!==null)return;let e=H.tests.map((e,t)=>({index:t,test:e})).filter(({test:e})=>e.status===`failed`).sort((e,t)=>(t.test.lastRunAt??``).localeCompare(e.test.lastRunAt??``))[0];if(!e)return;let t=e.test.testExecutionId??e.test.lastRunAt??`failed:${e.index}`;y.current!==t&&(y.current=t,L({type:`test`,testIndex:e.index}),I(`reasoning`))},[H.runningTestIndex,H.tests,A]),(0,p.useEffect)(()=>{!Ze||$e.current||h||C||w||M||A||G||!V||!V.target.trim()||($e.current=!0,c(d.suiteEdit(e),{replace:!0}),Q())},[V,Q,G,h,M,C,A,c,w,e,Ze]),Ve((0,p.useMemo)(()=>({r:()=>{h||zt(pe===`local`)},escape:()=>{T&&Bt()}}),[h,T,zt,Bt,pe])),(0,p.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),Y())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Y]),C)return(0,m.jsx)(je,{});if(w)return(0,m.jsx)(Be,{icon:xe,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>c(d.suites)});let qt=(0,m.jsxs)(le,{defaultValue:`builder`,className:`flex-1 flex min-h-0 flex-col`,children:[(0,m.jsxs)(ce,{variant:`line`,className:`px-4`,children:[(0,m.jsx)(oe,{value:`builder`,children:`Builder`}),(0,m.jsx)(oe,{value:`yaml`,children:`YAML`})]}),(0,m.jsx)(se,{value:`builder`,className:`mt-2 flex-1 overflow-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground/50 [&::-webkit-scrollbar-track]:bg-transparent [scrollbar-width:thin]`,children:(0,m.jsx)(Ue,{content:b,onChange:x,suggestions:kt,isCreateMode:h,liveMode:A,liveTests:H.tests,liveSetupHooks:H.setupHooks,liveTeardownHooks:H.teardownHooks,runningTestIndex:H.runningTestIndex,canRunTest:G&&H.connectionState===`connected`,canRunAll:Pt,isRunningAll:H.isRunningAllTests,isStoppingRunAll:H.isStoppingRunAllTests,onRunTest:Kt,onCancelTest:e=>{H.runningTestIndex===e&&H.cancelStep()},onRunAll:()=>void H.runAllTests(J),onStopAll:H.cancelRunAllTests,setupHooksStale:q,onRestartSession:q?()=>void Ht():void 0,selection:yt,onSelect:L,onRunLiveHook:Gt})}),(0,m.jsx)(se,{value:`yaml`,className:`flex-1 min-h-0 mt-2`,children:(0,m.jsx)(n,{value:b,onChange:x,onSave:Y,className:`h-full`,filePath:B||void 0})})]}),Jt=(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[h&&(0,m.jsx)(`div`,{className:`px-4 pt-3`,children:(0,m.jsxs)(`div`,{className:`rounded-md border bg-muted/15 px-3 py-2`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(ie,{className:`flex items-center gap-1 text-xs font-medium`,children:[`File Path `,(0,m.jsx)(Xe,{text:`Path is relative to your workspace root. Must match your workspace's suiteMatch pattern. Directories are created automatically on save.`})]}),(0,m.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Created only when you save`})]}),(0,m.jsx)(Se,{placeholder:`my-suite.suite.yaml`,value:S,onChange:e=>nt(e.target.value),className:`mt-2 max-w-md h-8 text-sm font-mono ${Dt?`border-red-500 focus-visible:ring-red-500`:``}`}),Dt&&(0,m.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:Et})]})}),qt]}),Yt=(0,m.jsx)(re,{connectionState:H.connectionState,isLaunching:M,targetName:Mt||`Selected Target`,targetLabel:H.currentUrl||`Configured start URL`,liveSessionNumber:O,platform:H.platform,screenshot:H.screenshot,currentUrl:H.currentUrl,pendingNavigation:H.pendingNavigation,steps:H.steps,setupHooks:H.setupHooks,teardownHooks:H.teardownHooks,tests:H.tests,selection:yt,runningStepId:H.runningStepId,terminalState:Lt,draftState:V===null?`invalid`:Tt||h?`unsaved`:`saved`,ariaTree:H.ariaTree,errorMessage:H.error,devtoolsTab:vt,canRunAll:Pt,isRunningAll:H.isRunningAllTests,isStoppingRunAll:H.isStoppingRunAllTests,setupHooksStale:q,executionUnit:`test`,runAllLabel:`Run All Tests`,stopAllLabel:`Stop Run All`,unitRowsSlot:null,onDevtoolsTabChange:I,onRunAll:()=>void H.runAllTests(J),onStopAll:H.cancelRunAllTests,onEndSession:Vt,onRestartSession:q?()=>void Ht():void 0,showEndSessionAction:l,onCloseLiveMode:X,onStartFreshSession:()=>void Q(),onBack:H.goBack,onForward:H.goForward,onRefresh:H.refreshPage,onNavigate:H.navigate,onRequestAriaTree:H.requestAriaTree,authStateCapture:K&&E?{sessionId:E,targetName:K,initialName:Nt,authStates:bt,isSaving:St,onSave:Ut}:null});return(0,m.jsxs)(`div`,{className:`flex h-screen flex-col`,children:[(0,m.jsx)(Ge,{suiteName:jt,suiteId:At,unsaved:Tt,isCreateMode:h,mode:`edit`,suiteHref:h?void 0:d.suiteView(e),isSaving:at,isValidating:st,isRunning:lt,runDisabled:Ft,hasInvalidFilename:Dt,shortcutsOpen:mt,hasLiveSession:G,liveConnectionState:W,isLiveActionDisabled:It,liveSessionNumber:O,onBack:()=>c(d.suites),onSave:Y,onValidate:Rt,onRun:zt,onLiveConnect:A?void 0:Q,onLiveEnd:G?Vt:void 0,onSettingsOpen:()=>pt(!0),onToggleShortcuts:()=>ht(e=>!e)}),T?(0,m.jsxs)(Re,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,m.jsx)(f,{defaultSize:60,minSize:30,children:(0,m.jsx)(n,{value:b,onChange:x,onSave:Y,className:`h-full`})}),(0,m.jsx)(ze,{withHandle:!0}),(0,m.jsx)(f,{defaultSize:40,minSize:25,children:(0,m.jsx)(a,{runId:T,onClose:Bt})})]}):A&&!l?(0,m.jsxs)(Re,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,m.jsx)(f,{defaultSize:45,minSize:30,children:Jt}),(0,m.jsx)(ze,{withHandle:!0}),(0,m.jsx)(f,{defaultSize:55,minSize:40,children:Yt})]}):Jt,(0,m.jsx)(fe,{open:ft,onOpenChange:pt,children:(0,m.jsxs)(me,{side:`right`,className:`sm:max-w-[400px] overflow-y-auto p-0`,children:[(0,m.jsxs)(ve,{className:`px-4 pt-4 pb-2`,children:[(0,m.jsx)(Ie,{children:`Suite Settings`}),(0,m.jsx)(ge,{children:`Advanced configuration for this suite`})]}),(0,m.jsx)(`div`,{className:`px-4 pb-4`,children:(0,m.jsx)(te,{content:b,onChange:x,selectedTarget:V?.target,showMeta:!1})})]})}),l&&(0,m.jsx)(fe,{open:A,onOpenChange:Wt,children:(0,m.jsxs)(me,{side:`bottom`,showCloseButton:!1,className:`h-[100dvh] max-h-[100dvh] rounded-none p-0`,children:[(0,m.jsxs)(ve,{className:`sr-only`,children:[(0,m.jsx)(Ie,{children:`Live Session`}),(0,m.jsx)(ge,{children:`Live execution workspace for the current suite draft.`})]}),Yt]})})]})}export{h as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{i as t,n,o as r,s as i,t as a}from"./select-DF8sGWfv.js";import{t as o}from"./circle-alert-TPWM0719.js";import{C as s,S as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,h as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as ee,y as te}from"./id-badge-CIlIhfqv.js";import{n as ne,r as O}from"./monaco-editor-q3UYuc-5.js";import{t as re}from"./circle-x-ITZ_DbXH.js";import{i as ie,t as k}from"./split-button-BKCtgFiC.js";import{t as A}from"./grip-vertical-MY-i_r9J.js";import{n as j,r as M,t as N}from"./shortcut-hints-CUbl8p3Z.js";import{t as ae}from"./plus-DWwmmJlz.js";import{t as P}from"./refresh-cw-BtT1wl9S.js";import{n as F,t as I}from"./textarea-wN2tIsDn.js";import{t as oe}from"./square-CEW9RAjr.js";import{a as L,n as R}from"./dist-_gv57K8d.js";import{n as z,r as B,t as V}from"./popover-CuqW26_E.js";import{A as H,Bt as se,Er as ce,Ft as le,Gt as U,H as W,Ht as ue,It as G,Kn as de,Kt as fe,Lt as pe,N as K,U as q,V as J,Vt as me,br as Y,c as he,d as ge,en as _e,j as X,l as ve,o as ye,s as be,u as xe}from"./index-CWwAjH9Q.js";import{t as Se}from"./badge-DHCU59H0.js";import{t as Ce}from"./display-step-CYKXUkbs.js";var Z=e(ce(),1),Q=_e();function we({text:e}){return(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(ue,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,Q.jsx)(X,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Te({name:e,suiteId:o,target:c,context:l,isCreateMode:d,suggestions:p,hookLabels:m={},onChange:h,disabled:g=!1}){let{targets:v,isLoading:y}=_(),{targets:x}=f(),S=c?x[c]:void 0,w=(0,Z.useRef)(null),[T,E]=(0,Z.useState)(0),D=u({text:l,cursorPos:T,suggestions:p,anchorRef:w,onInsert:(e,t,n)=>{h(`context`,l.slice(0,t)+e+l.slice(n)),requestAnimationFrame(()=>w.current?.focus())}}),ee=!y&&v.length>0;return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(L,{htmlFor:`suite-name`,className:`text-xs flex items-center gap-1`,children:[`Suite Name `,(0,Q.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,Q.jsx)(J,{id:`suite-name`,value:e,onChange:e=>h(`name`,e.target.value),placeholder:`My Suite`,required:!0,disabled:g,className:`h-8 text-sm`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(L,{htmlFor:`suite-id`,className:`text-xs flex items-center gap-1`,children:[`Suite ID `,(0,Q.jsx)(we,{text:`Unique identifier used for memory and analytics. Changing this breaks the association with past runs and observations.`})]}),d?(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(J,{id:`suite-id`,value:o,readOnly:!0,disabled:!0,className:`h-8 text-sm font-mono pr-9`}),(0,Q.jsx)(W,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>h(`suite-id`,R()),"aria-label":`Generate new ID`,disabled:g,className:`absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6`,children:(0,Q.jsx)(P,{className:`size-3.5`})})]}):(0,Q.jsx)(`p`,{className:`text-[13px] font-mono text-muted-foreground`,children:o||`No ID assigned`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(L,{htmlFor:`suite-target`,className:`text-xs flex items-center gap-1`,children:[`Target `,(0,Q.jsx)(`span`,{className:`text-destructive`,children:`*`}),` `,(0,Q.jsx)(we,{text:`A registered app target from your workspace config. Defines where the suite runs (web URL or mobile app).`})]}),ee?(0,Q.jsxs)(a,{value:c||void 0,onValueChange:e=>h(`target`,e),disabled:g,children:[(0,Q.jsx)(r,{id:`suite-target`,className:`w-full h-8 text-sm`,children:(0,Q.jsx)(i,{placeholder:`Select a target`})}),(0,Q.jsx)(n,{children:v.map(e=>(0,Q.jsx)(t,{value:e,children:e},e))})]}):y?null:(0,Q.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No targets configured.`,` `,(0,Q.jsx)(Y,{to:`/config`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Add targets in Settings.`})]}),S&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted-foreground mt-1.5`,children:[S.platform===`web`?(0,Q.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0`}):(0,Q.jsx)(s,{className:`h-3.5 w-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`text-muted-foreground/70 uppercase text-[11px] tracking-wider shrink-0`,children:S.platform}),(0,Q.jsxs)(`span`,{className:`font-mono truncate`,children:[S.product&&(0,Q.jsx)(`span`,{className:`mr-1.5`,children:S.product}),S.platform===`web`&&S.url,S.platform===`android`&&`${S.appPackage}${S.appActivity?` / ${S.appActivity}`:``}`,S.platform===`ios`&&S.bundleId]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(L,{htmlFor:`suite-context`,className:`text-xs flex items-center gap-1`,children:[`Context `,(0,Q.jsx)(we,{text:`Additional instructions passed to every test in this suite before its own context. Use this for suite-wide setup notes or shared preconditions.`})]}),(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(I,{ref:w,id:`suite-context`,value:l,onChange:e=>{h(`context`,e.target.value),E(e.target.selectionStart??0)},onKeyDown:e=>{D.handleKeyDown(e)},onBlur:()=>setTimeout(()=>D.setVisible(!1),150),placeholder:`Additional instructions applied to every test in this suite...`,disabled:g,className:`min-h-[60px] resize-none text-sm`,rows:2}),D.dropdown]}),C(l)&&(0,Q.jsx)(b,{text:l,hookLabels:m})]})]})}function Ee(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function De({status:e}){switch(e){case`running`:return(0,Q.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,Q.jsx)(U,{className:`size-3 text-emerald-500`});case`failed`:return(0,Q.jsx)(pe,{className:`size-3 text-destructive`});default:return(0,Q.jsx)(G,{className:`size-3 text-muted-foreground`})}}function Oe({status:e}){switch(e){case`running`:case`cancelling`:return(0,Q.jsx)(D,{className:`size-3 text-primary`});case`passed`:return(0,Q.jsx)(U,{className:`size-3 text-emerald-500`});case`failed`:return(0,Q.jsx)(re,{className:`size-3 text-red-500`});case`cancelled`:return(0,Q.jsx)(oe,{className:`size-3 text-amber-500`});default:return(0,Q.jsx)(D,{className:`size-3 text-muted-foreground/50`})}}function ke(e){return e.observation?e.observation:e.reasoning?e.reasoning:e.plannedAction==null?e.verifierReasoning?e.verifierReasoning:e.result:`Planned action captured`}function Ae({id:e,name:t,path:n,testId:r,isMissing:i,onRemove:a,disabled:o=!1,actionsLocked:s=!1,sortableDisabled:l=!1,liveMode:u=!1,liveStatus:d=`idle`,liveDuration:f,liveError:p=null,liveSteps:m=[],runningStepIndex:h=null,perTestSetupHooks:g=[],perTestTeardownHooks:_=[],canRunTest:y=!0,onRunTest:b,onCancelTest:x,testIndex:S,selection:C=null,onSelect:w}){let{attributes:T,listeners:E,setNodeRef:ee,transform:te,transition:ne,isDragging:O}=v({id:e,disabled:o||l}),ie={transform:c.Transform.toString(te),transition:ne,opacity:O?.55:1,zIndex:O?10:void 0},k=u&&d===`running`,j=u&&d===`passed`,M=u&&d===`failed`,N=u&&(j||M||u&&d===`cancelled`)&&f!=null,ae=u&&C?.type===`test`&&S!==void 0&&C.testIndex===S,P=u&&g.length+_.length>0,F=u?m.map(e=>({step:e,displayStep:Ce(e,e.stepIndex)})):[],I=C&&`stepId`in C?C.stepId:null,L=C?.type===`subaction`?C.subIndex:null;return(0,Q.jsxs)(`div`,{ref:ee,style:ie,className:q(`relative overflow-hidden flex flex-col gap-0.5 rounded-md border bg-card/60 px-3 py-2 hover:bg-card transition-colors`,i&&`border-amber-500/30`,i&&`bg-amber-500/[0.06]`,!i&&`border-border/70`,O&&`shadow-lg ring-2 ring-primary/20`,o&&`opacity-60`,k&&`live-running-surface border-border/60 bg-primary/5`,M&&!k&&`border-destructive/30`,M&&!k&&!ae&&`ring-1 ring-destructive/20`,ae&&!k&&`bg-primary/10 ring-1 ring-primary/30`),children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`mt-0.5 flex shrink-0 items-center p-0.5 text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing touch-none disabled:cursor-not-allowed`,...T,...E,"aria-label":`Reorder ${t}`,"aria-disabled":o||l,disabled:o||l,children:(0,Q.jsx)(A,{className:`size-3.5`})}),k&&(0,Q.jsx)(D,{className:`size-4 shrink-0 mt-0.5 text-primary`}),j&&(0,Q.jsx)(U,{className:`size-3.5 text-emerald-500 shrink-0 mt-1`}),M&&(0,Q.jsx)(re,{className:`size-3.5 text-red-500 shrink-0 mt-1`}),(0,Q.jsxs)(`div`,{className:q(`flex-1 min-w-0 space-y-0.5`,u&&w&&`cursor-pointer`),onClick:u&&w&&S!==void 0?()=>w({type:`test`,testIndex:S}):void 0,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-foreground truncate`,children:t}),(0,Q.jsx)(`div`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:n}),(0,Q.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:r}),F.length>0&&(0,Q.jsx)(`div`,{className:`mt-1.5 space-y-1.5`,children:F.map(({step:e,displayStep:t},n)=>{let r=e.status===`running`||h===e.stepIndex,i=ae&&I===null&&(r||h===null&&n===F.length-1),a=I===e.id||i,o=t.subActionsData??[];return(0,Q.jsxs)(`div`,{className:q(`relative overflow-hidden rounded-sm border bg-background/60`,r?`live-running-surface border-border/60 bg-primary/5`:a?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60`),children:[(0,Q.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left`,onClick:t=>{t.stopPropagation(),w?.({type:`step`,stepId:e.id})},"aria-label":`Select step ${e.stepIndex+1} ${e.instruction}`,children:[(0,Q.jsx)(Oe,{status:e.status}),(0,Q.jsxs)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[`Step `,e.stepIndex+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:e.instruction})]}),(r||a)&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5 px-2 pb-1 text-[11px] text-muted-foreground`,children:[r&&(0,Q.jsx)(`span`,{children:`Current step`}),a&&(0,Q.jsx)(`span`,{children:`Inspecting below`})]}),o.length>0&&(0,Q.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-2 py-1.5`,children:o.map(t=>(0,Q.jsxs)(`button`,{type:`button`,className:q(`flex w-full min-w-0 items-center gap-2 rounded-sm px-1.5 py-1 text-left text-[11px] transition-colors`,a&&L===t.index?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-muted/40`),onClick:n=>{n.stopPropagation(),w?.({type:`subaction`,stepId:e.id,subIndex:t.index})},"aria-label":`Select sub-action ${t.index+1} for step ${e.stepIndex+1}`,children:[(0,Q.jsxs)(`span`,{className:`shrink-0 font-medium`,children:[`Sub `,t.index+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ke(t)})]},`${e.id}-sub-${t.index}`))})]},e.id)})}),i&&(0,Q.jsx)(`div`,{className:`text-[11px] text-amber-700 dark:text-amber-300`,children:`This test file no longer exists in your workspace.`})]}),(0,Q.jsxs)(`div`,{className:`mt-0.5 flex shrink-0 self-start items-center gap-1`,children:[N&&(0,Q.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground whitespace-nowrap shrink-0`,children:Ee(f)}),u&&!k&&(0,Q.jsx)(W,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:b,disabled:!y||!b||s,className:q(`text-muted-foreground hover:text-foreground`,(!y||!b||s)&&`text-muted-foreground/30`),"aria-label":d===`idle`?`Run test ${t}`:`Re-run test ${t}`,children:(0,Q.jsx)(se,{className:`size-3.5`})}),u&&k&&x&&(0,Q.jsx)(W,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:x,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Cancel test ${t}`,children:(0,Q.jsx)(oe,{className:`size-3`})}),(0,Q.jsx)(W,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-destructive`,onClick:a,disabled:o||s,"aria-label":`Remove ${t}`,children:(0,Q.jsx)(le,{className:`size-3.5`})})]})]}),M&&p&&(0,Q.jsxs)(`p`,{className:`text-destructive text-xs mt-1 ml-7 line-clamp-2`,children:[p,` — see Reasoning tab for details`]}),P&&(0,Q.jsxs)(`ul`,{className:`mt-1.5 space-y-1 pl-5`,children:[g.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`setup`,hookId:e.id}),className:q(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,Q.jsx)(G,{className:`size-3 text-muted-foreground shrink-0`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`setup: `,e.name]}),(0,Q.jsx)(De,{status:e.status})]})},`setup-${e.id}`)}),_.map(e=>{let t=C?.type===`test-hook`&&C.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>S!==void 0&&w?.({type:`test-hook`,testIndex:S,phase:`teardown`,hookId:e.id}),className:q(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,Q.jsx)(G,{className:`size-3 text-muted-foreground shrink-0`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`teardown: `,e.name]}),(0,Q.jsx)(De,{status:e.status})]})},`teardown-${e.id}`)})]})]})}function je({availableTests:e,onAdd:t,disabled:n=!1}){return e.length===0?(0,Q.jsxs)(`div`,{className:`rounded-md border bg-card/20 p-3 text-sm text-muted-foreground`,children:[`No test files found.`,` `,(0,Q.jsx)(Y,{to:`/tests/new`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Create a test first.`})]}):(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsxs)(ye,{className:`rounded-md border`,children:[(0,Q.jsx)(ve,{placeholder:`Search by test name, path, or ID...`,disabled:n}),(0,Q.jsxs)(ge,{className:`max-h-64`,children:[(0,Q.jsx)(be,{children:`No tests match your query.`}),(0,Q.jsx)(he,{children:e.map(e=>(0,Q.jsx)(xe,{value:`${e.name} ${e.path} ${e.testId??``}`,onSelect:()=>t({test:e.path,id:e.testId??``}),disabled:n,className:`px-2 py-1.5`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5 w-full min-w-0`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:e.path}),(0,Q.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:e.testId??``})]})},e.path))})]})]}),(0,Q.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60`,children:`Type to filter by name, path, or test ID. Click to add. Same test can be added multiple times.`})]})}var Me=[`name`,`suite-id`,`target`,`use`,`context`,`setup`,`tests`,`teardown`];function Ne(e){function t(e,n){if(S(e)){n?e.items.sort((e,t)=>{let n=Me.indexOf(String(e.key)),r=Me.indexOf(String(t.key));return(n===-1?Me.length:n)-(r===-1?Me.length:r)}):e.items.sort((e,t)=>String(e.key).localeCompare(String(t.key)));for(let n of e.items)t(n.value,!1)}}t(e.contents,!0)}function Pe(e){return Ne(e),e.toString()}function Fe(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Ie(e){return Array.isArray(e)?e.map(e=>{if(e&&typeof e==`object`&&`test`in e&&`id`in e){let t=e;if(typeof t.test==`string`&&typeof t.id==`string`)return{test:t.test,id:t.id}}return null}).filter(e=>e!==null):[]}function Le(e){try{let t=y(e);if(t.errors.length>0)return null;let n=t.toJSON();return!n||typeof n!=`object`?null:{name:n.name??``,suiteId:n[`suite-id`]??``,target:n.target??``,context:n.context??``,setup:Fe(n.setup),teardown:Fe(n.teardown),tests:Ie(n.tests)}}catch{return null}}function Re(e,t,n){try{let r=y(e);return n===void 0||Array.isArray(n)&&n.length===0||n===``?r.deleteIn(t):r.setIn(t,n),Pe(r)}catch{return e}}function ze(e,t,n){try{if(t===n||t<0||n<0)return e;let r=y(e),i=Ie(r.toJSON()?.tests);if(t>=i.length||n>=i.length)return e;let a=[...i],[o]=a.splice(t,1);return a.splice(n,0,o),r.setIn([`tests`],a),Pe(r)}catch{return e}}function Be(e,t){try{let n=y(e),r=Ie(n.toJSON()?.tests);return n.setIn([`tests`],[...r,t]),Pe(n)}catch{return e}}function Ve(e,t){try{let n=y(e),r=Ie(n.toJSON()?.tests);if(t<0||t>=r.length)return e;let i=r.filter((e,n)=>n!==t);return i.length===0?n.deleteIn([`tests`]):n.setIn([`tests`],i),Pe(n)}catch{return e}}function He({text:e}){return(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(ue,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,Q.jsx)(X,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Ue({status:e}){switch(e){case`running`:return(0,Q.jsx)(D,{className:`size-3.5 text-primary`});case`passed`:return(0,Q.jsx)(U,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,Q.jsx)(pe,{className:`size-3.5 text-destructive`});default:return(0,Q.jsx)(G,{className:`size-3.5 text-muted-foreground`})}}function We(e){return e===`running`||e===`cancelling`}function Ge(e){return e===`running`||e===`cancelling`}function Ke(e){return e===`running`}function $(e){return e.some(e=>Ke(e.status))}function qe(e){return We(e.status)||e.runningStepIndex!==null||e.liveSteps.some(e=>Ge(e.status))||$(e.perTestSetupHooks)||$(e.perTestTeardownHooks)}function Je({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted-foreground`,children:e}),(0,Q.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>{let t=n?.type===`suite-hook`&&n.hookId===e.id;return(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>r?.({type:`suite-hook`,phase:e.phase,hookId:e.id}),className:q(`relative flex w-full items-center gap-2 overflow-hidden rounded-md border px-3 py-1.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60 bg-card/40 hover:bg-card/60`),children:[(0,Q.jsx)(Ue,{status:e.status}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm`,children:e.name}),(0,Q.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id})]})]})},e.id)})})]})}function Ye({content:e,onChange:t,disabled:n=!1,suggestions:r,isCreateMode:i=!1,liveMode:a=!1,liveTests:s=[],liveSetupHooks:c=[],liveTeardownHooks:u=[],runningTestIndex:f=null,canRunTest:_=!0,canRunAll:v=!1,isRunningAll:y=!1,isStoppingRunAll:b=!1,onRunTest:S,onCancelTest:C,onRunAll:w,onStopAll:D,onRunLiveHook:ne,setupHooksStale:re=!1,onRestartSession:ie,selection:k=null,onSelect:A}){let j=(0,Z.useRef)(null),{hooks:M,warningCopy:N}=T(),P=M??[],F=(0,Z.useMemo)(()=>Object.fromEntries(P.map(e=>[e.id,e.name])),[P]),[I,L]=(0,Z.useState)([]),[R,z]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{de().then(e=>L(e.files)).catch(()=>{})},[]),(0,Z.useEffect)(()=>{if(!R)return;function e(e){e.key===`Escape`&&z(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[R]);let B=Le(e),V=B===null,H=B??j.current;B&&(j.current=B);let se=ee(d(E,{activationConstraint:{distance:8}}),d(l,{coordinateGetter:x})),ce=(0,Z.useCallback)((n,r)=>{t(Re(e,[n],r))},[e,t]),le=(0,Z.useCallback)(n=>{t(Be(e,n))},[e,t]),U=(0,Z.useCallback)(n=>{t(Ve(e,n))},[e,t]),ue=H?.tests.map((e,t)=>`test-${t}`)??[],fe=a&&(y||b),K=a&&(f!==null||s.some(e=>qe(e))||$(c)||$(u)),q=fe||K,J=fe,Y=n||V||q,he=(0,Z.useCallback)(r=>{if(n||V||q)return;let{active:i,over:a}=r;if(!a||i.id===a.id)return;let o=parseInt(String(i.id).replace(`test-`,``),10),s=parseInt(String(a.id).replace(`test-`,``),10);if(Number.isNaN(o)||Number.isNaN(s))return;let c=ze(e,o,s);c!==e&&t(c)},[e,n,t,q,V]);return(0,Q.jsx)(`div`,{className:`flex flex-col`,children:(0,Q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[V&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:[(0,Q.jsx)(o,{className:`size-4 shrink-0`}),(0,Q.jsx)(`span`,{children:`YAML has errors — builder shows last valid state`})]}),a&&re&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[(0,Q.jsx)(pe,{className:`mt-0.5 size-4 shrink-0`}),(0,Q.jsx)(`span`,{children:`Setup hooks changed — restart session to re-apply the latest setup and teardown hooks.`})]}),ie&&(0,Q.jsx)(W,{type:`button`,size:`sm`,className:`shrink-0`,onClick:ie,children:`Restart Live Session`})]}),H?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Te,{name:H.name,suiteId:H.suiteId,target:H.target,context:H.context,isCreateMode:i,suggestions:r,hookLabels:F,onChange:ce,disabled:n||V}),a&&(0,Q.jsx)(Je,{title:`Setup Hooks (Live)`,hooks:c,selection:k,onSelect:A}),(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-card/20 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(G,{className:`size-4 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Hooks`})]}),(0,Q.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[H.setup.length+H.teardown.length,` `,H.setup.length+H.teardown.length===1?`hook`:`hooks`]})]}),N&&(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,Q.jsx)(o,{className:`mt-0.5 size-3.5 shrink-0`}),(0,Q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Q.jsx)(`p`,{className:`font-medium`,children:N.title}),(0,Q.jsx)(`p`,{children:N.body})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Search hook names or paste an h_ ID. Saved as stable ID in YAML. Inline runHook uses the stable hook ID.`}),(0,Q.jsx)(p,{phase:`setup`,label:`Setup`,values:H.setup,suggestions:P,disabled:Y,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>ce(`setup`,e)}),(0,Q.jsx)(p,{phase:`teardown`,label:`Teardown`,values:H.teardown,suggestions:P,disabled:Y,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>ce(`teardown`,e)})]})]}),a&&(0,Q.jsx)(Je,{title:`Teardown Hooks (Live)`,hooks:u,selection:k,onSelect:A}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1`,children:[`Tests in Suite`,` `,(0,Q.jsx)(He,{text:`Tests run in the order shown. Drag to reorder. The suite fails fast if any referenced test is missing at save.`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[H.tests.length,` `,H.tests.length===1?`test`:`tests`]}),a&&(0,Q.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:y?D:w,disabled:b||!y&&!v,children:b?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(me,{className:`size-3.5 animate-spin`}),`Stopping...`]}):y?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(oe,{className:`size-3.5`}),`Stop Run All`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(O,{className:`size-3.5`}),`Run All Tests`]})})]})]}),H.tests.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tests added yet. Use the picker below.`}):(0,Q.jsx)(h,{sensors:se,collisionDetection:te,onDragEnd:he,children:(0,Q.jsx)(m,{items:ue,strategy:g,children:(0,Q.jsx)(`div`,{className:`space-y-1.5`,children:H.tests.map((e,t)=>{let r=I.find(t=>t.path===e.test),i=r?.name??e.test.split(`/`).pop()??e.test,o=I.length>0&&!r,c=a?s[t]:void 0,l=a?_&&f===null&&!J:!0;return(0,Q.jsx)(Ae,{id:`test-${t}`,name:i,path:e.test,testId:e.id,isMissing:o,onRemove:()=>U(t),disabled:n||V,actionsLocked:J,sortableDisabled:q,liveMode:a,liveStatus:c?.status,liveDuration:c?.duration,liveError:c?.error??null,liveSteps:c?.liveSteps??[],runningStepIndex:c?.runningStepIndex??null,perTestSetupHooks:c?.perTestSetupHooks??[],perTestTeardownHooks:c?.perTestTeardownHooks??[],canRunTest:l,onRunTest:a&&S?()=>S(t):void 0,onCancelTest:a&&C?()=>C(t):void 0,testIndex:t,selection:k,onSelect:A},`test-${t}`)})})})})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Available Tests`}),(0,Q.jsxs)(W,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>z(e=>!e),disabled:n||V||J,"aria-expanded":R,"aria-controls":`suite-test-picker-region`,children:[(0,Q.jsx)(ae,{className:`size-3`}),R?`Hide picker`:`Add new test`]})]}),R&&(0,Q.jsx)(`div`,{id:`suite-test-picker-region`,children:(0,Q.jsx)(je,{availableTests:I,onAdd:le,disabled:n||V||J})})]})]}):(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Enter valid YAML to use the visual builder`})]})})}function Xe({suiteName:e,suiteId:t,unsaved:n,isCreateMode:r,mode:i=`view`,suiteHref:a,isSaving:o,isValidating:s,isRunning:c,runDisabled:l=!1,hasInvalidFilename:u,shortcutsOpen:d,showSuiteId:f=!0,hasLiveSession:p=!1,liveConnectionState:m=`idle`,isLiveActionDisabled:h=!1,liveSessionNumber:g=null,onSave:_,onValidate:v,onRun:y,onLiveConnect:b,onLiveEnd:x,onSettingsOpen:S,onToggleShortcuts:C}){let T=i===`view`&&!r,E=!!b||!!x||p||m===`connecting`,D=!r||E,ee=!r&&!T&&i===`edit`,te=`Start a disposable live session for this suite. Setup hooks run on connect, included tests run serially on a shared browser context, teardown hooks run when the session ends, and changes are not saved automatically.`;return(0,Q.jsxs)(`div`,{"data-testid":`suite-navbar-root`,className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(Y,{to:`/suites`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Suites`}),(0,Q.jsx)(fe,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),r?(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`New Suite`}):a&&!T?(0,Q.jsx)(Y,{to:a,className:`truncate text-sm font-medium hover:text-primary transition-colors`,children:e}):(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e}),ee&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(fe,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`Edit`})]}),n&&(0,Q.jsx)(Se,{variant:`outline`,className:`text-xs`,children:`Unsaved`}),!T&&!r&&t&&f&&(0,Q.jsx)(w,{label:`S`,value:t})]}),(0,Q.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:T?(0,Q.jsxs)(Q.Fragment,{children:[a?(0,Q.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Q.jsxs)(Y,{to:a,children:[`Edit`,(0,Q.jsx)(N,{shortcut:`E`})]})}):(0,Q.jsxs)(W,{variant:`outline`,size:`sm`,disabled:!0,children:[`Edit`,(0,Q.jsx)(N,{shortcut:`E`})]}),(0,Q.jsx)(k,{onRun:y,disabled:c||l,label:c?`Running...`:`Run`,shortcutKey:`R`,size:`sm`}),E&&(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsxs)(W,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,Q.jsx)(me,{className:`h-3.5 w-3.5 animate-spin`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`,(0,Q.jsx)(N,{shortcut:`L`,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`})]})}),(0,Q.jsx)(X,{className:`max-w-sm text-[13px]`,children:te})]}),!r&&(0,Q.jsxs)(V,{open:d,onOpenChange:e=>{e||C()},children:[(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(B,{asChild:!0,children:(0,Q.jsx)(W,{variant:`ghost`,size:`icon-sm`,onClick:C,"aria-label":`Shortcuts`,children:(0,Q.jsx)(M,{className:`h-3.5 w-3.5`})})})}),(0,Q.jsx)(X,{children:`Shortcuts`})]}),(0,Q.jsx)(z,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(j,{hints:[{key:`E`,label:`Edit`},{key:`R`,label:`Run`},{key:`L`,label:`Connect Live Session`}]})]})})})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(W,{variant:`ghost`,size:`sm`,onClick:v,disabled:s||u,children:[(0,Q.jsx)(U,{className:`h-3.5 w-3.5`}),s?`Validating...`:`Validate`]}),(0,Q.jsxs)(W,{variant:`ghost`,size:`sm`,onClick:_,disabled:o||u,children:[(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),o?`Saving...`:`Save`]}),(0,Q.jsxs)(W,{variant:`ghost`,size:`sm`,onClick:S,children:[(0,Q.jsx)(F,{className:`h-3.5 w-3.5`}),`Settings`]}),D&&(0,Q.jsx)(`div`,{className:`h-4 w-px bg-border`}),!r&&(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(`span`,{className:`inline-flex`,children:(0,Q.jsx)(k,{onRun:y,disabled:c||l||p,label:c?`Running...`:`Run Suite`,size:`sm`})})}),p&&(0,Q.jsx)(X,{children:`End the live session to queue a new suite run.`})]}),E&&(p&&m!==`connecting`?(0,Q.jsxs)(W,{variant:`destructive`,size:`sm`,onClick:x,disabled:!x,children:[(0,Q.jsx)(oe,{className:`h-3.5 w-3.5`}),`End Live Session`]}):(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsxs)(W,{size:`sm`,onClick:b,disabled:h||!b,children:[m===`connecting`?(0,Q.jsx)(me,{className:`h-3.5 w-3.5 animate-spin`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`}),m===`connecting`?`Connecting...`:`Connect Live Session`]})}),(0,Q.jsx)(X,{className:`max-w-sm text-[13px]`,children:te})]})),!T&&p&&typeof g==`number`&&(m===`connected`||m===`executing`)&&(0,Q.jsxs)(Se,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,g]}),!r&&(0,Q.jsxs)(V,{open:d,onOpenChange:e=>{e||C()},children:[(0,Q.jsxs)(H,{children:[(0,Q.jsx)(K,{asChild:!0,children:(0,Q.jsx)(B,{asChild:!0,children:(0,Q.jsx)(W,{variant:`ghost`,size:`icon-sm`,onClick:C,children:(0,Q.jsx)(M,{className:`h-3.5 w-3.5`})})})}),(0,Q.jsx)(X,{children:`Shortcuts`})]}),(0,Q.jsx)(z,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,Q.jsx)(`div`,{className:`space-y-3`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(j,{hints:[{key:`R`,label:`Run suite`},{key:`Cmd+S`,label:`Save`},{key:`Esc`,label:`Close results panel`}]})]})})})]})]})})]})}export{Re as i,Ye as n,Le as r,Xe as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-q3UYuc-5.js";import{t as n}from"./file-code-DDa3GwxK.js";import{n as r}from"./split-button-BKCtgFiC.js";import{t as i}from"./zap-CHRkZMyJ.js";import{a,n as o,o as ee,t as s}from"./insights-line-grid-eCcWaGgD.js";import{i as c,n as l,r as u,t as d}from"./tabs-xxRH91gb.js";import{A as f,Bn as te,Cr as ne,Er as p,G as m,H as h,K as g,M as re,N as _,S as v,Sr as ie,Vn as ae,W as y,br as b,en as x,fr as S,ir as oe,j as C,q as w,r as se,xr as ce}from"./index-CWwAjH9Q.js";import{t as T}from"./badge-DHCU59H0.js";import{t as le}from"./use-page-title-C_f72ri7.js";import{a as E,i as D,n as O,o as k,r as A,t as j}from"./table-cLA2Rr2t.js";import{t as ue}from"./empty-state-3cB27tBp.js";import{t as de}from"./use-keyboard-shortcuts-O6nfytzm.js";import{n as fe,t as pe}from"./suite-navbar-D9wliAeW.js";import{n as M,r as me,t as he}from"./viewer-url-state-Dsu1DY22.js";var N=e(p(),1),P=x(),ge=[`builder`,`yaml`,`memory`];function _e(e){let t=e.trim();return t.length>=2&&(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))?t.slice(1,-1).trim():t}function F(e){return{suiteId:e,total:0,flakyScore:0,isFlaky:!1,runs:[],trends:{daily:[],passRate:0,totalRuns:0,avgDuration:0}}}function I(e){if(!e)return``;let t=new Date(w(e)),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:y(e)}function L({status:e}){switch(e){case`passed`:return(0,P.jsx)(T,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,P.jsx)(T,{variant:`destructive`,children:`Failed`});case`healed`:return(0,P.jsx)(T,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,P.jsx)(T,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,P.jsx)(T,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,P.jsx)(T,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,P.jsx)(T,{variant:`outline`,children:e})}}function R({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,P.jsx)(h,{type:`button`,size:`xs`,variant:t===e?`default`:`ghost`,"aria-pressed":t===e,className:`h-7 rounded-[2px] px-2 text-xs`,onClick:()=>i(e),children:e===`scoped`?`Scoped`:`All runs`},e))}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}function z({runs:e,compactDate:t=!1}){return e.length===0?(0,P.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,P.jsxs)(j,{children:[(0,P.jsx)(E,{children:(0,P.jsxs)(k,{children:[(0,P.jsx)(D,{children:`Status`}),(0,P.jsx)(D,{children:`Duration`}),(0,P.jsx)(D,{children:`Date`})]})}),(0,P.jsx)(O,{children:e.map(e=>(0,P.jsxs)(k,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,P.jsxs)(A,{children:[(0,P.jsx)(b,{to:S.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,P.jsx)(L,{status:e.status})]}),(0,P.jsx)(A,{children:e.status===`running`?(0,P.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:g(e.duration)})}),(0,P.jsx)(A,{children:t?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:I(e.createdAt)}):(0,P.jsxs)(f,{children:[(0,P.jsx)(_,{asChild:!0,children:(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:y(e.createdAt)})}),(0,P.jsx)(C,{children:m(e.createdAt)})]})})]},e.id))})]})}function B(){let e=ie(),f=ce(),[p,m]=ne(),{defaultRunMode:h}=r(),_=e[`suite-id`]??``,y=(0,N.useMemo)(()=>he(p,ge),[p]),b=(0,N.useMemo)(()=>M(y,p),[p,y]),x=y.tab,C=y.view,[w,E]=(0,N.useState)(``),[D,O]=(0,N.useState)(``),[k,A]=(0,N.useState)(!0),[j,I]=(0,N.useState)(!1),[L,B]=(0,N.useState)(()=>F(_)),[V,H]=(0,N.useState)(`all`),[U,W]=(0,N.useState)(!1),[ve,ye]=(0,N.useState)(!1),G=(0,N.useMemo)(()=>{let e=w.match(/^name:\s*(.+)$/m);return e?_e(e[1]):null},[w]);le(G||`Suite`);let K=L.scope?.configured===!0,q=V===`scoped`&&K&&L.scopedTrends?L.scopedTrends:L.trends,J=V===`scoped`&&K&&L.scopedFlakyScore!==void 0?L.scopedFlakyScore:L.flakyScore,be=V===`scoped`&&K?L.scopedRuns??[]:L.runs,xe=(0,N.useMemo)(()=>q.daily.map(e=>({date:e.date,passRate:e.total>0?Math.round(e.passed/e.total*1e3)/10:0})),[q]),Se=(0,N.useMemo)(()=>L.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})),[L]),Y=be;(0,N.useEffect)(()=>{H(L.scope?.configured?`scoped`:`all`)},[L]),(0,N.useEffect)(()=>{b.toString()!==p.toString()&&m(b,{replace:!0})},[b,p,m]),(0,N.useEffect)(()=>{if(!_){I(!0),A(!1),B(F(``));return}let e=!1;return A(!0),I(!1),E(``),O(``),B(F(_)),ae(_).then(t=>{e||(E(t.content),O(t.path))}).catch(()=>{e||(I(!0),v.error(`Failed to load suite file`))}).finally(()=>{e||A(!1)}),()=>{e=!0}},[_]),(0,N.useEffect)(()=>{if(!_)return;let e=!1;return te(_,{limit:50}).then(t=>{e||B(t)}).catch(()=>{e||B(F(_))}),()=>{e=!0}},[_]);let X=async e=>{if(!(U||!D)){W(!0);try{let t=await oe({file:D,local:e});v.success(`Run started`),f(S.runLive(t.runId))}catch(e){v.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{W(!1)}}},Z=S.suiteEdit(_),Q=`${Z}?live=1`;de({e:()=>f(Z),r:()=>{D&&X(h===`local`)},l:()=>f(Q)});let $=e=>{m(M(e,p),{replace:!0})};if(k)return(0,P.jsx)(se,{});if(j)return(0,P.jsx)(ue,{icon:n,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>f(S.suites)});let Ce=(0,P.jsx)(fe,{content:w,onChange:()=>{},disabled:!0,suggestions:[]}),we=(0,P.jsx)(t,{value:w,onChange:()=>{},readOnly:!0,className:`h-full`}),Te=(0,P.jsxs)(`aside`,{"data-testid":`suite-detail-analytics-sidebar`,className:`flex flex-col gap-0 overflow-y-auto border-t border-border md:border-t-0 md:border-l md:border-border`,children:[(0,P.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})}),(0,P.jsxs)(o,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[Math.round(q.passRate*100),`%`]})]}),(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:g(L.trends.avgDuration)})]}),(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:L.total.toLocaleString()})]}),(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(J*100).toFixed(0),`%`]})]})]}),(0,P.jsx)(o,{className:`border-x-0 border-y-0`,children:(0,P.jsxs)(s,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,P.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y.slice(0,5),compactDate:!0})]})})]});return(0,P.jsx)(re,{children:(0,P.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,P.jsx)(pe,{suiteName:G||`Suite`,suiteId:_,unsaved:!1,isCreateMode:!1,mode:`view`,suiteHref:Z,isSaving:!1,isValidating:!1,isRunning:U,runDisabled:!D,hasInvalidFilename:!1,shortcutsOpen:ve,showSuiteId:!1,onBack:()=>f(S.suites),onSave:()=>{},onValidate:()=>{},onRun:e=>X(e),onLiveConnect:()=>f(Q),onSettingsOpen:()=>{},onToggleShortcuts:()=>ye(e=>!e)}),(0,P.jsxs)(d,{value:x,onValueChange:e=>$({tab:e,view:C}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,P.jsxs)(u,{variant:`line`,children:[(0,P.jsx)(c,{value:`overview`,children:`Overview`}),(0,P.jsx)(c,{value:`insights`,children:`Insights`})]})}),(0,P.jsxs)(l,{value:`overview`,className:`flex-1 min-h-0 mt-0 grid grid-cols-1 md:grid-cols-[minmax(480px,1fr)_minmax(260px,320px)]`,children:[(0,P.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,P.jsxs)(d,{value:C,onValueChange:e=>$({tab:x,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`border-b border-border`,children:(0,P.jsxs)(u,{variant:`line`,className:`w-full grid grid-cols-3 px-4 md:w-fit md:inline-flex`,children:[(0,P.jsx)(c,{value:`builder`,children:`Builder`}),(0,P.jsx)(c,{value:`yaml`,children:`YAML`}),(0,P.jsx)(c,{value:`memory`,children:`Memory`})]})}),(0,P.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,P.jsx)(l,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ce}),(0,P.jsx)(l,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:we}),(0,P.jsx)(l,{value:`memory`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:(0,P.jsx)(me,{scope:`suite`,scopeId:_,emptyTitle:`No suite memory yet`,emptyDescription:`This suite doesn't have cataloged observations in this workspace yet. Run the suite with memory enabled, then reopen this tab.`})})]})]})}),Te]}),(0,P.jsx)(l,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,P.jsxs)(`div`,{"data-testid":`suite-detail-insights`,className:`space-y-3 px-4 py-3`,children:[L.isFlaky&&(0,P.jsxs)(T,{variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-3`}),`Flaky (score: `,L.flakyScore.toFixed(2),`)`]}),(0,P.jsxs)(o,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,P.jsx)(s,{className:`border-b border-border md:border-b-0`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:L.total.toLocaleString()})]})}),(0,P.jsx)(s,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[Math.round(q.passRate*100),`%`]})]})}),(0,P.jsx)(s,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:g(L.trends.avgDuration)})]})}),(0,P.jsx)(s,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[(J*100).toFixed(0),`%`]})]})})]}),(0,P.jsx)(o,{children:(0,P.jsx)(s,{className:`px-4 py-3`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})})}),q.daily.length>0&&(0,P.jsxs)(o,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,P.jsxs)(s,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(ee,{data:xe})})]}),(0,P.jsxs)(s,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(a,{data:Se})})]})]}),(0,P.jsx)(o,{children:(0,P.jsxs)(s,{className:`px-4 py-3`,children:[(0,P.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y})]})})]})})]})]})})}export{B as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-B4k_G_pz.js";import{i as n,n as r,o as i,s as a,t as o}from"./select-DF8sGWfv.js";import{n as s,r as c}from"./shortcut-hints-CUbl8p3Z.js";import{t as ee}from"./plus-DWwmmJlz.js";import{t as te}from"./batch-action-bar-Dd_8W0p9.js";import{A as ne,Cr as l,Er as u,H as d,Hn as re,Ln as ie,M as ae,N as oe,S as f,U as p,Ut as m,V as h,W as se,a as ce,br as le,dn as ue,en as g,fr as _,ir as v,j as de,xr as fe}from"./index-CWwAjH9Q.js";import{t as y}from"./badge-DHCU59H0.js";import{t as pe}from"./use-page-title-C_f72ri7.js";import{a as me,i as he,n as ge,o as _e,r as ve,t as b}from"./lib-B4PNeU44.js";import{a as ye,i as be,n as xe,o as x,r as S,t as Se}from"./table-cLA2Rr2t.js";import{n as Ce,t as we}from"./scroll-area-CPuygHdB.js";import{t as Te}from"./empty-state-3cB27tBp.js";import{t as C}from"./use-keyboard-shortcuts-O6nfytzm.js";import{n as w,r as T,t as E}from"./tests-suites-table-widths-CAr7nQWt.js";var D=e(u(),1);function O(){let[e,t]=l(),n=e.get(`status`)??``,r=e.get(`platform`)??``,i=e.get(`sort`)??``,a=e.get(`order`)??`desc`,o=(0,D.useCallback)((e,n)=>{t(t=>{let r=new URLSearchParams(t);return n?r.set(e,n):r.delete(e),r},{replace:!0})},[t]),s=(0,D.useMemo)(()=>i?[{id:i,desc:a===`desc`}]:[],[i,a]),c=(0,D.useRef)(s);return c.current=s,{status:n,platform:r,sort:i,order:a,sorting:s,onSortingChange:(0,D.useCallback)(e=>{let n=typeof e==`function`?e(c.current):e;t(e=>{let t=new URLSearchParams(e);return n.length>0?(t.set(`sort`,n[0].id),t.set(`order`,n[0].desc?`desc`:`asc`)):(t.delete(`sort`),t.delete(`order`)),t},{replace:!0})},[t]),setStatus:(0,D.useCallback)(e=>o(`status`,e),[o]),setPlatform:(0,D.useCallback)(e=>o(`platform`,e),[o])}}var k=g(),Ee=new Set([`passed`,`healed`]),De=new Set([`passed`,`healed`,`failed`,`flaky`,`cancelled`]),Oe=50;function ke(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function A(e){return e.createdAt||e.startedAt||e.endedAt||``}function Ae({status:e}){switch(e){case`passed`:return(0,k.jsx)(y,{className:`bg-emerald-500/15 text-emerald-500 border-emerald-500/20`,children:`Passed`});case`failed`:return(0,k.jsx)(y,{variant:`destructive`,children:`Failed`});case`healed`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Healed`});case`flaky`:return(0,k.jsx)(y,{className:`bg-amber-500/15 text-amber-500 border-amber-500/20`,children:`Flaky`});case`running`:return(0,k.jsx)(y,{className:`bg-blue-500/15 text-blue-500 border-blue-500/20 animate-pulse`,children:`Running`});case`cancelled`:return(0,k.jsx)(y,{className:`bg-muted text-muted-foreground border-border`,children:`Cancelled`});default:return(0,k.jsx)(y,{variant:`outline`,children:e})}}function je(e){return p(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`?`px-2 text-center`:`px-3`,(e===`passRate`||e===`lastRun`)&&`text-right`)}function Me(e){return p(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,e===`targetName`&&`max-w-0 px-3`,e===`platform`&&`px-3`,e===`passRate`&&`px-3 text-right`,e===`lastRun`&&`max-w-0 px-3 text-right`)}function Ne({isActive:e,isBatchSelected:t}){return p(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function j(){pe(`Suites`);let[e,l]=(0,D.useState)([]),[u,g]=(0,D.useState)([]),[y,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)({}),[Pe,P]=(0,D.useState)(!1),[Fe,Ie]=(0,D.useState)([]),[F,I]=(0,D.useState)(-1),L=(0,D.useRef)([]),R=fe(),{status:z,platform:B,sorting:Le,onSortingChange:Re,setStatus:ze,setPlatform:Be}=O();(0,D.useEffect)(()=>{let e=!1;return Promise.all([re(),ie({limit:200})]).then(([t,n])=>{e||(l(t.files),g(n.runs))}).catch(()=>{e||f.error(`Failed to load suites`)}).finally(()=>{e||j(!1)}),()=>{e=!0}},[]);let V=(0,D.useMemo)(()=>e.map(e=>{let t=[...u.filter(t=>t.suiteId&&e.suiteId?t.suiteId===e.suiteId:t.suiteId?!1:t.name===e.name)].sort((e,t)=>A(t).localeCompare(A(e))),n=t.filter(e=>De.has(e.status)),r=n.filter(e=>Ee.has(e.status)).length,i=n.length>0?Math.round(r/n.length*100):null,a=t[0]??null,o=t.find(e=>e.targetName?.trim())??null;return{path:e.path,suiteId:e.suiteId,name:e.name,platform:e.platform??o?.platform??a?.platform??null,lastRunStatus:a?.status??null,lastRun:a,targetName:o?.targetName?.trim()??a?.targetName?.trim()??null,passRate:i,passCount:r,completedRunCount:n.length}}),[e,u]),H=(0,D.useMemo)(()=>{let e=V;return z&&(e=z===`no-runs`?e.filter(e=>!e.lastRunStatus):e.filter(e=>e.lastRunStatus===z)),B&&(e=e.filter(e=>e.platform===B)),e},[V,z,B]),Ve={id:`select`,header:({table:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,k.jsx)(T,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&`indeterminate`,onCheckedChange:t=>e.toggleAllPageRowsSelected(t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,k.jsx)(T,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(t)}),enableSorting:!1,size:48},U=(0,D.useMemo)(()=>[{accessorKey:`name`,header:({column:e})=>(0,k.jsxs)(d,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Name`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.getValue(`name`)}),(0,k.jsx)(`span`,{className:`block whitespace-normal break-all text-xs leading-snug text-muted-foreground`,children:e.original.path})]}),size:400,filterFn:(e,t,n)=>{let r=e.getValue(`name`).toLowerCase(),i=e.original.path.toLowerCase(),a=n.toLowerCase();return r.includes(a)||i.includes(a)}},{accessorKey:`targetName`,header:({column:e})=>(0,k.jsxs)(d,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-muted-foreground`,children:e.original.targetName??`No target`})},{accessorKey:`platform`,header:({column:e})=>(0,k.jsxs)(d,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Platform`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,k.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:ke(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,k.jsxs)(d,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Pass rate`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>e.original.passRate===null?(0,k.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,k.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`No runs`}),(0,k.jsx)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:`0 completed`})]}):(0,k.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,k.jsxs)(`div`,{className:`text-sm font-medium tabular-nums text-foreground`,children:[e.original.passRate,`%`]}),(0,k.jsxs)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:[e.original.passCount,`/`,e.original.completedRunCount]})]})},{id:`lastRun`,accessorFn:e=>e.lastRun?.createdAt??e.lastRun?.startedAt??e.lastRun?.endedAt??``,header:({column:e})=>(0,k.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,k.jsxs)(d,{variant:`ghost`,className:`h-auto justify-end px-0 text-[13px] font-medium text-foreground/90 hover:bg-transparent`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Last run`,(0,k.jsx)(t,{className:`ml-2 h-4 w-4`})]})}),cell:({row:e})=>e.original.lastRun?(0,k.jsxs)(le,{to:_.runDetail(e.original.lastRun.id),className:`relative z-10 flex w-full flex-col items-end gap-1 rounded-sm text-right focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60`,onClick:e=>e.stopPropagation(),children:[(0,k.jsx)(Ae,{status:e.original.lastRun.status}),(0,k.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:se(A(e.original.lastRun))})]}):(0,k.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`})}],[]),W=(0,D.useMemo)(()=>Object.keys(M).filter(e=>M[e]),[M]),G=(0,D.useMemo)(()=>H.filter(e=>W.includes(e.path)),[H,W]),K=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>v({file:t.path,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?f.error(`${n} runs queued, ${r} failed`):f.success(`${n} runs queued`),N({})}finally{P(!1)}}},[G]),He=(0,D.useCallback)(async e=>{if(G.length!==0){P(!0);try{let t=await Promise.allSettled(G.map(t=>v({file:t.path,noCache:!0,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?f.error(`${n} runs queued (no cache), ${r} failed`):f.success(`${n} runs queued (no cache)`),N({})}finally{P(!1)}}},[G]),Ue=(0,D.useCallback)(async()=>{if(G.length!==0){P(!0);try{let e=await Promise.allSettled(G.map(e=>ue(e.path))),t=G.filter((t,n)=>e[n]?.status===`fulfilled`),n=new Set(t.map(e=>e.path)),r=e.length-t.length;t.length>0&&(l(e=>e.filter(e=>!n.has(e.path))),N(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e))))),r>0?f.error(`Deleted ${t.length} suite${t.length===1?``:`s`}, ${r} failed`):f.success(`Deleted ${t.length} suite${t.length===1?``:`s`}`)}finally{P(!1)}}},[G]),q=ge({data:H,columns:[Ve,...U],getCoreRowModel:ve(),getSortedRowModel:_e(),getFilteredRowModel:he(),getPaginationRowModel:me(),onSortingChange:Re,onColumnFiltersChange:Ie,enableRowSelection:!0,onRowSelectionChange:N,getRowId:e=>e.path,state:{sorting:Le,columnFilters:Fe,rowSelection:M},initialState:{pagination:{pageSize:Oe}}}),J=q.getRowModel().rows,Y=q.getColumn(`name`)?.getFilterValue()??``,We=(0,D.useCallback)(e=>{q.getColumn(`name`)?.setFilterValue(e||void 0),q.setPageIndex(0),I(-1),N({})},[q]);C((0,D.useMemo)(()=>{let e=()=>I(e=>Math.min(e+1,J.length-1)),t=()=>I(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(F>=0&&J[F]){let t=J[F].original;if(!t.suiteId)return;let n=_.suiteView(t.suiteId);e.metaKey||e.ctrlKey?window.open(n,`_blank`):R(n)}}}},[J,F,R])),(0,D.useEffect)(()=>{if(F<0)return;let e=L.current[F];e&&document.activeElement!==e&&e.focus()},[F,J.length]);let X=(0,D.useCallback)((e,t)=>{e.suiteId&&(t&&t.preventDefault(),R(_.suiteView(e.suiteId)))},[R]);if(y)return(0,k.jsx)(ce,{});if(e.length===0)return(0,k.jsx)(`div`,{"data-tour-id":`tour-suites-table`,children:(0,k.jsx)(Te,{icon:m,title:`No suites found`,description:`Create your first suite file`,actionLabel:`New Suite`,onAction:()=>R(_.suiteNew)})});let Z=q.getFilteredRowModel().rows.length,Ge=q.getState().pagination.pageIndex,Q=q.getState().pagination.pageSize,$=Ge*Q+1,Ke=Math.min($+Q-1,Z);return(0,k.jsx)(ae,{children:(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,k.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Suites`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(ne,{children:[(0,k.jsx)(oe,{asChild:!0,children:(0,k.jsx)(d,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,k.jsx)(c,{className:`h-4 w-4`})})}),(0,k.jsx)(de,{side:`bottom`,className:`p-3`,children:(0,k.jsx)(s,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open suite`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,k.jsxs)(d,{size:`sm`,"data-tour-id":`tour-suites-new`,onClick:()=>R(_.suiteNew),children:[(0,k.jsx)(ee,{className:`size-4`}),`New Suite`]})]})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,k.jsx)(h,{placeholder:`Search suites...`,value:Y,onChange:e=>We(e.target.value),className:`max-w-[220px]`}),(0,k.jsxs)(o,{value:z||`all`,onValueChange:e=>{ze(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[150px]`,children:(0,k.jsx)(a,{placeholder:`All statuses`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All statuses`}),(0,k.jsx)(n,{value:`passed`,children:`Passed`}),(0,k.jsx)(n,{value:`failed`,children:`Failed`}),(0,k.jsx)(n,{value:`running`,children:`Running`}),(0,k.jsx)(n,{value:`no-runs`,children:`No runs`})]})]}),(0,k.jsxs)(o,{value:B||`all`,onValueChange:e=>{Be(e===`all`?``:e),I(-1),N({})},children:[(0,k.jsx)(i,{className:`w-[140px]`,children:(0,k.jsx)(a,{placeholder:`All platforms`})}),(0,k.jsxs)(r,{children:[(0,k.jsx)(n,{value:`all`,children:`All platforms`}),(0,k.jsx)(n,{value:`web`,children:`Web`}),(0,k.jsx)(n,{value:`android`,children:`Android`}),(0,k.jsx)(n,{value:`ios`,children:`iOS`})]})]})]}),(0,k.jsxs)(we,{"data-tour-id":`tour-suites-table`,className:`rounded-md border`,children:[(0,k.jsxs)(Se,{className:`min-w-full table-fixed`,children:[(0,k.jsx)(`colgroup`,{children:E.map(e=>{let t=w(e);return(0,k.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,k.jsx)(ye,{children:q.getHeaderGroups().map(e=>(0,k.jsx)(x,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,k.jsx)(be,{className:je(e.column.id),children:e.isPlaceholder?null:b(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,k.jsx)(xe,{children:J.length?J.map((e,t)=>{let n=t===F,r=e.getIsSelected();return(0,k.jsx)(x,{ref:e=>{L.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Ne({isActive:n,isBatchSelected:r}),onClick:()=>{I(t),X(e.original)},onFocus:()=>I(t),onKeyDown:t=>{t.key===`Enter`&&X(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,k.jsx)(S,{className:p(Me(e.column.id),t&&`relative z-10`),children:b(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,k.jsx)(x,{children:(0,k.jsx)(S,{colSpan:U.length+1,className:`h-24 text-center`,children:`No results.`})})})]}),(0,k.jsx)(Ce,{orientation:`horizontal`})]}),(0,k.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Z>0?`Showing ${$}-${Ke} of ${Z}${Y||z||B?` (${V.length} total)`:``}`:`No suites found`}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(d,{variant:`outline`,size:`sm`,onClick:()=>q.previousPage(),disabled:!q.getCanPreviousPage(),children:`Previous`}),(0,k.jsx)(d,{variant:`outline`,size:`sm`,onClick:()=>q.nextPage(),disabled:!q.getCanNextPage(),children:`Next`})]})]}),(0,k.jsx)(te,{selectedCount:W.length,onRun:K,onRunNoCache:He,onDelete:Ue,onCancel:()=>N({}),isRunning:Pe})]})})}export{j as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{c as t}from"./select-DF8sGWfv.js";import{At as n,Er as r,Et as i,Ot as a,Pt as o,U as s,en as c,rt as l,wt as u}from"./index-CWwAjH9Q.js";var d=e(r(),1),f=c(),p=`Switch`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeSwitch:r,name:a,checked:s,defaultChecked:c,required:l,disabled:m,value:h=`on`,onCheckedChange:_,form:v,...y}=e,[b,x]=d.useState(null),w=o(t,e=>x(e)),T=d.useRef(!1),E=b?v||!!b.closest(`form`):!0,[D,O]=u({prop:s,defaultProp:c??!1,onChange:_,caller:p});return(0,f.jsxs)(g,{scope:r,checked:D,disabled:m,children:[(0,f.jsx)(n.button,{type:`button`,role:`switch`,"aria-checked":D,"aria-required":l,"data-state":C(D),"data-disabled":m?``:void 0,disabled:m,value:h,...y,ref:w,onClick:i(e.onClick,e=>{O(e=>!e),E&&(T.current=e.isPropagationStopped(),T.current||e.stopPropagation())})}),E&&(0,f.jsx)(S,{control:b,bubbles:!T.current,name:a,value:h,checked:D,required:l,disabled:m,form:v,style:{transform:`translateX(-100%)`}})]})});v.displayName=p;var y=`SwitchThumb`,b=d.forwardRef((e,t)=>{let{__scopeSwitch:r,...i}=e,a=_(y,r);return(0,f.jsx)(n.span,{"data-state":C(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})});b.displayName=y;var x=`SwitchBubbleInput`,S=d.forwardRef(({__scopeSwitch:e,control:n,checked:r,bubbles:i=!0,...a},s)=>{let c=d.useRef(null),u=o(c,s),p=t(r),m=l(n);return d.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(p!==r&&n){let t=new Event(`click`,{bubbles:i});n.call(e,r),e.dispatchEvent(t)}},[p,r,i]),(0,f.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:u,style:{...a.style,...m,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});S.displayName=x;function C(e){return e?`checked`:`unchecked`}var w=v,T=b;function E({className:e,size:t=`default`,...n}){return(0,f.jsx)(w,{"data-slot":`switch`,"data-size":t,className:s(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...n,children:(0,f.jsx)(T,{"data-slot":`switch-thumb`,className:s(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-muted-foreground`)})})}export{E as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{i as t,l as n,n as r,o as i,s as a,t as o,u as s}from"./select-DF8sGWfv.js";import{t as c}from"./circle-x-ITZ_DbXH.js";import{t as l}from"./copy-D-NZb7QZ.js";import{t as u}from"./eye-DkGk2gsF.js";import{t as d}from"./refresh-cw-BtT1wl9S.js";import{At as f,Bt as p,Ct as m,Dt as h,Er as g,Et as _,Ft as v,Gt as y,K as b,Kt as x,Ot as ee,P as S,Pt as te,St as ne,Tt as re,U as C,Xt as w,en as ie,wt as T,xt as ae,zn as oe,zt as se}from"./index-CWwAjH9Q.js";import{t as E}from"./badge-DHCU59H0.js";var ce=w(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),le=w(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ue=w(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),D=e(g(),1),O=ie(),k=`Collapsible`,[de,fe]=ee(k),[pe,A]=de(k),me=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=T({prop:r,defaultProp:i??!1,onChange:o,caller:k});return(0,O.jsx)(pe,{scope:n,disabled:a,contentId:ne(),open:c,onOpenToggle:D.useCallback(()=>l(e=>!e),[l]),children:(0,O.jsx)(f.div,{"data-state":P(c),"data-disabled":a?``:void 0,...s,ref:t})})});me.displayName=k;var he=`CollapsibleTrigger`,j=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=A(he,n);return(0,O.jsx)(f.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":P(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:_(e.onClick,i.onOpenToggle)})});j.displayName=he;var M=`CollapsibleContent`,N=D.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=A(M,e.__scopeCollapsible);return(0,O.jsx)(m,{present:n||i.open,children:({present:e})=>(0,O.jsx)(ge,{...r,ref:t,present:e})})});N.displayName=M;var ge=D.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=A(M,n),[s,c]=D.useState(r),l=D.useRef(null),u=te(t,l),d=D.useRef(0),p=d.current,m=D.useRef(0),h=m.current,g=o.open||s,_=D.useRef(g),v=D.useRef(void 0);return D.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),re(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,O.jsx)(f.div,{"data-state":P(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})});function P(e){return e?`open`:`closed`}var _e=me,ve=j,ye=N,F=`Accordion`,be=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[I,xe,Se]=h(F),[L,Ce]=ee(F,[Se,fe]),R=fe(),we=D.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,O.jsx)(I.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,O.jsx)(ke,{...a,ref:t}):(0,O.jsx)(Oe,{...i,ref:t})})});we.displayName=F;var[z,Te]=L(F),[Ee,De]=L(F,{collapsible:!1}),Oe=D.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=T({prop:n,defaultProp:r??``,onChange:i,caller:F});return(0,O.jsx)(z,{scope:e.__scopeAccordion,value:D.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:D.useCallback(()=>a&&c(``),[a,c]),children:(0,O.jsx)(Ee,{scope:e.__scopeAccordion,collapsible:a,children:(0,O.jsx)(je,{...o,ref:t})})})}),ke=D.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=T({prop:n,defaultProp:r??[],onChange:i,caller:F}),c=D.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=D.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,O.jsx)(z,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,O.jsx)(Ee,{scope:e.__scopeAccordion,collapsible:!0,children:(0,O.jsx)(je,{...a,ref:t})})})}),[Ae,B]=L(F),je=D.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=te(D.useRef(null),t),c=xe(n),l=ae(i)===`ltr`,u=_(e.onKeyDown,e=>{if(!be.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,O.jsx)(Ae,{scope:n,disabled:r,direction:i,orientation:a,children:(0,O.jsx)(I.Slot,{scope:n,children:(0,O.jsx)(f.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})}),V=`AccordionItem`,[Me,H]=L(V),Ne=D.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=B(V,n),o=Te(V,n),s=R(n),c=ne(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,O.jsx)(Me,{scope:n,open:l,disabled:u,triggerId:c,children:(0,O.jsx)(_e,{"data-orientation":a.orientation,"data-state":ze(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});Ne.displayName=V;var Pe=`AccordionHeader`,Fe=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=B(F,n),a=H(Pe,n);return(0,O.jsx)(f.h3,{"data-orientation":i.orientation,"data-state":ze(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});Fe.displayName=Pe;var U=`AccordionTrigger`,Ie=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=B(F,n),a=H(U,n),o=De(U,n),s=R(n);return(0,O.jsx)(I.ItemSlot,{scope:n,children:(0,O.jsx)(ve,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});Ie.displayName=U;var Le=`AccordionContent`,Re=D.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=B(F,n),a=H(Le,n),o=R(n);return(0,O.jsx)(ye,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})});Re.displayName=Le;function ze(e){return e?`open`:`closed`}var Be=we,Ve=Ne,He=Fe,Ue=Ie,We=Re;function W({...e}){return(0,O.jsx)(_e,{"data-slot":`collapsible`,...e})}function G({...e}){return(0,O.jsx)(j,{"data-slot":`collapsible-trigger`,...e})}function K({...e}){return(0,O.jsx)(N,{"data-slot":`collapsible-content`,...e})}function Ge({confidence:e}){let t=Math.round(e*100);return(0,O.jsxs)(E,{variant:`outline`,className:C(`text-xs font-mono`,t>80?`bg-emerald-500/10 text-emerald-500 border-emerald-500/20`:t>=50?`bg-amber-500/10 text-amber-500 border-amber-500/20`:`bg-red-500/10 text-red-500 border-red-500/20`),children:[t,`%`]})}function Ke({...e}){return(0,O.jsx)(Be,{"data-slot":`accordion`,...e})}function qe({className:e,...t}){return(0,O.jsx)(Ve,{"data-slot":`accordion-item`,className:C(`border-b last:border-b-0`,e),...t})}function Je({className:e,children:t,...r}){return(0,O.jsx)(He,{className:`flex`,children:(0,O.jsxs)(Ue,{"data-slot":`accordion-trigger`,className:C(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...r,children:[t,(0,O.jsx)(n,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function Ye({className:e,children:t,...n}){return(0,O.jsx)(We,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,O.jsx)(`div`,{className:C(`pt-0 pb-4`,e),children:t})})}function Xe({attempts:e}){return!e||e.length===0?null:(0,O.jsx)(Ke,{type:`single`,collapsible:!0,className:`w-full`,children:e.map((e,t)=>(0,O.jsxs)(qe,{value:`attempt-${t}`,children:[(0,O.jsx)(Je,{className:`py-2 text-sm`,children:(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(`span`,{className:`font-medium`,children:[`Attempt `,e.attemptNumber??t+1]}),e.strategy&&(0,O.jsx)(E,{variant:`secondary`,className:`text-xs`,children:e.strategy}),e.success?(0,O.jsx)(y,{className:`h-3.5 w-3.5 text-emerald-500`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500`})]})}),(0,O.jsxs)(Ye,{className:`space-y-2`,children:[e.reasoning&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Reasoning`}),(0,O.jsx)(`p`,{className:`text-sm`,children:e.reasoning})]}),e.observationBefore&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Observation Before`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.observationBefore.length>200?`${e.observationBefore.slice(0,200)}…`:e.observationBefore})]}),e.observationAfter&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Observation After`}),(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.observationAfter.length>200?`${e.observationAfter.slice(0,200)}…`:e.observationAfter})]}),e.action!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Action`}),(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto`,children:typeof e.action==`string`?e.action:JSON.stringify(e.action,null,2)})]})]})]},t))})}var q=[{key:`observe`,label:`Observe`,icon:u},{key:`plan`,label:`Plan`,icon:ce},{key:`execute`,label:`Execute`,icon:p},{key:`verify`,label:`Verify`,icon:ue},{key:`heal`,label:`Heal`,icon:d}];function Ze(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e,null,2)}function J({config:e,content:t,duration:n,outcome:r,children:i,open:a,onOpenChange:o,sectionRef:s}){let[c,l]=(0,D.useState)(!1),u=a!==void 0,d=u?a:c,f=u?o:l,p=e.icon,m=t||i;return(0,O.jsxs)(W,{open:d,onOpenChange:f,children:[(0,O.jsxs)(G,{ref:s,className:`flex w-full items-center gap-2 py-1.5 text-left group sticky top-0 z-20 bg-background`,children:[(0,O.jsx)(`div`,{className:`flex items-center justify-center h-4 w-4 rounded-full bg-background border shrink-0`,children:(0,O.jsx)(p,{className:`h-2.5 w-2.5 text-muted-foreground`})}),(0,O.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),n!=null&&(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:b(n)}),r,(0,O.jsx)(`span`,{className:`flex-1`}),m&&(0,O.jsx)(x,{className:C(`h-3 w-3 text-muted-foreground transition-transform duration-200`,d&&`rotate-90`)})]}),m&&(0,O.jsx)(K,{className:`overflow-hidden min-w-0 max-w-full`,children:(0,O.jsxs)(`div`,{className:`min-w-0 max-w-full pl-6 pb-2 space-y-2`,children:[t&&(0,O.jsx)(`div`,{"data-reasoning-content-shell":`true`,className:`min-w-0 max-w-full rounded-sm`,children:(0,O.jsx)(`div`,{"data-reasoning-prose":`true`,className:`m-0 whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]`,children:t})}),i&&(0,O.jsx)(`div`,{"data-reasoning-children":`true`,className:`min-w-0 max-w-full`,children:i})]})})]})}function Qe(e){let t=[];return e.observation&&t.push({key:`observation`,label:`Observe`,icon:q[0].icon,content:e.observation,duration:null}),e.reasoning&&t.push({key:`reasoning`,label:`Plan`,icon:q[1].icon,content:e.reasoning,duration:null}),e.plannedAction!=null&&t.push({key:`plannedAction`,label:`Execute`,icon:q[2].icon,content:null,duration:null,children:(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),t}var $e=(0,D.forwardRef)(function({step:e},t){let n=Qe(e);return n.length===0&&e.error?(0,O.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(et,{ref:t,sections:n}),e.error&&(0,O.jsx)(`div`,{className:`pl-6 pb-2`,children:(0,O.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error})})]})}),et=(0,D.forwardRef)(function({sections:e},t){let[n,r]=(0,D.useState)(()=>e.map(()=>!1)),i=(0,D.useRef)([]),a=(0,D.useCallback)(e=>{r(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{i.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);return(0,D.useImperativeHandle)(t,()=>({togglePhase:a}),[a]),(0,O.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,O.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),e.map((e,t)=>(0,O.jsx)(J,{config:{key:e.key,label:e.label,icon:e.icon},content:e.content,duration:e.duration,outcome:e.outcome,open:n[t],onOpenChange:e=>r(n=>{let r=[...n];return r[t]=e,r}),sectionRef:e=>{i.current[t]=e},children:e.children},e.key))]})}),tt=(0,D.forwardRef)(function({runId:e,stepOrder:t,stepData:n},r){let[i,a]=(0,D.useState)(null),[o,s]=(0,D.useState)(!0),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)([!1,!1,!1,!1]),f=(0,D.useRef)([null,null,null,null]),p=(0,D.useCallback)(e=>{d(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{f.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);if((0,D.useImperativeHandle)(r,()=>({togglePhase:p}),[p]),(0,D.useEffect)(()=>{let n=!1;return oe(e,t).then(e=>{n||(a(e.trace),s(!1))}).catch(e=>{n||(l(e instanceof Error?e.message:`Failed to load reasoning`),s(!1))}),()=>{n=!0}},[e,t]),o)return(0,O.jsxs)(`div`,{className:`space-y-2`,children:[(0,O.jsx)(S,{className:`h-4 w-3/4`}),(0,O.jsx)(S,{className:`h-4 w-1/2`}),(0,O.jsx)(S,{className:`h-4 w-2/3`})]});if(!i&&c||!i)return(0,O.jsx)($e,{ref:r,step:n});let m=i.healAttempts&&i.healAttempts.length>0;return(0,O.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,O.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),(0,O.jsx)(J,{config:q[0],content:i.observeText,duration:i.observeDuration,open:u[0],onOpenChange:e=>d(t=>{let n=[...t];return n[0]=e,n}),sectionRef:e=>{f.current[0]=e}}),(0,O.jsx)(J,{config:q[1],content:i.planReasoning,duration:i.planDuration,outcome:i.planConfidence==null?void 0:(0,O.jsx)(Ge,{confidence:i.planConfidence}),open:u[1],onOpenChange:e=>d(t=>{let n=[...t];return n[1]=e,n}),sectionRef:e=>{f.current[1]=e},children:i.planAction!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Planned Action`}),(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:Ze(i.planAction)})]})}),(0,O.jsx)(J,{config:q[2],content:null,duration:i.executeDuration,open:u[2],onOpenChange:e=>d(t=>{let n=[...t];return n[2]=e,n}),sectionRef:e=>{f.current[2]=e},children:i.executeAction!=null&&(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Executed Action`}),(0,O.jsx)(`pre`,{className:`min-w-0 max-w-full text-xs font-mono bg-muted/50 rounded p-2 overflow-x-auto whitespace-pre-wrap break-words [overflow-wrap:anywhere]`,children:Ze(i.executeAction)})]})}),(0,O.jsx)(J,{config:q[3],content:i.verifyReasoning,duration:i.verifyDuration,outcome:i.verifySuccess==null?void 0:(0,O.jsx)(`span`,{className:C(`text-xs font-medium`,i.verifySuccess?`text-emerald-500`:`text-red-500`),children:i.verifySuccess?`Passed`:`Failed`}),open:u[3],onOpenChange:e=>d(t=>{let n=[...t];return n[3]=e,n}),sectionRef:e=>{f.current[3]=e}}),m&&(0,O.jsx)(J,{config:q[4],content:null,duration:null,children:(0,O.jsx)(Xe,{attempts:i.healAttempts})})]})}),nt=(0,D.forwardRef)(function(e,t){return e.mode===`static`?(0,O.jsx)(et,{sections:e.sections,ref:t}):(0,O.jsx)(tt,{runId:e.runId,stepOrder:e.stepOrder,stepData:e.stepData,ref:t})});function rt(e){switch(e){case`env`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`capture`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;case`cli`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-amber-500/15 text-amber-400 border-amber-500/20`;case`suite`:return`bg-cyan-500/15 text-cyan-400 border-cyan-500/20`;case`test`:return`bg-pink-500/15 text-pink-400 border-pink-500/20`;case`hook`:return`bg-orange-500/15 text-orange-400 border-orange-500/20`;case`step`:return`bg-teal-500/15 text-teal-400 border-teal-500/20`;default:return`bg-muted text-muted-foreground`}}function Y({title:e,count:t,defaultOpen:n,children:r}){return(0,O.jsxs)(W,{defaultOpen:n,children:[(0,O.jsxs)(G,{className:`flex items-center gap-1.5 w-full px-3 py-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors`,children:[(0,O.jsx)(x,{className:`h-3 w-3 transition-transform duration-200 [[data-state=open]>&]:rotate-90`}),e,(0,O.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[`(`,t,`)`]})]}),(0,O.jsx)(K,{children:r})]})}function X({message:e}){return(0,O.jsx)(`div`,{className:`px-4 py-3 text-xs text-muted-foreground/60 italic`,children:e})}function it({step:e,executionLogs:t=[]}){let n=e.variableSnapshot,r=n?Object.entries(n):[],i=t.filter(e=>e.type===`runjs`),a=t.filter(e=>e.type===`hook`);return(0,O.jsxs)(`div`,{className:`py-1`,children:[(0,O.jsx)(Y,{title:`Env`,count:r.length,defaultOpen:r.length>0,children:r.length===0?(0,O.jsx)(X,{message:`No variables at this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2`,children:(0,O.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{className:`border-b`,children:[(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Variable`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Value`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Source`})]})}),(0,O.jsx)(`tbody`,{children:r.map(([e,t])=>(0,O.jsxs)(`tr`,{className:`border-b border-border/50`,children:[(0,O.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs text-muted-foreground`,children:e}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs break-all`,children:t.value}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(E,{className:C(`text-[10px] px-1.5 py-0 border`,rt(t.source)),children:t.source})})]},e))})]})})}),(0,O.jsx)(Y,{title:`runJS`,count:i.length,defaultOpen:i.length>0,children:i.length===0?(0,O.jsx)(X,{message:`No runJS executions for this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:i.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[e.status===`passed`?(0,O.jsx)(y,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,O.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,O.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:b(e.duration)})]}),e.stdout&&(0,O.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden`,children:e.stdout}),e.returnData!=null&&(0,O.jsxs)(`div`,{className:`mt-1 p-1.5 rounded bg-muted/50`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground`,children:`Return: `}),(0,O.jsx)(`span`,{className:`font-mono text-[11px]`,children:typeof e.returnData==`string`?e.returnData:JSON.stringify(e.returnData)})]})]},e.id))})}),(0,O.jsx)(Y,{title:`Hooks`,count:a.length,defaultOpen:a.length>0,children:a.length===0?(0,O.jsx)(X,{message:`No hooks ran for this step`}):(0,O.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:a.map(e=>(0,O.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[e.status===`passed`?(0,O.jsx)(y,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,O.jsx)(c,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,O.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,O.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:b(e.duration)})]}),e.variables&&Object.keys(e.variables).length>0&&(0,O.jsxs)(`div`,{className:`mt-1.5 space-y-0.5`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground text-[10px]`,children:`Emitted variables:`}),Object.entries(e.variables).map(([e,t])=>(0,O.jsxs)(`div`,{className:`flex gap-2 pl-2 font-mono text-[11px]`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,O.jsx)(`span`,{className:`break-all`,children:t})]},e))]}),e.stdout&&(0,O.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden max-h-24 overflow-y-auto`,children:e.stdout})]},e.id))})})]})}function at(e){return e>=1e3?`+${(e/1e3).toFixed(1)}s`:`+${Math.round(e)}ms`}function ot(e){return Object.entries(e).filter(([e,t])=>e!==`startTime`&&t>0)}function st(e){return e>=200&&e<300?`text-emerald-500`:e>=300&&e<400?`text-amber-500`:e>=400?`text-red-500`:`text-muted-foreground`}function ct({headers:e}){let t=Object.entries(e);return t.length===0?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`None`}):(0,O.jsx)(`div`,{className:`space-y-0.5`,children:t.map(([e,t])=>(0,O.jsxs)(`div`,{className:`flex gap-2 text-xs font-mono`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground shrink-0`,children:[e,`:`]}),(0,O.jsx)(`span`,{className:`break-all`,children:t})]},e))})}function Z({label:e,children:t}){return(0,O.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,O.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:e}),t]})}function lt({text:e}){let[t,n]=(0,D.useState)(!1);return(0,O.jsx)(`button`,{onClick:(0,D.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},[e]),className:`text-muted-foreground hover:text-foreground`,children:t?(0,O.jsx)(s,{className:`h-3 w-3`}):(0,O.jsx)(l,{className:`h-3 w-3`})})}function ut({body:e,contentType:t}){let n=t.toLowerCase();if(n.includes(`application/json`))try{return(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:JSON.stringify(JSON.parse(e),null,2)})}catch{return(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}return n.includes(`image/svg+xml`)?(0,O.jsx)(`img`,{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:`SVG response`,className:`max-h-48`}):e.startsWith(`data:image/`)?(0,O.jsx)(`img`,{src:e,alt:`Image response`,className:`max-h-48 rounded-sm`}):n.includes(`image/`)?(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Image not previewable (re-run test to capture)`}):(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}function dt({entry:e}){let t=e.method===`POST`||e.method===`PUT`||e.method===`PATCH`;return(0,O.jsx)(`tr`,{children:(0,O.jsx)(`td`,{colSpan:6,className:`px-0 py-0`,children:(0,O.jsxs)(`div`,{className:`bg-muted/20 border-b border-border/50 px-4 py-3 space-y-4`,children:[(0,O.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,O.jsx)(Z,{label:`Request Headers`,children:(0,O.jsx)(ct,{headers:e.requestHeaders??{}})}),(0,O.jsx)(Z,{label:`Response Headers`,children:(0,O.jsx)(ct,{headers:e.responseHeaders??{}})})]}),t&&(0,O.jsx)(Z,{label:`Request Body`,children:e.requestBody?(0,O.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e.requestBody}):(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`No request body`})}),(0,O.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,O.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,O.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:`Response Body`}),e.body&&(0,O.jsx)(lt,{text:e.body})]}),e.body?(0,O.jsx)(ut,{body:e.body,contentType:e.responseHeaders?.[`content-type`]??``}):(0,O.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Not captured`})]}),e.timing&&(()=>{let t=ot(e.timing);return t.length===0?null:(0,O.jsx)(Z,{label:`Timing`,children:(0,O.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:t.map(([e,t])=>(0,O.jsxs)(`div`,{className:`text-xs font-mono`,children:[(0,O.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),` `,(0,O.jsxs)(`span`,{children:[Math.round(t),`ms`]})]},e))})})})()]})})})}function Q({text:e,query:t}){if(!t)return(0,O.jsx)(O.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsxs)(O.Fragment,{children:[e.slice(0,n),(0,O.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function ft({step:e,allSteps:t,platform:n}){let[r,i]=(0,D.useState)(new Set),a=(0,D.useMemo)(()=>{let n=e.displayStepOrder??e.stepOrder,r=[];for(let e of t){let t=e.displayStepOrder??e.stepOrder;if(t>n)continue;let i=t===n;for(let t of e.networkLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.startTime-t.startTime)},[e,t]),o=(0,D.useMemo)(()=>a.length===0?0:Math.min(...a.map(e=>e.startTime)),[a]),[s,c]=(0,D.useState)(``),l=(0,D.useDeferredValue)(s),u=(0,D.useMemo)(()=>{if(!l)return a;let e=l.toLowerCase();return a.filter(t=>t.url.toLowerCase().includes(e)||t.method.toLowerCase().includes(e)||String(t.status).includes(e))},[a,l]);(0,D.useEffect)(()=>{i(new Set)},[l]);let d=(0,D.useCallback)(e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return a.length===0?(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm py-12`,children:n===`android`||n===`ios`?`Network capture is not available for mobile tests`:`No network requests captured for this step`}):(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,O.jsx)(se,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,O.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),s&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[u.length,` of `,a.length]}),(0,O.jsx)(`button`,{onClick:()=>c(``),className:`text-muted-foreground hover:text-foreground`,children:(0,O.jsx)(v,{className:`h-3.5 w-3.5`})})]})]}),(0,O.jsx)(`div`,{className:`p-3`,children:(0,O.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{className:`border-b`,children:[(0,O.jsx)(`th`,{className:`w-6`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Method`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`URL`}),(0,O.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Status`}),(0,O.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Time`}),(0,O.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Duration`})]})}),(0,O.jsx)(`tbody`,{children:u.map((e,t)=>{let n=e.endTime-e.startTime,i=r.has(t);return(0,O.jsxs)(D.Fragment,{children:[(0,O.jsxs)(`tr`,{onClick:()=>d(t),className:C(`border-b border-border/50 cursor-pointer hover:bg-muted/30 transition-colors`,i&&`bg-muted/20`,!e.isCurrent&&`opacity-40`),children:[(0,O.jsx)(`td`,{className:`py-1.5 pl-2 pr-0 w-6`,children:(0,O.jsx)(x,{className:C(`h-3 w-3 text-muted-foreground transition-transform`,i&&`rotate-90`)})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(E,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:(0,O.jsx)(Q,{text:e.method,query:l})})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono truncate max-w-0 min-w-0`,children:(0,O.jsx)(Q,{text:e.url,query:l})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,O.jsx)(`span`,{className:C(`text-xs font-mono`,st(e.status)),children:(0,O.jsx)(Q,{text:String(e.status),query:l})})}),(0,O.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono text-muted-foreground text-right`,children:at(e.startTime-o)}),(0,O.jsxs)(`td`,{className:`py-1.5 px-2 text-xs text-muted-foreground text-right`,children:[n<1?`<1`:Math.round(n),`ms`]})]}),i&&(0,O.jsx)(dt,{entry:e})]},t)})})]})})]})}function pt(e){switch(e.toLowerCase()){case`error`:return`text-red-400`;case`warn`:case`warning`:return`text-amber-400`;case`info`:return`text-blue-400`;case`debug`:return`text-cyan-400`;default:return`text-muted-foreground`}}function mt(e){switch(e){case`setup`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`teardown`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;default:return`bg-muted text-muted-foreground`}}var $=[`error`,`warn`,`info`,`log`,`debug`];function ht({text:e,query:t}){if(!t)return(0,O.jsx)(O.Fragment,{children:e});let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?(0,O.jsx)(O.Fragment,{children:e}):(0,O.jsxs)(O.Fragment,{children:[e.slice(0,n),(0,O.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function gt({step:e,allSteps:n,executionLogs:s,isHookStep:c}){let l=(0,D.useMemo)(()=>{let t=e.displayStepOrder??e.stepOrder,r=[];for(let e of n){let n=e.displayStepOrder??e.stepOrder;if(n>t)continue;let i=n===t;for(let t of e.consoleLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.timestamp-t.timestamp)},[e,n]),[u,d]=(0,D.useState)(``),f=(0,D.useDeferredValue)(u),[p,m]=(0,D.useState)(`all`),h=(0,D.useMemo)(()=>{let e=l;if(p!==`all`&&(e=e.filter(e=>{let t=e.level.toLowerCase(),n=$.indexOf(p);if(n===-1)return!0;let r=$.indexOf(t);return r!==-1&&r>=n})),f){let t=f.toLowerCase();e=e.filter(e=>e.text.toLowerCase().includes(t)||e.level.toLowerCase().includes(t))}return e},[l,f,p]),g=c&&s&&s.length>0,_=l.length>0;return!g&&!_?(0,O.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm py-12`,children:`No console output captured for this step`}):(0,O.jsxs)(`div`,{className:`w-full overflow-hidden`,children:[_&&(0,O.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,O.jsx)(se,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,O.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),u&&(0,O.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[h.length,` of `,l.length]}),(0,O.jsx)(`div`,{className:`h-3 w-px bg-border/50 shrink-0`}),(0,O.jsxs)(o,{value:p,onValueChange:m,children:[(0,O.jsx)(i,{size:`sm`,className:`h-6 rounded-sm text-xs px-2 gap-1 border-border/50 min-w-0 w-auto`,children:(0,O.jsx)(a,{})}),(0,O.jsxs)(r,{className:`rounded-sm`,children:[(0,O.jsx)(t,{value:`all`,className:`text-xs`,children:`All levels`}),(0,O.jsx)(t,{value:`error`,className:`text-xs`,children:`Errors`}),(0,O.jsx)(t,{value:`warn`,className:`text-xs`,children:`Warnings`}),(0,O.jsx)(t,{value:`info`,className:`text-xs`,children:`Info`}),(0,O.jsx)(t,{value:`log`,className:`text-xs`,children:`Log`}),(0,O.jsx)(t,{value:`debug`,className:`text-xs`,children:`Debug`})]})]}),u&&(0,O.jsx)(`button`,{onClick:()=>d(``),className:`text-muted-foreground hover:text-foreground shrink-0`,children:(0,O.jsx)(v,{className:`h-3.5 w-3.5`})})]}),(0,O.jsxs)(`div`,{className:`p-3 space-y-0.5 overflow-x-hidden w-full max-w-full`,children:[g&&(0,O.jsx)(`div`,{className:`space-y-2 mb-3`,children:s.map(e=>(0,O.jsxs)(`div`,{className:`border border-border/50 rounded-sm overflow-hidden`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 bg-muted/20 border-b border-border/30`,children:[(0,O.jsx)(E,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:e.name}),(0,O.jsx)(E,{className:C(`text-[10px] px-1.5 py-0`,mt(e.phase)),children:e.phase}),(0,O.jsx)(`span`,{className:C(`text-[10px] font-mono`,e.status===`passed`?`text-emerald-500`:`text-red-500`),children:e.status}),(0,O.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:[e.duration,`ms`]})]}),e.stdout&&(0,O.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-foreground/90`,children:e.stdout}),e.stderr&&(0,O.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-red-400/80 border-t border-border/30`,children:e.stderr})]},e.id))}),g&&_&&(0,O.jsx)(`div`,{className:`border-t border-border/30 pt-2 mb-1`,children:(0,O.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider`,children:`Browser Console`})}),_&&h.map((e,t)=>(0,O.jsxs)(`div`,{className:C(`flex items-start gap-1.5 py-0.5 px-2 hover:bg-muted/30 font-mono text-xs overflow-hidden max-w-full`,!e.isCurrent&&`opacity-40`),children:[(0,O.jsx)(`span`,{className:C(`shrink-0 text-[10px]`,pt(e.level)),children:e.level}),(0,O.jsx)(`span`,{className:`text-muted-foreground/60 shrink-0 text-[10px] tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString()}),(0,O.jsx)(`span`,{className:`flex-1 min-w-0 break-all whitespace-pre-wrap overflow-hidden`,children:(0,O.jsx)(ht,{text:e.text,query:f})})]},t))]})]})}export{Xe as a,K as c,le as d,ce as f,nt as i,G as l,ft as n,Ge as o,it as r,W as s,gt as t,ue as u};
@@ -0,0 +1 @@
1
+ import"./chunk-CilyBKbf.js";import{Er as e,U as t,en as n}from"./index-CWwAjH9Q.js";e();var r=n();function i({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:t(`w-full caption-bottom text-sm`,e),...n})})}function a({className:e,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:t(`[&_tr]:border-b`,e),...n})}function o({className:e,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:t(`[&_tr:last-child]:border-0`,e),...n})}function s({className:e,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:t(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,e),...n})}function c({className:e,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:t(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}function l({className:e,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:t(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}export{a,c as i,o as n,s as o,l as r,i as t};