@checkly/playwright-core 1.48.22-beta → 1.48.22-beta.1

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.
Files changed (34) hide show
  1. package/lib/generated/clockSource.js +2 -1
  2. package/lib/generated/consoleApiSource.js +2 -1
  3. package/lib/generated/injectedScriptSource.js +2 -1
  4. package/lib/generated/pollingRecorderSource.js +2 -1
  5. package/lib/generated/utilityScriptSource.js +2 -1
  6. package/lib/generated/webSocketMockSource.js +2 -1
  7. package/lib/server/trace/recorder/tracing.js +2 -2
  8. package/lib/vite/recorder/assets/codeMirrorModule--bQcPrZ2.js +16437 -0
  9. package/lib/vite/recorder/assets/codeMirrorModule-Cy8X9Wtw.css +344 -0
  10. package/lib/vite/recorder/assets/index-BMeslH8X.js +9946 -0
  11. package/lib/vite/recorder/assets/index-BjXmTggo.css +2515 -0
  12. package/lib/vite/recorder/index.html +2 -2
  13. package/lib/vite/traceViewer/assets/codeMirrorModule-CBokkFJ2.js +16431 -0
  14. package/lib/vite/{recorder/assets/codeMirrorModule-CR6kB851.js → traceViewer/assets/codeMirrorModule-xvopPhZ4.js} +10 -10
  15. package/lib/vite/traceViewer/assets/inspectorTab-BqBvUFio.js +17361 -0
  16. package/lib/vite/traceViewer/assets/inspectorTab-wfvwpMHs.js +64 -0
  17. package/lib/vite/traceViewer/assets/workbench-DUc2iD0P.js +1473 -0
  18. package/lib/vite/traceViewer/assets/workbench-LKskf2Iy.js +9 -0
  19. package/lib/vite/traceViewer/embedded.BOw0jX78.js +106 -0
  20. package/lib/vite/traceViewer/embedded.BXYl5zRv.js +2 -0
  21. package/lib/vite/traceViewer/embedded.html +6 -6
  22. package/lib/vite/traceViewer/index.DW2ZzZfL.js +197 -0
  23. package/lib/vite/traceViewer/index.DZkJsFod.js +2 -0
  24. package/lib/vite/traceViewer/index.html +7 -7
  25. package/lib/vite/traceViewer/recorder.B76AH9PE.js +551 -0
  26. package/lib/vite/traceViewer/recorder.BVExlUUk.js +2 -0
  27. package/lib/vite/traceViewer/recorder.html +4 -4
  28. package/lib/vite/traceViewer/uiMode.DjTS7tqC.js +5 -0
  29. package/lib/vite/traceViewer/uiMode.html +7 -7
  30. package/lib/vite/traceViewer/uiMode.myF_lyEH.js +1724 -0
  31. package/package.json +1 -1
  32. package/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +0 -1
  33. package/lib/vite/recorder/assets/index-BW-aOBcL.css +0 -1
  34. package/lib/vite/recorder/assets/index-BcaUAUCW.js +0 -42
