playwright-core 1.56.0-alpha-2025-09-22 → 1.56.0-alpha-2025-09-24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/reinstall_chrome_beta_mac.sh +1 -1
- package/bin/reinstall_chrome_stable_mac.sh +1 -1
- package/bin/reinstall_msedge_beta_mac.sh +1 -1
- package/bin/reinstall_msedge_dev_mac.sh +1 -1
- package/bin/reinstall_msedge_stable_mac.sh +1 -1
- package/browsers.json +1 -1
- package/lib/client/browserContext.js +1 -7
- package/lib/client/channelOwner.js +0 -4
- package/lib/client/events.js +1 -0
- package/lib/client/page.js +0 -1
- package/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/pollingRecorderSource.js +1 -1
- package/lib/protocol/validator.js +0 -3
- package/lib/server/chromium/crBrowser.js +1 -32
- package/lib/server/chromium/crPage.js +2 -6
- package/lib/server/dispatchers/browserContextDispatcher.js +0 -3
- package/lib/server/page.js +4 -4
- package/lib/vite/traceViewer/assets/{codeMirrorModule-WgG9VDle.js → codeMirrorModule-C8G5kNRG.js} +1 -1
- package/lib/vite/traceViewer/assets/{defaultSettingsView-D2A3SsO6.js → defaultSettingsView-pyEJokcP.js} +4 -4
- package/lib/vite/traceViewer/assets/xtermModule-EuEc8Siv.js +9 -0
- package/lib/vite/traceViewer/{index.Cd3-kWwE.js → index.cllH3Wja.js} +1 -1
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/{uiMode.CasC1El2.js → uiMode.QjtJgPXL.js} +2 -2
- package/lib/vite/traceViewer/uiMode.html +2 -2
- package/lib/vite/traceViewer/{xtermModule.DYP7pi_n.css → xtermModule.Beg8tuEN.css} +1 -1
- package/package.json +1 -1
- package/types/types.d.ts +6 -35
- package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-C8G5kNRG.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var ww=Object.defineProperty;var xw=(n,e,i)=>e in n?ww(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var Me=(n,e,i)=>xw(n,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(l){if(l.ep)return;l.ep=!0;const o=i(l);fetch(l.href,o)}})();function _w(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zf={exports:{}},ba={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+a.message+`
|
|
|
55
55
|
rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
|
|
56
56
|
rgb(0 0 0 / 10%) 0px -2px 4px,
|
|
57
57
|
rgb(0 0 0 / 15%) 0px -6.1px 12px,
|
|
58
|
-
rgb(0 0 0 / 25%) 0px 6px 12px`},Ix=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[s,l]=q.useState(n.diff?"diff":"actual"),[o,u]=q.useState(!1),[f,d]=q.useState(null),[p,m]=q.useState("Expected"),[y,b]=q.useState(null),[w,E]=q.useState(null),[x,T]=es();q.useEffect(()=>{(async()=>{var R,te,re,L;d(await Kf((R=n.expected)==null?void 0:R.attachment.path)),m(((te=n.expected)==null?void 0:te.title)||"Expected"),b(await Kf((re=n.actual)==null?void 0:re.attachment.path)),E(await Kf((L=n.diff)==null?void 0:L.attachment.path))})()},[n]);const M=f&&y&&w,C=M?Math.max(f.naturalWidth,y.naturalWidth,200):500,V=M?Math.max(f.naturalHeight,y.naturalHeight,200):500,$=Math.min(1,(x.width-30)/C),B=Math.min(1,(x.width-50)/C/2),Y=C*$,J=V*$,I={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return v.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:T,children:M&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&v.jsx("div",{style:{...I,fontWeight:s==="diff"?600:"initial"},onClick:()=>l("diff"),children:"Diff"}),v.jsx("div",{style:{...I,fontWeight:s==="actual"?600:"initial"},onClick:()=>l("actual"),children:"Actual"}),v.jsx("div",{style:{...I,fontWeight:s==="expected"?600:"initial"},onClick:()=>l("expected"),children:p}),v.jsx("div",{style:{...I,fontWeight:s==="sxs"?600:"initial"},onClick:()=>l("sxs"),children:"Side by side"}),v.jsx("div",{style:{...I,fontWeight:s==="slider"?600:"initial"},onClick:()=>l("slider"),children:"Slider"})]}),v.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:J+60},children:[n.diff&&s==="diff"&&v.jsx($n,{image:w,alt:"Diff",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="actual"&&v.jsx($n,{image:y,alt:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="expected"&&v.jsx($n,{image:f,alt:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="slider"&&v.jsx(Vx,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$,expectedTitle:p}),n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:B*C,canvasHeight:B*V,scale:B}),v.jsx($n,{image:o?w:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:B*C,canvasHeight:B*V,scale:B})]}),!n.diff&&s==="actual"&&v.jsx($n,{image:y,title:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="expected"&&v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,canvasWidth:B*C,canvasHeight:B*V,scale:B}),v.jsx($n,{image:y,title:"Actual",canvasWidth:B*C,canvasHeight:B*V,scale:B})]})]}),!i&&v.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[v.jsx("div",{children:n.diff&&v.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},Vx=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:s,scale:l,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,p]=q.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&v.jsxs("div",{style:{margin:5},children:[!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!m&&v.jsx("span",{children:e.naturalWidth}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&v.jsx("span",{children:e.naturalHeight})]}),v.jsxs("div",{style:{position:"relative",width:i,height:s,margin:15,...hh},children:[v.jsx(W0,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),v.jsx("img",{alt:o,style:{width:n.naturalWidth*l,height:n.naturalHeight*l},draggable:"false",src:n.src}),v.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...hh},children:v.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*l,height:e.naturalHeight*l},draggable:"false",src:e.src})})]})]})},$n=({image:n,title:e,alt:i,hideSize:s,canvasWidth:l,canvasHeight:o,scale:u,onClick:f})=>v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!s&&v.jsxs("div",{style:{margin:5},children:[e&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight})]}),v.jsx("div",{style:{display:"flex",flex:"none",width:l,height:o,margin:15,...hh},children:v.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),Gx="modulepreload",Kx=function(n,e){return new URL(n,e).href},By={},Yx=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(i.map(m=>{if(m=Kx(m,s),m in By)return;By[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(!!s)for(let x=f.length-1;x>=0;x--){const T=f[x];if(T.href===m&&(!y||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":Gx,y||(E.as="script"),E.crossOrigin="",E.href=m,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((x,T)=>{E.addEventListener("load",x),E.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},Xx=20,lr=({text:n,highlighter:e,mimeType:i,linkify:s,readOnly:l,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:p,wrapLines:m,onChange:y,dataTestId:b,placeholder:w})=>{const[E,x]=es(),[T]=q.useState(Yx(()=>import("./codeMirrorModule-WgG9VDle.js"),__vite__mapDeps([0,1]),import.meta.url).then($=>$.default)),M=q.useRef(null),[C,V]=q.useState();return q.useEffect(()=>{(async()=>{var I,R;const $=await T;Fx($);const B=x.current;if(!B)return;const Y=Zx(e)||Qx(i)||(s?"text/linkified":"");if(M.current&&Y===M.current.cm.getOption("mode")&&!!l===M.current.cm.getOption("readOnly")&&f===M.current.cm.getOption("lineNumbers")&&m===M.current.cm.getOption("lineWrapping")&&w===M.current.cm.getOption("placeholder"))return;(R=(I=M.current)==null?void 0:I.cm)==null||R.getWrapperElement().remove();const J=$(B,{value:"",mode:Y,readOnly:!!l,lineNumbers:f,lineWrapping:m,placeholder:w});return M.current={cm:J},d&&J.focus(),V(J),J})()},[T,C,x,e,i,s,f,m,l,d,w]),q.useEffect(()=>{M.current&&M.current.cm.setSize(E.width,E.height)},[E]),q.useLayoutEffect(()=>{var Y;if(!C)return;let $=!1;if(C.getValue()!==n&&(C.setValue(n),$=!0,p&&(C.execCommand("selectAll"),C.focus())),$||JSON.stringify(o)!==JSON.stringify(M.current.highlight)){for(const R of M.current.highlight||[])C.removeLineClass(R.line-1,"wrap");for(const R of o||[])C.addLineClass(R.line-1,"wrap",`source-line-${R.type}`);for(const R of M.current.widgets||[])C.removeLineWidget(R);for(const R of M.current.markers||[])R.clear();const J=[],I=[];for(const R of o||[]){if(R.type!=="subtle-error"&&R.type!=="error")continue;const te=(Y=M.current)==null?void 0:Y.cm.getLine(R.line-1);if(te){const re={};re.title=R.message||"",I.push(C.markText({line:R.line-1,ch:0},{line:R.line-1,ch:R.column||te.length},{className:"source-line-error-underline",attributes:re}))}if(R.type==="error"){const re=document.createElement("div");re.innerHTML=Ia(R.message||""),re.className="source-line-error-widget",J.push(C.addLineWidget(R.line,re,{above:!0,coverGutter:!1}))}}M.current.highlight=o,M.current.widgets=J,M.current.markers=I}typeof u=="number"&&M.current.cm.lineCount()>=u&&C.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let B;return y&&(B=()=>y(C.getValue()),C.on("change",B)),()=>{B&&C.off("change",B)}},[C,n,o,u,p,y]),v.jsx("div",{"data-testid":b,className:"cm-wrapper",ref:x,onClick:Px})};function Px(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Uy=!1;function Fx(n){Uy||(Uy=!0,n.defineSimpleMode("text/linkified",{start:[{regex:x0,token:"linkified"}]}))}function Qx(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function Zx(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function Jx(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const Wx=({title:n,children:e,setExpanded:i,expanded:s,expandOnTitleClick:l})=>{const o=q.useId();return v.jsxs("div",{className:Ye("expandable",s&&"expanded"),children:[v.jsxs("div",{role:"button","aria-expanded":s,"aria-controls":o,className:"expandable-title",onClick:()=>l&&i(!s),children:[v.jsx("div",{className:Ye("codicon",s?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!l&&i(!s)}),n]}),s&&v.jsx("div",{id:o,role:"region",style:{marginLeft:25},children:e})]})};function eb(n){const e=[];let i=0,s;for(;(s=x0.exec(n))!==null;){const o=n.substring(i,s.index);o&&e.push(o);const u=s[0];e.push(e_(u)),i=s.index+u.length}const l=n.substring(i);return l&&e.push(l),e}function e_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),v.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const t_=({attachment:n,reveal:e})=>{const[i,s]=q.useState(!1),[l,o]=q.useState(null),[u,f]=q.useState(null),[d,p]=kw(),m=q.useRef(null),y=Jx(n.contentType),b=!!n.sha1||!!n.path;q.useEffect(()=>{var x;if(e)return(x=m.current)==null||x.scrollIntoView({behavior:"smooth"}),p()},[e,p]),q.useEffect(()=>{i&&l===null&&u===null&&(f("Loading ..."),fetch(sc(n)).then(x=>x.text()).then(x=>{o(x),f(null)}).catch(x=>{f("Failed to load: "+x.message)}))},[i,l,u,n]);const w=q.useMemo(()=>{const x=l?l.split(`
|
|
58
|
+
rgb(0 0 0 / 25%) 0px 6px 12px`},Ix=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[s,l]=q.useState(n.diff?"diff":"actual"),[o,u]=q.useState(!1),[f,d]=q.useState(null),[p,m]=q.useState("Expected"),[y,b]=q.useState(null),[w,E]=q.useState(null),[x,T]=es();q.useEffect(()=>{(async()=>{var R,te,re,L;d(await Kf((R=n.expected)==null?void 0:R.attachment.path)),m(((te=n.expected)==null?void 0:te.title)||"Expected"),b(await Kf((re=n.actual)==null?void 0:re.attachment.path)),E(await Kf((L=n.diff)==null?void 0:L.attachment.path))})()},[n]);const M=f&&y&&w,C=M?Math.max(f.naturalWidth,y.naturalWidth,200):500,V=M?Math.max(f.naturalHeight,y.naturalHeight,200):500,$=Math.min(1,(x.width-30)/C),B=Math.min(1,(x.width-50)/C/2),Y=C*$,J=V*$,I={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return v.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:T,children:M&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&v.jsx("div",{style:{...I,fontWeight:s==="diff"?600:"initial"},onClick:()=>l("diff"),children:"Diff"}),v.jsx("div",{style:{...I,fontWeight:s==="actual"?600:"initial"},onClick:()=>l("actual"),children:"Actual"}),v.jsx("div",{style:{...I,fontWeight:s==="expected"?600:"initial"},onClick:()=>l("expected"),children:p}),v.jsx("div",{style:{...I,fontWeight:s==="sxs"?600:"initial"},onClick:()=>l("sxs"),children:"Side by side"}),v.jsx("div",{style:{...I,fontWeight:s==="slider"?600:"initial"},onClick:()=>l("slider"),children:"Slider"})]}),v.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:J+60},children:[n.diff&&s==="diff"&&v.jsx($n,{image:w,alt:"Diff",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="actual"&&v.jsx($n,{image:y,alt:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="expected"&&v.jsx($n,{image:f,alt:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="slider"&&v.jsx(Vx,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$,expectedTitle:p}),n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:B*C,canvasHeight:B*V,scale:B}),v.jsx($n,{image:o?w:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:B*C,canvasHeight:B*V,scale:B})]}),!n.diff&&s==="actual"&&v.jsx($n,{image:y,title:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="expected"&&v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,canvasWidth:B*C,canvasHeight:B*V,scale:B}),v.jsx($n,{image:y,title:"Actual",canvasWidth:B*C,canvasHeight:B*V,scale:B})]})]}),!i&&v.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[v.jsx("div",{children:n.diff&&v.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},Vx=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:s,scale:l,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,p]=q.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&v.jsxs("div",{style:{margin:5},children:[!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!m&&v.jsx("span",{children:e.naturalWidth}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&v.jsx("span",{children:e.naturalHeight})]}),v.jsxs("div",{style:{position:"relative",width:i,height:s,margin:15,...hh},children:[v.jsx(W0,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),v.jsx("img",{alt:o,style:{width:n.naturalWidth*l,height:n.naturalHeight*l},draggable:"false",src:n.src}),v.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...hh},children:v.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*l,height:e.naturalHeight*l},draggable:"false",src:e.src})})]})]})},$n=({image:n,title:e,alt:i,hideSize:s,canvasWidth:l,canvasHeight:o,scale:u,onClick:f})=>v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!s&&v.jsxs("div",{style:{margin:5},children:[e&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight})]}),v.jsx("div",{style:{display:"flex",flex:"none",width:l,height:o,margin:15,...hh},children:v.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),Gx="modulepreload",Kx=function(n,e){return new URL(n,e).href},By={},Yx=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(i.map(m=>{if(m=Kx(m,s),m in By)return;By[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(!!s)for(let x=f.length-1;x>=0;x--){const T=f[x];if(T.href===m&&(!y||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const E=document.createElement("link");if(E.rel=y?"stylesheet":Gx,y||(E.as="script"),E.crossOrigin="",E.href=m,p&&E.setAttribute("nonce",p),document.head.appendChild(E),y)return new Promise((x,T)=>{E.addEventListener("load",x),E.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},Xx=20,lr=({text:n,highlighter:e,mimeType:i,linkify:s,readOnly:l,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:p,wrapLines:m,onChange:y,dataTestId:b,placeholder:w})=>{const[E,x]=es(),[T]=q.useState(Yx(()=>import("./codeMirrorModule-C8G5kNRG.js"),__vite__mapDeps([0,1]),import.meta.url).then($=>$.default)),M=q.useRef(null),[C,V]=q.useState();return q.useEffect(()=>{(async()=>{var I,R;const $=await T;Fx($);const B=x.current;if(!B)return;const Y=Zx(e)||Qx(i)||(s?"text/linkified":"");if(M.current&&Y===M.current.cm.getOption("mode")&&!!l===M.current.cm.getOption("readOnly")&&f===M.current.cm.getOption("lineNumbers")&&m===M.current.cm.getOption("lineWrapping")&&w===M.current.cm.getOption("placeholder"))return;(R=(I=M.current)==null?void 0:I.cm)==null||R.getWrapperElement().remove();const J=$(B,{value:"",mode:Y,readOnly:!!l,lineNumbers:f,lineWrapping:m,placeholder:w});return M.current={cm:J},d&&J.focus(),V(J),J})()},[T,C,x,e,i,s,f,m,l,d,w]),q.useEffect(()=>{M.current&&M.current.cm.setSize(E.width,E.height)},[E]),q.useLayoutEffect(()=>{var Y;if(!C)return;let $=!1;if(C.getValue()!==n&&(C.setValue(n),$=!0,p&&(C.execCommand("selectAll"),C.focus())),$||JSON.stringify(o)!==JSON.stringify(M.current.highlight)){for(const R of M.current.highlight||[])C.removeLineClass(R.line-1,"wrap");for(const R of o||[])C.addLineClass(R.line-1,"wrap",`source-line-${R.type}`);for(const R of M.current.widgets||[])C.removeLineWidget(R);for(const R of M.current.markers||[])R.clear();const J=[],I=[];for(const R of o||[]){if(R.type!=="subtle-error"&&R.type!=="error")continue;const te=(Y=M.current)==null?void 0:Y.cm.getLine(R.line-1);if(te){const re={};re.title=R.message||"",I.push(C.markText({line:R.line-1,ch:0},{line:R.line-1,ch:R.column||te.length},{className:"source-line-error-underline",attributes:re}))}if(R.type==="error"){const re=document.createElement("div");re.innerHTML=Ia(R.message||""),re.className="source-line-error-widget",J.push(C.addLineWidget(R.line,re,{above:!0,coverGutter:!1}))}}M.current.highlight=o,M.current.widgets=J,M.current.markers=I}typeof u=="number"&&M.current.cm.lineCount()>=u&&C.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let B;return y&&(B=()=>y(C.getValue()),C.on("change",B)),()=>{B&&C.off("change",B)}},[C,n,o,u,p,y]),v.jsx("div",{"data-testid":b,className:"cm-wrapper",ref:x,onClick:Px})};function Px(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Uy=!1;function Fx(n){Uy||(Uy=!0,n.defineSimpleMode("text/linkified",{start:[{regex:x0,token:"linkified"}]}))}function Qx(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function Zx(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function Jx(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const Wx=({title:n,children:e,setExpanded:i,expanded:s,expandOnTitleClick:l})=>{const o=q.useId();return v.jsxs("div",{className:Ye("expandable",s&&"expanded"),children:[v.jsxs("div",{role:"button","aria-expanded":s,"aria-controls":o,className:"expandable-title",onClick:()=>l&&i(!s),children:[v.jsx("div",{className:Ye("codicon",s?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!l&&i(!s)}),n]}),s&&v.jsx("div",{id:o,role:"region",style:{marginLeft:25},children:e})]})};function eb(n){const e=[];let i=0,s;for(;(s=x0.exec(n))!==null;){const o=n.substring(i,s.index);o&&e.push(o);const u=s[0];e.push(e_(u)),i=s.index+u.length}const l=n.substring(i);return l&&e.push(l),e}function e_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),v.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const t_=({attachment:n,reveal:e})=>{const[i,s]=q.useState(!1),[l,o]=q.useState(null),[u,f]=q.useState(null),[d,p]=kw(),m=q.useRef(null),y=Jx(n.contentType),b=!!n.sha1||!!n.path;q.useEffect(()=>{var x;if(e)return(x=m.current)==null||x.scrollIntoView({behavior:"smooth"}),p()},[e,p]),q.useEffect(()=>{i&&l===null&&u===null&&(f("Loading ..."),fetch(sc(n)).then(x=>x.text()).then(x=>{o(x),f(null)}).catch(x=>{f("Failed to load: "+x.message)}))},[i,l,u,n]);const w=q.useMemo(()=>{const x=l?l.split(`
|
|
59
59
|
`).length:0;return Math.min(Math.max(5,x),20)*Xx},[l]),E=v.jsxs("span",{style:{marginLeft:5},ref:m,"aria-label":n.name,children:[v.jsx("span",{children:eb(n.name)}),b&&v.jsx("a",{style:{marginLeft:5},href:Oo(n),children:"download"})]});return!y||!b?v.jsx("div",{style:{marginLeft:20},children:E}):v.jsxs("div",{className:Ye(d&&"yellow-flash"),children:[v.jsx(Wx,{title:E,expanded:i,setExpanded:s,expandOnTitleClick:!0,children:u&&v.jsx("i",{children:u})}),i&&l!==null&&v.jsx("div",{className:"vbox",style:{height:w},children:v.jsx(lr,{text:l,readOnly:!0,mimeType:n.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},n_=({model:n,revealedAttachment:e})=>{const{diffMap:i,screenshots:s,attachments:l}=q.useMemo(()=>{const o=new Set((n==null?void 0:n.visibleAttachments)??[]),u=new Set,f=new Map;for(const d of o){if(!d.path&&!d.sha1)continue;const p=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(p){const m=p[1],y=p[2],b=f.get(m)||{expected:void 0,actual:void 0,diff:void 0};b[y]=d,f.set(m,b),o.delete(d)}else d.contentType.startsWith("image/")&&(u.add(d),o.delete(d))}return{diffMap:f,attachments:o,screenshots:u}},[n]);return!i.size&&!s.size&&!l.size?v.jsx(ts,{text:"No attachments"}):v.jsxs("div",{className:"attachments-tab",children:[[...i.values()].map(({expected:o,actual:u,diff:f})=>v.jsxs(v.Fragment,{children:[o&&u&&v.jsx("div",{className:"attachments-section",children:"Image diff"}),o&&u&&v.jsx(Ix,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...o,path:Oo(o)},title:"Expected"},actual:{attachment:{...u,path:Oo(u)}},diff:f?{attachment:{...f,path:Oo(f)}}:void 0}})]})),s.size?v.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...s.values()].map((o,u)=>{const f=sc(o);return v.jsxs("div",{className:"attachment-item",children:[v.jsx("div",{children:v.jsx("img",{draggable:"false",src:f})}),v.jsx("div",{children:v.jsx("a",{target:"_blank",href:f,rel:"noreferrer",children:o.name})})]},`screenshot-${u}`)}),l.size?v.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...l.values()].map((o,u)=>v.jsx("div",{className:"attachment-item",children:v.jsx(t_,{attachment:o,reveal:e&&i_(o,e[0])?e:void 0})},s_(o,u)))]})};function i_(n,e){return n.name===e.name&&n.path===e.path&&n.sha1===e.sha1}function sc(n,e={}){const i=new URLSearchParams(e);return n.sha1?(i.set("trace",n.traceUrl),"sha1/"+n.sha1+"?"+i.toString()):(i.set("path",n.path),"file?"+i.toString())}function Oo(n){const e={dn:n.name};return n.contentType&&(e.dct=n.contentType),sc(n,e)}function s_(n,e){return e+"-"+(n.sha1?"sha1-"+n.sha1:"path-"+n.path)}const r_=`
|
|
60
60
|
# Instructions
|
|
61
61
|
|
|
@@ -110,7 +110,7 @@ ${l}}`}stringLiteral(e){return JSON.stringify(e)}}class k_{generatePlaywrightReq
|
|
|
110
110
|
`+" ".repeat(l.pos)+`^
|
|
111
111
|
`;return s.push({message:o,range:[i.lineCounter.linePos(e.range[0]),i.lineCounter.linePos(e.range[0]+l.pos)]}),null}throw l}}constructor(e){this._input=e,this._pos=0,this._length=e.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos<this._length?this._input[this._pos++]:null}_eof(){return this._pos>=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(e){this._eof()&&this._throwError(`Unexpected end of input when expecting ${e}`);const i=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(i,this._pos)}_readString(){let e="",i=!1;for(;!this._eof();){const s=this._next();if(i)e+=s,i=!1;else if(s==="\\")i=!0;else{if(s==='"')return e;e+=s}}this._throwError("Unterminated string")}_throwError(e,i=0){throw new zy(e,i||this._pos)}_readRegex(){let e="",i=!1,s=!1;for(;!this._eof();){const l=this._next();if(i)e+=l,i=!1;else if(l==="\\")i=!0,e+=l;else{if(l==="/"&&!s)return{pattern:e};l==="["?(s=!0,e+=l):l==="]"&&s?(e+=l,s=!1):e+=l}}this._throwError("Unterminated regex")}_readStringOrRegex(){const e=this._peek();return e==='"'?(this._next(),ab(this._readString())):e==="/"?(this._next(),this._readRegex()):null}_readAttributes(e){let i=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),i=this._pos;const s=this._readIdentifier("attribute");this._skipWhitespace();let l="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),i=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)l+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(e,s,l||"true",i)}}_parse(){this._skipWhitespace();const e=this._readIdentifier("role");this._skipWhitespace();const i=this._readStringOrRegex()||"",s={kind:"role",role:e,name:i};return this._readAttributes(s),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),s}_applyAttribute(e,i,s,l){if(i==="checked"){this._assert(s==="true"||s==="false"||s==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',l),e.checked=s==="true"?!0:s==="false"?!1:"mixed";return}if(i==="disabled"){this._assert(s==="true"||s==="false",'Value of "disabled" attribute must be a boolean',l),e.disabled=s==="true";return}if(i==="expanded"){this._assert(s==="true"||s==="false",'Value of "expanded" attribute must be a boolean',l),e.expanded=s==="true";return}if(i==="active"){this._assert(s==="true"||s==="false",'Value of "active" attribute must be a boolean',l),e.active=s==="true";return}if(i==="level"){this._assert(!isNaN(Number(s)),'Value of "level" attribute must be a number',l),e.level=Number(s);return}if(i==="pressed"){this._assert(s==="true"||s==="false"||s==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',l),e.pressed=s==="true"?!0:s==="false"?!1:"mixed";return}if(i==="selected"){this._assert(s==="true"||s==="false",'Value of "selected" attribute must be a boolean',l),e.selected=s==="true";return}this._assert(!1,`Unsupported attribute [${i}]`,l)}_assert(e,i,s){e||this._throwError(i||"Assertion error",s)}}class zy extends Error{constructor(e,i){super(e),this.pos=i}}let lb={};function sT(n){lb=n}function Va(n,e){for(;e;){if(n.contains(e))return!0;e=cb(e)}return!1}function bt(n){if(n.parentElement)return n.parentElement;if(n.parentNode&&n.parentNode.nodeType===11&&n.parentNode.host)return n.parentNode.host}function ob(n){let e=n;for(;e.parentNode;)e=e.parentNode;if(e.nodeType===11||e.nodeType===9)return e}function cb(n){for(;n.parentElement;)n=n.parentElement;return bt(n)}function ka(n,e,i){for(;n;){const s=n.closest(e);if(i&&s!==i&&(s!=null&&s.contains(i)))return;if(s)return s;n=cb(n)}}function wi(n,e){const i=e==="::before"?Hh:e==="::after"?zh:Uh;if(i&&i.has(n))return i.get(n);const s=n.ownerDocument&&n.ownerDocument.defaultView?n.ownerDocument.defaultView.getComputedStyle(n,e):void 0;return i==null||i.set(n,s),s}function ub(n,e){if(e=e??wi(n),!e)return!0;if(Element.prototype.checkVisibility&&lb.browserNameForWorkarounds!=="webkit"){if(!n.checkVisibility())return!1}else{const i=n.closest("details,summary");if(i!==n&&(i==null?void 0:i.nodeName)==="DETAILS"&&!i.open)return!1}return e.visibility==="visible"}function Xo(n){const e=wi(n);if(!e)return{visible:!0,inline:!1};if(e.display==="contents"){for(let s=n.firstChild;s;s=s.nextSibling){if(s.nodeType===1&&yi(s))return{visible:!0,inline:!1,style:e};if(s.nodeType===3&&fb(s))return{visible:!0,inline:!0,style:e}}return{visible:!1,inline:!1,style:e}}if(!ub(n,e))return{style:e,visible:!1,inline:!1};const i=n.getBoundingClientRect();return{rect:i,style:e,visible:i.width>0&&i.height>0,inline:e.display==="inline"}}function yi(n){return Xo(n).visible}function fb(n){const e=n.ownerDocument.createRange();e.selectNode(n);const i=e.getBoundingClientRect();return i.width>0&&i.height>0}function at(n){const e=n.tagName;return typeof e=="string"?e.toUpperCase():n instanceof HTMLFormElement?"FORM":n.tagName.toUpperCase()}let Uh,Hh,zh,hb=0;function qh(){++hb,Uh??(Uh=new Map),Hh??(Hh=new Map),zh??(zh=new Map)}function $h(){--hb||(Uh=void 0,Hh=void 0,zh=void 0)}function qy(n){return n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby")}const $y="article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]",rT=[["aria-atomic",void 0],["aria-busy",void 0],["aria-controls",void 0],["aria-current",void 0],["aria-describedby",void 0],["aria-details",void 0],["aria-dropeffect",void 0],["aria-flowto",void 0],["aria-grabbed",void 0],["aria-hidden",void 0],["aria-keyshortcuts",void 0],["aria-label",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-labelledby",["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"]],["aria-live",void 0],["aria-owns",void 0],["aria-relevant",void 0],["aria-roledescription",["generic"]]];function db(n,e){return rT.some(([i,s])=>!(s!=null&&s.includes(e||""))&&n.hasAttribute(i))}function pb(n){return!Number.isNaN(Number(String(n.getAttribute("tabindex"))))}function aT(n){return!Ab(n)&&(lT(n)||pb(n))}function lT(n){const e=at(n);return["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(e)?!0:e==="A"||e==="AREA"?n.hasAttribute("href"):e==="INPUT"?!n.hidden:!1}const Xf={A:n=>n.hasAttribute("href")?"link":null,AREA:n=>n.hasAttribute("href")?"link":null,ARTICLE:()=>"article",ASIDE:()=>"complementary",BLOCKQUOTE:()=>"blockquote",BUTTON:()=>"button",CAPTION:()=>"caption",CODE:()=>"code",DATALIST:()=>"listbox",DD:()=>"definition",DEL:()=>"deletion",DETAILS:()=>"group",DFN:()=>"term",DIALOG:()=>"dialog",DT:()=>"term",EM:()=>"emphasis",FIELDSET:()=>"group",FIGURE:()=>"figure",FOOTER:n=>ka(n,$y)?null:"contentinfo",FORM:n=>qy(n)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:n=>ka(n,$y)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:n=>n.getAttribute("alt")===""&&!n.getAttribute("title")&&!db(n)&&!pb(n)?"presentation":"img",INPUT:n=>{const e=n.type.toLowerCase();if(e==="search")return n.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(e)){const i=hr(n,n.getAttribute("list"))[0];return i&&at(i)==="DATALIST"?"combobox":"textbox"}return e==="hidden"?null:e==="file"?"button":_T[e]||"textbox"},INS:()=>"insertion",LI:()=>"listitem",MAIN:()=>"main",MARK:()=>"mark",MATH:()=>"math",MENU:()=>"list",METER:()=>"meter",NAV:()=>"navigation",OL:()=>"list",OPTGROUP:()=>"group",OPTION:()=>"option",OUTPUT:()=>"status",P:()=>"paragraph",PROGRESS:()=>"progressbar",SEARCH:()=>"search",SECTION:n=>qy(n)?"region":null,SELECT:n=>n.hasAttribute("multiple")||n.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:n=>{const e=ka(n,"table"),i=e?Po(e):"";return i==="grid"||i==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:n=>{if(n.getAttribute("scope")==="col")return"columnheader";if(n.getAttribute("scope")==="row")return"rowheader";const e=ka(n,"table"),i=e?Po(e):"";return i==="grid"||i==="treegrid"?"gridcell":"cell"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"},oT={DD:["DL","DIV"],DIV:["DL"],DT:["DL","DIV"],LI:["OL","UL"],TBODY:["TABLE"],TD:["TR"],TFOOT:["TABLE"],TH:["TR"],THEAD:["TABLE"],TR:["THEAD","TBODY","TFOOT","TABLE"]};function Iy(n){var s;const e=((s=Xf[at(n)])==null?void 0:s.call(Xf,n))||"";if(!e)return null;let i=n;for(;i;){const l=bt(i),o=oT[at(i)];if(!o||!l||!o.includes(at(l)))break;const u=Po(l);if((u==="none"||u==="presentation")&&!gb(l,u))return u;i=l}return e}const cT=["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","mark","marquee","math","meter","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem"];function Po(n){return(n.getAttribute("role")||"").split(" ").map(i=>i.trim()).find(i=>cT.includes(i))||null}function gb(n,e){return db(n,e)||aT(n)}function pt(n){const e=Po(n);if(!e)return Iy(n);if(e==="none"||e==="presentation"){const i=Iy(n);if(gb(n,i))return i}return e}function mb(n){return n===null?void 0:n.toLowerCase()==="true"}function yb(n){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(at(n))}function rn(n){if(yb(n))return!0;const e=wi(n),i=n.nodeName==="SLOT";if((e==null?void 0:e.display)==="contents"&&!i){for(let l=n.firstChild;l;l=l.nextSibling)if(l.nodeType===1&&!rn(l)||l.nodeType===3&&fb(l))return!1;return!0}return!(n.nodeName==="OPTION"&&!!n.closest("select"))&&!i&&!ub(n,e)?!0:bb(n)}function bb(n){let e=mi==null?void 0:mi.get(n);if(e===void 0){if(e=!1,n.parentElement&&n.parentElement.shadowRoot&&!n.assignedSlot&&(e=!0),!e){const i=wi(n);e=!i||i.display==="none"||mb(n.getAttribute("aria-hidden"))===!0}if(!e){const i=bt(n);i&&(e=bb(i))}mi==null||mi.set(n,e)}return e}function hr(n,e){if(!e)return[];const i=ob(n);if(!i)return[];try{const s=e.split(" ").filter(o=>!!o),l=[];for(const o of s){const u=i.querySelector("#"+CSS.escape(o));u&&!l.includes(u)&&l.push(u)}return l}catch{return[]}}function In(n){return n.trim()}function Da(n){return n.split(" ").map(e=>e.replace(/\r\n/g,`
|
|
112
112
|
`).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join(" ").trim()}function Vy(n,e){const i=[...n.querySelectorAll(e)];for(const s of hr(n,n.getAttribute("aria-owns")))s.matches(e)&&i.push(s),i.push(...s.querySelectorAll(e));return i}function Ba(n,e){const i=e==="::before"?Wh:e==="::after"?ed:Jh;if(i!=null&&i.has(n))return i==null?void 0:i.get(n);const s=wi(n,e);let l;if(s){const o=s.content;o&&o!=="none"&&o!=="normal"&&s.display!=="none"&&s.visibility!=="hidden"&&(l=uT(n,o,!!e))}return e&&l!==void 0&&((s==null?void 0:s.display)||"inline")!=="inline"&&(l=" "+l+" "),i&&i.set(n,l),l}function uT(n,e,i){if(!(!e||e==="none"||e==="normal"))try{let s=N0(e).filter(f=>!(f instanceof Io));const l=s.findIndex(f=>f instanceof ht&&f.value==="/");if(l!==-1)s=s.slice(l+1);else if(!i)return;const o=[];let u=0;for(;u<s.length;)if(s[u]instanceof Lh)o.push(s[u].value),u++;else if(u+2<s.length&&s[u]instanceof ja&&s[u].value==="attr"&&s[u+1]instanceof Oh&&s[u+2]instanceof Mh){const f=s[u+1].value;o.push(n.getAttribute(f)||""),u+=3}else return;return o.join("")}catch{}}function vb(n){const e=n.getAttribute("aria-labelledby");if(e===null)return null;const i=hr(n,e);return i.length?i:null}function fT(n,e){const i=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(n),s=e&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(n);return i||s}function Ga(n,e){const i=e?Fh:Ph;let s=i==null?void 0:i.get(n);return s===void 0&&(s="",["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(pt(n)||"")||(s=Da(pn(n,{includeHidden:e,visitedElements:new Set,embeddedInTargetElement:"self"}))),i==null||i.set(n,s)),s}function Gy(n,e){const i=e?Zh:Qh;let s=i==null?void 0:i.get(n);if(s===void 0){if(s="",n.hasAttribute("aria-describedby")){const l=hr(n,n.getAttribute("aria-describedby"));s=Da(l.map(o=>pn(o,{includeHidden:e,visitedElements:new Set,embeddedInDescribedBy:{element:o,hidden:rn(o)}})).join(" "))}else n.hasAttribute("aria-description")?s=Da(n.getAttribute("aria-description")||""):s=Da(n.getAttribute("title")||"");i==null||i.set(n,s)}return s}function hT(n){const e=n.getAttribute("aria-invalid");return!e||e.trim()===""||e.toLocaleLowerCase()==="false"?"false":e==="true"||e==="grammar"||e==="spelling"?e:"true"}function dT(n){if("validity"in n){const e=n.validity;return(e==null?void 0:e.valid)===!1}return!1}function pT(n){const e=Js;let i=Js==null?void 0:Js.get(n);if(i===void 0){i="";const s=hT(n)!=="false",l=dT(n);if(s||l){const o=n.getAttribute("aria-errormessage");i=hr(n,o).map(d=>Da(pn(d,{visitedElements:new Set,embeddedInDescribedBy:{element:d,hidden:rn(d)}}))).join(" ").trim()}e==null||e.set(n,i)}return i}function pn(n,e){var d,p,m,y;if(e.visitedElements.has(n))return"";const i={...e,embeddedInTargetElement:e.embeddedInTargetElement==="self"?"descendant":e.embeddedInTargetElement};if(!e.includeHidden){const b=!!((d=e.embeddedInLabelledBy)!=null&&d.hidden)||!!((p=e.embeddedInDescribedBy)!=null&&p.hidden)||!!((m=e.embeddedInNativeTextAlternative)!=null&&m.hidden)||!!((y=e.embeddedInLabel)!=null&&y.hidden);if(yb(n)||!b&&rn(n))return e.visitedElements.add(n),""}const s=vb(n);if(!e.embeddedInLabelledBy){const b=(s||[]).map(w=>pn(w,{...e,embeddedInLabelledBy:{element:w,hidden:rn(w)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(b)return b}const l=pt(n)||"",o=at(n);if(e.embeddedInLabel||e.embeddedInLabelledBy||e.embeddedInTargetElement==="descendant"){const b=[...n.labels||[]].includes(n),w=(s||[]).includes(n);if(!b&&!w){if(l==="textbox")return e.visitedElements.add(n),o==="INPUT"||o==="TEXTAREA"?n.value:n.textContent||"";if(["combobox","listbox"].includes(l)){e.visitedElements.add(n);let E;if(o==="SELECT")E=[...n.selectedOptions],!E.length&&n.options.length&&E.push(n.options[0]);else{const x=l==="combobox"?Vy(n,"*").find(T=>pt(T)==="listbox"):n;E=x?Vy(x,'[aria-selected="true"]').filter(T=>pt(T)==="option"):[]}return!E.length&&o==="INPUT"?n.value:E.map(x=>pn(x,i)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(l))return e.visitedElements.add(n),n.hasAttribute("aria-valuetext")?n.getAttribute("aria-valuetext")||"":n.hasAttribute("aria-valuenow")?n.getAttribute("aria-valuenow")||"":n.getAttribute("value")||"";if(["menu"].includes(l))return e.visitedElements.add(n),""}}const u=n.getAttribute("aria-label")||"";if(In(u))return e.visitedElements.add(n),u;if(!["presentation","none"].includes(l)){if(o==="INPUT"&&["button","submit","reset"].includes(n.type)){e.visitedElements.add(n);const b=n.value||"";return In(b)?b:n.type==="submit"?"Submit":n.type==="reset"?"Reset":n.getAttribute("title")||""}if(o==="INPUT"&&n.type==="file"){e.visitedElements.add(n);const b=n.labels||[];return b.length&&!e.embeddedInLabelledBy?wa(b,e):"Choose File"}if(o==="INPUT"&&n.type==="image"){e.visitedElements.add(n);const b=n.labels||[];if(b.length&&!e.embeddedInLabelledBy)return wa(b,e);const w=n.getAttribute("alt")||"";if(In(w))return w;const E=n.getAttribute("title")||"";return In(E)?E:"Submit"}if(!s&&o==="BUTTON"){e.visitedElements.add(n);const b=n.labels||[];if(b.length)return wa(b,e)}if(!s&&o==="OUTPUT"){e.visitedElements.add(n);const b=n.labels||[];return b.length?wa(b,e):n.getAttribute("title")||""}if(!s&&(o==="TEXTAREA"||o==="SELECT"||o==="INPUT")){e.visitedElements.add(n);const b=n.labels||[];if(b.length)return wa(b,e);const w=o==="INPUT"&&["text","password","search","tel","email","url"].includes(n.type)||o==="TEXTAREA",E=n.getAttribute("placeholder")||"",x=n.getAttribute("title")||"";return!w||x?x:E}if(!s&&o==="FIELDSET"){e.visitedElements.add(n);for(let w=n.firstElementChild;w;w=w.nextElementSibling)if(at(w)==="LEGEND")return pn(w,{...i,embeddedInNativeTextAlternative:{element:w,hidden:rn(w)}});return n.getAttribute("title")||""}if(!s&&o==="FIGURE"){e.visitedElements.add(n);for(let w=n.firstElementChild;w;w=w.nextElementSibling)if(at(w)==="FIGCAPTION")return pn(w,{...i,embeddedInNativeTextAlternative:{element:w,hidden:rn(w)}});return n.getAttribute("title")||""}if(o==="IMG"){e.visitedElements.add(n);const b=n.getAttribute("alt")||"";return In(b)?b:n.getAttribute("title")||""}if(o==="TABLE"){e.visitedElements.add(n);for(let w=n.firstElementChild;w;w=w.nextElementSibling)if(at(w)==="CAPTION")return pn(w,{...i,embeddedInNativeTextAlternative:{element:w,hidden:rn(w)}});const b=n.getAttribute("summary")||"";if(b)return b}if(o==="AREA"){e.visitedElements.add(n);const b=n.getAttribute("alt")||"";return In(b)?b:n.getAttribute("title")||""}if(o==="SVG"||n.ownerSVGElement){e.visitedElements.add(n);for(let b=n.firstElementChild;b;b=b.nextElementSibling)if(at(b)==="TITLE"&&b.ownerSVGElement)return pn(b,{...i,embeddedInLabelledBy:{element:b,hidden:rn(b)}})}if(n.ownerSVGElement&&o==="A"){const b=n.getAttribute("xlink:title")||"";if(In(b))return e.visitedElements.add(n),b}}const f=o==="SUMMARY"&&!["presentation","none"].includes(l);if(fT(l,e.embeddedInTargetElement==="descendant")||f||e.embeddedInLabelledBy||e.embeddedInDescribedBy||e.embeddedInLabel||e.embeddedInNativeTextAlternative){e.visitedElements.add(n);const b=gT(n,i);if(e.embeddedInTargetElement==="self"?In(b):b)return b}if(!["presentation","none"].includes(l)||o==="IFRAME"){e.visitedElements.add(n);const b=n.getAttribute("title")||"";if(In(b))return b}return e.visitedElements.add(n),""}function gT(n,e){const i=[],s=(o,u)=>{var f;if(!(u&&o.assignedSlot))if(o.nodeType===1){const d=((f=wi(o))==null?void 0:f.display)||"inline";let p=pn(o,e);(d!=="inline"||o.nodeName==="BR")&&(p=" "+p+" "),i.push(p)}else o.nodeType===3&&i.push(o.textContent||"")};i.push(Ba(n,"::before")||"");const l=Ba(n);if(l!==void 0)i.push(l);else{const o=n.nodeName==="SLOT"?n.assignedNodes():[];if(o.length)for(const u of o)s(u,!1);else{for(let u=n.firstChild;u;u=u.nextSibling)s(u,!0);if(n.shadowRoot)for(let u=n.shadowRoot.firstChild;u;u=u.nextSibling)s(u,!0);for(const u of hr(n,n.getAttribute("aria-owns")))s(u,!0)}}return i.push(Ba(n,"::after")||""),i.join("")}const Ih=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function Sb(n){return at(n)==="OPTION"?n.selected:Ih.includes(pt(n)||"")?mb(n.getAttribute("aria-selected"))===!0:!1}const Vh=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function wb(n){const e=Gh(n,!0);return e==="error"?!1:e}function mT(n){return Gh(n,!0)}function yT(n){return Gh(n,!1)}function Gh(n,e){const i=at(n);if(e&&i==="INPUT"&&n.indeterminate)return"mixed";if(i==="INPUT"&&["checkbox","radio"].includes(n.type))return n.checked;if(Vh.includes(pt(n)||"")){const s=n.getAttribute("aria-checked");return s==="true"?!0:e&&s==="mixed"?"mixed":!1}return"error"}const bT=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function vT(n){const e=at(n);return["INPUT","TEXTAREA","SELECT"].includes(e)?n.hasAttribute("readonly"):bT.includes(pt(n)||"")?n.getAttribute("aria-readonly")==="true":n.isContentEditable?!1:"error"}const Kh=["button"];function xb(n){if(Kh.includes(pt(n)||"")){const e=n.getAttribute("aria-pressed");if(e==="true")return!0;if(e==="mixed")return"mixed"}return!1}const Yh=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function _b(n){if(at(n)==="DETAILS")return n.open;if(Yh.includes(pt(n)||"")){const e=n.getAttribute("aria-expanded");return e===null?void 0:e==="true"}}const Xh=["heading","listitem","row","treeitem"];function Tb(n){const e={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[at(n)];if(e)return e;if(Xh.includes(pt(n)||"")){const i=n.getAttribute("aria-level"),s=i===null?Number.NaN:Number(i);if(Number.isInteger(s)&&s>=1)return s}return 0}const Eb=["application","button","composite","gridcell","group","input","link","menuitem","scrollbar","separator","tab","checkbox","columnheader","combobox","grid","listbox","menu","menubar","menuitemcheckbox","menuitemradio","option","radio","radiogroup","row","rowheader","searchbox","select","slider","spinbutton","switch","tablist","textbox","toolbar","tree","treegrid","treeitem"];function Fo(n){return Ab(n)||Nb(n)}function Ab(n){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(at(n))&&(n.hasAttribute("disabled")||ST(n)||wT(n))}function ST(n){return at(n)==="OPTION"&&!!n.closest("OPTGROUP[DISABLED]")}function wT(n){const e=n==null?void 0:n.closest("FIELDSET[DISABLED]");if(!e)return!1;const i=e.querySelector(":scope > LEGEND");return!i||!i.contains(n)}function Nb(n,e=!1){if(!n)return!1;if(e||Eb.includes(pt(n)||"")){const i=(n.getAttribute("aria-disabled")||"").toLowerCase();return i==="true"?!0:i==="false"?!1:Nb(bt(n),!0)}return!1}function wa(n,e){return[...n].map(i=>pn(i,{...e,embeddedInLabel:{element:i,hidden:rn(i)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(i=>!!i).join(" ")}function xT(n){const e=td;let i=n,s;const l=[];for(;i;i=bt(i)){const o=e.get(i);if(o!==void 0){s=o;break}l.push(i);const u=wi(i);if(!u){s=!0;break}const f=u.pointerEvents;if(f){s=f!=="none";break}}s===void 0&&(s=!0);for(const o of l)e.set(o,s);return s}let Ph,Fh,Qh,Zh,Js,mi,Jh,Wh,ed,td,Cb=0;function rc(){qh(),++Cb,Ph??(Ph=new Map),Fh??(Fh=new Map),Qh??(Qh=new Map),Zh??(Zh=new Map),Js??(Js=new Map),mi??(mi=new Map),Jh??(Jh=new Map),Wh??(Wh=new Map),ed??(ed=new Map),td??(td=new Map)}function ac(){--Cb||(Ph=void 0,Fh=void 0,Qh=void 0,Zh=void 0,Js=void 0,mi=void 0,Jh=void 0,Wh=void 0,ed=void 0,td=void 0),$h()}const _T={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};function TT(n){return kb(n)?"'"+n.replace(/'/g,"''")+"'":n}function Pf(n){return kb(n)?'"'+n.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,e=>{switch(e){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case`
|
|
113
|
-
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+e.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':n}function kb(n){return!!(n.length===0||/^\s|\s$/.test(n)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(n)||/^-/.test(n)||/[\n:](\s|$)/.test(n)||/\s#/.test(n)||/[\n\r]/.test(n)||/^[&*\],?!>|@"'#%]/.test(n)||/[{}`]/.test(n)||/^\[/.test(n)||!isNaN(Number(n))||["y","n","yes","no","true","false","on","off","null"].includes(n.toLowerCase()))}let ET=0;function Mb(n){return n.mode==="ai"?{visibility:"ariaOrVisible",refs:"interactable",refPrefix:n.refPrefix,includeGenericRole:!0,renderActive:!0,renderCursorPointer:!0}:n.mode==="autoexpect"?{visibility:"ariaAndVisible",refs:"none"}:n.mode==="codegen"?{visibility:"aria",refs:"none",renderStringsAsRegex:!0}:{visibility:"aria",refs:"none"}}function Ua(n,e){const i=Mb(e),s=new Set,l={root:{role:"fragment",name:"",children:[],element:n,props:{},box:Xo(n),receivesPointerEvents:!0},elements:new Map,refs:new Map},o=(f,d,p)=>{if(s.has(d))return;if(s.add(d),d.nodeType===Node.TEXT_NODE&&d.nodeValue){if(!p)return;const x=d.nodeValue;f.role!=="textbox"&&x&&f.children.push(d.nodeValue||"");return}if(d.nodeType!==Node.ELEMENT_NODE)return;const m=d,y=!rn(m);let b=y;if(i.visibility==="ariaOrVisible"&&(b=y||yi(m)),i.visibility==="ariaAndVisible"&&(b=y&&yi(m)),i.visibility==="aria"&&!b)return;const w=[];if(m.hasAttribute("aria-owns")){const x=m.getAttribute("aria-owns").split(/\s+/);for(const T of x){const M=n.ownerDocument.getElementById(T);M&&w.push(M)}}const E=b?AT(m,i):null;E&&(E.ref&&(l.elements.set(E.ref,m),l.refs.set(m,E.ref)),f.children.push(E)),u(E||f,m,w,b)};function u(f,d,p,m){var E;const b=(((E=wi(d))==null?void 0:E.display)||"inline")!=="inline"||d.nodeName==="BR"?" ":"";b&&f.children.push(b),f.children.push(Ba(d,"::before")||"");const w=d.nodeName==="SLOT"?d.assignedNodes():[];if(w.length)for(const x of w)o(f,x,m);else{for(let x=d.firstChild;x;x=x.nextSibling)x.assignedSlot||o(f,x,m);if(d.shadowRoot)for(let x=d.shadowRoot.firstChild;x;x=x.nextSibling)o(f,x,m)}for(const x of p)o(f,x,m);if(f.children.push(Ba(d,"::after")||""),b&&f.children.push(b),f.children.length===1&&f.name===f.children[0]&&(f.children=[]),f.role==="link"&&d.hasAttribute("href")){const x=d.getAttribute("href");f.props.url=x}if(f.role==="textbox"&&d.hasAttribute("placeholder")&&d.getAttribute("placeholder")!==f.name){const x=d.getAttribute("placeholder");f.props.placeholder=x}}rc();try{o(l.root,n,!0)}finally{ac()}return CT(l.root),NT(l.root),l}function Ky(n,e){if(e.refs==="none"||e.refs==="interactable"&&(!n.box.visible||!n.receivesPointerEvents))return;let i;i=n.element._ariaRef,(!i||i.role!==n.role||i.name!==n.name)&&(i={role:n.role,name:n.name,ref:(e.refPrefix??"")+"e"+ ++ET},n.element._ariaRef=i),n.ref=i.ref}function AT(n,e){const i=n.ownerDocument.activeElement===n;if(n.nodeName==="IFRAME"){const p={role:"iframe",name:"",children:[],props:{},element:n,box:Xo(n),receivesPointerEvents:!0,active:i};return Ky(p,e),p}const s=e.includeGenericRole?"generic":null,l=pt(n)??s;if(!l||l==="presentation"||l==="none")return null;const o=Et(Ga(n,!1)||""),u=xT(n),f=Xo(n);if(l==="generic"&&f.inline&&n.childNodes.length===1&&n.childNodes[0].nodeType===Node.TEXT_NODE)return null;const d={role:l,name:o,children:[],props:{},element:n,box:f,receivesPointerEvents:u,active:i};return Ky(d,e),Vh.includes(l)&&(d.checked=wb(n)),Eb.includes(l)&&(d.disabled=Fo(n)),Yh.includes(l)&&(d.expanded=_b(n)),Xh.includes(l)&&(d.level=Tb(n)),Kh.includes(l)&&(d.pressed=xb(n)),Ih.includes(l)&&(d.selected=Sb(n)),(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&n.type!=="checkbox"&&n.type!=="radio"&&n.type!=="file"&&(d.children=[n.value]),d}function NT(n){const e=i=>{const s=[];for(const o of i.children||[]){if(typeof o=="string"){s.push(o);continue}const u=e(o);s.push(...u)}return i.role==="generic"&&s.length<=1&&s.every(o=>typeof o!="string"&&!!o.ref)?s:(i.children=s,[i])};e(n)}function CT(n){const e=(s,l)=>{if(!s.length)return;const o=Et(s.join(""));o&&l.push(o),s.length=0},i=s=>{const l=[],o=[];for(const u of s.children||[])typeof u=="string"?o.push(u):(e(o,l),i(u),l.push(u));e(o,l),s.children=l.length?l:[],s.children.length===1&&s.children[0]===s.name&&(s.children=[])};i(n)}function kT(n,e){return e?n?typeof e=="string"?n===e:!!n.match(new RegExp(e.pattern)):!1:!0}function Yy(n,e){if(!(e!=null&&e.normalized))return!0;if(!n)return!1;if(n===e.normalized||n===e.raw)return!0;const i=MT(e);return i?!!n.match(i):!1}const Ff=Symbol("cachedRegex");function MT(n){if(n[Ff]!==void 0)return n[Ff];const{raw:e}=n,i=e.startsWith("/")&&e.endsWith("/")&&e.length>1;let s;try{s=i?new RegExp(e.slice(1,-1)):null}catch{s=null}return n[Ff]=s,s}function OT(n,e){const i=Ua(n,{mode:"expect"});return{matches:Ob(i.root,e,!1,!1),received:{raw:Qo(i,{mode:"expect"}),regex:Qo(i,{mode:"codegen"})}}}function LT(n,e){const i=Ua(n,{mode:"expect"}).root;return Ob(i,e,!0,!1).map(l=>l.element)}function nd(n,e,i){var s;return typeof n=="string"&&e.kind==="text"?Yy(n,e.text):n===null||typeof n!="object"||e.kind!=="role"||e.role!=="fragment"&&e.role!==n.role||e.checked!==void 0&&e.checked!==n.checked||e.disabled!==void 0&&e.disabled!==n.disabled||e.expanded!==void 0&&e.expanded!==n.expanded||e.level!==void 0&&e.level!==n.level||e.pressed!==void 0&&e.pressed!==n.pressed||e.selected!==void 0&&e.selected!==n.selected||!kT(n.name,e.name)||!Yy(n.props.url,(s=e.props)==null?void 0:s.url)?!1:e.containerMode==="contain"?Py(n.children||[],e.children||[]):e.containerMode==="equal"?Xy(n.children||[],e.children||[],!1):e.containerMode==="deep-equal"||i?Xy(n.children||[],e.children||[],!0):Py(n.children||[],e.children||[])}function Xy(n,e,i){if(e.length!==n.length)return!1;for(let s=0;s<e.length;++s)if(!nd(n[s],e[s],i))return!1;return!0}function Py(n,e){if(e.length>n.length)return!1;const i=n.slice(),s=e.slice();for(const l of s){let o=i.shift();for(;o&&!nd(o,l,!1);)o=i.shift();if(!o)return!1}return!0}function Ob(n,e,i,s){const l=[],o=(u,f)=>{if(nd(u,e,s)){const d=typeof u=="string"?f:u;return d&&l.push(d),!i}if(typeof u=="string")return!1;for(const d of u.children||[])if(o(d,u))return!0;return!1};return o(n,null),l}function Qo(n,e){const i=Mb(e),s=[],l=i.renderStringsAsRegex?jT:()=>!0,o=i.renderStringsAsRegex?RT:d=>d,u=(d,p,m,y)=>{if(typeof d=="string"){if(p&&!l(p,d))return;const T=Pf(o(d));T&&s.push(m+"- text: "+T);return}let b=d.role;if(d.name&&d.name.length<=900){const T=o(d.name);if(T){const M=T.startsWith("/")&&T.endsWith("/")?T:JSON.stringify(T);b+=" "+M}}d.checked==="mixed"&&(b+=" [checked=mixed]"),d.checked===!0&&(b+=" [checked]"),d.disabled&&(b+=" [disabled]"),d.expanded&&(b+=" [expanded]"),d.active&&i.renderActive&&(b+=" [active]"),d.level&&(b+=` [level=${d.level}]`),d.pressed==="mixed"&&(b+=" [pressed=mixed]"),d.pressed===!0&&(b+=" [pressed]"),d.selected===!0&&(b+=" [selected]");let w=!1;d.ref&&(b+=` [ref=${d.ref}]`,y&&DT(d)&&(w=!0,b+=" [cursor=pointer]"));const E=m+"- "+TT(b),x=!!Object.keys(d.props).length;if(!d.children.length&&!x)s.push(E);else if(d.children.length===1&&typeof d.children[0]=="string"&&!x){const T=l(d,d.children[0])?o(d.children[0]):null;T?s.push(E+": "+Pf(T)):s.push(E)}else{s.push(E+":");for(const[T,M]of Object.entries(d.props))s.push(m+" - /"+T+": "+Pf(M));for(const T of d.children||[])u(T,d,m+" ",y&&!w)}},f=n.root;if(f.role==="fragment")for(const d of f.children||[])u(d,f,"",!!i.renderCursorPointer);else u(f,null,"",!!i.renderCursorPointer);return s.join(`
|
|
113
|
+
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+e.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':n}function kb(n){return!!(n.length===0||/^\s|\s$/.test(n)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(n)||/^-/.test(n)||/[\n:](\s|$)/.test(n)||/\s#/.test(n)||/[\n\r]/.test(n)||/^[&*\],?!>|@"'#%]/.test(n)||/[{}`]/.test(n)||/^\[/.test(n)||!isNaN(Number(n))||["y","n","yes","no","true","false","on","off","null"].includes(n.toLowerCase()))}let ET=0;function Mb(n){return n.mode==="ai"?{visibility:"ariaOrVisible",refs:"interactable",refPrefix:n.refPrefix,includeGenericRole:!0,renderActive:!0,renderCursorPointer:!0}:n.mode==="autoexpect"?{visibility:"ariaAndVisible",refs:"none"}:n.mode==="codegen"?{visibility:"aria",refs:"none",renderStringsAsRegex:!0}:{visibility:"aria",refs:"none"}}function Ua(n,e){const i=Mb(e),s=new Set,l={root:{role:"fragment",name:"",children:[],element:n,props:{},box:Xo(n),receivesPointerEvents:!0},elements:new Map,refs:new Map},o=(f,d,p)=>{if(s.has(d))return;if(s.add(d),d.nodeType===Node.TEXT_NODE&&d.nodeValue){if(!p)return;const x=d.nodeValue;f.role!=="textbox"&&x&&f.children.push(d.nodeValue||"");return}if(d.nodeType!==Node.ELEMENT_NODE)return;const m=d,y=!rn(m);let b=y;if(i.visibility==="ariaOrVisible"&&(b=y||yi(m)),i.visibility==="ariaAndVisible"&&(b=y&&yi(m)),i.visibility==="aria"&&!b)return;const w=[];if(m.hasAttribute("aria-owns")){const x=m.getAttribute("aria-owns").split(/\s+/);for(const T of x){const M=n.ownerDocument.getElementById(T);M&&w.push(M)}}const E=b?AT(m,i):null;E&&(E.ref&&(l.elements.set(E.ref,m),l.refs.set(m,E.ref)),f.children.push(E)),u(E||f,m,w,b)};function u(f,d,p,m){var E;const b=(((E=wi(d))==null?void 0:E.display)||"inline")!=="inline"||d.nodeName==="BR"?" ":"";b&&f.children.push(b),f.children.push(Ba(d,"::before")||"");const w=d.nodeName==="SLOT"?d.assignedNodes():[];if(w.length)for(const x of w)o(f,x,m);else{for(let x=d.firstChild;x;x=x.nextSibling)x.assignedSlot||o(f,x,m);if(d.shadowRoot)for(let x=d.shadowRoot.firstChild;x;x=x.nextSibling)o(f,x,m)}for(const x of p)o(f,x,m);if(f.children.push(Ba(d,"::after")||""),b&&f.children.push(b),f.children.length===1&&f.name===f.children[0]&&(f.children=[]),f.role==="link"&&d.hasAttribute("href")){const x=d.getAttribute("href");f.props.url=x}if(f.role==="textbox"&&d.hasAttribute("placeholder")&&d.getAttribute("placeholder")!==f.name){const x=d.getAttribute("placeholder");f.props.placeholder=x}}rc();try{o(l.root,n,!0)}finally{ac()}return CT(l.root),NT(l.root),l}function Ky(n,e){if(e.refs==="none"||e.refs==="interactable"&&(!n.box.visible||!n.receivesPointerEvents))return;let i;i=n.element._ariaRef,(!i||i.role!==n.role||i.name!==n.name)&&(i={role:n.role,name:n.name,ref:(e.refPrefix??"")+"e"+ ++ET},n.element._ariaRef=i),n.ref=i.ref}function AT(n,e){const i=n.ownerDocument.activeElement===n;if(n.nodeName==="IFRAME"){const p={role:"iframe",name:"",children:[],props:{},element:n,box:Xo(n),receivesPointerEvents:!0,active:i};return Ky(p,e),p}const s=e.includeGenericRole?"generic":null,l=pt(n)??s;if(!l||l==="presentation"||l==="none")return null;const o=Et(Ga(n,!1)||""),u=xT(n),f=Xo(n);if(l==="generic"&&f.inline&&n.childNodes.length===1&&n.childNodes[0].nodeType===Node.TEXT_NODE)return null;const d={role:l,name:o,children:[],props:{},element:n,box:f,receivesPointerEvents:u,active:i};return Ky(d,e),Vh.includes(l)&&(d.checked=wb(n)),Eb.includes(l)&&(d.disabled=Fo(n)),Yh.includes(l)&&(d.expanded=_b(n)),Xh.includes(l)&&(d.level=Tb(n)),Kh.includes(l)&&(d.pressed=xb(n)),Ih.includes(l)&&(d.selected=Sb(n)),(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&n.type!=="checkbox"&&n.type!=="radio"&&n.type!=="file"&&(d.children=[n.value]),d}function NT(n){const e=i=>{const s=[];for(const o of i.children||[]){if(typeof o=="string"){s.push(o);continue}const u=e(o);s.push(...u)}return i.role==="generic"&&!i.name&&s.length<=1&&s.every(o=>typeof o!="string"&&!!o.ref)?s:(i.children=s,[i])};e(n)}function CT(n){const e=(s,l)=>{if(!s.length)return;const o=Et(s.join(""));o&&l.push(o),s.length=0},i=s=>{const l=[],o=[];for(const u of s.children||[])typeof u=="string"?o.push(u):(e(o,l),i(u),l.push(u));e(o,l),s.children=l.length?l:[],s.children.length===1&&s.children[0]===s.name&&(s.children=[])};i(n)}function kT(n,e){return e?n?typeof e=="string"?n===e:!!n.match(new RegExp(e.pattern)):!1:!0}function Yy(n,e){if(!(e!=null&&e.normalized))return!0;if(!n)return!1;if(n===e.normalized||n===e.raw)return!0;const i=MT(e);return i?!!n.match(i):!1}const Ff=Symbol("cachedRegex");function MT(n){if(n[Ff]!==void 0)return n[Ff];const{raw:e}=n,i=e.startsWith("/")&&e.endsWith("/")&&e.length>1;let s;try{s=i?new RegExp(e.slice(1,-1)):null}catch{s=null}return n[Ff]=s,s}function OT(n,e){const i=Ua(n,{mode:"expect"});return{matches:Ob(i.root,e,!1,!1),received:{raw:Qo(i,{mode:"expect"}),regex:Qo(i,{mode:"codegen"})}}}function LT(n,e){const i=Ua(n,{mode:"expect"}).root;return Ob(i,e,!0,!1).map(l=>l.element)}function nd(n,e,i){var s;return typeof n=="string"&&e.kind==="text"?Yy(n,e.text):n===null||typeof n!="object"||e.kind!=="role"||e.role!=="fragment"&&e.role!==n.role||e.checked!==void 0&&e.checked!==n.checked||e.disabled!==void 0&&e.disabled!==n.disabled||e.expanded!==void 0&&e.expanded!==n.expanded||e.level!==void 0&&e.level!==n.level||e.pressed!==void 0&&e.pressed!==n.pressed||e.selected!==void 0&&e.selected!==n.selected||!kT(n.name,e.name)||!Yy(n.props.url,(s=e.props)==null?void 0:s.url)?!1:e.containerMode==="contain"?Py(n.children||[],e.children||[]):e.containerMode==="equal"?Xy(n.children||[],e.children||[],!1):e.containerMode==="deep-equal"||i?Xy(n.children||[],e.children||[],!0):Py(n.children||[],e.children||[])}function Xy(n,e,i){if(e.length!==n.length)return!1;for(let s=0;s<e.length;++s)if(!nd(n[s],e[s],i))return!1;return!0}function Py(n,e){if(e.length>n.length)return!1;const i=n.slice(),s=e.slice();for(const l of s){let o=i.shift();for(;o&&!nd(o,l,!1);)o=i.shift();if(!o)return!1}return!0}function Ob(n,e,i,s){const l=[],o=(u,f)=>{if(nd(u,e,s)){const d=typeof u=="string"?f:u;return d&&l.push(d),!i}if(typeof u=="string")return!1;for(const d of u.children||[])if(o(d,u))return!0;return!1};return o(n,null),l}function Qo(n,e){const i=Mb(e),s=[],l=i.renderStringsAsRegex?jT:()=>!0,o=i.renderStringsAsRegex?RT:d=>d,u=(d,p,m,y)=>{if(typeof d=="string"){if(p&&!l(p,d))return;const T=Pf(o(d));T&&s.push(m+"- text: "+T);return}let b=d.role;if(d.name&&d.name.length<=900){const T=o(d.name);if(T){const M=T.startsWith("/")&&T.endsWith("/")?T:JSON.stringify(T);b+=" "+M}}d.checked==="mixed"&&(b+=" [checked=mixed]"),d.checked===!0&&(b+=" [checked]"),d.disabled&&(b+=" [disabled]"),d.expanded&&(b+=" [expanded]"),d.active&&i.renderActive&&(b+=" [active]"),d.level&&(b+=` [level=${d.level}]`),d.pressed==="mixed"&&(b+=" [pressed=mixed]"),d.pressed===!0&&(b+=" [pressed]"),d.selected===!0&&(b+=" [selected]");let w=!1;d.ref&&(b+=` [ref=${d.ref}]`,y&&DT(d)&&(w=!0,b+=" [cursor=pointer]"));const E=m+"- "+TT(b),x=!!Object.keys(d.props).length;if(!d.children.length&&!x)s.push(E);else if(d.children.length===1&&typeof d.children[0]=="string"&&!x){const T=l(d,d.children[0])?o(d.children[0]):null;T?s.push(E+": "+Pf(T)):s.push(E)}else{s.push(E+":");for(const[T,M]of Object.entries(d.props))s.push(m+" - /"+T+": "+Pf(M));for(const T of d.children||[])u(T,d,m+" ",y&&!w)}},f=n.root;if(f.role==="fragment")for(const d of f.children||[])u(d,f,"",!!i.renderCursorPointer);else u(f,null,"",!!i.renderCursorPointer);return s.join(`
|
|
114
114
|
`)}function RT(n){const e=[{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}];let i="",s=0;const l=new RegExp(e.map(o=>"("+o.regex.source+")").join("|"),"g");return n.replace(l,(o,...u)=>{const f=u[u.length-2],d=u.slice(0,-2);i+=Go(n.slice(s,f));for(let p=0;p<d.length;p++)if(d[p]){const{replacement:m}=e[p];i+=m;break}return s=f+o.length,o}),i?(i+=Go(n.slice(s)),String(new RegExp(i))):n}function jT(n,e){if(!e.length)return!1;if(!n.name)return!0;if(n.name.length>e.length)return!1;const i=e.length<=200&&n.name.length<=200?Sx(e,n.name):"";let s=e;for(;i&&s.includes(i);)s=s.replace(i,"");return s.trim().length/e.length>.1}function DT(n){var e;return((e=n.box.style)==null?void 0:e.cursor)==="pointer"}const Fy=":host{font-size:13px;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;color:#333}svg{position:absolute;height:0}x-pw-tooltip{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:none;font-size:12.8px;font-weight:400;left:0;line-height:1.5;max-width:600px;position:absolute;top:0;padding:0;flex-direction:column;overflow:hidden}x-pw-tooltip-line{display:flex;max-width:600px;padding:6px;-webkit-user-select:none;user-select:none;cursor:pointer}x-pw-tooltip-footer{display:flex;max-width:600px;padding:6px;-webkit-user-select:none;user-select:none;color:#777}x-pw-dialog{background-color:#fff;pointer-events:auto;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:flex;flex-direction:column;position:absolute;z-index:10;font-size:13px}x-pw-dialog:not(.autosize){width:400px;height:150px}x-pw-dialog-body{display:flex;flex-direction:column;flex:auto}x-pw-dialog-body label{margin:5px 8px;display:flex;flex-direction:row;align-items:center}x-pw-highlight{position:absolute;top:0;left:0;width:0;height:0}x-pw-action-point{position:absolute;width:20px;height:20px;background:red;border-radius:10px;margin:-10px 0 0 -10px;z-index:2}x-pw-separator{height:1px;margin:6px 9px;background:#949494e5}x-pw-tool-gripper{height:28px;width:24px;margin:2px 0;cursor:grab}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{width:16px;height:16px;margin:6px 4px;clip-path:url(#icon-gripper);background-color:#555}x-pw-tools-list>label{display:flex;align-items:center;margin:0 10px;-webkit-user-select:none;user-select:none}x-pw-tools-list{display:flex;width:100%;border-bottom:1px solid #dddddd}x-pw-tool-item{pointer-events:auto;height:28px;width:28px;border-radius:3px}x-pw-tool-item:not(.disabled){cursor:pointer}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.toggled{background-color:#8acae480}x-pw-tool-item.toggled:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{width:16px;height:16px;margin:6px;background-color:#3a3a3a}x-pw-tool-item.disabled>x-div{background-color:#61616180;cursor:default}x-pw-tool-item.record.toggled{background-color:transparent}x-pw-tool-item.record.toggled:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.record.toggled>x-div{background-color:#a1260d}x-pw-tool-item.record.disabled.toggled>x-div{opacity:.8}x-pw-tool-item.accept>x-div{background-color:#388a34}x-pw-tool-item.record>x-div{clip-path:url(#icon-circle-large-filled)}x-pw-tool-item.record.toggled>x-div{clip-path:url(#icon-stop-circle)}x-pw-tool-item.pick-locator>x-div{clip-path:url(#icon-inspect)}x-pw-tool-item.text>x-div{clip-path:url(#icon-whole-word)}x-pw-tool-item.visibility>x-div{clip-path:url(#icon-eye)}x-pw-tool-item.value>x-div{clip-path:url(#icon-symbol-constant)}x-pw-tool-item.snapshot>x-div{clip-path:url(#icon-gist)}x-pw-tool-item.accept>x-div{clip-path:url(#icon-check)}x-pw-tool-item.cancel>x-div{clip-path:url(#icon-close)}x-pw-tool-item.succeeded>x-div{clip-path:url(#icon-pass);background-color:#388a34!important}x-pw-overlay{position:absolute;top:0;max-width:min-content;z-index:2147483647;background:transparent;pointer-events:auto}x-pw-overlay x-pw-tools-list{background-color:#fffd;box-shadow:#0000001a 0 5px 5px;border-radius:3px;border-bottom:none}x-pw-overlay x-pw-tool-item{margin:2px}textarea.text-editor{font-family:system-ui,Ubuntu,Droid Sans,sans-serif;flex:auto;border:none;margin:6px 10px;color:#333;outline:1px solid transparent!important;resize:none;padding:0;font-size:13px}textarea.text-editor.does-not-match{outline:1px solid red!important}x-div{display:block}x-spacer{flex:auto}*{box-sizing:border-box}*[hidden]{display:none!important}x-locator-editor{flex:none;width:100%;height:60px;padding:4px;border-bottom:1px solid #dddddd;outline:1px solid transparent}x-locator-editor.does-not-match{outline:1px solid red}.CodeMirror{width:100%!important;height:100%!important}x-pw-action-list{flex:auto;display:flex;flex-direction:column;-webkit-user-select:none;user-select:none}x-pw-action-item{padding:6px 10px;cursor:pointer;overflow:hidden}x-pw-action-item:hover{background-color:#f2f2f2}x-pw-action-item:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}";class Qf{constructor(e){this._renderedEntries=[],this._language="javascript",this._injectedScript=e;const i=e.document;if(this._isUnderTest=e.isUnderTest,this._glassPaneElement=i.createElement("x-pw-glass"),this._glassPaneElement.style.position="fixed",this._glassPaneElement.style.top="0",this._glassPaneElement.style.right="0",this._glassPaneElement.style.bottom="0",this._glassPaneElement.style.left="0",this._glassPaneElement.style.zIndex="2147483647",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent",this._actionPointElement=i.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push=="function"){const s=new this._injectedScript.window.CSSStyleSheet;s.replaceSync(Fy),this._glassPaneShadow.adoptedStyleSheets.push(s)}else{const s=this._injectedScript.document.createElement("style");s.textContent=Fy,this._glassPaneShadow.appendChild(s)}this._glassPaneShadow.appendChild(this._actionPointElement)}install(){this._injectedScript.document.documentElement&&(!this._injectedScript.document.documentElement.contains(this._glassPaneElement)||this._glassPaneElement.nextElementSibling)&&this._injectedScript.document.documentElement.appendChild(this._glassPaneElement)}setLanguage(e){this._language=e}runHighlightOnRaf(e){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);const i=this._injectedScript.querySelectorAll(e,this._injectedScript.document.documentElement),s=Ji(this._language,Gn(e)),l=i.length>1?"#f6b26b7f":"#6fa8dc7f";this.updateHighlight(i.map((o,u)=>{const f=i.length>1?` [${u+1} of ${i.length}]`:"";return{element:o,color:l,tooltipText:s+f}})),this._rafRequest=this._injectedScript.utils.builtins.requestAnimationFrame(()=>this.runHighlightOnRaf(e))}uninstall(){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest),this._glassPaneElement.remove()}showActionPoint(e,i){this._actionPointElement.style.top=i+"px",this._actionPointElement.style.left=e+"px",this._actionPointElement.hidden=!1}hideActionPoint(){this._actionPointElement.hidden=!0}clearHighlight(){var e,i;for(const s of this._renderedEntries)(e=s.highlightElement)==null||e.remove(),(i=s.tooltipElement)==null||i.remove();this._renderedEntries=[]}maskElements(e,i){this.updateHighlight(e.map(s=>({element:s,color:i})))}updateHighlight(e){if(!this._highlightIsUpToDate(e)){this.clearHighlight();for(const i of e){const s=this._createHighlightElement();this._glassPaneShadow.appendChild(s);let l;if(i.tooltipText){l=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(l),l.style.top="0",l.style.left="0",l.style.display="flex";const o=this._injectedScript.document.createElement("x-pw-tooltip-line");o.textContent=i.tooltipText,l.appendChild(o)}this._renderedEntries.push({targetElement:i.element,color:i.color,tooltipElement:l,highlightElement:s})}for(const i of this._renderedEntries){if(i.box=i.targetElement.getBoundingClientRect(),!i.tooltipElement)continue;const{anchorLeft:s,anchorTop:l}=this.tooltipPosition(i.box,i.tooltipElement);i.tooltipTop=l,i.tooltipLeft=s}for(const i of this._renderedEntries){i.tooltipElement&&(i.tooltipElement.style.top=i.tooltipTop+"px",i.tooltipElement.style.left=i.tooltipLeft+"px");const s=i.box;i.highlightElement.style.backgroundColor=i.color,i.highlightElement.style.left=s.x+"px",i.highlightElement.style.top=s.y+"px",i.highlightElement.style.width=s.width+"px",i.highlightElement.style.height=s.height+"px",i.highlightElement.style.display="block",this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:s.x,y:s.y,width:s.width,height:s.height}))}}}firstBox(){var e;return(e=this._renderedEntries[0])==null?void 0:e.box}firstTooltipBox(){const e=this._renderedEntries[0];if(!(!e||!e.tooltipElement||e.tooltipLeft===void 0||e.tooltipTop===void 0))return{x:e.tooltipLeft,y:e.tooltipTop,left:e.tooltipLeft,top:e.tooltipTop,width:e.tooltipElement.offsetWidth,height:e.tooltipElement.offsetHeight,bottom:e.tooltipTop+e.tooltipElement.offsetHeight,right:e.tooltipLeft+e.tooltipElement.offsetWidth,toJSON:()=>{}}}tooltipPosition(e,i){const s=i.offsetWidth,l=i.offsetHeight,o=this._glassPaneElement.offsetWidth,u=this._glassPaneElement.offsetHeight;let f=Math.max(5,e.left);f+s>o-5&&(f=o-s-5);let d=Math.max(0,e.bottom)+5;return d+l>u-5&&(Math.max(0,e.top)>l+5?d=Math.max(0,e.top)-l-5:d=u-5-l),{anchorLeft:f,anchorTop:d}}_highlightIsUpToDate(e){if(e.length!==this._renderedEntries.length)return!1;for(let i=0;i<this._renderedEntries.length;++i){if(e[i].element!==this._renderedEntries[i].targetElement||e[i].color!==this._renderedEntries[i].color)return!1;const s=this._renderedEntries[i].box;if(!s)return!1;const l=e[i].element.getBoundingClientRect();if(l.top!==s.top||l.right!==s.right||l.bottom!==s.bottom||l.left!==s.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(e){this._glassPaneShadow.appendChild(e)}onGlassPaneClick(e){this._glassPaneElement.style.pointerEvents="auto",this._glassPaneElement.style.backgroundColor="rgba(0, 0, 0, 0.3)",this._glassPaneElement.addEventListener("click",e)}offGlassPaneClick(e){this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.backgroundColor="transparent",this._glassPaneElement.removeEventListener("click",e)}}function BT(n,e,i){const s=n.left-e.right;if(!(s<0||i!==void 0&&s>i))return s+Math.max(e.bottom-n.bottom,0)+Math.max(n.top-e.top,0)}function UT(n,e,i){const s=e.left-n.right;if(!(s<0||i!==void 0&&s>i))return s+Math.max(e.bottom-n.bottom,0)+Math.max(n.top-e.top,0)}function HT(n,e,i){const s=e.top-n.bottom;if(!(s<0||i!==void 0&&s>i))return s+Math.max(n.left-e.left,0)+Math.max(e.right-n.right,0)}function zT(n,e,i){const s=n.top-e.bottom;if(!(s<0||i!==void 0&&s>i))return s+Math.max(n.left-e.left,0)+Math.max(e.right-n.right,0)}function qT(n,e,i){const s=i===void 0?50:i;let l=0;return n.left-e.right>=0&&(l+=n.left-e.right),e.left-n.right>=0&&(l+=e.left-n.right),e.top-n.bottom>=0&&(l+=e.top-n.bottom),n.top-e.bottom>=0&&(l+=n.top-e.bottom),l>s?void 0:l}const $T=["left-of","right-of","above","below","near"];function Lb(n,e,i,s){const l=e.getBoundingClientRect(),o={"left-of":UT,"right-of":BT,above:HT,below:zT,near:qT}[n];let u;for(const f of i){if(f===e)continue;const d=o(l,f.getBoundingClientRect(),s);d!==void 0&&(u===void 0||d<u)&&(u=d)}return u}function Rb(n,e){for(const i of e.jsonPath)n!=null&&(n=n[i]);return jb(n,e)}function jb(n,e){const i=typeof n=="string"&&!e.caseSensitive?n.toUpperCase():n,s=typeof e.value=="string"&&!e.caseSensitive?e.value.toUpperCase():e.value;return e.op==="<truthy>"?!!i:e.op==="="?s instanceof RegExp?typeof i=="string"&&!!i.match(s):i===s:typeof i!="string"||typeof s!="string"?!1:e.op==="*="?i.includes(s):e.op==="^="?i.startsWith(s):e.op==="$="?i.endsWith(s):e.op==="|="?i===s||i.startsWith(s+"-"):e.op==="~="?i.split(" ").includes(s):!1}function id(n){const e=n.ownerDocument;return n.nodeName==="SCRIPT"||n.nodeName==="NOSCRIPT"||n.nodeName==="STYLE"||e.head&&e.head.contains(n)}function Dt(n,e){let i=n.get(e);if(i===void 0){if(i={full:"",normalized:"",immediate:[]},!id(e)){let s="";if(e instanceof HTMLInputElement&&(e.type==="submit"||e.type==="button"))i={full:e.value,normalized:Et(e.value),immediate:[e.value]};else{for(let l=e.firstChild;l;l=l.nextSibling)if(l.nodeType===Node.TEXT_NODE)i.full+=l.nodeValue||"",s+=l.nodeValue||"";else{if(l.nodeType===Node.COMMENT_NODE)continue;s&&i.immediate.push(s),s="",l.nodeType===Node.ELEMENT_NODE&&(i.full+=Dt(n,l).full)}s&&i.immediate.push(s),e.shadowRoot&&(i.full+=Dt(n,e.shadowRoot).full),i.full&&(i.normalized=Et(i.full))}}n.set(e,i)}return i}function lc(n,e,i){if(id(e)||!i(Dt(n,e)))return"none";for(let s=e.firstChild;s;s=s.nextSibling)if(s.nodeType===Node.ELEMENT_NODE&&i(Dt(n,s)))return"selfAndChildren";return e.shadowRoot&&i(Dt(n,e.shadowRoot))?"selfAndChildren":"self"}function Db(n,e){const i=vb(e);if(i)return i.map(o=>Dt(n,o));const s=e.getAttribute("aria-label");if(s!==null&&s.trim())return[{full:s,normalized:Et(s),immediate:[s]}];const l=e.nodeName==="INPUT"&&e.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(e.nodeName)||l){const o=e.labels;if(o)return[...o].map(u=>Dt(n,u))}return[]}function Qy(n){return n.displayName||n.name||"Anonymous"}function IT(n){if(n.type)switch(typeof n.type){case"function":return Qy(n.type);case"string":return n.type;case"object":return n.type.displayName||(n.type.render?Qy(n.type.render):"")}if(n._currentElement){const e=n._currentElement.type;if(typeof e=="string")return e;if(typeof e=="function")return e.displayName||e.name||"Anonymous"}return""}function VT(n){var e;return n.key??((e=n._currentElement)==null?void 0:e.key)}function GT(n){if(n.child){const i=[];for(let s=n.child;s;s=s.sibling)i.push(s);return i}if(!n._currentElement)return[];const e=i=>{var l;const s=(l=i._currentElement)==null?void 0:l.type;return typeof s=="function"||typeof s=="string"};if(n._renderedComponent){const i=n._renderedComponent;return e(i)?[i]:[]}return n._renderedChildren?[...Object.values(n._renderedChildren)].filter(e):[]}function KT(n){var s;const e=n.memoizedProps||((s=n._currentElement)==null?void 0:s.props);if(!e||typeof e=="string")return e;const i={...e};return delete i.children,i}function Bb(n){var s;const e={key:VT(n),name:IT(n),children:GT(n).map(Bb),rootElements:[],props:KT(n)},i=n.stateNode||n._hostNode||((s=n._renderedComponent)==null?void 0:s._hostNode);if(i instanceof Element)e.rootElements.push(i);else for(const l of e.children)e.rootElements.push(...l.rootElements);return e}function Ub(n,e,i=[]){e(n)&&i.push(n);for(const s of n.children)Ub(s,e,i);return i}function Hb(n,e=[]){const s=(n.ownerDocument||n).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{const l=s.currentNode,o=l,u=Object.keys(o).find(d=>d.startsWith("__reactContainer")&&o[d]!==null);if(u)e.push(o[u].stateNode.current);else{const d="_reactRootContainer";o.hasOwnProperty(d)&&o[d]!==null&&e.push(o[d]._internalRoot.current)}if(l instanceof Element&&l.hasAttribute("data-reactroot"))for(const d of Object.keys(l))(d.startsWith("__reactInternalInstance")||d.startsWith("__reactFiber"))&&e.push(l[d]);const f=l instanceof Element?l.shadowRoot:null;f&&Hb(f,e)}while(s.nextNode());return e}const YT=()=>({queryAll(n,e){const{name:i,attributes:s}=Zi(e,!1),u=Hb(n.ownerDocument||n).map(d=>Bb(d)).map(d=>Ub(d,p=>{const m=p.props??{};if(p.key!==void 0&&(m.key=p.key),i&&p.name!==i||p.rootElements.some(y=>!Va(n,y)))return!1;for(const y of s)if(!Rb(m,y))return!1;return!0})).flat(),f=new Set;for(const d of u)for(const p of d.rootElements)f.add(p);return[...f]}}),zb=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];zb.sort();function xa(n,e,i){if(!e.includes(i))throw new Error(`"${n}" attribute is only supported for roles: ${e.slice().sort().map(s=>`"${s}"`).join(", ")}`)}function Ks(n,e){if(n.op!=="<truthy>"&&!e.includes(n.value))throw new Error(`"${n.name}" must be one of ${e.map(i=>JSON.stringify(i)).join(", ")}`)}function Ys(n,e){if(!e.includes(n.op))throw new Error(`"${n.name}" does not support "${n.op}" matcher`)}function XT(n,e){const i={role:e};for(const s of n)switch(s.name){case"checked":{xa(s.name,Vh,e),Ks(s,[!0,!1,"mixed"]),Ys(s,["<truthy>","="]),i.checked=s.op==="<truthy>"?!0:s.value;break}case"pressed":{xa(s.name,Kh,e),Ks(s,[!0,!1,"mixed"]),Ys(s,["<truthy>","="]),i.pressed=s.op==="<truthy>"?!0:s.value;break}case"selected":{xa(s.name,Ih,e),Ks(s,[!0,!1]),Ys(s,["<truthy>","="]),i.selected=s.op==="<truthy>"?!0:s.value;break}case"expanded":{xa(s.name,Yh,e),Ks(s,[!0,!1]),Ys(s,["<truthy>","="]),i.expanded=s.op==="<truthy>"?!0:s.value;break}case"level":{if(xa(s.name,Xh,e),typeof s.value=="string"&&(s.value=+s.value),s.op!=="="||typeof s.value!="number"||Number.isNaN(s.value))throw new Error('"level" attribute must be compared to a number');i.level=s.value;break}case"disabled":{Ks(s,[!0,!1]),Ys(s,["<truthy>","="]),i.disabled=s.op==="<truthy>"?!0:s.value;break}case"name":{if(s.op==="<truthy>")throw new Error('"name" attribute must have a value');if(typeof s.value!="string"&&!(s.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');i.name=s.value,i.nameOp=s.op,i.exact=s.caseSensitive;break}case"include-hidden":{Ks(s,[!0,!1]),Ys(s,["<truthy>","="]),i.includeHidden=s.op==="<truthy>"?!0:s.value;break}default:throw new Error(`Unknown attribute "${s.name}", must be one of ${zb.map(l=>`"${l}"`).join(", ")}.`)}return i}function PT(n,e,i){const s=[],l=u=>{if(pt(u)===e.role&&!(e.selected!==void 0&&Sb(u)!==e.selected)&&!(e.checked!==void 0&&wb(u)!==e.checked)&&!(e.pressed!==void 0&&xb(u)!==e.pressed)&&!(e.expanded!==void 0&&_b(u)!==e.expanded)&&!(e.level!==void 0&&Tb(u)!==e.level)&&!(e.disabled!==void 0&&Fo(u)!==e.disabled)&&!(!e.includeHidden&&rn(u))){if(e.name!==void 0){const f=Et(Ga(u,!!e.includeHidden));if(typeof e.name=="string"&&(e.name=Et(e.name)),i&&!e.exact&&e.nameOp==="="&&(e.nameOp="*="),!jb(f,{op:e.nameOp||"=",value:e.name,caseSensitive:!!e.exact}))return}s.push(u)}},o=u=>{const f=[];u.shadowRoot&&f.push(u.shadowRoot);for(const d of u.querySelectorAll("*"))l(d),d.shadowRoot&&f.push(d.shadowRoot);f.forEach(o)};return o(n),s}function Zy(n){return{queryAll:(e,i)=>{const s=Zi(i,!0),l=s.name.toLowerCase();if(!l)throw new Error("Role must not be empty");const o=XT(s.attributes,l);rc();try{return PT(e,o,n)}finally{ac()}}}}class FT{constructor(){this._retainCacheCounter=0,this._cacheText=new Map,this._cacheQueryCSS=new Map,this._cacheMatches=new Map,this._cacheQuery=new Map,this._cacheMatchesSimple=new Map,this._cacheMatchesParents=new Map,this._cacheCallMatches=new Map,this._cacheCallQuery=new Map,this._cacheQuerySimple=new Map,this._engines=new Map,this._engines.set("not",JT),this._engines.set("is",Ma),this._engines.set("where",Ma),this._engines.set("has",QT),this._engines.set("scope",ZT),this._engines.set("light",WT),this._engines.set("visible",eE),this._engines.set("text",tE),this._engines.set("text-is",nE),this._engines.set("text-matches",iE),this._engines.set("has-text",sE),this._engines.set("right-of",_a("right-of")),this._engines.set("left-of",_a("left-of")),this._engines.set("above",_a("above")),this._engines.set("below",_a("below")),this._engines.set("near",_a("near")),this._engines.set("nth-match",rE);const e=[...this._engines.keys()];e.sort();const i=[...K0];if(i.sort(),e.join("|")!==i.join("|"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${e.join("|")} vs ${i.join("|")}`)}begin(){++this._retainCacheCounter}end(){--this._retainCacheCounter,this._retainCacheCounter||(this._cacheQueryCSS.clear(),this._cacheMatches.clear(),this._cacheQuery.clear(),this._cacheMatchesSimple.clear(),this._cacheMatchesParents.clear(),this._cacheCallMatches.clear(),this._cacheCallQuery.clear(),this._cacheQuerySimple.clear(),this._cacheText.clear())}_cached(e,i,s,l){e.has(i)||e.set(i,[]);const o=e.get(i),u=o.find(d=>s.every((p,m)=>d.rest[m]===p));if(u)return u.result;const f=l();return o.push({rest:s,result:f}),f}_checkSelector(e){if(!(typeof e=="object"&&e&&(Array.isArray(e)||"simples"in e&&e.simples.length)))throw new Error(`Malformed selector "${e}"`);return e}matches(e,i,s){const l=this._checkSelector(i);this.begin();try{return this._cached(this._cacheMatches,e,[l,s.scope,s.pierceShadow,s.originalScope],()=>Array.isArray(l)?this._matchesEngine(Ma,e,l,s):(this._hasScopeClause(l)&&(s=this._expandContextForScopeMatching(s)),this._matchesSimple(e,l.simples[l.simples.length-1].selector,s)?this._matchesParents(e,l,l.simples.length-2,s):!1))}finally{this.end()}}query(e,i){const s=this._checkSelector(i);this.begin();try{return this._cached(this._cacheQuery,s,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(s))return this._queryEngine(Ma,e,s);this._hasScopeClause(s)&&(e=this._expandContextForScopeMatching(e));const l=this._scoreMap;this._scoreMap=new Map;let o=this._querySimple(e,s.simples[s.simples.length-1].selector);return o=o.filter(u=>this._matchesParents(u,s,s.simples.length-2,e)),this._scoreMap.size&&o.sort((u,f)=>{const d=this._scoreMap.get(u),p=this._scoreMap.get(f);return d===p?0:d===void 0?1:p===void 0?-1:d-p}),this._scoreMap=l,o})}finally{this.end()}}_markScore(e,i){this._scoreMap&&this._scoreMap.set(e,i)}_hasScopeClause(e){return e.simples.some(i=>i.selector.functions.some(s=>s.name==="scope"))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;const i=bt(e.scope);return i?{...e,scope:i,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,i,s){return this._cached(this._cacheMatchesSimple,e,[i,s.scope,s.pierceShadow,s.originalScope],()=>{if(e===s.scope||i.css&&!this._matchesCSS(e,i.css))return!1;for(const l of i.functions)if(!this._matchesEngine(this._getEngine(l.name),e,l.args,s))return!1;return!0})}_querySimple(e,i){return i.functions.length?this._cached(this._cacheQuerySimple,i,[e.scope,e.pierceShadow,e.originalScope],()=>{let s=i.css;const l=i.functions;s==="*"&&l.length&&(s=void 0);let o,u=-1;s!==void 0?o=this._queryCSS(e,s):(u=l.findIndex(f=>this._getEngine(f.name).query!==void 0),u===-1&&(u=0),o=this._queryEngine(this._getEngine(l[u].name),e,l[u].args));for(let f=0;f<l.length;f++){if(f===u)continue;const d=this._getEngine(l[f].name);d.matches!==void 0&&(o=o.filter(p=>this._matchesEngine(d,p,l[f].args,e)))}for(let f=0;f<l.length;f++){if(f===u)continue;const d=this._getEngine(l[f].name);d.matches===void 0&&(o=o.filter(p=>this._matchesEngine(d,p,l[f].args,e)))}return o}):this._queryCSS(e,i.css||"*")}_matchesParents(e,i,s,l){return s<0?!0:this._cached(this._cacheMatchesParents,e,[i,s,l.scope,l.pierceShadow,l.originalScope],()=>{const{selector:o,combinator:u}=i.simples[s];if(u===">"){const f=yo(e,l);return!f||!this._matchesSimple(f,o,l)?!1:this._matchesParents(f,i,s-1,l)}if(u==="+"){const f=Zf(e,l);return!f||!this._matchesSimple(f,o,l)?!1:this._matchesParents(f,i,s-1,l)}if(u===""){let f=yo(e,l);for(;f;){if(this._matchesSimple(f,o,l)){if(this._matchesParents(f,i,s-1,l))return!0;if(i.simples[s-1].combinator==="")break}f=yo(f,l)}return!1}if(u==="~"){let f=Zf(e,l);for(;f;){if(this._matchesSimple(f,o,l)){if(this._matchesParents(f,i,s-1,l))return!0;if(i.simples[s-1].combinator==="~")break}f=Zf(f,l)}return!1}if(u===">="){let f=e;for(;f;){if(this._matchesSimple(f,o,l)){if(this._matchesParents(f,i,s-1,l))return!0;if(i.simples[s-1].combinator==="")break}f=yo(f,l)}return!1}throw new Error(`Unsupported combinator "${u}"`)})}_matchesEngine(e,i,s,l){if(e.matches)return this._callMatches(e,i,s,l);if(e.query)return this._callQuery(e,s,l).includes(i);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(e,i,s){if(e.query)return this._callQuery(e,s,i);if(e.matches)return this._queryCSS(i,"*").filter(l=>this._callMatches(e,l,s,i));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(e,i,s,l){return this._cached(this._cacheCallMatches,i,[e,l.scope,l.pierceShadow,l.originalScope,...s],()=>e.matches(i,s,l,this))}_callQuery(e,i,s){return this._cached(this._cacheCallQuery,e,[s.scope,s.pierceShadow,s.originalScope,...i],()=>e.query(s,i,this))}_matchesCSS(e,i){return e.matches(i)}_queryCSS(e,i){return this._cached(this._cacheQueryCSS,i,[e.scope,e.pierceShadow,e.originalScope],()=>{let s=[];function l(o){if(s=s.concat([...o.querySelectorAll(i)]),!!e.pierceShadow){o.shadowRoot&&l(o.shadowRoot);for(const u of o.querySelectorAll("*"))u.shadowRoot&&l(u.shadowRoot)}}return l(e.scope),s})}_getEngine(e){const i=this._engines.get(e);if(!i)throw new Error(`Unknown selector engine "${e}"`);return i}}const Ma={matches(n,e,i,s){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');return e.some(l=>s.matches(n,l,i))},query(n,e,i){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');let s=[];for(const l of e)s=s.concat(i.query(n,l));return e.length===1?s:qb(s)}},QT={matches(n,e,i,s){if(e.length===0)throw new Error('"has" engine expects non-empty selector list');return s.query({...i,scope:n},e).length>0}},ZT={matches(n,e,i,s){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const l=i.originalScope||i.scope;return l.nodeType===9?n===l.documentElement:n===l},query(n,e,i){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const s=n.originalScope||n.scope;if(s.nodeType===9){const l=s.documentElement;return l?[l]:[]}return s.nodeType===1?[s]:[]}},JT={matches(n,e,i,s){if(e.length===0)throw new Error('"not" engine expects non-empty selector list');return!s.matches(n,e,i)}},WT={query(n,e,i){return i.query({...n,pierceShadow:!1},e)},matches(n,e,i,s){return s.matches(n,e,{...i,pierceShadow:!1})}},eE={matches(n,e,i,s){if(e.length)throw new Error('"visible" engine expects no arguments');return yi(n)}},tE={matches(n,e,i,s){if(e.length!==1||typeof e[0]!="string")throw new Error('"text" engine expects a single string');const l=Et(e[0]).toLowerCase(),o=u=>u.normalized.toLowerCase().includes(l);return lc(s._cacheText,n,o)==="self"}},nE={matches(n,e,i,s){if(e.length!==1||typeof e[0]!="string")throw new Error('"text-is" engine expects a single string');const l=Et(e[0]),o=u=>!l&&!u.immediate.length?!0:u.immediate.some(f=>Et(f)===l);return lc(s._cacheText,n,o)!=="none"}},iE={matches(n,e,i,s){if(e.length===0||typeof e[0]!="string"||e.length>2||e.length===2&&typeof e[1]!="string")throw new Error('"text-matches" engine expects a regexp body and optional regexp flags');const l=new RegExp(e[0],e.length===2?e[1]:void 0),o=u=>l.test(u.full);return lc(s._cacheText,n,o)==="self"}},sE={matches(n,e,i,s){if(e.length!==1||typeof e[0]!="string")throw new Error('"has-text" engine expects a single string');if(id(n))return!1;const l=Et(e[0]).toLowerCase();return(u=>u.normalized.toLowerCase().includes(l))(Dt(s._cacheText,n))}};function _a(n){return{matches(e,i,s,l){const o=i.length&&typeof i[i.length-1]=="number"?i[i.length-1]:void 0,u=o===void 0?i:i.slice(0,i.length-1);if(i.length<1+(o===void 0?0:1))throw new Error(`"${n}" engine expects a selector list and optional maximum distance in pixels`);const f=l.query(s,u),d=Lb(n,e,f,o);return d===void 0?!1:(l._markScore(e,d),!0)}}}const rE={query(n,e,i){let s=e[e.length-1];if(e.length<2)throw new Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof s!="number"||s<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');const l=Ma.query(n,e.slice(0,e.length-1),i);return s--,s<l.length?[l[s]]:[]}};function yo(n,e){if(n!==e.scope)return e.pierceShadow?bt(n):n.parentElement||void 0}function Zf(n,e){if(n!==e.scope)return n.previousElementSibling||void 0}function qb(n){const e=new Map,i=[],s=[];function l(u){let f=e.get(u);if(f)return f;const d=bt(u);return d?l(d).children.push(u):i.push(u),f={children:[],taken:!1},e.set(u,f),f}for(const u of n)l(u).taken=!0;function o(u){const f=e.get(u);if(f.taken&&s.push(u),f.children.length>1){const d=new Set(f.children);f.children=[];let p=u.firstElementChild;for(;p&&f.children.length<d.size;)d.has(p)&&f.children.push(p),p=p.nextElementSibling;for(p=u.shadowRoot?u.shadowRoot.firstElementChild:null;p&&f.children.length<d.size;)d.has(p)&&f.children.push(p),p=p.nextElementSibling}f.children.forEach(o)}return i.forEach(o),s}const $b=10,dr=$b/2,Jy=1,aE=2,lE=10,oE=50,Ib=100,Vb=120,Gb=140,Kb=160,Ro=180,Yb=200,Wy=250,cE=Vb+dr,uE=Gb+dr,fE=Ib+dr,hE=Kb+dr,dE=Ro+dr,pE=Yb+dr,gE=300,mE=500,Xb=510,Jf=520,Pb=530,gh=1e4,yE=1e7,bE=1e3;function e0(n,e,i){n._evaluator.begin();const s={allowText:new Map,disallowText:new Map};rc(),qh();try{let l=[];if(i.forTextExpect){let f=Oa(n,e.ownerDocument.documentElement,i);for(let d=e;d;d=bt(d)){const p=Vi(s,n,d,{...i,noText:!0});if(!p)continue;if(Gi(p)<=bE){f=p;break}}l=[jo(f)]}else{if(!e.matches("input,textarea,select")&&!e.isContentEditable){const f=ka(e,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",i.root);f&&yi(f)&&(e=f)}if(i.multiple){const f=Vi(s,n,e,i),d=Vi(s,n,e,{...i,noText:!0});let p=[f,d];if(s.allowText.clear(),s.disallowText.clear(),f&&Wf(f)&&p.push(Vi(s,n,e,{...i,noCSSId:!0})),d&&Wf(d)&&p.push(Vi(s,n,e,{...i,noText:!0,noCSSId:!0})),p=p.filter(Boolean),!p.length){const m=Oa(n,e,i);p.push(m),Wf(m)&&p.push(Oa(n,e,{...i,noCSSId:!0}))}l=[...new Set(p.map(m=>jo(m)))]}else{const f=Vi(s,n,e,i)||Oa(n,e,i);l=[jo(f)]}}const o=l[0],u=n.parseSelector(o);return{selector:o,selectors:l,elements:n.querySelectorAll(u,i.root??e.ownerDocument)}}finally{$h(),ac(),n._evaluator.end()}}function Vi(n,e,i,s){if(s.root&&!Va(s.root,i))throw new Error("Target element must belong to the root's subtree");if(i===s.root)return[{engine:"css",selector:":scope",score:1}];if(i.ownerDocument.documentElement===i)return[{engine:"css",selector:"html",score:1}];let l=null;const o=f=>{(!l||Gi(f)<Gi(l))&&(l=f)},u=[];if(!s.noText)for(const f of SE(e,i,!s.isRecursive))u.push({candidate:f,isTextCandidate:!0});for(const f of vE(e,i,s))s.omitInternalEngines&&f.engine.startsWith("internal:")||u.push({candidate:[f],isTextCandidate:!1});u.sort((f,d)=>Gi(f.candidate)-Gi(d.candidate));for(const{candidate:f,isTextCandidate:d}of u){const p=e.querySelectorAll(e.parseSelector(jo(f)),s.root??i.ownerDocument);if(!p.includes(i))continue;if(p.length===1){o(f);break}const m=p.indexOf(i);if(!(m>5)&&(o([...f,{engine:"nth",selector:String(m),score:gh}]),!s.isRecursive))for(let y=bt(i);y&&y!==s.root;y=bt(y)){const b=p.filter(V=>Va(y,V)&&V!==y),w=b.indexOf(i);if(b.length>5||w===-1||w===m&&b.length>1)continue;const E=b.length===1?f:[...f,{engine:"nth",selector:String(w),score:gh}];if(l&&Gi([{engine:"",selector:"",score:1},...E])>=Gi(l))continue;const T=!!s.noText||d,M=T?n.disallowText:n.allowText;let C=M.get(y);C===void 0&&(C=Vi(n,e,y,{...s,isRecursive:!0,noText:T})||Oa(e,y,s),M.set(y,C)),C&&o([...C,...E])}}return l}function vE(n,e,i){const s=[];{for(const u of["data-testid","data-test-id","data-test"])u!==i.testIdAttributeName&&e.getAttribute(u)&&s.push({engine:"css",selector:`[${u}=${Qs(e.getAttribute(u))}]`,score:aE});if(!i.noCSSId){const u=e.getAttribute("id");u&&!wE(u)&&s.push({engine:"css",selector:Fb(u),score:mE})}s.push({engine:"css",selector:Vn(e),score:Pb})}if(e.nodeName==="IFRAME"){for(const u of["name","title"])e.getAttribute(u)&&s.push({engine:"css",selector:`${Vn(e)}[${u}=${Qs(e.getAttribute(u))}]`,score:lE});return e.getAttribute(i.testIdAttributeName)&&s.push({engine:"css",selector:`[${i.testIdAttributeName}=${Qs(e.getAttribute(i.testIdAttributeName))}]`,score:Jy}),mh([s]),s}if(e.getAttribute(i.testIdAttributeName)&&s.push({engine:"internal:testid",selector:`[${i.testIdAttributeName}=${_t(e.getAttribute(i.testIdAttributeName),!0)}]`,score:Jy}),e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const u=e;if(u.placeholder){s.push({engine:"internal:attr",selector:`[placeholder=${_t(u.placeholder,!0)}]`,score:cE});for(const f of Ws(u.placeholder))s.push({engine:"internal:attr",selector:`[placeholder=${_t(f.text,!1)}]`,score:Vb-f.scoreBonus})}}const l=Db(n._evaluator._cacheText,e);for(const u of l){const f=u.normalized;s.push({engine:"internal:label",selector:Rt(f,!0),score:uE});for(const d of Ws(f))s.push({engine:"internal:label",selector:Rt(d.text,!1),score:Gb-d.scoreBonus})}const o=pt(e);return o&&!["none","presentation"].includes(o)&&s.push({engine:"internal:role",selector:o,score:Xb}),e.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(e.nodeName)&&s.push({engine:"css",selector:`${Vn(e)}[name=${Qs(e.getAttribute("name"))}]`,score:Jf}),["INPUT","TEXTAREA"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&e.getAttribute("type")&&s.push({engine:"css",selector:`${Vn(e)}[type=${Qs(e.getAttribute("type"))}]`,score:Jf}),["INPUT","TEXTAREA","SELECT"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&s.push({engine:"css",selector:Vn(e),score:Jf+1}),mh([s]),s}function SE(n,e,i){if(e.nodeName==="SELECT")return[];const s=[],l=e.getAttribute("title");if(l){s.push([{engine:"internal:attr",selector:`[title=${_t(l,!0)}]`,score:pE}]);for(const p of Ws(l))s.push([{engine:"internal:attr",selector:`[title=${_t(p.text,!1)}]`,score:Yb-p.scoreBonus}])}const o=e.getAttribute("alt");if(o&&["APPLET","AREA","IMG","INPUT"].includes(e.nodeName)){s.push([{engine:"internal:attr",selector:`[alt=${_t(o,!0)}]`,score:hE}]);for(const p of Ws(o))s.push([{engine:"internal:attr",selector:`[alt=${_t(p.text,!1)}]`,score:Kb-p.scoreBonus}])}const u=Dt(n._evaluator._cacheText,e).normalized,f=u?Ws(u):[];if(u){if(i){u.length<=80&&s.push([{engine:"internal:text",selector:Rt(u,!0),score:dE}]);for(const m of f)s.push([{engine:"internal:text",selector:Rt(m.text,!1),score:Ro-m.scoreBonus}])}const p={engine:"css",selector:Vn(e),score:Pb};for(const m of f)s.push([p,{engine:"internal:has-text",selector:Rt(m.text,!1),score:Ro-m.scoreBonus}]);if(i&&u.length<=80){const m=new RegExp("^"+Go(u)+"$");s.push([p,{engine:"internal:has-text",selector:Rt(m,!1),score:Wy}])}}const d=pt(e);if(d&&!["none","presentation"].includes(d)){const p=Ga(e,!1);if(p){const m={engine:"internal:role",selector:`${d}[name=${_t(p,!0)}]`,score:fE};s.push([m]);for(const y of Ws(p))s.push([{engine:"internal:role",selector:`${d}[name=${_t(y.text,!1)}]`,score:Ib-y.scoreBonus}])}else{const m={engine:"internal:role",selector:`${d}`,score:Xb};for(const y of f)s.push([m,{engine:"internal:has-text",selector:Rt(y.text,!1),score:Ro-y.scoreBonus}]);if(i&&u.length<=80){const y=new RegExp("^"+Go(u)+"$");s.push([m,{engine:"internal:has-text",selector:Rt(y,!1),score:Wy}])}}}return mh(s),s}function Fb(n){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(n)?"#"+n:`[id=${Qs(n)}]`}function Wf(n){return n.some(e=>e.engine==="css"&&(e.selector.startsWith("#")||e.selector.startsWith('[id="')))}function Oa(n,e,i){const s=i.root??e.ownerDocument,l=[];function o(f){const d=l.slice();f&&d.unshift(f);const p=d.join(" > "),m=n.parseSelector(p);return n.querySelector(m,s,!1)===e?p:void 0}function u(f){const d={engine:"css",selector:f,score:yE},p=n.parseSelector(f),m=n.querySelectorAll(p,s);if(m.length===1)return[d];const y={engine:"nth",selector:String(m.indexOf(e)),score:gh};return[d,y]}for(let f=e;f&&f!==s;f=bt(f)){let d="";if(f.id&&!i.noCSSId){const y=Fb(f.id),b=o(y);if(b)return u(b);d=y}const p=f.parentNode,m=[...f.classList].map(xE);for(let y=0;y<m.length;++y){const b="."+m.slice(0,y+1).join("."),w=o(b);if(w)return u(w);!d&&p&&p.querySelectorAll(b).length===1&&(d=b)}if(p){const y=[...p.children],b=f.nodeName,E=y.filter(T=>T.nodeName===b).indexOf(f)===0?Vn(f):`${Vn(f)}:nth-child(${1+y.indexOf(f)})`,x=o(E);if(x)return u(x);d||(d=E)}else d||(d=Vn(f));l.unshift(d)}return u(o())}function mh(n){for(const e of n)for(const i of e)i.score>oE&&i.score<gE&&(i.score+=Math.min($b,i.selector.length/10|0))}function jo(n){const e=[];let i="";for(const{engine:s,selector:l}of n)e.length&&(i!=="css"||s!=="css"||l.startsWith(":nth-match("))&&e.push(">>"),i=s,s==="css"?e.push(l):e.push(`${s}=${l}`);return e.join(" ")}function Gi(n){let e=0;for(let i=0;i<n.length;i++)e+=n[i].score*(n.length-i);return e}function wE(n){let e,i=0;for(let s=0;s<n.length;++s){const l=n[s];let o;if(!(l==="-"||l==="_")){if(l>="a"&&l<="z"?o="lower":l>="A"&&l<="Z"?o="upper":l>="0"&&l<="9"?o="digit":o="other",o==="lower"&&e==="upper"){e=o;continue}e&&e!==o&&++i,e=o}}return i>=n.length/4}function bo(n,e){if(n.length<=e)return n;n=n.substring(0,e);const i=n.match(/^(.*)\b(.+?)$/);return i?i[1].trimEnd():""}function Ws(n){let e=[];{const i=n.match(/^([\d.,]+)[^.,\w]/),s=i?i[1].length:0;if(s){const l=bo(n.substring(s).trimStart(),80);e.push({text:l,scoreBonus:l.length<=30?2:1})}}{const i=n.match(/[^.,\w]([\d.,]+)$/),s=i?i[1].length:0;if(s){const l=bo(n.substring(0,n.length-s).trimEnd(),80);e.push({text:l,scoreBonus:l.length<=30?2:1})}}return n.length<=30?e.push({text:n,scoreBonus:0}):(e.push({text:bo(n,80),scoreBonus:0}),e.push({text:bo(n,30),scoreBonus:1})),e=e.filter(i=>i.text),e.length||e.push({text:n.substring(0,80),scoreBonus:0}),e}function Vn(n){return n.nodeName.toLocaleLowerCase().replace(/[:\.]/g,e=>"\\"+e)}function xE(n){let e="";for(let i=0;i<n.length;i++)e+=_E(n,i);return e}function _E(n,e){const i=n.charCodeAt(e);return i===0?"�":i>=1&&i<=31||i>=48&&i<=57&&(e===0||e===1&&n.charCodeAt(0)===45)?"\\"+i.toString(16)+" ":e===0&&i===45&&n.length===1?"\\"+n.charAt(e):i>=128||i===45||i===95||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?n.charAt(e):"\\"+n.charAt(e)}function Qb(n,e){const i=n.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/");let s=i.substring(i.lastIndexOf("/")+1);return s.endsWith(e)&&(s=s.substring(0,s.length-e.length)),s}function TE(n,e){return e?e.toUpperCase():""}const EE=/(?:^|[-_/])(\w)/g,Zb=n=>n&&n.replace(EE,TE);function AE(n){function e(m){const y=m.name||m._componentTag||m.__playwright_guessedName;if(y)return y;const b=m.__file;if(b)return Zb(Qb(b,".vue"))}function i(m,y){return m.type.__playwright_guessedName=y,y}function s(m){var b,w,E,x;const y=e(m.type||{});if(y)return y;if(m.root===m)return"Root";for(const T in(w=(b=m.parent)==null?void 0:b.type)==null?void 0:w.components)if(((E=m.parent)==null?void 0:E.type.components[T])===m.type)return i(m,T);for(const T in(x=m.appContext)==null?void 0:x.components)if(m.appContext.components[T]===m.type)return i(m,T);return"Anonymous Component"}function l(m){return m._isBeingDestroyed||m.isUnmounted}function o(m){return m.subTree.type.toString()==="Symbol(Fragment)"}function u(m){const y=[];return m.component&&y.push(m.component),m.suspense&&y.push(...u(m.suspense.activeBranch)),Array.isArray(m.children)&&m.children.forEach(b=>{b.component?y.push(b.component):y.push(...u(b))}),y.filter(b=>{var w;return!l(b)&&!((w=b.type.devtools)!=null&&w.hide)})}function f(m){return o(m)?d(m.subTree):[m.subTree.el]}function d(m){if(!m.children)return[];const y=[];for(let b=0,w=m.children.length;b<w;b++){const E=m.children[b];E.component?y.push(...f(E.component)):E.el&&y.push(E.el)}return y}function p(m){return{name:s(m),children:u(m.subTree).map(p),rootElements:f(m),props:m.props}}return p(n)}function NE(n){function e(o){const u=o.displayName||o.name||o._componentTag;if(u)return u;const f=o.__file;if(f)return Zb(Qb(f,".vue"))}function i(o){const u=e(o.$options||o.fnOptions||{});return u||(o.$root===o?"Root":"Anonymous Component")}function s(o){return o.$children?o.$children:Array.isArray(o.subTree.children)?o.subTree.children.filter(u=>!!u.component).map(u=>u.component):[]}function l(o){return{name:i(o),children:s(o).map(l),rootElements:[o.$el],props:o._props}}return l(n)}function Jb(n,e,i=[]){e(n)&&i.push(n);for(const s of n.children)Jb(s,e,i);return i}function Wb(n,e=[]){const s=(n.ownerDocument||n).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),l=new Set;do{const o=s.currentNode;o.__vue__&&l.add(o.__vue__.$root),o.__vue_app__&&o._vnode&&o._vnode.component&&e.push({root:o._vnode.component,version:3});const u=o instanceof Element?o.shadowRoot:null;u&&Wb(u,e)}while(s.nextNode());for(const o of l)e.push({version:2,root:o});return e}const CE=()=>({queryAll(n,e){const i=n.ownerDocument||n,{name:s,attributes:l}=Zi(e,!1),f=Wb(i).map(p=>p.version===3?AE(p.root):NE(p.root)).map(p=>Jb(p,m=>{if(s&&m.name!==s||m.rootElements.some(y=>!Va(n,y)))return!1;for(const y of l)if(!Rb(m.props,y))return!1;return!0})).flat(),d=new Set;for(const p of f)for(const m of p.rootElements)d.add(m);return[...d]}}),t0={queryAll(n,e){e.startsWith("/")&&n.nodeType!==Node.DOCUMENT_NODE&&(e="."+e);const i=[],s=n.ownerDocument||n;if(!s)return i;const l=s.evaluate(e,n,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let o=l.iterateNext();o;o=l.iterateNext())o.nodeType===Node.ELEMENT_NODE&&i.push(o);return i}};function sd(n,e,i){return`internal:attr=[${n}=${_t(e,(i==null?void 0:i.exact)||!1)}]`}function kE(n,e){return`internal:testid=[${n}=${_t(e,!0)}]`}function ME(n,e){return"internal:label="+Rt(n,!!(e!=null&&e.exact))}function OE(n,e){return sd("alt",n,e)}function LE(n,e){return sd("title",n,e)}function RE(n,e){return sd("placeholder",n,e)}function jE(n,e){return"internal:text="+Rt(n,!!(e!=null&&e.exact))}function DE(n,e={}){const i=[];return e.checked!==void 0&&i.push(["checked",String(e.checked)]),e.disabled!==void 0&&i.push(["disabled",String(e.disabled)]),e.selected!==void 0&&i.push(["selected",String(e.selected)]),e.expanded!==void 0&&i.push(["expanded",String(e.expanded)]),e.includeHidden!==void 0&&i.push(["include-hidden",String(e.includeHidden)]),e.level!==void 0&&i.push(["level",String(e.level)]),e.name!==void 0&&i.push(["name",_t(e.name,!!e.exact)]),e.pressed!==void 0&&i.push(["pressed",String(e.pressed)]),`internal:role=${n}${i.map(([s,l])=>`[${s}=${l}]`).join("")}`}const Ta=Symbol("selector"),BE=class La{constructor(e,i,s){if(s!=null&&s.hasText&&(i+=` >> internal:has-text=${Rt(s.hasText,!1)}`),s!=null&&s.hasNotText&&(i+=` >> internal:has-not-text=${Rt(s.hasNotText,!1)}`),s!=null&&s.has&&(i+=" >> internal:has="+JSON.stringify(s.has[Ta])),s!=null&&s.hasNot&&(i+=" >> internal:has-not="+JSON.stringify(s.hasNot[Ta])),(s==null?void 0:s.visible)!==void 0&&(i+=` >> visible=${s.visible?"true":"false"}`),this[Ta]=i,i){const u=e.parseSelector(i);this.element=e.querySelector(u,e.document,!1),this.elements=e.querySelectorAll(u,e.document)}const l=i,o=this;o.locator=(u,f)=>new La(e,l?l+" >> "+u:u,f),o.getByTestId=u=>o.locator(kE(e.testIdAttributeNameForStrictErrorAndConsoleCodegen(),u)),o.getByAltText=(u,f)=>o.locator(OE(u,f)),o.getByLabel=(u,f)=>o.locator(ME(u,f)),o.getByPlaceholder=(u,f)=>o.locator(RE(u,f)),o.getByText=(u,f)=>o.locator(jE(u,f)),o.getByTitle=(u,f)=>o.locator(LE(u,f)),o.getByRole=(u,f={})=>o.locator(DE(u,f)),o.filter=u=>new La(e,i,u),o.first=()=>o.locator("nth=0"),o.last=()=>o.locator("nth=-1"),o.nth=u=>o.locator(`nth=${u}`),o.and=u=>new La(e,l+" >> internal:and="+JSON.stringify(u[Ta])),o.or=u=>new La(e,l+" >> internal:or="+JSON.stringify(u[Ta]))}};let UE=BE;class HE{constructor(e){this._injectedScript=e}install(){this._injectedScript.window.playwright||(this._injectedScript.window.playwright={$:(e,i)=>this._querySelector(e,!!i),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),generateLocator:(e,i)=>this._generateLocator(e,i),ariaSnapshot:(e,i)=>this._injectedScript.ariaSnapshot(e||this._injectedScript.document.body,i||{mode:"expect"}),resume:()=>this._resume(),...new UE(this._injectedScript,"")},delete this._injectedScript.window.playwright.filter,delete this._injectedScript.window.playwright.first,delete this._injectedScript.window.playwright.last,delete this._injectedScript.window.playwright.nth,delete this._injectedScript.window.playwright.and,delete this._injectedScript.window.playwright.or)}_querySelector(e,i){if(typeof e!="string")throw new Error("Usage: playwright.query('Playwright >> selector').");const s=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(s,this._injectedScript.document,i)}_querySelectorAll(e){if(typeof e!="string")throw new Error("Usage: playwright.$$('Playwright >> selector').");const i=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(i,this._injectedScript.document)}_inspect(e){if(typeof e!="string")throw new Error("Usage: playwright.inspect('Playwright >> selector').");this._injectedScript.window.inspect(this._querySelector(e,!1))}_selector(e){if(!(e instanceof Element))throw new Error("Usage: playwright.selector(element).");return this._injectedScript.generateSelectorSimple(e)}_generateLocator(e,i){if(!(e instanceof Element))throw new Error("Usage: playwright.locator(element).");const s=this._injectedScript.generateSelectorSimple(e);return Ji(i||"javascript",s)}_resume(){if(!this._injectedScript.window.__pw_resume)return!1;this._injectedScript.window.__pw_resume().catch(()=>{})}}function zE(n){try{return n instanceof RegExp||Object.prototype.toString.call(n)==="[object RegExp]"}catch{return!1}}function qE(n){try{return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}catch{return!1}}function $E(n){try{return n instanceof URL||Object.prototype.toString.call(n)==="[object URL]"}catch{return!1}}function IE(n){var e;try{return n instanceof Error||n&&((e=Object.getPrototypeOf(n))==null?void 0:e.name)==="Error"}catch{return!1}}function VE(n,e){try{return n instanceof e||Object.prototype.toString.call(n)===`[object ${e.name}]`}catch{return!1}}const ev={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function GE(n){if("toBase64"in n)return n.toBase64();const e=Array.from(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)).map(i=>String.fromCharCode(i)).join("");return btoa(e)}function KE(n,e){const i=atob(n),s=new Uint8Array(i.length);for(let l=0;l<i.length;l++)s[l]=i.charCodeAt(l);return new e(s.buffer)}function yh(n,e=[],i=new Map){if(!Object.is(n,void 0)){if(typeof n=="object"&&n){if("ref"in n)return i.get(n.ref);if("v"in n)return n.v==="undefined"?void 0:n.v==="null"?null:n.v==="NaN"?NaN:n.v==="Infinity"?1/0:n.v==="-Infinity"?-1/0:n.v==="-0"?-0:void 0;if("d"in n)return new Date(n.d);if("u"in n)return new URL(n.u);if("bi"in n)return BigInt(n.bi);if("e"in n){const s=new Error(n.e.m);return s.name=n.e.n,s.stack=n.e.s,s}if("r"in n)return new RegExp(n.r.p,n.r.f);if("a"in n){const s=[];i.set(n.id,s);for(const l of n.a)s.push(yh(l,e,i));return s}if("o"in n){const s={};i.set(n.id,s);for(const{k:l,v:o}of n.o)l!=="__proto__"&&(s[l]=yh(o,e,i));return s}if("h"in n)return e[n.h];if("ta"in n)return KE(n.ta.b,ev[n.ta.k])}return n}}function YE(n,e){return bh(n,e,{visited:new Map,lastId:0})}function bh(n,e,i){if(n&&typeof n=="object"){if(typeof globalThis.Window=="function"&&n instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document=="function"&&n instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node=="function"&&n instanceof globalThis.Node)return"ref: <Node>"}return tv(n,e,i)}function tv(n,e,i){var o;const s=e(n);if("fallThrough"in s)n=s.fallThrough;else return s;if(typeof n=="symbol")return{v:"undefined"};if(Object.is(n,void 0))return{v:"undefined"};if(Object.is(n,null))return{v:"null"};if(Object.is(n,NaN))return{v:"NaN"};if(Object.is(n,1/0))return{v:"Infinity"};if(Object.is(n,-1/0))return{v:"-Infinity"};if(Object.is(n,-0))return{v:"-0"};if(typeof n=="boolean"||typeof n=="number"||typeof n=="string")return n;if(typeof n=="bigint")return{bi:n.toString()};if(IE(n)){let u;return(o=n.stack)!=null&&o.startsWith(n.name+": "+n.message)?u=n.stack:u=`${n.name}: ${n.message}
|
|
115
115
|
${n.stack}`,{e:{n:n.name,m:n.message,s:u}}}if(qE(n))return{d:n.toJSON()};if($E(n))return{u:n.toJSON()};if(zE(n))return{r:{p:n.source,f:n.flags}};for(const[u,f]of Object.entries(ev))if(VE(n,f))return{ta:{b:GE(n),k:u}};const l=i.visited.get(n);if(l)return{ref:l};if(Array.isArray(n)){const u=[],f=++i.lastId;i.visited.set(n,f);for(let d=0;d<n.length;++d)u.push(bh(n[d],e,i));return{a:u,id:f}}if(typeof n=="object"){const u=[],f=++i.lastId;i.visited.set(n,f);for(const p of Object.keys(n)){let m;try{m=n[p]}catch{continue}p==="toJSON"&&typeof m=="function"?u.push({k:p,v:{o:[],id:0}}):u.push({k:p,v:bh(m,e,i)})}let d;try{u.length===0&&n.toJSON&&typeof n.toJSON=="function"&&(d={value:n.toJSON()})}catch{}return d?tv(d.value,e,i):{o:u,id:f}}}class XE{constructor(e,i){var s,l,o,u,f,d,p,m;this.global=e,this.isUnderTest=i,e.__pwClock?this.builtins=e.__pwClock.builtins:this.builtins={setTimeout:(s=e.setTimeout)==null?void 0:s.bind(e),clearTimeout:(l=e.clearTimeout)==null?void 0:l.bind(e),setInterval:(o=e.setInterval)==null?void 0:o.bind(e),clearInterval:(u=e.clearInterval)==null?void 0:u.bind(e),requestAnimationFrame:(f=e.requestAnimationFrame)==null?void 0:f.bind(e),cancelAnimationFrame:(d=e.cancelAnimationFrame)==null?void 0:d.bind(e),requestIdleCallback:(p=e.requestIdleCallback)==null?void 0:p.bind(e),cancelIdleCallback:(m=e.cancelIdleCallback)==null?void 0:m.bind(e),performance:e.performance,Intl:e.Intl,Date:e.Date},this.isUnderTest&&(e.builtins=this.builtins)}evaluate(e,i,s,l,...o){const u=o.slice(0,l),f=o.slice(l),d=[];for(let m=0;m<u.length;m++)d[m]=yh(u[m],f);let p=this.global.eval(s);return e===!0?p=p(...d):e===!1?p=p:typeof p=="function"&&(p=p(...d)),i?this._promiseAwareJsonValueNoThrow(p):p}jsonValue(e,i){if(i!==void 0)return YE(i,s=>({fallThrough:s}))}_promiseAwareJsonValueNoThrow(e){const i=s=>{try{return this.jsonValue(!0,s)}catch{return}};return e&&typeof e=="object"&&typeof e.then=="function"?(async()=>{const s=await e;return i(s)})():i(e)}}class nv{constructor(e,i){this._testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid",this.utils={asLocator:Ji,cacheNormalizedWhitespaces:bx,elementText:Dt,getAriaRole:pt,getElementAccessibleDescription:Gy,getElementAccessibleName:Ga,isElementVisible:yi,isInsideScope:Va,normalizeWhiteSpace:Et,parseAriaSnapshot:Bh,generateAriaTree:Ua,builtins:null},this.window=e,this.document=e.document,this.isUnderTest=i.isUnderTest,this.utils.builtins=new XE(e,i.isUnderTest).builtins,this._sdkLanguage=i.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=i.testIdAttributeName,this._evaluator=new FT,this.consoleApi=new HE(this),this.onGlobalListenersRemoved=new Set,this._autoClosingTags=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]),this._booleanAttributes=new Set(["checked","selected","disabled","readonly","multiple"]),this._eventTypes=new Map([["auxclick","mouse"],["click","mouse"],["dblclick","mouse"],["mousedown","mouse"],["mouseeenter","mouse"],["mouseleave","mouse"],["mousemove","mouse"],["mouseout","mouse"],["mouseover","mouse"],["mouseup","mouse"],["mouseleave","mouse"],["mousewheel","mouse"],["keydown","keyboard"],["keyup","keyboard"],["keypress","keyboard"],["textInput","keyboard"],["touchstart","touch"],["touchmove","touch"],["touchend","touch"],["touchcancel","touch"],["pointerover","pointer"],["pointerout","pointer"],["pointerenter","pointer"],["pointerleave","pointer"],["pointerdown","pointer"],["pointerup","pointer"],["pointermove","pointer"],["pointercancel","pointer"],["gotpointercapture","pointer"],["lostpointercapture","pointer"],["focus","focus"],["blur","focus"],["drag","drag"],["dragstart","drag"],["dragend","drag"],["dragover","drag"],["dragenter","drag"],["dragleave","drag"],["dragexit","drag"],["drop","drag"],["wheel","wheel"],["deviceorientation","deviceorientation"],["deviceorientationabsolute","deviceorientation"],["devicemotion","devicemotion"]]),this._hoverHitTargetInterceptorEvents=new Set(["mousemove"]),this._tapHitTargetInterceptorEvents=new Set(["pointerdown","pointerup","touchstart","touchend","touchcancel"]),this._mouseHitTargetInterceptorEvents=new Set(["mousedown","mouseup","pointerdown","pointerup","click","auxclick","dblclick","contextmenu"]),this._allHitTargetInterceptorEvents=new Set([...this._hoverHitTargetInterceptorEvents,...this._tapHitTargetInterceptorEvents,...this._mouseHitTargetInterceptorEvents]),this._engines=new Map,this._engines.set("xpath",t0),this._engines.set("xpath:light",t0),this._engines.set("_react",YT()),this._engines.set("_vue",CE()),this._engines.set("role",Zy(!1)),this._engines.set("text",this._createTextEngine(!0,!1)),this._engines.set("text:light",this._createTextEngine(!1,!1)),this._engines.set("id",this._createAttributeEngine("id",!0)),this._engines.set("id:light",this._createAttributeEngine("id",!1)),this._engines.set("data-testid",this._createAttributeEngine("data-testid",!0)),this._engines.set("data-testid:light",this._createAttributeEngine("data-testid",!1)),this._engines.set("data-test-id",this._createAttributeEngine("data-test-id",!0)),this._engines.set("data-test-id:light",this._createAttributeEngine("data-test-id",!1)),this._engines.set("data-test",this._createAttributeEngine("data-test",!0)),this._engines.set("data-test:light",this._createAttributeEngine("data-test",!1)),this._engines.set("css",this._createCSSEngine()),this._engines.set("nth",{queryAll:()=>[]}),this._engines.set("visible",this._createVisibleEngine()),this._engines.set("internal:control",this._createControlEngine()),this._engines.set("internal:has",this._createHasEngine()),this._engines.set("internal:has-not",this._createHasNotEngine()),this._engines.set("internal:and",{queryAll:()=>[]}),this._engines.set("internal:or",{queryAll:()=>[]}),this._engines.set("internal:chain",this._createInternalChainEngine()),this._engines.set("internal:label",this._createInternalLabelEngine()),this._engines.set("internal:text",this._createTextEngine(!0,!0)),this._engines.set("internal:has-text",this._createInternalHasTextEngine()),this._engines.set("internal:has-not-text",this._createInternalHasNotTextEngine()),this._engines.set("internal:attr",this._createNamedAttributeEngine()),this._engines.set("internal:testid",this._createNamedAttributeEngine()),this._engines.set("internal:role",Zy(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(const{name:s,source:l}of i.customEngines)this._engines.set(s,this.eval(l));this._stableRafCount=i.stableRafCount,this._browserName=i.browserName,this._isUtilityWorld=!!i.isUtilityWorld,sT({browserNameForWorkarounds:i.browserName}),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),this.isUnderTest&&(this.window.__injectedScript=this)}eval(e){return this.window.eval(e)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(e){const i=Fa(e);return mx(i,s=>{if(!this._engines.has(s.name))throw this.createStacklessError(`Unknown engine "${s.name}" while parsing selector ${e}`)}),i}generateSelector(e,i){return e0(this,e,i)}generateSelectorSimple(e,i){return e0(this,e,{...i,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(e,i,s){const l=this.querySelectorAll(e,i);if(s&&l.length>1)throw this.strictModeViolationError(e,l);return l[0]}_queryNth(e,i){const s=[...e];let l=+i.body;return l===-1&&(l=s.length-1),new Set(s.slice(l,l+1))}_queryLayoutSelector(e,i,s){const l=i.name,o=i.body,u=[],f=this.querySelectorAll(o.parsed,s);for(const d of e){const p=Lb(l,d,f,o.distance);p!==void 0&&u.push({element:d,score:p})}return u.sort((d,p)=>d.score-p.score),new Set(u.map(d=>d.element))}ariaSnapshot(e,i){if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");return this._lastAriaSnapshot=Ua(e,i),Qo(this._lastAriaSnapshot,i)}ariaSnapshotForRecorder(){const e=Ua(this.document.body,{mode:"ai"});return{ariaSnapshot:Qo(e,{mode:"ai"}),refs:e.refs}}getAllElementsMatchingExpectAriaTemplate(e,i){return LT(e.documentElement,i)}querySelectorAll(e,i){if(e.capture!==void 0){if(e.parts.some(l=>l.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");const s={parts:e.parts.slice(0,e.capture+1)};if(e.capture<e.parts.length-1){const l={parts:e.parts.slice(e.capture+1)},o={name:"internal:has",body:{parsed:l},source:Gn(l)};s.parts.push(o)}return this.querySelectorAll(s,i)}if(!i.querySelectorAll)throw this.createStacklessError("Node is not queryable.");if(e.capture!==void 0)throw this.createStacklessError("Internal error: there should not be a capture in the selector.");if(i.nodeType===11&&e.parts.length===1&&e.parts[0].name==="css"&&e.parts[0].source===":scope")return[i];this._evaluator.begin();try{let s=new Set([i]);for(const l of e.parts)if(l.name==="nth")s=this._queryNth(s,l);else if(l.name==="internal:and"){const o=this.querySelectorAll(l.body.parsed,i);s=new Set(o.filter(u=>s.has(u)))}else if(l.name==="internal:or"){const o=this.querySelectorAll(l.body.parsed,i);s=new Set(qb(new Set([...s,...o])))}else if($T.includes(l.name))s=this._queryLayoutSelector(s,l,i);else{const o=new Set;for(const u of s){const f=this._queryEngineAll(l,u);for(const d of f)o.add(d)}s=o}return[...s]}finally{this._evaluator.end()}}_queryEngineAll(e,i){const s=this._engines.get(e.name).queryAll(i,e.body);for(const l of s)if(!("nodeName"in l))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(l)}`);return s}_createAttributeEngine(e,i){const s=l=>[{simples:[{selector:{css:`[${e}=${JSON.stringify(l)}]`,functions:[]},combinator:""}]}];return{queryAll:(l,o)=>this._evaluator.query({scope:l,pierceShadow:i},s(o))}}_createCSSEngine(){return{queryAll:(e,i)=>this._evaluator.query({scope:e,pierceShadow:!0},i)}}_createTextEngine(e,i){return{queryAll:(l,o)=>{const{matcher:u,kind:f}=So(o,i),d=[];let p=null;const m=b=>{if(f==="lax"&&p&&p.contains(b))return!1;const w=lc(this._evaluator._cacheText,b,u);w==="none"&&(p=b),(w==="self"||w==="selfAndChildren"&&f==="strict"&&!i)&&d.push(b)};l.nodeType===Node.ELEMENT_NODE&&m(l);const y=this._evaluator._queryCSS({scope:l,pierceShadow:e},"*");for(const b of y)m(b);return d}}}_createInternalHasTextEngine(){return{queryAll:(e,i)=>{if(e.nodeType!==1)return[];const s=e,l=Dt(this._evaluator._cacheText,s),{matcher:o}=So(i,!0);return o(l)?[s]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(e,i)=>{if(e.nodeType!==1)return[];const s=e,l=Dt(this._evaluator._cacheText,s),{matcher:o}=So(i,!0);return o(l)?[]:[s]}}}_createInternalLabelEngine(){return{queryAll:(e,i)=>{const{matcher:s}=So(i,!0);return this._evaluator._queryCSS({scope:e,pierceShadow:!0},"*").filter(o=>Db(this._evaluator._cacheText,o).some(u=>s(u)))}}}_createNamedAttributeEngine(){return{queryAll:(i,s)=>{const l=Zi(s,!0);if(l.name||l.attributes.length!==1)throw new Error("Malformed attribute selector: "+s);const{name:o,value:u,caseSensitive:f}=l.attributes[0],d=f?null:u.toLowerCase();let p;return u instanceof RegExp?p=y=>!!y.match(u):f?p=y=>y===u:p=y=>y.toLowerCase().includes(d),this._evaluator._queryCSS({scope:i,pierceShadow:!0},`[${o}]`).filter(y=>p(y.getAttribute(o)))}}}_createDescribeEngine(){return{queryAll:i=>i.nodeType!==1?[]:[i]}}_createControlEngine(){return{queryAll(e,i){if(i==="enter-frame")return[];if(i==="return-empty")return[];if(i==="component")return e.nodeType!==1?[]:[e.childElementCount===1?e.firstElementChild:e];throw new Error(`Internal error, unknown internal:control selector ${i}`)}}}_createHasEngine(){return{queryAll:(i,s)=>i.nodeType!==1?[]:!!this.querySelector(s.parsed,i,!1)?[i]:[]}}_createHasNotEngine(){return{queryAll:(i,s)=>i.nodeType!==1?[]:!!this.querySelector(s.parsed,i,!1)?[]:[i]}}_createVisibleEngine(){return{queryAll:(i,s)=>{if(i.nodeType!==1)return[];const l=s==="true";return yi(i)===l?[i]:[]}}}_createInternalChainEngine(){return{queryAll:(i,s)=>this.querySelectorAll(s.parsed,i)}}extend(e,i){const s=this.window.eval(`
|
|
116
116
|
(() => {
|
|
@@ -120,7 +120,7 @@ ${n.stack}`,{e:{n:n.name,m:n.message,s:u}}}if(qE(n))return{d:n.toJSON()};if($E(n
|
|
|
120
120
|
})()`);return new s(this,i)}async viewportRatio(e){return await new Promise(i=>{const s=new IntersectionObserver(l=>{i(l[0].intersectionRatio),s.disconnect()});s.observe(e),this.utils.builtins.requestAnimationFrame(()=>{})})}getElementBorderWidth(e){if(e.nodeType!==Node.ELEMENT_NODE||!e.ownerDocument||!e.ownerDocument.defaultView)return{left:0,top:0};const i=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(i.borderLeftWidth||"",10),top:parseInt(i.borderTopWidth||"",10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return"error:notconnected";const i=e.ownerDocument.defaultView;for(let l=e;l;l=bt(l))if(i.getComputedStyle(l).transform!=="none")return"transformed";const s=i.getComputedStyle(e);return{left:parseInt(s.borderLeftWidth||"",10)+parseInt(s.paddingLeft||"",10),top:parseInt(s.borderTopWidth||"",10)+parseInt(s.paddingTop||"",10)}}retarget(e,i){let s=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!s)return null;if(i==="none")return s;if(!s.matches("input, textarea, select")&&!s.isContentEditable&&(i==="button-link"?s=s.closest("button, [role=button], a, [role=link]")||s:s=s.closest("button, [role=button], [role=checkbox], [role=radio]")||s),i==="follow-label"&&!s.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!s.isContentEditable){const l=s.closest("label");l&&l.control&&(s=l.control)}return s}async checkElementStates(e,i){if(i.includes("stable")){const s=await this._checkElementIsStable(e);if(s===!1)return{missingState:"stable"};if(s==="error:notconnected")return"error:notconnected"}for(const s of i)if(s!=="stable"){const l=this.elementState(e,s);if(l.received==="error:notconnected")return"error:notconnected";if(!l.matches)return{missingState:s}}}async _checkElementIsStable(e){const i=Symbol("continuePolling");let s,l=0,o=0;const u=()=>{const y=this.retarget(e,"no-follow-label");if(!y)return"error:notconnected";const b=this.utils.builtins.performance.now();if(this._stableRafCount>1&&b-o<15)return i;o=b;const w=y.getBoundingClientRect(),E={x:w.top,y:w.left,width:w.width,height:w.height};if(s){if(!(E.x===s.x&&E.y===s.y&&E.width===s.width&&E.height===s.height))return!1;if(++l>=this._stableRafCount)return!0}return s=E,i};let f,d;const p=new Promise((y,b)=>{f=y,d=b}),m=()=>{try{const y=u();y!==i?f(y):this.utils.builtins.requestAnimationFrame(m)}catch(y){d(y)}};return this.utils.builtins.requestAnimationFrame(m),p}_createAriaRefEngine(){return{queryAll:(i,s)=>{var o,u;const l=(u=(o=this._lastAriaSnapshot)==null?void 0:o.elements)==null?void 0:u.get(s);return l&&l.isConnected?[l]:[]}}}elementState(e,i){const s=this.retarget(e,["visible","hidden"].includes(i)?"none":"follow-label");if(!s||!s.isConnected)return i==="hidden"?{matches:!0,received:"hidden"}:{matches:!1,received:"error:notconnected"};if(i==="visible"||i==="hidden"){const l=yi(s);return{matches:i==="visible"?l:!l,received:l?"visible":"hidden"}}if(i==="disabled"||i==="enabled"){const l=Fo(s);return{matches:i==="disabled"?l:!l,received:l?"disabled":"enabled"}}if(i==="editable"){const l=Fo(s),o=vT(s);if(o==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!l&&!o,received:l?"disabled":o?"readOnly":"editable"}}if(i==="checked"||i==="unchecked"){const l=i==="checked",o=yT(s);if(o==="error")throw this.createStacklessError("Not a checkbox or radio button");const u=s.nodeName==="INPUT"&&s.type==="radio";return{matches:l===o,received:o?"checked":"unchecked",isRadio:u}}if(i==="indeterminate"){const l=mT(s);if(l==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:l==="mixed",received:l===!0?"checked":l===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${i}"`)}selectOptions(e,i){const s=this.retarget(e,"follow-label");if(!s)return"error:notconnected";if(s.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");const l=s,o=[...l.options],u=[];let f=i.slice();for(let d=0;d<o.length;d++){const p=o[d],m=y=>{if(y instanceof Node)return p===y;let b=!0;return y.valueOrLabel!==void 0&&(b=b&&(y.valueOrLabel===p.value||y.valueOrLabel===p.label)),y.value!==void 0&&(b=b&&y.value===p.value),y.label!==void 0&&(b=b&&y.label===p.label),y.index!==void 0&&(b=b&&y.index===d),b};if(f.some(m)){if(!this.elementState(p,"enabled").matches)return"error:optionnotenabled";if(u.push(p),l.multiple)f=f.filter(y=>!m(y));else{f=[];break}}}return f.length?"error:optionsnotfound":(l.value=void 0,u.forEach(d=>d.selected=!0),l.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),l.dispatchEvent(new Event("change",{bubbles:!0})),u.map(d=>d.value))}fill(e,i){const s=this.retarget(e,"follow-label");if(!s)return"error:notconnected";if(s.nodeName.toLowerCase()==="input"){const l=s,o=l.type.toLowerCase(),u=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(o)&&!u.has(o))throw this.createStacklessError(`Input of type "${o}" cannot be filled`);if(o==="number"&&(i=i.trim(),isNaN(Number(i))))throw this.createStacklessError("Cannot type text into input[type=number]");if(u.has(o)){if(i=i.trim(),l.focus(),l.value=i,l.value!==i)throw this.createStacklessError("Malformed value");return s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(s.nodeName.toLowerCase()!=="textarea"){if(!s.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element")}return this.selectText(s),"needsinput"}selectText(e){const i=this.retarget(e,"follow-label");if(!i)return"error:notconnected";if(i.nodeName.toLowerCase()==="input"){const o=i;return o.select(),o.focus(),"done"}if(i.nodeName.toLowerCase()==="textarea"){const o=i;return o.selectionStart=0,o.selectionEnd=o.value.length,o.focus(),"done"}const s=i.ownerDocument.createRange();s.selectNodeContents(i);const l=i.ownerDocument.defaultView.getSelection();return l&&(l.removeAllRanges(),l.addRange(s)),i.focus(),"done"}_activelyFocused(e){const i=e.getRootNode().activeElement,s=i===e&&!!e.ownerDocument&&e.ownerDocument.hasFocus();return{activeElement:i,isFocused:s}}focusNode(e,i){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");const{activeElement:s,isFocused:l}=this._activelyFocused(e);if(e.isContentEditable&&!l&&s&&s.blur&&s.blur(),e.focus(),e.focus(),i&&!l&&e.nodeName.toLowerCase()==="input")try{e.setSelectionRange(0,0)}catch{}return"done"}blurNode(e){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");return e.blur(),"done"}setInputFiles(e,i){if(e.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";const s=e;if(s.nodeName!=="INPUT")return"Not an <input> element";const l=s;if((l.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";const u=i.map(d=>{const p=Uint8Array.from(atob(d.buffer),m=>m.charCodeAt(0));return new File([p],d.name,{type:d.mimeType,lastModified:d.lastModifiedMs})}),f=new DataTransfer;for(const d of u)f.items.add(d);l.files=f.files,l.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),l.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(e,i){const s=[];let l=i;for(;l;){const m=ob(l);if(!m||(s.push(m),m.nodeType===9))break;l=m.host}let o;for(let m=s.length-1;m>=0;m--){const y=s[m],b=y.elementsFromPoint(e.x,e.y),w=y.elementFromPoint(e.x,e.y);if(w&&b[0]&&bt(w)===b[0]){const x=this.window.getComputedStyle(w);(x==null?void 0:x.display)==="contents"&&b.unshift(w)}b[0]&&b[0].shadowRoot===y&&b[1]===w&&b.shift();const E=b[0];if(!E||(o=E,m&&E!==s[m-1].host))break}const u=[];for(;o&&o!==i;)u.push(o),o=bt(o);if(o===i)return"done";const f=this.previewNode(u[0]||this.document.documentElement);let d,p=i;for(;p;){const m=u.indexOf(p);if(m!==-1){m>1&&(d=this.previewNode(u[m-1]));break}p=bt(p)}return d?{hitTargetDescription:`${f} from ${d} subtree`}:{hitTargetDescription:f}}setupHitTargetInterceptor(e,i,s,l){const o=this.retarget(e,"button-link");if(!o||!o.isConnected)return"error:notconnected";if(s){const m=this.expectHitTarget(s,o);if(m!=="done")return m.hitTargetDescription}if(i==="drag")return{stop:()=>"done"};const u={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[i];let f;const d=m=>{if(!u.has(m.type)||!m.isTrusted)return;const y=this.window.TouchEvent&&m instanceof this.window.TouchEvent?m.touches[0]:m;f===void 0&&y&&(f=this.expectHitTarget({x:y.clientX,y:y.clientY},o)),(l||f!=="done"&&f!==void 0)&&(m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation())},p=()=>(this._hitTargetInterceptor===d&&(this._hitTargetInterceptor=void 0),f||"done");return this._hitTargetInterceptor=d,{stop:p}}dispatchEvent(e,i,s){var u,f,d;let l;const o={bubbles:!0,cancelable:!0,composed:!0,...s};switch(this._eventTypes.get(i)){case"mouse":l=new MouseEvent(i,o);break;case"keyboard":l=new KeyboardEvent(i,o);break;case"touch":{if(this._browserName==="webkit"){const p=y=>{var E,x;if(y instanceof Touch)return y;let b=y.pageX;b===void 0&&y.clientX!==void 0&&(b=y.clientX+(((E=this.document.scrollingElement)==null?void 0:E.scrollLeft)||0));let w=y.pageY;return w===void 0&&y.clientY!==void 0&&(w=y.clientY+(((x=this.document.scrollingElement)==null?void 0:x.scrollTop)||0)),this.document.createTouch(this.window,y.target??e,y.identifier,b,w,y.screenX,y.screenY,y.radiusX,y.radiusY,y.rotationAngle,y.force)},m=y=>y instanceof TouchList||!y?y:this.document.createTouchList(...y.map(p));o.target??(o.target=e),o.touches=m(o.touches),o.targetTouches=m(o.targetTouches),o.changedTouches=m(o.changedTouches),l=new TouchEvent(i,o)}else o.target??(o.target=e),o.touches=(u=o.touches)==null?void 0:u.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),o.targetTouches=(f=o.targetTouches)==null?void 0:f.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),o.changedTouches=(d=o.changedTouches)==null?void 0:d.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l=new TouchEvent(i,o);break}case"pointer":l=new PointerEvent(i,o);break;case"focus":l=new FocusEvent(i,o);break;case"drag":l=new DragEvent(i,o);break;case"wheel":l=new WheelEvent(i,o);break;case"deviceorientation":try{l=new DeviceOrientationEvent(i,o)}catch{const{bubbles:p,cancelable:m,alpha:y,beta:b,gamma:w,absolute:E}=o;l=this.document.createEvent("DeviceOrientationEvent"),l.initDeviceOrientationEvent(i,p,m,y,b,w,E)}break;case"devicemotion":try{l=new DeviceMotionEvent(i,o)}catch{const{bubbles:p,cancelable:m,acceleration:y,accelerationIncludingGravity:b,rotationRate:w,interval:E}=o;l=this.document.createEvent("DeviceMotionEvent"),l.initDeviceMotionEvent(i,p,m,y,b,w,E)}break;default:l=new Event(i,o);break}e.dispatchEvent(l)}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return vo(`#text=${e.nodeValue||""}`);if(e.nodeType!==Node.ELEMENT_NODE)return vo(`<${e.nodeName.toLowerCase()} />`);const i=e,s=[];for(let d=0;d<i.attributes.length;d++){const{name:p,value:m}=i.attributes[d];p!=="style"&&(!m&&this._booleanAttributes.has(p)?s.push(` ${p}`):s.push(` ${p}="${m}"`))}s.sort((d,p)=>d.length-p.length);const l=Ny(s.join(""),500);if(this._autoClosingTags.has(i.nodeName))return vo(`<${i.nodeName.toLowerCase()}${l}/>`);const o=i.childNodes;let u=!1;if(o.length<=5){u=!0;for(let d=0;d<o.length;d++)u=u&&o[d].nodeType===Node.TEXT_NODE}const f=u?i.textContent||"":o.length?"…":"";return vo(`<${i.nodeName.toLowerCase()}${l}>${Ny(f,50)}</${i.nodeName.toLowerCase()}>`)}strictModeViolationError(e,i){this._evaluator.begin(),rc(),qh();try{const s=this._isUtilityWorld&&this._browserName==="firefox"?2:10,l=i.slice(0,s).map(u=>({preview:this.previewNode(u),selector:this.generateSelectorSimple(u)})),o=l.map((u,f)=>`
|
|
121
121
|
${f+1}) ${u.preview} aka ${Ji(this._sdkLanguage,u.selector)}`);return l.length<i.length&&o.push(`
|
|
122
122
|
...`),this.createStacklessError(`strict mode violation: ${Ji(this._sdkLanguage,Gn(e))} resolved to ${i.length} elements:${o.join("")}
|
|
123
|
-
`)}finally{$h(),ac(),this._evaluator.end()}}createStacklessError(e){if(this._browserName==="firefox"){const s=new Error("Error: "+e);return s.stack="",s}const i=new Error(e);return delete i.stack,i}createHighlight(){return new Qf(this)}maskSelectors(e,i){this._highlight&&this.hideHighlight(),this._highlight=new Qf(this),this._highlight.install();const s=[];for(const l of e)s.push(this.querySelectorAll(l,this.document.documentElement));this._highlight.maskElements(s.flat(),i)}highlight(e){this._highlight||(this._highlight=new Qf(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,i){var u,f;((u=this._markedElements)==null?void 0:u.callId)!==i&&(this._markedElements=void 0);const s=((f=this._markedElements)==null?void 0:f.elements)||new Set,l=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:i,composed:!0});for(const d of s)e.has(d)||d.dispatchEvent(l);const o=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:i,composed:!0});for(const d of e)s.has(d)||d.dispatchEvent(o);this._markedElements={callId:i,elements:e}}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let i=!1;const s=()=>i=!0;this.window.addEventListener(e,s),new MutationObserver(l=>{if(l.some(u=>Array.from(u.addedNodes).includes(this.document.documentElement))&&(i=!1,this.window.dispatchEvent(new CustomEvent(e)),!i)){this.window.addEventListener(e,s);for(const u of this.onGlobalListenersRemoved)u()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=s=>{var l;return(l=this._hitTargetInterceptor)==null?void 0:l.call(this,s)},i=()=>{for(const s of this._allHitTargetInterceptorEvents)this.window.addEventListener(s,e,{capture:!0,passive:!1})};i(),this.onGlobalListenersRemoved.add(i)}async expect(e,i,s){var o,u;if(i.expression==="to.have.count"||i.expression.endsWith(".array"))return this.expectArray(s,i);if(!e){if(!i.isNot&&i.expression==="to.be.hidden")return{matches:!0};if(i.isNot&&i.expression==="to.be.visible")return{matches:!1};if(!i.isNot&&i.expression==="to.be.detached")return{matches:!0};if(i.isNot&&i.expression==="to.be.attached")return{matches:!1};if(i.isNot&&i.expression==="to.be.in.viewport")return{matches:!1};if(i.expression==="to.have.title"&&((o=i==null?void 0:i.expectedText)!=null&&o[0])){const f=new Xs(i.expectedText[0]),d=this.document.title;return{received:d,matches:f.matches(d)}}if(i.expression==="to.have.url"&&((u=i==null?void 0:i.expectedText)!=null&&u[0])){const f=new Xs(i.expectedText[0]),d=this.document.location.href;return{received:d,matches:f.matches(d)}}return{matches:i.isNot,missingReceived:!0}}return await this.expectSingleElement(e,i)}async expectSingleElement(e,i){var l;const s=i.expression;{let o;if(s==="to.have.attribute"){const u=e.hasAttribute(i.expressionArg);o={matches:u,received:u?"attribute present":"attribute not present"}}else if(s==="to.be.checked"){const{checked:u,indeterminate:f}=i.expectedValue;if(f){if(u!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");o=this.elementState(e,"indeterminate")}else o=this.elementState(e,u===!1?"unchecked":"checked")}else if(s==="to.be.disabled")o=this.elementState(e,"disabled");else if(s==="to.be.editable")o=this.elementState(e,"editable");else if(s==="to.be.readonly")o=this.elementState(e,"editable"),o.matches=!o.matches;else if(s==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const u=e.value;o={matches:!u,received:u?"notEmpty":"empty"}}else{const u=(l=e.textContent)==null?void 0:l.trim();o={matches:!u,received:u?"notEmpty":"empty"}}else if(s==="to.be.enabled")o=this.elementState(e,"enabled");else if(s==="to.be.focused"){const u=this._activelyFocused(e).isFocused;o={matches:u,received:u?"focused":"inactive"}}else s==="to.be.hidden"?o=this.elementState(e,"hidden"):s==="to.be.visible"?o=this.elementState(e,"visible"):s==="to.be.attached"?o={matches:!0,received:"attached"}:s==="to.be.detached"&&(o={matches:!1,received:"attached"});if(o){if(o.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return o}}if(s==="to.have.property"){let o=e;const u=i.expressionArg.split(".");for(let p=0;p<u.length-1;p++){if(typeof o!="object"||!(u[p]in o))return{received:void 0,matches:!1};o=o[u[p]]}const f=o[u[u.length-1]],d=vh(f,i.expectedValue);return{received:f,matches:d}}if(s==="to.be.in.viewport"){const o=await this.viewportRatio(e);return{received:`viewport ratio ${o}`,matches:o>0&&o>(i.expectedNumber??0)-1e-9}}if(s==="to.have.values"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="SELECT"||!e.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");const o=[...e.selectedOptions].map(u=>u.value);return o.length!==i.expectedText.length?{received:o,matches:!1}:{received:o,matches:o.map((u,f)=>new Xs(i.expectedText[f]).matches(u)).every(Boolean)}}if(s==="to.match.aria"){const o=OT(e,i.expectedValue);return{received:o.received,matches:!!o.matches.length}}{let o;if(s==="to.have.attribute.value"){const u=e.getAttribute(i.expressionArg);if(u===null)return{received:null,matches:!1};o=u}else if(["to.have.class","to.contain.class"].includes(s)){if(!i.expectedText)throw this.createStacklessError("Expected text is not provided for "+s);return{received:e.classList.toString(),matches:new Xs(i.expectedText[0]).matchesClassList(this,e.classList,s==="to.contain.class")}}else if(s==="to.have.css")o=this.window.getComputedStyle(e).getPropertyValue(i.expressionArg);else if(s==="to.have.id")o=e.id;else if(s==="to.have.text")o=i.useInnerText?e.innerText:Dt(new Map,e).full;else if(s==="to.have.accessible.name")o=Ga(e,!1);else if(s==="to.have.accessible.description")o=Gy(e,!1);else if(s==="to.have.accessible.error.message")o=pT(e);else if(s==="to.have.role")o=pt(e)||"";else if(s==="to.have.value"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"&&e.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");o=e.value}if(o!==void 0&&i.expectedText){const u=new Xs(i.expectedText[0]);return{received:o,matches:u.matches(o)}}}throw this.createStacklessError("Unknown expect matcher: "+s)}expectArray(e,i){const s=i.expression;if(s==="to.have.count"){const d=e.length,p=d===i.expectedNumber;return{received:d,matches:p}}if(!i.expectedText)throw this.createStacklessError("Expected text is not provided for "+s);if(["to.have.class.array","to.contain.class.array"].includes(s)){const d=e.map(y=>y.classList),p=d.map(String);if(d.length!==i.expectedText.length)return{received:p,matches:!1};const m=this._matchSequentially(i.expectedText,d,(y,b)=>y.matchesClassList(this,b,s==="to.contain.class.array"));return{received:p,matches:m}}if(!["to.contain.text.array","to.have.text.array"].includes(s))throw this.createStacklessError("Unknown expect matcher: "+s);const l=e.map(d=>i.useInnerText?d.innerText:Dt(new Map,d).full),o=s!=="to.contain.text.array";if(!(l.length===i.expectedText.length||!o))return{received:l,matches:!1};const f=this._matchSequentially(i.expectedText,l,(d,p)=>d.matches(p));return{received:l,matches:f}}_matchSequentially(e,i,s){const l=e.map(f=>new Xs(f));let o=0,u=0;for(;o<l.length&&u<i.length;)s(l[o],i[u])&&++o,++u;return o===l.length}}function vo(n){return n.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function PE(n){if(n=n.substring(1,n.length-1),!n.includes("\\"))return n;const e=[];let i=0;for(;i<n.length;)n[i]==="\\"&&i+1<n.length&&i++,e.push(n[i++]);return e.join("")}function So(n,e){if(n[0]==="/"&&n.lastIndexOf("/")>0){const l=n.lastIndexOf("/"),o=new RegExp(n.substring(1,l),n.substring(l+1));return{matcher:u=>o.test(u.full),kind:"regex"}}const i=e?JSON.parse.bind(JSON):PE;let s=!1;return n.length>1&&n[0]==='"'&&n[n.length-1]==='"'?(n=i(n),s=!0):e&&n.length>1&&n[0]==='"'&&n[n.length-2]==='"'&&n[n.length-1]==="i"?(n=i(n.substring(0,n.length-1)),s=!1):e&&n.length>1&&n[0]==='"'&&n[n.length-2]==='"'&&n[n.length-1]==="s"?(n=i(n.substring(0,n.length-1)),s=!0):n.length>1&&n[0]==="'"&&n[n.length-1]==="'"&&(n=i(n),s=!0),n=Et(n),s?e?{kind:"strict",matcher:o=>o.normalized===n}:{matcher:o=>!n&&!o.immediate.length?!0:o.immediate.some(u=>Et(u)===n),kind:"strict"}:(n=n.toLowerCase(),{kind:"lax",matcher:l=>l.normalized.toLowerCase().includes(n)})}class Xs{constructor(e){if(this._normalizeWhiteSpace=e.normalizeWhiteSpace,this._ignoreCase=e.ignoreCase,this._string=e.matchSubstring?void 0:this.normalize(e.string),this._substring=e.matchSubstring?this.normalize(e.string):void 0,e.regexSource){const i=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&i.delete("i"),e.ignoreCase===!0&&i.add("i"),this._regex=new RegExp(e.regexSource,[...i].join(""))}}matches(e){return this._regex||(e=this.normalize(e)),this._string!==void 0?e===this._string:this._substring!==void 0?e.includes(this._substring):this._regex?!!this._regex.test(e):!1}matchesClassList(e,i,s){if(s){if(this._regex)throw e.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every(l=>i.contains(l))}return this.matches(i.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=Et(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function vh(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(let s=0;s<n.length;++s)if(!vh(n[s],e[s]))return!1;return!0}if(n instanceof RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===e.toString();const i=Object.keys(n);if(i.length!==Object.keys(e).length)return!1;for(let s=0;s<i.length;++s)if(!e.hasOwnProperty(i[s]))return!1;for(const s of i)if(!vh(n[s],e[s]))return!1;return!0}return typeof n=="number"&&typeof e=="number"?isNaN(n)&&isNaN(e):!1}const FE={tagName:"svg",children:[{tagName:"defs",children:[{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gripper"},children:[{tagName:"path",attrs:{d:"M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-circle-large-filled"},children:[{tagName:"path",attrs:{d:"M8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674 7.157 7.157 0 0 1-2.516 2.509 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-stop-circle"},children:[{tagName:"path",attrs:{d:"M6 6h4v4H6z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-inspect"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-whole-word"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 11H1V13H15V11H16V14H15H1H0V11Z"}},{tagName:"path",attrs:{d:"M6.84048 11H5.95963V10.1406H5.93814C5.555 10.7995 4.99104 11.1289 4.24625 11.1289C3.69839 11.1289 3.26871 10.9839 2.95718 10.6938C2.64924 10.4038 2.49527 10.0189 2.49527 9.53906C2.49527 8.51139 3.10041 7.91341 4.3107 7.74512L5.95963 7.51416C5.95963 6.57959 5.58186 6.1123 4.82632 6.1123C4.16389 6.1123 3.56591 6.33789 3.03238 6.78906V5.88672C3.57307 5.54297 4.19612 5.37109 4.90152 5.37109C6.19416 5.37109 6.84048 6.05501 6.84048 7.42285V11ZM5.95963 8.21777L4.63297 8.40039C4.22476 8.45768 3.91682 8.55973 3.70914 8.70654C3.50145 8.84977 3.39761 9.10579 3.39761 9.47461C3.39761 9.74316 3.4925 9.96338 3.68228 10.1353C3.87564 10.3035 4.13166 10.3877 4.45035 10.3877C4.8872 10.3877 5.24706 10.2355 5.52994 9.93115C5.8164 9.62321 5.95963 9.2347 5.95963 8.76562V8.21777Z"}},{tagName:"path",attrs:{d:"M9.3475 10.2051H9.32601V11H8.44515V2.85742H9.32601V6.4668H9.3475C9.78076 5.73633 10.4146 5.37109 11.2489 5.37109C11.9543 5.37109 12.5057 5.61816 12.9032 6.1123C13.3042 6.60286 13.5047 7.26172 13.5047 8.08887C13.5047 9.00911 13.2809 9.74674 12.8333 10.3018C12.3857 10.8532 11.7734 11.1289 10.9964 11.1289C10.2695 11.1289 9.71989 10.821 9.3475 10.2051ZM9.32601 7.98682V8.75488C9.32601 9.20964 9.47282 9.59635 9.76644 9.91504C10.0636 10.2301 10.4396 10.3877 10.8944 10.3877C11.4279 10.3877 11.8451 10.1836 12.1458 9.77539C12.4502 9.36719 12.6024 8.79964 12.6024 8.07275C12.6024 7.46045 12.4609 6.98063 12.1781 6.6333C11.8952 6.28597 11.512 6.1123 11.0286 6.1123C10.5166 6.1123 10.1048 6.29134 9.7933 6.64941C9.48177 7.00391 9.32601 7.44971 9.32601 7.98682Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-eye"},children:[{tagName:"path",attrs:{d:"M7.99993 6.00316C9.47266 6.00316 10.6666 7.19708 10.6666 8.66981C10.6666 10.1426 9.47266 11.3365 7.99993 11.3365C6.52715 11.3365 5.33324 10.1426 5.33324 8.66981C5.33324 7.19708 6.52715 6.00316 7.99993 6.00316ZM7.99993 7.00315C7.07946 7.00315 6.33324 7.74935 6.33324 8.66981C6.33324 9.59028 7.07946 10.3365 7.99993 10.3365C8.9204 10.3365 9.6666 9.59028 9.6666 8.66981C9.6666 7.74935 8.9204 7.00315 7.99993 7.00315ZM7.99993 3.66675C11.0756 3.66675 13.7307 5.76675 14.4673 8.70968C14.5344 8.97755 14.3716 9.24908 14.1037 9.31615C13.8358 9.38315 13.5643 9.22041 13.4973 8.95248C12.8713 6.45205 10.6141 4.66675 7.99993 4.66675C5.38454 4.66675 3.12664 6.45359 2.50182 8.95555C2.43491 9.22341 2.16348 9.38635 1.89557 9.31948C1.62766 9.25255 1.46471 8.98115 1.53162 8.71321C2.26701 5.76856 4.9229 3.66675 7.99993 3.66675Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-symbol-constant"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 6h8v1H4V6zm8 3H4v1h8V9z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 4l1-1h12l1 1v8l-1 1H2l-1-1V4zm1 0v8h12V4H2z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-check"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-close"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-pass"},children:[{tagName:"path",attrs:{d:"M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gist"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.57 1.14l3.28 3.3.15.36v9.7l-.5.5h-11l-.5-.5v-13l.5-.5h7.72l.35.14zM10 5h3l-3-3v3zM3 2v12h10V6H9.5L9 5.5V2H3zm2.062 7.533l1.817-1.828L6.17 7 4 9.179v.707l2.171 2.174.707-.707-1.816-1.82zM8.8 7.714l.7-.709 2.189 2.175v.709L9.5 12.062l-.705-.709 1.831-1.82L8.8 7.714z"}}]}]}]},an={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class n0{}class eh{constructor(e,i){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=i}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var i;He(e),e.button===0&&(i=this._hoveredModel)!=null&&i.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){He(e)}onPointerUp(e){He(e)}onMouseDown(e){He(e)}onMouseUp(e){He(e)}onMouseMove(e){var l;He(e);let i=this._recorder.deepEventTarget(e);if(i.isConnected||(i=null),this._hoveredElement===i)return;this._hoveredElement=i;let s=null;if(this._hoveredElement){const o=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});s={selector:o.selector,elements:o.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,o.selector),color:this._assertVisibility?an.assert:an.single}}((l=this._hoveredModel)==null?void 0:l.selector)!==(s==null?void 0:s.selector)&&(this._hoveredModel=s,this._recorder.updateHighlight(s,!0))}onMouseEnter(e){He(e)}onMouseLeave(e){He(e);const i=this._recorder.injectedScript.window;i.top!==i&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){He(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){He(e)}onScroll(e){this._reset(!1)}_commit(e,i){var s;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(s=this._recorder.overlay)==null||s.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,i)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class QE{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set,this._dialog=new iv(e)}cursor(){return"pointer"}_installObserverIfNeeded(){var e;this._observer||(e=this._recorder.injectedScript.document)!=null&&e.body&&(this._observer=new MutationObserver(i=>{if(this._hoveredElement)for(const s of i)for(const l of s.removedNodes)(l===this._hoveredElement||l.contains(this._hoveredElement))&&this._resetHoveredModel()}),this._observer.observe(this._recorder.injectedScript.document.body,{childList:!0,subtree:!0}))}uninstall(){var e;(e=this._observer)==null||e.disconnect(),this._observer=null,this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._dialog.close()}onClick(e){if(this._dialog.isShowing()){e.button===2&&e.type==="auxclick"&&He(e);return}if(qa(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;if(e.button===2&&e.type==="auxclick"){this._showActionListDialog(this._hoveredModel,e);return}const i=za(this._recorder.deepEventTarget(e));if(i&&e.detail===1){this._performAction({name:i.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:Ha(e),signals:[],button:Sh(e),modifiers:sr(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){this._dialog.isShowing()||qa(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:Ha(e),signals:[],button:Sh(e),modifiers:sr(e),clickCount:e.detail}))}_commitPendingClickAction(){this._pendingClickAction&&this._performAction(this._pendingClickAction.action),this._cancelPendingClickAction()}_cancelPendingClickAction(){this._pendingClickAction&&this._recorder.injectedScript.utils.builtins.clearTimeout(this._pendingClickAction.timeout),this._pendingClickAction=void 0}onContextMenu(e){if(this._dialog.isShowing()){He(e);return}this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._showActionListDialog(this._hoveredModel,e)}onPointerDown(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);this._hoveredElement!==i&&(this._hoveredElement=i,this._updateModelForHoveredElement())}onMouseLeave(e){if(this._dialog.isShowing())return;const i=this._recorder.injectedScript.window;i.top!==i&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._dialog.isShowing()||this._onFocus(!0)}onInput(e){if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);if(i.nodeName==="INPUT"&&i.type.toLowerCase()==="file"){this._recordAction({name:"setInputFiles",selector:this._activeModel.selector,signals:[],files:[...i.files||[]].map(s=>s.name)});return}if(qa(i)){this._recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:i.value});return}if(["INPUT","TEXTAREA"].includes(i.nodeName)||i.isContentEditable){if(i.nodeName==="INPUT"&&["checkbox","radio"].includes(i.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:i.isContentEditable?i.innerText:i.value})}if(i.nodeName==="SELECT"){const s=i;this._recordAction({name:"select",selector:this._activeModel.selector,options:[...s.selectedOptions].map(l=>l.value),signals:[]})}}onKeyDown(e){if(!this._dialog.isShowing()&&this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const i=za(this._recorder.deepEventTarget(e));if(i&&e.detail===0){this._performAction({name:i.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:sr(e)})}}}onKeyUp(e){if(!this._dialog.isShowing()&&this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){He(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._dialog.isShowing()||this._resetHoveredModel()}_showActionListDialog(e,i){He(i);const s=Ha(i),l=[{title:"Click",action:{name:"click",selector:e.selector,position:s,signals:[],button:"left",modifiers:0,clickCount:0}},{title:"Right click",action:{name:"click",selector:e.selector,position:s,signals:[],button:"right",modifiers:0,clickCount:0}},{title:"Double click",action:{name:"click",selector:e.selector,position:s,signals:[],button:"left",modifiers:0,clickCount:2}},{title:"Hover",action:{name:"hover",selector:e.selector,position:s,signals:[]}}],o=this._recorder.document.createElement("x-pw-action-list");o.setAttribute("role","list"),o.setAttribute("aria-label","Choose action");for(const p of l){const m=this._recorder.document.createElement("x-pw-action-item");m.setAttribute("role","listitem"),m.textContent=p.title,m.setAttribute("aria-label",p.title),m.addEventListener("click",()=>{this._dialog.close(),this._performAction(p.action)}),o.appendChild(m)}const u=this._dialog.show({label:"Choose action",body:o,autosize:!0}),f=this._recorder.highlight.firstTooltipBox()||e.elements[0].getBoundingClientRect(),d=this._recorder.highlight.tooltipPosition(f,u);this._dialog.moveTo(d.anchorTop,d.anchorLeft)}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const i=eA(this._recorder.document);if(e&&i===this._recorder.document.body)return;const s=i?this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=s&&s.selector?{...s,color:an.action}:null,e&&(this._hoveredElement=i,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){const i=this._recorder.deepEventTarget(e),s=i.nodeName;return!!(s==="SELECT"||s==="OPTION"||s==="INPUT"&&["date","range"].includes(i.type))}_actionInProgress(e){const i=e instanceof KeyboardEvent,s=e instanceof MouseEvent||e instanceof PointerEvent;for(const l of this._performingActions)if(i&&l.name==="press"&&e.key===l.key||s&&(l.name==="click"||l.name==="hover"||l.name==="check"||l.name==="uncheck"))return!0;return He(e),!1}_consumedDueToNoModel(e,i){return i?!1:(He(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(He(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||He(e)}_recordAction(e){this._recorder.recordAction(e)}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e);const i=this._recorder.performAction(e).then(()=>{this._performingActions.delete(e),this._onFocus(!1)});this._recorder.injectedScript.isUnderTest&&i.then(()=>{console.error("Action performed for test: "+JSON.stringify({hovered:this._hoveredModel?this._hoveredModel.selector:null,active:this._activeModel?this._activeModel.selector:null}))})}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const i=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!i?!!za(this._recorder.deepEventTarget(e)):!0}_updateModelForHoveredElement(){if(this._installObserverIfNeeded(),this._performingActions.size)return;if(!this._hoveredElement||!this._hoveredElement.isConnected){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!0);return}const{selector:e,elements:i}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:i,color:an.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class ZE{constructor(e){this._recorder=e}install(){this._recorder.highlight.uninstall()}uninstall(){this._recorder.highlight.install()}onClick(e){const i=this._recorder.deepEventTarget(e);if(qa(i)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const s=za(i),{ariaSnapshot:l,selector:o,ref:u}=this._ariaSnapshot(i);if(s&&e.detail===1){this._recorder.recordAction({name:s.checked?"check":"uncheck",selector:o,ref:u,signals:[],ariaSnapshot:l});return}this._recorder.recordAction({name:"click",selector:o,ref:u,ariaSnapshot:l,position:Ha(e),signals:[],button:Sh(e),modifiers:sr(e),clickCount:e.detail})}onContextMenu(e){const i=this._recorder.deepEventTarget(e),{ariaSnapshot:s,selector:l,ref:o}=this._ariaSnapshot(i);this._recorder.recordAction({name:"click",selector:l,ref:o,ariaSnapshot:s,position:Ha(e),signals:[],button:"right",modifiers:sr(e),clickCount:1})}onInput(e){const i=this._recorder.deepEventTarget(e),{ariaSnapshot:s,selector:l,ref:o}=this._ariaSnapshot(i);if(qa(i)){this._recorder.recordAction({name:"fill",selector:l,ref:o,ariaSnapshot:s,signals:[],text:i.value});return}if(["INPUT","TEXTAREA"].includes(i.nodeName)||i.isContentEditable){if(i.nodeName==="INPUT"&&["checkbox","radio"].includes(i.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",ref:o,selector:l,ariaSnapshot:s,signals:[],text:i.isContentEditable?i.innerText:i.value});return}if(i.nodeName==="SELECT"){const u=i;this._recorder.recordAction({name:"select",selector:l,ref:o,ariaSnapshot:s,options:[...u.selectedOptions].map(f=>f.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const i=this._recorder.deepEventTarget(e),{ariaSnapshot:s,selector:l,ref:o}=this._ariaSnapshot(i);if(e.key===" "){const u=za(i);if(u&&e.detail===0){this._recorder.recordAction({name:u.checked?"uncheck":"check",selector:l,ref:o,ariaSnapshot:s,signals:[]});return}}this._recorder.recordAction({name:"press",selector:l,ref:o,ariaSnapshot:s,signals:[],key:e.key,modifiers:sr(e)})}_shouldIgnoreMouseEvent(e){const i=this._recorder.deepEventTarget(e),s=i.nodeName;return!!(s==="SELECT"||s==="OPTION"||s==="INPUT"&&["date","range"].includes(i.type))}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const i=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!i?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:i,refs:s}=this._recorder.injectedScript.ariaSnapshotForRecorder(),l=e?s.get(e):void 0,o=e?this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName}):void 0;return{ariaSnapshot:i,selector:o==null?void 0:o.selector,ref:l}}}class th{constructor(e,i){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=i,this._dialog=new iv(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){He(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const i=this._recorder.deepEventTarget(e);this._elementHasValue(i)&&e.preventDefault()}onPointerUp(e){var s;const i=(s=this._hoverHighlight)==null?void 0:s.elements[0];this._kind==="value"&&i&&(i.nodeName==="INPUT"||i.nodeName==="SELECT")&&i.disabled&&this._commitAssertValue()}onMouseMove(e){var s;if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);if(((s=this._hoverHighlight)==null?void 0:s.elements[0])!==i){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,i).full?{elements:[i],selector:"",color:an.assert}:null;else if(this._elementHasValue(i)){const l=this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:l.selector,elements:l.elements,color:an.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),He(e)}onScroll(e){this._recorder.updateHighlight(this._hoverHighlight,!1)}_elementHasValue(e){return e.nodeName==="TEXTAREA"||e.nodeName==="SELECT"||e.nodeName==="INPUT"&&!["button","image","reset","submit"].includes(e.type)}_generateAction(){var i;this._textCache.clear();const e=(i=this._hoverHighlight)==null?void 0:i.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:s}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:s,signals:[],checked:!e.checked}:{name:"assertValue",selector:s,signals:[],value:e.value}}else if(this._kind==="snapshot"){const s=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:s.selector,elements:s.elements,color:an.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"codegen"})}}else{const s=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:s.selector,elements:s.elements,color:an.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertText",selector:this._hoverHighlight.selector,signals:[],text:this._recorder.injectedScript.utils.elementText(this._textCache,e).normalized,substring:!0}}}_renderValue(e){return(e==null?void 0:e.name)==="assertText"?this._recorder.injectedScript.utils.normalizeWhiteSpace(e.text):(e==null?void 0:e.name)==="assertChecked"?String(e.checked):(e==null?void 0:e.name)==="assertValue"?e.value:(e==null?void 0:e.name)==="assertSnapshot"?e.ariaSnapshot:""}_commit(){!this._action||!this._dialog.isShowing()||(this._dialog.close(),this._recorder.recordAction(this._action),this._recorder.setMode("recording"))}_showDialog(){var e,i,s,l;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((i=this._action)==null?void 0:i.name)==="assertText"?this._showTextDialog(this._action):((s=this._action)==null?void 0:s.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(l=this._recorder.overlay)==null||l.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const i=this._recorder.document.createElement("textarea");i.setAttribute("spellcheck","false"),i.value=this._renderValue(e),i.classList.add("text-editor");const s=()=>{var y;const f=this._recorder.injectedScript.utils.normalizeWhiteSpace(i.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=f;const p=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,m=f&&p.includes(f);i.classList.toggle("does-not-match",!m)};i.addEventListener("input",s);const o=this._dialog.show({label:"Assert that element contains text",body:i,onCommit:()=>this._commit()}),u=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),o);this._dialog.moveTo(u.anchorTop,u.anchorLeft),i.focus()}_commitAssertValue(){var i;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(i=this._recorder.overlay)==null||i.flashToolSucceeded("assertingValue"))}}class JE{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const i=this._recorder.document;this._overlayElement=i.createElement("x-pw-overlay");const s=i.createElement("x-pw-tools-list");this._overlayElement.appendChild(s),this._dragHandle=i.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(i.createElement("x-div")),s.appendChild(this._dragHandle),this._recordToggle=this._recorder.document.createElement("x-pw-tool-item"),this._recordToggle.title="Record",this._recordToggle.classList.add("record"),this._recordToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._recordToggle),this._pickLocatorToggle=this._recorder.document.createElement("x-pw-tool-item"),this._pickLocatorToggle.title="Pick locator",this._pickLocatorToggle.classList.add("pick-locator"),this._pickLocatorToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._pickLocatorToggle),this._assertVisibilityToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertVisibilityToggle.title="Assert visibility",this._assertVisibilityToggle.classList.add("visibility"),this._assertVisibilityToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertVisibilityToggle),this._assertTextToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertTextToggle.title="Assert text",this._assertTextToggle.classList.add("text"),this._assertTextToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertTextToggle),this._assertValuesToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertValuesToggle.title="Assert value",this._assertValuesToggle.classList.add("value"),this._assertValuesToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertValuesToggle),this._assertSnapshotToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertSnapshotToggle.title="Assert snapshot",this._assertSnapshotToggle.classList.add("snapshot"),this._assertSnapshotToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){sv(this._listeners),this._listeners=[De(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),De(this._recordToggle,"click",()=>{this._recordToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="none"||this._recorder.state.mode==="standby"||this._recorder.state.mode==="inspecting"?"recording":"standby")}),De(this._pickLocatorToggle,"click",()=>{if(this._pickLocatorToggle.classList.contains("disabled"))return;const e={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"};this._recorder.setMode(e[this._recorder.state.mode])}),De(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),De(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),De(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),De(this._assertSnapshotToggle,"click",()=>{this._assertSnapshotToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingSnapshot"?"recording":"assertingSnapshot")})]}install(){this._recorder.highlight.appendChild(this._overlayElement),this._refreshListeners(),this._updateVisualPosition()}contains(e){return this._recorder.injectedScript.utils.isInsideScope(this._overlayElement,e)}setUIState(e){const i=e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting";this._recordToggle.classList.toggle("toggled",i),this._recordToggle.title=i?"Stop Recording":"Start Recording",this._pickLocatorToggle.classList.toggle("toggled",e.mode==="inspecting"||e.mode==="recording-inspecting"),this._assertVisibilityToggle.classList.toggle("toggled",e.mode==="assertingVisibility"),this._assertVisibilityToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertTextToggle.classList.toggle("toggled",e.mode==="assertingText"),this._assertTextToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertValuesToggle.classList.toggle("toggled",e.mode==="assertingValue"),this._assertValuesToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertSnapshotToggle.classList.toggle("toggled",e.mode==="assertingSnapshot"),this._assertSnapshotToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._offsetX!==e.overlay.offsetX&&(this._offsetX=e.overlay.offsetX,this._updateVisualPosition()),e.mode==="none"?this._hideOverlay():this._showOverlay()}flashToolSucceeded(e){let i;e==="assertingVisibility"?i=this._assertVisibilityToggle:e==="assertingSnapshot"?i=this._assertSnapshotToggle:i=this._assertValuesToggle,i.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>i.classList.remove("succeeded"),2e3)}_hideOverlay(){this._overlayElement.setAttribute("hidden","true")}_showOverlay(){this._overlayElement.hasAttribute("hidden")&&(this._overlayElement.removeAttribute("hidden"),this._updateVisualPosition())}_updateVisualPosition(){this._measure=this._overlayElement.getBoundingClientRect(),this._overlayElement.style.left=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2+this._offsetX+"px"}onMouseMove(e){if(!e.buttons)return this._dragState=void 0,!1;if(this._dragState){this._offsetX=this._dragState.offsetX+e.clientX-this._dragState.dragStart.x;const i=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-i,Math.min(i,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),He(e),!0}return!1}onMouseUp(e){return this._dragState?(He(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,He(e),!0):!1}onDblClick(e){return!1}}class WE{constructor(e,i){var s,l;this._listeners=[],this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.state={mode:"none",testIdAttributeName:"data-testid",language:"javascript",overlay:{offsetX:0}},this._delegate={},this.document=e.document,this.injectedScript=e,this.highlight=e.createHighlight(),this._tools={none:new n0,standby:new n0,inspecting:new eh(this,!1),recording:(i==null?void 0:i.recorderMode)==="api"?new ZE(this):new QE(this),"recording-inspecting":new eh(this,!1),assertingText:new th(this,"text"),assertingVisibility:new eh(this,!0),assertingValue:new th(this,"value"),assertingSnapshot:new th(this,"snapshot")},this._currentTool=this._tools.none,(l=(s=this._currentTool).install)==null||l.call(s),e.window.top===e.window&&(this.overlay=new JE(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
|
|
123
|
+
`)}finally{$h(),ac(),this._evaluator.end()}}createStacklessError(e){if(this._browserName==="firefox"){const s=new Error("Error: "+e);return s.stack="",s}const i=new Error(e);return delete i.stack,i}createHighlight(){return new Qf(this)}maskSelectors(e,i){this._highlight&&this.hideHighlight(),this._highlight=new Qf(this),this._highlight.install();const s=[];for(const l of e)s.push(this.querySelectorAll(l,this.document.documentElement));this._highlight.maskElements(s.flat(),i)}highlight(e){this._highlight||(this._highlight=new Qf(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,i){var u,f;((u=this._markedElements)==null?void 0:u.callId)!==i&&(this._markedElements=void 0);const s=((f=this._markedElements)==null?void 0:f.elements)||new Set,l=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:i,composed:!0});for(const d of s)e.has(d)||d.dispatchEvent(l);const o=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:i,composed:!0});for(const d of e)s.has(d)||d.dispatchEvent(o);this._markedElements={callId:i,elements:e}}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let i=!1;const s=()=>i=!0;this.window.addEventListener(e,s),new MutationObserver(l=>{if(l.some(u=>Array.from(u.addedNodes).includes(this.document.documentElement))&&(i=!1,this.window.dispatchEvent(new CustomEvent(e)),!i)){this.window.addEventListener(e,s);for(const u of this.onGlobalListenersRemoved)u()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=s=>{var l;return(l=this._hitTargetInterceptor)==null?void 0:l.call(this,s)},i=()=>{for(const s of this._allHitTargetInterceptorEvents)this.window.addEventListener(s,e,{capture:!0,passive:!1})};i(),this.onGlobalListenersRemoved.add(i)}async expect(e,i,s){var o,u;if(i.expression==="to.have.count"||i.expression.endsWith(".array"))return this.expectArray(s,i);if(!e){if(!i.isNot&&i.expression==="to.be.hidden")return{matches:!0};if(i.isNot&&i.expression==="to.be.visible")return{matches:!1};if(!i.isNot&&i.expression==="to.be.detached")return{matches:!0};if(i.isNot&&i.expression==="to.be.attached")return{matches:!1};if(i.isNot&&i.expression==="to.be.in.viewport")return{matches:!1};if(i.expression==="to.have.title"&&((o=i==null?void 0:i.expectedText)!=null&&o[0])){const f=new Xs(i.expectedText[0]),d=this.document.title;return{received:d,matches:f.matches(d)}}if(i.expression==="to.have.url"&&((u=i==null?void 0:i.expectedText)!=null&&u[0])){const f=new Xs(i.expectedText[0]),d=this.document.location.href;return{received:d,matches:f.matches(d)}}return{matches:i.isNot,missingReceived:!0}}return await this.expectSingleElement(e,i)}async expectSingleElement(e,i){var l;const s=i.expression;{let o;if(s==="to.have.attribute"){const u=e.hasAttribute(i.expressionArg);o={matches:u,received:u?"attribute present":"attribute not present"}}else if(s==="to.be.checked"){const{checked:u,indeterminate:f}=i.expectedValue;if(f){if(u!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");o=this.elementState(e,"indeterminate")}else o=this.elementState(e,u===!1?"unchecked":"checked")}else if(s==="to.be.disabled")o=this.elementState(e,"disabled");else if(s==="to.be.editable")o=this.elementState(e,"editable");else if(s==="to.be.readonly")o=this.elementState(e,"editable"),o.matches=!o.matches;else if(s==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const u=e.value;o={matches:!u,received:u?"notEmpty":"empty"}}else{const u=(l=e.textContent)==null?void 0:l.trim();o={matches:!u,received:u?"notEmpty":"empty"}}else if(s==="to.be.enabled")o=this.elementState(e,"enabled");else if(s==="to.be.focused"){const u=this._activelyFocused(e).isFocused;o={matches:u,received:u?"focused":"inactive"}}else s==="to.be.hidden"?o=this.elementState(e,"hidden"):s==="to.be.visible"?o=this.elementState(e,"visible"):s==="to.be.attached"?o={matches:!0,received:"attached"}:s==="to.be.detached"&&(o={matches:!1,received:"attached"});if(o){if(o.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return o}}if(s==="to.have.property"){let o=e;const u=i.expressionArg.split(".");for(let p=0;p<u.length-1;p++){if(typeof o!="object"||!(u[p]in o))return{received:void 0,matches:!1};o=o[u[p]]}const f=o[u[u.length-1]],d=vh(f,i.expectedValue);return{received:f,matches:d}}if(s==="to.be.in.viewport"){const o=await this.viewportRatio(e);return{received:`viewport ratio ${o}`,matches:o>0&&o>(i.expectedNumber??0)-1e-9}}if(s==="to.have.values"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="SELECT"||!e.multiple)throw this.createStacklessError("Not a select element with a multiple attribute");const o=[...e.selectedOptions].map(u=>u.value);return o.length!==i.expectedText.length?{received:o,matches:!1}:{received:o,matches:o.map((u,f)=>new Xs(i.expectedText[f]).matches(u)).every(Boolean)}}if(s==="to.match.aria"){const o=OT(e,i.expectedValue);return{received:o.received,matches:!!o.matches.length}}{let o;if(s==="to.have.attribute.value"){const u=e.getAttribute(i.expressionArg);if(u===null)return{received:null,matches:!1};o=u}else if(["to.have.class","to.contain.class"].includes(s)){if(!i.expectedText)throw this.createStacklessError("Expected text is not provided for "+s);return{received:e.classList.toString(),matches:new Xs(i.expectedText[0]).matchesClassList(this,e.classList,s==="to.contain.class")}}else if(s==="to.have.css")o=this.window.getComputedStyle(e).getPropertyValue(i.expressionArg);else if(s==="to.have.id")o=e.id;else if(s==="to.have.text")o=i.useInnerText?e.innerText:Dt(new Map,e).full;else if(s==="to.have.accessible.name")o=Ga(e,!1);else if(s==="to.have.accessible.description")o=Gy(e,!1);else if(s==="to.have.accessible.error.message")o=pT(e);else if(s==="to.have.role")o=pt(e)||"";else if(s==="to.have.value"){if(e=this.retarget(e,"follow-label"),e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"&&e.nodeName!=="SELECT")throw this.createStacklessError("Not an input element");o=e.value}if(o!==void 0&&i.expectedText){const u=new Xs(i.expectedText[0]);return{received:o,matches:u.matches(o)}}}throw this.createStacklessError("Unknown expect matcher: "+s)}expectArray(e,i){const s=i.expression;if(s==="to.have.count"){const d=e.length,p=d===i.expectedNumber;return{received:d,matches:p}}if(!i.expectedText)throw this.createStacklessError("Expected text is not provided for "+s);if(["to.have.class.array","to.contain.class.array"].includes(s)){const d=e.map(y=>y.classList),p=d.map(String);if(d.length!==i.expectedText.length)return{received:p,matches:!1};const m=this._matchSequentially(i.expectedText,d,(y,b)=>y.matchesClassList(this,b,s==="to.contain.class.array"));return{received:p,matches:m}}if(!["to.contain.text.array","to.have.text.array"].includes(s))throw this.createStacklessError("Unknown expect matcher: "+s);const l=e.map(d=>i.useInnerText?d.innerText:Dt(new Map,d).full),o=s!=="to.contain.text.array";if(!(l.length===i.expectedText.length||!o))return{received:l,matches:!1};const f=this._matchSequentially(i.expectedText,l,(d,p)=>d.matches(p));return{received:l,matches:f}}_matchSequentially(e,i,s){const l=e.map(f=>new Xs(f));let o=0,u=0;for(;o<l.length&&u<i.length;)s(l[o],i[u])&&++o,++u;return o===l.length}}function vo(n){return n.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function PE(n){if(n=n.substring(1,n.length-1),!n.includes("\\"))return n;const e=[];let i=0;for(;i<n.length;)n[i]==="\\"&&i+1<n.length&&i++,e.push(n[i++]);return e.join("")}function So(n,e){if(n[0]==="/"&&n.lastIndexOf("/")>0){const l=n.lastIndexOf("/"),o=new RegExp(n.substring(1,l),n.substring(l+1));return{matcher:u=>o.test(u.full),kind:"regex"}}const i=e?JSON.parse.bind(JSON):PE;let s=!1;return n.length>1&&n[0]==='"'&&n[n.length-1]==='"'?(n=i(n),s=!0):e&&n.length>1&&n[0]==='"'&&n[n.length-2]==='"'&&n[n.length-1]==="i"?(n=i(n.substring(0,n.length-1)),s=!1):e&&n.length>1&&n[0]==='"'&&n[n.length-2]==='"'&&n[n.length-1]==="s"?(n=i(n.substring(0,n.length-1)),s=!0):n.length>1&&n[0]==="'"&&n[n.length-1]==="'"&&(n=i(n),s=!0),n=Et(n),s?e?{kind:"strict",matcher:o=>o.normalized===n}:{matcher:o=>!n&&!o.immediate.length?!0:o.immediate.some(u=>Et(u)===n),kind:"strict"}:(n=n.toLowerCase(),{kind:"lax",matcher:l=>l.normalized.toLowerCase().includes(n)})}class Xs{constructor(e){if(this._normalizeWhiteSpace=e.normalizeWhiteSpace,this._ignoreCase=e.ignoreCase,this._string=e.matchSubstring?void 0:this.normalize(e.string),this._substring=e.matchSubstring?this.normalize(e.string):void 0,e.regexSource){const i=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&i.delete("i"),e.ignoreCase===!0&&i.add("i"),this._regex=new RegExp(e.regexSource,[...i].join(""))}}matches(e){return this._regex||(e=this.normalize(e)),this._string!==void 0?e===this._string:this._substring!==void 0?e.includes(this._substring):this._regex?!!this._regex.test(e):!1}matchesClassList(e,i,s){if(s){if(this._regex)throw e.createStacklessError("Partial matching does not support regular expressions. Please provide a string value.");return this._string.split(/\s+/g).filter(Boolean).every(l=>i.contains(l))}return this.matches(i.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=Et(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function vh(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(let s=0;s<n.length;++s)if(!vh(n[s],e[s]))return!1;return!0}if(n instanceof RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===e.toString();const i=Object.keys(n);if(i.length!==Object.keys(e).length)return!1;for(let s=0;s<i.length;++s)if(!e.hasOwnProperty(i[s]))return!1;for(const s of i)if(!vh(n[s],e[s]))return!1;return!0}return typeof n=="number"&&typeof e=="number"?isNaN(n)&&isNaN(e):!1}const FE={tagName:"svg",children:[{tagName:"defs",children:[{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gripper"},children:[{tagName:"path",attrs:{d:"M5 3h2v2H5zm0 4h2v2H5zm0 4h2v2H5zm4-8h2v2H9zm0 4h2v2H9zm0 4h2v2H9z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-circle-large-filled"},children:[{tagName:"path",attrs:{d:"M8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674 7.157 7.157 0 0 1-2.516 2.509 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-stop-circle"},children:[{tagName:"path",attrs:{d:"M6 6h4v4H6z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-inspect"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 3l1-1h12l1 1v6h-1V3H2v8h5v1H2l-1-1V3zm14.707 9.707L9 6v9.414l2.707-2.707h4zM10 13V8.414l3.293 3.293h-2L10 13z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-whole-word"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 11H1V13H15V11H16V14H15H1H0V11Z"}},{tagName:"path",attrs:{d:"M6.84048 11H5.95963V10.1406H5.93814C5.555 10.7995 4.99104 11.1289 4.24625 11.1289C3.69839 11.1289 3.26871 10.9839 2.95718 10.6938C2.64924 10.4038 2.49527 10.0189 2.49527 9.53906C2.49527 8.51139 3.10041 7.91341 4.3107 7.74512L5.95963 7.51416C5.95963 6.57959 5.58186 6.1123 4.82632 6.1123C4.16389 6.1123 3.56591 6.33789 3.03238 6.78906V5.88672C3.57307 5.54297 4.19612 5.37109 4.90152 5.37109C6.19416 5.37109 6.84048 6.05501 6.84048 7.42285V11ZM5.95963 8.21777L4.63297 8.40039C4.22476 8.45768 3.91682 8.55973 3.70914 8.70654C3.50145 8.84977 3.39761 9.10579 3.39761 9.47461C3.39761 9.74316 3.4925 9.96338 3.68228 10.1353C3.87564 10.3035 4.13166 10.3877 4.45035 10.3877C4.8872 10.3877 5.24706 10.2355 5.52994 9.93115C5.8164 9.62321 5.95963 9.2347 5.95963 8.76562V8.21777Z"}},{tagName:"path",attrs:{d:"M9.3475 10.2051H9.32601V11H8.44515V2.85742H9.32601V6.4668H9.3475C9.78076 5.73633 10.4146 5.37109 11.2489 5.37109C11.9543 5.37109 12.5057 5.61816 12.9032 6.1123C13.3042 6.60286 13.5047 7.26172 13.5047 8.08887C13.5047 9.00911 13.2809 9.74674 12.8333 10.3018C12.3857 10.8532 11.7734 11.1289 10.9964 11.1289C10.2695 11.1289 9.71989 10.821 9.3475 10.2051ZM9.32601 7.98682V8.75488C9.32601 9.20964 9.47282 9.59635 9.76644 9.91504C10.0636 10.2301 10.4396 10.3877 10.8944 10.3877C11.4279 10.3877 11.8451 10.1836 12.1458 9.77539C12.4502 9.36719 12.6024 8.79964 12.6024 8.07275C12.6024 7.46045 12.4609 6.98063 12.1781 6.6333C11.8952 6.28597 11.512 6.1123 11.0286 6.1123C10.5166 6.1123 10.1048 6.29134 9.7933 6.64941C9.48177 7.00391 9.32601 7.44971 9.32601 7.98682Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-eye"},children:[{tagName:"path",attrs:{d:"M7.99993 6.00316C9.47266 6.00316 10.6666 7.19708 10.6666 8.66981C10.6666 10.1426 9.47266 11.3365 7.99993 11.3365C6.52715 11.3365 5.33324 10.1426 5.33324 8.66981C5.33324 7.19708 6.52715 6.00316 7.99993 6.00316ZM7.99993 7.00315C7.07946 7.00315 6.33324 7.74935 6.33324 8.66981C6.33324 9.59028 7.07946 10.3365 7.99993 10.3365C8.9204 10.3365 9.6666 9.59028 9.6666 8.66981C9.6666 7.74935 8.9204 7.00315 7.99993 7.00315ZM7.99993 3.66675C11.0756 3.66675 13.7307 5.76675 14.4673 8.70968C14.5344 8.97755 14.3716 9.24908 14.1037 9.31615C13.8358 9.38315 13.5643 9.22041 13.4973 8.95248C12.8713 6.45205 10.6141 4.66675 7.99993 4.66675C5.38454 4.66675 3.12664 6.45359 2.50182 8.95555C2.43491 9.22341 2.16348 9.38635 1.89557 9.31948C1.62766 9.25255 1.46471 8.98115 1.53162 8.71321C2.26701 5.76856 4.9229 3.66675 7.99993 3.66675Z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-symbol-constant"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 6h8v1H4V6zm8 3H4v1h8V9z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1 4l1-1h12l1 1v8l-1 1H2l-1-1V4zm1 0v8h12V4H2z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-check"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-close"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-pass"},children:[{tagName:"path",attrs:{d:"M6.27 10.87h.71l4.56-4.56-.71-.71-4.2 4.21-1.92-1.92L4 8.6l2.27 2.27z"}},{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.6 1c1.6.1 3.1.9 4.2 2 1.3 1.4 2 3.1 2 5.1 0 1.6-.6 3.1-1.6 4.4-1 1.2-2.4 2.1-4 2.4-1.6.3-3.2.1-4.6-.7-1.4-.8-2.5-2-3.1-3.5C.9 9.2.8 7.5 1.3 6c.5-1.6 1.4-2.9 2.8-3.8C5.4 1.3 7 .9 8.6 1zm.5 12.9c1.3-.3 2.5-1 3.4-2.1.8-1.1 1.3-2.4 1.2-3.8 0-1.6-.6-3.2-1.7-4.3-1-1-2.2-1.6-3.6-1.7-1.3-.1-2.7.2-3.8 1-1.1.8-1.9 1.9-2.3 3.3-.4 1.3-.4 2.7.2 4 .6 1.3 1.5 2.3 2.7 3 1.2.7 2.6.9 3.9.6z"}}]},{tagName:"clipPath",attrs:{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",id:"icon-gist"},children:[{tagName:"path",attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.57 1.14l3.28 3.3.15.36v9.7l-.5.5h-11l-.5-.5v-13l.5-.5h7.72l.35.14zM10 5h3l-3-3v3zM3 2v12h10V6H9.5L9 5.5V2H3zm2.062 7.533l1.817-1.828L6.17 7 4 9.179v.707l2.171 2.174.707-.707-1.816-1.82zM8.8 7.714l.7-.709 2.189 2.175v.709L9.5 12.062l-.705-.709 1.831-1.82L8.8 7.714z"}}]}]}]},an={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class n0{}class eh{constructor(e,i){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=i}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var i;He(e),e.button===0&&(i=this._hoveredModel)!=null&&i.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){He(e)}onPointerUp(e){He(e)}onMouseDown(e){He(e)}onMouseUp(e){He(e)}onMouseMove(e){var l;He(e);let i=this._recorder.deepEventTarget(e);if(i.isConnected||(i=null),this._hoveredElement===i)return;this._hoveredElement=i;let s=null;if(this._hoveredElement){const o=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});s={selector:o.selector,elements:o.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,o.selector),color:this._assertVisibility?an.assert:an.single}}((l=this._hoveredModel)==null?void 0:l.selector)!==(s==null?void 0:s.selector)&&(this._hoveredModel=s,this._recorder.updateHighlight(s,!0))}onMouseEnter(e){He(e)}onMouseLeave(e){He(e);const i=this._recorder.injectedScript.window;i.top!==i&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){He(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){He(e)}onScroll(e){this._reset(!1)}_commit(e,i){var s;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(s=this._recorder.overlay)==null||s.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,i)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class QE{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set,this._dialog=new iv(e)}cursor(){return"pointer"}_installObserverIfNeeded(){var e;this._observer||(e=this._recorder.injectedScript.document)!=null&&e.body&&(this._observer=new MutationObserver(i=>{if(this._hoveredElement)for(const s of i)for(const l of s.removedNodes)(l===this._hoveredElement||l.contains(this._hoveredElement))&&this._resetHoveredModel()}),this._observer.observe(this._recorder.injectedScript.document.body,{childList:!0,subtree:!0}))}uninstall(){var e;(e=this._observer)==null||e.disconnect(),this._observer=null,this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._dialog.close()}onClick(e){if(this._dialog.isShowing()){e.button===2&&e.type==="auxclick"&&He(e);return}if(qa(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;if(e.button===2&&e.type==="auxclick"){this._showActionListDialog(this._hoveredModel,e);return}const i=za(this._recorder.deepEventTarget(e));if(i&&e.detail===1){this._performAction({name:i.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:Ha(e),signals:[],button:Sh(e),modifiers:sr(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){this._dialog.isShowing()||qa(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:Ha(e),signals:[],button:Sh(e),modifiers:sr(e),clickCount:e.detail}))}_commitPendingClickAction(){this._pendingClickAction&&this._performAction(this._pendingClickAction.action),this._cancelPendingClickAction()}_cancelPendingClickAction(){this._pendingClickAction&&this._recorder.injectedScript.utils.builtins.clearTimeout(this._pendingClickAction.timeout),this._pendingClickAction=void 0}onContextMenu(e){if(this._dialog.isShowing()){He(e);return}this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._showActionListDialog(this._hoveredModel,e)}onPointerDown(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._dialog.isShowing()||this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);this._hoveredElement!==i&&(this._hoveredElement=i,this._updateModelForHoveredElement())}onMouseLeave(e){if(this._dialog.isShowing())return;const i=this._recorder.injectedScript.window;i.top!==i&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._dialog.isShowing()||this._onFocus(!0)}onInput(e){if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);if(i.nodeName==="INPUT"&&i.type.toLowerCase()==="file"){this._recordAction({name:"setInputFiles",selector:this._activeModel.selector,signals:[],files:[...i.files||[]].map(s=>s.name)});return}if(qa(i)){this._recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:i.value});return}if(["INPUT","TEXTAREA"].includes(i.nodeName)||i.isContentEditable){if(i.nodeName==="INPUT"&&["checkbox","radio"].includes(i.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:i.isContentEditable?i.innerText:i.value})}if(i.nodeName==="SELECT"){const s=i;this._recordAction({name:"select",selector:this._activeModel.selector,options:[...s.selectedOptions].map(l=>l.value),signals:[]})}}onKeyDown(e){if(!this._dialog.isShowing()&&this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const i=za(this._recorder.deepEventTarget(e));if(i&&e.detail===0){this._performAction({name:i.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:sr(e)})}}}onKeyUp(e){if(!this._dialog.isShowing()&&this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){He(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._dialog.isShowing()||this._resetHoveredModel()}_showActionListDialog(e,i){He(i);const s=Ha(i),l=[{title:"Click",cb:()=>this._performAction({name:"click",selector:e.selector,position:s,signals:[],button:"left",modifiers:0,clickCount:0})},{title:"Right click",cb:()=>this._performAction({name:"click",selector:e.selector,position:s,signals:[],button:"right",modifiers:0,clickCount:0})},{title:"Double click",cb:()=>this._performAction({name:"click",selector:e.selector,position:s,signals:[],button:"left",modifiers:0,clickCount:2})},{title:"Hover",cb:()=>this._performAction({name:"hover",selector:e.selector,position:s,signals:[]})},{title:"Pick locator",cb:()=>this._recorder.elementPicked(e.selector,e)}],o=this._recorder.document.createElement("x-pw-action-list");o.setAttribute("role","list"),o.setAttribute("aria-label","Choose action");for(const p of l){const m=this._recorder.document.createElement("x-pw-action-item");m.setAttribute("role","listitem"),m.textContent=p.title,m.setAttribute("aria-label",p.title),m.addEventListener("click",()=>{this._dialog.close(),p.cb()}),o.appendChild(m)}const u=this._dialog.show({label:"Choose action",body:o,autosize:!0}),f=this._recorder.highlight.firstTooltipBox()||e.elements[0].getBoundingClientRect(),d=this._recorder.highlight.tooltipPosition(f,u);this._dialog.moveTo(d.anchorTop,d.anchorLeft)}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const i=eA(this._recorder.document);if(e&&i===this._recorder.document.body)return;const s=i?this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=s&&s.selector?{...s,color:an.action}:null,e&&(this._hoveredElement=i,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){const i=this._recorder.deepEventTarget(e),s=i.nodeName;return!!(s==="SELECT"||s==="OPTION"||s==="INPUT"&&["date","range"].includes(i.type))}_actionInProgress(e){const i=e instanceof KeyboardEvent,s=e instanceof MouseEvent||e instanceof PointerEvent;for(const l of this._performingActions)if(i&&l.name==="press"&&e.key===l.key||s&&(l.name==="click"||l.name==="hover"||l.name==="check"||l.name==="uncheck"))return!0;return He(e),!1}_consumedDueToNoModel(e,i){return i?!1:(He(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(He(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||He(e)}_recordAction(e){this._recorder.recordAction(e)}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e);const i=this._recorder.performAction(e).then(()=>{this._performingActions.delete(e),this._onFocus(!1)});this._recorder.injectedScript.isUnderTest&&i.then(()=>{console.error("Action performed for test: "+JSON.stringify({hovered:this._hoveredModel?this._hoveredModel.selector:null,active:this._activeModel?this._activeModel.selector:null}))})}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const i=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!i?!!za(this._recorder.deepEventTarget(e)):!0}_updateModelForHoveredElement(){if(this._installObserverIfNeeded(),this._performingActions.size)return;if(!this._hoveredElement||!this._hoveredElement.isConnected){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!0);return}const{selector:e,elements:i}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:i,color:an.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class ZE{constructor(e){this._recorder=e}install(){this._recorder.highlight.uninstall()}uninstall(){this._recorder.highlight.install()}onClick(e){const i=this._recorder.deepEventTarget(e);if(qa(i)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const s=za(i),{ariaSnapshot:l,selector:o,ref:u}=this._ariaSnapshot(i);if(s&&e.detail===1){this._recorder.recordAction({name:s.checked?"check":"uncheck",selector:o,ref:u,signals:[],ariaSnapshot:l});return}this._recorder.recordAction({name:"click",selector:o,ref:u,ariaSnapshot:l,position:Ha(e),signals:[],button:Sh(e),modifiers:sr(e),clickCount:e.detail})}onContextMenu(e){const i=this._recorder.deepEventTarget(e),{ariaSnapshot:s,selector:l,ref:o}=this._ariaSnapshot(i);this._recorder.recordAction({name:"click",selector:l,ref:o,ariaSnapshot:s,position:Ha(e),signals:[],button:"right",modifiers:sr(e),clickCount:1})}onInput(e){const i=this._recorder.deepEventTarget(e),{ariaSnapshot:s,selector:l,ref:o}=this._ariaSnapshot(i);if(qa(i)){this._recorder.recordAction({name:"fill",selector:l,ref:o,ariaSnapshot:s,signals:[],text:i.value});return}if(["INPUT","TEXTAREA"].includes(i.nodeName)||i.isContentEditable){if(i.nodeName==="INPUT"&&["checkbox","radio"].includes(i.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",ref:o,selector:l,ariaSnapshot:s,signals:[],text:i.isContentEditable?i.innerText:i.value});return}if(i.nodeName==="SELECT"){const u=i;this._recorder.recordAction({name:"select",selector:l,ref:o,ariaSnapshot:s,options:[...u.selectedOptions].map(f=>f.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const i=this._recorder.deepEventTarget(e),{ariaSnapshot:s,selector:l,ref:o}=this._ariaSnapshot(i);if(e.key===" "){const u=za(i);if(u&&e.detail===0){this._recorder.recordAction({name:u.checked?"uncheck":"check",selector:l,ref:o,ariaSnapshot:s,signals:[]});return}}this._recorder.recordAction({name:"press",selector:l,ref:o,ariaSnapshot:s,signals:[],key:e.key,modifiers:sr(e)})}_shouldIgnoreMouseEvent(e){const i=this._recorder.deepEventTarget(e),s=i.nodeName;return!!(s==="SELECT"||s==="OPTION"||s==="INPUT"&&["date","range"].includes(i.type))}_shouldGenerateKeyPressFor(e){if(typeof e.key!="string"||e.key==="Enter"&&(this._recorder.deepEventTarget(e).nodeName==="TEXTAREA"||this._recorder.deepEventTarget(e).isContentEditable)||["Backspace","Delete","AltGraph"].includes(e.key)||e.key==="@"&&e.code==="KeyL")return!1;if(navigator.platform.includes("Mac")){if(e.key==="v"&&e.metaKey)return!1}else if(e.key==="v"&&e.ctrlKey||e.key==="Insert"&&e.shiftKey)return!1;if(["Shift","Control","Meta","Alt","Process"].includes(e.key))return!1;const i=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!i?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:i,refs:s}=this._recorder.injectedScript.ariaSnapshotForRecorder(),l=e?s.get(e):void 0,o=e?this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName}):void 0;return{ariaSnapshot:i,selector:o==null?void 0:o.selector,ref:l}}}class th{constructor(e,i){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=i,this._dialog=new iv(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){He(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const i=this._recorder.deepEventTarget(e);this._elementHasValue(i)&&e.preventDefault()}onPointerUp(e){var s;const i=(s=this._hoverHighlight)==null?void 0:s.elements[0];this._kind==="value"&&i&&(i.nodeName==="INPUT"||i.nodeName==="SELECT")&&i.disabled&&this._commitAssertValue()}onMouseMove(e){var s;if(this._dialog.isShowing())return;const i=this._recorder.deepEventTarget(e);if(((s=this._hoverHighlight)==null?void 0:s.elements[0])!==i){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,i).full?{elements:[i],selector:"",color:an.assert}:null;else if(this._elementHasValue(i)){const l=this._recorder.injectedScript.generateSelector(i,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:l.selector,elements:l.elements,color:an.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),He(e)}onScroll(e){this._recorder.updateHighlight(this._hoverHighlight,!1)}_elementHasValue(e){return e.nodeName==="TEXTAREA"||e.nodeName==="SELECT"||e.nodeName==="INPUT"&&!["button","image","reset","submit"].includes(e.type)}_generateAction(){var i;this._textCache.clear();const e=(i=this._hoverHighlight)==null?void 0:i.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:s}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:s,signals:[],checked:!e.checked}:{name:"assertValue",selector:s,signals:[],value:e.value}}else if(this._kind==="snapshot"){const s=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:s.selector,elements:s.elements,color:an.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"codegen"})}}else{const s=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:s.selector,elements:s.elements,color:an.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertText",selector:this._hoverHighlight.selector,signals:[],text:this._recorder.injectedScript.utils.elementText(this._textCache,e).normalized,substring:!0}}}_renderValue(e){return(e==null?void 0:e.name)==="assertText"?this._recorder.injectedScript.utils.normalizeWhiteSpace(e.text):(e==null?void 0:e.name)==="assertChecked"?String(e.checked):(e==null?void 0:e.name)==="assertValue"?e.value:(e==null?void 0:e.name)==="assertSnapshot"?e.ariaSnapshot:""}_commit(){!this._action||!this._dialog.isShowing()||(this._dialog.close(),this._recorder.recordAction(this._action),this._recorder.setMode("recording"))}_showDialog(){var e,i,s,l;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((i=this._action)==null?void 0:i.name)==="assertText"?this._showTextDialog(this._action):((s=this._action)==null?void 0:s.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(l=this._recorder.overlay)==null||l.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const i=this._recorder.document.createElement("textarea");i.setAttribute("spellcheck","false"),i.value=this._renderValue(e),i.classList.add("text-editor");const s=()=>{var y;const f=this._recorder.injectedScript.utils.normalizeWhiteSpace(i.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=f;const p=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,m=f&&p.includes(f);i.classList.toggle("does-not-match",!m)};i.addEventListener("input",s);const o=this._dialog.show({label:"Assert that element contains text",body:i,onCommit:()=>this._commit()}),u=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),o);this._dialog.moveTo(u.anchorTop,u.anchorLeft),i.focus()}_commitAssertValue(){var i;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(i=this._recorder.overlay)==null||i.flashToolSucceeded("assertingValue"))}}class JE{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const i=this._recorder.document;this._overlayElement=i.createElement("x-pw-overlay");const s=i.createElement("x-pw-tools-list");this._overlayElement.appendChild(s),this._dragHandle=i.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(i.createElement("x-div")),s.appendChild(this._dragHandle),this._recordToggle=this._recorder.document.createElement("x-pw-tool-item"),this._recordToggle.title="Record",this._recordToggle.classList.add("record"),this._recordToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._recordToggle),this._pickLocatorToggle=this._recorder.document.createElement("x-pw-tool-item"),this._pickLocatorToggle.title="Pick locator",this._pickLocatorToggle.classList.add("pick-locator"),this._pickLocatorToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._pickLocatorToggle),this._assertVisibilityToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertVisibilityToggle.title="Assert visibility",this._assertVisibilityToggle.classList.add("visibility"),this._assertVisibilityToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertVisibilityToggle),this._assertTextToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertTextToggle.title="Assert text",this._assertTextToggle.classList.add("text"),this._assertTextToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertTextToggle),this._assertValuesToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertValuesToggle.title="Assert value",this._assertValuesToggle.classList.add("value"),this._assertValuesToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertValuesToggle),this._assertSnapshotToggle=this._recorder.document.createElement("x-pw-tool-item"),this._assertSnapshotToggle.title="Assert snapshot",this._assertSnapshotToggle.classList.add("snapshot"),this._assertSnapshotToggle.appendChild(this._recorder.document.createElement("x-div")),s.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){sv(this._listeners),this._listeners=[De(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),De(this._recordToggle,"click",()=>{this._recordToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="none"||this._recorder.state.mode==="standby"||this._recorder.state.mode==="inspecting"?"recording":"standby")}),De(this._pickLocatorToggle,"click",()=>{if(this._pickLocatorToggle.classList.contains("disabled"))return;const e={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"};this._recorder.setMode(e[this._recorder.state.mode])}),De(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),De(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),De(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),De(this._assertSnapshotToggle,"click",()=>{this._assertSnapshotToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingSnapshot"?"recording":"assertingSnapshot")})]}install(){this._recorder.highlight.appendChild(this._overlayElement),this._refreshListeners(),this._updateVisualPosition()}contains(e){return this._recorder.injectedScript.utils.isInsideScope(this._overlayElement,e)}setUIState(e){const i=e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting";this._recordToggle.classList.toggle("toggled",i),this._recordToggle.title=i?"Stop Recording":"Start Recording",this._pickLocatorToggle.classList.toggle("toggled",e.mode==="inspecting"||e.mode==="recording-inspecting"),this._assertVisibilityToggle.classList.toggle("toggled",e.mode==="assertingVisibility"),this._assertVisibilityToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertTextToggle.classList.toggle("toggled",e.mode==="assertingText"),this._assertTextToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertValuesToggle.classList.toggle("toggled",e.mode==="assertingValue"),this._assertValuesToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._assertSnapshotToggle.classList.toggle("toggled",e.mode==="assertingSnapshot"),this._assertSnapshotToggle.classList.toggle("disabled",e.mode==="none"||e.mode==="standby"||e.mode==="inspecting"),this._offsetX!==e.overlay.offsetX&&(this._offsetX=e.overlay.offsetX,this._updateVisualPosition()),e.mode==="none"?this._hideOverlay():this._showOverlay()}flashToolSucceeded(e){let i;e==="assertingVisibility"?i=this._assertVisibilityToggle:e==="assertingSnapshot"?i=this._assertSnapshotToggle:i=this._assertValuesToggle,i.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>i.classList.remove("succeeded"),2e3)}_hideOverlay(){this._overlayElement.setAttribute("hidden","true")}_showOverlay(){this._overlayElement.hasAttribute("hidden")&&(this._overlayElement.removeAttribute("hidden"),this._updateVisualPosition())}_updateVisualPosition(){this._measure=this._overlayElement.getBoundingClientRect(),this._overlayElement.style.left=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2+this._offsetX+"px"}onMouseMove(e){if(!e.buttons)return this._dragState=void 0,!1;if(this._dragState){this._offsetX=this._dragState.offsetX+e.clientX-this._dragState.dragStart.x;const i=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-i,Math.min(i,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),He(e),!0}return!1}onMouseUp(e){return this._dragState?(He(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,He(e),!0):!1}onDblClick(e){return!1}}class WE{constructor(e,i){var s,l;this._listeners=[],this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.state={mode:"none",testIdAttributeName:"data-testid",language:"javascript",overlay:{offsetX:0}},this._delegate={},this.document=e.document,this.injectedScript=e,this.highlight=e.createHighlight(),this._tools={none:new n0,standby:new n0,inspecting:new eh(this,!1),recording:(i==null?void 0:i.recorderMode)==="api"?new ZE(this):new QE(this),"recording-inspecting":new eh(this,!1),assertingText:new th(this,"text"),assertingVisibility:new eh(this,!0),assertingValue:new th(this,"value"),assertingSnapshot:new th(this,"snapshot")},this._currentTool=this._tools.none,(l=(s=this._currentTool).install)==null||l.call(s),e.window.top===e.window&&(this.overlay=new JE(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
|
|
124
124
|
body[data-pw-cursor=pointer] *, body[data-pw-cursor=pointer] *::after { cursor: pointer !important; }
|
|
125
125
|
body[data-pw-cursor=text] *, body[data-pw-cursor=text] *::after { cursor: text !important; }
|
|
126
126
|
`),this.installListeners(),e.utils.cacheNormalizedWhitespaces(),e.isUnderTest&&console.error("Recorder script ready for test"),e.consoleApi.install()}installListeners(){var s,l,o;sv(this._listeners),this._listeners=[De(this.document,"click",u=>this._onClick(u),!0),De(this.document,"auxclick",u=>this._onClick(u),!0),De(this.document,"dblclick",u=>this._onDblClick(u),!0),De(this.document,"contextmenu",u=>this._onContextMenu(u),!0),De(this.document,"dragstart",u=>this._onDragStart(u),!0),De(this.document,"input",u=>this._onInput(u),!0),De(this.document,"keydown",u=>this._onKeyDown(u),!0),De(this.document,"keyup",u=>this._onKeyUp(u),!0),De(this.document,"pointerdown",u=>this._onPointerDown(u),!0),De(this.document,"pointerup",u=>this._onPointerUp(u),!0),De(this.document,"mousedown",u=>this._onMouseDown(u),!0),De(this.document,"mouseup",u=>this._onMouseUp(u),!0),De(this.document,"mousemove",u=>this._onMouseMove(u),!0),De(this.document,"mouseleave",u=>this._onMouseLeave(u),!0),De(this.document,"mouseenter",u=>this._onMouseEnter(u),!0),De(this.document,"focus",u=>this._onFocus(u),!0),De(this.document,"scroll",u=>this._onScroll(u),!0)],this.highlight.install();let e;const i=()=>{this.highlight.install(),e=this.injectedScript.utils.builtins.setTimeout(i,500)};e=this.injectedScript.utils.builtins.setTimeout(i,500),this._listeners.push(()=>this.injectedScript.utils.builtins.clearTimeout(e)),this.highlight.appendChild(rv(this.document,FE)),(s=this.overlay)==null||s.install(),(o=(l=this._currentTool)==null?void 0:l.install)==null||o.call(l),this.document.adoptedStyleSheets.push(this._stylesheet)}_switchCurrentTool(){var s,l,o,u,f,d;const e=this._tools[this.state.mode];if(e===this._currentTool)return;(l=(s=this._currentTool).uninstall)==null||l.call(s),this.clearHighlight(),this._currentTool=e,(u=(o=this._currentTool).install)==null||u.call(o);const i=(f=e.cursor)==null?void 0:f.call(e);i&&((d=this.injectedScript.document.body)==null||d.setAttribute("data-pw-cursor",i))}setUIState(e,i){var o;this._delegate=i,e.actionPoint&&this.state.actionPoint&&e.actionPoint.x===this.state.actionPoint.x&&e.actionPoint.y===this.state.actionPoint.y||!e.actionPoint&&!this.state.actionPoint||(e.actionPoint?this.highlight.showActionPoint(e.actionPoint.x,e.actionPoint.y):this.highlight.hideActionPoint()),this.state=e,this.highlight.setLanguage(e.language),this._switchCurrentTool(),(o=this.overlay)==null||o.setUIState(e);let s="noop";if(e.actionSelector!==this._lastHighlightedSelector){const u=e.actionSelector?tA(this.injectedScript,e.language,e.actionSelector,this.document):null;s=u!=null&&u.length?u:"clear",this._lastHighlightedSelector=u!=null&&u.length?e.actionSelector:void 0}const l=JSON.stringify(e.ariaTemplate);if(this._lastHighlightedAriaTemplateJSON!==l){const u=e.ariaTemplate?this.injectedScript.getAllElementsMatchingExpectAriaTemplate(this.document,e.ariaTemplate):[];if(u.length){const f=u.length>1?an.multiple:an.single;s=u.map(d=>({element:d,color:f})),this._lastHighlightedAriaTemplateJSON=l}else this._lastHighlightedSelector||(s="clear"),this._lastHighlightedAriaTemplateJSON="undefined"}s==="clear"?this.highlight.clearHighlight():s!=="noop"&&this.highlight.updateHighlight(s)}clearHighlight(){this.updateHighlight(null,!1)}_onClick(e){var i,s,l;e.isTrusted&&((i=this.overlay)!=null&&i.onClick(e)||this._ignoreOverlayEvent(e)||(l=(s=this._currentTool).onClick)==null||l.call(s,e))}_onDblClick(e){var i,s,l;e.isTrusted&&((i=this.overlay)!=null&&i.onDblClick(e)||this._ignoreOverlayEvent(e)||(l=(s=this._currentTool).onDblClick)==null||l.call(s,e))}_onContextMenu(e){var i,s;e.isTrusted&&((s=(i=this._currentTool).onContextMenu)==null||s.call(i,e))}_onDragStart(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onDragStart)==null||s.call(i,e))}_onPointerDown(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onPointerDown)==null||s.call(i,e))}_onPointerUp(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onPointerUp)==null||s.call(i,e))}_onMouseDown(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onMouseDown)==null||s.call(i,e))}_onMouseUp(e){var i,s,l;e.isTrusted&&((i=this.overlay)!=null&&i.onMouseUp(e)||this._ignoreOverlayEvent(e)||(l=(s=this._currentTool).onMouseUp)==null||l.call(s,e))}_onMouseMove(e){var i,s,l;e.isTrusted&&((i=this.overlay)!=null&&i.onMouseMove(e)||this._ignoreOverlayEvent(e)||(l=(s=this._currentTool).onMouseMove)==null||l.call(s,e))}_onMouseEnter(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onMouseEnter)==null||s.call(i,e))}_onMouseLeave(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onMouseLeave)==null||s.call(i,e))}_onFocus(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onFocus)==null||s.call(i,e))}_onScroll(e){var i,s;e.isTrusted&&(this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.highlight.hideActionPoint(),(s=(i=this._currentTool).onScroll)==null||s.call(i,e))}_onInput(e){var i,s;this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onInput)==null||s.call(i,e)}_onKeyDown(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onKeyDown)==null||s.call(i,e))}_onKeyUp(e){var i,s;e.isTrusted&&(this._ignoreOverlayEvent(e)||(s=(i=this._currentTool).onKeyUp)==null||s.call(i,e))}updateHighlight(e,i){this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this._updateHighlight(e,i)}_updateHighlight(e,i){var l,o;let s=e==null?void 0:e.tooltipText;s===void 0&&(e!=null&&e.selector)&&(s=this.injectedScript.utils.asLocator(this.state.language,e.selector)),e?this.highlight.updateHighlight(e.elements.map(u=>({element:u,color:e.color,tooltipText:s}))):this.highlight.clearHighlight(),i&&((o=(l=this._delegate).highlightUpdated)==null||o.call(l))}_ignoreOverlayEvent(e){return e.composedPath().some(i=>(i.nodeName||"").toLowerCase()==="x-pw-glass")}deepEventTarget(e){var i;for(const s of e.composedPath())if(!((i=this.overlay)!=null&&i.contains(s)))return s;return e.composedPath()[0]}setMode(e){var i,s;(s=(i=this._delegate).setMode)==null||s.call(i,e)}_captureAutoExpectSnapshot(){const e=this.injectedScript.document.documentElement;return e?this.injectedScript.utils.generateAriaTree(e,{mode:"autoexpect"}):void 0}async performAction(e){var s,l;const i=this._lastActionAutoexpectSnapshot;if(this._lastActionAutoexpectSnapshot=this._captureAutoExpectSnapshot(),!nA(e)&&this._lastActionAutoexpectSnapshot){const o=iA(i,this._lastActionAutoexpectSnapshot);e.preconditionSelector=o?this.injectedScript.generateSelector(o,{testIdAttributeName:this.state.testIdAttributeName}).selector:void 0,e.preconditionSelector===e.selector&&(e.preconditionSelector=void 0)}await((l=(s=this._delegate).performAction)==null?void 0:l.call(s,e).catch(()=>{}))}recordAction(e){var i,s;this._lastActionAutoexpectSnapshot=this._captureAutoExpectSnapshot(),(s=(i=this._delegate).recordAction)==null||s.call(i,e)}setOverlayState(e){var i,s;(s=(i=this._delegate).setOverlayState)==null||s.call(i,e)}elementPicked(e,i){var l,o;const s=this.injectedScript.ariaSnapshot(i.elements[0],{mode:"expect"});(o=(l=this._delegate).elementPicked)==null||o.call(l,{selector:e,ariaSnapshot:s})}}let iv=class{constructor(e){this._dialogElement=null,this._recorder=e}isShowing(){return!!this._dialogElement}show(e){const i=this._recorder.document.createElement("x-pw-tool-item");i.title="Accept",i.classList.add("accept"),i.appendChild(this._recorder.document.createElement("x-div")),i.addEventListener("click",()=>{var f;return(f=e.onCommit)==null?void 0:f.call(e)});const s=this._recorder.document.createElement("x-pw-tool-item");s.title="Close",s.classList.add("cancel"),s.appendChild(this._recorder.document.createElement("x-div")),s.addEventListener("click",()=>{var f;this.close(),(f=e.onCancel)==null||f.call(e)}),this._dialogElement=this._recorder.document.createElement("x-pw-dialog"),e.autosize&&this._dialogElement.classList.add("autosize"),this._keyboardListener=f=>{var d;if(f.key==="Escape"){this.close(),(d=e.onCancel)==null||d.call(e);return}if(e.onCommit&&f.key==="Enter"&&(f.ctrlKey||f.metaKey)){this._dialogElement&&e.onCommit();return}},this._onGlassPaneClickHandler=f=>{var d;this.close(),(d=e.onCancel)==null||d.call(e)};const l=this._recorder.document.createElement("x-pw-tools-list"),o=this._recorder.document.createElement("label");o.textContent=e.label,l.appendChild(o),l.appendChild(this._recorder.document.createElement("x-spacer")),e.onCommit&&l.appendChild(i),l.appendChild(s),this._dialogElement.appendChild(l);const u=this._recorder.document.createElement("x-pw-dialog-body");return u.appendChild(e.body),this._dialogElement.appendChild(u),this._recorder.highlight.appendChild(this._dialogElement),this._recorder.highlight.onGlassPaneClick(this._onGlassPaneClickHandler),this._recorder.document.addEventListener("keydown",this._keyboardListener,!0),this._dialogElement}moveTo(e,i){this._dialogElement&&(this._dialogElement.style.top=e+"px",this._dialogElement.style.left=i+"px")}close(){this._dialogElement&&(this._dialogElement.remove(),this._recorder.highlight.offGlassPaneClick(this._onGlassPaneClickHandler),this._recorder.document.removeEventListener("keydown",this._keyboardListener),this._dialogElement=null)}};function eA(n){let e=n.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function sr(n){return(n.altKey?1:0)|(n.ctrlKey?2:0)|(n.metaKey?4:0)|(n.shiftKey?8:0)}function Sh(n){switch(n.which){case 1:return"left";case 2:return"middle";case 3:return"right"}return"left"}function Ha(n){if(n.target.nodeName==="CANVAS")return{x:n.offsetX,y:n.offsetY}}function He(n){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()}function za(n){if(!n||n.nodeName!=="INPUT")return null;const e=n;return["checkbox","radio"].includes(e.type)?e:null}function qa(n){return!n||n.nodeName!=="INPUT"?!1:n.type.toLowerCase()==="range"}function De(n,e,i,s){return n.addEventListener(e,i,s),()=>{n.removeEventListener(e,i,s)}}function sv(n){for(const e of n)e();n.splice(0,n.length)}function tA(n,e,i,s){try{const l=n.parseSelector(i),o=n.querySelectorAll(l,s),u=o.length>1?an.multiple:an.single,f=n.utils.asLocator(e,i);return o.map((d,p)=>{const m=o.length>1?` [${p+1} of ${o.length}]`:"";return{element:d,color:u,tooltipText:f+m}})}catch{return[]}}function rv(n,{tagName:e,attrs:i,children:s}){const l=n.createElementNS("http://www.w3.org/2000/svg",e);if(i)for(const[o,u]of Object.entries(i))l.setAttribute(o,u);if(s)for(const o of s)l.appendChild(rv(n,o));return l}function nA(n){return n.name.startsWith("assert")}function iA(n,e){var u,f;function i(d,p,m){let y=1,b=m+y;for(const w of d.children||[])typeof w=="string"?(y++,b++):(y+=i(w,p,b),b+=y);if(!["none","presentation","fragment","iframe","generic"].includes(d.role)&&d.name){let w=p.get(d.role);w||(w=new Map,p.set(d.role,w));const E=w.get(d.name),x=y*100-m;(!E||E.sizeAndPosition<x)&&w.set(d.name,{node:d,sizeAndPosition:x})}return y}const s=new Map;n&&i(n.root,s,0);const l=new Map;i(e.root,l,0);const o=[];for(const[d,p]of l)for(const[m,y]of p)((u=s.get(d))==null?void 0:u.get(m))||o.push(y);return o.sort((d,p)=>p.sizeAndPosition-d.sizeAndPosition),(f=o[0])==null?void 0:f.node.element}function sA(n,e){n=n.replace(/AriaRole\s*\.\s*([\w]+)/g,(o,u)=>u.toLowerCase()).replace(/(get_by_role|getByRole)\s*\(\s*(?:["'`])([^'"`]+)['"`]/g,(o,u,f)=>`${u}(${f.toLowerCase()}`);const i=[];let s="";for(let o=0;o<n.length;++o){const u=n[o];if(u!=='"'&&u!=="'"&&u!=="`"&&u!=="/"){s+=u;continue}const f=n[o-1]==="r"||n[o]==="/";++o;let d="";for(;o<n.length;){if(n[o]==="\\"){f?(n[o+1]!==u&&(d+=n[o]),++o,d+=n[o]):(++o,n[o]==="n"?d+=`
|