playwright-core 1.54.0-beta-1752081918000 → 1.54.0-beta-1752093008000
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/lib/generated/injectedScriptSource.js +1 -1
- package/lib/generated/pollingRecorderSource.js +1 -1
- package/lib/vite/traceViewer/assets/{codeMirrorModule-Djh-rPQr.js → codeMirrorModule-3kZ8GVgK.js} +1 -1
- package/lib/vite/traceViewer/assets/{defaultSettingsView-BsQs1KiL.js → defaultSettingsView-Ds-bson8.js} +4 -4
- package/lib/vite/traceViewer/{index.LwN9z-Hp.js → index.CG3BNeDq.js} +1 -1
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/{uiMode.DyB42ep8.js → uiMode.BijnIl3L.js} +1 -1
- package/lib/vite/traceViewer/uiMode.html +2 -2
- package/package.json +1 -1
|
@@ -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-3kZ8GVgK.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var p0=Object.defineProperty;var m0=(t,e,n)=>e in t?p0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ee=(t,e,n)=>m0(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function g0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var au={exports:{}},bi={},cu={exports:{}},me={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+m.message+`
|
|
|
46
46
|
rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
|
|
47
47
|
rgb(0 0 0 / 10%) 0px -2px 4px,
|
|
48
48
|
rgb(0 0 0 / 15%) 0px -6.1px 12px,
|
|
49
|
-
rgb(0 0 0 / 25%) 0px 6px 12px`},P1=({diff:t,noTargetBlank:e,hideDetails:n})=>{const[r,o]=$.useState(t.diff?"diff":"actual"),[l,c]=$.useState(!1),[u,d]=$.useState(null),[p,g]=$.useState("Expected"),[y,v]=$.useState(null),[S,k]=$.useState(null),[_,E]=Ar();$.useEffect(()=>{(async()=>{var M,G,K,O;d(await pu((M=t.expected)==null?void 0:M.attachment.path)),g(((G=t.expected)==null?void 0:G.title)||"Expected"),v(await pu((K=t.actual)==null?void 0:K.attachment.path)),k(await pu((O=t.diff)==null?void 0:O.attachment.path))})()},[t]);const C=u&&y&&S,A=C?Math.max(u.naturalWidth,y.naturalWidth,200):500,B=C?Math.max(u.naturalHeight,y.naturalHeight,200):500,R=Math.min(1,(_.width-30)/A),D=Math.min(1,(_.width-50)/A/2),z=A*R,H=B*R,F={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return w.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:C&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&w.jsx("div",{style:{...F,fontWeight:r==="diff"?600:"initial"},onClick:()=>o("diff"),children:"Diff"}),w.jsx("div",{style:{...F,fontWeight:r==="actual"?600:"initial"},onClick:()=>o("actual"),children:"Actual"}),w.jsx("div",{style:{...F,fontWeight:r==="expected"?600:"initial"},onClick:()=>o("expected"),children:p}),w.jsx("div",{style:{...F,fontWeight:r==="sxs"?600:"initial"},onClick:()=>o("sxs"),children:"Side by side"}),w.jsx("div",{style:{...F,fontWeight:r==="slider"?600:"initial"},onClick:()=>o("slider"),children:"Slider"})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:H+60},children:[t.diff&&r==="diff"&&w.jsx(En,{image:S,alt:"Diff",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="actual"&&w.jsx(En,{image:y,alt:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="expected"&&w.jsx(En,{image:u,alt:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="slider"&&w.jsx(O1,{expectedImage:u,actualImage:y,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R,expectedTitle:p}),t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:l?S:y,title:l?"Diff":"Actual",onClick:()=>c(!l),hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D})]}),!t.diff&&r==="actual"&&w.jsx(En,{image:y,title:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="expected"&&w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:y,title:"Actual",canvasWidth:D*A,canvasHeight:D*B,scale:D})]})]}),!n&&w.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[w.jsx("div",{children:t.diff&&w.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},O1=({expectedImage:t,actualImage:e,canvasWidth:n,canvasHeight:r,scale:o,expectedTitle:l,hideSize:c})=>{const u={position:"absolute",top:0,left:0},[d,p]=$.useState(n/2),g=t.naturalWidth===e.naturalWidth&&t.naturalHeight===e.naturalHeight;return w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!c&&w.jsxs("div",{style:{margin:5},children:[!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!g&&w.jsx("span",{children:e.naturalWidth}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!g&&w.jsx("span",{children:e.naturalHeight})]}),w.jsxs("div",{style:{position:"relative",width:n,height:r,margin:15,...Pu},children:[w.jsx(fg,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),w.jsx("img",{alt:l,style:{width:t.naturalWidth*o,height:t.naturalHeight*o},draggable:"false",src:t.src}),w.jsx("div",{style:{...u,bottom:0,overflow:"hidden",width:d,...Pu},children:w.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*o,height:e.naturalHeight*o},draggable:"false",src:e.src})})]})]})},En=({image:t,title:e,alt:n,hideSize:r,canvasWidth:o,canvasHeight:l,scale:c,onClick:u})=>w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&w.jsxs("div",{style:{margin:5},children:[e&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight})]}),w.jsx("div",{style:{display:"flex",flex:"none",width:o,height:l,margin:15,...Pu},children:w.jsx("img",{width:t.naturalWidth*c,height:t.naturalHeight*c,alt:e||n,style:{cursor:u?"pointer":"initial"},draggable:"false",src:t.src,onClick:u})})]}),$1="modulepreload",R1=function(t,e){return new URL(t,e).href},Qp={},D1=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(g=>{if(g=R1(g,r),g in Qp)return;Qp[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const E=u[_];if(E.href===g&&(!y||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${v}`))return;const k=document.createElement("link");if(k.rel=y?"stylesheet":$1,y||(k.as="script"),k.crossOrigin="",k.href=g,p&&k.setAttribute("nonce",p),document.head.appendChild(k),y)return new Promise((_,E)=>{k.addEventListener("load",_),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},F1=20,Cs=({text:t,language:e,mimeType:n,linkify:r,readOnly:o,highlight:l,revealLine:c,lineNumbers:u,isFocused:d,focusOnChange:p,wrapLines:g,onChange:y,dataTestId:v,placeholder:S})=>{const[k,_]=Ar(),[E]=$.useState(D1(()=>import("./codeMirrorModule-Djh-rPQr.js"),__vite__mapDeps([0,1]),import.meta.url).then(R=>R.default)),C=$.useRef(null),[A,B]=$.useState();return $.useEffect(()=>{(async()=>{var F,M;const R=await E;z1(R);const D=_.current;if(!D)return;const z=U1(e)||H1(n)||(r?"text/linkified":"");if(C.current&&z===C.current.cm.getOption("mode")&&!!o===C.current.cm.getOption("readOnly")&&u===C.current.cm.getOption("lineNumbers")&&g===C.current.cm.getOption("lineWrapping")&&S===C.current.cm.getOption("placeholder"))return;(M=(F=C.current)==null?void 0:F.cm)==null||M.getWrapperElement().remove();const H=R(D,{value:"",mode:z,readOnly:!!o,lineNumbers:u,lineWrapping:g,placeholder:S});return C.current={cm:H},d&&H.focus(),B(H),H})()},[E,A,_,e,n,r,u,g,o,d,S]),$.useEffect(()=>{C.current&&C.current.cm.setSize(k.width,k.height)},[k]),$.useLayoutEffect(()=>{var z;if(!A)return;let R=!1;if(A.getValue()!==t&&(A.setValue(t),R=!0,p&&(A.execCommand("selectAll"),A.focus())),R||JSON.stringify(l)!==JSON.stringify(C.current.highlight)){for(const M of C.current.highlight||[])A.removeLineClass(M.line-1,"wrap");for(const M of l||[])A.addLineClass(M.line-1,"wrap",`source-line-${M.type}`);for(const M of C.current.widgets||[])A.removeLineWidget(M);for(const M of C.current.markers||[])M.clear();const H=[],F=[];for(const M of l||[]){if(M.type!=="subtle-error"&&M.type!=="error")continue;const G=(z=C.current)==null?void 0:z.cm.getLine(M.line-1);if(G){const K={};K.title=M.message||"",F.push(A.markText({line:M.line-1,ch:0},{line:M.line-1,ch:M.column||G.length},{className:"source-line-error-underline",attributes:K}))}if(M.type==="error"){const K=document.createElement("div");K.innerHTML=qi(M.message||""),K.className="source-line-error-widget",H.push(A.addLineWidget(M.line,K,{above:!0,coverGutter:!1}))}}C.current.highlight=l,C.current.widgets=H,C.current.markers=F}typeof c=="number"&&C.current.cm.lineCount()>=c&&A.scrollIntoView({line:Math.max(0,c-1),ch:0},50);let D;return y&&(D=()=>y(A.getValue()),A.on("change",D)),()=>{D&&A.off("change",D)}},[A,t,l,c,p,y]),w.jsx("div",{"data-testid":v,className:"cm-wrapper",ref:_,onClick:B1})};function B1(t){var n;if(!(t.target instanceof HTMLElement))return;let e;t.target.classList.contains("cm-linkified")?e=t.target.textContent:t.target.classList.contains("cm-link")&&((n=t.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(e=t.target.nextElementSibling.textContent.slice(1,-1)),e&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}let Jp=!1;function z1(t){Jp||(Jp=!0,t.defineSimpleMode("text/linkified",{start:[{regex:Om,token:"linkified"}]}))}function H1(t){if(t){if(t.includes("javascript")||t.includes("json"))return"javascript";if(t.includes("python"))return"python";if(t.includes("csharp"))return"text/x-csharp";if(t.includes("java"))return"text/x-java";if(t.includes("markdown"))return"markdown";if(t.includes("html")||t.includes("svg"))return"htmlmixed";if(t.includes("css"))return"css"}}function U1(t){if(t)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[t]}function q1(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const V1=({title:t,children:e,setExpanded:n,expanded:r,expandOnTitleClick:o})=>{const l=$.useId();return w.jsxs("div",{className:Be("expandable",r&&"expanded"),children:[w.jsxs("div",{role:"button","aria-expanded":r,"aria-controls":l,className:"expandable-title",onClick:()=>o&&n(!r),children:[w.jsx("div",{className:Be("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!o&&n(!r)}),t]}),r&&w.jsx("div",{id:l,role:"region",style:{marginLeft:25},children:e})]})};function dg(t){const e=[];let n=0,r;for(;(r=Om.exec(t))!==null;){const l=t.substring(n,r.index);l&&e.push(l);const c=r[0];e.push(W1(c)),n=r.index+c.length}const o=t.substring(n);return o&&e.push(o),e}function W1(t){let e=t;return e.startsWith("www.")&&(e="https://"+e),w.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:t})}const K1=({attachment:t,reveal:e})=>{const[n,r]=$.useState(!1),[o,l]=$.useState(null),[c,u]=$.useState(null),[d,p]=_0(),g=$.useRef(null),y=q1(t.contentType),v=!!t.sha1||!!t.path;$.useEffect(()=>{var _;if(e)return(_=g.current)==null||_.scrollIntoView({behavior:"smooth"}),p()},[e,p]),$.useEffect(()=>{n&&o===null&&c===null&&(u("Loading ..."),fetch(ra(t)).then(_=>_.text()).then(_=>{l(_),u(null)}).catch(_=>{u("Failed to load: "+_.message)}))},[n,o,c,t]);const S=$.useMemo(()=>{const _=o?o.split(`
|
|
49
|
+
rgb(0 0 0 / 25%) 0px 6px 12px`},P1=({diff:t,noTargetBlank:e,hideDetails:n})=>{const[r,o]=$.useState(t.diff?"diff":"actual"),[l,c]=$.useState(!1),[u,d]=$.useState(null),[p,g]=$.useState("Expected"),[y,v]=$.useState(null),[S,k]=$.useState(null),[_,E]=Ar();$.useEffect(()=>{(async()=>{var M,G,K,O;d(await pu((M=t.expected)==null?void 0:M.attachment.path)),g(((G=t.expected)==null?void 0:G.title)||"Expected"),v(await pu((K=t.actual)==null?void 0:K.attachment.path)),k(await pu((O=t.diff)==null?void 0:O.attachment.path))})()},[t]);const C=u&&y&&S,A=C?Math.max(u.naturalWidth,y.naturalWidth,200):500,B=C?Math.max(u.naturalHeight,y.naturalHeight,200):500,R=Math.min(1,(_.width-30)/A),D=Math.min(1,(_.width-50)/A/2),z=A*R,H=B*R,F={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return w.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:C&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&w.jsx("div",{style:{...F,fontWeight:r==="diff"?600:"initial"},onClick:()=>o("diff"),children:"Diff"}),w.jsx("div",{style:{...F,fontWeight:r==="actual"?600:"initial"},onClick:()=>o("actual"),children:"Actual"}),w.jsx("div",{style:{...F,fontWeight:r==="expected"?600:"initial"},onClick:()=>o("expected"),children:p}),w.jsx("div",{style:{...F,fontWeight:r==="sxs"?600:"initial"},onClick:()=>o("sxs"),children:"Side by side"}),w.jsx("div",{style:{...F,fontWeight:r==="slider"?600:"initial"},onClick:()=>o("slider"),children:"Slider"})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:H+60},children:[t.diff&&r==="diff"&&w.jsx(En,{image:S,alt:"Diff",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="actual"&&w.jsx(En,{image:y,alt:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="expected"&&w.jsx(En,{image:u,alt:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),t.diff&&r==="slider"&&w.jsx(O1,{expectedImage:u,actualImage:y,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R,expectedTitle:p}),t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:l?S:y,title:l?"Diff":"Actual",onClick:()=>c(!l),hideSize:n,canvasWidth:D*A,canvasHeight:D*B,scale:D})]}),!t.diff&&r==="actual"&&w.jsx(En,{image:y,title:"Actual",hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="expected"&&w.jsx(En,{image:u,title:p,hideSize:n,canvasWidth:z,canvasHeight:H,scale:R}),!t.diff&&r==="sxs"&&w.jsxs("div",{style:{display:"flex"},children:[w.jsx(En,{image:u,title:p,canvasWidth:D*A,canvasHeight:D*B,scale:D}),w.jsx(En,{image:y,title:"Actual",canvasWidth:D*A,canvasHeight:D*B,scale:D})]})]}),!n&&w.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[w.jsx("div",{children:t.diff&&w.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),w.jsx("div",{children:w.jsx("a",{target:e?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},O1=({expectedImage:t,actualImage:e,canvasWidth:n,canvasHeight:r,scale:o,expectedTitle:l,hideSize:c})=>{const u={position:"absolute",top:0,left:0},[d,p]=$.useState(n/2),g=t.naturalWidth===e.naturalWidth&&t.naturalHeight===e.naturalHeight;return w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!c&&w.jsxs("div",{style:{margin:5},children:[!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!g&&w.jsx("span",{children:e.naturalWidth}),!g&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!g&&w.jsx("span",{children:e.naturalHeight})]}),w.jsxs("div",{style:{position:"relative",width:n,height:r,margin:15,...Pu},children:[w.jsx(fg,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),w.jsx("img",{alt:l,style:{width:t.naturalWidth*o,height:t.naturalHeight*o},draggable:"false",src:t.src}),w.jsx("div",{style:{...u,bottom:0,overflow:"hidden",width:d,...Pu},children:w.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*o,height:e.naturalHeight*o},draggable:"false",src:e.src})})]})]})},En=({image:t,title:e,alt:n,hideSize:r,canvasWidth:o,canvasHeight:l,scale:c,onClick:u})=>w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!r&&w.jsxs("div",{style:{margin:5},children:[e&&w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),w.jsx("span",{children:t.naturalWidth}),w.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),w.jsx("span",{children:t.naturalHeight})]}),w.jsx("div",{style:{display:"flex",flex:"none",width:o,height:l,margin:15,...Pu},children:w.jsx("img",{width:t.naturalWidth*c,height:t.naturalHeight*c,alt:e||n,style:{cursor:u?"pointer":"initial"},draggable:"false",src:t.src,onClick:u})})]}),$1="modulepreload",R1=function(t,e){return new URL(t,e).href},Qp={},D1=function(e,n,r){let o=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const u=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(g=>{if(g=R1(g,r),g in Qp)return;Qp[g]=!0;const y=g.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const E=u[_];if(E.href===g&&(!y||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${v}`))return;const k=document.createElement("link");if(k.rel=y?"stylesheet":$1,y||(k.as="script"),k.crossOrigin="",k.href=g,p&&k.setAttribute("nonce",p),document.head.appendChild(k),y)return new Promise((_,E)=>{k.addEventListener("load",_),k.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&l(u.reason);return e().catch(l)})},F1=20,Cs=({text:t,language:e,mimeType:n,linkify:r,readOnly:o,highlight:l,revealLine:c,lineNumbers:u,isFocused:d,focusOnChange:p,wrapLines:g,onChange:y,dataTestId:v,placeholder:S})=>{const[k,_]=Ar(),[E]=$.useState(D1(()=>import("./codeMirrorModule-3kZ8GVgK.js"),__vite__mapDeps([0,1]),import.meta.url).then(R=>R.default)),C=$.useRef(null),[A,B]=$.useState();return $.useEffect(()=>{(async()=>{var F,M;const R=await E;z1(R);const D=_.current;if(!D)return;const z=U1(e)||H1(n)||(r?"text/linkified":"");if(C.current&&z===C.current.cm.getOption("mode")&&!!o===C.current.cm.getOption("readOnly")&&u===C.current.cm.getOption("lineNumbers")&&g===C.current.cm.getOption("lineWrapping")&&S===C.current.cm.getOption("placeholder"))return;(M=(F=C.current)==null?void 0:F.cm)==null||M.getWrapperElement().remove();const H=R(D,{value:"",mode:z,readOnly:!!o,lineNumbers:u,lineWrapping:g,placeholder:S});return C.current={cm:H},d&&H.focus(),B(H),H})()},[E,A,_,e,n,r,u,g,o,d,S]),$.useEffect(()=>{C.current&&C.current.cm.setSize(k.width,k.height)},[k]),$.useLayoutEffect(()=>{var z;if(!A)return;let R=!1;if(A.getValue()!==t&&(A.setValue(t),R=!0,p&&(A.execCommand("selectAll"),A.focus())),R||JSON.stringify(l)!==JSON.stringify(C.current.highlight)){for(const M of C.current.highlight||[])A.removeLineClass(M.line-1,"wrap");for(const M of l||[])A.addLineClass(M.line-1,"wrap",`source-line-${M.type}`);for(const M of C.current.widgets||[])A.removeLineWidget(M);for(const M of C.current.markers||[])M.clear();const H=[],F=[];for(const M of l||[]){if(M.type!=="subtle-error"&&M.type!=="error")continue;const G=(z=C.current)==null?void 0:z.cm.getLine(M.line-1);if(G){const K={};K.title=M.message||"",F.push(A.markText({line:M.line-1,ch:0},{line:M.line-1,ch:M.column||G.length},{className:"source-line-error-underline",attributes:K}))}if(M.type==="error"){const K=document.createElement("div");K.innerHTML=qi(M.message||""),K.className="source-line-error-widget",H.push(A.addLineWidget(M.line,K,{above:!0,coverGutter:!1}))}}C.current.highlight=l,C.current.widgets=H,C.current.markers=F}typeof c=="number"&&C.current.cm.lineCount()>=c&&A.scrollIntoView({line:Math.max(0,c-1),ch:0},50);let D;return y&&(D=()=>y(A.getValue()),A.on("change",D)),()=>{D&&A.off("change",D)}},[A,t,l,c,p,y]),w.jsx("div",{"data-testid":v,className:"cm-wrapper",ref:_,onClick:B1})};function B1(t){var n;if(!(t.target instanceof HTMLElement))return;let e;t.target.classList.contains("cm-linkified")?e=t.target.textContent:t.target.classList.contains("cm-link")&&((n=t.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(e=t.target.nextElementSibling.textContent.slice(1,-1)),e&&(t.preventDefault(),t.stopPropagation(),window.open(e,"_blank"))}let Jp=!1;function z1(t){Jp||(Jp=!0,t.defineSimpleMode("text/linkified",{start:[{regex:Om,token:"linkified"}]}))}function H1(t){if(t){if(t.includes("javascript")||t.includes("json"))return"javascript";if(t.includes("python"))return"python";if(t.includes("csharp"))return"text/x-csharp";if(t.includes("java"))return"text/x-java";if(t.includes("markdown"))return"markdown";if(t.includes("html")||t.includes("svg"))return"htmlmixed";if(t.includes("css"))return"css"}}function U1(t){if(t)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[t]}function q1(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const V1=({title:t,children:e,setExpanded:n,expanded:r,expandOnTitleClick:o})=>{const l=$.useId();return w.jsxs("div",{className:Be("expandable",r&&"expanded"),children:[w.jsxs("div",{role:"button","aria-expanded":r,"aria-controls":l,className:"expandable-title",onClick:()=>o&&n(!r),children:[w.jsx("div",{className:Be("codicon",r?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!o&&n(!r)}),t]}),r&&w.jsx("div",{id:l,role:"region",style:{marginLeft:25},children:e})]})};function dg(t){const e=[];let n=0,r;for(;(r=Om.exec(t))!==null;){const l=t.substring(n,r.index);l&&e.push(l);const c=r[0];e.push(W1(c)),n=r.index+c.length}const o=t.substring(n);return o&&e.push(o),e}function W1(t){let e=t;return e.startsWith("www.")&&(e="https://"+e),w.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:t})}const K1=({attachment:t,reveal:e})=>{const[n,r]=$.useState(!1),[o,l]=$.useState(null),[c,u]=$.useState(null),[d,p]=_0(),g=$.useRef(null),y=q1(t.contentType),v=!!t.sha1||!!t.path;$.useEffect(()=>{var _;if(e)return(_=g.current)==null||_.scrollIntoView({behavior:"smooth"}),p()},[e,p]),$.useEffect(()=>{n&&o===null&&c===null&&(u("Loading ..."),fetch(ra(t)).then(_=>_.text()).then(_=>{l(_),u(null)}).catch(_=>{u("Failed to load: "+_.message)}))},[n,o,c,t]);const S=$.useMemo(()=>{const _=o?o.split(`
|
|
50
50
|
`).length:0;return Math.min(Math.max(5,_),20)*F1},[o]),k=w.jsxs("span",{style:{marginLeft:5},ref:g,"aria-label":t.name,children:[w.jsx("span",{children:dg(t.name)}),v&&w.jsx("a",{style:{marginLeft:5},href:Al(t),children:"download"})]});return!y||!v?w.jsx("div",{style:{marginLeft:20},children:k}):w.jsxs("div",{className:Be(d&&"yellow-flash"),children:[w.jsx(V1,{title:k,expanded:n,setExpanded:r,expandOnTitleClick:!0,children:c&&w.jsx("i",{children:c})}),n&&o!==null&&w.jsx("div",{className:"vbox",style:{height:S},children:w.jsx(Cs,{text:o,readOnly:!0,mimeType:t.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},G1=({model:t,revealedAttachment:e})=>{const{diffMap:n,screenshots:r,attachments:o}=$.useMemo(()=>{const l=new Set((t==null?void 0:t.visibleAttachments)??[]),c=new Set,u=new Map;for(const d of l){if(!d.path&&!d.sha1)continue;const p=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(p){const g=p[1],y=p[2],v=u.get(g)||{expected:void 0,actual:void 0,diff:void 0};v[y]=d,u.set(g,v),l.delete(d)}else d.contentType.startsWith("image/")&&(c.add(d),l.delete(d))}return{diffMap:u,attachments:l,screenshots:c}},[t]);return!n.size&&!r.size&&!o.size?w.jsx(Ir,{text:"No attachments"}):w.jsxs("div",{className:"attachments-tab",children:[[...n.values()].map(({expected:l,actual:c,diff:u})=>w.jsxs(w.Fragment,{children:[l&&c&&w.jsx("div",{className:"attachments-section",children:"Image diff"}),l&&c&&w.jsx(P1,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...l,path:Al(l)},title:"Expected"},actual:{attachment:{...c,path:Al(c)}},diff:u?{attachment:{...u,path:Al(u)}}:void 0}})]})),r.size?w.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...r.values()].map((l,c)=>{const u=ra(l);return w.jsxs("div",{className:"attachment-item",children:[w.jsx("div",{children:w.jsx("img",{draggable:"false",src:u})}),w.jsx("div",{children:w.jsx("a",{target:"_blank",href:u,rel:"noreferrer",children:l.name})})]},`screenshot-${c}`)}),o.size?w.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...o.values()].map((l,c)=>w.jsx("div",{className:"attachment-item",children:w.jsx(K1,{attachment:l,reveal:e&&Q1(l,e[0])?e:void 0})},J1(l,c)))]})};function Q1(t,e){return t.name===e.name&&t.path===e.path&&t.sha1===e.sha1}function ra(t,e={}){const n=new URLSearchParams(e);return t.sha1?(n.set("trace",t.traceUrl),"sha1/"+t.sha1+"?"+n.toString()):(n.set("path",t.path),"file?"+n.toString())}function Al(t){const e={dn:t.name};return t.contentType&&(e.dct=t.contentType),ra(t,e)}function J1(t,e){return e+"-"+(t.sha1?"sha1-"+t.sha1:"path-"+t.path)}const X1=`
|
|
51
51
|
# Instructions
|
|
52
52
|
|
|
@@ -102,7 +102,7 @@ ${o}}`}stringLiteral(e){return JSON.stringify(e)}}class xS{generatePlaywrightReq
|
|
|
102
102
|
`;return r.push({message:l,range:[n.lineCounter.linePos(e.range[0]),n.lineCounter.linePos(e.range[0]+o.pos)]}),null}throw o}}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 n=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(n,this._pos)}_readString(){let e="",n=!1;for(;!this._eof();){const r=this._next();if(n)e+=r,n=!1;else if(r==="\\")n=!0;else{if(r==='"')return e;e+=r}}this._throwError("Unterminated string")}_throwError(e,n=0){throw new Yp(e,n||this._pos)}_readRegex(){let e="",n=!1,r=!1;for(;!this._eof();){const o=this._next();if(n)e+=o,n=!1;else if(o==="\\")n=!0,e+=o;else{if(o==="/"&&!r)return{pattern:e};o==="["?(r=!0,e+=o):o==="]"&&r?(e+=o,r=!1):e+=o}}this._throwError("Unterminated regex")}_readStringOrRegex(){const e=this._peek();return e==='"'?(this._next(),wg(this._readString())):e==="/"?(this._next(),this._readRegex()):null}_readAttributes(e){let n=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),n=this._pos;const r=this._readIdentifier("attribute");this._skipWhitespace();let o="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),n=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)o+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(e,r,o||"true",n)}}_parse(){this._skipWhitespace();const e=this._readIdentifier("role");this._skipWhitespace();const n=this._readStringOrRegex()||"",r={kind:"role",role:e,name:n};return this._readAttributes(r),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),r}_applyAttribute(e,n,r,o){if(n==="checked"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',o),e.checked=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="disabled"){this._assert(r==="true"||r==="false",'Value of "disabled" attribute must be a boolean',o),e.disabled=r==="true";return}if(n==="expanded"){this._assert(r==="true"||r==="false",'Value of "expanded" attribute must be a boolean',o),e.expanded=r==="true";return}if(n==="active"){this._assert(r==="true"||r==="false",'Value of "active" attribute must be a boolean',o),e.active=r==="true";return}if(n==="level"){this._assert(!isNaN(Number(r)),'Value of "level" attribute must be a number',o),e.level=Number(r);return}if(n==="pressed"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',o),e.pressed=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="selected"){this._assert(r==="true"||r==="false",'Value of "selected" attribute must be a boolean',o),e.selected=r==="true";return}this._assert(!1,`Unsupported attribute [${n}]`,o)}_assert(e,n,r){e||this._throwError(n||"Assertion error",r)}}class Yp extends Error{constructor(e,n){super(e),this.pos=n}}let Sg={};function JS(t){Sg=t}function sa(t,e){for(;e;){if(t.contains(e))return!0;e=_g(e)}return!1}function lt(t){if(t.parentElement)return t.parentElement;if(t.parentNode&&t.parentNode.nodeType===11&&t.parentNode.host)return t.parentNode.host}function xg(t){let e=t;for(;e.parentNode;)e=e.parentNode;if(e.nodeType===11||e.nodeType===9)return e}function _g(t){for(;t.parentElement;)t=t.parentElement;return lt(t)}function Pi(t,e,n){for(;t;){const r=t.closest(e);if(n&&r!==n&&(r!=null&&r.contains(n)))return;if(r)return r;t=_g(t)}}function rr(t,e){return t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,e):void 0}function Eg(t,e){if(e=e??rr(t),!e)return!0;if(Element.prototype.checkVisibility&&Sg.browserNameForWorkarounds!=="webkit"){if(!t.checkVisibility())return!1}else{const n=t.closest("details,summary");if(n!==t&&(n==null?void 0:n.nodeName)==="DETAILS"&&!n.open)return!1}return e.visibility==="visible"}function ql(t){const e=rr(t);if(!e)return{visible:!0};if(e.display==="contents"){for(let r=t.firstChild;r;r=r.nextSibling){if(r.nodeType===1&&Cr(r))return{visible:!0,style:e};if(r.nodeType===3&&kg(r))return{visible:!0,style:e}}return{visible:!1,style:e}}if(!Eg(t,e))return{style:e,visible:!1};const n=t.getBoundingClientRect();return{rect:n,style:e,visible:n.width>0&&n.height>0}}function Cr(t){return ql(t).visible}function kg(t){const e=t.ownerDocument.createRange();e.selectNode(t);const n=e.getBoundingClientRect();return n.width>0&&n.height>0}function Xe(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Zp(t){return t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")}const em="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]",XS=[["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 bg(t,e){return XS.some(([n,r])=>!(r!=null&&r.includes(e||""))&&t.hasAttribute(n))}function Tg(t){return!Number.isNaN(Number(String(t.getAttribute("tabindex"))))}function YS(t){return!Dg(t)&&(ZS(t)||Tg(t))}function ZS(t){const e=Xe(t);return["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(e)?!0:e==="A"||e==="AREA"?t.hasAttribute("href"):e==="INPUT"?!t.hidden:!1}const gu={A:t=>t.hasAttribute("href")?"link":null,AREA:t=>t.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:t=>Pi(t,em)?null:"contentinfo",FORM:t=>Zp(t)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:t=>Pi(t,em)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:t=>t.getAttribute("alt")===""&&!t.getAttribute("title")&&!bg(t)&&!Tg(t)?"presentation":"img",INPUT:t=>{const e=t.type.toLowerCase();if(e==="search")return t.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(e)){const n=Ms(t,t.getAttribute("list"))[0];return n&&Xe(n)==="DATALIST"?"combobox":"textbox"}return e==="hidden"?null:e==="file"?"button":mx[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:t=>Zp(t)?"region":null,SELECT:t=>t.hasAttribute("multiple")||t.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:t=>{const e=Pi(t,"table"),n=e?Vl(e):"";return n==="grid"||n==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:t=>{if(t.getAttribute("scope")==="col")return"columnheader";if(t.getAttribute("scope")==="row")return"rowheader";const e=Pi(t,"table"),n=e?Vl(e):"";return n==="grid"||n==="treegrid"?"gridcell":"cell"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"},ex={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 tm(t){var r;const e=((r=gu[Xe(t)])==null?void 0:r.call(gu,t))||"";if(!e)return null;let n=t;for(;n;){const o=lt(n),l=ex[Xe(n)];if(!l||!o||!l.includes(Xe(o)))break;const c=Vl(o);if((c==="none"||c==="presentation")&&!Cg(o,c))return c;n=o}return e}const tx=["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 Vl(t){return(t.getAttribute("role")||"").split(" ").map(n=>n.trim()).find(n=>tx.includes(n))||null}function Cg(t,e){return bg(t,e)||YS(t)}function nt(t){const e=Vl(t);if(!e)return tm(t);if(e==="none"||e==="presentation"){const n=tm(t);if(Cg(t,n))return n}return e}function Ng(t){return t===null?void 0:t.toLowerCase()==="true"}function Ag(t){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(Xe(t))}function zt(t){if(Ag(t))return!0;const e=rr(t),n=t.nodeName==="SLOT";if((e==null?void 0:e.display)==="contents"&&!n){for(let o=t.firstChild;o;o=o.nextSibling)if(o.nodeType===1&&!zt(o)||o.nodeType===3&&kg(o))return!1;return!0}return!(t.nodeName==="OPTION"&&!!t.closest("select"))&&!n&&!Eg(t,e)?!0:Ig(t)}function Ig(t){let e=Yn==null?void 0:Yn.get(t);if(e===void 0){if(e=!1,t.parentElement&&t.parentElement.shadowRoot&&!t.assignedSlot&&(e=!0),!e){const n=rr(t);e=!n||n.display==="none"||Ng(t.getAttribute("aria-hidden"))===!0}if(!e){const n=lt(t);n&&(e=Ig(n))}Yn==null||Yn.set(t,e)}return e}function Ms(t,e){if(!e)return[];const n=xg(t);if(!n)return[];try{const r=e.split(" ").filter(l=>!!l),o=[];for(const l of r){const c=n.querySelector("#"+CSS.escape(l));c&&!o.includes(c)&&o.push(c)}return o}catch{return[]}}function kn(t){return t.trim()}function Fi(t){return t.split(" ").map(e=>e.replace(/\r\n/g,`
|
|
103
103
|
`).replace(/[\u200b\u00ad]/g,"").replace(/\s\s*/g," ")).join(" ").trim()}function nm(t,e){const n=[...t.querySelectorAll(e)];for(const r of Ms(t,t.getAttribute("aria-owns")))r.matches(e)&&n.push(r),n.push(...r.querySelectorAll(e));return n}function Bi(t,e){const n=e==="::before"?mf:e==="::after"?gf:pf;if(n!=null&&n.has(t))return n==null?void 0:n.get(t);const r=rr(t,e);let o;return r&&r.display!=="none"&&r.visibility!=="hidden"&&(o=nx(t,r.content,!!e)),e&&o!==void 0&&((r==null?void 0:r.display)||"inline")!=="inline"&&(o=" "+o+" "),n&&n.set(t,o),o}function nx(t,e,n){if(!(!e||e==="none"||e==="normal"))try{let r=Fm(e).filter(u=>!(u instanceof Fl));const o=r.findIndex(u=>u instanceof et&&u.value==="/");if(o!==-1)r=r.slice(o+1);else if(!n)return;const l=[];let c=0;for(;c<r.length;)if(r[c]instanceof Yu)l.push(r[c].value),c++;else if(c+2<r.length&&r[c]instanceof Di&&r[c].value==="attr"&&r[c+1]instanceof Xu&&r[c+2]instanceof Ju){const u=r[c+1].value;l.push(t.getAttribute(u)||""),c+=3}else return;return l.join("")}catch{}}function Lg(t){const e=t.getAttribute("aria-labelledby");if(e===null)return null;const n=Ms(t,e);return n.length?n:null}function rx(t,e){const n=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(t),r=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(t);return n||r}function Vi(t,e){const n=e?ff:uf;let r=n==null?void 0:n.get(t);return r===void 0&&(r="",["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(nt(t)||"")||(r=Fi(en(t,{includeHidden:e,visitedElements:new Set,embeddedInTargetElement:"self"}))),n==null||n.set(t,r)),r}function rm(t,e){const n=e?hf:df;let r=n==null?void 0:n.get(t);if(r===void 0){if(r="",t.hasAttribute("aria-describedby")){const o=Ms(t,t.getAttribute("aria-describedby"));r=Fi(o.map(l=>en(l,{includeHidden:e,visitedElements:new Set,embeddedInDescribedBy:{element:l,hidden:zt(l)}})).join(" "))}else t.hasAttribute("aria-description")?r=Fi(t.getAttribute("aria-description")||""):r=Fi(t.getAttribute("title")||"");n==null||n.set(t,r)}return r}function sx(t){const e=t.getAttribute("aria-invalid");return!e||e.trim()===""||e.toLocaleLowerCase()==="false"?"false":e==="true"||e==="grammar"||e==="spelling"?e:"true"}function ix(t){if("validity"in t){const e=t.validity;return(e==null?void 0:e.valid)===!1}return!1}function ox(t){const e=gs;let n=gs==null?void 0:gs.get(t);if(n===void 0){n="";const r=sx(t)!=="false",o=ix(t);if(r||o){const l=t.getAttribute("aria-errormessage");n=Ms(t,l).map(d=>Fi(en(d,{visitedElements:new Set,embeddedInDescribedBy:{element:d,hidden:zt(d)}}))).join(" ").trim()}e==null||e.set(t,n)}return n}function en(t,e){var d,p,g,y;if(e.visitedElements.has(t))return"";const n={...e,embeddedInTargetElement:e.embeddedInTargetElement==="self"?"descendant":e.embeddedInTargetElement};if(!e.includeHidden){const v=!!((d=e.embeddedInLabelledBy)!=null&&d.hidden)||!!((p=e.embeddedInDescribedBy)!=null&&p.hidden)||!!((g=e.embeddedInNativeTextAlternative)!=null&&g.hidden)||!!((y=e.embeddedInLabel)!=null&&y.hidden);if(Ag(t)||!v&&zt(t))return e.visitedElements.add(t),""}const r=Lg(t);if(!e.embeddedInLabelledBy){const v=(r||[]).map(S=>en(S,{...e,embeddedInLabelledBy:{element:S,hidden:zt(S)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(v)return v}const o=nt(t)||"",l=Xe(t);if(e.embeddedInLabel||e.embeddedInLabelledBy||e.embeddedInTargetElement==="descendant"){const v=[...t.labels||[]].includes(t),S=(r||[]).includes(t);if(!v&&!S){if(o==="textbox")return e.visitedElements.add(t),l==="INPUT"||l==="TEXTAREA"?t.value:t.textContent||"";if(["combobox","listbox"].includes(o)){e.visitedElements.add(t);let k;if(l==="SELECT")k=[...t.selectedOptions],!k.length&&t.options.length&&k.push(t.options[0]);else{const _=o==="combobox"?nm(t,"*").find(E=>nt(E)==="listbox"):t;k=_?nm(_,'[aria-selected="true"]').filter(E=>nt(E)==="option"):[]}return!k.length&&l==="INPUT"?t.value:k.map(_=>en(_,n)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(o))return e.visitedElements.add(t),t.hasAttribute("aria-valuetext")?t.getAttribute("aria-valuetext")||"":t.hasAttribute("aria-valuenow")?t.getAttribute("aria-valuenow")||"":t.getAttribute("value")||"";if(["menu"].includes(o))return e.visitedElements.add(t),""}}const c=t.getAttribute("aria-label")||"";if(kn(c))return e.visitedElements.add(t),c;if(!["presentation","none"].includes(o)){if(l==="INPUT"&&["button","submit","reset"].includes(t.type)){e.visitedElements.add(t);const v=t.value||"";return kn(v)?v:t.type==="submit"?"Submit":t.type==="reset"?"Reset":t.getAttribute("title")||""}if(l==="INPUT"&&t.type==="file"){e.visitedElements.add(t);const v=t.labels||[];return v.length&&!e.embeddedInLabelledBy?Ci(v,e):"Choose File"}if(l==="INPUT"&&t.type==="image"){e.visitedElements.add(t);const v=t.labels||[];if(v.length&&!e.embeddedInLabelledBy)return Ci(v,e);const S=t.getAttribute("alt")||"";if(kn(S))return S;const k=t.getAttribute("title")||"";return kn(k)?k:"Submit"}if(!r&&l==="BUTTON"){e.visitedElements.add(t);const v=t.labels||[];if(v.length)return Ci(v,e)}if(!r&&l==="OUTPUT"){e.visitedElements.add(t);const v=t.labels||[];return v.length?Ci(v,e):t.getAttribute("title")||""}if(!r&&(l==="TEXTAREA"||l==="SELECT"||l==="INPUT")){e.visitedElements.add(t);const v=t.labels||[];if(v.length)return Ci(v,e);const S=l==="INPUT"&&["text","password","search","tel","email","url"].includes(t.type)||l==="TEXTAREA",k=t.getAttribute("placeholder")||"",_=t.getAttribute("title")||"";return!S||_?_:k}if(!r&&l==="FIELDSET"){e.visitedElements.add(t);for(let S=t.firstElementChild;S;S=S.nextElementSibling)if(Xe(S)==="LEGEND")return en(S,{...n,embeddedInNativeTextAlternative:{element:S,hidden:zt(S)}});return t.getAttribute("title")||""}if(!r&&l==="FIGURE"){e.visitedElements.add(t);for(let S=t.firstElementChild;S;S=S.nextElementSibling)if(Xe(S)==="FIGCAPTION")return en(S,{...n,embeddedInNativeTextAlternative:{element:S,hidden:zt(S)}});return t.getAttribute("title")||""}if(l==="IMG"){e.visitedElements.add(t);const v=t.getAttribute("alt")||"";return kn(v)?v:t.getAttribute("title")||""}if(l==="TABLE"){e.visitedElements.add(t);for(let S=t.firstElementChild;S;S=S.nextElementSibling)if(Xe(S)==="CAPTION")return en(S,{...n,embeddedInNativeTextAlternative:{element:S,hidden:zt(S)}});const v=t.getAttribute("summary")||"";if(v)return v}if(l==="AREA"){e.visitedElements.add(t);const v=t.getAttribute("alt")||"";return kn(v)?v:t.getAttribute("title")||""}if(l==="SVG"||t.ownerSVGElement){e.visitedElements.add(t);for(let v=t.firstElementChild;v;v=v.nextElementSibling)if(Xe(v)==="TITLE"&&v.ownerSVGElement)return en(v,{...n,embeddedInLabelledBy:{element:v,hidden:zt(v)}})}if(t.ownerSVGElement&&l==="A"){const v=t.getAttribute("xlink:title")||"";if(kn(v))return e.visitedElements.add(t),v}}const u=l==="SUMMARY"&&!["presentation","none"].includes(o);if(rx(o,e.embeddedInTargetElement==="descendant")||u||e.embeddedInLabelledBy||e.embeddedInDescribedBy||e.embeddedInLabel||e.embeddedInNativeTextAlternative){e.visitedElements.add(t);const v=lx(t,n);if(e.embeddedInTargetElement==="self"?kn(v):v)return v}if(!["presentation","none"].includes(o)||l==="IFRAME"){e.visitedElements.add(t);const v=t.getAttribute("title")||"";if(kn(v))return v}return e.visitedElements.add(t),""}function lx(t,e){const n=[],r=(l,c)=>{var u;if(!(c&&l.assignedSlot))if(l.nodeType===1){const d=((u=rr(l))==null?void 0:u.display)||"inline";let p=en(l,e);(d!=="inline"||l.nodeName==="BR")&&(p=" "+p+" "),n.push(p)}else l.nodeType===3&&n.push(l.textContent||"")};n.push(Bi(t,"::before")||"");const o=Bi(t);if(o!==void 0)n.push(o);else{const l=t.nodeName==="SLOT"?t.assignedNodes():[];if(l.length)for(const c of l)r(c,!1);else{for(let c=t.firstChild;c;c=c.nextSibling)r(c,!0);if(t.shadowRoot)for(let c=t.shadowRoot.firstChild;c;c=c.nextSibling)r(c,!0);for(const c of Ms(t,t.getAttribute("aria-owns")))r(c,!0)}}return n.push(Bi(t,"::after")||""),n.join("")}const rf=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function Mg(t){return Xe(t)==="OPTION"?t.selected:rf.includes(nt(t)||"")?Ng(t.getAttribute("aria-selected"))===!0:!1}const sf=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function jg(t){const e=of(t,!0);return e==="error"?!1:e}function ax(t){return of(t,!0)}function cx(t){return of(t,!1)}function of(t,e){const n=Xe(t);if(e&&n==="INPUT"&&t.indeterminate)return"mixed";if(n==="INPUT"&&["checkbox","radio"].includes(t.type))return t.checked;if(sf.includes(nt(t)||"")){const r=t.getAttribute("aria-checked");return r==="true"?!0:e&&r==="mixed"?"mixed":!1}return"error"}const ux=["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox","columnheader","rowheader","searchbox","switch","treegrid"];function fx(t){const e=Xe(t);return["INPUT","TEXTAREA","SELECT"].includes(e)?t.hasAttribute("readonly"):ux.includes(nt(t)||"")?t.getAttribute("aria-readonly")==="true":t.isContentEditable?!1:"error"}const lf=["button"];function Pg(t){if(lf.includes(nt(t)||"")){const e=t.getAttribute("aria-pressed");if(e==="true")return!0;if(e==="mixed")return"mixed"}return!1}const af=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function Og(t){if(Xe(t)==="DETAILS")return t.open;if(af.includes(nt(t)||"")){const e=t.getAttribute("aria-expanded");return e===null?void 0:e==="true"}}const cf=["heading","listitem","row","treeitem"];function $g(t){const e={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[Xe(t)];if(e)return e;if(cf.includes(nt(t)||"")){const n=t.getAttribute("aria-level"),r=n===null?Number.NaN:Number(n);if(Number.isInteger(r)&&r>=1)return r}return 0}const Rg=["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 Wl(t){return Dg(t)||Fg(t)}function Dg(t){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(Xe(t))&&(t.hasAttribute("disabled")||dx(t)||hx(t))}function dx(t){return Xe(t)==="OPTION"&&!!t.closest("OPTGROUP[DISABLED]")}function hx(t){const e=t==null?void 0:t.closest("FIELDSET[DISABLED]");if(!e)return!1;const n=e.querySelector(":scope > LEGEND");return!n||!n.contains(t)}function Fg(t,e=!1){if(!t)return!1;if(e||Rg.includes(nt(t)||"")){const n=(t.getAttribute("aria-disabled")||"").toLowerCase();return n==="true"?!0:n==="false"?!1:Fg(lt(t),!0)}return!1}function Ci(t,e){return[...t].map(n=>en(n,{...e,embeddedInLabel:{element:n,hidden:zt(n)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(n=>!!n).join(" ")}function px(t){const e=yf;let n=t,r;const o=[];for(;n;n=lt(n)){const l=e.get(n);if(l!==void 0){r=l;break}o.push(n);const c=rr(n);if(!c){r=!0;break}const u=c.pointerEvents;if(u){r=u!=="none";break}}r===void 0&&(r=!0);for(const l of o)e.set(l,r);return r}let uf,ff,df,hf,gs,Yn,pf,mf,gf,yf,Bg=0;function vf(){++Bg,uf??(uf=new Map),ff??(ff=new Map),df??(df=new Map),hf??(hf=new Map),gs??(gs=new Map),Yn??(Yn=new Map),pf??(pf=new Map),mf??(mf=new Map),gf??(gf=new Map),yf??(yf=new Map)}function wf(){--Bg||(uf=void 0,ff=void 0,df=void 0,hf=void 0,gs=void 0,Yn=void 0,pf=void 0,mf=void 0,gf=void 0,yf=void 0)}const mx={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};function gx(t){return zg(t)?"'"+t.replace(/'/g,"''")+"'":t}function yu(t){return zg(t)?'"'+t.replace(/[\\"\x00-\x1f\x7f-\x9f]/g,e=>{switch(e){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case`
|
|
104
104
|
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+e.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':t}function zg(t){return!!(t.length===0||/^\s|\s$/.test(t)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(t)||/^-/.test(t)||/[\n:](\s|$)/.test(t)||/\s#/.test(t)||/[\n\r]/.test(t)||/^[&*\],?!>|@"'#%]/.test(t)||/[{}`]/.test(t)||/^\[/.test(t)||!isNaN(Number(t))||["y","n","yes","no","true","false","on","off","null"].includes(t.toLowerCase()))}let yx=0;function Kl(t,e){const n=new Set,r={root:{role:"fragment",name:"",children:[],element:t,props:{},box:ql(t),receivesPointerEvents:!0},elements:new Map,refs:new Map},o=(c,u,d)=>{if(n.has(u))return;if(n.add(u),u.nodeType===Node.TEXT_NODE&&u.nodeValue){if(!d)return;const k=u.nodeValue;c.role!=="textbox"&&k&&c.children.push(u.nodeValue||"");return}if(u.nodeType!==Node.ELEMENT_NODE)return;const p=u,g=zt(p);if(g&&!(e!=null&&e.forAI))return;const y=[];if(p.hasAttribute("aria-owns")){const k=p.getAttribute("aria-owns").split(/\s+/);for(const _ of k){const E=t.ownerDocument.getElementById(_);E&&y.push(E)}}const v=!g||Cr(p),S=v?vx(p,e):null;S&&(S.ref&&(r.elements.set(S.ref,p),r.refs.set(p,S.ref)),c.children.push(S)),l(S||c,p,y,v)};function l(c,u,d,p){var S;const y=(((S=rr(u))==null?void 0:S.display)||"inline")!=="inline"||u.nodeName==="BR"?" ":"";y&&c.children.push(y),c.children.push(Bi(u,"::before")||"");const v=u.nodeName==="SLOT"?u.assignedNodes():[];if(v.length)for(const k of v)o(c,k,p);else{for(let k=u.firstChild;k;k=k.nextSibling)k.assignedSlot||o(c,k,p);if(u.shadowRoot)for(let k=u.shadowRoot.firstChild;k;k=k.nextSibling)o(c,k,p)}for(const k of d)o(c,k,p);if(c.children.push(Bi(u,"::after")||""),y&&c.children.push(y),c.children.length===1&&c.name===c.children[0]&&(c.children=[]),c.role==="link"&&u.hasAttribute("href")){const k=u.getAttribute("href");c.props.url=k}}vf();try{o(r.root,t,!0)}finally{wf()}return Sx(r.root),wx(r.root),r}function sm(t,e,n,r){if(!(r!=null&&r.forAI))return;let o;return o=t._ariaRef,(!o||o.role!==e||o.name!==n)&&(o={role:e,name:n,ref:((r==null?void 0:r.refPrefix)??"")+"e"+ ++yx},t._ariaRef=o),o.ref}function vx(t,e){const n=t.ownerDocument.activeElement===t;if(t.nodeName==="IFRAME")return{role:"iframe",name:"",ref:sm(t,"iframe","",e),children:[],props:{},element:t,box:ql(t),receivesPointerEvents:!0,active:n};const r=e!=null&&e.forAI?"generic":null,o=nt(t)??r;if(!o||o==="presentation"||o==="none")return null;const l=mt(Vi(t,!1)||""),c=px(t),u={role:o,name:l,ref:sm(t,o,l,e),children:[],props:{},element:t,box:ql(t),receivesPointerEvents:c,active:n};return sf.includes(o)&&(u.checked=jg(t)),Rg.includes(o)&&(u.disabled=Wl(t)),af.includes(o)&&(u.expanded=Og(t)),cf.includes(o)&&(u.level=$g(t)),lf.includes(o)&&(u.pressed=Pg(t)),rf.includes(o)&&(u.selected=Mg(t)),(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.type!=="checkbox"&&t.type!=="radio"&&t.type!=="file"&&(u.children=[t.value]),u}function wx(t){const e=n=>{const r=[];for(const l of n.children||[]){if(typeof l=="string"){r.push(l);continue}const c=e(l);r.push(...c)}return n.role==="generic"&&r.length<=1&&r.every(l=>typeof l!="string"&&Ug(l))?r:(n.children=r,[n])};e(t)}function Sx(t){const e=(r,o)=>{if(!r.length)return;const l=mt(r.join(""));l&&o.push(l),r.length=0},n=r=>{const o=[],l=[];for(const c of r.children||[])typeof c=="string"?l.push(c):(e(l,o),n(c),o.push(c));e(l,o),r.children=o.length?o:[],r.children.length===1&&r.children[0]===r.name&&(r.children=[])};n(t)}function Sf(t,e){return e?t?typeof e=="string"?t===e:!!t.match(new RegExp(e.pattern)):!1:!0}function xx(t,e){return Sf(t,e.text)}function _x(t,e){return Sf(t,e.name)}function Ex(t,e){const n=Kl(t);return{matches:Hg(n.root,e,!1,!1),received:{raw:Gl(n,{mode:"raw"}),regex:Gl(n,{mode:"regex"})}}}function kx(t,e){const n=Kl(t).root;return Hg(n,e,!0,!1).map(o=>o.element)}function xf(t,e,n){var r;return typeof t=="string"&&e.kind==="text"?xx(t,e):t===null||typeof t!="object"||e.kind!=="role"||e.role!=="fragment"&&e.role!==t.role||e.checked!==void 0&&e.checked!==t.checked||e.disabled!==void 0&&e.disabled!==t.disabled||e.expanded!==void 0&&e.expanded!==t.expanded||e.level!==void 0&&e.level!==t.level||e.pressed!==void 0&&e.pressed!==t.pressed||e.selected!==void 0&&e.selected!==t.selected||!_x(t.name,e)||!Sf(t.props.url,(r=e.props)==null?void 0:r.url)?!1:e.containerMode==="contain"?om(t.children||[],e.children||[]):e.containerMode==="equal"?im(t.children||[],e.children||[],!1):e.containerMode==="deep-equal"||n?im(t.children||[],e.children||[],!0):om(t.children||[],e.children||[])}function im(t,e,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!xf(t[r],e[r],n))return!1;return!0}function om(t,e){if(e.length>t.length)return!1;const n=t.slice(),r=e.slice();for(const o of r){let l=n.shift();for(;l&&!xf(l,o,!1);)l=n.shift();if(!l)return!1}return!0}function Hg(t,e,n,r){const o=[],l=(c,u)=>{if(xf(c,e,r)){const d=typeof c=="string"?u:c;return d&&o.push(d),!n}if(typeof c=="string")return!1;for(const d of c.children||[])if(l(d,c))return!0;return!1};return l(t,null),o}function Gl(t,e){const n=[],r=(e==null?void 0:e.mode)==="regex"?Tx:()=>!0,o=(e==null?void 0:e.mode)==="regex"?bx:u=>u,l=(u,d,p)=>{if(typeof u=="string"){if(d&&!r(d,u))return;const S=yu(o(u));S&&n.push(p+"- text: "+S);return}let g=u.role;if(u.name&&u.name.length<=900){const S=o(u.name);if(S){const k=S.startsWith("/")&&S.endsWith("/")?S:JSON.stringify(S);g+=" "+k}}if(u.checked==="mixed"&&(g+=" [checked=mixed]"),u.checked===!0&&(g+=" [checked]"),u.disabled&&(g+=" [disabled]"),u.expanded&&(g+=" [expanded]"),u.active&&(e!=null&&e.forAI)&&(g+=" [active]"),u.level&&(g+=` [level=${u.level}]`),u.pressed==="mixed"&&(g+=" [pressed=mixed]"),u.pressed===!0&&(g+=" [pressed]"),u.selected===!0&&(g+=" [selected]"),e!=null&&e.forAI&&Ug(u)){const S=u.ref,k=Cx(u)?" [cursor=pointer]":"";S&&(g+=` [ref=${S}]${k}`)}const y=p+"- "+gx(g),v=!!Object.keys(u.props).length;if(!u.children.length&&!v)n.push(y);else if(u.children.length===1&&typeof u.children[0]=="string"&&!v){const S=r(u,u.children[0])?o(u.children[0]):null;S?n.push(y+": "+yu(S)):n.push(y)}else{n.push(y+":");for(const[S,k]of Object.entries(u.props))n.push(p+" - /"+S+": "+yu(k));for(const S of u.children||[])l(S,u,p+" ")}},c=t.root;if(c.role==="fragment")for(const u of c.children||[])l(u,c,"");else l(c,null,"");return n.join(`
|
|
105
|
-
`)}function bx(t){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 n="",r=0;const o=new RegExp(e.map(l=>"("+l.regex.source+")").join("|"),"g");return t.replace(o,(l,...c)=>{const u=c[c.length-2],d=c.slice(0,-2);n+=zl(t.slice(r,u));for(let p=0;p<d.length;p++)if(d[p]){const{replacement:g}=e[p];n+=g;break}return r=u+l.length,l}),n?(n+=zl(t.slice(r)),String(new RegExp(n))):t}function Tx(t,e){if(!e.length)return!1;if(!t.name)return!0;if(t.name.length>e.length)return!1;const n=e.length<=200&&t.name.length<=200?c1(e,t.name):"";let r=e;for(;n&&r.includes(n);)r=r.replace(n,"");return r.trim().length/e.length>.1}function Ug(t){return t.box.visible&&t.receivesPointerEvents}function Cx(t){var e;return((e=t.box.style)==null?void 0:e.cursor)==="pointer"}const lm=":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-line.selectable:hover{background-color:#f2f2f2;overflow:hidden}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;width:400px;height:150px;z-index:10;font-size:13px}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.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}";class vu{constructor(e){this._renderedEntries=[],this._language="javascript",this._injectedScript=e;const n=e.document;this._isUnderTest=e.isUnderTest,this._glassPaneElement=n.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="2147483646",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent";for(const r of["click","auxclick","dragstart","input","keydown","keyup","pointerdown","pointerup","mousedown","mouseup","mouseleave","focus","scroll"])this._glassPaneElement.addEventListener(r,o=>{o.stopPropagation(),o.stopImmediatePropagation()});if(this._actionPointElement=n.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 r=new this._injectedScript.window.CSSStyleSheet;r.replaceSync(lm),this._glassPaneShadow.adoptedStyleSheets.push(r)}else{const r=this._injectedScript.document.createElement("style");r.textContent=lm,this._glassPaneShadow.appendChild(r)}this._glassPaneShadow.appendChild(this._actionPointElement)}install(){this._injectedScript.document.documentElement&&!this._injectedScript.document.documentElement.contains(this._glassPaneElement)&&this._injectedScript.document.documentElement.appendChild(this._glassPaneElement)}setLanguage(e){this._language=e}runHighlightOnRaf(e){this._rafRequest&&this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);const n=this._injectedScript.querySelectorAll(e,this._injectedScript.document.documentElement),r=Tr(this._language,Tn(e)),o=n.length>1?"#f6b26b7f":"#6fa8dc7f";this.updateHighlight(n.map((l,c)=>{const u=n.length>1?` [${c+1} of ${n.length}]`:"";return{element:l,color:o,tooltipText:r+u}})),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,n){this._actionPointElement.style.top=n+"px",this._actionPointElement.style.left=e+"px",this._actionPointElement.hidden=!1}hideActionPoint(){this._actionPointElement.hidden=!0}clearHighlight(){var e,n;for(const r of this._renderedEntries)(e=r.highlightElement)==null||e.remove(),(n=r.tooltipElement)==null||n.remove();this._renderedEntries=[]}maskElements(e,n){this.updateHighlight(e.map(r=>({element:r,color:n})))}updateHighlight(e){if(!this._highlightIsUpToDate(e)){this.clearHighlight();for(const n of e){const r=this._createHighlightElement();this._glassPaneShadow.appendChild(r);let o;if(n.tooltipText){o=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(o),o.style.top="0",o.style.left="0",o.style.display="flex";const l=this._injectedScript.document.createElement("x-pw-tooltip-line");l.textContent=n.tooltipText,o.appendChild(l)}this._renderedEntries.push({targetElement:n.element,color:n.color,tooltipElement:o,highlightElement:r})}for(const n of this._renderedEntries){if(n.box=n.targetElement.getBoundingClientRect(),!n.tooltipElement)continue;const{anchorLeft:r,anchorTop:o}=this.tooltipPosition(n.box,n.tooltipElement);n.tooltipTop=o,n.tooltipLeft=r}for(const n of this._renderedEntries){n.tooltipElement&&(n.tooltipElement.style.top=n.tooltipTop+"px",n.tooltipElement.style.left=n.tooltipLeft+"px");const r=n.box;n.highlightElement.style.backgroundColor=n.color,n.highlightElement.style.left=r.x+"px",n.highlightElement.style.top=r.y+"px",n.highlightElement.style.width=r.width+"px",n.highlightElement.style.height=r.height+"px",n.highlightElement.style.display="block",this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:r.x,y:r.y,width:r.width,height:r.height}))}}}firstBox(){var e;return(e=this._renderedEntries[0])==null?void 0:e.box}tooltipPosition(e,n){const r=n.offsetWidth,o=n.offsetHeight,l=this._glassPaneElement.offsetWidth,c=this._glassPaneElement.offsetHeight;let u=e.left;u+r>l-5&&(u=l-r-5);let d=e.bottom+5;return d+o>c-5&&(e.top>o+5?d=e.top-o-5:d=c-5-o),{anchorLeft:u,anchorTop:d}}_highlightIsUpToDate(e){if(e.length!==this._renderedEntries.length)return!1;for(let n=0;n<this._renderedEntries.length;++n){if(e[n].element!==this._renderedEntries[n].targetElement||e[n].color!==this._renderedEntries[n].color)return!1;const r=this._renderedEntries[n].box;if(!r)return!1;const o=e[n].element.getBoundingClientRect();if(o.top!==r.top||o.right!==r.right||o.bottom!==r.bottom||o.left!==r.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(e){this._glassPaneShadow.appendChild(e)}}function Nx(t,e,n){const r=t.left-e.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.bottom-t.bottom,0)+Math.max(t.top-e.top,0)}function Ax(t,e,n){const r=e.left-t.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.bottom-t.bottom,0)+Math.max(t.top-e.top,0)}function Ix(t,e,n){const r=e.top-t.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.left-e.left,0)+Math.max(e.right-t.right,0)}function Lx(t,e,n){const r=t.top-e.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.left-e.left,0)+Math.max(e.right-t.right,0)}function Mx(t,e,n){const r=n===void 0?50:n;let o=0;return t.left-e.right>=0&&(o+=t.left-e.right),e.left-t.right>=0&&(o+=e.left-t.right),e.top-t.bottom>=0&&(o+=e.top-t.bottom),t.top-e.bottom>=0&&(o+=t.top-e.bottom),o>r?void 0:o}const jx=["left-of","right-of","above","below","near"];function qg(t,e,n,r){const o=e.getBoundingClientRect(),l={"left-of":Ax,"right-of":Nx,above:Ix,below:Lx,near:Mx}[t];let c;for(const u of n){if(u===e)continue;const d=l(o,u.getBoundingClientRect(),r);d!==void 0&&(c===void 0||d<c)&&(c=d)}return c}function Vg(t,e){for(const n of e.jsonPath)t!=null&&(t=t[n]);return Wg(t,e)}function Wg(t,e){const n=typeof t=="string"&&!e.caseSensitive?t.toUpperCase():t,r=typeof e.value=="string"&&!e.caseSensitive?e.value.toUpperCase():e.value;return e.op==="<truthy>"?!!n:e.op==="="?r instanceof RegExp?typeof n=="string"&&!!n.match(r):n===r:typeof n!="string"||typeof r!="string"?!1:e.op==="*="?n.includes(r):e.op==="^="?n.startsWith(r):e.op==="$="?n.endsWith(r):e.op==="|="?n===r||n.startsWith(r+"-"):e.op==="~="?n.split(" ").includes(r):!1}function _f(t){const e=t.ownerDocument;return t.nodeName==="SCRIPT"||t.nodeName==="NOSCRIPT"||t.nodeName==="STYLE"||e.head&&e.head.contains(t)}function Tt(t,e){let n=t.get(e);if(n===void 0){if(n={full:"",normalized:"",immediate:[]},!_f(e)){let r="";if(e instanceof HTMLInputElement&&(e.type==="submit"||e.type==="button"))n={full:e.value,normalized:mt(e.value),immediate:[e.value]};else{for(let o=e.firstChild;o;o=o.nextSibling)if(o.nodeType===Node.TEXT_NODE)n.full+=o.nodeValue||"",r+=o.nodeValue||"";else{if(o.nodeType===Node.COMMENT_NODE)continue;r&&n.immediate.push(r),r="",o.nodeType===Node.ELEMENT_NODE&&(n.full+=Tt(t,o).full)}r&&n.immediate.push(r),e.shadowRoot&&(n.full+=Tt(t,e.shadowRoot).full),n.full&&(n.normalized=mt(n.full))}}t.set(e,n)}return n}function ia(t,e,n){if(_f(e)||!n(Tt(t,e)))return"none";for(let r=e.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(Tt(t,r)))return"selfAndChildren";return e.shadowRoot&&n(Tt(t,e.shadowRoot))?"selfAndChildren":"self"}function Kg(t,e){const n=Lg(e);if(n)return n.map(l=>Tt(t,l));const r=e.getAttribute("aria-label");if(r!==null&&r.trim())return[{full:r,normalized:mt(r),immediate:[r]}];const o=e.nodeName==="INPUT"&&e.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(e.nodeName)||o){const l=e.labels;if(l)return[...l].map(c=>Tt(t,c))}return[]}function am(t){return t.displayName||t.name||"Anonymous"}function Px(t){if(t.type)switch(typeof t.type){case"function":return am(t.type);case"string":return t.type;case"object":return t.type.displayName||(t.type.render?am(t.type.render):"")}if(t._currentElement){const e=t._currentElement.type;if(typeof e=="string")return e;if(typeof e=="function")return e.displayName||e.name||"Anonymous"}return""}function Ox(t){var e;return t.key??((e=t._currentElement)==null?void 0:e.key)}function $x(t){if(t.child){const n=[];for(let r=t.child;r;r=r.sibling)n.push(r);return n}if(!t._currentElement)return[];const e=n=>{var o;const r=(o=n._currentElement)==null?void 0:o.type;return typeof r=="function"||typeof r=="string"};if(t._renderedComponent){const n=t._renderedComponent;return e(n)?[n]:[]}return t._renderedChildren?[...Object.values(t._renderedChildren)].filter(e):[]}function Rx(t){var r;const e=t.memoizedProps||((r=t._currentElement)==null?void 0:r.props);if(!e||typeof e=="string")return e;const n={...e};return delete n.children,n}function Gg(t){var r;const e={key:Ox(t),name:Px(t),children:$x(t).map(Gg),rootElements:[],props:Rx(t)},n=t.stateNode||t._hostNode||((r=t._renderedComponent)==null?void 0:r._hostNode);if(n instanceof Element)e.rootElements.push(n);else for(const o of e.children)e.rootElements.push(...o.rootElements);return e}function Qg(t,e,n=[]){e(t)&&n.push(t);for(const r of t.children)Qg(r,e,n);return n}function Jg(t,e=[]){const r=(t.ownerDocument||t).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);do{const o=r.currentNode,l=o,c=Object.keys(l).find(d=>d.startsWith("__reactContainer")&&l[d]!==null);if(c)e.push(l[c].stateNode.current);else{const d="_reactRootContainer";l.hasOwnProperty(d)&&l[d]!==null&&e.push(l[d]._internalRoot.current)}if(o instanceof Element&&o.hasAttribute("data-reactroot"))for(const d of Object.keys(o))(d.startsWith("__reactInternalInstance")||d.startsWith("__reactFiber"))&&e.push(o[d]);const u=o instanceof Element?o.shadowRoot:null;u&&Jg(u,e)}while(r.nextNode());return e}const Dx=()=>({queryAll(t,e){const{name:n,attributes:r}=br(e,!1),c=Jg(t.ownerDocument||t).map(d=>Gg(d)).map(d=>Qg(d,p=>{const g=p.props??{};if(p.key!==void 0&&(g.key=p.key),n&&p.name!==n||p.rootElements.some(y=>!sa(t,y)))return!1;for(const y of r)if(!Vg(g,y))return!1;return!0})).flat(),u=new Set;for(const d of c)for(const p of d.rootElements)u.add(p);return[...u]}}),Xg=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];Xg.sort();function Ni(t,e,n){if(!e.includes(n))throw new Error(`"${t}" attribute is only supported for roles: ${e.slice().sort().map(r=>`"${r}"`).join(", ")}`)}function as(t,e){if(t.op!=="<truthy>"&&!e.includes(t.value))throw new Error(`"${t.name}" must be one of ${e.map(n=>JSON.stringify(n)).join(", ")}`)}function cs(t,e){if(!e.includes(t.op))throw new Error(`"${t.name}" does not support "${t.op}" matcher`)}function Fx(t,e){const n={role:e};for(const r of t)switch(r.name){case"checked":{Ni(r.name,sf,e),as(r,[!0,!1,"mixed"]),cs(r,["<truthy>","="]),n.checked=r.op==="<truthy>"?!0:r.value;break}case"pressed":{Ni(r.name,lf,e),as(r,[!0,!1,"mixed"]),cs(r,["<truthy>","="]),n.pressed=r.op==="<truthy>"?!0:r.value;break}case"selected":{Ni(r.name,rf,e),as(r,[!0,!1]),cs(r,["<truthy>","="]),n.selected=r.op==="<truthy>"?!0:r.value;break}case"expanded":{Ni(r.name,af,e),as(r,[!0,!1]),cs(r,["<truthy>","="]),n.expanded=r.op==="<truthy>"?!0:r.value;break}case"level":{if(Ni(r.name,cf,e),typeof r.value=="string"&&(r.value=+r.value),r.op!=="="||typeof r.value!="number"||Number.isNaN(r.value))throw new Error('"level" attribute must be compared to a number');n.level=r.value;break}case"disabled":{as(r,[!0,!1]),cs(r,["<truthy>","="]),n.disabled=r.op==="<truthy>"?!0:r.value;break}case"name":{if(r.op==="<truthy>")throw new Error('"name" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');n.name=r.value,n.nameOp=r.op,n.exact=r.caseSensitive;break}case"include-hidden":{as(r,[!0,!1]),cs(r,["<truthy>","="]),n.includeHidden=r.op==="<truthy>"?!0:r.value;break}default:throw new Error(`Unknown attribute "${r.name}", must be one of ${Xg.map(o=>`"${o}"`).join(", ")}.`)}return n}function Bx(t,e,n){const r=[],o=c=>{if(nt(c)===e.role&&!(e.selected!==void 0&&Mg(c)!==e.selected)&&!(e.checked!==void 0&&jg(c)!==e.checked)&&!(e.pressed!==void 0&&Pg(c)!==e.pressed)&&!(e.expanded!==void 0&&Og(c)!==e.expanded)&&!(e.level!==void 0&&$g(c)!==e.level)&&!(e.disabled!==void 0&&Wl(c)!==e.disabled)&&!(!e.includeHidden&&zt(c))){if(e.name!==void 0){const u=mt(Vi(c,!!e.includeHidden));if(typeof e.name=="string"&&(e.name=mt(e.name)),n&&!e.exact&&e.nameOp==="="&&(e.nameOp="*="),!Wg(u,{op:e.nameOp||"=",value:e.name,caseSensitive:!!e.exact}))return}r.push(c)}},l=c=>{const u=[];c.shadowRoot&&u.push(c.shadowRoot);for(const d of c.querySelectorAll("*"))o(d),d.shadowRoot&&u.push(d.shadowRoot);u.forEach(l)};return l(t),r}function cm(t){return{queryAll:(e,n)=>{const r=br(n,!0),o=r.name.toLowerCase();if(!o)throw new Error("Role must not be empty");const l=Fx(r.attributes,o);vf();try{return Bx(e,l,t)}finally{wf()}}}}class zx{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",qx),this._engines.set("is",Oi),this._engines.set("where",Oi),this._engines.set("has",Hx),this._engines.set("scope",Ux),this._engines.set("light",Vx),this._engines.set("visible",Wx),this._engines.set("text",Kx),this._engines.set("text-is",Gx),this._engines.set("text-matches",Qx),this._engines.set("has-text",Jx),this._engines.set("right-of",Ai("right-of")),this._engines.set("left-of",Ai("left-of")),this._engines.set("above",Ai("above")),this._engines.set("below",Ai("below")),this._engines.set("near",Ai("near")),this._engines.set("nth-match",Xx);const e=[...this._engines.keys()];e.sort();const n=[...rg];if(n.sort(),e.join("|")!==n.join("|"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${e.join("|")} vs ${n.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,n,r,o){e.has(n)||e.set(n,[]);const l=e.get(n),c=l.find(d=>r.every((p,g)=>d.rest[g]===p));if(c)return c.result;const u=o();return l.push({rest:r,result:u}),u}_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,n,r){const o=this._checkSelector(n);this.begin();try{return this._cached(this._cacheMatches,e,[o,r.scope,r.pierceShadow,r.originalScope],()=>Array.isArray(o)?this._matchesEngine(Oi,e,o,r):(this._hasScopeClause(o)&&(r=this._expandContextForScopeMatching(r)),this._matchesSimple(e,o.simples[o.simples.length-1].selector,r)?this._matchesParents(e,o,o.simples.length-2,r):!1))}finally{this.end()}}query(e,n){const r=this._checkSelector(n);this.begin();try{return this._cached(this._cacheQuery,r,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(r))return this._queryEngine(Oi,e,r);this._hasScopeClause(r)&&(e=this._expandContextForScopeMatching(e));const o=this._scoreMap;this._scoreMap=new Map;let l=this._querySimple(e,r.simples[r.simples.length-1].selector);return l=l.filter(c=>this._matchesParents(c,r,r.simples.length-2,e)),this._scoreMap.size&&l.sort((c,u)=>{const d=this._scoreMap.get(c),p=this._scoreMap.get(u);return d===p?0:d===void 0?1:p===void 0?-1:d-p}),this._scoreMap=o,l})}finally{this.end()}}_markScore(e,n){this._scoreMap&&this._scoreMap.set(e,n)}_hasScopeClause(e){return e.simples.some(n=>n.selector.functions.some(r=>r.name==="scope"))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;const n=lt(e.scope);return n?{...e,scope:n,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,n,r){return this._cached(this._cacheMatchesSimple,e,[n,r.scope,r.pierceShadow,r.originalScope],()=>{if(e===r.scope||n.css&&!this._matchesCSS(e,n.css))return!1;for(const o of n.functions)if(!this._matchesEngine(this._getEngine(o.name),e,o.args,r))return!1;return!0})}_querySimple(e,n){return n.functions.length?this._cached(this._cacheQuerySimple,n,[e.scope,e.pierceShadow,e.originalScope],()=>{let r=n.css;const o=n.functions;r==="*"&&o.length&&(r=void 0);let l,c=-1;r!==void 0?l=this._queryCSS(e,r):(c=o.findIndex(u=>this._getEngine(u.name).query!==void 0),c===-1&&(c=0),l=this._queryEngine(this._getEngine(o[c].name),e,o[c].args));for(let u=0;u<o.length;u++){if(u===c)continue;const d=this._getEngine(o[u].name);d.matches!==void 0&&(l=l.filter(p=>this._matchesEngine(d,p,o[u].args,e)))}for(let u=0;u<o.length;u++){if(u===c)continue;const d=this._getEngine(o[u].name);d.matches===void 0&&(l=l.filter(p=>this._matchesEngine(d,p,o[u].args,e)))}return l}):this._queryCSS(e,n.css||"*")}_matchesParents(e,n,r,o){return r<0?!0:this._cached(this._cacheMatchesParents,e,[n,r,o.scope,o.pierceShadow,o.originalScope],()=>{const{selector:l,combinator:c}=n.simples[r];if(c===">"){const u=pl(e,o);return!u||!this._matchesSimple(u,l,o)?!1:this._matchesParents(u,n,r-1,o)}if(c==="+"){const u=wu(e,o);return!u||!this._matchesSimple(u,l,o)?!1:this._matchesParents(u,n,r-1,o)}if(c===""){let u=pl(e,o);for(;u;){if(this._matchesSimple(u,l,o)){if(this._matchesParents(u,n,r-1,o))return!0;if(n.simples[r-1].combinator==="")break}u=pl(u,o)}return!1}if(c==="~"){let u=wu(e,o);for(;u;){if(this._matchesSimple(u,l,o)){if(this._matchesParents(u,n,r-1,o))return!0;if(n.simples[r-1].combinator==="~")break}u=wu(u,o)}return!1}if(c===">="){let u=e;for(;u;){if(this._matchesSimple(u,l,o)){if(this._matchesParents(u,n,r-1,o))return!0;if(n.simples[r-1].combinator==="")break}u=pl(u,o)}return!1}throw new Error(`Unsupported combinator "${c}"`)})}_matchesEngine(e,n,r,o){if(e.matches)return this._callMatches(e,n,r,o);if(e.query)return this._callQuery(e,r,o).includes(n);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(e,n,r){if(e.query)return this._callQuery(e,r,n);if(e.matches)return this._queryCSS(n,"*").filter(o=>this._callMatches(e,o,r,n));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(e,n,r,o){return this._cached(this._cacheCallMatches,n,[e,o.scope,o.pierceShadow,o.originalScope,...r],()=>e.matches(n,r,o,this))}_callQuery(e,n,r){return this._cached(this._cacheCallQuery,e,[r.scope,r.pierceShadow,r.originalScope,...n],()=>e.query(r,n,this))}_matchesCSS(e,n){return e.matches(n)}_queryCSS(e,n){return this._cached(this._cacheQueryCSS,n,[e.scope,e.pierceShadow,e.originalScope],()=>{let r=[];function o(l){if(r=r.concat([...l.querySelectorAll(n)]),!!e.pierceShadow){l.shadowRoot&&o(l.shadowRoot);for(const c of l.querySelectorAll("*"))c.shadowRoot&&o(c.shadowRoot)}}return o(e.scope),r})}_getEngine(e){const n=this._engines.get(e);if(!n)throw new Error(`Unknown selector engine "${e}"`);return n}}const Oi={matches(t,e,n,r){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');return e.some(o=>r.matches(t,o,n))},query(t,e,n){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');let r=[];for(const o of e)r=r.concat(n.query(t,o));return e.length===1?r:Yg(r)}},Hx={matches(t,e,n,r){if(e.length===0)throw new Error('"has" engine expects non-empty selector list');return r.query({...n,scope:t},e).length>0}},Ux={matches(t,e,n,r){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const o=n.originalScope||n.scope;return o.nodeType===9?t===o.documentElement:t===o},query(t,e,n){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const r=t.originalScope||t.scope;if(r.nodeType===9){const o=r.documentElement;return o?[o]:[]}return r.nodeType===1?[r]:[]}},qx={matches(t,e,n,r){if(e.length===0)throw new Error('"not" engine expects non-empty selector list');return!r.matches(t,e,n)}},Vx={query(t,e,n){return n.query({...t,pierceShadow:!1},e)},matches(t,e,n,r){return r.matches(t,e,{...n,pierceShadow:!1})}},Wx={matches(t,e,n,r){if(e.length)throw new Error('"visible" engine expects no arguments');return Cr(t)}},Kx={matches(t,e,n,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"text" engine expects a single string');const o=mt(e[0]).toLowerCase(),l=c=>c.normalized.toLowerCase().includes(o);return ia(r._cacheText,t,l)==="self"}},Gx={matches(t,e,n,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"text-is" engine expects a single string');const o=mt(e[0]),l=c=>!o&&!c.immediate.length?!0:c.immediate.some(u=>mt(u)===o);return ia(r._cacheText,t,l)!=="none"}},Qx={matches(t,e,n,r){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 o=new RegExp(e[0],e.length===2?e[1]:void 0),l=c=>o.test(c.full);return ia(r._cacheText,t,l)==="self"}},Jx={matches(t,e,n,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"has-text" engine expects a single string');if(_f(t))return!1;const o=mt(e[0]).toLowerCase();return(c=>c.normalized.toLowerCase().includes(o))(Tt(r._cacheText,t))}};function Ai(t){return{matches(e,n,r,o){const l=n.length&&typeof n[n.length-1]=="number"?n[n.length-1]:void 0,c=l===void 0?n:n.slice(0,n.length-1);if(n.length<1+(l===void 0?0:1))throw new Error(`"${t}" engine expects a selector list and optional maximum distance in pixels`);const u=o.query(r,c),d=qg(t,e,u,l);return d===void 0?!1:(o._markScore(e,d),!0)}}}const Xx={query(t,e,n){let r=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 r!="number"||r<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');const o=Oi.query(t,e.slice(0,e.length-1),n);return r--,r<o.length?[o[r]]:[]}};function pl(t,e){if(t!==e.scope)return e.pierceShadow?lt(t):t.parentElement||void 0}function wu(t,e){if(t!==e.scope)return t.previousElementSibling||void 0}function Yg(t){const e=new Map,n=[],r=[];function o(c){let u=e.get(c);if(u)return u;const d=lt(c);return d?o(d).children.push(c):n.push(c),u={children:[],taken:!1},e.set(c,u),u}for(const c of t)o(c).taken=!0;function l(c){const u=e.get(c);if(u.taken&&r.push(c),u.children.length>1){const d=new Set(u.children);u.children=[];let p=c.firstElementChild;for(;p&&u.children.length<d.size;)d.has(p)&&u.children.push(p),p=p.nextElementSibling;for(p=c.shadowRoot?c.shadowRoot.firstElementChild:null;p&&u.children.length<d.size;)d.has(p)&&u.children.push(p),p=p.nextElementSibling}u.children.forEach(l)}return n.forEach(l),r}const Zg=10,js=Zg/2,um=1,Yx=2,Zx=10,e_=50,ey=100,ty=120,ny=140,ry=160,Il=180,sy=200,fm=250,t_=ty+js,n_=ny+js,r_=ey+js,s_=ry+js,i_=Il+js,o_=sy+js,l_=300,a_=500,iy=510,Su=520,oy=530,ly=1e4,c_=1e7,u_=1e3;function dm(t,e,n){t._evaluator.begin();const r={allowText:new Map,disallowText:new Map};vf();try{let o=[];if(n.forTextExpect){let u=ml(t,e.ownerDocument.documentElement,n);for(let d=e;d;d=lt(d)){const p=us(r,t,d,{...n,noText:!0});if(!p)continue;if(Zn(p)<=u_){u=p;break}}o=[Ll(u)]}else{if(!e.matches("input,textarea,select")&&!e.isContentEditable){const u=Pi(e,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",n.root);u&&Cr(u)&&(e=u)}if(n.multiple){const u=us(r,t,e,n),d=us(r,t,e,{...n,noText:!0});let p=[u,d];if(r.allowText.clear(),r.disallowText.clear(),u&&xu(u)&&p.push(us(r,t,e,{...n,noCSSId:!0})),d&&xu(d)&&p.push(us(r,t,e,{...n,noText:!0,noCSSId:!0})),p=p.filter(Boolean),!p.length){const g=ml(t,e,n);p.push(g),xu(g)&&p.push(ml(t,e,{...n,noCSSId:!0}))}o=[...new Set(p.map(g=>Ll(g)))]}else{const u=us(r,t,e,n)||ml(t,e,n);o=[Ll(u)]}}const l=o[0],c=t.parseSelector(l);return{selector:l,selectors:o,elements:t.querySelectorAll(c,n.root??e.ownerDocument)}}finally{wf(),t._evaluator.end()}}function hm(t){return t.filter(e=>e[0].selector[0]!=="/")}function us(t,e,n,r){if(r.root&&!sa(r.root,n))throw new Error("Target element must belong to the root's subtree");if(n===r.root)return[{engine:"css",selector:":scope",score:1}];if(n.ownerDocument.documentElement===n)return[{engine:"css",selector:"html",score:1}];const o=(c,u)=>{const d=c===n;let p=u?d_(e,c,c===n):[];c!==n&&(p=hm(p));const g=f_(e,c,r).filter(S=>!r.omitInternalEngines||!S.engine.startsWith("internal:")).map(S=>[S]);let y=pm(e,r.root??n.ownerDocument,c,[...p,...g],d);p=hm(p);const v=S=>{const k=u&&!S.length,_=[...S,...g].filter(C=>y?Zn(C)<Zn(y):!0);let E=_[0];if(E)for(let C=lt(c);C&&C!==r.root;C=lt(C)){const A=l(C,k);if(!A||y&&Zn([...A,...E])>=Zn(y))continue;if(E=pm(e,C,c,_,d),!E)return;const B=[...A,...E];(!y||Zn(B)<Zn(y))&&(y=B)}};return v(p),c===n&&p.length&&v([]),y},l=(c,u)=>{const d=u?t.allowText:t.disallowText;let p=d.get(c);return p===void 0&&(p=o(c,u),d.set(c,p)),p};return o(n,!r.noText)}function f_(t,e,n){const r=[];{for(const c of["data-testid","data-test-id","data-test"])c!==n.testIdAttributeName&&e.getAttribute(c)&&r.push({engine:"css",selector:`[${c}=${ps(e.getAttribute(c))}]`,score:Yx});if(!n.noCSSId){const c=e.getAttribute("id");c&&!h_(c)&&r.push({engine:"css",selector:ay(c),score:a_})}r.push({engine:"css",selector:bn(e),score:oy})}if(e.nodeName==="IFRAME"){for(const c of["name","title"])e.getAttribute(c)&&r.push({engine:"css",selector:`${bn(e)}[${c}=${ps(e.getAttribute(c))}]`,score:Zx});return e.getAttribute(n.testIdAttributeName)&&r.push({engine:"css",selector:`[${n.testIdAttributeName}=${ps(e.getAttribute(n.testIdAttributeName))}]`,score:um}),Ru([r]),r}if(e.getAttribute(n.testIdAttributeName)&&r.push({engine:"internal:testid",selector:`[${n.testIdAttributeName}=${ht(e.getAttribute(n.testIdAttributeName),!0)}]`,score:um}),e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const c=e;if(c.placeholder){r.push({engine:"internal:attr",selector:`[placeholder=${ht(c.placeholder,!0)}]`,score:t_});for(const u of ys(c.placeholder))r.push({engine:"internal:attr",selector:`[placeholder=${ht(u.text,!1)}]`,score:ty-u.scoreBonus})}}const o=Kg(t._evaluator._cacheText,e);for(const c of o){const u=c.normalized;r.push({engine:"internal:label",selector:kt(u,!0),score:n_});for(const d of ys(u))r.push({engine:"internal:label",selector:kt(d.text,!1),score:ny-d.scoreBonus})}const l=nt(e);return l&&!["none","presentation"].includes(l)&&r.push({engine:"internal:role",selector:l,score:iy}),e.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(e.nodeName)&&r.push({engine:"css",selector:`${bn(e)}[name=${ps(e.getAttribute("name"))}]`,score:Su}),["INPUT","TEXTAREA"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&e.getAttribute("type")&&r.push({engine:"css",selector:`${bn(e)}[type=${ps(e.getAttribute("type"))}]`,score:Su}),["INPUT","TEXTAREA","SELECT"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&r.push({engine:"css",selector:bn(e),score:Su+1}),Ru([r]),r}function d_(t,e,n){if(e.nodeName==="SELECT")return[];const r=[],o=e.getAttribute("title");if(o){r.push([{engine:"internal:attr",selector:`[title=${ht(o,!0)}]`,score:o_}]);for(const p of ys(o))r.push([{engine:"internal:attr",selector:`[title=${ht(p.text,!1)}]`,score:sy-p.scoreBonus}])}const l=e.getAttribute("alt");if(l&&["APPLET","AREA","IMG","INPUT"].includes(e.nodeName)){r.push([{engine:"internal:attr",selector:`[alt=${ht(l,!0)}]`,score:s_}]);for(const p of ys(l))r.push([{engine:"internal:attr",selector:`[alt=${ht(p.text,!1)}]`,score:ry-p.scoreBonus}])}const c=Tt(t._evaluator._cacheText,e).normalized,u=c?ys(c):[];if(c){if(n){c.length<=80&&r.push([{engine:"internal:text",selector:kt(c,!0),score:i_}]);for(const g of u)r.push([{engine:"internal:text",selector:kt(g.text,!1),score:Il-g.scoreBonus}])}const p={engine:"css",selector:bn(e),score:oy};for(const g of u)r.push([p,{engine:"internal:has-text",selector:kt(g.text,!1),score:Il-g.scoreBonus}]);if(c.length<=80){const g=new RegExp("^"+zl(c)+"$");r.push([p,{engine:"internal:has-text",selector:kt(g,!1),score:fm}])}}const d=nt(e);if(d&&!["none","presentation"].includes(d)){const p=Vi(e,!1);if(p){const g={engine:"internal:role",selector:`${d}[name=${ht(p,!0)}]`,score:r_};r.push([g]);for(const y of ys(p))r.push([{engine:"internal:role",selector:`${d}[name=${ht(y.text,!1)}]`,score:ey-y.scoreBonus}])}else{const g={engine:"internal:role",selector:`${d}`,score:iy};for(const y of u)r.push([g,{engine:"internal:has-text",selector:kt(y.text,!1),score:Il-y.scoreBonus}]);if(c.length<=80){const y=new RegExp("^"+zl(c)+"$");r.push([g,{engine:"internal:has-text",selector:kt(y,!1),score:fm}])}}}return Ru(r),r}function ay(t){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(t)?"#"+t:`[id=${ps(t)}]`}function xu(t){return t.some(e=>e.engine==="css"&&(e.selector.startsWith("#")||e.selector.startsWith('[id="')))}function ml(t,e,n){const r=n.root??e.ownerDocument,o=[];function l(u){const d=o.slice();u&&d.unshift(u);const p=d.join(" > "),g=t.parseSelector(p);return t.querySelector(g,r,!1)===e?p:void 0}function c(u){const d={engine:"css",selector:u,score:c_},p=t.parseSelector(u),g=t.querySelectorAll(p,r);if(g.length===1)return[d];const y={engine:"nth",selector:String(g.indexOf(e)),score:ly};return[d,y]}for(let u=e;u&&u!==r;u=lt(u)){let d="";if(u.id&&!n.noCSSId){const y=ay(u.id),v=l(y);if(v)return c(v);d=y}const p=u.parentNode,g=[...u.classList].map(p_);for(let y=0;y<g.length;++y){const v="."+g.slice(0,y+1).join("."),S=l(v);if(S)return c(S);!d&&p&&p.querySelectorAll(v).length===1&&(d=v)}if(p){const y=[...p.children],v=u.nodeName,k=y.filter(E=>E.nodeName===v).indexOf(u)===0?bn(u):`${bn(u)}:nth-child(${1+y.indexOf(u)})`,_=l(k);if(_)return c(_);d||(d=k)}else d||(d=bn(u));o.unshift(d)}return c(l())}function Ru(t){for(const e of t)for(const n of e)n.score>e_&&n.score<l_&&(n.score+=Math.min(Zg,n.selector.length/10|0))}function Ll(t){const e=[];let n="";for(const{engine:r,selector:o}of t)e.length&&(n!=="css"||r!=="css"||o.startsWith(":nth-match("))&&e.push(">>"),n=r,r==="css"?e.push(o):e.push(`${r}=${o}`);return e.join(" ")}function Zn(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n].score*(t.length-n);return e}function pm(t,e,n,r,o){const l=r.map(u=>({tokens:u,score:Zn(u)}));l.sort((u,d)=>u.score-d.score);let c=null;for(const{tokens:u}of l){const d=t.parseSelector(Ll(u)),p=t.querySelectorAll(d,e);if(p[0]===n&&p.length===1)return u;const g=p.indexOf(n);if(!o||c||g===-1||p.length>5)continue;const y={engine:"nth",selector:String(g),score:ly};c=[...u,y]}return c}function h_(t){let e,n=0;for(let r=0;r<t.length;++r){const o=t[r];let l;if(!(o==="-"||o==="_")){if(o>="a"&&o<="z"?l="lower":o>="A"&&o<="Z"?l="upper":o>="0"&&o<="9"?l="digit":l="other",l==="lower"&&e==="upper"){e=l;continue}e&&e!==l&&++n,e=l}}return n>=t.length/4}function gl(t,e){if(t.length<=e)return t;t=t.substring(0,e);const n=t.match(/^(.*)\b(.+?)$/);return n?n[1].trimEnd():""}function ys(t){let e=[];{const n=t.match(/^([\d.,]+)[^.,\w]/),r=n?n[1].length:0;if(r){const o=gl(t.substring(r).trimStart(),80);e.push({text:o,scoreBonus:o.length<=30?2:1})}}{const n=t.match(/[^.,\w]([\d.,]+)$/),r=n?n[1].length:0;if(r){const o=gl(t.substring(0,t.length-r).trimEnd(),80);e.push({text:o,scoreBonus:o.length<=30?2:1})}}return t.length<=30?e.push({text:t,scoreBonus:0}):(e.push({text:gl(t,80),scoreBonus:0}),e.push({text:gl(t,30),scoreBonus:1})),e=e.filter(n=>n.text),e.length||e.push({text:t.substring(0,80),scoreBonus:0}),e}function bn(t){return t.nodeName.toLocaleLowerCase().replace(/[:\.]/g,e=>"\\"+e)}function p_(t){let e="";for(let n=0;n<t.length;n++)e+=m_(t,n);return e}function m_(t,e){const n=t.charCodeAt(e);return n===0?"�":n>=1&&n<=31||n>=48&&n<=57&&(e===0||e===1&&t.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":e===0&&n===45&&t.length===1?"\\"+t.charAt(e):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?t.charAt(e):"\\"+t.charAt(e)}function cy(t,e){const n=t.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/");let r=n.substring(n.lastIndexOf("/")+1);return r.endsWith(e)&&(r=r.substring(0,r.length-e.length)),r}function g_(t,e){return e?e.toUpperCase():""}const y_=/(?:^|[-_/])(\w)/g,uy=t=>t&&t.replace(y_,g_);function v_(t){function e(g){const y=g.name||g._componentTag||g.__playwright_guessedName;if(y)return y;const v=g.__file;if(v)return uy(cy(v,".vue"))}function n(g,y){return g.type.__playwright_guessedName=y,y}function r(g){var v,S,k,_;const y=e(g.type||{});if(y)return y;if(g.root===g)return"Root";for(const E in(S=(v=g.parent)==null?void 0:v.type)==null?void 0:S.components)if(((k=g.parent)==null?void 0:k.type.components[E])===g.type)return n(g,E);for(const E in(_=g.appContext)==null?void 0:_.components)if(g.appContext.components[E]===g.type)return n(g,E);return"Anonymous Component"}function o(g){return g._isBeingDestroyed||g.isUnmounted}function l(g){return g.subTree.type.toString()==="Symbol(Fragment)"}function c(g){const y=[];return g.component&&y.push(g.component),g.suspense&&y.push(...c(g.suspense.activeBranch)),Array.isArray(g.children)&&g.children.forEach(v=>{v.component?y.push(v.component):y.push(...c(v))}),y.filter(v=>{var S;return!o(v)&&!((S=v.type.devtools)!=null&&S.hide)})}function u(g){return l(g)?d(g.subTree):[g.subTree.el]}function d(g){if(!g.children)return[];const y=[];for(let v=0,S=g.children.length;v<S;v++){const k=g.children[v];k.component?y.push(...u(k.component)):k.el&&y.push(k.el)}return y}function p(g){return{name:r(g),children:c(g.subTree).map(p),rootElements:u(g),props:g.props}}return p(t)}function w_(t){function e(l){const c=l.displayName||l.name||l._componentTag;if(c)return c;const u=l.__file;if(u)return uy(cy(u,".vue"))}function n(l){const c=e(l.$options||l.fnOptions||{});return c||(l.$root===l?"Root":"Anonymous Component")}function r(l){return l.$children?l.$children:Array.isArray(l.subTree.children)?l.subTree.children.filter(c=>!!c.component).map(c=>c.component):[]}function o(l){return{name:n(l),children:r(l).map(o),rootElements:[l.$el],props:l._props}}return o(t)}function fy(t,e,n=[]){e(t)&&n.push(t);for(const r of t.children)fy(r,e,n);return n}function dy(t,e=[]){const r=(t.ownerDocument||t).createTreeWalker(t,NodeFilter.SHOW_ELEMENT),o=new Set;do{const l=r.currentNode;l.__vue__&&o.add(l.__vue__.$root),l.__vue_app__&&l._vnode&&l._vnode.component&&e.push({root:l._vnode.component,version:3});const c=l instanceof Element?l.shadowRoot:null;c&&dy(c,e)}while(r.nextNode());for(const l of o)e.push({version:2,root:l});return e}const S_=()=>({queryAll(t,e){const n=t.ownerDocument||t,{name:r,attributes:o}=br(e,!1),u=dy(n).map(p=>p.version===3?v_(p.root):w_(p.root)).map(p=>fy(p,g=>{if(r&&g.name!==r||g.rootElements.some(y=>!sa(t,y)))return!1;for(const y of o)if(!Vg(g.props,y))return!1;return!0})).flat(),d=new Set;for(const p of u)for(const g of p.rootElements)d.add(g);return[...d]}}),mm={queryAll(t,e){e.startsWith("/")&&t.nodeType!==Node.DOCUMENT_NODE&&(e="."+e);const n=[],r=t.ownerDocument||t;if(!r)return n;const o=r.evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let l=o.iterateNext();l;l=o.iterateNext())l.nodeType===Node.ELEMENT_NODE&&n.push(l);return n}};function Ef(t,e,n){return`internal:attr=[${t}=${ht(e,(n==null?void 0:n.exact)||!1)}]`}function x_(t,e){return`internal:testid=[${t}=${ht(e,!0)}]`}function __(t,e){return"internal:label="+kt(t,!!(e!=null&&e.exact))}function E_(t,e){return Ef("alt",t,e)}function k_(t,e){return Ef("title",t,e)}function b_(t,e){return Ef("placeholder",t,e)}function T_(t,e){return"internal:text="+kt(t,!!(e!=null&&e.exact))}function C_(t,e={}){const n=[];return e.checked!==void 0&&n.push(["checked",String(e.checked)]),e.disabled!==void 0&&n.push(["disabled",String(e.disabled)]),e.selected!==void 0&&n.push(["selected",String(e.selected)]),e.expanded!==void 0&&n.push(["expanded",String(e.expanded)]),e.includeHidden!==void 0&&n.push(["include-hidden",String(e.includeHidden)]),e.level!==void 0&&n.push(["level",String(e.level)]),e.name!==void 0&&n.push(["name",ht(e.name,!!e.exact)]),e.pressed!==void 0&&n.push(["pressed",String(e.pressed)]),`internal:role=${t}${n.map(([r,o])=>`[${r}=${o}]`).join("")}`}const Ii=Symbol("selector"),N_=class $i{constructor(e,n,r){if(r!=null&&r.hasText&&(n+=` >> internal:has-text=${kt(r.hasText,!1)}`),r!=null&&r.hasNotText&&(n+=` >> internal:has-not-text=${kt(r.hasNotText,!1)}`),r!=null&&r.has&&(n+=" >> internal:has="+JSON.stringify(r.has[Ii])),r!=null&&r.hasNot&&(n+=" >> internal:has-not="+JSON.stringify(r.hasNot[Ii])),(r==null?void 0:r.visible)!==void 0&&(n+=` >> visible=${r.visible?"true":"false"}`),this[Ii]=n,n){const c=e.parseSelector(n);this.element=e.querySelector(c,e.document,!1),this.elements=e.querySelectorAll(c,e.document)}const o=n,l=this;l.locator=(c,u)=>new $i(e,o?o+" >> "+c:c,u),l.getByTestId=c=>l.locator(x_(e.testIdAttributeNameForStrictErrorAndConsoleCodegen(),c)),l.getByAltText=(c,u)=>l.locator(E_(c,u)),l.getByLabel=(c,u)=>l.locator(__(c,u)),l.getByPlaceholder=(c,u)=>l.locator(b_(c,u)),l.getByText=(c,u)=>l.locator(T_(c,u)),l.getByTitle=(c,u)=>l.locator(k_(c,u)),l.getByRole=(c,u={})=>l.locator(C_(c,u)),l.filter=c=>new $i(e,n,c),l.first=()=>l.locator("nth=0"),l.last=()=>l.locator("nth=-1"),l.nth=c=>l.locator(`nth=${c}`),l.and=c=>new $i(e,o+" >> internal:and="+JSON.stringify(c[Ii])),l.or=c=>new $i(e,o+" >> internal:or="+JSON.stringify(c[Ii]))}};let A_=N_;class I_{constructor(e){this._injectedScript=e}install(){this._injectedScript.window.playwright||(this._injectedScript.window.playwright={$:(e,n)=>this._querySelector(e,!!n),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),generateLocator:(e,n)=>this._generateLocator(e,n),ariaSnapshot:(e,n)=>this._injectedScript.ariaSnapshot(e||this._injectedScript.document.body,n),resume:()=>this._resume(),...new A_(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,n){if(typeof e!="string")throw new Error("Usage: playwright.query('Playwright >> selector').");const r=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(r,this._injectedScript.document,n)}_querySelectorAll(e){if(typeof e!="string")throw new Error("Usage: playwright.$$('Playwright >> selector').");const n=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(n,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,n){if(!(e instanceof Element))throw new Error("Usage: playwright.locator(element).");const r=this._injectedScript.generateSelectorSimple(e);return Tr(n||"javascript",r)}_resume(){this._injectedScript.window.__pw_resume().catch(()=>{})}}function L_(t){try{return t instanceof RegExp||Object.prototype.toString.call(t)==="[object RegExp]"}catch{return!1}}function M_(t){try{return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}catch{return!1}}function j_(t){try{return t instanceof URL||Object.prototype.toString.call(t)==="[object URL]"}catch{return!1}}function P_(t){var e;try{return t instanceof Error||t&&((e=Object.getPrototypeOf(t))==null?void 0:e.name)==="Error"}catch{return!1}}function O_(t,e){try{return t instanceof e||Object.prototype.toString.call(t)===`[object ${e.name}]`}catch{return!1}}const hy={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function $_(t){if("toBase64"in t)return t.toBase64();const e=Array.from(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).map(n=>String.fromCharCode(n)).join("");return btoa(e)}function R_(t,e){const n=atob(t),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new e(r.buffer)}function Du(t,e=[],n=new Map){if(!Object.is(t,void 0)){if(typeof t=="object"&&t){if("ref"in t)return n.get(t.ref);if("v"in t)return t.v==="undefined"?void 0:t.v==="null"?null:t.v==="NaN"?NaN:t.v==="Infinity"?1/0:t.v==="-Infinity"?-1/0:t.v==="-0"?-0:void 0;if("d"in t)return new Date(t.d);if("u"in t)return new URL(t.u);if("bi"in t)return BigInt(t.bi);if("e"in t){const r=new Error(t.e.m);return r.name=t.e.n,r.stack=t.e.s,r}if("r"in t)return new RegExp(t.r.p,t.r.f);if("a"in t){const r=[];n.set(t.id,r);for(const o of t.a)r.push(Du(o,e,n));return r}if("o"in t){const r={};n.set(t.id,r);for(const{k:o,v:l}of t.o)o!=="__proto__"&&(r[o]=Du(l,e,n));return r}if("h"in t)return e[t.h];if("ta"in t)return R_(t.ta.b,hy[t.ta.k])}return t}}function D_(t,e){return Fu(t,e,{visited:new Map,lastId:0})}function Fu(t,e,n){if(t&&typeof t=="object"){if(typeof globalThis.Window=="function"&&t instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document=="function"&&t instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node=="function"&&t instanceof globalThis.Node)return"ref: <Node>"}return py(t,e,n)}function py(t,e,n){var l;const r=e(t);if("fallThrough"in r)t=r.fallThrough;else return r;if(typeof t=="symbol")return{v:"undefined"};if(Object.is(t,void 0))return{v:"undefined"};if(Object.is(t,null))return{v:"null"};if(Object.is(t,NaN))return{v:"NaN"};if(Object.is(t,1/0))return{v:"Infinity"};if(Object.is(t,-1/0))return{v:"-Infinity"};if(Object.is(t,-0))return{v:"-0"};if(typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t;if(typeof t=="bigint")return{bi:t.toString()};if(P_(t)){let c;return(l=t.stack)!=null&&l.startsWith(t.name+": "+t.message)?c=t.stack:c=`${t.name}: ${t.message}
|
|
105
|
+
`)}function bx(t){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 n="",r=0;const o=new RegExp(e.map(l=>"("+l.regex.source+")").join("|"),"g");return t.replace(o,(l,...c)=>{const u=c[c.length-2],d=c.slice(0,-2);n+=zl(t.slice(r,u));for(let p=0;p<d.length;p++)if(d[p]){const{replacement:g}=e[p];n+=g;break}return r=u+l.length,l}),n?(n+=zl(t.slice(r)),String(new RegExp(n))):t}function Tx(t,e){if(!e.length)return!1;if(!t.name)return!0;if(t.name.length>e.length)return!1;const n=e.length<=200&&t.name.length<=200?c1(e,t.name):"";let r=e;for(;n&&r.includes(n);)r=r.replace(n,"");return r.trim().length/e.length>.1}function Ug(t){return t.box.visible&&t.receivesPointerEvents}function Cx(t){var e;return((e=t.box.style)==null?void 0:e.cursor)==="pointer"}const lm=":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-line.selectable:hover{background-color:#f2f2f2;overflow:hidden}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;width:400px;height:150px;z-index:10;font-size:13px}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.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}";class vu{constructor(e){this._renderedEntries=[],this._language="javascript",this._injectedScript=e;const n=e.document;this._isUnderTest=e.isUnderTest,this._glassPaneElement=n.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";for(const r of["click","auxclick","dragstart","input","keydown","keyup","pointerdown","pointerup","mousedown","mouseup","mouseleave","focus","scroll"])this._glassPaneElement.addEventListener(r,o=>{o.stopPropagation(),o.stopImmediatePropagation()});if(this._actionPointElement=n.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 r=new this._injectedScript.window.CSSStyleSheet;r.replaceSync(lm),this._glassPaneShadow.adoptedStyleSheets.push(r)}else{const r=this._injectedScript.document.createElement("style");r.textContent=lm,this._glassPaneShadow.appendChild(r)}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 n=this._injectedScript.querySelectorAll(e,this._injectedScript.document.documentElement),r=Tr(this._language,Tn(e)),o=n.length>1?"#f6b26b7f":"#6fa8dc7f";this.updateHighlight(n.map((l,c)=>{const u=n.length>1?` [${c+1} of ${n.length}]`:"";return{element:l,color:o,tooltipText:r+u}})),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,n){this._actionPointElement.style.top=n+"px",this._actionPointElement.style.left=e+"px",this._actionPointElement.hidden=!1}hideActionPoint(){this._actionPointElement.hidden=!0}clearHighlight(){var e,n;for(const r of this._renderedEntries)(e=r.highlightElement)==null||e.remove(),(n=r.tooltipElement)==null||n.remove();this._renderedEntries=[]}maskElements(e,n){this.updateHighlight(e.map(r=>({element:r,color:n})))}updateHighlight(e){if(!this._highlightIsUpToDate(e)){this.clearHighlight();for(const n of e){const r=this._createHighlightElement();this._glassPaneShadow.appendChild(r);let o;if(n.tooltipText){o=this._injectedScript.document.createElement("x-pw-tooltip"),this._glassPaneShadow.appendChild(o),o.style.top="0",o.style.left="0",o.style.display="flex";const l=this._injectedScript.document.createElement("x-pw-tooltip-line");l.textContent=n.tooltipText,o.appendChild(l)}this._renderedEntries.push({targetElement:n.element,color:n.color,tooltipElement:o,highlightElement:r})}for(const n of this._renderedEntries){if(n.box=n.targetElement.getBoundingClientRect(),!n.tooltipElement)continue;const{anchorLeft:r,anchorTop:o}=this.tooltipPosition(n.box,n.tooltipElement);n.tooltipTop=o,n.tooltipLeft=r}for(const n of this._renderedEntries){n.tooltipElement&&(n.tooltipElement.style.top=n.tooltipTop+"px",n.tooltipElement.style.left=n.tooltipLeft+"px");const r=n.box;n.highlightElement.style.backgroundColor=n.color,n.highlightElement.style.left=r.x+"px",n.highlightElement.style.top=r.y+"px",n.highlightElement.style.width=r.width+"px",n.highlightElement.style.height=r.height+"px",n.highlightElement.style.display="block",this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:r.x,y:r.y,width:r.width,height:r.height}))}}}firstBox(){var e;return(e=this._renderedEntries[0])==null?void 0:e.box}tooltipPosition(e,n){const r=n.offsetWidth,o=n.offsetHeight,l=this._glassPaneElement.offsetWidth,c=this._glassPaneElement.offsetHeight;let u=e.left;u+r>l-5&&(u=l-r-5);let d=e.bottom+5;return d+o>c-5&&(e.top>o+5?d=e.top-o-5:d=c-5-o),{anchorLeft:u,anchorTop:d}}_highlightIsUpToDate(e){if(e.length!==this._renderedEntries.length)return!1;for(let n=0;n<this._renderedEntries.length;++n){if(e[n].element!==this._renderedEntries[n].targetElement||e[n].color!==this._renderedEntries[n].color)return!1;const r=this._renderedEntries[n].box;if(!r)return!1;const o=e[n].element.getBoundingClientRect();if(o.top!==r.top||o.right!==r.right||o.bottom!==r.bottom||o.left!==r.left)return!1}return!0}_createHighlightElement(){return this._injectedScript.document.createElement("x-pw-highlight")}appendChild(e){this._glassPaneShadow.appendChild(e)}}function Nx(t,e,n){const r=t.left-e.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.bottom-t.bottom,0)+Math.max(t.top-e.top,0)}function Ax(t,e,n){const r=e.left-t.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.bottom-t.bottom,0)+Math.max(t.top-e.top,0)}function Ix(t,e,n){const r=e.top-t.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.left-e.left,0)+Math.max(e.right-t.right,0)}function Lx(t,e,n){const r=t.top-e.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.left-e.left,0)+Math.max(e.right-t.right,0)}function Mx(t,e,n){const r=n===void 0?50:n;let o=0;return t.left-e.right>=0&&(o+=t.left-e.right),e.left-t.right>=0&&(o+=e.left-t.right),e.top-t.bottom>=0&&(o+=e.top-t.bottom),t.top-e.bottom>=0&&(o+=t.top-e.bottom),o>r?void 0:o}const jx=["left-of","right-of","above","below","near"];function qg(t,e,n,r){const o=e.getBoundingClientRect(),l={"left-of":Ax,"right-of":Nx,above:Ix,below:Lx,near:Mx}[t];let c;for(const u of n){if(u===e)continue;const d=l(o,u.getBoundingClientRect(),r);d!==void 0&&(c===void 0||d<c)&&(c=d)}return c}function Vg(t,e){for(const n of e.jsonPath)t!=null&&(t=t[n]);return Wg(t,e)}function Wg(t,e){const n=typeof t=="string"&&!e.caseSensitive?t.toUpperCase():t,r=typeof e.value=="string"&&!e.caseSensitive?e.value.toUpperCase():e.value;return e.op==="<truthy>"?!!n:e.op==="="?r instanceof RegExp?typeof n=="string"&&!!n.match(r):n===r:typeof n!="string"||typeof r!="string"?!1:e.op==="*="?n.includes(r):e.op==="^="?n.startsWith(r):e.op==="$="?n.endsWith(r):e.op==="|="?n===r||n.startsWith(r+"-"):e.op==="~="?n.split(" ").includes(r):!1}function _f(t){const e=t.ownerDocument;return t.nodeName==="SCRIPT"||t.nodeName==="NOSCRIPT"||t.nodeName==="STYLE"||e.head&&e.head.contains(t)}function Tt(t,e){let n=t.get(e);if(n===void 0){if(n={full:"",normalized:"",immediate:[]},!_f(e)){let r="";if(e instanceof HTMLInputElement&&(e.type==="submit"||e.type==="button"))n={full:e.value,normalized:mt(e.value),immediate:[e.value]};else{for(let o=e.firstChild;o;o=o.nextSibling)if(o.nodeType===Node.TEXT_NODE)n.full+=o.nodeValue||"",r+=o.nodeValue||"";else{if(o.nodeType===Node.COMMENT_NODE)continue;r&&n.immediate.push(r),r="",o.nodeType===Node.ELEMENT_NODE&&(n.full+=Tt(t,o).full)}r&&n.immediate.push(r),e.shadowRoot&&(n.full+=Tt(t,e.shadowRoot).full),n.full&&(n.normalized=mt(n.full))}}t.set(e,n)}return n}function ia(t,e,n){if(_f(e)||!n(Tt(t,e)))return"none";for(let r=e.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(Tt(t,r)))return"selfAndChildren";return e.shadowRoot&&n(Tt(t,e.shadowRoot))?"selfAndChildren":"self"}function Kg(t,e){const n=Lg(e);if(n)return n.map(l=>Tt(t,l));const r=e.getAttribute("aria-label");if(r!==null&&r.trim())return[{full:r,normalized:mt(r),immediate:[r]}];const o=e.nodeName==="INPUT"&&e.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(e.nodeName)||o){const l=e.labels;if(l)return[...l].map(c=>Tt(t,c))}return[]}function am(t){return t.displayName||t.name||"Anonymous"}function Px(t){if(t.type)switch(typeof t.type){case"function":return am(t.type);case"string":return t.type;case"object":return t.type.displayName||(t.type.render?am(t.type.render):"")}if(t._currentElement){const e=t._currentElement.type;if(typeof e=="string")return e;if(typeof e=="function")return e.displayName||e.name||"Anonymous"}return""}function Ox(t){var e;return t.key??((e=t._currentElement)==null?void 0:e.key)}function $x(t){if(t.child){const n=[];for(let r=t.child;r;r=r.sibling)n.push(r);return n}if(!t._currentElement)return[];const e=n=>{var o;const r=(o=n._currentElement)==null?void 0:o.type;return typeof r=="function"||typeof r=="string"};if(t._renderedComponent){const n=t._renderedComponent;return e(n)?[n]:[]}return t._renderedChildren?[...Object.values(t._renderedChildren)].filter(e):[]}function Rx(t){var r;const e=t.memoizedProps||((r=t._currentElement)==null?void 0:r.props);if(!e||typeof e=="string")return e;const n={...e};return delete n.children,n}function Gg(t){var r;const e={key:Ox(t),name:Px(t),children:$x(t).map(Gg),rootElements:[],props:Rx(t)},n=t.stateNode||t._hostNode||((r=t._renderedComponent)==null?void 0:r._hostNode);if(n instanceof Element)e.rootElements.push(n);else for(const o of e.children)e.rootElements.push(...o.rootElements);return e}function Qg(t,e,n=[]){e(t)&&n.push(t);for(const r of t.children)Qg(r,e,n);return n}function Jg(t,e=[]){const r=(t.ownerDocument||t).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);do{const o=r.currentNode,l=o,c=Object.keys(l).find(d=>d.startsWith("__reactContainer")&&l[d]!==null);if(c)e.push(l[c].stateNode.current);else{const d="_reactRootContainer";l.hasOwnProperty(d)&&l[d]!==null&&e.push(l[d]._internalRoot.current)}if(o instanceof Element&&o.hasAttribute("data-reactroot"))for(const d of Object.keys(o))(d.startsWith("__reactInternalInstance")||d.startsWith("__reactFiber"))&&e.push(o[d]);const u=o instanceof Element?o.shadowRoot:null;u&&Jg(u,e)}while(r.nextNode());return e}const Dx=()=>({queryAll(t,e){const{name:n,attributes:r}=br(e,!1),c=Jg(t.ownerDocument||t).map(d=>Gg(d)).map(d=>Qg(d,p=>{const g=p.props??{};if(p.key!==void 0&&(g.key=p.key),n&&p.name!==n||p.rootElements.some(y=>!sa(t,y)))return!1;for(const y of r)if(!Vg(g,y))return!1;return!0})).flat(),u=new Set;for(const d of c)for(const p of d.rootElements)u.add(p);return[...u]}}),Xg=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];Xg.sort();function Ni(t,e,n){if(!e.includes(n))throw new Error(`"${t}" attribute is only supported for roles: ${e.slice().sort().map(r=>`"${r}"`).join(", ")}`)}function as(t,e){if(t.op!=="<truthy>"&&!e.includes(t.value))throw new Error(`"${t.name}" must be one of ${e.map(n=>JSON.stringify(n)).join(", ")}`)}function cs(t,e){if(!e.includes(t.op))throw new Error(`"${t.name}" does not support "${t.op}" matcher`)}function Fx(t,e){const n={role:e};for(const r of t)switch(r.name){case"checked":{Ni(r.name,sf,e),as(r,[!0,!1,"mixed"]),cs(r,["<truthy>","="]),n.checked=r.op==="<truthy>"?!0:r.value;break}case"pressed":{Ni(r.name,lf,e),as(r,[!0,!1,"mixed"]),cs(r,["<truthy>","="]),n.pressed=r.op==="<truthy>"?!0:r.value;break}case"selected":{Ni(r.name,rf,e),as(r,[!0,!1]),cs(r,["<truthy>","="]),n.selected=r.op==="<truthy>"?!0:r.value;break}case"expanded":{Ni(r.name,af,e),as(r,[!0,!1]),cs(r,["<truthy>","="]),n.expanded=r.op==="<truthy>"?!0:r.value;break}case"level":{if(Ni(r.name,cf,e),typeof r.value=="string"&&(r.value=+r.value),r.op!=="="||typeof r.value!="number"||Number.isNaN(r.value))throw new Error('"level" attribute must be compared to a number');n.level=r.value;break}case"disabled":{as(r,[!0,!1]),cs(r,["<truthy>","="]),n.disabled=r.op==="<truthy>"?!0:r.value;break}case"name":{if(r.op==="<truthy>")throw new Error('"name" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');n.name=r.value,n.nameOp=r.op,n.exact=r.caseSensitive;break}case"include-hidden":{as(r,[!0,!1]),cs(r,["<truthy>","="]),n.includeHidden=r.op==="<truthy>"?!0:r.value;break}default:throw new Error(`Unknown attribute "${r.name}", must be one of ${Xg.map(o=>`"${o}"`).join(", ")}.`)}return n}function Bx(t,e,n){const r=[],o=c=>{if(nt(c)===e.role&&!(e.selected!==void 0&&Mg(c)!==e.selected)&&!(e.checked!==void 0&&jg(c)!==e.checked)&&!(e.pressed!==void 0&&Pg(c)!==e.pressed)&&!(e.expanded!==void 0&&Og(c)!==e.expanded)&&!(e.level!==void 0&&$g(c)!==e.level)&&!(e.disabled!==void 0&&Wl(c)!==e.disabled)&&!(!e.includeHidden&&zt(c))){if(e.name!==void 0){const u=mt(Vi(c,!!e.includeHidden));if(typeof e.name=="string"&&(e.name=mt(e.name)),n&&!e.exact&&e.nameOp==="="&&(e.nameOp="*="),!Wg(u,{op:e.nameOp||"=",value:e.name,caseSensitive:!!e.exact}))return}r.push(c)}},l=c=>{const u=[];c.shadowRoot&&u.push(c.shadowRoot);for(const d of c.querySelectorAll("*"))o(d),d.shadowRoot&&u.push(d.shadowRoot);u.forEach(l)};return l(t),r}function cm(t){return{queryAll:(e,n)=>{const r=br(n,!0),o=r.name.toLowerCase();if(!o)throw new Error("Role must not be empty");const l=Fx(r.attributes,o);vf();try{return Bx(e,l,t)}finally{wf()}}}}class zx{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",qx),this._engines.set("is",Oi),this._engines.set("where",Oi),this._engines.set("has",Hx),this._engines.set("scope",Ux),this._engines.set("light",Vx),this._engines.set("visible",Wx),this._engines.set("text",Kx),this._engines.set("text-is",Gx),this._engines.set("text-matches",Qx),this._engines.set("has-text",Jx),this._engines.set("right-of",Ai("right-of")),this._engines.set("left-of",Ai("left-of")),this._engines.set("above",Ai("above")),this._engines.set("below",Ai("below")),this._engines.set("near",Ai("near")),this._engines.set("nth-match",Xx);const e=[...this._engines.keys()];e.sort();const n=[...rg];if(n.sort(),e.join("|")!==n.join("|"))throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${e.join("|")} vs ${n.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,n,r,o){e.has(n)||e.set(n,[]);const l=e.get(n),c=l.find(d=>r.every((p,g)=>d.rest[g]===p));if(c)return c.result;const u=o();return l.push({rest:r,result:u}),u}_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,n,r){const o=this._checkSelector(n);this.begin();try{return this._cached(this._cacheMatches,e,[o,r.scope,r.pierceShadow,r.originalScope],()=>Array.isArray(o)?this._matchesEngine(Oi,e,o,r):(this._hasScopeClause(o)&&(r=this._expandContextForScopeMatching(r)),this._matchesSimple(e,o.simples[o.simples.length-1].selector,r)?this._matchesParents(e,o,o.simples.length-2,r):!1))}finally{this.end()}}query(e,n){const r=this._checkSelector(n);this.begin();try{return this._cached(this._cacheQuery,r,[e.scope,e.pierceShadow,e.originalScope],()=>{if(Array.isArray(r))return this._queryEngine(Oi,e,r);this._hasScopeClause(r)&&(e=this._expandContextForScopeMatching(e));const o=this._scoreMap;this._scoreMap=new Map;let l=this._querySimple(e,r.simples[r.simples.length-1].selector);return l=l.filter(c=>this._matchesParents(c,r,r.simples.length-2,e)),this._scoreMap.size&&l.sort((c,u)=>{const d=this._scoreMap.get(c),p=this._scoreMap.get(u);return d===p?0:d===void 0?1:p===void 0?-1:d-p}),this._scoreMap=o,l})}finally{this.end()}}_markScore(e,n){this._scoreMap&&this._scoreMap.set(e,n)}_hasScopeClause(e){return e.simples.some(n=>n.selector.functions.some(r=>r.name==="scope"))}_expandContextForScopeMatching(e){if(e.scope.nodeType!==1)return e;const n=lt(e.scope);return n?{...e,scope:n,originalScope:e.originalScope||e.scope}:e}_matchesSimple(e,n,r){return this._cached(this._cacheMatchesSimple,e,[n,r.scope,r.pierceShadow,r.originalScope],()=>{if(e===r.scope||n.css&&!this._matchesCSS(e,n.css))return!1;for(const o of n.functions)if(!this._matchesEngine(this._getEngine(o.name),e,o.args,r))return!1;return!0})}_querySimple(e,n){return n.functions.length?this._cached(this._cacheQuerySimple,n,[e.scope,e.pierceShadow,e.originalScope],()=>{let r=n.css;const o=n.functions;r==="*"&&o.length&&(r=void 0);let l,c=-1;r!==void 0?l=this._queryCSS(e,r):(c=o.findIndex(u=>this._getEngine(u.name).query!==void 0),c===-1&&(c=0),l=this._queryEngine(this._getEngine(o[c].name),e,o[c].args));for(let u=0;u<o.length;u++){if(u===c)continue;const d=this._getEngine(o[u].name);d.matches!==void 0&&(l=l.filter(p=>this._matchesEngine(d,p,o[u].args,e)))}for(let u=0;u<o.length;u++){if(u===c)continue;const d=this._getEngine(o[u].name);d.matches===void 0&&(l=l.filter(p=>this._matchesEngine(d,p,o[u].args,e)))}return l}):this._queryCSS(e,n.css||"*")}_matchesParents(e,n,r,o){return r<0?!0:this._cached(this._cacheMatchesParents,e,[n,r,o.scope,o.pierceShadow,o.originalScope],()=>{const{selector:l,combinator:c}=n.simples[r];if(c===">"){const u=pl(e,o);return!u||!this._matchesSimple(u,l,o)?!1:this._matchesParents(u,n,r-1,o)}if(c==="+"){const u=wu(e,o);return!u||!this._matchesSimple(u,l,o)?!1:this._matchesParents(u,n,r-1,o)}if(c===""){let u=pl(e,o);for(;u;){if(this._matchesSimple(u,l,o)){if(this._matchesParents(u,n,r-1,o))return!0;if(n.simples[r-1].combinator==="")break}u=pl(u,o)}return!1}if(c==="~"){let u=wu(e,o);for(;u;){if(this._matchesSimple(u,l,o)){if(this._matchesParents(u,n,r-1,o))return!0;if(n.simples[r-1].combinator==="~")break}u=wu(u,o)}return!1}if(c===">="){let u=e;for(;u;){if(this._matchesSimple(u,l,o)){if(this._matchesParents(u,n,r-1,o))return!0;if(n.simples[r-1].combinator==="")break}u=pl(u,o)}return!1}throw new Error(`Unsupported combinator "${c}"`)})}_matchesEngine(e,n,r,o){if(e.matches)return this._callMatches(e,n,r,o);if(e.query)return this._callQuery(e,r,o).includes(n);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(e,n,r){if(e.query)return this._callQuery(e,r,n);if(e.matches)return this._queryCSS(n,"*").filter(o=>this._callMatches(e,o,r,n));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(e,n,r,o){return this._cached(this._cacheCallMatches,n,[e,o.scope,o.pierceShadow,o.originalScope,...r],()=>e.matches(n,r,o,this))}_callQuery(e,n,r){return this._cached(this._cacheCallQuery,e,[r.scope,r.pierceShadow,r.originalScope,...n],()=>e.query(r,n,this))}_matchesCSS(e,n){return e.matches(n)}_queryCSS(e,n){return this._cached(this._cacheQueryCSS,n,[e.scope,e.pierceShadow,e.originalScope],()=>{let r=[];function o(l){if(r=r.concat([...l.querySelectorAll(n)]),!!e.pierceShadow){l.shadowRoot&&o(l.shadowRoot);for(const c of l.querySelectorAll("*"))c.shadowRoot&&o(c.shadowRoot)}}return o(e.scope),r})}_getEngine(e){const n=this._engines.get(e);if(!n)throw new Error(`Unknown selector engine "${e}"`);return n}}const Oi={matches(t,e,n,r){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');return e.some(o=>r.matches(t,o,n))},query(t,e,n){if(e.length===0)throw new Error('"is" engine expects non-empty selector list');let r=[];for(const o of e)r=r.concat(n.query(t,o));return e.length===1?r:Yg(r)}},Hx={matches(t,e,n,r){if(e.length===0)throw new Error('"has" engine expects non-empty selector list');return r.query({...n,scope:t},e).length>0}},Ux={matches(t,e,n,r){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const o=n.originalScope||n.scope;return o.nodeType===9?t===o.documentElement:t===o},query(t,e,n){if(e.length!==0)throw new Error('"scope" engine expects no arguments');const r=t.originalScope||t.scope;if(r.nodeType===9){const o=r.documentElement;return o?[o]:[]}return r.nodeType===1?[r]:[]}},qx={matches(t,e,n,r){if(e.length===0)throw new Error('"not" engine expects non-empty selector list');return!r.matches(t,e,n)}},Vx={query(t,e,n){return n.query({...t,pierceShadow:!1},e)},matches(t,e,n,r){return r.matches(t,e,{...n,pierceShadow:!1})}},Wx={matches(t,e,n,r){if(e.length)throw new Error('"visible" engine expects no arguments');return Cr(t)}},Kx={matches(t,e,n,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"text" engine expects a single string');const o=mt(e[0]).toLowerCase(),l=c=>c.normalized.toLowerCase().includes(o);return ia(r._cacheText,t,l)==="self"}},Gx={matches(t,e,n,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"text-is" engine expects a single string');const o=mt(e[0]),l=c=>!o&&!c.immediate.length?!0:c.immediate.some(u=>mt(u)===o);return ia(r._cacheText,t,l)!=="none"}},Qx={matches(t,e,n,r){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 o=new RegExp(e[0],e.length===2?e[1]:void 0),l=c=>o.test(c.full);return ia(r._cacheText,t,l)==="self"}},Jx={matches(t,e,n,r){if(e.length!==1||typeof e[0]!="string")throw new Error('"has-text" engine expects a single string');if(_f(t))return!1;const o=mt(e[0]).toLowerCase();return(c=>c.normalized.toLowerCase().includes(o))(Tt(r._cacheText,t))}};function Ai(t){return{matches(e,n,r,o){const l=n.length&&typeof n[n.length-1]=="number"?n[n.length-1]:void 0,c=l===void 0?n:n.slice(0,n.length-1);if(n.length<1+(l===void 0?0:1))throw new Error(`"${t}" engine expects a selector list and optional maximum distance in pixels`);const u=o.query(r,c),d=qg(t,e,u,l);return d===void 0?!1:(o._markScore(e,d),!0)}}}const Xx={query(t,e,n){let r=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 r!="number"||r<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');const o=Oi.query(t,e.slice(0,e.length-1),n);return r--,r<o.length?[o[r]]:[]}};function pl(t,e){if(t!==e.scope)return e.pierceShadow?lt(t):t.parentElement||void 0}function wu(t,e){if(t!==e.scope)return t.previousElementSibling||void 0}function Yg(t){const e=new Map,n=[],r=[];function o(c){let u=e.get(c);if(u)return u;const d=lt(c);return d?o(d).children.push(c):n.push(c),u={children:[],taken:!1},e.set(c,u),u}for(const c of t)o(c).taken=!0;function l(c){const u=e.get(c);if(u.taken&&r.push(c),u.children.length>1){const d=new Set(u.children);u.children=[];let p=c.firstElementChild;for(;p&&u.children.length<d.size;)d.has(p)&&u.children.push(p),p=p.nextElementSibling;for(p=c.shadowRoot?c.shadowRoot.firstElementChild:null;p&&u.children.length<d.size;)d.has(p)&&u.children.push(p),p=p.nextElementSibling}u.children.forEach(l)}return n.forEach(l),r}const Zg=10,js=Zg/2,um=1,Yx=2,Zx=10,e_=50,ey=100,ty=120,ny=140,ry=160,Il=180,sy=200,fm=250,t_=ty+js,n_=ny+js,r_=ey+js,s_=ry+js,i_=Il+js,o_=sy+js,l_=300,a_=500,iy=510,Su=520,oy=530,ly=1e4,c_=1e7,u_=1e3;function dm(t,e,n){t._evaluator.begin();const r={allowText:new Map,disallowText:new Map};vf();try{let o=[];if(n.forTextExpect){let u=ml(t,e.ownerDocument.documentElement,n);for(let d=e;d;d=lt(d)){const p=us(r,t,d,{...n,noText:!0});if(!p)continue;if(Zn(p)<=u_){u=p;break}}o=[Ll(u)]}else{if(!e.matches("input,textarea,select")&&!e.isContentEditable){const u=Pi(e,"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]",n.root);u&&Cr(u)&&(e=u)}if(n.multiple){const u=us(r,t,e,n),d=us(r,t,e,{...n,noText:!0});let p=[u,d];if(r.allowText.clear(),r.disallowText.clear(),u&&xu(u)&&p.push(us(r,t,e,{...n,noCSSId:!0})),d&&xu(d)&&p.push(us(r,t,e,{...n,noText:!0,noCSSId:!0})),p=p.filter(Boolean),!p.length){const g=ml(t,e,n);p.push(g),xu(g)&&p.push(ml(t,e,{...n,noCSSId:!0}))}o=[...new Set(p.map(g=>Ll(g)))]}else{const u=us(r,t,e,n)||ml(t,e,n);o=[Ll(u)]}}const l=o[0],c=t.parseSelector(l);return{selector:l,selectors:o,elements:t.querySelectorAll(c,n.root??e.ownerDocument)}}finally{wf(),t._evaluator.end()}}function hm(t){return t.filter(e=>e[0].selector[0]!=="/")}function us(t,e,n,r){if(r.root&&!sa(r.root,n))throw new Error("Target element must belong to the root's subtree");if(n===r.root)return[{engine:"css",selector:":scope",score:1}];if(n.ownerDocument.documentElement===n)return[{engine:"css",selector:"html",score:1}];const o=(c,u)=>{const d=c===n;let p=u?d_(e,c,c===n):[];c!==n&&(p=hm(p));const g=f_(e,c,r).filter(S=>!r.omitInternalEngines||!S.engine.startsWith("internal:")).map(S=>[S]);let y=pm(e,r.root??n.ownerDocument,c,[...p,...g],d);p=hm(p);const v=S=>{const k=u&&!S.length,_=[...S,...g].filter(C=>y?Zn(C)<Zn(y):!0);let E=_[0];if(E)for(let C=lt(c);C&&C!==r.root;C=lt(C)){const A=l(C,k);if(!A||y&&Zn([...A,...E])>=Zn(y))continue;if(E=pm(e,C,c,_,d),!E)return;const B=[...A,...E];(!y||Zn(B)<Zn(y))&&(y=B)}};return v(p),c===n&&p.length&&v([]),y},l=(c,u)=>{const d=u?t.allowText:t.disallowText;let p=d.get(c);return p===void 0&&(p=o(c,u),d.set(c,p)),p};return o(n,!r.noText)}function f_(t,e,n){const r=[];{for(const c of["data-testid","data-test-id","data-test"])c!==n.testIdAttributeName&&e.getAttribute(c)&&r.push({engine:"css",selector:`[${c}=${ps(e.getAttribute(c))}]`,score:Yx});if(!n.noCSSId){const c=e.getAttribute("id");c&&!h_(c)&&r.push({engine:"css",selector:ay(c),score:a_})}r.push({engine:"css",selector:bn(e),score:oy})}if(e.nodeName==="IFRAME"){for(const c of["name","title"])e.getAttribute(c)&&r.push({engine:"css",selector:`${bn(e)}[${c}=${ps(e.getAttribute(c))}]`,score:Zx});return e.getAttribute(n.testIdAttributeName)&&r.push({engine:"css",selector:`[${n.testIdAttributeName}=${ps(e.getAttribute(n.testIdAttributeName))}]`,score:um}),Ru([r]),r}if(e.getAttribute(n.testIdAttributeName)&&r.push({engine:"internal:testid",selector:`[${n.testIdAttributeName}=${ht(e.getAttribute(n.testIdAttributeName),!0)}]`,score:um}),e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const c=e;if(c.placeholder){r.push({engine:"internal:attr",selector:`[placeholder=${ht(c.placeholder,!0)}]`,score:t_});for(const u of ys(c.placeholder))r.push({engine:"internal:attr",selector:`[placeholder=${ht(u.text,!1)}]`,score:ty-u.scoreBonus})}}const o=Kg(t._evaluator._cacheText,e);for(const c of o){const u=c.normalized;r.push({engine:"internal:label",selector:kt(u,!0),score:n_});for(const d of ys(u))r.push({engine:"internal:label",selector:kt(d.text,!1),score:ny-d.scoreBonus})}const l=nt(e);return l&&!["none","presentation"].includes(l)&&r.push({engine:"internal:role",selector:l,score:iy}),e.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(e.nodeName)&&r.push({engine:"css",selector:`${bn(e)}[name=${ps(e.getAttribute("name"))}]`,score:Su}),["INPUT","TEXTAREA"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&e.getAttribute("type")&&r.push({engine:"css",selector:`${bn(e)}[type=${ps(e.getAttribute("type"))}]`,score:Su}),["INPUT","TEXTAREA","SELECT"].includes(e.nodeName)&&e.getAttribute("type")!=="hidden"&&r.push({engine:"css",selector:bn(e),score:Su+1}),Ru([r]),r}function d_(t,e,n){if(e.nodeName==="SELECT")return[];const r=[],o=e.getAttribute("title");if(o){r.push([{engine:"internal:attr",selector:`[title=${ht(o,!0)}]`,score:o_}]);for(const p of ys(o))r.push([{engine:"internal:attr",selector:`[title=${ht(p.text,!1)}]`,score:sy-p.scoreBonus}])}const l=e.getAttribute("alt");if(l&&["APPLET","AREA","IMG","INPUT"].includes(e.nodeName)){r.push([{engine:"internal:attr",selector:`[alt=${ht(l,!0)}]`,score:s_}]);for(const p of ys(l))r.push([{engine:"internal:attr",selector:`[alt=${ht(p.text,!1)}]`,score:ry-p.scoreBonus}])}const c=Tt(t._evaluator._cacheText,e).normalized,u=c?ys(c):[];if(c){if(n){c.length<=80&&r.push([{engine:"internal:text",selector:kt(c,!0),score:i_}]);for(const g of u)r.push([{engine:"internal:text",selector:kt(g.text,!1),score:Il-g.scoreBonus}])}const p={engine:"css",selector:bn(e),score:oy};for(const g of u)r.push([p,{engine:"internal:has-text",selector:kt(g.text,!1),score:Il-g.scoreBonus}]);if(c.length<=80){const g=new RegExp("^"+zl(c)+"$");r.push([p,{engine:"internal:has-text",selector:kt(g,!1),score:fm}])}}const d=nt(e);if(d&&!["none","presentation"].includes(d)){const p=Vi(e,!1);if(p){const g={engine:"internal:role",selector:`${d}[name=${ht(p,!0)}]`,score:r_};r.push([g]);for(const y of ys(p))r.push([{engine:"internal:role",selector:`${d}[name=${ht(y.text,!1)}]`,score:ey-y.scoreBonus}])}else{const g={engine:"internal:role",selector:`${d}`,score:iy};for(const y of u)r.push([g,{engine:"internal:has-text",selector:kt(y.text,!1),score:Il-y.scoreBonus}]);if(c.length<=80){const y=new RegExp("^"+zl(c)+"$");r.push([g,{engine:"internal:has-text",selector:kt(y,!1),score:fm}])}}}return Ru(r),r}function ay(t){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(t)?"#"+t:`[id=${ps(t)}]`}function xu(t){return t.some(e=>e.engine==="css"&&(e.selector.startsWith("#")||e.selector.startsWith('[id="')))}function ml(t,e,n){const r=n.root??e.ownerDocument,o=[];function l(u){const d=o.slice();u&&d.unshift(u);const p=d.join(" > "),g=t.parseSelector(p);return t.querySelector(g,r,!1)===e?p:void 0}function c(u){const d={engine:"css",selector:u,score:c_},p=t.parseSelector(u),g=t.querySelectorAll(p,r);if(g.length===1)return[d];const y={engine:"nth",selector:String(g.indexOf(e)),score:ly};return[d,y]}for(let u=e;u&&u!==r;u=lt(u)){let d="";if(u.id&&!n.noCSSId){const y=ay(u.id),v=l(y);if(v)return c(v);d=y}const p=u.parentNode,g=[...u.classList].map(p_);for(let y=0;y<g.length;++y){const v="."+g.slice(0,y+1).join("."),S=l(v);if(S)return c(S);!d&&p&&p.querySelectorAll(v).length===1&&(d=v)}if(p){const y=[...p.children],v=u.nodeName,k=y.filter(E=>E.nodeName===v).indexOf(u)===0?bn(u):`${bn(u)}:nth-child(${1+y.indexOf(u)})`,_=l(k);if(_)return c(_);d||(d=k)}else d||(d=bn(u));o.unshift(d)}return c(l())}function Ru(t){for(const e of t)for(const n of e)n.score>e_&&n.score<l_&&(n.score+=Math.min(Zg,n.selector.length/10|0))}function Ll(t){const e=[];let n="";for(const{engine:r,selector:o}of t)e.length&&(n!=="css"||r!=="css"||o.startsWith(":nth-match("))&&e.push(">>"),n=r,r==="css"?e.push(o):e.push(`${r}=${o}`);return e.join(" ")}function Zn(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n].score*(t.length-n);return e}function pm(t,e,n,r,o){const l=r.map(u=>({tokens:u,score:Zn(u)}));l.sort((u,d)=>u.score-d.score);let c=null;for(const{tokens:u}of l){const d=t.parseSelector(Ll(u)),p=t.querySelectorAll(d,e);if(p[0]===n&&p.length===1)return u;const g=p.indexOf(n);if(!o||c||g===-1||p.length>5)continue;const y={engine:"nth",selector:String(g),score:ly};c=[...u,y]}return c}function h_(t){let e,n=0;for(let r=0;r<t.length;++r){const o=t[r];let l;if(!(o==="-"||o==="_")){if(o>="a"&&o<="z"?l="lower":o>="A"&&o<="Z"?l="upper":o>="0"&&o<="9"?l="digit":l="other",l==="lower"&&e==="upper"){e=l;continue}e&&e!==l&&++n,e=l}}return n>=t.length/4}function gl(t,e){if(t.length<=e)return t;t=t.substring(0,e);const n=t.match(/^(.*)\b(.+?)$/);return n?n[1].trimEnd():""}function ys(t){let e=[];{const n=t.match(/^([\d.,]+)[^.,\w]/),r=n?n[1].length:0;if(r){const o=gl(t.substring(r).trimStart(),80);e.push({text:o,scoreBonus:o.length<=30?2:1})}}{const n=t.match(/[^.,\w]([\d.,]+)$/),r=n?n[1].length:0;if(r){const o=gl(t.substring(0,t.length-r).trimEnd(),80);e.push({text:o,scoreBonus:o.length<=30?2:1})}}return t.length<=30?e.push({text:t,scoreBonus:0}):(e.push({text:gl(t,80),scoreBonus:0}),e.push({text:gl(t,30),scoreBonus:1})),e=e.filter(n=>n.text),e.length||e.push({text:t.substring(0,80),scoreBonus:0}),e}function bn(t){return t.nodeName.toLocaleLowerCase().replace(/[:\.]/g,e=>"\\"+e)}function p_(t){let e="";for(let n=0;n<t.length;n++)e+=m_(t,n);return e}function m_(t,e){const n=t.charCodeAt(e);return n===0?"�":n>=1&&n<=31||n>=48&&n<=57&&(e===0||e===1&&t.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":e===0&&n===45&&t.length===1?"\\"+t.charAt(e):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?t.charAt(e):"\\"+t.charAt(e)}function cy(t,e){const n=t.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/");let r=n.substring(n.lastIndexOf("/")+1);return r.endsWith(e)&&(r=r.substring(0,r.length-e.length)),r}function g_(t,e){return e?e.toUpperCase():""}const y_=/(?:^|[-_/])(\w)/g,uy=t=>t&&t.replace(y_,g_);function v_(t){function e(g){const y=g.name||g._componentTag||g.__playwright_guessedName;if(y)return y;const v=g.__file;if(v)return uy(cy(v,".vue"))}function n(g,y){return g.type.__playwright_guessedName=y,y}function r(g){var v,S,k,_;const y=e(g.type||{});if(y)return y;if(g.root===g)return"Root";for(const E in(S=(v=g.parent)==null?void 0:v.type)==null?void 0:S.components)if(((k=g.parent)==null?void 0:k.type.components[E])===g.type)return n(g,E);for(const E in(_=g.appContext)==null?void 0:_.components)if(g.appContext.components[E]===g.type)return n(g,E);return"Anonymous Component"}function o(g){return g._isBeingDestroyed||g.isUnmounted}function l(g){return g.subTree.type.toString()==="Symbol(Fragment)"}function c(g){const y=[];return g.component&&y.push(g.component),g.suspense&&y.push(...c(g.suspense.activeBranch)),Array.isArray(g.children)&&g.children.forEach(v=>{v.component?y.push(v.component):y.push(...c(v))}),y.filter(v=>{var S;return!o(v)&&!((S=v.type.devtools)!=null&&S.hide)})}function u(g){return l(g)?d(g.subTree):[g.subTree.el]}function d(g){if(!g.children)return[];const y=[];for(let v=0,S=g.children.length;v<S;v++){const k=g.children[v];k.component?y.push(...u(k.component)):k.el&&y.push(k.el)}return y}function p(g){return{name:r(g),children:c(g.subTree).map(p),rootElements:u(g),props:g.props}}return p(t)}function w_(t){function e(l){const c=l.displayName||l.name||l._componentTag;if(c)return c;const u=l.__file;if(u)return uy(cy(u,".vue"))}function n(l){const c=e(l.$options||l.fnOptions||{});return c||(l.$root===l?"Root":"Anonymous Component")}function r(l){return l.$children?l.$children:Array.isArray(l.subTree.children)?l.subTree.children.filter(c=>!!c.component).map(c=>c.component):[]}function o(l){return{name:n(l),children:r(l).map(o),rootElements:[l.$el],props:l._props}}return o(t)}function fy(t,e,n=[]){e(t)&&n.push(t);for(const r of t.children)fy(r,e,n);return n}function dy(t,e=[]){const r=(t.ownerDocument||t).createTreeWalker(t,NodeFilter.SHOW_ELEMENT),o=new Set;do{const l=r.currentNode;l.__vue__&&o.add(l.__vue__.$root),l.__vue_app__&&l._vnode&&l._vnode.component&&e.push({root:l._vnode.component,version:3});const c=l instanceof Element?l.shadowRoot:null;c&&dy(c,e)}while(r.nextNode());for(const l of o)e.push({version:2,root:l});return e}const S_=()=>({queryAll(t,e){const n=t.ownerDocument||t,{name:r,attributes:o}=br(e,!1),u=dy(n).map(p=>p.version===3?v_(p.root):w_(p.root)).map(p=>fy(p,g=>{if(r&&g.name!==r||g.rootElements.some(y=>!sa(t,y)))return!1;for(const y of o)if(!Vg(g.props,y))return!1;return!0})).flat(),d=new Set;for(const p of u)for(const g of p.rootElements)d.add(g);return[...d]}}),mm={queryAll(t,e){e.startsWith("/")&&t.nodeType!==Node.DOCUMENT_NODE&&(e="."+e);const n=[],r=t.ownerDocument||t;if(!r)return n;const o=r.evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let l=o.iterateNext();l;l=o.iterateNext())l.nodeType===Node.ELEMENT_NODE&&n.push(l);return n}};function Ef(t,e,n){return`internal:attr=[${t}=${ht(e,(n==null?void 0:n.exact)||!1)}]`}function x_(t,e){return`internal:testid=[${t}=${ht(e,!0)}]`}function __(t,e){return"internal:label="+kt(t,!!(e!=null&&e.exact))}function E_(t,e){return Ef("alt",t,e)}function k_(t,e){return Ef("title",t,e)}function b_(t,e){return Ef("placeholder",t,e)}function T_(t,e){return"internal:text="+kt(t,!!(e!=null&&e.exact))}function C_(t,e={}){const n=[];return e.checked!==void 0&&n.push(["checked",String(e.checked)]),e.disabled!==void 0&&n.push(["disabled",String(e.disabled)]),e.selected!==void 0&&n.push(["selected",String(e.selected)]),e.expanded!==void 0&&n.push(["expanded",String(e.expanded)]),e.includeHidden!==void 0&&n.push(["include-hidden",String(e.includeHidden)]),e.level!==void 0&&n.push(["level",String(e.level)]),e.name!==void 0&&n.push(["name",ht(e.name,!!e.exact)]),e.pressed!==void 0&&n.push(["pressed",String(e.pressed)]),`internal:role=${t}${n.map(([r,o])=>`[${r}=${o}]`).join("")}`}const Ii=Symbol("selector"),N_=class $i{constructor(e,n,r){if(r!=null&&r.hasText&&(n+=` >> internal:has-text=${kt(r.hasText,!1)}`),r!=null&&r.hasNotText&&(n+=` >> internal:has-not-text=${kt(r.hasNotText,!1)}`),r!=null&&r.has&&(n+=" >> internal:has="+JSON.stringify(r.has[Ii])),r!=null&&r.hasNot&&(n+=" >> internal:has-not="+JSON.stringify(r.hasNot[Ii])),(r==null?void 0:r.visible)!==void 0&&(n+=` >> visible=${r.visible?"true":"false"}`),this[Ii]=n,n){const c=e.parseSelector(n);this.element=e.querySelector(c,e.document,!1),this.elements=e.querySelectorAll(c,e.document)}const o=n,l=this;l.locator=(c,u)=>new $i(e,o?o+" >> "+c:c,u),l.getByTestId=c=>l.locator(x_(e.testIdAttributeNameForStrictErrorAndConsoleCodegen(),c)),l.getByAltText=(c,u)=>l.locator(E_(c,u)),l.getByLabel=(c,u)=>l.locator(__(c,u)),l.getByPlaceholder=(c,u)=>l.locator(b_(c,u)),l.getByText=(c,u)=>l.locator(T_(c,u)),l.getByTitle=(c,u)=>l.locator(k_(c,u)),l.getByRole=(c,u={})=>l.locator(C_(c,u)),l.filter=c=>new $i(e,n,c),l.first=()=>l.locator("nth=0"),l.last=()=>l.locator("nth=-1"),l.nth=c=>l.locator(`nth=${c}`),l.and=c=>new $i(e,o+" >> internal:and="+JSON.stringify(c[Ii])),l.or=c=>new $i(e,o+" >> internal:or="+JSON.stringify(c[Ii]))}};let A_=N_;class I_{constructor(e){this._injectedScript=e}install(){this._injectedScript.window.playwright||(this._injectedScript.window.playwright={$:(e,n)=>this._querySelector(e,!!n),$$:e=>this._querySelectorAll(e),inspect:e=>this._inspect(e),selector:e=>this._selector(e),generateLocator:(e,n)=>this._generateLocator(e,n),ariaSnapshot:(e,n)=>this._injectedScript.ariaSnapshot(e||this._injectedScript.document.body,n),resume:()=>this._resume(),...new A_(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,n){if(typeof e!="string")throw new Error("Usage: playwright.query('Playwright >> selector').");const r=this._injectedScript.parseSelector(e);return this._injectedScript.querySelector(r,this._injectedScript.document,n)}_querySelectorAll(e){if(typeof e!="string")throw new Error("Usage: playwright.$$('Playwright >> selector').");const n=this._injectedScript.parseSelector(e);return this._injectedScript.querySelectorAll(n,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,n){if(!(e instanceof Element))throw new Error("Usage: playwright.locator(element).");const r=this._injectedScript.generateSelectorSimple(e);return Tr(n||"javascript",r)}_resume(){this._injectedScript.window.__pw_resume().catch(()=>{})}}function L_(t){try{return t instanceof RegExp||Object.prototype.toString.call(t)==="[object RegExp]"}catch{return!1}}function M_(t){try{return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}catch{return!1}}function j_(t){try{return t instanceof URL||Object.prototype.toString.call(t)==="[object URL]"}catch{return!1}}function P_(t){var e;try{return t instanceof Error||t&&((e=Object.getPrototypeOf(t))==null?void 0:e.name)==="Error"}catch{return!1}}function O_(t,e){try{return t instanceof e||Object.prototype.toString.call(t)===`[object ${e.name}]`}catch{return!1}}const hy={i8:Int8Array,ui8:Uint8Array,ui8c:Uint8ClampedArray,i16:Int16Array,ui16:Uint16Array,i32:Int32Array,ui32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:BigInt64Array,bui64:BigUint64Array};function $_(t){if("toBase64"in t)return t.toBase64();const e=Array.from(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).map(n=>String.fromCharCode(n)).join("");return btoa(e)}function R_(t,e){const n=atob(t),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new e(r.buffer)}function Du(t,e=[],n=new Map){if(!Object.is(t,void 0)){if(typeof t=="object"&&t){if("ref"in t)return n.get(t.ref);if("v"in t)return t.v==="undefined"?void 0:t.v==="null"?null:t.v==="NaN"?NaN:t.v==="Infinity"?1/0:t.v==="-Infinity"?-1/0:t.v==="-0"?-0:void 0;if("d"in t)return new Date(t.d);if("u"in t)return new URL(t.u);if("bi"in t)return BigInt(t.bi);if("e"in t){const r=new Error(t.e.m);return r.name=t.e.n,r.stack=t.e.s,r}if("r"in t)return new RegExp(t.r.p,t.r.f);if("a"in t){const r=[];n.set(t.id,r);for(const o of t.a)r.push(Du(o,e,n));return r}if("o"in t){const r={};n.set(t.id,r);for(const{k:o,v:l}of t.o)o!=="__proto__"&&(r[o]=Du(l,e,n));return r}if("h"in t)return e[t.h];if("ta"in t)return R_(t.ta.b,hy[t.ta.k])}return t}}function D_(t,e){return Fu(t,e,{visited:new Map,lastId:0})}function Fu(t,e,n){if(t&&typeof t=="object"){if(typeof globalThis.Window=="function"&&t instanceof globalThis.Window)return"ref: <Window>";if(typeof globalThis.Document=="function"&&t instanceof globalThis.Document)return"ref: <Document>";if(typeof globalThis.Node=="function"&&t instanceof globalThis.Node)return"ref: <Node>"}return py(t,e,n)}function py(t,e,n){var l;const r=e(t);if("fallThrough"in r)t=r.fallThrough;else return r;if(typeof t=="symbol")return{v:"undefined"};if(Object.is(t,void 0))return{v:"undefined"};if(Object.is(t,null))return{v:"null"};if(Object.is(t,NaN))return{v:"NaN"};if(Object.is(t,1/0))return{v:"Infinity"};if(Object.is(t,-1/0))return{v:"-Infinity"};if(Object.is(t,-0))return{v:"-0"};if(typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t;if(typeof t=="bigint")return{bi:t.toString()};if(P_(t)){let c;return(l=t.stack)!=null&&l.startsWith(t.name+": "+t.message)?c=t.stack:c=`${t.name}: ${t.message}
|
|
106
106
|
${t.stack}`,{e:{n:t.name,m:t.message,s:c}}}if(M_(t))return{d:t.toJSON()};if(j_(t))return{u:t.toJSON()};if(L_(t))return{r:{p:t.source,f:t.flags}};for(const[c,u]of Object.entries(hy))if(O_(t,u))return{ta:{b:$_(t),k:c}};const o=n.visited.get(t);if(o)return{ref:o};if(Array.isArray(t)){const c=[],u=++n.lastId;n.visited.set(t,u);for(let d=0;d<t.length;++d)c.push(Fu(t[d],e,n));return{a:c,id:u}}if(typeof t=="object"){const c=[],u=++n.lastId;n.visited.set(t,u);for(const p of Object.keys(t)){let g;try{g=t[p]}catch{continue}p==="toJSON"&&typeof g=="function"?c.push({k:p,v:{o:[],id:0}}):c.push({k:p,v:Fu(g,e,n)})}let d;try{c.length===0&&t.toJSON&&typeof t.toJSON=="function"&&(d={value:t.toJSON()})}catch{}return d?py(d.value,e,n):{o:c,id:u}}}class F_{constructor(e,n){var r,o,l,c,u,d,p,g;this.global=e,this.isUnderTest=n,e.__pwClock?this.builtins=e.__pwClock.builtins:this.builtins={setTimeout:(r=e.setTimeout)==null?void 0:r.bind(e),clearTimeout:(o=e.clearTimeout)==null?void 0:o.bind(e),setInterval:(l=e.setInterval)==null?void 0:l.bind(e),clearInterval:(c=e.clearInterval)==null?void 0:c.bind(e),requestAnimationFrame:(u=e.requestAnimationFrame)==null?void 0:u.bind(e),cancelAnimationFrame:(d=e.cancelAnimationFrame)==null?void 0:d.bind(e),requestIdleCallback:(p=e.requestIdleCallback)==null?void 0:p.bind(e),cancelIdleCallback:(g=e.cancelIdleCallback)==null?void 0:g.bind(e),performance:e.performance,Intl:e.Intl,Date:e.Date},this.isUnderTest&&(e.builtins=this.builtins)}evaluate(e,n,r,o,...l){const c=l.slice(0,o),u=l.slice(o),d=[];for(let g=0;g<c.length;g++)d[g]=Du(c[g],u);let p=this.global.eval(r);return e===!0?p=p(...d):e===!1?p=p:typeof p=="function"&&(p=p(...d)),n?this._promiseAwareJsonValueNoThrow(p):p}jsonValue(e,n){if(n!==void 0)return D_(n,r=>({fallThrough:r}))}_promiseAwareJsonValueNoThrow(e){const n=r=>{try{return this.jsonValue(!0,r)}catch{return}};return e&&typeof e=="object"&&typeof e.then=="function"?(async()=>{const r=await e;return n(r)})():n(e)}}class my{constructor(e,n){this._testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid",this.utils={asLocator:Tr,cacheNormalizedWhitespaces:l1,elementText:Tt,getAriaRole:nt,getElementAccessibleDescription:rm,getElementAccessibleName:Vi,isElementVisible:Cr,isInsideScope:sa,normalizeWhiteSpace:mt,parseAriaSnapshot:nf,builtins:null},this.window=e,this.document=e.document,this.isUnderTest=n.isUnderTest,this.utils.builtins=new F_(e,n.isUnderTest).builtins,this._sdkLanguage=n.sdkLanguage,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=n.testIdAttributeName,this._evaluator=new zx,this.consoleApi=new I_(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",mm),this._engines.set("xpath:light",mm),this._engines.set("_react",Dx()),this._engines.set("_vue",S_()),this._engines.set("role",cm(!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",cm(!0)),this._engines.set("internal:describe",this._createDescribeEngine()),this._engines.set("aria-ref",this._createAriaRefEngine());for(const{name:r,source:o}of n.customEngines)this._engines.set(r,this.eval(o));this._stableRafCount=n.stableRafCount,this._browserName=n.browserName,JS({browserNameForWorkarounds:n.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 n=Ji(e);return i1(n,r=>{if(!this._engines.has(r.name))throw this.createStacklessError(`Unknown engine "${r.name}" while parsing selector ${e}`)}),n}generateSelector(e,n){return dm(this,e,n)}generateSelectorSimple(e,n){return dm(this,e,{...n,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(e,n,r){const o=this.querySelectorAll(e,n);if(r&&o.length>1)throw this.strictModeViolationError(e,o);return o[0]}_queryNth(e,n){const r=[...e];let o=+n.body;return o===-1&&(o=r.length-1),new Set(r.slice(o,o+1))}_queryLayoutSelector(e,n,r){const o=n.name,l=n.body,c=[],u=this.querySelectorAll(l.parsed,r);for(const d of e){const p=qg(o,d,u,l.distance);p!==void 0&&c.push({element:d,score:p})}return c.sort((d,p)=>d.score-p.score),new Set(c.map(d=>d.element))}ariaSnapshot(e,n){if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");return this._lastAriaSnapshot=Kl(e,n),Gl(this._lastAriaSnapshot,n)}ariaSnapshotForRecorder(){const e=Kl(this.document.body,{forAI:!0});return{ariaSnapshot:Gl(e,{forAI:!0}),refs:e.refs}}getAllByAria(e,n){return kx(e.documentElement,n)}querySelectorAll(e,n){if(e.capture!==void 0){if(e.parts.some(o=>o.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");const r={parts:e.parts.slice(0,e.capture+1)};if(e.capture<e.parts.length-1){const o={parts:e.parts.slice(e.capture+1)},l={name:"internal:has",body:{parsed:o},source:Tn(o)};r.parts.push(l)}return this.querySelectorAll(r,n)}if(!n.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(n.nodeType===11&&e.parts.length===1&&e.parts[0].name==="css"&&e.parts[0].source===":scope")return[n];this._evaluator.begin();try{let r=new Set([n]);for(const o of e.parts)if(o.name==="nth")r=this._queryNth(r,o);else if(o.name==="internal:and"){const l=this.querySelectorAll(o.body.parsed,n);r=new Set(l.filter(c=>r.has(c)))}else if(o.name==="internal:or"){const l=this.querySelectorAll(o.body.parsed,n);r=new Set(Yg(new Set([...r,...l])))}else if(jx.includes(o.name))r=this._queryLayoutSelector(r,o,n);else{const l=new Set;for(const c of r){const u=this._queryEngineAll(o,c);for(const d of u)l.add(d)}r=l}return[...r]}finally{this._evaluator.end()}}_queryEngineAll(e,n){const r=this._engines.get(e.name).queryAll(n,e.body);for(const o of r)if(!("nodeName"in o))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(o)}`);return r}_createAttributeEngine(e,n){const r=o=>[{simples:[{selector:{css:`[${e}=${JSON.stringify(o)}]`,functions:[]},combinator:""}]}];return{queryAll:(o,l)=>this._evaluator.query({scope:o,pierceShadow:n},r(l))}}_createCSSEngine(){return{queryAll:(e,n)=>this._evaluator.query({scope:e,pierceShadow:!0},n)}}_createTextEngine(e,n){return{queryAll:(o,l)=>{const{matcher:c,kind:u}=vl(l,n),d=[];let p=null;const g=v=>{if(u==="lax"&&p&&p.contains(v))return!1;const S=ia(this._evaluator._cacheText,v,c);S==="none"&&(p=v),(S==="self"||S==="selfAndChildren"&&u==="strict"&&!n)&&d.push(v)};o.nodeType===Node.ELEMENT_NODE&&g(o);const y=this._evaluator._queryCSS({scope:o,pierceShadow:e},"*");for(const v of y)g(v);return d}}}_createInternalHasTextEngine(){return{queryAll:(e,n)=>{if(e.nodeType!==1)return[];const r=e,o=Tt(this._evaluator._cacheText,r),{matcher:l}=vl(n,!0);return l(o)?[r]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(e,n)=>{if(e.nodeType!==1)return[];const r=e,o=Tt(this._evaluator._cacheText,r),{matcher:l}=vl(n,!0);return l(o)?[]:[r]}}}_createInternalLabelEngine(){return{queryAll:(e,n)=>{const{matcher:r}=vl(n,!0);return this._evaluator._queryCSS({scope:e,pierceShadow:!0},"*").filter(l=>Kg(this._evaluator._cacheText,l).some(c=>r(c)))}}}_createNamedAttributeEngine(){return{queryAll:(n,r)=>{const o=br(r,!0);if(o.name||o.attributes.length!==1)throw new Error("Malformed attribute selector: "+r);const{name:l,value:c,caseSensitive:u}=o.attributes[0],d=u?null:c.toLowerCase();let p;return c instanceof RegExp?p=y=>!!y.match(c):u?p=y=>y===c:p=y=>y.toLowerCase().includes(d),this._evaluator._queryCSS({scope:n,pierceShadow:!0},`[${l}]`).filter(y=>p(y.getAttribute(l)))}}}_createDescribeEngine(){return{queryAll:n=>n.nodeType!==1?[]:[n]}}_createControlEngine(){return{queryAll(e,n){if(n==="enter-frame")return[];if(n==="return-empty")return[];if(n==="component")return e.nodeType!==1?[]:[e.childElementCount===1?e.firstElementChild:e];throw new Error(`Internal error, unknown internal:control selector ${n}`)}}}_createHasEngine(){return{queryAll:(n,r)=>n.nodeType!==1?[]:!!this.querySelector(r.parsed,n,!1)?[n]:[]}}_createHasNotEngine(){return{queryAll:(n,r)=>n.nodeType!==1?[]:!!this.querySelector(r.parsed,n,!1)?[]:[n]}}_createVisibleEngine(){return{queryAll:(n,r)=>{if(n.nodeType!==1)return[];const o=r==="true";return Cr(n)===o?[n]:[]}}}_createInternalChainEngine(){return{queryAll:(n,r)=>this.querySelectorAll(r.parsed,n)}}extend(e,n){const r=this.window.eval(`
|
|
107
107
|
(() => {
|
|
108
108
|
const module = {};
|
|
@@ -111,7 +111,7 @@ ${t.stack}`,{e:{n:t.name,m:t.message,s:c}}}if(M_(t))return{d:t.toJSON()};if(j_(t
|
|
|
111
111
|
})()`);return new r(this,n)}async viewportRatio(e){return await new Promise(n=>{const r=new IntersectionObserver(o=>{n(o[0].intersectionRatio),r.disconnect()});r.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 n=e.ownerDocument.defaultView.getComputedStyle(e);return{left:parseInt(n.borderLeftWidth||"",10),top:parseInt(n.borderTopWidth||"",10)}}describeIFrameStyle(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return"error:notconnected";const n=e.ownerDocument.defaultView;for(let o=e;o;o=lt(o))if(n.getComputedStyle(o).transform!=="none")return"transformed";const r=n.getComputedStyle(e);return{left:parseInt(r.borderLeftWidth||"",10)+parseInt(r.paddingLeft||"",10),top:parseInt(r.borderTopWidth||"",10)+parseInt(r.paddingTop||"",10)}}retarget(e,n){let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(!r)return null;if(n==="none")return r;if(!r.matches("input, textarea, select")&&!r.isContentEditable&&(n==="button-link"?r=r.closest("button, [role=button], a, [role=link]")||r:r=r.closest("button, [role=button], [role=checkbox], [role=radio]")||r),n==="follow-label"&&!r.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!r.isContentEditable){const o=r.closest("label");o&&o.control&&(r=o.control)}return r}async checkElementStates(e,n){if(n.includes("stable")){const r=await this._checkElementIsStable(e);if(r===!1)return{missingState:"stable"};if(r==="error:notconnected")return"error:notconnected"}for(const r of n)if(r!=="stable"){const o=this.elementState(e,r);if(o.received==="error:notconnected")return"error:notconnected";if(!o.matches)return{missingState:r}}}async _checkElementIsStable(e){const n=Symbol("continuePolling");let r,o=0,l=0;const c=()=>{const y=this.retarget(e,"no-follow-label");if(!y)return"error:notconnected";const v=this.utils.builtins.performance.now();if(this._stableRafCount>1&&v-l<15)return n;l=v;const S=y.getBoundingClientRect(),k={x:S.top,y:S.left,width:S.width,height:S.height};if(r){if(!(k.x===r.x&&k.y===r.y&&k.width===r.width&&k.height===r.height))return!1;if(++o>=this._stableRafCount)return!0}return r=k,n};let u,d;const p=new Promise((y,v)=>{u=y,d=v}),g=()=>{try{const y=c();y!==n?u(y):this.utils.builtins.requestAnimationFrame(g)}catch(y){d(y)}};return this.utils.builtins.requestAnimationFrame(g),p}_createAriaRefEngine(){return{queryAll:(n,r)=>{var l,c;const o=(c=(l=this._lastAriaSnapshot)==null?void 0:l.elements)==null?void 0:c.get(r);return o&&o.isConnected?[o]:[]}}}elementState(e,n){const r=this.retarget(e,["visible","hidden"].includes(n)?"none":"follow-label");if(!r||!r.isConnected)return n==="hidden"?{matches:!0,received:"hidden"}:{matches:!1,received:"error:notconnected"};if(n==="visible"||n==="hidden"){const o=Cr(r);return{matches:n==="visible"?o:!o,received:o?"visible":"hidden"}}if(n==="disabled"||n==="enabled"){const o=Wl(r);return{matches:n==="disabled"?o:!o,received:o?"disabled":"enabled"}}if(n==="editable"){const o=Wl(r),l=fx(r);if(l==="error")throw this.createStacklessError("Element is not an <input>, <textarea>, <select> or [contenteditable] and does not have a role allowing [aria-readonly]");return{matches:!o&&!l,received:o?"disabled":l?"readOnly":"editable"}}if(n==="checked"||n==="unchecked"){const o=n==="checked",l=cx(r);if(l==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:o===l,received:l?"checked":"unchecked"}}if(n==="indeterminate"){const o=ax(r);if(o==="error")throw this.createStacklessError("Not a checkbox or radio button");return{matches:o==="mixed",received:o===!0?"checked":o===!1?"unchecked":"mixed"}}throw this.createStacklessError(`Unexpected element state "${n}"`)}selectOptions(e,n){const r=this.retarget(e,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a <select> element");const o=r,l=[...o.options],c=[];let u=n.slice();for(let d=0;d<l.length;d++){const p=l[d],g=y=>{if(y instanceof Node)return p===y;let v=!0;return y.valueOrLabel!==void 0&&(v=v&&(y.valueOrLabel===p.value||y.valueOrLabel===p.label)),y.value!==void 0&&(v=v&&y.value===p.value),y.label!==void 0&&(v=v&&y.label===p.label),y.index!==void 0&&(v=v&&y.index===d),v};if(u.some(g)){if(!this.elementState(p,"enabled").matches)return"error:optionnotenabled";if(c.push(p),o.multiple)u=u.filter(y=>!g(y));else{u=[];break}}}return u.length?"error:optionsnotfound":(o.value=void 0,c.forEach(d=>d.selected=!0),o.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),o.dispatchEvent(new Event("change",{bubbles:!0})),c.map(d=>d.value))}fill(e,n){const r=this.retarget(e,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()==="input"){const o=r,l=o.type.toLowerCase(),c=new Set(["color","date","time","datetime-local","month","range","week"]);if(!new Set(["","email","number","password","search","tel","text","url"]).has(l)&&!c.has(l))throw this.createStacklessError(`Input of type "${l}" cannot be filled`);if(l==="number"&&(n=n.trim(),isNaN(Number(n))))throw this.createStacklessError("Cannot type text into input[type=number]");if(c.has(l)){if(n=n.trim(),o.focus(),o.value=n,o.value!==n)throw this.createStacklessError("Malformed value");return r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0})),"done"}}else if(r.nodeName.toLowerCase()!=="textarea"){if(!r.isContentEditable)throw this.createStacklessError("Element is not an <input>, <textarea> or [contenteditable] element")}return this.selectText(r),"needsinput"}selectText(e){const n=this.retarget(e,"follow-label");if(!n)return"error:notconnected";if(n.nodeName.toLowerCase()==="input"){const l=n;return l.select(),l.focus(),"done"}if(n.nodeName.toLowerCase()==="textarea"){const l=n;return l.selectionStart=0,l.selectionEnd=l.value.length,l.focus(),"done"}const r=n.ownerDocument.createRange();r.selectNodeContents(n);const o=n.ownerDocument.defaultView.getSelection();return o&&(o.removeAllRanges(),o.addRange(r)),n.focus(),"done"}_activelyFocused(e){const n=e.getRootNode().activeElement,r=n===e&&!!e.ownerDocument&&e.ownerDocument.hasFocus();return{activeElement:n,isFocused:r}}focusNode(e,n){if(!e.isConnected)return"error:notconnected";if(e.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Node is not an element");const{activeElement:r,isFocused:o}=this._activelyFocused(e);if(e.isContentEditable&&!o&&r&&r.blur&&r.blur(),e.focus(),e.focus(),n&&!o&&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,n){if(e.nodeType!==Node.ELEMENT_NODE)return"Node is not of type HTMLElement";const r=e;if(r.nodeName!=="INPUT")return"Not an <input> element";const o=r;if((o.getAttribute("type")||"").toLowerCase()!=="file")return"Not an input[type=file] element";const c=n.map(d=>{const p=Uint8Array.from(atob(d.buffer),g=>g.charCodeAt(0));return new File([p],d.name,{type:d.mimeType,lastModified:d.lastModifiedMs})}),u=new DataTransfer;for(const d of c)u.items.add(d);o.files=u.files,o.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}))}expectHitTarget(e,n){const r=[];let o=n;for(;o;){const g=xg(o);if(!g||(r.push(g),g.nodeType===9))break;o=g.host}let l;for(let g=r.length-1;g>=0;g--){const y=r[g],v=y.elementsFromPoint(e.x,e.y),S=y.elementFromPoint(e.x,e.y);if(S&&v[0]&<(S)===v[0]){const _=this.window.getComputedStyle(S);(_==null?void 0:_.display)==="contents"&&v.unshift(S)}v[0]&&v[0].shadowRoot===y&&v[1]===S&&v.shift();const k=v[0];if(!k||(l=k,g&&k!==r[g-1].host))break}const c=[];for(;l&&l!==n;)c.push(l),l=lt(l);if(l===n)return"done";const u=this.previewNode(c[0]||this.document.documentElement);let d,p=n;for(;p;){const g=c.indexOf(p);if(g!==-1){g>1&&(d=this.previewNode(c[g-1]));break}p=lt(p)}return d?{hitTargetDescription:`${u} from ${d} subtree`}:{hitTargetDescription:u}}setupHitTargetInterceptor(e,n,r,o){const l=this.retarget(e,"button-link");if(!l||!l.isConnected)return"error:notconnected";if(r){const g=this.expectHitTarget(r,l);if(g!=="done")return g.hitTargetDescription}if(n==="drag")return{stop:()=>"done"};const c={hover:this._hoverHitTargetInterceptorEvents,tap:this._tapHitTargetInterceptorEvents,mouse:this._mouseHitTargetInterceptorEvents}[n];let u;const d=g=>{if(!c.has(g.type)||!g.isTrusted)return;const y=this.window.TouchEvent&&g instanceof this.window.TouchEvent?g.touches[0]:g;u===void 0&&y&&(u=this.expectHitTarget({x:y.clientX,y:y.clientY},l)),(o||u!=="done"&&u!==void 0)&&(g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation())},p=()=>(this._hitTargetInterceptor===d&&(this._hitTargetInterceptor=void 0),u||"done");return this._hitTargetInterceptor=d,{stop:p}}dispatchEvent(e,n,r){var c,u,d;let o;const l={bubbles:!0,cancelable:!0,composed:!0,...r};switch(this._eventTypes.get(n)){case"mouse":o=new MouseEvent(n,l);break;case"keyboard":o=new KeyboardEvent(n,l);break;case"touch":{if(this._browserName==="webkit"){const p=y=>{var k,_;if(y instanceof Touch)return y;let v=y.pageX;v===void 0&&y.clientX!==void 0&&(v=y.clientX+(((k=this.document.scrollingElement)==null?void 0:k.scrollLeft)||0));let S=y.pageY;return S===void 0&&y.clientY!==void 0&&(S=y.clientY+(((_=this.document.scrollingElement)==null?void 0:_.scrollTop)||0)),this.document.createTouch(this.window,y.target??e,y.identifier,v,S,y.screenX,y.screenY,y.radiusX,y.radiusY,y.rotationAngle,y.force)},g=y=>y instanceof TouchList||!y?y:this.document.createTouchList(...y.map(p));l.target??(l.target=e),l.touches=g(l.touches),l.targetTouches=g(l.targetTouches),l.changedTouches=g(l.changedTouches),o=new TouchEvent(n,l)}else l.target??(l.target=e),l.touches=(c=l.touches)==null?void 0:c.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l.targetTouches=(u=l.targetTouches)==null?void 0:u.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),l.changedTouches=(d=l.changedTouches)==null?void 0:d.map(p=>p instanceof Touch?p:new Touch({...p,target:p.target??e})),o=new TouchEvent(n,l);break}case"pointer":o=new PointerEvent(n,l);break;case"focus":o=new FocusEvent(n,l);break;case"drag":o=new DragEvent(n,l);break;case"wheel":o=new WheelEvent(n,l);break;case"deviceorientation":try{o=new DeviceOrientationEvent(n,l)}catch{const{bubbles:p,cancelable:g,alpha:y,beta:v,gamma:S,absolute:k}=l;o=this.document.createEvent("DeviceOrientationEvent"),o.initDeviceOrientationEvent(n,p,g,y,v,S,k)}break;case"devicemotion":try{o=new DeviceMotionEvent(n,l)}catch{const{bubbles:p,cancelable:g,acceleration:y,accelerationIncludingGravity:v,rotationRate:S,interval:k}=l;o=this.document.createEvent("DeviceMotionEvent"),o.initDeviceMotionEvent(n,p,g,y,v,S,k)}break;default:o=new Event(n,l);break}e.dispatchEvent(o)}previewNode(e){if(e.nodeType===Node.TEXT_NODE)return yl(`#text=${e.nodeValue||""}`);if(e.nodeType!==Node.ELEMENT_NODE)return yl(`<${e.nodeName.toLowerCase()} />`);const n=e,r=[];for(let d=0;d<n.attributes.length;d++){const{name:p,value:g}=n.attributes[d];p!=="style"&&(!g&&this._booleanAttributes.has(p)?r.push(` ${p}`):r.push(` ${p}="${g}"`))}r.sort((d,p)=>d.length-p.length);const o=Bp(r.join(""),500);if(this._autoClosingTags.has(n.nodeName))return yl(`<${n.nodeName.toLowerCase()}${o}/>`);const l=n.childNodes;let c=!1;if(l.length<=5){c=!0;for(let d=0;d<l.length;d++)c=c&&l[d].nodeType===Node.TEXT_NODE}const u=c?n.textContent||"":l.length?"…":"";return yl(`<${n.nodeName.toLowerCase()}${o}>${Bp(u,50)}</${n.nodeName.toLowerCase()}>`)}strictModeViolationError(e,n){const r=n.slice(0,10).map(l=>({preview:this.previewNode(l),selector:this.generateSelectorSimple(l)})),o=r.map((l,c)=>`
|
|
112
112
|
${c+1}) ${l.preview} aka ${Tr(this._sdkLanguage,l.selector)}`);return r.length<n.length&&o.push(`
|
|
113
113
|
...`),this.createStacklessError(`strict mode violation: ${Tr(this._sdkLanguage,Tn(e))} resolved to ${n.length} elements:${o.join("")}
|
|
114
|
-
`)}createStacklessError(e){if(this._browserName==="firefox"){const r=new Error("Error: "+e);return r.stack="",r}const n=new Error(e);return delete n.stack,n}createHighlight(){return new vu(this)}maskSelectors(e,n){this._highlight&&this.hideHighlight(),this._highlight=new vu(this),this._highlight.install();const r=[];for(const o of e)r.push(this.querySelectorAll(o,this.document.documentElement));this._highlight.maskElements(r.flat(),n)}highlight(e){this._highlight||(this._highlight=new vu(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,n){var c,u;((c=this._markedElements)==null?void 0:c.callId)!==n&&(this._markedElements=void 0);const r=((u=this._markedElements)==null?void 0:u.elements)||new Set,o=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of r)e.has(d)||d.dispatchEvent(o);const l=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of e)r.has(d)||d.dispatchEvent(l);this._markedElements={callId:n,elements:e}}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let n=!1;const r=()=>n=!0;this.window.addEventListener(e,r),new MutationObserver(o=>{if(o.some(c=>Array.from(c.addedNodes).includes(this.document.documentElement))&&(n=!1,this.window.dispatchEvent(new CustomEvent(e)),!n)){this.window.addEventListener(e,r);for(const c of this.onGlobalListenersRemoved)c()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=r=>{var o;return(o=this._hitTargetInterceptor)==null?void 0:o.call(this,r)},n=()=>{for(const r of this._allHitTargetInterceptorEvents)this.window.addEventListener(r,e,{capture:!0,passive:!1})};n(),this.onGlobalListenersRemoved.add(n)}async expect(e,n,r){var l,c;if(n.expression==="to.have.count"||n.expression.endsWith(".array"))return this.expectArray(r,n);if(!e){if(!n.isNot&&n.expression==="to.be.hidden")return{matches:!0};if(n.isNot&&n.expression==="to.be.visible")return{matches:!1};if(!n.isNot&&n.expression==="to.be.detached")return{matches:!0};if(n.isNot&&n.expression==="to.be.attached")return{matches:!1};if(n.isNot&&n.expression==="to.be.in.viewport")return{matches:!1};if(n.expression==="to.have.title"&&((l=n==null?void 0:n.expectedText)!=null&&l[0])){const u=new fs(n.expectedText[0]),d=this.document.title;return{received:d,matches:u.matches(d)}}if(n.expression==="to.have.url"&&((c=n==null?void 0:n.expectedText)!=null&&c[0])){const u=new fs(n.expectedText[0]),d=this.document.location.href;return{received:d,matches:u.matches(d)}}return{matches:n.isNot,missingReceived:!0}}return await this.expectSingleElement(e,n)}async expectSingleElement(e,n){var o;const r=n.expression;{let l;if(r==="to.have.attribute"){const c=e.hasAttribute(n.expressionArg);l={matches:c,received:c?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){const{checked:c,indeterminate:u}=n.expectedValue;if(u){if(c!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");l=this.elementState(e,"indeterminate")}else l=this.elementState(e,c===!1?"unchecked":"checked")}else if(r==="to.be.disabled")l=this.elementState(e,"disabled");else if(r==="to.be.editable")l=this.elementState(e,"editable");else if(r==="to.be.readonly")l=this.elementState(e,"editable"),l.matches=!l.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const c=e.value;l={matches:!c,received:c?"notEmpty":"empty"}}else{const c=(o=e.textContent)==null?void 0:o.trim();l={matches:!c,received:c?"notEmpty":"empty"}}else if(r==="to.be.enabled")l=this.elementState(e,"enabled");else if(r==="to.be.focused"){const c=this._activelyFocused(e).isFocused;l={matches:c,received:c?"focused":"inactive"}}else r==="to.be.hidden"?l=this.elementState(e,"hidden"):r==="to.be.visible"?l=this.elementState(e,"visible"):r==="to.be.attached"?l={matches:!0,received:"attached"}:r==="to.be.detached"&&(l={matches:!1,received:"attached"});if(l){if(l.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return l}}if(r==="to.have.property"){let l=e;const c=n.expressionArg.split(".");for(let p=0;p<c.length-1;p++){if(typeof l!="object"||!(c[p]in l))return{received:void 0,matches:!1};l=l[c[p]]}const u=l[c[c.length-1]],d=Bu(u,n.expectedValue);return{received:u,matches:d}}if(r==="to.be.in.viewport"){const l=await this.viewportRatio(e);return{received:`viewport ratio ${l}`,matches:l>0&&l>(n.expectedNumber??0)-1e-9}}if(r==="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 l=[...e.selectedOptions].map(c=>c.value);return l.length!==n.expectedText.length?{received:l,matches:!1}:{received:l,matches:l.map((c,u)=>new fs(n.expectedText[u]).matches(c)).every(Boolean)}}if(r==="to.match.aria"){const l=Ex(e,n.expectedValue);return{received:l.received,matches:!!l.matches.length}}{let l;if(r==="to.have.attribute.value"){const c=e.getAttribute(n.expressionArg);if(c===null)return{received:null,matches:!1};l=c}else if(["to.have.class","to.contain.class"].includes(r)){if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new fs(n.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")l=this.window.getComputedStyle(e).getPropertyValue(n.expressionArg);else if(r==="to.have.id")l=e.id;else if(r==="to.have.text")l=n.useInnerText?e.innerText:Tt(new Map,e).full;else if(r==="to.have.accessible.name")l=Vi(e,!1);else if(r==="to.have.accessible.description")l=rm(e,!1);else if(r==="to.have.accessible.error.message")l=ox(e);else if(r==="to.have.role")l=nt(e)||"";else if(r==="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");l=e.value}if(l!==void 0&&n.expectedText){const c=new fs(n.expectedText[0]);return{received:l,matches:c.matches(l)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,n){const r=n.expression;if(r==="to.have.count"){const d=e.length,p=d===n.expectedNumber;return{received:d,matches:p}}if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);if(["to.have.class.array","to.contain.class.array"].includes(r)){const d=e.map(y=>y.classList),p=d.map(String);if(d.length!==n.expectedText.length)return{received:p,matches:!1};const g=this._matchSequentially(n.expectedText,d,(y,v)=>y.matchesClassList(this,v,r==="to.contain.class.array"));return{received:p,matches:g}}if(!["to.contain.text.array","to.have.text.array"].includes(r))throw this.createStacklessError("Unknown expect matcher: "+r);const o=e.map(d=>n.useInnerText?d.innerText:Tt(new Map,d).full),l=r!=="to.contain.text.array";if(!(o.length===n.expectedText.length||!l))return{received:o,matches:!1};const u=this._matchSequentially(n.expectedText,o,(d,p)=>d.matches(p));return{received:o,matches:u}}_matchSequentially(e,n,r){const o=e.map(u=>new fs(u));let l=0,c=0;for(;l<o.length&&c<n.length;)r(o[l],n[c])&&++l,++c;return l===o.length}}function yl(t){return t.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function B_(t){if(t=t.substring(1,t.length-1),!t.includes("\\"))return t;const e=[];let n=0;for(;n<t.length;)t[n]==="\\"&&n+1<t.length&&n++,e.push(t[n++]);return e.join("")}function vl(t,e){if(t[0]==="/"&&t.lastIndexOf("/")>0){const o=t.lastIndexOf("/"),l=new RegExp(t.substring(1,o),t.substring(o+1));return{matcher:c=>l.test(c.full),kind:"regex"}}const n=e?JSON.parse.bind(JSON):B_;let r=!1;return t.length>1&&t[0]==='"'&&t[t.length-1]==='"'?(t=n(t),r=!0):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="i"?(t=n(t.substring(0,t.length-1)),r=!1):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="s"?(t=n(t.substring(0,t.length-1)),r=!0):t.length>1&&t[0]==="'"&&t[t.length-1]==="'"&&(t=n(t),r=!0),t=mt(t),r?e?{kind:"strict",matcher:l=>l.normalized===t}:{matcher:l=>!t&&!l.immediate.length?!0:l.immediate.some(c=>mt(c)===t),kind:"strict"}:(t=t.toLowerCase(),{kind:"lax",matcher:o=>o.normalized.toLowerCase().includes(t)})}class fs{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 n=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&n.delete("i"),e.ignoreCase===!0&&n.add("i"),this._regex=new RegExp(e.regexSource,[...n].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,n,r){if(r){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(o=>n.contains(o))}return this.matches(n.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=mt(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function Bu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!Bu(t[r],e[r]))return!1;return!0}if(t instanceof RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r=0;r<n.length;++r)if(!e.hasOwnProperty(n[r]))return!1;for(const r of n)if(!Bu(t[r],e[r]))return!1;return!0}return typeof t=="number"&&typeof e=="number"?isNaN(t)&&isNaN(e):!1}const z_={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-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"}}]}]}]},Ht={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class gm{cursor(){return"default"}}class _u{constructor(e,n){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=n}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var n;Ue(e),e.button===0&&(n=this._hoveredModel)!=null&&n.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){Ue(e)}onPointerUp(e){Ue(e)}onMouseDown(e){Ue(e)}onMouseUp(e){Ue(e)}onMouseMove(e){var o;Ue(e);let n=this._recorder.deepEventTarget(e);if(n.isConnected||(n=null),this._hoveredElement===n)return;this._hoveredElement=n;let r=null;if(this._hoveredElement){const l=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});r={selector:l.selector,elements:l.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,l.selector),color:this._assertVisibility?Ht.assert:Ht.single}}((o=this._hoveredModel)==null?void 0:o.selector)!==(r==null?void 0:r.selector)&&(this._hoveredModel=r,this._recorder.updateHighlight(r,!0))}onMouseEnter(e){Ue(e)}onMouseLeave(e){Ue(e);const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){Ue(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){Ue(e)}onScroll(e){this._reset(!1)}_commit(e,n){var r;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(r=this._recorder.overlay)==null||r.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,n)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class H_{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set}cursor(){return"pointer"}install(){this._observer=new MutationObserver(e=>{if(this._hoveredElement)for(const n of e)for(const r of n.removedNodes)(r===this._hoveredElement||r.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}onClick(e){if(Es(this._hoveredElement)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===1){this._performAction({name:n.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){Es(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(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){this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:"right",modifiers:0,clickCount:0})}onPointerDown(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){const n=this._recorder.deepEventTarget(e);this._hoveredElement!==n&&(this._hoveredElement=n,this._updateModelForHoveredElement())}onMouseLeave(e){const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._onFocus(!0)}onInput(e){const n=this._recorder.deepEventTarget(e);if(n.nodeName==="INPUT"&&n.type.toLowerCase()==="file"){this._recorder.recordAction({name:"setInputFiles",selector:this._activeModel.selector,signals:[],files:[...n.files||[]].map(r=>r.name)});return}if(Es(n)){this._recorder.recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recorder.recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:n.isContentEditable?n.innerText:n.value})}if(n.nodeName==="SELECT"){const r=n;if(this._actionInProgress(e))return;this._performAction({name:"select",selector:this._activeModel.selector,options:[...r.selectedOptions].map(o=>o.value),signals:[]})}}onKeyDown(e){if(this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===0){this._performAction({name:n.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:_s(e)})}}}onKeyUp(e){if(this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){Ue(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._resetHoveredModel()}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const n=K_(this._recorder.document);if(e&&n===this._recorder.document.body)return;const r=n?this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=r&&r.selector?{...r,color:Ht.action}:null,e&&(this._hoveredElement=n,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.type))}_actionInProgress(e){const n=e instanceof KeyboardEvent,r=e instanceof MouseEvent||e instanceof PointerEvent;for(const o of this._performingActions)if(n&&o.name==="press"&&e.key===o.key||r&&(o.name==="click"||o.name==="check"||o.name==="uncheck"))return!0;return Ue(e),!1}_consumedDueToNoModel(e,n){return n?!1:(Ue(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(Ue(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||Ue(e)}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e);const n=this._recorder.performAction(e).then(()=>{this._performingActions.delete(e),this._onFocus(!1)});this._recorder.injectedScript.isUnderTest&&n.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 n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!!Hi(this._recorder.deepEventTarget(e)):!0}_updateModelForHoveredElement(){if(this._performingActions.size)return;if(!this._hoveredElement||!this._hoveredElement.isConnected){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!0);return}const{selector:e,elements:n}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:n,color:Ht.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class U_{constructor(e){this._recorder=e}cursor(){return"pointer"}onClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const r=Hi(n),{ariaSnapshot:o,selector:l}=this._ariaSnapshot(n);if(r&&e.detail===1){this._recorder.recordAction({name:r.checked?"check":"uncheck",selector:l,signals:[],ariaSnapshot:o});return}this._recorder.recordAction({name:"click",selector:l,ariaSnapshot:o,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onDblClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||this._shouldIgnoreMouseEvent(e))return;const{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);this._recorder.recordAction({name:"click",selector:o,ariaSnapshot:r,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onInput(e){const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(Es(n)){this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.isContentEditable?n.innerText:n.value});return}if(n.nodeName==="SELECT"){const l=n;this._recorder.recordAction({name:"select",selector:o,ariaSnapshot:r,options:[...l.selectedOptions].map(c=>c.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(e.key===" "){const l=Hi(n);if(l&&e.detail===0){this._recorder.recordAction({name:l.checked?"uncheck":"check",selector:o,ariaSnapshot:r,signals:[]});return}}this._recorder.recordAction({name:"press",selector:o,ariaSnapshot:r,signals:[],key:e.key,modifiers:_s(e)})}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.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 n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:n,refs:r}=this._recorder.injectedScript.ariaSnapshotForRecorder(),o=e?r.get(e):void 0,l=o?`aria-ref=${o}`:void 0;return{ariaSnapshot:n,selector:l}}}class Eu{constructor(e,n){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=n,this._dialog=new W_(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){Ue(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const n=this._recorder.deepEventTarget(e);this._elementHasValue(n)&&e.preventDefault()}onPointerUp(e){var r;const n=(r=this._hoverHighlight)==null?void 0:r.elements[0];this._kind==="value"&&n&&(n.nodeName==="INPUT"||n.nodeName==="SELECT")&&n.disabled&&this._commitAssertValue()}onMouseMove(e){var r;if(this._dialog.isShowing())return;const n=this._recorder.deepEventTarget(e);if(((r=this._hoverHighlight)==null?void 0:r.elements[0])!==n){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,n).full?{elements:[n],selector:"",color:Ht.assert}:null;else if(this._elementHasValue(n)){const o=this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:o.selector,elements:o.elements,color:Ht.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),Ue(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 n;this._textCache.clear();const e=(n=this._hoverHighlight)==null?void 0:n.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:r}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:r,signals:[],checked:!e.checked}:{name:"assertValue",selector:r,signals:[],value:e.value}}else if(this._kind==="snapshot"){const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"regex"})}}else{const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.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,n,r,o;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((n=this._action)==null?void 0:n.name)==="assertText"?this._showTextDialog(this._action):((r=this._action)==null?void 0:r.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(o=this._recorder.overlay)==null||o.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const n=this._recorder.document.createElement("textarea");n.setAttribute("spellcheck","false"),n.value=this._renderValue(e),n.classList.add("text-editor");const r=()=>{var y;const u=this._recorder.injectedScript.utils.normalizeWhiteSpace(n.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=u;const p=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,g=u&&p.includes(u);n.classList.toggle("does-not-match",!g)};n.addEventListener("input",r);const l=this._dialog.show({label:"Assert that element contains text",body:n,onCommit:()=>this._commit()}),c=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),l);this._dialog.moveTo(c.anchorTop,c.anchorLeft),n.focus()}_commitAssertValue(){var n;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(n=this._recorder.overlay)==null||n.flashToolSucceeded("assertingValue"))}}class q_{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const n=this._recorder.document;this._overlayElement=n.createElement("x-pw-overlay");const r=n.createElement("x-pw-tools-list");this._overlayElement.appendChild(r),this._dragHandle=n.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(n.createElement("x-div")),r.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")),r.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")),r.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")),r.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")),r.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")),r.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")),r.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){gy(this._listeners),this._listeners=[Le(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),Le(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")}),Le(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])}),Le(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),Le(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),Le(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),Le(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){this._recordToggle.classList.toggle("toggled",e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting"),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 n;e==="assertingVisibility"?n=this._assertVisibilityToggle:e==="assertingSnapshot"?n=this._assertSnapshotToggle:n=this._assertValuesToggle,n.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>n.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 n=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-n,Math.min(n,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),Ue(e),!0}return!1}onMouseUp(e){return this._dragState?(Ue(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,Ue(e),!0):!1}onDblClick(e){return!1}}class V_{constructor(e,n){var r,o;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 gm,standby:new gm,inspecting:new _u(this,!1),recording:(n==null?void 0:n.recorderMode)==="api"?new U_(this):new H_(this),"recording-inspecting":new _u(this,!1),assertingText:new Eu(this,"text"),assertingVisibility:new _u(this,!0),assertingValue:new Eu(this,"value"),assertingSnapshot:new Eu(this,"snapshot")},this._currentTool=this._tools.none,(o=(r=this._currentTool).install)==null||o.call(r),e.window.top===e.window&&(this.overlay=new q_(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
|
|
114
|
+
`)}createStacklessError(e){if(this._browserName==="firefox"){const r=new Error("Error: "+e);return r.stack="",r}const n=new Error(e);return delete n.stack,n}createHighlight(){return new vu(this)}maskSelectors(e,n){this._highlight&&this.hideHighlight(),this._highlight=new vu(this),this._highlight.install();const r=[];for(const o of e)r.push(this.querySelectorAll(o,this.document.documentElement));this._highlight.maskElements(r.flat(),n)}highlight(e){this._highlight||(this._highlight=new vu(this),this._highlight.install()),this._highlight.runHighlightOnRaf(e)}hideHighlight(){this._highlight&&(this._highlight.uninstall(),delete this._highlight)}markTargetElements(e,n){var c,u;((c=this._markedElements)==null?void 0:c.callId)!==n&&(this._markedElements=void 0);const r=((u=this._markedElements)==null?void 0:u.elements)||new Set,o=new CustomEvent("__playwright_unmark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of r)e.has(d)||d.dispatchEvent(o);const l=new CustomEvent("__playwright_mark_target__",{bubbles:!0,cancelable:!0,detail:n,composed:!0});for(const d of e)r.has(d)||d.dispatchEvent(l);this._markedElements={callId:n,elements:e}}_setupGlobalListenersRemovalDetection(){const e="__playwright_global_listeners_check__";let n=!1;const r=()=>n=!0;this.window.addEventListener(e,r),new MutationObserver(o=>{if(o.some(c=>Array.from(c.addedNodes).includes(this.document.documentElement))&&(n=!1,this.window.dispatchEvent(new CustomEvent(e)),!n)){this.window.addEventListener(e,r);for(const c of this.onGlobalListenersRemoved)c()}}).observe(this.document,{childList:!0})}_setupHitTargetInterceptors(){const e=r=>{var o;return(o=this._hitTargetInterceptor)==null?void 0:o.call(this,r)},n=()=>{for(const r of this._allHitTargetInterceptorEvents)this.window.addEventListener(r,e,{capture:!0,passive:!1})};n(),this.onGlobalListenersRemoved.add(n)}async expect(e,n,r){var l,c;if(n.expression==="to.have.count"||n.expression.endsWith(".array"))return this.expectArray(r,n);if(!e){if(!n.isNot&&n.expression==="to.be.hidden")return{matches:!0};if(n.isNot&&n.expression==="to.be.visible")return{matches:!1};if(!n.isNot&&n.expression==="to.be.detached")return{matches:!0};if(n.isNot&&n.expression==="to.be.attached")return{matches:!1};if(n.isNot&&n.expression==="to.be.in.viewport")return{matches:!1};if(n.expression==="to.have.title"&&((l=n==null?void 0:n.expectedText)!=null&&l[0])){const u=new fs(n.expectedText[0]),d=this.document.title;return{received:d,matches:u.matches(d)}}if(n.expression==="to.have.url"&&((c=n==null?void 0:n.expectedText)!=null&&c[0])){const u=new fs(n.expectedText[0]),d=this.document.location.href;return{received:d,matches:u.matches(d)}}return{matches:n.isNot,missingReceived:!0}}return await this.expectSingleElement(e,n)}async expectSingleElement(e,n){var o;const r=n.expression;{let l;if(r==="to.have.attribute"){const c=e.hasAttribute(n.expressionArg);l={matches:c,received:c?"attribute present":"attribute not present"}}else if(r==="to.be.checked"){const{checked:c,indeterminate:u}=n.expectedValue;if(u){if(c!==void 0)throw this.createStacklessError("Can't assert indeterminate and checked at the same time");l=this.elementState(e,"indeterminate")}else l=this.elementState(e,c===!1?"unchecked":"checked")}else if(r==="to.be.disabled")l=this.elementState(e,"disabled");else if(r==="to.be.editable")l=this.elementState(e,"editable");else if(r==="to.be.readonly")l=this.elementState(e,"editable"),l.matches=!l.matches;else if(r==="to.be.empty")if(e.nodeName==="INPUT"||e.nodeName==="TEXTAREA"){const c=e.value;l={matches:!c,received:c?"notEmpty":"empty"}}else{const c=(o=e.textContent)==null?void 0:o.trim();l={matches:!c,received:c?"notEmpty":"empty"}}else if(r==="to.be.enabled")l=this.elementState(e,"enabled");else if(r==="to.be.focused"){const c=this._activelyFocused(e).isFocused;l={matches:c,received:c?"focused":"inactive"}}else r==="to.be.hidden"?l=this.elementState(e,"hidden"):r==="to.be.visible"?l=this.elementState(e,"visible"):r==="to.be.attached"?l={matches:!0,received:"attached"}:r==="to.be.detached"&&(l={matches:!1,received:"attached"});if(l){if(l.received==="error:notconnected")throw this.createStacklessError("Element is not connected");return l}}if(r==="to.have.property"){let l=e;const c=n.expressionArg.split(".");for(let p=0;p<c.length-1;p++){if(typeof l!="object"||!(c[p]in l))return{received:void 0,matches:!1};l=l[c[p]]}const u=l[c[c.length-1]],d=Bu(u,n.expectedValue);return{received:u,matches:d}}if(r==="to.be.in.viewport"){const l=await this.viewportRatio(e);return{received:`viewport ratio ${l}`,matches:l>0&&l>(n.expectedNumber??0)-1e-9}}if(r==="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 l=[...e.selectedOptions].map(c=>c.value);return l.length!==n.expectedText.length?{received:l,matches:!1}:{received:l,matches:l.map((c,u)=>new fs(n.expectedText[u]).matches(c)).every(Boolean)}}if(r==="to.match.aria"){const l=Ex(e,n.expectedValue);return{received:l.received,matches:!!l.matches.length}}{let l;if(r==="to.have.attribute.value"){const c=e.getAttribute(n.expressionArg);if(c===null)return{received:null,matches:!1};l=c}else if(["to.have.class","to.contain.class"].includes(r)){if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);return{received:e.classList.toString(),matches:new fs(n.expectedText[0]).matchesClassList(this,e.classList,r==="to.contain.class")}}else if(r==="to.have.css")l=this.window.getComputedStyle(e).getPropertyValue(n.expressionArg);else if(r==="to.have.id")l=e.id;else if(r==="to.have.text")l=n.useInnerText?e.innerText:Tt(new Map,e).full;else if(r==="to.have.accessible.name")l=Vi(e,!1);else if(r==="to.have.accessible.description")l=rm(e,!1);else if(r==="to.have.accessible.error.message")l=ox(e);else if(r==="to.have.role")l=nt(e)||"";else if(r==="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");l=e.value}if(l!==void 0&&n.expectedText){const c=new fs(n.expectedText[0]);return{received:l,matches:c.matches(l)}}}throw this.createStacklessError("Unknown expect matcher: "+r)}expectArray(e,n){const r=n.expression;if(r==="to.have.count"){const d=e.length,p=d===n.expectedNumber;return{received:d,matches:p}}if(!n.expectedText)throw this.createStacklessError("Expected text is not provided for "+r);if(["to.have.class.array","to.contain.class.array"].includes(r)){const d=e.map(y=>y.classList),p=d.map(String);if(d.length!==n.expectedText.length)return{received:p,matches:!1};const g=this._matchSequentially(n.expectedText,d,(y,v)=>y.matchesClassList(this,v,r==="to.contain.class.array"));return{received:p,matches:g}}if(!["to.contain.text.array","to.have.text.array"].includes(r))throw this.createStacklessError("Unknown expect matcher: "+r);const o=e.map(d=>n.useInnerText?d.innerText:Tt(new Map,d).full),l=r!=="to.contain.text.array";if(!(o.length===n.expectedText.length||!l))return{received:o,matches:!1};const u=this._matchSequentially(n.expectedText,o,(d,p)=>d.matches(p));return{received:o,matches:u}}_matchSequentially(e,n,r){const o=e.map(u=>new fs(u));let l=0,c=0;for(;l<o.length&&c<n.length;)r(o[l],n[c])&&++l,++c;return l===o.length}}function yl(t){return t.replace(/\n/g,"↵").replace(/\t/g,"⇆")}function B_(t){if(t=t.substring(1,t.length-1),!t.includes("\\"))return t;const e=[];let n=0;for(;n<t.length;)t[n]==="\\"&&n+1<t.length&&n++,e.push(t[n++]);return e.join("")}function vl(t,e){if(t[0]==="/"&&t.lastIndexOf("/")>0){const o=t.lastIndexOf("/"),l=new RegExp(t.substring(1,o),t.substring(o+1));return{matcher:c=>l.test(c.full),kind:"regex"}}const n=e?JSON.parse.bind(JSON):B_;let r=!1;return t.length>1&&t[0]==='"'&&t[t.length-1]==='"'?(t=n(t),r=!0):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="i"?(t=n(t.substring(0,t.length-1)),r=!1):e&&t.length>1&&t[0]==='"'&&t[t.length-2]==='"'&&t[t.length-1]==="s"?(t=n(t.substring(0,t.length-1)),r=!0):t.length>1&&t[0]==="'"&&t[t.length-1]==="'"&&(t=n(t),r=!0),t=mt(t),r?e?{kind:"strict",matcher:l=>l.normalized===t}:{matcher:l=>!t&&!l.immediate.length?!0:l.immediate.some(c=>mt(c)===t),kind:"strict"}:(t=t.toLowerCase(),{kind:"lax",matcher:o=>o.normalized.toLowerCase().includes(t)})}class fs{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 n=new Set((e.regexFlags||"").split(""));e.ignoreCase===!1&&n.delete("i"),e.ignoreCase===!0&&n.add("i"),this._regex=new RegExp(e.regexSource,[...n].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,n,r){if(r){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(o=>n.contains(o))}return this.matches(n.toString())}normalize(e){return e&&(this._normalizeWhiteSpace&&(e=mt(e)),this._ignoreCase&&(e=e.toLocaleLowerCase()),e)}}function Bu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!Bu(t[r],e[r]))return!1;return!0}if(t instanceof RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r=0;r<n.length;++r)if(!e.hasOwnProperty(n[r]))return!1;for(const r of n)if(!Bu(t[r],e[r]))return!1;return!0}return typeof t=="number"&&typeof e=="number"?isNaN(t)&&isNaN(e):!1}const z_={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-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"}}]}]}]},Ht={multiple:"#f6b26b7f",single:"#6fa8dc7f",assert:"#8acae480",action:"#dc6f6f7f"};class gm{cursor(){return"default"}}class _u{constructor(e,n){this._hoveredModel=null,this._hoveredElement=null,this._recorder=e,this._assertVisibility=n}cursor(){return"pointer"}uninstall(){this._hoveredModel=null,this._hoveredElement=null}onClick(e){var n;Ue(e),e.button===0&&(n=this._hoveredModel)!=null&&n.selector&&this._commit(this._hoveredModel.selector,this._hoveredModel)}onPointerDown(e){Ue(e)}onPointerUp(e){Ue(e)}onMouseDown(e){Ue(e)}onMouseUp(e){Ue(e)}onMouseMove(e){var o;Ue(e);let n=this._recorder.deepEventTarget(e);if(n.isConnected||(n=null),this._hoveredElement===n)return;this._hoveredElement=n;let r=null;if(this._hoveredElement){const l=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName,multiple:!1});r={selector:l.selector,elements:l.elements,tooltipText:this._recorder.injectedScript.utils.asLocator(this._recorder.state.language,l.selector),color:this._assertVisibility?Ht.assert:Ht.single}}((o=this._hoveredModel)==null?void 0:o.selector)!==(r==null?void 0:r.selector)&&(this._hoveredModel=r,this._recorder.updateHighlight(r,!0))}onMouseEnter(e){Ue(e)}onMouseLeave(e){Ue(e);const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&this._reset(!0)}onKeyDown(e){Ue(e),e.key==="Escape"&&this._assertVisibility&&this._recorder.setMode("recording")}onKeyUp(e){Ue(e)}onScroll(e){this._reset(!1)}_commit(e,n){var r;this._assertVisibility?(this._recorder.recordAction({name:"assertVisible",selector:e,signals:[]}),this._recorder.setMode("recording"),(r=this._recorder.overlay)==null||r.flashToolSucceeded("assertingVisibility")):this._recorder.elementPicked(e,n)}_reset(e){this._hoveredElement=null,this._hoveredModel=null,this._recorder.updateHighlight(null,e)}}class H_{constructor(e){this._hoveredModel=null,this._hoveredElement=null,this._activeModel=null,this._expectProgrammaticKeyUp=!1,this._observer=null,this._recorder=e,this._performingActions=new Set}cursor(){return"pointer"}_installObserverIfNeeded(){var e;this._observer||(e=this._recorder.injectedScript.document)!=null&&e.body&&(this._observer=new MutationObserver(n=>{if(this._hoveredElement)for(const r of n)for(const o of r.removedNodes)(o===this._hoveredElement||o.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}onClick(e){if(Es(this._hoveredElement)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel))return;const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===1){this._performAction({name:n.checked?"check":"uncheck",selector:this._hoveredModel.selector,signals:[]});return}this._cancelPendingClickAction(),e.detail===1&&(this._pendingClickAction={action:{name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail},timeout:this._recorder.injectedScript.utils.builtins.setTimeout(()=>this._commitPendingClickAction(),200)})}onDblClick(e){Es(this._hoveredElement)||this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||(this._cancelPendingClickAction(),this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:Ql(e),modifiers:_s(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){this._shouldIgnoreMouseEvent(e)||this._actionInProgress(e)||this._consumedDueToNoModel(e,this._hoveredModel)||this._performAction({name:"click",selector:this._hoveredModel.selector,position:zi(e),signals:[],button:"right",modifiers:0,clickCount:0})}onPointerDown(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onPointerUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseDown(e){this._shouldIgnoreMouseEvent(e)||(this._consumeWhenAboutToPerform(e),this._activeModel=this._hoveredModel)}onMouseUp(e){this._shouldIgnoreMouseEvent(e)||this._consumeWhenAboutToPerform(e)}onMouseMove(e){const n=this._recorder.deepEventTarget(e);this._hoveredElement!==n&&(this._hoveredElement=n,this._updateModelForHoveredElement())}onMouseLeave(e){const n=this._recorder.injectedScript.window;n.top!==n&&this._recorder.deepEventTarget(e).nodeType===Node.DOCUMENT_NODE&&(this._hoveredElement=null,this._updateModelForHoveredElement())}onFocus(e){this._onFocus(!0)}onInput(e){const n=this._recorder.deepEventTarget(e);if(n.nodeName==="INPUT"&&n.type.toLowerCase()==="file"){this._recorder.recordAction({name:"setInputFiles",selector:this._activeModel.selector,signals:[],files:[...n.files||[]].map(r=>r.name)});return}if(Es(n)){this._recorder.recordAction({name:"fill",selector:this._hoveredModel.selector,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase())||this._consumedDueWrongTarget(e))return;this._recorder.recordAction({name:"fill",selector:this._activeModel.selector,signals:[],text:n.isContentEditable?n.innerText:n.value})}if(n.nodeName==="SELECT"){const r=n;if(this._actionInProgress(e))return;this._performAction({name:"select",selector:this._activeModel.selector,options:[...r.selectedOptions].map(o=>o.value),signals:[]})}}onKeyDown(e){if(this._shouldGenerateKeyPressFor(e)){if(this._actionInProgress(e)){this._expectProgrammaticKeyUp=!0;return}if(!this._consumedDueWrongTarget(e)){if(e.key===" "){const n=Hi(this._recorder.deepEventTarget(e));if(n&&e.detail===0){this._performAction({name:n.checked?"uncheck":"check",selector:this._activeModel.selector,signals:[]});return}}this._performAction({name:"press",selector:this._activeModel.selector,signals:[],key:e.key,modifiers:_s(e)})}}}onKeyUp(e){if(this._shouldGenerateKeyPressFor(e)){if(!this._expectProgrammaticKeyUp){Ue(e);return}this._expectProgrammaticKeyUp=!1}}onScroll(e){this._resetHoveredModel()}_resetHoveredModel(){this._hoveredModel=null,this._hoveredElement=null,this._updateHighlight(!1)}_onFocus(e){const n=K_(this._recorder.document);if(e&&n===this._recorder.document.body)return;const r=n?this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName}):null;this._activeModel=r&&r.selector?{...r,color:Ht.action}:null,e&&(this._hoveredElement=n,this._updateModelForHoveredElement())}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.type))}_actionInProgress(e){const n=e instanceof KeyboardEvent,r=e instanceof MouseEvent||e instanceof PointerEvent;for(const o of this._performingActions)if(n&&o.name==="press"&&e.key===o.key||r&&(o.name==="click"||o.name==="check"||o.name==="uncheck"))return!0;return Ue(e),!1}_consumedDueToNoModel(e,n){return n?!1:(Ue(e),!0)}_consumedDueWrongTarget(e){return this._activeModel&&this._activeModel.elements[0]===this._recorder.deepEventTarget(e)?!1:(Ue(e),!0)}_consumeWhenAboutToPerform(e){this._performingActions.size||Ue(e)}_performAction(e){this._recorder.updateHighlight(null,!1),this._performingActions.add(e);const n=this._recorder.performAction(e).then(()=>{this._performingActions.delete(e),this._onFocus(!1)});this._recorder.injectedScript.isUnderTest&&n.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 n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!!Hi(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:n}=this._recorder.injectedScript.generateSelector(this._hoveredElement,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoveredModel&&this._hoveredModel.selector===e||(this._hoveredModel=e?{selector:e,elements:n,color:Ht.action}:null,this._updateHighlight(!0))}_updateHighlight(e){this._recorder.updateHighlight(this._hoveredModel,e)}}class U_{constructor(e){this._recorder=e}cursor(){return"pointer"}onClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||e.button===2&&e.type==="auxclick"||this._shouldIgnoreMouseEvent(e))return;const r=Hi(n),{ariaSnapshot:o,selector:l}=this._ariaSnapshot(n);if(r&&e.detail===1){this._recorder.recordAction({name:r.checked?"check":"uncheck",selector:l,signals:[],ariaSnapshot:o});return}this._recorder.recordAction({name:"click",selector:l,ariaSnapshot:o,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onDblClick(e){const n=this._recorder.deepEventTarget(e);if(Es(n)||this._shouldIgnoreMouseEvent(e))return;const{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);this._recorder.recordAction({name:"click",selector:o,ariaSnapshot:r,position:zi(e),signals:[],button:Ql(e),modifiers:_s(e),clickCount:e.detail})}onInput(e){const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(Es(n)){this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.value});return}if(["INPUT","TEXTAREA"].includes(n.nodeName)||n.isContentEditable){if(n.nodeName==="INPUT"&&["checkbox","radio"].includes(n.type.toLowerCase()))return;this._recorder.recordAction({name:"fill",selector:o,ariaSnapshot:r,signals:[],text:n.isContentEditable?n.innerText:n.value});return}if(n.nodeName==="SELECT"){const l=n;this._recorder.recordAction({name:"select",selector:o,ariaSnapshot:r,options:[...l.selectedOptions].map(c=>c.value),signals:[]});return}}onKeyDown(e){if(!this._shouldGenerateKeyPressFor(e))return;const n=this._recorder.deepEventTarget(e),{ariaSnapshot:r,selector:o}=this._ariaSnapshot(n);if(e.key===" "){const l=Hi(n);if(l&&e.detail===0){this._recorder.recordAction({name:l.checked?"uncheck":"check",selector:o,ariaSnapshot:r,signals:[]});return}}this._recorder.recordAction({name:"press",selector:o,ariaSnapshot:r,signals:[],key:e.key,modifiers:_s(e)})}_shouldIgnoreMouseEvent(e){const n=this._recorder.deepEventTarget(e),r=n.nodeName;return!!(r==="SELECT"||r==="OPTION"||r==="INPUT"&&["date","range"].includes(n.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 n=e.ctrlKey||e.altKey||e.metaKey;return e.key.length===1&&!n?!this._isEditable(this._recorder.deepEventTarget(e)):!0}_isEditable(e){return!!(e.nodeName==="TEXTAREA"||e.nodeName==="INPUT"||e.isContentEditable)}_ariaSnapshot(e){const{ariaSnapshot:n,refs:r}=this._recorder.injectedScript.ariaSnapshotForRecorder(),o=e?r.get(e):void 0,l=o?`aria-ref=${o}`:void 0;return{ariaSnapshot:n,selector:l}}}class Eu{constructor(e,n){this._hoverHighlight=null,this._action=null,this._recorder=e,this._textCache=new Map,this._kind=n,this._dialog=new W_(e)}cursor(){return"pointer"}uninstall(){this._dialog.close(),this._hoverHighlight=null}onClick(e){Ue(e),this._kind==="value"?this._commitAssertValue():this._dialog.isShowing()||this._showDialog()}onMouseDown(e){const n=this._recorder.deepEventTarget(e);this._elementHasValue(n)&&e.preventDefault()}onPointerUp(e){var r;const n=(r=this._hoverHighlight)==null?void 0:r.elements[0];this._kind==="value"&&n&&(n.nodeName==="INPUT"||n.nodeName==="SELECT")&&n.disabled&&this._commitAssertValue()}onMouseMove(e){var r;if(this._dialog.isShowing())return;const n=this._recorder.deepEventTarget(e);if(((r=this._hoverHighlight)==null?void 0:r.elements[0])!==n){if(this._kind==="text"||this._kind==="snapshot")this._hoverHighlight=this._recorder.injectedScript.utils.elementText(this._textCache,n).full?{elements:[n],selector:"",color:Ht.assert}:null;else if(this._elementHasValue(n)){const o=this._recorder.injectedScript.generateSelector(n,{testIdAttributeName:this._recorder.state.testIdAttributeName});this._hoverHighlight={selector:o.selector,elements:o.elements,color:Ht.assert}}else this._hoverHighlight=null;this._recorder.updateHighlight(this._hoverHighlight,!0)}}onKeyDown(e){e.key==="Escape"&&this._recorder.setMode("recording"),Ue(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 n;this._textCache.clear();const e=(n=this._hoverHighlight)==null?void 0:n.elements[0];if(!e)return null;if(this._kind==="value"){if(!this._elementHasValue(e))return null;const{selector:r}=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName});return e.nodeName==="INPUT"&&["checkbox","radio"].includes(e.type.toLowerCase())?{name:"assertChecked",selector:r,signals:[],checked:!e.checked}:{name:"assertValue",selector:r,signals:[],value:e.value}}else if(this._kind==="snapshot"){const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.assert},this._recorder.updateHighlight(this._hoverHighlight,!0),{name:"assertSnapshot",selector:this._hoverHighlight.selector,signals:[],ariaSnapshot:this._recorder.injectedScript.ariaSnapshot(e,{mode:"regex"})}}else{const r=this._recorder.injectedScript.generateSelector(e,{testIdAttributeName:this._recorder.state.testIdAttributeName,forTextExpect:!0});return this._hoverHighlight={selector:r.selector,elements:r.elements,color:Ht.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,n,r,o;(e=this._hoverHighlight)!=null&&e.elements[0]&&(this._action=this._generateAction(),((n=this._action)==null?void 0:n.name)==="assertText"?this._showTextDialog(this._action):((r=this._action)==null?void 0:r.name)==="assertSnapshot"&&(this._recorder.recordAction(this._action),this._recorder.setMode("recording"),(o=this._recorder.overlay)==null||o.flashToolSucceeded("assertingSnapshot")))}_showTextDialog(e){const n=this._recorder.document.createElement("textarea");n.setAttribute("spellcheck","false"),n.value=this._renderValue(e),n.classList.add("text-editor");const r=()=>{var y;const u=this._recorder.injectedScript.utils.normalizeWhiteSpace(n.value),d=(y=this._hoverHighlight)==null?void 0:y.elements[0];if(!d)return;e.text=u;const p=this._recorder.injectedScript.utils.elementText(this._textCache,d).normalized,g=u&&p.includes(u);n.classList.toggle("does-not-match",!g)};n.addEventListener("input",r);const l=this._dialog.show({label:"Assert that element contains text",body:n,onCommit:()=>this._commit()}),c=this._recorder.highlight.tooltipPosition(this._recorder.highlight.firstBox(),l);this._dialog.moveTo(c.anchorTop,c.anchorLeft),n.focus()}_commitAssertValue(){var n;if(this._kind!=="value")return;const e=this._generateAction();e&&(this._recorder.recordAction(e),this._recorder.setMode("recording"),(n=this._recorder.overlay)==null||n.flashToolSucceeded("assertingValue"))}}class q_{constructor(e){this._listeners=[],this._offsetX=0,this._measure={width:0,height:0},this._recorder=e;const n=this._recorder.document;this._overlayElement=n.createElement("x-pw-overlay");const r=n.createElement("x-pw-tools-list");this._overlayElement.appendChild(r),this._dragHandle=n.createElement("x-pw-tool-gripper"),this._dragHandle.appendChild(n.createElement("x-div")),r.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")),r.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")),r.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")),r.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")),r.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")),r.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")),r.appendChild(this._assertSnapshotToggle),this._updateVisualPosition(),this._refreshListeners()}_refreshListeners(){gy(this._listeners),this._listeners=[Le(this._dragHandle,"mousedown",e=>{this._dragState={offsetX:this._offsetX,dragStart:{x:e.clientX,y:0}}}),Le(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")}),Le(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])}),Le(this._assertVisibilityToggle,"click",()=>{this._assertVisibilityToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingVisibility"?"recording":"assertingVisibility")}),Le(this._assertTextToggle,"click",()=>{this._assertTextToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingText"?"recording":"assertingText")}),Le(this._assertValuesToggle,"click",()=>{this._assertValuesToggle.classList.contains("disabled")||this._recorder.setMode(this._recorder.state.mode==="assertingValue"?"recording":"assertingValue")}),Le(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){this._recordToggle.classList.toggle("toggled",e.mode==="recording"||e.mode==="assertingText"||e.mode==="assertingVisibility"||e.mode==="assertingValue"||e.mode==="assertingSnapshot"||e.mode==="recording-inspecting"),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 n;e==="assertingVisibility"?n=this._assertVisibilityToggle:e==="assertingSnapshot"?n=this._assertSnapshotToggle:n=this._assertValuesToggle,n.classList.add("succeeded"),this._recorder.injectedScript.utils.builtins.setTimeout(()=>n.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 n=(this._recorder.injectedScript.window.innerWidth-this._measure.width)/2-10;return this._offsetX=Math.max(-n,Math.min(n,this._offsetX)),this._updateVisualPosition(),this._recorder.setOverlayState({offsetX:this._offsetX}),Ue(e),!0}return!1}onMouseUp(e){return this._dragState?(Ue(e),!0):!1}onClick(e){return this._dragState?(this._dragState=void 0,Ue(e),!0):!1}onDblClick(e){return!1}}class V_{constructor(e,n){var r,o;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 gm,standby:new gm,inspecting:new _u(this,!1),recording:(n==null?void 0:n.recorderMode)==="api"?new U_(this):new H_(this),"recording-inspecting":new _u(this,!1),assertingText:new Eu(this,"text"),assertingVisibility:new _u(this,!0),assertingValue:new Eu(this,"value"),assertingSnapshot:new Eu(this,"snapshot")},this._currentTool=this._tools.none,(o=(r=this._currentTool).install)==null||o.call(r),e.window.top===e.window&&(this.overlay=new q_(this),this.overlay.setUIState(this.state)),this._stylesheet=new e.window.CSSStyleSheet,this._stylesheet.replaceSync(`
|
|
115
115
|
body[data-pw-cursor=pointer] *, body[data-pw-cursor=pointer] *::after { cursor: pointer !important; }
|
|
116
116
|
body[data-pw-cursor=text] *, body[data-pw-cursor=text] *::after { cursor: text !important; }
|
|
117
117
|
`),this.installListeners(),e.utils.cacheNormalizedWhitespaces(),e.isUnderTest&&console.error("Recorder script ready for test"),e.consoleApi.install()}installListeners(){var r,o,l;gy(this._listeners),this._listeners=[Le(this.document,"click",c=>this._onClick(c),!0),Le(this.document,"auxclick",c=>this._onClick(c),!0),Le(this.document,"dblclick",c=>this._onDblClick(c),!0),Le(this.document,"contextmenu",c=>this._onContextMenu(c),!0),Le(this.document,"dragstart",c=>this._onDragStart(c),!0),Le(this.document,"input",c=>this._onInput(c),!0),Le(this.document,"keydown",c=>this._onKeyDown(c),!0),Le(this.document,"keyup",c=>this._onKeyUp(c),!0),Le(this.document,"pointerdown",c=>this._onPointerDown(c),!0),Le(this.document,"pointerup",c=>this._onPointerUp(c),!0),Le(this.document,"mousedown",c=>this._onMouseDown(c),!0),Le(this.document,"mouseup",c=>this._onMouseUp(c),!0),Le(this.document,"mousemove",c=>this._onMouseMove(c),!0),Le(this.document,"mouseleave",c=>this._onMouseLeave(c),!0),Le(this.document,"mouseenter",c=>this._onMouseEnter(c),!0),Le(this.document,"focus",c=>this._onFocus(c),!0),Le(this.document,"scroll",c=>this._onScroll(c),!0)],this.highlight.install();let e;const n=()=>{this.highlight.install(),e=this.injectedScript.utils.builtins.setTimeout(n,500)};e=this.injectedScript.utils.builtins.setTimeout(n,500),this._listeners.push(()=>this.injectedScript.utils.builtins.clearTimeout(e)),this.highlight.appendChild(yy(this.document,z_)),(r=this.overlay)==null||r.install(),(l=(o=this._currentTool)==null?void 0:o.install)==null||l.call(o),this.document.adoptedStyleSheets.push(this._stylesheet)}_switchCurrentTool(){var n,r,o,l,c;const e=this._tools[this.state.mode];e!==this._currentTool&&((r=(n=this._currentTool).uninstall)==null||r.call(n),this.clearHighlight(),this._currentTool=e,(l=(o=this._currentTool).install)==null||l.call(o),(c=this.injectedScript.document.body)==null||c.setAttribute("data-pw-cursor",e.cursor()))}setUIState(e,n){var l;this._delegate=n,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(),(l=this.overlay)==null||l.setUIState(e);let r="noop";if(e.actionSelector!==this._lastHighlightedSelector){const c=e.actionSelector?G_(this.injectedScript,e.language,e.actionSelector,this.document):null;r=c!=null&&c.length?c:"clear",this._lastHighlightedSelector=c!=null&&c.length?e.actionSelector:void 0}const o=JSON.stringify(e.ariaTemplate);if(this._lastHighlightedAriaTemplateJSON!==o){const c=e.ariaTemplate?this.injectedScript.getAllByAria(this.document,e.ariaTemplate):[];if(c.length){const u=c.length>1?Ht.multiple:Ht.single;r=c.map(d=>({element:d,color:u})),this._lastHighlightedAriaTemplateJSON=o}else this._lastHighlightedSelector||(r="clear"),this._lastHighlightedAriaTemplateJSON="undefined"}r==="clear"?this.highlight.clearHighlight():r!=="noop"&&this.highlight.updateHighlight(r)}clearHighlight(){this.updateHighlight(null,!1)}_onClick(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onClick(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onClick)==null||o.call(r,e))}_onDblClick(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onDblClick(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onDblClick)==null||o.call(r,e))}_onContextMenu(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onContextMenu)==null||r.call(n,e))}_onDragStart(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onDragStart)==null||r.call(n,e))}_onPointerDown(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onPointerDown)==null||r.call(n,e))}_onPointerUp(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onPointerUp)==null||r.call(n,e))}_onMouseDown(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onMouseDown)==null||r.call(n,e))}_onMouseUp(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onMouseUp(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onMouseUp)==null||o.call(r,e))}_onMouseMove(e){var n,r,o;e.isTrusted&&((n=this.overlay)!=null&&n.onMouseMove(e)||this._ignoreOverlayEvent(e)||(o=(r=this._currentTool).onMouseMove)==null||o.call(r,e))}_onMouseEnter(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onMouseEnter)==null||r.call(n,e))}_onMouseLeave(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onMouseLeave)==null||r.call(n,e))}_onFocus(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onFocus)==null||r.call(n,e))}_onScroll(e){var n,r;e.isTrusted&&(this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this.highlight.hideActionPoint(),(r=(n=this._currentTool).onScroll)==null||r.call(n,e))}_onInput(e){var n,r;this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onInput)==null||r.call(n,e)}_onKeyDown(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onKeyDown)==null||r.call(n,e))}_onKeyUp(e){var n,r;e.isTrusted&&(this._ignoreOverlayEvent(e)||(r=(n=this._currentTool).onKeyUp)==null||r.call(n,e))}updateHighlight(e,n){this._lastHighlightedSelector=void 0,this._lastHighlightedAriaTemplateJSON="undefined",this._updateHighlight(e,n)}_updateHighlight(e,n){var o,l;let r=e==null?void 0:e.tooltipText;r===void 0&&(e!=null&&e.selector)&&(r=this.injectedScript.utils.asLocator(this.state.language,e.selector)),e?this.highlight.updateHighlight(e.elements.map(c=>({element:c,color:e.color,tooltipText:r}))):this.highlight.clearHighlight(),n&&((l=(o=this._delegate).highlightUpdated)==null||l.call(o))}_ignoreOverlayEvent(e){return e.composedPath().some(n=>(n.nodeName||"").toLowerCase()==="x-pw-glass")}deepEventTarget(e){var n;for(const r of e.composedPath())if(!((n=this.overlay)!=null&&n.contains(r)))return r;return e.composedPath()[0]}setMode(e){var n,r;(r=(n=this._delegate).setMode)==null||r.call(n,e)}async performAction(e){var n,r;await((r=(n=this._delegate).performAction)==null?void 0:r.call(n,e).catch(()=>{}))}recordAction(e){var n,r;(r=(n=this._delegate).recordAction)==null||r.call(n,e)}setOverlayState(e){var n,r;(r=(n=this._delegate).setOverlayState)==null||r.call(n,e)}elementPicked(e,n){var o,l;const r=this.injectedScript.ariaSnapshot(n.elements[0]);(l=(o=this._delegate).elementPicked)==null||l.call(o,{selector:e,ariaSnapshot:r})}}class W_{constructor(e){this._dialogElement=null,this._recorder=e}isShowing(){return!!this._dialogElement}show(e){const n=this._recorder.document.createElement("x-pw-tool-item");n.title="Accept",n.classList.add("accept"),n.appendChild(this._recorder.document.createElement("x-div")),n.addEventListener("click",()=>e.onCommit());const r=this._recorder.document.createElement("x-pw-tool-item");r.title="Close",r.classList.add("cancel"),r.appendChild(this._recorder.document.createElement("x-div")),r.addEventListener("click",()=>{var u;this.close(),(u=e.onCancel)==null||u.call(e)}),this._dialogElement=this._recorder.document.createElement("x-pw-dialog"),this._keyboardListener=u=>{var d;if(u.key==="Escape"){this.close(),(d=e.onCancel)==null||d.call(e);return}if(u.key==="Enter"&&(u.ctrlKey||u.metaKey)){this._dialogElement&&e.onCommit();return}},this._recorder.document.addEventListener("keydown",this._keyboardListener,!0);const o=this._recorder.document.createElement("x-pw-tools-list"),l=this._recorder.document.createElement("label");l.textContent=e.label,o.appendChild(l),o.appendChild(this._recorder.document.createElement("x-spacer")),o.appendChild(n),o.appendChild(r),this._dialogElement.appendChild(o);const c=this._recorder.document.createElement("x-pw-dialog-body");return c.appendChild(e.body),this._dialogElement.appendChild(c),this._recorder.highlight.appendChild(this._dialogElement),this._dialogElement}moveTo(e,n){this._dialogElement&&(this._dialogElement.style.top=e+"px",this._dialogElement.style.left=n+"px")}close(){this._dialogElement&&(this._dialogElement.remove(),this._recorder.document.removeEventListener("keydown",this._keyboardListener),this._dialogElement=null)}}function K_(t){let e=t.activeElement;for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function _s(t){return(t.altKey?1:0)|(t.ctrlKey?2:0)|(t.metaKey?4:0)|(t.shiftKey?8:0)}function Ql(t){switch(t.which){case 1:return"left";case 2:return"middle";case 3:return"right"}return"left"}function zi(t){if(t.target.nodeName==="CANVAS")return{x:t.offsetX,y:t.offsetY}}function Ue(t){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()}function Hi(t){if(!t||t.nodeName!=="INPUT")return null;const e=t;return["checkbox","radio"].includes(e.type)?e:null}function Es(t){return!t||t.nodeName!=="INPUT"?!1:t.type.toLowerCase()==="range"}function Le(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function gy(t){for(const e of t)e();t.splice(0,t.length)}function G_(t,e,n,r){try{const o=t.parseSelector(n),l=t.querySelectorAll(o,r),c=l.length>1?Ht.multiple:Ht.single,u=t.utils.asLocator(e,n);return l.map((d,p)=>{const g=l.length>1?` [${p+1} of ${l.length}]`:"";return{element:d,color:c,tooltipText:u+g}})}catch{return[]}}function yy(t,{tagName:e,attrs:n,children:r}){const o=t.createElementNS("http://www.w3.org/2000/svg",e);if(n)for(const[l,c]of Object.entries(n))o.setAttribute(l,c);if(r)for(const l of r)o.appendChild(yy(t,l));return o}function Q_(t,e){t=t.replace(/AriaRole\s*\.\s*([\w]+)/g,(l,c)=>c.toLowerCase()).replace(/(get_by_role|getByRole)\s*\(\s*(?:["'`])([^'"`]+)['"`]/g,(l,c,u)=>`${c}(${u.toLowerCase()}`);const n=[];let r="";for(let l=0;l<t.length;++l){const c=t[l];if(c!=='"'&&c!=="'"&&c!=="`"&&c!=="/"){r+=c;continue}const u=t[l-1]==="r"||t[l]==="/";++l;let d="";for(;l<t.length;){if(t[l]==="\\"){u?(t[l+1]!==c&&(d+=t[l]),++l,d+=t[l]):(++l,t[l]==="n"?d+=`
|