@capagents/forgeqe 3.1.8 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/HOW_TO_USE.md +51 -4
  2. package/THIRD_PARTY_NOTICES.md +2 -1
  3. package/dist/docs-site/docs/area-operations/index.html +25 -2
  4. package/dist/docs-site/docs/area-quality/index.html +17 -3
  5. package/dist/docs-site/docs/area-setup/index.html +1 -1
  6. package/dist/docs-site/docs/get-started/index.html +18 -2
  7. package/dist/docs-site/docs/overview/index.html +1 -1
  8. package/dist/docs-site/docs/search.js +1 -1
  9. package/dist/forgeqe.js +1972 -1930
  10. package/dist/template.html +12 -12
  11. package/dist/vendor/ibm-ace.js +2 -0
  12. package/dist/web/THIRD_PARTY_NOTICES.md +29 -0
  13. package/dist/web/assets/{3d-force-graph-OeCdKJJ-.js → 3d-force-graph-Bhmgjf_7.js} +1 -1
  14. package/dist/web/assets/Agent-Dx4aOB_h.js +8 -0
  15. package/dist/web/assets/AgentWork-D0MS10up.js +2 -0
  16. package/dist/web/assets/ApiTests-DUoEh0nX.js +10 -0
  17. package/dist/web/assets/Browse-BGgyLuL3.js +1 -0
  18. package/dist/web/assets/Chat-CEHUI2ty.js +3 -0
  19. package/dist/web/assets/{CommandPalette-zRrrp6F_.js → CommandPalette-rY8rp79k.js} +1 -1
  20. package/dist/web/assets/Compare-B_NCvogR.js +1 -0
  21. package/dist/web/assets/Cost-sm-6tWRQ.js +1 -0
  22. package/dist/web/assets/Data-CFyxbwPS.js +6 -0
  23. package/dist/web/assets/Desktop-A_D4LTis.js +1 -0
  24. package/dist/web/assets/DesktopReview-CM7xmpHS.js +2 -0
  25. package/dist/web/assets/Evidence-BlTkmzfE.js +1 -0
  26. package/dist/web/assets/Explore-DyGqAEff.js +2 -0
  27. package/dist/web/assets/Features-BjPR9gCe.js +1 -0
  28. package/dist/web/assets/Flags-C_DneXS9.js +2 -0
  29. package/dist/web/assets/Flaky-l5ugC_ER.js +1 -0
  30. package/dist/web/assets/Impact-7TXQHcsW.js +3 -0
  31. package/dist/web/assets/Jobs-xRLNI-8l.js +5 -0
  32. package/dist/web/assets/KindPage-BZu1Zo4S.js +6 -0
  33. package/dist/web/assets/Migration-DKsyDwDO.js +8 -0
  34. package/dist/web/assets/Observability-CVwKJ-fI.js +1 -0
  35. package/dist/web/assets/PageAgent-C1X5ot6v.js +1 -0
  36. package/dist/web/assets/Product-iHqLyIhD.js +12 -0
  37. package/dist/web/assets/Production-C8eGcwCi.js +1 -0
  38. package/dist/web/assets/Quality-BVsN6u0E.js +1 -0
  39. package/dist/web/assets/Readiness-BWlbiTeu.js +1 -0
  40. package/dist/web/assets/Record-C7qgNFqs.js +1 -0
  41. package/dist/web/assets/Regression-ChleHlqe.js +5 -0
  42. package/dist/web/assets/RelationGraph-CzR_Hs8A.js +1 -0
  43. package/dist/web/assets/Reports-CIcKyoHH.js +2 -0
  44. package/dist/web/assets/Response-D2ZeO8uW.js +9 -0
  45. package/dist/web/assets/Responsive-DCfw-Oz3.js +3 -0
  46. package/dist/web/assets/RunDiff-COaxhvKm.js +1 -0
  47. package/dist/web/assets/Runs-3qx2qf56.js +2 -0
  48. package/dist/web/assets/Settings-DG2k3Lno.js +21 -0
  49. package/dist/web/assets/Steps-CN4n8U1I.js +3 -0
  50. package/dist/web/assets/TestCases-BEfJFp5h.js +1 -0
  51. package/dist/web/assets/TestData-SO2qqaAF.js +2 -0
  52. package/dist/web/assets/TestDebt-DIYhbhjh.js +1 -0
  53. package/dist/web/assets/TestManagement-D7q6G3YN.js +4 -0
  54. package/dist/web/assets/WhatsNew-DqBLhhgk.js +1 -0
  55. package/dist/web/assets/{agents-C0Jg2pN8.js → agents-BUWN-VJv.js} +1 -1
  56. package/dist/web/assets/{coverage-BB9BLjGz.js → coverage-DCtiu73T.js} +4 -4
  57. package/dist/web/assets/dataParts-BdmBLsU9.js +3 -0
  58. package/dist/web/assets/{diff-cbn6NGtL.js → diff-DEgLgw6R.js} +1 -1
  59. package/dist/web/assets/families-CrnKBjis.js +1 -0
  60. package/dist/web/assets/{highlight--Ayfy7Gy.js → highlight-DSLpJ_Dq.js} +1 -1
  61. package/dist/web/assets/index-DAteDsgB.css +2 -0
  62. package/dist/web/assets/index-RJ1kEHuo.js +64 -0
  63. package/dist/web/assets/input-Be3YOEK2.js +1 -0
  64. package/dist/web/assets/logLevel-Dq8s6DZz.js +3 -0
  65. package/dist/web/assets/palette-Dcoz5crU.js +1 -0
  66. package/dist/web/assets/{paletteCommands-ar4wAGok.js → paletteCommands-fwv5XVOS.js} +1 -1
  67. package/dist/web/assets/parts-CkI14hIv.js +1 -0
  68. package/dist/web/assets/productParts-BOUMBM_H.js +1 -0
  69. package/dist/web/assets/qualityParts-8KI3JCY8.js +1 -0
  70. package/dist/web/assets/recordTest-kf2ykEQF.js +1 -0
  71. package/dist/web/assets/route-D8G-pTdk.js +1 -0
  72. package/dist/web/assets/stepper-CQSK6KS0.js +1 -0
  73. package/dist/web/index.html +7 -7
  74. package/docs/OBSERVABILITY.md +233 -0
  75. package/docs/user-guide.html +59 -6
  76. package/forgeqe.example.yaml +5 -1
  77. package/llms.example.json +1 -1
  78. package/package.json +2 -1
  79. package/prompts/browser-persona.md +1 -1
  80. package/py/forgeqe_desktop/handhooks.py +106 -4
  81. package/py/forgeqe_desktop/handrecord.py +77 -2
  82. package/py/forgeqe_desktop/service.py +22 -5
  83. package/py/forgeqe_desktop/workflow.py +47 -2
  84. package/py/forgeqe_engine/copilot_gateway.py +139 -5
  85. package/py/forgeqe_engine/copilot_models.py +186 -0
  86. package/py/forgeqe_engine/diagnostics.py +119 -2
  87. package/py/forgeqe_engine/llm.py +85 -1
  88. package/py/forgeqe_engine/persona.py +3 -2
  89. package/py/forgeqe_engine/service.py +36 -10
  90. package/py/forgeqe_mobile/record.py +95 -5
  91. package/dist/web/assets/Agent-DrdDwck4.js +0 -8
  92. package/dist/web/assets/AgentWork-wNaA-i2T.js +0 -2
  93. package/dist/web/assets/ApiTests-B3X6NIn8.js +0 -10
  94. package/dist/web/assets/Browse-Cd1DEgYR.js +0 -1
  95. package/dist/web/assets/Chat-4GknHS5Z.js +0 -3
  96. package/dist/web/assets/Compare-DJVhkzqO.js +0 -1
  97. package/dist/web/assets/Cost-CbKnuQuB.js +0 -1
  98. package/dist/web/assets/Data-Bt5yqqvq.js +0 -6
  99. package/dist/web/assets/Desktop-CPDo3Ir-.js +0 -1
  100. package/dist/web/assets/DesktopReview-CCaqTSu5.js +0 -1
  101. package/dist/web/assets/Evidence-BAuIgj1h.js +0 -1
  102. package/dist/web/assets/Explore-BqzEPdP7.js +0 -2
  103. package/dist/web/assets/Features-DFuPCW9x.js +0 -1
  104. package/dist/web/assets/Flags-UBakvqIq.js +0 -2
  105. package/dist/web/assets/Flaky-DUzdfQW4.js +0 -1
  106. package/dist/web/assets/Impact-jLZqUzz9.js +0 -3
  107. package/dist/web/assets/Jobs-De3NyY5s.js +0 -5
  108. package/dist/web/assets/KindPage-DWznWcLB.js +0 -6
  109. package/dist/web/assets/Migration-BdOq6RO6.js +0 -2
  110. package/dist/web/assets/PageAgent-dVvZtNoB.js +0 -1
  111. package/dist/web/assets/Product-ByZ8Qr3i.js +0 -12
  112. package/dist/web/assets/Production-D8L2TchK.js +0 -1
  113. package/dist/web/assets/Quality-CSZEuhZo.js +0 -1
  114. package/dist/web/assets/Readiness-bBu_84mx.js +0 -1
  115. package/dist/web/assets/Record-DWJEDj2C.js +0 -1
  116. package/dist/web/assets/Regression-D2VkPIhZ.js +0 -5
  117. package/dist/web/assets/RelationGraph-q5H4bYjq.js +0 -1
  118. package/dist/web/assets/Reports-dF-O5HTI.js +0 -2
  119. package/dist/web/assets/Response-D4JW3pwi.js +0 -9
  120. package/dist/web/assets/Responsive-CLX9S27s.js +0 -3
  121. package/dist/web/assets/RunDiff-BuL_-GwF.js +0 -1
  122. package/dist/web/assets/Runs-DyyaAiyA.js +0 -2
  123. package/dist/web/assets/Settings-DnG6_QQj.js +0 -21
  124. package/dist/web/assets/Steps-C-0zwG7T.js +0 -2
  125. package/dist/web/assets/TestCases-DXk9qsEL.js +0 -1
  126. package/dist/web/assets/TestData-D4al7-3Z.js +0 -2
  127. package/dist/web/assets/TestDebt-BzOVDuS8.js +0 -1
  128. package/dist/web/assets/TestManagement-T-NIlhc9.js +0 -1
  129. package/dist/web/assets/Tosca-D7tqMGK0.js +0 -3
  130. package/dist/web/assets/WhatsNew-DBViE2Qt.js +0 -1
  131. package/dist/web/assets/dataParts-D56_9p6T.js +0 -3
  132. package/dist/web/assets/families-gkpkloLT.js +0 -1
  133. package/dist/web/assets/filters-Culzq1j1.js +0 -1
  134. package/dist/web/assets/fold-UP5ihvz-.js +0 -1
  135. package/dist/web/assets/head-BpR3dGRT.js +0 -1
  136. package/dist/web/assets/index-CljX5dI4.js +0 -64
  137. package/dist/web/assets/index-CwAqcn-z.css +0 -2
  138. package/dist/web/assets/input-D7iHeNXz.js +0 -1
  139. package/dist/web/assets/logos-B4e5nBuL.js +0 -1
  140. package/dist/web/assets/palette-lUno7fso.js +0 -1
  141. package/dist/web/assets/parts-DbdUgAZS.js +0 -1
  142. package/dist/web/assets/productParts-DSrnTFn8.js +0 -1
  143. package/dist/web/assets/qualityParts-D_U5zhKC.js +0 -1
  144. package/dist/web/assets/recordTest-D9zuJ-aG.js +0 -1
  145. package/dist/web/assets/route-Dg53WdFu.js +0 -1
