@testver/testver 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +3 -1
  2. package/bin/testver.js +1 -1
  3. package/dist/index.js +770 -391
  4. package/package.json +2 -1
  5. package/src/ui/static/assets/{AIPanel-D09Ni3a4.js → AIPanel-B_R-CbrF.js} +2 -2
  6. package/src/ui/static/assets/{AIRecordPanel-DZtUZnRe.js → AIRecordPanel-BRQWIU5h.js} +3 -3
  7. package/src/ui/static/assets/{AIStreamUI-BsxKziYG.js → AIStreamUI-C3D989_6.js} +3 -3
  8. package/src/ui/static/assets/{AITestGenPage-Cg21-P1W.js → AITestGenPage-D3t2gPAA.js} +5 -5
  9. package/src/ui/static/assets/{APITestingPage-Cdc8EZz2.js → APITestingPage-Cmwkiiys.js} +1 -1
  10. package/src/ui/static/assets/{AboutPage-yJLCr2_q.js → AboutPage-CjEqKB-q.js} +1 -1
  11. package/src/ui/static/assets/AdvancedPage-4kAcpE8Y.js +3 -0
  12. package/src/ui/static/assets/{AnalyticsPage-gTPFsiLZ.js → AnalyticsPage-64mYNK2v.js} +1 -1
  13. package/src/ui/static/assets/{AuditLogPage-DE45E_PV.js → AuditLogPage-BQjOzQje.js} +1 -1
  14. package/src/ui/static/assets/{ChangesSummary-C-7oi_sx.js → ChangesSummary-CY_Vb27i.js} +2 -2
  15. package/src/ui/static/assets/{CodeMapPage-DgU6ZYBO.js → CodeMapPage-B1ezmnlE.js} +3 -3
  16. package/src/ui/static/assets/{ConfirmDialog-DNU3qoAP.js → ConfirmDialog-t7mpeeSN.js} +1 -1
  17. package/src/ui/static/assets/{CoveragePage-BpTjgcdV.js → CoveragePage-YMmCbiBk.js} +2 -2
  18. package/src/ui/static/assets/{CronBuilder-DsnX-vRr.js → CronBuilder-Nk-K-_8I.js} +1 -1
  19. package/src/ui/static/assets/Dashboard-BDVxO2V4.js +1 -0
  20. package/src/ui/static/assets/{DefectsPage-BtMNbq6Z.js → DefectsPage-l8yGeCyR.js} +1 -1
  21. package/src/ui/static/assets/{DiffViewer-DPglzjPH.js → DiffViewer-BIU09a_i.js} +1 -1
  22. package/src/ui/static/assets/{EmptyState-BH_aDO0P.js → EmptyState-D1T3JWUr.js} +1 -1
  23. package/src/ui/static/assets/{ExportButton-Ce_MxnM1.js → ExportButton-Dt5RhL-h.js} +1 -1
  24. package/src/ui/static/assets/{FileViewer-iYL0lxyY.js → FileViewer-CrKgh_cB.js} +5 -5
  25. package/src/ui/static/assets/{GitPage-CQqV8JBC.js → GitPage-_4nCEzkJ.js} +5 -5
  26. package/src/ui/static/assets/{ImportExportPage-DXk7Koaq.js → ImportExportPage-BcR7IQi9.js} +1 -1
  27. package/src/ui/static/assets/{JiraPushDialog-CqftoLh8.js → JiraPushDialog-C2sP4_4h.js} +1 -1
  28. package/src/ui/static/assets/KpiTile-inmeEsy3.js +1 -0
  29. package/src/ui/static/assets/{LiveExecutionView-BD0wE8sz.js → LiveExecutionView-D5BRe9jq.js} +1 -1
  30. package/src/ui/static/assets/{MediaModal-DiSINwmh.js → MediaModal-C5n6sHYi.js} +1 -1
  31. package/src/ui/static/assets/{MobileRunPicker-BNs2lZFf.js → MobileRunPicker-0h-N2c6d.js} +1 -1
  32. package/src/ui/static/assets/{MobileRunTarget-D2Nqcj10.js → MobileRunTarget-Bo_xekig.js} +1 -1
  33. package/src/ui/static/assets/{ModuleExplorer-BmkoQrHb.js → ModuleExplorer-VGcmK167.js} +1 -1
  34. package/src/ui/static/assets/{OutputPage-Dcsr7cmr.js → OutputPage-B_1nPPxE.js} +1 -1
  35. package/src/ui/static/assets/PipelinesPanel-PmmPu8pj.js +1 -0
  36. package/src/ui/static/assets/{ProfilePage-ByshrcwC.js → ProfilePage-y7tJNNFd.js} +1 -1
  37. package/src/ui/static/assets/{ProjectExplorer-B9B___ij.js → ProjectExplorer-DbfGhRq0.js} +1 -1
  38. package/src/ui/static/assets/{RemoteFileStrip-DbPnaZ-v.js → RemoteFileStrip-WuRKtx_h.js} +1 -1
  39. package/src/ui/static/assets/ReportCard-G52Q6-2i.js +2 -0
  40. package/src/ui/static/assets/ReportFullView-Bt8UFP2J.js +1 -0
  41. package/src/ui/static/assets/ReportsPage-DMtDi73Q.js +48 -0
  42. package/src/ui/static/assets/ResultsPage-BI9jpK2N.js +115 -0
  43. package/src/ui/static/assets/RunState-ifC4zi6M.js +1 -0
  44. package/src/ui/static/assets/{RunTargets-C7Vqd4TU.js → RunTargets-C7vpCbck.js} +1 -1
  45. package/src/ui/static/assets/{ScriptMappingPage-BrANeHv0.js → ScriptMappingPage-7vHuvhQw.js} +1 -1
  46. package/src/ui/static/assets/{SearchableDevicePicker-CFJ_DUAA.js → SearchableDevicePicker-BYxYJNWl.js} +1 -1
  47. package/src/ui/static/assets/{SettingsPage-BwOiebKG.js → SettingsPage-DSISg7r7.js} +1 -1
  48. package/src/ui/static/assets/SharedReportView-BOqKGJmR.js +1 -0
  49. package/src/ui/static/assets/{SourcesPage-C_QVQwiA.js → SourcesPage-CgqtYGBi.js} +1 -1
  50. package/src/ui/static/assets/TestExplorerPage-gYLhCD4d.js +7 -0
  51. package/src/ui/static/assets/{TestManagementPage-Ch4PthuU.js → TestManagementPage-wqYTKP7W.js} +2 -2
  52. package/src/ui/static/assets/TestPlansPage-DOKX9p6z.js +5 -0
  53. package/src/ui/static/assets/{TestverCreditsRing-CUsMGEe3.js → TestverCreditsRing-DpMzl3h7.js} +1 -1
  54. package/src/ui/static/assets/{UncommittedDiffViewer-B5HSURk8.js → UncommittedDiffViewer-BxS0zi-p.js} +1 -1
  55. package/src/ui/static/assets/{UserManagementPage-BjY3ftxf.js → UserManagementPage-B5d0uDU_.js} +2 -2
  56. package/src/ui/static/assets/{WorkflowsPage-BUu-LjZ8.js → WorkflowsPage-Bk0DFnFS.js} +17 -17
  57. package/src/ui/static/assets/{hiddenLlmProviders-setxgY_B.js → hiddenLlmProviders-CdhhNa5G.js} +1 -1
  58. package/src/ui/static/assets/index-BYVxKLrT.js +47 -0
  59. package/src/ui/static/assets/index-C2KJt7SI.css +1 -0
  60. package/src/ui/static/assets/reportMeta-AKcU_qwq.js +1 -0
  61. package/src/ui/static/assets/{useFeatureFlags-DqhngqgG.js → useFeatureFlags-DNkIctil.js} +1 -1
  62. package/src/ui/static/assets/{useJiraConnector-TM1Rfj1s.js → useJiraConnector-D5ysBBvz.js} +1 -1
  63. package/src/ui/static/assets/{useOwnership-eW6Egd7X.js → useOwnership-U0AfKBRo.js} +1 -1
  64. package/src/ui/static/assets/{useSuites-CvtMGakZ.js → useSuites-DyfN9HVv.js} +1 -1
  65. package/src/ui/static/assets/{useTestExplorer-HqvURJAc.js → useTestExplorer-DT8frjCK.js} +1 -1
  66. package/src/ui/static/assets/{useTestLifecycle-CL7-zz0Q.js → useTestLifecycle-OcwQaB1s.js} +1 -1
  67. package/src/ui/static/assets/{useTestManagement-ZTA1_VUm.js → useTestManagement-Xm4Bcx3u.js} +2 -2
  68. package/src/ui/static/assets/useTestResults-D5EwGIX9.js +1 -0
  69. package/src/ui/static/assets/{vendor-icons-B0wLOBoh.js → vendor-icons-BKPiFyYV.js} +1 -1
  70. package/src/ui/static/index.html +3 -3
  71. package/src/ui/static/assets/AdvancedPage-DB-6sJ6s.js +0 -3
  72. package/src/ui/static/assets/Dashboard-DRWbVyTb.js +0 -1
  73. package/src/ui/static/assets/PipelinesPanel-CMMXCSda.js +0 -1
  74. package/src/ui/static/assets/ReportCard-BbNfk85h.js +0 -2
  75. package/src/ui/static/assets/ReportFullView-Cg1rggho.js +0 -1
  76. package/src/ui/static/assets/ReportsPage-CFv3OAhe.js +0 -48
  77. package/src/ui/static/assets/ResultsPage-B4LwZH-R.js +0 -115
  78. package/src/ui/static/assets/SharedReportView-BAbW1WOs.js +0 -1
  79. package/src/ui/static/assets/TestExplorerPage-BRRWtwde.js +0 -7
  80. package/src/ui/static/assets/TestPlansPage-Bno2vpGd.js +0 -5
  81. package/src/ui/static/assets/index-B0klHYbO.css +0 -1
  82. package/src/ui/static/assets/index-DtBWNlVD.js +0 -47
  83. package/src/ui/static/assets/useTestResults-Bm-JyMhB.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DtBWNlVD.js","assets/vendor-react-CTbHBddL.js","assets/vendor-query-BrzmPFT3.js","assets/vendor-icons-B0wLOBoh.js","assets/index-B0klHYbO.css"])))=>i.map(i=>d[i]);
