@testver/testver 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +88 -69
- package/README.md +6 -2
- package/bin/testver.js +9 -1
- package/dist/index.js +52650 -35771
- package/package.json +179 -178
- package/src/ui/static/agents/antigravity.svg +76 -0
- package/src/ui/static/agents/codex.svg +3 -0
- package/src/ui/static/agents/gemini.svg +1 -0
- package/src/ui/static/agents/opencode.svg +4 -0
- package/src/ui/static/agents/vscode.svg +17 -0
- package/src/ui/static/assets/AIPanel-RWO8Cd9w.js +32 -0
- package/src/ui/static/assets/AIRecordPanel-DnreS585.js +40 -0
- package/src/ui/static/assets/AIStreamUI-C1gHJtlF.js +9 -0
- package/src/ui/static/assets/{AITestGenPage-D3t2gPAA.js → AITestGenPage-C8bWUelu.js} +5 -5
- package/src/ui/static/assets/APITestingPage-DwL67hqL.js +19 -0
- package/src/ui/static/assets/AboutPage-CynLB95E.js +1 -0
- package/src/ui/static/assets/AccessTokensTab-BdevOmpE.js +1 -0
- package/src/ui/static/assets/AdvancedPage-BeM7aB8b.js +3 -0
- package/src/ui/static/assets/{AnalyticsPage-64mYNK2v.js → AnalyticsPage-C5ddYfRk.js} +1 -1
- package/src/ui/static/assets/AuditLogPage-DYcUdJoj.js +1 -0
- package/src/ui/static/assets/ChangesSummary-BjNMwGIZ.js +3 -0
- package/src/ui/static/assets/{CodeMapPage-B1ezmnlE.js → CodeMapPage-BQOEtv-R.js} +3 -3
- package/src/ui/static/assets/{ConfirmDialog-t7mpeeSN.js → ConfirmDialog-D_N9188T.js} +1 -1
- package/src/ui/static/assets/{CoveragePage-YMmCbiBk.js → CoveragePage-8bDSphY1.js} +2 -2
- package/src/ui/static/assets/{CronBuilder-Nk-K-_8I.js → CronBuilder-C7_JADb7.js} +1 -1
- package/src/ui/static/assets/{Dashboard-BDVxO2V4.js → Dashboard-B22yRPyV.js} +1 -1
- package/src/ui/static/assets/{DefectsPage-l8yGeCyR.js → DefectsPage-Arv4Ac-b.js} +72 -72
- package/src/ui/static/assets/{EmptyState-D1T3JWUr.js → EmptyState-BShNSbLf.js} +1 -1
- package/src/ui/static/assets/{ExportButton-Dt5RhL-h.js → ExportButton-xrS_AnfS.js} +1 -1
- package/src/ui/static/assets/{FileViewer-CrKgh_cB.js → FileViewer-Bcr9T1jW.js} +18 -18
- package/src/ui/static/assets/{GitPage-_4nCEzkJ.js → GitPage-DXL2Sv40.js} +12 -12
- package/src/ui/static/assets/{ImportExportPage-BcR7IQi9.js → ImportExportPage-BcjzRd7T.js} +36 -36
- package/src/ui/static/assets/{JiraPushDialog-C2sP4_4h.js → JiraPushDialog-DNYU9Ce0.js} +1 -1
- package/src/ui/static/assets/{KpiTile-inmeEsy3.js → KpiTile-BKlWqjgN.js} +1 -1
- package/src/ui/static/assets/{LiveExecutionView-D5BRe9jq.js → LiveExecutionView-1LlyEDEe.js} +1 -1
- package/src/ui/static/assets/{ManagePage-B8iG6Q0B.js → ManagePage-SvRQ6L19.js} +1 -1
- package/src/ui/static/assets/{MediaModal-C5n6sHYi.js → MediaModal-Dyy_iHl9.js} +1 -1
- package/src/ui/static/assets/MobileRunPicker-Cf5rm469.js +1 -0
- package/src/ui/static/assets/MobileRunTarget-C4M4YJJh.js +6 -0
- package/src/ui/static/assets/{ModuleExplorer-VGcmK167.js → ModuleExplorer-BKVbxFZK.js} +1 -1
- package/src/ui/static/assets/{OutputPage-B_1nPPxE.js → OutputPage-Bi-28tJi.js} +1 -1
- package/src/ui/static/assets/PipelinesPanel-BtO3iSJ4.js +1 -0
- package/src/ui/static/assets/{ProfilePage-y7tJNNFd.js → ProfilePage-BgZ4VDC-.js} +1 -1
- package/src/ui/static/assets/{ProjectExplorer-DbfGhRq0.js → ProjectExplorer-BVGbmVP7.js} +1 -1
- package/src/ui/static/assets/{RemoteFileStrip-WuRKtx_h.js → RemoteFileStrip-dzPInzgb.js} +1 -1
- package/src/ui/static/assets/{ReportCard-G52Q6-2i.js → ReportCard-LOf1PXlb.js} +2 -2
- package/src/ui/static/assets/{ReportFullView-Bt8UFP2J.js → ReportFullView-Ce4OI8lf.js} +1 -1
- package/src/ui/static/assets/{ReportsPage-DMtDi73Q.js → ReportsPage-DFxCQ8cY.js} +48 -48
- package/src/ui/static/assets/{ResultsPage-BI9jpK2N.js → ResultsPage-DD-uj8gk.js} +115 -115
- package/src/ui/static/assets/{RunState-ifC4zi6M.js → RunState-DDwFB4tA.js} +1 -1
- package/src/ui/static/assets/{RunTargets-C7vpCbck.js → RunTargets-CkIpY3v3.js} +1 -1
- package/src/ui/static/assets/ScriptMappingPage-DQQoR6sR.js +1 -0
- package/src/ui/static/assets/{SearchableDevicePicker-BYxYJNWl.js → SearchableDevicePicker-CenIxD7b.js} +1 -1
- package/src/ui/static/assets/{SettingsPage-DSISg7r7.js → SettingsPage-DAV_0y0m.js} +83 -83
- package/src/ui/static/assets/{SharedReportView-BOqKGJmR.js → SharedReportView-CqSLFKT1.js} +1 -1
- package/src/ui/static/assets/{SourcesPage-CgqtYGBi.js → SourcesPage-BvqC9oKw.js} +14 -14
- package/src/ui/static/assets/TestExplorerPage-Bdnll77k.js +7 -0
- package/src/ui/static/assets/{TestManagementPage-wqYTKP7W.js → TestManagementPage-CCNE688A.js} +10 -10
- package/src/ui/static/assets/{TestPlansPage-DOKX9p6z.js → TestPlansPage-T6D25i6-.js} +5 -5
- package/src/ui/static/assets/{TestverCreditsDetail-cSW0SpNx.js → TestverCreditsDetail-BKpt4oLW.js} +1 -1
- package/src/ui/static/assets/{TestverCreditsRing-DpMzl3h7.js → TestverCreditsRing-CoDk5eAS.js} +1 -1
- package/src/ui/static/assets/TestverMcpPage-Dte0qSXp.js +34 -0
- package/src/ui/static/assets/{UncommittedDiffViewer-BxS0zi-p.js → UncommittedDiffViewer-BNroxCoo.js} +2 -2
- package/src/ui/static/assets/{UserManagementPage-B5d0uDU_.js → UserManagementPage-BU4MuDJZ.js} +10 -10
- package/src/ui/static/assets/{WorkflowsPage-Bk0DFnFS.js → WorkflowsPage-BP5k7AqE.js} +83 -83
- package/src/ui/static/assets/clipboard-BIEd7Ccc.js +1 -0
- package/src/ui/static/assets/{hiddenLlmProviders-CdhhNa5G.js → hiddenLlmProviders-BPORgy-e.js} +1 -1
- package/src/ui/static/assets/index-BlA8ntjb.js +47 -0
- package/src/ui/static/assets/index-Co4_SlGD.css +1 -0
- package/src/ui/static/assets/{index-DpQhqcHv.js → index-DLmlY2Ol.js} +1 -1
- package/src/ui/static/assets/{reportMeta-AKcU_qwq.js → reportMeta-B9ZRW6ts.js} +1 -1
- package/src/ui/static/assets/runSelected-BoPm1sz-.js +1 -0
- package/src/ui/static/assets/{useChartTheme-BFz2QcND.js → useChartTheme-CTIe6M63.js} +1 -1
- package/src/ui/static/assets/{useDebouncedValue-BsHptIvX.js → useDebouncedValue-C9odz7b2.js} +1 -1
- package/src/ui/static/assets/{useFeatureFlags-DNkIctil.js → useFeatureFlags-B4Otsv-N.js} +1 -1
- package/src/ui/static/assets/{useJiraConnector-D5ysBBvz.js → useJiraConnector--JZhbYrT.js} +1 -1
- package/src/ui/static/assets/{useOwnership-U0AfKBRo.js → useOwnership-BhPOiYzy.js} +1 -1
- package/src/ui/static/assets/useSuites-GN_K2mHc.js +1 -0
- package/src/ui/static/assets/{useTabParam-ChbOedP1.js → useTabParam-CyYAP90W.js} +1 -1
- package/src/ui/static/assets/{useTestExplorer-DT8frjCK.js → useTestExplorer-BGhkGHKy.js} +1 -1
- package/src/ui/static/assets/{useTestLifecycle-OcwQaB1s.js → useTestLifecycle-DX5ES6x8.js} +1 -1
- package/src/ui/static/assets/{useTestManagement-Xm4Bcx3u.js → useTestManagement-ommXjx0q.js} +2 -2
- package/src/ui/static/assets/useTestResults-DWjvm8gm.js +1 -0
- package/src/ui/static/assets/{vendor-charts-DWFQlmCz.js → vendor-charts-By5uZ93z.js} +1 -1
- package/src/ui/static/assets/{vendor-flow-YGpC9U9I.js → vendor-flow-B61ZV-pm.js} +1 -1
- package/src/ui/static/assets/{vendor-icons-BKPiFyYV.js → vendor-icons-Cm92aSc5.js} +1426 -1421
- package/src/ui/static/assets/vendor-query-DkZSMtfn.js +1 -0
- package/src/ui/static/assets/{vendor-quill-W-RoQfb6.js → vendor-quill-xJF2Jvjc.js} +1 -1
- package/src/ui/static/assets/{vendor-react-CTbHBddL.js → vendor-react-DOVfxdUy.js} +1 -1
- package/src/ui/static/index.html +479 -479
- package/src/ui/static/assets/AIPanel-B_R-CbrF.js +0 -32
- package/src/ui/static/assets/AIRecordPanel-BRQWIU5h.js +0 -40
- package/src/ui/static/assets/AIStreamUI-C3D989_6.js +0 -9
- package/src/ui/static/assets/APITestingPage-Cmwkiiys.js +0 -19
- package/src/ui/static/assets/AboutPage-CjEqKB-q.js +0 -1
- package/src/ui/static/assets/AdvancedPage-4kAcpE8Y.js +0 -3
- package/src/ui/static/assets/AuditLogPage-BQjOzQje.js +0 -1
- package/src/ui/static/assets/ChangesSummary-CY_Vb27i.js +0 -2
- package/src/ui/static/assets/DiffViewer-BIU09a_i.js +0 -2
- package/src/ui/static/assets/MobileRunPicker-0h-N2c6d.js +0 -1
- package/src/ui/static/assets/MobileRunTarget-Bo_xekig.js +0 -6
- package/src/ui/static/assets/PipelinesPanel-PmmPu8pj.js +0 -1
- package/src/ui/static/assets/ScriptMappingPage-7vHuvhQw.js +0 -1
- package/src/ui/static/assets/TestExplorerPage-gYLhCD4d.js +0 -7
- package/src/ui/static/assets/index-BYVxKLrT.js +0 -47
- package/src/ui/static/assets/index-C2KJt7SI.css +0 -1
- package/src/ui/static/assets/runSelected-WlgnZcSF.js +0 -1
- package/src/ui/static/assets/useSuites-DyfN9HVv.js +0 -1
- package/src/ui/static/assets/useTestResults-D5EwGIX9.js +0 -1
- package/src/ui/static/assets/vendor-query-BrzmPFT3.js +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-B22yRPyV.js","assets/vendor-react-DOVfxdUy.js","assets/useTestExplorer-BGhkGHKy.js","assets/vendor-query-DkZSMtfn.js","assets/vendor-icons-Cm92aSc5.js","assets/useTestLifecycle-DX5ES6x8.js","assets/useTestResults-DWjvm8gm.js","assets/useChartTheme-CTIe6M63.js","assets/vendor-charts-By5uZ93z.js","assets/formatTestName-BKd2Uqhs.js","assets/useSuites-GN_K2mHc.js","assets/formatDate-T65-Y6Mi.js","assets/RunState-DDwFB4tA.js","assets/ModuleExplorer-BKVbxFZK.js","assets/FileViewer-Bcr9T1jW.js","assets/RemoteFileStrip-dzPInzgb.js","assets/index-DLmlY2Ol.js","assets/sandboxStorage-BrzaG3ny.js","assets/simpleMarkdown-kWs-10D8.js","assets/EmptyState-BShNSbLf.js","assets/UncommittedDiffViewer-BNroxCoo.js","assets/ProjectExplorer-BVGbmVP7.js","assets/AdvancedPage-BeM7aB8b.js","assets/useTabParam-CyYAP90W.js","assets/ansiToHtml-DYRzYQV1.js","assets/MobileRunTarget-C4M4YJJh.js","assets/SearchableDevicePicker-CenIxD7b.js","assets/LiveExecutionView-1LlyEDEe.js","assets/aiHandoff-vhtR29Fh.js","assets/runSelected-BoPm1sz-.js","assets/ConfirmDialog-D_N9188T.js","assets/visibleInterval-BKsLfJZ3.js","assets/CronBuilder-C7_JADb7.js","assets/AIPanel-RWO8Cd9w.js","assets/useFeatureFlags-B4Otsv-N.js","assets/AIStreamUI-C1gHJtlF.js","assets/ReportCard-LOf1PXlb.js","assets/KpiTile-BKlWqjgN.js","assets/ChangesSummary-BjNMwGIZ.js","assets/MediaModal-Dyy_iHl9.js","assets/hiddenLlmProviders-BPORgy-e.js","assets/TestverCreditsRing-CoDk5eAS.js","assets/AIRecordPanel-DnreS585.js","assets/TestverMcpPage-Dte0qSXp.js","assets/AccessTokensTab-BdevOmpE.js","assets/clipboard-BIEd7Ccc.js","assets/ResultsPage-DD-uj8gk.js","assets/RunTargets-CkIpY3v3.js","assets/useOwnership-BhPOiYzy.js","assets/excel-BrxuVus5.js","assets/vendor-excel-BFHGVHVC.js","assets/OutputPage-Bi-28tJi.js","assets/TestExplorerPage-Bdnll77k.js","assets/MobileRunPicker-Cf5rm469.js","assets/CodeMapPage-BQOEtv-R.js","assets/vendor-flow-B61ZV-pm.js","assets/vendor-flow-BnuhLJ6X.css","assets/ManagePage-SvRQ6L19.js","assets/PipelinesPanel-BtO3iSJ4.js","assets/SettingsPage-DAV_0y0m.js","assets/TestverCreditsDetail-BKpt4oLW.js","assets/APITestingPage-DwL67hqL.js","assets/GitPage-DXL2Sv40.js","assets/UserManagementPage-BU4MuDJZ.js","assets/AuditLogPage-DYcUdJoj.js","assets/ProfilePage-BgZ4VDC-.js","assets/WorkflowsPage-BP5k7AqE.js","assets/TestManagementPage-CCNE688A.js","assets/ImportExportPage-BcjzRd7T.js","assets/useTestManagement-ommXjx0q.js","assets/useDebouncedValue-C9odz7b2.js","assets/ExportButton-xrS_AnfS.js","assets/useJiraConnector--JZhbYrT.js","assets/JiraPushDialog-DNYU9Ce0.js","assets/TestPlansPage-T6D25i6-.js","assets/ScriptMappingPage-DQQoR6sR.js","assets/AITestGenPage-C8bWUelu.js","assets/CoveragePage-8bDSphY1.js","assets/AnalyticsPage-C5ddYfRk.js","assets/DefectsPage-Arv4Ac-b.js","assets/vendor-quill-xJF2Jvjc.js","assets/vendor-quill-CTpA5PSA.css","assets/SourcesPage-BvqC9oKw.js","assets/SharedReportView-CqSLFKT1.js","assets/ReportsPage-DFxCQ8cY.js","assets/reportMeta-B9ZRW6ts.js","assets/ReportFullView-Ce4OI8lf.js","assets/AboutPage-CynLB95E.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as m,j as s,u as H,b as Ve,N as Yn,d as Jt,O as Qn,L as ce,e as Xn,f as Zn,i as yt,h as eo,k as to,l as Q,m as so}from"./vendor-react-DOVfxdUy.js";import{u as B,a as de,b as no,c as Ye,k as oo,Q as ro,d as ao}from"./vendor-query-DkZSMtfn.js";import{C as io,a as co,I as Ft,X as Qe,L as Bt,T as Xe,N as Gt,G as ne,b as Me,c as lo,d as Ze,e as ke,Z as zt,B as et,f as qt,H as Wt,g as tt,S as st,h as Ht,i as Kt,F as Vt,j as nt,k as _e,U as Ue,l as Yt,P as uo,m as mo,A as Je,n as po,o as wt,p as me,q as ho,r as Qt,s as ot,t as Xt,u as rt,v as at,w as Zt,W as fo,x as es,R as ts,y as go,M as xo,z as ss,D as it,E as bo,J as yo,K as Ce,O as ct,Q as wo,V as So,Y as vo,_ as jo,$ as To,a0 as ns,a1 as Fe,a2 as No,a3 as os,a4 as rs,a5 as ko,a6 as as,a7 as Co,a8 as Be,a9 as ge,aa as is,ab as cs,ac as Oo,ad as re,ae as Po,af as Eo,ag as Ro,ah as xe,ai as lt,aj as $o,ak as Oe,al as Ao,am as Io,an as Lo,ao as Do,ap as Mo}from"./vendor-icons-Cm92aSc5.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const i of c.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function o(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=o(l);fetch(l.href,c)}})();const _o="modulepreload",Uo=function(e){return"/"+e},St={},I=function(t,o,a){let l=Promise.resolve();if(o&&o.length>0){let i=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),d=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=i(o.map(u=>{if(u=Uo(u),u in St)return;St[u]=!0;const h=u.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":_o,h||(g.as="script"),g.crossOrigin="",g.href=u,d&&g.setAttribute("nonce",d),document.head.appendChild(g),h)return new Promise((b,k)=>{g.addEventListener("load",b),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${u}`)))})}))}function c(i){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=i,window.dispatchEvent(r),!r.defaultPrevented)throw i}return l.then(i=>{for(const r of i||[])r.status==="rejected"&&c(r.reason);return t().catch(c)})};let ls=Date.now(),vt=!1;function ds(){return ls}function Jo(){if(vt||typeof window>"u")return;vt=!0;const e=()=>{ls=Date.now()};for(const t of["pointerdown","keydown","wheel","touchstart"])window.addEventListener(t,e,{capture:!0,passive:!0})}let pe=null,Pe=null;const Ge=new Set;function Fo(){return pe}function Bo(){return Pe}function us(e){e&&(Pe={idleHours:e.idleHours,maxDays:e.maxDays})}function oe(e){if(!(e&&(!Number.isFinite(e.expiresAt)||!Number.isFinite(e.absoluteExpiresAt)))&&!(e&&pe&&e.expiresAt===pe.expiresAt&&e.absoluteExpiresAt===pe.absoluteExpiresAt)){pe=e;for(const t of Ge)t(e)}}function Go(e){return Ge.add(e),()=>{Ge.delete(e)}}const ze="testver.logoutReason";function zo(e){try{sessionStorage.setItem(ze,JSON.stringify({reason:e,policy:Pe}))}catch{}}function qo(){try{const e=sessionStorage.getItem(ze);if(!e)return null;sessionStorage.removeItem(ze);try{const t=JSON.parse(e);return t.reason?{reason:t.reason,policy:t.policy??null}:null}catch{return{reason:e,policy:null}}}catch{return null}}function Wo(e,t=Pe){switch(e){case"idle":return`You were signed out after ${t?ms(t.idleHours):"a period"} without activity. Sign in to continue.`;case"max":return`Your sign-in reached its ${t?`${t.maxDays}-day`:"maximum"} limit. Please sign in again.`;case"revoked":return"Your session was ended — you signed out elsewhere, or an administrator signed you out.";case"invalid":case"required":return"Your session is no longer valid. Please sign in again.";default:return null}}function ms(e){return e%24===0&&e>=24?`${e/24} day${e===24?"":"s"}`:`${e} hour${e===1?"":"s"}`}const te="",dt="testver_token";function ps(e){if(!e.startsWith("/api/")||/[?&]token=/.test(e))return e;const t=G();return t?`${e}${e.includes("?")?"&":"?"}token=${encodeURIComponent(t)}`:e}function Ho(e){const t=e.match(/\/api\/documents\/download\/[^\s"'<>)\]]+/);return ps(t?t[0]:e)}async function Se(e,t,o){var h;const a=G(),l=await fetch(`${te}${e}`,{...t,headers:{"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...t.headers},cache:"no-store"});if(!l.ok){const p=await l.json().catch(()=>({error:l.statusText}));throw new Error(p.error||`Download failed (${l.status})`)}const i=((h=(l.headers.get("content-disposition")||"").match(/filename="([^"]+)"/))==null?void 0:h[1])||o,r=await l.blob(),d=URL.createObjectURL(r),u=document.createElement("a");u.href=d,u.download=i,document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(d)}function G(){return localStorage.getItem(dt)}function je(e){localStorage.setItem(dt,e)}function Ee(){localStorage.removeItem(dt)}function Re(e){zo(e),Ee(),oe(null),window.location.pathname!=="/login"&&window.location.pathname!=="/setup"&&(window.location.href="/login")}function hs(e){const t=e.headers.get("x-testver-token");t&&G()&&je(t);const o=Number(e.headers.get("x-testver-session-expires")),a=Number(e.headers.get("x-testver-session-max"));o>0&&a>0&&oe({expiresAt:o,absoluteExpiresAt:a})}let Te=null;const qe=[];function be(){return Te}function Ko(){try{const e=JSON.parse(sessionStorage.getItem("testver.previousClientIds")||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{return[]}}function ve(e){if(Te=e,e)for(;qe.length>0;){const t=qe.shift();try{t==null||t(e)}catch{}}}function ae(e=5e3){return Te?Promise.resolve(Te):new Promise(t=>{let o=!1;const a=l=>{o||(o=!0,t(l))};qe.push(l=>a(l)),setTimeout(()=>a(null),e)})}async function n(e,t){const o=G(),a={"Content-Type":"application/json",...t==null?void 0:t.headers};o&&(a.Authorization=`Bearer ${o}`);const l=be();l&&(a["X-Client-Id"]=l),a["X-Testver-Last-Activity"]=String(ds());const c=await fetch(`${te}${e}`,{...t,headers:{...a,"Cache-Control":"no-cache"},cache:"no-store"});if(hs(c),c.status===401){const r=await c.json().catch(()=>({})),d=c.headers.get("x-testver-auth");if(d)throw Re(d),new Error(r.error||"Session expired");const u=new Error(r.error||"Unauthorized");throw u.status=401,r.code&&(u.code=r.code),u.data=r,u}if(!c.ok){const r=await c.json().catch(()=>({error:c.statusText})),d=new Error(r.error||c.statusText);throw r.code&&(d.code=r.code),d.status=c.status,d.data=r,r.code==="TWO_FACTOR_SETUP_REQUIRED"&&window.dispatchEvent(new CustomEvent("testver:two-factor-setup-required")),d}const i=await c.json();if(i&&typeof i=="object"&&"setupRequired"in i&&i.setupRequired===!0)throw window.location.pathname!=="/setup"&&window.location.pathname!=="/login"&&(window.location.href="/setup"),new Error("Setup required");return i}const fs=()=>n("/api/project"),gs=()=>n("/api/project/rescan"),Vo=()=>n("/api/project/tree"),xs=()=>n("/api/system/app-mode"),bs=e=>n("/api/system/app-mode",{method:"POST",body:JSON.stringify({mode:e})}),ys=()=>n("/api/system/project-name"),ws=e=>n("/api/system/project-name",{method:"PUT",body:JSON.stringify({name:e})}),Yo=()=>n("/api/system/features"),Qo=()=>n("/api/system/api-trace"),Xo=e=>n("/api/system/api-trace",{method:"PUT",body:JSON.stringify(e)}),Zo=(e=50)=>n(`/api/heal/history?limit=${e}`),er=(e,t)=>n(`/api/heal/status?runId=${encodeURIComponent(e)}&testName=${encodeURIComponent(t)}`),tr=()=>n("/api/system/auto-heal"),sr=e=>n("/api/system/auto-heal",{method:"PUT",body:JSON.stringify(e)}),nr=(e,t)=>n("/api/heal/apply",{method:"POST",body:JSON.stringify({runId:e,testName:t})}),or=(e,t)=>n("/api/heal/undo",{method:"POST",body:JSON.stringify({runId:e,testName:t})}),rr=e=>n(`/api/project/modules/${e}/files`),ar=e=>n(`/api/files/${encodeURIComponent(e)}`),ir=(e,t)=>n("/api/files",{method:"POST",body:JSON.stringify({path:e,content:t})}),cr=(e,t)=>n(`/api/files/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})}),lr=e=>n(`/api/files/${encodeURIComponent(e)}`,{method:"DELETE"}),dr=(e,t)=>n("/api/files/search",{method:"POST",body:JSON.stringify({pattern:e,file_pattern:t})}),Ss=(e,t)=>n(`/api/search/global?q=${encodeURIComponent(e)}`,{signal:t}),ur=e=>n("/api/tests/ownership",{method:"POST",body:JSON.stringify({items:e})}),mr=()=>n("/api/tests/ownership/all"),pr=()=>n("/api/tests/ownership/config"),hr=e=>n("/api/tests/ownership/config",{method:"POST",body:JSON.stringify(e)}),fr=()=>n("/api/tests/ownership/status"),gr=()=>n("/api/tests/ownership/scan/start",{method:"POST"}),xr=()=>n("/api/tests/ownership/scan/cancel",{method:"POST"});function br(e){if(!e)return!1;const t=e.toLowerCase();return t==="appium"||t.startsWith("appium-")}const yr=()=>n("/api/runner/reuse-ticket"),wr=e=>n("/api/runner/run",{method:"POST",body:JSON.stringify(e)}),Sr=e=>n(`/api/runner/status/${e}`),vr=e=>n(`/api/runner/cancel/${e}`,{method:"POST"}),jr=(e,t)=>n(`/api/runner/runs/${e}/input`,{method:"POST",body:JSON.stringify(t)}),Tr=()=>n("/api/runner/history"),vs=()=>n("/api/runner/active"),js=()=>n("/api/runner/activity"),Nr=()=>n("/api/config/files"),kr=()=>n("/api/env"),Cr=(e,t)=>n("/api/env/compare",{method:"POST",body:JSON.stringify({file1:e,file2:t})}),Or=()=>n("/api/activity"),Pr=(e=20,t=0,o)=>{const a=new URLSearchParams({limit:String(e),offset:String(t)});return o!=null&&o.status&&o.status!=="all"&&a.set("status",o.status),o!=null&&o.source&&(o.source==="cloud"||o.source==="local")&&a.set("source",o.source),n(`/api/results/runs?${a.toString()}`)},Er=e=>{const t=e?`?source=${e}`:"";return Rr(t)},Rr=e=>n(`/api/results/runs/counts${e}`),$r=e=>n(`/api/results/runs/${e}`),Ar=(e,t)=>n(`/api/results/runs/${e}/tests${t?`?status=${t}`:""}`),Ir=e=>n(`/api/results/runs/${e}/failures`),Lr=(e=20)=>n(`/api/results/trends?count=${e}`),Dr=()=>n("/api/results/flaky"),Mr=(e=20)=>n(`/api/results/slowest?count=${e}`),_r=(e=20)=>n(`/api/results/top-failures?count=${e}`),Ur=e=>n(`/api/results/runs/${e}/analyze`,{method:"POST"}),Jr=e=>n(`/api/results/runs/${e}/analysis`),Fr=(e,t)=>n(`/api/results/runs/${e}/assess`,{method:"POST",body:JSON.stringify(t===void 0?{}:{groupIndex:t})}),Br=e=>n(`/api/results/runs/${e}/later-outcomes`),Gr=(e,t)=>n(`/api/results/test/${encodeURIComponent(e)}/history${t?`?file=${encodeURIComponent(t)}`:""}`),zr=(e,t)=>n(`/api/results/compare/${e}/${t}`),qr=e=>n(`/api/results/runs/${e}/new-failures`),Wr=(e=20)=>n(`/api/results/coverage?count=${e}`),Hr=(e=2)=>n(`/api/results/anomalies?threshold=${e}`),Kr=(e=20)=>n(`/api/results/category-trends?count=${e}`),Vr=()=>n("/api/health"),Yr=(e=50)=>n(`/api/results/health-scores?count=${e}`),Qr=e=>n("/api/results/baseline",{method:"POST",body:JSON.stringify({runId:e}),headers:{"Content-Type":"application/json"}}),Xr=()=>n("/api/results/baseline"),Zr=()=>n("/api/results/baseline",{method:"DELETE"}),ea=(e,t)=>n(t?`/api/results/runs/${e}/console?testName=${encodeURIComponent(t)}`:`/api/results/runs/${e}/console`),ta=()=>n("/api/llm/config"),sa=()=>n("/api/llm/testver/connect",{method:"POST"}),na=e=>n(`/api/llm/testver/connect/${encodeURIComponent(e)}`),oa=()=>n("/api/llm/testver/disconnect",{method:"POST"}),ra=(e=!1)=>n(`/api/llm/testver/status${e?"?fresh=1":""}`),Ts=(e=!1)=>n(`/api/testver/hub${e?"?fresh=1":""}`),aa=(e,t)=>n(`/api/testver/services/${e}`,{method:"PUT",body:JSON.stringify({enabled:t})}),ia=()=>n("/api/testver/disconnect",{method:"POST"}),ca=e=>n("/api/llm/config",{method:"PUT",body:JSON.stringify(e)}),la=e=>n("/api/llm/test-connection",{method:"POST",body:JSON.stringify(e)}),da=(e,t)=>n("/api/llm/active-model",{method:"PUT",body:JSON.stringify({provider:e,model:t})}),ua=()=>n("/api/config/run-commands"),ma=e=>n("/api/config/run-commands",{method:"PUT",body:JSON.stringify(e)}),pa=e=>n("/api/config/test-command",{method:"POST",body:JSON.stringify({command:e})}),ha=()=>n("/api/config/run-commands/suggest",{method:"POST",body:"{}"}),fa=e=>n("/api/config/run-commands/suggest-targets",{method:"POST",body:JSON.stringify(e?{for:e}:{})}),ga=()=>n("/api/config/run-commands/check"),xa=()=>n("/api/codemap/coverage"),ba=(e=!1)=>n("/api/codemap"+(e?"?force=1":"")),ya=()=>n("/api/codemap/rebuild",{method:"POST",body:"{}"}),wa=e=>n("/api/codemap/symbol?id="+encodeURIComponent(e)),Sa=e=>n("/api/codemap/impact?id="+encodeURIComponent(e)),va=()=>n("/api/codemap/quality"),ja=(e=!1)=>n("/api/datamap"+(e?"?force=1":"")),Ta=()=>n("/api/datamap/rebuild",{method:"POST",body:"{}"}),Na=e=>n("/api/datamap/source?id="+encodeURIComponent(e)),ka=(e,t=!1)=>n("/api/datamap/preview?id="+encodeURIComponent(e)+(t?"&reveal=1":"")),Ca=()=>n("/api/datamap/overrides"),Oa=e=>n("/api/datamap/include",{method:"POST",body:JSON.stringify({file:e})}),Pa=e=>n("/api/datamap/ignore",{method:"POST",body:JSON.stringify({file:e})}),Ea=(e,t)=>n("/api/datamap/override",{method:"DELETE",body:JSON.stringify({file:e,list:t})}),Ra=()=>n("/api/datamap/candidates"),$a=()=>n("/api/env-config/files"),Aa=e=>n("/api/env-config?file="+encodeURIComponent(e)),Ia=(e,t)=>n("/api/env-config",{method:"PUT",body:JSON.stringify({file:e,vars:t})}),La=()=>n("/api/env-config/candidates"),Da=e=>n("/api/env-config/load",{method:"POST",body:JSON.stringify({file:e})}),Ma=e=>n("/api/env-config/load",{method:"DELETE",body:JSON.stringify({file:e})}),_a=()=>n("/api/tests/lifecycle"),Ua=(e,t,o)=>n("/api/tests/lifecycle",{method:"PUT",body:JSON.stringify({file:e,name:t,status:o})}),Ja=(e,t)=>n("/api/tests/lifecycle/bulk",{method:"POST",body:JSON.stringify({items:e,status:t})}),Fa=()=>n("/api/runner/commands"),Ba=(e,t)=>n("/api/runner/commands",{method:"POST",body:JSON.stringify({label:e,command:t})}),Ga=(e,t)=>n(`/api/runner/commands/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),za=e=>n(`/api/runner/commands/${encodeURIComponent(e)}`,{method:"DELETE"}),qa=(e,t=2)=>n(`/api/codemap/graph?id=${encodeURIComponent(e)}&depth=${t}`),ye=(e,t)=>n(e,{method:"POST",body:JSON.stringify(t)}),Wa=e=>ye("/api/codemap/ai/explain",{id:e}),Ha=e=>ye("/api/codemap/ai/document",{id:e}),Ka=e=>ye("/api/codemap/ai/unused-verdict",{id:e}),Va=e=>ye("/api/codemap/ai/suggest-test",{id:e}),Ya=e=>ye("/api/codemap/ai/consolidate",{ids:e}),Qa=e=>{const t=new URLSearchParams;return e.id&&t.set("id",e.id),e.name&&t.set("name",e.name),e.file&&t.set("file",e.file),n("/api/codemap/test-methods?"+t.toString())},Ns="/api/codemap/export.csv";async function Xa(){const e=G(),t=await fetch(Ns,{headers:e?{Authorization:`Bearer ${e}`}:{},cache:"no-store"});if(!t.ok)throw new Error(`Export failed (${t.status})`);const o=await t.blob(),a=URL.createObjectURL(o),l=document.createElement("a");l.href=a,l.download="code-map.csv",document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(a)}const Za=()=>n("/api/codemap/steps");async function ei(){const e=G(),t=await fetch("/api/codemap/steps.csv",{headers:e?{Authorization:`Bearer ${e}`}:{},cache:"no-store"});if(!t.ok)throw new Error(`Export failed (${t.status})`);const o=await t.blob(),a=URL.createObjectURL(o),l=document.createElement("a");l.href=a,l.download="code-map-steps.csv",document.body.appendChild(l),l.click(),l.remove(),URL.revokeObjectURL(a)}const ti=e=>n("/api/codemap/ai/explain-step",{method:"POST",body:JSON.stringify({id:e})}),si=e=>n("/api/codemap/ai/suggest-stepdef",{method:"POST",body:JSON.stringify({text:e})}),ni=e=>n("/api/codemap/ai/consolidate-steps",{method:"POST",body:JSON.stringify({ids:e})}),oi=()=>n("/api/workflows/tools"),ri=e=>n("/api/ai/generate",{method:"POST",body:JSON.stringify(e)}),ai=e=>n("/api/ai/explain",{method:"POST",body:JSON.stringify(e)}),ii=e=>n("/api/ai/chat",{method:"POST",body:JSON.stringify(e)}),ci=()=>n("/api/ai/knowledge"),li=(e=[])=>n(`/api/ai/ask-feedback${e.length?`?answers=${encodeURIComponent(e.join(","))}`:""}`),di=e=>n("/api/ai/ask-feedback",{method:"POST",body:JSON.stringify(e)}),ui=e=>n(`/api/ai/ask-feedback/miss?query=${encodeURIComponent(e)}`,{method:"DELETE"}),mi=(e,t)=>n(`/api/ai/knowledge/run-file?run=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`),pi=()=>n("/api/mobile/providers"),hi=e=>n(`/api/mobile/test-credentials?provider=${encodeURIComponent(e)}`),fi=(e="browserstack")=>n(`/api/mobile/devices?provider=${encodeURIComponent(e)}`),gi=()=>n("/api/mobile/apps"),xi=async(e,t,o)=>{const a=new FormData;a.append("file",e),t&&a.append("label",t);const l=G(),c=be();return new Promise((i,r)=>{const d=new XMLHttpRequest;d.open("POST","/api/mobile/apps"),l&&d.setRequestHeader("Authorization",`Bearer ${l}`),c&&d.setRequestHeader("X-Client-Id",c),d.upload.onprogress=u=>{u.lengthComputable&&o&&o(u.loaded/u.total)},d.onerror=()=>r(new Error("Network error during upload. Check your connection and the server log.")),d.onabort=()=>r(new Error("Upload aborted.")),d.onload=()=>{const u=d.responseText||"";let h=null;try{h=u?JSON.parse(u):null}catch{}if(d.status>=200&&d.status<300&&(h!=null&&h.app)){i(h.app);return}const p=(h==null?void 0:h.error)||u.slice(0,300)||`HTTP ${d.status}`;r(new Error(`Upload failed (HTTP ${d.status}): ${p}`))},d.send(a)})},bi=e=>n(`/api/mobile/apps/${encodeURIComponent(e)}`,{method:"DELETE"}),yi=(e,t)=>n(`/api/mobile/apps/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({label:t})}),wi=async e=>{const t=await ae();return n("/api/mobile/session",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Si=()=>n("/api/mobile/session"),vi=()=>n("/api/mobile/session",{method:"DELETE"}),ji=(e={})=>n(`/api/mobile/session/screenshot${e.since?`?since=${e.since}`:""}`,e.timeoutMs?{signal:AbortSignal.timeout(e.timeoutMs)}:void 0);function Ti(e){const t=e;return!!t&&(t.status===503||t.code==="FRAME_PENDING"||t.name==="TimeoutError"||t.name==="AbortError")}const Ni=()=>n("/api/mobile/recording/start",{method:"POST",body:"{}"}),ki=()=>n("/api/mobile/recording"),Ci=(e,t)=>n("/api/mobile/recording/tap",{method:"POST",body:JSON.stringify({x:e,y:t})}),Oi=(e,t)=>n("/api/mobile/recording/type",{method:"POST",body:JSON.stringify({text:e,...t||{}})}),Pi=(e,t,o,a,l)=>n("/api/mobile/recording/swipe",{method:"POST",body:JSON.stringify({fromX:e,fromY:t,toX:o,toY:a,durationMs:l})}),Ei=(e,t)=>n("/api/mobile/recording/press-key",{method:"POST",body:JSON.stringify({key:e,...t||{}})}),Ri=e=>n("/api/mobile/session/press-key",{method:"POST",body:JSON.stringify({key:e})}),$i=e=>n("/api/mobile/recording/stop",{method:"POST",body:JSON.stringify(e)}),Ai=e=>n(`/api/mobile/recording/actions/${e}`,{method:"DELETE"}),Ii=()=>n("/api/mobile/recording/reset",{method:"POST",body:"{}"}),Li=e=>n("/api/mobile/recording/preview",{method:"POST",body:JSON.stringify(e)}),Di=()=>n("/api/mobile/recording/formatters"),Mi=(e,t)=>n(`/api/mobile/recording/actions/${e}`,{method:"PATCH",body:JSON.stringify(t)}),_i=e=>n("/api/mobile/recording/actions/reorder",{method:"POST",body:JSON.stringify({order:e})}),Ui=()=>n("/api/mobile/recording/end",{method:"POST",body:"{}"}),Ji=e=>n("/api/mobile/recording/pause",{method:"POST",body:JSON.stringify({paused:e})}),Fi=()=>n("/api/mobile/session/keepalive",{method:"POST",body:"{}"}),Bi=()=>n("/api/mobile/recording/resume",{method:"POST",body:"{}"}),Gi=(e,t,o)=>n("/api/mobile/recording/load",{method:"POST",body:JSON.stringify({actions:e,sessionInfo:t??void 0,settings:o??void 0})}),zi=(e,t)=>n("/api/mobile/recording/custom",{method:"POST",body:JSON.stringify({action:e,...t!==void 0?{afterIndex:t}:{}})}),qi=(e,t)=>n("/api/mobile/recording/actions/replace",{method:"POST",body:JSON.stringify({indexes:e,action:t})}),Wi=e=>n(`/api/mobile/recording/actions/${e}/restore`,{method:"POST",body:"{}"}),Hi=e=>n("/api/mobile/recording/settings",{method:"PUT",body:JSON.stringify({settings:e})}),Ki=e=>n("/api/mobile/recording/annotate",{method:"POST",body:JSON.stringify({text:e})}),Vi=()=>n("/api/mobile/session/elements"),Yi=e=>n("/api/mobile/recording/assertion",{method:"POST",body:JSON.stringify(e)}),Qi=e=>n("/api/mobile/recording/annotate",{method:"POST",body:JSON.stringify(e)}),Xi=e=>n("/api/mobile/recording/assert-mode",{method:"POST",body:JSON.stringify({enable:e})}),Zi=e=>n("/api/mobile/recording/annotate-mode",{method:"POST",body:JSON.stringify({enable:e})}),ec=(e=1,t=!1)=>n("/api/mobile/recording/playback",{method:"POST",body:JSON.stringify({speed:e,restart:t})}),tc=e=>n("/api/mobile/recording/generate",{method:"POST",body:JSON.stringify(e)}),sc=e=>n("/api/mobile/recording/generate/followup",{method:"POST",body:JSON.stringify(e)}),nc=e=>n("/api/mobile/recording/generate/stop",{method:"POST",body:JSON.stringify({requestId:e})}),oc=()=>n("/api/mobile/project/tests"),rc=(e={})=>{const t=new URLSearchParams;e.search&&t.set("search",e.search),e.tag&&t.set("tag",e.tag),e.limit&&t.set("limit",String(e.limit));const o=t.toString();return n(`/api/mobile/recordings${o?"?"+o:""}`)},ac=e=>n(`/api/mobile/recordings/${encodeURIComponent(e)}`),ic=e=>n("/api/mobile/recordings",{method:"POST",body:JSON.stringify(e)}),cc=(e,t)=>n(`/api/mobile/recordings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),ks="testver.mobileRecordingId";function lc(){try{const t=sessionStorage.getItem(ks);if(t)return t}catch{}const e=be();return e?`draft-${e}`:"draft-anonymous"}function dc(){const e=`mrec-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{sessionStorage.setItem(ks,e)}catch{}return e}const uc=e=>n(`/api/mobile/recordings/${encodeURIComponent(e)}`,{method:"DELETE"}),mc=(e={})=>{const t=new URLSearchParams;e.includeArchived&&t.set("status","all"),e.type&&t.set("type",e.type),e.search&&t.set("search",e.search);const o=t.toString();return n(`/api/tm/source-summaries${o?`?${o}`:""}`)},pc=async e=>{const t=await ae();return n("/api/ai/chat-stream",{method:"POST",body:JSON.stringify({...e,clientId:t})})},hc=()=>n("/api/ai/chat-reset",{method:"POST"}),Cs=e=>n(`/api/ai/runs${e?`?sessionId=${encodeURIComponent(e)}`:""}`),fc=e=>n(`/api/ai/runs/${encodeURIComponent(e)}/saved`,{method:"POST"}),gc=(e,t=0)=>n(`/api/ai/runs/${encodeURIComponent(e)}${t>0?`?after=${t}`:""}`),xc=e=>n("/api/ai/chat-stream/stop",{method:"POST",body:JSON.stringify(e)}),bc=e=>n("/api/ai/new-test",{method:"POST",body:JSON.stringify(e)}),yc=e=>n("/api/ai/code-review",{method:"POST",body:JSON.stringify(e)}),wc=e=>n("/api/ai/apply-review-fixes",{method:"POST",body:JSON.stringify(e)}),Sc=async(e,t)=>{const o=new FormData;for(const i of e)o.append("files",i);const a={},l=G();l&&(a.Authorization=`Bearer ${l}`);const c=await fetch(`/api/upload${t==="api"?"?mode=api":""}`,{method:"POST",body:o,headers:a});if(!c.ok){const i=await c.json().catch(()=>({error:c.statusText}));throw new Error(i.error||c.statusText)}return c.json()},vc=e=>n(`/api/upload/${e}`,{method:"DELETE"}),jc=async e=>{const t=await ae();return n("/api/browser/chat",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Tc=()=>n("/api/browser/status"),Nc=()=>n("/api/browser/screenshot",{method:"POST"}),kc=()=>n("/api/browser/viewport"),Cc=()=>n("/api/browser/close",{method:"POST"}),Oc=()=>n("/api/browser/keepalive",{method:"POST"}),Pc=()=>n("/api/tests/explore"),Os=(e,t)=>n(`/api/tests/scenario/${encodeURIComponent(e)}/history${t?`?file=${encodeURIComponent(t)}`:""}`),Ec=(e,t,o,a)=>n(`/api/tests/source?file=${encodeURIComponent(e)}&startLine=${t}${o?`&endLine=${o}`:""}${a?`&framework=${encodeURIComponent(a)}`:""}`),Rc=(e,t)=>n(`/api/tests/source?file=${encodeURIComponent(e)}&testName=${encodeURIComponent(t)}`),$c=(e,t)=>n(`/api/tests/step-definition?step=${encodeURIComponent(e)}${t?`&keyword=${encodeURIComponent(t)}`:""}`),Ac=e=>n("/api/tests/step-definitions",{method:"POST",body:JSON.stringify({steps:e})}),Ic=Os,Lc=e=>n("/api/cicd/generate",{method:"POST",body:JSON.stringify(e)}),Dc=e=>n("/api/cicd/save",{method:"POST",body:JSON.stringify(e)}),Mc=()=>n("/api/cicd/pipelines"),_c=e=>e.id?n(`/api/cicd/pipelines/${e.id}`,{method:"PUT",body:JSON.stringify(e)}):n("/api/cicd/pipelines",{method:"POST",body:JSON.stringify(e)}),Uc=e=>n(`/api/cicd/pipelines/${e}`,{method:"DELETE"}),Jc=()=>n("/api/cicd/tokens"),Fc=e=>n("/api/cicd/tokens",{method:"POST",body:JSON.stringify(e)}),Bc=e=>n(`/api/cicd/pipelines/${e}/previous-names`,{method:"DELETE"}),Gc=e=>n(`/api/cicd/tokens/${e}`,{method:"DELETE"}),zc=()=>n("/api/auth/access-tokens"),qc=()=>n("/api/testver-mcp"),Wc=e=>n(`/api/testver-mcp/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),Hc=()=>n("/api/auth/access-tokens/all"),Kc=e=>n("/api/auth/access-tokens",{method:"POST",body:JSON.stringify(e)}),Vc=e=>n("/api/auth/access-tokens/limits",{method:"PUT",body:JSON.stringify(e)}),Yc=(e,t)=>n(`/api/auth/access-tokens/${encodeURIComponent(e)}/renew`,{method:"POST",body:JSON.stringify({days:t})}),Qc=e=>n(`/api/auth/access-tokens/${encodeURIComponent(e)}`,{method:"DELETE"}),Xc=(e=50)=>n(`/api/cicd/ci-runs?limit=${e}`),Zc=e=>n(`/api/cicd/ci-runs/${e}/cancel`,{method:"POST"}),el=()=>n("/api/cicd/ci-analytics"),tl=e=>n(`/api/cicd/trace?q=${encodeURIComponent(e)}`),sl=()=>n("/api/chat/sessions"),nl=e=>n(`/api/chat/sessions/${encodeURIComponent(e)}`),ol=(e,t,o)=>n("/api/chat/sessions",{method:"POST",body:JSON.stringify({id:e,title:t,mode:o})}),rl=()=>n(`/api/reports?_t=${Date.now()}`),al=()=>n(`/api/reports/shared?_t=${Date.now()}`),il=e=>n(`/api/reports/${encodeURIComponent(e)}?_t=${Date.now()}`),cl=e=>n("/api/reports",{method:"POST",body:JSON.stringify(e)}),ll=(e,t)=>n(`/api/reports/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),dl=e=>n(`/api/reports/${encodeURIComponent(e)}`,{method:"DELETE"}),ul=e=>n(`/api/reports/${encodeURIComponent(e)}/regenerate`,{method:"POST",body:JSON.stringify({})}),ml=(e,t)=>n(`/api/reports/${encodeURIComponent(e)}/share`,{method:"POST",body:JSON.stringify(t?{expiresInDays:t}:{})}),pl=(e,t)=>"reportId"in t?Se(`/api/reports/${encodeURIComponent(t.reportId)}/export/${e}`,{method:"GET"},`report.${e}`):"shareToken"in t?Se(`/api/reports/share/${encodeURIComponent(t.shareToken)}/export/${e}`,{method:"GET"},`report.${e}`):Se(`/api/reports/export/${e}`,{method:"POST",body:JSON.stringify({spec:t.spec})},`${t.title||"report"}.${e}`),hl=e=>n(`/api/reports/${encodeURIComponent(e)}/share`,{method:"DELETE"}),fl=e=>n(`/api/reports/share/${encodeURIComponent(e)}`),gl=()=>n(`/api/reports/schedules?_t=${Date.now()}`),xl=e=>n(`/api/reports/schedules/${encodeURIComponent(e)}`),bl=e=>n("/api/reports/schedules",{method:"POST",body:JSON.stringify(e)}),yl=(e,t)=>n(`/api/reports/schedules/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),wl=e=>n(`/api/reports/schedules/${encodeURIComponent(e)}`,{method:"DELETE"}),Sl=e=>n(`/api/reports/schedules/${encodeURIComponent(e)}/run-now`,{method:"POST",body:JSON.stringify({})}),vl=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/permission-mode`,{method:"PATCH",body:JSON.stringify({permissionMode:t})}),jl=(e,t)=>n("/api/ai/chat-stream/permission-mode",{method:"POST",body:JSON.stringify({requestId:e,permissionMode:t})}),Tl=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/mode`,{method:"PATCH",body:JSON.stringify({mode:t})}),Nl=(e,t,o,a)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify({role:t,content:o,...a?{requestId:a}:{}})}),kl=(e,t,o)=>n(`/api/chat/sessions/${encodeURIComponent(e)}/timeline`,{method:"PUT",body:JSON.stringify({fullTimeline:t,...o?{runId:o}:{}})}),Cl=(e,t)=>n(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({title:t})}),Ol=e=>n(`/api/chat/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),Pl=()=>n("/api/chat/sessions",{method:"DELETE"}),El=async e=>{const t=await ae();return n("/api/recorder/start",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Rl=()=>n("/api/recorder/stop",{method:"POST"}),$l=()=>n("/api/recorder/status"),Al=e=>n("/api/recorder/load",{method:"POST",body:JSON.stringify({sessionId:e})}),Il=()=>n("/api/recorder/actions"),Ll=async e=>{const t=await ae();return n("/api/recorder/generate",{method:"POST",body:JSON.stringify({...e,clientId:t})})},Dl=e=>n("/api/recorder/abort",{method:"POST",body:JSON.stringify(e)}),Ml=async e=>{const t=await ae();return n("/api/recorder/followup",{method:"POST",body:JSON.stringify({...e,clientId:t})})},_l=e=>n("/api/recorder/playback",{method:"POST",body:JSON.stringify(e)}),Ul=e=>n(`/api/recorder/actions/${encodeURIComponent(e)}`,{method:"DELETE"}),Jl=(e,t)=>n(`/api/recorder/actions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({action:t})}),Fl=(e,t)=>n("/api/recorder/actions",{method:"POST",body:JSON.stringify({action:e,...t!==void 0?{afterId:t}:{}})}),Bl=(e,t)=>n("/api/recorder/actions/replace",{method:"POST",body:JSON.stringify({actionIds:e,action:t})}),Gl=e=>n(`/api/recorder/actions/${encodeURIComponent(e)}/restore`,{method:"POST",body:"{}"}),zl=(e,t,o)=>{const a=new URLSearchParams;return e&&a.set("q",e),t!=null&&t.length&&a.set("kinds",t.join(",")),o&&a.set("limit",String(o)),n(`/api/recorder/references?${a.toString()}`)},ql=e=>n(`/api/recorder/test-data?file=${encodeURIComponent(e)}`),Wl=e=>n("/api/recorder/settings",{method:"PUT",body:JSON.stringify({settings:e})}),Hl=()=>n("/api/recorder/reinspect",{method:"POST"}),Kl=e=>n("/api/recorder/reorder",{method:"POST",body:JSON.stringify({actionIds:e})}),Vl=()=>n("/api/recorder/pause",{method:"POST"}),Yl=()=>n("/api/recorder/resume",{method:"POST"}),Ql=()=>n("/api/recorder/resume-recording",{method:"POST"}),Xl=e=>{const t=new URLSearchParams;e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.template)!==void 0&&t.set("template",String(e.template)),e!=null&&e.limit&&t.set("limit",String(e.limit));const o=t.toString();return n(`/api/recorder/history${o?"?"+o:""}`)},Zl=e=>n(`/api/recorder/history/${e}`),ed=e=>n("/api/recorder/history",{method:"POST",body:JSON.stringify(e)}),td=(e,t)=>n(`/api/recorder/history/${e}`,{method:"PUT",body:JSON.stringify(t)}),sd=e=>n(`/api/recorder/history/${e}`,{method:"DELETE"}),nd=(e,t)=>n(`/api/recorder/history/compare/${e}/${t}`),od=e=>n("/api/recorder/assert-mode",{method:"POST",body:JSON.stringify({enable:e})}),rd=e=>n("/api/recorder/annotate-mode",{method:"POST",body:JSON.stringify({enable:e})}),ad=()=>n("/api/recorder/reset",{method:"POST"}),id=e=>n("/api/cloud/grid/connect",{method:"POST",body:JSON.stringify({takeover:(e==null?void 0:e.takeover)===!0})}),cd=()=>n("/api/cloud/grid/connection",{method:"DELETE"}),ld=()=>n("/api/cloud/grid/status"),dd=e=>n(`/api/runner/grid-browsers?command=${encodeURIComponent(e)}`),ud=()=>n("/api/cloud/grid/usage"),md=()=>n("/api/cloud/grid/test",{method:"POST"}),pd=e=>n(`/api/runner/runs/${encodeURIComponent(e)}/live`),hd=()=>n("/api/runner/runs/live"),fd=()=>n("/api/cloud/grid/sessions"),gd=e=>n(`/api/cloud/grid/sessions/${e}`,{method:"DELETE"});function xd(e){const t=G();return`/api/cloud/grid/live/${e}${t?`?token=${encodeURIComponent(t)}`:""}`}const bd=e=>n("/api/cloud/providers",{method:"POST",body:JSON.stringify({id:"testver-grid",...e})}),yd=()=>n("/api/mobile/local/status"),wd=()=>n("/api/mobile/local/config"),Sd=e=>n("/api/mobile/local/config",{method:"POST",body:JSON.stringify(e)}),vd=e=>n("/api/mobile/local/emulator/start",{method:"POST",body:JSON.stringify({avd:e})}),jd=e=>n("/api/mobile/local/emulator/stop",{method:"POST",body:JSON.stringify({serial:e})}),Td=e=>n("/api/mobile/local/simulator/start",{method:"POST",body:JSON.stringify({udid:e})}),Nd=e=>n("/api/mobile/local/simulator/stop",{method:"POST",body:JSON.stringify({udid:e})}),kd=()=>n("/api/cloud/providers"),Cd=e=>n(`/api/cloud/providers/${e}`),Od=e=>n("/api/cloud/providers",{method:"POST",body:JSON.stringify(e)}),Pd=e=>n(`/api/cloud/providers/${e}`,{method:"DELETE"}),Ed=e=>n("/api/cloud/default-provider",{method:"PUT",body:JSON.stringify({provider:e})}),Rd=e=>n("/api/cloud/test-connection",{method:"POST",body:JSON.stringify(e)}),$d=(e,t=10)=>n(`/api/cloud/providers/${e}/builds?limit=${t}`),Ad=(e,t)=>n(`/api/cloud/providers/${e}/env-vars${t?`?buildName=${encodeURIComponent(t)}`:""}`),Id=e=>n(`/api/cloud/providers/${e}/hub-url`),Ld=()=>n("/api/cloud/schedules"),Dd=e=>n("/api/cloud/schedules",{method:"POST",body:JSON.stringify(e)}),Md=(e,t)=>n(`/api/cloud/schedules/${e}`,{method:"PUT",body:JSON.stringify(t)}),_d=e=>n(`/api/cloud/schedules/${e}`,{method:"DELETE"}),Ud=(e,t)=>n("/api/cloud/analyze",{method:"POST",body:JSON.stringify({provider:e,command:t||void 0})}),Jd=e=>n(`/api/results/runs/${e}/fetch-artifacts`,{method:"POST"}),Fd=e=>n(`/api/cloud/schedules/${e}/run-now`,{method:"POST"}),Bd=()=>n("/api/cloud/schedules/next-runs"),Gd=()=>n("/api/api-testing/collections"),zd=e=>n(`/api/api-testing/collections/${e}`),qd=e=>n("/api/api-testing/collections",{method:"POST",body:JSON.stringify(e)}),Wd=(e,t)=>n(`/api/api-testing/collections/${e}`,{method:"PUT",body:JSON.stringify(t)}),Hd=e=>n(`/api/api-testing/collections/${e}`,{method:"DELETE"}),Kd=(e,t,o)=>n(`/api/api-testing/collections/${e}/requests`,{method:"POST",body:JSON.stringify({request:t,folderId:o})}),Vd=(e,t)=>n(`/api/api-testing/collections/${e}/requests/${t}`,{method:"DELETE"}),Yd=(e,t)=>n(`/api/api-testing/collections/${e}/folders`,{method:"POST",body:JSON.stringify({name:t})}),Qd=(e,t,o)=>n(`/api/api-testing/collections/${e}/folders/${t}`,{method:"PUT",body:JSON.stringify(o)}),Xd=(e,t)=>n(`/api/api-testing/collections/${e}/folders/${t}`,{method:"DELETE"}),Zd=e=>n(`/api/api-testing/collections/${e}/environments`),eu=(e,t)=>n(`/api/api-testing/collections/${e}/environments`,{method:"POST",body:JSON.stringify(t)}),tu=(e,t,o)=>n(`/api/api-testing/collections/${e}/environments/${t}`,{method:"PUT",body:JSON.stringify(o)}),su=(e,t)=>n(`/api/api-testing/collections/${e}/environments/${t}`,{method:"DELETE"}),nu=(e,t,o,a)=>n("/api/api-testing/send",{method:"POST",body:JSON.stringify({request:e,variables:t,collectionId:o,environmentId:a})}),ou=(e,t)=>n("/api/api-testing/send-chain",{method:"POST",body:JSON.stringify({requests:e,variables:t})}),ru=()=>n("/api/api-testing/storage"),au=(e=50)=>n(`/api/api-testing/history?limit=${e}`),iu=()=>n("/api/api-testing/history",{method:"DELETE"}),cu=(e,t)=>n("/api/api-testing/import",{method:"POST",body:JSON.stringify({data:e,format:t})}),lu=(e,t,o)=>n(`/api/api-testing/collections/${e}/requests/reorder`,{method:"PUT",body:JSON.stringify({folderId:t,requestIds:o})}),du=(e,t,o)=>n(`/api/api-testing/collections/${e}/requests/${t}/move`,{method:"POST",body:JSON.stringify({targetFolderId:o})}),uu=e=>n(`/api/api-testing/collections/${e}/export`),mu=async(e,t)=>{const o=G(),a=await fetch(`${te}/api/api-testing/collections/${e}/export`,{headers:o?{Authorization:`Bearer ${o}`}:{}});if(!a.ok)throw new Error("Export failed");const l=await a.json(),c={testver:!0,version:"1.0",exportedAt:new Date().toISOString(),collections:[l]},i=new Blob([JSON.stringify(c,null,2)],{type:"application/json"}),r=URL.createObjectURL(i),d=document.createElement("a");d.href=r,d.download=`${t.replace(/[^a-zA-Z0-9-_]/g,"_")}.testver.json`,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(r)},pu=async()=>{const e=G(),t=await fetch(`${te}/api/api-testing/export-all`,{headers:e?{Authorization:`Bearer ${e}`}:{}});if(!t.ok)throw new Error("Export failed");const o=await t.blob(),a=URL.createObjectURL(o),l=document.createElement("a");l.href=a,l.download=`testver-collections-${Date.now()}.testver.json`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)},hu=(e,t)=>n("/api/api-testing/parse-spec",{method:"POST",body:JSON.stringify({content:e,format:t})}),fu=e=>n("/api/ai/generate-api-scenarios",{method:"POST",body:JSON.stringify(e)}),ut=()=>n("/api/git/status"),Ps=e=>n(`/api/git/blame?file=${encodeURIComponent(e)}`),mt=(e=20,t)=>n(`/api/git/log?limit=${e}${t?`&file=${encodeURIComponent(t)}`:""}`),Es=e=>n(`/api/git/diff/${e}`),Rs=e=>n(`/api/git/diff/uncommitted${e?`?file=${encodeURIComponent(e)}`:""}`),$s=(e,t=30)=>n(`/api/git/churn?file=${encodeURIComponent(e)}&days=${t}`),As=e=>n(`/api/git/correlate/${e}`),Is=e=>n(`/api/git/ownership/${e}`),Ls=(e,t=!1)=>n("/api/git/stage",{method:"POST",body:JSON.stringify(t?{files:e,includeTestver:t}:{files:e})}),Ds=e=>n("/api/git/unstage",{method:"POST",body:JSON.stringify({files:e})}),Ms=(e,t={})=>n("/api/git/commit",{method:"POST",body:JSON.stringify({message:e,amend:!!t.amend,...t.confirmPushedAmend?{confirmPushedAmend:!0}:{},...t.includeTestver?{includeTestver:!0}:{}})}),_s=()=>n("/api/git/identity"),Us=()=>n("/api/git/last-commit"),Js=(e,t,o=!1)=>n("/api/git/discard",{method:"POST",body:JSON.stringify({files:e,...t?{scope:t}:{},...o?{includeTestver:o}:{}})}),Fs=()=>n("/api/git/stash"),Bs=(e,t=!0)=>n("/api/git/stash",{method:"POST",body:JSON.stringify({message:e,includeUntracked:t})}),Gs=(e,t)=>n("/api/git/stash/pop",{method:"POST",body:JSON.stringify({ref:e,sha:t})}),zs=(e,t)=>n("/api/git/stash/drop",{method:"POST",body:JSON.stringify({ref:e,sha:t})}),qs=()=>n("/api/git/stash/back-out",{method:"POST"}),Ws=()=>n("/api/git/operation/abort",{method:"POST"}),Hs=()=>n("/api/git/operation/skip",{method:"POST"}),Ks=()=>n("/api/git/operation/continue",{method:"POST"}),Vs=e=>n("/api/git/fetch",{method:"POST",body:JSON.stringify({remote:e})}),Ys=(e,t)=>n("/api/git/pull",{method:"POST",body:JSON.stringify({remote:e,branch:t})}),Qs=(e,t)=>n("/api/git/push",{method:"POST",body:JSON.stringify({remote:e,branch:t})}),Xs=()=>n("/api/git/remote-updates"),Zs=()=>n("/api/git/remote-updates/check",{method:"POST"}),en=()=>n("/api/git/remote-updates/incoming"),tn=()=>n("/api/git/remote-updates/stash-pull",{method:"POST"}),sn=()=>n("/api/git/remote-updates/match-remote",{method:"POST"}),nn=e=>n("/api/git/branch/delete",{method:"POST",body:JSON.stringify({name:e})}),gu=()=>n("/api/system/remote-updates"),xu=e=>n("/api/system/remote-updates",{method:"PUT",body:JSON.stringify(e)}),on=(e,t,o=!1)=>n("/api/askpass/answer",{method:"POST",body:JSON.stringify({requestId:e,value:t,remember:o})}),rn=e=>n("/api/askpass/cancel",{method:"POST",body:JSON.stringify({requestId:e})}),bu=()=>n("/api/askpass/cache"),yu=()=>n("/api/askpass/forget",{method:"POST"}),wu=e=>n(`/api/git/conflict?file=${encodeURIComponent(e)}`),an=(e,t)=>n("/api/git/conflict/resolve",{method:"POST",body:JSON.stringify(typeof t=="string"?{path:e,content:t}:{path:e,...t})}),cn=()=>n("/api/git/branches"),ln=(e,t=!0)=>n("/api/git/branch/create",{method:"POST",body:JSON.stringify({name:e,checkout:t})}),dn=e=>n("/api/git/branch/switch",{method:"POST",body:JSON.stringify({name:e})});async function un(){const e=await n("/api/auth/session/extend",{method:"POST"});return oe({expiresAt:e.expiresAt,absoluteExpiresAt:e.absoluteExpiresAt}),e}const Su=()=>n("/api/system/session-policy");async function vu(e){const t=await n("/api/system/session-policy",{method:"PUT",body:JSON.stringify(e)});return us(t),t}const pt=()=>n("/api/auth/status"),mn="testver.trustedBrowsers";function ht(){try{const e=JSON.parse(localStorage.getItem(mn)||"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string").slice(0,10):[]}catch{return[]}}function pn(e){try{localStorage.setItem(mn,JSON.stringify([e,...ht().filter(t=>t!==e)].slice(0,10)))}catch{}}const hn=(e,t)=>n("/api/auth/login",{method:"POST",body:JSON.stringify({username:e,password:t,trustedBrowsers:ht()})});async function fn(e){const t=await n("/api/auth/login/2fa",{method:"POST",body:JSON.stringify(e)});return t.trustedBrowser&&pn(t.trustedBrowser),t}const gn=e=>n("/api/auth/login/2fa/setup",{method:"POST",body:JSON.stringify({challenge:e})}),xn=(e,t)=>n("/api/auth/login/2fa/enable",{method:"POST",body:JSON.stringify({challenge:e,code:t})}),bn=e=>n("/api/auth/forgot-password",{method:"POST",body:JSON.stringify({identifier:e})}),yn=e=>n(`/api/auth/reset-password/${encodeURIComponent(e)}`),wn=(e,t)=>n("/api/auth/reset-password",{method:"POST",body:JSON.stringify({token:e,password:t})}),Sn=e=>n("/api/auth/setup",{method:"POST",body:JSON.stringify(e)}),vn=()=>n("/api/auth/logout",{method:"POST"}),ju=(e,t)=>n("/api/auth/change-password",{method:"POST",body:JSON.stringify({currentPassword:e,newPassword:t})}),Tu=()=>n("/api/auth/me"),Nu=()=>n("/api/auth/2fa"),jn=e=>n("/api/auth/2fa/setup",{method:"POST",body:JSON.stringify({password:e})}),Tn=(e,t)=>n("/api/auth/2fa/enable",{method:"POST",body:JSON.stringify({code:e,signOutOthers:t})}),ku=(e,t)=>n("/api/auth/2fa/recovery-codes",{method:"POST",body:JSON.stringify({password:e,...t})}),Cu=(e,t)=>n("/api/auth/2fa/disable",{method:"POST",body:JSON.stringify({password:e,...t})}),Ou=e=>n(`/api/auth/2fa/trusted-browsers/${encodeURIComponent(e)}`,{method:"DELETE"}),Pu=()=>n("/api/auth/2fa/trusted-browsers",{method:"DELETE"}),Eu=()=>n("/api/system/two-factor-policy"),Ru=e=>n("/api/system/two-factor-policy",{method:"PUT",body:JSON.stringify(e)}),$u=()=>n("/api/system/auth-files"),Au=e=>n("/api/auth/profile",{method:"PUT",body:JSON.stringify(e)}),Iu=()=>n("/api/auth/sessions"),Lu=e=>n(`/api/auth/sessions/${e}`,{method:"DELETE"}),Du=()=>n("/api/auth/sessions/revoke-others",{method:"POST"}),Mu=(e=20,t=0)=>n(`/api/auth/activity?limit=${e}&offset=${t}`),_u=()=>n("/api/auth/users"),Uu=e=>n("/api/auth/users",{method:"POST",body:JSON.stringify(e)}),Ju=(e,t)=>n(`/api/auth/users/${e}`,{method:"PUT",body:JSON.stringify(t)}),Fu=e=>n(`/api/auth/users/${e}`,{method:"DELETE"}),Bu=(e,t)=>n(`/api/auth/users/${e}/reset-password`,{method:"POST",body:JSON.stringify({newPassword:t})}),Gu=e=>n(`/api/auth/users/${e}/reset-2fa`,{method:"POST",body:"{}"}),zu=e=>n(`/api/auth/users/${e}/revoke-sessions`,{method:"POST"}),qu=e=>{const t=new URLSearchParams;if(e)for(const[a,l]of Object.entries(e))l!==void 0&&t.set(a,String(l));const o=t.toString();return n(`/api/audit${o?`?${o}`:""}`)},Wu=()=>n("/api/audit/stats"),Hu=()=>n("/api/audit/export"),Ku=()=>n("/api/skills"),Vu=e=>n(`/api/skills/${e}/preview`),Yu=e=>n(`/api/skills/${e}/enable`,{method:"PUT"}),Qu=e=>n(`/api/skills/${e}/disable`,{method:"PUT"}),Xu=e=>n("/api/skills/bulk",{method:"PUT",body:JSON.stringify(e)}),Zu=()=>n("/api/skills/reset",{method:"POST"}),em=(e,t)=>n("/api/skills/create",{method:"POST",body:JSON.stringify({content:e,slug:t})}),tm=(e,t)=>n(`/api/skills/${e}/update`,{method:"PUT",body:JSON.stringify({content:t})}),sm=e=>n(`/api/skills/${e}`,{method:"DELETE"}),nm=(e,t)=>n("/api/skills/import",{method:"POST",body:JSON.stringify({content:e,filename:t})}),om=e=>n("/api/skills/import-url",{method:"POST",body:JSON.stringify({url:e})}),rm=e=>n("/api/skills/discover",{method:"POST",body:JSON.stringify({catalogUrl:e})}),am=()=>n("/api/tools/categories"),im=e=>n("/api/skills/chat",{method:"POST",body:JSON.stringify(e)}),cm=e=>`${te}/api/skills/${e}/export`,lm=()=>n("/api/skills/chat/sessions"),dm=e=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}`),um=(e,t,o)=>n("/api/skills/chat/sessions",{method:"POST",body:JSON.stringify({id:e,title:t,...o})}),mm=(e,t,o)=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify({role:t,content:o})}),pm=(e,t)=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({title:t})}),hm=e=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}`,{method:"DELETE"}),fm=()=>n("/api/skills/chat/sessions",{method:"DELETE"}),gm=(e,t)=>n(`/api/skills/chat/sessions/${encodeURIComponent(e)}/selections`,{method:"PUT",body:JSON.stringify(t)}),xm=()=>n("/api/mcp/servers"),bm=e=>n("/api/mcp/servers",{method:"POST",body:JSON.stringify(e)}),ym=(e,t)=>n(`/api/mcp/servers/${e}`,{method:"PUT",body:JSON.stringify(t)}),wm=e=>n(`/api/mcp/servers/${e}`,{method:"DELETE"}),Sm=e=>n(`/api/mcp/servers/${e}/connect`,{method:"POST"}),vm=e=>n(`/api/mcp/servers/${e}/disconnect`,{method:"POST"}),jm=e=>n(`/api/mcp/servers/${e}/test`,{method:"POST"}),Tm=e=>n(`/api/mcp/servers/${e}/enable`,{method:"PUT"}),Nm=e=>n(`/api/mcp/servers/${e}/disable`,{method:"PUT"}),km=e=>n(`/api/mcp/servers/${e}/tools`),Cm=()=>n("/api/mcp/tools"),Om=()=>n("/api/mcp/presets"),Pm=e=>n(`/api/mcp/presets/${e}/add`,{method:"POST"}),Em=()=>n("/api/workflows"),Rm=e=>n(`/api/workflows/${encodeURIComponent(e)}`),$m=(e,t)=>n("/api/workflows",{method:"POST",body:JSON.stringify({yaml:e,id:t})}),Am=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),Im=e=>n(`/api/workflows/${encodeURIComponent(e)}`,{method:"DELETE"}),Lm=e=>n("/api/workflows/validate",{method:"POST",body:JSON.stringify({yaml:e})}),Dm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/run`,{method:"POST",body:JSON.stringify({variables:t})}),Mm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/pause`,{method:"POST",body:JSON.stringify({runId:t})}),_m=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/resume`,{method:"POST",body:JSON.stringify({runId:t})}),Um=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/abort`,{method:"POST",body:JSON.stringify({runId:t})}),Jm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/runs${t?`?limit=${t}`:""}`),Fm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`),Bm=()=>n("/api/workflows/active/runs"),Gm=()=>n("/api/workflows/templates/list"),zm=(e,t,o)=>n("/api/workflows/from-template",{method:"POST",body:JSON.stringify({templateId:e,parameters:t,id:o})}),qm=e=>n("/api/workflows/generate",{method:"POST",body:JSON.stringify({description:e})}),Wm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/duplicate`,{method:"POST",body:JSON.stringify({id:t})}),Hm=e=>n("/api/workflows/import",{method:"POST",body:JSON.stringify(e)}),Km=(e,t,o)=>n(`/api/workflows/${encodeURIComponent(e)}/schedule`,{method:"POST",body:JSON.stringify({cron:t,enabled:o})}),Vm=e=>n(`/api/workflows/${encodeURIComponent(e)}/schedule`,{method:"DELETE"}),Ym=e=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks`),Qm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks`,{method:"POST",body:JSON.stringify(t)}),Xm=(e,t,o)=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(o)}),Zm=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/webhooks/${encodeURIComponent(t)}`,{method:"DELETE"}),ep=e=>n(`/api/workflows/${encodeURIComponent(e)}/events`),tp=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/events`,{method:"PUT",body:JSON.stringify({subscriptions:t})}),sp=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/dry-run`,{method:"POST",body:JSON.stringify({variables:t})}),np=e=>n(`/api/workflows/${encodeURIComponent(e)}/versions`),op=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/versions/${t}/restore`,{method:"POST"}),rp=e=>n(`/api/workflows/${encodeURIComponent(e)}/notifications`),ap=(e,t)=>n(`/api/workflows/${encodeURIComponent(e)}/notifications`,{method:"PUT",body:JSON.stringify({notifications:t})}),ip=e=>n("/api/tm/folders",{method:"POST",body:JSON.stringify(e)}),cp=()=>n("/api/tm/folders"),lp=()=>n("/api/tm/folders/tree"),dp=e=>n(`/api/tm/folders/${e}`),up=(e,t)=>n(`/api/tm/folders/${e}`,{method:"PUT",body:JSON.stringify(t)}),mp=e=>n(`/api/tm/folders/${e}`,{method:"DELETE"}),pp=(e,t)=>n(`/api/tm/folders/${e}/move`,{method:"PUT",body:JSON.stringify({parentId:t})}),hp=e=>n("/api/tm/test-cases",{method:"POST",body:JSON.stringify(e)}),fp=e=>{var c;const t=new URLSearchParams;(e==null?void 0:e.folderId)===null?t.set("folderId","__uncategorized__"):e!=null&&e.folderId&&t.set("folderId",e.folderId),e!=null&&e.priority&&t.set("priority",e.priority),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.automationStatus&&t.set("automationStatus",e.automationStatus),e!=null&&e.reviewStatus&&t.set("reviewStatus",e.reviewStatus),(c=e==null?void 0:e.tagIds)!=null&&c.length&&t.set("tagIds",e.tagIds.join(",")),e!=null&&e.sourceId&&t.set("sourceId",e.sourceId),e!=null&&e.search&&t.set("search",e.search);const o=e==null?void 0:e.limit;o&&t.set("limit",String(o));let a=e==null?void 0:e.offset;a===void 0&&(e!=null&&e.page)&&e.page>1&&o&&(a=(e.page-1)*o),a!==void 0&&t.set("offset",String(a)),e!=null&&e.sort&&t.set("sort",e.sort),e!=null&&e.order&&t.set("order",e.order);const l=t.toString();return n(`/api/tm/test-cases${l?`?${l}`:""}`)},gp=e=>n(`/api/tm/test-cases/${e}`),xp=(e,t)=>n(`/api/tm/test-cases/${e}`,{method:"PUT",body:JSON.stringify(t)}),bp=e=>n(`/api/tm/test-cases/${e}`,{method:"DELETE"}),yp=e=>n("/api/tm/test-cases/bulk-delete",{method:"POST",body:JSON.stringify({ids:e})}),wp=(e,t)=>n("/api/tm/test-cases/bulk-review",{method:"POST",body:JSON.stringify({ids:e,reviewStatus:t})}),Sp=e=>n("/api/tm/ai/fix-cases",{method:"POST",body:JSON.stringify({cases:e})}),vp=e=>n("/api/tm/test-cases/push-jira",{method:"POST",body:JSON.stringify(e)}),jp=(e,t)=>n("/api/tm/test-cases/bulk-move",{method:"POST",body:JSON.stringify({ids:e,folderId:t})}),Tp=(e,t)=>n("/api/tm/test-cases/bulk-tag",{method:"POST",body:JSON.stringify({ids:e,tagIds:t})}),Np=e=>n(`/api/tm/test-cases/${e}/steps`),kp=(e,t)=>n(`/api/tm/test-cases/${e}/steps`,{method:"PUT",body:JSON.stringify({steps:t})}),Cp=e=>n("/api/tm/tags",{method:"POST",body:JSON.stringify(e)}),Op=()=>n("/api/tm/tags"),Pp=(e,t)=>n(`/api/tm/tags/${e}`,{method:"PUT",body:JSON.stringify(t)}),Ep=e=>n(`/api/tm/tags/${e}`,{method:"DELETE"}),Rp=(e,t)=>n(`/api/tm/test-cases/${e}/tags`,{method:"PUT",body:JSON.stringify({tagIds:t})}),$p=e=>n("/api/tm/custom-fields",{method:"POST",body:JSON.stringify(e)}),Ap=()=>n("/api/tm/custom-fields"),Ip=(e,t)=>n(`/api/tm/custom-fields/${e}`,{method:"PUT",body:JSON.stringify(t)}),Lp=e=>n(`/api/tm/custom-fields/${e}`,{method:"DELETE"}),Dp=(e,t)=>n(`/api/tm/test-cases/${e}/custom-fields`,{method:"PUT",body:JSON.stringify({values:t})}),Mp=e=>n(`/api/tm/test-cases/${e}/versions`),_p=(e,t)=>n(`/api/tm/test-cases/${e}/versions/${t}`),Up=(e,t,o)=>n(`/api/tm/test-cases/${e}/rollback`,{method:"POST",body:JSON.stringify({version:t,changedBy:o})}),Jp=(e,t)=>n(`/api/tm/test-cases/${e}/mapping`,{method:"PUT",body:JSON.stringify(t)}),Fp=e=>n(`/api/tm/test-cases/${e}/mapping`),Bp=e=>n(`/api/tm/test-cases/${e}/mapping`,{method:"DELETE"}),Gp=()=>n("/api/tm/mappings"),zp=()=>n("/api/tm/stats"),qp=e=>n("/api/tm/plans",{method:"POST",body:JSON.stringify(e)}),Wp=e=>{const t=e?`?status=${e}`:"";return n(`/api/tm/plans${t}`)},Hp=e=>n(`/api/tm/plans/${e}`),Kp=(e,t)=>n(`/api/tm/plans/${e}`,{method:"PUT",body:JSON.stringify(t)}),Vp=e=>n(`/api/tm/plans/${e}`,{method:"DELETE"}),Yp=(e,t,o)=>n(`/api/tm/plans/${e}/test-cases`,{method:"POST",body:JSON.stringify({testCaseIds:t,addedBy:o})}),Qp=(e,t)=>n(`/api/tm/plans/${e}/test-cases`,{method:"DELETE",body:JSON.stringify({testCaseIds:t})}),Xp=e=>n(`/api/tm/plans/${e}/test-cases`),Zp=(e,t)=>n(`/api/tm/plans/${e}/cycles`,{method:"POST",body:JSON.stringify(t)}),eh=e=>n(`/api/tm/plans/${e}/cycles`),th=e=>n(`/api/tm/cycles/${e}`),sh=(e,t)=>n(`/api/tm/cycles/${e}`,{method:"PUT",body:JSON.stringify(t)}),nh=e=>n(`/api/tm/cycles/${e}`,{method:"DELETE"}),oh=(e,t)=>n(`/api/tm/cycles/${e}/rerun-failed`,{method:"POST",body:JSON.stringify(t)}),rh=(e,t)=>{const o=t?`?status=${t}`:"";return n(`/api/tm/cycles/${e}/executions${o}`)},ah=e=>n(`/api/tm/executions/${e}`),ih=(e,t)=>n(`/api/tm/executions/${e}`,{method:"PUT",body:JSON.stringify(t)}),ch=e=>n(`/api/tm/executions/${e}/steps`),lh=(e,t)=>n(`/api/tm/step-results/${e}`,{method:"PUT",body:JSON.stringify(t)}),dh=(e,t,o)=>n(`/api/tm/executions/${e}/steps/bulk`,{method:"PUT",body:JSON.stringify({status:t,executedBy:o})}),uh=e=>n(`/api/tm/cycles/${e}/analytics`),mh=(e,t)=>n("/api/tm/cycles/compare",{method:"POST",body:JSON.stringify({cycleId1:e,cycleId2:t})}),ph=e=>n(`/api/tm/test-cases/${e}/execution-history`),hh=()=>n("/api/tm/execution-dots"),fh=()=>n("/api/tm/mappings/dashboard"),gh=()=>n("/api/tm/mappings/unmapped"),xh=()=>n("/api/tm/mappings/mapped"),bh=e=>n(`/api/tm/mappings/by-status/${e}`),yh=e=>n("/api/tm/mappings/bulk",{method:"POST",body:JSON.stringify({mappings:e})}),wh=e=>n("/api/tm/mappings/bulk",{method:"DELETE",body:JSON.stringify({testCaseIds:e})}),Sh=(e,t,o)=>n("/api/tm/mappings/sync-status",{method:"PUT",body:JSON.stringify({testCaseId:e,syncStatus:t,scriptHash:o})}),vh=(e,t)=>n("/api/tm/mappings/bulk-sync-status",{method:"PUT",body:JSON.stringify({testCaseIds:e,syncStatus:t})}),jh=()=>n("/api/tm/mappings/check-sync",{method:"POST"}),Th=(e,t)=>n("/api/tm/mappings/execute",{method:"POST",body:JSON.stringify({testCaseId:e,...t})}),Nh=e=>n(`/api/tm/mappings/search?q=${encodeURIComponent(e)}`),kh=e=>n(`/api/tm/sources/${encodeURIComponent(e)}/coverage-matrix`);async function*Ch(e,t,o,a="POST"){const l=G(),c={"Content-Type":"application/json",Accept:"text/event-stream"};l&&(c.Authorization=`Bearer ${l}`);const i=be();i&&(c["X-Client-Id"]=i),c["X-Testver-Last-Activity"]=String(ds()),a==="GET"&&delete c["Content-Type"];const r=await fetch(`${te}${e}`,{method:a,headers:c,body:a==="GET"?void 0:JSON.stringify(t),signal:o});if(hs(r),!r.ok||!r.body){const p=await r.text().catch(()=>"");let g={};try{g=JSON.parse(p)}catch{}if(r.status===401&&r.headers.get("x-testver-auth"))throw Re(r.headers.get("x-testver-auth")),new Error(g.error||"Session expired");const b=new Error(g.error||p||r.statusText);throw b.status=r.status,g.code&&(b.code=g.code),b}const d=r.body.getReader(),u=new TextDecoder;let h="";try{for(;;){const{value:p,done:g}=await d.read();if(g)break;h+=u.decode(p,{stream:!0});let b;for(;(b=h.indexOf(`
|
|
3
|
+
|
|
4
|
+
`))>=0||(b=h.indexOf(`\r
|
|
5
|
+
\r
|
|
6
|
+
`))>=0;){const k=(h.indexOf(`
|
|
7
|
+
|
|
8
|
+
`)>=0,b),w=h.slice(0,k);h=h.slice(k+(h.slice(k).startsWith(`\r
|
|
9
|
+
\r
|
|
10
|
+
`)?4:2));const S=w.split(/\r?\n/);let O=null,C="";for(const N of S)N.startsWith("event:")?O=N.slice(6).trim():N.startsWith("data:")&&(C+=(C?`
|
|
11
|
+
`:"")+N.slice(5).trim());if(O&&C)try{const N=JSON.parse(C);yield{event:O,data:N}}catch{}}}}finally{try{d.releaseLock()}catch{}}}const Oh=()=>n("/api/tm/ai/jobs/latest"),Ph=e=>n(`/api/tm/ai/jobs/${encodeURIComponent(e)}/cancel`,{method:"POST",body:"{}"}),Eh=e=>n(`/api/tm/ai/jobs/${encodeURIComponent(e)}/dismiss`,{method:"POST",body:"{}"}),Rh=e=>n("/api/tm/ai/estimate",{method:"POST",body:JSON.stringify(e)}),$h=(e,t={})=>n("/api/tm/ai/similar",{method:"POST",body:JSON.stringify({cases:e,...t})}),Ah=e=>n("/api/tm/ai/save-generated",{method:"POST",body:JSON.stringify(e)}),Ih=()=>n("/api/tm/ai/app-model"),Lh=e=>n("/api/tm/ai/grounding",{method:"POST",body:JSON.stringify(e)}),Dh=e=>n("/api/tm/intelligence/predictive-selection",{method:"POST",body:JSON.stringify(e)}),Mh=e=>n("/api/tm/intelligence/suggest-plan",{method:"POST",body:JSON.stringify(e)}),_h=e=>n("/api/tm/intelligence/nl-search",{method:"POST",body:JSON.stringify({query:e})}),Uh=e=>n("/api/tm/intelligence/auto-maintenance",{method:"POST",body:JSON.stringify({changes:e})}),Jh=e=>n("/api/tm/intelligence/risk-assessment",{method:"POST",body:JSON.stringify(e)}),Fh=e=>n("/api/tm/requirements",{method:"POST",body:JSON.stringify(e)}),Bh=e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.priority&&t.set("priority",e.priority),e!=null&&e.search&&t.set("search",e.search);const o=t.toString()?`?${t}`:"";return n(`/api/tm/requirements${o}`)},Gh=e=>n(`/api/tm/requirements/${e}`),zh=(e,t)=>n(`/api/tm/requirements/${e}`,{method:"PUT",body:JSON.stringify(t)}),qh=e=>n(`/api/tm/requirements/${e}`,{method:"DELETE"}),Wh=(e,t)=>n(`/api/tm/requirements/${e}/test-cases`,{method:"POST",body:JSON.stringify({testCaseIds:t})}),Hh=(e,t)=>n(`/api/tm/requirements/${e}/test-cases`,{method:"DELETE",body:JSON.stringify({testCaseIds:t})}),Kh=e=>n(`/api/tm/requirements/${e}/test-cases`),Vh=e=>n(`/api/tm/test-cases/${e}/requirements`),Yh=()=>n("/api/tm/traceability-matrix"),Qh=()=>n("/api/tm/coverage-stats"),Xh=()=>n("/api/tm/execution-analytics"),Zh=()=>n("/api/tm/health-score"),ef=()=>n("/api/tm/orphans"),tf=()=>n("/api/tm/source-traceability"),sf=e=>n("/api/tm/reports/generate",{method:"POST",body:JSON.stringify(e)}),nf=e=>n("/api/tm/defects",{method:"POST",body:JSON.stringify(e)}),of=e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.severity&&t.set("severity",e.severity),e!=null&&e.testCaseId&&t.set("testCaseId",e.testCaseId),e!=null&&e.search&&t.set("search",e.search);const o=t.toString()?`?${t}`:"";return n(`/api/tm/defects${o}`)},rf=e=>n(`/api/tm/defects/${e}`),af=(e,t)=>n(`/api/tm/defects/${e}`,{method:"PUT",body:JSON.stringify(t)}),cf=e=>n(`/api/tm/defects/${e}`,{method:"DELETE"}),lf=()=>n("/api/tm/defects/stats"),df=(e,t)=>n("/api/tm/defects/from-execution",{method:"POST",body:JSON.stringify({executionId:e,createdBy:t})}),uf=e=>n("/api/tm/defects/by-executions",{method:"POST",body:JSON.stringify({executionIds:e})}),mf=(e,t,o)=>n(`/api/tm/defects/${e}/transition`,{method:"PUT",body:JSON.stringify({status:t,performedBy:o})}),pf=e=>n(`/api/tm/defects/${e}/activity`),hf=e=>n(`/api/tm/defects/${e}/comments`),ff=(e,t,o)=>n(`/api/tm/defects/${e}/comments`,{method:"POST",body:JSON.stringify({content:t,author:o})}),gf=(e,t,o)=>n(`/api/tm/defects/${e}/comments/${t}${o?`?deletedBy=${encodeURIComponent(o)}`:""}`,{method:"DELETE"}),xf=e=>n("/api/tm/quality-gates",{method:"POST",body:JSON.stringify(e)}),bf=()=>n("/api/tm/quality-gates"),yf=e=>n(`/api/tm/quality-gates/${e}`),wf=(e,t)=>n(`/api/tm/quality-gates/${e}`,{method:"PUT",body:JSON.stringify(t)}),Sf=e=>n(`/api/tm/quality-gates/${e}`,{method:"DELETE"}),vf=(e,t)=>n(`/api/tm/quality-gates/${e}/evaluate`,{method:"POST",body:JSON.stringify({cycleId:t})}),jf=e=>n("/api/tm/webhooks",{method:"POST",body:JSON.stringify(e)}),Tf=()=>n("/api/tm/webhooks"),Nf=(e,t)=>n(`/api/tm/webhooks/${e}`,{method:"PUT",body:JSON.stringify(t)}),kf=e=>n(`/api/tm/webhooks/${e}`,{method:"DELETE"}),Cf=e=>{const t=e?`?folderId=${e}`:"";return n(`/api/tm/export${t}`)},Of=e=>n("/api/tm/import",{method:"POST",body:JSON.stringify(e)}),Pf=(e,t)=>n(`/api/tm/test-cases/${e}/attachments`,{method:"POST",body:JSON.stringify(t)}),Ef=e=>n(`/api/tm/test-cases/${e}/attachments`),Rf=e=>n(`/api/tm/attachments/${e}`),$f=e=>n(`/api/tm/attachments/${e}`,{method:"DELETE"}),Af=(e,t)=>n(`/api/tm/executions/${e}/attachments`,{method:"POST",body:JSON.stringify(t)}),If=e=>n(`/api/tm/executions/${e}/attachments`),Lf=e=>n(`/api/tm/execution-attachments/${e}`),Df=e=>n(`/api/tm/execution-attachments/${e}`,{method:"DELETE"}),Mf=(e,t)=>n(`/api/tm/test-cases/${e}/links`,{method:"POST",body:JSON.stringify(t)}),_f=e=>n(`/api/tm/test-cases/${e}/links`),Uf=(e,t)=>n(`/api/tm/links/${e}`,{method:"PUT",body:JSON.stringify(t)}),Jf=e=>n(`/api/tm/links/${e}`,{method:"DELETE"}),Ff=e=>n("/api/tm/sources",{method:"POST",body:JSON.stringify(e)}),Bf=e=>{const t=new URLSearchParams;e!=null&&e.type&&t.set("type",e.type),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.search&&t.set("search",e.search);const o=t.toString()?`?${t.toString()}`:"";return n(`/api/tm/sources${o}`)},Gf=e=>n(`/api/tm/sources/${e}`),zf=()=>n("/api/tm/sources-with-test-cases"),qf=(e,t)=>n(`/api/tm/sources/${e}`,{method:"PUT",body:JSON.stringify(t)}),Wf=e=>n(`/api/tm/sources/${encodeURIComponent(e)}/refresh`,{method:"POST"}),Hf=e=>n("/api/tm/test-cases/clear-stale",{method:"POST",body:JSON.stringify({ids:e})}),Kf=e=>n(`/api/tm/sources/${e}`,{method:"DELETE"}),Vf=(e,t,o,a)=>n(`/api/tm/sources/${e}/test-cases`,{method:"POST",body:JSON.stringify({testCaseIds:t,generationMethod:o,linkedBy:a})}),Yf=(e,t)=>n(`/api/tm/sources/${e}/test-cases`,{method:"DELETE",body:JSON.stringify({testCaseIds:t})}),Qf=e=>n(`/api/tm/sources/${e}/test-cases`),Xf=e=>n(`/api/tm/test-cases/${e}/sources`),Zf=()=>n("/api/tm/source-coverage"),eg=e=>n(`/api/tm/executions/${e}/run-automation`,{method:"POST"}),tg=e=>n(`/api/tm/cycles/${e}/run-all-automation`,{method:"POST"}),sg=e=>n(`/api/tm/automation-runs/${e}`),ng=e=>n(`/api/tm/cycles/${e}/automation-status`),og=e=>n(`/api/tm/cycles/${e}/cancel-automation`,{method:"POST"}),rg=e=>n(`/api/tm/executions/${e}/cancel-automation`,{method:"POST"}),ag=()=>n("/api/tm/cycle-run-settings"),ig=e=>n("/api/tm/cycle-run-settings",{method:"PUT",body:JSON.stringify(e)}),cg=()=>n("/api/connectors"),lg=e=>n(`/api/connectors/${e}`),dg=e=>n("/api/connectors",{method:"POST",body:JSON.stringify(e)}),ug=(e,t)=>n(`/api/connectors/${e}`,{method:"PUT",body:JSON.stringify(t)}),mg=e=>n(`/api/connectors/${e}`,{method:"DELETE"}),pg=e=>n(`/api/connectors/${e}/test`,{method:"POST"}),hg=(e,t)=>n(`/api/connectors/${e}/send-test`,{method:"POST",body:JSON.stringify(t||{})}),fg=e=>n(`/api/connectors/${e}/jira/projects`),gg=(e,t,o)=>n(`/api/connectors/${e}/jira/search`,{method:"POST",body:JSON.stringify({jql:t,maxResults:o})}),xg=(e,t)=>n(`/api/connectors/${e}/jira/create-issue`,{method:"POST",body:JSON.stringify(t)}),bg=(e,t)=>n(`/api/connectors/${e}/jira/issue/${t}`),yg=(e,t)=>n(`/api/connectors/${e}/jira/comment`,{method:"POST",body:JSON.stringify(t)}),wg=e=>n(`/api/connectors/${e}/jira/issue-types`),Sg=e=>n("/api/tm/quick-plan-from-source",{method:"POST",body:JSON.stringify(e)}),vg=()=>n("/api/tm/automation-usage"),jg=()=>n("/api/output/folders"),Tg=e=>n("/api/output/folders",{method:"POST",body:JSON.stringify(e)}),Ng=(e,t)=>n(`/api/output/folders/${e}`,{method:"PUT",body:JSON.stringify(t)}),kg=e=>n(`/api/output/folders/${e}`,{method:"DELETE"}),Cg=e=>n("/api/output/folders/reorder",{method:"PUT",body:JSON.stringify({ids:e})}),Og=()=>n("/api/output/detect"),Pg=(e,t)=>{const o=new URLSearchParams;t!=null&&t.sortBy&&o.set("sortBy",t.sortBy),t!=null&&t.sortDir&&o.set("sortDir",t.sortDir),t!=null&&t.filterExt&&o.set("filterExt",t.filterExt),t!=null&&t.depth&&o.set("depth",String(t.depth));const a=o.toString();return n(`/api/output/folders/${e}/files${a?`?${a}`:""}`)},Eg=(e,t)=>{const o=new URLSearchParams({q:e});return t&&o.set("folderIds",t),n(`/api/output/search?${o.toString()}`)},Rg=(e,t,o=!1)=>{const a=G(),l=new URLSearchParams({folderId:e,path:t});return o&&l.set("download","true"),a&&l.set("token",a),`${te}/api/output/file?${l.toString()}`},$g=async(e,t)=>{const o=G(),a=await fetch(`${te}/api/output/zip`,{method:"POST",headers:{"Content-Type":"application/json",...o?{Authorization:`Bearer ${o}`}:{}},body:JSON.stringify({folderId:e,paths:t})});if(!a.ok)throw new Error("ZIP download failed");const l=await a.blob(),c=URL.createObjectURL(l),i=document.createElement("a");i.href=c,i.download=`output-${Date.now()}.zip`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(c)},Ag=e=>n("/api/documents/generate",{method:"POST",body:JSON.stringify(e)}),Ig=()=>n("/api/documents/types"),Lg=()=>n("/api/suites"),Dg=e=>n(`/api/suites/${e}`),Mg=e=>n("/api/suites",{method:"POST",body:JSON.stringify(e)}),_g=(e,t)=>n(`/api/suites/${e}`,{method:"PUT",body:JSON.stringify(t)}),Ug=(e,t)=>n(`/api/suites/${e}/notifications/test`,{method:"POST",body:JSON.stringify(t)}),Jg=(e,t)=>n(`/api/suites/${e}/tests`,{method:"POST",body:JSON.stringify({tests:t})}),Fg=(e,t,o)=>n(`/api/suites/${e}/tests`,{method:"DELETE",body:JSON.stringify({file:t,name:o})}),Bg=e=>n(`/api/suites/${e}`,{method:"DELETE"}),Gg=(e,t={})=>n(`/api/suites/${e}/run`,{method:"POST",body:JSON.stringify(t)}),zg=e=>n(`/api/suites/${e}/run-status`),qg=e=>n(`/api/tm/cycle-runs/${e}/status`),Wg=e=>n(`/api/suites/${e}/cancel`,{method:"POST"}),Hg=e=>n(`/api/suites/${e}/runs`),Kg=(e,t,o)=>n(`/api/suites/${e}/compare?a=${encodeURIComponent(t)}&b=${encodeURIComponent(o)}`),ib=Object.freeze(Object.defineProperty({__proto__:null,abortWorkflow:Um,addChatMessage:Nl,addCustomStep:Fl,addMCPPreset:Pm,addMobileCustomStep:zi,addRunnerCommand:Ba,addSkillsChatMessage:mm,addSuiteTests:Jg,aiApplyReviewFixes:wc,aiBrowserChat:jc,aiChat:ii,aiChatReset:hc,aiChatStream:pc,aiCodeReview:yc,aiConsolidate:Ya,aiConsolidateSteps:ni,aiDocumentMethod:Ha,aiExplain:ai,aiExplainMethod:Wa,aiExplainStep:ti,aiGenerate:ri,aiNewTest:bc,aiSuggestStepDef:si,aiSuggestTest:Va,aiUnusedVerdict:Ka,analyzeCloudReadiness:Ud,analyzeFailures:Ur,askPassAnswer:on,askPassCacheCount:bu,askPassCancel:rn,askPassForget:yu,assessFailures:Fr,authChangePassword:ju,authGetMe:Tu,authLogin:hn,authLoginTwoFactor:fn,authLoginTwoFactorEnable:xn,authLoginTwoFactorSetup:gn,authLogout:vn,authSetup:Sn,authStatus:pt,awaitClientId:ae,browserKeepAlive:Oc,bulkUpdateSkills:Xu,cancelCiRun:Zc,cancelOwnershipScan:xr,cancelRun:vr,cancelSuiteRun:Wg,checkPasswordReset:yn,checkRemoteNow:Zs,checkRunTargets:ga,clearApiHistory:iu,clearBaseline:Zr,clearChatSessions:Pl,clearCiPipelinePreviousNames:Bc,clearSkillsChatSessions:fm,clearStoredToken:Ee,closeBrowserSession:Cc,codeMapExportCsvUrl:Ns,compareEnvs:Cr,compareRecordings:nd,compareSuiteRuns:Kg,connectMCPServer:Sm,createAccessToken:Kc,createApiCollection:qd,createApiFolder:Yd,createChatSession:ol,createCiToken:Fc,createConnector:dg,createFile:ir,createFromTemplate:zm,createMCPServer:bm,createOutputFolder:Tg,createReportSchedule:bl,createReportShareToken:ml,createSkill:em,createSkillsChatSession:um,createSuite:Mg,createUser:Uu,createWorkflow:$m,createWorkflowWebhook:Qm,deleteApiCollection:Hd,deleteApiEnvironment:su,deleteApiFolder:Xd,deleteApiRequest:Vd,deleteChatSession:Ol,deleteCiPipeline:Uc,deleteCloudProvider:Pd,deleteCloudSchedule:_d,deleteConnector:mg,deleteFile:lr,deleteMCPServer:wm,deleteMobileAction:Ai,deleteMobileApp:bi,deleteMobileRecording:uc,deleteOutputFolder:kg,deleteRecorderAction:Ul,deleteRecordingHistory:sd,deleteReportSchedule:wl,deleteRunnerCommand:za,deleteSavedReport:dl,deleteSkill:sm,deleteSkillsChatSession:hm,deleteSuite:Bg,deleteUploadedFile:vc,deleteUser:Fu,deleteWorkflow:Im,deleteWorkflowWebhook:Zm,detectOutputFolders:Og,disableMCPServer:Nm,disableSkill:Qu,disableTwoFactor:Cu,disconnectMCPServer:vm,disconnectTestver:oa,disconnectTestverHub:ia,discoverSkills:rm,dismissAskMiss:ui,documentHref:Ho,downloadAllApiCollections:pu,downloadApiCollectionExport:mu,downloadCodeMapCsv:Xa,downloadCodeMapStepsCsv:ei,downloadFromApi:Se,downloadOutputZip:$g,downloadReportExport:pl,dryRunWorkflow:sp,duplicateWorkflow:Wm,enableMCPServer:Tm,enableSkill:Yu,enableTwoFactor:Tn,endMobileRecording:Ui,endMobileSession:vi,endSession:Re,endTestverMcpSession:Wc,exportApiCollection:uu,exportAuditLog:Hu,extendSession:un,fetchCloudArtifacts:Jd,followUpFromRecording:Ml,followupMobileRecordingGeneration:sc,forgotPassword:bn,generateApiScenarios:fu,generateCICD:Lc,generateDocument:Ag,generateFromRecording:Ll,generateMobileRecording:tc,generateWorkflow:qm,getAccessTokens:zc,getActiveRuns:vs,getActiveWorkflowRuns:Bm,getActivity:Or,getAiRun:gc,getAiRuns:Cs,getAllAccessTokens:Hc,getAllMCPTools:Cm,getAllOwnership:mr,getApiCollection:zd,getApiCollections:Gd,getApiEnvironments:Zd,getApiHistory:au,getApiStorage:ru,getApiTrace:Qo,getAppMode:xs,getAskFeedback:li,getAuditLog:qu,getAuditStats:Wu,getAuthFilesStatus:$u,getAutoHealConfig:tr,getBaseline:Xr,getBrowserScreenshot:Nc,getBrowserStatus:Tc,getBrowserViewport:kc,getChatSession:nl,getChatSessions:sl,getCiAnalytics:el,getCiPipelines:Mc,getCiRuns:Xc,getCiTokens:Jc,getClientId:be,getCloudBuilds:$d,getCloudEnvVars:Ad,getCloudHubUrl:Id,getCloudProvider:Cd,getCloudProviders:kd,getCloudSchedules:Ld,getCodeMap:ba,getCodeMapCoverage:xa,getCodeMapGraph:qa,getCodeMapImpact:Sa,getCodeMapQuality:va,getCodeMapSteps:Za,getCodeMapSymbol:wa,getConfigFiles:Nr,getConflictedFile:wu,getConnector:lg,getCoverageHistory:Wr,getCycleRunStatus:qg,getDataMap:ja,getDataMapCandidates:Ra,getDataMapOverrides:Ca,getDataMapPreview:ka,getDataMapSource:Na,getDocumentTypes:Ig,getDurationAnomalies:Hr,getEnvConfig:Aa,getEnvConfigCandidates:La,getEnvConfigFiles:$a,getEnvFiles:kr,getExploreRunFile:mi,getFailureAnalysis:Jr,getFailureCategoryTrends:Kr,getFeatureFlags:Yo,getFileTree:Vo,getFlakyTests:Dr,getGitBlame:Ps,getGitBranches:cn,getGitChurn:$s,getGitCorrelation:As,getGitDiff:Es,getGitIdentity:_s,getGitLastCommit:Us,getGitLog:mt,getGitOwnership:Is,getGitStatus:ut,getGitUncommittedDiff:Rs,getGridBrowserOptions:dd,getGridSessions:fd,getGridStatus:ld,getGridUsage:ud,getHealHistory:Zo,getHealStatus:er,getHealthScores:Yr,getKnowledgeInventory:ci,getLLMConfig:ta,getLaterOutcomes:Br,getLiveGridRuns:hd,getLocalMobileConfig:wd,getLocalMobileStatus:yd,getMCPPresets:Om,getMCPServerTools:km,getMCPServers:xm,getMobileRecording:ki,getMobileRecordingHistory:ac,getMobileReuseTicket:yr,getMobileScreenshot:ji,getMobileSession:Si,getModuleFiles:rr,getMyActivity:Mu,getMySessions:Iu,getNewFailures:qr,getNextRuns:Bd,getOutputFileUrl:Rg,getOutputFiles:Pg,getOutputFolders:jg,getOwnershipConfig:pr,getOwnershipStatus:fr,getPreviousClientIds:Ko,getProject:fs,getProjectName:ys,getRecorderActions:Il,getRecorderStatus:$l,getRecordingSession:Zl,getRemoteIncoming:en,getRemoteUpdates:Xs,getRemoteUpdatesConfig:gu,getReportSchedule:xl,getResultFailures:Ir,getResultRun:$r,getResultRunCounts:Er,getResultRuns:Pr,getResultTests:Ar,getResultTrends:Lr,getRunActivity:js,getRunCommandsConfig:ua,getRunComparison:zr,getRunConsoleOutput:ea,getRunHistory:Tr,getRunLive:pd,getRunStatus:Sr,getRunnerCommands:Fa,getSavedReport:il,getScenarioHistory:Ic,getServerHealth:Vr,getSessionPolicy:Su,getSharedReport:fl,getSkillExportUrl:cm,getSkillPreview:Vu,getSkills:Ku,getSkillsChatSession:dm,getSkillsChatSessions:lm,getSlowestTests:Mr,getSourceCoverageMatrix:kh,getSourceSummaries:mc,getStepReferences:zl,getStoredToken:G,getSuite:Dg,getSuiteRunStatus:zg,getSuiteRuns:Hg,getTestCaseHistory:Os,getTestDataColumns:ql,getTestExplorer:Pc,getTestHistory:Gr,getTestLifecycle:_a,getTestMethods:Qa,getTestOwnership:ur,getTestSource:Ec,getTestSourceByName:Rc,getTestverHub:Ts,getTestverMcp:qc,getTestverStatus:ra,getToolCategories:am,getTopFailures:_r,getTwoFactor:Nu,getTwoFactorPolicy:Eu,getUsers:_u,getWorkflow:Rm,getWorkflowEventSubscriptions:ep,getWorkflowNotifications:rp,getWorkflowRun:Fm,getWorkflowRuns:Jm,getWorkflowTemplates:Gm,getWorkflowTools:oi,getWorkflowVersions:np,getWorkflowWebhooks:Ym,getWorkflows:Em,gitAbortOperation:Ws,gitCommit:Ms,gitContinueOperation:Ks,gitCreateBranch:ln,gitDeleteBranch:nn,gitDiscardFiles:Js,gitFetch:Vs,gitPull:Ys,gitPush:Qs,gitSkipOperationStep:Hs,gitStageFiles:Ls,gitStashBackOut:qs,gitStashDrop:zs,gitStashList:Fs,gitStashPop:Gs,gitStashSave:Bs,gitSwitchBranch:dn,gitUnstageFiles:Ds,globalSearch:Ss,gridConnect:id,gridDisconnect:cd,gridLiveUrl:xd,healApply:nr,healUndo:or,ignoreDataFile:Pa,importApiCollection:cu,importSkill:nm,importSkillFromUrl:om,importWorkflow:Hm,includeDataFile:Oa,isAppiumFramework:br,isFramePending:Ti,jiraAddComment:yg,jiraCreateIssue:xg,jiraGetIssue:bg,jiraGetIssueTypes:wg,jiraGetProjects:fg,jiraSearch:gg,keepMobileSessionAlive:Fi,listConnectors:cg,listMobileApps:gi,listMobileDevices:fi,listMobileFormatters:Di,listMobileProjectTests:oc,listMobileProviders:pi,listMobileRecordings:rc,listMobileSessionElements:Vi,listRecordingHistory:Xl,listReportSchedules:gl,listSavedReports:rl,listSharedReports:al,listSuites:Lg,loadEnvConfig:Da,loadMobileRecording:Gi,loadRecordingSession:Al,markAiRunSaved:fc,matchRemoteKeepingCommits:sn,mobileDraftId:lc,moveApiRequest:du,parseApiSpec:hu,patchMobileAction:Mi,pauseMobileRecording:Ji,pauseRecording:Vl,pauseWorkflow:Mm,playbackMobileRecording:ec,playbackRecording:_l,pollTestverConnect:na,pressMobileKey:Ri,previewMobileRecording:Li,rateAskAnswer:di,readFile:ar,rebuildCodeMap:ya,rebuildDataMap:Ta,recordMobileAnnotation:Ki,recordMobileAnnotationForElement:Qi,recordMobileAssertion:Yi,recordMobilePressKey:Ei,recordMobileSwipe:Pi,recordMobileTap:Ci,recordMobileType:Oi,regenerateRecoveryCodes:ku,regenerateSavedReport:ul,rememberTrustedBrowser:pn,removeAllTrustedBrowsers:Pu,removeDataMapOverride:Ea,removeSuiteTest:Fg,removeTrustedBrowser:Ou,removeWorkflowSchedule:Vm,renameChatSession:Cl,renameMobileApp:yi,renameSkillsChatSession:pm,renewAccessToken:Yc,reorderApiRequests:lu,reorderMobileActions:_i,reorderOutputFolders:Cg,reorderRecorderActions:Kl,replaceMobileWithCustomStep:qi,replaceRecorderAction:Jl,replaceWithCustomStep:Bl,rescanProject:gs,resetMobileRecording:Ii,resetPassword:wn,resetRecording:ad,resetSkills:Zu,resetUserPassword:Bu,resetUserTwoFactor:Gu,resolveConflictedFile:an,resolveStepDefinition:$c,resolveStepDefinitions:Ac,restoreMobileReplacedSteps:Wi,restoreReplacedSteps:Gl,restoreWorkflowVersion:op,resumeMobileRecording:Bi,resumeRecording:Yl,resumeRecordingSession:Ql,resumeWorkflow:_m,revokeAccessToken:Qc,revokeAllOtherSessions:Du,revokeCiToken:Gc,revokeMySession:Lu,revokeReportShareToken:hl,revokeUserSessions:zu,runReportScheduleNow:Sl,runScheduleNow:Fd,runSuite:Gg,runWorkflow:Dm,saveApiEnvironment:eu,saveApiRequest:Kd,saveCICDConfig:Dc,saveChatTimeline:kl,saveCiPipeline:_c,saveCloudProvider:Od,saveCloudSchedule:Dd,saveEnvConfig:Ia,saveGridProvider:bd,saveLLMConfig:ca,saveLocalMobileConfig:Sd,saveMobileRecorderSettings:Hi,saveMobileRecording:ic,saveRecorderSettings:Wl,saveRecordingToHistory:ed,saveRemoteUpdatesConfig:xu,saveReport:cl,saveRunCommandsConfig:ma,searchFiles:dr,searchOutputFiles:Eg,sendApiChain:ou,sendApiRequest:nu,sendRunInput:jr,sendTestNotification:hg,setAccessTokenLimits:Vc,setApiTrace:Xo,setAppMode:bs,setAutoHealConfig:sr,setBaseline:Qr,setChatStreamPermissionMode:jl,setClientId:ve,setDefaultCloudProvider:Ed,setMobileAnnotateMode:Zi,setMobileAssertMode:Xi,setOwnershipConfig:hr,setProjectName:ws,setSessionPolicy:vu,setStoredToken:je,setTestLifecycle:Ua,setTestLifecycleBulk:Ja,setTestverService:aa,setTwoFactorPolicy:Ru,setWorkflowEventSubscriptions:tp,setWorkflowSchedule:Km,skillsChatStream:im,startLocalEmulator:vd,startLocalSimulator:Td,startMobileRecording:Ni,startMobileSession:wi,startNewMobileRecordingId:dc,startOwnershipScan:gr,startRecording:El,startReinspect:Hl,startRun:wr,startTestverConnect:sa,startTwoFactorSetup:jn,stashPullReapply:tn,stopChatGeneration:xc,stopGridSession:gd,stopLocalEmulator:jd,stopLocalSimulator:Nd,stopMobileRecording:$i,stopMobileRecordingGeneration:nc,stopRecording:Rl,stopRecordingGeneration:Dl,streamTMAIEvents:Ch,suggestRunCommands:ha,suggestRunTargets:fa,switchActiveModel:da,testCloudConnection:Rd,testConnector:pg,testGridConnection:md,testLLMConnection:la,testMCPConnection:jm,testMobileProviderCredentials:hi,testRunCommand:pa,testSuiteNotification:Ug,tmAIAppModel:Ih,tmAIEstimate:Rh,tmAIFixCases:Sp,tmAIGrounding:Lh,tmAIJobCancel:Ph,tmAIJobDismiss:Eh,tmAIJobLatest:Oh,tmAISaveGenerated:Ah,tmAISimilar:$h,tmAddAttachment:Pf,tmAddDefectComment:ff,tmAddExecutionAttachment:Af,tmAddReferenceLink:Mf,tmAddTestCasesToPlan:Yp,tmAutoMaintenance:Uh,tmBulkDeleteTestCases:yp,tmBulkMoveTestCases:jp,tmBulkRemoveMappings:wh,tmBulkReviewTestCases:wp,tmBulkSetMappings:yh,tmBulkTagTestCases:Tp,tmBulkUpdateStepResults:dh,tmBulkUpdateSyncStatus:vh,tmCancelCycleAutomation:og,tmCancelExecutionAutomation:rg,tmCheckSync:jh,tmClearStale:Hf,tmCompareCycles:mh,tmCreateCustomField:$p,tmCreateCycle:Zp,tmCreateDefect:nf,tmCreateDefectFromExecution:df,tmCreateFolder:ip,tmCreatePlan:qp,tmCreateQualityGate:xf,tmCreateRequirement:Fh,tmCreateSource:Ff,tmCreateTag:Cp,tmCreateTestCase:hp,tmCreateWebhook:jf,tmDeleteAttachment:$f,tmDeleteCustomField:Lp,tmDeleteCycle:nh,tmDeleteDefect:cf,tmDeleteDefectComment:gf,tmDeleteExecutionAttachment:Df,tmDeleteFolder:mp,tmDeletePlan:Vp,tmDeleteQualityGate:Sf,tmDeleteReferenceLink:Jf,tmDeleteRequirement:qh,tmDeleteSource:Kf,tmDeleteTag:Ep,tmDeleteTestCase:bp,tmDeleteWebhook:kf,tmEvaluateQualityGate:vf,tmExecuteMapping:Th,tmExportTestCases:Cf,tmGenerateReport:sf,tmGetAllMappings:Gp,tmGetAttachment:Rf,tmGetAttachments:Ef,tmGetAutomationRunStatus:sg,tmGetAutomationUsage:vg,tmGetCoverageStats:Qh,tmGetCustomFields:Ap,tmGetCycle:th,tmGetCycleAnalytics:uh,tmGetCycleAutomationStatus:ng,tmGetCycleExecutions:rh,tmGetCycleRunSettings:ag,tmGetCycles:eh,tmGetDefect:rf,tmGetDefectActivity:pf,tmGetDefectComments:hf,tmGetDefectStats:lf,tmGetDefects:of,tmGetDefectsByExecutions:uf,tmGetExecution:ah,tmGetExecutionAnalytics:Xh,tmGetExecutionAttachment:Lf,tmGetExecutionAttachments:If,tmGetExecutionDots:hh,tmGetExecutionHistory:ph,tmGetFolder:dp,tmGetFolderTree:lp,tmGetFolders:cp,tmGetHealthScore:Zh,tmGetMappedTestCases:xh,tmGetMapping:Fp,tmGetMappingDashboard:fh,tmGetMappingsByStatus:bh,tmGetOrphans:ef,tmGetPlan:Hp,tmGetPlanTestCases:Xp,tmGetPlans:Wp,tmGetQualityGate:yf,tmGetQualityGates:bf,tmGetReferenceLinks:_f,tmGetRequirement:Gh,tmGetRequirementTestCases:Kh,tmGetRequirements:Bh,tmGetSource:Gf,tmGetSourceCoverage:Zf,tmGetSourceTestCases:Qf,tmGetSourceTraceability:tf,tmGetSources:Bf,tmGetSourcesWithTestCases:zf,tmGetStats:zp,tmGetStepResults:ch,tmGetSteps:Np,tmGetTags:Op,tmGetTestCase:gp,tmGetTestCaseRequirements:Vh,tmGetTestCaseSources:Xf,tmGetTestCases:fp,tmGetTraceabilityMatrix:Yh,tmGetUnmappedTestCases:gh,tmGetVersion:_p,tmGetVersions:Mp,tmGetWebhooks:Tf,tmImportTestCases:Of,tmLinkSourceTestCases:Vf,tmLinkTestCases:Wh,tmMoveFolder:pp,tmNLSearch:_h,tmPredictiveSelection:Dh,tmPushCasesToJira:vp,tmQuickPlanFromSource:Sg,tmRefreshSource:Wf,tmRemoveMapping:Bp,tmRemoveTestCasesFromPlan:Qp,tmRerunFailed:oh,tmRiskAssessment:Jh,tmRollbackTestCase:Up,tmRunAutomation:eg,tmRunCycleAutomation:tg,tmSaveCycleRunSettings:ig,tmSearchMappings:Nh,tmSetCustomFieldValues:Dp,tmSetMapping:Jp,tmSetSteps:kp,tmSetTestCaseTags:Rp,tmSuggestPlan:Mh,tmTransitionDefect:mf,tmUnlinkSourceTestCases:Yf,tmUnlinkTestCases:Hh,tmUpdateCustomField:Ip,tmUpdateCycle:sh,tmUpdateDefect:af,tmUpdateExecution:ih,tmUpdateFolder:up,tmUpdatePlan:Kp,tmUpdateQualityGate:wf,tmUpdateReferenceLink:Uf,tmUpdateRequirement:zh,tmUpdateSource:qf,tmUpdateStepResult:lh,tmUpdateSyncStatus:Sh,tmUpdateTag:Pp,tmUpdateTestCase:xp,tmUpdateWebhook:Nf,toggleAnnotateMode:rd,toggleAssertMode:od,traceCiCommit:tl,trustedBrowserTokens:ht,unloadEnvConfig:Ma,updateApiCollection:Wd,updateApiEnvironment:tu,updateApiFolder:Qd,updateChatSessionMode:Tl,updateChatSessionPermissionMode:vl,updateCloudSchedule:Md,updateConnector:ug,updateFile:cr,updateMCPServer:ym,updateMobileRecording:cc,updateMyProfile:Au,updateOutputFolder:Ng,updateRecordingHistory:td,updateReportSchedule:yl,updateRunnerCommand:Ga,updateSavedReport:ll,updateSkill:tm,updateSkillsChatSelections:gm,updateSuite:_g,updateUser:Ju,updateWorkflow:Am,updateWorkflowNotifications:ap,updateWorkflowWebhook:Xm,uploadFiles:Sc,uploadMobileApp:xi,validateWorkflowYaml:Lm,withSessionToken:ps},Symbol.toStringTag,{value:"Module"})),jt={superadmin:4,admin:3,tester:2,viewer:1},Nn=m.createContext({user:null,token:null,isAuthenticated:!1,isSetupRequired:!1,isSetupLinkMissing:!1,isLoading:!0,login:async()=>({}),completeSignIn:()=>{},isTwoFactorSetupRequired:!1,logout:async()=>{},setup:async()=>{},hasRole:()=>!1,refreshStatus:async()=>{}}),We="testver.setupToken";function Vg(){try{const e=new URL(window.location.href),t=e.searchParams.get("setup");return t?(sessionStorage.setItem(We,t),e.searchParams.delete("setup"),window.history.replaceState(null,"",e.pathname+(e.search||"")+e.hash),t):sessionStorage.getItem(We)}catch{return null}}function Yg({children:e}){const[t,o]=m.useState(null),[a,l]=m.useState(G()),[c,i]=m.useState(!1),[r,d]=m.useState(!1),[u]=m.useState(()=>Vg()),[h,p]=m.useState(!0),[g,b]=m.useState(!1),k=m.useCallback(async()=>{var E;try{const T=await pt();T.setupRequired?(i(!0),d(!!T.setupTokenRequired&&!u),o(null)):T.authenticated&&T.user?(i(!1),o(T.user),b(!!((E=T.twoFactor)!=null&&E.setupRequired)),T.session&&(us(T.session),oe({expiresAt:T.session.expiresAt,absoluteExpiresAt:T.session.absoluteExpiresAt}))):(i(!1),o(null))}catch{o(null)}finally{p(!1)}},[u]);m.useEffect(()=>{Jo(),k()},[k]);const w=m.useCallback(E=>{je(E.token),l(E.token),o(E.user),i(!1),b(!1),E.expiresAt&&E.absoluteExpiresAt&&oe({expiresAt:Date.parse(E.expiresAt),absoluteExpiresAt:Date.parse(E.absoluteExpiresAt)})},[]),S=m.useCallback(async(E,T)=>{const f=await hn(E,T);return!f.twoFactorRequired&&!f.twoFactorSetupRequired&&f.token&&w(f),f},[w]);m.useEffect(()=>{const E=()=>b(!0);return window.addEventListener("testver:two-factor-setup-required",E),()=>window.removeEventListener("testver:two-factor-setup-required",E)},[]);const O=m.useCallback(async()=>{try{await vn()}catch{}Ee(),oe(null),l(null),o(null),b(!1)},[]),C=m.useCallback(async(E,T,f,y,x,j)=>{const v=await Sn({username:E,displayName:T,email:y,password:f,appMode:x,projectName:j,setupToken:u??void 0});try{sessionStorage.removeItem(We)}catch{}je(v.token),l(v.token),o(v.user),i(!1)},[u]),N=m.useCallback(E=>t?jt[t.role]>=jt[E]:!1,[t]),P={user:t,token:a,isAuthenticated:!!t,isSetupRequired:c,isSetupLinkMissing:r,isLoading:h,login:S,completeSignIn:w,isTwoFactorSetupRequired:g,logout:O,setup:C,hasRole:N,refreshStatus:k};return m.createElement(Nn.Provider,{value:P},e)}function Y(){return m.useContext(Nn)}const Qg={brand:"bg-brand-500/20 text-brand-300",green:"bg-emerald-500/20 text-emerald-300",red:"bg-red-500/20 text-red-300",yellow:"bg-amber-500/20 text-amber-300",gray:"bg-gray-500/20 text-gray-300",blue:"bg-sky-500/20 text-sky-300"};function Xg({label:e,color:t="brand"}){return s.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${Qg[t]}`,children:e})}function Tt(){return document.documentElement.classList.contains("light")?"light":"dark"}function Zg(){const e=document.documentElement,t=e.classList.contains("light")?"dark":"light";e.classList.remove("dark","light"),e.classList.add(t),localStorage.setItem("testver-theme",t)}function ex(){const t=localStorage.getItem("testver-theme")??"light";document.documentElement.classList.remove("dark","light"),document.documentElement.classList.add(t)}const tx="/assets/logo-C7ltqfpq.svg",sx="/assets/dark-logo-DCPcGDyT.svg";function ie({className:e="",alt:t="Testver logo"}){return s.jsxs(s.Fragment,{children:[s.jsx("img",{src:tx,alt:t,className:`block dark:hidden ${e}`}),s.jsx("img",{src:sx,alt:t,className:`hidden dark:block ${e}`})]})}const kn=["testver-hub"];function nx(e){return B({queryKey:kn,queryFn:()=>Ts(),refetchInterval:6e4,refetchOnWindowFocus:!0,staleTime:3e4,retry:1,enabled:(e==null?void 0:e.enabled)??!0})}function cb(){const e=de();return()=>{e.invalidateQueries({queryKey:kn}),e.invalidateQueries({queryKey:["testver-status"]}),e.invalidateQueries({queryKey:["llm-config"]}),e.invalidateQueries({queryKey:["grid-status"]}),e.invalidateQueries({queryKey:["connectors"]}),e.invalidateQueries({queryKey:["cloud-providers"]})}}const $e=3e4;function Cn(){return B({queryKey:["git-status"],queryFn:ut,refetchInterval:3e4,refetchOnWindowFocus:!0})}const He="testver-git-include-testver";let we=(()=>{try{return sessionStorage.getItem(He)==="1"}catch{return!1}})();const Ke=new Set;function lb(e){we=e;try{e?sessionStorage.setItem(He,"1"):sessionStorage.removeItem(He)}catch{}Ke.forEach(t=>t())}function ox(){return m.useSyncExternalStore(e=>(Ke.add(e),()=>{Ke.delete(e)}),()=>we)}function rx(e,t){if(!t)return!1;const o=e.replace(/\\/g,"/").toLowerCase(),a=t.toLowerCase();return o.startsWith(a)||o===a.slice(0,-1)}function db(){const e=Cn(),t=ox(),o=m.useMemo(()=>{var u;const a=e.data;if(!(a!=null&&a.available)||t||!a.testverPrefix)return a&&{...a,hiddenTestver:0};const l=a.uncommittedChanges??[],c=l.filter(h=>!rx(h.path,a.testverPrefix)),i=Math.max(0,(a.stagedCount??0)-(a.testverStagedCount??0)),r=Math.max(0,(a.unstagedCount??0)-(a.testverUnstagedCount??0)),d=((u=a.conflictedPaths)==null?void 0:u.length)??0;return{...a,uncommittedChanges:c,stagedCount:i,unstagedCount:r,isClean:a.isClean||c.length===0&&d===0,hiddenTestver:l.length-c.length}},[e.data,t]);return{...e,data:o}}function On(){const{data:e}=B({queryKey:["git-status"],queryFn:ut,staleTime:3e4});return(e==null?void 0:e.available)===!0}function ub(e){return B({queryKey:["git-blame",e],queryFn:()=>Ps(e),enabled:!!e})}function mb(e=20,t){return B({queryKey:["git-log",e,t],queryFn:()=>mt(e,void 0),enabled:!0,placeholderData:oo,refetchInterval:$e,refetchOnWindowFocus:!0})}function pb(e,t=20){return B({queryKey:["git-file-history",e,t],queryFn:()=>mt(t,e||void 0),enabled:!!e})}function hb(e){return B({queryKey:["git-diff",e],queryFn:()=>Es(e),enabled:!!e})}function fb(e,t=!0){return B({queryKey:["git-uncommitted-diff",e??"all"],queryFn:()=>Rs(e||void 0),enabled:t,refetchInterval:$e,refetchOnWindowFocus:!0})}function gb(e,t=30){return B({queryKey:["git-churn",e,t],queryFn:()=>$s(e,t),enabled:!!e})}function xb(e){return B({queryKey:["git-correlation",e],queryFn:()=>As(e),enabled:!!e})}function bb(e){return B({queryKey:["git-ownership",e],queryFn:()=>Is(e),enabled:!!e})}function yb(){return B({queryKey:["git-branches"],queryFn:cn,refetchInterval:$e,refetchOnWindowFocus:!0})}function wb(e=!0){return B({queryKey:["git-identity"],queryFn:_s,enabled:e})}function Sb(e){return B({queryKey:["git-last-commit"],queryFn:Us,enabled:e})}function Pn(e){for(const t of["git-status","git-log","git-uncommitted-diff","git-branches","git-file-history","git-blame","git-last-commit","git-stash","git-remote-updates","git-remote-incoming"])e.invalidateQueries({queryKey:[t]})}function vb(){const e=de();return m.useCallback(()=>Pn(e),[e])}function ax(){return no({mutationKey:["git"]})>0}function F(e){const t=de();return Ye({mutationKey:["git"],mutationFn:e,onSettled:()=>Pn(t)})}function jb(){return F(e=>Ls(e,we))}function Tb(){return F(e=>an(e.path,e.side?{side:e.side}:e.deleteFile?{delete:!0}:e.content??""))}function Nb(){return F(e=>Ws())}function kb(){return F(e=>Ks())}function Cb(){return F(e=>Hs())}function Ob(){return F(e=>Ds(e))}function Pb(){return F(e=>Ms(e.message,{amend:e.amend,confirmPushedAmend:e.confirmPushedAmend,includeTestver:we}))}function Eb(){return F(e=>Js(e.files,e.scope,we))}function Rb(){return F(e=>Vs(e))}function En(){return F(e=>Ys(e==null?void 0:e.remote,e==null?void 0:e.branch))}function $b(){return F(e=>Qs(e==null?void 0:e.remote,e==null?void 0:e.branch))}function Ab(){return F(e=>ln(e.name,e.checkout))}function Ib(){return F(e=>dn(e))}function Lb(){return B({queryKey:["git-stash"],queryFn:Fs,refetchInterval:$e,refetchOnWindowFocus:!0})}function Db(){return F(e=>Bs(e.message,e.includeUntracked))}function Mb(){return F(e=>Gs(e==null?void 0:e.ref,e==null?void 0:e.sha))}function _b(){return F(e=>qs())}function Ub(){return F(e=>zs(e==null?void 0:e.ref,e==null?void 0:e.sha))}function ft(e=!0){return B({queryKey:["git-remote-updates"],queryFn:Xs,enabled:e,refetchInterval:6e4,refetchOnWindowFocus:!0,staleTime:2e4})}function Jb(e){return B({queryKey:["git-remote-incoming"],queryFn:en,enabled:e})}function Fb(){return F(e=>Zs())}function Bb(){return F(e=>tn())}function Gb(){return F(e=>sn())}function zb(){return F(e=>nn(e))}function gt(e){return!!e&&e.ok&&!e.skipped&&e.behind>0&&e.verdict!=="deleted"}function Nt(e,t){const o=(e==null?void 0:e.projectPrefix)??"";return o?t.startsWith(o)?t.slice(o.length):null:t}const Rn="testver-remote-snooze";function qb(e){if(!e)return 0;try{const t=JSON.parse(localStorage.getItem(Rn)||"null");return t&&t.sha===e&&t.until>Date.now()?t.until:0}catch{return 0}}function Wb(e,t){try{localStorage.setItem(Rn,JSON.stringify({sha:e,until:Date.now()+t*6e4}))}catch{}window.dispatchEvent(new CustomEvent("testver-remote-snooze"))}function ix(e){const[t,o]=m.useState(new Map),a=m.useRef(new Set);return m.useEffect(()=>{vs().then(c=>{const i=new Map;for(const r of c.runs){const d=new Date(r.startTime).getTime();i.set(r.runId,{runId:r.runId,command:r.command,startTime:r.startTime,framework:r.framework,cloudProvider:r.cloudProvider,source:r.source,plainCommand:r.plainCommand===!0,passed:0,failed:0,currentTest:0,currentTestName:"",elapsedMs:Date.now()-d,startMs:d})}i.size>0&&o(r=>{const d=new Map(i);for(const[u,h]of r)d.set(u,h);return d})}).catch(()=>{});const l=a.current;return()=>{for(const c of l)clearTimeout(c);l.clear()}},[]),m.useEffect(()=>{const l=(c,i)=>{o(r=>{const d=r.get(c);if(!d)return r;const u=new Map(r);return u.set(c,{...d,...i(d)}),u})};return e(c=>{if(c.type==="run-started"){const i=c.runId,r=c.startTime;o(d=>{const u=new Map(d);return u.set(i,{runId:i,command:c.command,startTime:r,framework:c.framework,cloudProvider:c.cloudProvider,source:c.source||"manual",plainCommand:c.plainCommand===!0,passed:0,failed:0,currentTest:0,currentTestName:"",elapsedMs:0,startMs:new Date(r).getTime()}),u})}if(c.type==="complete"){const i=c.runId,r=c.passed,d=c.failed,u=Date.now();l(i,p=>({passed:r??p.passed,failed:d??p.failed,exitCode:typeof c.exitCode=="number"?c.exitCode:p.exitCode,currentTestName:"Completed",endMs:p.endMs??u,elapsedMs:(p.endMs??u)-p.startMs}));const h=setTimeout(()=>{a.current.delete(h),o(p=>{if(!p.has(i))return p;const g=new Map(p);return g.delete(i),g})},8e3);a.current.add(h)}if(c.type==="error"&&c.runId){const i=c.runId;o(r=>{if(!r.has(i))return r;const d=new Map(r);return d.delete(i),d})}if(c.type==="test-passed"&&c.runId&&l(c.runId,i=>({passed:i.passed+1})),c.type==="test-failed"&&c.runId&&l(c.runId,i=>({failed:i.failed+1})),c.type==="test-results"&&c.runId){const i=c.summary;i&&l(c.runId,()=>({passed:i.passed,failed:i.failed}))}if(c.type==="test-progress"&&c.runId){const i=c.current,r=c.testName;l(c.runId,()=>({currentTest:i,currentTestName:r}))}})},[e]),m.useMemo(()=>{const l=Array.from(t.values());return{runs:l,hasActiveRuns:l.length>0,activeRunCount:l.length}},[t])}function cx(e){const[t,o]=m.useState(0);return m.useEffect(()=>{let a=!0;const l=()=>{js().then(i=>{a&&typeof i.count=="number"&&o(i.count)}).catch(()=>{})};l();const c=e(i=>{i.type==="runs-active"&&typeof i.count=="number"?o(i.count):i.type==="client-id"&&l()});return()=>{a=!1,c()}},[e]),t}const $n=m.createContext(0);function lx(){return m.useContext($n)}const dx={runs:[],hasActiveRuns:!1,activeRunCount:0},An=m.createContext(dx);function Hb(){return m.useContext(An)}function ux(e){const t=!!e&&e.endMs==null&&Number.isFinite(e.startMs),[,o]=m.useState(0);return m.useEffect(()=>{if(!t)return;const a=setInterval(()=>o(l=>l+1),1e3);return()=>clearInterval(a)},[t]),e?Number.isFinite(e.startMs)?Math.max(0,(e.endMs??Date.now())-e.startMs):e.elapsedMs:0}const In=m.createContext({toast:()=>{}}),Ae=()=>m.useContext(In);function mx({children:e}){const[t,o]=m.useState([]),a=m.useCallback((c,i,r)=>{const d=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`;o(u=>[...u,{id:d,type:c,message:i,...r?{action:r}:{}}]),setTimeout(()=>{o(u=>u.filter(h=>h.id!==d))},r?7e3:4e3)},[]),l=m.useCallback(c=>{o(i=>i.filter(r=>r.id!==c))},[]);return s.jsxs(In.Provider,{value:{toast:a},children:[e,s.jsx("div",{className:"fixed bottom-4 right-4 z-50 space-y-2",children:t.map(c=>s.jsxs("div",{className:`flex items-center gap-2 px-4 py-3 rounded-lg animate-slide-in text-sm
|
|
12
|
+
${c.type==="success"?"bg-emerald-900/90 text-emerald-200 border border-emerald-700/50":""}
|
|
13
|
+
${c.type==="error"?"bg-red-900/90 text-red-200 border border-red-700/50":""}
|
|
14
|
+
${c.type==="info"?"bg-surface-2 text-gray-200 border border-white/10":""}`,children:[c.type==="success"&&s.jsx(io,{size:16}),c.type==="error"&&s.jsx(co,{size:16}),c.type==="info"&&s.jsx(Ft,{size:16}),s.jsx("span",{className:"flex-1",children:c.message}),c.action&&s.jsx("button",{onClick:()=>{c.action.onClick(),l(c.id)},className:"ml-1 px-2 py-0.5 rounded-md text-xs font-medium bg-brand-600 hover:bg-brand-700 text-white flex-shrink-0",children:c.action.label}),s.jsx("button",{onClick:()=>l(c.id),className:"text-white/50 hover:text-white",children:s.jsx(Qe,{size:14})})]},c.id))})]})}const Ln=m.createContext({runs:[],running:[],recordRunning:[],recordings:[],refresh:()=>{}});function Dn(){return m.useContext(Ln)}const px=e=>(e.kind??"chat")==="chat",kt=e=>e.kind==="record-web"||e.kind==="record-mobile";function hx({subscribe:e,children:t}){const[o,a]=m.useState([]),[l,c]=m.useState([]),i=m.useRef(null),r=m.useCallback(()=>{Cs().then(w=>{a(w.runs),c(w.recordings??[])}).catch(()=>{})},[]),d=m.useCallback(()=>{i.current||(i.current=setTimeout(()=>{i.current=null,r()},250))},[r]);m.useEffect(()=>(r(),()=>{i.current&&clearTimeout(i.current)}),[r]),m.useEffect(()=>e(w=>{(w.type==="chat-runs-changed"||w.type==="client-id")&&d(),(w.type==="recorder-status"||w.type==="mobile-recording-status")&&d()}),[e,d]),m.useEffect(()=>{if(l.length===0)return;const w=setInterval(r,15e3);return()=>clearInterval(w)},[l.length,r]);const{toast:u}=Ae(),h=H(),{pathname:p}=Ve(),g=m.useRef(new Set);m.useEffect(()=>{for(const w of o){if(w.status!=="running"||!w.waitingForApproval){g.current.delete(w.requestId);continue}if(g.current.has(w.requestId))continue;g.current.add(w.requestId);const S=kt(w),O=S?"/ai-record":"/ai";p!==O&&u("info",S?"AI Record is waiting for your approval to carry on.":"The AI Assistant is waiting for your approval to carry on.",{label:"Open",onClick:()=>h(O)})}},[o,p,u,h]);const b=o.filter(w=>w.status==="running"&&px(w)),k=o.filter(w=>w.status==="running"&&kt(w));return s.jsx(Ln.Provider,{value:{runs:o,running:b,recordRunning:k,recordings:l,refresh:d},children:t})}function fx({modules:e,collapsed:t}){const{data:o}=nx(),{hasRole:a,user:l}=Y(),c=a("admin"),i=({label:r,isFirst:d=!1})=>t?s.jsx("div",{className:`mx-3 ${d?"mt-2":"mt-3"} mb-1 h-px bg-white/5`,"aria-hidden":"true"}):s.jsx("div",{className:`px-3 ${d?"pt-2":"pt-4"} pb-1`,children:s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:r})});return s.jsxs("aside",{className:`flex flex-col bg-surface-1 border-r border-white/5 flex-shrink-0 transition-[width] duration-200 ease-out ${t?"w-14":"w-56"}`,children:[s.jsxs("nav",{className:"flex-1 overflow-y-auto py-2 space-y-0.5",children:[s.jsx(i,{label:"Test Automation",isFirst:!0}),s.jsx(_,{to:"/",icon:s.jsx(Bt,{size:18}),label:"Dashboard",collapsed:t}),s.jsx(_,{to:"/tests",icon:s.jsx(Xe,{size:18}),label:"Test Explorer",collapsed:t}),s.jsx(_,{to:"/code-map",icon:s.jsx(Gt,{size:18}),label:"Code Map",collapsed:t}),s.jsx(_,{to:"/pipelines",icon:s.jsx(ne,{size:18}),label:"CI/CD Pipelines",collapsed:t}),s.jsx(_,{to:"/results",icon:s.jsx(Me,{size:18}),label:"Results",collapsed:t,indicator:s.jsx(gx,{})}),s.jsx(_,{to:"/advanced",icon:s.jsx(lo,{size:18}),label:"Advanced",collapsed:t}),s.jsx(i,{label:"Test Management"}),s.jsx(_,{to:"/test-cases",icon:s.jsx(Ze,{size:18}),label:"Test Cases",collapsed:t}),s.jsx(_,{to:"/test-plans",icon:s.jsx(ke,{size:18}),label:"Test Plans",collapsed:t}),s.jsx(_,{to:"/ai-test-gen",icon:s.jsx(zt,{size:18}),label:"AI Test Gen",collapsed:t}),s.jsx(_,{to:"/sources",icon:s.jsx(et,{size:18}),label:"Sources",collapsed:t}),s.jsx(_,{to:"/script-mapping",icon:s.jsx(qt,{size:18}),label:"Script Mapping",collapsed:t}),s.jsx(_,{to:"/coverage",icon:s.jsx(Wt,{size:18}),label:"Coverage",collapsed:t}),s.jsx(_,{to:"/defects",icon:s.jsx(tt,{size:18}),label:"Defects",collapsed:t}),s.jsx(i,{label:"Agents"}),s.jsx(_,{to:"/ai",icon:s.jsx(st,{size:18}),label:"AI Assistant",collapsed:t,indicator:s.jsx(xx,{})}),s.jsx(_,{to:"/ai-record",icon:s.jsx(Ht,{size:18}),label:"AI Record",collapsed:t,indicator:s.jsx(bx,{})}),s.jsx(_,{to:"/testver-mcp",icon:s.jsx(Kt,{size:18}),label:"Testver MCP",collapsed:t}),s.jsx(i,{label:"Project"}),s.jsx(_,{to:"/explorer",icon:s.jsx(Vt,{size:18}),label:"Explorer",collapsed:t}),s.jsx(_,{to:"/git",icon:s.jsx(ne,{size:18}),label:"Git",collapsed:t,indicator:s.jsx(yx,{})}),s.jsx(_,{to:"/reports",icon:s.jsx(nt,{size:18}),label:"Reports",collapsed:t}),!c&&s.jsxs(s.Fragment,{children:[s.jsx(i,{label:(l==null?void 0:l.role)==="viewer"?"Viewer":(l==null?void 0:l.role)==="tester"?"Tester":"Account"}),s.jsx(_,{to:"/settings",icon:s.jsx(_e,{size:18}),label:"Settings",collapsed:t})]}),c&&s.jsxs(s.Fragment,{children:[s.jsx(i,{label:"Admin"}),s.jsx(_,{to:"/users",icon:s.jsx(Ue,{size:18}),label:"Users",collapsed:t}),s.jsx(_,{to:"/audit",icon:s.jsx(Yt,{size:18}),label:"Audit Log",collapsed:t}),s.jsx(_,{to:"/settings",icon:s.jsx(_e,{size:18}),label:"Settings",collapsed:t})]})]}),s.jsx("div",{className:"border-t border-white/5 py-1",children:s.jsx(_,{to:"/testver",icon:o!=null&&o.connected?s.jsx(uo,{size:18,className:"text-emerald-500"}):s.jsx(mo,{size:18}),label:"Testver",collapsed:t,indicator:o!=null&&o.connected?s.jsx("span",{className:"block h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_0_3px_rgba(52,211,153,0.15)]",title:"Connected to Testver"}):void 0})})]})}function _({to:e,icon:t,label:o,badge:a,collapsed:l,indicator:c,activeStyles:i}){const r=i||"bg-brand-500/15 text-brand-300 font-medium",d=m.useRef(null),[u,h]=m.useState(null),p=()=>{var k;if(!l)return;const b=(k=d.current)==null?void 0:k.getBoundingClientRect();b&&h({top:b.top+b.height/2,left:b.right+8})},g=()=>h(null);return s.jsxs(Yn,{to:e,end:e==="/",ref:d,onMouseEnter:p,onMouseLeave:g,onFocus:p,onBlur:g,className:({isActive:b})=>`flex items-center gap-3 mx-2 px-2.5 py-2 rounded-lg text-sm transition-colors
|
|
15
|
+
${b?r:"text-gray-400 hover:text-gray-200 hover:bg-white/5"}
|
|
16
|
+
${l?"justify-center":""}`,children:[s.jsxs("span",{className:"flex-shrink-0 relative",children:[t,c&&l&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5",children:c})]}),!l&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"flex-1 truncate",children:o}),c&&s.jsx("span",{className:"flex-shrink-0",children:c}),a!==void 0&&a>0&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-surface-2 text-gray-400",children:a})]}),l&&u&&s.jsx(Mn,{pos:u,label:o,badge:a})]})}function Mn({pos:e,label:t,badge:o}){return Jt.createPortal(s.jsxs("span",{role:"tooltip",style:{top:e.top,left:e.left},className:`pointer-events-none fixed z-[60] -translate-y-1/2
|
|
17
|
+
whitespace-nowrap animate-tooltip-in`,children:[s.jsx("span",{className:"absolute -left-1 top-1/2 -translate-y-1/2 w-2 h-2 bg-[#111827] rotate-45 ring-1 ring-white/10"}),s.jsxs("span",{className:"relative inline-flex items-center gap-2 px-2.5 py-1.5 rounded-md bg-[#111827] text-white text-xs font-medium shadow-lg shadow-black/50 ring-1 ring-white/10",children:[t,o!==void 0&&o>0&&s.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-white/15 text-white/90",children:o})]})]}),document.body)}function gx(){const e=lx();if(e<=0)return null;const t=e===1?"A test run is in progress":`${e} test runs are in progress`;return s.jsxs("span",{className:"relative flex h-2 w-2",title:t,role:"status","aria-label":t,"data-testid":"results-running-dot",children:[s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75 motion-safe:animate-ping"}),s.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-400"})]})}function xx(){const{running:e}=Dn();if(e.length===0)return null;const t=e.some(l=>l.waitingForApproval),o=t?"An AI task is waiting for your approval":e.length===1?"An AI task is running":`${e.length} AI tasks are running`,a=t?"bg-amber-400":"bg-emerald-400";return s.jsxs("span",{className:"relative flex h-2 w-2",title:o,role:"status","aria-label":o,"data-testid":"ai-running-dot","data-waiting":t||void 0,children:[s.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${a} opacity-75 motion-safe:animate-ping`}),s.jsx("span",{className:`relative inline-flex h-2 w-2 rounded-full ${a}`})]})}function bx(){const{recordRunning:e,recordings:t}=Dn();if(e.length===0&&t.length===0)return null;const o=e.some(c=>c.waitingForApproval),a=o?"AI Record is waiting for your approval":e.length>0?"AI Record is generating a test":"A recording is in progress",l=o?"bg-amber-400":"bg-emerald-400";return s.jsxs("span",{className:"relative flex h-2 w-2",title:a,role:"status","aria-label":a,"data-testid":"ai-record-running-dot","data-waiting":o||void 0,children:[s.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${l} opacity-75 motion-safe:animate-ping`}),s.jsx("span",{className:`relative inline-flex h-2 w-2 rounded-full ${l}`})]})}function yx(){const{data:e}=ft(On()),t=e==null?void 0:e.check;if(!t||!gt(t))return null;const o=t.verdict==="uncommitted_overlap"||t.verdict==="will_conflict";return s.jsxs("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded-full flex items-center gap-0.5 ${o?"bg-amber-500/15 text-amber-700 dark:text-amber-300":"bg-sky-500/15 text-sky-700 dark:text-sky-300"}`,title:`${t.behind} new commit${t.behind===1?"":"s"} on ${t.remoteLabel||t.remote||"the remote"}`,children:[s.jsx(Je,{size:10}),t.behind]})}const Kb="This feature is not available for mobile at present";function wx(){const{data:e,isLoading:t}=B({queryKey:["system","app-mode"],queryFn:xs,staleTime:6e4}),o=(e==null?void 0:e.mode)??null,a=o===null||o==="web"||o==="both",l=o===null||o==="mobile"||o==="both",c=o===null||o==="both";return{mode:o,setAt:(e==null?void 0:e.setAt)??null,isLoading:t,showsWeb:a,showsMobile:l,isAmbiguous:c}}function Vb(){const e=de();return Ye({mutationFn:t=>bs(t),onSuccess:t=>{e.setQueryData(["system","app-mode"],t)}})}const _n=60;function Sx(e=!0){const{data:t,isLoading:o}=B({queryKey:["system","project-name"],queryFn:ys,staleTime:6e4,enabled:e});return{name:(t==null?void 0:t.name)??null,maxLength:(t==null?void 0:t.maxLength)??_n,isLoading:o}}function Yb(){const e=de();return Ye({mutationFn:t=>ws(t),onSuccess:t=>{e.setQueryData(["system","project-name"],t)}})}function vx(e){if(!e)return"";const t=e.split(/[\\/]+/).filter(Boolean);return t[t.length-1]??""}function jx(e){if(!e)return"";const t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t))return"";const o=Math.round(t/6e4);if(o<1)return"just now";if(o<60)return`${o} min ago`;const a=Math.round(o/60);if(a<24)return`${a} h ago`;const l=Math.round(a/24);return`${l} day${l===1?"":"s"} ago`}function Qb(e){if(!e)return"";const t=Math.max(0,Math.round((new Date(e).getTime()-Date.now())/6e4));return t<1?"in under a minute":`in ${t} min`}function Un(e){const t=[...new Set(e.incoming.map(o=>o.author).filter(Boolean))];return t.length===0?"Someone":t.length<=2?t.join(" and "):`${t.slice(0,2).join(", ")} and others`}function Jn(e){return(e==null?void 0:e.remoteLabel)||(e==null?void 0:e.remote)||"the remote"}const q=(e,t,o=`${t}s`)=>`${e} ${e===1?t:o}`;function Tx(e,t=3){return e.slice(0,t).join(", ")+(e.length>t?` and ${e.length-t} more`:"")}const Xb="testver-open-incoming",V="flex items-center gap-1 h-7 px-2 rounded-md border text-[11px] font-medium whitespace-nowrap transition-colors";function Nx(){var P,E;const e=H(),{toast:t}=Ae(),{data:o}=Cn(),{data:a}=ft((o==null?void 0:o.available)===!0),l=En(),c=ax(),[i,r]=m.useState(!1),d=m.useRef(null);if(m.useEffect(()=>()=>{d.current&&window.clearTimeout(d.current)},[]),!(o!=null&&o.available))return null;const u=(a==null?void 0:a.check)??null,h=Jn(u),p=(T=!1)=>e(T?"/git?incoming=1":"/git"),g=((P=o.conflictedPaths)==null?void 0:P.length)??0,b=o.operation,k=o.ahead??0,w=o.detached?s.jsxs("button",{className:`${V} bg-amber-500/15 border-amber-500/40 text-amber-700 dark:text-amber-300 hover:bg-amber-500/20`,onClick:()=>p(),title:"HEAD is on a commit, not a branch — open Git",children:[s.jsx(ne,{size:12}),s.jsxs("span",{className:"font-mono hidden xl:inline",children:["detached ",((E=o.lastCommit)==null?void 0:E.shortSha)??""]})]}):s.jsxs("button",{className:`${V} bg-surface-2 border-white/5 text-gray-300 hover:bg-surface-3`,onClick:()=>p(),title:`Current branch: ${o.branch??""}${k?` · ${q(k,"commit")} not pushed yet`:""} — open Git`,children:[s.jsx(ne,{size:12}),s.jsx("span",{className:"font-mono max-w-[10rem] truncate hidden xl:inline",children:o.branch}),k>0&&s.jsxs("span",{className:"flex items-center gap-0.5 text-emerald-600 dark:text-emerald-400",children:[s.jsx(po,{size:10}),k]})]});let S=null,O=!1;if(b&&g>0)S=s.jsxs("button",{className:`${V} bg-red-500/10 border-red-500/40 text-red-600 dark:text-red-300 hover:bg-red-500/15`,onClick:()=>p(),title:`A ${b.kind} is in progress with ${q(g,"conflicted file")} — open Git`,children:[s.jsx(wt,{size:12}),s.jsxs("span",{className:"hidden xl:inline",children:[b.kind[0].toUpperCase()+b.kind.slice(1)," — "]}),q(g,"conflict")]});else if(g>0){const T=!!o.pendingStash;S=s.jsxs("button",{className:`${V} bg-red-500/10 border-red-500/40 text-red-600 dark:text-red-300 hover:bg-red-500/15`,onClick:()=>p(),title:`${T?"Your stash came back with":"There are"} ${q(g,"conflicted file")} to resolve — open Git`,children:[s.jsx(me,{size:11}),s.jsx("span",{className:"hidden xl:inline",children:T?"Stash — ":""}),q(g,"conflict")]})}else if(b)S=s.jsxs("button",{className:`${V} bg-orange-500/10 border-orange-500/40 text-orange-600 dark:text-orange-300`,onClick:()=>p(),title:`A ${b.kind} is in progress — open Git`,children:[s.jsx(wt,{size:12}),s.jsxs("span",{className:"hidden xl:inline",children:[b.kind[0].toUpperCase()+b.kind.slice(1)," in progress"]})]});else if(u&&!u.skipped&&u.ok&&u.verdict==="rewritten")S=s.jsxs("button",{className:`${V} bg-red-500/10 border-red-500/40 text-red-600 dark:text-red-300`,onClick:()=>p(),title:`${u.upstream} was rewritten on ${h} — open Git`,children:[s.jsx(me,{size:11}),s.jsxs("span",{className:"hidden xl:inline",children:[h," history rewritten"]})]});else if(u&&!u.skipped&&u.verdict==="deleted")S=s.jsxs("button",{className:`${V} bg-amber-500/15 border-amber-500/40 text-amber-700 dark:text-amber-300`,onClick:()=>p(),title:`${u.upstream} was deleted on ${h} — open Git`,children:[s.jsx(ne,{size:12}),s.jsx("span",{className:"hidden xl:inline",children:"Remote branch deleted"})]});else if(u&>(u)){const T=u.verdict==="uncommitted_overlap"||u.verdict==="will_conflict",f=u.verdict==="uncommitted_overlap"?u.overlapFiles.length:u.conflictFiles.length;O=!0,S=s.jsxs("button",{className:`${V} ${T?"bg-amber-500/15 border-amber-500/40 text-amber-700 dark:text-amber-300 hover:bg-amber-500/20":"bg-sky-500/15 border-sky-500/40 text-sky-700 dark:text-sky-300 hover:bg-sky-500/20"}`,onClick:()=>p(!0),"aria-label":`${q(u.behind,"new commit")} on ${h}`,children:[s.jsx(Je,{size:12}),s.jsxs("span",{children:[u.behind,s.jsxs("span",{className:"hidden xl:inline",children:[" new on ",h]})]}),T&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"w-px h-3 bg-amber-500/40 mx-0.5"}),s.jsx(me,{size:11}),s.jsx("span",{className:"hidden xl:inline",children:q(f,"clash","clashes")})]})]})}else u&&!u.ok&&u.error&&(S=s.jsxs("button",{className:`${V} bg-surface-2 border-white/5 text-gray-500 hover:bg-surface-3`,onClick:()=>p(),title:u.error.message,children:[s.jsx(ho,{size:12}),s.jsxs("span",{className:"hidden xl:inline",children:["Can't check ",h]})]}));const C=()=>{d.current&&window.clearTimeout(d.current),r(!0)},N=()=>{d.current=window.setTimeout(()=>r(!1),200)};return s.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0 relative",children:[w,S&&s.jsxs("div",{className:"relative",onMouseEnter:O?C:void 0,onMouseLeave:O?N:void 0,children:[S,O&&i&&u&&s.jsxs("div",{className:"absolute top-full mt-2 right-0 bg-surface-1 border border-white/10 rounded-xl shadow-2xl p-4 z-50 w-[430px] max-w-[90vw]",onMouseEnter:C,onMouseLeave:N,children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[s.jsx(Je,{size:15}),q(u.behind,"new commit")," on ",u.upstream]}),s.jsxs("div",{className:"mt-2 space-y-1.5 text-xs",children:[u.incoming.slice(0,3).map(T=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-mono text-brand-400",children:T.shortSha}),s.jsx("span",{className:"text-gray-300 truncate flex-1",children:T.message})]},T.sha)),u.behind>3&&s.jsxs("div",{className:"text-gray-500",children:["…and ",u.behind-3," more"]})]}),s.jsxs("div",{className:"mt-2 text-xs text-gray-500 flex items-center gap-1",children:[s.jsx(Qt,{size:11})," ",Un(u)," · ",q(u.stats.files,"file")," · +",u.stats.additions," −",u.stats.deletions]}),u.verdict==="clean"?s.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg border border-emerald-500/30 bg-emerald-500/10 px-2.5 py-1.5 text-xs text-emerald-700 dark:text-emerald-300",children:[s.jsx(ot,{size:13,className:"shrink-0 mt-0.5"}),s.jsxs("span",{children:[s.jsx("b",{children:"Pulls cleanly"})," — nothing clashes with your work."]})]}):s.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 py-1.5 text-xs text-amber-700 dark:text-amber-300",children:[s.jsx(me,{size:13,className:"shrink-0 mt-0.5"}),s.jsx("span",{children:u.verdict==="uncommitted_overlap"?s.jsxs(s.Fragment,{children:["Changes ",Tx(u.overlapFiles,2),", which you are editing — use ",s.jsx("b",{children:"Stash, pull & re-apply"})," on the Git page."]}):s.jsxs(s.Fragment,{children:["Pulling will need ",q(u.conflictFiles.length,"file")," resolved."]})})]}),s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.verdict==="clean"&&s.jsxs("button",{disabled:c,onClick:()=>l.mutate(void 0,{onSuccess:T=>{var f;if(r(!1),T.conflicts&&((f=T.conflictedPaths)!=null&&f.length)){p();return}t("success",`Pulled ${q(u.behind,"commit")} from ${h}`)},onError:T=>t("error",`Pull failed: ${T.message}`)}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-emerald-600 hover:bg-emerald-500 text-white whitespace-nowrap disabled:opacity-50",children:[s.jsx(Xt,{size:12})," Pull now"]}),s.jsxs("button",{onClick:()=>{r(!1),p(!0)},className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-xs font-medium bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/10 whitespace-nowrap",children:["Open Git ",s.jsx(rt,{size:12})]}),s.jsxs("span",{className:"ml-auto text-[11px] text-gray-500 flex items-center gap-1 whitespace-nowrap",children:[s.jsx(at,{size:11})," ",jx(u.checkedAt)]})]})]})]})]})}function Ct({collapsed:e,onToggle:t}){const o=m.useRef(null),[a,l]=m.useState(null),c=()=>{var u;const d=(u=o.current)==null?void 0:u.getBoundingClientRect();d&&l({top:d.top+d.height/2,left:d.right+8})},i=()=>l(null),r=e?"Expand sidebar":"Collapse sidebar";return s.jsxs(s.Fragment,{children:[s.jsx("button",{ref:o,type:"button",onClick:()=>{i(),t()},onMouseEnter:c,onMouseLeave:i,onFocus:c,onBlur:i,"aria-label":r,"aria-expanded":!e,className:"p-1.5 rounded-lg text-gray-500 hover:text-brand-300 hover:bg-white/[0.05] transition-colors flex-shrink-0",children:e?s.jsx(bo,{size:17}):s.jsx(yo,{size:17})}),a&&s.jsx(Mn,{pos:a,label:`${r} (Ctrl+B)`})]})}function kx({rootPath:e,framework:t,language:o}){const{hasRole:a}=Y(),l=H(),{name:c,isLoading:i}=Sx();if(i)return null;const r=c||vx(e);if(!r)return null;const d=a("admin"),u=[t,o].filter(Boolean).join(" · "),h=[`Project: ${r}`,u?`Stack: ${u}`:"",c?"":"No project name set yet — showing the folder name.",d?"Click to rename in Settings → General.":""].filter(Boolean).join(`
|
|
18
|
+
`),p=s.jsxs(s.Fragment,{children:[s.jsx(ns,{size:16,"aria-hidden":!0,className:"flex-shrink-0 text-gray-400"}),s.jsx("span",{className:`text-sm font-semibold truncate flex-shrink-0 max-w-[7rem] lg:max-w-[11rem] xl:max-w-[16rem] ${c?"text-gray-100":"text-gray-400"}`,"data-testid":"header-project-name",children:r})]}),g="flex items-center gap-2 flex-shrink-0 h-8 px-2 rounded-lg";return d?s.jsx("button",{type:"button",onClick:()=>l("/settings?tab=general"),title:h,"aria-label":`Project ${r}. Open Settings to rename.`,className:`${g} hover:bg-white/[0.05] transition-colors`,children:p}):s.jsx("div",{title:h,"aria-label":`Project ${r}`,className:g,children:p})}function Cx({framework:e,language:t,rootPath:o,connected:a,onRescan:l,onSearchOpen:c,sidebarCollapsed:i,onToggleSidebar:r}){var N,P,E,T;const[d,u]=m.useState(Tt),{user:h,logout:p}=Y(),g=H(),[b,k]=m.useState(!1),w=m.useRef(null),S=()=>{Zg(),u(Tt())},O=async()=>{k(!1),await p(),g("/login",{replace:!0})};m.useEffect(()=>{if(!b)return;const f=y=>{w.current&&!w.current.contains(y.target)&&k(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[b]);const C=((P=(N=h==null?void 0:h.displayName)==null?void 0:N.charAt(0))==null?void 0:P.toUpperCase())||((T=(E=h==null?void 0:h.username)==null?void 0:E.charAt(0))==null?void 0:T.toUpperCase())||"?";return s.jsxs("header",{className:"h-12 bg-surface-1 border-b border-white/5 flex items-center gap-3 flex-shrink-0",children:[s.jsxs("div",{className:"h-full flex items-center gap-3 flex-1",children:[s.jsxs("div",{className:`h-full flex items-center border-r border-white/5 flex-shrink-0 transition-[width] duration-200 ease-out ${i?"w-14 justify-center":"w-56 pl-4 pr-2 gap-2"}`,children:[s.jsx(ie,{className:"w-7 h-7 object-contain flex-shrink-0"}),!i&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-semibold text-gray-100 text-sm whitespace-nowrap",children:"Testver"}),s.jsx("div",{className:"flex-1"}),s.jsx(Ct,{collapsed:!1,onToggle:r})]})]}),i&&s.jsx(Ct,{collapsed:!0,onToggle:r}),s.jsxs("div",{className:"flex items-center gap-2.5 ml-1",children:[s.jsx(kx,{rootPath:o,framework:e,language:t}),s.jsx(Px,{})]})]}),s.jsx("div",{className:"flex justify-center flex-[0_1_460px] min-w-[180px] px-1",children:s.jsxs("button",{onClick:c,className:"header-search group w-full flex items-center gap-2 h-8 pl-3 pr-2 rounded-lg bg-surface-2 hover:bg-surface-3 border border-white/5 hover:border-white/10 text-gray-400 hover:text-gray-300 transition-colors",title:"Search pages, test cases, defects and files (Ctrl+K)",children:[s.jsx(Zt,{size:14,className:"flex-shrink-0"}),s.jsx("span",{className:"text-xs truncate",children:"Search pages, test cases, defects, files…"}),s.jsx("span",{className:"flex-1"}),s.jsx("kbd",{className:"flex-shrink-0 px-1.5 py-0.5 rounded bg-surface-3 text-[10px] font-mono text-gray-500 group-hover:text-gray-400",children:"Ctrl+K"})]})}),s.jsx(Nx,{}),s.jsx("div",{className:"flex flex-1 justify-end",children:s.jsxs("div",{className:"flex items-center gap-3 pr-4",children:[s.jsxs("div",{className:`flex items-center gap-1.5 text-xs ${a?"text-emerald-400":"text-red-400"}`,children:[a?s.jsx(fo,{size:14}):s.jsx(es,{size:14}),s.jsx("span",{className:"hidden sm:inline",children:a?"Live":"Offline"})]}),s.jsx(Ox,{}),s.jsx("button",{onClick:l,className:"p-1.5 rounded-lg hover:bg-surface-2 text-gray-400 hover:text-gray-200",title:"Rescan project",children:s.jsx(ts,{size:16})}),s.jsx("button",{onClick:S,className:"p-1.5 rounded-lg hover:bg-surface-2 text-gray-400 hover:text-gray-200",title:"Toggle theme",children:d==="dark"?s.jsx(go,{size:16}):s.jsx(xo,{size:16})}),h&&s.jsxs("div",{className:"relative",ref:w,children:[s.jsxs("button",{onClick:()=>k(!b),className:"flex items-center gap-1.5 px-2 py-1 rounded-lg hover:bg-surface-2 transition-colors",children:[s.jsx("div",{className:"w-6 h-6 rounded-full bg-brand-500/20 flex items-center justify-center text-brand-300 text-[11px] font-semibold",children:C}),s.jsx("span",{className:"text-xs text-gray-300 hidden sm:inline max-w-[80px] truncate",children:h.username}),s.jsx(ss,{size:12,className:`text-gray-500 transition-transform ${b?"rotate-180":""}`})]}),b&&s.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 bg-surface-1 border border-white/10 rounded-lg z-50 py-1",children:[s.jsxs("div",{className:"px-3 py-2 border-b border-white/5",children:[s.jsx("p",{className:"text-sm font-medium text-gray-200",children:h.displayName}),s.jsxs("p",{className:"text-xs text-gray-500",children:["@",h.username]}),s.jsx(Xg,{label:h.role==="superadmin"?"super admin":h.role,color:h.role==="superadmin"?"yellow":h.role==="admin"?"brand":h.role==="tester"?"green":"gray"})]}),s.jsxs("button",{onClick:()=>{k(!1),g("/profile")},className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-300 hover:bg-surface-2 hover:text-gray-100",children:[s.jsx(Qt,{size:14}),"Profile"]}),s.jsxs("button",{onClick:O,className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-400 hover:bg-red-500/10",children:[s.jsx(it,{size:14}),"Sign Out"]})]})]})]})})]})}function Ox(){const[e,t]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{if(!e)return;const c=i=>{o.current&&!o.current.contains(i.target)&&t(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[e]);const a=[{label:"Documentation",desc:"Guides & reference",href:"https://www.docs.testver.com/",Icon:So,accent:"text-sky-500 bg-sky-500/10"},{label:"Support",desc:"Get help from our team",href:"https://support.testver.com/",Icon:vo,accent:"text-emerald-500 bg-emerald-500/10"},{label:"YouTube Channel",desc:"Tutorials & demos",href:"https://www.youtube.com/@TestverAI",Icon:jo,accent:"text-rose-500 bg-rose-500/10"}],l=c=>{t(!1),window.open(c,"_blank","noopener,noreferrer")};return s.jsxs("div",{className:"relative",ref:o,children:[s.jsx("button",{onClick:()=>t(c=>!c),className:`p-1.5 rounded-lg transition-colors ${e?"bg-surface-2 text-gray-200":"hover:bg-surface-2 text-gray-400 hover:text-gray-200"}`,title:"Help & resources","aria-label":"Help & resources",children:s.jsx(wo,{size:19})}),e&&s.jsxs("div",{className:"absolute right-0 top-full mt-1.5 w-64 bg-surface-1 border border-white/10 rounded-xl shadow-xl z-50 py-1.5 animate-fade-in",children:[s.jsx("p",{className:"px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:"Help & Resources"}),a.map(({label:c,desc:i,href:r,Icon:d,accent:u})=>s.jsxs("button",{onClick:()=>l(r),className:"group w-full flex items-center gap-3 px-3 py-2 text-left hover:bg-surface-2 transition-colors",children:[s.jsx("span",{className:`inline-flex h-8 w-8 items-center justify-center rounded-lg ${u}`,children:s.jsx(d,{size:15})}),s.jsxs("span",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"block text-sm font-medium text-gray-200",children:c}),s.jsx("span",{className:"block text-xs text-gray-500 truncate",children:i})]}),s.jsx(To,{size:13,className:"text-gray-600 group-hover:text-gray-400 transition-colors"})]},c))]})]})}function Px(){const{mode:e,isLoading:t}=wx();if(t||!e)return null;const a={web:{label:"Web",Icon:ct,container:"bg-sky-500/15 text-sky-700 dark:text-sky-300",iconText:"text-sky-700 dark:text-sky-400",beta:!1},mobile:{label:"Mobile",Icon:Ce,container:"bg-indigo-500/20 text-indigo-700 dark:text-indigo-300",iconText:"text-indigo-700 dark:text-indigo-400",beta:!0},both:{label:"Both",Icon:ke,container:"bg-purple-500/15 text-purple-700 dark:text-purple-300",iconText:"text-purple-700 dark:text-purple-300",beta:!1}}[e],l=a.Icon;return s.jsxs("span",{title:`App mode: ${a.label}${a.beta?" (beta)":""} — change in Settings → General`,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[11px] ${a.container}`,children:[s.jsx(l,{size:11,className:a.iconText}),s.jsx("span",{className:"font-medium",children:a.label}),a.beta&&s.jsx("span",{className:"ml-1 text-[9px] font-bold uppercase tracking-wider text-amber-400",children:"Beta"})]})}function Ex({subscribe:e,children:t}){const o=ix(e),a=cx(e);return s.jsx(An.Provider,{value:o,children:s.jsx($n.Provider,{value:a,children:t})})}function Zb({run:e,format:t}){return s.jsx(s.Fragment,{children:t(ux(e))})}function Fn({text:e="Loading..."}){return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 animate-fade-in",children:[s.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-brand-500 border-t-transparent animate-spin mb-4"}),s.jsx("p",{className:"text-sm text-gray-400",children:e})]})}const Rx=3e3,$x=5*6e4;function Ax({disconnectedSince:e,onRetry:t}){const[o,a]=m.useState(()=>Date.now()),[l,c]=m.useState(!1),i=m.useRef(!1);m.useEffect(()=>{if(e===null)return;a(Date.now());const h=setInterval(()=>a(Date.now()),1e3);return()=>clearInterval(h)},[e]);const r=e===null?0:o-e,d=e!==null&&r>=Rx;if(m.useEffect(()=>{if(d){i.current=!0,c(!1);return}if(e===null&&i.current){i.current=!1,c(!0);const h=setTimeout(()=>c(!1),3e3);return()=>clearTimeout(h)}},[d,e]),l)return s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2 px-4 py-1.5 text-xs border-b bg-emerald-500/10 border-emerald-500/30 text-emerald-700 dark:text-emerald-300",role:"status",children:[s.jsx(ot,{size:14,className:"shrink-0"}),"Reconnected to Testver."]});if(!d)return null;const u=r>=$x;return s.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2 px-4 py-1.5 text-xs border-b bg-amber-500/10 border-amber-500/30 text-amber-700 dark:text-amber-300",role:"status",children:[s.jsx(es,{size:14,className:"shrink-0"}),s.jsx("span",{className:"flex-1 min-w-0",children:u?s.jsxs(s.Fragment,{children:["Still can't reach the Testver server after ",Math.floor(r/6e4)," minutes. Check your network, or whether the server is running. If only your connection dropped, tasks you started (AI Assistant, test runs) keep running on the server — their results and file changes are there when you reconnect."]}):s.jsx(s.Fragment,{children:"Reconnecting to Testver… Check your Wi-Fi or network connection. Anything running carries on meanwhile, and this page catches up when it is back."})}),s.jsxs("button",{onClick:t,className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-amber-500/40 hover:bg-amber-500/20 font-medium shrink-0",children:[s.jsx(ts,{size:12})," Retry now"]})]})}const Ot=[{id:"dashboard",label:"Dashboard",hint:"Overview & health",path:"/",icon:s.jsx(Bt,{size:16}),keywords:"home overview",primary:!0},{id:"tests",label:"Test Explorer",hint:"Browse discovered tests",path:"/tests",icon:s.jsx(Xe,{size:16}),keywords:"suites specs",primary:!0},{id:"code-map",label:"Code Map",hint:"Codebase structure X-ray",path:"/code-map",icon:s.jsx(Gt,{size:16}),keywords:"graph quality methods steps"},{id:"test-data",label:"Test Data",hint:"Test data map",path:"/code-map?view=data",icon:s.jsx(No,{size:16}),keywords:"data map fixtures datasets"},{id:"runner",label:"Runner",hint:"Execute tests",path:"/advanced?tab=runner",icon:s.jsx(os,{size:16}),keywords:"run execute advanced",primary:!0},{id:"results",label:"Results",hint:"Run history & analytics",path:"/results",icon:s.jsx(Me,{size:16}),keywords:"runs executions reports",primary:!0},{id:"schedules",label:"Schedules",hint:"Cron-based recurring runs",path:"/advanced?tab=schedules",icon:s.jsx(rs,{size:16}),keywords:"cron recurring advanced"},{id:"pipelines",label:"CI/CD Pipelines",hint:"Gate builds on Testver-executed runs",path:"/pipelines",icon:s.jsx(ko,{size:16}),keywords:"ci cd cicd pipeline gate trigger token trace deploy orchestration dashboard github actions gitlab jenkins azure"},{id:"test-cases",label:"Test Cases",hint:"Manage test cases",path:"/test-cases",icon:s.jsx(Ze,{size:16}),keywords:"tm management tc",primary:!0},{id:"test-plans",label:"Test Plans",hint:"Plans, cycles & executions",path:"/test-plans",icon:s.jsx(ke,{size:16}),keywords:"tp cycles"},{id:"ai-test-gen",label:"AI Test Gen",hint:"Generate test cases with AI",path:"/ai-test-gen",icon:s.jsx(zt,{size:16}),keywords:"generate ai"},{id:"sources",label:"Sources",hint:"Requirements & documents",path:"/sources",icon:s.jsx(et,{size:16}),keywords:"requirements jira documents"},{id:"script-mapping",label:"Script Mapping",hint:"Link cases to automation",path:"/script-mapping",icon:s.jsx(qt,{size:16}),keywords:"traceability link"},{id:"coverage",label:"Coverage",hint:"Traceability & gaps",path:"/coverage",icon:s.jsx(Wt,{size:16}),keywords:"gaps orphans"},{id:"analytics",label:"Analytics",hint:"Test management analytics",path:"/analytics",icon:s.jsx(Me,{size:16}),keywords:"charts trends"},{id:"defects",label:"Defects",hint:"Bug tracker & Kanban",path:"/defects",icon:s.jsx(tt,{size:16}),keywords:"bugs issues kanban"},{id:"import-export",label:"Import / Export",hint:"TestRail, Zephyr, CSV…",path:"/import-export",icon:s.jsx(as,{size:16}),keywords:"testrail zephyr xray qtest csv"},{id:"explorer",label:"Project Explorer",hint:"Browse project files",path:"/explorer",icon:s.jsx(Vt,{size:16}),keywords:"files editor",primary:!0},{id:"api-testing",label:"API workspace",hint:"API mode collections, environments & history",path:"/api-testing",icon:s.jsx(Co,{size:16}),keywords:"api testing rest postman endpoints collections"},{id:"ai",label:"AI Assistant",hint:"AI chat copilot",path:"/ai",icon:s.jsx(st,{size:16}),keywords:"chat copilot",primary:!0},{id:"ai-record",label:"AI Record",hint:"Record & generate tests",path:"/ai-record",icon:s.jsx(Ht,{size:16}),keywords:"recorder capture"},{id:"testver-mcp",label:"Testver MCP",hint:"Connect an AI coding agent",path:"/testver-mcp",icon:s.jsx(Kt,{size:16}),keywords:"mcp agent coding agent model context protocol token"},{id:"reports",label:"Reports",hint:"Saved dashboards",path:"/reports",icon:s.jsx(nt,{size:16}),keywords:"dashboards export"},{id:"git",label:"Git",hint:"Stage, commit, push",path:"/git",icon:s.jsx(ne,{size:16}),keywords:"commit branch push"},{id:"connectors",label:"Connectors",hint:"JIRA, Slack, grids…",path:"/settings?tab=connectors",icon:s.jsx(Be,{size:16}),keywords:"jira slack integrations browserstack"},{id:"settings",label:"Settings",hint:"Configure Testver",path:"/settings",icon:s.jsx(_e,{size:16}),keywords:"config llm providers preferences",primary:!0},{id:"users",label:"Users",hint:"User management (admin)",path:"/users",icon:s.jsx(Ue,{size:16}),keywords:"admin roles accounts"},{id:"audit",label:"Audit Log",hint:"Activity log (admin)",path:"/audit",icon:s.jsx(Yt,{size:16}),keywords:"admin history"},{id:"profile",label:"Profile",hint:"Your account & password",path:"/profile",icon:s.jsx(Ue,{size:16}),keywords:"account password sessions"},{id:"about",label:"Testver: About",hint:"About this app",path:"/testver/about",icon:s.jsx(Ft,{size:16}),keywords:"version help"},{id:"testver-connections",label:"Testver: Connections",hint:"Connect to Testver and manage AI credits, Grid and Mail",path:"/testver",icon:s.jsx(Be,{size:16}),keywords:"connect account grid mail cloud credits services"}],Pt={testcase:{label:"Test Cases",icon:s.jsx(Ze,{size:16})},test:{label:"Tests",icon:s.jsx(Xe,{size:16})},testplan:{label:"Test Plans",icon:s.jsx(ke,{size:16})},defect:{label:"Defects",icon:s.jsx(tt,{size:16})},source:{label:"Sources",icon:s.jsx(et,{size:16})},schedule:{label:"Schedules",icon:s.jsx(rs,{size:16})},connector:{label:"Connectors",icon:s.jsx(Be,{size:16})},file:{label:"Files",icon:s.jsx(nt,{size:16})}},Ix=["testcase","test","testplan","defect","source","schedule","connector","file"];function Et(e,t){const o=e.toLowerCase(),a=t.toLowerCase();if(!o)return 0;const l=a.indexOf(o);if(l===0)return 1e3;if(l>0)return 600-l;let c=0,i=0,r=0;for(;c<a.length&&i<o.length;)a[c]===o[i]?i++:r++,c++;return i===o.length?120-Math.min(r,119):-1}function Lx({open:e,onClose:t}){const[o,a]=m.useState(""),[l,c]=m.useState([]),[i,r]=m.useState(!1),[d,u]=m.useState(0),h=m.useRef(null),p=H(),g=m.useCallback(C=>{p(C),t()},[p,t]),b=m.useMemo(()=>{const C=o.trim(),N=P=>({id:`nav-${P.id}`,label:P.label,description:P.hint,icon:P.icon,action:()=>g(P.path)});return C?Ot.map(P=>({n:P,score:Math.max(Et(C,P.label),Et(C,P.keywords||"")-200)})).filter(P=>P.score>-1).sort((P,E)=>E.score-P.score).slice(0,8).map(P=>N(P.n)):Ot.filter(P=>P.primary).map(N)},[o,g]);m.useEffect(()=>{if(!e)return;const C=o.trim();if(C.length<2){c([]),r(!1);return}const N=new AbortController;r(!0);const P=setTimeout(()=>{Ss(C,N.signal).then(E=>{c(E.results),r(!1)}).catch(E=>{(E==null?void 0:E.name)!=="AbortError"&&(c([]),r(!1))})},200);return()=>{clearTimeout(P),N.abort()}},[o,e]);const k=m.useMemo(()=>{const C=[];b.length&&C.push({key:"nav",label:"Navigation",items:b});for(const N of Ix){const P=l.filter(E=>E.type===N);P.length&&C.push({key:N,label:Pt[N].label,items:P.map(E=>({id:`${E.type}-${E.id}`,label:E.title,description:E.subtitle||"",icon:Pt[E.type].icon,action:()=>g(E.route)}))})}return C},[b,l,g]),w=m.useMemo(()=>k.flatMap(C=>C.items),[k]);if(m.useEffect(()=>{u(0)},[w.length,o]),m.useEffect(()=>{var C;e&&((C=h.current)==null||C.focus(),a(""),c([]),r(!1))},[e]),m.useEffect(()=>{if(!e)return;const C=N=>{N.key==="Escape"&&t(),N.key==="ArrowDown"&&(N.preventDefault(),u(P=>Math.min(P+1,w.length-1))),N.key==="ArrowUp"&&(N.preventDefault(),u(P=>Math.max(P-1,0))),N.key==="Enter"&&w[d]&&w[d].action()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[e,w,d,t]),!e)return null;const S=w.length>0;let O=-1;return s.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:t}),s.jsxs("div",{className:"relative w-[560px] bg-surface-1 rounded-xl border border-white/10 overflow-hidden animate-fade-in",children:[s.jsxs("div",{className:"flex items-center px-4 border-b border-white/5",children:[s.jsx(Zt,{size:18,className:"text-gray-400 flex-shrink-0"}),s.jsx("input",{ref:h,value:o,onChange:C=>a(C.target.value),placeholder:"Search pages, test cases, defects, files…",className:"flex-1 bg-transparent border-none outline-none px-3 py-3.5 text-sm text-gray-100 placeholder-gray-500"}),i&&s.jsx(Fe,{size:15,className:"text-gray-500 animate-spin flex-shrink-0 mr-1"}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-300",children:s.jsx(Qe,{size:16})})]}),s.jsxs("div",{className:"max-h-80 overflow-y-auto py-1",children:[!S&&s.jsx("div",{className:"px-4 py-8 text-center text-sm text-gray-500",children:i?"Searching…":o.trim()?"No results found":"Type to search"}),k.map(C=>s.jsxs("div",{children:[s.jsx("div",{className:"px-4 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:C.label}),C.items.map(N=>{O+=1;const P=O;return s.jsxs("button",{className:`w-full flex items-center gap-3 px-4 py-2.5 text-left text-sm transition-colors ${P===d?"bg-brand-500/15 text-brand-200":"text-gray-300 hover:bg-white/5"}`,onMouseEnter:()=>u(P),onClick:N.action,children:[s.jsx("span",{className:"text-gray-400 flex-shrink-0",children:N.icon}),s.jsx("span",{className:"font-medium flex-1 truncate",children:N.label}),N.description&&s.jsx("span",{className:"text-xs text-gray-500 truncate max-w-[240px]",children:N.description})]},N.id)})]},C.key))]}),s.jsxs("div",{className:"px-4 py-2 border-t border-white/5 flex gap-3 text-[10px] text-gray-500",children:[s.jsxs("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono",children:"↑↓"})," Navigate"]}),s.jsxs("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono",children:"Enter"})," Select"]}),s.jsxs("span",{children:[s.jsx("kbd",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono",children:"Esc"})," Close"]})]})]})]})}function Dx({subscribe:e}){const[t,o]=m.useState(null),[a,l]=m.useState(""),[c,i]=m.useState(!1),[r,d]=m.useState(!1),[u,h]=m.useState(!1),[p,g]=m.useState(!1),b=m.useRef(null);if(m.useEffect(()=>e(f=>{if(f.type==="askpass-request"){const{requestId:y,prompt:x}=f;typeof y=="string"&&typeof x=="string"&&(o({requestId:y,prompt:x}),l(""),i(!1),g(!1))}if(f.type==="askpass-closed"){const{requestId:y}=f;o(x=>x&&x.requestId===y?null:x),l("")}}),[e]),m.useEffect(()=>{t&&setTimeout(()=>{var f;return(f=b.current)==null?void 0:f.focus()},0)},[t]),!t)return null;const k=async()=>{if(!a||u)return;h(!0);let f=!1;try{f=(await on(t.requestId,a,r)).ok}catch{}if(h(!1),l(""),!f){g(!0);return}o(null),r&&window.dispatchEvent(new CustomEvent("askpass-cache-changed"))},w=async()=>{if(!p)try{await rn(t.requestId)}catch{}o(null),l(""),g(!1)},S=/^\s*user ?name\b/i.test(t.prompt),O=/\(yes\/no/i.test(t.prompt)||/continue connecting/i.test(t.prompt),C=!S&&!O,N=/passphrase/i.test(t.prompt),P=/password/i.test(t.prompt),E=S?"Git username":N?"SSH passphrase":P?"Git password":"Git credentials",T=S?"Username (e.g. your GitHub user)":N?"Passphrase":P?"Password or personal access token":O?"yes / no":"Value";return s.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:s.jsxs("div",{className:"bg-surface-1 dark:bg-surface-1 rounded-xl border border-white/10 shadow-2xl w-full max-w-md mx-4 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-2 px-5 py-3 border-b border-white/5 bg-surface-2/50",children:[s.jsx(ge,{size:16,className:"text-amber-400"}),s.jsx("h3",{className:"text-base font-semibold text-gray-100 flex-1",children:E}),s.jsx("button",{onClick:w,className:"text-gray-500 hover:text-gray-300 transition-colors",title:"Cancel","aria-label":"Cancel",children:s.jsx(Qe,{size:16})})]}),s.jsxs("div",{className:"px-5 py-4 space-y-3",children:[p&&s.jsx("p",{role:"alert",className:"text-sm text-red-600 dark:text-red-400 leading-relaxed",children:"This request has expired — git stopped waiting for an answer. Close this and run the action again."}),s.jsx("p",{className:"text-sm text-gray-300 leading-relaxed",children:"Git is asking for credentials to complete the operation:"}),s.jsx("div",{className:"bg-orange-100 dark:bg-orange-500/15 border border-orange-600 dark:border-orange-500/60 rounded-lg px-3 py-2 text-sm font-mono text-orange-800 dark:text-orange-200 break-all",children:t.prompt}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{ref:b,type:C&&!c?"password":"text",value:a,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),k()),f.key==="Escape"&&(f.preventDefault(),w())},placeholder:T,className:`w-full bg-surface-2 border border-white/10 rounded-lg px-3 py-2.5 text-sm text-gray-100 placeholder-gray-500 focus:outline-none focus:border-sky-500/50 font-mono ${C?"pr-9":""}`,autoComplete:"off",spellCheck:!1}),C&&s.jsx("button",{type:"button",tabIndex:-1,onClick:()=>i(f=>!f),"aria-label":c?"Hide":"Show",title:c?"Hide":"Show",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-200 focus:outline-none",children:c?s.jsx(is,{size:16}):s.jsx(cs,{size:16})})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-300 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:f=>d(f.target.checked),className:"rounded border-white/20 bg-surface-2 text-sky-500 focus:ring-sky-500 focus:ring-offset-0"}),"Remember for this session"]}),s.jsxs("p",{className:"text-xs text-gray-500 leading-relaxed",children:["Your input is sent only to the local git process. Remembered values live in memory only and are wiped when the server restarts or you click ",s.jsx("em",{children:"Clear saved credentials"}),"."]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-white/5 bg-surface-2/30",children:[s.jsx("button",{onClick:w,disabled:u,className:"px-3 py-1.5 rounded-lg text-sm text-gray-300 hover:bg-white/5 transition-colors",children:p?"Close":"Cancel"}),s.jsx("button",{onClick:k,disabled:!a||u||p,className:"px-4 py-1.5 rounded-lg text-sm font-medium bg-sky-600 hover:bg-sky-500 text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:u?"Submitting…":"Submit"})]})]})})}const Bn=m.createContext(e=>{e()});function ey(){return m.useContext(Bn)}const Gn="testver-run-warning-quiet",zn=()=>new Date().toISOString().slice(0,10);function Mx(){try{return localStorage.getItem(Gn)===zn()}catch{return!1}}function _x({children:e}){const t=On(),{data:o}=ft(t),[a,l]=m.useState(null),c=m.useCallback((i,r)=>{const d=o==null?void 0:o.check;if(!(o!=null&&o.settings.warnBeforeRuns)||!d||!gt(d)||Mx()){i();return}l({run:i,files:(r==null?void 0:r.files)??[],check:d})},[o]);return s.jsxs(Bn.Provider,{value:c,children:[e,a&&s.jsx(Ux,{...a,onClose:()=>l(null)})]})}function Ux({run:e,files:t,check:o,onClose:a}){const l=H(),{toast:c}=Ae(),i=En(),[r,d]=m.useState(!1),u=Jn(o),h=()=>{if(r)try{localStorage.setItem(Gn,zn())}catch{}a()},p=new Set(t.map(S=>S.replace(/\\/g,"/"))),g=S=>{const O=Nt(o,S)??S;return[...p].some(C=>C===O||C.endsWith(`/${O}`)||O.endsWith(`/${C}`))},b=[];for(const S of o.incoming)for(const O of S.files){if(b.length>=5)break;(p.size===0||g(O.path))&&b.push({path:Nt(o,O.path)??O.path,msg:S.message})}const k=p.size>0?o.incoming.filter(S=>S.files.some(O=>g(O.path))).length:0,w=o.verdict==="uncommitted_overlap"||o.verdict==="will_conflict";return Jt.createPortal(s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:a}),s.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"run-warning-title",className:"relative bg-surface-1 rounded-xl border border-white/10 p-6 w-[640px] max-w-[90vw] animate-fade-in",children:[s.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/15 flex items-center justify-center flex-shrink-0 text-amber-500",children:s.jsx(ne,{size:20})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("h3",{id:"run-warning-title",className:"text-base font-semibold text-gray-100",children:["Your code is ",q(o.behind,"commit")," behind ",u]}),s.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:[o.upstream," has newer commits by ",Un(o),"."," ",k>0?s.jsxs(s.Fragment,{children:[s.jsxs("b",{className:"text-gray-200",children:[q(k,"of them changes","of them change")," files these tests use"]}),", so this run may not test the latest code:"]}):s.jsx(s.Fragment,{children:"This run may not test the latest code. The newest changes:"})]}),b.length>0&&s.jsx("ul",{className:"mt-2 space-y-1 text-xs font-mono text-gray-300",children:b.map((S,O)=>s.jsxs("li",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Oo,{size:12,className:"text-amber-500 shrink-0"}),s.jsx("span",{className:"truncate",children:S.path}),s.jsxs("span",{className:"font-sans text-gray-500 truncate",children:["— “",S.msg,"”"]})]},O))}),w&&s.jsx("p",{className:"mt-2 text-xs text-amber-600 dark:text-amber-300",children:o.verdict==="uncommitted_overlap"?"Some of these change files you are editing — pull from the Git page with Stash, pull & re-apply.":"Pulling will need conflicts resolved — do it from the Git page."}),s.jsxs("label",{className:"mt-3 flex items-center gap-2 text-xs text-gray-500",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:S=>d(S.target.checked),className:"rounded border-white/20"})," Don't warn me again today"]})]})]}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{onClick:h,className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300",children:"Cancel"}),s.jsxs("button",{onClick:()=>{h(),e()},className:"px-4 py-2 text-sm rounded-lg bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/10 flex items-center gap-1.5",children:[s.jsx(os,{size:13})," Run anyway"]}),w?s.jsxs("button",{onClick:()=>{h(),l("/git")},className:"px-4 py-2 text-sm rounded-lg bg-amber-600 hover:bg-amber-500 text-white font-medium flex items-center gap-1.5",children:["Open Git ",s.jsx(rt,{size:14})]}):s.jsxs("button",{disabled:i.isPending,onClick:()=>i.mutate(void 0,{onSuccess:S=>{var O;if(h(),S.conflicts&&((O=S.conflictedPaths)!=null&&O.length)){c("error","The pull stopped on conflicts — resolve them on the Git page, then run."),l("/git");return}c("success",`Pulled ${q(o.behind,"commit")} — starting the run`),e()},onError:S=>c("error",`Pull failed: ${S.message}`)}),className:"px-4 py-2 text-sm rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white font-medium flex items-center gap-1.5 disabled:opacity-50",children:[s.jsx(Xt,{size:14,className:i.isPending?"animate-pulse":""})," Pull, then run"]})]})]})]}),document.body)}function Jx(){return B({queryKey:["project"],queryFn:fs,staleTime:3e4})}const Fx=[{id:"scanning",label:"Scanning project files",detail:"Walking your project directory to discover tests, page objects, and configs.",Icon:Eo},{id:"detecting",label:"Detecting test frameworks",detail:"Looking for Playwright, WebdriverIO, Appium, Selenium, Cypress, pytest, JUnit, and more.",Icon:Ro},{id:"discovering",label:"Discovering modules",detail:"Organizing files into modules — tests, fixtures, helpers, configs, and the rest.",Icon:ns},{id:"ready",label:"Almost ready ✨",detail:"Just a moment while we get everything in place for you…",Icon:st}],qn=[{id:"connecting",label:"Connecting to Testver",detail:"Establishing a secure session with the workspace.",Icon:re},{id:"identity",label:"Verifying your identity",detail:"Checking your saved session token against the server.",Icon:ge},{id:"profile",label:"Loading your profile",detail:"Pulling your role, preferences, and recent activity.",Icon:Po}],Bx=1500,Gx=250;function Wn({title:e="Getting your project ready",subtitle:t="Hang tight — we're loading everything Testver needs to help you write, run, and analyze tests.",phases:o=Fx,footerHint:a="Larger projects can take a few seconds — the first scan is the slow one; subsequent restarts are instant."}={}){const[l,c]=m.useState(0),[i,r]=m.useState(!1);return m.useEffect(()=>{const d=setTimeout(()=>r(!0),Gx);return()=>clearTimeout(d)},[]),m.useEffect(()=>{if(!i)return;const d=setInterval(()=>{c(u=>Math.min(u+1,o.length-1))},Bx);return()=>clearInterval(d)},[i,o.length]),i?s.jsxs("div",{className:"h-screen flex items-center justify-center bg-surface-0 px-4",children:[s.jsxs("div",{className:"w-full max-w-lg",children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 bg-brand-500/20 blur-2xl rounded-full animate-pulse-soft"}),s.jsx(ie,{className:"relative w-16 h-16 object-contain animate-breathe"})]}),s.jsx("h1",{className:"mt-5 text-xl font-semibold text-gray-100",children:e}),s.jsx("p",{className:"mt-1.5 text-sm text-gray-500 text-center max-w-sm",children:t})]}),s.jsx("div",{className:"relative h-1.5 mb-7 rounded-full bg-surface-2 overflow-hidden",children:s.jsx("div",{className:"absolute inset-y-0 w-1/3 rounded-full bg-gradient-to-r from-transparent via-brand-500 to-transparent",style:{animation:"testverProgressSweep 1.6s ease-in-out infinite"}})}),s.jsx("div",{className:"relative h-[88px] mb-5",children:o.map((d,u)=>{const h=d.Icon,p=u===l,g=u<l;return s.jsxs("div",{className:`absolute inset-0 flex items-start gap-3 p-3.5 rounded-lg border bg-brand-500/10 border-brand-500/30 transition-all duration-500 ${p?"opacity-100 translate-y-0":g?"opacity-0 -translate-y-3 pointer-events-none":"opacity-0 translate-y-3 pointer-events-none"}`,"aria-hidden":!p,children:[s.jsx("div",{className:"mt-0.5 w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 bg-brand-500/20 text-brand-300 animate-pulse-soft",children:s.jsx(h,{size:16})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-brand-200",children:d.label}),s.jsx("p",{className:"text-[11px] text-gray-500 leading-snug mt-1",children:d.detail})]})]},d.id)})}),s.jsx("div",{className:"flex items-center justify-center gap-2 mb-2",children:o.map((d,u)=>{const h=u<=l;return s.jsx("span",{className:`rounded-full transition-all duration-500 ${h?u===l?"w-6 h-1.5 bg-brand-500":"w-1.5 h-1.5 bg-brand-500/70":"w-1.5 h-1.5 bg-white/10"}`},u)})}),a&&l===o.length-1&&s.jsx("p",{className:"mt-4 text-center text-[11px] text-gray-500",children:a})]}),s.jsx("style",{children:`
|
|
19
|
+
@keyframes testverProgressSweep {
|
|
20
|
+
0% { transform: translateX(-100%); }
|
|
21
|
+
100% { transform: translateX(400%); }
|
|
22
|
+
}
|
|
23
|
+
`})]}):s.jsx("div",{className:"h-screen bg-surface-0"})}const Ne="testver.clientId",Rt="testver.previousClientIds";function zx(){try{return sessionStorage.getItem(Ne)}catch{return null}}function qx(e){try{const t=sessionStorage.getItem(Ne);if(t&&t!==e){const o=JSON.parse(sessionStorage.getItem(Rt)||"[]");sessionStorage.setItem(Rt,JSON.stringify([t,...o.filter(a=>a!==t)].slice(0,5)))}sessionStorage.setItem(Ne,e)}catch{}}const $t=[1e3,2e3,5e3,1e4];function Wx(){const e=m.useRef(null),t=m.useRef(new Set),[o,a]=m.useState(!1),[l,c]=m.useState(null),i=m.useRef(null),r=m.useRef(0),d=m.useRef(!1),u=m.useRef(null),h=m.useCallback(()=>{if(d.current)return;i.current&&(clearTimeout(i.current),i.current=null);const w=window.location.protocol==="https:"?"wss:":"ws:",S=G(),O=new URLSearchParams;S&&O.set("token",S);const C=zx();C&&(O.set("resume",C),u.current!==null&&O.set("after",String(u.current)));const N=O.toString()?`?${O.toString()}`:"",P=new WebSocket(`${w}//${window.location.host}/ws${N}`);P.onopen=()=>{e.current===P&&(r.current=0,a(!0),c(null))},P.onclose=E=>{if(e.current!==P)return;if(a(!1),c(f=>f??Date.now()),ve(null),E.code===4001){Ee(),window.location.href="/login";return}if(d.current)return;const T=$t[Math.min(r.current,$t.length-1)];r.current++,i.current=setTimeout(h,T)},P.onerror=()=>P.close(),P.onmessage=E=>{try{const T=JSON.parse(E.data),f=T.__seq;if(typeof f=="number"){if(u.current!==null&&f<=u.current)return;u.current=f}T.type==="client-id"&&T.clientId&&(T.resumed||(u.current=null),ve(T.clientId),qx(T.clientId));for(const y of t.current)try{y(T)}catch(x){console.error("[ws] message handler failed:",x)}}catch{}},e.current=P},[]),p=m.useCallback(()=>{const w=e.current;w&&(w.readyState===WebSocket.OPEN||w.readyState===WebSocket.CONNECTING)||(r.current=0,h())},[h]);m.useEffect(()=>{d.current=!1,h();const w=()=>p(),S=()=>{document.visibilityState==="visible"&&p()};return window.addEventListener("online",w),document.addEventListener("visibilitychange",S),()=>{d.current=!0,window.removeEventListener("online",w),document.removeEventListener("visibilitychange",S),i.current&&clearTimeout(i.current);const O=e.current;e.current=null,O==null||O.close()}},[h,p]);const g=m.useCallback(w=>new Promise(S=>{try{sessionStorage.setItem(Ne,w)}catch{}u.current=null;let O=!1;const C=f=>{O||(O=!0,P(),clearTimeout(E),S(f))},N=f=>{f.type==="client-id"&&f.clientId&&C(f.clientId)};t.current.add(N);const P=()=>{t.current.delete(N)},E=setTimeout(()=>C(null),1e4),T=e.current;e.current=null;try{T==null||T.close()}catch{}ve(null),r.current=0,h()}),[h]),b=m.useCallback(w=>(t.current.add(w),()=>{t.current.delete(w)}),[]),k=m.useCallback(w=>{var S;((S=e.current)==null?void 0:S.readyState)===WebSocket.OPEN&&e.current.send(JSON.stringify(w))},[]);return{connected:o,subscribe:b,send:k,disconnectedSince:l,reconnectNow:p,adoptClientId:g}}const At={"/":"Dashboard","/explorer":"Project Explorer","/advanced":"Advanced","/tests":"Test Explorer","/test-cases":"Test Cases","/test-plans":"Test Plans","/script-mapping":"Script Mapping","/ai-test-gen":"AI Test Generation","/sources":"Sources","/coverage":"Coverage","/analytics":"Analytics","/defects":"Defects","/import-export":"Import / Export","/connectors":"Connectors","/results":"Results","/output":"Output","/api-testing":"API workspace","/git":"Git","/ai":"AI Assistant","/skills":"Skills & MCPs","/workflows":"Workflows","/settings":"Settings","/profile":"Profile","/users":"User Management","/audit":"Audit Log","/login":"Login","/setup":"Setup"};function Hx(){const{pathname:e}=Ve();m.useEffect(()=>{let t=At[e];if(!t){const o="/"+e.split("/").filter(Boolean)[0];t=At[o]}!t&&e.startsWith("/module")&&(t="Module Explorer"),document.title=t?`${t} - Testver`:"Testver"},[e])}const Kx=m.memo(Cx),Vx=m.memo(fx),Yx=2e3;function Qx(){const{data:e,isLoading:t}=Jx(),{connected:o,subscribe:a,send:l,disconnectedSince:c,reconnectNow:i,adoptClientId:r}=Wx(),d="testver-sidebar-collapsed",[u,h]=m.useState(()=>{try{return localStorage.getItem(d)==="1"}catch{return!1}});m.useEffect(()=>{try{localStorage.setItem(d,u?"1":"0")}catch{}},[u]);const[p,g]=m.useState(!1),b=de(),{toast:k}=Ae();Hx(),m.useEffect(()=>{const T=f=>{if((f.ctrlKey||f.metaKey)&&f.key==="k")f.preventDefault(),g(y=>!y);else if((f.ctrlKey||f.metaKey)&&(f.key==="b"||f.key==="B")){const y=f.target,x=y==null?void 0:y.tagName;if(x==="INPUT"||x==="TEXTAREA"||y!=null&&y.isContentEditable)return;f.preventDefault(),h(j=>!j)}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[]);const w=m.useRef(new Set),S=m.useRef(null),O=m.useCallback(T=>{const f=x=>{for(const j of x)b.invalidateQueries({queryKey:[j]})};if(S.current){for(const x of T)w.current.add(x);return}f(T);const y=()=>{S.current=setTimeout(()=>{if(w.current.size===0){S.current=null;return}const x=[...w.current];w.current.clear(),f(x),y()},Yx)};y()},[b]);m.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),m.useEffect(()=>a(T=>{if(T.type==="modules-updated"&&O(["project","fileTree","moduleFiles","test-explorer"]),T.type==="test-results"&&O(["test-trends","top-failures","flaky-tests","slowest-tests","result-runs","result-run","test-explorer","runHistory"]),T.type==="healing-event"&&(b.invalidateQueries({queryKey:["healing-events"]}),b.invalidateQueries({queryKey:["healing-analytics"]}),b.invalidateQueries({queryKey:["healing-stats"]}),b.invalidateQueries({queryKey:["healing-fingerprints"]})),T.type==="schedule-skipped"){const f=T.scheduleName||"Scheduled run";k("info",`${f} skipped — its previous run is still in progress.`)}}),[a,b,k,O]);const C=m.useCallback(async()=>{await gs(),b.invalidateQueries({queryKey:["project"]})},[b]),N=m.useCallback(()=>g(!0),[]),P=m.useCallback(()=>h(T=>!T),[]),E=m.useMemo(()=>({project:e,connected:o,subscribe:a,send:l,adoptClientId:r}),[e,o,a,l,r]);return t||!e?s.jsx(Wn,{title:"Welcome back to Testver",subtitle:"One moment — loading your workspace and recent activity.",phases:qn,footerHint:void 0}):s.jsx(Ex,{subscribe:a,children:s.jsx(hx,{subscribe:a,children:s.jsxs("div",{className:"h-screen flex flex-col overflow-hidden bg-surface-0",children:[s.jsx(Kx,{framework:e.framework||"",language:e.language,rootPath:e.rootPath,connected:o,onRescan:C,onSearchOpen:N,sidebarCollapsed:u,onToggleSidebar:P}),s.jsx(Ax,{disconnectedSince:c,onRetry:i}),s.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[s.jsx(Vx,{modules:e.modules,collapsed:u}),s.jsx("main",{className:"flex-1 overflow-y-auto",children:s.jsx(_x,{children:s.jsx(m.Suspense,{fallback:s.jsx(Fn,{}),children:s.jsx(Qn,{context:E})})})})]}),s.jsx(Lx,{open:p,onClose:()=>g(!1),modules:e.modules}),s.jsx(Dx,{subscribe:a})]})})})}const le=m.forwardRef(function({className:t="",wrapperClassName:o="",...a},l){const[c,i]=m.useState(!1);return s.jsxs("div",{className:`relative ${o}`,children:[s.jsx("input",{...a,ref:l,type:c?"text":"password",className:`${t} pr-9`}),s.jsx("button",{type:"button",tabIndex:-1,onClick:()=>i(r=>!r),"aria-label":c?"Hide password":"Show password",title:c?"Hide":"Show",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 focus:outline-none",children:c?s.jsx(is,{size:16}):s.jsx(cs,{size:16})})]})}),ue=function(e,t){let l=e;const c=he[t];let i=null,r=0,d=null;const u=[],h={},p=function(f,y){r=l*4+17,i=(function(x){const j=new Array(x);for(let v=0;v<x;v+=1){j[v]=new Array(x);for(let R=0;R<x;R+=1)j[v][R]=null}return j})(r),g(0,0),g(r-7,0),g(0,r-7),w(),k(),O(f,y),l>=7&&S(f),d==null&&(d=P(l,c,u)),C(d,y)},g=function(f,y){for(let x=-1;x<=7;x+=1)if(!(f+x<=-1||r<=f+x))for(let j=-1;j<=7;j+=1)y+j<=-1||r<=y+j||(0<=x&&x<=6&&(j==0||j==6)||0<=j&&j<=6&&(x==0||x==6)||2<=x&&x<=4&&2<=j&&j<=4?i[f+x][y+j]=!0:i[f+x][y+j]=!1)},b=function(){let f=0,y=0;for(let x=0;x<8;x+=1){p(!0,x);const j=Z.getLostPoint(h);(x==0||f>j)&&(f=j,y=x)}return y},k=function(){for(let f=8;f<r-8;f+=1)i[f][6]==null&&(i[f][6]=f%2==0);for(let f=8;f<r-8;f+=1)i[6][f]==null&&(i[6][f]=f%2==0)},w=function(){const f=Z.getPatternPosition(l);for(let y=0;y<f.length;y+=1)for(let x=0;x<f.length;x+=1){const j=f[y],v=f[x];if(i[j][v]==null)for(let R=-2;R<=2;R+=1)for(let $=-2;$<=2;$+=1)R==-2||R==2||$==-2||$==2||R==0&&$==0?i[j+R][v+$]=!0:i[j+R][v+$]=!1}},S=function(f){const y=Z.getBCHTypeNumber(l);for(let x=0;x<18;x+=1){const j=!f&&(y>>x&1)==1;i[Math.floor(x/3)][x%3+r-8-3]=j}for(let x=0;x<18;x+=1){const j=!f&&(y>>x&1)==1;i[x%3+r-8-3][Math.floor(x/3)]=j}},O=function(f,y){const x=c<<3|y,j=Z.getBCHTypeInfo(x);for(let v=0;v<15;v+=1){const R=!f&&(j>>v&1)==1;v<6?i[v][8]=R:v<8?i[v+1][8]=R:i[r-15+v][8]=R}for(let v=0;v<15;v+=1){const R=!f&&(j>>v&1)==1;v<8?i[8][r-v-1]=R:v<9?i[8][15-v-1+1]=R:i[8][15-v-1]=R}i[r-8][8]=!f},C=function(f,y){let x=-1,j=r-1,v=7,R=0;const $=Z.getMaskFunction(y);for(let D=r-1;D>0;D-=2)for(D==6&&(D-=1);;){for(let M=0;M<2;M+=1)if(i[j][D-M]==null){let J=!1;R<f.length&&(J=(f[R]>>>v&1)==1),$(j,D-M)&&(J=!J),i[j][D-M]=J,v-=1,v==-1&&(R+=1,v=7)}if(j+=x,j<0||r<=j){j-=x,x=-x;break}}},N=function(f,y){let x=0,j=0,v=0;const R=new Array(y.length),$=new Array(y.length);for(let A=0;A<y.length;A+=1){const U=y[A].dataCount,W=y[A].totalCount-U;j=Math.max(j,U),v=Math.max(v,W),R[A]=new Array(U);for(let K=0;K<R[A].length;K+=1)R[A][K]=255&f.getBuffer()[K+x];x+=U;const Ie=Z.getErrorCorrectPolynomial(W),xt=fe(R[A],Ie.getLength()-1).mod(Ie);$[A]=new Array(Ie.getLength()-1);for(let K=0;K<$[A].length;K+=1){const bt=K+xt.getLength()-$[A].length;$[A][K]=bt>=0?xt.getAt(bt):0}}let D=0;for(let A=0;A<y.length;A+=1)D+=y[A].totalCount;const M=new Array(D);let J=0;for(let A=0;A<j;A+=1)for(let U=0;U<y.length;U+=1)A<R[U].length&&(M[J]=R[U][A],J+=1);for(let A=0;A<v;A+=1)for(let U=0;U<y.length;U+=1)A<$[U].length&&(M[J]=$[U][A],J+=1);return M},P=function(f,y,x){const j=It.getRSBlocks(f,y),v=Lt();for(let $=0;$<x.length;$+=1){const D=x[$];v.put(D.getMode(),4),v.put(D.getLength(),Z.getLengthInBits(D.getMode(),f)),D.write(v)}let R=0;for(let $=0;$<j.length;$+=1)R+=j[$].dataCount;if(v.getLengthInBits()>R*8)throw"code length overflow. ("+v.getLengthInBits()+">"+R*8+")";for(v.getLengthInBits()+4<=R*8&&v.put(0,4);v.getLengthInBits()%8!=0;)v.putBit(!1);for(;!(v.getLengthInBits()>=R*8||(v.put(236,8),v.getLengthInBits()>=R*8));)v.put(17,8);return N(v,j)};h.addData=function(f,y){y=y||"Byte";let x=null;switch(y){case"Numeric":x=Xx(f);break;case"Alphanumeric":x=Zx(f);break;case"Byte":x=e0(f);break;case"Kanji":x=t0(f);break;default:throw"mode:"+y}u.push(x),d=null},h.isDark=function(f,y){if(f<0||r<=f||y<0||r<=y)throw f+","+y;return i[f][y]},h.getModuleCount=function(){return r},h.make=function(){if(l<1){let f=1;for(;f<40;f++){const y=It.getRSBlocks(f,c),x=Lt();for(let v=0;v<u.length;v++){const R=u[v];x.put(R.getMode(),4),x.put(R.getLength(),Z.getLengthInBits(R.getMode(),f)),R.write(x)}let j=0;for(let v=0;v<y.length;v++)j+=y[v].dataCount;if(x.getLengthInBits()<=j*8)break}l=f}p(!1,b())},h.createTableTag=function(f,y){f=f||2,y=typeof y>"u"?f*4:y;let x="";x+='<table style="',x+=" border-width: 0px; border-style: none;",x+=" border-collapse: collapse;",x+=" padding: 0px; margin: "+y+"px;",x+='">',x+="<tbody>";for(let j=0;j<h.getModuleCount();j+=1){x+="<tr>";for(let v=0;v<h.getModuleCount();v+=1)x+='<td style="',x+=" border-width: 0px; border-style: none;",x+=" border-collapse: collapse;",x+=" padding: 0px; margin: 0px;",x+=" width: "+f+"px;",x+=" height: "+f+"px;",x+=" background-color: ",x+=h.isDark(j,v)?"#000000":"#ffffff",x+=";",x+='"/>';x+="</tr>"}return x+="</tbody>",x+="</table>",x},h.createSvgTag=function(f,y,x,j){let v={};typeof arguments[0]=="object"&&(v=arguments[0],f=v.cellSize,y=v.margin,x=v.alt,j=v.title),f=f||2,y=typeof y>"u"?f*4:y,x=typeof x=="string"?{text:x}:x||{},x.text=x.text||null,x.id=x.text?x.id||"qrcode-description":null,j=typeof j=="string"?{text:j}:j||{},j.text=j.text||null,j.id=j.text?j.id||"qrcode-title":null;const R=h.getModuleCount()*f+y*2;let $,D,M,J,A="",U;for(U="l"+f+",0 0,"+f+" -"+f+",0 0,-"+f+"z ",A+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',A+=v.scalable?"":' width="'+R+'px" height="'+R+'px"',A+=' viewBox="0 0 '+R+" "+R+'" ',A+=' preserveAspectRatio="xMinYMin meet"',A+=j.text||x.text?' role="img" aria-labelledby="'+E([j.id,x.id].join(" ").trim())+'"':"",A+=">",A+=j.text?'<title id="'+E(j.id)+'">'+E(j.text)+"</title>":"",A+=x.text?'<description id="'+E(x.id)+'">'+E(x.text)+"</description>":"",A+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',A+='<path d="',M=0;M<h.getModuleCount();M+=1)for(J=M*f+y,$=0;$<h.getModuleCount();$+=1)h.isDark(M,$)&&(D=$*f+y,A+="M"+D+","+J+U);return A+='" stroke="transparent" fill="black"/>',A+="</svg>",A},h.createDataURL=function(f,y){f=f||2,y=typeof y>"u"?f*4:y;const x=h.getModuleCount()*f+y*2,j=y,v=x-y;return r0(x,x,function(R,$){if(j<=R&&R<v&&j<=$&&$<v){const D=Math.floor((R-j)/f),M=Math.floor(($-j)/f);return h.isDark(M,D)?0:1}else return 1})},h.createImgTag=function(f,y,x){f=f||2,y=typeof y>"u"?f*4:y;const j=h.getModuleCount()*f+y*2;let v="";return v+="<img",v+=' src="',v+=h.createDataURL(f,y),v+='"',v+=' width="',v+=j,v+='"',v+=' height="',v+=j,v+='"',x&&(v+=' alt="',v+=E(x),v+='"'),v+="/>",v};const E=function(f){let y="";for(let x=0;x<f.length;x+=1){const j=f.charAt(x);switch(j){case"<":y+="<";break;case">":y+=">";break;case"&":y+="&";break;case'"':y+=""";break;default:y+=j;break}}return y},T=function(f){f=typeof f>"u"?2:f;const x=h.getModuleCount()*1+f*2,j=f,v=x-f;let R,$,D,M,J;const A={"██":"█","█ ":"▀"," █":"▄"," ":" "},U={"██":"▀","█ ":"▀"," █":" "," ":" "};let W="";for(R=0;R<x;R+=2){for(D=Math.floor((R-j)/1),M=Math.floor((R+1-j)/1),$=0;$<x;$+=1)J="█",j<=$&&$<v&&j<=R&&R<v&&h.isDark(D,Math.floor(($-j)/1))&&(J=" "),j<=$&&$<v&&j<=R+1&&R+1<v&&h.isDark(M,Math.floor(($-j)/1))?J+=" ":J+="█",W+=f<1&&R+1>=v?U[J]:A[J];W+=`
|
|
24
|
+
`}return x%2&&f>0?W.substring(0,W.length-x-1)+Array(x+1).join("▀"):W.substring(0,W.length-1)};return h.createASCII=function(f,y){if(f=f||1,f<2)return T(y);f-=1,y=typeof y>"u"?f*2:y;const x=h.getModuleCount()*f+y*2,j=y,v=x-y;let R,$,D,M;const J=Array(f+1).join("██"),A=Array(f+1).join(" ");let U="",W="";for(R=0;R<x;R+=1){for(D=Math.floor((R-j)/f),W="",$=0;$<x;$+=1)M=1,j<=$&&$<v&&j<=R&&R<v&&h.isDark(D,Math.floor(($-j)/f))&&(M=0),W+=M?J:A;for(D=0;D<f;D+=1)U+=W+`
|
|
25
|
+
`}return U.substring(0,U.length-1)},h.renderTo2dContext=function(f,y){y=y||2;const x=h.getModuleCount();for(let j=0;j<x;j++)for(let v=0;v<x;v++)f.fillStyle=h.isDark(j,v)?"black":"white",f.fillRect(v*y,j*y,y,y)},h};ue.stringToBytes=function(e){const t=[];for(let o=0;o<e.length;o+=1){const a=e.charCodeAt(o);t.push(a&255)}return t};ue.createStringToBytes=function(e,t){const o=(function(){const l=n0(e),c=function(){const d=l.read();if(d==-1)throw"eof";return d};let i=0;const r={};for(;;){const d=l.read();if(d==-1)break;const u=c(),h=c(),p=c(),g=String.fromCharCode(d<<8|u),b=h<<8|p;r[g]=b,i+=1}if(i!=t)throw i+" != "+t;return r})(),a=63;return function(l){const c=[];for(let i=0;i<l.length;i+=1){const r=l.charCodeAt(i);if(r<128)c.push(r);else{const d=o[l.charAt(i)];typeof d=="number"?(d&255)==d?c.push(d):(c.push(d>>>8),c.push(d&255)):c.push(a)}}return c}};const z={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},he={L:1,M:0,Q:3,H:2},X={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Z=(function(){const e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,o=7973,a=21522,l={},c=function(i){let r=0;for(;i!=0;)r+=1,i>>>=1;return r};return l.getBCHTypeInfo=function(i){let r=i<<10;for(;c(r)-c(t)>=0;)r^=t<<c(r)-c(t);return(i<<10|r)^a},l.getBCHTypeNumber=function(i){let r=i<<12;for(;c(r)-c(o)>=0;)r^=o<<c(r)-c(o);return i<<12|r},l.getPatternPosition=function(i){return e[i-1]},l.getMaskFunction=function(i){switch(i){case X.PATTERN000:return function(r,d){return(r+d)%2==0};case X.PATTERN001:return function(r,d){return r%2==0};case X.PATTERN010:return function(r,d){return d%3==0};case X.PATTERN011:return function(r,d){return(r+d)%3==0};case X.PATTERN100:return function(r,d){return(Math.floor(r/2)+Math.floor(d/3))%2==0};case X.PATTERN101:return function(r,d){return r*d%2+r*d%3==0};case X.PATTERN110:return function(r,d){return(r*d%2+r*d%3)%2==0};case X.PATTERN111:return function(r,d){return(r*d%3+(r+d)%2)%2==0};default:throw"bad maskPattern:"+i}},l.getErrorCorrectPolynomial=function(i){let r=fe([1],0);for(let d=0;d<i;d+=1)r=r.multiply(fe([1,ee.gexp(d)],0));return r},l.getLengthInBits=function(i,r){if(1<=r&&r<10)switch(i){case z.MODE_NUMBER:return 10;case z.MODE_ALPHA_NUM:return 9;case z.MODE_8BIT_BYTE:return 8;case z.MODE_KANJI:return 8;default:throw"mode:"+i}else if(r<27)switch(i){case z.MODE_NUMBER:return 12;case z.MODE_ALPHA_NUM:return 11;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 10;default:throw"mode:"+i}else if(r<41)switch(i){case z.MODE_NUMBER:return 14;case z.MODE_ALPHA_NUM:return 13;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 12;default:throw"mode:"+i}else throw"type:"+r},l.getLostPoint=function(i){const r=i.getModuleCount();let d=0;for(let p=0;p<r;p+=1)for(let g=0;g<r;g+=1){let b=0;const k=i.isDark(p,g);for(let w=-1;w<=1;w+=1)if(!(p+w<0||r<=p+w))for(let S=-1;S<=1;S+=1)g+S<0||r<=g+S||w==0&&S==0||k==i.isDark(p+w,g+S)&&(b+=1);b>5&&(d+=3+b-5)}for(let p=0;p<r-1;p+=1)for(let g=0;g<r-1;g+=1){let b=0;i.isDark(p,g)&&(b+=1),i.isDark(p+1,g)&&(b+=1),i.isDark(p,g+1)&&(b+=1),i.isDark(p+1,g+1)&&(b+=1),(b==0||b==4)&&(d+=3)}for(let p=0;p<r;p+=1)for(let g=0;g<r-6;g+=1)i.isDark(p,g)&&!i.isDark(p,g+1)&&i.isDark(p,g+2)&&i.isDark(p,g+3)&&i.isDark(p,g+4)&&!i.isDark(p,g+5)&&i.isDark(p,g+6)&&(d+=40);for(let p=0;p<r;p+=1)for(let g=0;g<r-6;g+=1)i.isDark(g,p)&&!i.isDark(g+1,p)&&i.isDark(g+2,p)&&i.isDark(g+3,p)&&i.isDark(g+4,p)&&!i.isDark(g+5,p)&&i.isDark(g+6,p)&&(d+=40);let u=0;for(let p=0;p<r;p+=1)for(let g=0;g<r;g+=1)i.isDark(g,p)&&(u+=1);const h=Math.abs(100*u/r/r-50)/5;return d+=h*10,d},l})(),ee=(function(){const e=new Array(256),t=new Array(256);for(let a=0;a<8;a+=1)e[a]=1<<a;for(let a=8;a<256;a+=1)e[a]=e[a-4]^e[a-5]^e[a-6]^e[a-8];for(let a=0;a<255;a+=1)t[e[a]]=a;const o={};return o.glog=function(a){if(a<1)throw"glog("+a+")";return t[a]},o.gexp=function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return e[a]},o})(),fe=function(e,t){if(typeof e.length>"u")throw e.length+"/"+t;const o=(function(){let l=0;for(;l<e.length&&e[l]==0;)l+=1;const c=new Array(e.length-l+t);for(let i=0;i<e.length-l;i+=1)c[i]=e[i+l];return c})(),a={};return a.getAt=function(l){return o[l]},a.getLength=function(){return o.length},a.multiply=function(l){const c=new Array(a.getLength()+l.getLength()-1);for(let i=0;i<a.getLength();i+=1)for(let r=0;r<l.getLength();r+=1)c[i+r]^=ee.gexp(ee.glog(a.getAt(i))+ee.glog(l.getAt(r)));return fe(c,0)},a.mod=function(l){if(a.getLength()-l.getLength()<0)return a;const c=ee.glog(a.getAt(0))-ee.glog(l.getAt(0)),i=new Array(a.getLength());for(let r=0;r<a.getLength();r+=1)i[r]=a.getAt(r);for(let r=0;r<l.getLength();r+=1)i[r]^=ee.gexp(ee.glog(l.getAt(r))+c);return fe(i,0).mod(l)},a},It=(function(){const e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(l,c){const i={};return i.totalCount=l,i.dataCount=c,i},o={},a=function(l,c){switch(c){case he.L:return e[(l-1)*4+0];case he.M:return e[(l-1)*4+1];case he.Q:return e[(l-1)*4+2];case he.H:return e[(l-1)*4+3];default:return}};return o.getRSBlocks=function(l,c){const i=a(l,c);if(typeof i>"u")throw"bad rs block @ typeNumber:"+l+"/errorCorrectionLevel:"+c;const r=i.length/3,d=[];for(let u=0;u<r;u+=1){const h=i[u*3+0],p=i[u*3+1],g=i[u*3+2];for(let b=0;b<h;b+=1)d.push(t(p,g))}return d},o})(),Lt=function(){const e=[];let t=0;const o={};return o.getBuffer=function(){return e},o.getAt=function(a){const l=Math.floor(a/8);return(e[l]>>>7-a%8&1)==1},o.put=function(a,l){for(let c=0;c<l;c+=1)o.putBit((a>>>l-c-1&1)==1)},o.getLengthInBits=function(){return t},o.putBit=function(a){const l=Math.floor(t/8);e.length<=l&&e.push(0),a&&(e[l]|=128>>>t%8),t+=1},o},Xx=function(e){const t=z.MODE_NUMBER,o=e,a={};a.getMode=function(){return t},a.getLength=function(i){return o.length},a.write=function(i){const r=o;let d=0;for(;d+2<r.length;)i.put(l(r.substring(d,d+3)),10),d+=3;d<r.length&&(r.length-d==1?i.put(l(r.substring(d,d+1)),4):r.length-d==2&&i.put(l(r.substring(d,d+2)),7))};const l=function(i){let r=0;for(let d=0;d<i.length;d+=1)r=r*10+c(i.charAt(d));return r},c=function(i){if("0"<=i&&i<="9")return i.charCodeAt(0)-48;throw"illegal char :"+i};return a},Zx=function(e){const t=z.MODE_ALPHA_NUM,o=e,a={};a.getMode=function(){return t},a.getLength=function(c){return o.length},a.write=function(c){const i=o;let r=0;for(;r+1<i.length;)c.put(l(i.charAt(r))*45+l(i.charAt(r+1)),11),r+=2;r<i.length&&c.put(l(i.charAt(r)),6)};const l=function(c){if("0"<=c&&c<="9")return c.charCodeAt(0)-48;if("A"<=c&&c<="Z")return c.charCodeAt(0)-65+10;switch(c){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+c}};return a},e0=function(e){const t=z.MODE_8BIT_BYTE,o=ue.stringToBytes(e),a={};return a.getMode=function(){return t},a.getLength=function(l){return o.length},a.write=function(l){for(let c=0;c<o.length;c+=1)l.put(o[c],8)},a},t0=function(e){const t=z.MODE_KANJI,o=ue.stringToBytes;(function(c,i){const r=o(c);if(r.length!=2||(r[0]<<8|r[1])!=i)throw"sjis not supported."})("友",38726);const a=o(e),l={};return l.getMode=function(){return t},l.getLength=function(c){return~~(a.length/2)},l.write=function(c){const i=a;let r=0;for(;r+1<i.length;){let d=(255&i[r])<<8|255&i[r+1];if(33088<=d&&d<=40956)d-=33088;else if(57408<=d&&d<=60351)d-=49472;else throw"illegal char at "+(r+1)+"/"+d;d=(d>>>8&255)*192+(d&255),c.put(d,13),r+=2}if(r<i.length)throw"illegal char at "+(r+1)},l},Hn=function(){const e=[],t={};return t.writeByte=function(o){e.push(o&255)},t.writeShort=function(o){t.writeByte(o),t.writeByte(o>>>8)},t.writeBytes=function(o,a,l){a=a||0,l=l||o.length;for(let c=0;c<l;c+=1)t.writeByte(o[c+a])},t.writeString=function(o){for(let a=0;a<o.length;a+=1)t.writeByte(o.charCodeAt(a))},t.toByteArray=function(){return e},t.toString=function(){let o="";o+="[";for(let a=0;a<e.length;a+=1)a>0&&(o+=","),o+=e[a];return o+="]",o},t},s0=function(){let e=0,t=0,o=0,a="";const l={},c=function(r){a+=String.fromCharCode(i(r&63))},i=function(r){if(r<0)throw"n:"+r;if(r<26)return 65+r;if(r<52)return 97+(r-26);if(r<62)return 48+(r-52);if(r==62)return 43;if(r==63)return 47;throw"n:"+r};return l.writeByte=function(r){for(e=e<<8|r&255,t+=8,o+=1;t>=6;)c(e>>>t-6),t-=6},l.flush=function(){if(t>0&&(c(e<<6-t),e=0,t=0),o%3!=0){const r=3-o%3;for(let d=0;d<r;d+=1)a+="="}},l.toString=function(){return a},l},n0=function(e){const t=e;let o=0,a=0,l=0;const c={};c.read=function(){for(;l<8;){if(o>=t.length){if(l==0)return-1;throw"unexpected end of file./"+l}const d=t.charAt(o);if(o+=1,d=="=")return l=0,-1;if(d.match(/^\s$/))continue;a=a<<6|i(d.charCodeAt(0)),l+=6}const r=a>>>l-8&255;return l-=8,r};const i=function(r){if(65<=r&&r<=90)return r-65;if(97<=r&&r<=122)return r-97+26;if(48<=r&&r<=57)return r-48+52;if(r==43)return 62;if(r==47)return 63;throw"c:"+r};return c},o0=function(e,t){const o=e,a=t,l=new Array(e*t),c={};c.setPixel=function(u,h,p){l[h*o+u]=p},c.write=function(u){u.writeString("GIF87a"),u.writeShort(o),u.writeShort(a),u.writeByte(128),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(255),u.writeByte(255),u.writeByte(255),u.writeString(","),u.writeShort(0),u.writeShort(0),u.writeShort(o),u.writeShort(a),u.writeByte(0);const h=2,p=r(h);u.writeByte(h);let g=0;for(;p.length-g>255;)u.writeByte(255),u.writeBytes(p,g,255),g+=255;u.writeByte(p.length-g),u.writeBytes(p,g,p.length-g),u.writeByte(0),u.writeString(";")};const i=function(u){const h=u;let p=0,g=0;const b={};return b.write=function(k,w){if(k>>>w)throw"length over";for(;p+w>=8;)h.writeByte(255&(k<<p|g)),w-=8-p,k>>>=8-p,g=0,p=0;g=k<<p|g,p=p+w},b.flush=function(){p>0&&h.writeByte(g)},b},r=function(u){const h=1<<u,p=(1<<u)+1;let g=u+1;const b=d();for(let C=0;C<h;C+=1)b.add(String.fromCharCode(C));b.add(String.fromCharCode(h)),b.add(String.fromCharCode(p));const k=Hn(),w=i(k);w.write(h,g);let S=0,O=String.fromCharCode(l[S]);for(S+=1;S<l.length;){const C=String.fromCharCode(l[S]);S+=1,b.contains(O+C)?O=O+C:(w.write(b.indexOf(O),g),b.size()<4095&&(b.size()==1<<g&&(g+=1),b.add(O+C)),O=C)}return w.write(b.indexOf(O),g),w.write(p,g),w.flush(),k.toByteArray()},d=function(){const u={};let h=0;const p={};return p.add=function(g){if(p.contains(g))throw"dup key:"+g;u[g]=h,h+=1},p.size=function(){return h},p.indexOf=function(g){return u[g]},p.contains=function(g){return typeof u[g]<"u"},p};return c},r0=function(e,t,o){const a=o0(e,t);for(let r=0;r<t;r+=1)for(let d=0;d<e;d+=1)a.setPixel(d,r,o(d,r));const l=Hn();a.write(l);const c=s0(),i=l.toByteArray();for(let r=0;r<i.length;r+=1)c.writeByte(i[r]);return c.flush(),"data:image/gif;base64,"+c};ue.stringToBytes;function a0({value:e,size:t=184}){const{count:o,path:a}=m.useMemo(()=>{const l=ue(0,"M");l.addData(e),l.make();const c=l.getModuleCount();let i="";for(let r=0;r<c;r++)for(let d=0;d<c;d++)l.isDark(r,d)&&(i+=`M${d+4} ${r+4}h1v1h-1z`);return{count:c+8,path:i}},[e]);return s.jsxs("svg",{role:"img","aria-label":"QR code for your authenticator app",viewBox:`0 0 ${o} ${o}`,width:t,height:t,shapeRendering:"crispEdges",className:"rounded-lg","data-testid":"two-factor-qr",children:[s.jsx("rect",{width:o,height:o,fill:"#ffffff"}),s.jsx("path",{d:a,fill:"#111827"})]})}function Kn({value:e,onChange:t,onComplete:o,disabled:a,autoFocus:l=!0,id:c}){const i=m.useRef(null);return m.useEffect(()=>{var r;l&&((r=i.current)==null||r.focus())},[l]),s.jsx("input",{ref:i,id:c,type:"text",inputMode:"numeric",autoComplete:"one-time-code","aria-label":"6-digit code",placeholder:"······",maxLength:7,value:e,disabled:a,onChange:r=>{const d=r.target.value.replace(/\D/g,"").slice(0,6);t(d),d.length===6&&(o==null||o(d))},className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-center text-xl font-mono tracking-[0.5em]\r
|
|
26
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600 disabled:opacity-50`})}function i0({codes:e,onDone:t,doneLabel:o="Done",account:a}){const[l,c]=m.useState(!1),[i,r]=m.useState(!1),d=[`Testver recovery codes${a?` — ${a}`:""}`,"Each code signs you in once if you cannot use your authenticator app.","",...e,""].join(`
|
|
27
|
+
`),u=async()=>{try{await navigator.clipboard.writeText(d),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},h=()=>{const p=URL.createObjectURL(new Blob([d],{type:"text/plain"})),g=document.createElement("a");g.href=p,g.download="testver-recovery-codes.txt",g.click(),URL.revokeObjectURL(p)};return s.jsxs("div",{className:"space-y-4","data-testid":"recovery-codes",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Save your recovery codes"}),s.jsx("p",{className:"mt-1 text-[13px] text-gray-400 leading-relaxed",children:"If you lose your phone, each of these codes signs you in once. Keep them somewhere safe — a password manager is ideal. They are shown only now."})]}),s.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-1.5 rounded-lg bg-surface-2 border border-white/10 px-4 py-3 font-mono text-[14px] text-gray-100",children:e.map(p=>s.jsx("span",{children:p},p))}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",onClick:u,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/10 text-[13px] text-gray-300 hover:bg-white/5",children:[i?s.jsx(xe,{size:14,className:"text-emerald-400"}):s.jsx(lt,{size:14})," ",i?"Copied":"Copy"]}),s.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-white/10 text-[13px] text-gray-300 hover:bg-white/5",children:[s.jsx(as,{size:14})," Download"]})]}),s.jsxs("label",{className:"flex items-start gap-2 text-[13px] text-gray-300 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:l,onChange:p=>c(p.target.checked),className:"mt-0.5 accent-brand-500"}),"I have saved my recovery codes"]}),s.jsxs("button",{type:"button",disabled:!l,onClick:t,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[s.jsx(re,{size:16})," ",o]})]})}function Vn({start:e,confirm:t,onFinished:o,doneLabel:a,beforeCode:l}){const[c,i]=m.useState(null),[r,d]=m.useState(""),[u,h]=m.useState(""),[p,g]=m.useState(""),[b,k]=m.useState(!1),[w,S]=m.useState(null),[O,C]=m.useState(!1),N=m.useRef(!1);m.useEffect(()=>{N.current||(N.current=!0,e().then(i).catch(E=>d(E.message||"Could not start the setup.")))},[e]);const P=async(E=u)=>{if(!(E.length!==6||b)){k(!0),g("");try{S(await t(E))}catch(T){g(T.message||"That code did not work."),h("")}finally{k(!1)}}};return w?s.jsx(i0,{codes:w,onDone:o,doneLabel:a,account:c==null?void 0:c.account}):r?s.jsx("p",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:r}):c?s.jsxs("form",{onSubmit:E=>{E.preventDefault(),P()},className:"space-y-4","data-testid":"two-factor-setup",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-center sm:items-start",children:[s.jsx("div",{className:"p-2 bg-white rounded-xl flex-shrink-0",children:s.jsx(a0,{value:c.otpauthUri})}),s.jsxs("div",{className:"space-y-2 text-[13px] text-gray-400 leading-relaxed",children:[s.jsxs("p",{className:"flex items-center gap-1.5 text-gray-200 font-medium",children:[s.jsx(Ce,{size:14})," 1. Scan with your authenticator app"]}),s.jsx("p",{children:"Google Authenticator, Microsoft Authenticator, Authy, 1Password or Bitwarden all work. In the app, add an account and scan this code."}),s.jsx("p",{className:"text-gray-500",children:"Can't scan? Enter this key instead (time-based):"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:"px-2 py-1 rounded bg-surface-2 border border-white/10 font-mono text-[13px] text-gray-100 whitespace-normal break-normal","data-testid":"two-factor-key",children:c.secretGrouped.split(" ").map((E,T)=>s.jsx("span",{className:"inline-block whitespace-nowrap mr-[0.6ch] last:mr-0",children:E},T))}),s.jsx("button",{type:"button",title:"Copy the key",onClick:async()=>{try{await navigator.clipboard.writeText(c.secret),C(!0),setTimeout(()=>C(!1),2e3)}catch{}},className:"p-1.5 rounded-md text-gray-400 hover:text-gray-200 hover:bg-white/5",children:O?s.jsx(xe,{size:14,className:"text-emerald-400"}):s.jsx(lt,{size:14})})]})]})]}),l,s.jsxs("div",{children:[s.jsx("label",{htmlFor:"two-factor-first-code",className:"block text-[13px] text-gray-200 font-medium mb-1.5",children:"2. Enter the 6-digit code the app shows for Testver"}),s.jsx(Kn,{id:"two-factor-first-code",value:u,onChange:h,onComplete:E=>void P(E),disabled:b,autoFocus:!1})]}),p&&s.jsx("p",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:p}),s.jsxs("button",{type:"submit",disabled:b||u.length!==6,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[b?s.jsx(Fe,{size:16,className:"animate-spin"}):s.jsx(re,{size:16})," Turn on two-factor authentication"]})]}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[s.jsx(Fe,{size:14,className:"animate-spin"})," Preparing…"]})}function c0(){const{login:e,completeSignIn:t,isSetupRequired:o,isAuthenticated:a}=Y(),l=H(),[c,i]=m.useState(""),[r,d]=m.useState(""),[u,h]=m.useState(""),[p,g]=m.useState(!1),[b,k]=m.useState({kind:"password"}),[w]=m.useState(()=>{const N=qo();return N?Wo(N.reason,N.policy):null});if(o)return l("/setup",{replace:!0}),null;if(a)return l("/",{replace:!0}),null;const S=(N="")=>{k({kind:"password"}),d(""),h(N)},O=async N=>{if(N.preventDefault(),!(!c.trim()||!r)){g(!0),h("");try{const P=await e(c.trim(),r);P.twoFactorRequired?k({kind:"code",challenge:P.challenge,allowTrustBrowser:P.allowTrustBrowser,trustBrowserDays:P.trustBrowserDays}):P.twoFactorSetupRequired?k({kind:"setup",challenge:P.challenge,requiredFor:P.requiredFor}):l("/",{replace:!0})}catch(P){h(P.message||"Login failed")}finally{g(!1)}}},C=N=>{t(N),l("/",{replace:!0})};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0 px-4",children:s.jsxs("div",{className:`w-full ${b.kind==="setup"?"max-w-lg":"max-w-sm"} bg-surface-1 rounded-xl border border-white/5 p-8`,children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:b.kind==="password"?"Sign in to Testver":b.kind==="code"?"Two-factor authentication":"Set up two-factor authentication"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500 text-center",children:b.kind==="password"?"Test automation dashboard":b.kind==="code"?"Enter the code from your authenticator app":`Your administrator requires it for ${b.requiredFor==="admins"?"administrator accounts":"every account"} — it takes a minute.`})]}),b.kind==="password"&&s.jsxs("form",{onSubmit:O,children:[w&&!u&&s.jsxs("div",{className:"mb-4 p-3 flex items-start gap-2 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-600 dark:text-amber-300 text-sm",children:[s.jsx(at,{size:14,className:"mt-0.5 flex-shrink-0"}),s.jsx("span",{children:w})]}),u&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:u}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Username or email"}),s.jsx("input",{type:"text",value:c,onChange:N=>i(N.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
28
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Username or email",autoFocus:!0,autoComplete:"username"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s.jsx("label",{className:"block text-xs text-gray-400",children:"Password"}),s.jsx(ce,{to:"/forgot-password",className:"text-xs text-brand-400 hover:text-brand-300",children:"Forgot password?"})]}),s.jsx(le,{value:r,onChange:N=>d(N.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
29
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Enter password",autoComplete:"current-password"})]}),s.jsxs("button",{type:"submit",disabled:p||!c.trim()||!r,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500\r
|
|
30
|
+
text-white text-sm font-medium rounded-lg transition-colors\r
|
|
31
|
+
disabled:opacity-50 disabled:cursor-not-allowed`,children:[p?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx($o,{size:16}),p?"Signing in...":"Sign In"]})]}),b.kind==="code"&&s.jsx(l0,{step:b,onSignedIn:C,onRestart:S}),b.kind==="setup"&&s.jsx(d0,{challenge:b.challenge,onSignedIn:C,onRestart:S})]})})}function l0({step:e,onSignedIn:t,onRestart:o}){const[a,l]=m.useState(!1),[c,i]=m.useState(""),[r,d]=m.useState(""),[u,h]=m.useState(!1),[p,g]=m.useState(""),[b,k]=m.useState(!1),w=async S=>{var C;if(b)return;const O=S??c;if(!(!a&&O.length!==6)&&!(a&&!r.trim())){k(!0),g("");try{const N=await fn({challenge:e.challenge,...a?{recoveryCode:r.trim()}:{code:O},trustBrowser:e.allowTrustBrowser&&u});t(N)}catch(N){if(N.code==="AUTH_2FA_EXPIRED"||N.code==="AUTH_LOCKED"){o(N.message);return}const P=(C=N.data)==null?void 0:C.attemptsLeft;g(`${N.message||"That did not work."}${typeof P=="number"?` ${P} attempt${P===1?"":"s"} left.`:""}`),i("")}finally{k(!1)}}};return s.jsxs("form",{onSubmit:S=>{S.preventDefault(),w()},className:"space-y-4",children:[p&&s.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:p}),a?s.jsxs("div",{children:[s.jsx("label",{htmlFor:"recovery-code",className:"block text-xs text-gray-400 mb-1.5",children:"Recovery code"}),s.jsx("input",{id:"recovery-code",type:"text",autoFocus:!0,autoComplete:"off",spellCheck:!1,value:r,onChange:S=>d(S.target.value),placeholder:"xxxxx-xxxxx",className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-center font-mono text-base tracking-wider\r
|
|
32
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`}),s.jsx("p",{className:"mt-1.5 text-xs text-gray-500",children:"Each recovery code works once."})]}):s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"6-digit code"}),s.jsx(Kn,{value:c,onChange:i,onComplete:S=>void w(S),disabled:b})]}),e.allowTrustBrowser&&s.jsxs("label",{className:"flex items-start gap-2 text-[13px] text-gray-300 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",checked:u,onChange:S=>h(S.target.checked),className:"mt-0.5 accent-brand-500"}),s.jsxs("span",{children:["Trust this browser for ",e.trustBrowserDays," days ",s.jsx("span",{className:"block text-xs text-gray-500",children:"Only on a computer you alone use. You can remove it in Profile."})]})]}),s.jsxs("button",{type:"submit",disabled:b||(a?!r.trim():c.length!==6),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[b?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(re,{size:16}),"Verify"]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsxs("button",{type:"button",onClick:()=>o(),className:"flex items-center gap-1 text-gray-500 hover:text-gray-300",children:[s.jsx(Oe,{size:12})," Back"]}),s.jsxs("button",{type:"button",onClick:()=>{l(S=>!S),g("")},className:"flex items-center gap-1 text-brand-400 hover:text-brand-300",children:[s.jsx(ge,{size:12})," ",a?"Use the code from my app":"Use a recovery code"]})]})]})}function d0({challenge:e,onSignedIn:t,onRestart:o}){const[a,l]=m.useState(null);return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Vn,{start:()=>gn(e).catch(c=>{throw c.code==="AUTH_2FA_EXPIRED"&&o(c.message),c}),confirm:async c=>{try{const i=await xn(e,c);return l(i),i.recoveryCodes??[]}catch(i){throw(i.code==="AUTH_2FA_EXPIRED"||i.code==="AUTH_LOCKED")&&o(i.message),i}},doneLabel:"Continue to Testver",onFinished:()=>{a&&t(a)}}),!a&&s.jsxs("button",{type:"button",onClick:()=>o(),className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-300",children:[s.jsx(Oe,{size:12})," Back to sign in"]})]})}function u0(){const[e,t]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(!1),[i,r]=m.useState(!1),d=async u=>{if(u.preventDefault(),!(!e.trim()||i)){r(!0),a("");try{await bn(e.trim()),c(!0)}catch(h){a(h.message||"Could not send the reset email")}finally{r(!1)}}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0",children:s.jsxs("form",{onSubmit:d,className:"w-full max-w-sm bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Forgot your password?"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500 text-center",children:"Enter your username or email and we will send a link to choose a new one."})]}),l?s.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/10 p-4 text-sm text-emerald-300 flex items-start gap-2.5",children:[s.jsx(Ao,{size:18,className:"mt-0.5 shrink-0"}),s.jsx("span",{children:"If that account has an email address on file, a reset link is on its way. It works once and expires in 60 minutes."})]}):s.jsxs(s.Fragment,{children:[o&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:o}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Username or email"}),s.jsx("input",{type:"text",value:e,onChange:u=>t(u.target.value),className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50 placeholder-gray-600",placeholder:"you@company.com",autoFocus:!0,autoComplete:"username"})]}),s.jsxs("button",{type:"submit",disabled:i||!e.trim(),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[i?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(ge,{size:16}),i?"Sending…":"Send reset link"]})]}),s.jsx("p",{className:"mt-5 rounded-lg border border-white/5 bg-surface-2 px-3 py-2.5 text-xs text-gray-500 leading-relaxed",children:"The reset link is sent through the email service connected to this Testver (Testver Mail or an SMTP connector), to the email address on your account. If neither is set up, ask an administrator to reset your password."}),s.jsx("p",{className:"mt-4 text-center text-xs text-gray-500",children:s.jsx(ce,{to:"/login",className:"text-brand-400 hover:text-brand-300",children:"Back to sign in"})})]})})}function m0(){const[e]=Xn(),t=e.get("token")??"",[o,a]=m.useState("checking"),[l,c]=m.useState(null),[i,r]=m.useState(""),[d,u]=m.useState(""),[h,p]=m.useState(""),[g,b]=m.useState(!1);m.useEffect(()=>{if(!t){a("invalid");return}yn(t).then(w=>{c(w.username),a("ready")}).catch(()=>a("invalid"))},[t]);const k=async w=>{if(w.preventDefault(),!g){if(i.length<6){p("Password must be at least 6 characters");return}if(i!==d){p("The two passwords do not match");return}b(!0),p("");try{await wn(t,i),a("done")}catch(S){p(S.message||"Could not reset the password")}finally{b(!1)}}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0",children:s.jsxs("form",{onSubmit:k,className:"w-full max-w-sm bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-8",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Choose a new password"}),l&&o==="ready"&&s.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["for @",l]})]}),o==="checking"&&s.jsx("p",{className:"text-sm text-gray-500 text-center",children:"Checking your link…"}),o==="invalid"&&s.jsxs("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-4 text-sm text-amber-300",children:["This reset link has expired or was already used."," ",s.jsx(ce,{to:"/forgot-password",className:"underline underline-offset-2 hover:text-amber-200",children:"Request a new one"}),"."]}),o==="done"&&s.jsxs("div",{className:"rounded-lg border border-emerald-500/20 bg-emerald-500/10 p-4 text-sm text-emerald-300 flex items-start gap-2.5",children:[s.jsx(ot,{size:18,className:"mt-0.5 shrink-0"}),s.jsxs("span",{children:["Your password has been changed and every other session was signed out. ",s.jsx(ce,{to:"/login",className:"underline underline-offset-2",children:"Sign in"})," with the new one."]})]}),o==="ready"&&s.jsxs(s.Fragment,{children:[h&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:h}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"New password"}),s.jsx(le,{value:i,onChange:w=>r(w.target.value),className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50 placeholder-gray-600",placeholder:"At least 6 characters",autoComplete:"new-password"})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-xs text-gray-400 mb-1.5",children:"Confirm new password"}),s.jsx(le,{value:d,onChange:w=>u(w.target.value),className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50 placeholder-gray-600",placeholder:"Repeat the password",autoComplete:"new-password"})]}),s.jsxs("button",{type:"submit",disabled:g||!i||!d,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[g?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(ge,{size:16}),g?"Saving…":"Set new password"]})]}),o!=="done"&&s.jsx("p",{className:"mt-6 text-center text-xs text-gray-500",children:s.jsx(ce,{to:"/login",className:"text-brand-400 hover:text-brand-300",children:"Back to sign in"})})]})})}const p0=[{value:"web",label:"Web Testing",Icon:ct,blurb:"Supports all major web automation frameworks — Playwright, Selenium, Cypress, and more. Run tests locally, on a server, or in the cloud.",selectedClasses:"bg-sky-500/15 border-sky-500/60 ring-1 ring-sky-500/40",selectedIconClasses:"bg-sky-500/25 text-sky-700 dark:text-sky-300",selectedTitleClasses:"text-sky-700 dark:text-sky-200",selectedCheckClasses:"text-sky-700 dark:text-sky-300",badge:null},{value:"mobile",label:"Mobile Testing",Icon:Ce,blurb:"Supports all major Appium frameworks for Android and iOS. Runs on your local devices and emulators, or on cloud device grids.",selectedClasses:"bg-indigo-500/15 border-indigo-500/60 ring-1 ring-indigo-500/40",selectedIconClasses:"bg-indigo-500/25 text-indigo-700 dark:text-indigo-300",selectedTitleClasses:"text-indigo-700 dark:text-indigo-200",selectedCheckClasses:"text-indigo-700 dark:text-indigo-300",badge:"Beta"}];function h0(){const{setup:e,isSetupRequired:t,isAuthenticated:o,isSetupLinkMissing:a}=Y(),l=H(),[c,i]=m.useState("mode"),[r,d]=m.useState(null),[u,h]=m.useState(""),[p,g]=m.useState(""),[b,k]=m.useState(""),[w,S]=m.useState(""),[O,C]=m.useState(""),[N,P]=m.useState(""),[E,T]=m.useState(""),[f,y]=m.useState(!1);if(!t&&o)return l("/",{replace:!0}),null;const x=()=>{if(T(""),!u.trim()){T("Please enter a project name");return}if(!r){T("Please pick what you will be testing");return}i("account")},j=async v=>{if(v.preventDefault(),T(""),!r||!u.trim()){i("mode");return}if(!p.trim()){T("Username is required");return}if(!b.trim()){T("Display name is required");return}if(!w.trim()){T("Email is required");return}if(O.length<6){T("Password must be at least 6 characters");return}if(O!==N){T("Passwords do not match");return}y(!0);try{await e(p.trim(),b.trim(),O,w.trim()||void 0,r,u.trim()),l("/",{replace:!0})}catch(R){T(R.message||"Setup failed")}finally{y(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0 px-4 py-8",children:s.jsxs("div",{className:"w-full max-w-2xl bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-6",children:[s.jsx(ie,{className:"w-14 h-14 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Welcome to Testver"}),s.jsx("p",{className:"mt-1.5 text-[15px] text-gray-500 text-center",children:c==="mode"?"Let's start with your project and what you'll be testing":"Now create your super admin account"})]}),s.jsx(x0,{step:c}),a&&s.jsxs("div",{className:"mb-4 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-300 text-sm",children:["This workspace can only be set up from its setup link. Open it from your Testver dashboard (Cloud → ",s.jsx("b",{children:"Open workspace"}),") — the link carries the one-time key that lets you create the super admin."]}),E&&s.jsx("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:E}),c==="mode"?s.jsx(f0,{projectName:u,onProjectNameChange:h,value:r,onChange:d,onNext:x}):s.jsx(g0,{appMode:r,projectName:u.trim(),username:p,setUsername:g,displayName:b,setDisplayName:k,email:w,setEmail:S,password:O,setPassword:C,confirmPassword:N,setConfirmPassword:P,loading:f,onBack:()=>{T(""),i("mode")},onSubmit:j})]})})}function f0({projectName:e,onProjectNameChange:t,value:o,onChange:a,onNext:l}){return s.jsxs("div",{children:[s.jsxs("div",{className:"mb-5",children:[s.jsxs("label",{htmlFor:"setup-project-name",className:"block text-xs text-gray-400 mb-1.5",children:["Project name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{id:"setup-project-name",type:"text",value:e,onChange:c=>t(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())},maxLength:_n,className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
33
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"e.g. Customer Portal",autoFocus:!0,autoComplete:"off","data-testid":"setup-project-name"}),s.jsx("p",{className:"mt-1.5 text-[11px] text-gray-500",children:"Shown at the top of every screen so your team knows which project they are in."})]}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"This controls which Testver surfaces (Runner, Recorder, Schedules, AI Assistant) you'll see. You can change it later in Settings → General."}),s.jsx("div",{className:"grid grid-cols-2 gap-3 mb-6",children:p0.map(({value:c,label:i,Icon:r,blurb:d,badge:u,selectedClasses:h,selectedIconClasses:p,selectedTitleClasses:g,selectedCheckClasses:b})=>{const k=o===c;return s.jsxs("button",{type:"button",onClick:()=>a(c),className:`relative text-left flex flex-col gap-3 p-5 rounded-lg border transition-all ${k?h:"bg-white/[0.03] border-white/10 hover:bg-white/[0.06] hover:border-white/20"}`,children:[u&&s.jsx("span",{className:"absolute top-2.5 right-2.5 text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded bg-amber-500/15 text-amber-400 border border-amber-500/30",children:u}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center transition-colors ${k?p:"bg-white/[0.06] text-gray-400"}`,children:s.jsx(r,{size:24})}),k&&s.jsx(xe,{size:18,className:b})]}),s.jsxs("div",{children:[s.jsx("div",{className:`text-base font-semibold ${k?g:"text-gray-200"}`,children:i}),s.jsx("p",{className:"text-sm text-gray-500 leading-relaxed mt-1.5",children:d})]})]},c)})}),s.jsxs("button",{type:"button",onClick:l,disabled:!o||!e.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500\r
|
|
34
|
+
text-white text-sm font-medium rounded-lg transition-colors\r
|
|
35
|
+
disabled:opacity-40 disabled:cursor-not-allowed`,children:["Next",s.jsx(Io,{size:16})]})]})}function g0(e){const{appMode:t,projectName:o,username:a,setUsername:l,displayName:c,setDisplayName:i,email:r,setEmail:d,password:u,setPassword:h,confirmPassword:p,setConfirmPassword:g,loading:b,onBack:k,onSubmit:w}=e,S=t==="mobile"?Ce:ct,O=t==="mobile"?"Mobile Testing":"Web Testing",C=t==="mobile"?"bg-indigo-500/10 border-indigo-500/30":"bg-sky-500/10 border-sky-500/30",N=t==="mobile"?"text-indigo-700 dark:text-indigo-300":"text-sky-700 dark:text-sky-300",P=t==="mobile"?"text-indigo-700 dark:text-indigo-200":"text-sky-700 dark:text-sky-200",E=t==="mobile"?"text-indigo-700 hover:text-indigo-600 dark:text-indigo-300 dark:hover:text-indigo-200":"text-sky-700 hover:text-sky-600 dark:text-sky-300 dark:hover:text-sky-200";return s.jsxs("form",{onSubmit:w,children:[s.jsxs("div",{className:`mb-4 p-3 rounded-lg border flex items-center gap-2.5 ${C}`,children:[s.jsx(S,{size:16,className:`flex-shrink-0 ${N}`}),s.jsxs("div",{className:"flex-1 min-w-0 text-xs truncate",children:[s.jsx("span",{className:`font-medium ${P}`,children:o}),s.jsx("span",{className:"text-gray-500 mx-1.5",children:"·"}),s.jsx("span",{className:`font-medium ${P}`,children:O})]}),s.jsx("button",{type:"button",onClick:k,className:`text-[11px] font-medium ${E}`,children:"Change"})]}),s.jsxs("div",{className:"mb-5 p-3 bg-surface-2 border border-white/5 rounded-lg flex items-start gap-2",children:[s.jsx(re,{size:14,className:"text-gray-400 mt-0.5 flex-shrink-0"}),s.jsx("p",{className:"text-[11px] text-gray-400",children:"This account becomes the super admin — it owns system-level settings and is the only account that can create admins. You can create more users after setup."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Username ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:a,onChange:T=>l(T.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
36
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"e.g. admin",autoFocus:!0,autoComplete:"username"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Display Name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:c,onChange:T=>i(T.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
37
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"e.g. Admin User",autoComplete:"name"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Email ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"email",required:!0,value:r,onChange:T=>d(T.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
38
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"admin@company.com",autoComplete:"email"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Password ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx(le,{value:u,onChange:T=>h(T.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
39
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Min. 6 characters",autoComplete:"new-password"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-gray-400 mb-1.5",children:["Confirm Password ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx(le,{value:p,onChange:T=>g(T.target.value),className:`w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm\r
|
|
40
|
+
focus:outline-none focus:border-brand-500/50 placeholder-gray-600`,placeholder:"Re-enter password",autoComplete:"new-password"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{type:"button",onClick:k,disabled:b,className:`flex items-center justify-center gap-2 px-4 py-2.5 bg-surface-2 hover:bg-surface-3\r
|
|
41
|
+
text-gray-300 text-sm font-medium rounded-lg border border-white/10 transition-colors\r
|
|
42
|
+
disabled:opacity-50`,children:[s.jsx(Oe,{size:16}),"Back"]}),s.jsxs("button",{type:"submit",disabled:b,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500\r
|
|
43
|
+
text-white text-sm font-medium rounded-lg transition-colors\r
|
|
44
|
+
disabled:opacity-50 disabled:cursor-not-allowed`,children:[b?s.jsx("span",{className:"animate-spin w-4 h-4 border-2 border-white/30 border-t-white rounded-full"}):s.jsx(re,{size:16}),b?"Creating Account...":"Create Super Admin Account"]})]})]})}function x0({step:e}){return s.jsxs("div",{className:"flex items-center justify-center gap-2.5 mb-6",children:[s.jsxs("div",{className:`flex items-center gap-2 text-xs ${e==="mode"?"text-brand-300":"text-emerald-400"}`,children:[s.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[11px] font-semibold ${e==="mode"?"bg-brand-500/20 border border-brand-500/50":"bg-emerald-500/20 border border-emerald-500/40"}`,children:e==="mode"?"1":s.jsx(xe,{size:12})}),s.jsx("span",{children:"Project & focus"})]}),s.jsx("div",{className:`h-px w-8 ${e==="account"?"bg-emerald-500/40":"bg-white/10"}`}),s.jsxs("div",{className:`flex items-center gap-2 text-xs ${e==="account"?"text-brand-300":"text-gray-500"}`,children:[s.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[11px] font-semibold ${e==="account"?"bg-brand-500/20 border border-brand-500/50":"bg-surface-2 border border-white/10"}`,children:"2"}),s.jsx("span",{children:"Super admin account"})]})]})}const Dt=300*1e3;function Mt(e){const t=Math.max(0,Math.ceil(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function b0(){const{logout:e}=Y(),[t,o]=m.useState(Fo()),[a,l]=m.useState(Date.now()),[c,i]=m.useState(!1),[r,d]=m.useState(null),u=m.useRef(0),h=m.useRef(!1);m.useEffect(()=>Go(o),[]),m.useEffect(()=>{const w=setInterval(()=>l(Date.now()),1e3);return()=>clearInterval(w)},[]);const p=t?t.expiresAt-a:1/0,g=!!t&&t.expiresAt>=t.absoluteExpiresAt-1e3;if(m.useEffect(()=>{!t||p>Dt||!(p<=0?!h.current:a-u.current>6e4)||(u.current=a,p<=0&&(h.current=!0),pt().then(S=>{S.authenticated&&S.session&&S.session.expiresAt>Date.now()?(h.current=!1,oe({expiresAt:S.session.expiresAt,absoluteExpiresAt:S.session.absoluteExpiresAt})):(p<=0||!S.authenticated)&&Re(g?"max":"idle")}).catch(()=>{h.current=!1}))},[t,p,a,g]),!t||p>Dt||p<=0)return null;const b=Bo(),k=async()=>{i(!0),d(null);try{await un()}catch(w){d(w.message)}finally{i(!1)}};return s.jsx("div",{role:"alertdialog","aria-live":"assertive",className:"fixed bottom-5 left-1/2 -translate-x-1/2 z-[9999] w-[min(560px,calc(100vw-32px))] rounded-xl border border-amber-500/30 bg-surface-1 shadow-2xl p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(at,{size:18,className:"text-amber-500 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[g?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm font-semibold text-gray-100",children:["You'll need to sign in again in ",Mt(p)]}),s.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["Sign-ins last at most ",b?`${b.maxDays} day${b.maxDays===1?"":"s"}`:"the configured number of days",". Save what you're working on. Runs keep going on the server while you sign in."]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-sm font-semibold text-gray-100",children:["You'll be signed out in ",Mt(p)]}),s.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["There's been no activity for ",b?ms(b.idleHours):"a while",". Runs keep going on the server either way."]})]}),r&&s.jsx("p",{className:"text-sm text-red-400 mt-1.5",children:r}),s.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[!g&&s.jsx("button",{onClick:k,disabled:c,className:"px-3.5 py-1.5 rounded-lg text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 disabled:opacity-50",children:"Stay signed in"}),s.jsxs("button",{onClick:()=>{e().then(()=>{window.location.href="/login"})},className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg text-sm text-gray-300 hover:bg-white/5",children:[s.jsx(it,{size:13})," ",g?"Sign in again now":"Sign out"]})]})]})]})})}function y0({children:e}){const{isAuthenticated:t,isLoading:o,isSetupRequired:a,isTwoFactorSetupRequired:l}=Y(),c=H();return m.useEffect(()=>{o||(a?c("/setup",{replace:!0}):t||c("/login",{replace:!0}))},[o,t,a,c]),o?s.jsx(Wn,{title:"Welcome back to Testver",subtitle:"One moment — verifying your session.",phases:qn,footerHint:void 0}):t?l?s.jsx(w0,{}):s.jsxs(s.Fragment,{children:[e,s.jsx(b0,{})]}):null}function w0(){const{user:e,logout:t,refreshStatus:o}=Y(),[a,l]=m.useState(""),[c,i]=m.useState(""),[r,d]=m.useState("");return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-surface-0 px-4","data-testid":"two-factor-gate",children:s.jsxs("div",{className:"w-full max-w-lg bg-surface-1 rounded-xl border border-white/5 p-8",children:[s.jsxs("div",{className:"flex flex-col items-center mb-6 text-center",children:[s.jsx(ie,{className:"w-12 h-12 object-contain"}),s.jsx("h1",{className:"mt-4 text-xl font-semibold text-gray-100",children:"Set up two-factor authentication"}),s.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["Your administrator now requires it",e?` for @${e.username}`:"",". Set it up to continue — it takes a minute."]})]}),c?s.jsx(Vn,{start:()=>jn(c).catch(u=>{throw d(u.message),i(""),l(""),u}),confirm:async u=>(await Tn(u,!1)).recoveryCodes,doneLabel:"Continue to Testver",onFinished:()=>{o()}}):s.jsxs("form",{onSubmit:u=>{u.preventDefault(),a&&(d(""),i(a))},className:"space-y-4",children:[r&&s.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/20 rounded-lg text-red-400 text-sm",children:r}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"two-factor-gate-password",className:"block text-xs text-gray-400 mb-1.5",children:"Confirm your password to start"}),s.jsx(le,{id:"two-factor-gate-password",value:a,onChange:u=>l(u.target.value),autoFocus:!0,autoComplete:"current-password",className:"w-full px-3 py-2.5 bg-surface-2 border border-white/10 rounded-lg text-gray-100 text-sm focus:outline-none focus:border-brand-500/50"})]}),s.jsxs("button",{type:"submit",disabled:!a,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50",children:[s.jsx(re,{size:16})," Start"]})]}),s.jsxs("button",{type:"button",onClick:()=>void t(),className:"mt-5 flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300",children:[s.jsx(it,{size:12})," Sign out"]})]})})}function Le({minRole:e,children:t}){const{hasRole:o}=Y();return o(e)?s.jsx(s.Fragment,{children:t}):s.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[s.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:s.jsx(Lo,{size:24,className:"text-red-400"})}),s.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Access Denied"}),s.jsx("p",{className:"text-sm text-gray-500 max-w-sm",children:"You don't have permission to access this page. Contact an administrator if you need access."})]})})}function se(){const e=Zn(),t=H(),o=Ve(),[a,l]=m.useState(!1),[c,i]=m.useState(!1),r=yt(e)?e.status:void 0,d=yt(e)?e.statusText:void 0,u=(e==null?void 0:e.message)||d||(typeof e=="string"?e:"An unexpected error occurred."),h=e==null?void 0:e.stack,p=r===404||e==null,g=p?"We couldn't find that page":r?`Something went wrong (${r})`:"Something went wrong",b=p?"The page you're looking for doesn't exist or may have moved.":"An unexpected error stopped this page from rendering. You can try reloading, going back, or returning to the dashboard.",k=[`URL: ${o.pathname}${o.search}`,r?`Status: ${r} ${d||""}`:"",`Message: ${u}`,h?`
|
|
45
|
+
Stack:
|
|
46
|
+
${h}`:""].filter(Boolean).join(`
|
|
47
|
+
`),w=async()=>{try{await navigator.clipboard.writeText(k),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return s.jsx("div",{className:"min-h-screen w-full flex items-center justify-center px-4 py-12 bg-surface-0 text-gray-200",children:s.jsxs("div",{className:"w-full max-w-xl",children:[s.jsxs("div",{className:"flex flex-col items-center text-center animate-fade-in",children:[s.jsx("div",{className:["w-16 h-16 rounded-2xl flex items-center justify-center mb-5 ring-1",p?"bg-brand-500/10 ring-brand-500/30 text-brand-400":"bg-rose-500/10 ring-rose-500/30 text-rose-400"].join(" "),children:s.jsx(me,{size:28,strokeWidth:2})}),s.jsx("h1",{className:"text-2xl font-semibold text-gray-100 mb-2",children:g}),s.jsx("p",{className:"text-sm text-gray-400 max-w-md leading-relaxed",children:b})]}),s.jsxs("div",{className:"mt-7 flex flex-wrap items-center justify-center gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-brand-500 hover:bg-brand-400 text-white transition-colors",children:[s.jsx(Do,{size:16}),"Reload page"]}),s.jsxs("button",{type:"button",onClick:()=>t(-1),className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-surface-2 hover:bg-surface-3 text-gray-200 ring-1 ring-white/10 transition-colors",children:[s.jsx(Oe,{size:16}),"Go back"]}),s.jsxs(ce,{to:"/",className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-surface-2 hover:bg-surface-3 text-gray-200 ring-1 ring-white/10 transition-colors",children:[s.jsx(Mo,{size:16}),"Dashboard"]})]}),!p&&s.jsxs("div",{className:"mt-8 rounded-xl bg-surface-1 ring-1 ring-white/10 overflow-hidden",children:[s.jsxs("button",{type:"button",onClick:()=>l(S=>!S),className:"w-full flex items-center justify-between px-4 py-3 text-left text-sm text-gray-300 hover:bg-surface-2/60 transition-colors",children:[s.jsxs("span",{className:"inline-flex items-center gap-2",children:[a?s.jsx(ss,{size:16}):s.jsx(rt,{size:16}),"Technical details"]}),a&&s.jsxs("span",{role:"button",tabIndex:0,onClick:S=>{S.stopPropagation(),w()},onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),S.stopPropagation(),w())},className:"inline-flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 cursor-pointer",children:[c?s.jsx(xe,{size:14,className:"text-emerald-400"}):s.jsx(lt,{size:14}),c?"Copied":"Copy"]})]}),a&&s.jsx("div",{className:"border-t border-white/10 bg-surface-0/40",children:s.jsx("pre",{className:"px-4 py-3 text-xs leading-relaxed text-gray-300 whitespace-pre-wrap break-words font-mono max-h-72 overflow-auto",children:k})})]}),!p&&s.jsx("p",{className:"mt-6 text-center text-xs text-gray-500",children:"If this keeps happening, copy the technical details above and share them with your administrator."})]})})}function L(e,t){const o=a=>{try{sessionStorage.removeItem(De)}catch{}return{default:t(a)}};return m.lazy(()=>e().then(o,async a=>{if(!await _t()){for(;!await _t();)await new Promise(c=>setTimeout(c,2e3));try{return o(await e())}catch{}}let l=!1;try{l=sessionStorage.getItem(De)==="1"}catch{}if(!l){try{sessionStorage.setItem(De,"1")}catch{}return window.location.reload(),new Promise(()=>{})}throw a}))}async function _t(){try{return(await fetch("/api/health",{cache:"no-store"})).ok}catch{return!1}}const De="testver.chunkReload",S0=L(()=>I(()=>import("./Dashboard-B22yRPyV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),e=>e.Dashboard),v0=L(()=>I(()=>import("./ModuleExplorer-BKVbxFZK.js"),__vite__mapDeps([13,1,3,14,4,15,16,7,17,18,19,11,20])),e=>e.ModuleExplorer),j0=L(()=>I(()=>import("./ProjectExplorer-BVGbmVP7.js"),__vite__mapDeps([21,1,3,14,4,15,16,7,17,18,19,11,20])),e=>e.ProjectExplorer),T0=L(()=>I(()=>import("./AdvancedPage-BeM7aB8b.js"),__vite__mapDeps([22,1,23,3,24,4,25,11,26,27,12,28,29,30,31,32])),e=>e.AdvancedPage),N0=L(()=>I(()=>import("./AIPanel-RWO8Cd9w.js"),__vite__mapDeps([33,1,15,4,26,30,31,9,2,3,34,35,36,11,37,8,38,23,39,40,41,16,7])),e=>e.AIPanel),k0=L(()=>I(()=>import("./AIRecordPanel-DnreS585.js"),__vite__mapDeps([42,1,9,11,3,30,4,38,23,39,35,40,41,26,2])),e=>e.AIRecordPanel),C0=L(()=>I(()=>import("./TestverMcpPage-Dte0qSXp.js"),__vite__mapDeps([43,1,3,44,30,4,45,11])),e=>e.TestverMcpPage),O0=L(()=>I(()=>import("./ResultsPage-DD-uj8gk.js").then(e=>e.R),__vite__mapDeps([46,1,11,24,6,3,23,30,4,28,47,9,10,27,12,2,48,39,49,50,19])),e=>e.ResultsPage),P0=L(()=>I(()=>import("./OutputPage-Bi-28tJi.js"),__vite__mapDeps([51,1,3,16,7,17,4])),e=>e.OutputPage),E0=L(()=>I(()=>import("./TestExplorerPage-Bdnll77k.js"),__vite__mapDeps([52,1,49,50,2,3,48,5,23,11,9,4,12,16,6,47,46,24,30,28,10,27,39,19,7,53,25,26,32,29])),e=>e.TestExplorerPage),R0=L(()=>I(()=>import("./CodeMapPage-BQOEtv-R.js"),__vite__mapDeps([54,1,55,8,56,23,28,9,4,35,3])),e=>e.CodeMapPage),$0=L(()=>I(()=>import("./ManagePage-SvRQ6L19.js"),__vite__mapDeps([57,1])),e=>e.ManagePage),A0=L(()=>I(()=>import("./PipelinesPanel-BtO3iSJ4.js"),__vite__mapDeps([58,1,3,12,4,30,47,23,45])),e=>e.PipelinesPage),I0=L(()=>I(()=>import("./SettingsPage-DAV_0y0m.js"),__vite__mapDeps([59,1,11,3,4,23,47,18,31,44,30,45,34,40,28,48,41,60])),e=>e.SettingsPage),L0=L(()=>I(()=>import("./APITestingPage-DwL67hqL.js"),__vite__mapDeps([61,1,3,4,23,16,7,11])),e=>e.APITestingPage),D0=L(()=>I(()=>import("./GitPage-DXL2Sv40.js"),__vite__mapDeps([62,1,4,30,6,3,20,11])),e=>e.GitPage),M0=L(()=>I(()=>import("./UserManagementPage-BU4MuDJZ.js"),__vite__mapDeps([63,1,11,3,4])),e=>e.UserManagementPage),_0=L(()=>I(()=>import("./AuditLogPage-DYcUdJoj.js"),__vite__mapDeps([64,1,11,3,4])),e=>e.AuditLogPage),U0=L(()=>I(()=>import("./ProfilePage-BgZ4VDC-.js"),__vite__mapDeps([65,1,3,4])),e=>e.ProfilePage),J0=L(()=>I(()=>import("./WorkflowsPage-BP5k7AqE.js"),__vite__mapDeps([66,1,11,23,4,35,3,8])),e=>e.WorkflowsPage),F0=L(()=>I(()=>import("./TestManagementPage-CCNE688A.js"),__vite__mapDeps([67,1,11,68,49,50,69,3,28,4,23,70,9,71,72,73])),e=>e.TestManagementPage),B0=L(()=>I(()=>import("./TestPlansPage-T6D25i6-.js"),__vite__mapDeps([74,1,11,3,23,12,4,30,2,47,69,9,53,25,26,72,67,68,49,50,28,70,71,73,27])),e=>e.TestPlansPage),G0=L(()=>I(()=>import("./ScriptMappingPage-DQQoR6sR.js"),__vite__mapDeps([75,1,23,30,4,69,3,9])),e=>e.ScriptMappingPage),z0=L(()=>I(()=>import("./AITestGenPage-C8bWUelu.js"),__vite__mapDeps([76,1,3,69,4,28,73,72])),e=>e.AITestGenPage),q0=L(()=>I(()=>import("./CoveragePage-8bDSphY1.js"),__vite__mapDeps([77,1,71,4,23,69,3,11])),e=>e.CoveragePage),W0=L(()=>I(()=>import("./AnalyticsPage-C5ddYfRk.js"),__vite__mapDeps([78,1,3,23,71,4,69])),e=>e.AnalyticsPage),H0=L(()=>I(()=>import("./DefectsPage-Arv4Ac-b.js"),__vite__mapDeps([79,1,80,81,23,70,71,4,69,3,72])),e=>e.DefectsPage),K0=L(()=>I(()=>import("./ImportExportPage-BcjzRd7T.js"),__vite__mapDeps([68,1,49,50,69,3,28,4])),e=>e.ImportExportPage),V0=L(()=>I(()=>import("./SourcesPage-BvqC9oKw.js"),__vite__mapDeps([82,1,11,23,69,3,30,4,72])),e=>e.default),Y0=L(()=>I(()=>import("./SharedReportView-CqSLFKT1.js"),__vite__mapDeps([83,1,11,36,37,4,8,3])),e=>e.SharedReportView),Q0=L(()=>I(()=>import("./ReportsPage-DFxCQ8cY.js"),__vite__mapDeps([84,1,11,31,30,4,85,32,28,37,3])),e=>e.ReportsPage),X0=L(()=>I(()=>import("./ReportFullView-Ce4OI8lf.js"),__vite__mapDeps([86,1,30,4,36,11,37,8,85,32,3])),e=>e.ReportFullView),Ut=L(()=>I(()=>import("./AboutPage-CynLB95E.js"),__vite__mapDeps([87,1,3,41,11,60,30,4])),e=>e.AboutPage),Z0=e=>s.jsx(m.Suspense,{fallback:s.jsx(Fn,{}),children:e}),eb=new ro({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),tb=eo([{path:"login",element:s.jsx(c0,{}),errorElement:s.jsx(se,{})},{path:"forgot-password",element:s.jsx(u0,{}),errorElement:s.jsx(se,{})},{path:"reset-password",element:s.jsx(m0,{}),errorElement:s.jsx(se,{})},{path:"setup",element:s.jsx(h0,{}),errorElement:s.jsx(se,{})},{path:"reports/share/:token",element:Z0(s.jsx(Y0,{})),errorElement:s.jsx(se,{})},{element:s.jsx(y0,{children:s.jsx(Qx,{})}),errorElement:s.jsx(se,{}),children:[{index:!0,element:s.jsx(S0,{})},{path:"explorer",element:s.jsx(j0,{})},{path:"module/:moduleId",element:s.jsx(v0,{})},{path:"advanced",element:s.jsx(T0,{})},{path:"runner",element:s.jsx(Q,{to:"/advanced?tab=runner",replace:!0})},{path:"tests",element:s.jsx(E0,{})},{path:"code-map",element:s.jsx(R0,{})},{path:"data-map",element:s.jsx(Q,{to:"/code-map?view=data",replace:!0})},{path:"manage",element:s.jsx($0,{})},{path:"environments",element:s.jsx(Q,{to:"/manage",replace:!0})},{path:"test-cases",element:s.jsx(F0,{})},{path:"test-plans",element:s.jsx(B0,{})},{path:"script-mapping",element:s.jsx(G0,{})},{path:"ai-test-gen",element:s.jsx(z0,{})},{path:"sources",element:s.jsx(V0,{})},{path:"coverage",element:s.jsx(q0,{})},{path:"analytics",element:s.jsx(W0,{})},{path:"defects",element:s.jsx(H0,{})},{path:"import-export",element:s.jsx(K0,{})},{path:"connectors",element:s.jsx(Q,{to:"/settings?tab=connectors",replace:!0})},{path:"results",element:s.jsx(O0,{})},{path:"output",element:s.jsx(P0,{})},{path:"api-testing",element:s.jsx(L0,{})},{path:"cicd",element:s.jsx(Q,{to:"/pipelines",replace:!0})},{path:"pipelines",element:s.jsx(A0,{})},{path:"schedules",element:s.jsx(Q,{to:"/advanced?tab=schedules",replace:!0})},{path:"git",element:s.jsx(D0,{})},{path:"ai",element:s.jsx(N0,{})},{path:"ai-record",element:s.jsx(k0,{})},{path:"testver-mcp",element:s.jsx(C0,{})},{path:"reports",element:s.jsx(Q0,{})},{path:"reports/view/:id",element:s.jsx(X0,{})},{path:"skills",element:s.jsx(Q,{to:"/ai",replace:!0})},{path:"workflows",element:s.jsx(J0,{})},{path:"settings",element:s.jsx(Le,{minRole:"viewer",children:s.jsx(I0,{})})},{path:"profile",element:s.jsx(U0,{})},{path:"testver",element:s.jsx(Ut,{})},{path:"testver/about",element:s.jsx(Ut,{})},{path:"about",element:s.jsx(Q,{to:"/testver/about",replace:!0})},{path:"users",element:s.jsx(Le,{minRole:"admin",children:s.jsx(M0,{})})},{path:"audit",element:s.jsx(Le,{minRole:"admin",children:s.jsx(_0,{})})},{path:"*",element:s.jsx(se,{})}]}]);function sb(){return s.jsx(ao,{client:eb,children:s.jsx(mx,{children:s.jsx(Yg,{children:s.jsx(to,{router:tb})})})})}ex();so.createRoot(document.getElementById("root")).render(s.jsx(m.StrictMode,{children:s.jsx(sb,{})}));export{Gd as $,yr as A,Xg as B,Ar as C,Pc as D,$r as E,Ud as F,Bd as G,Ld as H,Fd as I,Md as J,_d as K,Fn as L,Dd as M,En as N,ax as O,jx as P,pi as Q,Zb as R,gi as S,Si as T,fi as U,vi as V,wi as W,xi as X,ci as Y,li as Z,ui as _,Vo as a,Ii as a$,zd as a0,au as a1,ru as a2,pu as a3,di as a4,il as a5,Ho as a6,mc as a7,Dn as a8,ft as a9,sd as aA,td as aB,Zl as aC,rc as aD,uc as aE,cc as aF,ac as aG,zl as aH,ql as aI,ae as aJ,ki as aK,Di as aL,lc as aM,Ji as aN,Ui as aO,Li as aP,dc as aQ,ic as aR,ec as aS,Bi as aT,Xi as aU,Zi as aV,$i as aW,nc as aX,sc as aY,tc as aZ,Rc as a_,On as aa,Ku as ab,xm as ac,ta as ad,Y as ae,hc as af,vl as ag,jl as ah,Tl as ai,sl as aj,px as ak,Nl as al,gc as am,kl as an,be as ao,nl as ap,ol as aq,pc as ar,Sc as as,Sm as at,xc as au,Cl as av,Ol as aw,gt as ax,Nt as ay,Xl as az,Ae as b,ps as b$,Cs as b0,Mi as b1,Gi as b2,Ni as b3,zi as b4,qi as b5,Ai as b6,Wi as b7,Ki as b8,Oi as b9,Ll as bA,Ml as bB,Dl as bC,Fl as bD,Bl as bE,kc as bF,Oc as bG,Cc as bH,Vi as bI,ji as bJ,Ti as bK,Yi as bL,Qi as bM,Fi as bN,Tt as bO,qc as bP,zc as bQ,Wc as bR,jg as bS,Pg as bT,Eg as bU,Rg as bV,Ng as bW,Tg as bX,kg as bY,Og as bZ,Nh as b_,Ri as ba,Ei as bb,Hi as bc,fc as bd,_i as be,I as bf,Tc as bg,$l as bh,Ko as bi,ed as bj,rd as bk,od as bl,Il as bm,Al as bn,Yl as bo,Vl as bp,Rl as bq,Ql as br,ad as bs,El as bt,Gl as bu,Jl as bv,Hl as bw,Ul as bx,Kl as by,Wl as bz,ey as c,Xc as c$,Qa as c0,gp as c1,Np as c2,tr as c3,cg as c4,Ug as c5,Kb as c6,_a as c7,Ua as c8,Ja as c9,ka as cA,ja as cB,Ca as cC,Ta as cD,Ea as cE,Pa as cF,Oa as cG,Ra as cH,Xa as cI,ba as cJ,xa as cK,ya as cL,va as cM,Za as cN,ei as cO,qa as cP,wa as cQ,Ya as cR,si as cS,ni as cT,ti as cU,Wa as cV,Ha as cW,Ka as cX,Va as cY,Mc as cZ,Jc as c_,Zo as ca,nr as cb,or as cc,qg as cd,of as ce,nf as cf,ub as cg,gb as ch,Jd as ci,ea as cj,er as ck,bb as cl,zr as cm,Xr as cn,xb as co,Zr as cp,Qr as cq,Mg as cr,_g as cs,Jg as ct,Fg as cu,Bg as cv,Gg as cw,Wg as cx,Lg as cy,zg as cz,Cn as d,mg as d$,el as d0,th as d1,Bc as d2,Uc as d3,Gc as d4,Zc as d5,_c as d6,Wp as d7,eh as d8,ng as d9,ym as dA,Pm as dB,wm as dC,jm as dD,$a as dE,Aa as dF,Ia as dG,La as dH,Ma as dI,Da as dJ,yd as dK,Sd as dL,jd as dM,vd as dN,Nd as dO,Td as dP,ld as dQ,ud as dR,xd as dS,fd as dT,hd as dU,id as dV,md as dW,bd as dX,gd as dY,dg as dZ,ug as d_,Lc as da,Fc as db,tl as dc,Dc as dd,ut as de,Fb as df,gu as dg,q as dh,Qb as di,xu as dj,cm as dk,Vu as dl,Qu as dm,Yu as dn,tm as dp,em as dq,om as dr,nm as ds,Zu as dt,sm as du,Om as dv,Nm as dw,Tm as dx,vm as dy,bm as dz,pb as e,lb as e$,pg as e0,hg as e1,nx as e2,Rd as e3,Od as e4,Pd as e5,bi as e6,yi as e7,vx as e8,fa as e9,pr as eA,ur as eB,fr as eC,hr as eD,gr as eE,xr as eF,Kd as eG,nu as eH,qd as eI,Hd as eJ,Wd as eK,Yd as eL,Xd as eM,Vd as eN,iu as eO,Qd as eP,lu as eQ,du as eR,le as eS,ou as eT,hu as eU,cu as eV,fu as eW,mu as eX,su as eY,tu as eZ,eu as e_,ca as ea,ga as eb,Sx as ec,Yb as ed,ma as ee,ha as ef,pa as eg,Qo as eh,Su as ei,Eu as ej,Nu as ek,Vb as el,ra as em,la as en,Xo as eo,sr as ep,vu as eq,Ru as er,$u as es,Yo as et,ie as eu,Hc as ev,Kc as ew,Yc as ex,Qc as ey,Vc as ez,fb as f,ku as f$,$b as f0,Ib as f1,zb as f2,Gb as f3,qb as f4,Un as f5,Tx as f6,Wb as f7,Jb as f8,db as f9,Cb as fA,Pr as fB,Er as fC,Lr as fD,_r as fE,Dr as fF,Mr as fG,Gr as fH,Br as fI,Ur as fJ,Fr as fK,_u as fL,Uu as fM,Ju as fN,Fu as fO,Bu as fP,Gu as fQ,zu as fR,Wu as fS,qu as fT,Hu as fU,Ou as fV,Pu as fW,Vn as fX,Tn as fY,jn as fZ,i0 as f_,yb as fa,Lb as fb,Rb as fc,Ab as fd,Db as fe,Mb as ff,Ub as fg,yu as fh,bu as fi,Pb as fj,wb as fk,Sb as fl,Tb as fm,vb as fn,wu as fo,ox as fp,mb as fq,rx as fr,jb as fs,Ob as ft,Eb as fu,Nb as fv,kb as fw,Xb as fx,Bb as fy,_b as fz,rr as g,Kf as g$,Cu as g0,Kn as g1,Tu as g2,Iu as g3,Mu as g4,Au as g5,ju as g6,Lu as g7,Du as g8,Zg as g9,Km as gA,Im as gB,mi as gC,uf as gD,Lf as gE,pd as gF,Os as gG,Ec as gH,Ac as gI,Hf as gJ,Sp as gK,Oh as gL,Rh as gM,Eh as gN,Ph as gO,Ch as gP,Ih as gQ,Lh as gR,$h as gS,vp as gT,pl as gU,ml as gV,hl as gW,cl as gX,Bf as gY,Ff as gZ,qf as g_,oi as ga,Cm as gb,Em as gc,Jm as gd,Dm as ge,Mm as gf,Um as gg,_m as gh,Gm as gi,zm as gj,Ym as gk,ep as gl,Xm as gm,Zm as gn,Qm as go,tp as gp,Fm as gq,Rm as gr,Lm as gs,Am as gt,Wm as gu,sp as gv,$m as gw,qm as gx,Hm as gy,Vm as gz,Jn as h,Kp as h$,zf as h0,lp as h1,ip as h2,mp as h3,Op as h4,zp as h5,fp as h6,bp as h7,yp as h8,jp as h9,mf as hA,Cf as hB,Of as hC,Qf as hD,up as hE,hp as hF,xp as hG,kp as hH,Rp as hI,Cp as hJ,Mp as hK,Fp as hL,Ef as hM,_f as hN,ph as hO,Xf as hP,Pf as hQ,$f as hR,Mf as hS,Jf as hT,ch as hU,lh as hV,dh as hW,uh as hX,ag as hY,ig as hZ,qp as h_,wp as ha,Tp as hb,Hp as hc,Xp as hd,rh as he,Vp as hf,Qp as hg,nh as hh,ih as hi,oh as hj,eg as hk,tg as hl,og as hm,rg as hn,df as ho,fh as hp,xh as hq,gh as hr,yh as hs,wh as ht,jh as hu,Sh as hv,Ah as hw,lf as hx,af as hy,cf as hz,cr as i,Zp as i0,sh as i1,Yp as i2,Bh as i3,qh as i4,tf as i5,Yh as i6,Qh as i7,ef as i8,Zh as i9,Wf as iA,fl as iB,dl as iC,ll as iD,ul as iE,rl as iF,al as iG,gl as iH,Sl as iI,yl as iJ,wl as iK,bl as iL,cb as iM,aa as iN,ia as iO,sa as iP,na as iQ,Vr as iR,ib as iS,Xh as ia,pf as ib,hf as ic,ff as id,gf as ie,Up as ig,If as ih,Af as ii,Df as ij,Kh as ik,Hh as il,Fh as im,zh as io,Wh as ip,Ag as iq,fg as ir,gg as is,yg as it,bg as iu,wg as iv,xg as iw,kh as ix,vg as iy,Sg as iz,G as j,vr as k,jr as l,Tr as m,Fa as n,Jx as o,Ba as p,Ga as q,ar as r,wr as s,za as t,hb as u,ua as v,Hb as w,wx as x,kd as y,wd as z};
|