@capagents/forgeqe 3.1.1 → 3.1.2

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 (247) hide show
  1. package/HOW_TO_USE.md +435 -78
  2. package/README.md +21 -6
  3. package/THIRD_PARTY_NOTICES.md +210 -1
  4. package/dist/docs-site/CREDITS.md +6 -0
  5. package/dist/docs-site/architecture-map/index.html +1 -1
  6. package/dist/docs-site/docs/app-theme.css +100 -8
  7. package/dist/docs-site/docs/architecture/index.html +210 -214
  8. package/dist/docs-site/docs/area-api/index.html +350 -0
  9. package/dist/docs-site/docs/area-automated-tests/index.html +967 -0
  10. package/dist/docs-site/docs/area-browser/index.html +430 -0
  11. package/dist/docs-site/docs/area-data/index.html +605 -0
  12. package/dist/docs-site/docs/area-desktop/index.html +755 -0
  13. package/dist/docs-site/docs/area-mobile/index.html +631 -0
  14. package/dist/docs-site/docs/area-operations/index.html +1069 -0
  15. package/dist/docs-site/docs/area-pull-requests/index.html +208 -0
  16. package/dist/docs-site/docs/area-quality/index.html +365 -0
  17. package/dist/docs-site/docs/area-release/index.html +320 -0
  18. package/dist/docs-site/docs/area-setup/index.html +1192 -0
  19. package/dist/docs-site/docs/area-systems/index.html +207 -0
  20. package/dist/docs-site/docs/area-test-cases/index.html +694 -0
  21. package/dist/docs-site/docs/containers/index.html +97 -104
  22. package/dist/docs-site/docs/cost-architecture/index.html +108 -112
  23. package/dist/docs-site/docs/custom-agents-first-run/index.html +19 -23
  24. package/dist/docs-site/docs/desktop/index.html +172 -162
  25. package/dist/docs-site/docs/desktop-ci/index.html +26 -33
  26. package/dist/docs-site/docs/evidence/index.html +253 -257
  27. package/dist/docs-site/docs/feature-test-prompts/index.html +66 -70
  28. package/dist/docs-site/docs/get-started/index.html +495 -0
  29. package/dist/docs-site/docs/graphify/index.html +42 -46
  30. package/dist/docs-site/docs/guardrails/index.html +17 -21
  31. package/dist/docs-site/docs/index.html +17 -6729
  32. package/dist/docs-site/docs/mobile/index.html +155 -162
  33. package/dist/docs-site/docs/model-routing/index.html +44 -51
  34. package/dist/docs-site/docs/overview/index.html +176 -0
  35. package/dist/docs-site/docs/product-graph/index.html +52 -55
  36. package/dist/docs-site/docs/product-knowledge/index.html +11 -15
  37. package/dist/docs-site/docs/product-views/index.html +53 -57
  38. package/dist/docs-site/docs/reference/index.html +379 -0
  39. package/dist/docs-site/docs/search.js +1 -1
  40. package/dist/docs-site/docs/using/index.html +480 -0
  41. package/dist/docs-site/docs/web-app/index.html +147 -93
  42. package/dist/docs-site/security/index.html +930 -0
  43. package/dist/docs-site/security/security-theme.css +161 -0
  44. package/dist/docs-site/security/security.js +1465 -0
  45. package/dist/docs-site/vendor/react-18.3.1.production.min.js +31 -0
  46. package/dist/docs-site/vendor/react-dom-18.3.1.production.min.js +267 -0
  47. package/dist/docs-site/vendor/reactflow-11.11.4.umd.js +10 -0
  48. package/dist/forgeqe.js +1902 -1895
  49. package/dist/web/THIRD_PARTY_NOTICES.md +0 -136
  50. package/dist/web/assets/Agent-CPhmZdFX.js +8 -0
  51. package/dist/web/assets/AgentWork-BXdN9xgi.js +2 -0
  52. package/dist/web/assets/ApiTests-Do3xLjfB.js +10 -0
  53. package/dist/web/assets/Browse-WVkJT6Bs.js +2 -0
  54. package/dist/web/assets/Chat-CDc9UcQX.js +3 -0
  55. package/dist/web/assets/CommandPalette-BAZm62lV.js +1 -0
  56. package/dist/web/assets/Compare-Br6n9T9L.js +1 -0
  57. package/dist/web/assets/Cost-BBUyBu3Y.js +1 -0
  58. package/dist/web/assets/Data-Ch2DPEWp.js +6 -0
  59. package/dist/web/assets/Desktop-Qzoq-cQv.js +1 -0
  60. package/dist/web/assets/DesktopReview-CF_jQYAM.js +1 -0
  61. package/dist/web/assets/Evidence-C72Lj5_Q.js +1 -0
  62. package/dist/web/assets/Explore-ObkEpUyS.js +2 -0
  63. package/dist/web/assets/Features-CQzNo_WP.js +1 -0
  64. package/dist/web/assets/Flags-0-RniPJm.js +2 -0
  65. package/dist/web/assets/Flaky-BPJvNLCA.js +1 -0
  66. package/dist/web/assets/Impact-CfccsL_k.js +3 -0
  67. package/dist/web/assets/Jobs-T6m4zhDy.js +5 -0
  68. package/dist/web/assets/KindPage-BDUvWe2p.js +6 -0
  69. package/dist/web/assets/Migration-Dqeh4x5u.js +2 -0
  70. package/dist/web/assets/PageAgent-DNjzIgeY.js +1 -0
  71. package/dist/web/assets/Product-nYV_scOV.js +7 -0
  72. package/dist/web/assets/Production-CGSbEWVa.js +1 -0
  73. package/dist/web/assets/Quality-BIypojZm.js +1 -0
  74. package/dist/web/assets/Readiness-BlRjwJRg.js +1 -0
  75. package/dist/web/assets/Record-v2KLI-_Z.js +1 -0
  76. package/dist/web/assets/Regression-B-jSt4Jz.js +5 -0
  77. package/dist/web/assets/RelationGraph-8J98lOVG.js +1 -0
  78. package/dist/web/assets/Reports-GI4u6SyW.js +2 -0
  79. package/dist/web/assets/Response-mhBThq2b.js +9 -0
  80. package/dist/web/assets/Responsive-DXu7Ra7K.js +3 -0
  81. package/dist/web/assets/RunDiff-D0SHDNp0.js +1 -0
  82. package/dist/web/assets/Runs-C1Gjdi9M.js +2 -0
  83. package/dist/web/assets/Settings-BGGeuvyF.js +21 -0
  84. package/dist/web/assets/Steps-D-YG0eJy.js +2 -0
  85. package/dist/web/assets/TestCases-DC4w77eQ.js +1 -0
  86. package/dist/web/assets/TestData-CvKWRVVV.js +2 -0
  87. package/dist/web/assets/TestDebt-D8YzN29_.js +1 -0
  88. package/dist/web/assets/TestManagement-C5cDCqrD.js +1 -0
  89. package/dist/web/assets/Tosca-BGUv3RiJ.js +3 -0
  90. package/dist/web/assets/WhatsNew-B_Gyuv8O.js +1 -0
  91. package/dist/web/assets/agents-C0Jg2pN8.js +1 -0
  92. package/dist/web/assets/coverage-BMP6ELFJ.js +5 -0
  93. package/dist/web/assets/dataParts-DbeCj9ga.js +3 -0
  94. package/dist/web/assets/diff-BStuTmsN.js +2 -0
  95. package/dist/web/assets/families-BBFFrUlo.js +1 -0
  96. package/dist/web/assets/filters-CnAMr286.js +1 -0
  97. package/dist/web/assets/fold-D_O_VZui.js +1 -0
  98. package/dist/web/assets/head-CRo48rPt.js +1 -0
  99. package/dist/web/assets/highlight-BcFZIf59.js +4 -0
  100. package/dist/web/assets/index-B3JsM7tv.js +64 -0
  101. package/dist/web/assets/index-CafApcbZ.css +2 -0
  102. package/dist/web/assets/input-CtzK50ZF.js +1 -0
  103. package/dist/web/assets/jsx-runtime-LKYXHABd.js +1 -0
  104. package/dist/web/assets/line-icons-rdF8DYDJ.js +1 -0
  105. package/dist/web/assets/logos-D4oVWzqa.js +1 -0
  106. package/dist/web/assets/palette-DAaGSao7.js +1 -0
  107. package/dist/web/assets/paletteCommands-Co-RlQ8q.js +1 -0
  108. package/dist/web/assets/parts-D357Wolo.js +1 -0
  109. package/dist/web/assets/productParts-B8oHRCJF.js +1 -0
  110. package/dist/web/assets/qualityParts-BLkmIfDY.js +1 -0
  111. package/dist/web/assets/recordTest-Cez2sDJO.js +1 -0
  112. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  113. package/dist/web/assets/route-BloYJWgw.js +1 -0
  114. package/dist/web/index.html +12 -6
  115. package/docs/ARCHITECTURE.md +1 -1
  116. package/docs/BASAL.md +1 -1
  117. package/docs/DESKTOP.md +20 -1
  118. package/docs/EVIDENCE.md +1 -1
  119. package/docs/MOBILE.md +4 -4
  120. package/docs/PRODUCT_KNOWLEDGE.md +2 -0
  121. package/docs/WEB_APP.md +114 -51
  122. package/docs/user-guide.html +404 -81
  123. package/forgeqe.example.yaml +3 -3
  124. package/package.json +1 -1
  125. package/prompts/page-differs.md +1 -1
  126. package/prompts/requests-rule.md +1 -1
  127. package/prompts/test-reviewer.md +1 -1
  128. package/prompts/test-rules.md +3 -4
  129. package/skills/web-guidance/LICENSE +202 -0
  130. package/skills/web-guidance/SKILL.md +76 -0
  131. package/skills/web-guidance/UPSTREAM +67 -0
  132. package/skills/web-guidance/references/accessibility/accessibility.md +585 -0
  133. package/skills/web-guidance/references/accessibility/accessible-error-announcement.md +302 -0
  134. package/skills/web-guidance/references/accessibility/accessible-generated-content.md +41 -0
  135. package/skills/web-guidance/references/accessibility/respect-os-text-scale.md +127 -0
  136. package/skills/web-guidance/references/css/responsive-design.md +16 -0
  137. package/skills/web-guidance/references/forms/autofill-address-form.md +86 -0
  138. package/skills/web-guidance/references/forms/autofill-payment-form.md +142 -0
  139. package/skills/web-guidance/references/forms/autofill-sign-in-form.md +145 -0
  140. package/skills/web-guidance/references/forms/autofill-sign-up-form.md +155 -0
  141. package/skills/web-guidance/references/forms/forms.md +415 -0
  142. package/skills/web-guidance/references/forms/ime-safe-enter-submit.md +115 -0
  143. package/skills/web-guidance/references/forms/required-field-feedback.md +317 -0
  144. package/skills/web-guidance/references/forms/select-menu-interaction.md +310 -0
  145. package/skills/web-guidance/references/forms/slider.md +184 -0
  146. package/skills/web-guidance/references/forms/sms-otp-form.md +208 -0
  147. package/skills/web-guidance/references/forms/switch.md +60 -0
  148. package/skills/web-guidance/references/forms/validate-input-after-interaction.md +406 -0
  149. package/skills/web-guidance/references/performance/break-up-long-tasks.md +64 -0
  150. package/skills/web-guidance/references/performance/identify-heavy-scripts.md +69 -0
  151. package/skills/web-guidance/references/performance/identify-inp-causes.md +105 -0
  152. package/skills/web-guidance/references/performance/interaction-paint-timing.md +200 -0
  153. package/skills/web-guidance/references/performance/optimize-image-priority.md +73 -0
  154. package/skills/web-guidance/references/performance/performance.md +384 -0
  155. package/skills/web-guidance/references/privacy/privacy.md +247 -0
  156. package/skills/web-guidance/references/security/passkey-authentication.md +218 -0
  157. package/skills/web-guidance/references/security/passkey-management.md +310 -0
  158. package/skills/web-guidance/references/security/passkey-reauthentication.md +142 -0
  159. package/skills/web-guidance/references/security/passkey-registration.md +186 -0
  160. package/skills/web-guidance/references/security/passkeys.md +39 -0
  161. package/skills/web-guidance/references/security/sanitize-untrusted-html.md +105 -0
  162. package/skills/web-guidance/references/security/secure-external-subresources.md +202 -0
  163. package/skills/web-guidance/references/security/security.md +390 -0
  164. package/skills/web-guidance/references/security/trusted-types.md +141 -0
  165. package/skills/web-guidance/references/security/validate-origins.md +197 -0
  166. package/skills/web-guidance/references/security/verify-email-ownership.md +235 -0
  167. package/skills/web-guidance/references/ui-atoms/position-aware-tooltips.md +173 -0
  168. package/skills/web-guidance/references/ui-atoms/responsive-table.md +122 -0
  169. package/skills/web-guidance/references/ui-atoms/viewport-aware-dropdowns.md +178 -0
  170. package/skills/web-guidance/references/ui-behaviors/drag-and-drop.md +108 -0
  171. package/skills/web-guidance/references/ui-behaviors/light-dismiss-a-dialog.md +89 -0
  172. package/skills/web-guidance/references/ui-behaviors/motion.md +97 -0
  173. package/skills/web-guidance/references/ui-behaviors/platform-controls-dismiss-dialog.md +40 -0
  174. package/skills/web-guidance/references/ui-behaviors/prevent-page-scroll-under-modal-dialog.md +59 -0
  175. package/skills/web-guidance/references/ui-behaviors/search-hidden-content.md +141 -0
  176. package/skills/web-guidance/references/ui-behaviors/sortable-table.md +140 -0
  177. package/skills/web-guidance/references/ui-components/accordion.md +343 -0
  178. package/skills/web-guidance/references/ui-components/breadcrumbs.md +168 -0
  179. package/skills/web-guidance/references/ui-components/carousel.md +206 -0
  180. package/skills/web-guidance/references/ui-components/checkbox.md +144 -0
  181. package/skills/web-guidance/references/ui-components/dialog.md +218 -0
  182. package/skills/web-guidance/references/ui-components/hovercard.md +391 -0
  183. package/skills/web-guidance/references/ui-components/menu.md +415 -0
  184. package/skills/web-guidance/references/ui-components/navbar.md +281 -0
  185. package/skills/web-guidance/references/ui-components/navigation-drawer.md +429 -0
  186. package/skills/web-guidance/references/ui-components/persistent-toast-notifications.md +185 -0
  187. package/skills/web-guidance/references/ui-components/progress.md +181 -0
  188. package/skills/web-guidance/references/ui-components/spinner.md +179 -0
  189. package/skills/web-guidance/references/ui-components/tabs.md +371 -0
  190. package/skills/web-guidance/references/ui-components/toolbar.md +277 -0
  191. package/skills/web-guidance/references/user-experience/form-factor-adaptation.md +120 -0
  192. package/skills/web-guidance/references/user-experience/natural-interactions.md +155 -0
  193. package/skills/web-guidance/references/visual-design/color.md +43 -0
  194. package/skills/web-guidance/references/visual-design/dark-mode.md +350 -0
  195. package/dist/web/assets/AgentWork-DwAI0_Of.js +0 -2
  196. package/dist/web/assets/ApiTests-C0vFSHmM.js +0 -10
  197. package/dist/web/assets/Browse-5jfdtRc5.js +0 -2
  198. package/dist/web/assets/Chat-B3uhI94O.js +0 -3
  199. package/dist/web/assets/CommandPalette-D2J4nf5y.js +0 -1
  200. package/dist/web/assets/Compare-CN75w1p9.js +0 -1
  201. package/dist/web/assets/Cost-QoxyjR95.js +0 -1
  202. package/dist/web/assets/Data-BAvkcBVt.js +0 -6
  203. package/dist/web/assets/Desktop-BXdOIalN.js +0 -1
  204. package/dist/web/assets/DesktopReview-Bl2SrPP0.js +0 -1
  205. package/dist/web/assets/Evidence-BJ_I52CD.js +0 -1
  206. package/dist/web/assets/Explore-D9AuyTip.js +0 -2
  207. package/dist/web/assets/Features-CusGMDR9.js +0 -1
  208. package/dist/web/assets/Flags-CycGFuUP.js +0 -2
  209. package/dist/web/assets/Flaky-BcSzJogN.js +0 -1
  210. package/dist/web/assets/Impact-CJHnyZ21.js +0 -3
  211. package/dist/web/assets/Jobs-4xcFzEFo.js +0 -5
  212. package/dist/web/assets/KindPage-BielEIej.js +0 -6
  213. package/dist/web/assets/Migration-NwanKpJg.js +0 -2
  214. package/dist/web/assets/PageAgent-CNw4NXva.js +0 -1
  215. package/dist/web/assets/Product-DS3LJZ4P.js +0 -7
  216. package/dist/web/assets/Production-D3zsyNIS.js +0 -1
  217. package/dist/web/assets/Quality-Ctj2YpC4.js +0 -1
  218. package/dist/web/assets/Readiness-DGcRr_co.js +0 -1
  219. package/dist/web/assets/Record-Cc-wGe_Y.js +0 -1
  220. package/dist/web/assets/Regression-DcsbrRa1.js +0 -5
  221. package/dist/web/assets/Reports-BkCn0-Sf.js +0 -2
  222. package/dist/web/assets/Response-BP0UwQcW.js +0 -9
  223. package/dist/web/assets/Responsive-C8U7dumd.js +0 -3
  224. package/dist/web/assets/RunDiff-BhABuhF_.js +0 -1
  225. package/dist/web/assets/Runs-OwdWEYBv.js +0 -2
  226. package/dist/web/assets/Steps-BvzbQyoD.js +0 -2
  227. package/dist/web/assets/TestCases-CLq_6JA5.js +0 -1
  228. package/dist/web/assets/TestData-B0oKAhp6.js +0 -2
  229. package/dist/web/assets/TestDebt-8NLQ5YV_.js +0 -1
  230. package/dist/web/assets/TestManagement-2LYQ7vsN.js +0 -1
  231. package/dist/web/assets/Tosca-DfvMpPTG.js +0 -3
  232. package/dist/web/assets/WhatsNew-BGFNGwqN.js +0 -1
  233. package/dist/web/assets/families-DYlN5v0i.js +0 -1
  234. package/dist/web/assets/filters-faaSnoIq.js +0 -1
  235. package/dist/web/assets/fold-CUjwWAK3.js +0 -1
  236. package/dist/web/assets/frame-BLPdAXUq.js +0 -13
  237. package/dist/web/assets/head-CsTxBsO0.js +0 -1
  238. package/dist/web/assets/index-CxiCvGZq.js +0 -78
  239. package/dist/web/assets/index-dOIsrzhD.css +0 -2
  240. package/dist/web/assets/line-icons-CwZWt93L.js +0 -1
  241. package/dist/web/assets/logos-dGuc1jIM.js +0 -1
  242. package/dist/web/assets/markdown-BI3F-SJ1.js +0 -10
  243. package/dist/web/assets/paletteCommands-QJiCuUEr.js +0 -1
  244. package/dist/web/assets/parts-CdF1f7yS.js +0 -1
  245. package/dist/web/assets/productParts-hNLD9fN0.js +0 -1
  246. package/dist/web/assets/qualityParts-CT25lBWU.js +0 -1
  247. package/dist/web/assets/recordTest-P792aBUt.js +0 -1