@@ -1,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$n as t,$t as n,A as r,At as i,Bn as a,Cn as o,F as s,Fn as c,H as l,Hr as u,I as d,Ir as f,Jn as p,Lr as m,Lt as h,Mr as g,O as _,Pt as v,Rn as y,Rr as b,St as x,Un as S,Yt as C,Zn as w,ar as T,cn as E,ft as ee,ht as D,l as O,lt as k,n as te,on as ne,ot as A,r as j,sr as M,u as re,wr as N,xr as ie,y as P}from"./route-Dg53WdFu.js";import{t as F}from"./jsx-runtime-LKYXHABd.js";import{A as I,Rt as L,W as ae,a as oe,n as R,r as z,t as B,zt as V}from"./input-D7iHeNXz.js";import{a as H,c as se,d as U,i as W,l as ce,n as le,r as G,t as ue}from"./filters-Culzq1j1.js";import{a as de}from"./palette-lUno7fso.js";import{Bn as fe,E as pe,Ft as K,Hn as me,It as he,Kn as ge,Kt as _e,Lt as q,Pt as ve,Rt as ye,Tn as be,Un as xe,Vn as Se,Wt as Ce,Xn as we,_t as Te,g as Ee,u as J,wn as De,yt as Oe,zn as ke,zt as Ae}from"./index-CljX5dI4.js";import{t as je}from"./fold-UP5ihvz-.js";import{t as Me}from"./head-BpR3dGRT.js";import{f as Ne,u as Pe}from"./parts-DbdUgAZS.js";import{S as Fe,_ as Ie,b as Y,d as Le,f as Re,g as ze,h as Be,l as Ve,m as He,p as Ue,r as We,s as Ge,t as Ke,u as qe,v as Je,x as Ye,y as Xe}from"./logos-B4e5nBuL.js";import{t as Ze}from"./Steps-C-0zwG7T.js";var X=e(u(),1),Z=F(),Qe=500,$e=10;function et({plan:e,acceptLimits:t,next:n,again:r,onClose:i,onStarted:a}){let o=e.units.filter(e=>e.kind===`test`).length,[s,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!!n),[f,p]=(0,X.useState)(String(n?.size||$e)),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(``),v=Number(f),y=Number.isInteger(v)&&v>=1&&v<=Qe,x=async()=>{h(!0),_(``);try{a((await L.start(e.id,s,t,u?v:void 0)).detail)}catch(e){_(e.message),h(!1)}};return(0,Z.jsx)(ge,{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)(U,{variant:`ghost`,onClick:i,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(U,{variant:`primary`,disabled:m||s!==e.id||u&&!y,onClick:()=>void x(),"data-tip":n?`Continue with the next batch`:r?`Start the conversion again`:`Start the conversion`,children:[r?(0,Z.jsx)(S,{"aria-hidden":`true`}):(0,Z.jsx)(c,{"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:u,onCheckedChange:d}),(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.`})]})]}),u&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{children:`Test cases per batch`}),(0,Z.jsx)(B,{type:`number`,min:1,max:Qe,step:1,inputMode:`numeric`,value:f,"aria-invalid":!y,"aria-describedby":y?void 0:`batch-size-error`,onChange:e=>p(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 `,Qe,`.`]})]}),(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)(B,{value:s,onChange:e=>l(e.target.value),autoComplete:`off`,spellCheck:!1})]}),(0,Z.jsx)(qe,{error:g})]})})}function tt(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?Le[t.status]:e.job?.last?{label:`Did not start`,tone:`fail`}:e.confirmed?{label:`Confirmed`,tone:`neutral`}:Ie[e.plan.feasibility.verdict]}var Q=e=>e.slice(e.lastIndexOf(`/`)+1);function nt({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 L.reimport(e.plan.id,n&&r);location.hash=j(`tosca`,t.plan.id)}catch(e){c(e.message),o(!1)}};return(0,Z.jsx)(ge,{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)(U,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,Z.jsx)(U,{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 rt=[{id:`ci-github`,label:`GitHub Actions`},{id:`ci-azure`,label:`Azure Pipelines`}];function it({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(``),L.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 L.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)(ge,{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)(U,{variant:`ghost`,onClick:t,children:`Close`}),(0,Z.jsxs)(U,{disabled:!i,onClick:h,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),`Download`]}),!f&&(0,Z.jsx)(U,{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:rt}),(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)(pe,{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 at({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=``)=>L.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 L.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,b=y?.state===`running`,x=y?.state===`done`?y.result:void 0,S=m||(y?.state===`failed`?y.error:``)||(n&&!n.preview?n.problem:``)||``,C=e=>/^https:\/\//.test(e)?e:void 0,w=(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)(k,{size:11,"aria-hidden":`true`})]});return(0,Z.jsx)(ge,{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)(U,{variant:`ghost`,onClick:t,children:x?`Close`:`Cancel`}),!x&&(0,Z.jsx)(U,{variant:`primary`,disabled:!v||!n?.preview||f||b||!o.trim(),onClick:()=>void _(),children:f?`Starting…`:b?`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…`}),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}),x&&(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:[x.existing?`Nothing new to push: this is the pull request.`:`Pushed ${Y(x.files,`file`)} on ${x.branch}.`,` `,C(x.url)?w(C(x.url),`Open the pull request`):`It is open on ${x.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&&C(v.last.url)&&!x&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Opened before: `,w(C(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)(B,{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:b,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)(B,{value:c,maxLength:200,onChange:e=>l(e.target.value),disabled:b})]}),(0,Z.jsxs)(`label`,{className:I(`flex items-start gap-2`,b?`cursor-default`:`cursor-pointer`),children:[(0,Z.jsx)(J,{className:`mt-1`,checked:u,onCheckedChange:d,disabled:b}),(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)(je,{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)(je,{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 ot({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 L.delete(e,i),location.hash=j(`migration`,`migrations`)}catch(e){l(e.message),s(!1)}};return(0,Z.jsx)(ge,{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)(U,{variant:`ghost`,onClick:r,"data-tip":`Keep it`,children:[(0,Z.jsx)(_,{"aria-hidden":`true`}),`Keep`]}),(0,Z.jsxs)(U,{variant:`danger`,disabled:o||i!==e,onClick:()=>void u(),children:[(0,Z.jsx)(ie,{"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)(B,{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 st({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)(ge,{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)(U,{variant:`ghost`,onClick:n,children:[(0,Z.jsx)(b,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(U,{variant:`primary`,onClick:()=>r(i.trim()),"data-tip":`Send to the agent`,children:[(0,Z.jsx)(w,{"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)(z,{value:i,rows:4,maxLength:2e3,placeholder:`The cart badge is a span now, not a button.`,onChange:e=>a(e.target.value)})]})]})})}function ct({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)(ge,{open:!0,onClose:n,wide:!0,title:`Output of ${i?Q(i.target):t}`,description:r?.checkedAt?`Run again ${Ne(r.checkedAt)}`:`From the conversion's own run`,footer:(0,Z.jsxs)(U,{onClick:n,children:[(0,Z.jsx)(b,{"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 lt(e){let t=Object.fromEntries(Ue.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 ut({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 dt({d:e,planView:t,busy:n,onFix:r,onSteps:i,onOutput:a,onRun:o,onNext:s}){let l=e.result||(e.job?.running?lt(e):null);if(!l)return(0,Z.jsx)(Z.Fragment,{children:t});let u=new Map(l.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),h=new Set(d.map(e=>e.id)),g=new Set(f.map(e=>e.id)),_=l.units.filter(e=>h.has(e.id)&&e.status===`converted`).length,v=l.units.filter(e=>g.has(e.id)&&e.status===`written`).length,y=l.units.reduce((e,t)=>t.fidelity?{m:e.m+t.fidelity.matched,n:e.n+t.fidelity.required}:e,{m:0,n:0}),b=l.units.filter(e=>e.status===`failed`||e.status===`blocked`).length,x=e=>l.units.filter(t=>(h.has(t.id)||g.has(t.id))&&t.status===e).length,S=d.length+f.length,C=[{label:`Failed`,n:x(`failed`),bar:`bg-fail`},{label:`Needs a look`,n:x(`blocked`),bar:`bg-warn`},{label:`Passing`,n:_,bar:`bg-pass`},{label:f.length===1?`Workflow written`:`Workflows written`,n:v,bar:`bg-line-strong`},{label:f.length?`Not done yet`:`Not run yet`,n:Math.max(0,S-l.units.filter(e=>h.has(e.id)||g.has(e.id)).length),bar:`bg-line`}],[w,...T]=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?`${_} of ${d.length} passing`:`${v} of ${Y(f.length,`workflow`)} written`}),C.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:I(`size-2 rounded-full`,e.bar),"aria-hidden":`true`}),e.label,` `,(0,Z.jsx)(`span`,{className:I(`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:C.map(e=>e.n?(0,Z.jsx)(`span`,{className:e.bar,style:{width:`${e.n/Math.max(1,S)*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)(ut,{label:l.status===`running`?`Running for`:`Took`,children:Pe(l.status===`running`?Date.now()-Date.parse(l.startedAt):l.ms)}),(0,Z.jsx)(ut,{label:`Tosca steps in the tests`,children:(0,Z.jsx)(`span`,{className:y.n&&y.m===y.n?`text-pass`:void 0,children:y.n?`${y.m} of ${y.n}`:`–`})}),(0,Z.jsx)(ut,{label:`Need attention`,children:(0,Z.jsx)(`span`,{className:b?`text-fail`:void 0,children:b})}),(0,Z.jsx)(ut,{label:`Pages`,children:Y(e.plan.units.filter(e=>e.kind===`page`).length,`page object`)})]})]}),l.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:l.notes}),l.batch&&l.batch.left>0&&l.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 `,l.batch.runs,` is done. Check its tests, then continue: `,Y(l.batch.left,`test case`),` not tried yet.`]}),(0,Z.jsxs)(U,{size:`sm`,disabled:n,onClick:s,children:[(0,Z.jsx)(c,{"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)(ve,{label:`Files`,placeholder:`Find a file`,empty:`No files.`,height:`min(58vh, 580px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`File`}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`Status`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(q,`hidden @2xl:table-cell`),children:`Tosca steps`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(q,`hidden @3xl:table-cell`),children:`Note`}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:e.plan.units.map(t=>{let o=u.get(t.id),s=o?ze[o.status]:null,c=t.case?e.plan.cases.find(e=>e.id===t.case):void 0;return(0,Z.jsxs)(`tr`,{className:Ae,children:[(0,Z.jsxs)(`td`,{className:K,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?`${Ye(t)} · ${c.name}`:c.name:`${Ye(t)} · ${t.target}`,c?.suites?.length?` · ${c.suites.join(`, `)}`:``]})]}),(0,Z.jsxs)(`td`,{className:I(K,`whitespace-nowrap`),children:[s?(0,Z.jsx)(H,{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 `,Ee(o.checkedAt)]})]}),(0,Z.jsx)(`td`,{className:I(K,`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:I(K,`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:I(K,`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)(U,{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)(p,{"aria-hidden":`true`})}),t.case&&(0,Z.jsx)(U,{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)(E,{"aria-hidden":`true`})}),o&&(o.status===`failed`||o.status===`blocked`)&&t.kind!==`setup`&&!t.engine&&(0,Z.jsx)(U,{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)(m,{"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)(Ge,{framework:w,language:T.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=l.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:I(`text-[13px]`,r===e.cases.length?`text-pass`:`text-muted`),children:[r,` of `,Y(e.cases.length,`test`),` pass · @`,e.tag]})]}),(0,Z.jsx)(U,{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)(c,{"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:Ne(l.startedAt)}),l.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":l.model,children:l.model})]}),l.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:[l.reverted.length,` edits outside the target`]})]})]})]})]})]})}var ft={fail:{icon:l,cls:`text-fail`,label:`Failed`},ok:{icon:d,cls:`text-pass`,label:`Done`},info:{icon:C,cls:`text-muted`,label:`Info`},agent:{icon:P,cls:`text-accent-fg`,label:`Agent`},tool:{icon:m,cls:`text-muted`,label:`Tool`}};function pt(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} · ${Ye(a)} · ${a.target}`,status:t.result?.units.find(e=>e.id===a.id)?.status,events:[]}:{key:e,title:He[r.stage]||r.stage,sub:`Stage`,events:[]},n.set(e,i)}i.events.push(r)}return[...n.values()]}var mt=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});function ht({d:e,events:t,running:n}){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=pt(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)(()=>{n&&!h&&a.current&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[t.length,n,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)(W,{id:`tosca-activity-search`,label:`Find a line`,value:o,onChange:s,placeholder:`Find a line, test case or file`}),(0,Z.jsx)(ue,{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":n?`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||n&&e.key===v),a=`act-${e.key.replace(/[^A-Za-z0-9_-]/g,`-`)}`,o=e.status?ze[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)(r,{size:15,"aria-hidden":`true`,className:I(`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)(H,{tone:o.tone,children:o.label})]}),(0,Z.jsx)(ke,{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=ft[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:mt(e.ts)}),(0,Z.jsx)(n.icon,{size:16,role:`img`,"aria-label":n.label,className:I(`mt-1 flex-none`,n.cls)}),(0,Z.jsx)(`span`,{className:I(`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 gt({id:e,plan:t}){let[n,i]=(0,X.useState)(null),[s,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(`overview`),[p,m]=(0,X.useState)(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)([]),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),[D,k]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[A,N]=(0,X.useState)(!1),[P,F]=(0,X.useState)(!1),[I,ae]=(0,X.useState)(!1),[oe,R]=(0,X.useState)(!1),z=(0,X.useRef)(0),B=(0,X.useCallback)(()=>{L.detail(e).then(e=>{i(e),l(``)},e=>l(e.message));let t=z.current;L.events(e,t).then(e=>{if(e.next<z.current){z.current=0,x([]);return}let t=z.current;if(e.next<=t)return;let n=e.events.slice(Math.max(0,e.events.length-(e.next-t)));z.current=e.next,n.length&&x(e=>[...e,...n].slice(-2e3))},()=>{})},[e]);(0,X.useEffect)(B,[B]);let V=!!(n?.job?.running||n?.result?.status===`running`);(0,X.useEffect)(()=>{if(!V)return;let e=Se(B,1500);return()=>fe(e)},[V,B]);let se=(0,X.useCallback)(e=>{i(e),l(``),d(`overview`),setTimeout(B,800)},[B]),W=async e=>{w(!0),l(``);try{i(await e()),setTimeout(B,800)}catch(e){l(e.message)}finally{w(!1)}};if(!n)return 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}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`});let ce=tt(n),le=Fe(n.plan,n.result),G=n.result,ue=(G?.units||[]).filter(e=>e.kind===`test`&&(e.status===`failed`||e.status===`blocked`)).length,de=n.plan.cases.filter(e=>e.included).length,pe=[{id:`overview`,label:`Overview`},{id:`steps`,label:`Steps`,n:de?String(de):void 0,tone:ue?`text-fail`:void 0},{id:`activity`,label:`Activity`}];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:j(`migration`,`migrations`),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(O,{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(n.plan.source.file)}),(0,Z.jsx)(re,{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)(Ge,{framework:n.plan.target.id.split(`-`)[0],language:n.plan.target.id.split(`-`).slice(1).join(`-`),size:20}),n.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`,n.plan.source.project?` · ${n.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:n.plan.target.dir})]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{tone:ce.tone,children:ce.label}),V?(0,Z.jsxs)(U,{variant:`danger`,disabled:C,onClick:()=>void W(()=>L.stop(e)),children:[(0,Z.jsx)(M,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]}):(0,Z.jsxs)(Z.Fragment,{children:[G&&(G.status===`stopped`||G.status===`failed`)&&(0,Z.jsxs)(U,{disabled:C,onClick:()=>R(!0),"data-tip":`Start this conversion again. Tests it already wrote are kept.`,children:[(0,Z.jsx)(S,{"aria-hidden":`true`}),`Start again`]}),G&&(0,Z.jsxs)(U,{variant:`ghost`,onClick:()=>location.hash=j(`tosca`,e,`report`),children:[(0,Z.jsx)(ee,{"aria-hidden":`true`}),`Report`]}),G&&n.plan.units.some(e=>e.kind===`test`&&!e.engine)&&(0,Z.jsxs)(U,{disabled:C,onClick:()=>void W(()=>L.verify(e)),"data-tip":`Run every converted test again, no agent`,children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Run`]}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsxs)(U,{variant:`ghost`,disabled:C,"aria-haspopup":`menu`,"aria-expanded":P,onClick:()=>F(!P),children:[(0,Z.jsx)(o,{"aria-hidden":`true`}),`More`,(0,Z.jsx)(r,{"aria-hidden":`true`})]}),(0,Z.jsxs)(De,{open:P,onClose:()=>F(!1),label:`More for this conversion`,align:`end`,className:`w-[240px]`,children:[G&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(be,{onClick:()=>(F(!1),k(!0)),children:[(0,Z.jsx)(a,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`Re-import`]}),(0,Z.jsxs)(be,{onClick:()=>(F(!1),N(!0)),children:[(0,Z.jsx)(f,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-muted`}),`CI`]}),(0,Z.jsxs)(be,{onClick:()=>(F(!1),ne(!0)),children:[(0,Z.jsx)(h,{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)(be,{onClick:()=>(F(!1),E(!0)),children:[(0,Z.jsx)(ie,{size:16,"aria-hidden":`true`,className:`mr-2 flex-none text-fail`}),(0,Z.jsx)(`span`,{className:`text-fail`,children:`Delete`})]})]})]})]})]})]}),D&&(0,Z.jsx)(nt,{d:n,onClose:()=>k(!1)}),te&&(0,Z.jsx)(at,{id:e,onClose:()=>ne(!1)}),A&&(0,Z.jsx)(it,{id:e,onClose:()=>N(!1)}),oe&&(0,Z.jsx)(et,{plan:n.plan,acceptLimits:!1,again:!0,onClose:()=>R(!1),onStarted:e=>{R(!1),i(e)}}),I&&n.result?.batch&&(0,Z.jsx)(et,{plan:n.plan,acceptLimits:!1,next:n.result.batch,onClose:()=>ae(!1),onStarted:e=>{ae(!1),i(e)}}),T&&(0,Z.jsx)(ot,{id:e,title:`${Q(n.plan.source.file)} → ${n.plan.target.title}`,targetDir:n.plan.target.dir,onClose:()=>E(!1)}),G&&(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)(Be,{states:G.stages})}),V&&(0,Z.jsxs)(`span`,{className:`flex-none text-[13px] font-semibold tabular-nums text-accent-fg`,"aria-label":`${Math.round(le)}% done`,children:[Math.round(le),`%`]})]}),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}),(0,Z.jsx)(Ce,{prefix:`mtab`,className:`mb-0`,tabs:pe,current:u,onPick:d,label:`Tosca conversion`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`mtab-panel-${u}`,"aria-labelledby":`mtab-${u}`,className:`pane-swap flex min-w-0 flex-col gap-4`,children:[u===`overview`&&(0,Z.jsx)(dt,{d:n,planView:t(n,se),busy:C||V,onFix:_,onSteps:e=>(m(e),d(`steps`)),onOutput:y,onRun:t=>void W(()=>L.verify(e,t)),onNext:()=>ae(!0)}),u===`steps`&&(0,Z.jsx)(Ze,{id:e,plan:n.plan,result:G,initial:p}),u===`activity`&&(0,Z.jsx)(ht,{d:n,events:b,running:V})]},u),v&&(0,Z.jsx)(ct,{d:n,unit:v,onClose:()=>y(null)}),g&&(0,Z.jsx)(st,{d:n,unit:g,onClose:()=>_(null),onSend:t=>{_(null),W(()=>L.fix(e,[g],t))}})]})}var _t=e=>e.slice(e.lastIndexOf(`/`)+1),vt=50,yt=[{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 bt(e){return e===`converted`?ze.converted:e===`failed`?ze.failed:e===`blocked`?ze.blocked:e===`left out`?{label:`Left out`,tone:`neutral`}:e===`written`?ze.written:e===`not run`||e===`skipped`?{label:`Not run`,tone:`neutral`}:{label:e,tone:`neutral`}}function xt(e){for(let t of Ue){let n=e[t];if(n?.status===`failed`)return{id:t,...n.note?{note:n.note}:{}}}return null}function St({planId:e,unit:t,file:n}){let r=/\.(webm|mp4)$/i.test(n),[i,a]=(0,X.useState)(!r),[o,s]=(0,X.useState)(``),[l,u]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{if(!i)return;let r=!1;return s(``),u(!1),L.evidence(e,t,n).then(e=>!r&&s(e),()=>!r&&u(!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)(U,{variant:`ghost`,onClick:()=>a(!0),className:`h-[120px] w-full rounded-[10px] border border-line-soft bg-surface-muted`,children:[(0,Z.jsx)(c,{"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:l?`Not available`:`Loading…`}),(0,Z.jsx)(`span`,{className:`font-mono text-[13px] text-muted`,children:n})]})}function Ct({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(``),L.reportCase(e,t.case).then(e=>!n&&i(e),e=>!n&&o(e.message)),()=>{n=!0}},[e,t.case]);let s=bt(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?wt[t.change]:``]})]}),(0,Z.jsx)(H,{tone:s.tone,children:s.label}),t.ms>0&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted tabular-nums`,children:Pe(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:I(`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)(St,{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)(je,{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)(ve,{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`,{scope:`col`,className:I(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-14`),children:`Step`}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`What it does`}),(0,Z.jsx)(`th`,{scope:`col`,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=Ve[e.status]||Ve.matched;return(0,Z.jsxs)(`tr`,{className:`border-t border-line-soft align-top`,children:[(0,Z.jsx)(`td`,{className:I(`px-4 py-2`,`font-mono text-[13px] text-muted`),children:e.id}),(0,Z.jsxs)(`td`,{className:I(`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:I(`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:I(`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)(je,{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 wt={same:`Unchanged in Tosca: its earlier test kept`,changed:`Changed in Tosca: converted again`,new:`New in Tosca`},Tt=e=>`"${(/^[=+\-@\t\r]/.test(e)?`'${e}`:e).replace(/"/g,`""`)}"`;function Et(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(` / `),bt(t.status).label,t.file?`${e.target.dir}/${t.file}`:``,t.fidelity?`${t.fidelity.matched}/${t.fidelity.required}`:``,t.change?wt[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(Tt).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 Dt({g:e,rows:t,open:n,onToggle:i,pick:a,onPick:o}){let s=()=>Math.max(0,Math.floor(t.findIndex(e=>e.case===a)/vt)),[c,l]=(0,X.useState)(s),u=(0,X.useId)();(0,X.useEffect)(()=>l(s()),[t.length]);let d=t.slice(c*vt,c*vt+vt);return(0,Z.jsxs)(`div`,{className:`border-b border-line-soft last:border-b-0`,children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":n,"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)(r,{size:15,"aria-hidden":`true`,className:I(`flex-none text-muted transition-transform`,n&&`rotate-180`)}),(0,Z.jsx)(`span`,{className:I(`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)(ke,{open:n,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:I(`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:Pe(e.ms)})]}),e.note&&(0,Z.jsx)(`span`,{className:I(`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>vt&&(0,Z.jsx)(le,{page:c,size:vt,total:t.length,onPage:l,label:`${e.label} pages`})]})]})}function Ot({label:e,children:t,wide:n}){return(0,Z.jsxs)(`div`,{className:I(`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 kt({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,y]=(0,X.useState)(``);(0,X.useEffect)(()=>{s(!0),L.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,``,j(`tosca`,e,`report`,encodeURIComponent(f)))},[e,f]);let b=u.trim().toLowerCase(),x=(0,X.useMemo)(()=>{let e={failed:[],attention:[],passed:[],notrun:[],leftout:[]};for(let t of n?.tests||[])c!==`all`&&t.group!==c||b&&!`${t.name} ${t.file} ${t.case} ${t.note||``} ${t.suites.join(` `)} ${t.folders.join(` `)}`.toLowerCase().includes(b)||e[t.group].push(t);return e},[n,c,b]),S=async t=>{_(t),y(``);try{let n=await(t===`zip`?L.reportZip(e):L.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){y(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:j(`tosca`,e),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(O,{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 C=Le[n.status]||{label:n.status,tone:`neutral`},[w,...T]=n.target.id.split(`-`),E=xt(n.stages),ee=n.tests.length-n.counts.leftout,D=n.tests.find(e=>e.case===f)||null,k=yt.reduce((e,t)=>e+x[t.id].length,0),te=Math.max(1,n.tests.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`a`,{href:j(`tosca`,e),className:`inline-flex items-center gap-2 self-start text-sm`,children:[(0,Z.jsx)(O,{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:_t(n.source.file)}),(0,Z.jsx)(re,{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)(Ge,{framework:w,language:T.join(`-`),size:20}),n.target.title]})]})]}),(0,Z.jsx)(H,{tone:C.tone,children:C.label}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(U,{size:`sm`,onClick:()=>void S(`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)(A,{"aria-hidden":`true`}),g===`html`?`Making the HTML report…`:`HTML report`]}),(0,Z.jsxs)(U,{size:`sm`,variant:`ghost`,onClick:()=>Et(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)(A,{"aria-hidden":`true`}),`Traceability CSV`]}),(0,Z.jsxs)(U,{size:`sm`,onClick:()=>void S(`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)(A,{"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`]}),yt.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:I(`size-2 rounded-full`,e.bar),"aria-hidden":`true`}),e.label,` `,(0,Z.jsx)(`span`,{className:I(`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:yt.map(e=>n.counts[e.id]?(0,Z.jsx)(`span`,{className:e.bar,style:{width:`${n.counts[e.id]/te*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)(Ot,{label:`Time`,children:[Pe(n.ms),` · started `,Ne(n.startedAt)]}),(0,Z.jsxs)(Ot,{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)(Ot,{label:`Media`,children:n.media?Y(n.media,`file`):n.target.video?`Videos and failure screenshots`:`Failure screenshots`}),(0,Z.jsxs)(Ot,{label:`LLM`,children:[n.model||`–`,n.usage.input||n.usage.output?(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,Oe(n.usage.input+n.usage.output),` tokens`,n.cost?` · ${n.cost.estimate?`≈`:``}${Te(n.cost.amount,n.cost.currency)}`:``]}):null]}),(0,Z.jsxs)(Ot,{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)(Ot,{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:j(`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?`; …`:``,`.`]})]}),E&&(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 `,He[E.id],E.note?`: ${E.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)(W,{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)(ue,{items:[{id:`all`,label:`All`,n:n.tests.length},...yt.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:[yt.filter(e=>x[e.id].length).map(e=>(0,Z.jsx)(Dt,{g:e,rows:x[e.id],open:m[e.id]??(e.open||c===e.id||!!b||x[e.id].some(e=>e.case===f)),onToggle:()=>h(t=>({...t,[e.id]:!(t[e.id]??(e.open||c===e.id||!!b||x[e.id].some(e=>e.case===f)))})),pick:f,onPick:e=>p(e.case)},e.id)),!k&&(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:D?(0,Z.jsx)(`div`,{className:`pane-swap`,children:(0,Z.jsx)(Ct,{planId:n.id,pick:D,video:n.target.video})},D.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 At={converted:{icon:d,cls:`text-pass`,label:`Converted`},partly:{icon:s,cls:`text-warn`,label:`Converted, with steps for a person`},not:{icon:l,cls:`text-muted`,label:`Not converted`}},jt=e=>`"${(/^[=+\-@\t\r]/.test(e)?`'${e}`:e).replace(/"/g,`""`)}"`;function Mt(e,t,n){let r=[[`Test case id`,`Test case`,`Kind`,`What happens`,`Modules behind it`].map(jt).join(`,`)];for(let n of e.rows)for(let e of n.cases)r.push([e,t.get(e)||e,n.label,At[n.outcome].label,n.modules.map(e=>e.name).join(`; `)].map(jt).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 Nt({coverage:e,names:t,file:n,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)(U,{size:`sm`,variant:`ghost`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(!o),children:[(0,Z.jsx)(r,{"aria-hidden":`true`,className:I(`transition-transform`,o&&`rotate-180`)}),o?`Hide the breakdown`:`Show the breakdown`]}),(0,Z.jsxs)(U,{size:`sm`,variant:`ghost`,onClick:()=>Mt(e,t,n),"data-tip":`Every test case with its kind and what happens to it, for a spreadsheet.`,children:[(0,Z.jsx)(A,{"aria-hidden":`true`}),`CSV`]})]}),(0,Z.jsx)(ke,{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=At[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:I(`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 Pt={ok:{icon:d,cls:`text-pass`,label:`Ready`},answer:{icon:s,cls:`text-warn`,label:`Needs an answer`},blocker:{icon:l,cls:`text-fail`,label:`Blocks the start`}};function Ft({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)(()=>{L.data(e).then(e=>{c(e),g(``)},e=>g(e.message))},[e,t]);let _=async t=>{m(!0),g(``);try{c(await L.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)(R,{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)(B,{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)(U,{size:`sm`,type:`submit`,disabled:v||!l,children:`Use it`}),a&&(0,Z.jsx)(U,{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 It({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)(R,{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)(B,{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)(U,{size:`sm`,type:`submit`,disabled:t||!r.trim(),children:`Use it`})]})]})}function Lt({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)(R,{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:j(`settings`,e.engine===`database`?`databases`:`environments`),children:e.engine===`database`?`Settings, Databases`:`Settings, Environments`}),`.`]})}function Rt({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 ae.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)(B,{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)(U,{size:`sm`,type:`submit`,disabled:t||u||!o,children:`Save`}),e.accept&&(0,Z.jsx)(U,{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)(R,{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)(U,{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 zt({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)(()=>{L.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 L.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:I(`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)(U,{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=Pt[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:I(`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:I(`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)(It,{r,busy:o,onAnswer:e=>void f(e)}),t.kind===`app`&&t.engine&&(0,Z.jsx)(Lt,{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)(Rt,{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)(Ft,{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 Bt=/^[a-f0-9]{16}$/,Vt=`forgeqe.tosca.assistant`;function Ht(){try{let e=localStorage.getItem(Vt)||``;return Bt.test(e)?e:``}catch{return``}}function Ut(e){try{e?localStorage.setItem(Vt,e):localStorage.removeItem(Vt)}catch{}}var Wt=[/\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],Gt=e=>e.replace(/^.*\//,``).replace(/\.tsu$/i,``);function Kt(e){let t=e.exports[0]?.path||e.clones[0]?.exports[0]?.path,r=e.exports.length+e.clones.reduce((e,t)=>e+t.exports.length,0),i=[];return r>1&&i.push({icon:n,title:`All ${r} exports to Playwright`,hint:`Every export in one plan, in TypeScript`,text:`Migrate all the exports to Playwright in TypeScript`}),t&&i.push({icon:D,title:`${Gt(t)} to Selenium`,hint:`One export, in Java, with page objects`,text:`Migrate ${Gt(t)} to Selenium in Java, with page objects`}),t&&i.push({icon:g,title:`${Gt(t)} to Cypress`,hint:`Into a folder of its own`,text:`Migrate ${Gt(t)} to Cypress in TypeScript, into e2e/tosca`}),i.push({icon:T,title:`Help me choose`,hint:`The assistant asks one thing at a time`,text:`I want to migrate our Tosca tests. Help me choose.`}),i.slice(0,4)}function qt({view:e,sid:n,onSid:r}){let[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(``),[c,l]=(0,X.useState)(``),[u,d]=(0,X.useState)(!1),f=(0,X.useRef)(null),p=we();(0,X.useEffect)(()=>{n&&i?.id!==n&&V.view(n).then(a,()=>{r(``),Ut(``)})},[n]),(0,X.useEffect)(()=>{if(!i?.thinking&&!i?.checking)return;let e=setTimeout(()=>V.view(i.id).then(a,e=>l(e.message)),1200);return()=>clearTimeout(e)},[i]);let m=i?.messages.length??0;(0,X.useEffect)(()=>{m&&f.current?.scrollIntoView({block:`nearest`,behavior:oe()})},[m,i?.thinking]);let h=e=>{s(e),setTimeout(()=>document.getElementById(`tosca-agent-box`)?.focus(),0)},g=async e=>{d(!0),l(``);try{let t=await e();return a(t),t.id!==n&&(r(t.id),Ut(t.id)),!0}catch(e){return l(e.message),!1}finally{d(!1)}},_=async e=>{!e.trim()||u||i?.thinking||(Wt.some(t=>t.test(e))?(s(``),l(`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 g(()=>i?V.say(i.id,e):V.start(e))&&s(``))},v=()=>{i&&V.end(i.id).catch(()=>{}),a(null),s(``),l(``),r(``),Ut(``)},y=()=>i?.prefill&&(location.hash=j(`tosca`,`new`,i.id)),b=!i,x=u||!!i?.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)(de,{agent:`forgeqe-tosca`,px:p?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)(Qt,{view:e,onGit:()=>h(`Clone the Tosca exports from https://`)}),(0,Z.jsx)(`div`,{className:`grid w-full gap-2 text-left sm:grid-cols-2`,children:Kt(e).map(e=>(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>h(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)(ce,{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:j(`tosca`,`new`),className:`inline-flex items-center gap-2 text-[13px]`,children:[(0,Z.jsx)(t,{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:i.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)(U,{size:`sm`,variant:`ghost`,onClick:v,disabled:u,children:`New conversation`})]}),(0,Z.jsxs)(`ol`,{"aria-live":`polite`,className:`m-0 flex list-none flex-col gap-6 p-0`,children:[i.messages.map((e,t)=>(0,Z.jsx)(`li`,{className:`fade-quick`,children:e.role===`person`?(0,Z.jsx)(xe,{text:e.text}):(0,Z.jsx)(Jt,{text:e.text})},t)),i.thinking&&(0,Z.jsx)(`li`,{className:`fade-quick`,children:(0,Z.jsx)(Jt,{text:i.working===`cloning`?`Cloning the repository and looking for Tosca exports…`:`Reading what you said…`,working:i.working===`cloning`?`cloning`:`reading`})})]}),!i.thinking&&i.question?.id===`clone`&&i.clone&&(0,Z.jsx)(Xt,{c:i.clone,disabled:u,onToken:e=>g(()=>V.token(i.id,e)),onPick:e=>void g(()=>V.pick(i.id,`clone`,[e]))},`clone-${m}`),!i.thinking&&i.question&&i.question.id!==`clone`&&i.question.options.length>0&&(0,Z.jsx)(Yt,{q:i.question,disabled:u,onPick:e=>void g(()=>V.pick(i.id,i.question.id,e)).then(()=>document.getElementById(`tosca-agent-box`)?.focus())},`${i.question.id}-${m}`),!i.thinking&&i.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:i.question?`The wizard can open now; the rest is optional.`:`Everything is ready.`}),(0,Z.jsxs)(U,{variant:`primary`,onClick:y,children:[`Open the prefilled wizard`,(0,Z.jsx)(re,{"aria-hidden":`true`})]})]}),(0,Z.jsx)(`div`,{ref:f})]}),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(Zt,{v:i})})]}),(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:[c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 bg-bg pb-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),(0,Z.jsx)(me,{id:`tosca-agent-box`,label:`Tell Guide`,value:o,onChange:e=>{s(e),l(``)},onSend:()=>void _(o),busy:u,disabled:x,placeholder:b?`Migrate checkout.tsu to Playwright in TypeScript, on QA…`:`Answer, or change anything you said…`})]})]})}function Jt({text:e,working:t}){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,Z.jsx)(se,{state:t?`working`:`idle`,px:28,label:t?`Guide is ${t}`:`Guide`,className:`mt-1 flex-none`}),(0,Z.jsx)(`p`,{className:I(`m-0 text-[16px] leading-relaxed whitespace-pre-line [overflow-wrap:anywhere]`,t?`text-muted`:`text-ink-2`),children:e})]})}function Yt({q:e,disabled:t,onPick:n}){let[r,i]=(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:e.text}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.multi?(0,Z.jsx)(G,{items:e.options.filter(e=>!e.action).map(e=>({id:e.id,label:e.label})),value:r,onChange:e=>{let t=e.includes(`all`)&&!r.includes(`all`);i(t?[`all`]:e.filter(e=>e!==`all`))}}):e.options.map(e=>(0,Z.jsxs)(U,{size:`sm`,variant:e.id===`skip`?`ghost`:`outline`,disabled:t,onClick:()=>n([e.id]),children:[e.label,e.hint&&(0,Z.jsx)(`span`,{className:`text-[13px] font-normal text-muted`,children:e.hint})]},e.id))}),e.multi&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[e.options.some(e=>!e.action)&&(0,Z.jsxs)(U,{size:`sm`,variant:`primary`,disabled:t||!r.length,onClick:()=>n(r),children:[`Use `,r.includes(`all`)?`all`:r.length>1?`these ${r.length}`:`this`]}),e.options.filter(e=>e.action).map(e=>(0,Z.jsxs)(U,{size:`sm`,variant:`outline`,disabled:t,onClick:()=>n([e.id]),children:[e.id===`git`&&(0,Z.jsx)(v,{"aria-hidden":`true`}),e.label]},e.id)),e.typed&&e.options.some(e=>!e.action)&&(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:`Or type the names below.`})]})]})}function Xt({c:e,disabled:t,onToken:n,onPick:r}){let[i,a]=(0,X.useState)(null),[o,s]=(0,X.useState)(!1),[c,l]=(0,X.useState)(``),u=[...new Set([...e.credentials,...e.tokenVar?[e.tokenVar]:[]])].sort(),d=async()=>{if(i){s(!0),l(``);try{await ae.saveSecrets({[i.name]:i.value}),a(null),await n(i.name)}catch(e){l(e.message)}finally{s(!1)}}},f=t||o;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 `,e.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)(R,{id:`tsa-token`,size:`sm`,value:e.tokenVar??``,disabled:f,onChange:e=>void n(e.target.value),className:`min-w-[220px]`,children:[(0,Z.jsx)(`option`,{value:``,children:`None (public, or ssh)`}),u.map(t=>(0,Z.jsxs)(`option`,{value:t,children:[t,t===e.tokenVar&&!e.tokenSaved?` (not saved yet)`:``]},t))]})]}),!i&&(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:f,onClick:()=>a({name:e.tokenVar&&!e.tokenSaved?e.tokenVar:e.suggested,value:``}),children:`Add a token`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:f,onClick:()=>void n(e.tokenVar??``),children:`Check again`})]}),!i&&(0,Z.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Or save it in`,` `,(0,Z.jsx)(`a`,{href:j(`settings`,`repo-tokens`),target:`_blank`,rel:`noopener`,children:`Settings › Secrets › Repository tokens`}),`, then press Check again.`]}),i&&(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)(B,{id:`tsa-token-name`,size:`sm`,value:i.name,spellCheck:!1,maxLength:64,onChange:e=>a({...i,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)(B,{id:`tsa-token-value`,size:`sm`,type:`password`,autoComplete:`off`,value:i.value,onChange:e=>a({...i,value:e.target.value}),className:`w-[260px] max-w-full`})]}),(0,Z.jsx)(U,{size:`sm`,disabled:f||!i.name||!i.value,onClick:()=>void d(),children:o?`Saving…`:`Save`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>a(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.`})]}),c&&(0,Z.jsx)(`p`,{role:`alert`,className:`m-0 text-[13px] text-fail [overflow-wrap:anywhere]`,children:c}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsxs)(U,{size:`sm`,variant:`primary`,disabled:f||!(!e.tokenVar||e.tokenSaved),onClick:()=>r(`yes`),children:[(0,Z.jsx)(v,{"aria-hidden":`true`}),`Clone it`]}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,disabled:f,onClick:()=>r(`no`),children:`No`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:e.tokenVar&&!e.tokenSaved?`Save a token as ${e.tokenVar} first, or pick None.`:e.tokenVar?`Signs in with ${e.tokenVar}.`:`Nothing is cloned until you say so.`})]})]})}function Zt({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)(Ge,{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 Qt({view:e,onGit:t}){let n=`inline-flex min-h-7 items-center gap-1 rounded-full border px-2 no-underline`,r=e.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`}),e.exports.slice(0,5).map(e=>(0,Z.jsxs)(`span`,{className:I(n,`border-transparent bg-surface-strong text-ink-2`),children:[(0,Z.jsx)(i,{size:12,"aria-hidden":`true`}),Gt(e.path)]},e.path)),e.clones.map(e=>(0,Z.jsxs)(`span`,{className:I(n,`border-transparent bg-surface-strong text-ink-2`),children:[(0,Z.jsx)(v,{size:12,"aria-hidden":`true`}),e.label.replace(/^.*\//,``).replace(/\.git$/,``)]},e.id)),(0,Z.jsxs)(`button`,{type:`button`,onClick:t,className:I(n,`cursor-pointer border-dashed border-line-strong bg-transparent text-muted hover:text-ink`),children:[(0,Z.jsx)(v,{size:12,"aria-hidden":`true`}),`Clone a git repository`]}),(0,Z.jsx)(`span`,{className:`ml-1 text-muted`,children:e.exports.length+r?`${e.exports.length+r} found`:`none in this project yet`})]})}var $t=[`Export`,`Target`,`Instructions`,`Review`],en=[`The Tosca export and its test cases`,`Framework and language`,`Your rules, optional`,`Check and start`],tn=[`Keep one page object per Tosca module, in pages/.`,`Name each test after its Tosca test case.`,`Read the base URL from BASE_URL.`],nn={playwright:`Microsoft`,cypress:`JavaScript only`,webdriverio:`WebDriver and BiDi`,selenium:`WebDriver`};function rn({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:$t.map((r,i)=>{let a=i<=t,o=i===e,s=i<t&&!o;return(0,Z.jsxs)(`li`,{className:I(`flex items-center gap-2`,i<$t.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":en[i],className:I(`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:I(`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)(_,{size:13,strokeWidth:3}):i+1}),(0,Z.jsx)(`span`,{className:I(o?`font-medium text-ink`:a?`text-ink-2`:`text-muted`,!o&&`hidden @xl:inline`),children:r})]}),i<$t.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:I(`block h-full rounded-full bg-pass transition-[width] duration-250 ease-out`,i<t?`w-full`:`w-0`)})})]},r)})})})}function an({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 on({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)(U,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(O,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(U,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}function sn({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:I(`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 cn=e=>e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;function ln({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 un({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)(an,{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)(B,{inputMode:`url`,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)(an,{id:`tsc-git-branch`,label:`Branch`,help:`The default branch when empty.`,children:(0,Z.jsx)(B,{id:`tsc-git-branch`,value:i,spellCheck:!1,maxLength:200,placeholder:`main`,onChange:e=>a(e.target.value)})}),(0,Z.jsx)(an,{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)(B,{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)(U,{type:`submit`,disabled:e||!n.trim(),children:e?`Cloning…`:`Clone it`})})]})}function dn({view:e,onView:t,picked:n,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)(``),[S,C]=(0,X.useState)(``),w=new Set(n.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),C(``),e.length){m(!0);try{let t=await L.inspectSources(e);o(t),c(new Set(t.test_cases.filter(Xe).map(e=>e.id))),u(`tsc-cases`)}catch(e){t&&i(t),C(e.message)}finally{m(!1)}}},ee=e=>{o(null),C(``),i(t=>t.some(t=>$(t)===$(e))?t.filter(t=>$(t)!==$(e)):[...t,e])},O=T.length>0&&T.every(e=>w.has($(e.p))),k=async(e,n,r)=>{g(!0),C(``);try{t?.(await L.clone(e,n||void 0,r||void 0))}catch(e){C(e.message)}finally{g(!1)}},te=async e=>{C(``),b(``);try{t?.(await L.removeClone(e)),i(t=>t.filter(t=>t.workspace!==e)),o(null)}catch(e){C(e.message)}},ne=e=>{let t=new Set(s);t.has(e)?t.delete(e):t.add(e),c(t)},A=e=>Xe(e),j=a?a.test_cases.filter(A):[],M=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});return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(_e,{label:`Export`,tabs:[{id:`tsc-exports`,label:n.length?`Exports · ${n.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?n.length?E(n):C(`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)(ve,{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:O,onCheckedChange:e=>{o(null),C(``),i(e?T.map(e=>e.p):[])}}),`Pick all `,T.length]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(q,`w-10`),children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`Export`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(q,`hidden @xl:table-cell`),children:`Folder`}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`From`}),(0,Z.jsx)(`th`,{scope:`col`,className:ye,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:K,children:(0,Z.jsx)(J,{"aria-label":`Pick ${e.p.file}${e.p.workspace?` of ${e.from}`:``}`,checked:w.has(t),onCheckedChange:()=>ee(e.p)})}),(0,Z.jsx)(`td`,{className:K,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(D,{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:I(K,`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:I(K,`text-ink-2`),children:e.from}),(0,Z.jsx)(`td`,{className:he,children:cn(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)(U,{variant:`primary`,disabled:p||!n.length,onClick:()=>void E(n),children:p?`Reading…`:n.length>1?`Read ${n.length} exports`:`Read the export`}),(0,Z.jsx)(`span`,{className:`text-[13px] text-muted`,children:n.length?n.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&&!S&&(0,Z.jsx)(`p`,{role:`status`,className:`shimmer m-0 text-[13px]`,children:(0,Z.jsxs)(`span`,{children:[`Reading `,n.length===1?`the export`:`${n.length} exports`,`…`]})}),M,(0,Z.jsx)(an,{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)(B,{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)(U,{disabled:p||!d.trim(),onClick:()=>void E([...n.filter(e=>$(e)!==$({file:d.trim()})),{file:d.trim()}],n),"data-tip":`Add the export at this path and read it`,children:[(0,Z.jsx)(x,{"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)(r,{size:15,"aria-hidden":`true`,className:I(`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)(U,{size:`sm`,variant:`ghost`,onClick:()=>void te(e.id),children:`Remove it`}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,onClick:()=>b(``),children:`Keep it`})]}):(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,"aria-label":`Remove the copy of ${e.label}`,onClick:()=>b(e.id),children:`Remove`})]},e.id))}),(0,Z.jsx)(un,{busy:h,onClone:(e,t,n)=>void k(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:[M,!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 `,n.length===1?(0,Z.jsx)(`span`,{className:`font-mono text-[13px]`,children:n[0].file}):Y(n.length,`export`)]}),(0,Z.jsx)(U,{size:`sm`,variant:`ghost`,onClick:()=>u(`tsc-exports`),children:`Change exports`})]}),(0,Z.jsx)(ln,{s:a}),a.coverage&&(0,Z.jsx)(Nt,{coverage:a.coverage,names:new Map(a.test_cases.map(e=>[e.id,e.name])),file:`${n.length===1?n[0].file.replace(/^.*\//,``).replace(/\.tsu$/i,``):`tosca-exports`}-coverage.csv`,folded:!0}),(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ve,{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:j.length>0&&j.every(e=>s.has(e.id)),onCheckedChange:e=>c(new Set(e?j.map(e=>e.id):[]))}),`Pick all `,j.length,` test cases ForgeQE can convert`]}),head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(`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`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Test case`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Folder`}),(0,Z.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Steps · checks`}),(0,Z.jsx)(`th`,{scope:`col`,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=A(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:()=>ne(e.id)})}),(0,Z.jsxs)(`td`,{className:`px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:I(`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:I(`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:I(`px-4 py-2`,`whitespace-nowrap`),children:(0,Z.jsx)(H,{tone:t?`neutral`:`warn`,children:t?Je(e):`${Re[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 fn({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=Ke[e];return(0,Z.jsx)(sn,{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:nn[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=We[u(e.id)];return(0,Z.jsx)(sn,{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)(an,{id:`tsc-into`,label:`Output folder`,help:`A new folder. Empty: named after the target.`,children:(0,Z.jsx)(B,{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)(an,{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)(B,{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 pn({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)(Ge,{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 mn({view:e,onView:t,review:n,onStart:r,from:i}){let[a,o]=(0,X.useState)(0),[s,l]=(0,X.useState)(0),[u,d]=(0,X.useState)([]),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(new Set),[g,_]=(0,X.useState)(``),[v,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(``),[ee,D]=(0,X.useState)(null),[O,k]=(0,X.useState)(!1),[te,A]=(0,X.useState)(!1),[M,N]=(0,X.useState)(!1),[ie,P]=(0,X.useState)(``),F=[...m].sort().join(`,`);(0,X.useEffect)(()=>{D(null),k(!1),l(e=>Math.min(e,2))},[u.map($).join(`|`),F,g,x,C,T]);let[ae,R]=(0,X.useState)(`next`),B=(0,X.useRef)(null),H=e=>{R(e<a?`back`:`next`),o(e);let t=B.current;t&&t.getBoundingClientRect().top<0&&t.scrollIntoView({block:`start`,behavior:oe()})},se=e=>{H(e),l(t=>Math.max(t,e)),P(``)},[U,W]=(0,X.useState)(i?`filling`:``);(0,X.useEffect)(()=>{if(!i)return;let e=!0;return(async()=>{N(!0);try{let t=(await V.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;d(t.sources),b(t.to.split(`-`)[0]),_(t.to),S(t.into??``),E(t.instructions??``);let n=await L.inspectSources(t.sources);if(!e)return;let r=n.test_cases.filter(Xe).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 L.plan({sources:t.sources,to:t.to,...t.into?{into:t.into}:{},...t.instructions?{instructions:t.instructions}:{}});(t.app||t.baseUrl)&&await L.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 L.answer(a.plan.id,{use:{name:e,secret:n}}).catch(()=>{});if((t.desktopApp||t.mobileApp||t.database)&&await L.answer(a.plan.id,{...t.desktopApp?{desktopApp:t.desktopApp}:{},...t.mobileApp?{mobileApp:t.mobileApp}:{},...t.database?{database:t.database}:{}}).catch(()=>{}),!e)return;D(a),l(3),H(3),W(`done`)}catch(t){if(!e)return;P(t.message),W(``)}finally{e&&N(!1)}})(),()=>{e=!1}},[i]);let ce=async()=>{N(!0),P(``);try{let e=!f||f.test_cases.filter(Xe).every(e=>m.has(e.id)),t=await L.plan({sources:u,to:g,...x.trim()?{into:x.trim()}:{},...e?{}:{only:[...m]},...T.trim()?{instructions:T.trim()}:{},...C?{testAttributes:[C]}:{}});D(t),se(3)}catch(e){let t=e.message;P(t);let n=x.trim().replace(/\\/g,`/`).replace(/(?<!\/)\/+$/,``);n&&t.includes(n)&&H(1)}finally{N(!1)}},le=ee?.plan,G=le?.feasibility.findings.some(e=>e.level===`limit`),ue=le?.feasibility.verdict===`blocked`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i&&U&&(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:U===`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:j(`tosca`),className:`text-[13px]`,children:`Back to the assistant`})]}),(0,Z.jsx)(`div`,{ref:B,className:`scroll-mt-4`,children:(0,Z.jsx)(rn,{at:a,reached:s,onGo:e=>!M&&(e<3||ee)&&H(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:I(`flex min-w-0 flex-col gap-6`,ae===`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]}),ie&&(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:ie}),a===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(dn,{view:e,onView:t,picked:u,setPicked:d,found:f,setFound:p,only:m,setOnly:h}),(0,Z.jsx)(on,{busy:M,next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(re,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>se(1),disabled:!f||!m.size,aside:f&&!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)(fn,{view:e,to:g,setTo:_,fw:v,setFw:b,into:x,setInto:S,attr:C,setAttr:w}),(0,Z.jsx)(on,{busy:M,onBack:()=>H(0),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(re,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>se(2),disabled:!g})]}),a===2&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(an,{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)(z,{id:`tsc-instructions`,value:T,rows:6,maxLength:4e3,placeholder:`Page objects go in pages/, one class per Tosca module.`,onChange:e=>E(e.target.value)})}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:tn.map(e=>(0,Z.jsxs)(`button`,{type:`button`,disabled:T.includes(e),onClick:()=>E(T.trim()?`${T.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)(y,{size:13,"aria-hidden":`true`}),e]},e))}),(0,Z.jsx)(on,{busy:M,onBack:()=>H(1),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ne,{"aria-hidden":`true`}),M?`Checking…`:`Check`]}),onNext:()=>void ce(),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Nothing is changed yet.`})})]}),a===3&&le&&(0,Z.jsxs)(Z.Fragment,{children:[n(le,O,k,A),(0,Z.jsx)(on,{busy:M,onBack:()=>H(2),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(c,{"aria-hidden":`true`}),`Start`]}),disabled:ue||!te||G&&!O,onNext:()=>r(ee,!!G&&O),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:ue?`Change what is not possible first.`:te?G&&!O?`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)(pn,{view:e,picked:u,found:f,only:m,to:g,instructions:T})})]})]})}function hn({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),L.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 `,Oe(t.tokens.mid),` tokens`,t.cost?`, about ${Te(t.cost.mid,t.cost.currency)}`:``,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`(`,Oe(t.tokens.low),` to `,Oe(t.tokens.high),t.cost?`, ${Te(t.cost.low,t.cost.currency)} to ${Te(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 gn({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:j(`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)(hn,{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)(Nt,{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)(N,{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)(N,{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)(zt,{planId:e.id,onReady:r,onCoverage:a}),(0,Z.jsx)(je,{title:`Test cases (${e.cases.length})`,children:(0,Z.jsx)(`div`,{className:`@container`,children:(0,Z.jsx)(ve,{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`,{scope:`col`,className:q,children:`Test case`}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`In the plan`}),(0,Z.jsx)(`th`,{scope:`col`,className:I(ye,`hidden @xl:table-cell`),children:`Steps · checks`}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`Kind`})]}),children:e.cases.map(e=>{let t=e.change;return(0,Z.jsxs)(`tr`,{className:Ae,children:[(0,Z.jsx)(`td`,{className:I(K,`[overflow-wrap:anywhere]`,e.included?`text-ink`:`text-muted`),children:e.name}),(0,Z.jsxs)(`td`,{className:I(K,`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:I(he,`hidden @xl:table-cell`),children:[e.steps,(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` · `,e.asserts]})]}),(0,Z.jsx)(`td`,{className:I(K,`whitespace-nowrap text-muted`),children:Re[e.route]||e.route})]},e.id)})})})}),(0,Z.jsx)(je,{title:`Files, in order (${e.units.length})`,children:(0,Z.jsx)(ve,{label:`Files, in order`,placeholder:`Find a file`,height:`min(40vh, 360px)`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:I(q,`w-24`),children:`Kind`}),(0,Z.jsx)(`th`,{scope:`col`,className:q,children:`File`})]}),children:e.units.map(e=>(0,Z.jsxs)(`tr`,{className:Ae,children:[(0,Z.jsx)(`td`,{className:I(K,`text-muted`),children:Ye(e)}),(0,Z.jsx)(`td`,{className:I(K,`font-mono text-[13px] [overflow-wrap:anywhere]`),children:e.target})]},e.id))})})]})}function _n({d:e,onStarted:t}){let[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(!1),l=e.plan.feasibility.findings.some(e=>e.level===`limit`),u=e.plan.feasibility.verdict===`blocked`,d=!!e.job?.running;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[e.job?.last&&!d&&(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)(gn,{plan:e.plan,accepted:e.confirmed||n,onAccept:e.confirmed?void 0:r,onReady:a}),!u&&!d&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsxs)(U,{variant:`primary`,disabled:!i||!e.confirmed&&l&&!n,onClick:()=>s(!0),"data-tip":`Start the conversion`,children:[(0,Z.jsx)(c,{"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)(et,{plan:e.plan,acceptLimits:l&&(e.confirmed||n),onClose:()=>s(!1),onStarted:e=>{s(!1),t(e)}})]})}function vn({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)(Ht),l=(0,X.useCallback)(()=>{L.list().then(e=>{n(e),i(``)},e=>i(e.message))},[]);(0,X.useEffect)(l,[l,e]),(0,X.useEffect)(()=>{e===`conversions`&&location.replace(j(`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]?te(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)(Me,{tab:`migrations`,children:[(0,Z.jsx)(qe,{error:r}),m,t&&(0,Z.jsx)(mn,{view:t,onView:n,from:h,review:(e,t,n,r)=>(0,Z.jsx)(gn,{plan:e,accepted:t,onAccept:n,onReady:r}),onStart:(e,t)=>o({d:e,accept:t})},h||`new`),a&&(0,Z.jsx)(et,{plan:a.d.plan,acceptLimits:a.accept,onClose:()=>o(null),onStarted:e=>{o(null),location.hash=j(`tosca`,e.plan.id)}})]}):d&&f?(0,Z.jsx)(Me,{tab:`migrations`,wide:!0,children:(0,Z.jsx)(kt,{id:d,caseId:p},d)}):d?(0,Z.jsxs)(Me,{tab:`migrations`,wide:!0,children:[(0,Z.jsx)(qe,{error:r}),m,t&&(0,Z.jsx)(gt,{id:d,plan:(e,t)=>(0,Z.jsx)(_n,{d:e,onStarted:t})},d)]}):e===`conversions`?(0,Z.jsx)(Me,{tab:`migrations`,children:m}):(0,Z.jsxs)(Me,{tab:`migrations`,children:[(0,Z.jsx)(qe,{error:r}),m,t&&(0,Z.jsx)(qt,{view:t,sid:s,onSid:c})]})}export{vn as Tosca};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,M as n,u as r}from"./route-Dg53WdFu.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{A as a,j as o}from"./input-D7iHeNXz.js";import{a as s}from"./filters-Culzq1j1.js";import{L as c}from"./palette-lUno7fso.js";import{B as l,Dn as u,H as d,I as f,K as p,L as m,R as h,U as g,z as _,zn as v}from"./index-CljX5dI4.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[o,c]=(0,y.useState)(!1),l=h(e);return(0,b.jsxs)(`li`,{className:a(!i&&`border-t border-line-soft`),children:[(0,b.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":t,onClick:()=>c(!o),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:a(`flex-none text-muted transition-transform duration-200`,o&&`rotate-90`)})]}),(0,b.jsx)(v,{open:o,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}),l&&(0,b.jsxs)(`a`,{href:l,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===f;return(0,b.jsxs)(`li`,{className:`relative flex gap-4 pb-8`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:a(`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:l(e.date)}),` · `,o(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)(_,[]);let t=m(),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)(p,{}),(0,b.jsxs)(`main`,{className:a(g,`flex-auto gap-6`),children:[(0,b.jsx)(d,{}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,b.jsx)(u,{pixel:c[`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,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,sr as n}from"./route-Dg53WdFu.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{A as i,j as a,tt as o}from"./input-D7iHeNXz.js";import{a as s,d as c,f as l,i as u,n as d,s as f}from"./filters-Culzq1j1.js";import{Bn as p,Lt as m,Pt as h,Rt as g,Vn as _,zt as v}from"./index-CljX5dI4.js";var y=e(t(),1),b=r(),x={test:[`Testing the connection`,`Tested the connection`,`waiting`],tables:[`Reading the tables`,`Read the tables`,`searching`],query:[`Running the query`,`Ran the query`,`working`],gen:[`Making a preview`,`Made a preview`,`writing`],files:[`Writing the files`,`Wrote the files`,`writing`],insert:[`Inserting test data`,`Inserted test data`,`working`],batches:[`Listing the batches`,`Listed the batches`,`searching`],clean:[`Removing a batch`,`Removed a batch`,`working`],request:[`Asking Miner for test data`,`Asked Miner for test data`,`thinking`],fetch:[`Fetching the request again`,`Fetched the request again`,`searching`],ask:[`Asking Miner`,`Asked Miner`,`thinking`],checks:[`Running the checks`,`Ran the checks`,`working`],map:[`Reading the schema`,`Read the schema`,`searching`],check:[`Checking the flows`,`Checked the flows`,`working`],trace:[`Following the record`,`Followed the record`,`searching`]};function S(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(``),[i,a]=(0,y.useState)(!1),s=(0,y.useCallback)(()=>{o.view().then(e=>{t(e),r(``)},e=>r(e.message))},[]);(0,y.useEffect)(s,[s]);let c=!!e?.job?.running;return(0,y.useEffect)(()=>{if(!c)return;let e=_(s,1e3);return()=>p(e)},[c,s]),{view:e,error:n,busy:i||c,running:c,act:async(e,t)=>{a(!0),r(``);try{await o.run(e,t),s()}catch(e){r(e.message)}finally{a(!1)}},stop:()=>void o.stop().then(s),load:s,job:e?.job??null}}var C=e=>e==null?`NULL`:typeof e==`object`?JSON.stringify(e):String(e);function w({file:e,onNote:t}){return(0,b.jsx)(`button`,{type:`button`,"data-tip":e,onClick:async()=>t(await f(e)),className:i(l({size:`sm`}),`font-mono text-[13px]`),children:e.split(/[\\/]/).pop()})}function T({children:e,label:t}){return(0,b.jsx)(`pre`,{"aria-label":t,className:`m-0 max-h-[320px] overflow-auto rounded-[12px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre text-ink-2`,children:e})}function E({job:e,onStop:t,words:r}){let[i,o,l]=(r??x)[e.kind]??[`Working`,`Done`,`working`],u=(0,y.useRef)(null);(0,y.useEffect)(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[e.lines.length]);let d=e.exitCode===0,f=!d&&(e.kind===`check`||e.kind===`trace`)&&e.result!==void 0&&!e.result.error;return(0,b.jsxs)(`section`,{"aria-label":e.running?i:o,className:`flex flex-col gap-2 rounded-[14px] card border p-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 font-medium [overflow-wrap:anywhere]`,children:[e.running?i:o,e.target?(0,b.jsxs)(`span`,{className:`font-normal text-muted`,children:[` · `,e.target]}):null]}),(0,b.jsx)(s,{tone:e.running?`running`:d?`pass`:e.exitCode===2||f?`warn`:`fail`,orb:l,children:e.running?`Working`:d?`Done`:f?`Some broken`:e.exitCode===2?`Not done`:`Failed`}),e.running&&(0,b.jsxs)(c,{variant:`danger`,onClick:t,children:[(0,b.jsx)(n,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]}),(0,b.jsxs)(`details`,{open:e.running||!d&&!e.result,children:[(0,b.jsxs)(`summary`,{className:`cursor-pointer text-sm text-muted`,children:[`Output (`,a(e.lines.length,`line`),`)`]}),(0,b.jsx)(`code`,{className:`mt-2 block font-mono text-[13px] text-muted [overflow-wrap:anywhere]`,children:e.command}),(0,b.jsx)(`pre`,{ref:u,className:`mt-2 max-h-[240px] overflow-auto rounded-[10px] bg-surface-muted p-4 font-mono text-[13px] leading-relaxed whitespace-pre-wrap text-ink-2`,children:e.lines.join(`
2
- `)||`Starting…`})]})]})}function D({text:e}){return(0,b.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:e})}function O({columns:e,rows:t}){let n=e.map((e,n)=>t.length>0&&t.every(e=>e[n]===null||e[n]===void 0||typeof e[n]==`number`)&&t.some(e=>typeof e[n]==`number`));return(0,b.jsx)(h,{label:`Rows`,resetKey:t,head:e.map((e,t)=>(0,b.jsx)(`th`,{scope:`col`,className:n[t]?g:m,children:e},e)),children:t.map((e,t)=>(0,b.jsx)(`tr`,{className:v,children:e.map((e,t)=>(0,b.jsx)(`td`,{"data-tip":C(e),className:i(`px-4 py-2 font-mono text-[13px]`,n[t]?`text-right whitespace-nowrap tabular-nums`:`max-w-[320px] truncate`,e==null&&`text-muted`),children:C(e)},t))},t))})}function k({r:e}){return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(e.order||[]).map(t=>{let n=e.preview?.[t],r=n?.sample||[],i=r.length?Object.keys(r[0]):[];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`span`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:t}),` · `,a(e.rows?.[t]??0,`row`),n?.database_fills?.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · the database fills `,n.database_fills.join(`, `)]}):null,e.masked?.[t]?.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · masked `,e.masked[t].join(`, `)]}):null]}),i.length>0&&(0,b.jsx)(O,{columns:i,rows:r.slice(0,3).map(e=>i.map(t=>e[t]))})]},t)}),(e.warnings||[]).map((e,t)=>(0,b.jsx)(`p`,{className:`m-0 text-[13px] text-warn`,children:e},t))]})}var A={query:`Existing rows`,generate:`New rows`};function j({r:e,onNote:t}){let n=Object.entries(e.rows||{});return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(s,{tone:`pass`,children:A[e.kind||``]||`Answered`}),(0,b.jsxs)(`span`,{className:`min-w-0 text-sm text-ink-2 [overflow-wrap:anywhere]`,children:[e.database,e.why?` · ${e.why}`:``]})]}),n.map(([t,n])=>(0,b.jsx)(M,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:`The query, as the database checked it`}),(0,b.jsx)(T,{label:`SQL`,children:e.sql})]}),e.script_preview&&e.script_preview.length>0&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script for these rows, not run`}),(0,b.jsx)(T,{label:`INSERT script`,children:e.script_preview.join(`
3
- `)})]}),e.files?.length?(0,b.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Kept`,e.files.map(e=>(0,b.jsx)(w,{file:e,onNote:t},e))]}):null,e.replay&&(0,b.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,children:[`Tests and pipelines get the same data with `,(0,b.jsx)(`code`,{className:`font-mono text-[13px] text-ink-2`,children:e.replay}),`, without a model.`]})]})}function M({title:e,rows:t,total:n}){let r=[...new Set(t.flatMap(e=>Object.keys(e)))];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`span`,{className:`text-sm`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:e}),` · `,a(n,`row`),n>t.length?(0,b.jsxs)(`span`,{className:`text-muted`,children:[` · `,t.length,` shown`]}):null]}),r.length>0?(0,b.jsx)(O,{columns:r,rows:t.map(e=>r.map(t=>e[t]))}):(0,b.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`No rows match.`})]})}function N({items:e,text:t,label:n,size:r=10,children:i}){let[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(0),l=a.toLowerCase().split(/\s+/).filter(Boolean),f=l.length?e.filter(e=>l.every(n=>t(e).toLowerCase().includes(n))):e;(0,y.useEffect)(()=>c(0),[a,e.length]);let p=Math.min(s,Math.max(0,Math.ceil(f.length/r)-1));return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.length>r&&(0,b.jsx)(u,{id:`find-${n.toLowerCase().replace(/\W+/g,`-`)}`,label:`Find in ${n.toLowerCase()}`,value:a,onChange:o,className:`flex-none`}),f.length?(0,b.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.slice(p*r,p*r+r).map(i)}):(0,b.jsx)(`p`,{className:`m-0 text-sm text-muted`,children:`Nothing matches.`}),f.length>r&&(0,b.jsx)(d,{page:p,size:r,total:f.length,onPage:c,label:`Pages of ${n.toLowerCase()}`})]})}export{E as a,D as c,C as d,S as f,k as i,O as l,T as n,A as o,w as r,N as s,j as t,M as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./route-Dg53WdFu.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};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$t as t,At as n,Bt as r,C as i,D as a,Dn as o,En as s,Et as c,Fn as l,Fr as u,Gn as d,Gt as f,Hn as p,Hr as m,Ht as h,In as g,Ir as _,J as v,Jn as y,Jt as ee,K as te,Kt as b,Ln as ne,Lr as re,Lt as x,M as S,Mr as C,Nr as w,Nt as T,O as E,Ot as D,Pn as O,Pt as k,Q as A,Qn as j,Qt as M,Rr as ie,Rt as N,S as P,Sn as F,T as I,Tn as L,Tt as ae,U as R,Vn as oe,Vt as se,W as z,X as B,Xt as V,Y as H,Yn as ce,Yt as le,Z as ue,Zn as de,_ as fe,_n as pe,_r as me,a as he,ar as ge,b as _e,bt as ve,cn as ye,dn as be,dr as xe,dt as Se,en as Ce,er as we,ft as Te,g as Ee,gn as De,gt as Oe,h as ke,hr as Ae,ht as je,ir as Me,it as Ne,j as Pe,jr as Fe,kt as Ie,lr as Le,m as Re,mn as ze,mr as Be,mt as Ve,nn as He,nr as Ue,o as We,on as Ge,ot as Ke,p as qe,pn as Je,q as Ye,qn as Xe,qt as Ze,rn as Qe,rr as $e,rt as et,s as tt,tr as nt,tt as rt,ut as it,v as at,vn as ot,vr as st,w as ct,wr as lt,wt as ut,xn as dt,xt as ft,yn as pt,yr as mt,zt as ht}from"./route-Dg53WdFu.js";import{t as gt}from"./jsx-runtime-LKYXHABd.js";import{A as U,M as _t,c as vt,d as yt,lt as bt,t as xt}from"./input-D7iHeNXz.js";var W=e(m(),1),G=gt(),St=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ct=_t,wt=((e,t)=>n=>{if(t?.variants==null)return Ct(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=St(t)||St(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ct(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap font-medium no-underline transition-colors disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{outline:`rounded-[8px] border border-line-strong bg-surface-strong text-ink hover:bg-line hover:text-ink`,primary:`rounded-[8px] border border-accent bg-accent text-accent-ink hover:border-accent-hover hover:bg-accent-hover hover:text-accent-ink`,danger:`rounded-[8px] border border-line-strong bg-surface-strong text-fail hover:bg-fail-soft hover:text-fail`,destructive:`rounded-[8px] border border-fail bg-fail text-bg hover:opacity-90 hover:text-bg`,ghost:`rounded-[8px] border-0 bg-transparent text-ink hover:bg-surface-strong`,icon:`rounded-[8px] border-0 bg-transparent text-ink-2 hover:bg-surface-strong hover:text-ink`},size:{default:`min-h-10 px-4 text-sm [&>svg]:size-4 [&>svg]:flex-none`,lg:`min-h-11 px-6 text-sm [&>svg]:size-4 [&>svg]:flex-none`,sm:`min-h-8 px-4 text-[13px] [&>svg]:size-3.5 [&>svg]:flex-none`,icon:`size-10 [&>svg]:size-4`,"icon-sm":`size-8 [&>svg]:size-4`}},defaultVariants:{variant:`outline`,size:`default`}});function Tt({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,G.jsx)(`button`,{type:r,className:U(wt({variant:t,size:n}),e),...i})}var Et=new Map([[he,`accessibility`],[We,`history`],[tt,`web`],[qe,`branch`],[Ee,`feature`],[fe,`knowledge-base`],[at,`knowledge-base`],[_e,`container`],[P,`architecture`],[i,`bug`],[ct,`speed`],[I,`history`],[a,`report`],[R,`stories`],[z,`stories`],[te,`cloud`],[Ye,`code`],[v,`code`],[H,`coins`],[B,`columns`],[A,`container`],[rt,`server`],[et,`database`],[Ne,`database`],[Ke,`download`],[it,`visual`],[Se,`report`],[Te,`report`],[Ve,`code`],[je,`code`],[Oe,`file`],[ve,`table`],[ft,`stories`],[ut,`warning`],[ae,`flask`],[c,`folder`],[D,`folder`],[Ie,`folder`],[n,`folder`],[T,`visual`],[k,`branch`],[x,`branch`],[N,`web`],[ht,`feature`],[r,`wrench`],[se,`pulse`],[h,`history`],[f,`screenshot`],[b,`screenshot`],[Ze,`screenshot`],[ee,`inbox`],[le,`info`],[V,`key`],[M,`desktop`],[t,`layers`],[Ce,`board`],[He,`info`],[Qe,`sparkle`],[Ge,`stories`],[ye,`layers`],[be,`key`],[Je,`mail`],[ze,`web`],[De,`chat`],[pe,`stories`],[ot,`chat`],[pt,`mic`],[dt,`desktop`],[F,`mobile`],[L,`network`],[s,`replay`],[o,`palette`],[O,`coins`],[l,`replay`],[g,`plug`],[ne,`plug`],[oe,`replay`],[p,`rocket`],[d,`route`],[Xe,`visual`],[y,`scroll`],[de,`mail`],[j,`server`],[we,`feature`],[nt,`shield`],[Ue,`route`],[$e,`mobile`],[Me,`sparkle`],[ge,`sparkle`],[Le,`board`],[xe,`terminal`],[Be,`table`],[Ae,`mobile`],[me,`terminal`],[st,`ticket`],[mt,`history`],[lt,`warning`],[Fe,`coins`],[C,`wand`],[w,`wand`],[u,`plug`],[_,`network`],[re,`wrench`],[Re,`bell`],[ke,`bell`],[ue,`route`]]);function Dt({icon:e,size:t=16,className:n,label:r}){let i=Et.get(e);if(i){let e=yt(i);if(e)return(0,G.jsx)(vt,{src:e,name:i,px:t+2,alt:r||``,className:n})}return(0,G.jsx)(e,{size:t,strokeWidth:1.8,"aria-hidden":!r||void 0,"aria-label":r,className:n})}var Ot={idle:[`default`,`blink`],working:[`default`,`gyro`],reasoning:[`default`,`twins`],searching:[`default`,`lighthouse`],background:[`default`,`spiral`],retrying:[`default`,`surge`],compacting:[`default`,`squeeze`,`fuse`],waiting:[`default`],using:[`default`,`tap`,`scroll`,`type`,`zoom`,`snap`,`record`]},K=Math.PI*2,kt=Math.PI*(3-Math.sqrt(5)),q=e=>(1-Math.cos(Math.PI*e))/2,J=e=>{let t=Math.sin(e*127.1)*43758.5453;return t-Math.floor(t)},At=(e,t)=>(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2,jt=(e,t,n)=>{let r=[],i=[],a=e[t];for(let o=0;o<e.length;o++){if(o===t)continue;let s=At(a,e[o]),c=r.length;if(c===n){if(s>=i[n-1])continue;c--}for(;c>0&&i[c-1]>s;)r[c]=r[c-1],i[c]=i[c-1],c--;r[c]=o,i[c]=s}return r},Mt={idle:6500,"idle-blink":13e3,working:3e3,"working-gyro":3e3,reasoning:6500,"reasoning-twins":6500,searching:13e3,"searching-lighthouse":13e3,background:13e3,"background-spiral":13e3,retrying:13e3,"retrying-surge":13e3,compacting:1e4,"compacting-squeeze":1e4,"compacting-fuse":1e4,waiting:13e3,using:13e3,"using-tap":13e3,"using-scroll":13e3,"using-type":13e3,"using-zoom":13e3,"using-snap":13e3,"using-record":13e3},Nt=new Map;function Pt(e,t,n){let r=Nt.get(e);return r||Nt.set(e,r={t:0,last:t}),t>r.last&&(r.t+=Math.min(t-r.last,100)*n,r.last=t),r.t}var Ft=e=>1-Math.exp(-4.5*e)*Math.cos(3*Math.PI*e)-e*Math.exp(-4.5);function It(e,t){let n=3200,r=Math.floor(e/n),i=e-r*n,a=1260*t,o=2200*t,s;if(i<2e3)s=i*t;else if(i<2200){let e=(i-2e3)/200;s=(2e3+200*(e-e*e/2))*t}else if(i<3e3)s=2100*t-a*Ft((i-2200)/800);else{let e=(i-3e3)/200;s=2100*t-a+100*e*e*t}return r*(o-a)+s}function Lt(e,t){if(e===`retrying`)return It(2*t,K/9e3);if(e===`retrying-surge`){let e=t/3250,n=e-Math.floor(e);return(Math.floor(e)+(1-(1-n)**3))*K}return e===`using-scroll`?.4:e===`using-snap`?(Math.floor(t/X)*dn+Math.min(t%X,dn))/Mt[e]*K:t/Mt[e]*K}var Rt=(()=>{let e=30*Math.PI/180,t=10*Math.PI/180;return[-Math.sin(t)*Math.cos(e),Math.cos(t)*Math.cos(e),Math.sin(e)]})(),zt=1.4,Bt=30*Math.PI/180,Vt=Math.PI/2,Ht=1800,Ut=.4,Wt=.6;function Gt(e){let t=e*2.45+J(e)*1.5,n=(15+30*J(e+.5))*Math.PI/180;return[Math.sin(n)*Math.cos(t),Math.sin(n)*Math.sin(t),Math.cos(n)]}function Kt(e){let t=Math.floor(e/Ht),n=e/Ht-t,r=n<Ut?(1-Math.cos(n/Ut*Math.PI))/2:1,i=Gt(t),a=Gt(t+1),o=i.map((e,t)=>e+(a[t]-e)*r),s=Math.hypot(o[0],o[1],o[2]);return o.map(e=>e/s)}var qt=.45,Jt=.5,Yt=600,Xt=e=>Gt(e+57),Zt=(e,t,n)=>{let r=e.map((e,r)=>e+(t[r]-e)*n),i=Math.hypot(r[0],r[1],r[2]);return r.map(e=>e/i)},Qt=(e,t)=>e<t?(1-(e/t)**2)**2:0,$t=1400;function en(e){let t=Math.floor(e/$t),n=e/$t-t;return{at:Zt(Xt(t),Xt(t+1),n<.35?q(n/.35):1),click:Xt(n<.5?t:t+1),since:(n<.5?n+.5:n-.5)*$t}}var tn=e=>e<60?e/60:Math.max(0,1-(e-60)/240)**2,nn=1,rn=[[0,0],[0,16],[4,12],[7,18],[9,17],[6,11],[11,11]].map(([e,t])=>[e/18*nn,t/18*nn]);function an(e,t,n){let r=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){let[o,s]=e[i],[c,l]=e[a];s>n!=l>n&&t<(c-o)*(n-s)/(l-s)+o&&(r=!r)}return r}var Y=[-.3,.5],on=(e,t)=>[e,t,Math.sqrt(Math.max(0,1-e*e-t*t))],sn=e=>on(Y[0]+.35*e[0],Y[1]+.35*e[1]),cn=1800;function ln(e,t){let n=e%cn/cn,r=n<.3?q(n/.3):n<.6?1:n<.85?1-q((n-.6)/.25):0,i=e=>on(Y[0]+.3*e*Math.cos(t),Y[1]+.3*e*Math.sin(t));return{at:i(r),click:i(1),since:(n<.45?n+.55:n-.45)*cn}}var un=2600,X=2600,dn=2100;function fn(e){let t=e%X-dn;return t<0?0:Math.exp(-t/220)}function pn(e){let t=e%X;return t<120?1.2*(1-q(t/120)):t<180?0:t<430?1.2*q((t-180)/250):1.2}var mn=1200,hn=e=>Math.abs(1-2*(e%mn/mn));function gn(e){let t=e%un/un;return t<.25?q(t/.25):t<.5?1:t<.75?1-q((t-.5)/.25):0}var _n=1500,vn=1.1;function yn(e){let t=Math.floor(e/_n),n=Math.min(1,(e/_n-t)/.75);return{by:(t+1-(1-n)**3)*vn,pace:(1-n)**2}}var bn={right:0,"up-right":45,up:90,"up-left":135,left:180,"down-left":225,down:270,"down-right":315},Z=[90,270,45,180,0,225].map(e=>e*Math.PI/180);function xn(e,t){let n=-Math.sin(e),r=Math.cos(e),i=Math.sin(t),a=Math.cos(t),o=1-a;return[a+n*n*o,n*r*o,r*i,n*r*o,a+r*r*o,-n*i,-r*i,n*i,a]}var Sn=(e,t)=>e.map((n,r)=>e[r-r%3]*t[r%3]+e[r-r%3+1]*t[r%3+3]+e[r-r%3+2]*t[r%3+6]),Q=[`xxxx xxx xx`,`xxxxx xx xxxx`,`xxx xxxxx`],Cn=.09,wn=.3,Tn=.33,En=-.5,$=(()=>{let e=0;return Q.flatMap((t,n)=>[...t].map((r,i)=>{let a={row:n,col:i,at:e};return e+=r===` `?200:i===t.length-1?350:70+60*J(n*31+i),a}))})(),Dn=Q.map((e,t)=>$.flatMap((e,n)=>e.row===t?[n]:[])),On=$[$.length-1].at,kn=On+1300;function An(e){let t=e%kn,n=0;for(;n<$.length&&$[n].at<=t;)n++;let r=n?t-$[n-1].at:1/0,i=$[n]??{row:Q.length-1,col:Q[Q.length-1].length},a=r<300?1:+(Math.floor(t/450)%2==0);return{n,since:r,blink:a,caret:[En+i.col*Cn,Tn-i.row*wn],fade:t<On+900?1:Math.max(0,1-(t-On-900)/300)}}var jn=220,Mn=5,Nn=24,Pn=16,Fn={mount:({make:e,pts:t})=>{let n=t.map(()=>e(`circle`)),r=new Uint8Array(t.length);return{dot(e,t,i,a,o){let s=n[e],c=o.toFixed(2);c===`0.00`&&r[e]||(r[e]=+(c===`0.00`),s.setAttribute(`cx`,t.toFixed(2)),s.setAttribute(`cy`,i.toFixed(2)),s.setAttribute(`r`,Math.max(.45,a).toFixed(2)),s.setAttribute(`fill-opacity`,c))}}}};function In(e){let t=(e,t)=>[Math.cos(e)*Math.cos(t),Math.sin(e),Math.cos(e)*Math.sin(t)],n=Math.sqrt(4*Math.PI/e),r=.6*n;return Array.from({length:8},(e,i)=>{let a=i?i&-i:8,o=Math.min(85*Math.PI/180,Math.acos(Math.min(1,n*8/(K*a)))),s=[];for(let e=-o+i*.618%1*r;e<=o;e+=r/Math.sqrt(1+Math.cos(e)**2))s.push(t(e,i/8*K-e));return s}).flat()}function Ln(e,t,n){return n?n.points(t,e):e===`background-spiral`?In(t):Array.from({length:t},(e,n)=>{let r=1-2*(n+.5)/t,i=Math.sqrt(1-r*r),a=n*kt;return[i*Math.cos(a),r,i*Math.sin(a)]})}function Rn(e,{state:t,variant:n,size:r=20,speed:i=1,label:a,shape:o,render:s=Fn,density:c=1,dotSize:l=1,tilt:u=20,direction:d}={}){let f=t===`base`?`idle`:t,p=f&&Object.hasOwn(Ot,f)?f:`idle`,m=n!=="default"&&Ot[p].includes(n??``)?`${p}-${n}`:p,h={width:r,height:r,viewBox:`0 0 ${r} ${r}`,fill:`currentColor`};for(let[t,n]of Object.entries(h))e.setAttribute(t,String(n));a?(e.setAttribute(`role`,`img`),e.setAttribute(`aria-label`,a),e.removeAttribute(`aria-hidden`)):(e.setAttribute(`aria-hidden`,`true`),e.removeAttribute(`role`),e.removeAttribute(`aria-label`));let g=m===`background`?1:m===`using`||m===`using-type`?Math.max(4,1e3/r):4,_=Math.max(8,Math.round(r*g*c)),v=typeof o==`function`?{points:o}:o,y=r/2,ee=y*.8*(v?.scale??1),te=(r/64)**.6*(.72*Math.sqrt(4/g))*l,b=Ln(m,_,v),ne=s.mount({make:t=>e.appendChild(document.createElementNS(`http://www.w3.org/2000/svg`,t)),pts:b,size:r,radius:te}),re=!!s.flat,x=(m===`reasoning`||m===`reasoning-twins`)&&b.length>1,S=m===`compacting`||m===`compacting-fuse`,C=x?b.map((e,t)=>jt(b,t,Nn)):[],w=Array.from({length:m===`reasoning-twins`?2:1},()=>[]),T=0,E={k:0,m:[1,0,0,0,1,0,0,0,1]},D=e=>{let t=Mt[m],n=Lt(m,e),i=m===`using-scroll`?yn(e):null,a=d&&bn[d],o=null;if(i&&a!==void 0)o=xn(a*Math.PI/180+Math.PI,i.by);else if(i){let t=Math.floor(e/_n);for(t<E.k&&(E={k:0,m:[1,0,0,0,1,0,0,0,1]});E.k<t;E.k++)E.m=Sn(xn(Z[E.k%Z.length],vn),E.m);o=Sn(xn(Z[t%Z.length],i.by-t*vn),E.m)}let s=m===`working-gyro`?e/5e3*K:null,c=((re?0:u)+(v?.tip??0)+(s===null?0:10*Math.cos(s)))*Math.PI/180,l=s===null?0:12*Math.sin(s)*Math.PI/180,f=Math.sin(l),p=Math.cos(l),h=Math.sin(n),g=Math.cos(n),_=Math.sin(c),D=Math.cos(c),O=e=>b[e][1]*_+(-b[e][0]*h+b[e][2]*g)*D,k=new Map;if(x){let t=e/jn,n=Math.floor(t),r=t-n;if(!w[0].length){let e=[...b.keys()].reduce((e,t)=>O(t)>O(e)?t:e,0),t=t=>O(t)+At(b[t],b[e]);w.forEach((n,r)=>n.push(r?[...b.keys()].reduce((e,n)=>t(n)>t(e)?n:e,0):e))}for(T=Math.max(T,n-Pn);T<n;T++)w.forEach((e,t)=>{let n=e.slice(-8),r=e[e.length-1],i=-1,a=-1/0,o=m===`reasoning-twins`?w[1-t].at(-1):void 0;C[r].forEach((e,r)=>{let s=o===void 0?0:1.2*Math.min(Math.sqrt(At(b[e],b[o])),.8),c=O(e)+.35*J(T*31+r+t*977)+s;!n.includes(e)&&c>a&&(a=c,i=e)}),e.push(i<0?C[r][0]:i),e.length>Pn&&e.shift()});let i=(e,t)=>e!==void 0&&k.set(e,Math.max(k.get(e)??0,t));for(let e of w)for(let t=4;t>=0;t--)i(e[e.length-1-t],t===0?q(Math.min(1,r*2)):1-(t-1+r)/Mn)}let A=e/2e3*K+n,j=K/2e3+K/t,M=e=>70*Math.PI/180*(1-2*(e%6e3/6e3)),ie=Math.min(1,3*Math.sin(Math.PI*(e%6e3/6e3))),N=m===`searching`?Kt(e):null,P=m===`working-gyro`?.5*Math.sin(e/2600*K):m===`compacting-squeeze`?Math.sin(e/2600*K):0,F=null;if(S){let t=e%2800/2800,n=(t-.7)/.3,r=m===`compacting-fuse`?(1-n)**3:n<.45?1-1.25*q(n/.45):n<.7?-.25*(1-(n-.45)/.25)**2:0;F={at:-1.15+2.3*Math.min(1,t/.7),hold:t<.7?1:r}}let I=null;m===`using-tap`&&(I=en(e));let L=m===`using`;if(L){let t=a===void 0?en(e):null;I=t?{...t,at:sn(t.at),click:sn(t.click)}:ln(e,(a??0)*Math.PI/180)}let ae=L&&I?1-.15*tn(I.since):1,R=m===`using-type`?An(e):null,oe=m===`using-zoom`?gn(e):null,se=m===`using-snap`?fn(e):null,z=m===`idle-blink`?pn(e):null,B=m===`using-record`?hn(e):null;b.forEach(([t,a,s],c)=>{let u=n+zt*P*a,[d,v]=P?[Math.sin(u),Math.cos(u)]:[h,g],b=-t*d+s*v,S=t*v+s*d,C=a*D-b*_,w=b,T=S*_,E=a*_+b*D;o&&([S,C,E]=[0,3,6].map(e=>o[e]*S+o[e+1]*C+o[e+2]*E));let O=(E+1)/2,V=(.5+1.4*O)*te,H=Math.max(0,(O-.3)/.7);if(N){let e=Math.acos(Math.min(1,(S*N[0]+C*N[1]+E*N[2])/Math.hypot(S,C,E))),t=e<Wt?(1-(e/Wt)**2)**2:0;H*=1-.55*(1-t),r<=24&&(V*=1+.5*t),t&&(S*=1+.12*t,C*=1+.12*t,S+=(S-N[0])*.35*t,C+=(C-N[1])*.35*t,V*=1+.9*t,H+=(1-H)*t)}if(F){let e=S,t=Math.min(1,Math.max(0,(F.at-e)/.2))*F.hold,n=m===`compacting`?1.5:1;if(S*=1-.2*n*t,C*=1-.2*n*t,V*=1-.3*n*t,m===`compacting-fuse`){H*=1-.5*t;let n=Math.exp(-(((e-F.at)/.08)**2))*Math.max(0,F.hold)*Math.min(1,O/.5);V*=1+.8*n,H+=(1-H)*n}}if(m===`working`){let t=e%1700,n=1.3-2.6*q(Math.min(1,t/1200)),r=re?C:S*Rt[0]+C*Rt[1]+E*Rt[2],i=t<1200?Math.exp(-(((r-n)/.2)**2)):0;V*=1+.6*i,H+=(1-H)*i;let a=Math.min(1,Math.max(0,(r-n)/.2))*(t<1200?1:1-Math.min(1,1.6*((t-1200)/800)));S*=1-.08*a,C*=1-.08*a,V*=1-.15*a}if(m===`searching-lighthouse`){H*=.5;let t=Math.sin(Bt),n=Math.cos(Bt),r=S*n-C*t,i=-_*(S*t+C*n)+D*E,a=((Math.atan2(r,i)-(e/2500%1*K-Math.PI)+Math.PI)%K+K)%K-Math.PI,o=(a<0?Math.max(0,1+a/Vt):Math.exp(-((a/.45)**2)))*(.25+.75*Math.min(1,Math.max(0,(O-.4)/.3)));V*=1+.6*o,H+=(1-H)*o}if(x){let e=k.get(c)??0;H*=.5,e&&(V*=1+.8*e,H+=(1-H)*e)}if(m===`waiting`){let n=Math.asin(a/(Math.hypot(t,a,s)||1)),r=Math.atan2(s,t),i=Math.atan2(Math.sin(r-A),Math.cos(r-A)),o=i*Math.cos(n),c=Math.exp(-(((n-M(e+i/j))/.28)**2))*Math.exp(-((o/(i*j>0?.12:1))**2)),l=ie*c**.6;H=H*.5+(1-H*.5)*l,V*=1+1.1*l}if(I){let e=Math.hypot(S,C,E)||1,t=t=>Math.acos(Math.min(1,Math.max(-1,(S*t[0]+C*t[1]+E*t[2])/e)));H*=L?.25:.5;let n=I.since,r=L?0:Qt(t(I.at),qt),i=t(I.click),a=tn(n),o=a*Qt(i,Jt),s=Math.min(1,n/Yt),c=Math.exp(-(((i-(.15+1.3*(1-(1-s)**2)))/.18)**2))*(1-s)**2;if(S*=1-.14*o,C*=1-.14*o,V*=(1-.35*o)*(1+.7*Math.max(c,r*(1-a))),H+=(1-H)*Math.max(r,c),L&&an(rn,(S-I.at[0])/ae,(I.at[1]-C)/ae)){let e=Math.min(1,Math.max(0,(O-.5)/.2));V*=1+.15*e,H+=(1-H)*e}}if(R){H*=.25;let e=Math.round((Tn-C)/wn),t=Math.floor((S-En)/Cn),n=Dn[e]?.[t],r=0;n!==void 0&&n<R.n&&Q[e][t]===`x`&&Math.abs(Tn-e*wn-C)<.085&&(r=.75+(n===R.n-1?.25*Math.exp(-R.since/120):0));let[i,a]=R.caret;Math.abs(C-a)<.1&&(r=Math.max(r,R.blink*Math.exp(-(((S-i)/.04)**2)))),H+=(1-H)*r*R.fade*Math.min(1,Math.max(0,(O-.5)/.2))}if(oe){let e=oe*Math.max(0,E);S*=1+.45*e,C*=1+.45*e,V*=1+.8*e,H*=Math.min(1,Math.max(0,(1.05-Math.hypot(S,C))/.1))}if(i&&(H*=.55+.45*i.pace),se!==null&&(H*=.55,V*=1+.25*se,H+=(1-H)*se),z!==null){let e=Math.exp(-(((Math.abs(C)-z)/.06)**2))*+(z<1.2);H*=Math.min(1,Math.max(0,(z-Math.abs(C))/.08)),V*=1+.4*e,H+=(1-H)*e*Math.min(1,Math.max(0,(O-.4)/.3))}B!==null&&(S*=.92+.08*B,C*=.92+.08*B,H*=.3+.7*B),l&&([S,C]=[S*p-C*f,S*f+C*p]),ne.dot(c,y+S*ee,y-C*ee,V,H,w,-T)}),ne.frame?.()},O=`${m}@${i}`;D(Pt(O,performance.now(),i));let k=matchMedia(`(prefers-reduced-motion: reduce)`).matches,A=!1,j=0,M=!1,ie=new IntersectionObserver(e=>A=e[e.length-1].isIntersecting);ie.observe(e);function N(e){A&&D(Pt(O,e,i)),j=requestAnimationFrame(N)}let P=()=>{cancelAnimationFrame(j),j=0},F=()=>{j||k||M||(j=requestAnimationFrame(N))};return F(),{pause:P,play:F,destroy(){M=!0,P(),ie.disconnect(),e.replaceChildren()}}}function zn({state:e,variant:t,size:n=20,speed:r=1,paused:i=!1,label:a,shape:o,render:s,density:c,dotSize:l,tilt:u,direction:d,className:f}){let p=(0,W.useRef)(null),m=(0,W.useRef)(null);(0,W.useEffect)(()=>(m.current=Rn(p.current,{state:e,variant:t,size:n,speed:r,label:a,shape:o,render:s,density:c,dotSize:l,tilt:u,direction:d})).destroy,[e,t,n,r,a,o,s,c,l,u,d]),(0,W.useEffect)(()=>{i?m.current.pause():m.current.play()},[i,e,t,n,r,a,o,s,c,l,u,d]);let h=a?{role:`img`,"aria-label":a}:{"aria-hidden":!0};return(0,G.jsx)(`svg`,{ref:p,width:n,height:n,viewBox:`0 0 ${n} ${n}`,fill:`currentColor`,className:f,...h})}var Bn={thinking:{state:`reasoning`},searching:{state:`searching`},reading:{state:`searching`,variant:`lighthouse`},working:{state:`working`},writing:{state:`working`,variant:`gyro`},browsing:{state:`using`,variant:`tap`},recording:{state:`using`,variant:`record`},handing:{state:`background`},retrying:{state:`retrying`},compacting:{state:`compacting`},waiting:{state:`waiting`},idle:{state:`idle`}};function Vn({state:e=`working`,label:t,px:n=16,className:r}){return(0,G.jsx)(zn,{...Bn[e],size:n,label:t,className:U(`block flex-none text-ink`,r)})}async function Hn(e,t=bt.open){let n=window.open(`about:blank`,`_blank`);try{let r=await t(e);if(r.kind===`download`){n?.close();let e=document.createElement(`a`);return e.href=r.url,e.download=r.name,e.click(),``}return n?(n.opener=null,n.location.href=r.url,``):`The browser blocked the new tab.`}catch(e){return n?.close(),e.message}}function Un({icon:e,title:t,children:n,action:r,center:i=!1,className:a}){return(0,G.jsxs)(`div`,{role:`status`,className:U(`flex flex-col gap-2 py-6`,i?`items-center text-center`:`items-start`,a),children:[e&&(0,G.jsx)(Dt,{icon:e,size:22,className:`mb-1 text-muted`}),t&&(0,G.jsx)(`p`,{className:`m-0 text-[16px] font-medium text-ink`,children:t}),n&&(0,G.jsx)(`div`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:n}),r&&(0,G.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:r})]})}var Wn={pass:`bg-pass-soft text-pass`,fail:`bg-fail-soft text-fail`,warn:`bg-warn-soft text-warn`,running:`bg-accent-soft text-accent-fg`,neutral:`bg-surface-strong text-ink-2`},Gn={pass:E,fail:ie,warn:lt};function Kn({tone:e,children:t,className:n,icon:r=!0,orb:i=`working`}){let a=r?Gn[e]:void 0,o=r&&e===`running`;return(0,G.jsxs)(`span`,{className:U(`inline-flex min-h-6 items-center gap-1 rounded-full px-2 text-xs font-medium whitespace-nowrap`,(a||o)&&`pl-2`,Wn[e],n),children:[o&&(0,G.jsx)(Vn,{state:i,px:16}),a&&(0,G.jsx)(a,{size:12,strokeWidth:2.5,"aria-hidden":`true`,className:`flex-none`}),t]})}function qn({id:e,label:t,value:n,onChange:r,placeholder:i,className:a}){return(0,G.jsxs)(`div`,{className:U(`relative min-w-0 w-full max-w-[320px] flex-[0_1_320px]`,a),children:[(0,G.jsx)(ce,{size:14,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-muted`}),(0,G.jsx)(`label`,{htmlFor:e,className:`sr-only`,children:t}),(0,G.jsx)(xt,{size:`sm`,id:e,type:`search`,value:n,onChange:e=>r(e.target.value),placeholder:i??t,className:`pl-8`})]})}function Jn({items:e,value:t,onChange:n}){return(0,G.jsx)(G.Fragment,{children:e.map(e=>(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.id,"data-tip":e.tip,onClick:()=>n(e.id),className:U(`inline-flex min-h-8 cursor-pointer items-center gap-1 rounded-[8px] border px-4 text-[13px] font-medium`,t===e.id?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line hover:text-ink`),children:[e.icon&&(0,G.jsx)(Dt,{icon:e.icon,size:14}),e.label,e.n!==void 0&&(0,G.jsx)(`span`,{className:U(`tabular-nums`,e.alert&&e.n?`text-fail`:``),children:e.n})]},e.id))})}function Yn({items:e,value:t,onChange:n,className:r}){return(0,G.jsx)(G.Fragment,{children:e.map(e=>{let i=t.includes(e.id);return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":i,"data-tip":e.title,onClick:()=>n(i?t.filter(t=>t!==e.id):[...t,e.id]),className:U(`inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-[8px] border px-4 text-[13px] font-medium`,i?`border-accent bg-accent-soft text-ink`:`border-transparent bg-surface-strong text-ink-2 hover:bg-line`,r),children:[i&&(0,G.jsx)(E,{size:14,"aria-hidden":`true`}),e.label,e.note&&(0,G.jsx)(`span`,{className:U(`text-[13px] font-normal`,e.noteClass),children:e.note})]},e.id)})})}function Xn({page:e,size:t,total:n,onPage:r,label:i,children:a}){let o=Math.max(1,Math.ceil(n/t));return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 border-t border-line-soft px-4 py-2 text-[13px] text-muted`,children:[(0,G.jsxs)(`span`,{className:`flex-1`,children:[n?`${e*t+1}–${Math.min(n,e*t+t)} of ${n}`:`None`,a]}),o>1&&(0,G.jsxs)(`nav`,{"aria-label":i,className:`flex items-center gap-1`,children:[(0,G.jsx)(Tt,{size:`sm`,variant:`ghost`,disabled:e===0,onClick:()=>r(e-1),"aria-label":`Previous page`,"data-tip":`Previous page`,children:(0,G.jsx)(Pe,{"aria-hidden":`true`})}),(0,G.jsxs)(`span`,{className:`px-1 tabular-nums`,children:[`Page `,e+1,` of `,o]}),(0,G.jsx)(Tt,{size:`sm`,variant:`ghost`,disabled:e>=o-1,onClick:()=>r(e+1),"aria-label":`Next page`,"data-tip":`Next page`,children:(0,G.jsx)(S,{"aria-hidden":`true`})})]})]})}export{Kn as a,Vn as c,Tt as d,wt as f,qn as i,Dt as l,Xn as n,Un as o,Yn as r,Hn as s,Jn as t,Et as u};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Hr as n}from"./route-Dg53WdFu.js";import{t as r}from"./jsx-runtime-LKYXHABd.js";import{A as i}from"./input-D7iHeNXz.js";import{zn as a}from"./index-CljX5dI4.js";var o=e(n(),1),s=r();function c({title:e,children:n,defaultOpen:r}){let[c,l]=(0,o.useState)(!!r),u=(0,o.useId)();return(0,s.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,s.jsxs)(`button`,{type:`button`,"aria-expanded":c,"aria-controls":u,onClick:()=>l(!c),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,s.jsx)(t,{size:15,"aria-hidden":`true`,className:i(`transition-transform`,c&&`rotate-180`)}),e]}),(0,s.jsx)(a,{open:c,id:u,children:n})]})}export{c as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./route-Dg53WdFu.js";import{l as t}from"./agents-C0Jg2pN8.js";import{t as n}from"./jsx-runtime-LKYXHABd.js";import{i as r,nn as i,o as a}from"./index-CljX5dI4.js";var o=n();function s({tab:n,wide:s,action:c,agentBody:l,children:u}){let d=t(`migration`);return(0,o.jsx)(r,{title:i(`migration`),page:d,label:`Migration`,current:n,onPick:t=>location.hash=t===`agent`?e(`migration`):e(`migration`,`migrations`),tabs:[{id:`migrations`,label:`Migrations`}],below:(0,o.jsx)(a,{page:d}),...l===void 0?{}:{agentBody:l},...s?{wide:s}:{},...c?{end:c}:{},children:u})}export{s as t};