2
- import{gM as m,gN as l,gO as q,gP as d,gQ as K,gR as T,gS as f,gT as v,gU as p,gV as Q,b4 as C,gW as S,gX as M,gY as h,gZ as F,g_ as g,g$ as b,bP as D,cV as x,h0 as G,h1 as R,cW as A,cP as k,h2 as E,h3 as U,h4 as P,h5 as _,h6 as B,h7 as L,h8 as H,h9 as w,ha as V,hb as O,b$ as W,hc as X,cX as Y,hd as $,he as j,hf as z,hg as J,hh as N,hi as Z,hj as I,hk as ee,c0 as te,hl as se,c1 as ae,hm as ne,hn as ue,ho as ie,hp as re,hq as ce,hr as ye,hs as oe,ht as me,hu as le,hv as qe,hw as de,hx as Ke,bQ as Te,hy as fe,hz as ve,hA as pe,hB as Qe,hC as Ce,hD as Se,hE as Me,hF as he,hG as Fe,hH as ge,hI as be,hJ as De,hK as xe,hL as Ge,hM as Re,hN as Ae,hO as ke,hP as Ee,hQ as Ue,hR as Pe,hS as _e,hT as Be,hU as Le,hV as He,hW as we,hX as Ve,hY as Oe,hZ as We,h_ as Xe,h$ as Ye,i0 as $e,i1 as je,i2 as ze,i3 as Je,i4 as Ne,i5 as Ze,i6 as Ie,i7 as et,i8 as tt,i9 as st,ia as at,ib as nt}from"./index-DtBWNlVD.js";import{u as i,a as u,c as n}from"./vendor-query-BrzmPFT3.js";const a={folders:["tm-folders"],folderTree:["tm-folder-tree"],testCases:e=>["tm-test-cases",e],testCase:e=>["tm-test-case",e],steps:e=>["tm-steps",e],tags:["tm-tags"],customFields:["tm-custom-fields"],versions:e=>["tm-versions",e],mapping:e=>["tm-mapping",e],allMappings:["tm-all-mappings"],stats:["tm-stats"],plans:e=>["tm-plans",e],plan:e=>["tm-plan",e],planTestCases:e=>["tm-plan-test-cases",e],cycles:e=>["tm-cycles",e],cycle:e=>["tm-cycle",e],cycleExecutions:(e,t)=>["tm-cycle-executions",e,t],execution:e=>["tm-execution",e],stepResults:e=>["tm-step-results",e],cycleAnalytics:e=>["tm-cycle-analytics",e],executionHistory:e=>["tm-execution-history",e],mappingDashboard:()=>["tm-mapping-dashboard"],unmappedTestCases:()=>["tm-unmapped-test-cases"],mappedTestCases:()=>["tm-mapped-test-cases"],mappingsByStatus:e=>["tm-mappings-by-status",e],mappingSearch:e=>["tm-mapping-search",e],requirements:e=>["tm-requirements",e],requirement:e=>["tm-requirement",e],requirementTestCases:e=>["tm-requirement-test-cases",e],testCaseRequirements:e=>["tm-test-case-requirements",e],traceabilityMatrix:()=>["tm-traceability-matrix"],coverageStats:()=>["tm-coverage-stats"],executionAnalytics:()=>["tm-execution-analytics"],healthScore:()=>["tm-health-score"],orphans:()=>["tm-orphans"],defects:e=>["tm-defects",e],defect:e=>["tm-defect",e],defectStats:()=>["tm-defect-stats"],qualityGates:()=>["tm-quality-gates"],qualityGate:e=>["tm-quality-gate",e],webhooks:()=>["tm-webhooks"],attachments:e=>["tm-attachments",e],referenceLinks:e=>["tm-reference-links",e],sources:e=>["tm-sources",e],source:e=>["tm-source",e],sourceTestCases:e=>["tm-source-test-cases",e],testCaseSources:e=>["tm-test-case-sources",e],sourceCoverage:()=>["tm-source-coverage"]};function rt(){return i({queryKey:a.folderTree,queryFn:T})}function ct(){const e=u();return n({mutationFn:t=>f(t),onSuccess:()=>{e.invalidateQueries({queryKey:a.folderTree})}})}function yt(){const e=u();return n({mutationFn:({id:t,data:s})=>oe(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:a.folderTree})}})}function ot(){const e=u();return n({mutationFn:t=>v(t),onSuccess:()=>{e.invalidateQueries({queryKey:a.folderTree}),e.invalidateQueries({queryKey:["tm-test-cases"]})}})}function mt(e,t){return i({queryKey:a.testCases(e),queryFn:()=>S(e)})}function lt(e){return i({queryKey:a.testCase(e),queryFn:()=>D(e),enabled:!!e})}function qt(){const e=u();return n({mutationFn:t=>me(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree})}})}function dt(){const e=u();return n({mutationFn:({id:t,data:s})=>le(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.testCase(s.id)}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree})}})}function Kt(){const e=u();return n({mutationFn:t=>M(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree}),e.invalidateQueries({queryKey:["tm-tags"]})}})}function Tt(){const e=u();return n({mutationFn:t=>h(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree}),e.invalidateQueries({queryKey:["tm-tags"]})}})}function ft(){const e=u();return n({mutationFn:({ids:t,folderId:s})=>F(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.folderTree})}})}function vt(){const e=u();return n({mutationFn:({ids:t,reviewStatus:s})=>g(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:["tm-stats"]})}})}function pt(){const e=u();return n({mutationFn:({ids:t,tagIds:s})=>b(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]})}})}function Qt(e){return i({queryKey:a.steps(e),queryFn:()=>Te(e),enabled:!!e})}function Ct(){const e=u();return n({mutationFn:({testCaseId:t,steps:s})=>qe(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.steps(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function St(){return i({queryKey:a.tags,queryFn:p})}function Mt(){const e=u();return n({mutationFn:t=>Ke(t),onSuccess:()=>{e.invalidateQueries({queryKey:a.tags})}})}function ht(){const e=u();return n({mutationFn:({testCaseId:t,tagIds:s})=>de(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.testCase(s.testCaseId)}),e.invalidateQueries({queryKey:a.tags})}})}function Ft(e){return i({queryKey:a.versions(e),queryFn:()=>fe(e),enabled:!!e})}function gt(){const e=u();return n({mutationFn:({testCaseId:t,versionId:s,changedBy:r})=>Je(t,typeof s=="string"?parseInt(s,10):s,r),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.testCase(s.testCaseId)}),e.invalidateQueries({queryKey:a.versions(s.testCaseId)}),e.invalidateQueries({queryKey:["tm-test-cases"]})}})}function bt(e){return i({queryKey:a.mapping(e),queryFn:()=>ve(e),enabled:!!e})}function Dt(){return i({queryKey:a.stats,queryFn:Q})}function xt(e){return i({queryKey:a.plans(e),queryFn:()=>x(e)})}function Gt(e){return i({queryKey:a.plan(e),queryFn:()=>G(e),enabled:!!e})}function Rt(){const e=u();return n({mutationFn:t=>ke(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plans"]})}})}function At(){const e=u();return n({mutationFn:({id:t,data:s})=>Ee(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function kt(){const e=u();return n({mutationFn:t=>U(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plans"]})}})}function Et(e){return i({queryKey:a.planTestCases(e),queryFn:()=>R(e),enabled:!!e})}function Ut(){const e=u();return n({mutationFn:({planId:t,testCaseIds:s,addedBy:r})=>_e(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plan"]}),e.invalidateQueries({queryKey:["tm-plan-test-cases"]})}})}function Pt(){const e=u();return n({mutationFn:({planId:t,testCaseIds:s})=>P(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plan"]}),e.invalidateQueries({queryKey:["tm-plan-test-cases"]})}})}function _t(e){return i({queryKey:a.cycles(e),queryFn:()=>A(e),enabled:!!e})}function Bt(e){return i({queryKey:a.cycle(e),queryFn:()=>k(e),enabled:!!e})}function Lt(){const e=u();return n({mutationFn:({planId:t,data:s})=>Ue(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function Ht(){const e=u();return n({mutationFn:({id:t,data:s})=>Pe(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-cycle"]})}})}function wt(){const e=u();return n({mutationFn:t=>_(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function Vt(){const e=u();return n({mutationFn:({cycleId:t,data:s})=>L(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]})}})}function Ot(e,t){return i({queryKey:a.cycleExecutions(e,t),queryFn:()=>E(e,t),enabled:!!e})}function Wt(){const e=u();return n({mutationFn:({id:t,data:s})=>B(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-execution"]}),e.invalidateQueries({queryKey:["tm-cycle"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-cycle-analytics"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function Xt(e){return i({queryKey:a.stepResults(e),queryFn:()=>be(e),enabled:!!e})}function Yt(){const e=u();return n({mutationFn:({id:t,data:s})=>De(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-step-results"]}),e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycle"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function $t(){const e=u();return n({mutationFn:({executionId:t,status:s,executedBy:r})=>xe(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-step-results"]}),e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-cycle-analytics"]})}})}function jt(e){return i({queryKey:a.cycleAnalytics(e),queryFn:()=>Ge(e),enabled:!!e})}function zt(e){return i({queryKey:a.executionHistory(e),queryFn:()=>Ce(e),enabled:!!e})}function Jt(){return i({queryKey:["tm-execution-dots"],queryFn:()=>C(()=>import("./index-DtBWNlVD.js").then(e=>e.iF),__vite__mapDeps([0,1,2,3,4])).then(e=>e.tmGetExecutionDots())})}function Nt(){return i({queryKey:a.mappingDashboard(),queryFn:()=>$()})}function Zt(){return i({queryKey:a.unmappedTestCases(),queryFn:()=>z()})}function It(){return i({queryKey:a.mappedTestCases(),queryFn:()=>j()})}function es(){const e=u();return n({mutationFn:t=>J(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-unmapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]})}})}function ts(){const e=u();return n({mutationFn:t=>N(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-unmapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]})}})}function ss(){const e=u();return n({mutationFn:()=>Z(),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]}),e.invalidateQueries({queryKey:["tm-mappings-by-status"]})}})}function as(){const e=u();return n({mutationFn:({testCaseId:t,syncStatus:s,scriptHash:r})=>I(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]}),e.invalidateQueries({queryKey:["tm-mappings-by-status"]})}})}function ns(){const e=u();return n({mutationFn:t=>ee(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:["tm-stats"]}),e.invalidateQueries({queryKey:["tm-sources"]}),e.invalidateQueries({queryKey:["tm-requirements"]}),e.invalidateQueries({queryKey:["tm-traceability"]}),e.invalidateQueries({queryKey:["tm-coverage"]})}})}function us(e){return i({queryKey:a.requirements(e),queryFn:()=>Be(e)})}function is(){const e=u();return n({mutationFn:t=>st(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirements"]})}})}function rs(){const e=u();return n({mutationFn:({id:t,data:s})=>at(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirements"]}),e.invalidateQueries({queryKey:["tm-requirement"]})}})}function cs(){const e=u();return n({mutationFn:t=>Le(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirements"]})}})}function ys(e){return i({queryKey:a.requirementTestCases(e),queryFn:()=>et(e),enabled:!!e})}function os(){const e=u();return n({mutationFn:({reqId:t,testCaseIds:s})=>nt(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirement"]}),e.invalidateQueries({queryKey:["tm-requirement-test-cases"]}),e.invalidateQueries({queryKey:["tm-traceability-matrix"]}),e.invalidateQueries({queryKey:["tm-coverage-stats"]})}})}function ms(){const e=u();return n({mutationFn:({reqId:t,testCaseIds:s})=>tt(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirement"]}),e.invalidateQueries({queryKey:["tm-requirement-test-cases"]}),e.invalidateQueries({queryKey:["tm-traceability-matrix"]}),e.invalidateQueries({queryKey:["tm-coverage-stats"]})}})}function ls(){return i({queryKey:a.traceabilityMatrix(),queryFn:()=>we()})}function qs(){return i({queryKey:a.coverageStats(),queryFn:()=>Ve()})}function ds(){return i({queryKey:a.executionAnalytics(),queryFn:()=>Xe()})}function Ks(){return i({queryKey:a.healthScore(),queryFn:()=>We()})}function Ts(){return i({queryKey:a.orphans(),queryFn:()=>Oe()})}function fs(){return i({queryKey:["tm-source-traceability"],queryFn:()=>He()})}function vs(e){return i({queryKey:a.defects(e),queryFn:()=>te(e)})}function ps(){return i({queryKey:a.defectStats(),queryFn:()=>se()})}function Qs(){const e=u();return n({mutationFn:t=>ae(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]})}})}function Cs(){const e=u();return n({mutationFn:({id:t,data:s})=>ne(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function Ss(){const e=u();return n({mutationFn:t=>ue(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]})}})}function Ms(){const e=u();return n({mutationFn:({executionId:t,createdBy:s})=>X(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]})}})}function hs(){const e=u();return n({mutationFn:({id:t,status:s,performedBy:r})=>ie(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function Fs(e){return i({queryKey:["tm-defect-activity",e],queryFn:()=>Ye(e),enabled:!!e})}function gs(e){return i({queryKey:["tm-defect-comments",e],queryFn:()=>$e(e),enabled:!!e})}function bs(){const e=u();return n({mutationFn:({defectId:t,content:s,author:r})=>je(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defect-comments"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function Ds(){const e=u();return n({mutationFn:({defectId:t,commentId:s,deletedBy:r})=>ze(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defect-comments"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function xs(){return n({mutationFn:e=>re(e)})}function Gs(){const e=u();return n({mutationFn:t=>ce(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:["tm-stats"]})}})}function Rs(e){return i({queryKey:a.attachments(e||""),queryFn:()=>pe(e),enabled:!!e})}function As(){const e=u();return n({mutationFn:({testCaseId:t,data:s})=>Me(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.attachments(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function ks(){const e=u();return n({mutationFn:({id:t,testCaseId:s})=>he(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.attachments(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function Es(e){return i({queryKey:["tm-execution-attachments",e],queryFn:()=>Ne(e),enabled:!!e})}function Us(){const e=u();return n({mutationFn:({executionId:t,data:s})=>Ze(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["tm-execution-attachments",s.executionId]})}})}function Ps(){const e=u();return n({mutationFn:({id:t})=>Ie(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["tm-execution-attachments",s.executionId]})}})}function _s(e){return i({queryKey:a.referenceLinks(e||""),queryFn:()=>Qe(e),enabled:!!e})}function Bs(){const e=u();return n({mutationFn:({testCaseId:t,data:s})=>Fe(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.referenceLinks(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function Ls(){const e=u();return n({mutationFn:({id:t,testCaseId:s})=>ge(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.referenceLinks(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function Hs(e){return i({queryKey:a.sources(e),queryFn:()=>m(e)})}function ws(){return i({queryKey:["tm-sources-with-test-cases"],queryFn:()=>K()})}function Vs(){const e=u();return n({mutationFn:t=>l(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-sources"]})}})}function Os(){const e=u();return n({mutationFn:({id:t,data:s})=>q(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-sources"]}),e.invalidateQueries({queryKey:["tm-source"]})}})}function Ws(){const e=u();return n({mutationFn:t=>d(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-sources"]})}})}function Xs(e){return i({queryKey:a.sourceTestCases(e||""),queryFn:()=>ye(e),enabled:!!e})}function Ys(e){return i({queryKey:a.testCaseSources(e||""),queryFn:()=>Se(e),enabled:!!e})}function $s(){const e=u();return n({mutationFn:t=>H(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function js(){const e=u();return n({mutationFn:t=>w(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function zs(e,t){const s=!!(t!=null&&t.busy);return i({queryKey:["tm-cycle-automation-status",e],queryFn:()=>Y(e),enabled:!!e,refetchInterval:r=>{var c;const y=((c=r.state.data)==null?void 0:c.executions)??[];return s||y.some(o=>o.automationStatus==="running")?3e3:3e4}})}function Js(e,t){return i({queryKey:["tm-cycle-run-status",e],queryFn:()=>W(e),enabled:!!e&&t,refetchInterval:1500})}function Ns(){const e=u();return n({mutationFn:t=>V(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function Zs(){const e=u();return n({mutationFn:t=>O(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function Is(){return i({queryKey:["tm-cycle-run-settings"],queryFn:()=>Re(),staleTime:6e4})}function ea(){const e=u();return n({mutationFn:t=>Ae(t),onSuccess:t=>{e.setQueryData(["tm-cycle-run-settings"],t)}})}export{Ft as $,Lt as A,Ht as B,Ut as C,St as D,ws as E,mt as F,Es as G,Us as H,Ps as I,rt as J,ct as K,ot as L,Dt as M,Jt as N,Kt as O,Tt as P,ft as Q,vt as R,pt as S,lt as T,yt as U,qt as V,dt as W,Ct as X,ht as Y,Mt as Z,Qt as _,ea as a,bt as a0,Rs as a1,_s as a2,zt as a3,Ys as a4,As as a5,ks as a6,Bs as a7,Ls as a8,gt as a9,Qs as aA,Cs as aB,Ss as aC,hs as aD,Fs as aE,gs as aF,bs as aG,Ds as aH,Vs as aI,Os as aJ,Ws as aK,Xs as aL,Nt as aa,It as ab,Zt as ac,es as ad,ts as ae,ss as af,as as ag,Hs as ah,ns as ai,us as aj,cs as ak,fs as al,ls as am,qs as an,Ts as ao,ys as ap,ms as aq,is as ar,rs as as,os as at,xs as au,Gs as av,Ks as aw,ds as ax,vs as ay,ps as az,xt as b,Gt as c,Et as d,_t as e,Bt as f,Ot as g,kt as h,Pt as i,wt as j,Wt as k,Vt as l,$s as m,js as n,Ns as o,Zs as p,Js as q,Ms as r,zs as s,Xt as t,Is as u,Yt as v,$t as w,jt as x,Rt as y,At as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BYVxKLrT.js","assets/vendor-react-CTbHBddL.js","assets/vendor-query-BrzmPFT3.js","assets/vendor-icons-BKPiFyYV.js","assets/index-C2KJt7SI.css"])))=>i.map(i=>d[i]);
2
+ import{gM as m,gN as l,gO as q,gP as d,gQ as K,gR as T,gS as f,gT as v,gU as p,gV as Q,b4 as C,gW as S,gX as M,gY as h,gZ as F,g_ as g,g$ as b,bP as D,cV as x,h0 as G,h1 as R,cW as A,cP as k,h2 as E,h3 as U,h4 as P,h5 as _,h6 as B,h7 as L,h8 as H,h9 as w,ha as V,hb as O,b$ as W,hc as X,cX as Y,hd as $,he as j,hf as z,hg as J,hh as N,hi as Z,hj as I,hk as ee,c0 as te,hl as se,c1 as ae,hm as ne,hn as ue,ho as ie,hp as re,hq as ce,hr as ye,hs as oe,ht as me,hu as le,hv as qe,hw as de,hx as Ke,bQ as Te,hy as fe,hz as ve,hA as pe,hB as Qe,hC as Ce,hD as Se,hE as Me,hF as he,hG as Fe,hH as ge,hI as be,hJ as De,hK as xe,hL as Ge,hM as Re,hN as Ae,hO as ke,hP as Ee,hQ as Ue,hR as Pe,hS as _e,hT as Be,hU as Le,hV as He,hW as we,hX as Ve,hY as Oe,hZ as We,h_ as Xe,h$ as Ye,i0 as $e,i1 as je,i2 as ze,i3 as Je,i4 as Ne,i5 as Ze,i6 as Ie,i7 as et,i8 as tt,i9 as st,ia as at,ib as nt}from"./index-BYVxKLrT.js";import{u as i,a as u,c as n}from"./vendor-query-BrzmPFT3.js";const a={folders:["tm-folders"],folderTree:["tm-folder-tree"],testCases:e=>["tm-test-cases",e],testCase:e=>["tm-test-case",e],steps:e=>["tm-steps",e],tags:["tm-tags"],customFields:["tm-custom-fields"],versions:e=>["tm-versions",e],mapping:e=>["tm-mapping",e],allMappings:["tm-all-mappings"],stats:["tm-stats"],plans:e=>["tm-plans",e],plan:e=>["tm-plan",e],planTestCases:e=>["tm-plan-test-cases",e],cycles:e=>["tm-cycles",e],cycle:e=>["tm-cycle",e],cycleExecutions:(e,t)=>["tm-cycle-executions",e,t],execution:e=>["tm-execution",e],stepResults:e=>["tm-step-results",e],cycleAnalytics:e=>["tm-cycle-analytics",e],executionHistory:e=>["tm-execution-history",e],mappingDashboard:()=>["tm-mapping-dashboard"],unmappedTestCases:()=>["tm-unmapped-test-cases"],mappedTestCases:()=>["tm-mapped-test-cases"],mappingsByStatus:e=>["tm-mappings-by-status",e],mappingSearch:e=>["tm-mapping-search",e],requirements:e=>["tm-requirements",e],requirement:e=>["tm-requirement",e],requirementTestCases:e=>["tm-requirement-test-cases",e],testCaseRequirements:e=>["tm-test-case-requirements",e],traceabilityMatrix:()=>["tm-traceability-matrix"],coverageStats:()=>["tm-coverage-stats"],executionAnalytics:()=>["tm-execution-analytics"],healthScore:()=>["tm-health-score"],orphans:()=>["tm-orphans"],defects:e=>["tm-defects",e],defect:e=>["tm-defect",e],defectStats:()=>["tm-defect-stats"],qualityGates:()=>["tm-quality-gates"],qualityGate:e=>["tm-quality-gate",e],webhooks:()=>["tm-webhooks"],attachments:e=>["tm-attachments",e],referenceLinks:e=>["tm-reference-links",e],sources:e=>["tm-sources",e],source:e=>["tm-source",e],sourceTestCases:e=>["tm-source-test-cases",e],testCaseSources:e=>["tm-test-case-sources",e],sourceCoverage:()=>["tm-source-coverage"]};function rt(){return i({queryKey:a.folderTree,queryFn:T})}function ct(){const e=u();return n({mutationFn:t=>f(t),onSuccess:()=>{e.invalidateQueries({queryKey:a.folderTree})}})}function yt(){const e=u();return n({mutationFn:({id:t,data:s})=>oe(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:a.folderTree})}})}function ot(){const e=u();return n({mutationFn:t=>v(t),onSuccess:()=>{e.invalidateQueries({queryKey:a.folderTree}),e.invalidateQueries({queryKey:["tm-test-cases"]})}})}function mt(e,t){return i({queryKey:a.testCases(e),queryFn:()=>S(e)})}function lt(e){return i({queryKey:a.testCase(e),queryFn:()=>D(e),enabled:!!e})}function qt(){const e=u();return n({mutationFn:t=>me(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree})}})}function dt(){const e=u();return n({mutationFn:({id:t,data:s})=>le(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.testCase(s.id)}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree})}})}function Kt(){const e=u();return n({mutationFn:t=>M(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree}),e.invalidateQueries({queryKey:["tm-tags"]})}})}function Tt(){const e=u();return n({mutationFn:t=>h(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.stats}),e.invalidateQueries({queryKey:a.folderTree}),e.invalidateQueries({queryKey:["tm-tags"]})}})}function ft(){const e=u();return n({mutationFn:({ids:t,folderId:s})=>F(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:a.folderTree})}})}function vt(){const e=u();return n({mutationFn:({ids:t,reviewStatus:s})=>g(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:["tm-stats"]})}})}function pt(){const e=u();return n({mutationFn:({ids:t,tagIds:s})=>b(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]})}})}function Qt(e){return i({queryKey:a.steps(e),queryFn:()=>Te(e),enabled:!!e})}function Ct(){const e=u();return n({mutationFn:({testCaseId:t,steps:s})=>qe(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.steps(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function St(){return i({queryKey:a.tags,queryFn:p})}function Mt(){const e=u();return n({mutationFn:t=>Ke(t),onSuccess:()=>{e.invalidateQueries({queryKey:a.tags})}})}function ht(){const e=u();return n({mutationFn:({testCaseId:t,tagIds:s})=>de(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.testCase(s.testCaseId)}),e.invalidateQueries({queryKey:a.tags})}})}function Ft(e){return i({queryKey:a.versions(e),queryFn:()=>fe(e),enabled:!!e})}function gt(){const e=u();return n({mutationFn:({testCaseId:t,versionId:s,changedBy:r})=>Je(t,typeof s=="string"?parseInt(s,10):s,r),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.testCase(s.testCaseId)}),e.invalidateQueries({queryKey:a.versions(s.testCaseId)}),e.invalidateQueries({queryKey:["tm-test-cases"]})}})}function bt(e){return i({queryKey:a.mapping(e),queryFn:()=>ve(e),enabled:!!e})}function Dt(){return i({queryKey:a.stats,queryFn:Q})}function xt(e){return i({queryKey:a.plans(e),queryFn:()=>x(e)})}function Gt(e){return i({queryKey:a.plan(e),queryFn:()=>G(e),enabled:!!e})}function Rt(){const e=u();return n({mutationFn:t=>ke(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plans"]})}})}function At(){const e=u();return n({mutationFn:({id:t,data:s})=>Ee(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function kt(){const e=u();return n({mutationFn:t=>U(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plans"]})}})}function Et(e){return i({queryKey:a.planTestCases(e),queryFn:()=>R(e),enabled:!!e})}function Ut(){const e=u();return n({mutationFn:({planId:t,testCaseIds:s,addedBy:r})=>_e(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plan"]}),e.invalidateQueries({queryKey:["tm-plan-test-cases"]})}})}function Pt(){const e=u();return n({mutationFn:({planId:t,testCaseIds:s})=>P(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-plan"]}),e.invalidateQueries({queryKey:["tm-plan-test-cases"]})}})}function _t(e){return i({queryKey:a.cycles(e),queryFn:()=>A(e),enabled:!!e})}function Bt(e){return i({queryKey:a.cycle(e),queryFn:()=>k(e),enabled:!!e})}function Lt(){const e=u();return n({mutationFn:({planId:t,data:s})=>Ue(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function Ht(){const e=u();return n({mutationFn:({id:t,data:s})=>Pe(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-cycle"]})}})}function wt(){const e=u();return n({mutationFn:t=>_(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function Vt(){const e=u();return n({mutationFn:({cycleId:t,data:s})=>L(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycles"]})}})}function Ot(e,t){return i({queryKey:a.cycleExecutions(e,t),queryFn:()=>E(e,t),enabled:!!e})}function Wt(){const e=u();return n({mutationFn:({id:t,data:s})=>B(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-execution"]}),e.invalidateQueries({queryKey:["tm-cycle"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-cycle-analytics"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function Xt(e){return i({queryKey:a.stepResults(e),queryFn:()=>be(e),enabled:!!e})}function Yt(){const e=u();return n({mutationFn:({id:t,data:s})=>De(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-step-results"]}),e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycle"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-plan"]})}})}function $t(){const e=u();return n({mutationFn:({executionId:t,status:s,executedBy:r})=>xe(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-step-results"]}),e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-cycle-analytics"]})}})}function jt(e){return i({queryKey:a.cycleAnalytics(e),queryFn:()=>Ge(e),enabled:!!e})}function zt(e){return i({queryKey:a.executionHistory(e),queryFn:()=>Ce(e),enabled:!!e})}function Jt(){return i({queryKey:["tm-execution-dots"],queryFn:()=>C(()=>import("./index-BYVxKLrT.js").then(e=>e.iF),__vite__mapDeps([0,1,2,3,4])).then(e=>e.tmGetExecutionDots())})}function Nt(){return i({queryKey:a.mappingDashboard(),queryFn:()=>$()})}function Zt(){return i({queryKey:a.unmappedTestCases(),queryFn:()=>z()})}function It(){return i({queryKey:a.mappedTestCases(),queryFn:()=>j()})}function es(){const e=u();return n({mutationFn:t=>J(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-unmapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]})}})}function ts(){const e=u();return n({mutationFn:t=>N(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-unmapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]})}})}function ss(){const e=u();return n({mutationFn:()=>Z(),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]}),e.invalidateQueries({queryKey:["tm-mappings-by-status"]})}})}function as(){const e=u();return n({mutationFn:({testCaseId:t,syncStatus:s,scriptHash:r})=>I(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-mapping"]}),e.invalidateQueries({queryKey:["tm-mapped-test-cases"]}),e.invalidateQueries({queryKey:["tm-mapping-dashboard"]}),e.invalidateQueries({queryKey:["tm-mappings-by-status"]})}})}function ns(){const e=u();return n({mutationFn:t=>ee(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:["tm-stats"]}),e.invalidateQueries({queryKey:["tm-sources"]}),e.invalidateQueries({queryKey:["tm-requirements"]}),e.invalidateQueries({queryKey:["tm-traceability"]}),e.invalidateQueries({queryKey:["tm-coverage"]})}})}function us(e){return i({queryKey:a.requirements(e),queryFn:()=>Be(e)})}function is(){const e=u();return n({mutationFn:t=>st(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirements"]})}})}function rs(){const e=u();return n({mutationFn:({id:t,data:s})=>at(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirements"]}),e.invalidateQueries({queryKey:["tm-requirement"]})}})}function cs(){const e=u();return n({mutationFn:t=>Le(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirements"]})}})}function ys(e){return i({queryKey:a.requirementTestCases(e),queryFn:()=>et(e),enabled:!!e})}function os(){const e=u();return n({mutationFn:({reqId:t,testCaseIds:s})=>nt(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirement"]}),e.invalidateQueries({queryKey:["tm-requirement-test-cases"]}),e.invalidateQueries({queryKey:["tm-traceability-matrix"]}),e.invalidateQueries({queryKey:["tm-coverage-stats"]})}})}function ms(){const e=u();return n({mutationFn:({reqId:t,testCaseIds:s})=>tt(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-requirement"]}),e.invalidateQueries({queryKey:["tm-requirement-test-cases"]}),e.invalidateQueries({queryKey:["tm-traceability-matrix"]}),e.invalidateQueries({queryKey:["tm-coverage-stats"]})}})}function ls(){return i({queryKey:a.traceabilityMatrix(),queryFn:()=>we()})}function qs(){return i({queryKey:a.coverageStats(),queryFn:()=>Ve()})}function ds(){return i({queryKey:a.executionAnalytics(),queryFn:()=>Xe()})}function Ks(){return i({queryKey:a.healthScore(),queryFn:()=>We()})}function Ts(){return i({queryKey:a.orphans(),queryFn:()=>Oe()})}function fs(){return i({queryKey:["tm-source-traceability"],queryFn:()=>He()})}function vs(e){return i({queryKey:a.defects(e),queryFn:()=>te(e)})}function ps(){return i({queryKey:a.defectStats(),queryFn:()=>se()})}function Qs(){const e=u();return n({mutationFn:t=>ae(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]})}})}function Cs(){const e=u();return n({mutationFn:({id:t,data:s})=>ne(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function Ss(){const e=u();return n({mutationFn:t=>ue(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]})}})}function Ms(){const e=u();return n({mutationFn:({executionId:t,createdBy:s})=>X(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]})}})}function hs(){const e=u();return n({mutationFn:({id:t,status:s,performedBy:r})=>ie(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defects"]}),e.invalidateQueries({queryKey:["tm-defect"]}),e.invalidateQueries({queryKey:["tm-defect-stats"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function Fs(e){return i({queryKey:["tm-defect-activity",e],queryFn:()=>Ye(e),enabled:!!e})}function gs(e){return i({queryKey:["tm-defect-comments",e],queryFn:()=>$e(e),enabled:!!e})}function bs(){const e=u();return n({mutationFn:({defectId:t,content:s,author:r})=>je(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defect-comments"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function Ds(){const e=u();return n({mutationFn:({defectId:t,commentId:s,deletedBy:r})=>ze(t,s,r),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-defect-comments"]}),e.invalidateQueries({queryKey:["tm-defect-activity"]})}})}function xs(){return n({mutationFn:e=>re(e)})}function Gs(){const e=u();return n({mutationFn:t=>ce(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-test-cases"]}),e.invalidateQueries({queryKey:["tm-stats"]})}})}function Rs(e){return i({queryKey:a.attachments(e||""),queryFn:()=>pe(e),enabled:!!e})}function As(){const e=u();return n({mutationFn:({testCaseId:t,data:s})=>Me(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.attachments(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function ks(){const e=u();return n({mutationFn:({id:t,testCaseId:s})=>he(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.attachments(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function Es(e){return i({queryKey:["tm-execution-attachments",e],queryFn:()=>Ne(e),enabled:!!e})}function Us(){const e=u();return n({mutationFn:({executionId:t,data:s})=>Ze(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["tm-execution-attachments",s.executionId]})}})}function Ps(){const e=u();return n({mutationFn:({id:t})=>Ie(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["tm-execution-attachments",s.executionId]})}})}function _s(e){return i({queryKey:a.referenceLinks(e||""),queryFn:()=>Qe(e),enabled:!!e})}function Bs(){const e=u();return n({mutationFn:({testCaseId:t,data:s})=>Fe(t,s),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.referenceLinks(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function Ls(){const e=u();return n({mutationFn:({id:t,testCaseId:s})=>ge(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:a.referenceLinks(s.testCaseId)}),e.invalidateQueries({queryKey:a.testCase(s.testCaseId)})}})}function Hs(e){return i({queryKey:a.sources(e),queryFn:()=>m(e)})}function ws(){return i({queryKey:["tm-sources-with-test-cases"],queryFn:()=>K()})}function Vs(){const e=u();return n({mutationFn:t=>l(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-sources"]})}})}function Os(){const e=u();return n({mutationFn:({id:t,data:s})=>q(t,s),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-sources"]}),e.invalidateQueries({queryKey:["tm-source"]})}})}function Ws(){const e=u();return n({mutationFn:t=>d(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-sources"]})}})}function Xs(e){return i({queryKey:a.sourceTestCases(e||""),queryFn:()=>ye(e),enabled:!!e})}function Ys(e){return i({queryKey:a.testCaseSources(e||""),queryFn:()=>Se(e),enabled:!!e})}function $s(){const e=u();return n({mutationFn:t=>H(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function js(){const e=u();return n({mutationFn:t=>w(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-executions"]}),e.invalidateQueries({queryKey:["tm-cycles"]}),e.invalidateQueries({queryKey:["tm-plans"]}),e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function zs(e,t){const s=!!(t!=null&&t.busy);return i({queryKey:["tm-cycle-automation-status",e],queryFn:()=>Y(e),enabled:!!e,refetchInterval:r=>{var c;const y=((c=r.state.data)==null?void 0:c.executions)??[];return s||y.some(o=>o.automationStatus==="running")?3e3:3e4}})}function Js(e,t){return i({queryKey:["tm-cycle-run-status",e],queryFn:()=>W(e),enabled:!!e&&t,refetchInterval:1500})}function Ns(){const e=u();return n({mutationFn:t=>V(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function Zs(){const e=u();return n({mutationFn:t=>O(t),onSuccess:()=>{e.invalidateQueries({queryKey:["tm-cycle-automation-status"]})}})}function Is(){return i({queryKey:["tm-cycle-run-settings"],queryFn:()=>Re(),staleTime:6e4})}function ea(){const e=u();return n({mutationFn:t=>Ae(t),onSuccess:t=>{e.setQueryData(["tm-cycle-run-settings"],t)}})}export{Ft as $,Lt as A,Ht as B,Ut as C,St as D,ws as E,mt as F,Es as G,Us as H,Ps as I,rt as J,ct as K,ot as L,Dt as M,Jt as N,Kt as O,Tt as P,ft as Q,vt as R,pt as S,lt as T,yt as U,qt as V,dt as W,Ct as X,ht as Y,Mt as Z,Qt as _,ea as a,bt as a0,Rs as a1,_s as a2,zt as a3,Ys as a4,As as a5,ks as a6,Bs as a7,Ls as a8,gt as a9,Qs as aA,Cs as aB,Ss as aC,hs as aD,Fs as aE,gs as aF,bs as aG,Ds as aH,Vs as aI,Os as aJ,Ws as aK,Xs as aL,Nt as aa,It as ab,Zt as ac,es as ad,ts as ae,ss as af,as as ag,Hs as ah,ns as ai,us as aj,cs as ak,fs as al,ls as am,qs as an,Ts as ao,ys as ap,ms as aq,is as ar,rs as as,os as at,xs as au,Gs as av,Ks as aw,ds as ax,vs as ay,ps as az,xt as b,Gt as c,Et as d,_t as e,Bt as f,Ot as g,kt as h,Pt as i,wt as j,Wt as k,Vt as l,$s as m,js as n,Ns as o,Zs as p,Js as q,Ms as r,zs as s,Xt as t,Is as u,Yt as v,$t as w,jt as x,Rt as y,At as z};
@@ -0,0 +1 @@
1
+ import{u,a,c as r}from"./vendor-query-BrzmPFT3.js";import{fo as y,fp as l,E as o,fq as i,fr as c,fs as q,ft as f,fu as F,fv as T,fw as g,fx as K}from"./index-BYVxKLrT.js";function d(e=20,t=0,s){return u({queryKey:["result-runs",e,t,(s==null?void 0:s.status)||"all",(s==null?void 0:s.source)||"all"],queryFn:()=>y(e,t,s),refetchInterval:1e4})}function h(e){return u({queryKey:["result-run-counts",e||"all"],queryFn:()=>l(e),refetchInterval:1e4})}function m(e){return u({queryKey:["result-run",e],queryFn:()=>o(e),enabled:!!e,refetchInterval:t=>{var s,n;return((s=t.state.error)==null?void 0:s.status)===404?!1:((n=t.state.data)==null?void 0:n.status)==="running"?2e3:!1},retry:(t,s)=>(s==null?void 0:s.status)!==404&&t<3})}function p(e=20){return u({queryKey:["test-trends",e],queryFn:()=>i(e),refetchInterval:15e3})}function C(){return u({queryKey:["flaky-tests"],queryFn:()=>q(),refetchInterval:3e4})}function b(e=10){return u({queryKey:["top-failures",e],queryFn:()=>c(e),refetchInterval:15e3})}function w(e=10){return u({queryKey:["slowest-tests",e],queryFn:()=>f(e)})}function Q(){const e=a();return r({mutationFn:t=>g(t),onSuccess:(t,s)=>{e.invalidateQueries({queryKey:["result-run",s]})}})}function S(){const e=a();return r({mutationFn:({runId:t,groupIndex:s})=>K(t,s),onSuccess:(t,{runId:s})=>{e.invalidateQueries({queryKey:["result-run",s]})}})}function k(e){return u({queryKey:["later-outcomes",e],queryFn:()=>T(e),enabled:!!e,staleTime:15e3})}function L(e,t){return u({queryKey:["test-history",e,t??""],queryFn:()=>F(e,t),enabled:!!e})}export{b as a,C as b,w as c,d,m as e,L as f,k as g,Q as h,S as i,h as j,p as u};
@@ -1418,4 +1418,4 @@ import{r as h}from"./vendor-react-CTbHBddL.js";/**
1418
1418
  *
1419
1419
  * This source code is licensed under the ISC license.
1420
1420
  * See the LICENSE file in the root directory of this source tree.
1421
- */const Ha=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Sh=e("zoom-out",Ha);export{yt as $,Ua as A,Qa as B,it as C,Jo as D,Ko as E,Hc as F,Tc as G,Qc as H,yo as I,Dy as J,Ec as K,io as L,Uo as M,Oo as N,$t as O,iy as P,et as Q,my as R,By as S,ch as T,Nh as U,lo as V,jh as W,Lh as X,Zh as Y,Fh as Z,ec as _,th as a,Uc as a$,Pt as a0,st as a1,jt as a2,wo as a3,mt as a4,Ey as a5,Xt as a6,ky as a7,Ch as a8,Jt as a9,vt as aA,uo as aB,xc as aC,Wo as aD,Py as aE,Dt as aF,oo as aG,Eo as aH,ht as aI,ro as aJ,oc as aK,Yc as aL,Ut as aM,wc as aN,Lc as aO,Yo as aP,ot as aQ,Zc as aR,Qo as aS,Jy as aT,Tt as aU,Lo as aV,Vo as aW,co as aX,Sh as aY,Ph as aZ,gc as a_,qy as aa,py as ab,ho as ac,ac as ad,tc as ae,rc as af,Ly as ag,Vt as ah,Cc as ai,Rt as aj,lt as ak,Gt as al,No as am,Ba as an,$o as ao,Ra as ap,Zy as aq,fy as ar,to as as,Nt as at,Gy as au,nh as av,Jc as aw,Ka as ax,$h as ay,gt as az,Lt as b,jc as b$,eo as b0,Gc as b1,uy as b2,zt as b3,dt as b4,yc as b5,ry as b6,Iy as b7,yy as b8,ih as b9,vo as bA,St as bB,xy as bC,zo as bD,Hh as bE,ao as bF,cy as bG,qh as bH,Ny as bI,Xc as bJ,_h as bK,ty as bL,Ry as bM,go as bN,so as bO,Fc as bP,ct as bQ,dy as bR,ly as bS,wy as bT,Yy as bU,It as bV,Io as bW,Xo as bX,So as bY,Ic as bZ,Wt as b_,To as ba,ay as bb,oy as bc,Kc as bd,vh as be,yh as bf,hh as bg,Mc as bh,Co as bi,dh as bj,ey as bk,Xa as bl,Go as bm,rt as bn,Yt as bo,ny as bp,sy as bq,pt as br,La as bs,Mh as bt,eh as bu,Do as bv,Ro as bw,Ao as bx,Ah as by,$c as bz,ko as c,Ay as c$,pc as c0,lc as c1,bt as c2,dc as c3,Vc as c4,Et as c5,Wa as c6,Ta as c7,po as c8,fo as c9,Nc as cA,Kt as cB,Oy as cC,Qy as cD,gy as cE,Ht as cF,Wy as cG,kh as cH,sh as cI,oh as cJ,Ot as cK,Wc as cL,qc as cM,ja as cN,Pc as cO,Po as cP,hc as cQ,Hy as cR,Sc as cS,My as cT,no as cU,Aa as cV,bh as cW,$y as cX,mc as cY,zc as cZ,Vy as c_,kc as ca,vc as cb,sc as cc,Oa as cd,lh as ce,_t as cf,xh as cg,At as ch,uc as ci,Ya as cj,Dc as ck,Uy as cl,Ty as cm,Ca as cn,zh as co,bc as cp,jo as cq,Bo as cr,Mo as cs,Ky as ct,Bc as cu,Qt as cv,Da as cw,ph as cx,Zo as cy,nc as cz,xo as d,Rc as d0,Ja as d1,Ga as d2,Za as d3,ic as d4,fc as d5,gh as d6,wh as d7,fh as d8,qo as d9,vy as da,Sy as db,Ho as dc,_o as dd,ah as de,hy as df,cc as dg,Sa as dh,qt as di,Ac as dj,Fy as dk,Ea as dl,Fa as dm,at as dn,tt as dp,Cy as dq,Fo as dr,_y as ds,Bt as dt,kt as du,mo as dv,nt as e,Ct as f,_c as g,jy as h,by as i,mh as j,wt as k,ft as l,Ia as m,Oc as n,rh as o,Ft as p,uh as q,ut as r,Pa as s,xt as t,Zt as u,zy as v,Vh as w,Xy as x,Mt as y,bo as z};
1421
+ */const Ha=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Sh=e("zoom-out",Ha);export{yt as $,Ua as A,Qa as B,it as C,Jo as D,Ko as E,Hc as F,Tc as G,Qc as H,yo as I,Dy as J,Ec as K,io as L,Uo as M,Oo as N,$t as O,iy as P,et as Q,my as R,By as S,ch as T,Nh as U,lo as V,jh as W,Lh as X,Zh as Y,Fh as Z,ec as _,th as a,Gc as a$,wo as a0,Xt as a1,ky as a2,st as a3,Ch as a4,Jt as a5,qy as a6,py as a7,ho as a8,ac as a9,xc as aA,Wo as aB,Py as aC,Dt as aD,oo as aE,Eo as aF,ht as aG,ro as aH,oc as aI,Yc as aJ,Ut as aK,wc as aL,Lc as aM,Yo as aN,ot as aO,Zc as aP,Qo as aQ,Jy as aR,Tt as aS,Lo as aT,Vo as aU,co as aV,Sh as aW,Ph as aX,gc as aY,Uc as aZ,eo as a_,tc as aa,rc as ab,Ly as ac,Vt as ad,Cc as ae,Rt as af,lt as ag,Gt as ah,No as ai,Ba as aj,$o as ak,Ra as al,Zy as am,fy as an,to as ao,jt as ap,Nt as aq,Gy as ar,nh as as,Pt as at,Jc as au,Ka as av,$h as aw,gt as ax,vt as ay,uo as az,Lt as b,pc as b$,uy as b0,zt as b1,dt as b2,yc as b3,ry as b4,Iy as b5,yy as b6,ih as b7,Ey as b8,To as b9,St as bA,xy as bB,zo as bC,Hh as bD,ao as bE,cy as bF,qh as bG,Ny as bH,Xc as bI,_h as bJ,ty as bK,Ry as bL,go as bM,so as bN,Fc as bO,ct as bP,dy as bQ,ly as bR,wy as bS,Yy as bT,It as bU,Io as bV,Xo as bW,So as bX,Ic as bY,Wt as bZ,jc as b_,ay as ba,oy as bb,Kc as bc,vh as bd,yh as be,hh as bf,Mc as bg,Co as bh,dh as bi,ey as bj,Xa as bk,Go as bl,rt as bm,Yt as bn,ny as bo,sy as bp,pt as bq,La as br,Mh as bs,eh as bt,Do as bu,Ro as bv,Ao as bw,Ah as bx,$c as by,vo as bz,ko as c,Ay as c$,lc as c0,bt as c1,dc as c2,Vc as c3,Et as c4,Wa as c5,Ta as c6,po as c7,fo as c8,kc as c9,Nc as cA,Kt as cB,Oy as cC,Qy as cD,gy as cE,Ht as cF,Wy as cG,kh as cH,sh as cI,oh as cJ,Ot as cK,Wc as cL,qc as cM,ja as cN,Pc as cO,Po as cP,hc as cQ,Hy as cR,Sc as cS,My as cT,no as cU,Aa as cV,bh as cW,$y as cX,mc as cY,zc as cZ,Vy as c_,vc as ca,sc as cb,Oa as cc,lh as cd,_t as ce,xh as cf,At as cg,uc as ch,Ya as ci,Dc as cj,Uy as ck,Ty as cl,Ca as cm,zh as cn,bc as co,jo as cp,Bo as cq,Mo as cr,Ky as cs,Bc as ct,Qt as cu,Da as cv,ph as cw,Zo as cx,mt as cy,nc as cz,xo as d,Rc as d0,Ja as d1,Ga as d2,Za as d3,ic as d4,fc as d5,gh as d6,wh as d7,fh as d8,qo as d9,vy as da,Sy as db,Ho as dc,_o as dd,Fy as de,ah as df,hy as dg,cc as dh,Sa as di,qt as dj,Ac as dk,Cy as dl,tt as dm,at as dn,Ea as dp,Fa as dq,Fo as dr,_y as ds,Bt as dt,kt as du,mo as dv,nt as e,Ct as f,_c as g,jy as h,by as i,mh as j,wt as k,ft as l,Ia as m,Oc as n,rh as o,Ft as p,uh as q,ut as r,Pa as s,xt as t,Zt as u,zy as v,Vh as w,Xy as x,Mt as y,bo as z};
@@ -365,11 +365,11 @@
365
365
  82.5%, 100% { background: var(--boot-accent); width: 22px; }
366
366
  }
367
367
  </style>
368
- <script type="module" crossorigin src="/assets/index-DtBWNlVD.js"></script>
368
+ <script type="module" crossorigin src="/assets/index-BYVxKLrT.js"></script>
369
369
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-CTbHBddL.js">
370
370
  <link rel="modulepreload" crossorigin href="/assets/vendor-query-BrzmPFT3.js">
371
- <link rel="modulepreload" crossorigin href="/assets/vendor-icons-B0wLOBoh.js">
372
- <link rel="stylesheet" crossorigin href="/assets/index-B0klHYbO.css">
371
+ <link rel="modulepreload" crossorigin href="/assets/vendor-icons-BKPiFyYV.js">
372
+ <link rel="stylesheet" crossorigin href="/assets/index-C2KJt7SI.css">
373
373
  </head>
374
374
  <body class="bg-surface-0 text-gray-100 antialiased">
375
375
  <div id="root">
@@ -1,3 +0,0 @@
1
- import{r as n,j as e,u as at,n as wt}from"./vendor-react-CTbHBddL.js";import{u as kt}from"./useTabParam-ChbOedP1.js";import{u as fe,a as Ct}from"./vendor-query-BrzmPFT3.js";import{s as St,k as rt,l as Rt,m as Pt,n as zt,o as Tt,p as Et,q as It,t as At,v as Le,w as $t,b as nt,c as Dt,d as Lt,x as lt,y as ot,z as it,R as Ft,A as Mt,C as qt,D as Bt,E as Vt,F as Kt,G as _t,H as Ht,I as Ot,J as We,K as Gt,M as Ut}from"./index-DtBWNlVD.js";import{p as Wt,s as Qt}from"./ansiToHtml-DYRzYQV1.js";import{ax as Xt,u as ct,a2 as ie,k as ae,a3 as ue,b3 as Jt,b4 as Yt,ar as Zt,_ as es,a0 as oe,X as Fe,b5 as ts,S as Ie,o as ss,a as dt,y as as,v as rs,b6 as xe,ak as Qe,b7 as ns,b8 as ls,b9 as Ae,a7 as pe,a5 as Xe,ba as $e,J as De,G as os,a1 as Ce,bb as Je,bc as is}from"./vendor-icons-B0wLOBoh.js";import{M as mt,R as cs}from"./MobileRunTarget-D2Nqcj10.js";import{L as ds}from"./LiveExecutionView-BD0wE8sz.js";import{h as ms}from"./aiHandoff-vhtR29Fh.js";import{e as us,b as we}from"./runSelected-WlgnZcSF.js";import{C as xs}from"./ConfirmDialog-DNU3qoAP.js";import{s as ps}from"./visibleInterval-BKsLfJZ3.js";import{f as Ye}from"./formatDate-T65-Y6Mi.js";import{C as fs,i as hs}from"./CronBuilder-DsnX-vRr.js";import"./SearchableDevicePicker-CFJ_DUAA.js";const ke=5e3;function bs(o){const[t,i]=n.useState(null),[r,m]=n.useState([]),[u,c]=n.useState(null),[f,y]=n.useState(null),p=n.useRef([]),g=n.useRef(null),h=n.useCallback(()=>{const d=g.current;(d==null?void 0:d.raf)!=null&&cancelAnimationFrame(d.raf),(d==null?void 0:d.timer)!=null&&clearTimeout(d.timer),g.current=null;const P=p.current;P.length!==0&&(p.current=[],m(L=>{const A=L.concat(P);return A.length>ke?A.slice(A.length-ke):A}))},[]),N=n.useCallback(()=>{g.current||(g.current=typeof document<"u"&&document.hidden?{timer:setTimeout(h,100)}:{raf:requestAnimationFrame(h)})},[h]),E=n.useCallback(()=>{const d=g.current;(d==null?void 0:d.raf)!=null&&cancelAnimationFrame(d.raf),(d==null?void 0:d.timer)!=null&&clearTimeout(d.timer),g.current=null,p.current=[],m([])},[]);n.useEffect(()=>()=>{const d=g.current;(d==null?void 0:d.raf)!=null&&cancelAnimationFrame(d.raf),(d==null?void 0:d.timer)!=null&&clearTimeout(d.timer)},[]),n.useEffect(()=>{const d=()=>{document.hidden||h()};return document.addEventListener("visibilitychange",d),()=>document.removeEventListener("visibilitychange",d)},[h]),n.useEffect(()=>o(d=>{d.type==="output"&&d.runId===(t==null?void 0:t.runId)&&(y(null),p.current.push({stream:d.stream,data:d.data}),p.current.length>ke&&(p.current=p.current.slice(p.current.length-ke)),N()),d.type==="run-waiting-input"&&d.runId===(t==null?void 0:t.runId)&&y(d.prompt),d.type==="complete"&&d.runId===(t==null?void 0:t.runId)&&(h(),c({runId:t.runId,command:t.command,startTime:"",status:d.exitCode===0?"completed":"failed",exitCode:d.exitCode,duration:d.duration}),i(null),y(null))}),[o,t,h,N]);const $=n.useCallback(async d=>{E(),c(null);const P=await St(d);return i({runId:P.runId,command:P.command}),P},[E]),D=n.useCallback(async()=>{t&&(await rt(t.runId),i(null),y(null))},[t]),x=n.useCallback(async(d,P=!1)=>{t&&(y(null),await Rt(t.runId,P?{eof:!0}:{data:d}))},[t]),b=n.useCallback((d,P)=>{E(),c(null),i({runId:d,command:P})},[E]);return{activeRun:t,output:r,runResult:u,run:$,cancel:D,attachToRun:b,waitingPrompt:f,sendInput:x}}function gs(){return fe({queryKey:["runHistory"],queryFn:Pt,refetchInterval:5e3})}function ys(o,t){const[i,r]=n.useState({current:0,total:0,currentTestName:"",passed:0,failed:0,tests:[],elapsedMs:0,summary:null}),m=n.useRef(null),u=n.useRef(null),c=n.useCallback(()=>{m.current=null,u.current&&(clearInterval(u.current),u.current=null),r({current:0,total:0,currentTestName:"",passed:0,failed:0,tests:[],elapsedMs:0,summary:null})},[]);return n.useEffect(()=>(t?(r({current:0,total:0,currentTestName:"",passed:0,failed:0,tests:[],elapsedMs:0,summary:null}),m.current=Date.now(),u.current=setInterval(()=>{m.current&&r(f=>({...f,elapsedMs:Date.now()-m.current}))},500)):!t&&m.current&&u.current&&(clearInterval(u.current),u.current=null),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[t]),n.useEffect(()=>{if(t)return o(f=>{const y=f.runId;if(!(y&&y!==t)&&(f.type==="test-progress"&&r(p=>({...p,current:f.current,total:f.total||p.total,currentTestName:f.testName})),f.type==="test-passed"&&r(p=>({...p,passed:p.passed+1,tests:[...p.tests,{name:f.testName,status:"passed",duration:f.duration}]})),f.type==="test-failed"&&r(p=>({...p,failed:p.failed+1,tests:[...p.tests,{name:f.testName,status:"failed",duration:f.duration}]})),f.type==="test-results")){const p=f.summary;r(g=>({...g,summary:{runId:t,...p}}))}})},[o,t]),{...i,reset:c}}function js(o){const t=[];let i="",r="stdout";for(const m of o){if(m.stream!==r&&i){const u=i.split(`
2
- `);for(const c of u)c&&t.push({stream:r,data:c});i=""}r=m.stream,i+=m.data}if(i){const m=i.split(`
3
- `);for(const u of m)u&&t.push({stream:r,data:u})}return t}function vs({output:o}){const t=n.useRef(null);n.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[o]);const i=n.useMemo(()=>js(o),[o]);return e.jsxs("div",{ref:t,className:"flex-1 overflow-auto bg-black/40 rounded-lg p-4 font-mono text-xs leading-5",children:[i.length===0&&e.jsx("span",{className:"text-gray-600",children:"Waiting for output..."}),i.map((r,m)=>e.jsx(Ns,{data:r.data,stream:r.stream},m))]})}const Ns=n.memo(function({data:t,stream:i}){var u,c,f;const r=n.useMemo(()=>Wt(t),[t]),m=i==="stderr"?"text-red-400":i==="stdin"?"text-cyan-300":"text-gray-200";return i==="stdin"?e.jsxs("div",{className:m,children:[e.jsx("span",{className:"text-cyan-500/70 select-none",children:"› "}),t==="^D"?"^D (end of input)":t]}):r.length<=1&&!((u=r[0])!=null&&u.style.color)&&!((c=r[0])!=null&&c.style.bold)&&!((f=r[0])!=null&&f.style.dim)?e.jsx("div",{className:m,children:t}):e.jsx("div",{className:m,children:r.map((y,p)=>{const g=Qt(y.style);return Object.keys(g).length>0?e.jsx("span",{style:g,children:y.text},p):e.jsx("span",{children:y.text},p)})})});function ws(){const{data:o,isLoading:t}=gs(),i=(o==null?void 0:o.history)??[];return t?e.jsx("div",{className:"text-xs text-gray-500 p-3",children:"Loading history..."}):i.length===0?e.jsx("div",{className:"text-xs text-gray-500 p-4 text-center",children:"No previous runs"}):e.jsx("div",{className:"space-y-1.5 max-h-72 overflow-y-auto",children:i.map(r=>e.jsx(ks,{run:r},r.runId))})}function ks({run:o}){const t={completed:e.jsx(ae,{size:14,className:"text-emerald-400"}),failed:e.jsx(ie,{size:14,className:"text-red-400"}),running:e.jsx(ct,{size:14,className:"text-amber-400 animate-pulse"}),cancelled:e.jsx(Xt,{size:14,className:"text-gray-400"})};return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-surface-2 border border-white/5 text-xs",children:[t[o.status],e.jsx("span",{className:"font-mono text-gray-300 flex-1 truncate",children:o.command}),o.duration!=null&&e.jsxs("span",{className:"text-gray-500",children:[(o.duration/1e3).toFixed(1),"s"]}),o.startTime&&e.jsx("span",{className:"text-gray-600 text-[10px]",children:new Date(o.startTime).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})}function Cs({current:o,passed:t,failed:i,currentTestName:r,tests:m,elapsedMs:u}){const c=t+i,f=Math.round(u/1e3);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1 bg-surface-2 rounded-full h-2 overflow-hidden",children:e.jsx("div",{className:"h-full flex",children:c>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-emerald-500 transition-all",style:{width:`${t/Math.max(c,1)*100}%`}}),e.jsx("div",{className:"bg-red-500 transition-all",style:{width:`${i/Math.max(c,1)*100}%`}})]})})}),e.jsxs("span",{className:"text-xs text-gray-500 flex-shrink-0",children:[f,"s"]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-gray-400",children:["Test #",o]}),e.jsxs("span",{className:"text-emerald-400 flex items-center gap-1",children:[e.jsx(ae,{size:12})," ",t]}),e.jsxs("span",{className:"text-red-400 flex items-center gap-1",children:[e.jsx(ie,{size:12})," ",i]}),r&&e.jsxs("span",{className:"text-gray-500 flex items-center gap-1 truncate",children:[e.jsx(ue,{size:12,className:"animate-spin"}),e.jsx("span",{className:"truncate",children:r})]})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto space-y-0.5",children:m.slice(-30).map((y,p)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs py-0.5 animate-slide-in",children:[y.status==="passed"?e.jsx(ae,{size:12,className:"text-emerald-400 flex-shrink-0"}):e.jsx(ie,{size:12,className:"text-red-400 flex-shrink-0"}),e.jsx("span",{className:`truncate ${y.status==="passed"?"text-gray-400":"text-red-300"}`,children:y.name})]},p))})]})}function Ss({runId:o,summary:t,onRerunFailed:i}){const r=at(),m=t.passRate>=90?"text-emerald-400":t.passRate>=70?"text-amber-400":"text-red-400",u=t.passRate>=90?"bg-emerald-500/10":t.passRate>=70?"bg-amber-500/10":"bg-red-500/10",c=t.failed===0,f=()=>r(`/results?runId=${encodeURIComponent(o)}`);return e.jsxs("div",{className:`rounded-xl border border-white/5 px-4 py-2.5 ${u} flex items-center gap-x-4 gap-y-2 flex-wrap`,children:[e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c?e.jsx(ae,{size:16,className:"text-emerald-400"}):e.jsx(ie,{size:16,className:"text-red-400"}),e.jsx("span",{className:"text-sm font-semibold text-gray-200",children:"Run Complete"}),e.jsxs("span",{className:"text-xs text-gray-500",children:["· ",(t.duration/1e3).toFixed(1),"s"]})]}),e.jsx("span",{className:"w-px h-5 bg-white/10 hidden sm:block"}),e.jsxs("div",{className:"flex items-center gap-3.5 text-sm tabular-nums",children:[e.jsxs("span",{className:"text-gray-300",children:[e.jsx("span",{className:"font-bold text-gray-100",children:t.total})," ",e.jsx("span",{className:"text-gray-500 text-xs",children:"total"})]}),e.jsxs("span",{className:"flex items-center gap-1 text-emerald-400",title:"Passed",children:[e.jsx(ae,{size:13})," ",t.passed]}),e.jsxs("span",{className:`flex items-center gap-1 ${t.failed>0?"text-red-400":"text-gray-500"}`,title:"Failed",children:[e.jsx(ie,{size:13})," ",t.failed]}),e.jsxs("span",{className:"flex items-center gap-1 text-gray-500",title:"Skipped",children:[e.jsx(Jt,{size:13})," ",t.skipped]}),e.jsxs("span",{className:`font-bold ${m}`,children:[t.passRate,"%",e.jsx("span",{className:"text-gray-500 text-xs font-normal ml-1",children:"pass"})]})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2 flex-shrink-0",children:[t.failed>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-purple-500/15 text-purple-300 text-xs font-medium hover:bg-purple-500/25 transition-colors",children:[e.jsx(Yt,{size:12})," Analyze"]}),i&&e.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 text-gray-300 text-xs font-medium hover:bg-surface-3 transition-colors",children:[e.jsx(Zt,{size:12})," Re-run Failed"]})]}),e.jsxs("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-surface-2 text-gray-300 text-xs font-medium hover:bg-surface-3 transition-colors",children:[e.jsx(es,{size:12})," View Details"]})]})]})}function Rs({open:o,analysis:t,providerLabel:i,onAiFix:r,onSkipAndRun:m,onCancel:u}){return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:u}),e.jsxs("div",{className:"relative bg-surface-1 rounded-xl border border-white/10 p-0 w-[760px] max-w-[92vw] max-h-[85vh] animate-fade-in flex flex-col",children:[e.jsx("div",{className:"px-6 pt-5 pb-4 border-b border-white/5",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0 bg-amber-500/15",children:e.jsx(oe,{size:20,className:"text-amber-400"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-base font-semibold text-gray-100",children:["Not connected to ",i," yet"]}),e.jsx("p",{className:"text-sm text-gray-400 mt-0.5",children:"This project's driver setup doesn't honor Testver's cloud settings — the run would silently execute on a local browser."})]})]}),e.jsx("button",{onClick:u,className:"text-gray-500 hover:text-gray-300 p-1",children:e.jsx(Fe,{size:18})})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4",children:[e.jsxs("div",{className:"bg-surface-2 rounded-lg p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-gray-400 uppercase tracking-wide",children:[e.jsx(ts,{size:14}),"Detection Summary"]}),e.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-x-4 gap-y-1.5 text-sm",children:[e.jsx("div",{className:"text-gray-500",children:"Framework:"}),e.jsx("div",{className:"text-gray-200",children:t.framework||"Unknown"}),e.jsx("div",{className:"text-gray-500",children:"Language:"}),e.jsx("div",{className:"text-gray-200",children:t.language||"Unknown"}),e.jsx("div",{className:"text-gray-500",children:"Driver file (guess):"}),e.jsx("div",{className:"text-gray-200 font-mono text-xs break-all",children:t.hookFile||"Not located"})]}),e.jsx("p",{className:"text-[11px] text-gray-500 pt-1",children:"The driver file is a best-guess from a code scan — the AI Assistant verifies it (and looks for other driver-creation sites) before touching anything."})]}),e.jsxs("div",{className:"bg-brand-500/10 border border-brand-500/20 rounded-lg p-4 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-brand-300",children:[e.jsx(Ie,{size:15}),"Fix with AI Assistant"]}),e.jsxs("p",{className:"text-sm text-gray-300",children:["The AI Assistant makes the smallest change that connects this framework to ",i,", runs one test to verify, and confirms real cloud execution from the run's ground-truth verdict — self-correcting if verification fails, and undoing everything if it can't succeed."]}),e.jsx("p",{className:"text-xs text-gray-500",children:"You'll see every edit and the verification run in the AI Assistance screen. Requires an AI provider (Settings → LLM). Verification runs use a small amount of cloud minutes."})]}),e.jsxs("div",{className:"bg-surface-2 rounded-lg p-3 flex items-start gap-2",children:[e.jsx(ss,{size:14,className:"text-gray-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-xs text-gray-500",children:'"Run anyway" injects the cloud environment variables and runs as-is — if your code already reads them this works, otherwise the run lands locally and its result will carry a "executed locally" warning.'})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-white/5 flex justify-end gap-2",children:[e.jsx("button",{onClick:u,className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300",children:"Cancel"}),e.jsx("button",{onClick:m,className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/5",children:"Run Anyway"}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-4 py-2 text-sm rounded-lg bg-brand-600 hover:bg-brand-500 text-white font-medium",children:[e.jsx(Ie,{size:14}),"Fix with AI Assistant"]})]})]})]}):null}const Ps="testver-runner-recent",Ze="testver-runner-recent",zs=10;try{localStorage.getItem(Ze)!==null&&localStorage.removeItem(Ze)}catch{}function Ts(o){return`${Ps}:${o||"unknown"}`}function et(o){try{const t=localStorage.getItem(o),i=t?JSON.parse(t):[];return Array.isArray(i)?i.filter(r=>typeof r=="string"):[]}catch{return[]}}function ut(){const o=Ct(),{data:t}=fe({queryKey:["runner-commands"],queryFn:zt,staleTime:3e4}),i=(t==null?void 0:t.commands)||[],{data:r}=Tt(),m=Ts(r==null?void 0:r.rootPath),u=n.useCallback(async(g,h)=>{const N=await Et(g,h);o.setQueryData(["runner-commands"],N)},[o]),c=n.useCallback(async(g,h)=>{const N=await It(g,h);o.setQueryData(["runner-commands"],N)},[o]),f=n.useCallback(async g=>{const h=await At(g);o.setQueryData(["runner-commands"],h)},[o]),y=n.useCallback(g=>{const h=g.trim();if(!h)return;const N=[h,...et(m).filter(E=>E!==h)].slice(0,zs);try{localStorage.setItem(m,JSON.stringify(N))}catch{}},[m]);return{saved:[...i].sort((g,h)=>(h.pinned?1:0)-(g.pinned?1:0)||g.label.localeCompare(h.label)),add:u,update:c,remove:f,pushRecent:y,recent:et(m)}}function Es({framework:o,saved:t,recent:i,disabled:r,onPick:m,onRun:u,onSave:c,onUpdate:f,onDelete:y}){var X,w,ne;const[p,g]=n.useState(!1),[h,N]=n.useState(""),[E,$]=n.useState(!1),[D,x]=n.useState(""),[b,d]=n.useState(""),[P,L]=n.useState(null),[A,q]=n.useState(""),[z,U]=n.useState(""),[T,B]=n.useState(null),V=n.useRef(null);n.useEffect(()=>{if(!p)return;const l=S=>{T||V.current&&!V.current.contains(S.target)&&g(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[p,T]);const{data:_}=fe({queryKey:["run-commands-config"],queryFn:Le,staleTime:1e4}),W=(((w=(X=_==null?void 0:_.configured)==null?void 0:X.fullRun)==null?void 0:w.trim())||((ne=_==null?void 0:_.autoDetected)==null?void 0:ne.fullRun)||"").trim(),F=W?[{label:"Run All",command:W}]:[],a=h.trim().toLowerCase(),v=(l,S)=>!a||l.toLowerCase().includes(a)||S.toLowerCase().includes(a),I=t.filter(l=>v(l.label,l.command)),J=F.filter(l=>v(l.label,l.command)),H=i.filter(l=>v(l,l)),Y=l=>{m(l),g(!1)},O=l=>{u(l),g(!1)},re=()=>{$(!1),x(""),d("")},Q=()=>{const l=D.trim(),S=b.trim();l&&S&&(c(l,S),re())},he=l=>{L(l.id),q(l.label),U(l.command)},te=l=>{A.trim()&&z.trim()&&(f(l,{label:A.trim(),command:z.trim()}),L(null))};return e.jsxs("div",{className:"relative flex-shrink-0",ref:V,children:[e.jsxs("button",{type:"button",onClick:()=>g(l=>!l),disabled:r,title:"Saved commands, presets & recent",className:"flex items-center gap-1.5 px-3 py-2 rounded-xl bg-surface-2 border border-white/10 text-sm font-medium text-gray-300 hover:text-gray-100 hover:border-white/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(dt,{size:15}),e.jsx("span",{children:"Commands"}),e.jsx(as,{size:13,className:`transition-transform ${p?"rotate-180":""}`})]}),p&&e.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-[420px] max-h-[70vh] overflow-hidden flex flex-col rounded-xl bg-white dark:bg-surface-1 border border-gray-200 dark:border-white/10 shadow-2xl",children:[e.jsx("div",{className:"p-2 border-b border-gray-100 dark:border-white/5",children:e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-surface-2",children:[e.jsx(rs,{size:13,className:"text-gray-400"}),e.jsx("input",{autoFocus:!0,value:h,onChange:l=>N(l.target.value),placeholder:"Search commands…",className:"flex-1 bg-transparent text-sm text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),h&&e.jsx("button",{onClick:()=>N(""),children:e.jsx(Fe,{size:13,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200"})})]})}),e.jsxs("div",{className:"overflow-y-auto",children:[e.jsx("div",{className:"p-2 border-b border-gray-100 dark:border-white/5",children:E?e.jsxs("div",{className:"space-y-2 px-1 py-1",children:[e.jsx("input",{autoFocus:!0,value:D,onChange:l=>x(l.target.value),onKeyDown:l=>{l.key==="Escape"&&re()},placeholder:"Command name (e.g. Smoke — headed)",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsx("input",{value:b,onChange:l=>d(l.target.value),onKeyDown:l=>{l.key==="Enter"&&Q(),l.key==="Escape"&&re()},placeholder:"Command (e.g. npx playwright test --headed)",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm font-mono text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:re,className:"px-2.5 py-1.5 rounded-lg text-sm text-gray-500 hover:bg-black/5 dark:hover:bg-white/5",children:"Cancel"}),e.jsxs("button",{onClick:Q,disabled:!D.trim()||!b.trim(),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-brand-500/15 text-brand-500 hover:bg-brand-500/25 disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Qe,{size:14})," Add"]})]})]}):e.jsxs("button",{onClick:()=>$(!0),className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-sm font-medium text-brand-600 dark:text-brand-300 hover:bg-brand-500/10 transition-colors",children:[e.jsx(xe,{size:14})," Add Command"]})}),I.length>0&&e.jsx(Te,{title:"Saved",children:I.map(l=>P===l.id?e.jsxs("div",{className:"space-y-2 px-3 py-2 bg-white dark:bg-surface-1",children:[e.jsx("input",{autoFocus:!0,value:A,onChange:S=>q(S.target.value),onKeyDown:S=>{S.key==="Escape"&&L(null)},placeholder:"Command name",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsx("input",{value:z,onChange:S=>U(S.target.value),onKeyDown:S=>{S.key==="Enter"&&te(l.id),S.key==="Escape"&&L(null)},placeholder:"Command",className:"w-full bg-gray-100 dark:bg-surface-2 rounded-lg px-2.5 py-1.5 text-sm font-mono text-gray-700 dark:text-gray-200 outline-none placeholder-gray-400"}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{onClick:()=>L(null),className:"px-2.5 py-1.5 rounded-lg text-sm text-gray-500 hover:bg-black/5 dark:hover:bg-white/5",children:"Cancel"}),e.jsxs("button",{onClick:()=>te(l.id),disabled:!A.trim()||!z.trim(),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-brand-500/15 text-brand-500 hover:bg-brand-500/25 disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Qe,{size:14})," Save"]})]})]},l.id):e.jsx(Ee,{label:l.label,command:l.command,onPick:()=>Y(l.command),onRun:()=>O(l.command),actions:e.jsxs(e.Fragment,{children:[e.jsx(le,{title:l.pinned?"Unpin":"Pin",onClick:()=>f(l.id,{pinned:!l.pinned}),children:e.jsx(ns,{size:13,className:l.pinned?"fill-amber-400 text-amber-400":""})}),e.jsx(le,{title:"Edit",onClick:()=>he(l),children:e.jsx(ls,{size:13})}),e.jsx(le,{title:"Delete",onClick:()=>B(l),children:e.jsx(Ae,{size:13})})]})},l.id))}),J.length>0&&e.jsx(Te,{title:"Presets",children:J.map(l=>e.jsx(Ee,{label:l.label,command:l.command,onPick:()=>Y(l.command),onRun:()=>O(l.command),actions:e.jsx(le,{title:"Save to my commands",onClick:()=>c(l.label,l.command),children:e.jsx(xe,{size:13})})},l.label))}),H.length>0&&e.jsx(Te,{title:"Recent",children:H.map((l,S)=>e.jsx(Ee,{label:l,command:l,mono:!0,onPick:()=>Y(l),onRun:()=>O(l),actions:e.jsx(le,{title:"Save to my commands",onClick:()=>c(l.length>40?l.slice(0,40)+"…":l,l),children:e.jsx(xe,{size:13})})},`${l}-${S}`))}),I.length===0&&J.length===0&&H.length===0&&e.jsxs("p",{className:"px-4 py-6 text-center text-sm text-gray-400",children:["No commands match “",h,"”."]})]})]}),e.jsx(xs,{open:!!T,title:"Delete command?",description:T?`“${T.label}” (${T.command}) will be permanently removed from your saved commands. This can’t be undone.`:"",confirmLabel:"Delete",onConfirm:()=>{T&&y(T.id),B(null)},onCancel:()=>B(null)})]})}function Te({title:o,children:t}){return e.jsxs("div",{className:"py-1",children:[e.jsx("p",{className:"px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400 capitalize",children:o}),t]})}function le({title:o,onClick:t,children:i}){return e.jsx("button",{type:"button",title:o,onClick:r=>{r.stopPropagation(),t()},className:"p-1.5 rounded-md text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-black/5 dark:hover:bg-white/10 transition-colors",children:i})}function Ee({label:o,command:t,mono:i,onPick:r,onRun:m,actions:u}){return e.jsxs("div",{className:"group flex items-center gap-1 pl-3 pr-2 py-1.5 hover:bg-black/[0.04] dark:hover:bg-white/5 transition-colors",children:[e.jsxs("button",{type:"button",onClick:r,className:"flex-1 min-w-0 text-left",title:t,children:[e.jsx("span",{className:`block text-sm text-gray-700 dark:text-gray-200 truncate ${i?"font-mono text-[13px]":"font-medium"}`,children:o}),!i&&e.jsx("span",{className:"block text-[11px] text-gray-400 font-mono truncate",children:t})]}),e.jsxs("div",{className:"flex items-center flex-shrink-0",children:[u,e.jsx(le,{title:"Run now",onClick:m,children:e.jsx(pe,{size:13,className:"text-brand-500"})})]})]})}const se={browserstack:"BrowserStack",lambdatest:"LambdaTest",saucelabs:"Sauce Labs","local-appium":"Local Devices","testver-grid":"Testver Grid"};function Is(){var He,Oe,Ge,Ue;const{project:o,subscribe:t}=wt(),{runs:i}=$t(),{toast:r}=nt(),m=Dt(),u=at(),{activeRun:c,output:f,runResult:y,run:p,cancel:g,attachToRun:h,waitingPrompt:N,sendInput:E}=bs(t),[$,D]=n.useState(""),[x,b]=n.useState(!1),[d,P]=n.useState(null),L=n.useRef(null);n.useEffect(()=>{var s;N&&((s=L.current)==null||s.focus())},[N]),n.useEffect(()=>{c||(D(""),P(null))},[c]);const A=async(s=!1)=>{var j;if(!(!c||x)){b(!0),P(null);try{await E(s?"":$,s),s||D("")}catch(k){P(String((k==null?void 0:k.message)||k))}finally{b(!1),(j=L.current)==null||j.focus()}}},q=(i??[]).filter(s=>s.runId!==(c==null?void 0:c.runId)),z=ys(t,(c==null?void 0:c.runId)??null),{data:U}=Lt(),T=ut(),[B,V]=n.useState(""),[_,W]=n.useState(!1),{data:F}=fe({queryKey:["run-commands-config"],queryFn:Le,staleTime:1e4}),a=(((Oe=(He=F==null?void 0:F.configured)==null?void 0:He.fullRun)==null?void 0:Oe.trim())||((Ge=F==null?void 0:F.autoDetected)==null?void 0:Ge.fullRun)||"").trim(),v=((Ue=F==null?void 0:F.autoDetected)==null?void 0:Ue.wdioSuites)??[],I=new Set(v.map(s=>s.config)).size>1,J=[...a?[{id:"preset-run-all",label:"Run All",command:a,preset:!0}]:[],...v.map(s=>({id:`preset-wdio-suite-${s.config}-${s.name}`,label:`Suite: ${s.name}${I?` (${s.config.split("/").pop()})`:""}`,command:s.command,preset:!0})),...T.saved.map(s=>({id:s.id,label:s.label,command:s.command}))],H=B.trim().toLowerCase(),Y=H?J.filter(s=>s.command.toLowerCase()!==H&&(s.command.toLowerCase().includes(H)||s.label.toLowerCase().includes(H))):J,[O,re]=n.useState([]),[Q,he]=n.useState(!1),[te,X]=n.useState("local"),w=te,[ne,l]=n.useState(""),[S,xt]=n.useState(!1),[M,pt]=n.useState({deviceName:"",platformName:"Android",platformVersion:"",appId:"",appPath:""}),{showsMobile:Se,mode:Me}=lt(),ft=Me!=="mobile"&&/\bplaywright(\.cmd)?\s+test\b|\bcypress\s+run\b/i.test(B),K=Se&&!ft&&w!=="local"&&w!=="testver-grid",be=Me==="mobile",ge=be&&O.length===0&&!Q,Re=!K||!!M.deviceName&&(!!M.appId||!!M.appPath.trim()),[Z,qe]=n.useState(null);n.useEffect(()=>{if(!K){qe(null);return}let s=!1;const j=()=>{Mt().then(C=>{s||qe(C.ticket)}).catch(()=>{})};j();const k=ps(j,5e3);return()=>{s=!0,k()}},[K]);const[Be,ye]=n.useState(!1),[ce,je]=n.useState(null),[Ve,Ke]=n.useState(!1);n.useEffect(()=>{ot().then(s=>{const j=s.providers.filter(k=>k.enabled);re(j)}).catch(()=>{}),it().then(({config:s})=>he(!!s.enabled)).catch(()=>he(!1))},[]),n.useEffect(()=>{if(!(!be||w!=="local"))if(Q)X("local-appium");else{const s=O.filter(j=>j.id!=="testver-grid");s.length>0&&X(s[0].id)}},[be,Q,O,w]);const de=async(s,j)=>{const k=(s??B).trim(),C=j??te;try{const R={command:k,asTyped:!0,fromRunner:!0,...C==="local"?{plainCommand:!0}:{}};C!=="local"&&(R.cloudProvider=C,ne.trim()&&(R.buildName=ne.trim()),C==="testver-grid"&&S&&(R.gridTunnel=!0),K&&!j&&(M.deviceName&&(R.deviceName=M.deviceName),M.platformName&&(R.platformName=M.platformName),M.platformVersion&&(R.platformVersion=M.platformVersion),M.appId&&(R.appId=M.appId),M.appPath.trim()&&(R.appPath=M.appPath.trim()),Z&&!Z.claimed&&Date.now()<Z.expiresAt&&(R.reuseSessionId=Z.sessionId))),await p(R),T.pushRecent(k);const ee=C==="local"?"locally":`on ${se[C]||C}`;r("info",`Test run started ${ee}`)}catch(R){r("error",R.message||"The run could not be started")}},me=(s,j)=>m(()=>ht(s,j),{files:(s??B).split(/\s+/).filter(k=>/\.(spec|test)\.|\.(ts|tsx|js|jsx|py|java|cs|feature|robot)$/.test(k))}),ht=async(s,j)=>{const k=(s??B).trim(),C=j??te;if(!k){r("error","Please enter a run command");return}if(s!==void 0&&V(s),ge){r("error","Connect a device or enable a cloud grid in Connectors first");return}if(K&&!j&&!Re){r("error","Select a device and an app first");return}if(C==="local"){await de(k,j);return}if(K&&!j){await de(k,j);return}Ke(!0);try{const R=await Kt(C,k);je(R),R.cloudReady||R.alreadyPatched?await de(k,j):ye(!0)}catch(R){r("error",`Cloud analysis failed: ${R}`),await de(k,j)}finally{Ke(!1)}},bt=async s=>{try{const[{tests:j},k,C]=await Promise.all([qt(s),Bt(),Vt(s).catch(()=>null)]),R=j.filter(Ne=>Ne.status==="failed"||Ne.status==="error"),{tests:ee,unmatched:Pe}=us(R,k.suites);if(ee.length===0){r("error","The failed tests were not found in Test Explorer — run them from there.");return}Pe>0&&r("info",`${Pe} failed test${Pe===1?" was":"s were"} not found in Test Explorer — re-running the other ${ee.length}.`);const G=C?C.source==="cloud"&&C.cloudProvider?String(C.cloudProvider):C.source==="local"||!C.source?"local":void 0:void 0;if(G&&G!==te){const Ne=G==="local"||(G==="local-appium"?Q:O.some(Nt=>Nt.id===G)),ze=G==="local"?"this machine":se[G]||G;if(!Ne){r("error",`That run ran on ${ze}, which is not set up now — pick a target and run the failed tests from the Run Command field.`),V(we(ee));return}if(C!=null&&C.targetDevice){X(G),V(we(ee)),r("info",`That run ran on ${ze} — check the device and app, then press Run.`);return}r("info",`Re-running on ${ze}, where the run executed.`),me(we(ee),G);return}me(we(ee))}catch(j){r("error",j.message||"The failed tests could not be re-run")}},gt=()=>{const s=(ce==null?void 0:ce.aiFixPrompt)||`Make this project run on ${se[w]||w} through Testver's cloud environment variables without changing local behavior, then verify with one test run and check the run's cloudExecution verdict.`;ye(!1),je(null),ms(u,{prompt:s,mode:"web"})},yt=async()=>{ye(!1),je(null),await de()},jt=()=>{ye(!1),je(null)},vt=s=>{s.key==="Enter"&&!c&&me()},_e=!K&&w==="testver-grid"&&!!c,ve=K&&!!c||_e;return e.jsxs("div",{className:`h-full flex animate-fade-in ${ve?"":"flex-col"}`,children:[e.jsxs("div",{className:ve?"flex-1 flex flex-col overflow-hidden":"contents",children:[e.jsxs("div",{className:"px-6 py-4 border-b border-white/5 bg-surface-1 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-2.5",children:[e.jsx(dt,{size:22,className:"text-brand-400"}),"Runner"]}),e.jsx(Es,{saved:T.saved,recent:T.recent,onPick:s=>V(s),onRun:s=>{if(c){r("error","A run is already in progress — stop it first");return}me(s)},onSave:T.add,onUpdate:T.update,onDelete:T.remove})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Enter any run command to execute on the connected server"}),e.jsx("input",{value:B,onChange:s=>{V(s.target.value),W(!0)},onKeyDown:vt,onFocus:()=>W(!0),onBlur:()=>setTimeout(()=>W(!1),120),placeholder:"e.g., npm install or npx playwright test --headed",className:"w-full bg-surface-2 border border-white/10 rounded-xl px-3.5 py-2.5 text-[15px] text-gray-200 font-mono outline-none placeholder-gray-600 focus:border-brand-500/50",disabled:!!c}),_&&!c&&Y.length>0&&e.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 rounded-xl bg-white dark:bg-surface-1 border border-gray-200 dark:border-white/10 shadow-2xl py-1 overflow-hidden",children:[e.jsx("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Commands"}),e.jsx("div",{className:"max-h-[228px] overflow-y-auto",children:Y.map(s=>e.jsxs("button",{onMouseDown:j=>{j.preventDefault(),V(s.command),W(!1)},className:"w-full text-left px-3 py-1.5 hover:bg-black/[0.04] dark:hover:bg-white/5 transition-colors",title:s.command,children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 truncate",children:s.label}),s.preset&&e.jsx("span",{className:"px-1.5 py-0 rounded text-[9px] font-semibold bg-brand-500/15 text-brand-500 flex-shrink-0",children:"preset"})]}),e.jsx("span",{className:"block text-[11px] font-mono text-gray-400 truncate",children:s.command})]},s.id))})]})]}),e.jsx("div",{className:"flex items-end gap-2",children:c?e.jsxs("button",{onClick:g,className:"flex items-center justify-center gap-2 px-5 py-2.5 rounded-xl bg-red-600 hover:bg-red-500 text-white text-[15px] font-medium",children:[e.jsx(Xe,{size:14}),"Stop"]}):e.jsx("button",{onClick:()=>me(),disabled:Ve||ge||K&&!Re,title:ge?"Connect a local device or enable a cloud grid in Connectors first":K&&!Re?"Select a device and an app first":void 0,className:"flex items-center justify-center gap-2 px-5 py-2.5 rounded-xl bg-brand-600 hover:bg-brand-500 text-white text-[15px] font-medium disabled:opacity-60 disabled:cursor-not-allowed",children:Ve?e.jsxs(e.Fragment,{children:[e.jsx(oe,{size:14,className:"animate-pulse"}),"Checking..."]}):e.jsxs(e.Fragment,{children:[e.jsx(pe,{size:14}),"Run"]})})})]}),(O.length>0||Se&&Q)&&e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"Run on:"}),e.jsxs("div",{className:"flex gap-1.5",children:[!be&&e.jsxs("button",{onClick:()=>X("local"),disabled:!!c,className:`flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors ${w==="local"?"border-brand-500/50 bg-brand-500/10 text-brand-400 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[e.jsx($e,{size:12}),"Local"]}),O.map(s=>e.jsxs("button",{onClick:()=>X(s.id),disabled:!!c,className:`flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors ${w===s.id?"border-blue-500/50 bg-blue-500/10 text-blue-300 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[e.jsx(oe,{size:12}),se[s.id]]},s.id)),Se&&Q&&e.jsxs("button",{onClick:()=>X("local-appium"),disabled:!!c,className:`flex items-center gap-1.5 px-2.5 h-8 text-xs rounded-lg border transition-colors ${w==="local-appium"?"border-gray-300 dark:border-white/25 bg-gray-100/70 dark:bg-white/[0.08] text-gray-800 dark:text-gray-100 font-medium":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300 hover:border-white/10"} disabled:opacity-50`,children:[e.jsx(De,{size:12}),"Local Devices"]})]}),w==="testver-grid"&&e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-gray-400 cursor-pointer select-none",title:"Let grid browsers reach your localhost / private apps — outbound tunnel, scoped to localhost + your baseURL host, closed when the run ends",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:s=>xt(s.target.checked),disabled:!!c,className:"rounded border-gray-600 bg-surface-2 text-brand-500 focus:ring-brand-500"}),"Local tunnel"]})}),w!=="local"&&w!=="local-appium"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-sm text-gray-500",children:"Build:"}),e.jsx("input",{value:ne,onChange:s=>l(s.target.value),placeholder:"auto",className:"w-36 bg-surface-2 border border-white/10 rounded-xl px-3 py-1.5 text-sm text-gray-300 outline-none placeholder-gray-600 focus:border-brand-500/50",disabled:!!c})]})]}),ge&&e.jsxs("div",{className:"mt-3 flex items-start gap-2.5 px-3.5 py-3 rounded-xl border border-amber-500/25 bg-amber-500/10 text-sm text-amber-700 dark:text-amber-200",children:[e.jsx(De,{size:15,className:"mt-0.5 flex-shrink-0 text-amber-600 dark:text-amber-300"}),e.jsxs("span",{children:["No device target available. To run mobile tests, connect a local device or enable a cloud device grid in"," ",e.jsx("span",{className:"font-semibold",children:"Connectors"}),"."]})]}),K&&!c&&e.jsxs(e.Fragment,{children:[e.jsx(mt,{providerId:w,disabled:!!c,value:M,onChange:pt}),Z&&!Z.claimed&&Date.now()<Z.expiresAt&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-1.5 rounded-lg bg-emerald-500/10 border border-emerald-500/25 text-xs",children:[e.jsx(Ie,{size:12,className:"text-emerald-300 flex-shrink-0"}),e.jsx("span",{className:"text-emerald-200",children:"Reusing live recording session"}),e.jsxs("span",{className:"text-emerald-400/70 ml-auto",children:["saves ~45s · expires in ",Math.max(0,Math.round((Z.expiresAt-Date.now())/1e3)),"s"]})]})]}),e.jsxs("div",{className:"mt-2 text-sm text-gray-500 flex items-center gap-3 flex-wrap",children:[(U==null?void 0:U.branch)&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-sky-400/70",children:[e.jsx(os,{size:10})," ",U.branch]}),w!=="local"&&!c&&e.jsxs("span",{className:w==="local-appium"?"text-gray-400":"text-blue-400",children:[w==="local-appium"?"Target":"Cloud",": ",se[w]||w]}),c&&e.jsxs("span",{className:"text-amber-400 animate-pulse",children:["Running: ",c.command]}),y&&!c&&e.jsxs("span",{className:y.status==="completed"?"text-emerald-400":"text-red-400",children:["Last run: ",y.status,typeof y.exitCode=="number"?` · exit code ${y.exitCode}`:""," ",y.duration?`(${(y.duration/1e3).toFixed(1)}s)`:""]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsxs("div",{className:"flex-1 flex flex-col p-4 gap-3 overflow-hidden",children:[c&&z.current>0&&e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-2",children:"Live Progress"}),e.jsx(Cs,{current:z.current,passed:z.passed,failed:z.failed,currentTestName:z.currentTestName,tests:z.tests,elapsedMs:z.elapsedMs})]}),!c&&z.summary&&e.jsx(Ss,{summary:z.summary,runId:z.summary.runId,onRerunFailed:()=>void bt(z.summary.runId)}),e.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase",children:"Output"}),e.jsx(vs,{output:f}),c&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[N&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-300",children:[e.jsx(ue,{size:12,className:"animate-pulse"}),e.jsxs("span",{children:["The command looks like it is waiting for an answer: ",e.jsx("span",{className:"font-mono text-amber-200",children:N})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-cyan-500/70 text-sm select-none",children:"›"}),e.jsx("input",{ref:L,type:"text",value:$,onChange:s=>D(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),A(!1))},disabled:x,placeholder:N?"Type your answer and press Enter (empty Enter accepts the default)":"Send a line to the running command — press Enter","aria-label":"Input to the running command",spellCheck:!1,autoComplete:"off",className:"flex-1 h-9 px-3 rounded-lg bg-black/40 border border-white/10 focus:border-cyan-500/40 focus:outline-none font-mono text-sm text-gray-100 placeholder:text-gray-600 placeholder:font-sans disabled:opacity-60"}),e.jsx("button",{onClick:()=>void A(!1),disabled:x,className:"h-9 px-3 rounded-lg bg-cyan-600/20 text-cyan-300 border border-cyan-500/30 hover:bg-cyan-600/30 text-sm font-medium disabled:opacity-50",title:"Send the line followed by Enter",children:"Enter"}),e.jsx("button",{onClick:()=>void A(!0),disabled:x,className:"h-9 px-3 rounded-lg border border-white/10 text-gray-400 hover:text-gray-200 hover:bg-white/5 text-sm disabled:opacity-50",title:"Close the command's input (Ctrl-D) — for programs that read until input ends",children:"Send EOF"})]}),e.jsx("p",{className:"text-[11px] text-gray-600",children:d?e.jsx("span",{className:"text-red-400",children:d}):"What you type is echoed into the log above, so passwords will be visible there. Use Stop for Ctrl-C."})]})]}),!ve&&e.jsxs("div",{className:"w-80 border-l border-white/5 bg-surface-1 p-4 overflow-y-auto flex-shrink-0",children:[q.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-400 uppercase mb-3",children:"Current Runs"}),e.jsx("div",{className:"space-y-1.5",children:q.map(s=>e.jsxs("div",{className:"px-3 py-2.5 rounded-lg bg-amber-500/5 border border-amber-500/20 cursor-pointer hover:bg-amber-500/10 transition-colors",onClick:()=>h(s.runId,s.command),title:"Click to view output",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"relative flex h-2 w-2 flex-shrink-0",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-amber-400"})]}),e.jsx("span",{className:"font-mono text-gray-300 text-xs flex-1 truncate",children:s.command})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[s.cloudProvider&&e.jsxs("span",{className:"flex items-center gap-0.5 text-blue-400",children:[e.jsx(oe,{size:8}),se[s.cloudProvider]||s.cloudProvider]}),s.source==="scheduler"&&e.jsxs("span",{className:"flex items-center gap-0.5 text-gray-500",children:[e.jsx(Ce,{size:8})," Scheduled"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-emerald-400 flex items-center gap-0.5",children:[e.jsx(ae,{size:8})," ",s.passed]}),e.jsxs("span",{className:"text-red-400 flex items-center gap-0.5",children:[e.jsx(ie,{size:8})," ",s.failed]}),e.jsx("span",{className:"text-gray-500 tabular-nums font-mono",children:e.jsx(Ft,{run:s,format:j=>`${Math.floor(j/1e3)}s`})}),e.jsx("button",{onClick:j=>{j.stopPropagation(),rt(s.runId).catch(()=>{})},className:"text-red-400 hover:text-red-300 p-0.5",title:"Cancel run",children:e.jsx(Xe,{size:8})})]})]},s.runId))})]}),e.jsx("h3",{className:"text-sm font-semibold text-gray-400 uppercase mb-3",children:"Run History"}),e.jsx(ws,{})]})]})]}),ve&&e.jsx("div",{className:"w-[35%] min-w-[380px] max-w-[560px] border-l border-white/5 bg-surface-1 flex-shrink-0",children:_e?e.jsx(ds,{runId:(c==null?void 0:c.runId)??null,layout:"panel"}):e.jsx(cs,{testRunning:!!c})}),Be&&ce&&e.jsx(Rs,{open:Be,analysis:ce,providerLabel:se[w]||w,onAiFix:gt,onSkipAndRun:yt,onCancel:jt})]})}const As="w-full bg-surface-2 border border-white/10 rounded-xl px-3.5 py-2.5 text-[15px] text-gray-200 font-mono outline-none placeholder-gray-600 focus:border-brand-500/50";function $s({value:o,onChange:t,placeholder:i,disabled:r,className:m,hint:u}){var $,D,x;const[c,f]=n.useState(!1),{saved:y}=ut(),{data:p}=fe({queryKey:["run-commands-config"],queryFn:Le,staleTime:1e4}),g=(((D=($=p==null?void 0:p.configured)==null?void 0:$.fullRun)==null?void 0:D.trim())||((x=p==null?void 0:p.autoDetected)==null?void 0:x.fullRun)||"").trim(),h=[...g?[{id:"preset-run-all",label:"Run All",command:g,preset:!0}]:[],...y.map(b=>({id:b.id,label:b.label,command:b.command}))],N=o.trim().toLowerCase(),E=N?h.filter(b=>b.command.toLowerCase()!==N&&(b.command.toLowerCase().includes(N)||b.label.toLowerCase().includes(N))):h;return e.jsxs("div",{className:"relative",children:[e.jsx("input",{value:o,disabled:r,onChange:b=>{t(b.target.value),f(!0)},onFocus:()=>f(!0),onBlur:()=>setTimeout(()=>f(!1),120),placeholder:i,className:m||As}),c&&!r&&E.length>0&&e.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-30 rounded-xl bg-white dark:bg-surface-1 border border-gray-200 dark:border-white/10 shadow-2xl py-1 overflow-hidden",children:[e.jsxs("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:["Commands",u&&e.jsxs("span",{className:"ml-1.5 normal-case font-normal tracking-normal text-gray-400/80",children:["· ",u]})]}),e.jsx("div",{className:"max-h-[228px] overflow-y-auto",children:E.map(b=>e.jsxs("button",{type:"button",onMouseDown:d=>{d.preventDefault(),t(b.command),f(!1)},className:"w-full text-left px-3 py-1.5 hover:bg-black/[0.04] dark:hover:bg-white/5 transition-colors",title:b.command,children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200 truncate",children:b.label}),b.preset&&e.jsx("span",{className:"px-1.5 py-0 rounded text-[9px] font-semibold bg-brand-500/15 text-brand-500 flex-shrink-0",children:"preset"})]}),e.jsx("span",{className:"block text-[11px] font-mono text-gray-400 truncate",children:b.command})]},b.id))})]})]})}const Ds=[{label:"Every 5 minutes",cron:"*/5 * * * *"},{label:"Every 15 minutes",cron:"*/15 * * * *"},{label:"Every 30 minutes",cron:"*/30 * * * *"},{label:"Every hour",cron:"0 * * * *"},{label:"Every 2 hours",cron:"0 */2 * * *"},{label:"Daily at 8 AM",cron:"0 8 * * *"},{label:"Daily at 10 PM",cron:"0 22 * * *"},{label:"Weekdays at 9 AM",cron:"0 9 * * 1-5"},{label:"Weekly Sunday midnight",cron:"0 0 * * 0"},{label:"Custom",cron:""}],tt={browserstack:"BrowserStack",lambdatest:"LambdaTest",saucelabs:"Sauce Labs","local-appium":"Local Devices","testver-grid":"Testver Grid"},st=()=>({name:"",command:"",cron:"0 8 * * *",cloudProvider:"",enabled:!0,appPath:"",appId:"",deviceName:"",platformName:"Android",platformVersion:""});function Ls(o){const t=o.trim().split(/\s+/);if(t.length!==5)return o;const[i,r,m,u,c]=t;return i==="*"&&r==="*"&&m==="*"&&u==="*"&&c==="*"?"Every minute":i!=null&&i.startsWith("*/")&&r==="*"&&m==="*"&&u==="*"&&c==="*"?`Every ${i.slice(2)} min`:/^\d+$/.test(i)&&r==="*"&&m==="*"&&u==="*"&&c==="*"?`Hourly at :${i.padStart(2,"0")}`:/^\d+$/.test(i)&&/^\d+$/.test(r)&&m==="*"&&u==="*"&&c==="*"?`Daily ${r.padStart(2,"0")}:${i.padStart(2,"0")}`:/^\d+$/.test(i)&&/^\d+$/.test(r)&&m==="*"&&u==="*"&&hs(c)?`Weekdays ${r.padStart(2,"0")}:${i.padStart(2,"0")}`:/^\d+$/.test(i)&&/^\d+$/.test(r)&&m==="*"&&u==="*"&&c==="0"?`Sundays ${r.padStart(2,"0")}:${i.padStart(2,"0")}`:/^\d+$/.test(i)&&(r!=null&&r.startsWith("*/"))&&m==="*"&&u==="*"&&c==="*"?`Every ${r.slice(2)}h at :${i.padStart(2,"0")}`:o}function Fs(){const{toast:o}=nt(),[t,i]=n.useState([]),[r,m]=n.useState([]),[u,c]=n.useState(!1),{showsMobile:f}=lt(),[y,p]=n.useState(!0),[g,h]=n.useState(!1),[N,E]=n.useState(null),[$,D]=n.useState(null),[x,b]=n.useState(st()),[d,P]=n.useState(!1),[L,A]=n.useState({}),q=n.useCallback(async()=>{var a,v;try{const[I,J,H]=await Promise.all([_t().catch(()=>Ht()),ot().catch(()=>({providers:[]})),it().catch(()=>({config:{enabled:!1}}))]);i(I.schedules||[]),m(((a=J.providers)==null?void 0:a.filter(Y=>Y.enabled))||[]),c(!!((v=H.config)!=null&&v.enabled))}catch{}finally{p(!1)}},[]);n.useEffect(()=>{q()},[q]);const z=()=>{D(null),b(st()),h(!0)},U=a=>{D(a.id),b({name:a.name,command:a.command,cron:a.cron,cloudProvider:a.cloudProvider||"",enabled:a.enabled,appPath:a.appPath??"",appId:a.appId??"",deviceName:a.deviceName??"",platformName:a.platformName??"Android",platformVersion:a.platformVersion??""}),h(!0)},T=async()=>{if(!x.name.trim()){o("error","Name is required");return}if(!x.command.trim()){o("error","Command is required");return}if(!x.cron.trim()){o("error","Cron expression is required");return}P(!0);try{const v=f&&!!x.cloudProvider?{appPath:x.appPath.trim()||void 0,appId:x.appId||void 0,deviceName:x.deviceName||void 0,platformName:x.deviceName?x.platformName:void 0,platformVersion:x.platformVersion||void 0}:{};$?(await We($,{name:x.name.trim(),command:x.command.trim(),cron:x.cron.trim(),cloudProvider:x.cloudProvider||void 0,enabled:x.enabled,...v}),o("success","Schedule updated")):(await Ut({id:"",name:x.name.trim(),command:x.command.trim(),cron:x.cron.trim(),cloudProvider:x.cloudProvider||void 0,enabled:x.enabled,...v}),o("success","Schedule created")),h(!1),await q()}catch(a){o("error",`Save failed: ${a}`)}finally{P(!1)}},B=(a,v)=>{E({id:a,name:v})},V=async()=>{if(N){try{await Gt(N.id),o("info",`Schedule '${N.name}' deleted`),await q()}catch(a){o("error",`Delete failed: ${a}`)}E(null)}},_=async a=>{try{await We(a.id,{enabled:!a.enabled}),await q()}catch(v){o("error",`Toggle failed: ${v}`)}},W=async(a,v)=>{A(I=>({...I,[a]:!0}));try{const I=await Ot(a);I.runId?o("success",`'${v}' triggered (run: ${I.runId.slice(0,8)}...)`):o("info",I.message),await q()}catch(I){o("error",`Run failed: ${I}`)}finally{A(I=>({...I,[a]:!1}))}},F=Ds.find(a=>a.cron===x.cron);return!F||F.label,e.jsxs("div",{className:"min-h-screen bg-surface-0 text-gray-200 animate-fade-in",children:[e.jsx("div",{className:"border-b border-white/5 bg-surface-1",children:e.jsx("div",{className:"max-w-[1400px] mx-auto px-6 py-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-3",children:[e.jsx(Ce,{size:24,className:"text-brand-300"}),"Schedules",e.jsxs("span",{className:"text-sm font-normal bg-brand-500/15 text-brand-300 px-2.5 py-0.5 rounded-full",children:[t.length," schedules"]})]}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Schedule any run command to execute automatically on the connected server."})]}),e.jsxs("button",{onClick:z,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 rounded-lg transition-colors",children:[e.jsx(xe,{size:16}),"Add Schedule"]})]})})}),e.jsx("div",{className:"max-w-[1400px] mx-auto px-6 py-8",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(ue,{size:20,className:"animate-spin text-gray-500"})}):t.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(Ce,{size:40,className:"text-gray-600 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 text-[15px]",children:"No schedules configured yet."}),e.jsx("p",{className:"text-gray-600 text-sm mt-1",children:"Create a schedule to automatically run tests on a recurring basis."}),e.jsxs("button",{onClick:z,className:"mt-4 flex items-center gap-1.5 px-5 py-2.5 rounded-xl bg-brand-600 hover:bg-brand-500 text-white text-[15px] font-medium mx-auto",children:[e.jsx(xe,{size:14}),"Create Schedule"]})]}):e.jsx("div",{className:"space-y-3",children:t.map(a=>e.jsx("div",{className:`bg-surface-1 rounded-xl border border-white/5 p-4 transition-opacity ${a.enabled?"":"opacity-50"}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-200 truncate",children:a.name}),a.enabled?e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-emerald-500/15 text-emerald-400",children:[e.jsx(ae,{size:8})," Active"]}):e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-500/15 text-gray-500",children:[e.jsx(Je,{size:8})," Paused"]}),a.cloudProvider?e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-blue-500/15 text-blue-400",children:[e.jsx(oe,{size:8})," ",tt[a.cloudProvider]||a.cloudProvider]}):e.jsxs("span",{className:"flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-500/15 text-gray-400",children:[e.jsx($e,{size:8})," Local"]})]}),e.jsx("p",{className:"text-xs text-gray-400 font-mono truncate mb-1",children:a.command}),e.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-gray-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ct,{size:10}),Ls(a.cron),e.jsxs("span",{className:"text-gray-600",children:["(",a.cron,")"]})]}),a.lastRunTime&&e.jsxs("span",{children:["Last: ",Ye(a.lastRunTime)]}),a.nextRunTime&&e.jsxs("span",{className:"text-brand-400",children:["Next: ",Ye(a.nextRunTime)]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsxs("button",{onClick:()=>W(a.id,a.name),disabled:L[a.id],className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-brand-600/20 hover:bg-brand-600/30 text-brand-400 text-xs border border-brand-500/20 disabled:opacity-50",title:"Run Now",children:[L[a.id]?e.jsx(ue,{size:12,className:"animate-spin"}):e.jsx(pe,{size:12}),"Run"]}),e.jsx("button",{onClick:()=>_(a),className:"px-2.5 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-400 text-xs border border-white/5",title:a.enabled?"Pause":"Enable",children:a.enabled?e.jsx(Je,{size:12}):e.jsx(pe,{size:12})}),e.jsx("button",{onClick:()=>U(a),className:"px-2.5 py-1.5 rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-400 text-xs border border-white/5",title:"Edit",children:e.jsx(is,{size:12})}),e.jsx("button",{onClick:()=>B(a.id,a.name),className:"px-2.5 py-1.5 rounded-lg bg-red-600/20 hover:bg-red-600/30 text-red-400 text-xs border border-red-500/20",title:"Delete",children:e.jsx(Ae,{size:12})})]})]})},a.id))})}),N&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 animate-fade-in",children:e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/10 w-full max-w-sm mx-4 p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/15 flex items-center justify-center flex-shrink-0",children:e.jsx(Ae,{size:18,className:"text-red-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Delete Schedule"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"This action cannot be undone"})]})]}),e.jsxs("p",{className:"text-sm text-gray-400 mb-5",children:["Are you sure you want to delete ",e.jsxs("span",{className:"font-medium text-gray-200",children:['"',N.name,'"']}),"? All scheduled runs for this schedule will be cancelled."]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>E(null),className:"px-4 py-2 rounded-lg text-sm text-gray-400 hover:text-gray-200 hover:bg-white/5 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:V,className:"px-4 py-2 rounded-lg text-sm font-medium text-white bg-red-600 hover:bg-red-500 transition-colors",children:"Delete"})]})]})}),g&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 animate-fade-in overflow-y-auto py-6",children:e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/10 w-full max-w-lg mx-4 my-auto max-h-[calc(100vh-48px)] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-white/5",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-200",children:$?"Edit Schedule":"New Schedule"}),e.jsx("button",{onClick:()=>h(!1),className:"text-gray-500 hover:text-gray-300",children:e.jsx(Fe,{size:16})})]}),e.jsxs("div",{className:"p-4 space-y-4 overflow-y-auto flex-1",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Schedule Name"}),e.jsx("input",{value:x.name,onChange:a=>b(v=>({...v,name:a.target.value})),placeholder:"e.g., Nightly Regression",className:"w-full bg-surface-2 border border-white/10 rounded-xl px-3.5 py-2.5 text-[15px] text-gray-200 outline-none placeholder-gray-600 focus:border-brand-500/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Run Command"}),e.jsx($s,{value:x.command,onChange:a=>b(v=>({...v,command:a})),placeholder:"e.g., npx playwright test --headed",hint:"Add commands from the Runner screen"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-2",children:"Schedule"}),e.jsx(fs,{value:x.cron,onChange:a=>b(v=>({...v,cron:a}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-gray-400 block mb-1",children:"Run On"}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs("button",{onClick:()=>b(a=>({...a,cloudProvider:""})),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition-colors ${x.cloudProvider?"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300":"border-brand-500/50 bg-brand-500/10 text-brand-400"}`,children:[e.jsx($e,{size:12})," Local"]}),r.map(a=>e.jsxs("button",{onClick:()=>b(v=>({...v,cloudProvider:a.id})),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition-colors ${x.cloudProvider===a.id?"border-blue-500/60 bg-blue-500/15 text-blue-300 font-medium shadow-[0_0_0_1px_rgba(59,130,246,0.15)]":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300"}`,children:[e.jsx(oe,{size:12})," ",tt[a.id]||a.id]},a.id)),f&&u&&e.jsxs("button",{onClick:()=>b(a=>({...a,cloudProvider:"local-appium"})),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-lg border transition-colors ${x.cloudProvider==="local-appium"?"border-gray-400 dark:border-white/30 bg-gray-100 dark:bg-white/10 text-gray-800 dark:text-gray-100 font-medium shadow-sm":"border-white/5 bg-surface-2 text-gray-400 hover:text-gray-300"}`,children:[e.jsx(De,{size:12})," Local Devices"]})]})]}),f&&x.cloudProvider&&e.jsx(mt,{providerId:x.cloudProvider,value:{deviceName:x.deviceName,platformName:x.platformName,platformVersion:x.platformVersion,appId:x.appId,appPath:x.appPath},onChange:a=>b(v=>({...v,deviceName:a.deviceName,platformName:a.platformName,platformVersion:a.platformVersion,appId:a.appId,appPath:a.appPath}))}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-300 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x.enabled,onChange:a=>b(v=>({...v,enabled:a.target.checked})),className:"rounded border-gray-600 bg-surface-2 text-brand-500 focus:ring-brand-500"}),"Enable schedule immediately"]})]}),e.jsxs("div",{className:"flex justify-end gap-2 p-4 border-t border-white/5",children:[e.jsx("button",{onClick:()=>h(!1),className:"px-5 py-2.5 text-[15px] rounded-xl bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/5",children:"Cancel"}),e.jsxs("button",{onClick:T,disabled:d,className:"flex items-center gap-1.5 px-5 py-2.5 text-[15px] rounded-xl bg-brand-600 hover:bg-brand-500 text-white font-medium disabled:opacity-50",children:[d&&e.jsx(ue,{size:14,className:"animate-spin"}),$?"Update":"Create"]})]})]})})]})}function Zs(){const[o,t]=kt("tab",["runner","schedules"],"runner"),i=(r,m,u)=>e.jsxs("button",{onClick:()=>t(r),className:`flex items-center gap-1.5 px-4 py-2 text-sm font-medium border-b-2 transition-colors ${o===r?"border-brand-400 text-brand-300":"border-transparent text-gray-400 hover:text-gray-200 hover:border-white/10"}`,children:[u,m]});return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-1 px-5 border-b border-white/5 bg-surface-1 flex-shrink-0",children:[i("runner","Runner",e.jsx(pe,{size:15})),i("schedules","Schedules",e.jsx(Ce,{size:15}))]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:o==="runner"?e.jsx(Is,{}):e.jsx(Fs,{})})]})}export{Zs as AdvancedPage};
@@ -1 +0,0 @@
1
- import{j as e,u as f,b as T,r as p,L as w,n as R}from"./vendor-react-CTbHBddL.js";import{u as $}from"./useTestExplorer-HqvURJAc.js";import{T as A,k as S,a2 as y,O as F,at as D,au as I,X as L,o as M,av as z,J as E,a0 as P,aw as O,a3 as _,ax as B,r as V,ay as K,S as q}from"./vendor-icons-B0wLOBoh.js";import{u as U,L as g}from"./useTestLifecycle-CL7-zz0Q.js";import{u as W,a as X,b as H,c as Y,d as G}from"./useTestResults-Bm-JyMhB.js";import{u as J}from"./useChartTheme-BFz2QcND.js";import{R as Q,C as Z,h as ee,X as te,Y as k,T as se,A as N,L as ae}from"./vendor-charts-DWFQlmCz.js";import{f as b}from"./formatTestName-BKd2Uqhs.js";import{u as re}from"./useSuites-CvtMGakZ.js";import{f as le}from"./formatDate-T65-Y6Mi.js";import"./vendor-query-BrzmPFT3.js";import"./index-DtBWNlVD.js";function ne(){const{data:a,isLoading:s}=$(),l=(a==null?void 0:a.suites)??[],r=(a==null?void 0:a.totalTests)??0;let i=0,o=0,c=0,t=0;for(const n of l)for(const m of n.tests){const x=m.lastStatus;x==="passed"?i++:x==="failed"||x==="error"?o++:x==="skipped"?c++:t++}if(s&&r===0)return e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:["Total Tests","Passing","Failing","No Run"].map(n=>e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 min-h-[110px]",children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:n}),e.jsx("p",{className:"text-3xl font-bold text-gray-600",children:"—"}),e.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Scanning project…"})]},n))});if(r===0)return e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:["Total Tests","Passing","Failing","No Run"].map(n=>e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 min-h-[110px]",children:[e.jsx("p",{className:"text-sm text-gray-500 mb-1",children:n}),e.jsx("p",{className:"text-3xl font-bold text-gray-600",children:"0"}),e.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"No tests detected"})]},n))});const d=r>0?Math.round(i/r*100):0,h=r>0?Math.round(o/r*100):0,u=r>0?Math.round(t/r*100):0;return e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 min-h-[110px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Total Tests"}),e.jsx(A,{size:16,className:"text-orange-400"})]}),e.jsx("p",{className:"text-3xl font-bold text-gray-100",children:r}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-400",children:t})," never run",c>0&&e.jsxs(e.Fragment,{children:[", ",e.jsx("span",{className:"text-gray-400",children:c})," skipped"]})]}):c>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-400",children:c})," skipped"]}):"All tests have executed"})]}),e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 min-h-[110px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Passing"}),e.jsx(S,{size:16,className:i>0?"text-emerald-400":"text-gray-600"})]}),e.jsx("p",{className:`text-3xl font-bold ${i>0?"text-emerald-400":"text-gray-100"}`,children:i}),e.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[d,"% of catalog"]})]}),e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 min-h-[110px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Failing"}),o>0?e.jsx(y,{size:16,className:"text-red-400"}):e.jsx(F,{size:16,className:"text-gray-600"})]}),e.jsx("p",{className:`text-3xl font-bold ${o>0?"text-red-400":"text-gray-100"}`,children:o}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:o>0?`${h}% of catalog`:"No failing tests"})]}),e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 min-h-[110px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-sm text-gray-500",children:"No Run"}),e.jsx(D,{size:16,className:t>0?"text-amber-400":"text-gray-600"})]}),e.jsx("p",{className:`text-3xl font-bold ${t>0?"text-amber-400":"text-gray-100"}`,children:t}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t>0?`${u}% of catalog`:"All tests have run"})]})]})}const C=["active","in_review","draft","deprecated"],ie={active:"#10b981",in_review:"#f59e0b",draft:"#3b82f6",deprecated:"#f43f5e"};function ce(){const a=f(),{data:s}=$(),l=U(),r=(s==null?void 0:s.suites)??[],i={draft:0,active:0,in_review:0,deprecated:0};let o=0;for(const t of r)for(const d of t.tests)i[l.statusOf(t.file,d.name)]++,o++;const c=t=>o>0?Math.round(t/o*100):0;return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-lg bg-brand-500/10 text-brand-400",children:e.jsx(I,{size:16})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Test Status"}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Authoring status across ",o," test",o===1?"":"s"]})]})]}),e.jsx("button",{onClick:()=>a("/tests"),className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"View in Test Explorer →"})]}),e.jsx("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-black/5 dark:bg-white/5 mb-5",children:o===0?null:C.map(t=>i[t]>0?e.jsx("div",{className:"h-full transition-all",style:{width:`${c(i[t])}%`,backgroundColor:ie[t]},title:`${g[t].label}: ${i[t]} (${c(i[t])}%)`},t):null)}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:C.map(t=>{const d=g[t].cls.split(" ").filter(h=>h.startsWith("text-")).join(" ");return e.jsxs("button",{onClick:()=>a(`/tests?lifecycle=${t}`),className:"group text-left rounded-lg border border-white/5 bg-surface-2/40 hover:bg-surface-2 hover:border-white/10 px-3.5 py-3 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${g[t].dot}`}),e.jsx("span",{className:`text-xs font-medium ${d}`,children:g[t].label})]}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-100",children:i[t]}),e.jsxs("span",{className:"text-xs text-gray-500",children:[c(i[t]),"%"]})]})]},t)})})]})}function oe(){const{data:a}=W(20),s=J(),l=(a==null?void 0:a.trends)||[];if(l.length===0)return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200 mb-4",children:"Execution Trend"}),e.jsx("div",{className:"h-52 flex items-center justify-center text-gray-600 text-sm",children:"No test runs yet. Run tests to see trends."})]});const r=l.map((i,o)=>({run:`#${o+1}`,passed:i.passed,failed:i.failed,skipped:i.skipped,passRate:i.passRate}));return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5 flex flex-col",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200 mb-4",children:"Execution Trend"}),e.jsx("div",{className:"flex-1 min-h-[13rem]",children:e.jsx(Q,{width:"100%",height:"100%",children:e.jsxs(Z,{data:r,children:[e.jsx(ee,{strokeDasharray:"3 3",stroke:s.gridStroke}),e.jsx(te,{dataKey:"run",tick:{fontSize:11,fill:s.axisFill}}),e.jsx(k,{yAxisId:"left",tick:{fontSize:11,fill:s.axisFill}}),e.jsx(k,{yAxisId:"right",orientation:"right",domain:[0,100],tick:{fontSize:11,fill:s.axisFill}}),e.jsx(se,{contentStyle:{background:s.tooltipBackground,border:s.tooltipBorder,borderRadius:8,fontSize:13},labelStyle:{color:s.tooltipLabelColor}}),e.jsx(N,{yAxisId:"left",type:"monotone",dataKey:"passed",stackId:"1",fill:"#22c55e",fillOpacity:.3,stroke:"#22c55e"}),e.jsx(N,{yAxisId:"left",type:"monotone",dataKey:"failed",stackId:"1",fill:"#ef4444",fillOpacity:.3,stroke:"#ef4444"}),e.jsx(N,{yAxisId:"left",type:"monotone",dataKey:"skipped",stackId:"1",fill:"#64748b",fillOpacity:.2,stroke:"#64748b"}),e.jsx(ae,{yAxisId:"right",type:"monotone",dataKey:"passRate",stroke:"#a78bfa",strokeWidth:2,dot:!1})]})})})]})}function v({title:a,count:s,onClose:l,children:r}){return T.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:l}),e.jsxs("div",{className:"relative bg-surface-1 rounded-xl border border-white/10 w-[640px] max-w-[92vw] max-h-[80vh] flex flex-col shadow-2xl",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/5 flex-shrink-0",children:[e.jsxs("h3",{className:"text-base font-semibold text-gray-200",children:[a,typeof s=="number"&&e.jsxs("span",{className:"text-gray-500 font-normal",children:[" (",s,")"]})]}),e.jsx("button",{onClick:l,className:"text-gray-500 hover:text-gray-300 transition-colors","aria-label":"Close",children:e.jsx(L,{size:18})})]}),e.jsx("div",{className:"p-3 overflow-y-auto space-y-1",children:r})]})]}),document.body)}function de(){const{data:a}=X(50),s=(a==null?void 0:a.topFailures)||[],l=f(),[r,i]=p.useState(!1),o=t=>{if(t.file){const d=new URLSearchParams;d.set("file",t.file.replace(/\\/g,"/")),d.set("test",t.testName),l(`/tests?${d.toString()}`)}else l("/tests")},c=(t,d)=>e.jsxs("button",{onClick:()=>o(t),title:t.lastError||t.testName,className:"w-full flex items-start gap-2.5 p-2.5 rounded-lg hover:bg-surface-2 transition-colors text-left",children:[e.jsx(y,{size:16,className:"text-red-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-gray-200 truncate",children:b(t.testName)}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:t.lastError||"No error details"})]}),e.jsxs("span",{className:"text-xs font-medium text-red-400 flex-shrink-0",children:[t.failureCount,"x"]})]},d);return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200",children:"Top Failures"}),s.length>5&&e.jsx("button",{onClick:()=>i(!0),className:"text-xs text-brand-400 hover:text-brand-300 whitespace-nowrap",children:"View all →"})]}),s.length===0?e.jsx("p",{className:"text-sm text-gray-500 py-4 text-center",children:"No failures recorded yet."}):e.jsx("div",{className:"space-y-2",children:s.slice(0,5).map(c)}),r&&e.jsx(v,{title:"Top Failures",count:s.length,onClose:()=>i(!1),children:s.map(c)})]})}function xe(){const{data:a}=H(),s=(a==null?void 0:a.flaky)||[],l=f(),[r,i]=p.useState(!1),o=t=>{if(t.file){const d=new URLSearchParams;d.set("file",t.file.replace(/\\/g,"/")),d.set("test",t.testName),l(`/tests?${d.toString()}`)}else l("/tests")},c=(t,d)=>{var h;return e.jsxs("button",{onClick:()=>o(t),title:`Open ${t.testName} in Results`,className:"w-full flex items-start gap-2.5 p-2.5 rounded-lg hover:bg-surface-2 transition-colors text-left",children:[e.jsx(M,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-gray-200 truncate",children:b(t.testName)}),e.jsx("div",{className:"flex items-center gap-1 mt-1",children:(h=t.recentStatuses)==null?void 0:h.slice(0,10).map((u,n)=>e.jsx("span",{title:u,className:`w-2.5 h-2.5 rounded-full ${u==="passed"?"bg-emerald-400":u==="failed"?"bg-red-400":"bg-gray-600"}`},n))})]}),e.jsxs("span",{className:"text-xs font-medium text-amber-400 flex-shrink-0",children:[Math.round(t.flakinessRate*100),"%"]})]},d)};return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200",children:"Flaky Tests"}),s.length>5&&e.jsx("button",{onClick:()=>i(!0),className:"text-xs text-brand-400 hover:text-brand-300 whitespace-nowrap",children:"View all →"})]}),s.length===0?e.jsx("p",{className:"text-sm text-gray-500 py-4 text-center",children:"No flaky tests detected."}):e.jsx("div",{className:"space-y-2",children:s.slice(0,5).map(c)}),r&&e.jsx(v,{title:"Flaky Tests",count:s.length,onClose:()=>i(!1),children:s.map(c)})]})}function j(a){if(!a||a<0)return"—";if(a<1e3)return`${Math.round(a)}ms`;const s=a/1e3;return s<60?`${s.toFixed(s<10?1:0)}s`:`${Math.floor(s/60)}m ${Math.round(s%60)}s`}function me(a){if(!a)return"";const s=a.replace(/\\/g,"/");return s.slice(s.lastIndexOf("/")+1)}function he(){const{data:a}=Y(50),s=(a==null?void 0:a.slowest)||[],l=f(),[r,i]=p.useState(!1),o=t=>{if(t.file){const d=new URLSearchParams;d.set("file",t.file.replace(/\\/g,"/")),d.set("test",t.name),l(`/tests?${d.toString()}`)}else l("/tests")},c=(t,d)=>e.jsxs("button",{onClick:()=>o(t),title:`${t.name}${t.file?` — ${t.file}`:""} · avg ${j(t.avgDuration)}, max ${j(t.maxDuration)}`,className:"w-full flex items-start gap-2.5 p-2.5 rounded-lg hover:bg-surface-2 transition-colors text-left",children:[e.jsx(z,{size:16,className:"text-sky-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm text-gray-200 truncate",children:b(t.name)}),e.jsx("p",{className:"text-xs text-gray-500 truncate",children:t.file?me(t.file):`max ${j(t.maxDuration)}`})]}),e.jsx("span",{className:"text-xs font-medium text-sky-400 flex-shrink-0 tabular-nums",children:j(t.avgDuration)})]},d);return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200",children:"Slowest Tests"}),s.length>5&&e.jsx("button",{onClick:()=>i(!0),className:"text-xs text-brand-400 hover:text-brand-300 whitespace-nowrap",children:"View all →"})]}),s.length===0?e.jsx("p",{className:"text-sm text-gray-500 py-4 text-center",children:"No timing data yet. Run tests to see the slowest."}):e.jsx("div",{className:"space-y-2",children:s.slice(0,5).map(c)}),r&&e.jsx(v,{title:"Slowest Tests",count:s.length,onClose:()=>i(!1),children:s.map(c)})]})}function ue(a){if(!a)return"";const s=Date.now()-a,l=Math.floor(s/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const r=Math.floor(l/60);if(r<24)return`${r}h ago`;const i=Math.floor(r/24);return i<7?`${i}d ago`:new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function fe(a){return a>=90?{fill:"bg-emerald-500",text:"text-emerald-400"}:a>=50?{fill:"bg-amber-500",text:"text-amber-400"}:{fill:"bg-red-500",text:"text-red-400"}}const pe="bg-surface-1 rounded-xl border border-white/5 p-5",ge=5;function je(){const{data:a,isLoading:s}=re(),l=(a==null?void 0:a.suites)??[],[r,i]=p.useState(!1);p.useEffect(()=>{if(!s&&l.length>0){const n=requestAnimationFrame(()=>i(!0));return()=>cancelAnimationFrame(n)}},[s,l.length]);const o=n=>{var m;return((m=n.lastRun)==null?void 0:m.status)==="completed"?n.lastRun:(n.history||[]).find(x=>x.status==="completed")},c=n=>{var m,x;return(((x=(m=o(n))==null?void 0:m.summary)==null?void 0:x.total)??0)>0},t=l.filter(c).map(n=>{const m=o(n),x=m.summary;return{id:n.id,name:n.name,run:!0,rate:x.total?Math.round(x.passed/x.total*100):0,passed:x.passed??0,failed:x.failed??0,total:x.total??0,finishedAt:m.finishedAt}}).sort((n,m)=>n.rate-m.rate),d=l.filter(n=>!c(n)).map(n=>({id:n.id,name:n.name,run:!1})),h=[...t,...d].slice(0,ge),u=l.length;return e.jsxs("div",{className:pe,children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200",children:"Pass rate by suite"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Latest run · lowest first"})]}),u>0&&e.jsx(w,{to:"/tests?view=suites",className:"text-xs text-brand-400 hover:text-brand-300 whitespace-nowrap",children:"View all →"})]}),s?e.jsx("div",{className:"h-44 flex items-center justify-center text-sm text-gray-500",children:"Loading suites…"}):u===0?e.jsx("div",{className:"h-44 flex items-center justify-center text-sm text-gray-500 text-center px-4",children:"No suites yet. Create suites in Test Explorer to track their pass rates here."}):e.jsx("div",{className:"space-y-1",children:h.map(n=>{const m=n.run?fe(n.rate):null;return e.jsxs(w,{to:`/tests?view=suites&suite=${n.id}`,className:"grid grid-cols-[minmax(0,150px)_1fr_84px] items-center gap-3 py-1.5 px-1 -mx-1 rounded-lg hover:bg-white/5 transition-colors",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:`text-[13px] font-medium truncate ${n.run?"text-gray-200":"text-gray-400"}`,title:n.name,children:b(n.name)}),e.jsx("div",{className:"text-[11px] text-gray-500 truncate",children:n.run?`${ue(n.finishedAt)} · ${n.total} tests`:"Never run"})]}),e.jsx("div",{className:"h-2 rounded-full bg-surface-2 overflow-hidden",children:n.run&&e.jsx("div",{className:`h-full rounded-full ${m.fill} transition-[width] duration-700 ease-out`,style:{width:r?`${n.rate}%`:"0%"}})}),e.jsx("div",{className:"text-right",children:n.run?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`text-[15px] font-semibold ${m.text}`,children:[n.rate,"%"]}),e.jsxs("div",{className:"text-[11px] text-gray-500 tabular-nums",children:[n.passed," / ",n.failed]})]}):e.jsx("div",{className:"text-[11px] text-gray-500",children:"Not run yet"})})]},n.id)})})]})}function be(a){const s=Date.now()-new Date(a).getTime();if(!Number.isFinite(s)||s<0)return"just now";const l=Math.floor(s/1e3);if(l<60)return`${l}s ago`;const r=Math.floor(l/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function Ne(a){if(!a)return"—";const s=Math.round(a/1e3);if(s<60)return`${s}s`;const l=Math.floor(s/60),r=s%60;return r===0?`${l}m`:`${l}m ${r}s`}function ye(a){return a.status==="running"?{Icon:_,tint:"text-sky-400",bg:"bg-sky-500/15",label:"Running",spin:!0}:a.status==="cancelled"?{Icon:B,tint:"text-gray-400",bg:"bg-gray-500/15",label:"Cancelled",spin:!1}:a.status==="completed"&&(a.exitCode??0)===0?{Icon:V,tint:"text-emerald-400",bg:"bg-emerald-500/15",label:"Passed",spin:!1}:{Icon:y,tint:"text-red-400",bg:"bg-red-500/15",label:"Failed",spin:!1}}function ve({runs:a}){const s=f(),l=a.slice(0,5);return e.jsxs("div",{className:"bg-surface-1 rounded-xl border border-white/5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-200",children:"Recent Executions"}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["Last ",l.length," test executions with per-run breakdown"]})]}),e.jsx("button",{onClick:()=>s("/results"),className:"text-xs text-brand-400 hover:text-brand-300 transition-colors",children:"View all →"})]}),l.length===0?e.jsx("div",{className:"h-40 flex items-center justify-center text-sm text-gray-500",children:"No runs yet. Execute tests to see history."}):e.jsx("div",{className:"overflow-x-auto -mx-2",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-[11px] uppercase tracking-wide text-gray-500 border-b border-white/5",children:[e.jsx("th",{className:"text-left font-medium px-2 py-2",children:"Run"}),e.jsx("th",{className:"text-right font-medium px-2 py-2",children:"Passed"}),e.jsx("th",{className:"text-right font-medium px-2 py-2",children:"Failed"}),e.jsx("th",{className:"text-right font-medium px-2 py-2 hidden sm:table-cell",children:"Skipped"}),e.jsx("th",{className:"text-right font-medium px-2 py-2",children:"Total"}),e.jsx("th",{className:"text-right font-medium px-2 py-2 hidden lg:table-cell",children:"Pass Rate"}),e.jsx("th",{className:"text-right font-medium px-2 py-2",children:"Duration"}),e.jsx("th",{className:"text-right font-medium px-2 py-2 hidden sm:table-cell",children:"When"}),e.jsx("th",{className:"text-right font-medium px-2 py-2 hidden lg:table-cell",children:"Source"}),e.jsx("th",{className:"text-right font-medium px-2 py-2",children:"Status"})]})}),e.jsx("tbody",{children:l.map(r=>{const i=ye(r),o=i.Icon,c=r.summary,t=c?c.passRate>=90?"text-emerald-400":c.passRate>=70?"text-amber-400":"text-red-400":"text-gray-500";return e.jsxs("tr",{onClick:()=>s(`/results?runId=${encodeURIComponent(r.runId)}`),className:"border-b border-white/5 hover:bg-surface-2 cursor-pointer transition-colors",children:[e.jsx("td",{className:"px-2 py-2.5 min-w-0 max-w-xs",children:r.label?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-gray-200 truncate",title:r.label,children:r.label}),e.jsx("p",{className:"text-[11px] text-gray-500 truncate font-mono",title:r.command,children:r.command})]}):e.jsx("p",{className:"text-gray-200 truncate font-mono text-xs",title:r.command,children:r.command})}),e.jsx("td",{className:"px-2 py-2.5 text-right tabular-nums",children:c?e.jsx("span",{className:"text-emerald-400 font-medium",children:c.passed}):e.jsx("span",{className:"text-gray-600",children:"—"})}),e.jsx("td",{className:"px-2 py-2.5 text-right tabular-nums",children:c?e.jsx("span",{className:c.failed>0?"text-red-400 font-medium":"text-gray-500",children:c.failed}):e.jsx("span",{className:"text-gray-600",children:"—"})}),e.jsx("td",{className:"px-2 py-2.5 text-right tabular-nums hidden sm:table-cell",children:c?e.jsx("span",{className:"text-gray-500",children:c.skipped}):e.jsx("span",{className:"text-gray-600",children:"—"})}),e.jsx("td",{className:"px-2 py-2.5 text-right tabular-nums",children:c?e.jsx("span",{className:"text-gray-300",children:c.total}):e.jsx("span",{className:"text-gray-600",children:"—"})}),e.jsx("td",{className:"px-2 py-2.5 text-right tabular-nums hidden lg:table-cell",children:c?e.jsxs("span",{className:`${t} font-medium`,children:[c.passRate.toFixed(1),"%"]}):e.jsx("span",{className:"text-gray-600",children:"—"})}),e.jsx("td",{className:"px-2 py-2.5 text-right tabular-nums text-gray-400",children:Ne(r.duration)}),e.jsx("td",{className:"px-2 py-2.5 text-right text-gray-500 text-xs hidden sm:table-cell",title:le(r.startTime),children:be(r.startTime)}),e.jsx("td",{className:"px-2 py-2.5 text-right hidden lg:table-cell",children:r.source==="cloud"&&r.cloudProvider==="local-appium"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",title:"Local device (Appium)",children:[e.jsx(E,{size:11}),"local device"]}):r.source==="cloud"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-sky-300 px-1.5 py-0.5 bg-sky-500/10 rounded",title:r.cloudProvider,children:[e.jsx(P,{size:11}),r.cloudProvider||"cloud"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[e.jsx(O,{size:11}),"local"]})}),e.jsx("td",{className:"px-2 py-2.5 text-right",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-medium ${i.bg} ${i.tint}`,children:[e.jsx(o,{size:12,className:i.spin?"animate-spin":""}),i.label]})})]},r.runId)})})]})})]})}function Me(){const{project:a}=R(),s=f(),{data:l}=G(10,0),r=(l==null?void 0:l.runs)??[];return e.jsxs("div",{className:"p-6 space-y-6 animate-fade-in",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Automation Dashboard"}),e.jsxs("p",{className:"text-base text-gray-400 mt-0.5",children:[a.framework||"Auto-detect"," · ",a.stats.totalFiles," files · ",a.stats.totalModules," modules"]})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs("button",{onClick:()=>s("/ai-record"),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-surface-2 hover:bg-surface-3 text-gray-300 text-sm border border-white/5 transition-colors",title:"Record a flow with AI",children:[e.jsx(K,{size:15}),"AI Record"]}),e.jsxs("button",{onClick:()=>s("/ai"),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium transition-colors",title:"Open the AI Assistant",children:[e.jsx(q,{size:15}),"AI Assistant"]})]})]}),e.jsx(ne,{}),e.jsx(ce,{}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(oe,{}),e.jsx(je,{})]}),e.jsx(ve,{runs:r}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx(de,{}),e.jsx(xe,{}),e.jsx(he,{})]})]})}export{Me as Dashboard};