@@ -1 +0,0 @@
1
- import{Br as e,Gn as t,In as n,Lr as r,M as i,Mr as a,N as o,P as s,Pr as c,R as l,Sr as u,U as d,Yt as f,_r as p,a as m,at as h,b as g,br as _,cr as v,fr as y,it as ee,jn as b,m as x,nn as S,o as C,qn as w,rr as te,tn as T,tr as E,w as D,zn as O}from"./line-icons-CwZWt93L.js";import{$t as ne,B as re,V as k,a as A,c as j,f as ie,h as ae,l as M,o as N,ot as P,p as F,st as I,t as oe,z as L}from"./filters-faaSnoIq.js";import{$ as R,Q as z,Vt as B,X as V,Z as H,bn as se,bt as ce,et as U,it as le,n as ue,nt as W,o as de,ot as fe,rt as G}from"./frame-BLPdAXUq.js";import{G as pe,L as K,j as q}from"./index-CxiCvGZq.js";import{_ as me}from"./qualityParts-CT25lBWU.js";import{t as he}from"./AgentWork-DwAI0_Of.js";var J=e(r(),1),Y={view:()=>P(`GET`,`/api/testmgmt`),cases:()=>P(`GET`,`/api/testmgmt/cases`),case:e=>P(`GET`,`/api/testmgmt/case/${encodeURIComponent(e).replace(/%3A/gi,`:`)}`),sync:()=>P(`POST`,`/api/testmgmt/sync`),schedule:()=>P(`GET`,`/api/testmgmt/schedule`),setSchedule:e=>P(`POST`,`/api/testmgmt/schedule`,e),gaps:()=>P(`GET`,`/api/testmgmt/gaps`),tags:()=>P(`GET`,`/api/testmgmt/tags`),tag:(e,t=!1)=>P(`POST`,`/api/testmgmt/tags`,{...e,...t?{confirmed:!0}:{}}),suites:()=>P(`GET`,`/api/testmgmt/suites`),suite:e=>P(`GET`,`/api/testmgmt/suites/${encodeURIComponent(e)}`),buildSuite:(e,t)=>P(`POST`,`/api/testmgmt/suites/agent`,{request:e,...t?{open:t}:{}}),saveSuite:e=>P(`POST`,`/api/testmgmt/suites`,e),deleteSuite:e=>P(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/delete`,{confirmed:!0}),runSuite:(e,t,n=!1)=>P(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/run`,{...t,...n?{confirmed:!0}:{}}),run:(e,t,n=!1)=>P(`POST`,`/api/testmgmt/run`,{keys:e,...t?{env:t}:{},...n?{confirmed:!0}:{}}),job:()=>P(`GET`,`/api/testmgmt/job`),writeBack:(e,t,n,r)=>P(`POST`,`/api/testmgmt/writeback/${e}`,{keys:t,...r?{tags:r}:{},...n?{digest:n}:{}}),suiteTracker:(e,t,n)=>P(`POST`,`/api/testmgmt/suites/${encodeURIComponent(e)}/tracker`,{...t?{target:t}:{},...n?{digest:n}:{}}),stop:()=>P(`POST`,`/api/testmgmt/stop`),tests:()=>P(`GET`,`/api/testmgmt/tests`),discoveryPlan:()=>P(`GET`,`/api/testmgmt/discover`),discover:e=>P(`POST`,`/api/testmgmt/discover`,{digest:e}),link:e=>P(`POST`,`/api/testmgmt/links`,{changes:e}),setMain:(e,t)=>P(`POST`,`/api/testmgmt/links/main`,{case:e,test:t}),proposeLinks:(e=[])=>P(`POST`,`/api/testmgmt/links/propose`,{keys:e}),ask:(e,t,n,r)=>P(`POST`,`/api/testmgmt/ask`,{intent:e,keys:t,...n?{words:n}:{},...r?.length?{stories:r}:{}}),readStories:e=>P(`POST`,`/api/testmgmt/stories`,{scope:e})},ge={automated:`Automated`,not_automated:`Not automated`,pending:`Pending`,known_defect:`Known defect`,needs_attention:`Needs attention`},_e={mapping:`ForgeQE's mapping`,manual:`Linked by a person`,attribute:`Its marker or attribute names the case`,tracker:`The case's system names it`,agent:`Linked by the mapping agent`,name:`The case's id is in its name or tags`},ve={framework:`Listed by its framework`,code:`Read from the code`,runs:`Known from runs`},X={passed:`Passed`,failed:`Failed`,blocked:`Blocked`,not_run:`Not run`},Z=ne();function ye({title:e,about:t,onClose:n,children:r,footer:i}){return(0,Z.jsxs)(`aside`,{"aria-label":e,className:`flex w-full flex-none flex-col border-t border-line-soft bg-surface-muted xl:sticky xl:top-0 xl:h-(--screen) xl:w-[320px] 2xl:w-[380px] xl:border-t-0 xl:border-l`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-line-soft px-6 py-4`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:e}),(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:t})]}),n&&(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Close the ${e}`,"data-tip":`Close`,onClick:n,children:(0,Z.jsx)(c,{"aria-hidden":`true`})})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-6`,children:r}),i&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft px-6 py-4`,children:i})]})}function be({title:e,about:t,looking:n,context:r,suggestions:i,placeholder:a,onClose:o}){let[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(``),[h,g]=(0,J.useState)(!1),_=async(e,t,n,r,i)=>{f(!0),m(``);try{let{request:a}=await Y.ask(e,t,r,i),{id:o}=await I.start(a,{});c({id:o,said:n}),g(!1),u(``)}catch(e){m(e.message)}finally{f(!1)}};return(0,Z.jsxs)(ye,{title:e,about:t,onClose:o,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>(0,Z.jsxs)(L,{size:`sm`,disabled:d||!!e.disabled,"data-tip":e.disabled??e.label,onClick:()=>void _(e.intent,e.keys,e.label,void 0,e.stories),children:[(0,Z.jsx)(e.icon,{"aria-hidden":`true`}),e.label]},e.label))}),(0,Z.jsxs)(`form`,{className:`flex items-end gap-2`,onSubmit:e=>{e.preventDefault(),l.trim()&&_(`ask`,i[0]?.keys.slice(0,50)??[],l.trim(),l.trim())},children:[(0,Z.jsxs)(`label`,{className:`sr-only`,htmlFor:`tm-agent-words`,children:[`Message the `,e]}),(0,Z.jsx)(`textarea`,{id:`tm-agent-words`,rows:2,maxLength:1e3,value:l,placeholder:a,onChange:e=>u(e.target.value),className:`min-h-11 flex-1 resize-none rounded-[10px] border border-line bg-bg px-4 py-2 text-[13px] text-ink outline-none focus:border-accent`}),(0,Z.jsx)(L,{size:`icon`,variant:`primary`,type:`submit`,disabled:d||!l.trim(),"aria-label":`Send`,"data-tip":`Send`,children:(0,Z.jsx)(w,{"aria-hidden":`true`})})]})]}),children:[(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-4 text-center`,children:[(0,Z.jsx)(ae,{state:d||s&&!h?`thinking`:`working`,px:96,label:d?`Starting`:s&&!h?`Working`:`Ready`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:s?h?`Done. Ask again, or open the chat.`:`Working on it…`:n}),r.length>0&&(0,Z.jsx)(`span`,{className:`flex flex-wrap justify-center gap-2`,children:r.map(e=>(0,Z.jsx)(`span`,{className:`rounded-[8px] border border-line bg-bg px-2 text-[13px] text-ink-2`,children:e},e))}),s&&(0,Z.jsx)(`p`,{className:`m-0 text-[16px] leading-relaxed text-ink-2`,children:s.said})]}),p&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:p}),s?(0,Z.jsx)(he,{id:s.id,label:`The ${e} at work`,onEnd:()=>g(!0)},s.id):(0,Z.jsxs)(`p`,{className:k(`m-0 text-center text-[13px] text-muted`),children:[`Pick what to do below, or say it in your own words. It works in a chat you can open: `,(0,Z.jsx)(`a`,{href:F(`chats`),children:`Chats`}),`.`]})]})}var xe={automation:`Mark automated in their tracker`,tags:`Write ForgeQE's tags to their tracker`,untag:`Take ForgeQE's tags off in their tracker`},Se={automation:`Each case's tracker records its automated test: Azure DevOps' Associated Automation, or the automated label on a Jira or Xray test. Only cases whose test ForgeQE knows, from its mapping or a link, are marked.`,tags:`ForgeQE's own tags are added to each case's tags in Azure DevOps, or its labels in Jira. Tags the case already has stay; nothing is taken away.`,untag:`ForgeQE's own tags are taken off each case's tags in Azure DevOps, or its labels in Jira. Only a tag ForgeQE keeps for the case is taken off; the tracker's other tags stay.`},Ce=e=>e.system===`azure_devops`?`Azure DevOps plan ${e.plan}`:`Xray Test Set in ${e.project}`,we=e=>e.system===`azure_devops`?`ado:${e.plan}`:`xray:${e.project}`,Te=e=>e?.url&&/^https:\/\//i.test(e.url)?e.url:void 0,Ee=e=>e.system===`azure_devops`?`Azure DevOps suite ${e.suite} in plan ${e.plan}`:`Xray Test Set ${e.key}`;function De({plan:e,outcome:t}){let n=new Map((t?.failed??[]).map(e=>[e.key,e.error])),r=new Set((t?.done??[]).map(e=>e.key)),a=(e,t,a=!1)=>(0,Z.jsxs)(`li`,{className:`flex flex-col gap-1 border-t border-line-soft py-2 first:border-t-0`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[r.has(e.key)&&(0,Z.jsx)(i,{size:14,"aria-label":`Written`,className:`flex-none text-pass`}),n.has(e.key)&&(0,Z.jsx)(l,{size:14,"aria-label":`Refused`,className:`flex-none text-fail`}),e.key!==`suite`&&(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.key.replace(/^[a-z_]+:/,``)}),(0,Z.jsx)(`span`,{className:a?`text-muted`:`text-ink-2`,children:e.what})]}),n.has(e.key)&&(0,Z.jsx)(`span`,{className:`text-fail [overflow-wrap:anywhere]`,children:n.get(e.key)})]},`${e.key}-${t}`);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-[13px]`,children:[e.changes.length?(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:e.changes.map((e,t)=>a(e,t))}):(0,Z.jsx)(`p`,{className:`m-0 text-ink-2`,children:`Nothing to write: the trackers already say so.`}),e.skipped.length>0&&(0,Z.jsxs)(`details`,{children:[(0,Z.jsxs)(`summary`,{className:`cursor-pointer text-muted`,children:[`Left out: `,e.skipped.length]}),(0,Z.jsx)(`ul`,{className:`m-0 mt-2 flex list-none flex-col p-0`,children:e.skipped.map((e,t)=>a(e,t,!0))})]})]})}function Oe(e,t,n){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{i(null),o(null),c(``),e&&e().then(e=>i(e??null),e=>c(e.message))},[e]),{plan:r,outcome:a,error:s,busy:l,go:async()=>{if(r){u(!0),c(``);try{let e=await t(r.digest);e&&(o(e),n(`Wrote ${e.done.length}${e.failed.length?`; the tracker refused ${e.failed.length}`:``}.`))}catch(e){c(e.message)}finally{u(!1)}}}}}function ke({kind:e,keys:t,tags:n,onClose:r,onDone:i}){let[a,o]=(0,J.useState)(null);(0,J.useEffect)(()=>o(e?()=>()=>Y.writeBack(e,t,void 0,n).then(e=>e.plan):null),[e,t,n]);let s=Oe(a,r=>Y.writeBack(e,t,r,n).then(e=>e.outcome),i);return(0,Z.jsx)(B,{open:!!e,onClose:r,title:e?xe[e]:``,description:e?Se[e]:``,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:r,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),s.outcome?`Close`:`Cancel`]}),!s.outcome&&(0,Z.jsxs)(L,{variant:`primary`,disabled:s.busy||!s.plan?.changes.length,onClick:()=>void s.go(),"data-tip":`Write these changes`,children:[e===`untag`?(0,Z.jsx)(ee,{"aria-hidden":`true`}):(0,Z.jsx)(u,{"aria-hidden":`true`}),s.busy?`Writing…`:`${e===`untag`?`Take off`:`Write`} ${s.plan?.changes.length??``}`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[!s.plan&&!s.error&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Working out what would change…`}),s.error&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:s.error}),s.plan&&(0,Z.jsx)(De,{plan:s.plan,outcome:s.outcome})]})})}function Ae({open:e,suite:t,targets:n,onClose:r,onDone:i}){let[a,o]=(0,J.useState)(``),s=t.tracker?void 0:n.find(e=>we(e)===(a||(n[0]?we(n[0]):``))),[l,u]=(0,J.useState)(null);(0,J.useEffect)(()=>u(e&&(t.tracker||s)?()=>()=>Y.suiteTracker(t.id,s).then(e=>e.plan):null),[e,t.id,t.tracker,s&&we(s)]);let d=Oe(l,e=>Y.suiteTracker(t.id,s,e).then(e=>e.outcome),i),f=t.tracker;return(0,Z.jsx)(B,{open:e,onClose:r,title:f?`Keep ${t.name} in step`:`Keep ${t.name} in a tracker`,description:f?`It is ${Ee(f)}. Cases the suite gained are added there, and cases it lost are taken out.`:`The suite is made in the tracker with its cases, so the team sees it there. Later, Keep in step makes it match the suite again.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:r,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),d.outcome?`Close`:`Cancel`]}),!d.outcome&&(0,Z.jsxs)(L,{variant:`primary`,disabled:d.busy||!d.plan?.changes.length,onClick:()=>void d.go(),children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),d.busy?`Writing…`:f?`Keep in step`:`Make it there`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[!f&&(n.length?(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Where`,(0,Z.jsx)(N,{value:s?we(s):``,onChange:e=>o(e.target.value),children:n.map(e=>(0,Z.jsx)(`option`,{value:we(e),children:Ce(e)},we(e)))})]}):(0,Z.jsx)(`p`,{className:`m-0 text-ink-2`,children:`This suite's cases are in no connected Azure DevOps plan or Xray project. Connect one in Settings › Integrations.`})),(f||s)&&!d.plan&&!d.error&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Working out what would change…`}),d.error&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:d.error}),d.plan&&(0,Z.jsx)(De,{plan:d.plan,outcome:d.outcome}),d.outcome&&!d.outcome.failed.length&&(0,Z.jsx)(j,{tone:`pass`,children:`Done`})]})})}var je={automated:i,not_automated:o,pending:s,known_defect:_,needs_attention:_},Me={passed:`pass`,failed:`fail`,blocked:`warn`,not_run:`neutral`};function Q({text:e,tip:t,className:n}){return(0,Z.jsx)(`span`,{"data-tip":t??e,className:k(`block truncate`,n),children:e})}function Ne({a:e}){let t=je[e];return(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-[13px] whitespace-nowrap`,children:[(0,Z.jsx)(t,{size:15,"aria-hidden":`true`,className:k(`flex-none`,e===`automated`?`text-pass`:e===`known_defect`?`text-fail`:e===`not_automated`?`text-muted`:`text-warn`)}),ge[e]]})}function Pe({o:e}){return(0,Z.jsx)(j,{tone:Me[e],icon:e!==`not_run`,children:X[e]})}function Fe({runs:e}){return e.length?(0,Z.jsx)(`span`,{role:`img`,"aria-label":`Last runs: ${e.map(e=>e===`p`?`passed`:`failed`).join(`, `)}`,className:`inline-flex items-end gap-1`,children:e.map((e,t)=>(0,Z.jsx)(`span`,{className:k(`inline-block h-4 w-2 rounded-[2px]`,e===`p`?`bg-pass`:`bg-fail`)},t))}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})}function Ie({tags:e,max:t=3}){return e.length?(0,Z.jsxs)(`span`,{className:`inline-flex flex-wrap gap-1`,children:[e.slice(0,t).map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-[6px] bg-surface-strong px-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(y,{size:11,"aria-hidden":`true`}),e]},e)),e.length>t&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,"data-tip":e.slice(t).join(`, `),children:[`+`,e.length-t]})]}):null}function Le({points:e,label:t,format:n=e=>String(e),height:r=160}){if(e.length<2)return(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`The trend starts after a second day of numbers: each visit of Test management keeps the day's.`});let i=r,a=Math.min(...e.map(e=>e.y)),o=Math.max(...e.map(e=>e.y)),s=Math.max(0,a-(o-a||1)*.2),c=o+(o-a||1)*.2,l=t=>8+t*584/(e.length-1),u=e=>i-20-(e-s)/(c-s||1)*(i-36),d=e.map((e,t)=>`${l(t).toFixed(1)},${u(e.y).toFixed(1)}`),f=e.at(-1);return(0,Z.jsxs)(`figure`,{className:`m-0 flex flex-col gap-1`,children:[(0,Z.jsxs)(`svg`,{viewBox:`0 0 600 ${i}`,role:`img`,"aria-label":`${t}: from ${n(e[0].y)} on ${e[0].x} to ${n(f.y)} on ${f.x}`,className:`h-auto w-full text-accent`,children:[[.25,.5,.75].map(e=>(0,Z.jsx)(`line`,{x1:`0`,x2:600,y1:(i-20)*e+4,y2:(i-20)*e+4,className:`stroke-line-soft`,strokeWidth:`1`},e)),(0,Z.jsx)(`path`,{d:`M${d.join(` L`)} L${l(e.length-1)},${i-20} L${l(0)},${i-20} Z`,fill:`currentColor`,fillOpacity:`0.1`}),(0,Z.jsx)(`polyline`,{points:d.join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`}),(0,Z.jsx)(`circle`,{cx:l(e.length-1),cy:u(f.y),r:`4`,fill:`currentColor`,className:`stroke-bg`,strokeWidth:`2`})]}),(0,Z.jsxs)(`figcaption`,{className:`flex justify-between text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{children:e[0].x}),(0,Z.jsxs)(`span`,{className:`font-medium text-ink`,children:[n(f.y),` now`]}),(0,Z.jsx)(`span`,{children:f.x})]})]})}function Re({items:e,series:t,label:n}){let r=Math.max(1,...e.flatMap(e=>e.values));return(0,Z.jsxs)(`figure`,{className:`m-0 flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`flex flex-wrap gap-4 text-[13px] text-ink-2`,children:t.map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:k(`inline-block size-[10px] rounded-[3px]`,e.className),"aria-hidden":`true`}),e.name]},e.name))}),(0,Z.jsx)(`div`,{role:`img`,"aria-label":`${n}: ${e.map(e=>`${e.x} ${e.values.join(` and `)}`).join(`; `)}`,className:`flex h-[140px] items-end gap-2 border-b border-line`,children:e.map(e=>(0,Z.jsx)(`span`,{className:`flex h-full flex-1 items-end justify-center gap-1`,"data-tip":`${e.x}: ${e.values.map((e,n)=>`${t[n]?.name.toLowerCase()} ${e}`).join(`, `)}`,children:e.values.map((e,n)=>(0,Z.jsx)(`span`,{className:k(`w-full max-w-[14px] rounded-t-[4px]`,t[n]?.className),style:{height:`${Math.max(e?3:0,e/r*100)}%`}},n))},e.x))}),(0,Z.jsxs)(`span`,{className:`flex justify-between text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{children:e[0]?.x}),(0,Z.jsx)(`span`,{children:e.at(-1)?.x})]})]})}function ze({label:e,part:t,whole:n,className:r=`bg-accent`}){let i=n?Math.round(t/n*100):0;return(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,140px)_1fr_auto] items-center gap-4 text-[13px]`,children:[(0,Z.jsx)(Q,{text:e,className:`text-ink-2`}),(0,Z.jsx)(`span`,{className:`h-2 overflow-hidden rounded-full bg-surface-strong`,role:`img`,"aria-label":`${e}: ${t} of ${n}`,children:(0,Z.jsx)(`span`,{className:k(`block h-full rounded-full`,r),style:{width:`${i}%`}})}),(0,Z.jsxs)(`span`,{className:`w-[86px] text-right tabular-nums text-ink-2`,children:[t,` of `,n]})]})}function Be({open:e,onClose:t,title:n,preview:r,onStarted:i}){let[a,o]=(0,J.useState)(null),[s,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(null),[f,p]=(0,J.useState)(``),[m,h]=(0,J.useState)(!1);(0,J.useEffect)(()=>{e&&(d(null),p(``),Y.suites().then(e=>{o({list:e.environments,...e.active?{active:e.active}:{}}),l(e.active&&e.environments.includes(e.active)?e.active:e.environments[0]??``)},e=>p(e.message)))},[e]),(0,J.useEffect)(()=>{e&&a!==null&&r(s||void 0,!1).then(e=>{d(e.preview??null),p(``)},e=>p(e.message))},[e,s,a]);let g=async()=>{h(!0);try{await r(s||void 0,!0),i(),t()}catch(e){p(e.message)}finally{h(!1)}};return(0,Z.jsx)(B,{open:e,onClose:t,title:n,description:`ForgeQE runs these with forgeqe suite, on the environment you pick here. Results go to Runs and back to each case's system, as your settings say.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:t,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(L,{variant:`primary`,disabled:m||!u,onClick:()=>void g(),"data-tip":`Start the run`,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Run `,u?u.cases:``]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[a&&a.list.length>0&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Environment`,(0,Z.jsx)(N,{value:s,onChange:e=>l(e.target.value),children:a.list.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))})]}),u&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-ink-2`,children:[u.cases,` test case`,u.cases===1?``:`s`,` on `,u.env??`the active environment`,`.`]}),f&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:f})]})})}var Ve=e=>e.lastRun.outcome===`failed`||e.lastRun.outcome===`blocked`,He=e=>F(`test-management`,`cases`,encodeURIComponent(e));function Ue({cases:e,onChanged:n}){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(!1),[f,p]=(0,J.useState)(null),m=()=>Y.tests().then(e=>{i(e),o(``)},e=>o(e.message));(0,J.useEffect)(()=>{m()},[]),(0,J.useEffect)(()=>{if(!r?.busy)return;let e=setInterval(()=>void m(),3e3);return()=>clearInterval(e)},[r?.busy]),Ge(r?.busy??null,()=>n(`Done: the tests and their links are up to date.`));let h=(0,J.useMemo)(()=>new Map(e.map(e=>[e.key,e])),[e]);if(a)return(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:a});if(!r)return(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`});let g=r.tests.filter(e=>e.uid),_={all:g.length,unlinked:g.filter(e=>!e.cases.length).length,linked:g.filter(e=>e.cases.length).length,code:g.filter(e=>e.via===`code`).length},v=g.filter(e=>s===`all`||(s===`unlinked`?!e.cases.length:s===`linked`?e.cases.length>0:e.via===`code`)),y=async()=>{try{n(`The mapping agent is looking at ${(await Y.proposeLinks()).cases} cases with no test.`),m()}catch(e){n(e.message)}};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(L,{variant:`primary`,onClick:()=>u(!0),disabled:!!r.busy,children:[(0,Z.jsx)(t,{"aria-hidden":`true`}),`Discover tests`]}),(0,Z.jsxs)(L,{onClick:()=>void y(),disabled:!!r.busy||!g.length,"data-tip":`The mapping agent links cases that have no test to the tests that check them`,children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Link with the agent`]}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[r.busy?r.busy.what===`discover`?`Discovering tests, started ${K(r.busy.started)}…`:`The mapping agent is at work, started ${K(r.busy.started)}…`:r.discovery?`Discovered ${K(r.discovery.at)}.`:`Not discovered yet: these are read from the code.`,r.proposed>0&&` ${r.proposed} link${r.proposed===1?``:`s`} proposed, waiting on the cases' pages.`]})]}),r.error&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:r.error}),r.discovery&&r.discovery.projects.length>0&&(0,Z.jsx)(Ke,{projects:r.discovery.projects}),g.length?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Z.jsx)(oe,{items:[{id:`all`,label:`All`,n:_.all},{id:`unlinked`,label:`No test case`,n:_.unlinked},{id:`linked`,label:`Linked`,n:_.linked},{id:`code`,label:`Read from the code`,n:_.code,tip:`Their framework was not asked, or could not list them`}],value:s,onChange:c})}),(0,Z.jsx)(V,{label:`Automated tests`,placeholder:`Find a test by id, name, file or tag`,resetKey:s,empty:`No test matches.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-[45%]`),children:`Test`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Framework`}),(0,Z.jsx)(`th`,{className:R,children:`Test cases`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @3xl:table-cell`),children:`Tags`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Last runs`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:v.map(t=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsxs)(`td`,{className:k(H,`max-w-0`),children:[(0,Z.jsx)(Q,{text:t.name,tip:t.nativeId??t.name}),(0,Z.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-2 text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:t.uid}),t.file&&(0,Z.jsxs)(`span`,{className:`truncate font-mono`,children:[t.file,t.line?`:${t.line}`:``]}),t.flaky&&(0,Z.jsx)(j,{tone:`warn`,children:`Flaky`})]})]}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] @2xl:table-cell`),children:(0,Z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Z.jsxs)(`span`,{children:[We[t.framework??`code`],t.framework===`gherkin`?`, ${t.runner??`no runner found`}`:``]}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:ve[t.via??`runs`]})]})}),(0,Z.jsx)(`td`,{className:k(H,`text-[13px]`),children:t.cases.length?(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-x-2`,children:[t.cases.slice(0,4).map(e=>(0,Z.jsx)(`a`,{href:He(e),className:`font-mono`,"data-tip":h.get(e)?.title,children:h.get(e)?.id??e},e)),t.cases.length>4&&(0,Z.jsxs)(`span`,{className:`text-muted`,children:[`+`,t.cases.length-4]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None`})}),(0,Z.jsx)(`td`,{className:k(H,`hidden @3xl:table-cell`),children:(0,Z.jsx)(Ie,{tags:t.tags})}),(0,Z.jsx)(`td`,{className:k(H,`hidden @2xl:table-cell`),children:(0,Z.jsx)(Fe,{runs:t.runs})}),(0,Z.jsx)(`td`,{className:k(H,`text-right`),children:(0,Z.jsxs)(L,{size:`sm`,onClick:()=>p(t),"aria-label":`Link ${t.name} to a test case`,disabled:!e.length,children:[(0,Z.jsx)(T,{"aria-hidden":`true`}),`Link`]})})]},t.uid))})]}):(0,Z.jsx)(M,{icon:d,title:`No automated test found yet`,children:`Discover tests asks each test project's framework (pytest, .NET, Playwright, Vitest, Jest, Mocha, Robot Framework) for its tests. Set the automation repository in Settings › Code first.`}),(0,Z.jsx)(qe,{open:l,onClose:()=>u(!1),onStarted:()=>{u(!1),n(`Discovering tests: each project's framework lists its tests.`),m()}}),(0,Z.jsx)(Je,{open:!!f,title:`Link to a test case`,description:f?`Pick the test case ${f.name} checks. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`:void 0,items:e.filter(e=>!f?.cases.includes(e.key)).map(e=>({id:e.key,label:e.title,sub:e.id})),onClose:()=>p(null),onPick:async e=>{f?.uid&&(await Y.link([{case:e,test:f.uid,action:`link`}]),p(null),n(`Linked ${f.uid} to ${h.get(e)?.id??e}.`),m())}})]})}var We={pytest:`pytest`,dotnet:`.NET`,playwright:`Playwright`,jest:`Jest`,vitest:`Vitest`,mocha:`Mocha`,robot:`Robot Framework`,gherkin:`Gherkin`,code:`Code`};function Ge(e,t){let[n,r]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{e?r(!0):n&&(r(!1),t())},[e]),n}function Ke({projects:e}){return(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:e.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-start gap-2`,children:[e.ok?(0,Z.jsx)(i,{size:14,"aria-label":`Listed`,className:`mt-1 flex-none text-pass`}):(0,Z.jsx)(_,{size:14,"aria-label":`Not listed`,className:`mt-1 flex-none text-warn`}),(0,Z.jsxs)(`span`,{children:[e.label,` in `,e.dir?(0,Z.jsx)(`span`,{className:`font-mono`,children:e.dir}):`the repository's root`,`: `,e.ok?`${e.tests} test${e.tests===1?``:`s`}`:`not listed by its framework, read from the code`,e.error&&(0,Z.jsx)(`span`,{className:`block text-muted [overflow-wrap:anywhere]`,children:e.error})]})]},`${e.framework}-${e.dir}-${t}`))})}function qe({open:e,onClose:t,onStarted:n}){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(!1);(0,J.useEffect)(()=>{e&&(i(null),o(``),Y.discoveryPlan().then(i,e=>o(e.message)))},[e]);let l=async()=>{if(r){c(!0);try{await Y.discover(r.digest),n()}catch(e){o(e.message)}finally{c(!1)}}};return(0,Z.jsx)(B,{open:e,onClose:t,title:`Discover tests`,description:`Each test project's framework lists its tests, as a test explorer asks it. This runs the repository's code (pytest imports conftest.py, .NET builds the project) with no secret of ForgeQE's, so look at what will run first.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(L,{onClick:t,children:`Cancel`}),(0,Z.jsxs)(L,{variant:`primary`,onClick:()=>void l(),disabled:!r||s,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Discover`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-[13px]`,children:[a&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:a}),!r&&!a&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Finding the test projects…`}),r&&!r.steps.length&&(0,Z.jsx)(`p`,{className:`m-0 text-ink-2`,children:`No test project was found whose framework can be asked. Gherkin features and the code are still read.`}),r&&r.steps.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:r.steps.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{children:[We[e.project.framework],` in `,e.project.dir?(0,Z.jsx)(`span`,{className:`font-mono`,children:e.project.dir}):`the repository's root`]}),(0,Z.jsx)(`code`,{className:`rounded-[8px] bg-surface-strong px-2 py-1 font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.command})]},t))})]})})}function Je({open:e,title:t,description:n,items:r,onClose:i,onPick:a}){let[o,s]=(0,J.useState)(``),[c,u]=(0,J.useState)(``);(0,J.useEffect)(()=>s(``),[e]);let d=async e=>{u(e),s(``);try{await a(e)}catch(e){s(e.message)}finally{u(``)}};return(0,Z.jsx)(B,{open:e,onClose:i,title:t,description:n,wide:!0,footer:(0,Z.jsx)(L,{onClick:i,children:`Close`}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o&&(0,Z.jsxs)(`p`,{role:`alert`,className:`m-0 flex items-center gap-2 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(l,{size:14,"aria-hidden":`true`}),o]}),(0,Z.jsx)(V,{label:t,placeholder:`Find by id or words`,resetKey:String(e),empty:`Nothing to pick.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:R,children:`Name`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Pick`})})]}),children:r.map(e=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsxs)(`td`,{className:k(H,`max-w-0`),children:[(0,Z.jsx)(Q,{text:e.label}),e.sub&&(0,Z.jsx)(`span`,{className:`block truncate font-mono text-[13px] text-muted`,children:e.sub})]}),(0,Z.jsx)(`td`,{className:k(H,`w-24 text-right`),children:(0,Z.jsxs)(L,{size:`sm`,onClick:()=>void d(e.id),disabled:!!c,children:[(0,Z.jsx)(T,{"aria-hidden":`true`}),`Link`]})})]},e.id))})]})})}var Ye=e=>e&&/^https:\/\//i.test(e)?e:void 0;function Xe({caseKey:e,onRun:t}){let[n,r]=(0,J.useState)(null),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(``);(0,J.useEffect)(()=>{r(null),Y.case(e).then(e=>{r(e),a(``)},e=>a(e.message))},[e]);let d=(0,Z.jsxs)(`a`,{href:F(`test-management`,`cases`),className:`inline-flex w-fit items-center gap-2 text-[13px]`,children:[(0,Z.jsx)(m,{size:14,"aria-hidden":`true`}),`Test cases`]});if(i)return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[d,(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:i})]});if(!n)return(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`});let p=n.case,g=Ye(p.url);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[d,(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_420px] flex-col gap-2`,children:[(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:p.id}),` · `,p.plans.join(`, `)||`Not in a synced plan`]}),(0,Z.jsx)(`h2`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:p.title}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[p.priority&&(0,Z.jsxs)(j,{tone:p.priority===1?`fail`:p.priority===2?`warn`:`neutral`,icon:!1,children:[`Priority `,p.priority]}),p.state&&(0,Z.jsx)(j,{tone:`neutral`,children:p.state}),(0,Z.jsx)(Ne,{a:p.automation}),p.origin===`forgeqe`&&(0,Z.jsxs)(j,{tone:`running`,icon:!1,children:[(0,Z.jsx)(E,{size:12,"aria-hidden":`true`}),`Written by ForgeQE`,p.createdAt?` ${K(p.createdAt)}`:``]})]})]}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[g&&(0,Z.jsxs)(`a`,{className:re(),href:g,target:`_blank`,rel:`noreferrer noopener`,children:[(0,Z.jsx)(h,{"aria-hidden":`true`}),`Open in its system`]}),p.how!==`none`&&p.how!==`tracker`&&!!p.test?.file&&p.trackerAutomated!==!0&&(0,Z.jsxs)(L,{onClick:()=>s(`automation`),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Mark automated in its system`]}),p.ownTags.some(e=>!p.trackerTags.includes(e))&&(0,Z.jsxs)(L,{onClick:()=>s(`tags`),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Write tags to its system`]}),p.ownTags.some(e=>p.trackerTags.includes(e))&&(0,Z.jsxs)(L,{onClick:()=>s(`untag`),children:[(0,Z.jsx)(ee,{"aria-hidden":`true`}),`Take tags off in its system`]}),(0,Z.jsxs)(L,{variant:`primary`,onClick:()=>t([p.key]),children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Run`]})]})]}),(0,Z.jsx)(ke,{kind:o,keys:[p.key],onClose:()=>s(null),onDone:t=>(l(t),void Y.case(e).then(r,()=>{}))}),c&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:c}),(p.stale||p.drift)&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 flex items-start gap-2 rounded-[12px] bg-warn-soft px-4 py-2 text-[13px] text-warn`,children:[(0,Z.jsx)(_,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none`}),(0,Z.jsxs)(`span`,{children:[p.stale&&`Its steps changed in its system after its test was written: the next run updates the test. `,p.drift&&(p.trackerAutomated?`Its system marks it automated, but ForgeQE knows no test for it.`:`ForgeQE has a test for it, but its system does not mark it automated.`)]})]}),(0,Z.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsx)(V,{label:`Steps`,search:!1,empty:`Its system holds no steps for it, or it is not in a synced plan.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-10`),children:`#`}),(0,Z.jsx)(`th`,{className:R,children:`Action`}),(0,Z.jsx)(`th`,{className:R,children:`Expected result`})]}),children:n.steps.map((e,t)=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,Z.jsx)(`td`,{className:k(H,`text-[13px] text-muted tabular-nums`),children:t+1}),(0,Z.jsx)(`td`,{className:k(H,`text-[13px] [overflow-wrap:anywhere]`),children:e.action}),(0,Z.jsx)(`td`,{className:k(H,`text-[13px] text-ink-2 [overflow-wrap:anywhere]`),children:e.expected??`–`})]},t))}),(0,Z.jsx)(Ze,{detail:n,onChanged:t=>(l(t),void Y.case(e).then(r,()=>{}))})]}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6 text-[13px]`,children:[(0,Z.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:`Details`}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[96px_1fr] gap-x-4 gap-y-2`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Last run`}),(0,Z.jsxs)(`dd`,{className:`m-0 flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(Pe,{o:p.lastRun.outcome}),p.lastRun.at&&(0,Z.jsxs)(`span`,{className:`text-muted`,children:[K(p.lastRun.at),p.lastRun.by===`tracker`?`, in its system`:``]})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Suite`}),(0,Z.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:p.suite??`–`}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Area`}),(0,Z.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:p.group??`–`}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Stories`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:p.stories.join(`, `)||`–`}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Tags`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:p.tags.length?(0,Z.jsx)(Ie,{tags:p.tags,max:10}):`–`}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Steps`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:p.steps})]})]}),(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-2 rounded-[14px] border p-6 text-[13px]`,children:[(0,Z.jsxs)(`h3`,{className:`m-0 flex items-center gap-2 text-[16px] font-semibold`,children:[(0,Z.jsx)(f,{size:16,"aria-hidden":`true`}),`In suites and packs`]}),n.suites.length||p.packs.length?(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[n.suites.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`a`,{href:F(`test-management`,`suites`,e.id),children:e.name})},e.id)),p.packs.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:F(`regression`,e),children:[`Pack `,e]})},e))]}):(0,Z.jsx)(`p`,{className:`m-0 text-muted`,children:`In no suite or regression pack.`})]}),n.changes.length>0&&(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-2 rounded-[14px] border p-6 text-[13px]`,children:[(0,Z.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:`What ForgeQE did`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:n.changes.map((e,t)=>(0,Z.jsxs)(`li`,{className:`[overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`span`,{className:`text-muted`,children:K(e.at)}),` `,e.action,e.story?` for ${e.story}`:``,e.reason?`: ${e.reason}`:``]},t))})]})]})]})]})}function Ze({detail:e,onChanged:t}){let n=e.case,[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(!1),[s,l]=(0,J.useState)(``);(0,J.useEffect)(()=>{(n.proposed.length||a)&&Y.tests().then(e=>i(e.tests),()=>{})},[n.proposed.length,a]);let u=new Map((r??[]).filter(e=>e.uid).map(e=>[e.uid,e])),f=async(e,r,i)=>{l(``);try{await Y.link([{case:n.key,test:e,action:r}]),t(i)}catch(e){l(e.message)}},p=async e=>{l(``);try{t(`${e} is the main test now${(await Y.setMain(n.key,e)).mapped?`, and ForgeQE's mapping records it`:``}. Mark automated writes it to the tracker.`)}catch(e){l(e.message)}},m=async()=>{l(``);try{await Y.proposeLinks([n.key]),t(`The mapping agent is looking for this case's tests. Open the case again in a moment.`)}catch(e){l(e.message)}};return(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`h3`,{className:`m-0 flex flex-1 items-center gap-2 text-[16px] font-semibold`,children:[(0,Z.jsx)(d,{size:16,"aria-hidden":`true`}),`Automated tests`]}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>o(!0),children:[(0,Z.jsx)(T,{"aria-hidden":`true`}),`Link a test`]}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>void m(),"data-tip":`The mapping agent picks the tests that check this case`,children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),`Ask the agent`]})]}),s&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:s}),n.tests.length?(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0 text-[13px]`,children:n.tests.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-start gap-2 border-t border-line-soft py-2 first:border-t-0`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 [overflow-wrap:anywhere]`,children:[e.name,e.main&&n.tests.length>1&&(0,Z.jsx)(`span`,{"data-tip":`What its tracker records as its automated test, and what a run reuses first`,children:(0,Z.jsx)(j,{tone:`pass`,icon:!1,children:`Main test`})})]}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-x-2 text-[13px] text-muted`,children:[e.uid&&(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.uid}),e.file&&(0,Z.jsx)(`span`,{className:`font-mono [overflow-wrap:anywhere]`,children:e.file})]}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[_e[e.how],e.why&&e.why!==_e[e.how]?`: ${e.why}`:``]})]}),e.uid&&n.tests.length>1&&!e.main&&(0,Z.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>void p(e.uid),"aria-label":`Make ${e.name} the main test`,"data-tip":`Its tracker records this one as the case's automated test`,children:[(0,Z.jsx)(v,{"aria-hidden":`true`}),`Make main`]}),e.uid&&e.how!==`mapping`&&(0,Z.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>void f(e.uid,`unlink`,`Unlinked ${e.uid}. It is not linked again by itself.`),"aria-label":`Unlink ${e.name}`,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Unlink`]})]},e.uid??e.key))}):n.test?(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[120px_1fr] gap-x-4 gap-y-2 text-[13px]`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Test`}),(0,Z.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:n.test.name}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`File`}),(0,Z.jsx)(`dd`,{className:`m-0 font-mono [overflow-wrap:anywhere]`,children:n.test.file??`–`}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Known from`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:n.how===`none`?`–`:_e[n.how]})]}):(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No automated test is linked. Link one, ask the agent, or ask the agent on the right to automate it.`}),(n.tests.length>0||n.test)&&(0,Z.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-[13px] text-muted`,children:[`Last runs `,(0,Z.jsx)(Fe,{runs:e.test?.runs??n.runs})]}),n.proposed.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-[12px] bg-surface-muted p-4 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Proposed by the mapping agent`}),n.proposed.map(e=>{let t=u.get(e.test);return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col`,children:[(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:t?.name??e.test}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.test}),e.confidence?` · ${e.confidence} confidence`:``,e.why?` · ${e.why}`:``]})]}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>void f(e.test,`accept`,`Linked ${e.test}.`),children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Accept`]}),(0,Z.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>void f(e.test,`refuse`,`Refused ${e.test}.`),children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Refuse`]})]},e.test)})]}),(0,Z.jsx)(Je,{open:a,title:`Link a test`,description:`Pick a test that checks ${n.id}. It is kept in .forgeqe/testmgmt/links.json, shared with the team.`,items:(r??[]).filter(e=>e.uid&&!n.tests.some(t=>t.uid===e.uid)).map(e=>({id:e.uid,label:e.name,sub:`${e.uid}${e.file?` · ${e.file}`:``}`})),onClose:()=>o(!1),onPick:async e=>{await Y.link([{case:n.key,test:e,action:`link`}]),o(!1),t(`Linked ${e}.`)}})]})}var Qe=[{id:`all`,label:`All`,icon:S,test:()=>!0},{id:`not_automated`,label:`Not automated`,icon:o,test:e=>e.automation===`not_automated`},{id:`failing`,label:`Failing`,icon:l,test:Ve,alert:!0},{id:`pending`,label:`Pending`,icon:s,test:e=>e.automation===`pending`},{id:`generated`,label:`Generated by ForgeQE`,icon:E,test:e=>e.origin===`forgeqe`},{id:`stale`,label:`Steps changed`,icon:_,test:e=>e.stale},{id:`drift`,label:`Tracker disagrees`,icon:_,test:e=>e.drift}],$=``,$e=e=>[...new Set(e.filter(e=>!!e))].sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0}));function et({cases:e,tests:t=0,selected:n,onSelect:r,onRun:i,onChanged:a}){let[o,s]=(0,J.useState)(`all`),[l,d]=(0,J.useState)($),[p,m]=(0,J.useState)($),[h,g]=(0,J.useState)($),[_,v]=(0,J.useState)($),[ee,x]=(0,J.useState)(!1),[S,C]=(0,J.useState)(!1),[w,te]=(0,J.useState)(null),T=(0,J.useMemo)(()=>$e(e.flatMap(e=>e.plans)),[e]),D=(0,J.useMemo)(()=>$e(e.map(e=>e.suite)),[e]),O=(0,J.useMemo)(()=>$e(e.flatMap(e=>e.tags)),[e]),ne=e.filter(e=>(!l||e.plans.includes(l))&&(!p||e.suite===p)&&(!h||String(e.priority??``)===h)&&(!_||e.tags.includes(_))),re=Qe.find(e=>e.id===o),A=ne.filter(re.test),j=new Set(n),ie=(e,t)=>r(t?[...n,e]:n.filter(t=>t!==e)),ae=A.length>0&&A.every(e=>j.has(e.key));return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n.length>0&&(0,Z.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-accent-soft px-4 py-2 text-[13px] text-accent-fg`,children:[(0,Z.jsxs)(`span`,{className:`font-medium`,children:[n.length,` selected`]}),(0,Z.jsxs)(L,{size:`sm`,variant:`ghost`,onClick:()=>r([]),children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Clear`]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>x(!0),children:[(0,Z.jsx)(y,{"aria-hidden":`true`}),`Tag`]}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>C(!0),children:[(0,Z.jsx)(f,{"aria-hidden":`true`}),`Make a suite`]}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>te(`automation`),"data-tip":`Mark the picked cases automated in their tracker`,children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Mark automated`]}),(0,Z.jsxs)(L,{size:`sm`,onClick:()=>te(`tags`),"data-tip":`Write ForgeQE's tags to their tracker`,children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Write tags`]}),(0,Z.jsxs)(L,{size:`sm`,variant:`primary`,onClick:()=>i(n),children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Run `,n.length]})]}),(0,Z.jsx)(V,{label:`Test cases`,placeholder:`Find a case by id, title, tag or test`,resetKey:`${o}|${l}|${p}|${h}|${_}`,empty:e.length?`Nothing matches.`:t?`No test cases yet. The repository's ${t} automated test${t===1?` is`:`s are`} on the Automated tab.`:`No test cases yet.`,tools:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Z.jsx)(oe,{items:Qe.map(e=>({id:e.id,label:e.label,icon:e.icon,n:ne.filter(e.test).length,...e.alert?{alert:!0}:{}})),value:o,onChange:s})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[T.length>1&&(0,Z.jsxs)(N,{size:`sm`,"aria-label":`Plan`,value:l,onChange:e=>d(e.target.value),className:`w-auto`,children:[(0,Z.jsx)(`option`,{value:$,children:`Every plan`}),T.map(e=>(0,Z.jsx)(`option`,{children:e},e))]}),D.length>0&&(0,Z.jsxs)(N,{size:`sm`,"aria-label":`Suite`,value:p,onChange:e=>m(e.target.value),className:`w-auto`,children:[(0,Z.jsx)(`option`,{value:$,children:`Every suite`}),D.map(e=>(0,Z.jsx)(`option`,{children:e},e))]}),(0,Z.jsxs)(N,{size:`sm`,"aria-label":`Priority`,value:h,onChange:e=>g(e.target.value),className:`w-auto`,children:[(0,Z.jsx)(`option`,{value:$,children:`Any priority`}),[`1`,`2`,`3`,`4`].map(e=>(0,Z.jsxs)(`option`,{value:e,children:[`Priority `,e]},e))]}),O.length>0&&(0,Z.jsxs)(N,{size:`sm`,"aria-label":`Tag`,value:_,onChange:e=>v(e.target.value),className:`w-auto`,children:[(0,Z.jsx)(`option`,{value:$,children:`Any tag`}),O.map(e=>(0,Z.jsx)(`option`,{children:e},e))]})]})]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-10`),children:(0,Z.jsx)(q,{"aria-label":`Select every case shown`,checked:ae,onCheckedChange:e=>r(e?$e([...n,...A.map(e=>e.key)]):n.filter(e=>!A.some(t=>t.key===e)))})}),(0,Z.jsx)(`th`,{className:R,children:`Test case`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Suite`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Priority`}),(0,Z.jsx)(`th`,{className:R,children:`Automation`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @4xl:table-cell`),children:`Last runs`}),(0,Z.jsx)(`th`,{className:R,children:`Last run`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:A.map(e=>(0,Z.jsxs)(`tr`,{className:k(`border-t border-line-soft align-top hover:bg-surface-muted`,j.has(e.key)&&`bg-accent-soft hover:bg-accent-soft`),children:[(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(q,{"aria-label":`Select ${e.id}`,checked:j.has(e.key),onCheckedChange:t=>ie(e.key,t)})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsxs)(`a`,{href:He(e.key),className:`flex min-w-[220px] flex-col gap-1 text-ink no-underline`,children:[(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.id}),e.origin===`forgeqe`&&(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1`,"data-tip":`ForgeQE wrote this case`,children:[(0,Z.jsx)(E,{size:12,"aria-hidden":`true`}),`ForgeQE`]}),e.stories[0]&&(0,Z.jsx)(`span`,{children:e.stories[0]}),(0,Z.jsx)(Ie,{tags:e.tags,max:2})]})]})}),(0,Z.jsx)(`td`,{className:k(H,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:(0,Z.jsx)(Q,{text:e.suite??e.plans[0]??`–`})}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] @2xl:table-cell`),children:e.priority?`P${e.priority}`:`–`}),(0,Z.jsxs)(`td`,{className:H,children:[(0,Z.jsx)(Ne,{a:e.automation}),e.stale&&(0,Z.jsx)(`span`,{className:`mt-1 block text-[13px] text-warn`,children:`Steps changed`})]}),(0,Z.jsx)(`td`,{className:k(H,`hidden @4xl:table-cell`),children:(0,Z.jsx)(Fe,{runs:e.runs})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(`span`,{"data-tip":e.lastRun.at?`${K(e.lastRun.at)}${e.lastRun.by===`tracker`?`, in its system`:``}`:void 0,children:(0,Z.jsx)(Pe,{o:e.lastRun.outcome})})}),(0,Z.jsx)(`td`,{className:k(H,`text-right whitespace-nowrap`),children:(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.id}`,"data-tip":Ve(e)?`Run again`:`Run`,onClick:()=>i([e.key]),children:(0,Z.jsx)(b,{"aria-hidden":`true`})})})]},e.key))}),(0,Z.jsx)(ke,{kind:w,keys:n,onClose:()=>te(null),onDone:e=>a(e)}),(0,Z.jsx)(tt,{open:ee,keys:n,onClose:()=>x(!1),onDone:e=>a(e)}),(0,Z.jsx)(nt,{open:S,keys:n,onClose:()=>C(!1),onDone:e=>a(e)})]})}function tt({open:e,keys:t,onClose:n,onDone:r}){let[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(!1),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),p=async()=>{f(!0),u(``);try{let e={[o?`remove`:`add`]:[i.trim()],cases:t};await Y.tag(e);let s=await Y.tag(e,!0);r(`${o?`Removed`:`Added`} the tag ${i.trim()} ${o?`from`:`on`} ${s.changed??0} case${s.changed===1?``:`s`}.`),a(``),n()}catch(e){u(e.message)}finally{f(!1)}};return(0,Z.jsx)(B,{open:e,onClose:n,title:`Tag ${t.length} test case${t.length===1?``:`s`}`,description:`ForgeQE keeps its tags in .forgeqe/testmgmt/tags.json, shared with the team through the repository. The case's own tags in its system do not change.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:n,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(L,{variant:`primary`,disabled:d||!i.trim(),onClick:()=>void p(),children:[(0,Z.jsx)(y,{"aria-hidden":`true`}),o?`Remove`:`Add`,` tag`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Tag`,(0,Z.jsx)(A,{value:i,maxLength:40,placeholder:`smoke, release-24.11`,onChange:e=>a(e.target.value)})]}),(0,Z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(q,{checked:o,onCheckedChange:s}),`Remove it instead`]}),l&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:l})]})})}function nt({open:e,keys:t,onClose:n,onDone:r}){let[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(``),[l,u]=(0,J.useState)(!1),d=async()=>{u(!0),s(``);try{let{suite:e}=await Y.saveSuite({name:i.trim(),groups:[],exclude:[],picked:t});r(`Made the suite ${e.name}.`),a(``),n(),location.hash=F(`test-management`,`suites`,e.id)}catch(e){s(e.message)}finally{u(!1)}};return(0,Z.jsx)(B,{open:e,onClose:n,title:`A suite of ${t.length} test case${t.length===1?``:`s`}`,description:`Kept in .forgeqe/testmgmt/suites.json. For a suite that keeps up as plans change, ask the Suite agent on Suites.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:n,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(L,{variant:`primary`,disabled:l||!i.trim(),onClick:()=>void d(),children:[(0,Z.jsx)(f,{"aria-hidden":`true`}),`Make the suite`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Name`,(0,Z.jsx)(A,{value:i,maxLength:80,placeholder:`Saved cards`,onChange:e=>a(e.target.value)})]}),o&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:o})]})})}var rt=e=>new Date(`${e}T00:00:00Z`).toLocaleDateString([],{month:`short`,day:`numeric`,timeZone:`UTC`}),it=(e,t)=>t?Math.round(e/t*100):0;function at(e,t,n){if(e.length<2)return;let r=e.at(-1),i=new Date(`${r.day}T00:00:00Z`).getTime()-6048e5,a=[...e].reverse().find(e=>new Date(`${e.day}T00:00:00Z`).getTime()<=i)??e[0],o=t(r)-t(a);return{text:`${o>0?`+`:``}${o}`,dir:o>0?`up`:o<0?`down`:`same`,...n===void 0||o===0?{}:{good:o>0===n},against:`since ${rt(a.day)}`}}function ot({view:e,onRunSuite:t}){let n=e.summary;if(!n.cases&&!e.plans.length&&n.tests)return(0,Z.jsx)(M,{icon:d,title:`${n.tests} automated test${n.tests===1?``:`s`} found, no test case yet`,action:(0,Z.jsxs)(`a`,{className:re({size:`sm`}),href:F(`test-management`,`tests`),"data-tip":`Open the Automated tab`,children:[(0,Z.jsx)(C,{"aria-hidden":`true`}),`See the tests`]}),children:`These are the tests in the automation repository's code. Add a test plan in Settings › Integrations (Azure DevOps, Xray, TestRail, Zephyr Scale or qTest) to see the test cases they cover, which are automated and which are not.`});if(!n.cases&&!e.plans.length)return(0,Z.jsx)(M,{icon:S,title:`No test plans connected yet`,action:(0,Z.jsxs)(`a`,{className:re({size:`sm`}),href:F(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,Z.jsx)(C,{"aria-hidden":`true`}),`Settings`]}),children:`Add a test plan under Test plans in Test management, in your test case system's settings (Azure DevOps, Xray, TestRail, Zephyr Scale or qTest). Its cases show here with their automation, runs and gaps. Cases ForgeQE wrote or automated show here already.`});let r=e.trend;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(le,{label:`Headline numbers`,children:[(0,Z.jsx)(G,{label:`Test cases`,icon:S,value:n.cases,change:at(r,e=>e.cases,void 0),note:`${e.plans.length} plan${e.plans.length===1?``:`s`}`}),(0,Z.jsx)(G,{label:`Automated`,icon:i,value:`${n.automated} · ${it(n.automated,n.cases)}%`,change:at(r,e=>e.automated,!0),note:`${n.newlyAutomated} newly this week`}),(0,Z.jsx)(G,{label:`Not automated`,icon:o,value:n.notAutomated,change:at(r,e=>e.notAutomated,!1)}),(0,Z.jsx)(G,{label:`Pending`,icon:s,value:n.pending,tone:n.pending?`text-warn`:void 0,change:at(r,e=>e.pending,!1),note:`in Design or not ready`}),(0,Z.jsx)(G,{label:`Failing`,icon:l,value:n.failing,tone:n.failing?`text-fail`:void 0,change:at(r,e=>e.failing,!1),note:`their last run`}),(0,Z.jsx)(G,{label:`Generated by ForgeQE`,icon:E,value:n.generated,change:at(r,e=>e.generated,!0)})]}),(0,Z.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-2`,children:[(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Automation coverage`}),(0,Z.jsx)(Le,{label:`Share of test cases automated`,points:r.map(e=>({x:rt(e.day),y:it(e.automated,e.cases)})),format:e=>`${e}%`})]}),(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Generated and automated, by week`}),(0,Z.jsx)(Re,{label:`Test cases generated and automated each week`,series:[{name:`Generated`,className:`bg-accent-line`},{name:`Automated`,className:`bg-accent`}],items:e.weekly.map(e=>({x:rt(e.week),values:[e.generated,e.automated]}))})]}),(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Last run of every case`}),(0,Z.jsxs)(`div`,{role:`img`,"aria-label":`Passed ${n.cases-n.failing-n.neverRun}, failing ${n.failing}, not run ${n.neverRun}`,className:`flex h-3 gap-1 overflow-hidden rounded-full`,children:[(0,Z.jsx)(`span`,{className:`bg-pass`,style:{flex:n.cases-n.failing-n.neverRun}}),(0,Z.jsx)(`span`,{className:`bg-fail`,style:{flex:n.failing}}),(0,Z.jsx)(`span`,{className:`bg-line-strong`,style:{flex:n.neverRun}})]}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-4 text-[13px]`,children:[(0,Z.jsx)(`a`,{href:F(`test-management`,`cases`),className:`no-underline`,children:(0,Z.jsxs)(j,{tone:`pass`,children:[`Passed `,n.cases-n.failing-n.neverRun]})}),(0,Z.jsx)(`a`,{href:F(`test-management`,`gaps`),className:`no-underline`,children:(0,Z.jsxs)(j,{tone:`fail`,children:[`Failing `,n.failing]})}),(0,Z.jsx)(`a`,{href:F(`test-management`,`gaps`),className:`no-underline`,children:(0,Z.jsxs)(j,{tone:`neutral`,children:[`Not run `,n.neverRun]})})]})]}),(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline justify-between gap-4`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Automated, by suite`}),(0,Z.jsx)(`a`,{href:F(`test-management`,`gaps`),className:`text-[13px]`,children:`Find gaps`})]}),e.coverage.length?e.coverage.slice(0,8).map(e=>(0,Z.jsx)(ze,{label:e.suite,part:e.automated,whole:e.cases},e.suite)):(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`No suites yet.`})]})]}),(0,Z.jsx)(V,{label:`Suites`,placeholder:`Find a suite`,empty:`No suites yet: ask the Suite agent for one on Suites.`,search:e.suites.length>8,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:R,children:`Suite`}),(0,Z.jsx)(`th`,{className:U,children:`Cases`}),(0,Z.jsx)(`th`,{className:R,children:`Last run`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.suites.map(e=>(0,Z.jsxs)(`tr`,{className:W,onClick:()=>location.hash=F(`test-management`,`suites`,e.id),children:[(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(`a`,{href:F(`test-management`,`suites`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium`,children:e.name})}),(0,Z.jsx)(`td`,{className:z,children:e.cases}),(0,Z.jsx)(`td`,{className:H,children:e.last?(0,Z.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-2 text-[13px]`,children:[(0,Z.jsxs)(j,{tone:e.last.failed?`fail`:`pass`,children:[e.last.passed,` passed`,e.last.failed?`, ${e.last.failed} failed`:``]}),(0,Z.jsx)(`span`,{className:`text-muted`,children:K(e.last.at)})]}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not run`})}),(0,Z.jsxs)(`td`,{className:`${H} text-right whitespace-nowrap`,onClick:e=>e.stopPropagation(),children:[!!e.last?.failed&&(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Rerun the failed cases of ${e.name}`,"data-tip":`Rerun failed`,onClick:()=>t(e.id,`failed`),children:(0,Z.jsx)(O,{"aria-hidden":`true`})}),(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.name}`,"data-tip":`Run`,onClick:()=>t(e.id),children:(0,Z.jsx)(b,{"aria-hidden":`true`})})]})]},e.id))}),(0,Z.jsxs)(`p`,{className:`m-0 flex items-center gap-2 text-[13px] text-muted`,children:[(0,Z.jsx)(d,{size:14,"aria-hidden":`true`}),n.tests,` automated tests known, `,n.testsWithoutCase,` with no test case behind them.`]})]})}var st=e=>e&&/^https:\/\//i.test(e)?e:void 0;function ct({id:e,title:t,url:n}){let r=st(n);return(0,Z.jsxs)(`span`,{className:`flex min-w-[220px] flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:t}),r?(0,Z.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`font-mono text-[13px] text-accent-fg`,children:e}):(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-accent-fg`,children:e})]})}var lt={azure_devops:[{key:`sprint`,label:`Sprint`,placeholder:`current, or Sprint 24`},{key:`iteration`,label:`Iteration path`,placeholder:`Shop\\Release 3`},{key:`area`,label:`Area path`,placeholder:`Shop\\Checkout`},{key:`parent`,label:`Epic or feature`,placeholder:`1234`,number:!0},{key:`ids`,label:`Work item ids`,placeholder:`101, 102`,list:`numbers`},{key:`project`,label:`Project`,placeholder:`When Settings names none`}],jira:[{key:`sprint`,label:`Sprint`,placeholder:`current, or Sprint 24`},{key:`fixVersion`,label:`Fix version`,placeholder:`2.4.0`},{key:`epic`,label:`Epic`,placeholder:`SHOP-12`},{key:`keys`,label:`Story keys`,placeholder:`SHOP-101, SHOP-102`,list:`keys`},{key:`project`,label:`Project key`,placeholder:`SHOP`}],qtest:[{key:`module`,label:`Requirements module`,placeholder:`Module id, e.g. 1203`,number:!0},{key:`ids`,label:`Requirement ids`,placeholder:`5101, 5102`,list:`numbers`}]};function ut(e,t){let n={system:e};for(let r of lt[e]){let i=(t[r.key]??``).trim();i&&(r.list===`numbers`?n[r.key]=i.split(/[\s,]+/).filter(Boolean).map(Number):r.list===`keys`?n[r.key]=i.split(/[\s,]+/).filter(Boolean).map(e=>e.toUpperCase()):r.number?n[r.key]=Number(i):n[r.key]=r.key===`project`&&e===`jira`?i.toUpperCase():i)}return n}var dt=e=>Object.fromEntries(Object.entries(e??{}).filter(([e])=>e!==`system`).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]));function ft({gaps:e,onRead:t}){let[r,i]=(0,J.useState)(e.live?.system??`azure_devops`),[a,o]=(0,J.useState)(dt(e.live)),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(``);(0,J.useEffect)(()=>{e.live&&(i(e.live.system),o(dt(e.live)))},[e.live]);let d=async()=>{c(!0),u(``);try{await Y.readStories(ut(r,a)),t()}catch(e){u(e.message)}finally{c(!1)}};return(0,Z.jsxs)(`form`,{className:`card flex flex-col gap-4 rounded-[14px] border p-4`,onSubmit:e=>{e.preventDefault(),d()},children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`text-muted`,children:`Stories in`}),(0,Z.jsxs)(N,{size:`sm`,value:r,onChange:e=>(i(e.target.value),o({})),className:`w-auto`,children:[(0,Z.jsx)(`option`,{value:`azure_devops`,children:`Azure DevOps`}),(0,Z.jsx)(`option`,{value:`jira`,children:`Jira (also Xray and Zephyr Scale)`}),(0,Z.jsx)(`option`,{value:`qtest`,children:`qTest requirements`})]})]}),lt[r].map(e=>(0,Z.jsxs)(`label`,{className:`flex min-w-[140px] flex-[1_1_140px] flex-col gap-1 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`text-muted`,children:e.label}),(0,Z.jsx)(A,{size:`sm`,value:a[e.key]??``,maxLength:e.list?2e3:200,placeholder:e.placeholder,onChange:t=>o({...a,[e.key]:t.target.value})})]},e.key)),(0,Z.jsxs)(L,{size:`sm`,variant:`primary`,type:`submit`,disabled:s||!lt[r].some(e=>e.key!==`project`&&(a[e.key]??``).trim()),children:[(0,Z.jsx)(n,{"aria-hidden":`true`}),s?`Reading…`:`Read stories`]})]}),l&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:l})]})}function pt({kind:e,gaps:t,picked:n=[],onPick:r=()=>{},onRead:i=()=>{}}){let a=(0,Z.jsx)(ft,{gaps:t,onRead:i});if(!t.report)return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a,(0,Z.jsx)(M,{icon:x,title:`No stories read yet`,children:`Say which stories to read: a sprint, an iteration, an area, an epic or the ids. ForgeQE reads each story with its test cases and acceptance criteria from the tracker, as Release readiness does, and reads them again with every sync.`})]});let o=(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.report.id===`live`?`Read from the tracker${t.report.at?` ${K(t.report.at)}`:``}: ${t.report.scope}`:`From the readiness report of ${t.report.scope||t.report.id}`,` (`,t.stories,` stor`,t.stories===1?`y`:`ies`,`).`,e===`stories`&&n.length>0&&` ${n.length} picked for the Gap agent's "Cases for stories".`]}),s=new Set(t.noCase.map(e=>e.id)),c=new Set(n.filter(e=>s.has(e)));return e===`stories`?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a,o,(0,Z.jsx)(V,{label:`Stories with no test case`,placeholder:`Find a story`,empty:`Every story of the release has a test case.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-10`),children:(0,Z.jsx)(q,{"aria-label":`Pick every story shown`,checked:t.noCase.length>0&&t.noCase.every(e=>c.has(e.id)),onCheckedChange:e=>r(e?t.noCase.map(e=>e.id).slice(0,50):[])})}),(0,Z.jsx)(`th`,{className:k(R,`w-[55%]`),children:`Story`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Type`}),(0,Z.jsx)(`th`,{className:R,children:`State`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Area`})]}),children:t.noCase.map(e=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(q,{"aria-label":`Pick ${e.id}`,checked:c.has(e.id),onCheckedChange:t=>r(t?[...c,e.id].slice(0,50):[...c].filter(t=>t!==e.id))})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(ct,{id:e.id,title:e.title,url:e.url})}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] @2xl:table-cell`),children:e.type||`–`}),(0,Z.jsx)(`td`,{className:H,children:e.state?(0,Z.jsx)(j,{tone:`neutral`,icon:!1,children:e.state}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] @2xl:table-cell [overflow-wrap:anywhere]`),children:e.area||`–`})]},e.id))})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a,o,(0,Z.jsx)(V,{label:`Acceptance criteria no test case covers`,placeholder:`Find a criterion`,empty:`Every traced acceptance criterion has a test case.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-[55%]`),children:`Criterion`}),(0,Z.jsx)(`th`,{className:R,children:`Story`})]}),children:t.criteria.map((e,t)=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:k(H,`[overflow-wrap:anywhere]`),children:e.text}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(ct,{id:e.story,title:e.storyTitle,url:e.url})})]},`${e.story}-${t}`))})]})}var mt=[{id:`stories`,label:`Stories with no case`,icon:x},{id:`criteria`,label:`Criteria not covered`,icon:S}],ht=[{id:`not_automated`,label:`Not automated`,icon:o},{id:`pending`,label:`Pending`,icon:s},{id:`never_run`,label:`Never run`,icon:o},{id:`failing`,label:`Failing`,icon:l,alert:!0},{id:`stale`,label:`Steps changed`,icon:_},{id:`drift`,label:`Tracker disagrees`,icon:_},{id:`no_case`,label:`Tests with no case`,icon:d}];function gt({gaps:e,cases:t,tests:n,selected:r,onSelect:i,onRun:a,pickedStories:o=[],onPickStories:s=()=>{},onStoriesRead:c=()=>{}}){let[l,u]=(0,J.useState)(t.length||!n.length?`not_automated`:`no_case`),d=new Map(t.map(e=>[e.key,e])),f=new Map(e.ranked.map(e=>[e.key,e.why])),p=l===`no_case`||l===`stories`||l===`criteria`?[]:l===`not_automated`?e.ranked.map(e=>e.key):e.lists[l],m=e.stories??{stories:0,noCase:[],criteria:[]},h={stories:m.noCase.length,criteria:m.criteria.length},g=p.map(e=>d.get(e)).filter(e=>!!e),_=new Set(r),v=(e,t)=>i(t?[...r,e]:r.filter(t=>t!==e));return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`div`,{className:`grid gap-6 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Z.jsx)(oe,{items:[...ht.map(t=>({id:t.id,label:t.label,icon:t.icon,n:e.counts[t.id],...t.alert?{alert:!0}:{}})),...mt.map(e=>({id:e.id,label:e.label,icon:e.icon,n:h[e.id],tip:m.report?m.report.id===`live`?`Read from the tracker: ${m.report.scope}`:`From the readiness report of ${m.report.scope||m.report.id}`:`Read the release's stories from the tracker first`}))],value:l,onChange:e=>u(e)})}),l===`not_automated`&&g.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-[13px] text-ink-2`,children:[`Highest value first: priority, failing when run, in a pack, tagged smoke.`,(0,Z.jsx)(L,{size:`sm`,onClick:()=>i(g.slice(0,20).map(e=>e.key)),children:`Pick the top 20`})]})]}),(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-4 rounded-[14px] border p-6`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[16px] font-semibold`,children:`Not automated, by suite`}),e.bySuite.length?e.bySuite.slice(0,8).map(e=>(0,Z.jsx)(ze,{label:e.suite,part:e.notAutomated+e.pending,whole:e.cases,className:`bg-warn`},e.suite)):(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Nothing left to automate.`})]})]}),l===`stories`||l===`criteria`?(0,Z.jsx)(pt,{kind:l,gaps:m,picked:o,onPick:s,onRead:c}):l===`no_case`?(0,Z.jsx)(V,{label:`Tests with no test case`,placeholder:`Find a test`,empty:`Every test ForgeQE knows has a test case behind it.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-[55%]`),children:`Test`}),(0,Z.jsx)(`th`,{className:R,children:`Tags`}),(0,Z.jsx)(`th`,{className:R,children:`Last runs`})]}),children:e.testsWithoutCase.map(e=>{let t=n.find(t=>t.key===e);return t?(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsxs)(`td`,{className:k(H,`max-w-0`),children:[(0,Z.jsx)(Q,{text:t.name,tip:t.file?`${t.name} · ${t.file}`:t.name}),t.flaky&&(0,Z.jsx)(j,{tone:`warn`,className:`mt-1`,children:`Flaky`})]}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(Ie,{tags:t.tags})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(Fe,{runs:t.runs})})]},e):null})}):(0,Z.jsx)(V,{label:ht.find(e=>e.id===l).label,placeholder:`Find a case`,resetKey:l,empty:`No gap of this kind.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-10`),children:(0,Z.jsx)(q,{"aria-label":`Select every case shown`,checked:g.length>0&&g.every(e=>_.has(e.key)),onCheckedChange:e=>i(e?[...new Set([...r,...g.map(e=>e.key)])]:r.filter(e=>!g.some(t=>t.key===e)))})}),(0,Z.jsx)(`th`,{className:R,children:`Test case`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Priority`}),(0,Z.jsx)(`th`,{className:R,children:l===`not_automated`?`Why it matters`:`Automation`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Last run`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:g.map(e=>(0,Z.jsxs)(`tr`,{className:k(`border-t border-line-soft align-top hover:bg-surface-muted`,_.has(e.key)&&`bg-accent-soft hover:bg-accent-soft`),children:[(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(q,{"aria-label":`Select ${e.id}`,checked:_.has(e.key),onCheckedChange:t=>v(e.key,t)})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsxs)(`a`,{href:He(e.key),className:`flex min-w-[220px] flex-col gap-1 text-ink no-underline`,children:[(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.id}),e.suite&&(0,Z.jsx)(`span`,{children:e.suite}),(0,Z.jsx)(Ie,{tags:e.tags,max:2})]})]})}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] @2xl:table-cell`),children:e.priority?`P${e.priority}`:`–`}),(0,Z.jsx)(`td`,{className:H,children:l===`not_automated`?(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(f.get(e.key)??[]).map(e=>(0,Z.jsx)(j,{tone:`running`,icon:!1,children:e},e)),!(f.get(e.key)??[]).length&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})]}):(0,Z.jsx)(Ne,{a:e.automation})}),(0,Z.jsx)(`td`,{className:k(H,`hidden @2xl:table-cell`),children:(0,Z.jsx)(Pe,{o:e.lastRun.outcome})}),(0,Z.jsx)(`td`,{className:k(H,`text-right`),children:(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.id}`,"data-tip":`Run`,onClick:()=>a([e.key]),children:(0,Z.jsx)(b,{"aria-hidden":`true`})})})]},e.key))})]})}var _t=e=>e.from===`report`?`From the run's own report`:`From each case's latest result since the run started (its report is not written yet)`,vt={system:`system`,plan:`plan`,suite:`suite`,priority:`priority`,state:`state`,automation:`automation`,tag:`tag`,last_run:`last run`,origin:`origin`,stale:`steps changed`,in_pack:`in pack`};function yt({suites:e,onRun:t}){return e.length?(0,Z.jsx)(V,{label:`Suites`,placeholder:`Find a suite`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-[40%]`),children:`Suite`}),(0,Z.jsx)(`th`,{className:U,children:`Cases`}),(0,Z.jsx)(`th`,{className:k(U,`hidden @xl:table-cell`),children:`Automated`}),(0,Z.jsx)(`th`,{className:R,children:`Last run`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.map(e=>(0,Z.jsxs)(`tr`,{className:W,onClick:()=>location.hash=F(`test-management`,`suites`,e.id),children:[(0,Z.jsxs)(`td`,{className:k(H,`max-w-0`),children:[(0,Z.jsxs)(`a`,{href:F(`test-management`,`suites`,e.id),onClick:e=>e.stopPropagation(),className:`flex items-center gap-2 font-medium`,children:[e.built===`agent`?(0,Z.jsx)(E,{size:14,"aria-hidden":`true`,className:`flex-none`}):(0,Z.jsx)(f,{size:14,"aria-hidden":`true`,className:`flex-none`}),(0,Z.jsx)(Q,{text:e.name})]}),e.description&&(0,Z.jsx)(Q,{text:e.description,className:`mt-1 text-[13px] text-muted`})]}),(0,Z.jsx)(`td`,{className:z,children:e.cases}),(0,Z.jsxs)(`td`,{className:k(z,`hidden @xl:table-cell`),children:[e.cases?Math.round(e.automated/e.cases*100):0,`%`]}),(0,Z.jsx)(`td`,{className:H,children:e.last?(0,Z.jsxs)(`span`,{className:`flex flex-col items-start gap-1 text-[13px]`,"data-tip":_t(e.last),children:[(0,Z.jsxs)(j,{tone:e.last.failed?`fail`:`pass`,children:[e.last.passed,` passed`,e.last.failed?`, ${e.last.failed} failed`:``]}),(0,Z.jsx)(`span`,{className:`text-muted`,children:K(e.last.at)})]}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Not run`})}),(0,Z.jsxs)(`td`,{className:k(H,`text-right whitespace-nowrap`),onClick:e=>e.stopPropagation(),children:[!!e.last?.failed&&(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Rerun the failed cases of ${e.name}`,"data-tip":`Rerun failed`,onClick:()=>t(e.id,`failed`),children:(0,Z.jsx)(O,{"aria-hidden":`true`})}),(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Run ${e.name}`,"data-tip":`Run`,onClick:()=>t(e.id),children:(0,Z.jsx)(b,{"aria-hidden":`true`})})]})]},e.id))}):(0,Z.jsx)(M,{icon:f,title:`No suites yet`,children:`Tell the Suite agent on the right what the suite is for, such as “regression for the payments suite, P1 and anything failing lately”. It picks the cases from your plans, tags and runs.`})}function bt({id:e,onRun:t,onDeleted:n}){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(``),[s,l]=(0,J.useState)(!1),[d,f]=(0,J.useState)(!1);(0,J.useEffect)(()=>{i(null),Y.suite(e).then(e=>{i(e),o(``)},e=>o(e.message))},[e]);let h=(0,Z.jsxs)(`a`,{href:F(`test-management`,`suites`),className:`inline-flex w-fit items-center gap-2 text-[13px]`,children:[(0,Z.jsx)(m,{size:14,"aria-hidden":`true`}),`All suites`]});if(a)return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[h,(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail`,children:a})]});if(!r)return(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`});let g=r.suite,_=r.members.filter(e=>e.case.lastRun.outcome===`failed`||e.case.lastRun.outcome===`blocked`).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[h,(0,Z.jsxs)(`header`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_320px] flex-col gap-1`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em] [overflow-wrap:anywhere]`,children:g.name}),g.description&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:g.description}),g.tracker&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[`Kept as`,` `,Te(g.tracker)?(0,Z.jsx)(`a`,{href:Te(g.tracker),target:`_blank`,rel:`noreferrer noopener`,children:Ee(g.tracker)}):Ee(g.tracker)]})]}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap gap-2`,children:[(g.tracker||r.targets.length>0)&&(0,Z.jsxs)(L,{onClick:()=>f(!0),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),g.tracker?`Keep in step`:`Keep in tracker`]}),(0,Z.jsxs)(L,{variant:`danger`,onClick:()=>l(!0),children:[(0,Z.jsx)(p,{"aria-hidden":`true`}),`Delete`]}),_>0&&(0,Z.jsxs)(L,{onClick:()=>t(g.id,`failed`),children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`Rerun `,_,` failed`]}),(0,Z.jsxs)(L,{variant:`primary`,onClick:()=>t(g.id),children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Run suite`]})]})]}),(0,Z.jsxs)(le,{label:`The suite`,children:[(0,Z.jsx)(G,{compact:!0,label:`Cases`,value:g.cases,note:`${g.automated} automated`}),(0,Z.jsx)(G,{compact:!0,label:`Last run`,value:g.last?`${g.last.passed} passed`:`Not run`,tone:g.last?.failed?`text-fail`:void 0,note:g.last?`${g.last.failed} failed · ${K(g.last.at)}${g.last.from===`report`?``:` · so far`}`:void 0}),(0,Z.jsx)(G,{compact:!0,label:`Runs on`,value:g.env??`Active`,note:g.runs.length?`${g.runs.length} run${g.runs.length===1?``:`s`}`:`never run`}),(0,Z.jsx)(G,{compact:!0,label:`Built`,value:g.built===`agent`?`Suite agent`:g.built===`rules`?`Rules`:`Picked`,note:`updated ${K(g.updatedAt)}`})]}),g.groupsCount.length>0&&(0,Z.jsxs)(`section`,{className:`card flex flex-col gap-2 rounded-[14px] border p-6 text-[13px]`,children:[(0,Z.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:`Why these cases`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:g.groupsCount.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-muted`,children:g.groups[t]?.rules.map(e=>`${vt[e.field]} ${e.op===`is`?`is`:`is not`} ${e.value}`).join(` and `)}),(0,Z.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.cases})]},e.label))})]}),(0,Z.jsx)(V,{label:`Cases`,placeholder:`Find a case`,empty:`No case meets the suite's rules now.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-[45%]`),children:`Test case`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @xl:table-cell`),children:`Why it is in`}),(0,Z.jsx)(`th`,{className:R,children:`Automation`}),(0,Z.jsx)(`th`,{className:R,children:`Last run`})]}),children:r.members.map(e=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:k(H,`max-w-0`),children:(0,Z.jsxs)(`a`,{href:He(e.case.key),className:`flex min-w-0 flex-col gap-1 text-ink no-underline`,children:[(0,Z.jsx)(Q,{text:e.case.title,className:`font-medium`}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-accent-fg`,children:e.case.id}),(0,Z.jsx)(Ie,{tags:e.case.tags})]})]})}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] text-ink-2 @xl:table-cell`),children:e.group}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(Ne,{a:e.case.automation})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(Pe,{o:e.case.lastRun.outcome})})]},e.case.key))}),(0,Z.jsx)(Ae,{open:d,suite:g,targets:r.targets,onClose:()=>f(!1),onDone:()=>void Y.suite(e).then(i,()=>{})}),(0,Z.jsx)(B,{open:s,onClose:()=>l(!1),title:`Delete ${g.name}?`,description:`The suite goes from .forgeqe/testmgmt/suites.json. Its cases and their runs stay.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:()=>l(!1),children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(L,{variant:`destructive`,onClick:()=>void Y.deleteSuite(g.id).then(()=>{l(!1),n()},e=>o(e.message)),children:[(0,Z.jsx)(p,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,Z.jsx)(`p`,{className:`m-0 pt-4 text-[13px] text-ink-2`,children:`Runs already made are kept in Runs.`})})]})}function xt({open:e,onSaved:t}){let[n,r]=(0,J.useState)([]),[i,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(``),u=[...n].reverse().find(e=>`built`in e)?.built,d=n.filter(e=>`you`in e).map(e=>e.you).join(`. `),f=async t=>{let n=t.trim();if(n){s(!0),l(``),r(e=>[...e,{you:n}]),a(``);try{let t=await Y.buildSuite(d?`${d}. ${n}`:n,e?.id);r(e=>[...e,{built:t}])}catch(e){l(e.message)}finally{s(!1)}}},p=async n=>{if(u){s(!0);try{let{suite:i}=await Y.saveSuite({...n&&e?{id:e.id}:{},name:n&&e?e.name:u.name,description:u.summary,groups:u.groups,exclude:u.exclude,built:`agent`});r([]),t(i)}catch(e){l(e.message)}finally{s(!1)}}};return(0,Z.jsxs)(ye,{title:`Suite agent`,about:`Builds and changes suites from your plans, tags and runs.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(e?[`Leave out cases that are not automated`,`Add everything failing lately`,`Only priority 1 and 2`]:[`Smoke suite`,`P1 cases that failed lately`,`Everything not automated in one suite`]).map(e=>(0,Z.jsx)(L,{size:`sm`,disabled:o,onClick:()=>void f(e),children:e},e))}),(0,Z.jsxs)(`form`,{className:`flex items-end gap-2`,onSubmit:e=>{e.preventDefault(),f(i)},children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`tm-suite-words`,children:`Tell the Suite agent what the suite is for`}),(0,Z.jsx)(`textarea`,{id:`tm-suite-words`,rows:2,maxLength:1e3,value:i,placeholder:e?`Change ${e.name}, or ask about it`:`Describe the suite you need, e.g. regression for Payments under 30 minutes`,onChange:e=>a(e.target.value),className:`min-h-11 flex-1 resize-none rounded-[10px] border border-line bg-bg px-4 py-2 text-[13px] text-ink outline-none focus:border-accent`}),(0,Z.jsx)(L,{size:`icon`,variant:`primary`,type:`submit`,disabled:o||!i.trim(),"aria-label":`Send`,"data-tip":`Send`,children:(0,Z.jsx)(w,{"aria-hidden":`true`})})]})]}),children:[(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,Z.jsx)(ae,{state:o?`thinking`:`working`,px:96,label:o?`Building the suite`:`Ready`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:o?`Building the suite…`:e?`Looking at ${e.name}.`:`Ready. Say what the suite is for.`})]}),n.map((e,t)=>`you`in e?(0,Z.jsx)(`p`,{className:`m-0 text-center text-[16px] leading-relaxed text-ink-2`,children:e.you},t):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`p`,{className:`m-0 text-center text-[20px] leading-snug`,children:[e.built.name,`: `,e.built.cases,` case`,e.built.cases===1?``:`s`,`, `,e.built.automated,` automated.`]}),e.built.summary&&(0,Z.jsx)(`p`,{className:`m-0 text-center text-[13px] text-ink-2`,children:e.built.summary}),e.built.note&&(0,Z.jsx)(`p`,{className:`m-0 text-center text-[13px] text-muted`,children:e.built.note}),(0,Z.jsxs)(`div`,{className:`card flex flex-col gap-2 rounded-[14px] border bg-bg p-4 text-[13px]`,children:[e.built.perGroup.map(e=>(0,Z.jsxs)(`span`,{className:`flex items-baseline gap-2`,"data-tip":e.why,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`ml-auto tabular-nums`,children:e.cases})]},e.label)),e.built.exclude.length>0&&(0,Z.jsxs)(`span`,{className:`text-muted`,children:[`Leaves out: `,e.built.exclude.map(e=>`${vt[e.field]} ${e.op===`is`?`is`:`is not`} ${e.value}`).join(`, `)]})]}),e.built.question&&t===n.length-1&&(0,Z.jsxs)(`div`,{className:`card flex flex-col gap-2 rounded-[14px] border bg-bg p-4 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.built.question.text}),e.built.question.options.map(e=>(0,Z.jsx)(L,{size:`sm`,disabled:o,onClick:()=>void f(e),className:`justify-start`,children:e},e))]}),e.built.sample.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:e.built.sample.slice(0,5).map(e=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`flex-none font-mono text-accent-fg`,children:e.case.id}),(0,Z.jsx)(Q,{text:e.case.title,className:`min-w-0 text-ink-2`})]},e.case.key))})]},t)),c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),u&&(0,Z.jsxs)(`span`,{className:`flex flex-wrap justify-center gap-2`,children:[e&&(0,Z.jsxs)(L,{disabled:o,onClick:()=>void p(!0),children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Update `,e.name]}),(0,Z.jsxs)(L,{variant:`primary`,disabled:o,onClick:()=>void p(!1),children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Save `,e?`as a new suite`:`suite`]})]})]})}var St=[{id:`off`,label:`Off`,icon:o},{id:`hourly`,label:`Every hour`,icon:n},{id:`daily`,label:`Daily`,icon:g}];function Ct(e){return!e||e.every===`off`?`Sync: off`:e.every===`hourly`?`Sync: hourly`:e.every===`daily`?`Sync: daily ${e.at}`:`Sync: custom`}function wt({disabled:e}){let[t,n]=(0,J.useState)(!1),[r,i]=(0,J.useState)(null);return(0,J.useEffect)(()=>{Y.schedule().then(e=>i(e.schedule),()=>{})},[]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{size:`sm`,disabled:e,onClick:()=>n(!0),"data-tip":r?.nextAt?`Next sync ${me(r.nextAt)}`:`Set when the plans are synced`,children:[(0,Z.jsx)(g,{"aria-hidden":`true`}),Ct(r)]}),(0,Z.jsx)(Tt,{open:t,onClose:()=>n(!1),now:r,onSaved:i})]})}function Tt({open:e,onClose:t,now:n,onSaved:r}){let[i,a]=(0,J.useState)(`off`),[o,s]=(0,J.useState)(`06:00`),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),[p,m]=(0,J.useState)(null),[h,g]=(0,J.useState)(!1);(0,J.useEffect)(()=>{e&&(u(``),g(!!n&&n.every!==`off`&&n.every!==`custom`&&!!n.discover),Y.discoveryPlan().then(m,()=>m(null)),a(n&&n.every!==`custom`?n.every:`off`),n?.every===`daily`&&s(n.at))},[e,n]);let _=async()=>{f(!0);try{let e=h&&p&&i!==`off`?{discover:p.digest}:{};r((await Y.setSchedule(i===`daily`?{every:i,at:o,...e}:i===`hourly`?{every:i,...e}:{every:i})).schedule),t()}catch(e){u(e.message)}finally{f(!1)}};return(0,Z.jsx)(B,{open:e,onClose:t,title:`Sync on a schedule`,description:`ForgeQE reads every case of the connected test plans again, as Sync does, and the stories Gaps read, in the jobs service (forgeqe testmgmt sync). It can also discover the tests first. It runs while this computer is on.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:t,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(L,{variant:`primary`,disabled:d||i===`daily`&&!/^([01]\d|2[0-3]):[0-5]\d$/.test(o),onClick:()=>void _(),children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Save`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4 text-[13px]`,children:[(0,Z.jsx)(`div`,{role:`group`,"aria-label":`When to sync`,className:`flex flex-wrap gap-2`,children:(0,Z.jsx)(oe,{items:St.map(e=>({id:e.id,label:e.label,icon:e.icon})),value:i,onChange:a})}),i===`daily`&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 font-medium`,children:[`Time (this computer's clock)`,(0,Z.jsx)(A,{type:`time`,step:60,value:o,onChange:e=>s(e.target.value)})]}),i!==`off`&&p&&p.steps.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(q,{checked:h,onCheckedChange:e=>g(e===!0),"aria-label":`Also discover the tests`}),(0,Z.jsx)(`span`,{children:`Also discover the tests first. This runs the repository's code with these commands, with no secret of ForgeQE's. If the test projects change, the schedule stops discovering until you confirm again.`})]}),h&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.steps.map((e,t)=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`rounded-[8px] bg-surface-strong px-2 py-1 font-mono text-[13px] [overflow-wrap:anywhere]`,children:e.command})},t))})]}),n?.every===`custom`&&(0,Z.jsxs)(`p`,{className:`m-0 text-warn`,children:[`The sync job was changed outside this page (`,n.text,`). Saving here replaces it.`]}),n?.enabled===!1&&(0,Z.jsx)(`p`,{className:`m-0 text-warn`,children:`The sync job is disabled in the jobs service.`}),n?.last&&(0,Z.jsxs)(`p`,{className:`m-0 text-ink-2`,children:[`Last scheduled sync `,me(n.last.at),`: `,n.last.status.replace(`_`,` `),`.`]}),l&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-fail [overflow-wrap:anywhere]`,children:l})]})})}var Et={forgeqe:{label:`ForgeQE`,icon:E},script:{label:`Tests`,icon:d}},Dt=e=>Et[e]??{label:e===`azure_devops`?`Azure DevOps`:e===`jira`?`Jira`:e,icon:a},Ot=e=>e!==`forgeqe`&&e!==`script`,kt=[];function At({tags:e,cases:t=[],onChanged:n}){let[r,i]=(0,J.useState)(`all`),[o,s]=(0,J.useState)(null),c=e=>e.system===`azure_devops`||e.system===`jira`,l=e=>t.filter(t=>t.ownTags.includes(e)&&!t.trackerTags.includes(e)&&c(t)).map(e=>e.key),f=e=>t.filter(t=>t.ownTags.includes(e)&&t.trackerTags.includes(e)&&c(t)).map(e=>e.key),p=e.tags.filter(e=>r===`all`||(r===`out`?e.outOfStep>0:r===`tracker`?e.from.some(Ot):e.from.includes(r))),m=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(le,{label:`Tags`,children:[(0,Z.jsx)(G,{compact:!0,label:`Tags in use`,icon:y,value:e.tags.length}),(0,Z.jsx)(G,{compact:!0,label:`Test cases with a tag`,value:m(e.casesTagged,e.cases),note:`${e.casesTagged} of ${e.cases}`}),(0,Z.jsx)(G,{compact:!0,label:`Tests with a tag`,value:m(e.testsTagged,e.tests),note:`${e.testsTagged} of ${e.tests}`}),(0,Z.jsx)(G,{compact:!0,label:`Out of step`,icon:_,value:e.tags.filter(e=>e.outOfStep).length,tone:e.tags.some(e=>e.outOfStep)?`text-warn`:void 0,note:`a case's tag its test lacks`})]}),(0,Z.jsx)(V,{label:`Tags`,placeholder:`Find a tag`,resetKey:r,empty:e.tags.length?`Nothing matches.`:`No tags yet: tag cases in Test cases, or in their system.`,tools:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,Z.jsx)(oe,{items:[{id:`all`,label:`All`,n:e.tags.length},{id:`tracker`,label:`From their systems`,icon:a,n:e.tags.filter(e=>e.from.some(Ot)).length},{id:`script`,label:`From tests`,icon:d,n:e.tags.filter(e=>e.from.includes(`script`)).length},{id:`forgeqe`,label:`ForgeQE's`,icon:E,n:e.tags.filter(e=>e.from.includes(`forgeqe`)).length},{id:`out`,label:`Out of step`,icon:_,n:e.tags.filter(e=>e.outOfStep).length,alert:!0}],value:r,onChange:i})}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:k(R,`w-[28%]`),children:`Tag`}),(0,Z.jsx)(`th`,{className:R,children:`Comes from`}),(0,Z.jsx)(`th`,{className:U,children:`Test cases`}),(0,Z.jsx)(`th`,{className:U,children:`Tests`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @xl:table-cell`),children:`Out of step`}),(0,Z.jsx)(`th`,{className:k(R,`hidden @2xl:table-cell`),children:`Used by suites`}),(0,Z.jsx)(`th`,{className:R,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:p.map(e=>(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-[6px] bg-surface-strong px-2 text-[13px] font-medium`,children:[(0,Z.jsx)(y,{size:12,"aria-hidden":`true`}),e.name]})}),(0,Z.jsx)(`td`,{className:H,children:(0,Z.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:e.from.map(e=>{let t=Dt(e);return(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-[6px] border border-line px-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(t.icon,{size:12,"aria-hidden":`true`}),t.label]},e)})})}),(0,Z.jsx)(`td`,{className:z,children:e.cases}),(0,Z.jsx)(`td`,{className:z,children:e.tests}),(0,Z.jsx)(`td`,{className:k(H,`hidden @xl:table-cell`),children:e.outOfStep?(0,Z.jsx)(j,{tone:`warn`,children:e.outOfStep}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`–`})}),(0,Z.jsx)(`td`,{className:k(H,`hidden text-[13px] text-ink-2 @2xl:table-cell`),children:e.suites.join(`, `)||`–`}),(0,Z.jsxs)(`td`,{className:k(H,`text-right`),children:[l(e.name).length>0&&(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Write the tag ${e.name} to the trackers of ${l(e.name).length} cases`,"data-tip":`Write to the trackers of ${l(e.name).length} cases`,onClick:()=>s({kind:`tags`,keys:l(e.name)}),children:(0,Z.jsx)(u,{"aria-hidden":`true`})}),f(e.name).length>0&&(0,Z.jsx)(L,{size:`icon-sm`,variant:`icon`,"aria-label":`Take the tag ${e.name} off in the trackers of ${f(e.name).length} cases`,"data-tip":`Take off in the trackers of ${f(e.name).length} cases`,onClick:()=>s({kind:`untag`,keys:f(e.name),tags:[e.name]}),children:(0,Z.jsx)(ee,{"aria-hidden":`true`})})]})]},e.name))}),(0,Z.jsx)(ke,{kind:o?.kind??null,keys:o?.keys??kt,tags:o?.tags,onClose:()=>s(null),onDone:e=>n?.(e)})]})}var jt=[`dashboard`,`cases`,`tests`,`gaps`,`suites`,`tags`];function Mt({sub:e}){let t=(e??``).split(`/`).filter(Boolean),r=jt.includes(t[0])?t[0]:`dashboard`,i=r===`cases`&&t[1]?ie(t[1]):void 0,a=r===`suites`&&t[1]?ie(t[1]):void 0,[o,s]=(0,J.useState)(null),[c,u]=(0,J.useState)(null),[f,p]=(0,J.useState)(null),[m,h]=(0,J.useState)([]),[g,_]=(0,J.useState)(null),[v,ee]=(0,J.useState)(null),[x,S]=(0,J.useState)(null),[C,w]=(0,J.useState)(``),[T,D]=(0,J.useState)(``),[O,ne]=(0,J.useState)(!1),[re,A]=(0,J.useState)([]),[ae,M]=(0,J.useState)(null),[N,P]=(0,J.useState)(!0),I=(0,J.useCallback)(async()=>{try{let[e,t]=await Promise.all([Y.view(),Y.cases()]);s(e),u(t),ee(e.suites),S(e.job),w(``)}catch(e){w(e.message)}},[]);(0,J.useEffect)(()=>{I()},[I]),(0,J.useEffect)(()=>{r===`gaps`&&Y.gaps().then(p,e=>w(e.message)),r===`tags`&&Y.tags().then(_,e=>w(e.message)),r===`suites`&&Y.suites().then(e=>ee(e.suites),e=>w(e.message))},[r,o]),(0,J.useEffect)(()=>{if(!x?.running)return;let e=setInterval(()=>{Y.job().then(e=>{S(e.job),e.job?.running||I()},()=>{})},2e3);return()=>clearInterval(e)},[x?.running,I]);let oe=async()=>{ne(!0),D(``);try{let e=await Y.sync(),t=e.plans.filter(e=>e.error);D(t.length?t.map(e=>`${e.label}: ${e.error}`).join(` · `):`Synced ${e.plans.map(e=>`${e.label} (${e.cases} cases)`).join(`, `)}.`),await I()}catch(e){w(e.message)}finally{ne(!1)}},R=e=>M({title:`Run ${e.length} test case${e.length===1?``:`s`}`,go:(t,n)=>Y.run(e,t,n)}),z=(e,t)=>{let n=v?.find(t=>t.id===e)??o?.suites.find(t=>t.id===e);M({title:`${t?`Rerun the failed cases of`:`Run`} ${n?.name??`the suite`}`,go:(n,r)=>Y.runSuite(e,{...n?{env:n}:{},...t?{only:t}:{}},r)})},B=()=>{D(`The run started: it shows here while it runs, and in Runs.`),Y.job().then(e=>S(e.job),()=>{})},V=e=>{D(e),A([]),I()},H=new Map((c?.cases??[]).map(e=>[e.key,e])),U=re.filter(e=>H.has(e)),le=e=>e.map(e=>H.get(e).id),W=U.filter(e=>[`failed`,`blocked`].includes(H.get(e).lastRun.outcome)),G=U.filter(e=>H.get(e).automation!==`automated`),q=[{intent:`automate`,label:G.length?`Automate ${G.length}`:`Automate`,icon:d,keys:G.slice(0,50),...G.length?{}:{disabled:`Pick test cases that are not automated`}},{intent:`investigate`,label:W.length?`Why ${W.length} fail`:`Why they fail`,icon:l,keys:W.slice(0,50),...W.length?{}:{disabled:`Pick failing test cases`}},{intent:`tag`,label:`Suggest tags`,icon:y,keys:U.slice(0,50),...U.length?{}:{disabled:`Pick test cases in the list first`}},{intent:`tag_tests`,label:`Write tags into tests`,icon:d,keys:U.filter(e=>H.get(e).tests.length>0&&H.get(e).tags.length>0).slice(0,50),...U.filter(e=>H.get(e).tests.length>0&&H.get(e).tags.length>0).length?{}:{disabled:`Pick tagged cases that have a linked test`}}],he=(f?.ranked??[]).slice(0,20).map(e=>e.key),ge=[{intent:`automate`,label:U.length?`Automate ${U.length}`:`Automate the top ${he.length}`,icon:d,keys:(U.length?U:he).slice(0,50),...U.length||he.length?{}:{disabled:`Nothing left to automate`}},{intent:`investigate`,label:`Why the failing fail`,icon:l,keys:(f?.lists.failing??[]).slice(0,50),...f?.lists.failing.length?{}:{disabled:`Nothing is failing`}},{intent:`cases_for_stories`,label:m.length?`Cases for ${m.length} stor${m.length===1?`y`:`ies`}`:`Cases for stories with none`,icon:E,keys:[],stories:(m.length?m:(f?.stories?.noCase??[]).map(e=>e.id)).slice(0,50),...m.length||f?.stories?.noCase.length?{}:{disabled:`Read the release's stories in Gaps, Stories with no case, first`}}],_e=a?v?.find(e=>e.id===a):void 0,ve=(0,Z.jsxs)(`main`,{className:k(ue,`@container flex-auto gap-4`),children:[(0,Z.jsx)(pe,{}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsx)(ce,{pixel:se[`test-management`],size:`lg`}),(0,Z.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test management`}),o&&(0,Z.jsx)(fe,{label:`Test management`,className:`mb-0`,current:r,onPick:e=>location.hash=F(`test-management`,e),tabs:[{id:`dashboard`,label:`Dashboard`},{id:`cases`,label:`Test cases`,n:o.summary.cases},{id:`tests`,label:`Automated`,n:o.summary.tests},{id:`gaps`,label:`Gaps`,n:o.summary.notAutomated+o.summary.pending+o.summary.failing},{id:`suites`,label:`Suites`,n:o.suites.length},{id:`tags`,label:`Tags`}]}),o&&(0,Z.jsxs)(`span`,{className:`ml-auto flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[o.plans.length>0&&(0,Z.jsxs)(`span`,{"data-tip":o.plans.map(e=>`${e.label}: ${e.cases} cases${e.at?`, synced ${me(e.at)}`:``}`).join(` · `),children:[o.plans.length,` plan`,o.plans.length===1?``:`s`,o.plans[0]?.at?`, synced ${K(o.plans.map(e=>e.at??``).sort()[0])}`:`, not synced yet`]}),o.plans.length>0&&(0,Z.jsxs)(L,{size:`sm`,disabled:O,onClick:()=>void oe(),"data-tip":`Read every case of the connected plans again`,children:[(0,Z.jsx)(n,{"aria-hidden":`true`}),O?`Syncing…`:`Sync`]}),(o.plans.length>0||o.summary.tests>0)&&(0,Z.jsx)(wt,{disabled:O}),(r===`cases`||r===`gaps`||r===`suites`)&&!N&&(0,Z.jsxs)(L,{size:`sm`,onClick:()=>P(!0),children:[(0,Z.jsx)(E,{"aria-hidden":`true`}),r===`suites`?`Suite agent`:`Agent`]})]})]}),C&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:C}),!o&&!C&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),T&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:T}),o&&o.refused.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-warn`,children:[`Not read, as their system does not write a plan that way: `,o.refused.join(` · `),`. Fix them in Settings › Integrations.`]}),x&&(0,Z.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center gap-2 rounded-[12px] border border-line px-4 py-2 text-[13px]`,children:[(0,Z.jsx)(j,{tone:x.running?`running`:x.exitCode===0?`pass`:`fail`,children:x.running?`Running`:x.exitCode===0?`Finished`:`Stopped`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-ink-2`,"data-tip":x.command,children:x.lines.at(-1)??x.command}),x.running?(0,Z.jsxs)(L,{size:`sm`,variant:`danger`,onClick:()=>void Y.stop().then(e=>S(e.job)),children:[(0,Z.jsx)(te,{"aria-hidden":`true`}),`Stop`]}):(0,Z.jsx)(`a`,{href:F(`runs`),className:`text-[13px]`,children:`Runs`})]}),o&&(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)(`div`,{id:`panel-${r}`,role:`tabpanel`,"aria-labelledby":`tab-${r}`,className:`flex flex-col gap-4`,children:[r===`dashboard`&&(0,Z.jsx)(ot,{view:o,onRunSuite:z}),r===`cases`&&(i?(0,Z.jsx)(Xe,{caseKey:i,onRun:R}):c&&(0,Z.jsx)(et,{cases:c.cases,tests:c.tests.length,selected:U,onSelect:A,onRun:R,onChanged:V})),r===`tests`&&c&&(0,Z.jsx)(Ue,{cases:c.cases,onChanged:V}),r===`gaps`&&(f&&c?(0,Z.jsx)(gt,{gaps:f,cases:c.cases,tests:c.tests,selected:U,onSelect:A,onRun:R,pickedStories:m,onPickStories:h,onStoriesRead:()=>(h([]),void I())}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`})),r===`suites`&&(a?(0,Z.jsx)(bt,{id:a,onRun:z,onDeleted:()=>(location.hash=F(`test-management`,`suites`),void I())},a):v&&(0,Z.jsx)(yt,{suites:v,onRun:z})),r===`tags`&&(g?(0,Z.jsx)(At,{tags:g,cases:c?.cases,onChanged:V}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}))]})}),(0,Z.jsx)(Be,{open:!!ae,onClose:()=>M(null),title:ae?.title??`Run`,preview:(e,t)=>ae.go(e,t),onStarted:B})]}),X=i?H.get(i):void 0;return(0,Z.jsxs)(`div`,{className:`@container flex min-h-(--screen) flex-col`,children:[(0,Z.jsx)(de,{}),(0,Z.jsxs)(`div`,{className:`flex flex-auto flex-col xl:flex-row`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-auto flex-col`,children:ve}),o&&N&&r===`cases`&&(0,Z.jsx)(be,{title:`Test case agent`,about:`Automates, runs and tags the cases you pick.`,looking:X?`Looking at ${X.id}.`:U.length?`Looking at the ${U.length} cases you picked.`:`Looking at ${o.summary.cases} test cases. Pick some in the list.`,context:X?[X.id,...X.plans.slice(0,1)]:U.length?le(U).slice(0,4):[],suggestions:X?[{intent:X.automation===`automated`?`run`:`automate`,label:X.automation===`automated`?`Run it and explain`:`Automate it`,icon:X.automation===`automated`?b:d,keys:[X.key]},{intent:`investigate`,label:`Why it fails`,icon:l,keys:[X.key],...[`failed`,`blocked`].includes(X.lastRun.outcome)?{}:{disabled:`Its last run did not fail`}},{intent:`tag`,label:`Suggest tags`,icon:y,keys:[X.key]}]:q,placeholder:`Ask about these cases, or say what to do`,onClose:()=>P(!1)},i??`list`),o&&N&&r===`gaps`&&(0,Z.jsx)(be,{title:`Gap agent`,about:`Finds what to close first and closes it with you.`,looking:`Looking at ${o.summary.notAutomated} cases not automated, ${o.summary.pending} pending and ${o.summary.failing} failing.`,context:U.length?le(U).slice(0,4):[],suggestions:ge,placeholder:`What should we close first?`,onClose:()=>P(!1)}),o&&N&&r===`suites`&&(0,Z.jsx)(xt,{open:_e,onSaved:e=>{D(`Saved the suite ${e.name}.`),I(),location.hash=F(`test-management`,`suites`,e.id)}})]})]})}export{Mt as TestManagement};
@@ -1,3 +0,0 @@
1
- import{At as e,Br as t,E as n,Et as r,Gt as i,In as a,Lr as o,M as s,Mr as c,Nr as l,Nt as u,Or as d,Pn as f,Pr as p,R as m,Wn as h,Yn as g,Yt as _,_r as v,a as y,at as b,br as x,ct as S,dt as C,h as w,in as T,j as E,jn as D,nn as ee,nt as O,o as te,qn as k,rr as ne,tr as A,vt as re,w as j,yn as ie,zn as ae}from"./line-icons-CwZWt93L.js";import{$t as M,Jt as N,V as P,Yt as F,a as I,c as oe,et as se,f as ce,g as L,h as R,i as z,n as le,o as B,p as V,r as H,s as ue,t as U,z as W}from"./filters-faaSnoIq.js";import{$ as G,Bt as de,F as fe,Ht as pe,M as me,Q as he,Vt as K,X as ge,Z as q,ct as _e,et as ve,ot as ye,tt as be}from"./frame-BLPdAXUq.js";import{t as xe}from"./markdown-BI3F-SJ1.js";import{L as Se,dt as Ce,gt as we,it as Te,j as J,rt as Ee,ut as De}from"./index-CxiCvGZq.js";import{t as Oe}from"./fold-CUjwWAK3.js";import{t as ke}from"./head-CsTxBsO0.js";import{f as Ae,u as je}from"./parts-CdF1f7yS.js";import{S as Me,_ as Ne,b as Y,d as Pe,f as Fe,g as Ie,h as Le,l as Re,m as ze,p as Be,r as Ve,s as He,t as Ue,u as We,v as Ge,x as Ke,y as qe}from"./logos-dGuc1jIM.js";import{t as Je}from"./Steps-BvzbQyoD.js";var X=t(o(),1),Z=M(),Ye=500,Xe=10;function Ze({plan:e,acceptLimits:t,next:n,again:r,onClose:i,onStarted:a}){let o=e.units.filter(e=>e.kind===`test`).length,[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(!!n),[d,f]=(0,X.useState)(String(n?.size||Xe)),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(``),v=Number(d),y=Number.isInteger(v)&&v>=1&&v<=Ye,b=async()=>{h(!0),_(``);try{a((await N.start(e.id,s,t,l?v:void 0)).detail)}catch(e){_(e.message),h(!1)}};return(0,Z.jsx)(K,{open:!0,onClose:i,title:n?`Continue with the next batch`:r?`Start the conversion again`:`Start the conversion`,description:n?`${(v||n.size)>=n.left?`The last ${n.left===1?`test case`:`${n.left} test cases`} not tried yet ${n.left===1?`is`:`are`}`:`The next ${v||n.size} of the ${n.left} test cases not tried yet are`} written as ${e.target.title} tests in ${e.target.dir}. What is done is kept; a failed test stays for you to fix.`:r?`ForgeQE picks up where the conversion stopped: what is done and unchanged is kept, the rest is written as ${e.target.title} tests in ${e.target.dir}. It runs in the background.`:`The Tosca test cases are written as ${e.target.title} tests in ${e.target.dir}, and ForgeQE runs each one. It runs in the background; the Tosca export is not changed.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(W,{variant:`ghost`,onClick:i,children:[(0,Z.jsx)(p,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(W,{variant:`primary`,disabled:m||s!==e.id||l&&!y,onClick:()=>void b(),"data-tip":n?`Continue with the next batch`:r?`Start the conversion again`:`Start the conversion`,children:[r?(0,Z.jsx)(ae,{"aria-hidden":`true`}):(0,Z.jsx)(D,{"aria-hidden":`true`}),n?`Continue`:r?`Start again`:`Start`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[!n&&o>1&&(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,Z.jsx)(J,{className:`mt-1`,checked:l,onCheckedChange:u}),(0,Z.jsxs)(`span`,{children:[`Convert in batches`,(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`A few test cases at a time, stopping after each batch so you can check them before the next.`})]})]}),l&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{children:`Test cases per batch`}),(0,Z.jsx)(I,{type:`number`,min:1,max:Ye,step:1,inputMode:`numeric`,value:d,"aria-invalid":!y,"aria-describedby":y?void 0:`batch-size-error`,onChange:e=>f(e.target.value),className:`w-24`}),!y&&(0,Z.jsxs)(`p`,{id:`batch-size-error`,role:`alert`,className:`m-0 text-[13px] text-fail`,children:[`A whole number from 1 to `,Ye,`.`]})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`span`,{children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono`,children:e.id}),` to confirm`]}),(0,Z.jsx)(I,{value:s,onChange:e=>c(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,Z.jsx)(We,{error:g})]})})}function Qe(e){if(e.job?.running)return{label:e.job.kind===`fix`?`Fixing`:e.job.kind===`verify`?`Running tests`:`Running`,tone:`running`};let t=e.result;return t?.status===`running`?{label:t.stage===`validate`?`Validating`:`Running`,tone:`running`}:t?Pe[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:Ne[e.plan.feasibility.verdict]}var Q=e=>e.slice(e.lastIndexOf(`/`)+1);function $e({d:e,onClose:t}){let n=(e.plan.sources||[]).some(e=>e.workspace),[r,i]=(0,X.useState)(n),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(``),l=async()=>{o(!0),c(``);try{let t=await N.reimport(e.plan.id,n&&r);location.hash=V(`tosca`,t.plan.id)}catch(e){c(e.message),o(!1)}};return(0,Z.jsx)(K,{open:!0,onClose:t,title:`Read the exports again`,description:`A new plan from the same exports, into the same folder. Test cases unchanged in Tosca keep their tests; changed and new ones are converted; ones no longer there are listed. Nothing is written until you start it.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(W,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,Z.jsx)(W,{variant:`primary`,disabled:a,onClick:()=>void l(),children:a?`Reading…`:`Make the new plan`})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[n&&(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2`,children:[(0,Z.jsx)(J,{className:`mt-1`,checked:r,onCheckedChange:i}),(0,Z.jsxs)(`span`,{children:[`Get the newest commit of the cloned repositories`,(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Each is cloned again, as before; the old copy stays for this plan.`})]})]}),s&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s})]})})}var et=[{id:`ci-github`,label:`GitHub Actions`},{id:`ci-azure`,label:`Azure Pipelines`}];function tt({id:e,onClose:t}){let[n,r]=(0,X.useState)(`github`),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let t=!0;return a(null),p(!1),s(``),l(``),N.ci(e,n).then(e=>t&&a(e),e=>t&&s(e.message)),()=>{t=!1}},[e,n]);let m=i?i.file.slice(i.file.lastIndexOf(`/`)+1):``,h=()=>{if(!i)return;let e=URL.createObjectURL(new Blob([i.text],{type:`text/yaml;charset=utf-8`})),t=document.createElement(`a`);t.href=e,t.download=m,t.click(),setTimeout(()=>URL.revokeObjectURL(e),1e3)},g=async()=>{d(!0),s(``);try{let t=await N.writeCi(e,n);p(!0),l(`Added ${t.file}.${n===`github`?` GitHub runs a workflow only from ${t.path}: move it there.`:` Create a pipeline from it in Azure DevOps.`}`)}catch(e){s(e.message)}finally{d(!1)}};return(0,Z.jsxs)(K,{open:!0,wide:!0,onClose:t,title:`CI pipeline`,description:`Runs the converted tests in your CI, one job per Tosca execution list. Review it before you commit it.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(W,{variant:`ghost`,onClick:t,children:`Close`}),(0,Z.jsxs)(W,{disabled:!i,onClick:h,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`Download`]}),!f&&(0,Z.jsx)(W,{variant:`primary`,disabled:!i||u,onClick:()=>void g(),"data-tip":`Into the target folder's ci/, so a pull request of the conversion carries it.`,children:u?`Adding…`:`Add to the target folder`})]}),children:[(0,Z.jsx)(_e,{label:`CI`,current:`ci-${n}`,onPick:e=>!u&&r(e.slice(3)),tabs:et}),(0,Z.jsxs)(`div`,{id:`panel-ci-${n}`,role:`tabpanel`,"aria-labelledby":`tab-ci-${n}`,className:`flex flex-col gap-4 text-sm`,children:[!i&&!o&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Making the pipeline…`}),o&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:o}),c&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-ink [overflow-wrap:anywhere]`,children:c}),i&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-2`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Jobs`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:[...i.tests?[i.suites.length?`One per Tosca execution list: ${i.suites.join(`, `)}`:`One for every test: the export has no execution lists`]:[],...i.workflows?[`One per kind of app (desktop, mobile), replaying ${Y(i.workflows,`workflow`)}`]:[]].join(`; `)}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Goes in`}),(0,Z.jsx)(`dd`,{className:`m-0 font-mono text-[13px] [overflow-wrap:anywhere]`,children:i.path}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`To set`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[i.tests&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:`BASE_URL`}),` as a variable`]}),i.secrets.length?(0,Z.jsxs)(Z.Fragment,{children:[i.tests?`; as `:`As `,n===`github`?`secrets`:`secret variables`,`: `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:i.secrets.join(`, `)})]}):null,!i.tests&&!i.secrets.length?`None`:null,i.skipped.length?(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Not passed, not a name the CI takes: `,i.skipped.join(`, `)]}):null]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:m}),(0,Z.jsx)(xe,{text:i.text,label:`Copy ${m}`})]}),(0,Z.jsx)(`pre`,{"aria-label":m,tabIndex:0,className:`m-0 max-h-[420px] overflow-auto rounded-[12px] bg-surface-muted px-4 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:i.text})]})]})]})]})}function nt({id:e,onClose:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),[m,h]=(0,X.useState)(``),g=(t=``)=>N.pr(e,t).then(e=>{r(e),h(``),e.preview&&(a(e.preview),s(t=>t||e.preview.base),l(t=>t||e.preview.title))},e=>h(e.message));(0,X.useEffect)(()=>{g()},[e]),(0,X.useEffect)(()=>{if(n?.job?.state!==`running`)return;let e=setTimeout(()=>void g(o),1e3);return()=>clearTimeout(e)},[n]);let _=async()=>{p(!0),h(``);try{let t=await N.openPr(e,{base:o.trim(),title:c.trim(),draft:u});r(e=>e&&{...e,job:t.job})}catch(e){h(e.message)}finally{p(!1)}},v=i,y=n?.job,x=y?.state===`running`,S=y?.state===`done`?y.result:void 0,C=m||(y?.state===`failed`?y.error:``)||(n&&!n.preview?n.problem:``)||``,w=e=>/^https:\/\//.test(e)?e:void 0,T=(e,t)=>(0,Z.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-1 text-accent-fg`,children:[t,(0,Z.jsx)(b,{size:11,"aria-hidden":`true`})]});return(0,Z.jsx)(K,{open:!0,wide:!0,onClose:t,title:`Open a pull request`,description:`The converted tests on a branch of their own, for your team to review. ForgeQE commits in a separate copy of the repository, so your own branch and edits stay as they are, and merges nothing.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(W,{variant:`ghost`,onClick:t,children:S?`Close`:`Cancel`}),!S&&(0,Z.jsx)(W,{variant:`primary`,disabled:!v||!n?.preview||f||x||!o.trim(),onClick:()=>void _(),children:f?`Starting…`:x?`Pushing…`:`Push and open the pull request`})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 text-sm`,children:[!n&&!m&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-muted`,children:`Checking the repository…`}),C&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:C}),S&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-ink [overflow-wrap:anywhere]`,children:[S.existing?`Nothing new to push: this is the pull request.`:`Pushed ${Y(S.files,`file`)} on ${S.branch}.`,` `,w(S.url)?T(w(S.url),`Open the pull request`):`It is open on ${S.branch}; the host gave no https address to link to.`]}),v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-2`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Repository`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[v.platform===`github`?`GitHub`:`Azure DevOps`,` `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:v.repository}),` (`,v.remote,`)`]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Branch`}),(0,Z.jsx)(`dd`,{className:`m-0 font-mono text-[13px] [overflow-wrap:anywhere]`,children:v.branch}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[Y(v.files.length,`file`),` of `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:v.folder})]})]}),v.last&&w(v.last.url)&&!S&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Opened before: `,T(w(v.last.url),`the pull request`),`. Pushing again updates its branch.`]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Merge into`}),(0,Z.jsx)(I,{value:o,spellCheck:!1,maxLength:200,placeholder:`main`,"aria-invalid":!(!n||n.preview),onChange:e=>s(e.target.value),onBlur:()=>o.trim()&&o.trim()!==n?.preview?.base&&void g(o.trim()),disabled:x,className:`font-mono`})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Title`}),(0,Z.jsx)(I,{value:c,maxLength:200,onChange:e=>l(e.target.value),disabled:x})]}),(0,Z.jsxs)(`label`,{className:P(`flex items-start gap-2`,x?`cursor-default`:`cursor-pointer`),children:[(0,Z.jsx)(J,{className:`mt-1`,checked:u,onCheckedChange:d,disabled:x}),(0,Z.jsxs)(`span`,{children:[`Open it as a draft`,(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Reviewers are not asked yet.`})]})]}),(0,Z.jsx)(Oe,{title:`Files (${v.files.length})`,children:(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 font-mono text-[13px]`,children:[v.files.slice(0,200).map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e)),v.files.length>200&&(0,Z.jsxs)(`li`,{className:`text-muted`,children:[`and `,v.files.length-200,` more`]})]})}),v.skipped.length>0&&(0,Z.jsx)(Oe,{title:`Left out (${v.skipped.length})`,children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:v.skipped.slice(0,100).map(e=>(0,Z.jsxs)(`li`,{className:`[overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.path}),`: `,(0,Z.jsx)(`span`,{className:`text-muted`,children:e.why})]},e.path))})})]})]})})}function rt({id:e,title:t,targetDir:n,onClose:r}){let[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=async()=>{s(!0),l(``);try{await N.delete(e,i),location.hash=V(`migration`,`migrations`)}catch(e){l(e.message),s(!1)}};return(0,Z.jsx)(K,{open:!0,onClose:r,title:`Delete this conversion`,description:`${t}. Removes the plan and its run history from the list. Files already written under ${n} stay.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(W,{variant:`ghost`,onClick:r,"data-tip":`Keep it`,children:[(0,Z.jsx)(j,{"aria-hidden":`true`}),`Keep`]}),(0,Z.jsxs)(W,{variant:`danger`,disabled:o||i!==e,onClick:()=>void u(),children:[(0,Z.jsx)(v,{"aria-hidden":`true`}),`Delete`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsxs)(`span`,{children:[`Type `,(0,Z.jsx)(`span`,{className:`font-mono`,children:e}),` to confirm`]}),(0,Z.jsx)(I,{value:i,onChange:e=>a(e.target.value),autoComplete:`off`,spellCheck:!1})]}),c?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c}):null]})})}function it({d:e,unit:t,onClose:n,onSend:r}){let[i,a]=(0,X.useState)(``),o=e.plan.units.find(e=>e.id===t),s=e.result?.units.find(e=>e.id===t);return(0,Z.jsx)(K,{open:!0,onClose:n,title:`Fix ${o?Q(o.target):t}`,description:`Bridge works on this file again, with ForgeQE's last check and your note. It runs in the background.`,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(W,{variant:`ghost`,onClick:n,children:[(0,Z.jsx)(p,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(W,{variant:`primary`,onClick:()=>r(i.trim()),"data-tip":`Send to the agent`,children:[(0,Z.jsx)(k,{"aria-hidden":`true`}),`Send`]})]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[s?.problems?.length?(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:s.problems[0]}):null,(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`What should change? (optional)`}),(0,Z.jsx)(ue,{value:i,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>a(e.target.value)})]})]})})}function at({d:e,unit:t,onClose:n}){let r=e.result?.units.find(e=>e.id===t),i=e.plan.units.find(e=>e.id===t);return(0,Z.jsx)(K,{open:!0,onClose:n,wide:!0,title:`Output of ${i?Q(i.target):t}`,description:r?.checkedAt?`Run again ${Ae(r.checkedAt)}`:`From the conversion's own run`,footer:(0,Z.jsxs)(W,{onClick:n,children:[(0,Z.jsx)(p,{"aria-hidden":`true`}),`Close`]}),children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[r?.problems?.length?(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:r.problems.join(` `)}):r?.status===`converted`?(0,Z.jsx)(`p`,{className:`m-0 text-sm text-pass`,children:`Passes, with every Tosca step in the test.`}):null,r?.command&&(0,Z.jsxs)(`code`,{className:`block font-mono text-[13px] text-muted`,children:[`$ `,r.command]}),(0,Z.jsx)(`pre`,{className:`m-0 max-h-[60vh] overflow-auto rounded-[12px] bg-surface-muted px-4 py-2 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r?.output||`No output.`})]})})}function ot(e){let t=Object.fromEntries(Be.map(e=>[e,{status:e===`prepare`?`running`:`pending`,...e===`prepare`?{startedAt:new Date().toISOString()}:{}}]));return{status:`running`,plan:e.plan.id,target:e.plan.target,units:[],reverted:[],model:``,startedAt:e.job?.last?.startedAt||new Date().toISOString(),ms:0,stage:`prepare`,stages:t,notes:``}}function st({label:e,children:t}){return(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e}),(0,Z.jsx)(`dd`,{className:`m-0 text-[13px] text-ink [overflow-wrap:anywhere] tabular-nums`,children:t})]})}function ct({d:e,planView:t,busy:n,onFix:r,onSteps:i,onOutput:a,onRun:o,onNext:s}){let c=e.result||(e.job?.running?ot(e):null);if(!c)return(0,Z.jsx)(Z.Fragment,{children:t});let u=new Map(c.units.map(e=>[e.id,e])),d=e.plan.units.filter(e=>e.kind===`test`&&!e.engine),f=e.plan.units.filter(e=>e.kind===`test`&&e.engine),p=new Set(d.map(e=>e.id)),m=new Set(f.map(e=>e.id)),g=c.units.filter(e=>p.has(e.id)&&e.status===`converted`).length,_=c.units.filter(e=>m.has(e.id)&&e.status===`written`).length,v=c.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),y=c.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,b=e=>c.units.filter(t=>(p.has(t.id)||m.has(t.id))&&t.status===e).length,x=d.length+f.length,S=[{label:`Failed`,n:b(`failed`),bar:`bg-fail`},{label:`Needs a look`,n:b(`blocked`),bar:`bg-warn`},{label:`Passing`,n:g,bar:`bg-pass`},{label:f.length===1?`Workflow written`:`Workflows written`,n:_,bar:`bg-line-strong`},{label:f.length?`Not done yet`:`Not run yet`,n:Math.max(0,x-c.units.filter(e=>p.has(e.id)||m.has(e.id)).length),bar:`bg-line`}],[C,...w]=e.plan.target.id.split(`-`);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:d.length?`${g} of ${d.length} passing`:`${_} of ${Y(f.length,`workflow`)} written`}),S.filter(e=>e.n>0).map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-ink-2`,children:[(0,Z.jsx)(`span`,{className:P(`size-2 rounded-full`,e.bar),"aria-hidden":`true`}),e.label,` `,(0,Z.jsx)(`span`,{className:P(`tabular-nums`,e.label===`Failed`?`text-fail`:``),children:e.n})]},e.label))]}),(0,Z.jsx)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-surface-strong`,"aria-hidden":`true`,children:S.map(e=>e.n?(0,Z.jsx)(`span`,{className:e.bar,style:{width:`${e.n/Math.max(1,x)*100}%`}},e.label):null)}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-2 gap-x-6 gap-y-2 @3xl:grid-cols-4`,children:[(0,Z.jsx)(st,{label:c.status===`running`?`Running for`:`Took`,children:je(c.status===`running`?Date.now()-Date.parse(c.startedAt):c.ms)}),(0,Z.jsx)(st,{label:`Tosca steps in the tests`,children:(0,Z.jsx)(`span`,{className:v.n&&v.m===v.n?`text-pass`:void 0,children:v.n?`${v.m} of ${v.n}`:`–`})}),(0,Z.jsx)(st,{label:`Need attention`,children:(0,Z.jsx)(`span`,{className:y?`text-fail`:void 0,children:y})}),(0,Z.jsx)(st,{label:`Pages`,children:Y(e.plan.units.filter(e=>e.kind===`page`).length,`page object`)})]})]}),c.notes&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c.notes}),c.batch&&c.batch.left>0&&c.status!==`running`&&(0,Z.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center gap-x-4 gap-y-2 rounded-[12px] border border-accent-line bg-accent-soft px-4 py-2 text-sm text-ink`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Batch `,c.batch.runs,` is done. Check its tests, then continue: `,Y(c.batch.left,`test case`),` not tried yet.`]}),(0,Z.jsxs)(W,{size:`sm`,disabled:n,onClick:s,children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Continue with the next batch`]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,Z.jsx)(`div`,{className:`@container min-w-0`,children:(0,Z.jsx)(ge,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,height:`min(58vh, 580px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:G,children:`File`}),(0,Z.jsx)(`th`,{className:G,children:`Status`}),(0,Z.jsx)(`th`,{className:P(G,`hidden @2xl:table-cell`),children:`Tosca steps`}),(0,Z.jsx)(`th`,{className:P(G,`hidden @3xl:table-cell`),children:`Note`}),(0,Z.jsx)(`th`,{className:G,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.plan.units.map(t=>{let o=u.get(t.id),s=o?Ie[o.status]:null,c=t.case?e.plan.cases.find(e=>e.id===t.case):void 0;return(0,Z.jsxs)(`tr`,{className:be,children:[(0,Z.jsxs)(`td`,{className:q,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:t.kind===`setup`?`Project set-up`:Q(t.target)}),(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[c?t.engine?`${Ke(t)} · ${c.name}`:c.name:`${Ke(t)} · ${t.target}`,c?.suites?.length?` · ${c.suites.join(`, `)}`:``]})]}),(0,Z.jsxs)(`td`,{className:P(q,`whitespace-nowrap`),children:[s?(0,Z.jsx)(oe,{tone:s.tone,children:s.label}):(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Waiting`}),o?.checkedAt&&(0,Z.jsxs)(`span`,{className:`block pt-1 text-[13px] text-muted`,children:[`Run again `,Se(o.checkedAt)]})]}),(0,Z.jsx)(`td`,{className:P(q,`hidden text-[13px] whitespace-nowrap @2xl:table-cell`),children:o?.fidelity?(0,Z.jsxs)(`span`,{className:o.fidelity.missing.length?`text-fail`:`text-ink-2`,children:[o.fidelity.matched,` of `,o.fidelity.required]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`–`})}),(0,Z.jsx)(`td`,{className:P(q,`hidden text-[13px] text-ink-2 @3xl:table-cell`),children:(0,Z.jsx)(`span`,{className:`line-clamp-2`,children:o?.problems?.[0]||o?.reason||``})}),(0,Z.jsx)(`td`,{className:P(q,`whitespace-nowrap text-right`),children:(0,Z.jsxs)(`span`,{className:`inline-flex gap-1`,children:[t.kind===`test`&&(o?.output||o?.problems?.length)&&(0,Z.jsx)(W,{variant:`icon`,size:`icon-sm`,"aria-label":`Output of ${Q(t.target)}`,"data-tip":`Output of ${Q(t.target)}`,onClick:()=>a(t.id),children:(0,Z.jsx)(h,{"aria-hidden":`true`})}),t.case&&(0,Z.jsx)(W,{variant:`icon`,size:`icon-sm`,"aria-label":`Steps of ${Q(t.target)}`,"data-tip":`Steps of ${Q(t.target)}`,onClick:()=>i(t.case),children:(0,Z.jsx)(T,{"aria-hidden":`true`})}),o&&(o.status===`failed`||o.status===`blocked`)&&t.kind!==`setup`&&!t.engine&&(0,Z.jsx)(W,{variant:`icon`,size:`icon-sm`,disabled:n,"aria-label":`Fix ${Q(t.target)}`,"data-tip":`Fix ${Q(t.target)}`,onClick:()=>r(t.id),children:(0,Z.jsx)(l,{"aria-hidden":`true`})})]})})]},t.id)})})}),(0,Z.jsxs)(`aside`,{"aria-label":`Details`,className:`flex flex-col gap-4 rounded-[14px] card border p-6 text-sm @5xl:sticky @5xl:top-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`From`}),(0,Z.jsxs)(`span`,{className:`font-medium`,children:[`Tricentis Tosca`,e.plan.source.project?` · ${e.plan.source.project}`:``]}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.plan.source.file})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`To`}),(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(He,{framework:C,language:w.join(`-`)}),e.plan.target.title]}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.targetPath})]}),(e.plan.suites||[]).length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`Suites`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-2 p-0`,children:e.plan.suites.map(e=>{let t=new Set(e.cases),r=c.units.filter(e=>e.kind===`test`&&e.case&&t.has(e.case)&&e.status===`converted`).length;return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate`,children:e.name}),(0,Z.jsxs)(`span`,{className:P(`text-[13px]`,r===e.cases.length?`text-pass`:`text-muted`),children:[r,` of `,Y(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,Z.jsx)(W,{variant:`icon`,size:`icon-sm`,disabled:n,"aria-label":`Run the ${e.name} suite`,"data-tip":`Run the ${e.name} suite`,onClick:()=>o(e.name),children:(0,Z.jsx)(D,{"aria-hidden":`true`})})]},e.name)})})]}),e.plan.env.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:`Environment variables`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:e.plan.env.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-col`,children:[(0,Z.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[e.name,e.secret?(0,Z.jsx)(`span`,{className:`font-sans text-muted`,children:` · secret`}):null]}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.from})]},e.name))})]}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 border-t border-line-soft pt-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Started`}),(0,Z.jsx)(`dd`,{className:`m-0 text-right`,children:Ae(c.startedAt)}),c.model&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Agent`}),(0,Z.jsx)(`dd`,{className:`m-0 truncate text-right`,"data-tip":c.model,children:c.model})]}),c.reverted.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Put back`}),(0,Z.jsxs)(`dd`,{className:`m-0 text-right`,children:[c.reverted.length,` edits outside the target`]})]})]})]})]})]})}var lt={fail:{icon:m,cls:`text-fail`,label:`Failed`},ok:{icon:s,cls:`text-pass`,label:`Done`},info:{icon:i,cls:`text-muted`,label:`Info`},agent:{icon:w,cls:`text-accent-fg`,label:`Agent`},tool:{icon:l,cls:`text-muted`,label:`Tool`}};function ut(e,t){let n=new Map;for(let r of e){let e=r.unit?`u:${r.unit}`:`s:${r.stage}`,i=n.get(e);if(!i){let a=r.unit?t.plan.units.find(e=>e.id===r.unit):void 0,o=a?.case?t.plan.cases.find(e=>e.id===a.case):void 0;i=a?{key:e,title:a.kind===`test`?o?.name||a.case||a.id:a.kind===`page`?`Page object ${a.page||``}`.trim():`Set-up`,sub:`${a.id} · ${Ke(a)} · ${a.target}`,status:t.result?.units.find(e=>e.id===a.id)?.status,events:[]}:{key:e,title:ze[r.stage]||r.stage,sub:`Stage`,events:[]},n.set(e,i)}i.events.push(r)}return[...n.values()]}var dt=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function ft({d:e,events:t,running:r}){let i=(0,X.useRef)(null),a=(0,X.useRef)(!0),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(`all`),[u,d]=(0,X.useState)({}),f=ut(t,e),p=o.trim().toLowerCase(),m=e=>(c===`all`||e.kind===c)&&(!p||e.text.toLowerCase().includes(p)),h=c!==`all`||!!p,g=f.map(e=>({...e,lines:e.events.filter(m),matchTitle:!!p&&`${e.title} ${e.sub}`.toLowerCase().includes(p)})).map(e=>({...e,lines:e.matchTitle?e.events.filter(e=>c===`all`||e.kind===c):e.lines})).filter(e=>e.lines.length),_=e=>t.filter(t=>t.kind===e).length,v=f[f.length-1]?.key;return(0,X.useEffect)(()=>{r&&!h&&a.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[t.length,r,h]),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(z,{id:`tosca-activity-search`,label:`Find a line`,value:o,onChange:s,placeholder:`Find a line, test case or file`}),(0,Z.jsx)(U,{items:[{id:`all`,label:`All`,n:t.length},{id:`fail`,label:`Failed`,n:_(`fail`),alert:!0},{id:`ok`,label:`Done`,n:_(`ok`)},{id:`info`,label:`Info`,n:_(`info`)},{id:`agent`,label:`Agent`,n:_(`agent`)},{id:`tool`,label:`Tools`,n:_(`tool`)}],value:c,onChange:l})]}),(0,Z.jsxs)(`div`,{ref:i,role:`log`,"aria-live":r?`polite`:void 0,"aria-label":`Activity`,onScroll:e=>{let t=e.currentTarget;a.current=t.scrollTop+t.clientHeight>=t.scrollHeight-24},className:`flex max-h-[60vh] flex-col overflow-y-auto rounded-[12px] card border`,children:[g.map(e=>{let t=e.events.filter(e=>e.kind===`fail`).length,i=u[e.key]??(h||t>0||r&&e.key===v),a=`act-${e.key.replace(/[^A-Za-z0-9_-]/g,`-`)}`,o=e.status?Ie[e.status]:void 0;return(0,Z.jsxs)(`div`,{className:`border-b border-line-soft last:border-b-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":a,onClick:()=>d(t=>({...t,[e.key]:!i})),className:`flex w-full min-w-0 cursor-pointer items-center gap-4 border-0 bg-transparent px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,Z.jsx)(n,{size:15,"aria-hidden":`true`,className:P(`flex-none text-muted transition-transform`,i&&`rotate-180`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block text-sm font-medium text-ink [overflow-wrap:anywhere]`,children:e.title}),(0,Z.jsx)(`span`,{className:`block truncate font-mono text-[13px] text-muted`,children:e.sub})]}),(0,Z.jsxs)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:[h&&e.lines.length!==e.events.length?`${e.lines.length} of ${Y(e.events.length,`line`)}`:Y(e.events.length,`line`),t>0&&(0,Z.jsxs)(`span`,{className:`text-fail`,children:[` · `,t,` failed`]})]}),o&&(0,Z.jsx)(oe,{tone:o.tone,children:o.label})]}),(0,Z.jsx)(de,{open:i,id:a,children:(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col border-t border-line-soft p-0`,children:e.lines.map((e,t)=>{let n=lt[e.kind];return(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft py-2 pr-4 pl-12 text-[13px] last:border-b-0`,children:[(0,Z.jsx)(`span`,{className:`w-[76px] flex-none text-[13px] whitespace-nowrap text-muted tabular-nums`,children:dt(e.ts)}),(0,Z.jsx)(n.icon,{size:16,role:`img`,"aria-label":n.label,className:P(`mt-1 flex-none`,n.cls)}),(0,Z.jsx)(`span`,{className:P(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`fail`?`text-fail`:e.kind===`ok`?`text-ink`:e.kind===`tool`?`font-mono text-[13px] text-muted`:`text-ink-2`),children:e.text})]},t)})})})]},e.key)}),!g.length&&(0,Z.jsx)(`p`,{className:`m-0 px-4 py-8 text-center text-sm text-muted`,children:t.length?`No line matches.`:`Nothing yet.`})]})]})}function pt({id:e,plan:t}){let[r,i]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[l,d]=(0,X.useState)(`overview`),[f,p]=(0,X.useState)(),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[b,x]=(0,X.useState)([]),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),[ee,O]=(0,X.useState)(!1),[k,A]=(0,X.useState)(!1),[re,j]=(0,X.useState)(!1),[M,P]=(0,X.useState)(!1),[F,I]=(0,X.useState)(!1),[se,ce]=(0,X.useState)(!1),L=(0,X.useRef)(0),R=(0,X.useCallback)(()=>{N.detail(e).then(e=>{i(e),s(``)},e=>s(e.message));let t=L.current;N.events(e,t).then(e=>{if(e.next<L.current){L.current=0,x([]);return}let t=L.current;if(e.next<=t)return;let n=e.events.slice(Math.max(0,e.events.length-(e.next-t)));L.current=e.next,n.length&&x(e=>[...e,...n].slice(-2e3))},()=>{})},[e]);(0,X.useEffect)(R,[R]);let z=!!(r?.job?.running||r?.result?.status===`running`);(0,X.useEffect)(()=>{if(!z)return;let e=setInterval(R,1500);return()=>clearInterval(e)},[z,R]);let le=(0,X.useCallback)(e=>{i(e),s(``),d(`overview`),setTimeout(R,800)},[R]),B=async e=>{w(!0),s(``);try{i(await e()),setTimeout(R,800)}catch(e){s(e.message)}finally{w(!1)}};if(!r)return o?(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:o}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let H=Qe(r),ue=Me(r.plan,r.result),U=r.result,G=(U?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,de=r.plan.cases.filter(e=>e.included).length,fe=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:de?String(de):void 0,tone:G?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:V(`migration`,`migrations`),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(y,{size:16,"aria-hidden":`true`}),`Migrations`]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-start`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:Q(r.plan.source.file)}),(0,Z.jsx)(te,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(He,{framework:r.plan.target.id.split(`-`)[0],language:r.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),r.plan.target.title]})]}),(0,Z.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm text-muted`,children:[(0,Z.jsxs)(`span`,{children:[`Tricentis Tosca`,r.plan.source.project?` · ${r.plan.source.project}`:``]}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsxs)(`span`,{children:[`into `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:r.plan.target.dir})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(oe,{tone:H.tone,children:H.label}),z?(0,Z.jsxs)(W,{variant:`danger`,disabled:C,onClick:()=>void B(()=>N.stop(e)),children:[(0,Z.jsx)(ne,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,Z.jsxs)(Z.Fragment,{children:[U&&(U.status===`stopped`||U.status===`failed`)&&(0,Z.jsxs)(W,{disabled:C,onClick:()=>ce(!0),"data-tip":`Start this conversion again. Tests it already wrote are kept.`,children:[(0,Z.jsx)(ae,{"aria-hidden":`true`}),`Start again`]}),U&&(0,Z.jsxs)(W,{variant:`ghost`,onClick:()=>location.hash=V(`tosca`,e,`report`),children:[(0,Z.jsx)(S,{"aria-hidden":`true`}),`Report`]}),U&&r.plan.units.some(e=>e.kind===`test`&&!e.engine)&&(0,Z.jsxs)(W,{disabled:C,onClick:()=>void B(()=>N.verify(e)),"data-tip":`Run every converted test again, no agent`,children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Run`]}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsxs)(W,{variant:`ghost`,disabled:C,"aria-haspopup":`menu`,"aria-expanded":M,onClick:()=>P(!M),children:[(0,Z.jsx)(ie,{"aria-hidden":`true`}),`More`,(0,Z.jsx)(n,{"aria-hidden":`true`})]}),(0,Z.jsxs)(Ee,{open:M,onClose:()=>P(!1),label:`More for this conversion`,side:`auto`,className:`right-0 w-[240px]`,children:[U&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Te,{onClick:()=>(P(!1),O(!0)),children:[(0,Z.jsx)(a,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`Re-import`]}),(0,Z.jsxs)(Te,{onClick:()=>(P(!1),j(!0)),children:[(0,Z.jsx)(c,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`CI`]}),(0,Z.jsxs)(Te,{onClick:()=>(P(!1),A(!0)),children:[(0,Z.jsx)(u,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`Pull request`]}),(0,Z.jsx)(`div`,{role:`separator`,className:`mx-2 my-1 border-t border-line-soft`})]}),(0,Z.jsxs)(Te,{onClick:()=>(P(!1),E(!0)),children:[(0,Z.jsx)(v,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-fail`}),(0,Z.jsx)(`span`,{className:`text-fail`,children:`Delete`})]})]})]})]})]})]}),ee&&(0,Z.jsx)($e,{d:r,onClose:()=>O(!1)}),k&&(0,Z.jsx)(nt,{id:e,onClose:()=>A(!1)}),re&&(0,Z.jsx)(tt,{id:e,onClose:()=>j(!1)}),se&&(0,Z.jsx)(Ze,{plan:r.plan,acceptLimits:!1,again:!0,onClose:()=>ce(!1),onStarted:e=>{ce(!1),i(e)}}),F&&r.result?.batch&&(0,Z.jsx)(Ze,{plan:r.plan,acceptLimits:!1,next:r.result.batch,onClose:()=>I(!1),onStarted:e=>{I(!1),i(e)}}),T&&(0,Z.jsx)(rt,{id:e,title:`${Q(r.plan.source.file)} → ${r.plan.target.title}`,targetDir:r.plan.target.dir,onClose:()=>E(!1)}),U&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 rounded-[12px] card border px-4 py-2 @xl:gap-4 @xl:px-4`,children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(Le,{states:U.stages})}),z&&(0,Z.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(ue)}% done`,children:[Math.round(ue),`%`]})]}),o&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:o}),(0,Z.jsx)(ye,{prefix:`mtab`,className:`mb-0`,tabs:fe,current:l,onPick:d,label:`Tosca conversion`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`mtab-panel-${l}`,"aria-labelledby":`mtab-${l}`,className:`pane-swap flex min-w-0 flex-col gap-4`,children:[l===`overview`&&(0,Z.jsx)(ct,{d:r,planView:t(r,le),busy:C||z,onFix:h,onSteps:e=>(p(e),d(`steps`)),onOutput:_,onRun:t=>void B(()=>N.verify(e,t)),onNext:()=>I(!0)}),l===`steps`&&(0,Z.jsx)(Je,{id:e,plan:r.plan,result:U,initial:f}),l===`activity`&&(0,Z.jsx)(ft,{d:r,events:b,running:z})]},l),g&&(0,Z.jsx)(at,{d:r,unit:g,onClose:()=>_(null)}),m&&(0,Z.jsx)(it,{d:r,unit:m,onClose:()=>h(null),onSend:t=>{h(null),B(()=>N.fix(e,[m],t))}})]})}var mt=e=>e.slice(e.lastIndexOf(`/`)+1),ht=50,gt=[{id:`failed`,label:`Failed`,bar:`bg-fail`,open:!0},{id:`attention`,label:`Needs a look`,bar:`bg-warn`,open:!0},{id:`passed`,label:`Passed`,bar:`bg-pass`,open:!1},{id:`notrun`,label:`Not run`,bar:`bg-line-strong`,open:!1},{id:`leftout`,label:`Left out`,bar:`bg-line`,open:!1}];function _t(e){return e===`converted`?Ie.converted:e===`failed`?Ie.failed:e===`blocked`?Ie.blocked:e===`left out`?{label:`Left out`,tone:`neutral`}:e===`written`?Ie.written:e===`not run`||e===`skipped`?{label:`Not run`,tone:`neutral`}:{label:e,tone:`neutral`}}function vt(e){for(let t of Be){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function yt({planId:e,unit:t,file:n}){let r=/\.(webm|mp4)$/i.test(n),[i,a]=(0,X.useState)(!r),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{if(!i)return;let r=!1;return s(``),l(!1),N.evidence(e,t,n).then(e=>!r&&s(e),()=>!r&&l(!0)),()=>{r=!0}},[e,t,n,i]),(0,Z.jsxs)(`li`,{className:`flex w-[260px] max-w-full flex-col gap-1`,children:[o?r?(0,Z.jsx)(`video`,{controls:!0,autoPlay:!0,src:o,className:`max-h-[200px] w-full rounded-[10px] border border-line-soft bg-surface-muted`}):(0,Z.jsx)(`img`,{src:o,alt:`Screenshot ${n}`,className:`max-h-[200px] w-full rounded-[10px] border border-line-soft object-contain`}):r&&!i?(0,Z.jsxs)(W,{variant:`ghost`,onClick:()=>a(!0),className:`h-[120px] w-full rounded-[10px] border border-line-soft bg-surface-muted`,children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Play video`]}):(0,Z.jsx)(`span`,{role:`status`,className:`flex h-[120px] items-center justify-center rounded-[10px] border border-line-soft bg-surface-muted text-[13px] text-muted`,children:c?`Not available`:`Loading…`}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:n})]})}function bt({planId:e,pick:t,video:n}){let[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(``);(0,X.useEffect)(()=>{let n=!1;return i(null),o(``),N.reportCase(e,t.case).then(e=>!n&&i(e),e=>!n&&o(e.message)),()=>{n=!0}},[e,t.case]);let s=_t(t.status),c=t.group===`failed`||t.group===`attention`;return(0,Z.jsxs)(`section`,{"aria-label":`Test case ${t.name}`,className:`flex min-w-0 flex-col gap-4 rounded-[12px] card border p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-4 gap-y-1`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`m-0 text-[16px] font-semibold [overflow-wrap:anywhere]`,children:t.name}),(0,Z.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted [overflow-wrap:anywhere]`,children:[t.file?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:t.file}):`No file`,t.suites.length?` · ${t.suites.join(`, `)}`:``,t.folders.length?` · ${t.folders.join(` / `)}`:``]}),(t.uid||t.change)&&(0,Z.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted [overflow-wrap:anywhere]`,children:[t.uid?(0,Z.jsxs)(`span`,{children:[`Tosca id `,(0,Z.jsx)(`span`,{className:`font-mono`,children:t.uid})]}):null,t.uid&&t.change?` · `:``,t.change?xt[t.change]:``]})]}),(0,Z.jsx)(oe,{tone:s.tone,children:s.label}),t.ms>0&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:je(t.ms)})]}),a&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:a}),!r&&!a&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),r&&(0,Z.jsxs)(Z.Fragment,{children:[(r.problems?.length||r.reason)&&(0,Z.jsx)(`div`,{className:P(`flex flex-col gap-1 rounded-[10px] px-4 py-2 text-[13px] [overflow-wrap:anywhere]`,c?`bg-fail-soft text-fail`:`bg-surface-muted text-ink-2`),children:(r.problems?.length?r.problems:[r.reason]).map((e,t)=>(0,Z.jsx)(`span`,{children:e},t))}),r.media.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:n?`Video and failure screenshots`:`Failure screenshots`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-4 p-0`,children:r.media.map(t=>(0,Z.jsx)(yt,{planId:e,unit:r.unit,file:t},t))})]}):r.unit&&r.group!==`notrun`?(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:c?`No screenshot${n?` or video`:``} was kept for this failure.`:n?`No video was kept for this run.`:`No screenshot: the test passed.`}):null,r.fidelity&&r.fidelity.rows.length>0&&(0,Z.jsx)(Oe,{title:`Tosca steps (${r.fidelity.matched} of ${r.fidelity.required} in the test)`,defaultOpen:!!(r.fidelity.missing.length||r.personSteps.length),children:(0,Z.jsx)(ge,{label:`Tosca steps`,placeholder:`Find a step`,height:`min(40vh, 360px)`,resetKey:t.case,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:P(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-14`),children:`Step`}),(0,Z.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`What it does`}),(0,Z.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`In the test`})]}),children:r.fidelity.rows.map(e=>{let t=Re[e.status]||Re.matched;return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,Z.jsx)(`td`,{className:P(`px-4 py-2`,`font-mono text-[13px] text-muted`),children:e.id}),(0,Z.jsxs)(`td`,{className:P(`px-4 py-2`,`[overflow-wrap:anywhere]`),children:[e.kind===`assert`?`check ${e.op}`:e.op,` on `,e.element||`—`,e.step&&(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Tosca “`,e.step,`”`]})]}),(0,Z.jsx)(`td`,{className:P(`px-4 py-2`,`whitespace-nowrap`),children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:P(`size-2 flex-none rounded-full`,t.dot)}),t.label]})})]},e.id)})})}),r.command&&(0,Z.jsxs)(`code`,{className:`block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`$ `,r.command]}),r.output&&(0,Z.jsx)(Oe,{title:`Test output`,defaultOpen:c,children:(0,Z.jsx)(`pre`,{className:`m-0 max-h-[40vh] overflow-auto rounded-[10px] bg-surface-muted px-4 py-2 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:r.output})})]})]})}var xt={same:`Unchanged in Tosca: its earlier test kept`,changed:`Changed in Tosca: converted again`,new:`New in Tosca`},St=e=>`"${(/^[=+\-@\t\r]/.test(e)?`'${e}`:e).replace(/"/g,`""`)}"`;function Ct(e){let t=[`Tosca id`,`Test case`,`Tosca path`,`Status`,`Test file`,`Steps in the test`,`Change`,`Execution lists`],n=e.tests.map(t=>[t.uid||``,t.name,[...t.folders,t.name].join(` / `),_t(t.status).label,t.file?`${e.target.dir}/${t.file}`:``,t.fidelity?`${t.fidelity.matched}/${t.fidelity.required}`:``,t.change?xt[t.change]:``,t.suites.join(`; `)]);for(let t of e.removed)n.push([t.uid||``,t.name,t.name,`Removed from Tosca`,t.file||``,``,``,``]);let r=[t,...n].map(e=>e.map(St).join(`,`)).join(`\r
2
- `),i=URL.createObjectURL(new Blob([`${r}\r\n`],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=`tosca-${e.id}-traceability.csv`,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function wt({g:e,rows:t,open:r,onToggle:i,pick:a,onPick:o}){let s=()=>Math.max(0,Math.floor(t.findIndex(e=>e.case===a)/ht)),[c,l]=(0,X.useState)(s),u=(0,X.useId)();(0,X.useEffect)(()=>l(s()),[t.length]);let d=t.slice(c*ht,c*ht+ht);return(0,Z.jsxs)(`div`,{className:`border-b border-line-soft last:border-b-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":u,onClick:i,className:`flex w-full cursor-pointer items-center gap-2 border-0 bg-transparent px-4 py-2 text-left hover:bg-surface-muted`,children:[(0,Z.jsx)(n,{size:15,"aria-hidden":`true`,className:P(`flex-none text-muted transition-transform`,r&&`rotate-180`)}),(0,Z.jsx)(`span`,{className:P(`size-2 flex-none rounded-full`,e.bar),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:t.length})]}),(0,Z.jsxs)(de,{open:r,id:u,children:[(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:d.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":a===e.case,onClick:()=>o(e),className:P(`flex w-full min-w-0 cursor-pointer flex-col gap-1 border-0 px-4 py-2 pl-10 text-left`,a===e.case?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] font-medium text-ink [overflow-wrap:anywhere]`,children:e.name}),e.ms>0&&(0,Z.jsx)(`span`,{className:`flex-none text-[13px] text-muted tabular-nums`,children:je(e.ms)})]}),e.note&&(0,Z.jsx)(`span`,{className:P(`truncate text-[13px]`,e.group===`failed`?`text-fail`:`text-muted`),children:e.note}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 gap-2 text-[13px] text-muted`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.file||`No file`}),e.fidelity&&(0,Z.jsxs)(`span`,{className:`flex-none tabular-nums`,children:[e.fidelity.matched,`/`,e.fidelity.required,` steps`]}),e.media>0&&(0,Z.jsx)(`span`,{className:`flex-none tabular-nums`,children:Y(e.media,`file`)})]})]})},e.case))}),t.length>ht&&(0,Z.jsx)(le,{page:c,size:ht,total:t.length,onPage:l,label:`${e.label} pages`})]})]})}function Tt({label:e,children:t,wide:n}){return(0,Z.jsxs)(`div`,{className:P(`flex min-w-0 flex-col gap-1`,n&&`@3xl:col-span-2`),children:[(0,Z.jsx)(`dt`,{className:`text-[13px] text-muted`,children:e}),(0,Z.jsx)(`dd`,{className:`m-0 text-[13px] text-ink [overflow-wrap:anywhere]`,children:t})]})}function Et({id:e,caseId:t}){let[n,r]=(0,X.useState)(null),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(!0),[c,l]=(0,X.useState)(`all`),[u,d]=(0,X.useState)(``),[f,p]=(0,X.useState)(``),[m,h]=(0,X.useState)({}),[g,_]=(0,X.useState)(``),[v,b]=(0,X.useState)(``);(0,X.useEffect)(()=>{s(!0),N.report(e).then(e=>{if(r(e.report),a(e.report?``:`No report yet. Start the conversion first.`),s(!1),e.report){let n=t&&e.report.tests.find(e=>e.case===t)||e.report.tests.find(e=>e.group===`failed`||e.group===`attention`)||e.report.tests.find(e=>e.group!==`leftout`);p(n?n.case:``)}},e=>{a(e.message),s(!1)})},[e]),(0,X.useEffect)(()=>{f&&history.replaceState(null,``,V(`tosca`,e,`report`,encodeURIComponent(f)))},[e,f]);let x=u.trim().toLowerCase(),S=(0,X.useMemo)(()=>{let e={failed:[],attention:[],passed:[],notrun:[],leftout:[]};for(let t of n?.tests||[])c!==`all`&&t.group!==c||x&&!`${t.name} ${t.file} ${t.case} ${t.note||``} ${t.suites.join(` `)} ${t.folders.join(` `)}`.toLowerCase().includes(x)||e[t.group].push(t);return e},[n,c,x]),C=async t=>{_(t),b(``);try{let n=await(t===`zip`?N.reportZip(e):N.reportHtml(e)),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`tosca-${e}.${t}`,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch(e){b(e.message)}finally{_(``)}};if(o)return(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading report…`});if(i||!n)return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:V(`tosca`,e),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(y,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:i||`No report.`})]});let w=Pe[n.status]||{label:n.status,tone:`neutral`},[T,...E]=n.target.id.split(`-`),D=vt(n.stages),ee=n.tests.length-n.counts.leftout,k=n.tests.find(e=>e.case===f)||null,ne=gt.reduce((e,t)=>e+S[t.id].length,0),A=Math.max(1,n.tests.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:V(`tosca`,e),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(y,{size:16,"aria-hidden":`true`}),`Conversion`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`p`,{className:`m-0 text-[13px] font-medium tracking-wide text-muted uppercase`,children:`Conversion report`}),(0,Z.jsxs)(`h2`,{className:`m-0 flex flex-wrap items-center gap-x-2 gap-y-1 text-[20px] leading-snug font-semibold tracking-[-0.01em]`,children:[(0,Z.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:mt(n.source.file)}),(0,Z.jsx)(te,{size:18,"aria-hidden":`true`,className:`text-muted`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(He,{framework:T,language:E.join(`-`),size:20}),n.target.title]})]})]}),(0,Z.jsx)(oe,{tone:w.tone,children:w.label}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(W,{size:`sm`,onClick:()=>void C(`html`),disabled:!!g,"data-tip":`ForgeQE's HTML report of this conversion: one file with the failure screenshots inside. The zip has the videos too.`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),g===`html`?`Making the HTML report…`:`HTML report`]}),(0,Z.jsxs)(W,{size:`sm`,variant:`ghost`,onClick:()=>Ct(n),"data-tip":`Every Tosca test case by its unique id and path, with what became of it: its test file, outcome and steps.`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`Traceability CSV`]}),(0,Z.jsxs)(W,{size:`sm`,onClick:()=>void C(`zip`),disabled:!!g||n.status===`running`,"data-tip":n.status===`running`?`The zip is made when the run ends.`:`The HTML report with every screenshot and video: unzip it and open report.html.`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),g===`zip`?`Making the zip…`:`Zip with videos`]})]})]}),v&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:v}),(0,Z.jsxs)(`section`,{"aria-label":`Summary`,className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px]`,children:[(0,Z.jsxs)(`span`,{className:`font-semibold`,children:[n.counts.passed,` of `,ee,` passed`]}),gt.filter(e=>n.counts[e.id]>0).map(e=>(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-ink-2`,children:[(0,Z.jsx)(`span`,{className:P(`size-2 rounded-full`,e.bar),"aria-hidden":`true`}),e.label,` `,(0,Z.jsx)(`span`,{className:P(`tabular-nums`,e.id===`failed`?`text-fail`:``),children:n.counts[e.id]})]},e.id))]}),(0,Z.jsx)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-surface-strong`,"aria-hidden":`true`,children:gt.map(e=>n.counts[e.id]?(0,Z.jsx)(`span`,{className:e.bar,style:{width:`${n.counts[e.id]/A*100}%`}},e.id):null)}),(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-2 gap-x-6 gap-y-2 @3xl:grid-cols-4 @5xl:grid-cols-6`,children:[(0,Z.jsxs)(Tt,{label:`Time`,children:[je(n.ms),` · started `,Ae(n.startedAt)]}),(0,Z.jsxs)(Tt,{label:`Tosca steps in the tests`,children:[n.steps.required?`${n.steps.matched} of ${n.steps.required}`:`–`,n.personSteps?(0,Z.jsxs)(`span`,{className:`text-warn`,children:[` · `,n.personSteps,` for a person`]}):null]}),(0,Z.jsx)(Tt,{label:`Media`,children:n.media?Y(n.media,`file`):n.target.video?`Videos and failure screenshots`:`Failure screenshots`}),(0,Z.jsxs)(Tt,{label:`LLM`,children:[n.model||`–`,n.usage.input||n.usage.output?(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,fe(n.usage.input+n.usage.output),` tokens`,n.cost?` · ${n.cost.estimate?`≈`:``}${me(n.cost.amount,n.cost.currency)}`:``]}):null]}),(0,Z.jsxs)(Tt,{label:`From`,children:[`Tosca`,n.source.project?` · ${n.source.project}`:``,` · `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:n.source.file}),n.source.baseUrl&&(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:n.source.baseUrl})]}),(0,Z.jsxs)(Tt,{label:`To`,children:[n.target.title,` · `,(0,Z.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[n.target.dir,`/`]}),n.reverted.length>0&&(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[Y(n.reverted.length,`edit`),` outside it put back`]})]})]}),(n.previous||n.removed.length>0)&&(0,Z.jsxs)(`p`,{className:`m-0 rounded-[10px] bg-surface-muted px-4 py-2 text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[n.previous?(0,Z.jsxs)(Z.Fragment,{children:[`Re-imported from `,(0,Z.jsx)(`a`,{href:V(`tosca`,n.previous,`report`),children:n.previous}),`: `,n.tests.filter(e=>e.change===`same`).length,` unchanged (their tests kept), `,n.tests.filter(e=>e.change===`changed`).length,` changed, `,n.tests.filter(e=>e.change===`new`).length,` new.`,` `]}):null,n.removed.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[Y(n.removed.length,`test case`),` no longer in the exports; their tests are left as they are: `,n.removed.slice(0,5).map(e=>`${e.name}${e.file?` (${e.file})`:``}`).join(`; `),n.removed.length>5?`; …`:``,`.`]})]}),D&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:[`Failed in `,ze[D.id],D.note?`: ${D.note}`:``]})]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-4 @5xl:grid-cols-[minmax(320px,400px)_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,Z.jsx)(z,{id:`tosca-report-search`,label:`Find a test case`,value:u,onChange:d,placeholder:`Find a test case, file or problem`,className:`max-w-none flex-none`}),(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex flex-wrap gap-1`,children:(0,Z.jsx)(U,{items:[{id:`all`,label:`All`,n:n.tests.length},...gt.filter(e=>n.counts[e.id]>0).map(e=>({id:e.id,label:e.label,n:n.counts[e.id],alert:e.id===`failed`}))],value:c,onChange:l})}),(0,Z.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex flex-col overflow-hidden overscroll-contain rounded-[12px] card border @5xl:max-h-[min(70vh,760px)] @5xl:overflow-y-auto`,children:[gt.filter(e=>S[e.id].length).map(e=>(0,Z.jsx)(wt,{g:e,rows:S[e.id],open:m[e.id]??(e.open||c===e.id||!!x||S[e.id].some(e=>e.case===f)),onToggle:()=>h(t=>({...t,[e.id]:!(t[e.id]??(e.open||c===e.id||!!x||S[e.id].some(e=>e.case===f)))})),pick:f,onPick:e=>p(e.case)},e.id)),!ne&&(0,Z.jsx)(`p`,{className:`m-0 px-4 py-6 text-center text-sm text-muted`,children:`No test case matches.`})]})]}),(0,Z.jsx)(`div`,{className:`min-w-0 @5xl:sticky @5xl:top-4`,children:k?(0,Z.jsx)(`div`,{className:`pane-swap`,children:(0,Z.jsx)(bt,{planId:n.id,pick:k,video:n.target.video})},k.case):(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] card border px-4 py-6 text-center text-sm text-muted`,children:`Pick a test case to see its steps, output and media.`})})]})]})}var Dt={converted:{icon:s,cls:`text-pass`,label:`Converted`},partly:{icon:E,cls:`text-warn`,label:`Converted, with steps for a person`},not:{icon:m,cls:`text-muted`,label:`Not converted`}},Ot=e=>`"${(/^[=+\-@\t\r]/.test(e)?`'${e}`:e).replace(/"/g,`""`)}"`;function kt(e,t,n){let r=[[`Test case id`,`Test case`,`Kind`,`What happens`,`Modules behind it`].map(Ot).join(`,`)];for(let n of e.rows)for(let e of n.cases)r.push([e,t.get(e)||e,n.label,Dt[n.outcome].label,n.modules.map(e=>e.name).join(`; `)].map(Ot).join(`,`));let i=URL.createObjectURL(new Blob([`${r.join(`\r
3
- `)}\r\n`],{type:`text/csv;charset=utf-8`})),a=document.createElement(`a`);a.href=i,a.download=n,a.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function At({coverage:e,names:t,file:r,folded:i=!1}){let a=e.converted+e.partly,[o,s]=(0,X.useState)(!i),c=(0,X.useId)();return(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-coverage`,className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,Z.jsx)(`h3`,{id:`tsc-coverage`,className:`m-0 text-sm font-semibold`,children:`What can be migrated`}),(0,Z.jsxs)(`span`,{className:`flex-1 text-[13px] text-ink-2`,children:[a,` of `,e.total,` test case`,e.total===1?``:`s`,e.partly?`, ${e.partly} of them with steps for a person`:``,`; `,e.not,` not`]}),i&&(0,Z.jsxs)(W,{size:`sm`,variant:`ghost`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(!o),children:[(0,Z.jsx)(n,{"aria-hidden":`true`,className:P(`transition-transform`,o&&`rotate-180`)}),o?`Hide the breakdown`:`Show the breakdown`]}),(0,Z.jsxs)(W,{size:`sm`,variant:`ghost`,onClick:()=>kt(e,t,r),"data-tip":`Every test case with its kind and what happens to it, for a spreadsheet.`,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`CSV`]})]}),(0,Z.jsx)(de,{open:o,id:c,children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.rows.map(e=>{let t=Dt[e.outcome];return(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsx)(t.icon,{size:16,role:`img`,"aria-label":t.label,className:P(`mt-1 flex-none`,t.cls)}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-ink`,children:e.label}),(0,Z.jsx)(`span`,{className:`tabular-nums text-ink-2`,children:e.cases.length===1?`1 test case`:`${e.cases.length} test cases`})]}),(0,Z.jsx)(`span`,{className:`text-ink-2`,children:e.becomes}),e.modules.length>0&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Because of: `,e.modules.slice(0,4).map(e=>`${e.name}${e.engine?` (${e.engine})`:``} in ${e.cases}`).join(` · `),e.modules.length>4?` · and ${e.modules.length-4} more`:``]}),e.reasons&&e.reasons.length>0&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Steps left: `,e.reasons.slice(0,3).map(e=>`${e.count}× ${e.reason}`).join(` · `),e.reasons.length>3?` · and ${e.reasons.length-3} more`:``]})]})]},e.kind)})})})]})}var jt={ok:{icon:s,cls:`text-pass`,label:`Ready`},answer:{icon:E,cls:`text-warn`,label:`Needs an answer`},blocker:{icon:m,cls:`text-fail`,label:`Blocks the start`}};function Mt({planId:e,stamp:t,busy:n,open:r,onChanged:i,onAccept:a,acceptTip:o}){let[s,c]=(0,X.useState)(null),[l,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(``),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(``);(0,X.useEffect)(()=>{N.data(e).then(e=>{c(e),g(``)},e=>g(e.message))},[e,t]);let _=async t=>{m(!0),g(``);try{c(await N.setData(e,t)),u(``),f(``),i()}catch(e){g(e.message)}finally{m(!1)}},v=n||p,y=s?[...new Set(s.cases.flatMap(e=>e.missing))]:[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 pt-1`,children:[s&&s.sources.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:s.sources.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.file}),e.sheet?` (sheet ${e.sheet})`:``,`: `,Y(e.rows,`row`),e.transposed?`, attributes down the first column`:``]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.file}${e.sheet?`, sheet ${e.sheet}`:``}`,disabled:v,onClick:()=>void _({remove:t}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`Remove`})]},`${e.file}\u0000${e.sheet||``}`))}),s&&y.length>0&&(0,Z.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[`Not found yet: `,(0,Z.jsx)(`span`,{className:`font-mono`,children:y.slice(0,12).join(`, `)}),y.length>12?` and ${y.length-12} more`:``]}),r&&(0,Z.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),l&&_({file:l,...d.trim()?{sheet:d.trim()}:{}})},children:[(0,Z.jsxs)(B,{size:`sm`,"aria-label":`A data file of the project`,value:l,disabled:v||!s,onChange:e=>u(e.target.value),className:`w-auto max-w-[320px] font-mono`,children:[(0,Z.jsx)(`option`,{value:``,children:s&&!s.files.length?`No CSV, TSV, Excel or JSON file in the project`:`A data file of the project…`}),(s?.files||[]).map(e=>(0,Z.jsx)(`option`,{value:e.path,children:e.path},e.path))]}),/\.xls[xm]$/i.test(l)&&(0,Z.jsx)(I,{size:`sm`,"aria-label":`Sheet, the first if empty`,placeholder:`Sheet, the first if empty`,value:d,onChange:e=>f(e.target.value),disabled:v,className:`min-w-0 flex-[1_1_160px]`}),(0,Z.jsx)(W,{size:`sm`,type:`submit`,disabled:v||!l,children:`Use it`}),a&&(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,disabled:v,onClick:a,"data-tip":o,children:`Leave them for a person`})]}),h&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail`,children:h})]})}function Nt({r:e,busy:t,onAnswer:n}){let[r,i]=(0,X.useState)(``),a=String(e.environments.findIndex(t=>t.environment===e.answers.environment&&t.app===e.answers.app));return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[e.environments.length>0&&(0,Z.jsxs)(B,{size:`sm`,"aria-label":`An app of env.yaml`,value:a,disabled:t,onChange:t=>{let r=e.environments[Number(t.target.value)];r&&n({environment:r.environment,app:r.app})},className:`w-auto max-w-[320px]`,children:[(0,Z.jsx)(`option`,{value:`-1`,children:`An app of env.yaml…`}),e.environments.map((e,t)=>(0,Z.jsxs)(`option`,{value:String(t),children:[e.environment,` · `,e.app,` · `,e.url]},`${e.environment}\u0000${e.app}`))]}),(0,Z.jsxs)(`form`,{className:`flex min-w-0 flex-[1_1_280px] gap-2`,onSubmit:e=>{e.preventDefault(),r.trim()&&n({baseUrl:r.trim()})},children:[(0,Z.jsx)(I,{size:`sm`,type:`url`,"aria-label":`Or the address the tests start at`,placeholder:`Or the address, https://…`,value:r,onChange:e=>i(e.target.value),disabled:t,className:`min-w-0 flex-1`}),(0,Z.jsx)(W,{size:`sm`,type:`submit`,disabled:t||!r.trim(),children:`Use it`})]})]})}function Pt({item:e,picked:t,busy:n,onPick:r}){let i=e.apps||[];return i.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:(0,Z.jsxs)(B,{size:`sm`,"aria-label":e.engine===`database`?`A database`:e.engine===`mobile`?`A mobile app`:`A desktop app`,value:t&&i.includes(t)?t:``,disabled:n,onChange:e=>e.target.value&&r(e.target.value),className:`w-auto max-w-[320px] font-mono`,children:[(0,Z.jsx)(`option`,{value:``,children:e.engine===`database`?`A database…`:e.engine===`mobile`?`A mobile app…`:`A desktop app…`}),i.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]})}):(0,Z.jsxs)(`p`,{className:`m-0 pt-1 text-[13px] text-muted`,children:[e.engine===`database`?`No databases yet: add one in `:`No ${e.engine} apps yet: add one in `,(0,Z.jsx)(`a`,{href:V(`settings`,e.engine===`database`?`databases`:`environments`),children:e.engine===`database`?`Settings, Databases`:`Settings, Environments`}),`.`]})}function Ft({item:e,busy:t,secrets:n,onSaved:r,onAccept:i,onUse:a}){let[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(``),m=async()=>{d(!0),p(``);try{await se.saveSecrets({[e.name]:o}),s(``),r()}catch(e){p(e.message)}finally{d(!1)}};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 pt-1`,children:[(0,Z.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),o&&m()},children:[(0,Z.jsx)(I,{size:`sm`,type:e.secret?`password`:`text`,autoComplete:`off`,spellCheck:!1,"aria-label":`Value of ${e.name}`,placeholder:e.secret?`Its value, kept in the credential store`:`Its value`,value:o,onChange:e=>s(e.target.value),disabled:t||u,className:`min-w-0 flex-[1_1_220px]`}),(0,Z.jsx)(W,{size:`sm`,type:`submit`,disabled:t||u||!o,children:`Save`}),e.accept&&(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,disabled:t||u,onClick:i,"data-tip":e.accept,children:`Convert without it`})]}),n.length>0&&!e.uses&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`use-${e.name}`,className:`text-[13px] text-muted`,children:`Or use a saved secret`}),(0,Z.jsxs)(B,{id:`use-${e.name}`,size:`sm`,value:c,disabled:t||u,onChange:e=>l(e.target.value),className:`w-auto min-w-[200px] font-mono`,children:[(0,Z.jsx)(`option`,{value:``,children:`A saved secret…`}),n.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))]}),(0,Z.jsx)(W,{size:`sm`,disabled:t||u||!c,onClick:()=>a(c),children:`Use it`})]}),f&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail`,children:f})]})}function It({planId:e,onReady:t,onCoverage:n}){let[r,i]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=(0,X.useCallback)(e=>{i(e.readiness),t?.(e.readiness.ready),n?.(e.coverage)},[t,n]),d=(0,X.useCallback)(()=>{N.ready(e).then(u,e=>l(e.message))},[e,u]);(0,X.useEffect)(()=>{i(null),l(``),t?.(!1)},[e]),(0,X.useEffect)(d,[d]);let f=async t=>{s(!0),l(``);try{u(await N.answer(e,t))}catch(e){l(e.message)}finally{s(!1)}};return(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-ready`,className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,Z.jsx)(`h3`,{id:`tsc-ready`,className:`m-0 text-sm font-semibold`,children:`Before it runs`}),(0,Z.jsx)(`span`,{role:`status`,className:P(`flex-1 text-[13px]`,r?r.ready?`text-pass`:`text-ink-2`:`text-muted`),children:r?r.ready?`Everything the tests need is in place.`:`${r.blockers?`${r.blockers} to fix`:``}${r.blockers&&r.open?`, `:``}${r.open?`${r.open} to answer`:``} before it can start.`:`Checking…`}),(0,Z.jsxs)(W,{size:`sm`,variant:`ghost`,onClick:d,disabled:o,"data-tip":`Check again, after installing a program or setting a variable.`,children:[(0,Z.jsx)(a,{"aria-hidden":`true`}),`Check again`]})]}),c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:c}),r&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:r.items.map(t=>{let n=jt[t.level];return(0,Z.jsxs)(`li`,{className:`flex gap-4 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsx)(n.icon,{size:16,role:`img`,"aria-label":n.label,className:P(`mt-1 flex-none`,n.cls)}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:P(`font-medium text-ink`,t.kind===`env`||t.kind===`tool`?`font-mono text-[13px]`:``),children:t.title}),(0,Z.jsx)(`span`,{className:`text-ink-2 [overflow-wrap:anywhere]`,children:t.text}),t.accepted&&(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-warn`,children:[`Accepted: `,t.accept,(0,Z.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>void f({unaccept:[t.id]}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`Undo`})]}),t.kind===`url`&&(0,Z.jsx)(Nt,{r,busy:o,onAnswer:e=>void f(e)}),t.kind===`app`&&t.engine&&(0,Z.jsx)(Pt,{item:t,picked:t.engine===`desktop`?r.answers.desktopApp:t.engine===`mobile`?r.answers.mobileApp:r.answers.database,busy:o,onPick:e=>void f(t.engine===`desktop`?{desktopApp:e}:t.engine===`mobile`?{mobileApp:e}:{database:e})}),t.kind===`env`&&t.level===`answer`&&(0,Z.jsx)(Ft,{item:t,busy:o,secrets:r.secrets||[],onSaved:d,onAccept:()=>void f({accept:[t.id]}),onUse:e=>void f({use:{name:t.name,secret:e}})}),t.kind===`env`&&t.uses&&(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] text-muted`,children:[(0,Z.jsxs)(`span`,{children:[`Uses the saved secret `,(0,Z.jsx)(`span`,{className:`font-mono`,children:t.uses}),`.`]}),(0,Z.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>void f({use:{name:t.name,secret:``}}),className:`cursor-pointer border-0 bg-transparent p-0 text-[13px] text-accent-fg hover:underline`,children:`Stop using it`})]}),t.kind===`data`&&(0,Z.jsx)(Mt,{planId:e,stamp:r,busy:o,open:t.level===`answer`,onChanged:d,onAccept:t.accept&&t.level===`answer`?()=>void f({accept:[t.id]}):void 0,acceptTip:t.accept})]})]},t.id)})})]})}var Lt=/^[a-f0-9]{16}$/,Rt=`forgeqe.tosca.assistant`;function zt(){try{let e=localStorage.getItem(Rt)||``;return Lt.test(e)?e:``}catch{return``}}function Bt(e){try{e?localStorage.setItem(Rt,e):localStorage.removeItem(Rt)}catch{}}var Vt=[/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{20,}/,/\bgithub_pat_[A-Za-z0-9_]{20,}/,/\bglpat-[A-Za-z0-9_-]{20,}/,/\bATBB[A-Za-z0-9_-]{20,}/,/\b[a-z2-7]{52}\b/,/\bsk-[A-Za-z0-9_-]{16,}/,/\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{16,}/i,/\b(?:password|passwd|secret|token|api[_-]?key)\s*[:=]\s*\S{6,}/i],Ht=e=>e.replace(/^.*\//,``).replace(/\.tsu$/i,``);function Ut(e){let t=e.exports[0]?.path||e.clones[0]?.exports[0]?.path,n=e.exports.length+e.clones.reduce((e,t)=>e+t.exports.length,0),r=[];return n>1&&r.push({icon:_,title:`All ${n} exports to Playwright`,hint:`Every export in one plan, in TypeScript`,text:`Migrate all the exports to Playwright in TypeScript`}),t&&r.push({icon:C,title:`${Ht(t)} to Selenium`,hint:`One export, in Java, with page objects`,text:`Migrate ${Ht(t)} to Selenium in Java, with page objects`}),t&&r.push({icon:d,title:`${Ht(t)} to Cypress`,hint:`Into a folder of its own`,text:`Migrate ${Ht(t)} to Cypress in TypeScript, into e2e/tosca`}),r.push({icon:A,title:`Help me choose`,hint:`The assistant asks one thing at a time`,text:`I want to migrate our Tosca tests. Help me choose.`}),r.slice(0,4)}function Wt({view:e,sid:t,onSid:n}){let[r,i]=(0,X.useState)(null),[a,o]=(0,X.useState)(``),[s,c]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1),d=(0,X.useRef)(null),f=we();(0,X.useEffect)(()=>{t&&r?.id!==t&&F.view(t).then(i,()=>{n(``),Bt(``)})},[t]),(0,X.useEffect)(()=>{if(!r?.thinking&&!r?.checking)return;let e=setTimeout(()=>F.view(r.id).then(i,e=>c(e.message)),1200);return()=>clearTimeout(e)},[r]);let p=r?.messages.length??0;(0,X.useEffect)(()=>{p&&d.current?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[p,r?.thinking]);let m=e=>{o(e),setTimeout(()=>document.getElementById(`tosca-agent-box`)?.focus(),0)},h=async e=>{u(!0),c(``);try{let r=await e();return i(r),r.id!==t&&(n(r.id),Bt(r.id)),!0}catch(e){return c(e.message),!1}finally{u(!1)}},_=async e=>{!e.trim()||l||r?.thinking||(Vt.some(t=>t.test(e))?(o(``),c(`That looks like a token or a password, so it was not sent and the box was cleared. Use the token field of the clone question: it keeps it in your credential store.`)):await h(()=>r?F.say(r.id,e):F.start(e))&&o(``))},v=()=>{r&&F.end(r.id).catch(()=>{}),i(null),o(``),c(``),n(``),Bt(``)},y=()=>r?.prefill&&(location.hash=V(`tosca`,`new`,r.id)),b=!r,x=l||!!r?.thinking;return(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-agent`,"aria-labelledby":`tab-agent`,className:`mx-auto flex w-full max-w-[1080px] flex-auto flex-col gap-6`,children:[b?(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[880px] flex-col items-center gap-4 pt-2 text-center short:gap-4 short:pt-0`,children:[(0,Z.jsx)(pe,{agent:`forgeqe-tosca`,px:f?72:112,working:x,className:`mb-1`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`h2`,{className:`m-0 text-[20px] font-semibold`,children:`What do you want to migrate from Tosca?`}),(0,Z.jsx)(`p`,{className:`m-0 text-[16px] text-muted`,children:`Say it in your words: the exports, the framework and where the tests run. I ask only what I still need, then open the wizard with every stage filled in for you to check.`})]}),(0,Z.jsx)(Yt,{view:e,onGit:()=>m(`Clone the Tosca exports from https://`)}),(0,Z.jsx)(`div`,{className:`grid w-full gap-2 text-left sm:grid-cols-2`,children:Ut(e).map(e=>(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>m(e.text),className:`flex cursor-pointer items-start gap-4 rounded-[12px] card border px-4 py-2 text-left hover:border-line-strong hover:bg-surface-muted`,children:[(0,Z.jsx)(L,{icon:e.icon,size:18,className:`mt-1 text-accent-fg`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-ink [overflow-wrap:anywhere]`,children:e.title}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.hint})]})]},e.title))}),(0,Z.jsxs)(`a`,{href:V(`tosca`,`new`),className:`inline-flex items-center gap-2 text-[13px]`,children:[(0,Z.jsx)(g,{size:14,"aria-hidden":`true`}),`Or set every option yourself`]})]}):(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-label":`Conversation with Guide`,className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:r.model?`Worked out by ForgeQE's model from what you said and what your project has.`:`Worked out by ForgeQE's rules: no model is set up.`}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,onClick:v,disabled:l,children:`New conversation`})]}),(0,Z.jsxs)(`ol`,{"aria-live":`polite`,className:`m-0 flex list-none flex-col gap-6 p-0`,children:[r.messages.map((e,t)=>(0,Z.jsx)(`li`,{className:`fade-quick`,children:e.role===`person`?(0,Z.jsx)(Ce,{text:e.text}):(0,Z.jsx)(Gt,{text:e.text})},t)),r.thinking&&(0,Z.jsx)(`li`,{className:`fade-quick`,children:(0,Z.jsx)(Gt,{text:r.working===`cloning`?`Cloning the repository and looking for Tosca exports…`:`Reading what you said…`,working:r.working===`cloning`?`cloning`:`reading`})})]}),!r.thinking&&r.question?.id===`clone`&&r.clone&&(0,Z.jsx)(qt,{c:r.clone,disabled:l,onToken:e=>h(()=>F.token(r.id,e)),onPick:e=>void h(()=>F.pick(r.id,`clone`,[e]))},`clone-${p}`),!r.thinking&&r.question&&r.question.id!==`clone`&&r.question.options.length>0&&(0,Z.jsx)(Kt,{q:r.question,disabled:l,onPick:e=>void h(()=>F.pick(r.id,r.question.id,e)).then(()=>document.getElementById(`tosca-agent-box`)?.focus())},`${r.question.id}-${p}`),!r.thinking&&r.prefill&&(0,Z.jsxs)(`div`,{className:`fade-quick flex flex-wrap items-center gap-4 rounded-[14px] border border-accent-line bg-accent-soft px-4 py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] text-ink`,children:r.question?`The wizard can open now; the rest is optional.`:`Everything is ready.`}),(0,Z.jsxs)(W,{variant:`primary`,onClick:y,children:[`Open the prefilled wizard`,(0,Z.jsx)(te,{"aria-hidden":`true`})]})]}),(0,Z.jsx)(`div`,{ref:d})]}),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(Jt,{v:r})})]}),(0,Z.jsxs)(`div`,{className:`sticky bottom-0 z-10 mt-auto flex flex-col bg-gradient-to-t from-bg from-85% to-transparent pt-6 pb-4`,children:[s&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 bg-bg pb-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:s}),(0,Z.jsx)(De,{id:`tosca-agent-box`,label:`Tell Guide`,value:a,onChange:e=>{o(e),c(``)},onSend:()=>void _(a),busy:l,disabled:x,placeholder:b?`Migrate checkout.tsu to Playwright in TypeScript, on QA…`:`Answer, or change anything you said…`})]})]})}function Gt({text:e,working:t}){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,Z.jsx)(R,{state:t?`working`:`idle`,px:28,label:t?`Guide is ${t}`:`Guide`,className:`mt-1 flex-none`}),(0,Z.jsx)(`p`,{className:P(`m-0 text-[16px] leading-relaxed whitespace-pre-line [overflow-wrap:anywhere]`,t?`text-muted`:`text-ink-2`),children:e})]})}function Kt({q:t,disabled:n,onPick:r}){let[i,a]=(0,X.useState)([]);return(0,Z.jsxs)(`fieldset`,{className:`fade-quick m-0 ml-10 flex min-w-0 flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`sr-only`,children:t.text}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.multi?(0,Z.jsx)(H,{items:t.options.filter(e=>!e.action).map(e=>({id:e.id,label:e.label})),value:i,onChange:e=>{let t=e.includes(`all`)&&!i.includes(`all`);a(t?[`all`]:e.filter(e=>e!==`all`))}}):t.options.map(e=>(0,Z.jsxs)(W,{size:`sm`,variant:e.id===`skip`?`ghost`:`outline`,disabled:n,onClick:()=>r([e.id]),children:[e.label,e.hint&&(0,Z.jsx)(`span`,{className:`text-[13px] font-normal text-muted`,children:e.hint})]},e.id))}),t.multi&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[t.options.some(e=>!e.action)&&(0,Z.jsxs)(W,{size:`sm`,variant:`primary`,disabled:n||!i.length,onClick:()=>r(i),children:[`Use `,i.includes(`all`)?`all`:i.length>1?`these ${i.length}`:`this`]}),t.options.filter(e=>e.action).map(t=>(0,Z.jsxs)(W,{size:`sm`,variant:`outline`,disabled:n,onClick:()=>r([t.id]),children:[t.id===`git`&&(0,Z.jsx)(e,{"aria-hidden":`true`}),t.label]},t.id)),t.typed&&t.options.some(e=>!e.action)&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Or type the names below.`})]})]})}function qt({c:t,disabled:n,onToken:r,onPick:i}){let[a,o]=(0,X.useState)(null),[s,c]=(0,X.useState)(!1),[l,u]=(0,X.useState)(``),d=[...new Set([...t.credentials,...t.tokenVar?[t.tokenVar]:[]])].sort(),f=async()=>{if(a){c(!0),u(``);try{await se.saveSecrets({[a.name]:a.value}),o(null),await r(a.name)}catch(e){u(e.message)}finally{c(!1)}}},p=n||s;return(0,Z.jsxs)(`fieldset`,{className:`fade-quick m-0 ml-10 flex min-w-0 flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,Z.jsxs)(`legend`,{className:`sr-only`,children:[`Clone `,t.url]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,Z.jsxs)(`label`,{htmlFor:`tsa-token`,className:`flex flex-col gap-1 text-[13px] font-medium text-muted`,children:[`Access token`,(0,Z.jsxs)(B,{id:`tsa-token`,size:`sm`,value:t.tokenVar??``,disabled:p,onChange:e=>void r(e.target.value),className:`min-w-[220px]`,children:[(0,Z.jsx)(`option`,{value:``,children:`None (public, or ssh)`}),d.map(e=>(0,Z.jsxs)(`option`,{value:e,children:[e,e===t.tokenVar&&!t.tokenSaved?` (not saved yet)`:``]},e))]})]}),!a&&(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,disabled:p,onClick:()=>o({name:t.tokenVar&&!t.tokenSaved?t.tokenVar:t.suggested,value:``}),children:`Add a token`}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,disabled:p,onClick:()=>void r(t.tokenVar??``),children:`Check again`})]}),!a&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Or save it in`,` `,(0,Z.jsx)(`a`,{href:V(`settings`,`repo-tokens`),target:`_blank`,rel:`noopener`,children:`Settings › Secrets › Repository tokens`}),`, then press Check again.`]}),a&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2 rounded-[12px] bg-surface-muted p-4`,children:[(0,Z.jsxs)(`label`,{htmlFor:`tsa-token-name`,className:`flex flex-col gap-1 text-[13px] font-medium text-muted`,children:[`Name`,(0,Z.jsx)(I,{id:`tsa-token-name`,size:`sm`,value:a.name,spellCheck:!1,maxLength:64,onChange:e=>o({...a,name:e.target.value.toUpperCase().replace(/[^A-Z0-9_]/g,`_`)}),className:`w-[180px]`})]}),(0,Z.jsxs)(`label`,{htmlFor:`tsa-token-value`,className:`flex flex-col gap-1 text-[13px] font-medium text-muted`,children:[`Token`,(0,Z.jsx)(I,{id:`tsa-token-value`,size:`sm`,type:`password`,autoComplete:`off`,value:a.value,onChange:e=>o({...a,value:e.target.value}),className:`w-[260px] max-w-full`})]}),(0,Z.jsx)(W,{size:`sm`,disabled:p||!a.name||!a.value,onClick:()=>void f(),children:s?`Saving…`:`Save`}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,disabled:s,onClick:()=>o(null),children:`Cancel`}),(0,Z.jsx)(`span`,{className:`w-full text-[13px] text-muted`,children:`Kept in ForgeQE's credential store, never in the chat, the address or this page. Give it read access to the repository only.`})]}),l&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail [overflow-wrap:anywhere]`,children:l}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsxs)(W,{size:`sm`,variant:`primary`,disabled:p||!(!t.tokenVar||t.tokenSaved),onClick:()=>i(`yes`),children:[(0,Z.jsx)(e,{"aria-hidden":`true`}),`Clone it`]}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,disabled:p,onClick:()=>i(`no`),children:`No`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:t.tokenVar&&!t.tokenSaved?`Save a token as ${t.tokenVar} first, or pick None.`:t.tokenVar?`Signs in with ${t.tokenVar}.`:`Nothing is cloned until you say so.`})]})]})}function Jt({v:e}){let t=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-sm [overflow-wrap:anywhere]`,children:t})]}),n=(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`}),r=e.have;return(0,Z.jsxs)(`aside`,{"aria-label":`What the assistant has so far`,className:`flex flex-col rounded-[14px] card border p-6`,children:[t(r.exports.length>1?`Exports (${r.exports.length})`:`Export`,r.exports.length?(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[r.exports.slice(0,6).map(e=>(0,Z.jsx)(`li`,{className:`font-mono text-[13px]`,children:e},e)),r.exports.length>6&&(0,Z.jsxs)(`li`,{className:`text-[13px] text-muted`,children:[`and `,r.exports.length-6,` more`]})]}):n),t(`Target`,r.targetId?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(He,{framework:r.targetId.split(`-`)[0],language:r.targetId.split(`-`).slice(1).join(`-`)}),r.target]}):n),t(`Tests start at`,r.start||(0,Z.jsx)(`span`,{className:`text-muted`,children:`Asked on Review when not given`})),r.needs.map(e=>(0,Z.jsx)(X.Fragment,{children:t(e.need===`database`?`Database`:e.need===`mobile`?`Mobile app`:`Desktop app`,e.picked?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.picked}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Asked on Review when not given`}))},e.need)),t(`Folder`,r.into?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:r.into}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`tosca-<target>`})),t(`Saved secrets`,r.uses.length?(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:r.uses.map(e=>(0,Z.jsxs)(`li`,{className:`font-mono text-[13px]`,children:[e.variable,` uses `,e.secret]},e.variable))}):(0,Z.jsx)(`span`,{className:`text-muted`,children:e.checking?`Reading which variables the tests need…`:`None`})),t(`Instructions`,r.instructions?(0,Z.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:r.instructions}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function Yt({view:t,onGit:n}){let i=`inline-flex min-h-7 items-center gap-1 rounded-full border px-2 no-underline`,a=t.clones.reduce((e,t)=>e+t.exports.length,0);return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2 text-[13px]`,children:[(0,Z.jsx)(`span`,{className:`mr-1 text-muted`,children:`Exports`}),t.exports.slice(0,5).map(e=>(0,Z.jsxs)(`span`,{className:P(i,`border-transparent bg-surface-strong text-ink-2`),children:[(0,Z.jsx)(r,{size:12,"aria-hidden":`true`}),Ht(e.path)]},e.path)),t.clones.map(t=>(0,Z.jsxs)(`span`,{className:P(i,`border-transparent bg-surface-strong text-ink-2`),children:[(0,Z.jsx)(e,{size:12,"aria-hidden":`true`}),t.label.replace(/^.*\//,``).replace(/\.git$/,``)]},t.id)),(0,Z.jsxs)(`button`,{type:`button`,onClick:n,className:P(i,`cursor-pointer border-dashed border-line-strong bg-transparent text-muted hover:text-ink`),children:[(0,Z.jsx)(e,{size:12,"aria-hidden":`true`}),`Clone a git repository`]}),(0,Z.jsx)(`span`,{className:`ml-1 text-muted`,children:t.exports.length+a?`${t.exports.length+a} found`:`none in this project yet`})]})}var Xt=[`Export`,`Target`,`Instructions`,`Review`],Zt=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],Qt=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],$t={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function en({at:e,reached:t,onGo:n}){return(0,Z.jsx)(`nav`,{"aria-label":`Steps`,children:(0,Z.jsx)(`ol`,{className:`m-0 flex list-none items-center gap-2 p-0`,children:Xt.map((r,i)=>{let a=i<=t,o=i===e,s=i<t&&!o;return(0,Z.jsxs)(`li`,{className:P(`flex items-center gap-2`,i<Xt.length-1&&`flex-1`),children:[(0,Z.jsxs)(`button`,{type:`button`,disabled:!a,"aria-current":o?`step`:void 0,onClick:()=>n(i),"aria-label":r,"data-tip":Zt[i],className:P(`inline-flex min-h-8 flex-none items-center gap-2 rounded-[8px] border-0 bg-transparent px-1 text-[13px] whitespace-nowrap`,a&&!o?`cursor-pointer hover:bg-surface-strong`:``),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:P(`inline-flex size-6 flex-none items-center justify-center rounded-full text-[13px] font-semibold tabular-nums`,s?`bg-pass text-white`:o?`bg-accent text-accent-ink`:`border border-line bg-bg text-muted`),children:s?(0,Z.jsx)(j,{size:13,strokeWidth:3}):i+1}),(0,Z.jsx)(`span`,{className:P(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<Xt.length-1&&(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 min-w-4 flex-1 overflow-hidden rounded-full bg-line @xl:min-w-8`,children:(0,Z.jsx)(`span`,{className:P(`block h-full rounded-full bg-pass transition-[width] duration-250 ease-out`,i<t?`w-full`:`w-0`)})})]},r)})})})}function tn({id:e,label:t,help:n,children:r}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:e,className:`text-sm font-medium`,children:t}),r,n&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:n})]})}function nn({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,Z.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-bg py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:a}),t&&(0,Z.jsxs)(W,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(y,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(W,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function rn({on:e,onPick:t,logo:n,title:r,sub:i,label:a,multi:o}){return(0,Z.jsxs)(`button`,{type:`button`,role:o?`checkbox`:`radio`,"aria-checked":e,"aria-label":a,onClick:t,className:P(`flex min-h-[72px] min-w-0 cursor-pointer items-center gap-4 rounded-[12px] border px-4 py-4 text-left transition-colors`,e?`border-accent bg-accent-soft ring-1 ring-accent`:`border-line-soft bg-bg hover:border-line hover:bg-surface-muted`),children:[(0,Z.jsx)(`span`,{className:`inline-flex size-9 flex-none items-center justify-center rounded-[10px] bg-surface-muted`,children:n}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium text-ink`,children:r}),i&&(0,Z.jsx)(`span`,{className:`truncate text-[13px] text-muted`,children:i})]})]})}var an=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function on({s:e}){return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[12px] bg-surface-muted px-4 py-4 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.project||e.file}),(0,Z.jsxs)(`span`,{className:`text-ink-2`,children:[Y(e.test_cases.length,`test case`),` · `,Y(e.pages.length,`module`),` · `,Y(e.totals.steps,`step`),` · `,Y(e.totals.asserts,`check`)]}),e.suites.length>0&&(0,Z.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,Y(e.suites.length,`execution list`)]}),e.totals.unsupported>0&&(0,Z.jsxs)(`span`,{className:`text-warn`,children:[`· `,e.totals.unsupported===1?`1 step value cannot`:`${e.totals.unsupported} step values cannot`,` be converted`]}),e.duplicates?(0,Z.jsxs)(`span`,{className:`text-ink-2`,children:[`· `,Y(e.duplicates,`test case`),` in more than one export, converted once`]}):null]})}var $=e=>`${e.workspace||``}\u0000${e.file}`;function sn({busy:e,onClone:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(``),[o,s]=(0,X.useState)(``);return(0,Z.jsxs)(`form`,{className:`flex flex-col gap-4 rounded-[12px] card border px-4 py-4`,onSubmit:e=>{e.preventDefault(),n.trim()&&t(n.trim(),i.trim(),o.trim())},children:[(0,Z.jsx)(tn,{id:`tsc-git-url`,label:`Repository`,help:`https:// or git@ address. A shallow copy is made under ForgeQE's home, with no hooks run; the project is not changed.`,children:(0,Z.jsx)(I,{id:`tsc-git-url`,value:n,spellCheck:!1,maxLength:500,placeholder:`https://github.com/org/tosca-exports.git`,onChange:e=>r(e.target.value)})}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @xl:grid-cols-2`,children:[(0,Z.jsx)(tn,{id:`tsc-git-branch`,label:`Branch`,help:`The default branch when empty.`,children:(0,Z.jsx)(I,{id:`tsc-git-branch`,value:i,spellCheck:!1,maxLength:200,placeholder:`main`,onChange:e=>a(e.target.value)})}),(0,Z.jsx)(tn,{id:`tsc-git-token`,label:`Credential variable`,help:`For a private repository: the name of the variable that holds its token (saved in Settings), never the token.`,children:(0,Z.jsx)(I,{id:`tsc-git-token`,value:o,spellCheck:!1,maxLength:80,placeholder:`GITHUB_TOKEN`,onChange:e=>s(e.target.value)})})]}),(0,Z.jsx)(`div`,{children:(0,Z.jsx)(W,{type:`submit`,disabled:e||!n.trim(),children:e?`Cloning…`:`Clone it`})})]})}function cn({view:e,onView:t,picked:r,setPicked:i,found:a,setFound:o,only:s,setOnly:c}){let[l,u]=(0,X.useState)(a?`tsc-cases`:`tsc-exports`),[d,f]=(0,X.useState)(``),[p,m]=(0,X.useState)(!1),[h,g]=(0,X.useState)(!1),[_,v]=(0,X.useState)(e.clones.length>0&&e.exports.length===0),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),w=new Set(r.map($)),T=[...e.exports.map(e=>({p:{file:e.path},bytes:e.bytes,from:`This project`})),...e.clones.flatMap(e=>e.exports.map(t=>({p:{file:t.path,workspace:e.id},bytes:t.bytes,from:`${e.label.replace(/^.*\//,``).replace(/\.git$/,``)}${e.branch?` (${e.branch})`:``}`})))],E=async(e,t)=>{if(i(e),o(null),S(``),e.length){m(!0);try{let t=await N.inspectSources(e);o(t),c(new Set(t.test_cases.filter(qe).map(e=>e.id))),u(`tsc-cases`)}catch(e){t&&i(t),S(e.message)}finally{m(!1)}}},D=e=>{o(null),S(``),i(t=>t.some(t=>$(t)===$(e))?t.filter(t=>$(t)!==$(e)):[...t,e])},ee=T.length>0&&T.every(e=>w.has($(e.p))),O=async(e,n,r)=>{g(!0),S(``);try{t?.(await N.clone(e,n||void 0,r||void 0))}catch(e){S(e.message)}finally{g(!1)}},te=async e=>{S(``),b(``);try{t?.(await N.removeClone(e)),i(t=>t.filter(t=>t.workspace!==e)),o(null)}catch(e){S(e.message)}},k=e=>{let t=new Set(s);t.has(e)?t.delete(e):t.add(e),c(t)},ne=e=>qe(e),A=a?a.test_cases.filter(ne):[],j=x&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:x});return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(_e,{label:`Export`,tabs:[{id:`tsc-exports`,label:r.length?`Exports · ${r.length} picked`:`Exports`},{id:`tsc-cases`,label:a?`Test cases · ${s.size} of ${a.test_cases.length}`:`Test cases`}],current:l,onPick:e=>{e===`tsc-cases`&&!a?r.length?E(r):S(`Pick at least one export first.`):u(e)}}),l===`tsc-exports`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-tsc-exports`,"aria-labelledby":`tab-tsc-exports`,className:`pane-swap flex flex-col gap-6`,children:[T.length>0?(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ge,{label:`Tosca exports`,placeholder:`Find an export`,height:`min(44vh, 400px)`,tools:(0,Z.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(J,{checked:ee,onCheckedChange:e=>{o(null),S(``),i(e?T.map(e=>e.p):[])}}),`Pick all `,T.length]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:P(G,`w-10`),children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,Z.jsx)(`th`,{className:G,children:`Export`}),(0,Z.jsx)(`th`,{className:P(G,`hidden @xl:table-cell`),children:`Folder`}),(0,Z.jsx)(`th`,{className:G,children:`From`}),(0,Z.jsx)(`th`,{className:ve,children:`Size`})]}),children:T.map(e=>{let t=$(e.p),n=e.p.file.slice(e.p.file.lastIndexOf(`/`)+1);return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:q,children:(0,Z.jsx)(J,{"aria-label":`Pick ${e.p.file}${e.p.workspace?` of ${e.from}`:``}`,checked:w.has(t),onCheckedChange:()=>D(e.p)})}),(0,Z.jsx)(`td`,{className:q,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(C,{size:15,"aria-hidden":`true`,className:`flex-none text-muted`}),(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:n})]})}),(0,Z.jsx)(`td`,{className:P(q,`hidden font-mono text-[13px] text-muted @xl:table-cell`),children:e.p.file.includes(`/`)?e.p.file.slice(0,e.p.file.lastIndexOf(`/`)):`.`}),(0,Z.jsx)(`td`,{className:P(q,`text-ink-2`),children:e.from}),(0,Z.jsx)(`td`,{className:he,children:an(e.bytes)})]},t)})})}):(0,Z.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-surface-muted px-4 py-4 text-sm text-ink-2`,children:[`No Tosca export (.tsu) in this project yet. Export the test cases from Tosca Commander and put the files inside the project, for example `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:`tosca/checkout.tsu`}),`, or clone the repository that holds them below.`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsx)(W,{variant:`primary`,disabled:p||!r.length,onClick:()=>void E(r),children:p?`Reading…`:r.length>1?`Read ${r.length} exports`:`Read the export`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:r.length?r.length>1?`Their test cases become one plan; a module they share becomes one page object.`:`Tick more to convert several exports in one plan.`:`Tick one or more exports.`})]}),p&&!x&&(0,Z.jsx)(`p`,{role:`status`,className:`shimmer m-0 text-[13px]`,children:(0,Z.jsxs)(`span`,{children:[`Reading `,r.length===1?`the export`:`${r.length} exports`,`…`]})}),j,(0,Z.jsx)(tn,{id:`tsc-path`,label:`Add by its path`,help:`A .tsu, or a folder of them, inside the project. Secrets in an export stay encrypted: they become environment variables.`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(I,{id:`tsc-path`,value:d,spellCheck:!1,maxLength:300,placeholder:`tosca/checkout.tsu or tosca/`,onChange:e=>f(e.target.value),className:`min-w-0 flex-[1_1_300px]`}),(0,Z.jsxs)(W,{disabled:p||!d.trim(),onClick:()=>void E([...r.filter(e=>$(e)!==$({file:d.trim()})),{file:d.trim()}],r),"data-tip":`Add the export at this path and read it`,children:[(0,Z.jsx)(re,{"aria-hidden":`true`}),`Add`]})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":_,onClick:()=>v(!_),className:`inline-flex min-h-8 cursor-pointer items-center gap-2 self-start rounded-[8px] border-0 bg-transparent px-1 text-sm font-medium text-ink hover:bg-surface-strong`,children:[(0,Z.jsx)(n,{size:15,"aria-hidden":`true`,className:P(`transition-transform`,_&&`rotate-180`)}),`From a git repository`,e.clones.length?` (${e.clones.length} cloned)`:``]}),_&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.clones.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col rounded-[12px] card border p-0 text-[13px]`,children:e.clones.map(e=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 border-b border-line-soft px-4 py-2 last:border-b-0`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.label,(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[e.branch?`${e.branch} · `:``,e.commit?`@${e.commit} · `:``,Y(e.exports.length,`export`),` · cloned `,new Date(e.createdAt).toLocaleDateString()]})]}),y===e.id?(0,Z.jsxs)(`span`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-ink-2`,children:[`Remove this copy? Plans made from it can no longer run.`,(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,onClick:()=>void te(e.id),children:`Remove it`}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,onClick:()=>b(``),children:`Keep it`})]}):(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,"aria-label":`Remove the copy of ${e.label}`,onClick:()=>b(e.id),children:`Remove`})]},e.id))}),(0,Z.jsx)(sn,{busy:h,onClone:(e,t,n)=>void O(e,t,n)})]})]})]}):(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-tsc-cases`,"aria-labelledby":`tab-tsc-cases`,className:`pane-swap flex flex-col gap-6`,children:[j,!a&&!p&&(0,Z.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Pick exports and read them first.`}),p&&(0,Z.jsx)(`p`,{role:`status`,className:`shimmer m-0 text-[13px]`,children:(0,Z.jsx)(`span`,{children:`Reading…`})}),a&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px] text-ink-2`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[`From `,r.length===1?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:r[0].file}):Y(r.length,`export`)]}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,onClick:()=>u(`tsc-exports`),children:`Change exports`})]}),(0,Z.jsx)(on,{s:a}),a.coverage&&(0,Z.jsx)(At,{coverage:a.coverage,names:new Map(a.test_cases.map(e=>[e.id,e.name])),file:`${r.length===1?r[0].file.replace(/^.*\//,``).replace(/\.tsu$/i,``):`tosca-exports`}-coverage.csv`,folded:!0}),(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ge,{label:`Test cases to convert`,placeholder:`Find a test case`,height:`min(52vh, 520px)`,tools:(0,Z.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-[13px] text-ink-2`,children:[(0,Z.jsx)(J,{checked:A.length>0&&A.every(e=>s.has(e.id)),onCheckedChange:e=>c(new Set(e?A.map(e=>e.id):[]))}),`Pick all `,A.length,` test cases ForgeQE can convert`]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:P(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-10`),children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,Z.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Test case`}),(0,Z.jsx)(`th`,{className:P(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Folder`}),(0,Z.jsx)(`th`,{className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Steps · checks`}),(0,Z.jsx)(`th`,{className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Kind`})]}),children:a.test_cases.map(e=>{let t=ne(e);return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,Z.jsx)(`td`,{className:`px-4 py-2`,children:(0,Z.jsx)(J,{"aria-label":`Pick ${e.name}`,disabled:!t,checked:t&&s.has(e.id),onCheckedChange:()=>k(e.id)})}),(0,Z.jsxs)(`td`,{className:`px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:P(`font-medium [overflow-wrap:anywhere]`,t?`text-ink`:`text-muted`),children:e.name}),(e.unsupported>0||e.suites.length>0)&&(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[e.unsupported?`${e.unsupported} not convertible`:``,e.unsupported&&e.suites.length?` · `:``,e.suites.length?`in ${e.suites.join(`, `)}`:``]})]}),(0,Z.jsx)(`td`,{className:P(`px-4 py-2`,`hidden text-muted @2xl:table-cell [overflow-wrap:anywhere]`),children:e.folders.join(` / `)||`–`}),(0,Z.jsxs)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:[e.steps,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.asserts]})]}),(0,Z.jsx)(`td`,{className:P(`px-4 py-2`,`whitespace-nowrap`),children:(0,Z.jsx)(oe,{tone:t?`neutral`:`warn`,children:t?Ge(e):`${Fe[e.route]||e.route}: later`})})]},e.id)})})}),a.env.length>0&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm`,children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:`Environment variables`}),(0,Z.jsxs)(`span`,{className:`text-[13px] text-ink-2`,children:[a.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`. Their values are never in the export; you set them before the tests run.`]})]})]})]})]})}function ln({view:e,to:t,setTo:n,fw:r,setFw:i,into:a,setInto:o,attr:s,setAttr:c}){let l=e=>e.split(`-`)[0],u=e=>e.split(`-`).slice(1).join(`-`),d=[...new Map(e.targets.map(e=>[l(e.id),e.framework])).entries()],f=r||(t?l(t):``),p=e.targets.filter(e=>l(e.id)===f);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Framework`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Framework`,className:`grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2`,children:d.map(([e,t])=>{let r=Ue[e];return(0,Z.jsx)(rn,{on:f===e,onPick:()=>{e!==f&&(i(e),n(``))},logo:r?(0,Z.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:t,sub:$t[e],label:t},e)})})]}),(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium`,children:`Language`}),!f&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Pick a framework first.`}),f&&!t&&(0,Z.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`Pick its language.`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Language`,className:`pane-swap grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2`,children:p.map(e=>{let r=Ve[u(e.id)];return(0,Z.jsx)(rn,{on:t===e.id,onPick:()=>n(e.id),logo:r?(0,Z.jsx)(r,{width:22,height:22,"aria-hidden":`true`}):null,title:e.language,label:e.language},e.id)})},f)]}),(0,Z.jsxs)(`div`,{className:`grid gap-4 @2xl:grid-cols-2`,children:[(0,Z.jsx)(tn,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,Z.jsx)(I,{id:`tsc-into`,value:a,spellCheck:!1,maxLength:300,placeholder:t?`tosca-${t}`:`Named after the target`,onChange:e=>o(e.target.value)})}),(0,Z.jsx)(tn,{id:`tsc-attr`,label:`Test id attribute (optional)`,help:`When the app's is not data-test-id, data-testid, data-test, data-cy or data-qa.`,children:(0,Z.jsx)(I,{id:`tsc-attr`,value:s,spellCheck:!1,maxLength:40,placeholder:`data-automation-id`,onChange:e=>c(e.target.value.replace(/[^A-Za-z0-9_-]/g,``))})})]})]})}function un({view:e,picked:t,found:n,only:r,to:i,instructions:a}){let o=e.targets.find(e=>e.id===i),s=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-sm`,children:t})]});return(0,Z.jsxs)(`aside`,{"aria-label":`Summary`,className:`flex flex-col rounded-[14px] card border p-6`,children:[s(t.length>1?`Exports (${t.length})`:`Export`,t.length?(0,Z.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:[t.slice(0,6).map(t=>(0,Z.jsxs)(`li`,{className:`font-mono text-[13px] [overflow-wrap:anywhere]`,children:[t.workspace?`${e.clones.find(e=>e.id===t.workspace)?.label.replace(/^.*\//,``)||`git`}: `:``,t.file]},$(t))),t.length>6&&(0,Z.jsxs)(`li`,{className:`text-[13px] text-muted`,children:[`and `,t.length-6,` more`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Test cases`,n?(0,Z.jsxs)(`span`,{children:[r.size,` of `,n.test_cases.length,` picked`]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`–`})),s(`Target`,o?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(He,{framework:o.id.split(`-`)[0],language:o.id.split(`-`).slice(1).join(`-`)}),o.title]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not picked yet`})),s(`Instructions`,a.trim()?(0,Z.jsx)(`span`,{className:`line-clamp-3 text-ink-2`,children:a.trim()}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None`}))]})}function dn({view:e,onView:t,review:n,onStart:r,from:i}){let[a,o]=(0,X.useState)(0),[s,c]=(0,X.useState)(0),[l,u]=(0,X.useState)([]),[d,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(new Set),[g,_]=(0,X.useState)(``),[v,y]=(0,X.useState)(``),[b,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(``),[E,O]=(0,X.useState)(null),[k,ne]=(0,X.useState)(!1),[A,re]=(0,X.useState)(!1),[j,ie]=(0,X.useState)(!1),[ae,M]=(0,X.useState)(``),I=[...m].sort().join(`,`);(0,X.useEffect)(()=>{O(null),ne(!1),c(e=>Math.min(e,2))},[l.map($).join(`|`),I,g,b,S,w]);let[oe,se]=(0,X.useState)(`next`),ce=(0,X.useRef)(null),L=e=>{se(e<a?`back`:`next`),o(e);let t=ce.current;t&&t.getBoundingClientRect().top<0&&t.scrollIntoView({block:`start`,behavior:`smooth`})},R=e=>{L(e),c(t=>Math.max(t,e)),M(``)},[z,le]=(0,X.useState)(i?`filling`:``);(0,X.useEffect)(()=>{if(!i)return;let e=!0;return(async()=>{ie(!0);try{let t=(await F.view(i)).prefill;if(!t)throw Error(`The assistant does not have the exports and the target yet: go back to it, or pick them here.`);if(!e)return;u(t.sources),y(t.to.split(`-`)[0]),_(t.to),x(t.into??``),T(t.instructions??``);let n=await N.inspectSources(t.sources);if(!e)return;let r=n.test_cases.filter(qe).map(e=>e.id);if(p(n),h(new Set(r)),!r.length)throw Error(`These exports hold no web or API test case to convert.`);let a=await N.plan({sources:t.sources,to:t.to,...t.into?{into:t.into}:{},...t.instructions?{instructions:t.instructions}:{}});(t.app||t.baseUrl)&&await N.answer(a.plan.id,t.app?{environment:t.app.environment,app:t.app.app}:{baseUrl:t.baseUrl}).catch(()=>{});for(let[e,n]of Object.entries(t.uses||{}))await N.answer(a.plan.id,{use:{name:e,secret:n}}).catch(()=>{});if((t.desktopApp||t.mobileApp||t.database)&&await N.answer(a.plan.id,{...t.desktopApp?{desktopApp:t.desktopApp}:{},...t.mobileApp?{mobileApp:t.mobileApp}:{},...t.database?{database:t.database}:{}}).catch(()=>{}),!e)return;O(a),c(3),L(3),le(`done`)}catch(t){if(!e)return;M(t.message),le(``)}finally{e&&ie(!1)}})(),()=>{e=!1}},[i]);let B=async()=>{ie(!0),M(``);try{let e=!d||d.test_cases.filter(qe).every(e=>m.has(e.id)),t=await N.plan({sources:l,to:g,...b.trim()?{into:b.trim()}:{},...e?{}:{only:[...m]},...w.trim()?{instructions:w.trim()}:{},...S?{testAttributes:[S]}:{}});O(t),R(3)}catch(e){let t=e.message;M(t);let n=b.trim().replace(/\\/g,`/`).replace(/(?<!\/)\/+$/,``);n&&t.includes(n)&&L(1)}finally{ie(!1)}},H=E?.plan,U=H?.feasibility.findings.some(e=>e.level===`limit`),W=H?.feasibility.verdict===`blocked`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i&&z&&(0,Z.jsxs)(`p`,{role:`status`,className:`fade-quick m-0 flex flex-wrap items-center gap-x-4 gap-y-1 rounded-[14px] border border-accent-line bg-accent-soft px-4 py-2 text-sm text-ink`,children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:z===`filling`?`Filling in every stage from your conversation with the assistant…`:`Filled in from your conversation with the assistant. Check each stage before you start.`}),(0,Z.jsx)(`a`,{href:V(`tosca`),className:`text-[13px]`,children:`Back to the assistant`})]}),(0,Z.jsx)(`div`,{ref:ce,className:`scroll-mt-4`,children:(0,Z.jsx)(en,{at:a,reached:s,onGo:e=>!j&&(e<3||E)&&L(e)})}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-step`,className:P(`flex min-w-0 flex-col gap-6`,oe===`next`?`pane-next`:`pane-back`),children:[(0,Z.jsx)(`h2`,{id:`tsc-step`,className:`m-0 text-[20px] font-semibold tracking-[-0.01em]`,children:[`Which Tosca export?`,`What should the tests become?`,`Anything the agent should know?`,`Review and start`][a]}),ae&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:ae}),a===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{view:e,onView:t,picked:l,setPicked:u,found:d,setFound:p,only:m,setOnly:h}),(0,Z.jsx)(nn,{busy:j,next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(te,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>R(1),disabled:!d||!m.size,aside:d&&!m.size?(0,Z.jsx)(`span`,{className:`text-muted`,children:`Pick at least one web or API test case.`}):void 0})]}),a===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ln,{view:e,to:g,setTo:_,fw:v,setFw:y,into:b,setInto:x,attr:S,setAttr:C}),(0,Z.jsx)(nn,{busy:j,onBack:()=>L(0),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(te,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>R(2),disabled:!g})]}),a===2&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(tn,{id:`tsc-instructions`,label:`Instructions (optional)`,help:`Style and structure for the new code. Every Tosca step and check is kept either way.`,children:(0,Z.jsx)(ue,{id:`tsc-instructions`,value:w,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>T(e.target.value)})}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Qt.map(e=>(0,Z.jsxs)(`button`,{type:`button`,disabled:w.includes(e),onClick:()=>T(w.trim()?`${w.trim()}\n${e}`:e),className:`inline-flex min-h-8 cursor-pointer items-center gap-2 rounded-[8px] border-0 bg-surface-strong px-2 text-[13px] text-ink hover:bg-line disabled:cursor-default disabled:opacity-50`,children:[(0,Z.jsx)(f,{size:13,"aria-hidden":`true`}),e]},e))}),(0,Z.jsx)(nn,{busy:j,onBack:()=>L(1),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ee,{"aria-hidden":`true`}),j?`Checking…`:`Check`]}),onNext:()=>void B(),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),a===3&&H&&(0,Z.jsxs)(Z.Fragment,{children:[n(H,k,ne,re),(0,Z.jsx)(nn,{busy:j,onBack:()=>L(2),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Start`]}),disabled:W||!A||U&&!k,onNext:()=>r(E,!!U&&k),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:W?`Change what is not possible first.`:A?U&&!k?`Accept the limits to start.`:`Runs in the background.`:`Answer what the tests need first.`})})]})]},a),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(un,{view:e,picked:l,found:d,only:m,to:g,instructions:w})})]})]})}function fn({planId:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{let t=!0;return n(null),i(!1),N.estimate(e).then(e=>t&&n(e),()=>t&&i(!0)),()=>{t=!1}},[e]),r?(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not known`}):t?t.files.setup+t.files.pages+t.files.tests?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{children:[`About `,fe(t.tokens.mid),` tokens`,t.cost?`, about ${me(t.cost.mid,t.cost.currency)}`:``,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`(`,fe(t.tokens.low),` to `,fe(t.tokens.high),t.cost?`, ${me(t.cost.low,t.cost.currency)} to ${me(t.cost.high,t.cost.currency)}`:``,`)`]})]}),(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[t.model&&t.model!==`none`?`With ${t.model}. `:`No model is set up for Bridge yet. `,t.basis.from===`history`?`From ${t.basis.files} files written by earlier conversions here.`:`From defaults: no conversion has run here yet.`,t.cost||!t.model||t.model===`none`?``:` No price is set for this model.`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Nothing left to write`}):(0,Z.jsx)(`span`,{role:`status`,className:`text-muted`,children:`Working it out…`})}function pn({plan:e,accepted:t,onAccept:n,onReady:r}){let[i,a]=(0,X.useState)(null),o=(0,X.useMemo)(()=>new Map(e.cases.map(e=>[e.id,e.name])),[e]),s=e.feasibility.findings.filter(e=>e.level===`blocker`),c=e.feasibility.findings.filter(e=>e.level===`limit`),l=e.cases.filter(e=>e.included),u=e.units.filter(e=>e.kind===`page`).length,d=l.filter(e=>e.workflow).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid gap-x-6 gap-y-2 rounded-[14px] card border px-6 py-4 text-sm @xl:grid-cols-[auto_1fr]`,children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`From`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[`Tricentis Tosca`,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[e.sources&&e.sources.length>1?` · ${e.sources.length} exports`:(0,Z.jsxs)(Z.Fragment,{children:[` `,`· `,(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.source.file})]}),e.source.project?` · ${e.source.project}`:``]}),e.sources&&e.sources.length>1&&(0,Z.jsx)(`ul`,{className:`m-0 mt-1 flex list-none flex-col gap-1 p-0`,children:e.sources.map((t,n)=>(0,Z.jsxs)(`li`,{className:`font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:[t.label,(0,Z.jsxs)(`span`,{className:`font-sans text-muted`,children:[` · `,(e=>e?Y(e,`test case`):`its test cases are all in another export`)(e.cases.filter(e=>e.source===n).length)]})]},n))})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`To`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[e.target.title,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.target.dir]})]}),e.previous&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Since`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[(0,Z.jsx)(`a`,{href:V(`tosca`,e.previous.id),children:e.previous.id}),(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,Y(e.cases.filter(e=>e.change===`same`).length,`test case`),` unchanged (their tests kept), `,e.cases.filter(e=>e.change===`changed`).length,` changed, `,e.cases.filter(e=>e.change===`new`).length,` new, `,(e.removed||[]).length,` removed`]})]})]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Files`}),(0,Z.jsxs)(`dd`,{className:`m-0`,children:[l.length-d,` test`,l.length-d===1?``:`s`,d?`, ${d} desktop or mobile workflow${d===1?``:`s`}`:``,` of `,e.cases.length,` test case`,e.cases.length===1?``:`s`,`, `,u,` page object`,u===1?``:`s`]}),(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Estimate`}),(0,Z.jsx)(`dd`,{className:`m-0`,children:(0,Z.jsx)(fn,{planId:e.id})}),(e.suites||[]).length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Suites`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.suites.map(e=>`${e.name} (${Y(e.cases.length,`test`)})`).join(`, `),(0,Z.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Tosca's execution lists, as tags on the tests: `,e.suites.map(e=>`@${e.tag}`).join(`, `),`.`]})]})]}),e.env.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Environment variables`}),(0,Z.jsxs)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:[e.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:`Never in the export: you set them before the tests run.`})]})]}),e.instructions&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`dt`,{className:`text-muted`,children:`Instructions`}),(0,Z.jsx)(`dd`,{className:`m-0 whitespace-pre-wrap [overflow-wrap:anywhere]`,children:e.instructions})]})]}),i&&(0,Z.jsx)(At,{coverage:i,names:o,file:`tosca-${e.id}-coverage.csv`}),s.length>0&&(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-blockers`,className:`flex flex-col gap-2 rounded-[14px] bg-fail-soft px-6 py-4`,children:[(0,Z.jsxs)(`h3`,{id:`tsc-blockers`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-fail`,children:[(0,Z.jsx)(x,{size:16,"aria-hidden":`true`}),`Not possible`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-6 text-sm text-ink`,children:s.map(e=>(0,Z.jsx)(`li`,{children:e.text},e.code))})]}),c.length>0&&(0,Z.jsxs)(`section`,{"aria-labelledby":`tsc-limits`,className:`flex flex-col gap-4 rounded-[14px] bg-warn-soft px-6 py-4`,children:[(0,Z.jsxs)(`h3`,{id:`tsc-limits`,className:`m-0 flex items-center gap-2 text-sm font-semibold text-warn`,children:[(0,Z.jsx)(x,{size:16,"aria-hidden":`true`}),`Before you start`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-2 pl-6 text-sm text-ink`,children:c.map(e=>(0,Z.jsx)(`li`,{children:e.text},e.code))}),n&&!s.length&&(0,Z.jsxs)(`label`,{className:`flex min-h-9 cursor-pointer items-center gap-2 text-sm font-medium`,children:[(0,Z.jsx)(J,{checked:!!t,onCheckedChange:n}),`I understand`]})]}),(0,Z.jsx)(It,{planId:e.id,onReady:r,onCoverage:a}),(0,Z.jsx)(Oe,{title:`Test cases (${e.cases.length})`,children:(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ge,{label:`Test cases of the plan`,placeholder:`Find a test case`,height:`min(48vh, 440px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:G,children:`Test case`}),(0,Z.jsx)(`th`,{className:G,children:`In the plan`}),(0,Z.jsx)(`th`,{className:P(ve,`hidden @xl:table-cell`),children:`Steps · checks`}),(0,Z.jsx)(`th`,{className:G,children:`Kind`})]}),children:e.cases.map(e=>{let t=e.change;return(0,Z.jsxs)(`tr`,{className:be,children:[(0,Z.jsx)(`td`,{className:P(q,`[overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,Z.jsxs)(`td`,{className:P(q,`text-ink-2`),children:[e.included?`Converted`:e.why?e.why[0].toUpperCase()+e.why.slice(1):`Left out`,t?(0,Z.jsx)(`span`,{className:`block text-[13px] text-muted`,children:{same:`Unchanged: its test kept`,changed:`Changed in Tosca`,new:`New in Tosca`}[t]}):null]}),(0,Z.jsxs)(`td`,{className:P(he,`hidden @xl:table-cell`),children:[e.steps,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.asserts]})]}),(0,Z.jsx)(`td`,{className:P(q,`whitespace-nowrap text-muted`),children:Fe[e.route]||e.route})]},e.id)})})})}),(0,Z.jsx)(Oe,{title:`Files, in order (${e.units.length})`,children:(0,Z.jsx)(ge,{label:`Files, in order`,placeholder:`Find a file`,height:`min(40vh, 360px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{className:P(G,`w-24`),children:`Kind`}),(0,Z.jsx)(`th`,{className:G,children:`File`})]}),children:e.units.map(e=>(0,Z.jsxs)(`tr`,{className:be,children:[(0,Z.jsx)(`td`,{className:P(q,`text-muted`),children:Ke(e)}),(0,Z.jsx)(`td`,{className:P(q,`font-mono text-[13px] [overflow-wrap:anywhere]`),children:e.target})]},e.id))})})]})}function mn({d:e,onStarted:t}){let[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(!1),c=e.plan.feasibility.findings.some(e=>e.level===`limit`),l=e.plan.feasibility.verdict===`blocked`,u=!!e.job?.running;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.job?.last&&!u&&(0,Z.jsx)(`p`,{className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail`,children:`The last start did not run. Its job's log on the Jobs page says why.`}),(0,Z.jsx)(pn,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r,onReady:a}),!l&&!u&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsxs)(W,{variant:`primary`,disabled:!i||!e.confirmed&&c&&!n,onClick:()=>s(!0),"data-tip":`Start the conversion`,children:[(0,Z.jsx)(D,{"aria-hidden":`true`}),`Start`]}),!i&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Answer what the tests need first.`})]}),o&&(0,Z.jsx)(Ze,{plan:e.plan,acceptLimits:c&&(e.confirmed||n),onClose:()=>s(!1),onStarted:e=>{s(!1),t(e)}})]})}function hn({sub:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),[s,c]=(0,X.useState)(zt),l=(0,X.useCallback)(()=>{N.list().then(e=>{n(e),i(``)},e=>i(e.message))},[]);(0,X.useEffect)(l,[l,e]),(0,X.useEffect)(()=>{e===`conversions`&&location.replace(V(`migration`,`migrations`))},[e]);let u=e?.match(/^(tsc-\d{8}-\d{6}-[0-9a-f]{4})\/report(?:\/([^/]+))?$/),d=e&&/^tsc-\d{8}-\d{6}-[0-9a-f]{4}$/.test(e)?e:u?.[1]||``,f=!!u,p;try{p=u?.[2]?ce(u[2]):void 0}catch{}let m=!t&&!r&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),h=e?.match(/^new\/([a-f0-9]{16})$/)?.[1];return e===`new`||h?(0,Z.jsxs)(ke,{tab:`migrations`,children:[(0,Z.jsx)(We,{error:r}),m,t&&(0,Z.jsx)(dn,{view:t,onView:n,from:h,review:(e,t,n,r)=>(0,Z.jsx)(pn,{plan:e,accepted:t,onAccept:n,onReady:r}),onStart:(e,t)=>o({d:e,accept:t})},h||`new`),a&&(0,Z.jsx)(Ze,{plan:a.d.plan,acceptLimits:a.accept,onClose:()=>o(null),onStarted:e=>{o(null),location.hash=V(`tosca`,e.plan.id)}})]}):d&&f?(0,Z.jsx)(ke,{tab:`migrations`,wide:!0,children:(0,Z.jsx)(Et,{id:d,caseId:p},d)}):d?(0,Z.jsxs)(ke,{tab:`migrations`,wide:!0,children:[(0,Z.jsx)(We,{error:r}),m,t&&(0,Z.jsx)(pt,{id:d,plan:(e,t)=>(0,Z.jsx)(mn,{d:e,onStarted:t})},d)]}):e===`conversions`?(0,Z.jsx)(ke,{tab:`migrations`,children:m}):(0,Z.jsxs)(ke,{tab:`migrations`,children:[(0,Z.jsx)(We,{error:r}),m,t&&(0,Z.jsx)(Wt,{view:t,sid:s,onSid:c})]})}export{hn as Tosca};
@@ -1 +0,0 @@
1
- import{Br as e,Lr as t,O as n,o as r}from"./line-icons-CwZWt93L.js";import{$t as i,H as a,V as o,c as s}from"./filters-faaSnoIq.js";import{Bt as c,bn as l,bt as u,o as d,t as f}from"./frame-BLPdAXUq.js";import{B as p,G as m,H as h,U as g,V as _,z as v}from"./index-CxiCvGZq.js";var y=e(t(),1),b=i(),x={new:{label:`New`,tone:`running`},improved:{label:`Improved`,tone:`neutral`},fixed:{label:`Fixed`,tone:`pass`}};function S({change:e,id:t,first:i}){let[a,l]=(0,y.useState)(!1),u=_(e);return(0,b.jsxs)(`li`,{className:o(!i&&`border-t border-line-soft`),children:[(0,b.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":t,onClick:()=>l(!a),className:`flex min-h-11 w-full cursor-pointer items-center gap-4 border-0 bg-transparent px-4 py-2 text-left text-sm text-ink hover:bg-surface-muted`,children:[(0,b.jsx)(s,{tone:x[e.kind].tone,icon:!1,className:`w-[76px] justify-center`,children:x[e.kind].label}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:e.title}),(0,b.jsx)(n,{size:16,"aria-hidden":`true`,className:o(`flex-none text-muted transition-transform duration-200`,a&&`rotate-90`)})]}),(0,b.jsx)(c,{open:a,id:t,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 pt-1 pb-4 sm:pl-26`,children:[(0,b.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.detail}),u&&(0,b.jsxs)(`a`,{href:u,className:`inline-flex items-center gap-1 self-start text-[13px] font-medium`,children:[`Open`,(0,b.jsx)(r,{size:13,"aria-hidden":`true`})]})]})})]})}function C({release:e}){let t=e===v;return(0,b.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:o(`relative mt-2 size-[15px] flex-none rounded-full border-[3px] border-bg`,t?`bg-accent`:`bg-line`)}),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1`,children:[(0,b.jsxs)(`h3`,{className:`m-0 text-[16px] font-semibold`,children:[`ForgeQE `,e.version]}),t&&(0,b.jsx)(s,{tone:`running`,icon:!1,children:`Latest`}),(0,b.jsxs)(`span`,{className:`text-sm text-muted`,children:[(0,b.jsx)(`time`,{dateTime:e.date,children:g(e.date)}),` · `,a(e.changes.length,`change`)]})]}),(0,b.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:e.summary}),(0,b.jsx)(`ul`,{className:`m-0 flex list-none flex-col overflow-hidden rounded-[12px] card border p-0`,children:e.changes.map((t,n)=>(0,b.jsx)(S,{change:t,first:n===0,id:`change-${e.version}-${n}`},n))})]})]})}function w({embedded:e=!1}={}){(0,y.useEffect)(h,[]);let t=p(),n=(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)(`div`,{className:`relative flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[60px] bottom-10 left-[7px] w-px bg-line`}),t.map(e=>(0,b.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(`h2`,{className:`m-0 pl-8 text-[20px] font-semibold`,children:e.month}),(0,b.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:e.releases.map(e=>(0,b.jsx)(C,{release:e},e.version))})]},e.month))]})});return e?(0,b.jsx)(`div`,{className:`flex flex-col gap-6`,children:n}):(0,b.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,b.jsx)(d,{}),(0,b.jsxs)(`main`,{className:o(f,`flex-auto gap-6`),children:[(0,b.jsx)(m,{}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,b.jsx)(u,{pixel:l[`whats-new`],size:`lg`}),(0,b.jsx)(`h1`,{className:`m-0 flex-1 text-[25px] font-semibold tracking-[-0.01em]`,children:`What's new`})]}),(0,b.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`What each release of ForgeQE added, improved and fixed. Pick a change to read more.`}),n]})]})}export{x as KIND,w as WhatsNew};
@@ -1 +0,0 @@
1
- import{p as e}from"./filters-faaSnoIq.js";var t=[{id:`runs`,label:`Runs`,href:e(`runs`)},{id:`reports`,label:`Execution reports`,href:e(`reports`)},{id:`reports-project`,label:`Project report`,href:e(`reports`,`project`)},{id:`run-diff`,label:`Run diff`,href:e(`run-diff`)},{id:`flaky`,label:`Flaky tests`,href:e(`flaky`)}],n=[{id:`evidence-contracts`,label:`Contracts`,href:e(`evidence-contracts`)},{id:`evidence-releases`,label:`Releases`,href:e(`evidence-releases`)},{id:`evidence-learn`,label:`Learn`,href:e(`evidence-learn`)},{id:`evidence-monitor`,label:`Monitor`,href:e(`evidence-monitor`)}];export{t as n,n as t};