@@ -0,0 +1,9 @@
1
+ import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-wfvwpMHs.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
2
+ linear-gradient(-45deg, #80808020 25%, transparent 25%),
3
+ linear-gradient(45deg, transparent 75%, #80808020 75%),
4
+ linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
5
+ rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
6
+ rgb(0 0 0 / 10%) 0px -2px 4px,
7
+ rgb(0 0 0 / 15%) 0px -6.1px 12px,
8
+ rgb(0 0 0 / 25%) 0px 6px 12px`},ke=({diff:t,noTargetBlank:s})=>{const[i,n]=d.useState(t.diff?"diff":"actual"),[c,l]=d.useState(!1),[a,r]=d.useState(null),[o,x]=d.useState(null),[h,v]=d.useState(null),[m,b]=ht();d.useEffect(()=>{(async()=>{var R,X,z;r(await lt((R=t.expected)==null?void 0:R.attachment.path)),x(await lt((X=t.actual)==null?void 0:X.attachment.path)),v(await lt((z=t.diff)==null?void 0:z.attachment.path))})()},[t]);const j=a&&o&&h,w=j?Math.max(a.naturalWidth,o.naturalWidth,200):500,M=j?Math.max(a.naturalHeight,o.naturalHeight,200):500,f=Math.min(1,(m.width-30)/w),N=Math.min(1,(m.width-50)/w/2),y=w*f,T=M*f,L={flex:"none",margin:"0 10px",cursor:"pointer",userSelect:"none"};return e.jsx("div",{"data-testid":"test-result-image-mismatch",style:{display:"flex",flexDirection:"column",alignItems:"center",flex:"auto"},ref:b,children:j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":"test-result-image-mismatch-tabs",style:{display:"flex",margin:"10px 0 20px"},children:[t.diff&&e.jsx("div",{style:{...L,fontWeight:i==="diff"?600:"initial"},onClick:()=>n("diff"),children:"Diff"}),e.jsx("div",{style:{...L,fontWeight:i==="actual"?600:"initial"},onClick:()=>n("actual"),children:"Actual"}),e.jsx("div",{style:{...L,fontWeight:i==="expected"?600:"initial"},onClick:()=>n("expected"),children:"Expected"}),e.jsx("div",{style:{...L,fontWeight:i==="sxs"?600:"initial"},onClick:()=>n("sxs"),children:"Side by side"}),e.jsx("div",{style:{...L,fontWeight:i==="slider"?600:"initial"},onClick:()=>n("slider"),children:"Slider"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"center",flex:"auto",minHeight:T+60},children:[t.diff&&i==="diff"&&e.jsx(E,{image:h,alt:"Diff",canvasWidth:y,canvasHeight:T,scale:f}),t.diff&&i==="actual"&&e.jsx(E,{image:o,alt:"Actual",canvasWidth:y,canvasHeight:T,scale:f}),t.diff&&i==="expected"&&e.jsx(E,{image:a,alt:"Expected",canvasWidth:y,canvasHeight:T,scale:f}),t.diff&&i==="slider"&&e.jsx(Se,{expectedImage:a,actualImage:o,canvasWidth:y,canvasHeight:T,scale:f}),t.diff&&i==="sxs"&&e.jsxs("div",{style:{display:"flex"},children:[e.jsx(E,{image:a,title:"Expected",canvasWidth:N*w,canvasHeight:N*M,scale:N}),e.jsx(E,{image:c?h:o,title:c?"Diff":"Actual",onClick:()=>l(!c),canvasWidth:N*w,canvasHeight:N*M,scale:N})]}),!t.diff&&i==="actual"&&e.jsx(E,{image:o,title:"Actual",canvasWidth:y,canvasHeight:T,scale:f}),!t.diff&&i==="expected"&&e.jsx(E,{image:a,title:"Expected",canvasWidth:y,canvasHeight:T,scale:f}),!t.diff&&i==="sxs"&&e.jsxs("div",{style:{display:"flex"},children:[e.jsx(E,{image:a,title:"Expected",canvasWidth:N*w,canvasHeight:N*M,scale:N}),e.jsx(E,{image:o,title:"Actual",canvasWidth:N*w,canvasHeight:N*M,scale:N})]})]}),e.jsxs("div",{style:{alignSelf:"start",lineHeight:"18px",marginLeft:"15px"},children:[e.jsx("div",{children:t.diff&&e.jsx("a",{target:"_blank",href:t.diff.attachment.path,rel:"noreferrer",children:t.diff.attachment.name})}),e.jsx("div",{children:e.jsx("a",{target:s?"":"_blank",href:t.actual.attachment.path,rel:"noreferrer",children:t.actual.attachment.name})}),e.jsx("div",{children:e.jsx("a",{target:s?"":"_blank",href:t.expected.attachment.path,rel:"noreferrer",children:t.expected.attachment.name})})]})]})})},Se=({expectedImage:t,actualImage:s,canvasWidth:i,canvasHeight:n,scale:c})=>{const l={position:"absolute",top:0,left:0},[a,r]=d.useState(i/2),o=t.naturalWidth===s.naturalWidth&&t.naturalHeight===s.naturalHeight;return e.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column",userSelect:"none"},children:[e.jsxs("div",{style:{margin:5},children:[!o&&e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"Expected "}),e.jsx("span",{children:t.naturalWidth}),e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),e.jsx("span",{children:t.naturalHeight}),!o&&e.jsx("span",{style:{flex:"none",margin:"0 5px 0 15px"},children:"Actual "}),!o&&e.jsx("span",{children:s.naturalWidth}),!o&&e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),!o&&e.jsx("span",{children:s.naturalHeight})]}),e.jsxs("div",{style:{position:"relative",width:i,height:n,margin:15,...ot},children:[e.jsx(Kt,{orientation:"horizontal",offsets:[a],setOffsets:x=>r(x[0]),resizerColor:"#57606a80",resizerWidth:6}),e.jsx("img",{alt:"Expected",style:{width:t.naturalWidth*c,height:t.naturalHeight*c},draggable:"false",src:t.src}),e.jsx("div",{style:{...l,bottom:0,overflow:"hidden",width:a,...ot},children:e.jsx("img",{alt:"Actual",style:{width:s.naturalWidth*c,height:s.naturalHeight*c},draggable:"false",src:s.src})})]})]})},E=({image:t,title:s,alt:i,canvasWidth:n,canvasHeight:c,scale:l,onClick:a})=>e.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center",flexDirection:"column"},children:[e.jsxs("div",{style:{margin:5},children:[s&&e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:s}),e.jsx("span",{children:t.naturalWidth}),e.jsx("span",{style:{flex:"none",margin:"0 5px"},children:"x"}),e.jsx("span",{children:t.naturalHeight})]}),e.jsx("div",{style:{display:"flex",flex:"none",width:n,height:c,margin:15,...ot},children:e.jsx("img",{width:t.naturalWidth*l,height:t.naturalHeight*l,alt:s||i,style:{cursor:a?"pointer":"initial"},draggable:"false",src:t.src,onClick:a})})]});function Ce(t){return!!t.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/)}const Le=({title:t,children:s,setExpanded:i,expanded:n,expandOnTitleClick:c})=>e.jsxs("div",{className:K("expandable",n&&"expanded"),children:[e.jsxs("div",{className:"expandable-title",onClick:()=>c&&i(!n),children:[e.jsx("div",{className:K("codicon",n?"codicon-chevron-down":"codicon-chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!c&&i(!n)}),t]}),n&&e.jsx("div",{style:{marginLeft:25},children:s})]});function Wt(t){const s=[];let i=0,n;for(;(n=Jt.exec(t))!==null;){const l=t.substring(i,n.index);l&&s.push(l);const a=n[0];s.push(Ie(a)),i=n.index+a.length}const c=t.substring(i);return c&&s.push(c),s}function Ie(t){let s=t;return s.startsWith("www.")&&(s="https://"+s),e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",children:t})}const We=({attachment:t})=>{const[s,i]=d.useState(!1),[n,c]=d.useState(null),[l,a]=d.useState(null),r=Ce(t.contentType),o=!!t.sha1||!!t.path;d.useEffect(()=>{s&&n===null&&l===null&&(a("Loading ..."),fetch(mt(t)).then(v=>v.text()).then(v=>{c(v),a(null)}).catch(v=>{a("Failed to load: "+v.message)}))},[s,n,l,t]);const x=d.useMemo(()=>{const v=n?n.split(`
9
+ `).length:0;return Math.min(Math.max(5,v),20)*Qt},[n]),h=e.jsxs("span",{style:{marginLeft:5},children:[Wt(t.name)," ",o&&e.jsx("a",{style:{marginLeft:5},href:Z(t),children:"download"})]});return!r||!o?e.jsx("div",{style:{marginLeft:20},children:h}):e.jsxs(e.Fragment,{children:[e.jsx(Le,{title:h,expanded:s,setExpanded:i,expandOnTitleClick:!0,children:l&&e.jsx("i",{children:l})}),s&&n!==null&&e.jsx("div",{className:"vbox",style:{height:x},children:e.jsx(Zt,{text:n,readOnly:!0,mimeType:t.contentType,linkify:!0,lineNumbers:!0,wrapLines:!1})})]})},Re=({model:t})=>{const{diffMap:s,screenshots:i,attachments:n}=d.useMemo(()=>{const c=new Set,l=new Set;for(const r of(t==null?void 0:t.actions)||[]){const o=r.context.traceUrl;for(const x of r.attachments||[])c.add({...x,traceUrl:o})}const a=new Map;for(const r of c){if(!r.path&&!r.sha1)continue;const o=r.name.match(/^(.*)-(expected|actual|diff)\.png$/);if(o){const x=o[1],h=o[2],v=a.get(x)||{expected:void 0,actual:void 0,diff:void 0};v[h]=r,a.set(x,v),c.delete(r)}else r.contentType.startsWith("image/")&&(l.add(r),c.delete(r))}return{diffMap:a,attachments:c,screenshots:l}},[t]);return!s.size&&!i.size&&!n.size?e.jsx(J,{text:"No attachments"}):e.jsxs("div",{className:"attachments-tab",children:[[...s.values()].map(({expected:c,actual:l,diff:a})=>e.jsxs(e.Fragment,{children:[c&&l&&e.jsx("div",{className:"attachments-section",children:"Image diff"}),c&&l&&e.jsx(ke,{noTargetBlank:!0,diff:{name:"Image diff",expected:{attachment:{...c,path:Z(c)},title:"Expected"},actual:{attachment:{...l,path:Z(l)}},diff:a?{attachment:{...a,path:Z(a)}}:void 0}})]})),i.size?e.jsx("div",{className:"attachments-section",children:"Screenshots"}):void 0,[...i.values()].map((c,l)=>{const a=mt(c);return e.jsxs("div",{className:"attachment-item",children:[e.jsx("div",{children:e.jsx("img",{draggable:"false",src:a})}),e.jsx("div",{children:e.jsx("a",{target:"_blank",href:a,rel:"noreferrer",children:c.name})})]},`screenshot-${l}`)}),n.size?e.jsx("div",{className:"attachments-section",children:"Attachments"}):void 0,[...n.values()].map((c,l)=>e.jsx("div",{className:"attachment-item",children:e.jsx(We,{attachment:c})},ze(c,l)))]})};function mt(t,s={}){const i=new URLSearchParams(s);return t.sha1?(i.set("trace",t.traceUrl),"sha1/"+t.sha1+"?"+i.toString()):(i.set("path",t.path),"file?"+i.toString())}function Z(t){const s={dn:t.name};return t.contentType&&(s.dct=t.contentType),mt(t,s)}function ze(t,s){return s+"-"+(t.sha1?"sha1-"+t.sha1:"path-"+t.path)}const He=({annotations:t})=>t.length?e.jsx("div",{className:"annotations-tab",children:t.map((s,i)=>e.jsxs("div",{className:"annotation-item",children:[e.jsx("span",{style:{fontWeight:"bold"},children:s.type}),s.description&&e.jsxs("span",{children:[": ",Wt(s.description)]})]},`annotation-${i}`))}):e.jsx(J,{text:"No annotations"});function Xe(t){return t==="scheduled"?"codicon-clock":t==="running"?"codicon-loading":t==="failed"?"codicon-error":t==="passed"?"codicon-check":t==="skipped"?"codicon-circle-slash":"codicon-circle-outline"}function Ae(t){return t==="scheduled"?"Pending":t==="running"?"Running":t==="failed"?"Failed":t==="passed"?"Passed":t==="skipped"?"Skipped":"Did not run"}const Ee=({model:t,showSourcesFirst:s,rootDir:i,fallbackLocation:n,isLive:c,hideTimeline:l,status:a,annotations:r,inert:o,openPage:x,onOpenExternally:h,revealSource:v,showSettings:m})=>{var vt;const[b,j]=d.useState(void 0),[w,M]=d.useState(void 0),[f,N]=d.useState(),[y,T]=d.useState(),[L,R]=d.useState(),[X,z]=d.useState("actions"),[G,p]=jt("propertiesTab",s?"source":"call"),[u,S]=d.useState(!1),[C,k]=d.useState(""),[I,P]=d.useState(),[A,U]=jt("propertiesSidebarLocation","bottom"),$=!1,et=d.useCallback(g=>{j(g==null?void 0:g.callId),M(void 0)},[]),st=d.useMemo(()=>t==null?void 0:t.actions.find(g=>g.callId===f),[t,f]),it=d.useCallback(g=>{N(g==null?void 0:g.callId)},[]),Rt=d.useMemo(()=>(t==null?void 0:t.sources)||new Map,[t]);d.useEffect(()=>{P(void 0),M(void 0)},[t]);const B=d.useMemo(()=>{if(b){const q=t==null?void 0:t.actions.find(O=>O.callId===b);if(q)return q}const g=t==null?void 0:t.failedAction();if(g)return g;if(t!=null&&t.actions.length){let q=t.actions.length-1;for(let O=0;O<t.actions.length;++O)if(t.actions[O].apiName==="After Hooks"&&O){q=O-1;break}return t.actions[q]}},[t,b]),zt=d.useMemo(()=>w?w.stack:B==null?void 0:B.stack,[B,w]),nt=d.useMemo(()=>st||B,[B,st]),ut=d.useCallback(g=>{et(g),it(void 0)},[et,it]),D=d.useCallback(g=>{p(g),g!=="inspector"&&S(!1)},[p]),xt=d.useCallback(g=>{!u&&g&&D("inspector"),S(g)},[S,D,u]),Ht=d.useCallback(g=>{k(g),D("inspector")},[D]);d.useEffect(()=>{v&&D("source")},[v,D]);const at=te(t,I),ft=ee(t,I),pt=ge(t),Xt=d.useMemo(()=>(t==null?void 0:t.actions.map(g=>g.attachments||[]).flat())||[],[t]),V=(t==null?void 0:t.sdkLanguage)||"javascript",At={id:"inspector",title:"Locator",render:()=>e.jsx(ae,{showScreenshot:$,sdkLanguage:V,setIsInspecting:xt,highlightedLocator:C,setHighlightedLocator:k})},Dt={id:"call",title:"Call",render:()=>e.jsx(ue,{action:nt,sdkLanguage:V})},Et={id:"log",title:"Log",render:()=>e.jsx(fe,{action:nt,isLive:c})},Ft={id:"errors",title:"Errors",errorCount:pt.errors.size,render:()=>e.jsx(ve,{errorsModel:pt,sdkLanguage:V,revealInSource:g=>{g.action?et(g.action):M(g),D("source")}})};let gt;!B&&n&&(gt=(vt=n.source)==null?void 0:vt.errors.length);const rt={id:"source",title:"Source",errorCount:gt,render:()=>e.jsx(re,{stack:zt,sources:Rt,rootDir:i,stackFrameLocation:A==="bottom"?"right":"bottom",fallbackLocation:n,onOpenExternally:h})},Pt={id:"console",title:"Console",count:at.entries.length,render:()=>e.jsx(se,{consoleModel:at,boundaries:ct,selectedTime:I,onAccepted:g=>P({minimum:g.timestamp,maximum:g.timestamp}),onEntryHovered:R})},Ut={id:"network",title:"Network",count:ft.resources.length,render:()=>e.jsx(ie,{boundaries:ct,networkModel:ft,onEntryHovered:T})},Bt={id:"attachments",title:"Attachments",count:Xt.length,render:()=>e.jsx(Re,{model:t})},Y=[At,Dt,Et,Ft,Pt,Ut,rt,Bt];if(r!==void 0){const g={id:"annotations",title:"Annotations",count:r.length,render:()=>e.jsx(He,{annotations:r})};Y.push(g)}if(s){const g=Y.indexOf(rt);Y.splice(g,1),Y.splice(1,0,rt)}const{boundaries:ct}=d.useMemo(()=>{const g={minimum:(t==null?void 0:t.startTime)||0,maximum:(t==null?void 0:t.endTime)||3e4};return g.minimum>g.maximum&&(g.minimum=0,g.maximum=3e4),g.maximum+=(g.maximum-g.minimum)/20,{boundaries:g}},[t]);let Q=0;!c&&t&&t.endTime>=0?Q=t.endTime-t.startTime:t&&t.wallTime&&(Q=Date.now()-t.wallTime);const $t={id:"actions",title:"Actions",component:e.jsxs("div",{className:"vbox",children:[a&&e.jsxs("div",{className:"workbench-run-status",children:[e.jsx("span",{className:K("codicon",Xe(a))}),e.jsx("div",{children:Ae(a)}),e.jsx("div",{className:"spacer"}),e.jsx("div",{className:"workbench-run-duration",children:Q?F(Q):""})]}),e.jsx(de,{sdkLanguage:V,actions:(t==null?void 0:t.actions)||[],selectedAction:t?B:void 0,selectedTime:I,setSelectedTime:P,onSelected:ut,onHighlighted:it,revealConsole:()=>D("console"),isLive:c})]})},Ot={id:"metadata",title:"Metadata",component:e.jsx(Me,{model:t})};return e.jsxs("div",{className:"vbox workbench",...o?{inert:"true"}:{},children:[!l&&e.jsx(be,{model:t,consoleEntries:at.entries,boundaries:ct,highlightedAction:st,highlightedEntry:y,highlightedConsoleEntry:L,onSelected:ut,sdkLanguage:V,selectedTime:I,setSelectedTime:P}),e.jsx(wt,{sidebarSize:250,orientation:A==="bottom"?"vertical":"horizontal",settingName:"propertiesSidebar",main:e.jsx(wt,{sidebarSize:250,orientation:"horizontal",sidebarIsFirst:!0,settingName:"actionListSidebar",main:e.jsx(ne,{action:nt,model:t,sdkLanguage:V,testIdAttributeName:(t==null?void 0:t.testIdAttributeName)||"data-testid",isInspecting:u,setIsInspecting:xt,highlightedLocator:C,setHighlightedLocator:Ht,openPage:x}),sidebar:e.jsx(Nt,{tabs:[$t,Ot],selectedTab:X,setSelectedTab:z})}),sidebar:e.jsx(Nt,{tabs:Y,selectedTab:G,setSelectedTab:D,rightToolbar:[A==="bottom"?e.jsx(bt,{title:"Dock to right",icon:"layout-sidebar-right-off",onClick:()=>{U("right")}}):e.jsx(bt,{title:"Dock to bottom",icon:"layout-panel-off",onClick:()=>{U("bottom")}})],mode:A==="bottom"?"default":"select"})})]})};export{Le as E,le as T,Ee as W,Xe as t};
@@ -0,0 +1,106 @@
1
+ import { M as MultiTraceModel, r as reactExports, b as currentTheme, t as toggleTheme, j as jsxRuntimeExports, a as applyTheme, c as createRoot } from "./assets/inspectorTab-BqBvUFio.js";
2
+ import { W as Workbench } from "./assets/workbench-DUc2iD0P.js";
3
+ function openPage(url, target) {
4
+ if (url)
5
+ window.parent.postMessage({ method: "openExternal", params: { url, target } }, "*");
6
+ }
7
+ function openSourceLocation({ file, line, column }) {
8
+ window.parent.postMessage({ method: "openSourceLocation", params: { file, line, column } }, "*");
9
+ }
10
+ const EmbeddedWorkbenchLoader = () => {
11
+ const [traceURLs, setTraceURLs] = reactExports.useState([]);
12
+ const [model, setModel] = reactExports.useState(emptyModel);
13
+ const [progress, setProgress] = reactExports.useState({ done: 0, total: 0 });
14
+ const [processingErrorMessage, setProcessingErrorMessage] = reactExports.useState(null);
15
+ reactExports.useEffect(() => {
16
+ window.addEventListener("message", async ({ data: { method, params } }) => {
17
+ if (method === "loadTraceRequested") {
18
+ setTraceURLs(params.traceUrl ? [params.traceUrl] : []);
19
+ setProcessingErrorMessage(null);
20
+ } else if (method === "applyTheme") {
21
+ if (currentTheme() !== params.theme)
22
+ toggleTheme();
23
+ }
24
+ });
25
+ window.parent.postMessage({ type: "loaded" }, "*");
26
+ }, []);
27
+ reactExports.useEffect(() => {
28
+ (async () => {
29
+ if (traceURLs.length) {
30
+ const swListener = (event) => {
31
+ if (event.data.method === "progress")
32
+ setProgress(event.data.params);
33
+ };
34
+ navigator.serviceWorker.addEventListener("message", swListener);
35
+ setProgress({ done: 0, total: 1 });
36
+ const contextEntries = [];
37
+ for (let i = 0; i < traceURLs.length; i++) {
38
+ const url = traceURLs[i];
39
+ const params = new URLSearchParams();
40
+ params.set("trace", url);
41
+ params.set("limit", String(traceURLs.length));
42
+ const response = await fetch(`contexts?${params.toString()}`);
43
+ if (!response.ok) {
44
+ setProcessingErrorMessage((await response.json()).error);
45
+ return;
46
+ }
47
+ contextEntries.push(...await response.json());
48
+ }
49
+ navigator.serviceWorker.removeEventListener("message", swListener);
50
+ const model2 = new MultiTraceModel(contextEntries);
51
+ setProgress({ done: 0, total: 0 });
52
+ setModel(model2);
53
+ } else {
54
+ setModel(emptyModel);
55
+ }
56
+ })();
57
+ }, [traceURLs]);
58
+ reactExports.useEffect(() => {
59
+ var _a;
60
+ if (processingErrorMessage)
61
+ (_a = window.parent) == null ? void 0 : _a.postMessage({ method: "showErrorMessage", params: { message: processingErrorMessage } }, "*");
62
+ }, [processingErrorMessage]);
63
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vbox workbench-loader", children: [
64
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "progress", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "inner-progress", style: { width: progress.total ? 100 * progress.done / progress.total + "%" : 0 } }) }),
65
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Workbench, { model, openPage, onOpenExternally: openSourceLocation, showSettings: true }),
66
+ !traceURLs.length && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "empty-state", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Select test to see the trace" }) })
67
+ ] });
68
+ };
69
+ const emptyModel = new MultiTraceModel([]);
70
+ (async () => {
71
+ applyTheme();
72
+ const handleKeyEvent = (e) => {
73
+ var _a;
74
+ if (!e.isTrusted)
75
+ return;
76
+ (_a = window.parent) == null ? void 0 : _a.postMessage({
77
+ type: e.type,
78
+ key: e.key,
79
+ keyCode: e.keyCode,
80
+ code: e.code,
81
+ shiftKey: e.shiftKey,
82
+ altKey: e.altKey,
83
+ ctrlKey: e.ctrlKey,
84
+ metaKey: e.metaKey,
85
+ repeat: e.repeat
86
+ }, "*");
87
+ };
88
+ window.addEventListener("keydown", handleKeyEvent);
89
+ window.addEventListener("keyup", handleKeyEvent);
90
+ if (window.location.protocol !== "file:") {
91
+ if (!navigator.serviceWorker)
92
+ throw new Error(`Service workers are not supported.
93
+ Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
94
+ navigator.serviceWorker.register("sw.bundle.js");
95
+ if (!navigator.serviceWorker.controller) {
96
+ await new Promise((f) => {
97
+ navigator.serviceWorker.oncontrollerchange = () => f();
98
+ });
99
+ }
100
+ setInterval(function() {
101
+ fetch("ping");
102
+ }, 1e4);
103
+ }
104
+ createRoot(document.querySelector("#root")).render(/* @__PURE__ */ jsxRuntimeExports.jsx(EmbeddedWorkbenchLoader, {}));
105
+ })();
106
+ //# sourceMappingURL=embedded.BOw0jX78.js.map
@@ -0,0 +1,2 @@
1
+ import{M as u,r,b as y,t as E,j as o,a as k,c as x}from"./assets/inspectorTab-wfvwpMHs.js";import{W as M}from"./assets/workbench-LKskf2Iy.js";function S(t,e){t&&window.parent.postMessage({method:"openExternal",params:{url:t,target:e}},"*")}function j({file:t,line:e,column:a}){window.parent.postMessage({method:"openSourceLocation",params:{file:t,line:e,column:a}},"*")}const L=()=>{const[t,e]=r.useState([]),[a,g]=r.useState(h),[c,l]=r.useState({done:0,total:0}),[d,m]=r.useState(null);return r.useEffect(()=>{window.addEventListener("message",async({data:{method:s,params:n}})=>{s==="loadTraceRequested"?(e(n.traceUrl?[n.traceUrl]:[]),m(null)):s==="applyTheme"&&y()!==n.theme&&E()}),window.parent.postMessage({type:"loaded"},"*")},[]),r.useEffect(()=>{(async()=>{if(t.length){const s=i=>{i.data.method==="progress"&&l(i.data.params)};navigator.serviceWorker.addEventListener("message",s),l({done:0,total:1});const n=[];for(let i=0;i<t.length;i++){const v=t[i],p=new URLSearchParams;p.set("trace",v),p.set("limit",String(t.length));const w=await fetch(`contexts?${p.toString()}`);if(!w.ok){m((await w.json()).error);return}n.push(...await w.json())}navigator.serviceWorker.removeEventListener("message",s);const f=new u(n);l({done:0,total:0}),g(f)}else g(h)})()},[t]),r.useEffect(()=>{var s;d&&((s=window.parent)==null||s.postMessage({method:"showErrorMessage",params:{message:d}},"*"))},[d]),o.jsxs("div",{className:"vbox workbench-loader",children:[o.jsx("div",{className:"progress",children:o.jsx("div",{className:"inner-progress",style:{width:c.total?100*c.done/c.total+"%":0}})}),o.jsx(M,{model:a,openPage:S,onOpenExternally:j,showSettings:!0}),!t.length&&o.jsx("div",{className:"empty-state",children:o.jsx("div",{className:"title",children:"Select test to see the trace"})})]})},h=new u([]);(async()=>{k();const t=e=>{var a;e.isTrusted&&((a=window.parent)==null||a.postMessage({type:e.type,key:e.key,keyCode:e.keyCode,code:e.code,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,repeat:e.repeat},"*"))};if(window.addEventListener("keydown",t),window.addEventListener("keyup",t),window.location.protocol!=="file:"){if(!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
+ Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(e=>{navigator.serviceWorker.oncontrollerchange=()=>e()}),setInterval(function(){fetch("ping")},1e4)}x(document.querySelector("#root")).render(o.jsx(L,{}))})();
@@ -5,12 +5,12 @@
5
5
  <meta charset="UTF-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>Playwright Trace Viewer for VS Code</title>
8
- <script type="module" crossorigin src="./embedded.BIubxTi3.js"></script>
9
- <link rel="modulepreload" crossorigin href="./assets/inspectorTab-BPzhNk9r.js">
10
- <link rel="modulepreload" crossorigin href="./assets/workbench-DLv_q9ji.js">
11
- <link rel="stylesheet" crossorigin href="./inspectorTab.DLjBDrQR.css">
12
- <link rel="stylesheet" crossorigin href="./workbench.DlsCx8k5.css">
13
- <link rel="stylesheet" crossorigin href="./embedded.w7WN2u1R.css">
8
+ <script type="module" crossorigin src="./embedded.DeCrOtlO.js"></script>
9
+ <link rel="modulepreload" crossorigin href="./assets/inspectorTab-DOc4D3cX.js">
10
+ <link rel="modulepreload" crossorigin href="./assets/workbench-DNolpp3y.js">
11
+ <link rel="stylesheet" crossorigin href="./inspectorTab.DGJWXOSd.css">
12
+ <link rel="stylesheet" crossorigin href="./workbench.BQNDbcQ0.css">
13
+ <link rel="stylesheet" crossorigin href="./embedded.DjZq4InJ.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -0,0 +1,197 @@
1
+ import { M as MultiTraceModel, r as reactExports, j as jsxRuntimeExports, T as ToolbarButton, t as toggleTheme, a as applyTheme, c as createRoot } from "./assets/inspectorTab-BqBvUFio.js";
2
+ import { W as Workbench } from "./assets/workbench-DUc2iD0P.js";
3
+ import { T as TestServerConnection, W as WebSocketTestServerTransport } from "./assets/testServerConnection-D-tXL3sj.js";
4
+ const WorkbenchLoader = () => {
5
+ const [isServer, setIsServer] = reactExports.useState(false);
6
+ const [traceURLs, setTraceURLs] = reactExports.useState([]);
7
+ const [uploadedTraceNames, setUploadedTraceNames] = reactExports.useState([]);
8
+ const [model, setModel] = reactExports.useState(emptyModel);
9
+ const [progress, setProgress] = reactExports.useState({ done: 0, total: 0 });
10
+ const [dragOver, setDragOver] = reactExports.useState(false);
11
+ const [processingErrorMessage, setProcessingErrorMessage] = reactExports.useState(null);
12
+ const [fileForLocalModeError, setFileForLocalModeError] = reactExports.useState(null);
13
+ const processTraceFiles = reactExports.useCallback((files) => {
14
+ const blobUrls = [];
15
+ const fileNames = [];
16
+ const url = new URL(window.location.href);
17
+ for (let i = 0; i < files.length; i++) {
18
+ const file = files.item(i);
19
+ if (!file)
20
+ continue;
21
+ const blobTraceURL = URL.createObjectURL(file);
22
+ blobUrls.push(blobTraceURL);
23
+ fileNames.push(file.name);
24
+ url.searchParams.append("trace", blobTraceURL);
25
+ url.searchParams.append("traceFileName", file.name);
26
+ }
27
+ const href = url.toString();
28
+ window.history.pushState({}, "", href);
29
+ setTraceURLs(blobUrls);
30
+ setUploadedTraceNames(fileNames);
31
+ setDragOver(false);
32
+ setProcessingErrorMessage(null);
33
+ }, []);
34
+ reactExports.useEffect(() => {
35
+ const listener = async (e) => {
36
+ var _a;
37
+ if (!((_a = e.clipboardData) == null ? void 0 : _a.files.length))
38
+ return;
39
+ for (const file of e.clipboardData.files) {
40
+ if (file.type !== "application/zip")
41
+ return;
42
+ }
43
+ e.preventDefault();
44
+ processTraceFiles(e.clipboardData.files);
45
+ };
46
+ document.addEventListener("paste", listener);
47
+ return () => document.removeEventListener("paste", listener);
48
+ });
49
+ const handleDropEvent = reactExports.useCallback((event) => {
50
+ event.preventDefault();
51
+ processTraceFiles(event.dataTransfer.files);
52
+ }, [processTraceFiles]);
53
+ const handleFileInputChange = reactExports.useCallback((event) => {
54
+ event.preventDefault();
55
+ if (!event.target.files)
56
+ return;
57
+ processTraceFiles(event.target.files);
58
+ }, [processTraceFiles]);
59
+ reactExports.useEffect(() => {
60
+ const params = new URL(window.location.href).searchParams;
61
+ const newTraceURLs = params.getAll("trace");
62
+ setIsServer(params.has("isServer"));
63
+ for (const url of newTraceURLs) {
64
+ if (url.startsWith("file:")) {
65
+ setFileForLocalModeError(url || null);
66
+ return;
67
+ }
68
+ }
69
+ if (params.has("isServer")) {
70
+ const guid = new URLSearchParams(window.location.search).get("ws");
71
+ const wsURL = new URL(`../${guid}`, window.location.toString());
72
+ wsURL.protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
73
+ const testServerConnection = new TestServerConnection(new WebSocketTestServerTransport(wsURL));
74
+ testServerConnection.onLoadTraceRequested(async (params2) => {
75
+ setTraceURLs(params2.traceUrl ? [params2.traceUrl] : []);
76
+ setDragOver(false);
77
+ setProcessingErrorMessage(null);
78
+ });
79
+ testServerConnection.initialize({}).catch(() => {
80
+ });
81
+ } else if (!newTraceURLs.some((url) => url.startsWith("blob:"))) {
82
+ setTraceURLs(newTraceURLs);
83
+ }
84
+ }, []);
85
+ reactExports.useEffect(() => {
86
+ (async () => {
87
+ if (traceURLs.length) {
88
+ const swListener = (event) => {
89
+ if (event.data.method === "progress")
90
+ setProgress(event.data.params);
91
+ };
92
+ navigator.serviceWorker.addEventListener("message", swListener);
93
+ setProgress({ done: 0, total: 1 });
94
+ const contextEntries = [];
95
+ for (let i = 0; i < traceURLs.length; i++) {
96
+ const url = traceURLs[i];
97
+ const params = new URLSearchParams();
98
+ params.set("trace", url);
99
+ if (uploadedTraceNames.length)
100
+ params.set("traceFileName", uploadedTraceNames[i]);
101
+ params.set("limit", String(traceURLs.length));
102
+ const response = await fetch(`contexts?${params.toString()}`);
103
+ if (!response.ok) {
104
+ if (!isServer)
105
+ setTraceURLs([]);
106
+ setProcessingErrorMessage((await response.json()).error);
107
+ return;
108
+ }
109
+ contextEntries.push(...await response.json());
110
+ }
111
+ navigator.serviceWorker.removeEventListener("message", swListener);
112
+ const model2 = new MultiTraceModel(contextEntries);
113
+ setProgress({ done: 0, total: 0 });
114
+ setModel(model2);
115
+ } else {
116
+ setModel(emptyModel);
117
+ }
118
+ })();
119
+ }, [isServer, traceURLs, uploadedTraceNames]);
120
+ const showFileUploadDropArea = !!(!isServer && !dragOver && !fileForLocalModeError && (!traceURLs.length || processingErrorMessage));
121
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vbox workbench-loader", onDragOver: (event) => {
122
+ event.preventDefault();
123
+ setDragOver(true);
124
+ }, children: [
125
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hbox header", ...showFileUploadDropArea ? { inert: "true" } : {}, children: [
126
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "logo", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "playwright-logo.svg", alt: "Playwright logo" }) }),
127
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "product", children: "Playwright" }),
128
+ model.title && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: model.title }),
129
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "spacer" }),
130
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "color-mode", title: "Toggle color mode", toggled: false, onClick: () => toggleTheme() })
131
+ ] }),
132
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "progress", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "inner-progress", style: { width: progress.total ? 100 * progress.done / progress.total + "%" : 0 } }) }),
133
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Workbench, { model, inert: showFileUploadDropArea, showSettings: true }),
134
+ fileForLocalModeError && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "drop-target", children: [
135
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Trace Viewer uses Service Workers to show traces. To view trace:" }),
136
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { paddingTop: 20 }, children: [
137
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
138
+ "1. Click ",
139
+ /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: fileForLocalModeError, children: "here" }),
140
+ " to put your trace into the download shelf"
141
+ ] }),
142
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
143
+ "2. Go to ",
144
+ /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://trace.playwright.dev", children: "trace.playwright.dev" })
145
+ ] }),
146
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "3. Drop the trace from the download shelf into the page" })
147
+ ] })
148
+ ] }),
149
+ showFileUploadDropArea && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "drop-target", children: [
150
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "processing-error", role: "alert", children: processingErrorMessage }),
151
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", role: "heading", "aria-level": 1, children: "Drop Playwright Trace to load" }),
152
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "or" }),
153
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => {
154
+ const input = document.createElement("input");
155
+ input.type = "file";
156
+ input.multiple = true;
157
+ input.click();
158
+ input.addEventListener("change", (e) => handleFileInputChange(e));
159
+ }, type: "button", children: "Select file(s)" }),
160
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { maxWidth: 400 }, children: "Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally." })
161
+ ] }),
162
+ isServer && !traceURLs.length && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "drop-target", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Select test to see the trace" }) }),
163
+ dragOver && /* @__PURE__ */ jsxRuntimeExports.jsx(
164
+ "div",
165
+ {
166
+ className: "drop-target",
167
+ onDragLeave: () => {
168
+ setDragOver(false);
169
+ },
170
+ onDrop: (event) => handleDropEvent(event),
171
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: "Release to analyse the Playwright Trace" })
172
+ }
173
+ )
174
+ ] });
175
+ };
176
+ const emptyModel = new MultiTraceModel([]);
177
+ (async () => {
178
+ applyTheme();
179
+ if (window.location.protocol !== "file:") {
180
+ if (window.location.href.includes("isUnderTest=true"))
181
+ await new Promise((f) => setTimeout(f, 1e3));
182
+ if (!navigator.serviceWorker)
183
+ throw new Error(`Service workers are not supported.
184
+ Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
185
+ navigator.serviceWorker.register("sw.bundle.js");
186
+ if (!navigator.serviceWorker.controller) {
187
+ await new Promise((f) => {
188
+ navigator.serviceWorker.oncontrollerchange = () => f();
189
+ });
190
+ }
191
+ setInterval(function() {
192
+ fetch("ping");
193
+ }, 1e4);
194
+ }
195
+ createRoot(document.querySelector("#root")).render(/* @__PURE__ */ jsxRuntimeExports.jsx(WorkbenchLoader, {}));
196
+ })();
197
+ //# sourceMappingURL=index.DW2ZzZfL.js.map
@@ -0,0 +1,2 @@
1
+ import{M as k,r as o,j as e,T as W,t as D,a as M,c as C}from"./assets/inspectorTab-wfvwpMHs.js";import{W as F}from"./assets/workbench-LKskf2Iy.js";import{T as O,W as A}from"./assets/testServerConnection-DeE2kSzz.js";const I=()=>{const[i,N]=o.useState(!1),[c,p]=o.useState([]),[u,E]=o.useState([]),[f,S]=o.useState(L),[v,m]=o.useState({done:0,total:0}),[T,g]=o.useState(!1),[y,w]=o.useState(null),[x,U]=o.useState(null),h=o.useCallback(t=>{const r=[],a=[],s=new URL(window.location.href);for(let n=0;n<t.length;n++){const l=t.item(n);if(!l)continue;const b=URL.createObjectURL(l);r.push(b),a.push(l.name),s.searchParams.append("trace",b),s.searchParams.append("traceFileName",l.name)}const d=s.toString();window.history.pushState({},"",d),p(r),E(a),g(!1),w(null)},[]);o.useEffect(()=>{const t=async r=>{var a;if((a=r.clipboardData)!=null&&a.files.length){for(const s of r.clipboardData.files)if(s.type!=="application/zip")return;r.preventDefault(),h(r.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)});const P=o.useCallback(t=>{t.preventDefault(),h(t.dataTransfer.files)},[h]),R=o.useCallback(t=>{t.preventDefault(),t.target.files&&h(t.target.files)},[h]);o.useEffect(()=>{const t=new URL(window.location.href).searchParams,r=t.getAll("trace");N(t.has("isServer"));for(const a of r)if(a.startsWith("file:")){U(a||null);return}if(t.has("isServer")){const a=new URLSearchParams(window.location.search).get("ws"),s=new URL(`../${a}`,window.location.toString());s.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new O(new A(s));d.onLoadTraceRequested(async n=>{p(n.traceUrl?[n.traceUrl]:[]),g(!1),w(null)}),d.initialize({}).catch(()=>{})}else r.some(a=>a.startsWith("blob:"))||p(r)},[]),o.useEffect(()=>{(async()=>{if(c.length){const t=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",t),m({done:0,total:1});const r=[];for(let s=0;s<c.length;s++){const d=c[s],n=new URLSearchParams;n.set("trace",d),u.length&&n.set("traceFileName",u[s]),n.set("limit",String(c.length));const l=await fetch(`contexts?${n.toString()}`);if(!l.ok){i||p([]),w((await l.json()).error);return}r.push(...await l.json())}navigator.serviceWorker.removeEventListener("message",t);const a=new k(r);m({done:0,total:0}),S(a)}else S(L)})()},[i,c,u]);const j=!!(!i&&!T&&!x&&(!c.length||y));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),g(!0)},children:[e.jsxs("div",{className:"hbox header",...j?{inert:"true"}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),f.title&&e.jsx("div",{className:"title",children:f.title}),e.jsx("div",{className:"spacer"}),e.jsx(W,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>D()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(F,{model:f,inert:j,showSettings:!0}),x&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:x,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),j&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:y}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.multiple=!0,t.click(),t.addEventListener("change",r=>R(r))},type:"button",children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),i&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{g(!1)},onDrop:t=>P(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},L=new k([]);(async()=>{if(M(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(i=>setTimeout(i,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
+ Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(i=>{navigator.serviceWorker.oncontrollerchange=()=>i()}),setInterval(function(){fetch("ping")},1e4)}C(document.querySelector("#root")).render(e.jsx(I,{}))})();
@@ -7,13 +7,13 @@
7
7
  <link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
8
8
  <link rel="manifest" href="./manifest.webmanifest">
9
9
  <title>Playwright Trace Viewer</title>
10
- <script type="module" crossorigin src="./index.DPD22sZn.js"></script>
11
- <link rel="modulepreload" crossorigin href="./assets/inspectorTab-BPzhNk9r.js">
12
- <link rel="modulepreload" crossorigin href="./assets/workbench-DLv_q9ji.js">
13
- <link rel="modulepreload" crossorigin href="./assets/testServerConnection-DeE2kSzz.js">
14
- <link rel="stylesheet" crossorigin href="./inspectorTab.DLjBDrQR.css">
15
- <link rel="stylesheet" crossorigin href="./workbench.DlsCx8k5.css">
16
- <link rel="stylesheet" crossorigin href="./index.CrbWWHbf.css">
10
+ <script type="module" crossorigin src="./index.CM_h9lHr.js"></script>
11
+ <link rel="modulepreload" crossorigin href="./assets/inspectorTab-DOc4D3cX.js">
12
+ <link rel="modulepreload" crossorigin href="./assets/workbench-DNolpp3y.js">
13
+ <link rel="modulepreload" crossorigin href="./assets/testServerConnection-D-tXL3sj.js">
14
+ <link rel="stylesheet" crossorigin href="./inspectorTab.DGJWXOSd.css">
15
+ <link rel="stylesheet" crossorigin href="./workbench.BQNDbcQ0.css">
16
+ <link rel="stylesheet" crossorigin href="./index.QanXxRUb.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>