playwright-core 1.56.0-alpha-2025-10-02 → 1.56.0-beta-1759435110000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{q as Wu}from"./defaultSettingsView-DlXUx3cl.js";var vi={exports:{}},_u=vi.exports,ha;function It(){return ha||(ha=1,(function(Et,zt){(function(C,De){Et.exports=De()})(_u,(function(){var C=navigator.userAgent,De=navigator.platform,I=/gecko\/\d/i.test(C),K=/MSIE \d/.test(C),$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(C),V=/Edge\/(\d+)/.exec(C),b=K||$||V,N=b&&(K?document.documentMode||6:+(V||$)[1]),_=!V&&/WebKit\//.test(C),ie=_&&/Qt\/\d+\.\d+/.test(C),O=!V&&/Chrome\/(\d+)/.exec(C),q=O&&+O[1],z=/Opera\//.test(C),X=/Apple Computer/.test(navigator.vendor),ke=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(C),we=/PhantomJS/.test(C),te=X&&(/Mobile\/\w+/.test(C)||navigator.maxTouchPoints>2),re=/Android/.test(C),ne=te||re||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(C),se=te||/Mac/.test(De),Ae=/\bCrOS\b/.test(C),ye=/win/i.test(De),de=z&&C.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,_=!0);var ze=se&&(ie||z&&(de==null||de<12.11)),fe=I||b&&N>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return D(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function S(e,t,n,r){var i=d(e,t,n,r);return i.setAttribute("role","presentation"),i}var w;document.createRange?w=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:w=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function m(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function P(e,t){var n=e.className;H(t).test(n)||(e.className+=(n?" ":"")+t)}function le(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!H(n[r]).test(t)&&(t+=" "+n[r]);return t}var p=function(e){e.select()};te?p=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(p=function(e){try{e.select()}catch{}});function c(e){return e.display.wrapper.ownerDocument}function Y(e){return xe(e.display.wrapper)}function xe(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function j(e){return c(e).defaultView}function ue(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Te(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Le(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function oe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ne=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},ct={origin:"*mouse"},Oe={origin:"+move"};function Re(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(ge(Ue)+" ");return Ue[e]}function ge(e){return e[e.length-1]}function Pe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function T(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function B(){}function F(e,t){var n;return Object.create?n=Object.create(e):(B.prototype=e,n=new B),t&&Te(t,n),n}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Se(e,t){return t?t.source.indexOf("\\w")>-1&&ae(e)?!0:t.test(e):ae(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Lt(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function Nt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var mi=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,v){this.level=u,this.from=h,this.to=v}return function(u,h){var v=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var k=u.length,x=[],M=0;M<k;++M)x.push(n(u.charCodeAt(M)));for(var E=0,R=v;E<k;++E){var U=x[E];U=="m"?x[E]=R:R=U}for(var Q=0,G=v;Q<k;++Q){var ee=x[Q];ee=="1"&&G=="r"?x[Q]="n":o.test(ee)&&(G=ee,ee=="r"&&(x[Q]="R"))}for(var me=1,pe=x[0];me<k-1;++me){var Fe=x[me];Fe=="+"&&pe=="1"&&x[me+1]=="1"?x[me]="1":Fe==","&&pe==x[me+1]&&(pe=="1"||pe=="n")&&(x[me]=pe),pe=Fe}for(var Ke=0;Ke<k;++Ke){var st=x[Ke];if(st==",")x[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<k&&x[Xe]=="%";++Xe);for(var Mt=Ke&&x[Ke-1]=="!"||Xe<k&&x[Xe]=="1"?"1":"N",wt=Ke;wt<Xe;++wt)x[wt]=Mt;Ke=Xe-1}}for(var tt=0,St=v;tt<k;++tt){var ft=x[tt];St=="L"&&ft=="1"?x[tt]="L":o.test(ft)&&(St=ft)}for(var nt=0;nt<k;++nt)if(i.test(x[nt])){var rt=void 0;for(rt=nt+1;rt<k&&i.test(x[rt]);++rt);for(var Qe=(nt?x[nt-1]:v)=="L",Tt=(rt<k?x[rt]:v)=="L",nn=Qe==Tt?Qe?"L":"R":v,xr=nt;xr<rt;++xr)x[xr]=nn;nt=rt-1}for(var gt=[],Jt,ut=0;ut<k;)if(l.test(x[ut])){var co=ut;for(++ut;ut<k&&l.test(x[ut]);++ut);gt.push(new s(0,co,ut))}else{var ir=ut,Ar=gt.length,Er=h=="rtl"?1:0;for(++ut;ut<k&&x[ut]!="L";++ut);for(var mt=ir;mt<ut;)if(a.test(x[mt])){ir<mt&&(gt.splice(Ar,0,new s(1,ir,mt)),Ar+=Er);var on=mt;for(++mt;mt<ut&&a.test(x[mt]);++mt);gt.splice(Ar,0,new s(2,on,mt)),Ar+=Er,ir=mt}else++mt;ir<ut&&gt.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(gt[0].level==1&&(Jt=u.match(/^\s+/))&&(gt[0].from=Jt[0].length,gt.unshift(new s(0,0,Jt[0].length))),ge(gt).level==1&&(Jt=u.match(/\s+$/))&&(ge(gt).to-=Jt[0].length,gt.push(new s(0,k-Jt[0].length,k)))),h=="rtl"?gt.reverse():gt}})();function We(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],ve=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Qt(e,t){return e._handlers&&e._handlers[t]||Bn}function dt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=oe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Qt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ze(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),yt(t)||t.codemirrorIgnore}function Ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(n,t[r])==-1&&n.push(t[r])}function Ct(e,t){return Qt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){dt(this,t,n)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){ht(e),Nr(e)}function ln(e){return e.target||e.srcElement}function Wt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var yi=(function(){if(b&&N<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e})(),Or;function Wn(e){if(Or==null){var t=d("span","​");J(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&N<8))}var n=Or?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=J(e,document.createTextNode("AخA")),n=w(t,0,1).getBoundingClientRect(),r=w(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=`
1
+ import{q as Wu}from"./defaultSettingsView-w0zYjHsW.js";var vi={exports:{}},_u=vi.exports,ha;function It(){return ha||(ha=1,(function(Et,zt){(function(C,De){Et.exports=De()})(_u,(function(){var C=navigator.userAgent,De=navigator.platform,I=/gecko\/\d/i.test(C),K=/MSIE \d/.test(C),$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(C),V=/Edge\/(\d+)/.exec(C),b=K||$||V,N=b&&(K?document.documentMode||6:+(V||$)[1]),_=!V&&/WebKit\//.test(C),ie=_&&/Qt\/\d+\.\d+/.test(C),O=!V&&/Chrome\/(\d+)/.exec(C),q=O&&+O[1],z=/Opera\//.test(C),X=/Apple Computer/.test(navigator.vendor),ke=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(C),we=/PhantomJS/.test(C),te=X&&(/Mobile\/\w+/.test(C)||navigator.maxTouchPoints>2),re=/Android/.test(C),ne=te||re||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(C),se=te||/Mac/.test(De),Ae=/\bCrOS\b/.test(C),ye=/win/i.test(De),de=z&&C.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,_=!0);var ze=se&&(ie||z&&(de==null||de<12.11)),fe=I||b&&N>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return D(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function S(e,t,n,r){var i=d(e,t,n,r);return i.setAttribute("role","presentation"),i}var w;document.createRange?w=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:w=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function m(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function y(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function P(e,t){var n=e.className;H(t).test(n)||(e.className+=(n?" ":"")+t)}function le(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!H(n[r]).test(t)&&(t+=" "+n[r]);return t}var p=function(e){e.select()};te?p=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(p=function(e){try{e.select()}catch{}});function c(e){return e.display.wrapper.ownerDocument}function Y(e){return xe(e.display.wrapper)}function xe(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function j(e){return c(e).defaultView}function ue(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Te(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Le(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function oe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ne=50,qe={toString:function(){return"CodeMirror.Pass"}},Ve={scroll:!1},ct={origin:"*mouse"},Oe={origin:"+move"};function Re(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(ge(Ue)+" ");return Ue[e]}function ge(e){return e[e.length-1]}function Pe(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function T(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function B(){}function F(e,t){var n;return Object.create?n=Object.create(e):(B.prototype=e,n=new B),t&&Te(t,n),n}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Se(e,t){return t?t.source.indexOf("\\w")>-1&&ae(e)?!0:t.test(e):ae(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Lt(e,t,n){for(;(n<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=n;return t}function Nt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var mi=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,v){this.level=u,this.from=h,this.to=v}return function(u,h){var v=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var k=u.length,x=[],M=0;M<k;++M)x.push(n(u.charCodeAt(M)));for(var E=0,R=v;E<k;++E){var U=x[E];U=="m"?x[E]=R:R=U}for(var Q=0,G=v;Q<k;++Q){var ee=x[Q];ee=="1"&&G=="r"?x[Q]="n":o.test(ee)&&(G=ee,ee=="r"&&(x[Q]="R"))}for(var me=1,pe=x[0];me<k-1;++me){var Fe=x[me];Fe=="+"&&pe=="1"&&x[me+1]=="1"?x[me]="1":Fe==","&&pe==x[me+1]&&(pe=="1"||pe=="n")&&(x[me]=pe),pe=Fe}for(var Ke=0;Ke<k;++Ke){var st=x[Ke];if(st==",")x[Ke]="N";else if(st=="%"){var Xe=void 0;for(Xe=Ke+1;Xe<k&&x[Xe]=="%";++Xe);for(var Mt=Ke&&x[Ke-1]=="!"||Xe<k&&x[Xe]=="1"?"1":"N",wt=Ke;wt<Xe;++wt)x[wt]=Mt;Ke=Xe-1}}for(var tt=0,St=v;tt<k;++tt){var ft=x[tt];St=="L"&&ft=="1"?x[tt]="L":o.test(ft)&&(St=ft)}for(var nt=0;nt<k;++nt)if(i.test(x[nt])){var rt=void 0;for(rt=nt+1;rt<k&&i.test(x[rt]);++rt);for(var Qe=(nt?x[nt-1]:v)=="L",Tt=(rt<k?x[rt]:v)=="L",nn=Qe==Tt?Qe?"L":"R":v,xr=nt;xr<rt;++xr)x[xr]=nn;nt=rt-1}for(var gt=[],Jt,ut=0;ut<k;)if(l.test(x[ut])){var co=ut;for(++ut;ut<k&&l.test(x[ut]);++ut);gt.push(new s(0,co,ut))}else{var ir=ut,Ar=gt.length,Er=h=="rtl"?1:0;for(++ut;ut<k&&x[ut]!="L";++ut);for(var mt=ir;mt<ut;)if(a.test(x[mt])){ir<mt&&(gt.splice(Ar,0,new s(1,ir,mt)),Ar+=Er);var on=mt;for(++mt;mt<ut&&a.test(x[mt]);++mt);gt.splice(Ar,0,new s(2,on,mt)),Ar+=Er,ir=mt}else++mt;ir<ut&&gt.splice(Ar,0,new s(1,ir,ut))}return h=="ltr"&&(gt[0].level==1&&(Jt=u.match(/^\s+/))&&(gt[0].from=Jt[0].length,gt.unshift(new s(0,0,Jt[0].length))),ge(gt).level==1&&(Jt=u.match(/\s+$/))&&(ge(gt).to-=Jt[0].length,gt.push(new s(0,k-Jt[0].length,k)))),h=="rtl"?gt.reverse():gt}})();function We(e,t){var n=e.order;return n==null&&(n=e.order=mi(e.text,t)),n}var Bn=[],ve=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Qt(e,t){return e._handlers&&e._handlers[t]||Bn}function dt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=oe(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Qt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ze(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ye(e,n||t.type,e,t),yt(t)||t.codemirrorIgnore}function Ot(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)oe(n,t[r])==-1&&n.push(t[r])}function Ct(e,t){return Qt(e,t).length>0}function Bt(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){dt(this,t,n)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){ht(e),Nr(e)}function ln(e){return e.target||e.srcElement}function Wt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var yi=(function(){if(b&&N<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e})(),Or;function Wn(e){if(Or==null){var t=d("span","​");J(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&N<8))}var n=Or?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=J(e,document.createTextNode("AخA")),n=w(t,0,1).getBoundingClientRect(),r=w(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=`
2
2
 
3
3
  b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
4
4
  `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_n=(function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),_t=null;function xi(e){if(_t!=null)return _t;var t=J(e,d("span","x")),n=t.getBoundingClientRect(),r=w(t,0,1).getBoundingClientRect();return _t=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=F(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Te(t,n)}function Gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Wr(e,t,n){return e.startState?e.startState(t,n):!0}var Je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Je.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},Je.prototype.indentation=function(){return Le(this.string,null,this.tabSize)-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},Je.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Vt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var l=o.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function un(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Ft(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function f(e){if(e.parent==null)return null;for(var t=e.parent,n=oe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function g(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return n+l}function A(e,t){return t>=e.first&&t<e.first+e.size}function W(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function L(e,t,n){if(n===void 0&&(n=null),!(this instanceof L))return new L(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Z(e,t){return e.line-t.line||e.ch-t.ch}function _e(e,t){return e.sticky==t.sticky&&Z(e,t)==0}function it(e){return L(e.line,e.ch)}function xt(e,t){return Z(e,t)<0?t:e}function _r(e,t){return Z(e,t)<0?e:t}function po(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ce(e,t){if(t.line<e.first)return L(e.first,0);var n=e.first+e.size-1;return t.line>n?L(n,ce(e,n).text.length):_a(t,ce(e,t.line).text.length)}function _a(e,t){var n=e.ch;return n==null||n>t?L(e.line,t):n<0?L(e.line,0):e}function go(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ce(e,t[r]);return n}var Hn=function(e,t){this.state=e,this.lookAhead=t},Xt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Xt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Xt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xt.fromSaved=function(e,t,n){return t instanceof Hn?new Xt(e,Gt(e.mode,t.state),n,t.lookAhead):new Xt(e,Gt(e.mode,t),n)},Xt.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hn(t,this.maxLookAhead):t};function vo(e,t,n,r){var i=[e.state.modeGen],o={};wo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var h=e.state.overlays[u],v=1,k=0;n.state=!0,wo(e,t.text,h.mode,n,function(x,M){for(var E=v;k<x;){var R=i[v];R>x&&i.splice(v,1,x,i[v+1],R),v+=2,k=Math.min(x,R)}if(M)if(h.opaque)i.splice(E,v-E,x,"overlay "+M),v=E+2;else for(;E<v;E+=2){var U=i[E+1];i[E+1]=(U?U+" ":"")+"overlay "+M}},o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=fn(e,f(t)),i=t.text.length>e.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=vo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xt(r,!0,t);var o=Ha(e,t,n),l=o>r.first&&ce(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Wr(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?a.save():null,a.nextLine()}),n&&(r.modeFrontier=a.line),a}function bi(e,t,n,r){var i=e.doc.mode,o=new Je(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&yo(i,n.state);!o.eol();)ki(i,o,n.state),o.start=o.pos}function yo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=sn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function ki(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=sn(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bo(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ce(i,t);var a=ce(i,t.line),s=fn(e,t.line,n),u=new Je(a.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=ki(o,u,s.state),r&&h.push(new xo(u,l,Gt(i.mode,s.state)));return r?h:new xo(u,l,s.state)}function ko(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function wo(e,t,n,r,i,o,l){var a=n.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,h=new Je(t,e.options.tabSize,r),v,k=e.options.addModeClass&&[null];for(t==""&&ko(yo(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,l&&bi(e,t,r,h.pos),h.pos=t.length,v=null):v=ko(ki(n,h,r.state,k),o),k){var x=k[0].name;x&&(v="m-"+(v?x+" "+v:x))}if(!a||u!=v){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=v}h.start=h.pos}for(;s<h.pos;){var M=Math.min(h.pos,s+5e3);i(M,u),s=M}}function Ha(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=ce(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Le(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function Ra(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ce(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var So=!1,$t=!1;function qa(){So=!0}function ja(){$t=!0}function Rn(e,t,n){this.marker=e,this.from=t,this.to=n}function cn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ka(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ua(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Ga(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rn(l,o.from,s?null:o.to))}}return r}function Xa(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rn(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function wi(e,t){if(t.full)return null;var n=A(e,t.from.line)&&ce(e,t.from.line).markedSpans,r=A(e,t.to.line)&&ce(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=Z(t.from,t.to)==0,a=Ga(n,i,l),s=Xa(r,o,l),u=t.text.length==1,h=ge(t.text).length+(u?i:0);if(a)for(var v=0;v<a.length;++v){var k=a[v];if(k.to==null){var x=cn(s,k.marker);x?u&&(k.to=x.to==null?null:x.to+h):k.to=i}}if(s)for(var M=0;M<s.length;++M){var E=s[M];if(E.to!=null&&(E.to+=h),E.from==null){var R=cn(a,E.marker);R||(E.from=h,u&&(a||(a=[])).push(E))}else E.from+=h,u&&(a||(a=[])).push(E)}a&&(a=To(a)),s&&s!=a&&(s=To(s));var U=[a];if(!u){var Q=t.text.length-2,G;if(Q>0&&a)for(var ee=0;ee<a.length;++ee)a[ee].to==null&&(G||(G=[])).push(new Rn(a[ee].marker,null,null));for(var me=0;me<Q;++me)U.push(G);U.push(s)}return U}function To(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ya(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(x){if(x.markedSpans)for(var M=0;M<x.markedSpans.length;++M){var E=x.markedSpans[M].marker;E.readOnly&&(!r||oe(r,E)==-1)&&(r||(r=[])).push(E)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(Z(u.to,a.from)<0||Z(u.from,a.to)>0)){var h=[s,1],v=Z(u.from,a.from),k=Z(u.to,a.to);(v<0||!l.inclusiveLeft&&!v)&&h.push({from:u.from,to:a.from}),(k>0||!l.inclusiveRight&&!k)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Co(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qn(e){return e.inclusiveLeft?-1:0}function jn(e){return e.inclusiveRight?1:0}function Si(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=Z(r.from,i.from)||qn(e)-qn(t);if(o)return-o;var l=Z(r.to,i.to)||jn(e)-jn(t);return l||t.id-e.id}function Do(e,t){var n=$t&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Si(r,i.marker)<0)&&(r=i.marker);return r}function Mo(e){return Do(e,!0)}function Kn(e){return Do(e,!1)}function Za(e,t){var n=$t&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Fo(e,t,n,r,i){var o=ce(e,t),l=$t&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),h=Z(u.from,n)||qn(s.marker)-qn(i),v=Z(u.to,r)||jn(s.marker)-jn(i);if(!(h>=0&&v<=0||h<=0&&v>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.to,n)>=0:Z(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.from,r)<=0:Z(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Mo(e);)e=t.find(-1,!0).line;return e}function Ja(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function Qa(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ti(e,t){var n=ce(e,t),r=qt(n);return n==r?t:f(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=ce(e,t),r;if(!cr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function cr(e,t){var n=$t&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Li(e,t,r))return!0}}}function Li(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Li(e,r.line,cn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Li(e,t,i))return!0}function er(e){e=qt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==n)break;t+=a.height}return t}function Un(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Mo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Kn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Ci(e){var t=e.display,n=e.doc;t.maxLine=ce(n,n.first),t.maxLineLength=Un(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Un(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Co(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function Va(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),Co(e,n);var i=r?r(e):1;i!=e.height&&Ft(e,i)}function $a(e){e.parent=null,Lo(e)}var es={},ts={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ts:es;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function No(e,t){var n=S("span",null,null,_?"padding-right: .1px":null),r={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=ns,sr(e.display.measure)&&(l=We(o,e.doc.direction))&&(r.addToken=os(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);ls(o,r,mo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=le(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=le(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Wn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=le(r.pre.className,r.textClass||"")),r}function rs(e){var t=d("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ns(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?is(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),b&&N<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var v=0;;){s.lastIndex=v;var k=s.exec(t),x=k?k.index-v:t.length-v;if(x){var M=document.createTextNode(a.slice(v,v+x));b&&N<9?h.appendChild(d("span",[M])):h.appendChild(M),e.map.push(e.pos,e.pos+x,M),e.col+=x,e.pos+=x}if(!k)break;v+=x+1;var E=void 0;if(k[0]==" "){var R=e.cm.options.tabSize,U=R-e.col%R;E=h.appendChild(d("span",et(U),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=U}else k[0]=="\r"||k[0]==`
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-odlgUdya.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-eyVcHN77.js","../codeMirrorModule.C3UTv-Ge.css"])))=>i.map(i=>d[i]);
2
2
  var ww=Object.defineProperty;var xw=(n,e,i)=>e in n?ww(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var Me=(n,e,i)=>xw(n,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(l){if(l.ep)return;l.ep=!0;const o=i(l);fetch(l.href,o)}})();function _w(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zf={exports:{}},_a={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -55,7 +55,7 @@ Error generating stack: `+a.message+`
55
55
  rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
56
56
  rgb(0 0 0 / 10%) 0px -2px 4px,
57
57
  rgb(0 0 0 / 15%) 0px -6.1px 12px,
58
- rgb(0 0 0 / 25%) 0px 6px 12px`},Ix=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[s,l]=q.useState(n.diff?"diff":"actual"),[o,u]=q.useState(!1),[f,d]=q.useState(null),[p,m]=q.useState("Expected"),[y,b]=q.useState(null),[w,T]=q.useState(null),[x,E]=es();q.useEffect(()=>{(async()=>{var j,te,re,L;d(await Kf((j=n.expected)==null?void 0:j.attachment.path)),m(((te=n.expected)==null?void 0:te.title)||"Expected"),b(await Kf((re=n.actual)==null?void 0:re.attachment.path)),T(await Kf((L=n.diff)==null?void 0:L.attachment.path))})()},[n]);const k=f&&y&&w,N=k?Math.max(f.naturalWidth,y.naturalWidth,200):500,V=k?Math.max(f.naturalHeight,y.naturalHeight,200):500,$=Math.min(1,(x.width-30)/N),B=Math.min(1,(x.width-50)/N/2),Y=N*$,J=V*$,I={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return v.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:k&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&v.jsx("div",{style:{...I,fontWeight:s==="diff"?600:"initial"},onClick:()=>l("diff"),children:"Diff"}),v.jsx("div",{style:{...I,fontWeight:s==="actual"?600:"initial"},onClick:()=>l("actual"),children:"Actual"}),v.jsx("div",{style:{...I,fontWeight:s==="expected"?600:"initial"},onClick:()=>l("expected"),children:p}),v.jsx("div",{style:{...I,fontWeight:s==="sxs"?600:"initial"},onClick:()=>l("sxs"),children:"Side by side"}),v.jsx("div",{style:{...I,fontWeight:s==="slider"?600:"initial"},onClick:()=>l("slider"),children:"Slider"})]}),v.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:J+60},children:[n.diff&&s==="diff"&&v.jsx($n,{image:w,alt:"Diff",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="actual"&&v.jsx($n,{image:y,alt:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="expected"&&v.jsx($n,{image:f,alt:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="slider"&&v.jsx(Vx,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$,expectedTitle:p}),n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:B*N,canvasHeight:B*V,scale:B}),v.jsx($n,{image:o?w:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:B*N,canvasHeight:B*V,scale:B})]}),!n.diff&&s==="actual"&&v.jsx($n,{image:y,title:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="expected"&&v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,canvasWidth:B*N,canvasHeight:B*V,scale:B}),v.jsx($n,{image:y,title:"Actual",canvasWidth:B*N,canvasHeight:B*V,scale:B})]})]}),!i&&v.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[v.jsx("div",{children:n.diff&&v.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},Vx=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:s,scale:l,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,p]=q.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&v.jsxs("div",{style:{margin:5},children:[!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!m&&v.jsx("span",{children:e.naturalWidth}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&v.jsx("span",{children:e.naturalHeight})]}),v.jsxs("div",{style:{position:"relative",width:i,height:s,margin:15,...dh},children:[v.jsx(W0,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),v.jsx("img",{alt:o,style:{width:n.naturalWidth*l,height:n.naturalHeight*l},draggable:"false",src:n.src}),v.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...dh},children:v.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*l,height:e.naturalHeight*l},draggable:"false",src:e.src})})]})]})},$n=({image:n,title:e,alt:i,hideSize:s,canvasWidth:l,canvasHeight:o,scale:u,onClick:f})=>v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!s&&v.jsxs("div",{style:{margin:5},children:[e&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight})]}),v.jsx("div",{style:{display:"flex",flex:"none",width:l,height:o,margin:15,...dh},children:v.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),Gx="modulepreload",Kx=function(n,e){return new URL(n,e).href},Uy={},Yx=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(i.map(m=>{if(m=Kx(m,s),m in Uy)return;Uy[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(!!s)for(let x=f.length-1;x>=0;x--){const E=f[x];if(E.href===m&&(!y||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const T=document.createElement("link");if(T.rel=y?"stylesheet":Gx,y||(T.as="script"),T.crossOrigin="",T.href=m,p&&T.setAttribute("nonce",p),document.head.appendChild(T),y)return new Promise((x,E)=>{T.addEventListener("load",x),T.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},Xx=20,cr=({text:n,highlighter:e,mimeType:i,linkify:s,readOnly:l,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:p,wrapLines:m,onChange:y,dataTestId:b,placeholder:w})=>{const[T,x]=es(),[E]=q.useState(Yx(()=>import("./codeMirrorModule-odlgUdya.js"),__vite__mapDeps([0,1]),import.meta.url).then($=>$.default)),k=q.useRef(null),[N,V]=q.useState();return q.useEffect(()=>{(async()=>{var I,j;const $=await E;Fx($);const B=x.current;if(!B)return;const Y=Zx(e)||Qx(i)||(s?"text/linkified":"");if(k.current&&Y===k.current.cm.getOption("mode")&&!!l===k.current.cm.getOption("readOnly")&&f===k.current.cm.getOption("lineNumbers")&&m===k.current.cm.getOption("lineWrapping")&&w===k.current.cm.getOption("placeholder"))return;(j=(I=k.current)==null?void 0:I.cm)==null||j.getWrapperElement().remove();const J=$(B,{value:"",mode:Y,readOnly:!!l,lineNumbers:f,lineWrapping:m,placeholder:w});return k.current={cm:J},d&&J.focus(),V(J),J})()},[E,N,x,e,i,s,f,m,l,d,w]),q.useEffect(()=>{k.current&&k.current.cm.setSize(T.width,T.height)},[T]),q.useLayoutEffect(()=>{var Y;if(!N)return;let $=!1;if(N.getValue()!==n&&(N.setValue(n),$=!0,p&&(N.execCommand("selectAll"),N.focus())),$||JSON.stringify(o)!==JSON.stringify(k.current.highlight)){for(const j of k.current.highlight||[])N.removeLineClass(j.line-1,"wrap");for(const j of o||[])N.addLineClass(j.line-1,"wrap",`source-line-${j.type}`);for(const j of k.current.widgets||[])N.removeLineWidget(j);for(const j of k.current.markers||[])j.clear();const J=[],I=[];for(const j of o||[]){if(j.type!=="subtle-error"&&j.type!=="error")continue;const te=(Y=k.current)==null?void 0:Y.cm.getLine(j.line-1);if(te){const re={};re.title=j.message||"",I.push(N.markText({line:j.line-1,ch:0},{line:j.line-1,ch:j.column||te.length},{className:"source-line-error-underline",attributes:re}))}if(j.type==="error"){const re=document.createElement("div");re.innerHTML=Xa(j.message||""),re.className="source-line-error-widget",J.push(N.addLineWidget(j.line,re,{above:!0,coverGutter:!1}))}}k.current.highlight=o,k.current.widgets=J,k.current.markers=I}typeof u=="number"&&k.current.cm.lineCount()>=u&&N.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let B;return y&&(B=()=>y(N.getValue()),N.on("change",B)),()=>{B&&N.off("change",B)}},[N,n,o,u,p,y]),v.jsx("div",{"data-testid":b,className:"cm-wrapper",ref:x,onClick:Px})};function Px(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Hy=!1;function Fx(n){Hy||(Hy=!0,n.defineSimpleMode("text/linkified",{start:[{regex:x0,token:"linkified"}]}))}function Qx(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function Zx(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function Jx(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const Wx=({title:n,children:e,setExpanded:i,expanded:s,expandOnTitleClick:l})=>{const o=q.useId();return v.jsxs("div",{className:Ke("expandable",s&&"expanded"),children:[v.jsxs("div",{role:"button","aria-expanded":s,"aria-controls":o,className:"expandable-title",onClick:()=>l&&i(!s),children:[v.jsx("div",{className:Ke("codicon",s?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!l&&i(!s)}),n]}),s&&v.jsx("div",{id:o,role:"region",style:{marginLeft:25},children:e})]})};function eb(n){const e=[];let i=0,s;for(;(s=x0.exec(n))!==null;){const o=n.substring(i,s.index);o&&e.push(o);const u=s[0];e.push(e_(u)),i=s.index+u.length}const l=n.substring(i);return l&&e.push(l),e}function e_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),v.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const t_=({attachment:n,reveal:e})=>{const[i,s]=q.useState(!1),[l,o]=q.useState(null),[u,f]=q.useState(null),[d,p]=kw(),m=q.useRef(null),y=Jx(n.contentType),b=!!n.sha1||!!n.path;q.useEffect(()=>{var x;if(e)return(x=m.current)==null||x.scrollIntoView({behavior:"smooth"}),p()},[e,p]),q.useEffect(()=>{i&&l===null&&u===null&&(f("Loading ..."),fetch(rc(n)).then(x=>x.text()).then(x=>{o(x),f(null)}).catch(x=>{f("Failed to load: "+x.message)}))},[i,l,u,n]);const w=q.useMemo(()=>{const x=l?l.split(`
58
+ rgb(0 0 0 / 25%) 0px 6px 12px`},Ix=({diff:n,noTargetBlank:e,hideDetails:i})=>{const[s,l]=q.useState(n.diff?"diff":"actual"),[o,u]=q.useState(!1),[f,d]=q.useState(null),[p,m]=q.useState("Expected"),[y,b]=q.useState(null),[w,T]=q.useState(null),[x,E]=es();q.useEffect(()=>{(async()=>{var j,te,re,L;d(await Kf((j=n.expected)==null?void 0:j.attachment.path)),m(((te=n.expected)==null?void 0:te.title)||"Expected"),b(await Kf((re=n.actual)==null?void 0:re.attachment.path)),T(await Kf((L=n.diff)==null?void 0:L.attachment.path))})()},[n]);const k=f&&y&&w,N=k?Math.max(f.naturalWidth,y.naturalWidth,200):500,V=k?Math.max(f.naturalHeight,y.naturalHeight,200):500,$=Math.min(1,(x.width-30)/N),B=Math.min(1,(x.width-50)/N/2),Y=N*$,J=V*$,I={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return v.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:E,children:k&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[n.diff&&v.jsx("div",{style:{...I,fontWeight:s==="diff"?600:"initial"},onClick:()=>l("diff"),children:"Diff"}),v.jsx("div",{style:{...I,fontWeight:s==="actual"?600:"initial"},onClick:()=>l("actual"),children:"Actual"}),v.jsx("div",{style:{...I,fontWeight:s==="expected"?600:"initial"},onClick:()=>l("expected"),children:p}),v.jsx("div",{style:{...I,fontWeight:s==="sxs"?600:"initial"},onClick:()=>l("sxs"),children:"Side by side"}),v.jsx("div",{style:{...I,fontWeight:s==="slider"?600:"initial"},onClick:()=>l("slider"),children:"Slider"})]}),v.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:J+60},children:[n.diff&&s==="diff"&&v.jsx($n,{image:w,alt:"Diff",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="actual"&&v.jsx($n,{image:y,alt:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="expected"&&v.jsx($n,{image:f,alt:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),n.diff&&s==="slider"&&v.jsx(Vx,{expectedImage:f,actualImage:y,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$,expectedTitle:p}),n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:B*N,canvasHeight:B*V,scale:B}),v.jsx($n,{image:o?w:y,title:o?"Diff":"Actual",onClick:()=>u(!o),hideSize:i,canvasWidth:B*N,canvasHeight:B*V,scale:B})]}),!n.diff&&s==="actual"&&v.jsx($n,{image:y,title:"Actual",hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="expected"&&v.jsx($n,{image:f,title:p,hideSize:i,canvasWidth:Y,canvasHeight:J,scale:$}),!n.diff&&s==="sxs"&&v.jsxs("div",{style:{display:"flex"},children:[v.jsx($n,{image:f,title:p,canvasWidth:B*N,canvasHeight:B*V,scale:B}),v.jsx($n,{image:y,title:"Actual",canvasWidth:B*N,canvasHeight:B*V,scale:B})]})]}),!i&&v.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[v.jsx("div",{children:n.diff&&v.jsx("a",{target:"_blank",href:n.diff.attachment.path,rel:"noreferrer",children:n.diff.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.actual.attachment.path,rel:"noreferrer",children:n.actual.attachment.name})}),v.jsx("div",{children:v.jsx("a",{target:e?"":"_blank",href:n.expected.attachment.path,rel:"noreferrer",children:n.expected.attachment.name})})]})]})})},Vx=({expectedImage:n,actualImage:e,canvasWidth:i,canvasHeight:s,scale:l,expectedTitle:o,hideSize:u})=>{const f={position:"absolute",top:0,left:0},[d,p]=q.useState(i/2),m=n.naturalWidth===e.naturalWidth&&n.naturalHeight===e.naturalHeight;return v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[!u&&v.jsxs("div",{style:{margin:5},children:[!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!m&&v.jsx("span",{children:e.naturalWidth}),!m&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!m&&v.jsx("span",{children:e.naturalHeight})]}),v.jsxs("div",{style:{position:"relative",width:i,height:s,margin:15,...dh},children:[v.jsx(W0,{orientation:"horizontal",offsets:[d],setOffsets:y=>p(y[0]),resizerColor:"#57606a80",resizerWidth:6}),v.jsx("img",{alt:o,style:{width:n.naturalWidth*l,height:n.naturalHeight*l},draggable:"false",src:n.src}),v.jsx("div",{style:{...f,bottom:0,overflow:"hidden",width:d,...dh},children:v.jsx("img",{alt:"Actual",style:{width:e.naturalWidth*l,height:e.naturalHeight*l},draggable:"false",src:e.src})})]})]})},$n=({image:n,title:e,alt:i,hideSize:s,canvasWidth:l,canvasHeight:o,scale:u,onClick:f})=>v.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[!s&&v.jsxs("div",{style:{margin:5},children:[e&&v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:e}),v.jsx("span",{children:n.naturalWidth}),v.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),v.jsx("span",{children:n.naturalHeight})]}),v.jsx("div",{style:{display:"flex",flex:"none",width:l,height:o,margin:15,...dh},children:v.jsx("img",{width:n.naturalWidth*u,height:n.naturalHeight*u,alt:e||i,style:{cursor:f?"pointer":"initial"},draggable:"false",src:n.src,onClick:f})})]}),Gx="modulepreload",Kx=function(n,e){return new URL(n,e).href},Uy={},Yx=function(e,i,s){let l=Promise.resolve();if(i&&i.length>0){let u=function(m){return Promise.all(m.map(y=>Promise.resolve(y).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const f=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(i.map(m=>{if(m=Kx(m,s),m in Uy)return;Uy[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(!!s)for(let x=f.length-1;x>=0;x--){const E=f[x];if(E.href===m&&(!y||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const T=document.createElement("link");if(T.rel=y?"stylesheet":Gx,y||(T.as="script"),T.crossOrigin="",T.href=m,p&&T.setAttribute("nonce",p),document.head.appendChild(T),y)return new Promise((x,E)=>{T.addEventListener("load",x),T.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return e().catch(o)})},Xx=20,cr=({text:n,highlighter:e,mimeType:i,linkify:s,readOnly:l,highlight:o,revealLine:u,lineNumbers:f,isFocused:d,focusOnChange:p,wrapLines:m,onChange:y,dataTestId:b,placeholder:w})=>{const[T,x]=es(),[E]=q.useState(Yx(()=>import("./codeMirrorModule-eyVcHN77.js"),__vite__mapDeps([0,1]),import.meta.url).then($=>$.default)),k=q.useRef(null),[N,V]=q.useState();return q.useEffect(()=>{(async()=>{var I,j;const $=await E;Fx($);const B=x.current;if(!B)return;const Y=Zx(e)||Qx(i)||(s?"text/linkified":"");if(k.current&&Y===k.current.cm.getOption("mode")&&!!l===k.current.cm.getOption("readOnly")&&f===k.current.cm.getOption("lineNumbers")&&m===k.current.cm.getOption("lineWrapping")&&w===k.current.cm.getOption("placeholder"))return;(j=(I=k.current)==null?void 0:I.cm)==null||j.getWrapperElement().remove();const J=$(B,{value:"",mode:Y,readOnly:!!l,lineNumbers:f,lineWrapping:m,placeholder:w});return k.current={cm:J},d&&J.focus(),V(J),J})()},[E,N,x,e,i,s,f,m,l,d,w]),q.useEffect(()=>{k.current&&k.current.cm.setSize(T.width,T.height)},[T]),q.useLayoutEffect(()=>{var Y;if(!N)return;let $=!1;if(N.getValue()!==n&&(N.setValue(n),$=!0,p&&(N.execCommand("selectAll"),N.focus())),$||JSON.stringify(o)!==JSON.stringify(k.current.highlight)){for(const j of k.current.highlight||[])N.removeLineClass(j.line-1,"wrap");for(const j of o||[])N.addLineClass(j.line-1,"wrap",`source-line-${j.type}`);for(const j of k.current.widgets||[])N.removeLineWidget(j);for(const j of k.current.markers||[])j.clear();const J=[],I=[];for(const j of o||[]){if(j.type!=="subtle-error"&&j.type!=="error")continue;const te=(Y=k.current)==null?void 0:Y.cm.getLine(j.line-1);if(te){const re={};re.title=j.message||"",I.push(N.markText({line:j.line-1,ch:0},{line:j.line-1,ch:j.column||te.length},{className:"source-line-error-underline",attributes:re}))}if(j.type==="error"){const re=document.createElement("div");re.innerHTML=Xa(j.message||""),re.className="source-line-error-widget",J.push(N.addLineWidget(j.line,re,{above:!0,coverGutter:!1}))}}k.current.highlight=o,k.current.widgets=J,k.current.markers=I}typeof u=="number"&&k.current.cm.lineCount()>=u&&N.scrollIntoView({line:Math.max(0,u-1),ch:0},50);let B;return y&&(B=()=>y(N.getValue()),N.on("change",B)),()=>{B&&N.off("change",B)}},[N,n,o,u,p,y]),v.jsx("div",{"data-testid":b,className:"cm-wrapper",ref:x,onClick:Px})};function Px(n){var i;if(!(n.target instanceof HTMLElement))return;let e;n.target.classList.contains("cm-linkified")?e=n.target.textContent:n.target.classList.contains("cm-link")&&((i=n.target.nextElementSibling)!=null&&i.classList.contains("cm-url"))&&(e=n.target.nextElementSibling.textContent.slice(1,-1)),e&&(n.preventDefault(),n.stopPropagation(),window.open(e,"_blank"))}let Hy=!1;function Fx(n){Hy||(Hy=!0,n.defineSimpleMode("text/linkified",{start:[{regex:x0,token:"linkified"}]}))}function Qx(n){if(n){if(n.includes("javascript")||n.includes("json"))return"javascript";if(n.includes("python"))return"python";if(n.includes("csharp"))return"text/x-csharp";if(n.includes("java"))return"text/x-java";if(n.includes("markdown"))return"markdown";if(n.includes("html")||n.includes("svg"))return"htmlmixed";if(n.includes("css"))return"css"}}function Zx(n){if(n)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[n]}function Jx(n){return!!n.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const Wx=({title:n,children:e,setExpanded:i,expanded:s,expandOnTitleClick:l})=>{const o=q.useId();return v.jsxs("div",{className:Ke("expandable",s&&"expanded"),children:[v.jsxs("div",{role:"button","aria-expanded":s,"aria-controls":o,className:"expandable-title",onClick:()=>l&&i(!s),children:[v.jsx("div",{className:Ke("codicon",s?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!l&&i(!s)}),n]}),s&&v.jsx("div",{id:o,role:"region",style:{marginLeft:25},children:e})]})};function eb(n){const e=[];let i=0,s;for(;(s=x0.exec(n))!==null;){const o=n.substring(i,s.index);o&&e.push(o);const u=s[0];e.push(e_(u)),i=s.index+u.length}const l=n.substring(i);return l&&e.push(l),e}function e_(n){let e=n;return e.startsWith("www.")&&(e="https://"+e),v.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:n})}const t_=({attachment:n,reveal:e})=>{const[i,s]=q.useState(!1),[l,o]=q.useState(null),[u,f]=q.useState(null),[d,p]=kw(),m=q.useRef(null),y=Jx(n.contentType),b=!!n.sha1||!!n.path;q.useEffect(()=>{var x;if(e)return(x=m.current)==null||x.scrollIntoView({behavior:"smooth"}),p()},[e,p]),q.useEffect(()=>{i&&l===null&&u===null&&(f("Loading ..."),fetch(rc(n)).then(x=>x.text()).then(x=>{o(x),f(null)}).catch(x=>{f("Failed to load: "+x.message)}))},[i,l,u,n]);const w=q.useMemo(()=>{const x=l?l.split(`
59
59
  `).length:0;return Math.min(Math.max(5,x),20)*Xx},[l]),T=v.jsxs("span",{style:{marginLeft:5},ref:m,"aria-label":n.name,children:[v.jsx("span",{children:eb(n.name)}),b&&v.jsx("a",{style:{marginLeft:5},href:Lo(n),children:"download"})]});return!y||!b?v.jsx("div",{style:{marginLeft:20},children:T}):v.jsxs("div",{className:Ke(d&&"yellow-flash"),children:[v.jsx(Wx,{title:T,expanded:i,setExpanded:s,expandOnTitleClick:!0,children:u&&v.jsx("i",{children:u})}),i&&l!==null&&v.jsx("div",{className:"vbox",style:{height:w},children:v.jsx(cr,{text:l,readOnly:!0,mimeType:n.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},n_=({model:n,revealedAttachment:e})=>{const{diffMap:i,screenshots:s,attachments:l}=q.useMemo(()=>{const o=new Set((n==null?void 0:n.visibleAttachments)??[]),u=new Set,f=new Map;for(const d of o){if(!d.path&&!d.sha1)continue;const p=d.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(p){const m=p[1],y=p[2],b=f.get(m)||{expected:void 0,actual:void 0,diff:void 0};b[y]=d,f.set(m,b),o.delete(d)}else d.contentType.startsWith("image/")&&(u.add(d),o.delete(d))}return{diffMap:f,attachments:o,screenshots:u}},[n]);return!i.size&&!s.size&&!l.size?v.jsx(ts,{text:"No attachments"}):v.jsxs("div",{className:"attachments-tab",children:[[...i.values()].map(({expected:o,actual:u,diff:f})=>v.jsxs(v.Fragment,{children:[o&&u&&v.jsx("div",{className:"attachments-section",children:"Image diff"}),o&&u&&v.jsx(Ix,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...o,path:Lo(o)},title:"Expected"},actual:{attachment:{...u,path:Lo(u)}},diff:f?{attachment:{...f,path:Lo(f)}}:void 0}})]})),s.size?v.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...s.values()].map((o,u)=>{const f=rc(o);return v.jsxs("div",{className:"attachment-item",children:[v.jsx("div",{children:v.jsx("img",{draggable:"false",src:f})}),v.jsx("div",{children:v.jsx("a",{target:"_blank",href:f,rel:"noreferrer",children:o.name})})]},`screenshot-${u}`)}),l.size?v.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...l.values()].map((o,u)=>v.jsx("div",{className:"attachment-item",children:v.jsx(t_,{attachment:o,reveal:e&&i_(o,e[0])?e:void 0})},s_(o,u)))]})};function i_(n,e){return n.name===e.name&&n.path===e.path&&n.sha1===e.sha1}function rc(n,e={}){const i=new URLSearchParams(e);return n.sha1?(i.set("trace",n.traceUrl),"sha1/"+n.sha1+"?"+i.toString()):(i.set("path",n.path),"file?"+i.toString())}function Lo(n){const e={dn:n.name};return n.contentType&&(e.dct=n.contentType),rc(n,e)}function s_(n,e){return e+"-"+(n.sha1?"sha1-"+n.sha1:"path-"+n.path)}const r_=`
60
60
  # Instructions
61
61
 
@@ -262,4 +262,4 @@ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.pus
262
262
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
263
263
  `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const l="end"in i.value?i.value.end:void 0,o=Array.isArray(l)?l[l.length-1]:void 0;(o==null?void 0:o.type)==="comment"?l==null||l.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,e.indent)){const l=e.items[e.items.length-2],o=(s=l==null?void 0:l.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const l=!this.onKeyLine&&this.indent===e.indent,o=l&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(o&&i.sep&&!i.value){const f=[];for(let d=0;d<i.sep.length;++d){const p=i.sep[d];switch(p.type){case"newline":f.push(d);break;case"space":break;case"comment":p.indent>e.indent&&(f.length=0);break;default:f.length=0}}f.length>=2&&(u=i.sep.splice(f[1]))}switch(this.type){case"anchor":case"tag":o||i.value?(u.push(this.sourceToken),e.items.push({start:u}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):o||i.value?(u.push(this.sourceToken),e.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Xi(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(Zv(i.key)&&!Xi(i.sep,"newline")){const f=Zs(i.start),d=i.key,p=i.sep;p.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:d,sep:p}]})}else u.length>0?i.sep=i.sep.concat(u,this.sourceToken):i.sep.push(this.sourceToken);else if(Xi(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const f=Zs(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||o?e.items.push({start:u,key:null,sep:[this.sourceToken]}):Xi(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const f=this.flowScalar(this.type);o||i.value?(e.items.push({start:u,key:f,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(f):(Object.assign(i,{key:f,sep:[]}),this.onKeyLine=!0);return}default:{const f=this.startBlockValue(e);if(f){l&&f.type!=="block-seq"&&e.items.push({start:u}),this.stack.push(f);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var s;const i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){const l="end"in i.value?i.value.end:void 0,o=Array.isArray(l)?l[l.length-1]:void 0;(o==null?void 0:o.type)==="comment"?l==null||l.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){const l=e.items[e.items.length-2],o=(s=l==null?void 0:l.value)==null?void 0:s.end;if(Array.isArray(o)){Array.prototype.push.apply(o,i.start),o.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||Xi(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){const l=this.startBlockValue(e);if(l){this.stack.push(l);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s&&s.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:l,sep:[]}):i.sep?this.stack.push(l):Object.assign(i,{key:l,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const l=Ao(s),o=Zs(l);m0(e);const u=e.end.splice(1,e.end.length);u.push(this.sourceToken);const f={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(`
264
264
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
265
- `,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Ao(e),s=Zs(i);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Ao(e),s=Zs(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Jv(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Qv||null,prettyErrors:e}}function pN(n,e={}){const{lineCounter:i,prettyErrors:s}=Jv(e),l=new Sd(i==null?void 0:i.addNewLine),o=new vd(e),u=Array.from(o.compose(l.parse(n)));if(s&&i)for(const f of u)f.errors.forEach(ec(n,i)),f.warnings.forEach(ec(n,i));return u.length>0?u:Object.assign([],{empty:!0},o.streamInfo())}function Wv(n,e={}){const{lineCounter:i,prettyErrors:s}=Jv(e),l=new Sd(i==null?void 0:i.addNewLine),o=new vd(e);let u=null;for(const f of o.compose(l.parse(n),!0,n.length))if(!u)u=f;else if(u.options.logLevel!=="silent"){u.errors.push(new Qi(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(u.errors.forEach(ec(n,i)),u.warnings.forEach(ec(n,i))),u}function gN(n,e,i){let s;typeof e=="function"?s=e:i===void 0&&e&&typeof e=="object"&&(i=e);const l=Wv(n,i);if(!l)return null;if(l.warnings.forEach(o=>vv(l.options.logLevel,o)),l.errors.length>0){if(l.options.logLevel!=="silent")throw l.errors[0];l.errors=[]}return l.toJS(Object.assign({reviver:s},i))}function mN(n,e,i){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const l=Math.round(i);i=l<1?void 0:l>8?{indent:8}:{indent:l}}if(n===void 0){const{keepUndefined:l}=i??e??{};if(!l)return}return is(n)&&!s?n.toString(i):new wr(n,s,i).toString(i)}const eS=Object.freeze(Object.defineProperty({__proto__:null,Alias:uc,CST:fN,Composer:vd,Document:wr,Lexer:Fv,LineCounter:Qv,Pair:bt,Parser:Sd,Scalar:fe,Schema:vc,YAMLError:yd,YAMLMap:Kt,YAMLParseError:Qi,YAMLSeq:wi,YAMLWarning:Hv,isAlias:ns,isCollection:ze,isDocument:is,isMap:yr,isNode:qe,isPair:Be,isScalar:Le,isSeq:br,parse:gN,parseAllDocuments:pN,parseDocument:Wv,stringify:mN,visit:Si,visitAsync:cc},Symbol.toStringTag,{value:"Module"})),yN=({action:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})=>{const[f,d]=q.useState("action"),[p]=xn("shouldPopulateCanvasFromScreenshot",!1),m=q.useMemo(()=>wN(n),[n]),{snapshotInfoUrl:y,snapshotUrl:b,popoutUrl:w}=q.useMemo(()=>{const x=m[f];return x?xN(x,p):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[m,f,p]),T=q.useMemo(()=>y!==void 0?{snapshotInfoUrl:y,snapshotUrl:b,popoutUrl:w}:void 0,[y,b,w]);return v.jsxs("div",{className:"snapshot-tab vbox",children:[v.jsxs(Bh,{children:[v.jsx(Xt,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:s,onClick:()=>l(!s)}),["action","before","after"].map(x=>v.jsx(ib,{id:x,title:SN(x),selected:f===x,onSelect:()=>d(x)},x)),v.jsx("div",{style:{flex:"auto"}}),v.jsx(Xt,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(T!=null&&T.popoutUrl),onClick:()=>{const x=window.open((T==null?void 0:T.popoutUrl)||"","_blank");x==null||x.addEventListener("DOMContentLoaded",()=>{new nv(x,{isUnderTest:nS,sdkLanguage:e,testIdAttributeName:i,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),v.jsx(bN,{snapshotUrls:T,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})]})},bN=({snapshotUrls:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})=>{const f=q.useRef(null),d=q.useRef(null),[p,m]=q.useState({viewport:iS,url:""}),y=q.useRef({iteration:0,visibleIframe:0});return q.useEffect(()=>{(async()=>{const b=y.current.iteration+1,w=1-y.current.visibleIframe;y.current.iteration=b;const T=await _N(n==null?void 0:n.snapshotInfoUrl);if(y.current.iteration!==b)return;const x=[f,d][w].current;if(x){let E=()=>{};const k=new Promise(N=>E=N);try{x.addEventListener("load",E),x.addEventListener("error",E);const N=(n==null?void 0:n.snapshotUrl)||EN;x.contentWindow?x.contentWindow.location.replace(N):x.src=N,await k}catch{}finally{x.removeEventListener("load",E),x.removeEventListener("error",E)}}y.current.iteration===b&&(y.current.visibleIframe=w,m(T))})()},[n]),v.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:b=>{b.key==="Escape"&&s&&l(!1)},children:[v.jsx(y0,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:f.current,iteration:y.current.iteration}),v.jsx(y0,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:d.current,iteration:y.current.iteration}),v.jsx(vN,{snapshotInfo:p,children:v.jsxs("div",{className:"snapshot-switcher",children:[v.jsx("iframe",{ref:f,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===0&&"snapshot-visible")}),v.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},vN=({snapshotInfo:n,children:e})=>{const[i,s]=es(),o={width:n.viewport.width,height:n.viewport.height+40},u=Math.min(i.width/o.width,i.height/o.height,1),f={x:(i.width-o.width)/2,y:(i.height-o.height)/2};return v.jsx("div",{ref:s,className:"snapshot-wrapper",children:v.jsxs("div",{className:"snapshot-container",style:{width:o.width+"px",height:o.height+"px",transform:`translate(${f.x}px, ${f.y}px) scale(${u})`},children:[v.jsx(lA,{url:n.url}),e]})})};function SN(n){return n==="before"?"Before":n==="after"?"After":n==="action"?"Action":n}const y0=({iframe:n,isInspecting:e,sdkLanguage:i,testIdAttributeName:s,highlightedElement:l,setHighlightedElement:o,iteration:u})=>(q.useEffect(()=>{const f=l.lastEdited==="ariaSnapshot"?l.ariaSnapshot:void 0,d=l.lastEdited==="locator"?l.locator:void 0,p=!!f||!!d||e,m=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{tS(m,p,i,s,y,"",n==null?void 0:n.contentWindow)}catch{}const b=f?Uh(eS,f):void 0,w=d?rA(i,d,s):void 0;for(const{recorder:T,frameSelector:x}of m){const E=w!=null&&w.startsWith(x)?w.substring(x.length).trim():void 0,k=(b==null?void 0:b.errors.length)===0?b.fragment:void 0;T.setUIState({mode:e?"inspecting":"none",actionSelector:E,ariaTemplate:k,language:i,testIdAttributeName:s,overlay:{offsetX:0}},{async elementPicked(N){o({locator:Ji(i,x+N.selector),ariaSnapshot:N.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const N of m)N.recorder!==T&&N.recorder.clearHighlight()}})}},[n,e,l,o,i,s,u]),v.jsx(v.Fragment,{}));function tS(n,e,i,s,l,o,u){if(!u)return;const f=u;if(!f._recorder&&e){const d=new nv(u,{isUnderTest:l,sdkLanguage:i,testIdAttributeName:s,stableRafCount:1,browserName:"chromium",customEngines:[]}),p=new WT(d);f._injectedScript=d,f._recorder={recorder:p,frameSelector:o},l&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(p)))}f._recorder&&n.push(f._recorder);for(let d=0;d<u.frames.length;++d){const p=u.frames[d],m=p.frameElement?f._injectedScript.generateSelectorSimple(p.frameElement,{omitInternalEngines:!0,testIdAttributeName:s})+" >> internal:control=enter-frame >> ":"";tS(n,e,i,s,l,o+m,p)}}const Oa=(n,e,i=!1)=>{if(!n)return;const s=n[e];if(s){if(!n.pageId){console.error("snapshot action must have a pageId");return}return{action:n,snapshotName:s,pageId:n.pageId,point:n.point,hasInputTarget:i}}};function wN(n){if(!n)return{};let e=Oa(n,"beforeSnapshot");if(!e){for(let l=Ey(n);l;l=Ey(l))if(l.endTime<=n.startTime&&l.afterSnapshot){e=Oa(l,"afterSnapshot");break}}let i=Oa(n,"afterSnapshot");if(!i){let l;for(let o=Ty(n);o&&o.startTime<=n.endTime;o=Ty(o))o.endTime>n.endTime||!o.afterSnapshot||l&&l.endTime>o.endTime||(l=o);l?i=Oa(l,"afterSnapshot"):i=e}const s=Oa(n,"inputSnapshot",!0)??i;return s&&(s.point=n.point),{action:s,before:e,after:i}}const nS=new URLSearchParams(window.location.search).has("isUnderTest"),b0=new URLSearchParams(window.location.search).get("server");function xN(n,e){const i=new URLSearchParams;i.set("trace",$o(n.action).traceUrl),i.set("name",n.snapshotName),nS&&i.set("isUnderTest","true"),n.point&&(i.set("pointX",String(n.point.x)),i.set("pointY",String(n.point.y)),n.hasInputTarget&&i.set("hasInputTarget","1")),e&&i.set("shouldPopulateCanvasFromScreenshot","1");const s=new URL(`snapshot/${n.pageId}?${i.toString()}`,window.location.href).toString(),l=new URL(`snapshotInfo/${n.pageId}?${i.toString()}`,window.location.href).toString(),o=new URLSearchParams;o.set("r",s),b0&&o.set("server",b0),o.set("trace",$o(n.action).traceUrl),n.point&&(o.set("pointX",String(n.point.x)),o.set("pointY",String(n.point.y)),n.hasInputTarget&&i.set("hasInputTarget","1"));const u=new URL(`snapshot.html?${o.toString()}`,window.location.href).toString();return{snapshotInfoUrl:l,snapshotUrl:s,popoutUrl:u}}async function _N(n){const e={url:"",viewport:iS,timestamp:void 0,wallTime:void 0};if(n){const s=await(await fetch(n)).json();s.error||(e.url=s.url,e.viewport=s.viewport,e.timestamp=s.timestamp,e.wallTime=s.wallTime)}return e}const iS={width:1280,height:720},EN='data:text/html,<body style="background: #ddd"></body>',sS={width:200,height:45},Ws=2.5,TN=sS.height+Ws*2,AN=({model:n,boundaries:e,previewPoint:i})=>{var m,y;const[s,l]=es(),o=q.useRef(null);let u=0;if(o.current&&i){const b=o.current.getBoundingClientRect();u=(i.clientY-b.top+o.current.scrollTop)/TN|0}const f=(y=(m=n==null?void 0:n.pages)==null?void 0:m[u])==null?void 0:y.screencastFrames;let d,p;if(i!==void 0&&f&&f.length){const b=e.minimum+(e.maximum-e.minimum)*i.x/s.width;d=f[S0(f,b,rS)-1];const w={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};p=d?aS({width:d.width,height:d.height},w):void 0}return v.jsxs("div",{className:"film-strip",ref:l,children:[v.jsx("div",{className:"film-strip-lanes",ref:o,children:n==null?void 0:n.pages.map((b,w)=>b.screencastFrames.length?v.jsx(NN,{boundaries:e,page:b,width:s.width},w):null)}),(i==null?void 0:i.x)!==void 0&&v.jsxs("div",{className:"film-strip-hover",style:{top:s.bottom+5,left:Math.min(i.x,s.width-(p?p.width:0)-10)},children:[i.action&&v.jsx("div",{className:"film-strip-hover-title",children:Rh(i.action,i)}),d&&p&&v.jsx("div",{style:{width:p.width,height:p.height},children:v.jsx("img",{src:`sha1/${d.sha1}`,width:p.width,height:p.height})})]})]})},NN=({boundaries:n,page:e,width:i})=>{const s={width:0,height:0},l=e.screencastFrames;for(const x of l)s.width=Math.max(s.width,x.width),s.height=Math.max(s.height,x.height);const o=aS(s,sS),u=l[0].timestamp,f=l[l.length-1].timestamp,d=n.maximum-n.minimum,p=(u-n.minimum)/d*i,m=(n.maximum-f)/d*i,b=(f-u)/d*i/(o.width+2*Ws)|0,w=(f-u)/b,T=[];for(let x=0;u&&w&&x<b;++x){const E=u+w*x,k=S0(l,E,rS)-1;T.push(v.jsx("div",{className:"film-strip-frame",style:{width:o.width,height:o.height,backgroundImage:`url(sha1/${l[k].sha1})`,backgroundSize:`${o.width}px ${o.height}px`,margin:Ws,marginRight:Ws}},x))}return T.push(v.jsx("div",{className:"film-strip-frame",style:{width:o.width,height:o.height,backgroundImage:`url(sha1/${l[l.length-1].sha1})`,backgroundSize:`${o.width}px ${o.height}px`,margin:Ws,marginRight:Ws}},T.length)),v.jsx("div",{className:"film-strip-lane",style:{marginLeft:p+"px",marginRight:m+"px"},children:T})};function rS(n,e){return n-e.timestamp}function aS(n,e){const i=Math.max(n.width/e.width,n.height/e.height);return{width:n.width/i|0,height:n.height/i|0}}const CN=({model:n,boundaries:e,consoleEntries:i,onSelected:s,highlightedAction:l,highlightedEntry:o,highlightedConsoleEntry:u,selectedTime:f,setSelectedTime:d,sdkLanguage:p})=>{const[m,y]=es(),[b,w]=q.useState(),[T,x]=q.useState(),[E]=xn("actionsFilter",[]),{offsets:k,curtainLeft:N,curtainRight:V}=q.useMemo(()=>{let L=f||e;if(b&&b.startX!==b.endX){const z=wn(m.width,e,b.startX),Z=wn(m.width,e,b.endX);L={minimum:Math.min(z,Z),maximum:Math.max(z,Z)}}const F=sn(m.width,e,L.minimum),me=sn(m.width,e,e.maximum)-sn(m.width,e,L.maximum);return{offsets:kN(m.width,e),curtainLeft:F,curtainRight:me}},[f,e,b,m]),$=q.useMemo(()=>n==null?void 0:n.filteredActions(E),[n,E]),B=q.useMemo(()=>{const L=[];for(const F of $||[])L.push({action:F,leftTime:F.startTime,rightTime:F.endTime||e.maximum,leftPosition:sn(m.width,e,F.startTime),rightPosition:sn(m.width,e,F.endTime||e.maximum),active:!1,error:!!F.error});for(const F of(n==null?void 0:n.resources)||[]){const ge=F._monotonicTime,me=F._monotonicTime+F.time;L.push({resource:F,leftTime:ge,rightTime:me,leftPosition:sn(m.width,e,ge),rightPosition:sn(m.width,e,me),active:!1,error:!1})}for(const F of i||[])L.push({consoleMessage:F,leftTime:F.timestamp,rightTime:F.timestamp,leftPosition:sn(m.width,e,F.timestamp),rightPosition:sn(m.width,e,F.timestamp),active:!1,error:F.isError});return L},[n,$,i,e,m]);q.useMemo(()=>{for(const L of B)l?L.active=L.action===l:o?L.active=L.resource===o:u?L.active=L.consoleMessage===u:L.active=!1},[B,l,o,u]);const Y=q.useCallback(L=>{if(x(void 0),!y.current)return;const F=L.clientX-y.current.getBoundingClientRect().left,ge=wn(m.width,e,F),me=f?sn(m.width,e,f.minimum):0,z=f?sn(m.width,e,f.maximum):0;f&&Math.abs(F-me)<10?w({startX:z,endX:F,type:"resize"}):f&&Math.abs(F-z)<10?w({startX:me,endX:F,type:"resize"}):f&&ge>f.minimum&&ge<f.maximum&&L.clientY-y.current.getBoundingClientRect().top<20?w({startX:me,endX:z,pivot:F,type:"move"}):w({startX:F,endX:F,type:"resize"})},[e,m,y,f]),J=q.useCallback(L=>{if(!y.current)return;const F=L.clientX-y.current.getBoundingClientRect().left,ge=wn(m.width,e,F),me=$==null?void 0:$.findLast(Se=>Se.startTime<=ge);if(!L.buttons){w(void 0);return}if(me&&s(me),!b)return;let z=b;if(b.type==="resize")z={...b,endX:F};else{const Se=F-b.pivot;let C=b.startX+Se,X=b.endX+Se;C<0&&(C=0,X=C+(b.endX-b.startX)),X>m.width&&(X=m.width,C=X-(b.endX-b.startX)),z={...b,startX:C,endX:X,pivot:F}}w(z);const Z=wn(m.width,e,z.startX),ne=wn(m.width,e,z.endX);Z!==ne&&d({minimum:Math.min(Z,ne),maximum:Math.max(Z,ne)})},[e,b,m,$,s,y,d]),I=q.useCallback(()=>{if(x(void 0),!!b){if(b.startX!==b.endX){const L=wn(m.width,e,b.startX),F=wn(m.width,e,b.endX);d({minimum:Math.min(L,F),maximum:Math.max(L,F)})}else{const L=wn(m.width,e,b.startX),F=$==null?void 0:$.findLast(ge=>ge.startTime<=L);F&&s(F),d(void 0)}w(void 0)}},[e,b,m,$,d,s]),j=q.useCallback(L=>{if(!y.current)return;const F=L.clientX-y.current.getBoundingClientRect().left,ge=wn(m.width,e,F),me=$==null?void 0:$.findLast(z=>z.startTime<=ge);x({x:F,clientY:L.clientY,action:me,sdkLanguage:p})},[e,m,$,y,p]),te=q.useCallback(()=>{x(void 0)},[]),re=q.useCallback(()=>{d(void 0)},[d]);return v.jsxs("div",{className:"timeline-view-container",children:[!!b&&v.jsx(J0,{cursor:(b==null?void 0:b.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:I,onPaneMouseMove:J,onPaneDoubleClick:re}),v.jsxs("div",{ref:y,className:"timeline-view",onMouseDown:Y,onMouseMove:j,onMouseLeave:te,children:[v.jsx("div",{className:"timeline-grid",children:k.map((L,F)=>v.jsx("div",{className:"timeline-divider",style:{left:L.position+"px"},children:v.jsx("div",{className:"timeline-time",children:_t(L.time-e.minimum)})},F))}),v.jsx("div",{style:{height:8}}),v.jsx(AN,{model:n,boundaries:e,previewPoint:T}),v.jsx("div",{className:"timeline-bars",children:B.filter(L=>!L.action||L.action.class!=="Test").map((L,F)=>v.jsx("div",{className:Ke("timeline-bar",L.action&&"action",L.resource&&"network",L.consoleMessage&&"console-message",L.active&&"active",L.error&&"error"),style:{left:L.leftPosition,width:Math.max(5,L.rightPosition-L.leftPosition),top:MN(L),bottom:0}},F))}),v.jsx("div",{className:"timeline-marker",style:{display:T!==void 0?"block":"none",left:((T==null?void 0:T.x)||0)+"px"}}),f&&v.jsxs("div",{className:"timeline-window",children:[v.jsx("div",{className:"timeline-window-curtain left",style:{width:N}}),v.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),v.jsx("div",{className:"timeline-window-center",children:v.jsx("div",{className:"timeline-window-drag"})}),v.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),v.jsx("div",{className:"timeline-window-curtain right",style:{width:V}})]})]})]})};function kN(n,e){let s=n/64;const l=e.maximum-e.minimum,o=n/l;let u=l/s;const f=Math.ceil(Math.log(u)/Math.LN10);u=Math.pow(10,f),u*o>=320&&(u=u/5),u*o>=128&&(u=u/2);const d=e.minimum;let p=e.maximum;p+=64/o,s=Math.ceil((p-d)/u),u||(s=0);const m=[];for(let y=0;y<s;++y){const b=d+u*y;m.push({position:sn(n,e,b),time:b})}return m}function sn(n,e,i){return(i-e.minimum)/(e.maximum-e.minimum)*n}function wn(n,e,i){return i/n*(e.maximum-e.minimum)+e.minimum}function MN(n){return n.resource?25:20}const ON=({model:n})=>{var i,s;if(!n)return v.jsx(v.Fragment,{});const e=n.wallTime!==void 0?new Date(n.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return v.jsxs("div",{style:{flex:"auto",display:"block",overflow:"hidden auto"},children:[v.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&v.jsxs("div",{className:"call-line",children:["start time:",v.jsx("span",{className:"call-value datetime",title:e,children:e})]}),v.jsxs("div",{className:"call-line",children:["duration:",v.jsx("span",{className:"call-value number",title:_t(n.endTime-n.startTime),children:_t(n.endTime-n.startTime)})]}),v.jsx("div",{className:"call-section",children:"Browser"}),v.jsxs("div",{className:"call-line",children:["engine:",v.jsx("span",{className:"call-value string",title:n.browserName,children:n.browserName})]}),n.channel&&v.jsxs("div",{className:"call-line",children:["channel:",v.jsx("span",{className:"call-value string",title:n.channel,children:n.channel})]}),n.platform&&v.jsxs("div",{className:"call-line",children:["platform:",v.jsx("span",{className:"call-value string",title:n.platform,children:n.platform})]}),n.options.userAgent&&v.jsxs("div",{className:"call-line",children:["user agent:",v.jsx("span",{className:"call-value datetime",title:n.options.userAgent,children:n.options.userAgent})]}),n.options.baseURL&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),v.jsxs("div",{className:"call-line",children:["baseURL:",v.jsx("a",{className:"call-value string",href:n.options.baseURL,title:n.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:n.options.baseURL})]})]}),v.jsx("div",{className:"call-section",children:"Viewport"}),n.options.viewport&&v.jsxs("div",{className:"call-line",children:["width:",v.jsx("span",{className:"call-value number",title:String(!!((i=n.options.viewport)!=null&&i.width)),children:n.options.viewport.width})]}),n.options.viewport&&v.jsxs("div",{className:"call-line",children:["height:",v.jsx("span",{className:"call-value number",title:String(!!((s=n.options.viewport)!=null&&s.height)),children:n.options.viewport.height})]}),v.jsxs("div",{className:"call-line",children:["is mobile:",v.jsx("span",{className:"call-value boolean",title:String(!!n.options.isMobile),children:String(!!n.options.isMobile)})]}),n.options.deviceScaleFactor&&v.jsxs("div",{className:"call-line",children:["device scale:",v.jsx("span",{className:"call-value number",title:String(n.options.deviceScaleFactor),children:String(n.options.deviceScaleFactor)})]}),v.jsx("div",{className:"call-section",children:"Counts"}),v.jsxs("div",{className:"call-line",children:["pages:",v.jsx("span",{className:"call-value number",children:n.pages.length})]}),v.jsxs("div",{className:"call-line",children:["actions:",v.jsx("span",{className:"call-value number",children:n.actions.length})]}),v.jsxs("div",{className:"call-line",children:["events:",v.jsx("span",{className:"call-value number",children:n.events.length})]})]})},LN=({annotations:n})=>n.length?v.jsx("div",{className:"annotations-tab",children:n.map((e,i)=>v.jsxs("div",{className:"annotation-item",children:[v.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&v.jsxs("span",{children:[": ",eb(e.description)]})]},`annotation-${i}`))}):v.jsx(ts,{text:"No annotations"}),jN=({sdkLanguage:n,setIsInspecting:e,highlightedElement:i,setHighlightedElement:s})=>{const[l,o]=q.useState(),u=q.useCallback(f=>{const{errors:d}=Uh(eS,f,{prettyErrors:!1}),p=d.map(m=>({message:m.message,line:m.range[1].line,column:m.range[1].col,type:"subtle-error"}));o(p),s({...i,ariaSnapshot:f,lastEdited:"ariaSnapshot"}),e(!1)},[i,s,e]);return v.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[v.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[v.jsx("div",{style:{flex:"auto"},children:"Locator"}),v.jsx(Xt,{icon:"files",title:"Copy locator",onClick:()=>{py(i.locator||"")}})]}),v.jsx("div",{style:{height:50},children:v.jsx(cr,{text:i.locator||"",highlighter:n,isFocused:!0,wrapLines:!0,onChange:f=>{s({...i,locator:f,lastEdited:"locator"}),e(!1)}})}),v.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[v.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),v.jsx(Xt,{icon:"files",title:"Copy snapshot",onClick:()=>{py(i.ariaSnapshot||"")}})]}),v.jsx("div",{style:{height:150},children:v.jsx(cr,{text:i.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:l,onChange:u})})]})},RN=({className:n,style:e,open:i,isModal:s,minWidth:l,verticalOffset:o,requestClose:u,anchor:f,dataTestId:d,children:p})=>{const m=q.useRef(null),[y,b]=q.useState(0),w=ch(m),T=ch(f),x=DN(w,T,o);return q.useEffect(()=>{const E=N=>{!m.current||!(N.target instanceof Node)||m.current.contains(N.target)||u==null||u()},k=N=>{N.key==="Escape"&&(u==null||u())};return i?(document.addEventListener("mousedown",E),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",k)}):()=>{}},[i,u]),q.useEffect(()=>{const E=()=>b(k=>k+1);return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[]),q.useLayoutEffect(()=>{m.current&&(i?s?m.current.showModal():m.current.show():m.current.close())},[i,s]),v.jsx("dialog",{ref:m,style:{position:"fixed",margin:0,zIndex:110,top:x.top,left:x.left,minWidth:l||0,...e},className:n,"data-testid":d,children:p})};function DN(n,e,i=4,s=4){let l=Math.max(s,e.left);l+n.width>window.innerWidth-s&&(l=window.innerWidth-n.width-s);let o=Math.max(0,e.bottom)+i;return o+n.height>window.innerHeight-i&&(Math.max(0,e.top)>n.height+i?o=Math.max(0,e.top)-n.height-i:o=window.innerHeight-i-n.height),{left:l,top:o}}const BN=({title:n,icon:e,dialogDataTestId:i,children:s})=>{const l=q.useRef(null),[o,u]=q.useState(!1);return v.jsxs(v.Fragment,{children:[v.jsx(Xt,{ref:l,icon:e,title:n,onClick:()=>u(f=>!f)}),v.jsx(RN,{style:{backgroundColor:"var(--vscode-sideBar-background)",padding:"4px 8px"},open:o,verticalOffset:8,requestClose:()=>u(!1),anchor:l,dataTestId:i,children:s})]})},lS=({settings:n})=>v.jsx("div",{className:"vbox settings-view",children:n.map(e=>{const i=`setting-${e.name.replaceAll(/\s+/g,"-")}`;return v.jsx("div",{className:`setting setting-${e.type}`,title:e.title,children:UN(e,i)},e.name)})}),UN=(n,e)=>{switch(n.type){case"check":return v.jsxs(v.Fragment,{children:[v.jsx("input",{type:"checkbox",id:e,checked:n.value,onChange:()=>n.set(!n.value)}),v.jsxs("label",{htmlFor:e,children:[n.name,!!n.count&&v.jsx("span",{className:"setting-counter",children:n.count})]})]});case"select":return v.jsxs(v.Fragment,{children:[v.jsxs("label",{htmlFor:e,children:[n.name,":",!!n.count&&v.jsx("span",{className:"setting-counter",children:n.count})]}),v.jsx("select",{id:e,value:n.value,onChange:i=>n.set(i.target.value),children:n.options.map(i=>v.jsx("option",{value:i.value,children:i.label},i.value))})]});default:return null}},YN=({model:n,showSourcesFirst:e,rootDir:i,fallbackLocation:s,isLive:l,hideTimeline:o,status:u,annotations:f,inert:d,onOpenExternally:p,revealSource:m,testRunMetadata:y})=>{var Ei;const[b,w]=q.useState(void 0),[T,x]=q.useState(void 0),[E,k]=q.useState(void 0),[N,V]=q.useState(),[$,B]=q.useState(),[Y,J]=q.useState(),[I,j]=q.useState("actions"),[te,re]=xn("propertiesTab",e?"source":"call"),[L,F]=q.useState(!1),[ge,me]=q.useState({lastEdited:"none"}),[z,Z]=q.useState(),[ne,Se]=xn("propertiesSidebarLocation","bottom"),[C]=xn("actionsFilter",[]),X=q.useCallback(le=>{w(le==null?void 0:le.callId),x(void 0)},[]),Q=q.useMemo(()=>n==null?void 0:n.filteredActions(C),[n,C]),W=((n==null?void 0:n.actions.length)??0)-((Q==null?void 0:Q.length)??0),se=q.useMemo(()=>Q==null?void 0:Q.find(le=>le.callId===N),[Q,N]),ve=q.useCallback(le=>{V(le==null?void 0:le.callId)},[]),ue=q.useMemo(()=>(n==null?void 0:n.sources)||new Map,[n]);q.useEffect(()=>{Z(void 0),x(void 0)},[n]);const We=q.useMemo(()=>{if(b){const dt=Q==null?void 0:Q.find(At=>At.callId===b);if(dt)return dt}const le=n==null?void 0:n.failedAction();if(le)return le;if(Q!=null&&Q.length){let dt=Q.length-1;for(let At=0;At<Q.length;++At)if(Q[At].title==="After Hooks"&&At){dt=At-1;break}return Q[dt]}},[n,Q,b]),xe=q.useMemo(()=>se||We,[We,se]),gn=q.useMemo(()=>T?T.stack:xe==null?void 0:xe.stack,[xe,T]),ss=q.useCallback(le=>{X(le),ve(void 0)},[X,ve]),ht=q.useCallback(le=>{re(le),le!=="inspector"&&F(!1)},[re]),rs=q.useCallback(le=>{!L&&le&&ht("inspector"),F(le)},[F,ht,L]),xr=q.useCallback(le=>{me(le),ht("inspector")},[ht]),_r=q.useCallback(le=>{ht("attachments"),k(dt=>{if(!dt)return[le,0];const At=dt[1];return[le,At+1]})},[ht]);q.useEffect(()=>{m&&ht("source")},[m,ht]);const Er=v_(n,z),sl=G_(n,z),Ut=p_(n),Xn=(n==null?void 0:n.sdkLanguage)||"javascript",rl={id:"inspector",title:"Locator",render:()=>v.jsx(jN,{sdkLanguage:Xn,setIsInspecting:rs,highlightedElement:ge,setHighlightedElement:me})},al={id:"call",title:"Call",render:()=>v.jsx(Rx,{action:xe,startTimeOffset:(n==null?void 0:n.startTime)??0,sdkLanguage:Xn})},as={id:"log",title:"Log",render:()=>v.jsx(Ux,{action:xe,isLive:l})},_c={id:"errors",title:"Errors",errorCount:Ut.errors.size,render:()=>v.jsx(m_,{errorsModel:Ut,model:n,testRunMetadata:y,sdkLanguage:Xn,revealInSource:le=>{le.action?X(le.action):x(le),ht("source")},wallTime:(n==null?void 0:n.wallTime)??0})};let Tr;!We&&s&&(Tr=(Ei=s.source)==null?void 0:Ei.errors.length);const Ar={id:"source",title:"Source",errorCount:Tr,render:()=>v.jsx(f_,{stack:gn,sources:ue,rootDir:i,stackFrameLocation:ne==="bottom"?"right":"bottom",fallbackLocation:s,onOpenExternally:p})},Ec={id:"console",title:"Console",count:Er.entries.length,render:()=>v.jsx(S_,{consoleModel:Er,boundaries:rt,selectedTime:z,onAccepted:le=>Z({minimum:le.timestamp,maximum:le.timestamp}),onEntryHovered:J})},_i={id:"network",title:"Network",count:sl.resources.length,render:()=>v.jsx(K_,{boundaries:rt,networkModel:sl,onEntryHovered:B,sdkLanguage:(n==null?void 0:n.sdkLanguage)??"javascript"})},vt={id:"attachments",title:"Attachments",count:n==null?void 0:n.visibleAttachments.length,render:()=>v.jsx(n_,{model:n,revealedAttachment:E})},Tt=[rl,al,as,_c,Ec,_i,Ar,vt];if(f!==void 0){const le={id:"annotations",title:"Annotations",count:f.length,render:()=>v.jsx(LN,{annotations:f})};Tt.push(le)}if(e){const le=Tt.indexOf(Ar);Tt.splice(le,1),Tt.splice(1,0,Ar)}const{boundaries:rt}=q.useMemo(()=>{const le={minimum:(n==null?void 0:n.startTime)||0,maximum:(n==null?void 0:n.endTime)||3e4};return le.minimum>le.maximum&&(le.minimum=0,le.maximum=3e4),le.maximum+=(le.maximum-le.minimum)/20,{boundaries:le}},[n]);let ls=0;!l&&n&&n.endTime>=0?ls=n.endTime-n.startTime:n&&n.wallTime&&(ls=Date.now()-n.wallTime);const Tc={id:"actions",title:"Actions",component:v.jsxs("div",{className:"vbox",children:[u&&v.jsxs("div",{className:"workbench-run-status",children:[v.jsx("span",{className:Ke("codicon",Z0(u))}),v.jsx("div",{children:Mx(u)}),v.jsx("div",{className:"spacer"}),v.jsx("div",{className:"workbench-run-duration",children:ls?_t(ls):""})]}),v.jsx(Lx,{sdkLanguage:Xn,actions:Q||[],selectedAction:n?We:void 0,selectedTime:z,setSelectedTime:Z,onSelected:ss,onHighlighted:ve,revealAttachment:_r,revealConsole:()=>ht("console"),isLive:l}),v.jsxs("div",{className:"workbench-actions-status-bar",children:[!!W&&v.jsxs("span",{className:"workbench-actions-hidden-count",title:W+" actions hidden by filters",children:[W," hidden"]}),v.jsx(HN,{counters:n==null?void 0:n.actionCounters})]})]})},Ac={id:"metadata",title:"Metadata",component:v.jsx(ON,{model:n})};return v.jsxs("div",{className:"vbox workbench",...d?{inert:!0}:{},children:[!o&&v.jsx(CN,{model:n,consoleEntries:Er.entries,boundaries:rt,highlightedAction:se,highlightedEntry:$,highlightedConsoleEntry:Y,onSelected:ss,sdkLanguage:Xn,selectedTime:z,setSelectedTime:Z}),v.jsx(Io,{sidebarSize:250,orientation:ne==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:v.jsx(Io,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:v.jsx(yN,{action:xe,model:n,sdkLanguage:Xn,testIdAttributeName:(n==null?void 0:n.testIdAttributeName)||"data-testid",isInspecting:L,setIsInspecting:rs,highlightedElement:ge,setHighlightedElement:xr}),sidebar:v.jsx(ph,{tabs:[Tc,Ac],selectedTab:I,setSelectedTab:j})}),sidebar:v.jsx(ph,{tabs:Tt,selectedTab:te,setSelectedTab:ht,rightToolbar:[ne==="bottom"?v.jsx(Xt,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{Se("right")}}):v.jsx(Xt,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{Se("bottom")}})],mode:ne==="bottom"?"default":"select"})})]})},HN=({counters:n})=>{const[e,i]=xn("actionsFilter",[]);return v.jsx(BN,{icon:"filter",title:"Filter actions",dialogDataTestId:"actions-filter-dialog",children:v.jsx(lS,{settings:[{type:"check",value:e.includes("getter"),set:s=>i(s?[...e,"getter"]:e.filter(l=>l!=="getter")),name:"Getters",count:n==null?void 0:n.get("getter")},{type:"check",value:e.includes("route"),set:s=>i(s?[...e,"route"]:e.filter(l=>l!=="route")),name:"Network routes",count:n==null?void 0:n.get("route")},{type:"check",value:e.includes("configuration"),set:s=>i(s?[...e,"configuration"]:e.filter(l=>l!=="configuration")),name:"Configuration",count:n==null?void 0:n.get("configuration")}]})})};var v0;(n=>{function e(i){for(const s of i.splice(0))s.dispose()}n.disposeAll=e})(v0||(v0={}));class La{constructor(){this._listeners=new Set,this.event=(e,i)=>{this._listeners.add(e);let s=!1;const l=this,o={dispose(){s||(s=!0,l._listeners.delete(e))}};return i&&i.push(o),o}}fire(e){const i=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const s of this._listeners)this._deliveryQueue.push({listener:s,event:e});if(i){for(let s=0;s<this._deliveryQueue.length;s++){const{listener:l,event:o}=this._deliveryQueue[s];l.call(null,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class XN{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",i=>e(i.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class PN{constructor(e){this._onCloseEmitter=new La,this._onReportEmitter=new La,this._onStdioEmitter=new La,this._onTestFilesChangedEmitter=new La,this._onLoadTraceRequestedEmitter=new La,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this._transport=e,this._transport.onmessage(s=>{const l=JSON.parse(s),{id:o,result:u,error:f,method:d,params:p}=l;if(o){const m=this._callbacks.get(o);if(!m)return;this._callbacks.delete(o),f?m.reject(new Error(f)):m.resolve(u)}else this._dispatchEvent(d,p)});const i=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((s,l)=>{this._transport.onopen(s),this._transport.onerror(l)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(i)})}isClosed(){return this._isClosed}async _sendMessage(e,i){const s=globalThis.__logForTest;s==null||s({method:e,params:i}),await this._connectedPromise;const l=++this._lastId,o={id:l,method:e,params:i};return this._transport.send(JSON.stringify(o)),new Promise((u,f)=>{this._callbacks.set(l,{resolve:u,reject:f})})}_sendMessageNoReply(e,i){this._sendMessage(e,i).catch(()=>{})}_dispatchEvent(e,i){e==="report"?this._onReportEmitter.fire(i):e==="stdio"?this._onStdioEmitter.fire(i):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(i):e==="loadTraceRequested"&&this._onLoadTraceRequestedEmitter.fire(i)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async startDevServer(e){return await this._sendMessage("startDevServer",e)}async stopDevServer(e){return await this._sendMessage("stopDevServer",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const FN=()=>{const[n,e]=xn("shouldPopulateCanvasFromScreenshot",!1),[i,s]=Ow(),[l,o]=xn("mergeFiles",!1);return v.jsx(lS,{settings:[{type:"check",value:i,set:s,name:"Dark mode"},{type:"check",value:l,set:o,name:"Merge files"},{type:"check",value:n,set:e,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."}]})};export{BN as D,Wx as E,GN as M,Yt as R,Io as S,PN as T,XN as W,Yx as _,FN as a,YN as b,RN as c,qN as d,VN as e,uh as f,$N as g,IN as h,Ke as i,v as j,Cx as k,Bh as l,_t as m,Xt as n,xn as o,lS as p,_w as q,q as r,Ki as s,Z0 as t,es as u};
265
+ `,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Ao(e),s=Zs(i);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Ao(e),s=Zs(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Jv(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Qv||null,prettyErrors:e}}function pN(n,e={}){const{lineCounter:i,prettyErrors:s}=Jv(e),l=new Sd(i==null?void 0:i.addNewLine),o=new vd(e),u=Array.from(o.compose(l.parse(n)));if(s&&i)for(const f of u)f.errors.forEach(ec(n,i)),f.warnings.forEach(ec(n,i));return u.length>0?u:Object.assign([],{empty:!0},o.streamInfo())}function Wv(n,e={}){const{lineCounter:i,prettyErrors:s}=Jv(e),l=new Sd(i==null?void 0:i.addNewLine),o=new vd(e);let u=null;for(const f of o.compose(l.parse(n),!0,n.length))if(!u)u=f;else if(u.options.logLevel!=="silent"){u.errors.push(new Qi(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&i&&(u.errors.forEach(ec(n,i)),u.warnings.forEach(ec(n,i))),u}function gN(n,e,i){let s;typeof e=="function"?s=e:i===void 0&&e&&typeof e=="object"&&(i=e);const l=Wv(n,i);if(!l)return null;if(l.warnings.forEach(o=>vv(l.options.logLevel,o)),l.errors.length>0){if(l.options.logLevel!=="silent")throw l.errors[0];l.errors=[]}return l.toJS(Object.assign({reviver:s},i))}function mN(n,e,i){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){const l=Math.round(i);i=l<1?void 0:l>8?{indent:8}:{indent:l}}if(n===void 0){const{keepUndefined:l}=i??e??{};if(!l)return}return is(n)&&!s?n.toString(i):new wr(n,s,i).toString(i)}const eS=Object.freeze(Object.defineProperty({__proto__:null,Alias:uc,CST:fN,Composer:vd,Document:wr,Lexer:Fv,LineCounter:Qv,Pair:bt,Parser:Sd,Scalar:fe,Schema:vc,YAMLError:yd,YAMLMap:Kt,YAMLParseError:Qi,YAMLSeq:wi,YAMLWarning:Hv,isAlias:ns,isCollection:ze,isDocument:is,isMap:yr,isNode:qe,isPair:Be,isScalar:Le,isSeq:br,parse:gN,parseAllDocuments:pN,parseDocument:Wv,stringify:mN,visit:Si,visitAsync:cc},Symbol.toStringTag,{value:"Module"})),yN=({action:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})=>{const[f,d]=q.useState("action"),[p]=xn("shouldPopulateCanvasFromScreenshot",!1),m=q.useMemo(()=>wN(n),[n]),{snapshotInfoUrl:y,snapshotUrl:b,popoutUrl:w}=q.useMemo(()=>{const x=m[f];return x?xN(x,p):{snapshotInfoUrl:void 0,snapshotUrl:void 0,popoutUrl:void 0}},[m,f,p]),T=q.useMemo(()=>y!==void 0?{snapshotInfoUrl:y,snapshotUrl:b,popoutUrl:w}:void 0,[y,b,w]);return v.jsxs("div",{className:"snapshot-tab vbox",children:[v.jsxs(Bh,{children:[v.jsx(Xt,{className:"pick-locator",title:"Pick locator",icon:"target",toggled:s,onClick:()=>l(!s)}),["action","before","after"].map(x=>v.jsx(ib,{id:x,title:SN(x),selected:f===x,onSelect:()=>d(x)},x)),v.jsx("div",{style:{flex:"auto"}}),v.jsx(Xt,{icon:"link-external",title:"Open snapshot in a new tab",disabled:!(T!=null&&T.popoutUrl),onClick:()=>{const x=window.open((T==null?void 0:T.popoutUrl)||"","_blank");x==null||x.addEventListener("DOMContentLoaded",()=>{new nv(x,{isUnderTest:nS,sdkLanguage:e,testIdAttributeName:i,stableRafCount:1,browserName:"chromium",customEngines:[]}).consoleApi.install()})}})]}),v.jsx(bN,{snapshotUrls:T,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})]})},bN=({snapshotUrls:n,sdkLanguage:e,testIdAttributeName:i,isInspecting:s,setIsInspecting:l,highlightedElement:o,setHighlightedElement:u})=>{const f=q.useRef(null),d=q.useRef(null),[p,m]=q.useState({viewport:iS,url:""}),y=q.useRef({iteration:0,visibleIframe:0});return q.useEffect(()=>{(async()=>{const b=y.current.iteration+1,w=1-y.current.visibleIframe;y.current.iteration=b;const T=await _N(n==null?void 0:n.snapshotInfoUrl);if(y.current.iteration!==b)return;const x=[f,d][w].current;if(x){let E=()=>{};const k=new Promise(N=>E=N);try{x.addEventListener("load",E),x.addEventListener("error",E);const N=(n==null?void 0:n.snapshotUrl)||EN;x.contentWindow?x.contentWindow.location.replace(N):x.src=N,await k}catch{}finally{x.removeEventListener("load",E),x.removeEventListener("error",E)}}y.current.iteration===b&&(y.current.visibleIframe=w,m(T))})()},[n]),v.jsxs("div",{className:"vbox",tabIndex:0,onKeyDown:b=>{b.key==="Escape"&&s&&l(!1)},children:[v.jsx(y0,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:f.current,iteration:y.current.iteration}),v.jsx(y0,{isInspecting:s,sdkLanguage:e,testIdAttributeName:i,highlightedElement:o,setHighlightedElement:u,iframe:d.current,iteration:y.current.iteration}),v.jsx(vN,{snapshotInfo:p,children:v.jsxs("div",{className:"snapshot-switcher",children:[v.jsx("iframe",{ref:f,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===0&&"snapshot-visible")}),v.jsx("iframe",{ref:d,name:"snapshot",title:"DOM Snapshot",className:Ke(y.current.visibleIframe===1&&"snapshot-visible")})]})})]})},vN=({snapshotInfo:n,children:e})=>{const[i,s]=es(),l=40,o={width:n.viewport.width,height:n.viewport.height},u={width:Math.max(o.width,480),height:Math.max(o.height+l,320)},f=Math.min(i.width/u.width,i.height/u.height,1),d={x:(i.width-u.width)/2,y:(i.height-u.height)/2};return v.jsx("div",{ref:s,className:"snapshot-wrapper",children:v.jsxs("div",{className:"snapshot-container",style:{width:u.width+"px",height:u.height+"px",transform:`translate(${d.x}px, ${d.y}px) scale(${f})`},children:[v.jsx(lA,{url:n.url}),v.jsx("div",{className:"snapshot-browser-body",children:v.jsx("div",{style:{width:o.width+"px",height:o.height+"px"},children:e})})]})})};function SN(n){return n==="before"?"Before":n==="after"?"After":n==="action"?"Action":n}const y0=({iframe:n,isInspecting:e,sdkLanguage:i,testIdAttributeName:s,highlightedElement:l,setHighlightedElement:o,iteration:u})=>(q.useEffect(()=>{const f=l.lastEdited==="ariaSnapshot"?l.ariaSnapshot:void 0,d=l.lastEdited==="locator"?l.locator:void 0,p=!!f||!!d||e,m=[],y=new URLSearchParams(window.location.search).get("isUnderTest")==="true";try{tS(m,p,i,s,y,"",n==null?void 0:n.contentWindow)}catch{}const b=f?Uh(eS,f):void 0,w=d?rA(i,d,s):void 0;for(const{recorder:T,frameSelector:x}of m){const E=w!=null&&w.startsWith(x)?w.substring(x.length).trim():void 0,k=(b==null?void 0:b.errors.length)===0?b.fragment:void 0;T.setUIState({mode:e?"inspecting":"none",actionSelector:E,ariaTemplate:k,language:i,testIdAttributeName:s,overlay:{offsetX:0}},{async elementPicked(N){o({locator:Ji(i,x+N.selector),ariaSnapshot:N.ariaSnapshot,lastEdited:"none"})},highlightUpdated(){for(const N of m)N.recorder!==T&&N.recorder.clearHighlight()}})}},[n,e,l,o,i,s,u]),v.jsx(v.Fragment,{}));function tS(n,e,i,s,l,o,u){if(!u)return;const f=u;if(!f._recorder&&e){const d=new nv(u,{isUnderTest:l,sdkLanguage:i,testIdAttributeName:s,stableRafCount:1,browserName:"chromium",customEngines:[]}),p=new WT(d);f._injectedScript=d,f._recorder={recorder:p,frameSelector:o},l&&(window._weakRecordersForTest=window._weakRecordersForTest||new Set,window._weakRecordersForTest.add(new WeakRef(p)))}f._recorder&&n.push(f._recorder);for(let d=0;d<u.frames.length;++d){const p=u.frames[d],m=p.frameElement?f._injectedScript.generateSelectorSimple(p.frameElement,{omitInternalEngines:!0,testIdAttributeName:s})+" >> internal:control=enter-frame >> ":"";tS(n,e,i,s,l,o+m,p)}}const Oa=(n,e,i=!1)=>{if(!n)return;const s=n[e];if(s){if(!n.pageId){console.error("snapshot action must have a pageId");return}return{action:n,snapshotName:s,pageId:n.pageId,point:n.point,hasInputTarget:i}}};function wN(n){if(!n)return{};let e=Oa(n,"beforeSnapshot");if(!e){for(let l=Ey(n);l;l=Ey(l))if(l.endTime<=n.startTime&&l.afterSnapshot){e=Oa(l,"afterSnapshot");break}}let i=Oa(n,"afterSnapshot");if(!i){let l;for(let o=Ty(n);o&&o.startTime<=n.endTime;o=Ty(o))o.endTime>n.endTime||!o.afterSnapshot||l&&l.endTime>o.endTime||(l=o);l?i=Oa(l,"afterSnapshot"):i=e}const s=Oa(n,"inputSnapshot",!0)??i;return s&&(s.point=n.point),{action:s,before:e,after:i}}const nS=new URLSearchParams(window.location.search).has("isUnderTest"),b0=new URLSearchParams(window.location.search).get("server");function xN(n,e){const i=new URLSearchParams;i.set("trace",$o(n.action).traceUrl),i.set("name",n.snapshotName),nS&&i.set("isUnderTest","true"),n.point&&(i.set("pointX",String(n.point.x)),i.set("pointY",String(n.point.y)),n.hasInputTarget&&i.set("hasInputTarget","1")),e&&i.set("shouldPopulateCanvasFromScreenshot","1");const s=new URL(`snapshot/${n.pageId}?${i.toString()}`,window.location.href).toString(),l=new URL(`snapshotInfo/${n.pageId}?${i.toString()}`,window.location.href).toString(),o=new URLSearchParams;o.set("r",s),b0&&o.set("server",b0),o.set("trace",$o(n.action).traceUrl),n.point&&(o.set("pointX",String(n.point.x)),o.set("pointY",String(n.point.y)),n.hasInputTarget&&i.set("hasInputTarget","1"));const u=new URL(`snapshot.html?${o.toString()}`,window.location.href).toString();return{snapshotInfoUrl:l,snapshotUrl:s,popoutUrl:u}}async function _N(n){const e={url:"",viewport:iS,timestamp:void 0,wallTime:void 0};if(n){const s=await(await fetch(n)).json();s.error||(e.url=s.url,e.viewport=s.viewport,e.timestamp=s.timestamp,e.wallTime=s.wallTime)}return e}const iS={width:1280,height:720},EN='data:text/html,<body style="background: #ddd"></body>',sS={width:200,height:45},Ws=2.5,TN=sS.height+Ws*2,AN=({model:n,boundaries:e,previewPoint:i})=>{var m,y;const[s,l]=es(),o=q.useRef(null);let u=0;if(o.current&&i){const b=o.current.getBoundingClientRect();u=(i.clientY-b.top+o.current.scrollTop)/TN|0}const f=(y=(m=n==null?void 0:n.pages)==null?void 0:m[u])==null?void 0:y.screencastFrames;let d,p;if(i!==void 0&&f&&f.length){const b=e.minimum+(e.maximum-e.minimum)*i.x/s.width;d=f[S0(f,b,rS)-1];const w={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};p=d?aS({width:d.width,height:d.height},w):void 0}return v.jsxs("div",{className:"film-strip",ref:l,children:[v.jsx("div",{className:"film-strip-lanes",ref:o,children:n==null?void 0:n.pages.map((b,w)=>b.screencastFrames.length?v.jsx(NN,{boundaries:e,page:b,width:s.width},w):null)}),(i==null?void 0:i.x)!==void 0&&v.jsxs("div",{className:"film-strip-hover",style:{top:s.bottom+5,left:Math.min(i.x,s.width-(p?p.width:0)-10)},children:[i.action&&v.jsx("div",{className:"film-strip-hover-title",children:Rh(i.action,i)}),d&&p&&v.jsx("div",{style:{width:p.width,height:p.height},children:v.jsx("img",{src:`sha1/${d.sha1}`,width:p.width,height:p.height})})]})]})},NN=({boundaries:n,page:e,width:i})=>{const s={width:0,height:0},l=e.screencastFrames;for(const x of l)s.width=Math.max(s.width,x.width),s.height=Math.max(s.height,x.height);const o=aS(s,sS),u=l[0].timestamp,f=l[l.length-1].timestamp,d=n.maximum-n.minimum,p=(u-n.minimum)/d*i,m=(n.maximum-f)/d*i,b=(f-u)/d*i/(o.width+2*Ws)|0,w=(f-u)/b,T=[];for(let x=0;u&&w&&x<b;++x){const E=u+w*x,k=S0(l,E,rS)-1;T.push(v.jsx("div",{className:"film-strip-frame",style:{width:o.width,height:o.height,backgroundImage:`url(sha1/${l[k].sha1})`,backgroundSize:`${o.width}px ${o.height}px`,margin:Ws,marginRight:Ws}},x))}return T.push(v.jsx("div",{className:"film-strip-frame",style:{width:o.width,height:o.height,backgroundImage:`url(sha1/${l[l.length-1].sha1})`,backgroundSize:`${o.width}px ${o.height}px`,margin:Ws,marginRight:Ws}},T.length)),v.jsx("div",{className:"film-strip-lane",style:{marginLeft:p+"px",marginRight:m+"px"},children:T})};function rS(n,e){return n-e.timestamp}function aS(n,e){const i=Math.max(n.width/e.width,n.height/e.height);return{width:n.width/i|0,height:n.height/i|0}}const CN=({model:n,boundaries:e,consoleEntries:i,onSelected:s,highlightedAction:l,highlightedEntry:o,highlightedConsoleEntry:u,selectedTime:f,setSelectedTime:d,sdkLanguage:p})=>{const[m,y]=es(),[b,w]=q.useState(),[T,x]=q.useState(),[E]=xn("actionsFilter",[]),{offsets:k,curtainLeft:N,curtainRight:V}=q.useMemo(()=>{let L=f||e;if(b&&b.startX!==b.endX){const z=wn(m.width,e,b.startX),Z=wn(m.width,e,b.endX);L={minimum:Math.min(z,Z),maximum:Math.max(z,Z)}}const F=sn(m.width,e,L.minimum),me=sn(m.width,e,e.maximum)-sn(m.width,e,L.maximum);return{offsets:kN(m.width,e),curtainLeft:F,curtainRight:me}},[f,e,b,m]),$=q.useMemo(()=>n==null?void 0:n.filteredActions(E),[n,E]),B=q.useMemo(()=>{const L=[];for(const F of $||[])L.push({action:F,leftTime:F.startTime,rightTime:F.endTime||e.maximum,leftPosition:sn(m.width,e,F.startTime),rightPosition:sn(m.width,e,F.endTime||e.maximum),active:!1,error:!!F.error});for(const F of(n==null?void 0:n.resources)||[]){const ge=F._monotonicTime,me=F._monotonicTime+F.time;L.push({resource:F,leftTime:ge,rightTime:me,leftPosition:sn(m.width,e,ge),rightPosition:sn(m.width,e,me),active:!1,error:!1})}for(const F of i||[])L.push({consoleMessage:F,leftTime:F.timestamp,rightTime:F.timestamp,leftPosition:sn(m.width,e,F.timestamp),rightPosition:sn(m.width,e,F.timestamp),active:!1,error:F.isError});return L},[n,$,i,e,m]);q.useMemo(()=>{for(const L of B)l?L.active=L.action===l:o?L.active=L.resource===o:u?L.active=L.consoleMessage===u:L.active=!1},[B,l,o,u]);const Y=q.useCallback(L=>{if(x(void 0),!y.current)return;const F=L.clientX-y.current.getBoundingClientRect().left,ge=wn(m.width,e,F),me=f?sn(m.width,e,f.minimum):0,z=f?sn(m.width,e,f.maximum):0;f&&Math.abs(F-me)<10?w({startX:z,endX:F,type:"resize"}):f&&Math.abs(F-z)<10?w({startX:me,endX:F,type:"resize"}):f&&ge>f.minimum&&ge<f.maximum&&L.clientY-y.current.getBoundingClientRect().top<20?w({startX:me,endX:z,pivot:F,type:"move"}):w({startX:F,endX:F,type:"resize"})},[e,m,y,f]),J=q.useCallback(L=>{if(!y.current)return;const F=L.clientX-y.current.getBoundingClientRect().left,ge=wn(m.width,e,F),me=$==null?void 0:$.findLast(Se=>Se.startTime<=ge);if(!L.buttons){w(void 0);return}if(me&&s(me),!b)return;let z=b;if(b.type==="resize")z={...b,endX:F};else{const Se=F-b.pivot;let C=b.startX+Se,X=b.endX+Se;C<0&&(C=0,X=C+(b.endX-b.startX)),X>m.width&&(X=m.width,C=X-(b.endX-b.startX)),z={...b,startX:C,endX:X,pivot:F}}w(z);const Z=wn(m.width,e,z.startX),ne=wn(m.width,e,z.endX);Z!==ne&&d({minimum:Math.min(Z,ne),maximum:Math.max(Z,ne)})},[e,b,m,$,s,y,d]),I=q.useCallback(()=>{if(x(void 0),!!b){if(b.startX!==b.endX){const L=wn(m.width,e,b.startX),F=wn(m.width,e,b.endX);d({minimum:Math.min(L,F),maximum:Math.max(L,F)})}else{const L=wn(m.width,e,b.startX),F=$==null?void 0:$.findLast(ge=>ge.startTime<=L);F&&s(F),d(void 0)}w(void 0)}},[e,b,m,$,d,s]),j=q.useCallback(L=>{if(!y.current)return;const F=L.clientX-y.current.getBoundingClientRect().left,ge=wn(m.width,e,F),me=$==null?void 0:$.findLast(z=>z.startTime<=ge);x({x:F,clientY:L.clientY,action:me,sdkLanguage:p})},[e,m,$,y,p]),te=q.useCallback(()=>{x(void 0)},[]),re=q.useCallback(()=>{d(void 0)},[d]);return v.jsxs("div",{className:"timeline-view-container",children:[!!b&&v.jsx(J0,{cursor:(b==null?void 0:b.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:I,onPaneMouseMove:J,onPaneDoubleClick:re}),v.jsxs("div",{ref:y,className:"timeline-view",onMouseDown:Y,onMouseMove:j,onMouseLeave:te,children:[v.jsx("div",{className:"timeline-grid",children:k.map((L,F)=>v.jsx("div",{className:"timeline-divider",style:{left:L.position+"px"},children:v.jsx("div",{className:"timeline-time",children:_t(L.time-e.minimum)})},F))}),v.jsx("div",{style:{height:8}}),v.jsx(AN,{model:n,boundaries:e,previewPoint:T}),v.jsx("div",{className:"timeline-bars",children:B.filter(L=>!L.action||L.action.class!=="Test").map((L,F)=>v.jsx("div",{className:Ke("timeline-bar",L.action&&"action",L.resource&&"network",L.consoleMessage&&"console-message",L.active&&"active",L.error&&"error"),style:{left:L.leftPosition,width:Math.max(5,L.rightPosition-L.leftPosition),top:MN(L),bottom:0}},F))}),v.jsx("div",{className:"timeline-marker",style:{display:T!==void 0?"block":"none",left:((T==null?void 0:T.x)||0)+"px"}}),f&&v.jsxs("div",{className:"timeline-window",children:[v.jsx("div",{className:"timeline-window-curtain left",style:{width:N}}),v.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),v.jsx("div",{className:"timeline-window-center",children:v.jsx("div",{className:"timeline-window-drag"})}),v.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),v.jsx("div",{className:"timeline-window-curtain right",style:{width:V}})]})]})]})};function kN(n,e){let s=n/64;const l=e.maximum-e.minimum,o=n/l;let u=l/s;const f=Math.ceil(Math.log(u)/Math.LN10);u=Math.pow(10,f),u*o>=320&&(u=u/5),u*o>=128&&(u=u/2);const d=e.minimum;let p=e.maximum;p+=64/o,s=Math.ceil((p-d)/u),u||(s=0);const m=[];for(let y=0;y<s;++y){const b=d+u*y;m.push({position:sn(n,e,b),time:b})}return m}function sn(n,e,i){return(i-e.minimum)/(e.maximum-e.minimum)*n}function wn(n,e,i){return i/n*(e.maximum-e.minimum)+e.minimum}function MN(n){return n.resource?25:20}const ON=({model:n})=>{var i,s;if(!n)return v.jsx(v.Fragment,{});const e=n.wallTime!==void 0?new Date(n.wallTime).toLocaleString(void 0,{timeZoneName:"short"}):void 0;return v.jsxs("div",{style:{flex:"auto",display:"block",overflow:"hidden auto"},children:[v.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!e&&v.jsxs("div",{className:"call-line",children:["start time:",v.jsx("span",{className:"call-value datetime",title:e,children:e})]}),v.jsxs("div",{className:"call-line",children:["duration:",v.jsx("span",{className:"call-value number",title:_t(n.endTime-n.startTime),children:_t(n.endTime-n.startTime)})]}),v.jsx("div",{className:"call-section",children:"Browser"}),v.jsxs("div",{className:"call-line",children:["engine:",v.jsx("span",{className:"call-value string",title:n.browserName,children:n.browserName})]}),n.channel&&v.jsxs("div",{className:"call-line",children:["channel:",v.jsx("span",{className:"call-value string",title:n.channel,children:n.channel})]}),n.platform&&v.jsxs("div",{className:"call-line",children:["platform:",v.jsx("span",{className:"call-value string",title:n.platform,children:n.platform})]}),n.options.userAgent&&v.jsxs("div",{className:"call-line",children:["user agent:",v.jsx("span",{className:"call-value datetime",title:n.options.userAgent,children:n.options.userAgent})]}),n.options.baseURL&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),v.jsxs("div",{className:"call-line",children:["baseURL:",v.jsx("a",{className:"call-value string",href:n.options.baseURL,title:n.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:n.options.baseURL})]})]}),v.jsx("div",{className:"call-section",children:"Viewport"}),n.options.viewport&&v.jsxs("div",{className:"call-line",children:["width:",v.jsx("span",{className:"call-value number",title:String(!!((i=n.options.viewport)!=null&&i.width)),children:n.options.viewport.width})]}),n.options.viewport&&v.jsxs("div",{className:"call-line",children:["height:",v.jsx("span",{className:"call-value number",title:String(!!((s=n.options.viewport)!=null&&s.height)),children:n.options.viewport.height})]}),v.jsxs("div",{className:"call-line",children:["is mobile:",v.jsx("span",{className:"call-value boolean",title:String(!!n.options.isMobile),children:String(!!n.options.isMobile)})]}),n.options.deviceScaleFactor&&v.jsxs("div",{className:"call-line",children:["device scale:",v.jsx("span",{className:"call-value number",title:String(n.options.deviceScaleFactor),children:String(n.options.deviceScaleFactor)})]}),v.jsx("div",{className:"call-section",children:"Counts"}),v.jsxs("div",{className:"call-line",children:["pages:",v.jsx("span",{className:"call-value number",children:n.pages.length})]}),v.jsxs("div",{className:"call-line",children:["actions:",v.jsx("span",{className:"call-value number",children:n.actions.length})]}),v.jsxs("div",{className:"call-line",children:["events:",v.jsx("span",{className:"call-value number",children:n.events.length})]})]})},LN=({annotations:n})=>n.length?v.jsx("div",{className:"annotations-tab",children:n.map((e,i)=>v.jsxs("div",{className:"annotation-item",children:[v.jsx("span",{style:{fontWeight:"bold"},children:e.type}),e.description&&v.jsxs("span",{children:[": ",eb(e.description)]})]},`annotation-${i}`))}):v.jsx(ts,{text:"No annotations"}),jN=({sdkLanguage:n,setIsInspecting:e,highlightedElement:i,setHighlightedElement:s})=>{const[l,o]=q.useState(),u=q.useCallback(f=>{const{errors:d}=Uh(eS,f,{prettyErrors:!1}),p=d.map(m=>({message:m.message,line:m.range[1].line,column:m.range[1].col,type:"subtle-error"}));o(p),s({...i,ariaSnapshot:f,lastEdited:"ariaSnapshot"}),e(!1)},[i,s,e]);return v.jsxs("div",{style:{flex:"auto",backgroundColor:"var(--vscode-sideBar-background)",padding:"0 10px 10px 10px",overflow:"auto"},children:[v.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[v.jsx("div",{style:{flex:"auto"},children:"Locator"}),v.jsx(Xt,{icon:"files",title:"Copy locator",onClick:()=>{py(i.locator||"")}})]}),v.jsx("div",{style:{height:50},children:v.jsx(cr,{text:i.locator||"",highlighter:n,isFocused:!0,wrapLines:!0,onChange:f=>{s({...i,locator:f,lastEdited:"locator"}),e(!1)}})}),v.jsxs("div",{className:"hbox",style:{lineHeight:"28px",color:"var(--vscode-editorCodeLens-foreground)"},children:[v.jsx("div",{style:{flex:"auto"},children:"Aria snapshot"}),v.jsx(Xt,{icon:"files",title:"Copy snapshot",onClick:()=>{py(i.ariaSnapshot||"")}})]}),v.jsx("div",{style:{height:150},children:v.jsx(cr,{text:i.ariaSnapshot||"",highlighter:"yaml",wrapLines:!1,highlight:l,onChange:u})})]})},RN=({className:n,style:e,open:i,isModal:s,minWidth:l,verticalOffset:o,requestClose:u,anchor:f,dataTestId:d,children:p})=>{const m=q.useRef(null),[y,b]=q.useState(0),w=ch(m),T=ch(f),x=DN(w,T,o);return q.useEffect(()=>{const E=N=>{!m.current||!(N.target instanceof Node)||m.current.contains(N.target)||u==null||u()},k=N=>{N.key==="Escape"&&(u==null||u())};return i?(document.addEventListener("mousedown",E),document.addEventListener("keydown",k),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",k)}):()=>{}},[i,u]),q.useEffect(()=>{const E=()=>b(k=>k+1);return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[]),q.useLayoutEffect(()=>{m.current&&(i?s?m.current.showModal():m.current.show():m.current.close())},[i,s]),v.jsx("dialog",{ref:m,style:{position:"fixed",margin:0,zIndex:110,top:x.top,left:x.left,minWidth:l||0,...e},className:n,"data-testid":d,children:p})};function DN(n,e,i=4,s=4){let l=Math.max(s,e.left);l+n.width>window.innerWidth-s&&(l=window.innerWidth-n.width-s);let o=Math.max(0,e.bottom)+i;return o+n.height>window.innerHeight-i&&(Math.max(0,e.top)>n.height+i?o=Math.max(0,e.top)-n.height-i:o=window.innerHeight-i-n.height),{left:l,top:o}}const BN=({title:n,icon:e,dialogDataTestId:i,children:s})=>{const l=q.useRef(null),[o,u]=q.useState(!1);return v.jsxs(v.Fragment,{children:[v.jsx(Xt,{ref:l,icon:e,title:n,onClick:()=>u(f=>!f)}),v.jsx(RN,{style:{backgroundColor:"var(--vscode-sideBar-background)",padding:"4px 8px"},open:o,verticalOffset:8,requestClose:()=>u(!1),anchor:l,dataTestId:i,children:s})]})},lS=({settings:n})=>v.jsx("div",{className:"vbox settings-view",children:n.map(e=>{const i=`setting-${e.name.replaceAll(/\s+/g,"-")}`;return v.jsx("div",{className:`setting setting-${e.type}`,title:e.title,children:UN(e,i)},e.name)})}),UN=(n,e)=>{switch(n.type){case"check":return v.jsxs(v.Fragment,{children:[v.jsx("input",{type:"checkbox",id:e,checked:n.value,onChange:()=>n.set(!n.value)}),v.jsxs("label",{htmlFor:e,children:[n.name,!!n.count&&v.jsx("span",{className:"setting-counter",children:n.count})]})]});case"select":return v.jsxs(v.Fragment,{children:[v.jsxs("label",{htmlFor:e,children:[n.name,":",!!n.count&&v.jsx("span",{className:"setting-counter",children:n.count})]}),v.jsx("select",{id:e,value:n.value,onChange:i=>n.set(i.target.value),children:n.options.map(i=>v.jsx("option",{value:i.value,children:i.label},i.value))})]});default:return null}},YN=({model:n,showSourcesFirst:e,rootDir:i,fallbackLocation:s,isLive:l,hideTimeline:o,status:u,annotations:f,inert:d,onOpenExternally:p,revealSource:m,testRunMetadata:y})=>{var Ei;const[b,w]=q.useState(void 0),[T,x]=q.useState(void 0),[E,k]=q.useState(void 0),[N,V]=q.useState(),[$,B]=q.useState(),[Y,J]=q.useState(),[I,j]=q.useState("actions"),[te,re]=xn("propertiesTab",e?"source":"call"),[L,F]=q.useState(!1),[ge,me]=q.useState({lastEdited:"none"}),[z,Z]=q.useState(),[ne,Se]=xn("propertiesSidebarLocation","bottom"),[C]=xn("actionsFilter",[]),X=q.useCallback(le=>{w(le==null?void 0:le.callId),x(void 0)},[]),Q=q.useMemo(()=>n==null?void 0:n.filteredActions(C),[n,C]),W=((n==null?void 0:n.actions.length)??0)-((Q==null?void 0:Q.length)??0),se=q.useMemo(()=>Q==null?void 0:Q.find(le=>le.callId===N),[Q,N]),ve=q.useCallback(le=>{V(le==null?void 0:le.callId)},[]),ue=q.useMemo(()=>(n==null?void 0:n.sources)||new Map,[n]);q.useEffect(()=>{Z(void 0),x(void 0)},[n]);const We=q.useMemo(()=>{if(b){const dt=Q==null?void 0:Q.find(At=>At.callId===b);if(dt)return dt}const le=n==null?void 0:n.failedAction();if(le)return le;if(Q!=null&&Q.length){let dt=Q.length-1;for(let At=0;At<Q.length;++At)if(Q[At].title==="After Hooks"&&At){dt=At-1;break}return Q[dt]}},[n,Q,b]),xe=q.useMemo(()=>se||We,[We,se]),gn=q.useMemo(()=>T?T.stack:xe==null?void 0:xe.stack,[xe,T]),ss=q.useCallback(le=>{X(le),ve(void 0)},[X,ve]),ht=q.useCallback(le=>{re(le),le!=="inspector"&&F(!1)},[re]),rs=q.useCallback(le=>{!L&&le&&ht("inspector"),F(le)},[F,ht,L]),xr=q.useCallback(le=>{me(le),ht("inspector")},[ht]),_r=q.useCallback(le=>{ht("attachments"),k(dt=>{if(!dt)return[le,0];const At=dt[1];return[le,At+1]})},[ht]);q.useEffect(()=>{m&&ht("source")},[m,ht]);const Er=v_(n,z),sl=G_(n,z),Ut=p_(n),Xn=(n==null?void 0:n.sdkLanguage)||"javascript",rl={id:"inspector",title:"Locator",render:()=>v.jsx(jN,{sdkLanguage:Xn,setIsInspecting:rs,highlightedElement:ge,setHighlightedElement:me})},al={id:"call",title:"Call",render:()=>v.jsx(Rx,{action:xe,startTimeOffset:(n==null?void 0:n.startTime)??0,sdkLanguage:Xn})},as={id:"log",title:"Log",render:()=>v.jsx(Ux,{action:xe,isLive:l})},_c={id:"errors",title:"Errors",errorCount:Ut.errors.size,render:()=>v.jsx(m_,{errorsModel:Ut,model:n,testRunMetadata:y,sdkLanguage:Xn,revealInSource:le=>{le.action?X(le.action):x(le),ht("source")},wallTime:(n==null?void 0:n.wallTime)??0})};let Tr;!We&&s&&(Tr=(Ei=s.source)==null?void 0:Ei.errors.length);const Ar={id:"source",title:"Source",errorCount:Tr,render:()=>v.jsx(f_,{stack:gn,sources:ue,rootDir:i,stackFrameLocation:ne==="bottom"?"right":"bottom",fallbackLocation:s,onOpenExternally:p})},Ec={id:"console",title:"Console",count:Er.entries.length,render:()=>v.jsx(S_,{consoleModel:Er,boundaries:rt,selectedTime:z,onAccepted:le=>Z({minimum:le.timestamp,maximum:le.timestamp}),onEntryHovered:J})},_i={id:"network",title:"Network",count:sl.resources.length,render:()=>v.jsx(K_,{boundaries:rt,networkModel:sl,onEntryHovered:B,sdkLanguage:(n==null?void 0:n.sdkLanguage)??"javascript"})},vt={id:"attachments",title:"Attachments",count:n==null?void 0:n.visibleAttachments.length,render:()=>v.jsx(n_,{model:n,revealedAttachment:E})},Tt=[rl,al,as,_c,Ec,_i,Ar,vt];if(f!==void 0){const le={id:"annotations",title:"Annotations",count:f.length,render:()=>v.jsx(LN,{annotations:f})};Tt.push(le)}if(e){const le=Tt.indexOf(Ar);Tt.splice(le,1),Tt.splice(1,0,Ar)}const{boundaries:rt}=q.useMemo(()=>{const le={minimum:(n==null?void 0:n.startTime)||0,maximum:(n==null?void 0:n.endTime)||3e4};return le.minimum>le.maximum&&(le.minimum=0,le.maximum=3e4),le.maximum+=(le.maximum-le.minimum)/20,{boundaries:le}},[n]);let ls=0;!l&&n&&n.endTime>=0?ls=n.endTime-n.startTime:n&&n.wallTime&&(ls=Date.now()-n.wallTime);const Tc={id:"actions",title:"Actions",component:v.jsxs("div",{className:"vbox",children:[u&&v.jsxs("div",{className:"workbench-run-status",children:[v.jsx("span",{className:Ke("codicon",Z0(u))}),v.jsx("div",{children:Mx(u)}),v.jsx("div",{className:"spacer"}),v.jsx("div",{className:"workbench-run-duration",children:ls?_t(ls):""})]}),v.jsx(Lx,{sdkLanguage:Xn,actions:Q||[],selectedAction:n?We:void 0,selectedTime:z,setSelectedTime:Z,onSelected:ss,onHighlighted:ve,revealAttachment:_r,revealConsole:()=>ht("console"),isLive:l}),v.jsxs("div",{className:"workbench-actions-status-bar",children:[!!W&&v.jsxs("span",{className:"workbench-actions-hidden-count",title:W+" actions hidden by filters",children:[W," hidden"]}),v.jsx(HN,{counters:n==null?void 0:n.actionCounters})]})]})},Ac={id:"metadata",title:"Metadata",component:v.jsx(ON,{model:n})};return v.jsxs("div",{className:"vbox workbench",...d?{inert:!0}:{},children:[!o&&v.jsx(CN,{model:n,consoleEntries:Er.entries,boundaries:rt,highlightedAction:se,highlightedEntry:$,highlightedConsoleEntry:Y,onSelected:ss,sdkLanguage:Xn,selectedTime:z,setSelectedTime:Z}),v.jsx(Io,{sidebarSize:250,orientation:ne==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:v.jsx(Io,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:v.jsx(yN,{action:xe,model:n,sdkLanguage:Xn,testIdAttributeName:(n==null?void 0:n.testIdAttributeName)||"data-testid",isInspecting:L,setIsInspecting:rs,highlightedElement:ge,setHighlightedElement:xr}),sidebar:v.jsx(ph,{tabs:[Tc,Ac],selectedTab:I,setSelectedTab:j})}),sidebar:v.jsx(ph,{tabs:Tt,selectedTab:te,setSelectedTab:ht,rightToolbar:[ne==="bottom"?v.jsx(Xt,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{Se("right")}}):v.jsx(Xt,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{Se("bottom")}})],mode:ne==="bottom"?"default":"select"})})]})},HN=({counters:n})=>{const[e,i]=xn("actionsFilter",[]);return v.jsx(BN,{icon:"filter",title:"Filter actions",dialogDataTestId:"actions-filter-dialog",children:v.jsx(lS,{settings:[{type:"check",value:e.includes("getter"),set:s=>i(s?[...e,"getter"]:e.filter(l=>l!=="getter")),name:"Getters",count:n==null?void 0:n.get("getter")},{type:"check",value:e.includes("route"),set:s=>i(s?[...e,"route"]:e.filter(l=>l!=="route")),name:"Network routes",count:n==null?void 0:n.get("route")},{type:"check",value:e.includes("configuration"),set:s=>i(s?[...e,"configuration"]:e.filter(l=>l!=="configuration")),name:"Configuration",count:n==null?void 0:n.get("configuration")}]})})};var v0;(n=>{function e(i){for(const s of i.splice(0))s.dispose()}n.disposeAll=e})(v0||(v0={}));class La{constructor(){this._listeners=new Set,this.event=(e,i)=>{this._listeners.add(e);let s=!1;const l=this,o={dispose(){s||(s=!0,l._listeners.delete(e))}};return i&&i.push(o),o}}fire(e){const i=!this._deliveryQueue;this._deliveryQueue||(this._deliveryQueue=[]);for(const s of this._listeners)this._deliveryQueue.push({listener:s,event:e});if(i){for(let s=0;s<this._deliveryQueue.length;s++){const{listener:l,event:o}=this._deliveryQueue[s];l.call(null,o)}this._deliveryQueue=void 0}}dispose(){this._listeners.clear(),this._deliveryQueue&&(this._deliveryQueue=[])}}class XN{constructor(e){this._ws=new WebSocket(e)}onmessage(e){this._ws.addEventListener("message",i=>e(i.data.toString()))}onopen(e){this._ws.addEventListener("open",e)}onerror(e){this._ws.addEventListener("error",e)}onclose(e){this._ws.addEventListener("close",e)}send(e){this._ws.send(e)}close(){this._ws.close()}}class PN{constructor(e){this._onCloseEmitter=new La,this._onReportEmitter=new La,this._onStdioEmitter=new La,this._onTestFilesChangedEmitter=new La,this._onLoadTraceRequestedEmitter=new La,this._lastId=0,this._callbacks=new Map,this._isClosed=!1,this.onClose=this._onCloseEmitter.event,this.onReport=this._onReportEmitter.event,this.onStdio=this._onStdioEmitter.event,this.onTestFilesChanged=this._onTestFilesChangedEmitter.event,this.onLoadTraceRequested=this._onLoadTraceRequestedEmitter.event,this._transport=e,this._transport.onmessage(s=>{const l=JSON.parse(s),{id:o,result:u,error:f,method:d,params:p}=l;if(o){const m=this._callbacks.get(o);if(!m)return;this._callbacks.delete(o),f?m.reject(new Error(f)):m.resolve(u)}else this._dispatchEvent(d,p)});const i=setInterval(()=>this._sendMessage("ping").catch(()=>{}),3e4);this._connectedPromise=new Promise((s,l)=>{this._transport.onopen(s),this._transport.onerror(l)}),this._transport.onclose(()=>{this._isClosed=!0,this._onCloseEmitter.fire(),clearInterval(i)})}isClosed(){return this._isClosed}async _sendMessage(e,i){const s=globalThis.__logForTest;s==null||s({method:e,params:i}),await this._connectedPromise;const l=++this._lastId,o={id:l,method:e,params:i};return this._transport.send(JSON.stringify(o)),new Promise((u,f)=>{this._callbacks.set(l,{resolve:u,reject:f})})}_sendMessageNoReply(e,i){this._sendMessage(e,i).catch(()=>{})}_dispatchEvent(e,i){e==="report"?this._onReportEmitter.fire(i):e==="stdio"?this._onStdioEmitter.fire(i):e==="testFilesChanged"?this._onTestFilesChangedEmitter.fire(i):e==="loadTraceRequested"&&this._onLoadTraceRequestedEmitter.fire(i)}async initialize(e){await this._sendMessage("initialize",e)}async ping(e){await this._sendMessage("ping",e)}async pingNoReply(e){this._sendMessageNoReply("ping",e)}async watch(e){await this._sendMessage("watch",e)}watchNoReply(e){this._sendMessageNoReply("watch",e)}async open(e){await this._sendMessage("open",e)}openNoReply(e){this._sendMessageNoReply("open",e)}async resizeTerminal(e){await this._sendMessage("resizeTerminal",e)}resizeTerminalNoReply(e){this._sendMessageNoReply("resizeTerminal",e)}async checkBrowsers(e){return await this._sendMessage("checkBrowsers",e)}async installBrowsers(e){await this._sendMessage("installBrowsers",e)}async runGlobalSetup(e){return await this._sendMessage("runGlobalSetup",e)}async runGlobalTeardown(e){return await this._sendMessage("runGlobalTeardown",e)}async startDevServer(e){return await this._sendMessage("startDevServer",e)}async stopDevServer(e){return await this._sendMessage("stopDevServer",e)}async clearCache(e){return await this._sendMessage("clearCache",e)}async listFiles(e){return await this._sendMessage("listFiles",e)}async listTests(e){return await this._sendMessage("listTests",e)}async runTests(e){return await this._sendMessage("runTests",e)}async findRelatedTestFiles(e){return await this._sendMessage("findRelatedTestFiles",e)}async stopTests(e){await this._sendMessage("stopTests",e)}stopTestsNoReply(e){this._sendMessageNoReply("stopTests",e)}async closeGracefully(e){await this._sendMessage("closeGracefully",e)}close(){try{this._transport.close()}catch{}}}const FN=()=>{const[n,e]=xn("shouldPopulateCanvasFromScreenshot",!1),[i,s]=Ow(),[l,o]=xn("mergeFiles",!1);return v.jsx(lS,{settings:[{type:"check",value:i,set:s,name:"Dark mode"},{type:"check",value:l,set:o,name:"Merge files"},{type:"check",value:n,set:e,name:"Display canvas content",title:"Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."}]})};export{BN as D,Wx as E,GN as M,Yt as R,Io as S,PN as T,XN as W,Yx as _,FN as a,YN as b,RN as c,qN as d,VN as e,uh as f,$N as g,IN as h,Ke as i,v as j,Cx as k,Bh as l,_t as m,Xt as n,xn as o,lS as p,_w as q,q as r,Ki as s,Z0 as t,es as u};