playwright-core 1.56.0-alpha-2025-08-22 → 1.56.0-alpha-2025-08-23

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-Ddgs1X7L.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-CtpCsWZ5.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
2
2
  var p0=Object.defineProperty;var m0=(t,e,n)=>e in t?p0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var be=(t,e,n)=>m0(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function g0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var uu={exports:{}},bi={},fu={exports:{}},he={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -46,7 +46,7 @@ Error generating stack: `+m.message+`
46
46
  rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
47
47
  rgb(0 0 0 / 10%) 0px -2px 4px,
48
48
  rgb(0 0 0 / 15%) 0px -6.1px 12px,
49
- rgb(0 0 0 / 25%) 0px 6px 12px`},PS=({diff:t,noTargetBlank:e,hideDetails:n})=>{const[r,o]=$.useState(t.diff?"diff":"actual"),[l,c]=$.useState(!1),[u,d]=$.useState(null),[p,g]=$.useState("Expected"),[y,v]=$.useState(null),[x,E]=$.useState(null),[S,k]=jr();$.useEffect(()=>{(async()=>{var j,oe,ae,M;d(await mu((j=t.expected)==null?void 0:j.attachment.path)),g(((oe=t.expected)==null?void 0:oe.title)||"Expected"),v(await mu((ae=t.actual)==null?void 0:ae.attachment.path)),E(await mu((M=t.diff)==null?void 0:M.attachment.path))})()},[t]);const C=u&&y&&x,A=C?Math.max(u.naturalWidth,y.naturalWidth,200):500,U=C?Math.max(u.naturalHeight,y.naturalHeight,200):500,R=Math.min(1,(S.width-30)/A),D=Math.min(1,(S.width-50)/A/2),z=A*R,q=U*R,F={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return w.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:k,children:C&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&w.jsx("div",{style:{...F,fontWeight:r==="diff"?600:"initial"},onClick:()=>o("diff"),children:"Diff"}),w.jsx("div",{style:{...F,fontWeight:r==="actual"?600:"initial"},onClick:()=>o("actual"),children:"Actual"}),w.jsx("div",{style:{...F,fontWeight:r==="expected"?600:"initial"},onClick:()=>o("expected"),children:p}),w.jsx("div",{style:{...F,fontWeight:r==="sxs"?600:"initial"},onClick:()=>o("sxs"),children:"Side by side"}),w.jsx("div",{style:{...F,fontWeight:r==="slider"?600:"initial"},onClick:()=>o("slider"),children:"Slider"})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:q+60},children:[t.diff&&r==="diff"&&w.jsx(En,{image:x,alt:"Diff",hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),t.diff&&r==="actual"&&w.jsx(En,{image:y,alt:"Actual",hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),t.diff&&r==="expected"&&w.jsx(En,{image:u,alt:p,hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),t.diff&&r==="slider"&&w.jsx(OS,{expectedImage:u,actualImage:y,hideSize:n,canvasWidth:z,canvasHeight:q,scale:R,expectedTitle:p}),t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:D*A,canvasHeight:D*U,scale:D}),w.jsx(En,{image:l?x:y,title:l?"Diff":"Actual",onClick:()=>c(!l),hideSize:n,canvasWidth:D*A,canvasHeight:D*U,scale:D})]}),!t.diff&&r==="actual"&&w.jsx(En,{image:y,title:"Actual",hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),!t.diff&&r==="expected"&&w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),!t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,canvasWidth:D*A,canvasHeight:D*U,scale:D}),w.jsx(En,{image:y,title:"Actual",canvasWidth:D*A,canvasHeight:D*U,scale:D})]})]}),!n&&w.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[w.jsx("div",{children:t.diff&&w.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},OS=({expectedImage:t,actualImage:e,canvasWidth:n,canvasHeight:r,scale:o,expectedTitle:l,hideSize:c})=>{const u={position:"absolute",top:0,left:0},[d,p]=$.useState(n/2),g=t.naturalWidth===e.naturalWidth&&t.naturalHeight===e.naturalHeight;return w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!c&&w.jsxs("div",{style:{margin:5},children:[!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!g&&w.jsx("span",{children:e.naturalWidth}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!g&&w.jsx("span",{children:e.naturalHeight})]}),w.jsxs("div",{style:{position:"relative",width:n,height:r,margin:15,...Ou},children:[w.jsx(hg,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),w.jsx("img",{alt:l,style:{width:t.naturalWidth*o,height:t.naturalHeight*o},draggable:"false",src:t.src}),w.jsx("div",{style:{...u,bottom:0,overflow:"hidden",width:d,...Ou},children:w.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*o,height:e.naturalHeight*o},draggable:"false",src:e.src})})]})]})},En=({image:t,title:e,alt:n,hideSize:r,canvasWidth:o,canvasHeight:l,scale:c,onClick:u})=>w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&w.jsxs("div",{style:{margin:5},children:[e&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight})]}),w.jsx("div",{style:{display:"flex",flex:"none",width:o,height:l,margin:15,...Ou},children:w.jsx("img",{width:t.naturalWidth*c,height:t.naturalHeight*c,alt:e||n,style:{cursor:u?"pointer":"initial"},draggable:"false",src:t.src,onClick:u})})]}),RS="modulepreload",$S=function(t,e){return new URL(t,e).href},Jp={},DS=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(g=>{if(g=$S(g,r),g in Jp)return;Jp[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(!!r)for(let S=u.length-1;S>=0;S--){const k=u[S];if(k.href===g&&(!y||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${v}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":RS,y||(E.as="script"),E.crossOrigin="",E.href=g,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((S,k)=>{E.addEventListener("load",S),E.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},FS=20,Cs=({text:t,highlighter:e,mimeType:n,linkify:r,readOnly:o,highlight:l,revealLine:c,lineNumbers:u,isFocused:d,focusOnChange:p,wrapLines:g,onChange:y,dataTestId:v,placeholder:x})=>{const[E,S]=jr(),[k]=$.useState(DS(()=>import("./codeMirrorModule-Ddgs1X7L.js"),__vite__mapDeps([0,1]),import.meta.url).then(R=>R.default)),C=$.useRef(null),[A,U]=$.useState();return $.useEffect(()=>{(async()=>{var F,j;const R=await k;zS(R);const D=S.current;if(!D)return;const z=HS(e)||US(n)||(r?"text/linkified":"");if(C.current&&z===C.current.cm.getOption("mode")&&!!o===C.current.cm.getOption("readOnly")&&u===C.current.cm.getOption("lineNumbers")&&g===C.current.cm.getOption("lineWrapping")&&x===C.current.cm.getOption("placeholder"))return;(j=(F=C.current)==null?void 0:F.cm)==null||j.getWrapperElement().remove();const q=R(D,{value:"",mode:z,readOnly:!!o,lineNumbers:u,lineWrapping:g,placeholder:x});return C.current={cm:q},d&&q.focus(),U(q),q})()},[k,A,S,e,n,r,u,g,o,d,x]),$.useEffect(()=>{C.current&&C.current.cm.setSize(E.width,E.height)},[E]),$.useLayoutEffect(()=>{var z;if(!A)return;let R=!1;if(A.getValue()!==t&&(A.setValue(t),R=!0,p&&(A.execCommand("selectAll"),A.focus())),R||JSON.stringify(l)!==JSON.stringify(C.current.highlight)){for(const j of C.current.highlight||[])A.removeLineClass(j.line-1,"wrap");for(const j of l||[])A.addLineClass(j.line-1,"wrap",`source-line-${j.type}`);for(const j of C.current.widgets||[])A.removeLineWidget(j);for(const j of C.current.markers||[])j.clear();const q=[],F=[];for(const j of l||[]){if(j.type!=="subtle-error"&&j.type!=="error")continue;const oe=(z=C.current)==null?void 0:z.cm.getLine(j.line-1);if(oe){const ae={};ae.title=j.message||"",F.push(A.markText({line:j.line-1,ch:0},{line:j.line-1,ch:j.column||oe.length},{className:"source-line-error-underline",attributes:ae}))}if(j.type==="error"){const ae=document.createElement("div");ae.innerHTML=Wi(j.message||""),ae.className="source-line-error-widget",q.push(A.addLineWidget(j.line,ae,{above:!0,coverGutter:!1}))}}C.current.highlight=l,C.current.widgets=q,C.current.markers=F}typeof c=="number"&&C.current.cm.lineCount()>=c&&A.scrollIntoView({line:Math.max(0,c-1),ch:0},50);let D;return y&&(D=()=>y(A.getValue()),A.on("change",D)),()=>{D&&A.off("change",D)}},[A,t,l,c,p,y]),w.jsx("div",{"data-testid":v,className:"cm-wrapper",ref:S,onClick:BS})};function BS(t){var n;if(!(t.target instanceof HTMLElement))return;let e;t.target.classList.contains("cm-linkified")?e=t.target.textContent:t.target.classList.contains("cm-link")&&((n=t.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(e=t.target.nextElementSibling.textContent.slice(1,-1)),e&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}let Xp=!1;function zS(t){Xp||(Xp=!0,t.defineSimpleMode("text/linkified",{start:[{regex:Rm,token:"linkified"}]}))}function US(t){if(t){if(t.includes("javascript")||t.includes("json"))return"javascript";if(t.includes("python"))return"python";if(t.includes("csharp"))return"text/x-csharp";if(t.includes("java"))return"text/x-java";if(t.includes("markdown"))return"markdown";if(t.includes("html")||t.includes("svg"))return"htmlmixed";if(t.includes("css"))return"css"}}function HS(t){if(t)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[t]}function qS(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const VS=({title:t,children:e,setExpanded:n,expanded:r,expandOnTitleClick:o})=>{const l=$.useId();return w.jsxs("div",{className:ze("expandable",r&&"expanded"),children:[w.jsxs("div",{role:"button","aria-expanded":r,"aria-controls":l,className:"expandable-title",onClick:()=>o&&n(!r),children:[w.jsx("div",{className:ze("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!o&&n(!r)}),t]}),r&&w.jsx("div",{id:l,role:"region",style:{marginLeft:25},children:e})]})};function pg(t){const e=[];let n=0,r;for(;(r=Rm.exec(t))!==null;){const l=t.substring(n,r.index);l&&e.push(l);const c=r[0];e.push(WS(c)),n=r.index+c.length}const o=t.substring(n);return o&&e.push(o),e}function WS(t){let e=t;return e.startsWith("www.")&&(e="https://"+e),w.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:t})}const KS=({attachment:t,reveal:e})=>{const[n,r]=$.useState(!1),[o,l]=$.useState(null),[c,u]=$.useState(null),[d,p]=_0(),g=$.useRef(null),y=qS(t.contentType),v=!!t.sha1||!!t.path;$.useEffect(()=>{var S;if(e)return(S=g.current)==null||S.scrollIntoView({behavior:"smooth"}),p()},[e,p]),$.useEffect(()=>{n&&o===null&&c===null&&(u("Loading ..."),fetch(ia(t)).then(S=>S.text()).then(S=>{l(S),u(null)}).catch(S=>{u("Failed to load: "+S.message)}))},[n,o,c,t]);const x=$.useMemo(()=>{const S=o?o.split(`
49
+ rgb(0 0 0 / 25%) 0px 6px 12px`},PS=({diff:t,noTargetBlank:e,hideDetails:n})=>{const[r,o]=$.useState(t.diff?"diff":"actual"),[l,c]=$.useState(!1),[u,d]=$.useState(null),[p,g]=$.useState("Expected"),[y,v]=$.useState(null),[x,E]=$.useState(null),[S,k]=jr();$.useEffect(()=>{(async()=>{var j,oe,ae,M;d(await mu((j=t.expected)==null?void 0:j.attachment.path)),g(((oe=t.expected)==null?void 0:oe.title)||"Expected"),v(await mu((ae=t.actual)==null?void 0:ae.attachment.path)),E(await mu((M=t.diff)==null?void 0:M.attachment.path))})()},[t]);const C=u&&y&&x,A=C?Math.max(u.naturalWidth,y.naturalWidth,200):500,U=C?Math.max(u.naturalHeight,y.naturalHeight,200):500,R=Math.min(1,(S.width-30)/A),D=Math.min(1,(S.width-50)/A/2),z=A*R,q=U*R,F={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return w.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:k,children:C&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&w.jsx("div",{style:{...F,fontWeight:r==="diff"?600:"initial"},onClick:()=>o("diff"),children:"Diff"}),w.jsx("div",{style:{...F,fontWeight:r==="actual"?600:"initial"},onClick:()=>o("actual"),children:"Actual"}),w.jsx("div",{style:{...F,fontWeight:r==="expected"?600:"initial"},onClick:()=>o("expected"),children:p}),w.jsx("div",{style:{...F,fontWeight:r==="sxs"?600:"initial"},onClick:()=>o("sxs"),children:"Side by side"}),w.jsx("div",{style:{...F,fontWeight:r==="slider"?600:"initial"},onClick:()=>o("slider"),children:"Slider"})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:q+60},children:[t.diff&&r==="diff"&&w.jsx(En,{image:x,alt:"Diff",hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),t.diff&&r==="actual"&&w.jsx(En,{image:y,alt:"Actual",hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),t.diff&&r==="expected"&&w.jsx(En,{image:u,alt:p,hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),t.diff&&r==="slider"&&w.jsx(OS,{expectedImage:u,actualImage:y,hideSize:n,canvasWidth:z,canvasHeight:q,scale:R,expectedTitle:p}),t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:D*A,canvasHeight:D*U,scale:D}),w.jsx(En,{image:l?x:y,title:l?"Diff":"Actual",onClick:()=>c(!l),hideSize:n,canvasWidth:D*A,canvasHeight:D*U,scale:D})]}),!t.diff&&r==="actual"&&w.jsx(En,{image:y,title:"Actual",hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),!t.diff&&r==="expected"&&w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:z,canvasHeight:q,scale:R}),!t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,canvasWidth:D*A,canvasHeight:D*U,scale:D}),w.jsx(En,{image:y,title:"Actual",canvasWidth:D*A,canvasHeight:D*U,scale:D})]})]}),!n&&w.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[w.jsx("div",{children:t.diff&&w.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},OS=({expectedImage:t,actualImage:e,canvasWidth:n,canvasHeight:r,scale:o,expectedTitle:l,hideSize:c})=>{const u={position:"absolute",top:0,left:0},[d,p]=$.useState(n/2),g=t.naturalWidth===e.naturalWidth&&t.naturalHeight===e.naturalHeight;return w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!c&&w.jsxs("div",{style:{margin:5},children:[!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!g&&w.jsx("span",{children:e.naturalWidth}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!g&&w.jsx("span",{children:e.naturalHeight})]}),w.jsxs("div",{style:{position:"relative",width:n,height:r,margin:15,...Ou},children:[w.jsx(hg,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),w.jsx("img",{alt:l,style:{width:t.naturalWidth*o,height:t.naturalHeight*o},draggable:"false",src:t.src}),w.jsx("div",{style:{...u,bottom:0,overflow:"hidden",width:d,...Ou},children:w.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*o,height:e.naturalHeight*o},draggable:"false",src:e.src})})]})]})},En=({image:t,title:e,alt:n,hideSize:r,canvasWidth:o,canvasHeight:l,scale:c,onClick:u})=>w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&w.jsxs("div",{style:{margin:5},children:[e&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight})]}),w.jsx("div",{style:{display:"flex",flex:"none",width:o,height:l,margin:15,...Ou},children:w.jsx("img",{width:t.naturalWidth*c,height:t.naturalHeight*c,alt:e||n,style:{cursor:u?"pointer":"initial"},draggable:"false",src:t.src,onClick:u})})]}),RS="modulepreload",$S=function(t,e){return new URL(t,e).href},Jp={},DS=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(g=>{if(g=$S(g,r),g in Jp)return;Jp[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(!!r)for(let S=u.length-1;S>=0;S--){const k=u[S];if(k.href===g&&(!y||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${v}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":RS,y||(E.as="script"),E.crossOrigin="",E.href=g,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((S,k)=>{E.addEventListener("load",S),E.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},FS=20,Cs=({text:t,highlighter:e,mimeType:n,linkify:r,readOnly:o,highlight:l,revealLine:c,lineNumbers:u,isFocused:d,focusOnChange:p,wrapLines:g,onChange:y,dataTestId:v,placeholder:x})=>{const[E,S]=jr(),[k]=$.useState(DS(()=>import("./codeMirrorModule-CtpCsWZ5.js"),__vite__mapDeps([0,1]),import.meta.url).then(R=>R.default)),C=$.useRef(null),[A,U]=$.useState();return $.useEffect(()=>{(async()=>{var F,j;const R=await k;zS(R);const D=S.current;if(!D)return;const z=HS(e)||US(n)||(r?"text/linkified":"");if(C.current&&z===C.current.cm.getOption("mode")&&!!o===C.current.cm.getOption("readOnly")&&u===C.current.cm.getOption("lineNumbers")&&g===C.current.cm.getOption("lineWrapping")&&x===C.current.cm.getOption("placeholder"))return;(j=(F=C.current)==null?void 0:F.cm)==null||j.getWrapperElement().remove();const q=R(D,{value:"",mode:z,readOnly:!!o,lineNumbers:u,lineWrapping:g,placeholder:x});return C.current={cm:q},d&&q.focus(),U(q),q})()},[k,A,S,e,n,r,u,g,o,d,x]),$.useEffect(()=>{C.current&&C.current.cm.setSize(E.width,E.height)},[E]),$.useLayoutEffect(()=>{var z;if(!A)return;let R=!1;if(A.getValue()!==t&&(A.setValue(t),R=!0,p&&(A.execCommand("selectAll"),A.focus())),R||JSON.stringify(l)!==JSON.stringify(C.current.highlight)){for(const j of C.current.highlight||[])A.removeLineClass(j.line-1,"wrap");for(const j of l||[])A.addLineClass(j.line-1,"wrap",`source-line-${j.type}`);for(const j of C.current.widgets||[])A.removeLineWidget(j);for(const j of C.current.markers||[])j.clear();const q=[],F=[];for(const j of l||[]){if(j.type!=="subtle-error"&&j.type!=="error")continue;const oe=(z=C.current)==null?void 0:z.cm.getLine(j.line-1);if(oe){const ae={};ae.title=j.message||"",F.push(A.markText({line:j.line-1,ch:0},{line:j.line-1,ch:j.column||oe.length},{className:"source-line-error-underline",attributes:ae}))}if(j.type==="error"){const ae=document.createElement("div");ae.innerHTML=Wi(j.message||""),ae.className="source-line-error-widget",q.push(A.addLineWidget(j.line,ae,{above:!0,coverGutter:!1}))}}C.current.highlight=l,C.current.widgets=q,C.current.markers=F}typeof c=="number"&&C.current.cm.lineCount()>=c&&A.scrollIntoView({line:Math.max(0,c-1),ch:0},50);let D;return y&&(D=()=>y(A.getValue()),A.on("change",D)),()=>{D&&A.off("change",D)}},[A,t,l,c,p,y]),w.jsx("div",{"data-testid":v,className:"cm-wrapper",ref:S,onClick:BS})};function BS(t){var n;if(!(t.target instanceof HTMLElement))return;let e;t.target.classList.contains("cm-linkified")?e=t.target.textContent:t.target.classList.contains("cm-link")&&((n=t.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(e=t.target.nextElementSibling.textContent.slice(1,-1)),e&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}let Xp=!1;function zS(t){Xp||(Xp=!0,t.defineSimpleMode("text/linkified",{start:[{regex:Rm,token:"linkified"}]}))}function US(t){if(t){if(t.includes("javascript")||t.includes("json"))return"javascript";if(t.includes("python"))return"python";if(t.includes("csharp"))return"text/x-csharp";if(t.includes("java"))return"text/x-java";if(t.includes("markdown"))return"markdown";if(t.includes("html")||t.includes("svg"))return"htmlmixed";if(t.includes("css"))return"css"}}function HS(t){if(t)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[t]}function qS(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const VS=({title:t,children:e,setExpanded:n,expanded:r,expandOnTitleClick:o})=>{const l=$.useId();return w.jsxs("div",{className:ze("expandable",r&&"expanded"),children:[w.jsxs("div",{role:"button","aria-expanded":r,"aria-controls":l,className:"expandable-title",onClick:()=>o&&n(!r),children:[w.jsx("div",{className:ze("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!o&&n(!r)}),t]}),r&&w.jsx("div",{id:l,role:"region",style:{marginLeft:25},children:e})]})};function pg(t){const e=[];let n=0,r;for(;(r=Rm.exec(t))!==null;){const l=t.substring(n,r.index);l&&e.push(l);const c=r[0];e.push(WS(c)),n=r.index+c.length}const o=t.substring(n);return o&&e.push(o),e}function WS(t){let e=t;return e.startsWith("www.")&&(e="https://"+e),w.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:t})}const KS=({attachment:t,reveal:e})=>{const[n,r]=$.useState(!1),[o,l]=$.useState(null),[c,u]=$.useState(null),[d,p]=_0(),g=$.useRef(null),y=qS(t.contentType),v=!!t.sha1||!!t.path;$.useEffect(()=>{var S;if(e)return(S=g.current)==null||S.scrollIntoView({behavior:"smooth"}),p()},[e,p]),$.useEffect(()=>{n&&o===null&&c===null&&(u("Loading ..."),fetch(ia(t)).then(S=>S.text()).then(S=>{l(S),u(null)}).catch(S=>{u("Failed to load: "+S.message)}))},[n,o,c,t]);const x=$.useMemo(()=>{const S=o?o.split(`
50
50
  `).length:0;return Math.min(Math.max(5,S),20)*FS},[o]),E=w.jsxs("span",{style:{marginLeft:5},ref:g,"aria-label":t.name,children:[w.jsx("span",{children:pg(t.name)}),v&&w.jsx("a",{style:{marginLeft:5},href:Ml(t),children:"download"})]});return!y||!v?w.jsx("div",{style:{marginLeft:20},children:E}):w.jsxs("div",{className:ze(d&&"yellow-flash"),children:[w.jsx(VS,{title:E,expanded:n,setExpanded:r,expandOnTitleClick:!0,children:c&&w.jsx("i",{children:c})}),n&&o!==null&&w.jsx("div",{className:"vbox",style:{height:x},children:w.jsx(Cs,{text:o,readOnly:!0,mimeType:t.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},GS=({model:t,revealedAttachment:e})=>{const{diffMap:n,screenshots:r,attachments:o}=$.useMemo(()=>{const l=new Set((t==null?void 0:t.visibleAttachments)??[]),c=new Set,u=new Map;for(const d of l){if(!d.path&&!d.sha1)continue;const p=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(p){const g=p[1],y=p[2],v=u.get(g)||{expected:void 0,actual:void 0,diff:void 0};v[y]=d,u.set(g,v),l.delete(d)}else d.contentType.startsWith("image/")&&(c.add(d),l.delete(d))}return{diffMap:u,attachments:l,screenshots:c}},[t]);return!n.size&&!r.size&&!o.size?w.jsx(Pr,{text:"No attachments"}):w.jsxs("div",{className:"attachments-tab",children:[[...n.values()].map(({expected:l,actual:c,diff:u})=>w.jsxs(w.Fragment,{children:[l&&c&&w.jsx("div",{className:"attachments-section",children:"Image diff"}),l&&c&&w.jsx(PS,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...l,path:Ml(l)},title:"Expected"},actual:{attachment:{...c,path:Ml(c)}},diff:u?{attachment:{...u,path:Ml(u)}}:void 0}})]})),r.size?w.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...r.values()].map((l,c)=>{const u=ia(l);return w.jsxs("div",{className:"attachment-item",children:[w.jsx("div",{children:w.jsx("img",{draggable:"false",src:u})}),w.jsx("div",{children:w.jsx("a",{target:"_blank",href:u,rel:"noreferrer",children:l.name})})]},`screenshot-${c}`)}),o.size?w.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...o.values()].map((l,c)=>w.jsx("div",{className:"attachment-item",children:w.jsx(KS,{attachment:l,reveal:e&&QS(l,e[0])?e:void 0})},JS(l,c)))]})};function QS(t,e){return t.name===e.name&&t.path===e.path&&t.sha1===e.sha1}function ia(t,e={}){const n=new URLSearchParams(e);return t.sha1?(n.set("trace",t.traceUrl),"sha1/"+t.sha1+"?"+n.toString()):(n.set("path",t.path),"file?"+n.toString())}function Ml(t){const e={dn:t.name};return t.contentType&&(e.dct=t.contentType),ia(t,e)}function JS(t,e){return e+"-"+(t.sha1?"sha1-"+t.sha1:"path-"+t.path)}const XS=`
51
51
  # Instructions
52
52
 
@@ -253,4 +253,4 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
253
253
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
254
254
  `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var r;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const o="end"in n.value?n.value.end:void 0,l=Array.isArray(o)?o[o.length-1]:void 0;(l==null?void 0:l.type)==="comment"?o==null||o.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const o=e.items[e.items.length-2],l=(r=o==null?void 0:o.value)==null?void 0:r.end;if(Array.isArray(l)){Array.prototype.push.apply(l,n.start),l.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const o=!this.onKeyLine&&this.indent===e.indent,l=o&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(l&&n.sep&&!n.value){const u=[];for(let d=0;d<n.sep.length;++d){const p=n.sep[d];switch(p.type){case"newline":u.push(d);break;case"space":break;case"comment":p.indent>e.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(c=n.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":l||n.value?(c.push(this.sourceToken),e.items.push({start:c}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):l||n.value?(c.push(this.sourceToken),e.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Tr(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(uv(n.key)&&!Tr(n.sep,"newline")){const u=ms(n.start),d=n.key,p=n.sep;p.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:d,sep:p}]})}else c.length>0?n.sep=n.sep.concat(c,this.sourceToken):n.sep.push(this.sourceToken);else if(Tr(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const u=ms(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||l?e.items.push({start:c,key:null,sep:[this.sourceToken]}):Tr(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const u=this.flowScalar(this.type);l||n.value?(e.items.push({start:c,key:u,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(u):(Object.assign(n,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(e);if(u){o&&u.type!=="block-seq"&&e.items.push({start:c}),this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const o="end"in n.value?n.value.end:void 0,l=Array.isArray(o)?o[o.length-1]:void 0;(l==null?void 0:l.type)==="comment"?o==null||o.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const o=e.items[e.items.length-2],l=(r=o==null?void 0:o.value)==null?void 0:r.end;if(Array.isArray(l)){Array.prototype.push.apply(l,n.start),l.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Tr(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const o=this.startBlockValue(e);if(o){this.stack.push(o);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const o=Tl(r),l=ms(o);Im(e);const c=e.end.splice(1,e.end.length);c.push(this.sourceToken);const u={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:l,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
255
255
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
256
- `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Tl(e),r=ms(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Tl(e),r=ms(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function fv(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new cv||null,prettyErrors:e}}function lk(t,e={}){const{lineCounter:n,prettyErrors:r}=fv(e),o=new Bf(n==null?void 0:n.addNewLine),l=new Ff(e),c=Array.from(l.compose(o.parse(t)));if(r&&n)for(const u of c)u.errors.forEach(ea(t,n)),u.warnings.forEach(ea(t,n));return c.length>0?c:Object.assign([],{empty:!0},l.streamInfo())}function dv(t,e={}){const{lineCounter:n,prettyErrors:r}=fv(e),o=new Bf(n==null?void 0:n.addNewLine),l=new Ff(e);let c=null;for(const u of l.compose(o.parse(t),!0,t.length))if(!c)c=u;else if(c.options.logLevel!=="silent"){c.errors.push(new Ar(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(c.errors.forEach(ea(t,n)),c.warnings.forEach(ea(t,n))),c}function ak(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);const o=dv(t,n);if(!o)return null;if(o.warnings.forEach(l=>My(o.options.logLevel,l)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function ck(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){const{keepUndefined:o}=n??e??{};if(!o)return}return Rr(t)&&!r?t.toString(n):new Fs(t,r,n).toString(n)}const hv=Object.freeze(Object.defineProperty({__proto__:null,Alias:ca,CST:sk,Composer:Ff,Document:Fs,Lexer:av,LineCounter:cv,Pair:ct,Parser:Bf,Scalar:ue,Schema:va,YAMLError:$f,YAMLMap:Lt,YAMLParseError:Ar,YAMLSeq:nr,YAMLWarning:Xy,isAlias:Or,isCollection:Re,isDocument:Rr,isMap:Os,isNode:$e,isPair:je,isScalar:Te,isSeq:Rs,parse:ak,parseAllDocuments:lk,parseDocument:dv,stringify:ck,visit:tr,visitAsync:aa},Symbol.toStringTag,{value:"Module"})),uk=({action:t,sdkLanguage:e,testIdAttributeName:n,isInspecting:r,setIsInspecting:o,highlightedElement:l,setHighlightedElement:c})=>{const[u,d]=$.useState("action"),[p]=Nn("shouldPopulateCanvasFromScreenshot",!1),g=$.useMemo(()=>pk(t),[t]),{snapshotInfoUrl:y,snapshotUrl:v,popoutUrl:x}=$.useMemo(()=>{const S=g[u];return S?mk(S,p):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[g,u,p]),E=$.useMemo(()=>y!==void 0?{snapshotInfoUrl:y,snapshotUrl:v,popoutUrl:x}:void 0,[y,v,x]);return w.jsxs("div",{className:"snapshot-tab vbox",children:[w.jsxs(rf,{children:[w.jsx(Ht,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:r,onClick:()=>o(!r)}),["action","before","after"].map(S=>w.jsx(yg,{id:S,title:hk(S),selected:u===S,onSelect:()=>d(S)},S)),w.jsx("div",{style:{flex:"auto"}}),w.jsx(Ht,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(E!=null&&E.popoutUrl),onClick:()=>{const S=window.open((E==null?void 0:E.popoutUrl)||"","_blank");S==null||S.addEventListener("DOMContentLoaded",()=>{new gy(S,{isUnderTest:mv,sdkLanguage:e,testIdAttributeName:n,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),w.jsx(fk,{snapshotUrls:E,sdkLanguage:e,testIdAttributeName:n,isInspecting:r,setIsInspecting:o,highlightedElement:l,setHighlightedElement:c})]})},fk=({snapshotUrls:t,sdkLanguage:e,testIdAttributeName:n,isInspecting:r,setIsInspecting:o,highlightedElement:l,setHighlightedElement:c})=>{const u=$.useRef(null),d=$.useRef(null),[p,g]=$.useState({viewport:gv,url:""}),y=$.useRef({iteration:0,visibleIframe:0});return $.useEffect(()=>{(async()=>{const v=y.current.iteration+1,x=1-y.current.visibleIframe;y.current.iteration=v;const E=await gk(t==null?void 0:t.snapshotInfoUrl);if(y.current.iteration!==v)return;const S=[u,d][x].current;if(S){let k=()=>{};const C=new Promise(A=>k=A);try{S.addEventListener("load",k),S.addEventListener("error",k);const A=(t==null?void 0:t.snapshotUrl)||yk;S.contentWindow?S.contentWindow.location.replace(A):S.src=A,await C}catch{}finally{S.removeEventListener("load",k),S.removeEventListener("error",k)}}y.current.iteration===v&&(y.current.visibleIframe=x,g(E))})()},[t]),w.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:v=>{v.key==="Escape"&&r&&o(!1)},children:[w.jsx(Lm,{isInspecting:r,sdkLanguage:e,testIdAttributeName:n,highlightedElement:l,setHighlightedElement:c,iframe:u.current,iteration:y.current.iteration}),w.jsx(Lm,{isInspecting:r,sdkLanguage:e,testIdAttributeName:n,highlightedElement:l,setHighlightedElement:c,iframe:d.current,iteration:y.current.iteration}),w.jsx(dk,{snapshotInfo:p,children:w.jsxs("div",{className:"snapshot-switcher",children:[w.jsx("iframe",{ref:u,name:"snapshot",title:"DOM Snapshot",className:ze(y.current.visibleIframe===0&&"snapshot-visible")}),w.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",className:ze(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},dk=({snapshotInfo:t,children:e})=>{const[n,r]=jr(),l={width:t.viewport.width,height:t.viewport.height+40},c=Math.min(n.width/l.width,n.height/l.height,1),u={x:(n.width-l.width)/2,y:(n.height-l.height)/2};return w.jsx("div",{ref:r,className:"snapshot-wrapper",children:w.jsxs("div",{className:"snapshot-container",style:{width:l.width+"px",height:l.height+"px",transform:`translate(${u.x}px, ${u.y}px) scale(${c})`},children:[w.jsx(eE,{url:t.url}),e]})})};function hk(t){return t==="before"?"Before":t==="after"?"After":t==="action"?"Action":t}const Lm=({iframe:t,isInspecting:e,sdkLanguage:n,testIdAttributeName:r,highlightedElement:o,setHighlightedElement:l,iteration:c})=>($.useEffect(()=>{const u=o.lastEdited==="ariaSnapshot"?o.ariaSnapshot:void 0,d=o.lastEdited==="locator"?o.locator:void 0,p=!!u||!!d||e,g=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{pv(g,p,n,r,y,"",t==null?void 0:t.contentWindow)}catch{}const v=u?sf(hv,u):void 0,x=d?Y_(n,d,r):void 0;for(const{recorder:E,frameSelector:S}of g){const k=x!=null&&x.startsWith(S)?x.substring(S.length).trim():void 0,C=(v==null?void 0:v.errors.length)===0?v.fragment:void 0;E.setUIState({mode:e?"inspecting":"none",actionSelector:k,ariaTemplate:C,language:n,testIdAttributeName:r,overlay:{offsetX:0}},{async elementPicked(A){l({locator:Lr(n,S+A.selector),ariaSnapshot:A.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const A of g)A.recorder!==E&&A.recorder.clearHighlight()}})}},[t,e,o,l,n,r,c]),w.jsx(w.Fragment,{}));function pv(t,e,n,r,o,l,c){if(!c)return;const u=c;if(!u._recorder&&e){const d=new gy(c,{isUnderTest:o,sdkLanguage:n,testIdAttributeName:r,stableRafCount:1,browserName:"chromium",customEngines:[]}),p=new V_(d);u._injectedScript=d,u._recorder={recorder:p,frameSelector:l},o&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(p)))}u._recorder&&t.push(u._recorder);for(let d=0;d<c.frames.length;++d){const p=c.frames[d],g=p.frameElement?u._injectedScript.generateSelectorSimple(p.frameElement,{omitInternalEngines:!0,testIdAttributeName:r})+" >> internal:control=enter-frame >> ":"";pv(t,e,n,r,o,l+g,p)}}function pk(t){if(!t)return{};let e=t.beforeSnapshot?{action:t,snapshotName:t.beforeSnapshot}:void 0;if(!e){for(let o=$p(t);o;o=$p(o))if(o.endTime<=t.startTime&&o.afterSnapshot){e={action:o,snapshotName:o.afterSnapshot};break}}let n=t.afterSnapshot?{action:t,snapshotName:t.afterSnapshot}:void 0;if(!n){let o;for(let l=Dp(t);l&&l.startTime<=t.endTime;l=Dp(l))l.endTime>t.endTime||!l.afterSnapshot||o&&o.endTime>l.endTime||(o=l);o?n={action:o,snapshotName:o.afterSnapshot}:n=e}const r=t.inputSnapshot?{action:t,snapshotName:t.inputSnapshot,hasInputTarget:!0}:n;return r&&(r.point=t.point),{action:r,before:e,after:n}}const mv=new URLSearchParams(window.location.search).has("isUnderTest"),Mm=new URLSearchParams(window.location.search).get("server");function mk(t,e){const n=new URLSearchParams;n.set("trace",zl(t.action).traceUrl),n.set("name",t.snapshotName),mv&&n.set("isUnderTest","true"),t.point&&(n.set("pointX",String(t.point.x)),n.set("pointY",String(t.point.y)),t.hasInputTarget&&n.set("hasInputTarget","1")),e&&n.set("shouldPopulateCanvasFromScreenshot","1");const r=new URL(`snapshot/${t.action.pageId}?${n.toString()}`,window.location.href).toString(),o=new URL(`snapshotInfo/${t.action.pageId}?${n.toString()}`,window.location.href).toString(),l=new URLSearchParams;l.set("r",r),Mm&&l.set("server",Mm),l.set("trace",zl(t.action).traceUrl),t.point&&(l.set("pointX",String(t.point.x)),l.set("pointY",String(t.point.y)),t.hasInputTarget&&n.set("hasInputTarget","1"));const c=new URL(`snapshot.html?${l.toString()}`,window.location.href).toString();return{snapshotInfoUrl:o,snapshotUrl:r,popoutUrl:c}}async function gk(t){const e={url:"",viewport:gv,timestamp:void 0,wallTime:void 0};if(t){const r=await(await fetch(t)).json();r.error||(e.url=r.url,e.viewport=r.viewport,e.timestamp=r.timestamp,e.wallTime=r.wallTime)}return e}const gv={width:1280,height:720},yk='data:text/html,<body style="background: #ddd"></body>',yv={width:200,height:45},ys=2.5,vk=yv.height+ys*2,wk=({model:t,boundaries:e,previewPoint:n})=>{var g,y;const[r,o]=jr(),l=$.useRef(null);let c=0;if(l.current&&n){const v=l.current.getBoundingClientRect();c=(n.clientY-v.top+l.current.scrollTop)/vk|0}const u=(y=(g=t==null?void 0:t.pages)==null?void 0:g[c])==null?void 0:y.screencastFrames;let d,p;if(n!==void 0&&u&&u.length){const v=e.minimum+(e.maximum-e.minimum)*n.x/r.width;d=u[Pm(u,v,vv)-1];const x={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};p=d?wv({width:d.width,height:d.height},x):void 0}return w.jsxs("div",{className:"film-strip",ref:o,children:[w.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((v,x)=>v.screencastFrames.length?w.jsx(Sk,{boundaries:e,page:v,width:r.width},x):null)}),(n==null?void 0:n.x)!==void 0&&w.jsxs("div",{className:"film-strip-hover",style:{top:r.bottom+5,left:Math.min(n.x,r.width-(p?p.width:0)-10)},children:[n.action&&w.jsx("div",{className:"film-strip-hover-title",children:tf(n.action,n)}),d&&p&&w.jsx("div",{style:{width:p.width,height:p.height},children:w.jsx("img",{src:`sha1/${d.sha1}`,width:p.width,height:p.height})})]})]})},Sk=({boundaries:t,page:e,width:n})=>{const r={width:0,height:0},o=e.screencastFrames;for(const S of o)r.width=Math.max(r.width,S.width),r.height=Math.max(r.height,S.height);const l=wv(r,yv),c=o[0].timestamp,u=o[o.length-1].timestamp,d=t.maximum-t.minimum,p=(c-t.minimum)/d*n,g=(t.maximum-u)/d*n,v=(u-c)/d*n/(l.width+2*ys)|0,x=(u-c)/v,E=[];for(let S=0;c&&x&&S<v;++S){const k=c+x*S,C=Pm(o,k,vv)-1;E.push(w.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${o[C].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:ys,marginRight:ys}},S))}return E.push(w.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${o[o.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:ys,marginRight:ys}},E.length)),w.jsx("div",{className:"film-strip-lane",style:{marginLeft:p+"px",marginRight:g+"px"},children:E})};function vv(t,e){return t-e.timestamp}function wv(t,e){const n=Math.max(t.width/e.width,t.height/e.height);return{width:t.width/n|0,height:t.height/n|0}}const xk=({model:t,boundaries:e,consoleEntries:n,onSelected:r,highlightedAction:o,highlightedEntry:l,highlightedConsoleEntry:c,selectedTime:u,setSelectedTime:d,sdkLanguage:p})=>{const[g,y]=jr(),[v,x]=$.useState(),[E,S]=$.useState(),[k]=Nn("actionsFilter",[]),{offsets:C,curtainLeft:A,curtainRight:U}=$.useMemo(()=>{let M=u||e;if(v&&v.startX!==v.endX){const pe=un(g.width,e,v.startX),ge=un(g.width,e,v.endX);M={minimum:Math.min(pe,ge),maximum:Math.max(pe,ge)}}const H=Ft(g.width,e,M.minimum),xe=Ft(g.width,e,e.maximum)-Ft(g.width,e,M.maximum);return{offsets:_k(g.width,e),curtainLeft:H,curtainRight:xe}},[u,e,v,g]),R=$.useMemo(()=>t==null?void 0:t.filteredActions(k),[t,k]),D=$.useMemo(()=>{const M=[];for(const H of R||[])H.class!=="Test"&&M.push({action:H,leftTime:H.startTime,rightTime:H.endTime||e.maximum,leftPosition:Ft(g.width,e,H.startTime),rightPosition:Ft(g.width,e,H.endTime||e.maximum),active:!1,error:!!H.error});for(const H of(t==null?void 0:t.resources)||[]){const fe=H._monotonicTime,xe=H._monotonicTime+H.time;M.push({resource:H,leftTime:fe,rightTime:xe,leftPosition:Ft(g.width,e,fe),rightPosition:Ft(g.width,e,xe),active:!1,error:!1})}for(const H of n||[])M.push({consoleMessage:H,leftTime:H.timestamp,rightTime:H.timestamp,leftPosition:Ft(g.width,e,H.timestamp),rightPosition:Ft(g.width,e,H.timestamp),active:!1,error:H.isError});return M},[t,R,n,e,g]);$.useMemo(()=>{for(const M of D)o?M.active=M.action===o:l?M.active=M.resource===l:c?M.active=M.consoleMessage===c:M.active=!1},[D,o,l,c]);const z=$.useCallback(M=>{if(S(void 0),!y.current)return;const H=M.clientX-y.current.getBoundingClientRect().left,fe=un(g.width,e,H),xe=u?Ft(g.width,e,u.minimum):0,pe=u?Ft(g.width,e,u.maximum):0;u&&Math.abs(H-xe)<10?x({startX:pe,endX:H,type:"resize"}):u&&Math.abs(H-pe)<10?x({startX:xe,endX:H,type:"resize"}):u&&fe>u.minimum&&fe<u.maximum&&M.clientY-y.current.getBoundingClientRect().top<20?x({startX:xe,endX:pe,pivot:H,type:"move"}):x({startX:H,endX:H,type:"resize"})},[e,g,y,u]),q=$.useCallback(M=>{if(!y.current)return;const H=M.clientX-y.current.getBoundingClientRect().left,fe=un(g.width,e,H),xe=R==null?void 0:R.findLast(ne=>ne.startTime<=fe);if(!M.buttons){x(void 0);return}if(xe&&r(xe),!v)return;let pe=v;if(v.type==="resize")pe={...v,endX:H};else{const ne=H-v.pivot;let J=v.startX+ne,I=v.endX+ne;J<0&&(J=0,I=J+(v.endX-v.startX)),I>g.width&&(I=g.width,J=I-(v.endX-v.startX)),pe={...v,startX:J,endX:I,pivot:H}}x(pe);const ge=un(g.width,e,pe.startX),Q=un(g.width,e,pe.endX);ge!==Q&&d({minimum:Math.min(ge,Q),maximum:Math.max(ge,Q)})},[e,v,g,R,r,y,d]),F=$.useCallback(()=>{if(S(void 0),!!v){if(v.startX!==v.endX){const M=un(g.width,e,v.startX),H=un(g.width,e,v.endX);d({minimum:Math.min(M,H),maximum:Math.max(M,H)})}else{const M=un(g.width,e,v.startX),H=R==null?void 0:R.findLast(fe=>fe.startTime<=M);H&&r(H),d(void 0)}x(void 0)}},[e,v,g,R,d,r]),j=$.useCallback(M=>{if(!y.current)return;const H=M.clientX-y.current.getBoundingClientRect().left,fe=un(g.width,e,H),xe=R==null?void 0:R.findLast(pe=>pe.startTime<=fe);S({x:H,clientY:M.clientY,action:xe,sdkLanguage:p})},[e,g,R,y,p]),oe=$.useCallback(()=>{S(void 0)},[]),ae=$.useCallback(()=>{d(void 0)},[d]);return w.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!v&&w.jsx(dg,{cursor:(v==null?void 0:v.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:F,onPaneMouseMove:q,onPaneDoubleClick:ae}),w.jsxs("div",{ref:y,className:"timeline-view",onMouseDown:z,onMouseMove:j,onMouseLeave:oe,children:[w.jsx("div",{className:"timeline-grid",children:C.map((M,H)=>w.jsx("div",{className:"timeline-divider",style:{left:M.position+"px"},children:w.jsx("div",{className:"timeline-time",children:pt(M.time-e.minimum)})},H))}),w.jsx("div",{style:{height:8}}),w.jsx(wk,{model:t,boundaries:e,previewPoint:E}),w.jsx("div",{className:"timeline-bars",children:D.map((M,H)=>w.jsx("div",{className:ze("timeline-bar",M.action&&"action",M.resource&&"network",M.consoleMessage&&"console-message",M.active&&"active",M.error&&"error"),style:{left:M.leftPosition,width:Math.max(5,M.rightPosition-M.leftPosition),top:Ek(M),bottom:0}},H))}),w.jsx("div",{className:"timeline-marker",style:{display:E!==void 0?"block":"none",left:((E==null?void 0:E.x)||0)+"px"}}),u&&w.jsxs("div",{className:"timeline-window",children:[w.jsx("div",{className:"timeline-window-curtain left",style:{width:A}}),w.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),w.jsx("div",{className:"timeline-window-center",children:w.jsx("div",{className:"timeline-window-drag"})}),w.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),w.jsx("div",{className:"timeline-window-curtain right",style:{width:U}})]})]})]})};function _k(t,e){let r=t/64;const o=e.maximum-e.minimum,l=t/o;let c=o/r;const u=Math.ceil(Math.log(c)/Math.LN10);c=Math.pow(10,u),c*l>=5*64&&(c=c/5),c*l>=2*64&&(c=c/2);const d=e.minimum;let p=e.maximum;p+=64/l,r=Math.ceil((p-d)/c),c||(r=0);const g=[];for(let y=0;y<r;++y){const v=d+c*y;g.push({position:Ft(t,e,v),time:v})}return g}function Ft(t,e,n){return(n-e.minimum)/(e.maximum-e.minimum)*t}function un(t,e,n){return n/t*(e.maximum-e.minimum)+e.minimum}function Ek(t){return t.resource?25:20}const kk=({model:t})=>{var n,r;if(!t)return w.jsx(w.Fragment,{});const e=t.wallTime!==void 0?new Date(t.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return w.jsxs("div",{className:"vbox",style:{flexShrink:0},children:[w.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&w.jsxs("div",{className:"call-line",children:["start time:",w.jsx("span",{className:"call-value datetime",title:e,children:e})]}),w.jsxs("div",{className:"call-line",children:["duration:",w.jsx("span",{className:"call-value number",title:pt(t.endTime-t.startTime),children:pt(t.endTime-t.startTime)})]}),w.jsx("div",{className:"call-section",children:"Browser"}),w.jsxs("div",{className:"call-line",children:["engine:",w.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&w.jsxs("div",{className:"call-line",children:["channel:",w.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&w.jsxs("div",{className:"call-line",children:["platform:",w.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&w.jsxs("div",{className:"call-line",children:["user agent:",w.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),w.jsxs("div",{className:"call-line",children:["baseURL:",w.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),w.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&w.jsxs("div",{className:"call-line",children:["width:",w.jsx("span",{className:"call-value number",title:String(!!((n=t.options.viewport)!=null&&n.width)),children:t.options.viewport.width})]}),t.options.viewport&&w.jsxs("div",{className:"call-line",children:["height:",w.jsx("span",{className:"call-value number",title:String(!!((r=t.options.viewport)!=null&&r.height)),children:t.options.viewport.height})]}),w.jsxs("div",{className:"call-line",children:["is mobile:",w.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&w.jsxs("div",{className:"call-line",children:["device scale:",w.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),w.jsx("div",{className:"call-section",children:"Counts"}),w.jsxs("div",{className:"call-line",children:["pages:",w.jsx("span",{className:"call-value number",children:t.pages.length})]}),w.jsxs("div",{className:"call-line",children:["actions:",w.jsx("span",{className:"call-value number",children:t.actions.length})]}),w.jsxs("div",{className:"call-line",children:["events:",w.jsx("span",{className:"call-value number",children:t.events.length})]})]})},bk=({annotations:t})=>t.length?w.jsx("div",{className:"annotations-tab",children:t.map((e,n)=>w.jsxs("div",{className:"annotation-item",children:[w.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&w.jsxs("span",{children:[": ",pg(e.description)]})]},`annotation-${n}`))}):w.jsx(Pr,{text:"No annotations"}),Tk=({sdkLanguage:t,setIsInspecting:e,highlightedElement:n,setHighlightedElement:r})=>{const[o,l]=$.useState(),c=$.useCallback(u=>{const{errors:d}=sf(hv,u,{prettyErrors:!1}),p=d.map(g=>({message:g.message,line:g.range[1].line,column:g.range[1].col,type:"subtle-error"}));l(p),r({...n,ariaSnapshot:u,lastEdited:"ariaSnapshot"}),e(!1)},[n,r,e]);return w.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[w.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[w.jsx("div",{style:{flex:"auto"},children:"Locator"}),w.jsx(Ht,{icon:"files",title:"Copy locator",onClick:()=>{Np(n.locator||"")}})]}),w.jsx("div",{style:{height:50},children:w.jsx(Cs,{text:n.locator||"",highlighter:t,isFocused:!0,wrapLines:!0,onChange:u=>{r({...n,locator:u,lastEdited:"locator"}),e(!1)}})}),w.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[w.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),w.jsx(Ht,{icon:"files",title:"Copy snapshot",onClick:()=>{Np(n.ariaSnapshot||"")}})]}),w.jsx("div",{style:{height:150},children:w.jsx(Cs,{text:n.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:o,onChange:c})})]})},Ok=({model:t,showSourcesFirst:e,rootDir:n,fallbackLocation:r,isLive:o,hideTimeline:l,status:c,annotations:u,inert:d,onOpenExternally:p,revealSource:g,testRunMetadata:y})=>{var lo;const[v,x]=$.useState(void 0),[E,S]=$.useState(void 0),[k,C]=$.useState(void 0),[A,U]=$.useState(),[R,D]=$.useState(),[z,q]=$.useState(),[F,j]=$.useState("actions"),[oe,ae]=Nn("propertiesTab",e?"source":"call"),[M,H]=$.useState(!1),[fe,xe]=$.useState({lastEdited:"none"}),[pe,ge]=$.useState(),[Q,ne]=Nn("propertiesSidebarLocation","bottom"),[J]=Nn("actionsFilter",[]),I=$.useCallback(ie=>{x(ie==null?void 0:ie.callId),S(void 0)},[]),B=$.useMemo(()=>t==null?void 0:t.filteredActions(J),[t,J]),ce=$.useMemo(()=>B==null?void 0:B.find(ie=>ie.callId===A),[B,A]),de=$.useCallback(ie=>{U(ie==null?void 0:ie.callId)},[]),ye=$.useMemo(()=>(t==null?void 0:t.sources)||new Map,[t]);$.useEffect(()=>{ge(void 0),S(void 0)},[t]);const me=$.useMemo(()=>{if(v){const Vt=B==null?void 0:B.find(Wt=>Wt.callId===v);if(Vt)return Vt}const ie=t==null?void 0:t.failedAction();if(ie)return ie;if(B!=null&&B.length){let Vt=B.length-1;for(let Wt=0;Wt<B.length;++Wt)if(B[Wt].title==="After Hooks"&&Wt){Vt=Wt-1;break}return B[Vt]}},[t,B,v]),ve=$.useMemo(()=>ce||me,[me,ce]),_e=$.useMemo(()=>E?E.stack:ve==null?void 0:ve.stack,[ve,E]),ke=$.useCallback(ie=>{I(ie),de(void 0)},[I,de]),Ne=$.useCallback(ie=>{ae(ie),ie!=="inspector"&&H(!1)},[ae]),sr=$.useCallback(ie=>{!M&&ie&&Ne("inspector"),H(ie)},[H,Ne,M]),no=$.useCallback(ie=>{xe(ie),Ne("inspector")},[Ne]),$r=$.useCallback(ie=>{Ne("attachments"),C(Vt=>{if(!Vt)return[ie,0];const Wt=Vt[1];return[ie,Wt+1]})},[Ne]);$.useEffect(()=>{g&&Ne("source")},[g,Ne]);const ir=f1(t,pe),Bs=R1(t,pe),zs=o1(t),rn=(t==null?void 0:t.sdkLanguage)||"javascript",ro={id:"inspector",title:"Locator",render:()=>w.jsx(Tk,{sdkLanguage:rn,setIsInspecting:sr,highlightedElement:fe,setHighlightedElement:xe})},Us={id:"call",title:"Call",render:()=>w.jsx(TS,{action:ve,startTimeOffset:(t==null?void 0:t.startTime)??0,sdkLanguage:rn})},or={id:"log",title:"Log",render:()=>w.jsx(AS,{action:ve,isLive:o})},In={id:"errors",title:"Errors",errorCount:zs.errors.size,render:()=>w.jsx(a1,{errorsModel:zs,model:t,testRunMetadata:y,sdkLanguage:rn,revealInSource:ie=>{ie.action?I(ie.action):S(ie),Ne("source")},wallTime:(t==null?void 0:t.wallTime)??0})};let Dr;!me&&r&&(Dr=(lo=r.source)==null?void 0:lo.errors.length);const Fr={id:"source",title:"Source",errorCount:Dr,render:()=>w.jsx(r1,{stack:_e,sources:ye,rootDir:n,stackFrameLocation:Q==="bottom"?"right":"bottom",fallbackLocation:r,onOpenExternally:p})},so={id:"console",title:"Console",count:ir.entries.length,render:()=>w.jsx(d1,{consoleModel:ir,boundaries:Ln,selectedTime:pe,onAccepted:ie=>ge({minimum:ie.timestamp,maximum:ie.timestamp}),onEntryHovered:q})},io={id:"network",title:"Network",count:Bs.resources.length,render:()=>w.jsx($1,{boundaries:Ln,networkModel:Bs,onEntryHovered:D,sdkLanguage:(t==null?void 0:t.sdkLanguage)??"javascript"})},oo={id:"attachments",title:"Attachments",count:t==null?void 0:t.visibleAttachments.length,render:()=>w.jsx(GS,{model:t,revealedAttachment:k})},hn=[ro,Us,or,In,so,io,Fr,oo];if(u!==void 0){const ie={id:"annotations",title:"Annotations",count:u.length,render:()=>w.jsx(bk,{annotations:u})};hn.push(ie)}if(e){const ie=hn.indexOf(Fr);hn.splice(ie,1),hn.splice(1,0,Fr)}const{boundaries:Ln}=$.useMemo(()=>{const ie={minimum:(t==null?void 0:t.startTime)||0,maximum:(t==null?void 0:t.endTime)||3e4};return ie.minimum>ie.maximum&&(ie.minimum=0,ie.maximum=3e4),ie.maximum+=(ie.maximum-ie.minimum)/20,{boundaries:ie}},[t]);let lr=0;!o&&t&&t.endTime>=0?lr=t.endTime-t.startTime:t&&t.wallTime&&(lr=Date.now()-t.wallTime);const ar={id:"actions",title:"Actions",component:w.jsxs("div",{className:"vbox",children:[c&&w.jsxs("div",{className:"workbench-run-status",children:[w.jsx("span",{className:ze("codicon",fg(c))}),w.jsx("div",{children:_S(c)}),w.jsx("div",{className:"spacer"}),w.jsx("div",{className:"workbench-run-duration",children:lr?pt(lr):""})]}),w.jsx(kS,{sdkLanguage:rn,actions:B||[],selectedAction:t?me:void 0,selectedTime:pe,setSelectedTime:ge,onSelected:ke,onHighlighted:de,revealAttachment:$r,revealConsole:()=>Ne("console"),isLive:o})]})},cr={id:"metadata",title:"Metadata",component:w.jsx(kk,{model:t})};return w.jsxs("div",{className:"vbox workbench",...d?{inert:"true"}:{},children:[!l&&w.jsx(xk,{model:t,consoleEntries:ir.entries,boundaries:Ln,highlightedAction:ce,highlightedEntry:R,highlightedConsoleEntry:z,onSelected:ke,sdkLanguage:rn,selectedTime:pe,setSelectedTime:ge}),w.jsx(Ul,{sidebarSize:250,orientation:Q==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:w.jsx(Ul,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:w.jsx(uk,{action:ve,model:t,sdkLanguage:rn,testIdAttributeName:(t==null?void 0:t.testIdAttributeName)||"data-testid",isInspecting:M,setIsInspecting:sr,highlightedElement:fe,setHighlightedElement:no}),sidebar:w.jsx(Ru,{tabs:[ar,cr],selectedTab:F,setSelectedTab:j})}),sidebar:w.jsx(Ru,{tabs:hn,selectedTab:oe,setSelectedTab:Ne,rightToolbar:[Q==="bottom"?w.jsx(Ht,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{ne("right")}}):w.jsx(Ht,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{ne("bottom")}})],mode:Q==="bottom"?"default":"select"})})]})};var jm;(t=>{function e(n){for(const r of n.splice(0))r.dispose()}t.disposeAll=e})(jm||(jm={}));class Mi{constructor(){this._listeners=new Set,this.event=(e,n)=>{this._listeners.add(e);let r=!1;const o=this,l={dispose(){r||(r=!0,o._listeners.delete(e))}};return n&&n.push(l),l}}fire(e){const n=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const r of this._listeners)this._deliveryQueue.push({listener:r,event:e});if(n){for(let r=0;r<this._deliveryQueue.length;r++){const{listener:o,event:l}=this._deliveryQueue[r];o.call(null,l)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class Rk{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",n=>e(n.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class $k{constructor(e){this._onCloseEmitter=new Mi,this._onReportEmitter=new Mi,this._onStdioEmitter=new Mi,this._onTestFilesChangedEmitter=new Mi,this._onLoadTraceRequestedEmitter=new Mi,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this._transport=e,this._transport.onmessage(r=>{const o=JSON.parse(r),{id:l,result:c,error:u,method:d,params:p}=o;if(l){const g=this._callbacks.get(l);if(!g)return;this._callbacks.delete(l),u?g.reject(new Error(u)):g.resolve(c)}else this._dispatchEvent(d,p)});const n=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((r,o)=>{this._transport.onopen(r),this._transport.onerror(o)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(n)})}isClosed(){return this._isClosed}async _sendMessage(e,n){const r=globalThis.__logForTest;r==null||r({method:e,params:n}),await this._connectedPromise;const o=++this._lastId,l={id:o,method:e,params:n};return this._transport.send(JSON.stringify(l)),new Promise((c,u)=>{this._callbacks.set(o,{resolve:c,reject:u})})}_sendMessageNoReply(e,n){this._sendMessage(e,n).catch(()=>{})}_dispatchEvent(e,n){e==="report"?this._onReportEmitter.fire(n):e==="stdio"?this._onStdioEmitter.fire(n):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(n):e==="loadTraceRequested"&&this._onLoadTraceRequestedEmitter.fire(n)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async startDevServer(e){return await this._sendMessage("startDevServer",e)}async stopDevServer(e){return await this._sendMessage("stopDevServer",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const Ck=({settings:t})=>w.jsx("div",{className:"vbox settings-view",children:t.map(e=>{const n=`setting-${e.name}`;return w.jsx("div",{className:"setting",title:e.title,children:Nk(e,n)},e.name)})}),Nk=(t,e)=>{switch(t.type){case"check":return w.jsxs(w.Fragment,{children:[w.jsx("input",{type:"checkbox",id:e,checked:t.value,onChange:()=>t.set(!t.value)}),w.jsx("label",{htmlFor:e,children:t.name})]});case"select":return w.jsxs(w.Fragment,{children:[w.jsx("label",{htmlFor:e,children:t.name}),w.jsx("select",{id:e,value:t.value,onChange:n=>t.set(n.target.value),children:t.options.map(n=>w.jsx("option",{value:n.value,children:n.label},n.value))})]});default:return null}},Dk=()=>{const[t,e]=Nn("shouldPopulateCanvasFromScreenshot",!1),[n,r]=Nn("actionsFilter",[]),[o,l]=k0();return w.jsx(Ck,{settings:[{type:"check",value:o,set:l,name:"Dark mode"},{type:"check",value:t,set:e,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."},{type:"check",value:n.includes("getter"),set:c=>r(c?[...n,"getter"]:n.filter(u=>u!=="getter")),name:"Show getter actions"},{type:"check",value:n.includes("route"),set:c=>r(c?[...n,"route"]:n.filter(u=>u!=="route")),name:"Show route actions"},{type:"check",value:n.includes("configuration"),set:c=>r(c?[...n,"configuration"]:n.filter(u=>u!=="configuration")),name:"Show configuration actions"}]})};export{Dk as D,VS as E,Pk as M,Mt as R,Ul as S,Ht as T,Rk as W,DS as _,$k as a,Ok as b,Ik as c,jk as d,Mu as e,Lk as f,Mk as g,ze as h,SS as i,w as j,rf as k,Nn as l,pt as m,Ck as n,g0 as o,$ as r,kr as s,fg as t,jr as u};
256
+ `,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Tl(e),r=ms(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Tl(e),r=ms(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function fv(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new cv||null,prettyErrors:e}}function lk(t,e={}){const{lineCounter:n,prettyErrors:r}=fv(e),o=new Bf(n==null?void 0:n.addNewLine),l=new Ff(e),c=Array.from(l.compose(o.parse(t)));if(r&&n)for(const u of c)u.errors.forEach(ea(t,n)),u.warnings.forEach(ea(t,n));return c.length>0?c:Object.assign([],{empty:!0},l.streamInfo())}function dv(t,e={}){const{lineCounter:n,prettyErrors:r}=fv(e),o=new Bf(n==null?void 0:n.addNewLine),l=new Ff(e);let c=null;for(const u of l.compose(o.parse(t),!0,t.length))if(!c)c=u;else if(c.options.logLevel!=="silent"){c.errors.push(new Ar(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(c.errors.forEach(ea(t,n)),c.warnings.forEach(ea(t,n))),c}function ak(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);const o=dv(t,n);if(!o)return null;if(o.warnings.forEach(l=>My(o.options.logLevel,l)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function ck(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){const o=Math.round(n);n=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){const{keepUndefined:o}=n??e??{};if(!o)return}return Rr(t)&&!r?t.toString(n):new Fs(t,r,n).toString(n)}const hv=Object.freeze(Object.defineProperty({__proto__:null,Alias:ca,CST:sk,Composer:Ff,Document:Fs,Lexer:av,LineCounter:cv,Pair:ct,Parser:Bf,Scalar:ue,Schema:va,YAMLError:$f,YAMLMap:Lt,YAMLParseError:Ar,YAMLSeq:nr,YAMLWarning:Xy,isAlias:Or,isCollection:Re,isDocument:Rr,isMap:Os,isNode:$e,isPair:je,isScalar:Te,isSeq:Rs,parse:ak,parseAllDocuments:lk,parseDocument:dv,stringify:ck,visit:tr,visitAsync:aa},Symbol.toStringTag,{value:"Module"})),uk=({action:t,sdkLanguage:e,testIdAttributeName:n,isInspecting:r,setIsInspecting:o,highlightedElement:l,setHighlightedElement:c})=>{const[u,d]=$.useState("action"),[p]=Nn("shouldPopulateCanvasFromScreenshot",!1),g=$.useMemo(()=>pk(t),[t]),{snapshotInfoUrl:y,snapshotUrl:v,popoutUrl:x}=$.useMemo(()=>{const S=g[u];return S?mk(S,p):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[g,u,p]),E=$.useMemo(()=>y!==void 0?{snapshotInfoUrl:y,snapshotUrl:v,popoutUrl:x}:void 0,[y,v,x]);return w.jsxs("div",{className:"snapshot-tab vbox",children:[w.jsxs(rf,{children:[w.jsx(Ht,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:r,onClick:()=>o(!r)}),["action","before","after"].map(S=>w.jsx(yg,{id:S,title:hk(S),selected:u===S,onSelect:()=>d(S)},S)),w.jsx("div",{style:{flex:"auto"}}),w.jsx(Ht,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(E!=null&&E.popoutUrl),onClick:()=>{const S=window.open((E==null?void 0:E.popoutUrl)||"","_blank");S==null||S.addEventListener("DOMContentLoaded",()=>{new gy(S,{isUnderTest:mv,sdkLanguage:e,testIdAttributeName:n,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),w.jsx(fk,{snapshotUrls:E,sdkLanguage:e,testIdAttributeName:n,isInspecting:r,setIsInspecting:o,highlightedElement:l,setHighlightedElement:c})]})},fk=({snapshotUrls:t,sdkLanguage:e,testIdAttributeName:n,isInspecting:r,setIsInspecting:o,highlightedElement:l,setHighlightedElement:c})=>{const u=$.useRef(null),d=$.useRef(null),[p,g]=$.useState({viewport:gv,url:""}),y=$.useRef({iteration:0,visibleIframe:0});return $.useEffect(()=>{(async()=>{const v=y.current.iteration+1,x=1-y.current.visibleIframe;y.current.iteration=v;const E=await gk(t==null?void 0:t.snapshotInfoUrl);if(y.current.iteration!==v)return;const S=[u,d][x].current;if(S){let k=()=>{};const C=new Promise(A=>k=A);try{S.addEventListener("load",k),S.addEventListener("error",k);const A=(t==null?void 0:t.snapshotUrl)||yk;S.contentWindow?S.contentWindow.location.replace(A):S.src=A,await C}catch{}finally{S.removeEventListener("load",k),S.removeEventListener("error",k)}}y.current.iteration===v&&(y.current.visibleIframe=x,g(E))})()},[t]),w.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:v=>{v.key==="Escape"&&r&&o(!1)},children:[w.jsx(Lm,{isInspecting:r,sdkLanguage:e,testIdAttributeName:n,highlightedElement:l,setHighlightedElement:c,iframe:u.current,iteration:y.current.iteration}),w.jsx(Lm,{isInspecting:r,sdkLanguage:e,testIdAttributeName:n,highlightedElement:l,setHighlightedElement:c,iframe:d.current,iteration:y.current.iteration}),w.jsx(dk,{snapshotInfo:p,children:w.jsxs("div",{className:"snapshot-switcher",children:[w.jsx("iframe",{ref:u,name:"snapshot",title:"DOM Snapshot",className:ze(y.current.visibleIframe===0&&"snapshot-visible")}),w.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",className:ze(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},dk=({snapshotInfo:t,children:e})=>{const[n,r]=jr(),l={width:t.viewport.width,height:t.viewport.height+40},c=Math.min(n.width/l.width,n.height/l.height,1),u={x:(n.width-l.width)/2,y:(n.height-l.height)/2};return w.jsx("div",{ref:r,className:"snapshot-wrapper",children:w.jsxs("div",{className:"snapshot-container",style:{width:l.width+"px",height:l.height+"px",transform:`translate(${u.x}px, ${u.y}px) scale(${c})`},children:[w.jsx(eE,{url:t.url}),e]})})};function hk(t){return t==="before"?"Before":t==="after"?"After":t==="action"?"Action":t}const Lm=({iframe:t,isInspecting:e,sdkLanguage:n,testIdAttributeName:r,highlightedElement:o,setHighlightedElement:l,iteration:c})=>($.useEffect(()=>{const u=o.lastEdited==="ariaSnapshot"?o.ariaSnapshot:void 0,d=o.lastEdited==="locator"?o.locator:void 0,p=!!u||!!d||e,g=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{pv(g,p,n,r,y,"",t==null?void 0:t.contentWindow)}catch{}const v=u?sf(hv,u):void 0,x=d?Y_(n,d,r):void 0;for(const{recorder:E,frameSelector:S}of g){const k=x!=null&&x.startsWith(S)?x.substring(S.length).trim():void 0,C=(v==null?void 0:v.errors.length)===0?v.fragment:void 0;E.setUIState({mode:e?"inspecting":"none",actionSelector:k,ariaTemplate:C,language:n,testIdAttributeName:r,overlay:{offsetX:0}},{async elementPicked(A){l({locator:Lr(n,S+A.selector),ariaSnapshot:A.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const A of g)A.recorder!==E&&A.recorder.clearHighlight()}})}},[t,e,o,l,n,r,c]),w.jsx(w.Fragment,{}));function pv(t,e,n,r,o,l,c){if(!c)return;const u=c;if(!u._recorder&&e){const d=new gy(c,{isUnderTest:o,sdkLanguage:n,testIdAttributeName:r,stableRafCount:1,browserName:"chromium",customEngines:[]}),p=new V_(d);u._injectedScript=d,u._recorder={recorder:p,frameSelector:l},o&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(p)))}u._recorder&&t.push(u._recorder);for(let d=0;d<c.frames.length;++d){const p=c.frames[d],g=p.frameElement?u._injectedScript.generateSelectorSimple(p.frameElement,{omitInternalEngines:!0,testIdAttributeName:r})+" >> internal:control=enter-frame >> ":"";pv(t,e,n,r,o,l+g,p)}}function pk(t){if(!t)return{};let e=t.beforeSnapshot?{action:t,snapshotName:t.beforeSnapshot}:void 0;if(!e){for(let o=$p(t);o;o=$p(o))if(o.endTime<=t.startTime&&o.afterSnapshot){e={action:o,snapshotName:o.afterSnapshot};break}}let n=t.afterSnapshot?{action:t,snapshotName:t.afterSnapshot}:void 0;if(!n){let o;for(let l=Dp(t);l&&l.startTime<=t.endTime;l=Dp(l))l.endTime>t.endTime||!l.afterSnapshot||o&&o.endTime>l.endTime||(o=l);o?n={action:o,snapshotName:o.afterSnapshot}:n=e}const r=t.inputSnapshot?{action:t,snapshotName:t.inputSnapshot,hasInputTarget:!0}:n;return r&&(r.point=t.point),{action:r,before:e,after:n}}const mv=new URLSearchParams(window.location.search).has("isUnderTest"),Mm=new URLSearchParams(window.location.search).get("server");function mk(t,e){const n=new URLSearchParams;n.set("trace",zl(t.action).traceUrl),n.set("name",t.snapshotName),mv&&n.set("isUnderTest","true"),t.point&&(n.set("pointX",String(t.point.x)),n.set("pointY",String(t.point.y)),t.hasInputTarget&&n.set("hasInputTarget","1")),e&&n.set("shouldPopulateCanvasFromScreenshot","1");const r=new URL(`snapshot/${t.action.pageId}?${n.toString()}`,window.location.href).toString(),o=new URL(`snapshotInfo/${t.action.pageId}?${n.toString()}`,window.location.href).toString(),l=new URLSearchParams;l.set("r",r),Mm&&l.set("server",Mm),l.set("trace",zl(t.action).traceUrl),t.point&&(l.set("pointX",String(t.point.x)),l.set("pointY",String(t.point.y)),t.hasInputTarget&&n.set("hasInputTarget","1"));const c=new URL(`snapshot.html?${l.toString()}`,window.location.href).toString();return{snapshotInfoUrl:o,snapshotUrl:r,popoutUrl:c}}async function gk(t){const e={url:"",viewport:gv,timestamp:void 0,wallTime:void 0};if(t){const r=await(await fetch(t)).json();r.error||(e.url=r.url,e.viewport=r.viewport,e.timestamp=r.timestamp,e.wallTime=r.wallTime)}return e}const gv={width:1280,height:720},yk='data:text/html,<body style="background: #ddd"></body>',yv={width:200,height:45},ys=2.5,vk=yv.height+ys*2,wk=({model:t,boundaries:e,previewPoint:n})=>{var g,y;const[r,o]=jr(),l=$.useRef(null);let c=0;if(l.current&&n){const v=l.current.getBoundingClientRect();c=(n.clientY-v.top+l.current.scrollTop)/vk|0}const u=(y=(g=t==null?void 0:t.pages)==null?void 0:g[c])==null?void 0:y.screencastFrames;let d,p;if(n!==void 0&&u&&u.length){const v=e.minimum+(e.maximum-e.minimum)*n.x/r.width;d=u[Pm(u,v,vv)-1];const x={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};p=d?wv({width:d.width,height:d.height},x):void 0}return w.jsxs("div",{className:"film-strip",ref:o,children:[w.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((v,x)=>v.screencastFrames.length?w.jsx(Sk,{boundaries:e,page:v,width:r.width},x):null)}),(n==null?void 0:n.x)!==void 0&&w.jsxs("div",{className:"film-strip-hover",style:{top:r.bottom+5,left:Math.min(n.x,r.width-(p?p.width:0)-10)},children:[n.action&&w.jsx("div",{className:"film-strip-hover-title",children:tf(n.action,n)}),d&&p&&w.jsx("div",{style:{width:p.width,height:p.height},children:w.jsx("img",{src:`sha1/${d.sha1}`,width:p.width,height:p.height})})]})]})},Sk=({boundaries:t,page:e,width:n})=>{const r={width:0,height:0},o=e.screencastFrames;for(const S of o)r.width=Math.max(r.width,S.width),r.height=Math.max(r.height,S.height);const l=wv(r,yv),c=o[0].timestamp,u=o[o.length-1].timestamp,d=t.maximum-t.minimum,p=(c-t.minimum)/d*n,g=(t.maximum-u)/d*n,v=(u-c)/d*n/(l.width+2*ys)|0,x=(u-c)/v,E=[];for(let S=0;c&&x&&S<v;++S){const k=c+x*S,C=Pm(o,k,vv)-1;E.push(w.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${o[C].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:ys,marginRight:ys}},S))}return E.push(w.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${o[o.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:ys,marginRight:ys}},E.length)),w.jsx("div",{className:"film-strip-lane",style:{marginLeft:p+"px",marginRight:g+"px"},children:E})};function vv(t,e){return t-e.timestamp}function wv(t,e){const n=Math.max(t.width/e.width,t.height/e.height);return{width:t.width/n|0,height:t.height/n|0}}const xk=({model:t,boundaries:e,consoleEntries:n,onSelected:r,highlightedAction:o,highlightedEntry:l,highlightedConsoleEntry:c,selectedTime:u,setSelectedTime:d,sdkLanguage:p})=>{const[g,y]=jr(),[v,x]=$.useState(),[E,S]=$.useState(),[k]=Nn("actionsFilter",[]),{offsets:C,curtainLeft:A,curtainRight:U}=$.useMemo(()=>{let M=u||e;if(v&&v.startX!==v.endX){const pe=un(g.width,e,v.startX),ge=un(g.width,e,v.endX);M={minimum:Math.min(pe,ge),maximum:Math.max(pe,ge)}}const H=Ft(g.width,e,M.minimum),xe=Ft(g.width,e,e.maximum)-Ft(g.width,e,M.maximum);return{offsets:_k(g.width,e),curtainLeft:H,curtainRight:xe}},[u,e,v,g]),R=$.useMemo(()=>t==null?void 0:t.filteredActions(k),[t,k]),D=$.useMemo(()=>{const M=[];for(const H of R||[])H.class!=="Test"&&M.push({action:H,leftTime:H.startTime,rightTime:H.endTime||e.maximum,leftPosition:Ft(g.width,e,H.startTime),rightPosition:Ft(g.width,e,H.endTime||e.maximum),active:!1,error:!!H.error});for(const H of(t==null?void 0:t.resources)||[]){const fe=H._monotonicTime,xe=H._monotonicTime+H.time;M.push({resource:H,leftTime:fe,rightTime:xe,leftPosition:Ft(g.width,e,fe),rightPosition:Ft(g.width,e,xe),active:!1,error:!1})}for(const H of n||[])M.push({consoleMessage:H,leftTime:H.timestamp,rightTime:H.timestamp,leftPosition:Ft(g.width,e,H.timestamp),rightPosition:Ft(g.width,e,H.timestamp),active:!1,error:H.isError});return M},[t,R,n,e,g]);$.useMemo(()=>{for(const M of D)o?M.active=M.action===o:l?M.active=M.resource===l:c?M.active=M.consoleMessage===c:M.active=!1},[D,o,l,c]);const z=$.useCallback(M=>{if(S(void 0),!y.current)return;const H=M.clientX-y.current.getBoundingClientRect().left,fe=un(g.width,e,H),xe=u?Ft(g.width,e,u.minimum):0,pe=u?Ft(g.width,e,u.maximum):0;u&&Math.abs(H-xe)<10?x({startX:pe,endX:H,type:"resize"}):u&&Math.abs(H-pe)<10?x({startX:xe,endX:H,type:"resize"}):u&&fe>u.minimum&&fe<u.maximum&&M.clientY-y.current.getBoundingClientRect().top<20?x({startX:xe,endX:pe,pivot:H,type:"move"}):x({startX:H,endX:H,type:"resize"})},[e,g,y,u]),q=$.useCallback(M=>{if(!y.current)return;const H=M.clientX-y.current.getBoundingClientRect().left,fe=un(g.width,e,H),xe=R==null?void 0:R.findLast(ne=>ne.startTime<=fe);if(!M.buttons){x(void 0);return}if(xe&&r(xe),!v)return;let pe=v;if(v.type==="resize")pe={...v,endX:H};else{const ne=H-v.pivot;let J=v.startX+ne,I=v.endX+ne;J<0&&(J=0,I=J+(v.endX-v.startX)),I>g.width&&(I=g.width,J=I-(v.endX-v.startX)),pe={...v,startX:J,endX:I,pivot:H}}x(pe);const ge=un(g.width,e,pe.startX),Q=un(g.width,e,pe.endX);ge!==Q&&d({minimum:Math.min(ge,Q),maximum:Math.max(ge,Q)})},[e,v,g,R,r,y,d]),F=$.useCallback(()=>{if(S(void 0),!!v){if(v.startX!==v.endX){const M=un(g.width,e,v.startX),H=un(g.width,e,v.endX);d({minimum:Math.min(M,H),maximum:Math.max(M,H)})}else{const M=un(g.width,e,v.startX),H=R==null?void 0:R.findLast(fe=>fe.startTime<=M);H&&r(H),d(void 0)}x(void 0)}},[e,v,g,R,d,r]),j=$.useCallback(M=>{if(!y.current)return;const H=M.clientX-y.current.getBoundingClientRect().left,fe=un(g.width,e,H),xe=R==null?void 0:R.findLast(pe=>pe.startTime<=fe);S({x:H,clientY:M.clientY,action:xe,sdkLanguage:p})},[e,g,R,y,p]),oe=$.useCallback(()=>{S(void 0)},[]),ae=$.useCallback(()=>{d(void 0)},[d]);return w.jsxs("div",{className:"timeline-view-container",children:[!!v&&w.jsx(dg,{cursor:(v==null?void 0:v.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:F,onPaneMouseMove:q,onPaneDoubleClick:ae}),w.jsxs("div",{ref:y,className:"timeline-view",onMouseDown:z,onMouseMove:j,onMouseLeave:oe,children:[w.jsx("div",{className:"timeline-grid",children:C.map((M,H)=>w.jsx("div",{className:"timeline-divider",style:{left:M.position+"px"},children:w.jsx("div",{className:"timeline-time",children:pt(M.time-e.minimum)})},H))}),w.jsx("div",{style:{height:8}}),w.jsx(wk,{model:t,boundaries:e,previewPoint:E}),w.jsx("div",{className:"timeline-bars",children:D.map((M,H)=>w.jsx("div",{className:ze("timeline-bar",M.action&&"action",M.resource&&"network",M.consoleMessage&&"console-message",M.active&&"active",M.error&&"error"),style:{left:M.leftPosition,width:Math.max(5,M.rightPosition-M.leftPosition),top:Ek(M),bottom:0}},H))}),w.jsx("div",{className:"timeline-marker",style:{display:E!==void 0?"block":"none",left:((E==null?void 0:E.x)||0)+"px"}}),u&&w.jsxs("div",{className:"timeline-window",children:[w.jsx("div",{className:"timeline-window-curtain left",style:{width:A}}),w.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),w.jsx("div",{className:"timeline-window-center",children:w.jsx("div",{className:"timeline-window-drag"})}),w.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),w.jsx("div",{className:"timeline-window-curtain right",style:{width:U}})]})]})]})};function _k(t,e){let r=t/64;const o=e.maximum-e.minimum,l=t/o;let c=o/r;const u=Math.ceil(Math.log(c)/Math.LN10);c=Math.pow(10,u),c*l>=5*64&&(c=c/5),c*l>=2*64&&(c=c/2);const d=e.minimum;let p=e.maximum;p+=64/l,r=Math.ceil((p-d)/c),c||(r=0);const g=[];for(let y=0;y<r;++y){const v=d+c*y;g.push({position:Ft(t,e,v),time:v})}return g}function Ft(t,e,n){return(n-e.minimum)/(e.maximum-e.minimum)*t}function un(t,e,n){return n/t*(e.maximum-e.minimum)+e.minimum}function Ek(t){return t.resource?25:20}const kk=({model:t})=>{var n,r;if(!t)return w.jsx(w.Fragment,{});const e=t.wallTime!==void 0?new Date(t.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return w.jsxs("div",{className:"vbox",style:{flexShrink:0},children:[w.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&w.jsxs("div",{className:"call-line",children:["start time:",w.jsx("span",{className:"call-value datetime",title:e,children:e})]}),w.jsxs("div",{className:"call-line",children:["duration:",w.jsx("span",{className:"call-value number",title:pt(t.endTime-t.startTime),children:pt(t.endTime-t.startTime)})]}),w.jsx("div",{className:"call-section",children:"Browser"}),w.jsxs("div",{className:"call-line",children:["engine:",w.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&w.jsxs("div",{className:"call-line",children:["channel:",w.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&w.jsxs("div",{className:"call-line",children:["platform:",w.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&w.jsxs("div",{className:"call-line",children:["user agent:",w.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),w.jsxs("div",{className:"call-line",children:["baseURL:",w.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),w.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&w.jsxs("div",{className:"call-line",children:["width:",w.jsx("span",{className:"call-value number",title:String(!!((n=t.options.viewport)!=null&&n.width)),children:t.options.viewport.width})]}),t.options.viewport&&w.jsxs("div",{className:"call-line",children:["height:",w.jsx("span",{className:"call-value number",title:String(!!((r=t.options.viewport)!=null&&r.height)),children:t.options.viewport.height})]}),w.jsxs("div",{className:"call-line",children:["is mobile:",w.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&w.jsxs("div",{className:"call-line",children:["device scale:",w.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),w.jsx("div",{className:"call-section",children:"Counts"}),w.jsxs("div",{className:"call-line",children:["pages:",w.jsx("span",{className:"call-value number",children:t.pages.length})]}),w.jsxs("div",{className:"call-line",children:["actions:",w.jsx("span",{className:"call-value number",children:t.actions.length})]}),w.jsxs("div",{className:"call-line",children:["events:",w.jsx("span",{className:"call-value number",children:t.events.length})]})]})},bk=({annotations:t})=>t.length?w.jsx("div",{className:"annotations-tab",children:t.map((e,n)=>w.jsxs("div",{className:"annotation-item",children:[w.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&w.jsxs("span",{children:[": ",pg(e.description)]})]},`annotation-${n}`))}):w.jsx(Pr,{text:"No annotations"}),Tk=({sdkLanguage:t,setIsInspecting:e,highlightedElement:n,setHighlightedElement:r})=>{const[o,l]=$.useState(),c=$.useCallback(u=>{const{errors:d}=sf(hv,u,{prettyErrors:!1}),p=d.map(g=>({message:g.message,line:g.range[1].line,column:g.range[1].col,type:"subtle-error"}));l(p),r({...n,ariaSnapshot:u,lastEdited:"ariaSnapshot"}),e(!1)},[n,r,e]);return w.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[w.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[w.jsx("div",{style:{flex:"auto"},children:"Locator"}),w.jsx(Ht,{icon:"files",title:"Copy locator",onClick:()=>{Np(n.locator||"")}})]}),w.jsx("div",{style:{height:50},children:w.jsx(Cs,{text:n.locator||"",highlighter:t,isFocused:!0,wrapLines:!0,onChange:u=>{r({...n,locator:u,lastEdited:"locator"}),e(!1)}})}),w.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[w.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),w.jsx(Ht,{icon:"files",title:"Copy snapshot",onClick:()=>{Np(n.ariaSnapshot||"")}})]}),w.jsx("div",{style:{height:150},children:w.jsx(Cs,{text:n.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:o,onChange:c})})]})},Ok=({model:t,showSourcesFirst:e,rootDir:n,fallbackLocation:r,isLive:o,hideTimeline:l,status:c,annotations:u,inert:d,onOpenExternally:p,revealSource:g,testRunMetadata:y})=>{var lo;const[v,x]=$.useState(void 0),[E,S]=$.useState(void 0),[k,C]=$.useState(void 0),[A,U]=$.useState(),[R,D]=$.useState(),[z,q]=$.useState(),[F,j]=$.useState("actions"),[oe,ae]=Nn("propertiesTab",e?"source":"call"),[M,H]=$.useState(!1),[fe,xe]=$.useState({lastEdited:"none"}),[pe,ge]=$.useState(),[Q,ne]=Nn("propertiesSidebarLocation","bottom"),[J]=Nn("actionsFilter",[]),I=$.useCallback(ie=>{x(ie==null?void 0:ie.callId),S(void 0)},[]),B=$.useMemo(()=>t==null?void 0:t.filteredActions(J),[t,J]),ce=$.useMemo(()=>B==null?void 0:B.find(ie=>ie.callId===A),[B,A]),de=$.useCallback(ie=>{U(ie==null?void 0:ie.callId)},[]),ye=$.useMemo(()=>(t==null?void 0:t.sources)||new Map,[t]);$.useEffect(()=>{ge(void 0),S(void 0)},[t]);const me=$.useMemo(()=>{if(v){const Vt=B==null?void 0:B.find(Wt=>Wt.callId===v);if(Vt)return Vt}const ie=t==null?void 0:t.failedAction();if(ie)return ie;if(B!=null&&B.length){let Vt=B.length-1;for(let Wt=0;Wt<B.length;++Wt)if(B[Wt].title==="After Hooks"&&Wt){Vt=Wt-1;break}return B[Vt]}},[t,B,v]),ve=$.useMemo(()=>ce||me,[me,ce]),_e=$.useMemo(()=>E?E.stack:ve==null?void 0:ve.stack,[ve,E]),ke=$.useCallback(ie=>{I(ie),de(void 0)},[I,de]),Ne=$.useCallback(ie=>{ae(ie),ie!=="inspector"&&H(!1)},[ae]),sr=$.useCallback(ie=>{!M&&ie&&Ne("inspector"),H(ie)},[H,Ne,M]),no=$.useCallback(ie=>{xe(ie),Ne("inspector")},[Ne]),$r=$.useCallback(ie=>{Ne("attachments"),C(Vt=>{if(!Vt)return[ie,0];const Wt=Vt[1];return[ie,Wt+1]})},[Ne]);$.useEffect(()=>{g&&Ne("source")},[g,Ne]);const ir=f1(t,pe),Bs=R1(t,pe),zs=o1(t),rn=(t==null?void 0:t.sdkLanguage)||"javascript",ro={id:"inspector",title:"Locator",render:()=>w.jsx(Tk,{sdkLanguage:rn,setIsInspecting:sr,highlightedElement:fe,setHighlightedElement:xe})},Us={id:"call",title:"Call",render:()=>w.jsx(TS,{action:ve,startTimeOffset:(t==null?void 0:t.startTime)??0,sdkLanguage:rn})},or={id:"log",title:"Log",render:()=>w.jsx(AS,{action:ve,isLive:o})},In={id:"errors",title:"Errors",errorCount:zs.errors.size,render:()=>w.jsx(a1,{errorsModel:zs,model:t,testRunMetadata:y,sdkLanguage:rn,revealInSource:ie=>{ie.action?I(ie.action):S(ie),Ne("source")},wallTime:(t==null?void 0:t.wallTime)??0})};let Dr;!me&&r&&(Dr=(lo=r.source)==null?void 0:lo.errors.length);const Fr={id:"source",title:"Source",errorCount:Dr,render:()=>w.jsx(r1,{stack:_e,sources:ye,rootDir:n,stackFrameLocation:Q==="bottom"?"right":"bottom",fallbackLocation:r,onOpenExternally:p})},so={id:"console",title:"Console",count:ir.entries.length,render:()=>w.jsx(d1,{consoleModel:ir,boundaries:Ln,selectedTime:pe,onAccepted:ie=>ge({minimum:ie.timestamp,maximum:ie.timestamp}),onEntryHovered:q})},io={id:"network",title:"Network",count:Bs.resources.length,render:()=>w.jsx($1,{boundaries:Ln,networkModel:Bs,onEntryHovered:D,sdkLanguage:(t==null?void 0:t.sdkLanguage)??"javascript"})},oo={id:"attachments",title:"Attachments",count:t==null?void 0:t.visibleAttachments.length,render:()=>w.jsx(GS,{model:t,revealedAttachment:k})},hn=[ro,Us,or,In,so,io,Fr,oo];if(u!==void 0){const ie={id:"annotations",title:"Annotations",count:u.length,render:()=>w.jsx(bk,{annotations:u})};hn.push(ie)}if(e){const ie=hn.indexOf(Fr);hn.splice(ie,1),hn.splice(1,0,Fr)}const{boundaries:Ln}=$.useMemo(()=>{const ie={minimum:(t==null?void 0:t.startTime)||0,maximum:(t==null?void 0:t.endTime)||3e4};return ie.minimum>ie.maximum&&(ie.minimum=0,ie.maximum=3e4),ie.maximum+=(ie.maximum-ie.minimum)/20,{boundaries:ie}},[t]);let lr=0;!o&&t&&t.endTime>=0?lr=t.endTime-t.startTime:t&&t.wallTime&&(lr=Date.now()-t.wallTime);const ar={id:"actions",title:"Actions",component:w.jsxs("div",{className:"vbox",children:[c&&w.jsxs("div",{className:"workbench-run-status",children:[w.jsx("span",{className:ze("codicon",fg(c))}),w.jsx("div",{children:_S(c)}),w.jsx("div",{className:"spacer"}),w.jsx("div",{className:"workbench-run-duration",children:lr?pt(lr):""})]}),w.jsx(kS,{sdkLanguage:rn,actions:B||[],selectedAction:t?me:void 0,selectedTime:pe,setSelectedTime:ge,onSelected:ke,onHighlighted:de,revealAttachment:$r,revealConsole:()=>Ne("console"),isLive:o})]})},cr={id:"metadata",title:"Metadata",component:w.jsx(kk,{model:t})};return w.jsxs("div",{className:"vbox workbench",...d?{inert:"true"}:{},children:[!l&&w.jsx(xk,{model:t,consoleEntries:ir.entries,boundaries:Ln,highlightedAction:ce,highlightedEntry:R,highlightedConsoleEntry:z,onSelected:ke,sdkLanguage:rn,selectedTime:pe,setSelectedTime:ge}),w.jsx(Ul,{sidebarSize:250,orientation:Q==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:w.jsx(Ul,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:w.jsx(uk,{action:ve,model:t,sdkLanguage:rn,testIdAttributeName:(t==null?void 0:t.testIdAttributeName)||"data-testid",isInspecting:M,setIsInspecting:sr,highlightedElement:fe,setHighlightedElement:no}),sidebar:w.jsx(Ru,{tabs:[ar,cr],selectedTab:F,setSelectedTab:j})}),sidebar:w.jsx(Ru,{tabs:hn,selectedTab:oe,setSelectedTab:Ne,rightToolbar:[Q==="bottom"?w.jsx(Ht,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{ne("right")}}):w.jsx(Ht,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{ne("bottom")}})],mode:Q==="bottom"?"default":"select"})})]})};var jm;(t=>{function e(n){for(const r of n.splice(0))r.dispose()}t.disposeAll=e})(jm||(jm={}));class Mi{constructor(){this._listeners=new Set,this.event=(e,n)=>{this._listeners.add(e);let r=!1;const o=this,l={dispose(){r||(r=!0,o._listeners.delete(e))}};return n&&n.push(l),l}}fire(e){const n=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const r of this._listeners)this._deliveryQueue.push({listener:r,event:e});if(n){for(let r=0;r<this._deliveryQueue.length;r++){const{listener:o,event:l}=this._deliveryQueue[r];o.call(null,l)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class Rk{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",n=>e(n.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class $k{constructor(e){this._onCloseEmitter=new Mi,this._onReportEmitter=new Mi,this._onStdioEmitter=new Mi,this._onTestFilesChangedEmitter=new Mi,this._onLoadTraceRequestedEmitter=new Mi,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this._transport=e,this._transport.onmessage(r=>{const o=JSON.parse(r),{id:l,result:c,error:u,method:d,params:p}=o;if(l){const g=this._callbacks.get(l);if(!g)return;this._callbacks.delete(l),u?g.reject(new Error(u)):g.resolve(c)}else this._dispatchEvent(d,p)});const n=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((r,o)=>{this._transport.onopen(r),this._transport.onerror(o)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(n)})}isClosed(){return this._isClosed}async _sendMessage(e,n){const r=globalThis.__logForTest;r==null||r({method:e,params:n}),await this._connectedPromise;const o=++this._lastId,l={id:o,method:e,params:n};return this._transport.send(JSON.stringify(l)),new Promise((c,u)=>{this._callbacks.set(o,{resolve:c,reject:u})})}_sendMessageNoReply(e,n){this._sendMessage(e,n).catch(()=>{})}_dispatchEvent(e,n){e==="report"?this._onReportEmitter.fire(n):e==="stdio"?this._onStdioEmitter.fire(n):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(n):e==="loadTraceRequested"&&this._onLoadTraceRequestedEmitter.fire(n)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async startDevServer(e){return await this._sendMessage("startDevServer",e)}async stopDevServer(e){return await this._sendMessage("stopDevServer",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const Ck=({settings:t})=>w.jsx("div",{className:"vbox settings-view",children:t.map(e=>{const n=`setting-${e.name}`;return w.jsx("div",{className:"setting",title:e.title,children:Nk(e,n)},e.name)})}),Nk=(t,e)=>{switch(t.type){case"check":return w.jsxs(w.Fragment,{children:[w.jsx("input",{type:"checkbox",id:e,checked:t.value,onChange:()=>t.set(!t.value)}),w.jsx("label",{htmlFor:e,children:t.name})]});case"select":return w.jsxs(w.Fragment,{children:[w.jsx("label",{htmlFor:e,children:t.name}),w.jsx("select",{id:e,value:t.value,onChange:n=>t.set(n.target.value),children:t.options.map(n=>w.jsx("option",{value:n.value,children:n.label},n.value))})]});default:return null}},Dk=()=>{const[t,e]=Nn("shouldPopulateCanvasFromScreenshot",!1),[n,r]=Nn("actionsFilter",[]),[o,l]=k0();return w.jsx(Ck,{settings:[{type:"check",value:o,set:l,name:"Dark mode"},{type:"check",value:t,set:e,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."},{type:"check",value:n.includes("getter"),set:c=>r(c?[...n,"getter"]:n.filter(u=>u!=="getter")),name:"Show getter actions"},{type:"check",value:n.includes("route"),set:c=>r(c?[...n,"route"]:n.filter(u=>u!=="route")),name:"Show route actions"},{type:"check",value:n.includes("configuration"),set:c=>r(c?[...n,"configuration"]:n.filter(u=>u!=="configuration")),name:"Show configuration actions"}]})};export{Dk as D,VS as E,Pk as M,Mt as R,Ul as S,Ht as T,Rk as W,DS as _,$k as a,Ok as b,Ik as c,jk as d,Mu as e,Lk as f,Mk as g,ze as h,SS as i,w as j,rf as k,Nn as l,pt as m,Ck as n,g0 as o,$ as r,kr as s,fg as t,jr as u};