patchright-core 1.49.1 → 1.50.0

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 (120) hide show
  1. package/ThirdPartyNotices.txt +9 -9
  2. package/bin/reinstall_msedge_beta_linux.sh +6 -0
  3. package/bin/reinstall_msedge_dev_linux.sh +6 -0
  4. package/bin/reinstall_msedge_stable_linux.sh +6 -0
  5. package/browsers.json +17 -16
  6. package/lib/androidServerImpl.js +1 -1
  7. package/lib/cli/program.js +6 -30
  8. package/lib/client/channelOwner.js +35 -55
  9. package/lib/client/clientInstrumentation.js +2 -0
  10. package/lib/client/connection.js +3 -3
  11. package/lib/client/network.js +3 -1
  12. package/lib/client/waiter.js +1 -1
  13. package/lib/generated/consoleApiSource.js +1 -1
  14. package/lib/generated/injectedScriptSource.js +1 -1
  15. package/lib/generated/pollingRecorderSource.js +1 -1
  16. package/lib/inProcessFactory.js +2 -0
  17. package/lib/protocol/debug.js +1 -1
  18. package/lib/protocol/validator.js +2 -2
  19. package/lib/remote/playwrightConnection.js +4 -3
  20. package/lib/remote/playwrightServer.js +2 -1
  21. package/lib/server/bidi/bidiBrowser.js +9 -6
  22. package/lib/server/bidi/bidiExecutionContext.js +20 -1
  23. package/lib/server/bidi/bidiInput.js +7 -5
  24. package/lib/server/bidi/bidiNetworkManager.js +8 -9
  25. package/lib/server/bidi/bidiPage.js +9 -20
  26. package/lib/server/bidi/third_party/bidiKeyboard.js +9 -7
  27. package/lib/server/browserContext.js +24 -16
  28. package/lib/server/chromium/crBrowser.js +10 -10
  29. package/lib/server/chromium/crExecutionContext.js +1 -5
  30. package/lib/server/chromium/crInput.js +15 -4
  31. package/lib/server/chromium/crPage.js +19 -31
  32. package/lib/server/codegen/csharp.js +12 -2
  33. package/lib/server/codegen/java.js +14 -3
  34. package/lib/server/codegen/javascript.js +10 -2
  35. package/lib/server/codegen/jsonl.js +1 -1
  36. package/lib/server/codegen/python.js +5 -4
  37. package/lib/server/debugController.js +15 -40
  38. package/lib/server/debugger.js +1 -1
  39. package/lib/server/deviceDescriptorsSource.json +50 -50
  40. package/lib/server/dispatchers/browserContextDispatcher.js +2 -13
  41. package/lib/server/dispatchers/debugControllerDispatcher.js +4 -2
  42. package/lib/server/dispatchers/frameDispatcher.js +3 -2
  43. package/lib/server/dispatchers/pageDispatcher.js +1 -1
  44. package/lib/server/dispatchers/webSocketRouteDispatcher.js +10 -11
  45. package/lib/server/dom.js +7 -2
  46. package/lib/server/firefox/ffBrowser.js +6 -6
  47. package/lib/server/firefox/ffInput.js +15 -4
  48. package/lib/server/firefox/ffPage.js +13 -28
  49. package/lib/server/frames.js +30 -39
  50. package/lib/server/har/harTracer.js +1 -1
  51. package/lib/server/input.js +2 -3
  52. package/lib/server/launchApp.js +5 -5
  53. package/lib/server/network.js +2 -2
  54. package/lib/server/page.js +23 -16
  55. package/lib/server/recorder/chat.js +177 -0
  56. package/lib/server/recorder/contextRecorder.js +6 -15
  57. package/lib/server/recorder/recorderApp.js +1 -1
  58. package/lib/server/recorder/recorderCollection.js +5 -17
  59. package/lib/server/recorder/recorderRunner.js +7 -3
  60. package/lib/server/recorder/recorderUtils.js +5 -29
  61. package/lib/server/recorder.js +12 -9
  62. package/lib/server/registry/browserFetcher.js +1 -1
  63. package/lib/server/registry/dependencies.js +5 -5
  64. package/lib/server/registry/index.js +118 -5
  65. package/lib/server/registry/nativeDeps.js +7 -4
  66. package/lib/server/trace/recorder/snapshotterInjected.js +12 -5
  67. package/lib/server/trace/viewer/traceViewer.js +6 -1
  68. package/lib/server/transport.js +1 -0
  69. package/lib/server/webkit/webkit.js +1 -1
  70. package/lib/server/webkit/wkBrowser.js +6 -6
  71. package/lib/server/webkit/wkExecutionContext.js +1 -0
  72. package/lib/server/webkit/wkInput.js +15 -5
  73. package/lib/server/webkit/wkPage.js +9 -25
  74. package/lib/utils/comparators.js +16 -10
  75. package/lib/utils/debugLogger.js +3 -1
  76. package/lib/utils/hostPlatform.js +14 -8
  77. package/lib/utils/isomorphic/ariaSnapshot.js +176 -52
  78. package/lib/utils/isomorphic/cssParser.js +4 -4
  79. package/lib/utils/isomorphic/locatorGenerators.js +2 -2
  80. package/lib/utils/isomorphic/locatorParser.js +18 -12
  81. package/lib/utils/isomorphic/urlMatch.js +2 -4
  82. package/lib/utils/processLauncher.js +1 -1
  83. package/lib/utils/wsServer.js +1 -0
  84. package/lib/utils/zones.js +18 -20
  85. package/lib/utilsBundleImpl/index.js +95 -95
  86. package/lib/vite/htmlReport/index.html +14 -14
  87. package/lib/vite/recorder/assets/{codeMirrorModule-AFvV6hAs.js → codeMirrorModule-3Qn3tPnZ.js} +1 -1
  88. package/lib/vite/recorder/assets/{index-_cTWgVuJ.js → index-Bek6JFv8.js} +78 -78
  89. package/lib/vite/recorder/assets/{index-iA1aAGZg.css → index-CAQewHss.css} +1 -1
  90. package/lib/vite/recorder/index.html +2 -2
  91. package/lib/vite/traceViewer/assets/{codeMirrorModule-BWCrdKft.js → codeMirrorModule-aLkSUGpW.js} +1 -1
  92. package/lib/vite/traceViewer/assets/defaultSettingsView-CxUo6zd3.js +243 -0
  93. package/lib/vite/traceViewer/defaultSettingsView.DtIkrKWn.css +1 -0
  94. package/lib/vite/traceViewer/index.Bhu5cv5R.js +2 -0
  95. package/lib/vite/traceViewer/index.html +3 -6
  96. package/lib/vite/traceViewer/sw.bundle.js +3 -3
  97. package/lib/vite/traceViewer/uiMode.BBy7FOVd.js +5 -0
  98. package/lib/vite/traceViewer/{uiMode.voC1ZiOQ.css → uiMode.Be_ME-Go.css} +1 -1
  99. package/lib/vite/traceViewer/uiMode.html +4 -7
  100. package/package.json +1 -1
  101. package/types/protocol.d.ts +269 -20
  102. package/types/types.d.ts +59 -29
  103. package/bin/PrintDeps.exe +0 -0
  104. package/bin/README.md +0 -2
  105. package/lib/server/ariaSnapshot.js +0 -33
  106. package/lib/server/recorder/recorderInTraceViewer.js +0 -144
  107. package/lib/utils/isomorphic/recorderUtils.js +0 -227
  108. package/lib/vite/traceViewer/assets/inspectorTab-C_9qyxv5.js +0 -68
  109. package/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
  110. package/lib/vite/traceViewer/assets/workbench-DsQEOQud.js +0 -9
  111. package/lib/vite/traceViewer/embedded.D4x_-tXl.js +0 -2
  112. package/lib/vite/traceViewer/embedded.html +0 -18
  113. package/lib/vite/traceViewer/embedded.w7WN2u1R.css +0 -1
  114. package/lib/vite/traceViewer/index.BskMikzx.js +0 -2
  115. package/lib/vite/traceViewer/inspectorTab.DEOUW62d.css +0 -1
  116. package/lib/vite/traceViewer/recorder.B_SY1GJM.css +0 -0
  117. package/lib/vite/traceViewer/recorder.Dsk1wX5k.js +0 -2
  118. package/lib/vite/traceViewer/recorder.html +0 -17
  119. package/lib/vite/traceViewer/uiMode.CzKr-TMc.js +0 -5
  120. package/lib/vite/traceViewer/workbench.C-zR9ysA.css +0 -1
@@ -1,3 +1,3 @@
1
- var Ns=Object.defineProperty;var Ls=(n,t,e)=>t in n?Ns(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var L=(n,t,e)=>Ls(n,typeof t!="symbol"?t+"":t,e);function Us(n,t){const e=new Array(t.length).fill(0);return new Array(t.length).fill(0).map((s,r)=>(i,a)=>{e[r]=i/a*t[r]*1e3,n(e.reduce((l,u)=>l+u,0),1e3)})}const Tn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function vs(n){return n.replace(/[&<>"']/ug,t=>Tn[t])}function Fs(n){return n.replace(/[&<]/ug,t=>Tn[t])}function Ot(n,t,e){return n.find((s,r)=>{if(r===n.length-1)return!0;const i=n[r+1];return Math.abs(t(s)-e)<Math.abs(t(i)-e)})}function Sn(n){return Array.isArray(n)&&typeof n[0]=="string"}function Ms(n){return Array.isArray(n)&&Array.isArray(n[0])}class Hs{constructor(t,e,s,r,i){L(this,"_htmlCache");L(this,"_snapshots");L(this,"_index");L(this,"snapshotName");L(this,"_resources");L(this,"_snapshot");L(this,"_callId");L(this,"_screencastFrames");this._htmlCache=t,this._resources=e,this._snapshots=s,this._index=i,this._snapshot=s[i],this._callId=s[i].callId,this._screencastFrames=r,this.snapshotName=s[i].snapshotName}snapshot(){return this._snapshots[this._index]}viewport(){return this._snapshots[this._index].viewport}closestScreenshot(){var r;const{wallTime:t,timestamp:e}=this.snapshot(),s=t&&((r=this._screencastFrames[0])!=null&&r.frameSwapWallTime)?Ot(this._screencastFrames,i=>i.frameSwapWallTime,t):Ot(this._screencastFrames,i=>i.timestamp,e);return s==null?void 0:s.sha1}render(){const t=[],e=(i,a,l,u)=>{if(typeof i=="string"){l==="STYLE"||l==="style"?t.push(Gs(i)):t.push(Fs(i));return}if(Ms(i)){const d=a-i[0][0];if(d>=0&&d<=a){const h=Bs(this._snapshots[d]),p=i[0][1];if(p>=0&&p<h.length)return e(h[p],d,l,u)}}else if(Sn(i)){const[d,h,...p]=i,b=d==="NOSCRIPT"?"X-NOSCRIPT":d,y=Object.entries(h||{});t.push("<",b);const x="__playwright_current_src__",c=b==="IFRAME"||b==="FRAME",o=b==="A",f=b==="IMG",_=f&&y.some(m=>m[0]===x),g=b==="SOURCE"&&l==="PICTURE"&&(u==null?void 0:u.some(m=>m[0]===x));for(const[m,E]of y){let w=m;c&&m.toLowerCase()==="src"&&(w="__playwright_src__"),f&&m===x&&(w="src"),["src","srcset"].includes(m.toLowerCase())&&(_||g)&&(w="_"+w);let T=E;o&&m.toLowerCase()==="href"?T="link://"+E:(m.toLowerCase()==="href"||m.toLowerCase()==="src"||m===x)&&(T=Qe(E)),t.push(" ",w,'="',vs(T),'"')}t.push(">");for(const m of p)e(m,a,b,y);Ws.has(b)||t.push("</",b,">");return}else return},s=this._snapshot;return{html:this._htmlCache.getOrCompute(this,()=>{e(s.html,this._index,void 0,void 0);const a=(s.doctype?`<!DOCTYPE ${s.doctype}>`:"")+["<style>*,*::before,*::after { visibility: hidden }</style>",`<script>${js(this._callId,this.snapshotName)}<\/script>`].join("")+t.join("");return{value:a,size:a.length}}),pageId:s.pageId,frameId:s.frameId,index:this._index}}resourceByUrl(t,e){const s=this._snapshot;let r,i;for(const l of this._resources){if(typeof l._monotonicTime=="number"&&l._monotonicTime>=s.timestamp)break;l.response.status!==304&&l.request.url===t&&l.request.method===e&&(l._frameref===s.frameId?r=l:i=l)}let a=r??i;if(a&&e.toUpperCase()==="GET"){for(const l of s.resourceOverrides)if(t===l.url&&l.sha1){a={...a,response:{...a.response,content:{...a.response.content,_sha1:l.sha1}}};break}}return a}}const Ws=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]);function Bs(n){if(!n._nodes){const t=[],e=s=>{if(typeof s=="string")t.push(s);else if(Sn(s)){const[,,...r]=s;for(const i of r)e(i);t.push(s)}};e(n.html),n._nodes=t}return n._nodes}function js(...n){function t(e,...s){const r=new URLSearchParams(location.search).has("isUnderTest"),i="Recorded click position in absolute coordinates did not match the center of the clicked element. This is likely due to a difference between the test runner and the trace viewer operating systems.",a=[],l=[],u=[],d=[],h=y=>{for(const x of y.querySelectorAll("[__playwright_scroll_top_]"))a.push(x);for(const x of y.querySelectorAll("[__playwright_scroll_left_]"))l.push(x);for(const x of y.querySelectorAll("[__playwright_value_]")){const c=x;c.type!=="file"&&(c.value=c.getAttribute("__playwright_value_")),x.removeAttribute("__playwright_value_")}for(const x of y.querySelectorAll("[__playwright_checked_]"))x.checked=x.getAttribute("__playwright_checked_")==="true",x.removeAttribute("__playwright_checked_");for(const x of y.querySelectorAll("[__playwright_selected_]"))x.selected=x.getAttribute("__playwright_selected_")==="true",x.removeAttribute("__playwright_selected_");for(const x of s)for(const c of y.querySelectorAll(`[__playwright_target__="${x}"]`)){const o=c.style;o.outline="2px solid #006ab1",o.backgroundColor="#6fa8dc7f",u.push(c)}for(const x of y.querySelectorAll("iframe, frame")){const c=x.getAttribute("__playwright_src__");if(!c)x.setAttribute("src",'data:text/html,<body style="background: #ddd"></body>');else{const o=new URL(e(window.location.href)),f=o.pathname.lastIndexOf("/snapshot/");f!==-1&&(o.pathname=o.pathname.substring(0,f+1)),o.pathname+=c.substring(1),x.setAttribute("src",o.toString())}}{const x=y.querySelector("body[__playwright_custom_elements__]");if(x&&window.customElements){const c=(x.getAttribute("__playwright_custom_elements__")||"").split(",");for(const o of c)window.customElements.define(o,class extends HTMLElement{})}}for(const x of y.querySelectorAll("template[__playwright_shadow_root_]")){const c=x,o=c.parentElement.attachShadow({mode:"open"});o.appendChild(c.content),c.remove(),h(o)}if("adoptedStyleSheets"in y){const x=[...y.adoptedStyleSheets];for(const c of y.querySelectorAll("template[__playwright_style_sheet_]")){const o=c,f=new CSSStyleSheet;f.replaceSync(o.getAttribute("__playwright_style_sheet_")),x.push(f)}y.adoptedStyleSheets=x}d.push(...y.querySelectorAll("canvas"))},p=()=>{window.removeEventListener("load",p);for(const c of a)c.scrollTop=+c.getAttribute("__playwright_scroll_top_"),c.removeAttribute("__playwright_scroll_top_");for(const c of l)c.scrollLeft=+c.getAttribute("__playwright_scroll_left_"),c.removeAttribute("__playwright_scroll_left_");document.styleSheets[0].disabled=!0;const y=new URL(window.location.href).searchParams,x=window.location.pathname.match(/\/page@[a-z0-9]+$/);if(y.get("pointX")&&y.get("pointY")){const c=+y.get("pointX"),o=+y.get("pointY"),f=y.has("hasInputTarget"),_=u.length>0,g=document.documentElement?[document.documentElement]:[];for(const m of _?u:g){const E=document.createElement("x-pw-pointer");if(E.style.position="fixed",E.style.backgroundColor="#f44336",E.style.width="20px",E.style.height="20px",E.style.borderRadius="10px",E.style.margin="-10px 0 0 -10px",E.style.zIndex="2147483646",E.style.display="flex",E.style.alignItems="center",E.style.justifyContent="center",_){const w=m.getBoundingClientRect(),T=w.left+w.width/2,R=w.top+w.height/2;if(E.style.left=T+"px",E.style.top=R+"px",x&&(Math.abs(T-c)>=10||Math.abs(R-o)>=10)){const A=document.createElement("x-pw-pointer-warning");A.textContent="⚠",A.style.fontSize="19px",A.style.color="white",A.style.marginTop="-3.5px",A.style.userSelect="none",E.appendChild(A),E.setAttribute("title",i)}document.documentElement.appendChild(E)}else x&&!f&&(E.style.left=c+"px",E.style.top=o+"px",document.documentElement.appendChild(E))}}if(d.length>0){let c=function(f,_){function g(){const m=document.createElement("canvas");m.width=m.width/Math.floor(m.width/24),m.height=m.height/Math.floor(m.height/24);const E=m.getContext("2d");return E.fillStyle="lightgray",E.fillRect(0,0,m.width,m.height),E.fillStyle="white",E.fillRect(0,0,m.width/2,m.height/2),E.fillRect(m.width/2,m.height/2,m.width,m.height),E.createPattern(m,"repeat")}f.fillStyle=g(),f.fillRect(0,0,_.width,_.height)};if(!x){for(const f of d){const _=f.getContext("2d");c(_,f),f.title="Playwright displays canvas contents on a best-effort basis. It doesn't support canvas elements inside an iframe yet. If this impacts your workflow, please open an issue so we can prioritize."}return}const o=new Image;o.onload=()=>{for(const f of d){const _=f.getContext("2d"),g=f.getAttribute("__playwright_bounding_rect__");if(f.removeAttribute("__playwright_bounding_rect__"),!g)continue;let m;try{m=JSON.parse(g)}catch{continue}const E=m.right>1||m.bottom>1;if(m.left>1||m.top>1){f.title="Playwright couldn't capture canvas contents because it's located outside the viewport.";continue}c(_,f),_.drawImage(o,m.left*o.width,m.top*o.height,(m.right-m.left)*o.width,(m.bottom-m.top)*o.height,0,0,f.width,f.height),r&&console.log("canvas drawn:",JSON.stringify([m.left,m.top,m.right-m.left,m.bottom-m.top].map(T=>Math.floor(T*100)))),E?f.title="Playwright couldn't capture full canvas contents because it's located partially outside the viewport.":f.title="Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution."}},o.onerror=()=>{for(const f of d){const _=f.getContext("2d");c(_,f),f.title="Playwright couldn't show canvas contents because the screenshot failed to load."}},o.src=location.href.replace("/snapshot","/closest-screenshot")}},b=()=>h(document);window.addEventListener("load",p),window.addEventListener("DOMContentLoaded",b)}return`
2
- (${t.toString()})(${ze.toString()}${n.map(e=>`, "${e}"`).join("")})`}const Rn=["about:","blob:","data:","file:","ftp:","http:","https:","mailto:","sftp:","ws:","wss:"],kt="http://playwright.bloburl/#";function Qe(n){n.startsWith(kt)&&(n=n.substring(kt.length));try{const t=new URL(n);if(t.protocol==="javascript:"||t.protocol==="vbscript:")return"javascript:void(0)";const e=t.protocol==="blob:",s=t.protocol==="file:";if(!e&&!s&&Rn.includes(t.protocol))return n;const r="pw-"+t.protocol.slice(0,t.protocol.length-1);return s||(t.protocol="https:"),t.hostname=t.hostname?`${r}--${t.hostname}`:r,s&&(t.protocol="https:"),t.toString()}catch{return n}}const qs=/url\(['"]?([\w-]+:)\/\//ig;function Gs(n){return n.replace(qs,(t,e)=>!(e==="blob:")&&!(e==="file:")&&Rn.includes(e)?t:t.replace(e+"//",`https://pw-${e.slice(0,-1)}--`))}function ze(n){const t=new URL(n);return t.pathname.endsWith("/snapshot.html")?t.searchParams.get("r"):n}class Ys{constructor(t,e){L(this,"_snapshotStorage");L(this,"_resourceLoader");L(this,"_snapshotIds",new Map);this._snapshotStorage=t,this._resourceLoader=e}serveSnapshot(t,e,s){const r=this._snapshot(t.substring(9),e);if(!r)return new Response(null,{status:404});const i=r.render();return this._snapshotIds.set(s,r),new Response(i.html,{status:200,headers:{"Content-Type":"text/html; charset=utf-8"}})}async serveClosestScreenshot(t,e){const s=this._snapshot(t.substring(19),e),r=s==null?void 0:s.closestScreenshot();return r?new Response(await this._resourceLoader(r)):new Response(null,{status:404})}serveSnapshotInfo(t,e){const s=this._snapshot(t.substring(13),e);return this._respondWithJson(s?{viewport:s.viewport(),url:s.snapshot().frameUrl,timestamp:s.snapshot().timestamp,wallTime:s.snapshot().wallTime}:{error:"No snapshot found"})}_snapshot(t,e){const s=e.get("name");return this._snapshotStorage.snapshotByName(t.slice(1),s)}_respondWithJson(t){return new Response(JSON.stringify(t),{status:200,headers:{"Cache-Control":"public, max-age=31536000","Content-Type":"application/json"}})}async serveResource(t,e,s){let r;const i=this._snapshotIds.get(s);for(const y of t)if(r=i==null?void 0:i.resourceByUrl(Vs(y),e),r)break;if(!r)return new Response(null,{status:404});const a=r.response.content._sha1,l=a?await this._resourceLoader(a)||new Blob([]):new Blob([]);let u=r.response.content.mimeType;/^text\/|^application\/(javascript|json)/.test(u)&&!u.includes("charset")&&(u=`${u}; charset=utf-8`);const h=new Headers;u!=="x-unknown"&&h.set("Content-Type",u);for(const{name:y,value:x}of r.response.headers)h.set(y,x);h.delete("Content-Encoding"),h.delete("Access-Control-Allow-Origin"),h.set("Access-Control-Allow-Origin","*"),h.delete("Content-Length"),h.set("Content-Length",String(l.size)),h.set("Cache-Control","public, max-age=31536000");const{status:p}=r.response,b=p===101||p===204||p===205||p===304;return new Response(b?null:l,{headers:h,status:r.response.status,statusText:r.response.statusText})}}function Vs(n){try{const t=new URL(n);return t.hash="",t.toString()}catch{return n}}function Zs(n){const t=new Map,{files:e,stacks:s}=n;for(const r of s){const[i,a]=r;t.set(`call@${i}`,a.map(l=>({file:e[l[0]],line:l[1],column:l[2],function:l[3]})))}return t}class Ks{constructor(t){L(this,"_maxSize");L(this,"_map");L(this,"_size");this._maxSize=t,this._map=new Map,this._size=0}getOrCompute(t,e){if(this._map.has(t)){const r=this._map.get(t);return this._map.delete(t),this._map.set(t,r),r.value}const s=e();for(;this._map.size&&this._size+s.size>this._maxSize;){const[r,i]=this._map.entries().next().value;this._size-=i.size,this._map.delete(r)}return this._map.set(t,s),this._size+=s.size,s.value}}class Xs{constructor(){L(this,"_resources",[]);L(this,"_frameSnapshots",new Map);L(this,"_cache",new Ks(1e8))}addResource(t){t.request.url=Qe(t.request.url),this._resources.push(t)}addFrameSnapshot(t,e){for(const i of t.resourceOverrides)i.url=Qe(i.url);let s=this._frameSnapshots.get(t.frameId);s||(s={raw:[],renderers:[]},this._frameSnapshots.set(t.frameId,s),t.isMainFrame&&this._frameSnapshots.set(t.pageId,s)),s.raw.push(t);const r=new Hs(this._cache,this._resources,s.raw,e,s.raw.length-1);return s.renderers.push(r),r}snapshotByName(t,e){const s=this._frameSnapshots.get(t);return s==null?void 0:s.renderers.find(r=>r.snapshotName===e)}snapshotsForTest(){return[...this._frameSnapshots.keys()]}finalize(){this._resources.sort((t,e)=>(t._monotonicTime||0)-(e._monotonicTime||0))}}class An extends Error{constructor(t){super(t),this.name="TraceVersionError"}}const It=7;class $s{constructor(t,e){L(this,"_contextEntry");L(this,"_snapshotStorage");L(this,"_actionMap",new Map);L(this,"_version");L(this,"_pageEntries",new Map);L(this,"_jsHandles",new Map);L(this,"_consoleObjects",new Map);this._contextEntry=t,this._snapshotStorage=e}appendTrace(t){for(const e of t.split(`
3
- `))this._appendEvent(e)}actions(){return[...this._actionMap.values()]}_pageEntry(t){let e=this._pageEntries.get(t);return e||(e={pageId:t,screencastFrames:[]},this._pageEntries.set(t,e),this._contextEntry.pages.push(e)),e}_appendEvent(t){if(!t)return;const e=this._modernize(JSON.parse(t));for(const s of e)this._innerAppendEvent(s)}_innerAppendEvent(t){const e=this._contextEntry;switch(t.type){case"context-options":{if(t.version>It)throw new An("The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.");this._version=t.version,e.origin=t.origin,e.browserName=t.browserName,e.channel=t.channel,e.title=t.title,e.platform=t.platform,e.wallTime=t.wallTime,e.startTime=t.monotonicTime,e.sdkLanguage=t.sdkLanguage,e.options=t.options,e.testIdAttributeName=t.testIdAttributeName;break}case"screencast-frame":{this._pageEntry(t.pageId).screencastFrames.push(t);break}case"before":{this._actionMap.set(t.callId,{...t,type:"action",endTime:0,log:[]});break}case"input":{const s=this._actionMap.get(t.callId);s.inputSnapshot=t.inputSnapshot,s.point=t.point;break}case"log":{const s=this._actionMap.get(t.callId);if(!s)return;s.log.push({time:t.time,message:t.message});break}case"after":{const s=this._actionMap.get(t.callId);s.afterSnapshot=t.afterSnapshot,s.endTime=t.endTime,s.result=t.result,s.error=t.error,s.attachments=t.attachments,t.point&&(s.point=t.point);break}case"action":{this._actionMap.set(t.callId,{...t,log:[]});break}case"event":{e.events.push(t);break}case"stdout":{e.stdio.push(t);break}case"stderr":{e.stdio.push(t);break}case"error":{e.errors.push(t);break}case"console":{e.events.push(t);break}case"resource-snapshot":this._snapshotStorage.addResource(t.snapshot),e.resources.push(t.snapshot);break;case"frame-snapshot":this._snapshotStorage.addFrameSnapshot(t.snapshot,this._pageEntry(t.snapshot.pageId).screencastFrames);break}"pageId"in t&&t.pageId&&this._pageEntry(t.pageId),(t.type==="action"||t.type==="before")&&(e.startTime=Math.min(e.startTime,t.startTime)),(t.type==="action"||t.type==="after")&&(e.endTime=Math.max(e.endTime,t.endTime)),t.type==="event"&&(e.startTime=Math.min(e.startTime,t.time),e.endTime=Math.max(e.endTime,t.time)),t.type==="screencast-frame"&&(e.startTime=Math.min(e.startTime,t.timestamp),e.endTime=Math.max(e.endTime,t.timestamp))}_processedContextCreatedEvent(){return this._version!==void 0}_modernize(t){let e=this._version||t.version;if(e===void 0)return[t];let s=[t];for(;e<It;++e)s=this[`_modernize_${e}_to_${e+1}`].call(this,s);return s}_modernize_0_to_1(t){for(const e of t)e.type==="action"&&typeof e.metadata.error=="string"&&(e.metadata.error={error:{name:"Error",message:e.metadata.error}});return t}_modernize_1_to_2(t){var e;for(const s of t)s.type!=="frame-snapshot"||!s.snapshot.isMainFrame||(s.snapshot.viewport=((e=this._contextEntry.options)==null?void 0:e.viewport)||{width:1280,height:720});return t}_modernize_2_to_3(t){for(const e of t){if(e.type!=="resource-snapshot"||e.snapshot.request)continue;const s=e.snapshot;e.snapshot={_frameref:s.frameId,request:{url:s.url,method:s.method,headers:s.requestHeaders,postData:s.requestSha1?{_sha1:s.requestSha1}:void 0},response:{status:s.status,headers:s.responseHeaders,content:{mimeType:s.contentType,_sha1:s.responseSha1}},_monotonicTime:s.timestamp}}return t}_modernize_3_to_4(t){const e=[];for(const s of t){const r=this._modernize_event_3_to_4(s);r&&e.push(r)}return e}_modernize_event_3_to_4(t){var s,r,i,a;if(t.type!=="action"&&t.type!=="event")return t;const e=t.metadata;return e.internal||e.method.startsWith("tracing")?null:t.type==="event"?e.method==="__create__"&&e.type==="ConsoleMessage"?{type:"object",class:e.type,guid:e.params.guid,initializer:e.params.initializer}:{type:"event",time:e.startTime,class:e.type,method:e.method,params:e.params,pageId:e.pageId}:{type:"action",callId:e.id,startTime:e.startTime,endTime:e.endTime,apiName:e.apiName||e.type+"."+e.method,class:e.type,method:e.method,params:e.params,wallTime:e.wallTime||Date.now(),log:e.log,beforeSnapshot:(s=e.snapshots.find(l=>l.title==="before"))==null?void 0:s.snapshotName,inputSnapshot:(r=e.snapshots.find(l=>l.title==="input"))==null?void 0:r.snapshotName,afterSnapshot:(i=e.snapshots.find(l=>l.title==="after"))==null?void 0:i.snapshotName,error:(a=e.error)==null?void 0:a.error,result:e.result,point:e.point,pageId:e.pageId}}_modernize_4_to_5(t){const e=[];for(const s of t){const r=this._modernize_event_4_to_5(s);r&&e.push(r)}return e}_modernize_event_4_to_5(t){var e,s;if(t.type==="event"&&t.method==="__create__"&&t.class==="JSHandle"&&this._jsHandles.set(t.params.guid,t.params.initializer),t.type==="object"){if(t.class!=="ConsoleMessage")return null;const r=(e=t.initializer.args)==null?void 0:e.map(i=>{if(i.guid){const a=this._jsHandles.get(i.guid);return{preview:(a==null?void 0:a.preview)||"",value:""}}return{preview:i.preview||"",value:i.value||""}});return this._consoleObjects.set(t.guid,{type:t.initializer.type,text:t.initializer.text,location:t.initializer.location,args:r}),null}if(t.type==="event"&&t.method==="console"){const r=this._consoleObjects.get(((s=t.params.message)==null?void 0:s.guid)||"");return r?{type:"console",time:t.time,pageId:t.pageId,messageType:r.type,text:r.text,args:r.args,location:r.location}:null}return t}_modernize_5_to_6(t){const e=[];for(const s of t)if(e.push(s),!(s.type!=="after"||!s.log.length))for(const r of s.log)e.push({type:"log",callId:s.callId,message:r,time:-1});return e}_modernize_6_to_7(t){const e=[];if(!this._processedContextCreatedEvent()&&t[0].type!=="context-options"){const s={type:"context-options",origin:"testRunner",version:7,browserName:"",options:{},platform:process.platform,wallTime:0,monotonicTime:0,sdkLanguage:"javascript"};e.push(s)}for(const s of t){if(s.type==="context-options"){e.push({...s,monotonicTime:0,origin:"library"});continue}!this._contextEntry.wallTime&&s.type==="before"&&(this._contextEntry.wallTime=s.wallTime),!this._contextEntry.startTime&&s.type==="before"&&(this._contextEntry.startTime=s.startTime),e.push(s)}return e}}class Js{constructor(){L(this,"contextEntries",[]);L(this,"_snapshotStorage");L(this,"_backend");L(this,"_resourceToContentType",new Map)}async load(t,e){var l,u;this._backend=t;const s=[];let r=!1;for(const d of await this._backend.entryNames()){const h=d.match(/(.+)\.trace/);h&&s.push(h[1]||""),d.includes("src@")&&(r=!0)}if(!s.length)throw new Error("Cannot find .trace file");this._snapshotStorage=new Xs;const i=s.length*3;let a=0;for(const d of s){const h=Qs();h.traceUrl=t.traceURL(),h.hasSource=r;const p=new $s(h,this._snapshotStorage),b=await this._backend.readText(d+".trace")||"";p.appendTrace(b),e(++a,i);const y=await this._backend.readText(d+".network")||"";if(p.appendTrace(y),e(++a,i),h.actions=p.actions().sort((c,o)=>c.startTime-o.startTime),!t.isLive()){for(const c of h.actions.slice().reverse())if(!c.endTime&&!c.error)for(const o of h.actions)o.parentId===c.callId&&c.endTime<o.endTime&&(c.endTime=o.endTime)}const x=await this._backend.readText(d+".stacks");if(x){const c=Zs(JSON.parse(x));for(const o of h.actions)o.stack=o.stack||c.get(o.callId)}e(++a,i);for(const c of h.resources)(l=c.request.postData)!=null&&l._sha1&&this._resourceToContentType.set(c.request.postData._sha1,Dt(c.request.postData.mimeType)),(u=c.response.content)!=null&&u._sha1&&this._resourceToContentType.set(c.response.content._sha1,Dt(c.response.content.mimeType));this.contextEntries.push(h)}this._snapshotStorage.finalize()}async hasEntry(t){return this._backend.hasEntry(t)}async resourceForSha1(t){const e=await this._backend.readBlob("resources/"+t),s=this._resourceToContentType.get(t);return!e||s===void 0||s==="x-unknown"?e:new Blob([e],{type:s})}storage(){return this._snapshotStorage}}function Dt(n){const t=n.match(/^(.*);\s*charset=.*$/);return t?t[1]:n}function Qs(){return{origin:"testRunner",traceUrl:"",startTime:Number.MAX_SAFE_INTEGER,wallTime:Number.MAX_SAFE_INTEGER,endTime:0,browserName:"",options:{deviceScaleFactor:1,isMobile:!1,viewport:{width:1280,height:800}},pages:[],resources:[],actions:[],events:[],errors:[],stdio:[],hasSource:!1}}const zs=15,U=0,z=1,er=2,V=-2,W=-3,Pt=-4,ee=-5,Z=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Cn=1440,tr=0,nr=4,sr=9,rr=5,ir=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ar=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],or=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],cr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],lr=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],fr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],te=15;function et(){const n=this;let t,e,s,r,i,a;function l(d,h,p,b,y,x,c,o,f,_,g){let m,E,w,T,R,A,S,C,I,O,N,P,k,M,v;O=0,R=p;do s[d[h+O]]++,O++,R--;while(R!==0);if(s[0]==p)return c[0]=-1,o[0]=0,U;for(C=o[0],A=1;A<=te&&s[A]===0;A++);for(S=A,C<A&&(C=A),R=te;R!==0&&s[R]===0;R--);for(w=R,C>R&&(C=R),o[0]=C,M=1<<A;A<R;A++,M<<=1)if((M-=s[A])<0)return W;if((M-=s[R])<0)return W;for(s[R]+=M,a[1]=A=0,O=1,k=2;--R!==0;)a[k]=A+=s[O],k++,O++;R=0,O=0;do(A=d[h+O])!==0&&(g[a[A]++]=R),O++;while(++R<p);for(p=a[w],a[0]=R=0,O=0,T=-1,P=-C,i[0]=0,N=0,v=0;S<=w;S++)for(m=s[S];m--!==0;){for(;S>P+C;){if(T++,P+=C,v=w-P,v=v>C?C:v,(E=1<<(A=S-P))>m+1&&(E-=m+1,k=S,A<v))for(;++A<v&&!((E<<=1)<=s[++k]);)E-=s[k];if(v=1<<A,_[0]+v>Cn)return W;i[T]=N=_[0],_[0]+=v,T!==0?(a[T]=R,r[0]=A,r[1]=C,A=R>>>P-C,r[2]=N-i[T-1]-A,f.set(r,(i[T-1]+A)*3)):c[0]=N}for(r[1]=S-P,O>=p?r[0]=192:g[O]<b?(r[0]=g[O]<256?0:96,r[2]=g[O++]):(r[0]=x[g[O]-b]+16+64,r[2]=y[g[O++]-b]),E=1<<S-P,A=R>>>P;A<v;A+=E)f.set(r,(N+A)*3);for(A=1<<S-1;R&A;A>>>=1)R^=A;for(R^=A,I=(1<<P)-1;(R&I)!=a[T];)T--,P-=C,I=(1<<P)-1}return M!==0&&w!=1?ee:U}function u(d){let h;for(t||(t=[],e=[],s=new Int32Array(te+1),r=[],i=new Int32Array(te),a=new Int32Array(te+1)),e.length<d&&(e=[]),h=0;h<d;h++)e[h]=0;for(h=0;h<te+1;h++)s[h]=0;for(h=0;h<3;h++)r[h]=0;i.set(s.subarray(0,te),0),a.set(s.subarray(0,te+1),0)}n.inflate_trees_bits=function(d,h,p,b,y){let x;return u(19),t[0]=0,x=l(d,0,19,19,null,null,p,h,b,t,e),x==W?y.msg="oversubscribed dynamic bit lengths tree":(x==ee||h[0]===0)&&(y.msg="incomplete dynamic bit lengths tree",x=W),x},n.inflate_trees_dynamic=function(d,h,p,b,y,x,c,o,f){let _;return u(288),t[0]=0,_=l(p,0,d,257,or,cr,x,b,o,t,e),_!=U||b[0]===0?(_==W?f.msg="oversubscribed literal/length tree":_!=Pt&&(f.msg="incomplete literal/length tree",_=W),_):(u(288),_=l(p,d,h,0,lr,fr,c,y,o,t,e),_!=U||y[0]===0&&d>257?(_==W?f.msg="oversubscribed distance tree":_==ee?(f.msg="incomplete distance tree",_=W):_!=Pt&&(f.msg="empty distance tree with lengths",_=W),_):U)}}et.inflate_trees_fixed=function(n,t,e,s){return n[0]=sr,t[0]=rr,e[0]=ir,s[0]=ar,U};const ke=0,Nt=1,Lt=2,Ut=3,vt=4,Ft=5,Mt=6,qe=7,Ht=8,Ie=9;function ur(){const n=this;let t,e=0,s,r=0,i=0,a=0,l=0,u=0,d=0,h=0,p,b=0,y,x=0;function c(o,f,_,g,m,E,w,T){let R,A,S,C,I,O,N,P,k,M,v,be,D,fe,F,H;N=T.next_in_index,P=T.avail_in,I=w.bitb,O=w.bitk,k=w.write,M=k<w.read?w.read-k-1:w.end-k,v=Z[o],be=Z[f];do{for(;O<20;)P--,I|=(T.read_byte(N++)&255)<<O,O+=8;if(R=I&v,A=_,S=g,H=(S+R)*3,(C=A[H])===0){I>>=A[H+1],O-=A[H+1],w.win[k++]=A[H+2],M--;continue}do{if(I>>=A[H+1],O-=A[H+1],C&16){for(C&=15,D=A[H+2]+(I&Z[C]),I>>=C,O-=C;O<15;)P--,I|=(T.read_byte(N++)&255)<<O,O+=8;R=I&be,A=m,S=E,H=(S+R)*3,C=A[H];do if(I>>=A[H+1],O-=A[H+1],C&16){for(C&=15;O<C;)P--,I|=(T.read_byte(N++)&255)<<O,O+=8;if(fe=A[H+2]+(I&Z[C]),I>>=C,O-=C,M-=D,k>=fe)F=k-fe,k-F>0&&2>k-F?(w.win[k++]=w.win[F++],w.win[k++]=w.win[F++],D-=2):(w.win.set(w.win.subarray(F,F+2),k),k+=2,F+=2,D-=2);else{F=k-fe;do F+=w.end;while(F<0);if(C=w.end-F,D>C){if(D-=C,k-F>0&&C>k-F)do w.win[k++]=w.win[F++];while(--C!==0);else w.win.set(w.win.subarray(F,F+C),k),k+=C,F+=C,C=0;F=0}}if(k-F>0&&D>k-F)do w.win[k++]=w.win[F++];while(--D!==0);else w.win.set(w.win.subarray(F,F+D),k),k+=D,F+=D,D=0;break}else if(!(C&64))R+=A[H+2],R+=I&Z[C],H=(S+R)*3,C=A[H];else return T.msg="invalid distance code",D=T.avail_in-P,D=O>>3<D?O>>3:D,P+=D,N-=D,O-=D<<3,w.bitb=I,w.bitk=O,T.avail_in=P,T.total_in+=N-T.next_in_index,T.next_in_index=N,w.write=k,W;while(!0);break}if(C&64)return C&32?(D=T.avail_in-P,D=O>>3<D?O>>3:D,P+=D,N-=D,O-=D<<3,w.bitb=I,w.bitk=O,T.avail_in=P,T.total_in+=N-T.next_in_index,T.next_in_index=N,w.write=k,z):(T.msg="invalid literal/length code",D=T.avail_in-P,D=O>>3<D?O>>3:D,P+=D,N-=D,O-=D<<3,w.bitb=I,w.bitk=O,T.avail_in=P,T.total_in+=N-T.next_in_index,T.next_in_index=N,w.write=k,W);if(R+=A[H+2],R+=I&Z[C],H=(S+R)*3,(C=A[H])===0){I>>=A[H+1],O-=A[H+1],w.win[k++]=A[H+2],M--;break}}while(!0)}while(M>=258&&P>=10);return D=T.avail_in-P,D=O>>3<D?O>>3:D,P+=D,N-=D,O-=D<<3,w.bitb=I,w.bitk=O,T.avail_in=P,T.total_in+=N-T.next_in_index,T.next_in_index=N,w.write=k,U}n.init=function(o,f,_,g,m,E){t=ke,d=o,h=f,p=_,b=g,y=m,x=E,s=null},n.proc=function(o,f,_){let g,m,E,w=0,T=0,R=0,A,S,C,I;for(R=f.next_in_index,A=f.avail_in,w=o.bitb,T=o.bitk,S=o.write,C=S<o.read?o.read-S-1:o.end-S;;)switch(t){case ke:if(C>=258&&A>=10&&(o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,_=c(d,h,p,b,y,x,o,f),R=f.next_in_index,A=f.avail_in,w=o.bitb,T=o.bitk,S=o.write,C=S<o.read?o.read-S-1:o.end-S,_!=U)){t=_==z?qe:Ie;break}i=d,s=p,r=b,t=Nt;case Nt:for(g=i;T<g;){if(A!==0)_=U;else return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);A--,w|=(f.read_byte(R++)&255)<<T,T+=8}if(m=(r+(w&Z[g]))*3,w>>>=s[m+1],T-=s[m+1],E=s[m],E===0){a=s[m+2],t=Mt;break}if(E&16){l=E&15,e=s[m+2],t=Lt;break}if(!(E&64)){i=E,r=m/3+s[m+2];break}if(E&32){t=qe;break}return t=Ie,f.msg="invalid literal/length code",_=W,o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);case Lt:for(g=l;T<g;){if(A!==0)_=U;else return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);A--,w|=(f.read_byte(R++)&255)<<T,T+=8}e+=w&Z[g],w>>=g,T-=g,i=h,s=y,r=x,t=Ut;case Ut:for(g=i;T<g;){if(A!==0)_=U;else return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);A--,w|=(f.read_byte(R++)&255)<<T,T+=8}if(m=(r+(w&Z[g]))*3,w>>=s[m+1],T-=s[m+1],E=s[m],E&16){l=E&15,u=s[m+2],t=vt;break}if(!(E&64)){i=E,r=m/3+s[m+2];break}return t=Ie,f.msg="invalid distance code",_=W,o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);case vt:for(g=l;T<g;){if(A!==0)_=U;else return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);A--,w|=(f.read_byte(R++)&255)<<T,T+=8}u+=w&Z[g],w>>=g,T-=g,t=Ft;case Ft:for(I=S-u;I<0;)I+=o.end;for(;e!==0;){if(C===0&&(S==o.end&&o.read!==0&&(S=0,C=S<o.read?o.read-S-1:o.end-S),C===0&&(o.write=S,_=o.inflate_flush(f,_),S=o.write,C=S<o.read?o.read-S-1:o.end-S,S==o.end&&o.read!==0&&(S=0,C=S<o.read?o.read-S-1:o.end-S),C===0)))return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);o.win[S++]=o.win[I++],C--,I==o.end&&(I=0),e--}t=ke;break;case Mt:if(C===0&&(S==o.end&&o.read!==0&&(S=0,C=S<o.read?o.read-S-1:o.end-S),C===0&&(o.write=S,_=o.inflate_flush(f,_),S=o.write,C=S<o.read?o.read-S-1:o.end-S,S==o.end&&o.read!==0&&(S=0,C=S<o.read?o.read-S-1:o.end-S),C===0)))return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);_=U,o.win[S++]=a,C--,t=ke;break;case qe:if(T>7&&(T-=8,A++,R--),o.write=S,_=o.inflate_flush(f,_),S=o.write,C=S<o.read?o.read-S-1:o.end-S,o.read!=o.write)return o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);t=Ht;case Ht:return _=z,o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);case Ie:return _=W,o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_);default:return _=V,o.bitb=w,o.bitk=T,f.avail_in=A,f.total_in+=R-f.next_in_index,f.next_in_index=R,o.write=S,o.inflate_flush(f,_)}},n.free=function(){}}const Wt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_e=0,Ge=1,Bt=2,jt=3,qt=4,Gt=5,De=6,Pe=7,Yt=8,ue=9;function dr(n,t){const e=this;let s=_e,r=0,i=0,a=0,l;const u=[0],d=[0],h=new ur;let p=0,b=new Int32Array(Cn*3);const y=0,x=new et;e.bitk=0,e.bitb=0,e.win=new Uint8Array(t),e.end=t,e.read=0,e.write=0,e.reset=function(c,o){o&&(o[0]=y),s==De&&h.free(c),s=_e,e.bitk=0,e.bitb=0,e.read=e.write=0},e.reset(n,null),e.inflate_flush=function(c,o){let f,_,g;return _=c.next_out_index,g=e.read,f=(g<=e.write?e.write:e.end)-g,f>c.avail_out&&(f=c.avail_out),f!==0&&o==ee&&(o=U),c.avail_out-=f,c.total_out+=f,c.next_out.set(e.win.subarray(g,g+f),_),_+=f,g+=f,g==e.end&&(g=0,e.write==e.end&&(e.write=0),f=e.write-g,f>c.avail_out&&(f=c.avail_out),f!==0&&o==ee&&(o=U),c.avail_out-=f,c.total_out+=f,c.next_out.set(e.win.subarray(g,g+f),_),_+=f,g+=f),c.next_out_index=_,e.read=g,o},e.proc=function(c,o){let f,_,g,m,E,w,T,R;for(m=c.next_in_index,E=c.avail_in,_=e.bitb,g=e.bitk,w=e.write,T=w<e.read?e.read-w-1:e.end-w;;){let A,S,C,I,O,N,P,k;switch(s){case _e:for(;g<3;){if(E!==0)o=U;else return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);E--,_|=(c.read_byte(m++)&255)<<g,g+=8}switch(f=_&7,p=f&1,f>>>1){case 0:_>>>=3,g-=3,f=g&7,_>>>=f,g-=f,s=Ge;break;case 1:A=[],S=[],C=[[]],I=[[]],et.inflate_trees_fixed(A,S,C,I),h.init(A[0],S[0],C[0],0,I[0],0),_>>>=3,g-=3,s=De;break;case 2:_>>>=3,g-=3,s=jt;break;case 3:return _>>>=3,g-=3,s=ue,c.msg="invalid block type",o=W,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o)}break;case Ge:for(;g<32;){if(E!==0)o=U;else return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);E--,_|=(c.read_byte(m++)&255)<<g,g+=8}if((~_>>>16&65535)!=(_&65535))return s=ue,c.msg="invalid stored block lengths",o=W,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);r=_&65535,_=g=0,s=r!==0?Bt:p!==0?Pe:_e;break;case Bt:if(E===0||T===0&&(w==e.end&&e.read!==0&&(w=0,T=w<e.read?e.read-w-1:e.end-w),T===0&&(e.write=w,o=e.inflate_flush(c,o),w=e.write,T=w<e.read?e.read-w-1:e.end-w,w==e.end&&e.read!==0&&(w=0,T=w<e.read?e.read-w-1:e.end-w),T===0)))return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);if(o=U,f=r,f>E&&(f=E),f>T&&(f=T),e.win.set(c.read_buf(m,f),w),m+=f,E-=f,w+=f,T-=f,(r-=f)!==0)break;s=p!==0?Pe:_e;break;case jt:for(;g<14;){if(E!==0)o=U;else return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);E--,_|=(c.read_byte(m++)&255)<<g,g+=8}if(i=f=_&16383,(f&31)>29||(f>>5&31)>29)return s=ue,c.msg="too many length or distance symbols",o=W,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);if(f=258+(f&31)+(f>>5&31),!l||l.length<f)l=[];else for(R=0;R<f;R++)l[R]=0;_>>>=14,g-=14,a=0,s=qt;case qt:for(;a<4+(i>>>10);){for(;g<3;){if(E!==0)o=U;else return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);E--,_|=(c.read_byte(m++)&255)<<g,g+=8}l[Wt[a++]]=_&7,_>>>=3,g-=3}for(;a<19;)l[Wt[a++]]=0;if(u[0]=7,f=x.inflate_trees_bits(l,u,d,b,c),f!=U)return o=f,o==W&&(l=null,s=ue),e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);a=0,s=Gt;case Gt:for(;f=i,!(a>=258+(f&31)+(f>>5&31));){let M,v;for(f=u[0];g<f;){if(E!==0)o=U;else return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);E--,_|=(c.read_byte(m++)&255)<<g,g+=8}if(f=b[(d[0]+(_&Z[f]))*3+1],v=b[(d[0]+(_&Z[f]))*3+2],v<16)_>>>=f,g-=f,l[a++]=v;else{for(R=v==18?7:v-14,M=v==18?11:3;g<f+R;){if(E!==0)o=U;else return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);E--,_|=(c.read_byte(m++)&255)<<g,g+=8}if(_>>>=f,g-=f,M+=_&Z[R],_>>>=R,g-=R,R=a,f=i,R+M>258+(f&31)+(f>>5&31)||v==16&&R<1)return l=null,s=ue,c.msg="invalid bit length repeat",o=W,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);v=v==16?l[R-1]:0;do l[R++]=v;while(--M!==0);a=R}}if(d[0]=-1,O=[],N=[],P=[],k=[],O[0]=9,N[0]=6,f=i,f=x.inflate_trees_dynamic(257+(f&31),1+(f>>5&31),l,O,N,P,k,b,c),f!=U)return f==W&&(l=null,s=ue),o=f,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);h.init(O[0],N[0],b,P[0],b,k[0]),s=De;case De:if(e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,(o=h.proc(e,c,o))!=z)return e.inflate_flush(c,o);if(o=U,h.free(c),m=c.next_in_index,E=c.avail_in,_=e.bitb,g=e.bitk,w=e.write,T=w<e.read?e.read-w-1:e.end-w,p===0){s=_e;break}s=Pe;case Pe:if(e.write=w,o=e.inflate_flush(c,o),w=e.write,T=w<e.read?e.read-w-1:e.end-w,e.read!=e.write)return e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);s=Yt;case Yt:return o=z,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);case ue:return o=W,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o);default:return o=V,e.bitb=_,e.bitk=g,c.avail_in=E,c.total_in+=m-c.next_in_index,c.next_in_index=m,e.write=w,e.inflate_flush(c,o)}}},e.free=function(c){e.reset(c,null),e.win=null,b=null},e.set_dictionary=function(c,o,f){e.win.set(c.subarray(o,o+f),0),e.read=e.write=f},e.sync_point=function(){return s==Ge?1:0}}const hr=32,_r=8,pr=0,Vt=1,Zt=2,Kt=3,Xt=4,$t=5,Ye=6,ye=7,Jt=12,ne=13,mr=[0,0,255,255];function wr(){const n=this;n.mode=0,n.method=0,n.was=[0],n.need=0,n.marker=0,n.wbits=0;function t(e){return!e||!e.istate?V:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=ye,e.istate.blocks.reset(e,null),U)}n.inflateEnd=function(e){return n.blocks&&n.blocks.free(e),n.blocks=null,U},n.inflateInit=function(e,s){return e.msg=null,n.blocks=null,s<8||s>15?(n.inflateEnd(e),V):(n.wbits=s,e.istate.blocks=new dr(e,1<<s),t(e),U)},n.inflate=function(e,s){let r,i;if(!e||!e.istate||!e.next_in)return V;const a=e.istate;for(s=s==nr?ee:U,r=ee;;)switch(a.mode){case pr:if(e.avail_in===0)return r;if(r=s,e.avail_in--,e.total_in++,((a.method=e.read_byte(e.next_in_index++))&15)!=_r){a.mode=ne,e.msg="unknown compression method",a.marker=5;break}if((a.method>>4)+8>a.wbits){a.mode=ne,e.msg="invalid win size",a.marker=5;break}a.mode=Vt;case Vt:if(e.avail_in===0)return r;if(r=s,e.avail_in--,e.total_in++,i=e.read_byte(e.next_in_index++)&255,((a.method<<8)+i)%31!==0){a.mode=ne,e.msg="incorrect header check",a.marker=5;break}if(!(i&hr)){a.mode=ye;break}a.mode=Zt;case Zt:if(e.avail_in===0)return r;r=s,e.avail_in--,e.total_in++,a.need=(e.read_byte(e.next_in_index++)&255)<<24&4278190080,a.mode=Kt;case Kt:if(e.avail_in===0)return r;r=s,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<16&16711680,a.mode=Xt;case Xt:if(e.avail_in===0)return r;r=s,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<8&65280,a.mode=$t;case $t:return e.avail_in===0?r:(r=s,e.avail_in--,e.total_in++,a.need+=e.read_byte(e.next_in_index++)&255,a.mode=Ye,er);case Ye:return a.mode=ne,e.msg="need dictionary",a.marker=0,V;case ye:if(r=a.blocks.proc(e,r),r==W){a.mode=ne,a.marker=0;break}if(r==U&&(r=s),r!=z)return r;r=s,a.blocks.reset(e,a.was),a.mode=Jt;case Jt:return e.avail_in=0,z;case ne:return W;default:return V}},n.inflateSetDictionary=function(e,s,r){let i=0,a=r;if(!e||!e.istate||e.istate.mode!=Ye)return V;const l=e.istate;return a>=1<<l.wbits&&(a=(1<<l.wbits)-1,i=r-a),l.blocks.set_dictionary(s,i,a),l.mode=ye,U},n.inflateSync=function(e){let s,r,i,a,l;if(!e||!e.istate)return V;const u=e.istate;if(u.mode!=ne&&(u.mode=ne,u.marker=0),(s=e.avail_in)===0)return ee;for(r=e.next_in_index,i=u.marker;s!==0&&i<4;)e.read_byte(r)==mr[i]?i++:e.read_byte(r)!==0?i=0:i=4-i,r++,s--;return e.total_in+=r-e.next_in_index,e.next_in_index=r,e.avail_in=s,u.marker=i,i!=4?W:(a=e.total_in,l=e.total_out,t(e),e.total_in=a,e.total_out=l,u.mode=ye,U)},n.inflateSyncPoint=function(e){return!e||!e.istate||!e.istate.blocks?V:e.istate.blocks.sync_point()}}function On(){}On.prototype={inflateInit(n){const t=this;return t.istate=new wr,n||(n=zs),t.istate.inflateInit(t,n)},inflate(n){const t=this;return t.istate?t.istate.inflate(t,n):V},inflateEnd(){const n=this;if(!n.istate)return V;const t=n.istate.inflateEnd(n);return n.istate=null,t},inflateSync(){const n=this;return n.istate?n.istate.inflateSync(n):V},inflateSetDictionary(n,t){const e=this;return e.istate?e.istate.inflateSetDictionary(e,n,t):V},read_byte(n){return this.next_in[n]},read_buf(n,t){return this.next_in.subarray(n,n+t)}};function gr(n){const t=this,e=new On,s=n&&n.chunkSize?Math.floor(n.chunkSize*2):128*1024,r=tr,i=new Uint8Array(s);let a=!1;e.inflateInit(),e.next_out=i,t.append=function(l,u){const d=[];let h,p,b=0,y=0,x=0;if(l.length!==0){e.next_in_index=0,e.next_in=l,e.avail_in=l.length;do{if(e.next_out_index=0,e.avail_out=s,e.avail_in===0&&!a&&(e.next_in_index=0,a=!0),h=e.inflate(r),a&&h===ee){if(e.avail_in!==0)throw new Error("inflating: bad input")}else if(h!==U&&h!==z)throw new Error("inflating: "+e.msg);if((a||h===z)&&e.avail_in===l.length)throw new Error("inflating: bad input");e.next_out_index&&(e.next_out_index===s?d.push(new Uint8Array(i)):d.push(i.subarray(0,e.next_out_index))),x+=e.next_out_index,u&&e.next_in_index>0&&e.next_in_index!=b&&(u(e.next_in_index),b=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return d.length>1?(p=new Uint8Array(x),d.forEach(function(c){p.set(c,y),y+=c.length})):p=d[0]?new Uint8Array(d[0]):new Uint8Array,p}},t.flush=function(){e.inflateEnd()}}const de=4294967295,ae=65535,br=8,yr=0,xr=99,Er=67324752,Tr=134695760,Qt=33639248,Sr=101010256,zt=101075792,Rr=117853008,pe=22,Ve=20,Ze=56,Ar=1,Cr=39169,Or=10,kr=1,Ir=21589,Dr=28789,Pr=25461,Nr=6534,en=1,Lr=6,tn=8,nn=2048,sn=16,Ur="/",$=void 0,Ue="undefined",kn="function";class rn{constructor(t){return class extends TransformStream{constructor(e,s){const r=new t(s);super({transform(i,a){a.enqueue(r.append(i))},flush(i){const a=r.flush();a&&i.enqueue(a)}})}}}}const vr=64;let In=2;try{typeof navigator!=Ue&&navigator.hardwareConcurrency&&(In=navigator.hardwareConcurrency)}catch{}const Fr={chunkSize:512*1024,maxWorkers:In,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:$,CompressionStreamNative:typeof CompressionStream!=Ue&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Ue&&DecompressionStream},oe=Object.assign({},Fr);function Dn(){return oe}function Mr(n){return Math.max(n.chunkSize,vr)}function Pn(n){const{baseURL:t,chunkSize:e,maxWorkers:s,terminateWorkerTimeout:r,useCompressionStream:i,useWebWorkers:a,Deflate:l,Inflate:u,CompressionStream:d,DecompressionStream:h,workerScripts:p}=n;if(se("baseURL",t),se("chunkSize",e),se("maxWorkers",s),se("terminateWorkerTimeout",r),se("useCompressionStream",i),se("useWebWorkers",a),l&&(oe.CompressionStream=new rn(l)),u&&(oe.DecompressionStream=new rn(u)),se("CompressionStream",d),se("DecompressionStream",h),p!==$){const{deflate:b,inflate:y}=p;if((b||y)&&(oe.workerScripts||(oe.workerScripts={})),b){if(!Array.isArray(b))throw new Error("workerScripts.deflate must be an array");oe.workerScripts.deflate=b}if(y){if(!Array.isArray(y))throw new Error("workerScripts.inflate must be an array");oe.workerScripts.inflate=y}}}function se(n,t){t!==$&&(oe[n]=t)}function Hr(){return"application/octet-stream"}const Nn=[];for(let n=0;n<256;n++){let t=n;for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t=t>>>1;Nn[n]=t}class ve{constructor(t){this.crc=t||-1}append(t){let e=this.crc|0;for(let s=0,r=t.length|0;s<r;s++)e=e>>>8^Nn[(e^t[s])&255];this.crc=e}get(){return~this.crc}}class Ln extends TransformStream{constructor(){let t;const e=new ve;super({transform(s,r){e.append(s),r.enqueue(s)},flush(){const s=new Uint8Array(4);new DataView(s.buffer).setUint32(0,e.get()),t.value=s}}),t=this}}function Wr(n){if(typeof TextEncoder>"u"){n=unescape(encodeURIComponent(n));const t=new Uint8Array(n.length);for(let e=0;e<t.length;e++)t[e]=n.charCodeAt(e);return t}else return new TextEncoder().encode(n)}const Y={concat(n,t){if(n.length===0||t.length===0)return n.concat(t);const e=n[n.length-1],s=Y.getPartial(e);return s===32?n.concat(t):Y._shiftRight(t,s,e|0,n.slice(0,n.length-1))},bitLength(n){const t=n.length;if(t===0)return 0;const e=n[t-1];return(t-1)*32+Y.getPartial(e)},clamp(n,t){if(n.length*32<t)return n;n=n.slice(0,Math.ceil(t/32));const e=n.length;return t=t&31,e>0&&t&&(n[e-1]=Y.partial(t,n[e-1]&2147483648>>t-1,1)),n},partial(n,t,e){return n===32?t:(e?t|0:t<<32-n)+n*1099511627776},getPartial(n){return Math.round(n/1099511627776)||32},_shiftRight(n,t,e,s){for(s===void 0&&(s=[]);t>=32;t-=32)s.push(e),e=0;if(t===0)return s.concat(n);for(let a=0;a<n.length;a++)s.push(e|n[a]>>>t),e=n[a]<<32-t;const r=n.length?n[n.length-1]:0,i=Y.getPartial(r);return s.push(Y.partial(t+i&31,t+i>32?e:s.pop(),1)),s}},Fe={bytes:{fromBits(n){const e=Y.bitLength(n)/8,s=new Uint8Array(e);let r;for(let i=0;i<e;i++)i&3||(r=n[i/4]),s[i]=r>>>24,r<<=8;return s},toBits(n){const t=[];let e,s=0;for(e=0;e<n.length;e++)s=s<<8|n[e],(e&3)===3&&(t.push(s),s=0);return e&3&&t.push(Y.partial(8*(e&3),s)),t}}},Un={};Un.sha1=class{constructor(n){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],n?(t._h=n._h.slice(0),t._buffer=n._buffer.slice(0),t._length=n._length):t.reset()}reset(){const n=this;return n._h=n._init.slice(0),n._buffer=[],n._length=0,n}update(n){const t=this;typeof n=="string"&&(n=Fe.utf8String.toBits(n));const e=t._buffer=Y.concat(t._buffer,n),s=t._length,r=t._length=s+Y.bitLength(n);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const i=new Uint32Array(e);let a=0;for(let l=t.blockSize+s-(t.blockSize+s&t.blockSize-1);l<=r;l+=t.blockSize)t._block(i.subarray(16*a,16*(a+1))),a+=1;return e.splice(0,16*a),t}finalize(){const n=this;let t=n._buffer;const e=n._h;t=Y.concat(t,[Y.partial(1,1)]);for(let s=t.length+2;s&15;s++)t.push(0);for(t.push(Math.floor(n._length/4294967296)),t.push(n._length|0);t.length;)n._block(t.splice(0,16));return n.reset(),e}_f(n,t,e,s){if(n<=19)return t&e|~t&s;if(n<=39)return t^e^s;if(n<=59)return t&e|t&s|e&s;if(n<=79)return t^e^s}_S(n,t){return t<<n|t>>>32-n}_block(n){const t=this,e=t._h,s=Array(80);for(let d=0;d<16;d++)s[d]=n[d];let r=e[0],i=e[1],a=e[2],l=e[3],u=e[4];for(let d=0;d<=79;d++){d>=16&&(s[d]=t._S(1,s[d-3]^s[d-8]^s[d-14]^s[d-16]));const h=t._S(5,r)+t._f(d,i,a,l)+u+s[d]+t._key[Math.floor(d/20)]|0;u=l,l=a,a=t._S(30,i),i=r,r=h}e[0]=e[0]+r|0,e[1]=e[1]+i|0,e[2]=e[2]+a|0,e[3]=e[3]+l|0,e[4]=e[4]+u|0}};const vn={};vn.aes=class{constructor(n){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const e=t._tables[0][4],s=t._tables[1],r=n.length;let i,a,l,u=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[a=n.slice(0),l=[]],i=r;i<4*r+28;i++){let d=a[i-1];(i%r===0||r===8&&i%r===4)&&(d=e[d>>>24]<<24^e[d>>16&255]<<16^e[d>>8&255]<<8^e[d&255],i%r===0&&(d=d<<8^d>>>24^u<<24,u=u<<1^(u>>7)*283)),a[i]=a[i-r]^d}for(let d=0;i;d++,i--){const h=a[d&3?i:i-4];i<=4||d<4?l[d]=h:l[d]=s[0][e[h>>>24]]^s[1][e[h>>16&255]]^s[2][e[h>>8&255]]^s[3][e[h&255]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],t=this._tables[1],e=n[4],s=t[4],r=[],i=[];let a,l,u,d;for(let h=0;h<256;h++)i[(r[h]=h<<1^(h>>7)*283)^h]=h;for(let h=a=0;!e[h];h^=l||1,a=i[a]||1){let p=a^a<<1^a<<2^a<<3^a<<4;p=p>>8^p&255^99,e[h]=p,s[p]=h,d=r[u=r[l=r[h]]];let b=d*16843009^u*65537^l*257^h*16843008,y=r[p]*257^p*16843008;for(let x=0;x<4;x++)n[x][h]=y=y<<24^y>>>8,t[x][p]=b=b<<24^b>>>8}for(let h=0;h<5;h++)n[h]=n[h].slice(0),t[h]=t[h].slice(0)}_crypt(n,t){if(n.length!==4)throw new Error("invalid aes block size");const e=this._key[t],s=e.length/4-2,r=[0,0,0,0],i=this._tables[t],a=i[0],l=i[1],u=i[2],d=i[3],h=i[4];let p=n[0]^e[0],b=n[t?3:1]^e[1],y=n[2]^e[2],x=n[t?1:3]^e[3],c=4,o,f,_;for(let g=0;g<s;g++)o=a[p>>>24]^l[b>>16&255]^u[y>>8&255]^d[x&255]^e[c],f=a[b>>>24]^l[y>>16&255]^u[x>>8&255]^d[p&255]^e[c+1],_=a[y>>>24]^l[x>>16&255]^u[p>>8&255]^d[b&255]^e[c+2],x=a[x>>>24]^l[p>>16&255]^u[b>>8&255]^d[y&255]^e[c+3],c+=4,p=o,b=f,y=_;for(let g=0;g<4;g++)r[t?3&-g:g]=h[p>>>24]<<24^h[b>>16&255]<<16^h[y>>8&255]<<8^h[x&255]^e[c++],o=p,p=b,b=y,y=x,x=o;return r}};const Br={getRandomValues(n){const t=new Uint32Array(n.buffer),e=s=>{let r=987654321;const i=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&i,s=18e3*(s&65535)+(s>>16)&i,(((r<<16)+s&i)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let s=0,r;s<n.length;s+=4){const i=e((r||Math.random())*4294967296);r=i()*987654071,t[s/4]=i()*4294967296|0}return n}},Fn={};Fn.ctrGladman=class{constructor(n,t){this._prf=n,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)===255){let t=n>>16&255,e=n>>8&255,s=n&255;t===255?(t=0,e===255?(e=0,s===255?s=0:++s):++e):++t,n=0,n+=t<<16,n+=e<<8,n+=s}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,t,e){let s;if(!(s=t.length))return[];const r=Y.bitLength(t);for(let i=0;i<s;i+=4){this.incCounter(e);const a=n.encrypt(e);t[i]^=a[0],t[i+1]^=a[1],t[i+2]^=a[2],t[i+3]^=a[3]}return Y.clamp(t,r)}};const he={importKey(n){return new he.hmacSha1(Fe.bytes.toBits(n))},pbkdf2(n,t,e,s){if(e=e||1e4,s<0||e<0)throw new Error("invalid params to pbkdf2");const r=(s>>5)+1<<2;let i,a,l,u,d;const h=new ArrayBuffer(r),p=new DataView(h);let b=0;const y=Y;for(t=Fe.bytes.toBits(t),d=1;b<(r||1);d++){for(i=a=n.encrypt(y.concat(t,[d])),l=1;l<e;l++)for(a=n.encrypt(a),u=0;u<a.length;u++)i[u]^=a[u];for(l=0;b<(r||1)&&l<i.length;l++)p.setInt32(b,i[l]),b+=4}return h.slice(0,s/8)}};he.hmacSha1=class{constructor(n){const t=this,e=t._hash=Un.sha1,s=[[],[]];t._baseHash=[new e,new e];const r=t._baseHash[0].blockSize/32;n.length>r&&(n=new e().update(n).finalize());for(let i=0;i<r;i++)s[0][i]=n[i]^909522486,s[1][i]=n[i]^1549556828;t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new e(t._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){const t=this;t._updated=!0,t._resultHash.update(n)}digest(){const n=this,t=n._resultHash.finalize(),e=new n._hash(n._baseHash[1]).update(t).finalize();return n.reset(),e}encrypt(n){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(n),this.digest(n)}};const jr=typeof crypto<"u"&&typeof crypto.getRandomValues=="function",dt="Invalid password",ht="Invalid signature",_t="zipjs-abort-check-password";function Mn(n){return jr?crypto.getRandomValues(n):Br.getRandomValues(n)}const me=16,qr="raw",Hn={name:"PBKDF2"},Gr={name:"HMAC"},Yr="SHA-1",Vr=Object.assign({hash:Gr},Hn),tt=Object.assign({iterations:1e3,hash:{name:Yr}},Hn),Zr=["deriveBits"],Te=[8,12,16],xe=[16,24,32],re=10,Kr=[0,0,0,0],Wn="undefined",Bn="function",We=typeof crypto!=Wn,Ce=We&&crypto.subtle,jn=We&&typeof Ce!=Wn,J=Fe.bytes,Xr=vn.aes,$r=Fn.ctrGladman,Jr=he.hmacSha1;let an=We&&jn&&typeof Ce.importKey==Bn,on=We&&jn&&typeof Ce.deriveBits==Bn;class Qr extends TransformStream{constructor({password:t,signed:e,encryptionStrength:s,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(i=>this.resolveReady=i),password:t,signed:e,strength:s-1,pending:new Uint8Array})},async transform(i,a){const l=this,{password:u,strength:d,resolveReady:h,ready:p}=l;u?(await ei(l,d,u,X(i,0,Te[d]+2)),i=X(i,Te[d]+2),r?a.error(new Error(_t)):h()):await p;const b=new Uint8Array(i.length-re-(i.length-re)%me);a.enqueue(qn(l,i,b,0,re,!0))},async flush(i){const{signed:a,ctr:l,hmac:u,pending:d,ready:h}=this;if(u&&l){await h;const p=X(d,0,d.length-re),b=X(d,d.length-re);let y=new Uint8Array;if(p.length){const x=Re(J,p);u.update(x);const c=l.update(x);y=Se(J,c)}if(a){const x=X(Se(J,u.digest()),0,re);for(let c=0;c<re;c++)if(x[c]!=b[c])throw new Error(ht)}i.enqueue(y)}}})}}class zr extends TransformStream{constructor({password:t,encryptionStrength:e}){let s;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:t,strength:e-1,pending:new Uint8Array})},async transform(r,i){const a=this,{password:l,strength:u,resolveReady:d,ready:h}=a;let p=new Uint8Array;l?(p=await ti(a,u,l),d()):await h;const b=new Uint8Array(p.length+r.length-r.length%me);b.set(p,0),i.enqueue(qn(a,r,b,p.length,0))},async flush(r){const{ctr:i,hmac:a,pending:l,ready:u}=this;if(a&&i){await u;let d=new Uint8Array;if(l.length){const h=i.update(Re(J,l));a.update(h),d=Se(J,h)}s.signature=Se(J,a.digest()).slice(0,re),r.enqueue(pt(d,s.signature))}}}),s=this}}function qn(n,t,e,s,r,i){const{ctr:a,hmac:l,pending:u}=n,d=t.length-r;u.length&&(t=pt(u,t),e=ri(e,d-d%me));let h;for(h=0;h<=d-me;h+=me){const p=Re(J,X(t,h,h+me));i&&l.update(p);const b=a.update(p);i||l.update(b),e.set(Se(J,b),h+s)}return n.pending=X(t,h),e}async function ei(n,t,e,s){const r=await Gn(n,t,e,X(s,0,Te[t])),i=X(s,Te[t]);if(r[0]!=i[0]||r[1]!=i[1])throw new Error(dt)}async function ti(n,t,e){const s=Mn(new Uint8Array(Te[t])),r=await Gn(n,t,e,s);return pt(s,r)}async function Gn(n,t,e,s){n.password=null;const r=Wr(e),i=await ni(qr,r,Vr,!1,Zr),a=await si(Object.assign({salt:s},tt),i,8*(xe[t]*2+2)),l=new Uint8Array(a),u=Re(J,X(l,0,xe[t])),d=Re(J,X(l,xe[t],xe[t]*2)),h=X(l,xe[t]*2);return Object.assign(n,{keys:{key:u,authentication:d,passwordVerification:h},ctr:new $r(new Xr(u),Array.from(Kr)),hmac:new Jr(d)}),h}async function ni(n,t,e,s,r){if(an)try{return await Ce.importKey(n,t,e,s,r)}catch{return an=!1,he.importKey(t)}else return he.importKey(t)}async function si(n,t,e){if(on)try{return await Ce.deriveBits(n,t,e)}catch{return on=!1,he.pbkdf2(t,n.salt,tt.iterations,e)}else return he.pbkdf2(t,n.salt,tt.iterations,e)}function pt(n,t){let e=n;return n.length+t.length&&(e=new Uint8Array(n.length+t.length),e.set(n,0),e.set(t,n.length)),e}function ri(n,t){if(t&&t>n.length){const e=n;n=new Uint8Array(t),n.set(e,0)}return n}function X(n,t,e){return n.subarray(t,e)}function Se(n,t){return n.fromBits(t)}function Re(n,t){return n.toBits(t)}const we=12;class ii extends TransformStream{constructor({password:t,passwordVerification:e,checkPasswordOnly:s}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),Yn(this,t)},transform(r,i){const a=this;if(a.password){const l=cn(a,r.subarray(0,we));if(a.password=null,l[we-1]!=a.passwordVerification)throw new Error(dt);r=r.subarray(we)}s?i.error(new Error(_t)):i.enqueue(cn(a,r))}})}}class ai extends TransformStream{constructor({password:t,passwordVerification:e}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),Yn(this,t)},transform(s,r){const i=this;let a,l;if(i.password){i.password=null;const u=Mn(new Uint8Array(we));u[we-1]=i.passwordVerification,a=new Uint8Array(s.length+u.length),a.set(ln(i,u),0),l=we}else a=new Uint8Array(s.length),l=0;a.set(ln(i,s),l),r.enqueue(a)}})}}function cn(n,t){const e=new Uint8Array(t.length);for(let s=0;s<t.length;s++)e[s]=Vn(n)^t[s],mt(n,e[s]);return e}function ln(n,t){const e=new Uint8Array(t.length);for(let s=0;s<t.length;s++)e[s]=Vn(n)^t[s],mt(n,t[s]);return e}function Yn(n,t){const e=[305419896,591751049,878082192];Object.assign(n,{keys:e,crcKey0:new ve(e[0]),crcKey2:new ve(e[2])});for(let s=0;s<t.length;s++)mt(n,t.charCodeAt(s))}function mt(n,t){let[e,s,r]=n.keys;n.crcKey0.append([t]),e=~n.crcKey0.get(),s=fn(Math.imul(fn(s+Zn(e)),134775813)+1),n.crcKey2.append([s>>>24]),r=~n.crcKey2.get(),n.keys=[e,s,r]}function Vn(n){const t=n.keys[2]|2;return Zn(Math.imul(t,t^1)>>>8)}function Zn(n){return n&255}function fn(n){return n&4294967295}const un="deflate-raw";class oi extends TransformStream{constructor(t,{chunkSize:e,CompressionStream:s,CompressionStreamNative:r}){super({});const{compressed:i,encrypted:a,useCompressionStream:l,zipCrypto:u,signed:d,level:h}=t,p=this;let b,y,x=Kn(super.readable);(!a||u)&&d&&(b=new Ln,x=Q(x,b)),i&&(x=$n(x,l,{level:h,chunkSize:e},r,s)),a&&(u?x=Q(x,new ai(t)):(y=new zr(t),x=Q(x,y))),Xn(p,x,()=>{let c;a&&!u&&(c=y.signature),(!a||u)&&d&&(c=new DataView(b.value.buffer).getUint32(0)),p.signature=c})}}class ci extends TransformStream{constructor(t,{chunkSize:e,DecompressionStream:s,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:a,signed:l,signature:u,compressed:d,useCompressionStream:h}=t;let p,b,y=Kn(super.readable);a&&(i?y=Q(y,new ii(t)):(b=new Qr(t),y=Q(y,b))),d&&(y=$n(y,h,{chunkSize:e},r,s)),(!a||i)&&l&&(p=new Ln,y=Q(y,p)),Xn(this,y,()=>{if((!a||i)&&l){const x=new DataView(p.value.buffer);if(u!=x.getUint32(0,!1))throw new Error(ht)}})}}function Kn(n){return Q(n,new TransformStream({transform(t,e){t&&t.length&&e.enqueue(t)}}))}function Xn(n,t,e){t=Q(t,new TransformStream({flush:e})),Object.defineProperty(n,"readable",{get(){return t}})}function $n(n,t,e,s,r){try{const i=t&&s?s:r;n=Q(n,new i(un,e))}catch(i){if(t)n=Q(n,new r(un,e));else throw i}return n}function Q(n,t){return n.pipeThrough(t)}const li="message",fi="start",ui="pull",dn="data",di="ack",hi="close",_i="deflate",Jn="inflate";class pi extends TransformStream{constructor(t,e){super({});const s=this,{codecType:r}=t;let i;r.startsWith(_i)?i=oi:r.startsWith(Jn)&&(i=ci);let a=0;const l=new i(t,e),u=super.readable,d=new TransformStream({transform(h,p){h&&h.length&&(a+=h.length,p.enqueue(h))},flush(){const{signature:h}=l;Object.assign(s,{signature:h,size:a})}});Object.defineProperty(s,"readable",{get(){return u.pipeThrough(l).pipeThrough(d)}})}}const mi=typeof Worker!=Ue;class Ke{constructor(t,{readable:e,writable:s},{options:r,config:i,streamOptions:a,useWebWorkers:l,transferStreams:u,scripts:d},h){const{signal:p}=a;return Object.assign(t,{busy:!0,readable:e.pipeThrough(new wi(e,a,i),{signal:p}),writable:s,options:Object.assign({},r),scripts:d,transferStreams:u,terminate(){const{worker:b,busy:y}=t;b&&!y&&(b.terminate(),t.interface=null)},onTaskFinished(){t.busy=!1,h(t)}}),(l&&mi?bi:gi)(t,i)}}class wi extends TransformStream{constructor(t,{onstart:e,onprogress:s,size:r,onend:i},{chunkSize:a}){let l=0;super({start(){e&&Xe(e,r)},async transform(u,d){l+=u.length,s&&await Xe(s,l,r),d.enqueue(u)},flush(){t.size=l,i&&Xe(i,l)}},{highWaterMark:1,size:()=>a})}}async function Xe(n,...t){try{await n(...t)}catch{}}function gi(n,t){return{run:()=>yi(n,t)}}function bi(n,{baseURL:t,chunkSize:e}){return n.interface||Object.assign(n,{worker:Ti(n.scripts[0],t,n),interface:{run:()=>xi(n,{chunkSize:e})}}),n.interface}async function yi({options:n,readable:t,writable:e,onTaskFinished:s},r){const i=new pi(n,r);try{await t.pipeThrough(i).pipeTo(e,{preventClose:!0,preventAbort:!0});const{signature:a,size:l}=i;return{signature:a,size:l}}finally{s()}}async function xi(n,t){let e,s;const r=new Promise((b,y)=>{e=b,s=y});Object.assign(n,{reader:null,writer:null,resolveResult:e,rejectResult:s,result:r});const{readable:i,options:a,scripts:l}=n,{writable:u,closed:d}=Ei(n.writable);nt({type:fi,scripts:l.slice(1),options:a,config:t,readable:i,writable:u},n)||Object.assign(n,{reader:i.getReader(),writer:u.getWriter()});const p=await r;try{await u.getWriter().close()}catch{}return await d,p}function Ei(n){const t=n.getWriter();let e;const s=new Promise(i=>e=i);return{writable:new WritableStream({async write(i){await t.ready,await t.write(i)},close(){t.releaseLock(),e()},abort(i){return t.abort(i)}}),closed:s}}let hn=!0,_n=!0;function Ti(n,t,e){const s={type:"module"};let r,i;typeof n==kn&&(n=n());try{r=new URL(n,t)}catch{r=n}if(hn)try{i=new Worker(r)}catch{hn=!1,i=new Worker(r,s)}else i=new Worker(r,s);return i.addEventListener(li,a=>Si(a,e)),i}function nt(n,{worker:t,writer:e,onTaskFinished:s,transferStreams:r}){try{let{value:i,readable:a,writable:l}=n;const u=[];if(i&&(i.byteLength<i.buffer.byteLength?n.value=i.buffer.slice(0,i.byteLength):n.value=i.buffer,u.push(n.value)),r&&_n?(a&&u.push(a),l&&u.push(l)):n.readable=n.writable=null,u.length)try{return t.postMessage(n,u),!0}catch{_n=!1,n.readable=n.writable=null,t.postMessage(n)}else t.postMessage(n)}catch(i){throw e&&e.releaseLock(),s(),i}}async function Si({data:n},t){const{type:e,value:s,messageId:r,result:i,error:a}=n,{reader:l,writer:u,resolveResult:d,rejectResult:h,onTaskFinished:p}=t;try{if(a){const{message:y,stack:x,code:c,name:o}=a,f=new Error(y);Object.assign(f,{stack:x,code:c,name:o}),b(f)}else{if(e==ui){const{value:y,done:x}=await l.read();nt({type:dn,value:y,done:x,messageId:r},t)}e==dn&&(await u.ready,await u.write(new Uint8Array(s)),nt({type:di,messageId:r},t)),e==hi&&b(null,i)}}catch(y){b(y)}function b(y,x){y?h(y):d(x),u&&u.releaseLock(),p()}}let ie=[];const $e=[];let pn=0;async function Ri(n,t){const{options:e,config:s}=t,{transferStreams:r,useWebWorkers:i,useCompressionStream:a,codecType:l,compressed:u,signed:d,encrypted:h}=e,{workerScripts:p,maxWorkers:b,terminateWorkerTimeout:y}=s;t.transferStreams=r||r===$;const x=!u&&!d&&!h&&!t.transferStreams;t.useWebWorkers=!x&&(i||i===$&&s.useWebWorkers),t.scripts=t.useWebWorkers&&p?p[l]:[],e.useCompressionStream=a||a===$&&s.useCompressionStream;let c;const o=ie.find(_=>!_.busy);if(o)st(o),c=new Ke(o,n,t,f);else if(ie.length<b){const _={indexWorker:pn};pn++,ie.push(_),c=new Ke(_,n,t,f)}else c=await new Promise(_=>$e.push({resolve:_,stream:n,workerOptions:t}));return c.run();function f(_){if($e.length){const[{resolve:g,stream:m,workerOptions:E}]=$e.splice(0,1);g(new Ke(_,m,E,f))}else _.worker?(st(_),Number.isFinite(y)&&y>=0&&(_.terminateTimeout=setTimeout(()=>{ie=ie.filter(g=>g!=_),_.terminate()},y))):ie=ie.filter(g=>g!=_)}}function st(n){const{terminateTimeout:t}=n;t&&(clearTimeout(t),n.terminateTimeout=null)}function Ai(){ie.forEach(n=>{st(n),n.terminate()})}const Qn="HTTP error ",Oe="HTTP Range not supported",zn="Writer iterator completed too soon",Ci="text/plain",Oi="Content-Length",ki="Content-Range",Ii="Accept-Ranges",Di="Range",Pi="Content-Type",Ni="HEAD",wt="GET",es="bytes",Li=64*1024,gt="writable";class Be{constructor(){this.size=0}init(){this.initialized=!0}}class le extends Be{get readable(){const t=this,{chunkSize:e=Li}=t,s=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:i=0,size:a,diskNumberStart:l}=s,{chunkOffset:u}=this;r.enqueue(await G(t,i+u,Math.min(e,a-u),l)),u+e>a?r.close():this.chunkOffset+=e}});return s}}class bt extends Be{constructor(){super();const t=this,e=new WritableStream({write(s){return t.writeUint8Array(s)}});Object.defineProperty(t,gt,{get(){return e}})}writeUint8Array(){}}class Ui extends le{constructor(t){super();let e=t.length;for(;t.charAt(e-1)=="=";)e--;const s=t.indexOf(",")+1;Object.assign(this,{dataURI:t,dataStart:s,size:Math.floor((e-s)*.75)})}readUint8Array(t,e){const{dataStart:s,dataURI:r}=this,i=new Uint8Array(e),a=Math.floor(t/3)*4,l=atob(r.substring(a+s,Math.ceil((t+e)/3)*4+s)),u=t-Math.floor(a/4)*3;for(let d=u;d<u+e;d++)i[d-u]=l.charCodeAt(d);return i}}class vi extends bt{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let s=0,r=e.pending;const i=e.pending.length;for(e.pending="",s=0;s<Math.floor((i+t.length)/3)*3-i;s++)r+=String.fromCharCode(t[s]);for(;s<t.length;s++)e.pending+=String.fromCharCode(t[s]);r.length>2?e.data+=btoa(r):e.pending=r}getData(){return this.data+btoa(this.pending)}}class yt extends le{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,e){const s=this,r=t+e;let a=await(t||r<s.size?s.blob.slice(t,r):s.blob).arrayBuffer();return a.byteLength>e&&(a=a.slice(t,r)),new Uint8Array(a)}}class ts extends Be{constructor(t){super();const e=this,s=new TransformStream,r=[];t&&r.push([Pi,t]),Object.defineProperty(e,gt,{get(){return s.writable}}),e.blob=new Response(s.readable,{headers:r}).blob()}getData(){return this.blob}}class Fi extends yt{constructor(t){super(new Blob([t],{type:Ci}))}}class Mi extends ts{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){const{encoding:t,utf8:e}=this,s=await super.getData();if(s.text&&e)return s.text();{const r=new FileReader;return new Promise((i,a)=>{Object.assign(r,{onload:({target:l})=>i(l.result),onerror:()=>a(r.error)}),r.readAsText(s,t)})}}}class Hi extends le{constructor(t,e){super(),ns(this,t,e)}async init(){await ss(this,rt,mn),super.init()}readUint8Array(t,e){return rs(this,t,e,rt,mn)}}class Wi extends le{constructor(t,e){super(),ns(this,t,e)}async init(){await ss(this,it,wn),super.init()}readUint8Array(t,e){return rs(this,t,e,it,wn)}}function ns(n,t,e){const{preventHeadRequest:s,useRangeHeader:r,forceRangeRequests:i}=e;e=Object.assign({},e),delete e.preventHeadRequest,delete e.useRangeHeader,delete e.forceRangeRequests,delete e.useXHR,Object.assign(n,{url:t,options:e,preventHeadRequest:s,useRangeHeader:r,forceRangeRequests:i})}async function ss(n,t,e){const{url:s,useRangeHeader:r,forceRangeRequests:i}=n;if(Gi(s)&&(r||i)){const{headers:a}=await t(wt,n,is(n));if(!i&&a.get(Ii)!=es)throw new Error(Oe);{let l;const u=a.get(ki);if(u){const d=u.trim().split(/\s*\/\s*/);if(d.length){const h=d[1];h&&h!="*"&&(l=Number(h))}}l===$?await gn(n,t,e):n.size=l}}else await gn(n,t,e)}async function rs(n,t,e,s,r){const{useRangeHeader:i,forceRangeRequests:a,options:l}=n;if(i||a){const u=await s(wt,n,is(n,t,e));if(u.status!=206)throw new Error(Oe);return new Uint8Array(await u.arrayBuffer())}else{const{data:u}=n;return u||await r(n,l),new Uint8Array(n.data.subarray(t,t+e))}}function is(n,t=0,e=1){return Object.assign({},xt(n),{[Di]:es+"="+t+"-"+(t+e-1)})}function xt({options:n}){const{headers:t}=n;if(t)return Symbol.iterator in t?Object.fromEntries(t):t}async function mn(n){await as(n,rt)}async function wn(n){await as(n,it)}async function as(n,t){const e=await t(wt,n,xt(n));n.data=new Uint8Array(await e.arrayBuffer()),n.size||(n.size=n.data.length)}async function gn(n,t,e){if(n.preventHeadRequest)await e(n,n.options);else{const r=(await t(Ni,n,xt(n))).headers.get(Oi);r?n.size=Number(r):await e(n,n.options)}}async function rt(n,{options:t,url:e},s){const r=await fetch(e,Object.assign({},t,{method:n,headers:s}));if(r.status<400)return r;throw r.status==416?new Error(Oe):new Error(Qn+(r.statusText||r.status))}function it(n,{url:t},e){return new Promise((s,r)=>{const i=new XMLHttpRequest;if(i.addEventListener("load",()=>{if(i.status<400){const a=[];i.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(l=>{const u=l.trim().split(/\s*:\s*/);u[0]=u[0].trim().replace(/^[a-z]|-[a-z]/g,d=>d.toUpperCase()),a.push(u)}),s({status:i.status,arrayBuffer:()=>i.response,headers:new Map(a)})}else r(i.status==416?new Error(Oe):new Error(Qn+(i.statusText||i.status)))},!1),i.addEventListener("error",a=>r(a.detail?a.detail.error:new Error("Network error")),!1),i.open(n,t),e)for(const a of Object.entries(e))i.setRequestHeader(a[0],a[1]);i.responseType="arraybuffer",i.send()})}class os extends le{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR?new Wi(t,e):new Hi(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Bi extends os{constructor(t,e={}){e.useRangeHeader=!0,super(t,e)}}class ji extends le{constructor(t){super(),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class qi extends bt{init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t)}),super.init()}writeUint8Array(t){const e=this;if(e.offset+t.length>e.array.length){const s=e.array;e.array=new Uint8Array(s.length+t.length),e.array.set(s)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.array}}class Et extends le{constructor(t){super(),this.readers=t}async init(){const t=this,{readers:e}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(e.map(async(s,r)=>{await s.init(),r!=e.length-1&&(t.lastDiskOffset+=s.size),t.size+=s.size})),super.init()}async readUint8Array(t,e,s=0){const r=this,{readers:i}=this;let a,l=s;l==-1&&(l=i.length-1);let u=t;for(;u>=i[l].size;)u-=i[l].size,l++;const d=i[l],h=d.size;if(u+e<=h)a=await G(d,u,e);else{const p=h-u;a=new Uint8Array(e),a.set(await G(d,u,p)),a.set(await r.readUint8Array(t+p,e-p,s),p)}return r.lastDiskNumber=Math.max(l,r.lastDiskNumber),a}}class Me extends Be{constructor(t,e=4294967295){super();const s=this;Object.assign(s,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});let r,i,a;const l=new WritableStream({async write(h){const{availableSize:p}=s;if(a)h.length>=p?(await u(h.slice(0,p)),await d(),s.diskOffset+=r.size,s.diskNumber++,a=null,await this.write(h.slice(p))):await u(h);else{const{value:b,done:y}=await t.next();if(y&&!b)throw new Error(zn);r=b,r.size=0,r.maxSize&&(s.maxSize=r.maxSize),s.availableSize=s.maxSize,await Ae(r),i=b.writable,a=i.getWriter(),await this.write(h)}},async close(){await a.ready,await d()}});Object.defineProperty(s,gt,{get(){return l}});async function u(h){const p=h.length;p&&(await a.ready,await a.write(h),r.size+=p,s.size+=p,s.availableSize-=p)}async function d(){i.size=r.size,await a.close()}}}function Gi(n){const{baseURL:t}=Dn(),{protocol:e}=new URL(n,t);return e=="http:"||e=="https:"}async function Ae(n,t){n.init&&!n.initialized&&await n.init(t)}function cs(n){return Array.isArray(n)&&(n=new Et(n)),n instanceof ReadableStream&&(n={readable:n}),n}function ls(n){n.writable===$&&typeof n.next==kn&&(n=new Me(n)),n instanceof WritableStream&&(n={writable:n});const{writable:t}=n;return t.size===$&&(t.size=0),n instanceof Me||Object.assign(n,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),n}function G(n,t,e,s){return n.readUint8Array(t,e,s)}const Yi=Et,Vi=Me,fs="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Zi=fs.length==256;function Ki(n){if(Zi){let t="";for(let e=0;e<n.length;e++)t+=fs[n[e]];return t}else return new TextDecoder().decode(n)}function at(n,t){return t&&t.trim().toLowerCase()=="cp437"?Ki(n):new TextDecoder(t).decode(n)}const us="filename",ds="rawFilename",hs="comment",_s="rawComment",ps="uncompressedSize",ms="compressedSize",ws="offset",ot="diskNumberStart",ct="lastModDate",lt="rawLastModDate",gs="lastAccessDate",Xi="rawLastAccessDate",bs="creationDate",$i="rawCreationDate",Ji="internalFileAttribute",Qi="externalFileAttribute",zi="msDosCompatible",ea="zip64",ta=[us,ds,ms,ps,ct,lt,hs,_s,gs,bs,ws,ot,ot,Ji,Qi,zi,ea,"directory","bitFlag","encrypted","signature","filenameUTF8","commentUTF8","compressionMethod","version","versionMadeBy","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class bn{constructor(t){ta.forEach(e=>this[e]=t[e])}}const Ne="File format is not recognized",ys="End of central directory not found",xs="End of Zip64 central directory not found",Es="End of Zip64 central directory locator not found",Ts="Central directory header not found",Ss="Local file header not found",Rs="Zip64 extra field not found",As="File contains encrypted entry",Cs="Encryption method not supported",ft="Compression method not supported",ut="Split zip file",yn="utf-8",xn="cp437",na=[[ps,de],[ms,de],[ws,de],[ot,ae]],sa={[ae]:{getValue:B,bytes:4},[de]:{getValue:Le,bytes:8}};class ra{constructor(t,e={}){Object.assign(this,{reader:cs(t),options:e,config:Dn()})}async*getEntriesGenerator(t={}){const e=this;let{reader:s}=e;const{config:r}=e;if(await Ae(s),(s.size===$||!s.readUint8Array)&&(s=new yt(await new Response(s.readable).blob()),await Ae(s)),s.size<pe)throw new Error(Ne);s.chunkSize=Mr(r);const i=await fa(s,Sr,s.size,pe,ae*16);if(!i){const S=await G(s,0,4),C=q(S);throw B(C)==Tr?new Error(ut):new Error(ys)}const a=q(i);let l=B(a,12),u=B(a,16);const d=i.offset,h=j(a,20),p=d+pe+h;let b=j(a,4);const y=s.lastDiskNumber||0;let x=j(a,6),c=j(a,8),o=0,f=0;if(u==de||l==de||c==ae||x==ae){const S=await G(s,i.offset-Ve,Ve),C=q(S);if(B(C,0)!=Rr)throw new Error(xs);u=Le(C,8);let I=await G(s,u,Ze,-1),O=q(I);const N=i.offset-Ve-Ze;if(B(O,0)!=zt&&u!=N){const P=u;u=N,o=u-P,I=await G(s,u,Ze,-1),O=q(I)}if(B(O,0)!=zt)throw new Error(Es);b==ae&&(b=B(O,16)),x==ae&&(x=B(O,20)),c==ae&&(c=Le(O,32)),l==de&&(l=Le(O,40)),u-=l}if(u>=s.size&&(o=s.size-u-l-pe,u=s.size-l-pe),y!=b)throw new Error(ut);if(u<0)throw new Error(Ne);let _=0,g=await G(s,u,l,x),m=q(g);if(l){const S=i.offset-l;if(B(m,_)!=Qt&&u!=S){const C=u;u=S,o+=u-C,g=await G(s,u,l,x),m=q(g)}}const E=i.offset-u-(s.lastDiskOffset||0);if(l!=E&&E>=0&&(l=E,g=await G(s,u,l,x),m=q(g)),u<0||u>=s.size)throw new Error(Ne);const w=K(e,t,"filenameEncoding"),T=K(e,t,"commentEncoding");for(let S=0;S<c;S++){const C=new ia(s,r,e.options);if(B(m,_)!=Qt)throw new Error(Ts);Os(C,m,_+6);const I=!!C.bitFlag.languageEncodingFlag,O=_+46,N=O+C.filenameLength,P=N+C.extraFieldLength,k=j(m,_+4),M=(k&0)==0,v=g.subarray(O,N),be=j(m,_+32),D=P+be,fe=g.subarray(P,D),F=I,H=I,Tt=M&&(ge(m,_+38)&sn)==sn,St=B(m,_+42)+o;Object.assign(C,{versionMadeBy:k,msDosCompatible:M,compressedSize:0,uncompressedSize:0,commentLength:be,directory:Tt,offset:St,diskNumberStart:j(m,_+34),internalFileAttribute:j(m,_+36),externalFileAttribute:B(m,_+38),rawFilename:v,filenameUTF8:F,commentUTF8:H,rawExtraField:g.subarray(N,P)});const[Rt,Ds]=await Promise.all([at(v,F?yn:w||xn),at(fe,H?yn:T||xn)]);Object.assign(C,{rawComment:fe,filename:Rt,comment:Ds,directory:Tt||Rt.endsWith(Ur)}),f=Math.max(St,f),await ks(C,C,m,_+6);const je=new bn(C);je.getData=(Ct,Ps)=>C.getData(Ct,je,Ps),_=D;const{onprogress:At}=t;if(At)try{await At(S+1,c,new bn(C))}catch{}yield je}const R=K(e,t,"extractPrependedData"),A=K(e,t,"extractAppendedData");return R&&(e.prependedData=f>0?await G(s,0,f):new Uint8Array),e.comment=h?await G(s,d+pe,h):new Uint8Array,A&&(e.appendedData=p<s.size?await G(s,p,s.size-p):new Uint8Array),!0}async getEntries(t={}){const e=[];for await(const s of this.getEntriesGenerator(t))e.push(s);return e}async close(){}}class ia{constructor(t,e,s){Object.assign(this,{reader:t,config:e,options:s})}async getData(t,e,s={}){const r=this,{reader:i,offset:a,diskNumberStart:l,extraFieldAES:u,compressionMethod:d,config:h,bitFlag:p,signature:b,rawLastModDate:y,uncompressedSize:x,compressedSize:c}=r,o=e.localDirectory={},f=await G(i,a,30,l),_=q(f);let g=K(r,s,"password");if(g=g&&g.length&&g,u&&u.originalCompressionMethod!=xr)throw new Error(ft);if(d!=yr&&d!=br)throw new Error(ft);if(B(_,0)!=Er)throw new Error(Ss);Os(o,_,4),o.rawExtraField=o.extraFieldLength?await G(i,a+30+o.filenameLength,o.extraFieldLength,l):new Uint8Array,await ks(r,o,_,4,!0),Object.assign(e,{lastAccessDate:o.lastAccessDate,creationDate:o.creationDate});const m=r.encrypted&&o.encrypted,E=m&&!u;if(m){if(!E&&u.strength===$)throw new Error(Cs);if(!g)throw new Error(As)}const w=a+30+o.filenameLength+o.extraFieldLength,T=c,R=i.readable;Object.assign(R,{diskNumberStart:l,offset:w,size:T});const A=K(r,s,"signal"),S=K(r,s,"checkPasswordOnly");S&&(t=new WritableStream),t=ls(t),await Ae(t,x);const{writable:C}=t,{onstart:I,onprogress:O,onend:N}=s,P={options:{codecType:Jn,password:g,zipCrypto:E,encryptionStrength:u&&u.strength,signed:K(r,s,"checkSignature"),passwordVerification:E&&(p.dataDescriptor?y>>>8&255:b>>>24&255),signature:b,compressed:d!=0,encrypted:m,useWebWorkers:K(r,s,"useWebWorkers"),useCompressionStream:K(r,s,"useCompressionStream"),transferStreams:K(r,s,"transferStreams"),checkPasswordOnly:S},config:h,streamOptions:{signal:A,size:T,onstart:I,onprogress:O,onend:N}};let k=0;try{({outputSize:k}=await Ri({readable:R,writable:C},P))}catch(M){if(!S||M.message!=_t)throw M}finally{const M=K(r,s,"preventClose");C.size+=k,!M&&!C.locked&&await C.getWriter().close()}return S?void 0:t.getData?t.getData():C}}function Os(n,t,e){const s=n.rawBitFlag=j(t,e+2),r=(s&en)==en,i=B(t,e+6);Object.assign(n,{encrypted:r,version:j(t,e),bitFlag:{level:(s&Lr)>>1,dataDescriptor:(s&tn)==tn,languageEncodingFlag:(s&nn)==nn},rawLastModDate:i,lastModDate:ua(i),filenameLength:j(t,e+22),extraFieldLength:j(t,e+24)})}async function ks(n,t,e,s,r){const{rawExtraField:i}=t,a=t.extraField=new Map,l=q(new Uint8Array(i));let u=0;try{for(;u<i.length;){const f=j(l,u),_=j(l,u+2);a.set(f,{type:f,data:i.slice(u+4,u+4+_)}),u+=4+_}}catch{}const d=j(e,s+4);Object.assign(t,{signature:B(e,s+10),uncompressedSize:B(e,s+18),compressedSize:B(e,s+14)});const h=a.get(Ar);h&&(aa(h,t),t.extraFieldZip64=h);const p=a.get(Dr);p&&(await En(p,us,ds,t,n),t.extraFieldUnicodePath=p);const b=a.get(Pr);b&&(await En(b,hs,_s,t,n),t.extraFieldUnicodeComment=b);const y=a.get(Cr);y?(oa(y,t,d),t.extraFieldAES=y):t.compressionMethod=d;const x=a.get(Or);x&&(ca(x,t),t.extraFieldNTFS=x);const c=a.get(Ir);c&&(la(c,t,r),t.extraFieldExtendedTimestamp=c);const o=a.get(Nr);o&&(t.extraFieldUSDZ=o)}function aa(n,t){t.zip64=!0;const e=q(n.data),s=na.filter(([r,i])=>t[r]==i);for(let r=0,i=0;r<s.length;r++){const[a,l]=s[r];if(t[a]==l){const u=sa[l];t[a]=n[a]=u.getValue(e,i),i+=u.bytes}else if(n[a])throw new Error(Rs)}}async function En(n,t,e,s,r){const i=q(n.data),a=new ve;a.append(r[e]);const l=q(new Uint8Array(4));l.setUint32(0,a.get(),!0);const u=B(i,1);Object.assign(n,{version:ge(i,0),[t]:at(n.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&u==B(l,0)}),n.valid&&(s[t]=n[t],s[t+"UTF8"]=!0)}function oa(n,t,e){const s=q(n.data),r=ge(s,4);Object.assign(n,{vendorVersion:ge(s,0),vendorId:ge(s,2),strength:r,originalCompressionMethod:e,compressionMethod:j(s,5)}),t.compressionMethod=n.compressionMethod}function ca(n,t){const e=q(n.data);let s=4,r;try{for(;s<n.data.length&&!r;){const i=j(e,s),a=j(e,s+2);i==kr&&(r=n.data.slice(s+4,s+4+a)),s+=4+a}}catch{}try{if(r&&r.length==24){const i=q(r),a=i.getBigUint64(0,!0),l=i.getBigUint64(8,!0),u=i.getBigUint64(16,!0);Object.assign(n,{rawLastModDate:a,rawLastAccessDate:l,rawCreationDate:u});const d=Je(a),h=Je(l),p=Je(u),b={lastModDate:d,lastAccessDate:h,creationDate:p};Object.assign(n,b),Object.assign(t,b)}}catch{}}function la(n,t,e){const s=q(n.data),r=ge(s,0),i=[],a=[];e?((r&1)==1&&(i.push(ct),a.push(lt)),(r&2)==2&&(i.push(gs),a.push(Xi)),(r&4)==4&&(i.push(bs),a.push($i))):n.data.length>=5&&(i.push(ct),a.push(lt));let l=1;i.forEach((u,d)=>{if(n.data.length>=l+4){const h=B(s,l);t[u]=n[u]=new Date(h*1e3);const p=a[d];n[p]=h}l+=4})}async function fa(n,t,e,s,r){const i=new Uint8Array(4),a=q(i);da(a,0,t);const l=s+r;return await u(s)||await u(Math.min(l,e));async function u(d){const h=e-d,p=await G(n,h,d);for(let b=p.length-s;b>=0;b--)if(p[b]==i[0]&&p[b+1]==i[1]&&p[b+2]==i[2]&&p[b+3]==i[3])return{offset:h+b,buffer:p.slice(b,b+s).buffer}}}function K(n,t,e){return t[e]===$?n.options[e]:t[e]}function ua(n){const t=(n&4294901760)>>16,e=n&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(e&63488)>>11,(e&2016)>>5,(e&31)*2,0)}catch{}}function Je(n){return new Date(Number(n/BigInt(1e4)-BigInt(116444736e5)))}function ge(n,t){return n.getUint8(t)}function j(n,t){return n.getUint16(t,!0)}function B(n,t){return n.getUint32(t,!0)}function Le(n,t){return Number(n.getBigUint64(t,!0))}function da(n,t,e){n.setUint32(t,e,!0)}function q(n){return new DataView(n.buffer)}Pn({Inflate:gr});const ha=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:yt,BlobWriter:ts,Data64URIReader:Ui,Data64URIWriter:vi,ERR_BAD_FORMAT:Ne,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Ts,ERR_ENCRYPTED:As,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Es,ERR_EOCDR_NOT_FOUND:ys,ERR_EOCDR_ZIP64_NOT_FOUND:xs,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Rs,ERR_HTTP_RANGE:Oe,ERR_INVALID_PASSWORD:dt,ERR_INVALID_SIGNATURE:ht,ERR_ITERATOR_COMPLETED_TOO_SOON:zn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ss,ERR_SPLIT_ZIP_FILE:ut,ERR_UNSUPPORTED_COMPRESSION:ft,ERR_UNSUPPORTED_ENCRYPTION:Cs,HttpRangeReader:Bi,HttpReader:os,Reader:le,SplitDataReader:Et,SplitDataWriter:Me,SplitZipReader:Yi,SplitZipWriter:Vi,TextReader:Fi,TextWriter:Mi,Uint8ArrayReader:ji,Uint8ArrayWriter:qi,Writer:bt,ZipReader:ra,configure:Pn,getMimeType:Hr,initReader:cs,initStream:Ae,initWriter:ls,readUint8Array:G,terminateWorkers:Ai},Symbol.toStringTag,{value:"Module"})),Ee=ha;class _a{constructor(t,e){L(this,"_zipReader");L(this,"_entriesPromise");L(this,"_traceURL");this._traceURL=t,Ee.configure({baseURL:self.location.href}),this._zipReader=new Ee.ZipReader(new Ee.HttpReader(ma(t),{mode:"cors",preventHeadRequest:!0}),{useWebWorkers:!1}),this._entriesPromise=this._zipReader.getEntries({onprogress:e}).then(s=>{const r=new Map;for(const i of s)r.set(i.filename,i);return r})}isLive(){return!1}traceURL(){return this._traceURL}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){var i;const s=(await this._entriesPromise).get(t);if(!s)return;const r=new Ee.TextWriter;return await((i=s.getData)==null?void 0:i.call(s,r)),r.getData()}async readBlob(t){const s=(await this._entriesPromise).get(t);if(!s)return;const r=new Ee.BlobWriter;return await s.getData(r),r.getData()}}class pa{constructor(t){L(this,"_entriesPromise");L(this,"_traceURL");this._traceURL=t,this._entriesPromise=fetch("/trace/file?path="+encodeURIComponent(t)).then(async e=>{const s=JSON.parse(await e.text()),r=new Map;for(const i of s.entries)r.set(i.name,i.path);return r})}isLive(){return!0}traceURL(){return this._traceURL}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){const e=await this._readEntry(t);return e==null?void 0:e.text()}async readBlob(t){const e=await this._readEntry(t);return(e==null?void 0:e.status)===200?await(e==null?void 0:e.blob()):void 0}async _readEntry(t){const s=(await this._entriesPromise).get(t);if(s)return fetch("/trace/file?path="+encodeURIComponent(s))}}function ma(n){let t=n.startsWith("http")||n.startsWith("blob")?n:`file?path=${encodeURIComponent(n)}`;return t.startsWith("https://www.dropbox.com/")&&(t="https://dl.dropboxusercontent.com/"+t.substring(24)),t}self.addEventListener("install",function(n){self.skipWaiting()});self.addEventListener("activate",function(n){n.waitUntil(self.clients.claim())});const wa=new URL(self.registration.scope).pathname,ce=new Map,He=new Map;async function ga(n,t,e,s,r){var u;await Is();let i=He.get(e);i||(i={limit:s,traceUrls:new Set},He.set(e,i)),i.traceUrls.add(n);const a=new Js;try{const[d,h]=Us(r,[.5,.4,.1]),p=n.endsWith("json")?new pa(n):new _a(n,d);await a.load(p,h)}catch(d){throw console.error(d),(u=d==null?void 0:d.message)!=null&&u.includes("Cannot find .trace file")&&await a.hasEntry("index.html")?new Error("Could not load trace. Did you upload a Playwright HTML report instead? Make sure to extract the archive first and then double-click the index.html file or put it on a web server."):d instanceof An?new Error(`Could not load trace from ${t||n}. ${d.message}`):t?new Error(`Could not load trace from ${t}. Make sure to upload a valid Playwright trace.`):new Error(`Could not load trace from ${n}. Make sure a valid Playwright Trace is accessible over this url.`)}const l=new Ys(a.storage(),d=>a.resourceForSha1(d));return ce.set(n,{traceModel:a,snapshotServer:l}),a}async function ba(n){if(n.request.url.startsWith("chrome-extension://"))return fetch(n.request);const t=n.request,e=await self.clients.get(n.clientId),s=self.registration.scope.startsWith("https://");if(t.url.startsWith(self.registration.scope)){const u=new URL(ze(t.url)),d=u.pathname.substring(wa.length-1);if(d==="/ping")return await Is(),new Response(null,{status:200});const h=u.searchParams.get("trace");if(d==="/contexts")try{const p=u.searchParams.has("limit")?+u.searchParams.get("limit"):void 0,b=await ga(h,u.searchParams.get("traceFileName"),n.clientId,p,(y,x)=>{e.postMessage({method:"progress",params:{done:y,total:x}})});return new Response(JSON.stringify(b.contextEntries),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){return new Response(JSON.stringify({error:p==null?void 0:p.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(d.startsWith("/snapshotInfo/")){const{snapshotServer:p}=ce.get(h)||{};return p?p.serveSnapshotInfo(d,u.searchParams):new Response(null,{status:404})}if(d.startsWith("/snapshot/")){const{snapshotServer:p}=ce.get(h)||{};if(!p)return new Response(null,{status:404});const b=p.serveSnapshot(d,u.searchParams,u.href);return s&&b.headers.set("Content-Security-Policy","upgrade-insecure-requests"),b}if(d.startsWith("/closest-screenshot/")){const{snapshotServer:p}=ce.get(h)||{};return p?p.serveClosestScreenshot(d,u.searchParams):new Response(null,{status:404})}if(d.startsWith("/sha1/")){const p=d.slice(6);for(const b of ce.values()){const y=await b.traceModel.resourceForSha1(p);if(y)return new Response(y,{status:200,headers:ya(u.searchParams)})}return new Response(null,{status:404})}return fetch(n.request)}const r=ze(e.url),i=new URL(r).searchParams.get("trace"),{snapshotServer:a}=ce.get(i)||{};if(!a)return new Response(null,{status:404});const l=[t.url];return s&&t.url.startsWith("https://")&&l.push(t.url.replace(/^https/,"http")),a.serveResource(l,t.method,r)}function ya(n){const t=n.get("dn"),e=n.get("dct");if(!t)return;const s=new Headers;return s.set("Content-Disposition",`attachment; filename="attachment"; filename*=UTF-8''${encodeURIComponent(t)}`),e&&s.set("Content-Type",e),s}async function Is(){const n=await self.clients.matchAll(),t=new Set;for(const[e,s]of He){if(!n.find(r=>r.id===e)){He.delete(e);continue}if(s.limit!==void 0){const r=[...s.traceUrls];s.traceUrls=new Set(r.slice(r.length-s.limit))}s.traceUrls.forEach(r=>t.add(r))}for(const e of ce.keys())t.has(e)||ce.delete(e)}self.addEventListener("fetch",function(n){n.respondWith(ba(n))});
1
+ var vr=Object.defineProperty;var Lr=(n,t,e)=>t in n?vr(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var N=(n,t,e)=>Lr(n,typeof t!="symbol"?t+"":t,e);function Nr(n,t){const e=new Array(t.length).fill(0);return new Array(t.length).fill(0).map((r,s)=>(i,a)=>{e[s]=i/a*t[s]*1e3,n(e.reduce((o,f)=>o+f,0),1e3)})}const Tn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Fr(n){return n.replace(/[&<>"']/ug,t=>Tn[t])}function Ur(n){return n.replace(/[&<]/ug,t=>Tn[t])}function Ot(n,t,e){return n.find((r,s)=>{if(s===n.length-1)return!0;const i=n[s+1];return Math.abs(t(r)-e)<Math.abs(t(i)-e)})}function Sn(n){return Array.isArray(n)&&typeof n[0]=="string"}function Mr(n){return Array.isArray(n)&&Array.isArray(n[0])}class Wr{constructor(t,e,r,s,i){N(this,"_htmlCache");N(this,"_snapshots");N(this,"_index");N(this,"snapshotName");N(this,"_resources");N(this,"_snapshot");N(this,"_callId");N(this,"_screencastFrames");this._htmlCache=t,this._resources=e,this._snapshots=r,this._index=i,this._snapshot=r[i],this._callId=r[i].callId,this._screencastFrames=s,this.snapshotName=r[i].snapshotName}snapshot(){return this._snapshots[this._index]}viewport(){return this._snapshots[this._index].viewport}closestScreenshot(){var s;const{wallTime:t,timestamp:e}=this.snapshot(),r=t&&((s=this._screencastFrames[0])!=null&&s.frameSwapWallTime)?Ot(this._screencastFrames,i=>i.frameSwapWallTime,t):Ot(this._screencastFrames,i=>i.timestamp,e);return r==null?void 0:r.sha1}render(){const t=[],e=(i,a,o,f)=>{if(typeof i=="string"){o==="STYLE"||o==="style"?t.push(Gr(i)):t.push(Ur(i));return}if(Mr(i)){const h=a-i[0][0];if(h>=0&&h<=a){const u=Br(this._snapshots[h]),y=i[0][1];if(y>=0&&y<u.length)return e(u[y],h,o,f)}}else if(Sn(i)){const[h,u,...y]=i,b=h==="NOSCRIPT"?"X-NOSCRIPT":h,R=Object.entries(u||{});t.push("<",b);const C="__playwright_current_src__",l=b==="IFRAME"||b==="FRAME",c=b==="A",d=b==="IMG",p=d&&R.some(g=>g[0]===C),w=b==="SOURCE"&&o==="PICTURE"&&(f==null?void 0:f.some(g=>g[0]===C));for(const[g,T]of R){let _=g;l&&g.toLowerCase()==="src"&&(_="__playwright_src__"),d&&g===C&&(_="src"),["src","srcset"].includes(g.toLowerCase())&&(p||w)&&(_="_"+_);let S=T;c&&g.toLowerCase()==="href"?S="link://"+T:(g.toLowerCase()==="href"||g.toLowerCase()==="src"||g===C)&&(S=Qe(T)),t.push(" ",_,'="',Fr(S),'"')}t.push(">");for(const g of y)e(g,a,b,R);Hr.has(b)||t.push("</",b,">");return}else return},r=this._snapshot;return{html:this._htmlCache.getOrCompute(this,()=>{e(r.html,this._index,void 0,void 0);const a=(r.doctype?`<!DOCTYPE ${r.doctype}>`:"")+["<style>*,*::before,*::after { visibility: hidden }</style>",`<script>${jr(this.viewport(),this._callId,this.snapshotName)}<\/script>`].join("")+t.join("");return{value:a,size:a.length}}),pageId:r.pageId,frameId:r.frameId,index:this._index}}resourceByUrl(t,e){const r=this._snapshot;let s,i;for(const o of this._resources){if(typeof o._monotonicTime=="number"&&o._monotonicTime>=r.timestamp)break;o.response.status!==304&&o.request.url===t&&o.request.method===e&&(o._frameref===r.frameId?s=o:i=o)}let a=s??i;if(a&&e.toUpperCase()==="GET"){for(const o of r.resourceOverrides)if(t===o.url&&o.sha1){a={...a,response:{...a.response,content:{...a.response.content,_sha1:o.sha1}}};break}}return a}}const Hr=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]);function Br(n){if(!n._nodes){const t=[],e=r=>{if(typeof r=="string")t.push(r);else if(Sn(r)){const[,,...s]=r;for(const i of s)e(i);t.push(r)}};e(n.html),n._nodes=t}return n._nodes}function jr(n,...t){function e(r,s,...i){const a=new URLSearchParams(location.search),o=a.has("shouldPopulateCanvasFromScreenshot"),f=a.has("isUnderTest"),h={viewport:s,frames:new WeakMap};window.__playwright_frame_bounding_rects__=h;const u="Recorded click position in absolute coordinates did not match the center of the clicked element. This is likely due to a difference between the test runner and the trace viewer operating systems.",y=[],b=[],R=[],C=[];let l=window;for(;l!==l.parent&&!l.location.pathname.match(/\/page@[a-z0-9]+$/);)l=l.parent;const c=w=>{for(const g of w.querySelectorAll("[__playwright_scroll_top_]"))y.push(g);for(const g of w.querySelectorAll("[__playwright_scroll_left_]"))b.push(g);for(const g of w.querySelectorAll("[__playwright_value_]")){const T=g;T.type!=="file"&&(T.value=T.getAttribute("__playwright_value_")),g.removeAttribute("__playwright_value_")}for(const g of w.querySelectorAll("[__playwright_checked_]"))g.checked=g.getAttribute("__playwright_checked_")==="true",g.removeAttribute("__playwright_checked_");for(const g of w.querySelectorAll("[__playwright_selected_]"))g.selected=g.getAttribute("__playwright_selected_")==="true",g.removeAttribute("__playwright_selected_");for(const g of w.querySelectorAll("[__playwright_popover_open_]")){try{g.showPopover()}catch{}g.removeAttribute("__playwright_popover_open_")}for(const g of i)for(const T of w.querySelectorAll(`[__playwright_target__="${g}"]`)){const _=T.style;_.outline="2px solid #006ab1",_.backgroundColor="#6fa8dc7f",R.push(T)}for(const g of w.querySelectorAll("iframe, frame")){const T=g.getAttribute("__playwright_bounding_rect__");g.removeAttribute("__playwright_bounding_rect__");const _=T?JSON.parse(T):void 0;_&&h.frames.set(g,{boundingRect:_,scrollLeft:0,scrollTop:0});const S=g.getAttribute("__playwright_src__");if(!S)g.setAttribute("src",'data:text/html,<body style="background: #ddd"></body>');else{const E=new URL(r(window.location.href)),A=E.pathname.lastIndexOf("/snapshot/");A!==-1&&(E.pathname=E.pathname.substring(0,A+1)),E.pathname+=S.substring(1),g.setAttribute("src",E.toString())}}{const g=w.querySelector("body[__playwright_custom_elements__]");if(g&&window.customElements){const T=(g.getAttribute("__playwright_custom_elements__")||"").split(",");for(const _ of T)window.customElements.define(_,class extends HTMLElement{})}}for(const g of w.querySelectorAll("template[__playwright_shadow_root_]")){const T=g,_=T.parentElement.attachShadow({mode:"open"});_.appendChild(T.content),T.remove(),c(_)}if("adoptedStyleSheets"in w){const g=[...w.adoptedStyleSheets];for(const T of w.querySelectorAll("template[__playwright_style_sheet_]")){const _=T,S=new CSSStyleSheet;S.replaceSync(_.getAttribute("__playwright_style_sheet_")),g.push(S)}w.adoptedStyleSheets=g}C.push(...w.querySelectorAll("canvas"))},d=()=>{window.removeEventListener("load",d);for(const T of y)T.scrollTop=+T.getAttribute("__playwright_scroll_top_"),T.removeAttribute("__playwright_scroll_top_"),h.frames.has(T)&&(h.frames.get(T).scrollTop=T.scrollTop);for(const T of b)T.scrollLeft=+T.getAttribute("__playwright_scroll_left_"),T.removeAttribute("__playwright_scroll_left_"),h.frames.has(T)&&(h.frames.get(T).scrollLeft=T.scrollTop);document.styleSheets[0].disabled=!0;const w=new URL(window.location.href).searchParams,g=window===l;if(w.get("pointX")&&w.get("pointY")){const T=+w.get("pointX"),_=+w.get("pointY"),S=w.has("hasInputTarget"),E=R.length>0,A=document.documentElement?[document.documentElement]:[];for(const x of E?R:A){const m=document.createElement("x-pw-pointer");if(m.style.position="fixed",m.style.backgroundColor="#f44336",m.style.width="20px",m.style.height="20px",m.style.borderRadius="10px",m.style.margin="-10px 0 0 -10px",m.style.zIndex="2147483646",m.style.display="flex",m.style.alignItems="center",m.style.justifyContent="center",E){const k=x.getBoundingClientRect(),O=k.left+k.width/2,v=k.top+k.height/2;if(m.style.left=O+"px",m.style.top=v+"px",g&&(Math.abs(O-T)>=10||Math.abs(v-_)>=10)){const D=document.createElement("x-pw-pointer-warning");D.textContent="⚠",D.style.fontSize="19px",D.style.color="white",D.style.marginTop="-3.5px",D.style.userSelect="none",m.appendChild(D),m.setAttribute("title",u)}document.documentElement.appendChild(m)}else g&&!S&&(m.style.left=T+"px",m.style.top=_+"px",document.documentElement.appendChild(m))}}if(C.length>0){let T=function(S,E){function A(){const x=document.createElement("canvas");x.width=x.width/Math.floor(x.width/24),x.height=x.height/Math.floor(x.height/24);const m=x.getContext("2d");return m.fillStyle="lightgray",m.fillRect(0,0,x.width,x.height),m.fillStyle="white",m.fillRect(0,0,x.width/2,x.height/2),m.fillRect(x.width/2,x.height/2,x.width,x.height),m.createPattern(x,"repeat")}S.fillStyle=A(),S.fillRect(0,0,E.width,E.height)};const _=new Image;_.onload=()=>{var S;for(const E of C){const A=E.getContext("2d"),x=E.getAttribute("__playwright_bounding_rect__");if(E.removeAttribute("__playwright_bounding_rect__"),!x)continue;let m;try{m=JSON.parse(x)}catch{continue}let k=window;for(;k!==l;){const U=k.frameElement;k=k.parent;const L=(S=k.__playwright_frame_bounding_rects__)==null?void 0:S.frames.get(U);if(!(L!=null&&L.boundingRect))break;const te=L.boundingRect.left-L.scrollLeft,P=L.boundingRect.top-L.scrollTop;m.left+=te,m.top+=P,m.right+=te,m.bottom+=P}const{width:O,height:v}=l.__playwright_frame_bounding_rects__.viewport;m.left=m.left/O,m.top=m.top/v,m.right=m.right/O,m.bottom=m.bottom/v;const D=m.right>1||m.bottom>1;if(m.left>1||m.top>1){E.title="Playwright couldn't capture canvas contents because it's located outside the viewport.";continue}T(A,E),o?(A.drawImage(_,m.left*_.width,m.top*_.height,(m.right-m.left)*_.width,(m.bottom-m.top)*_.height,0,0,E.width,E.height),D?E.title="Playwright couldn't capture full canvas contents because it's located partially outside the viewport.":E.title="Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution."):E.title="Canvas content display is disabled.",f&&console.log("canvas drawn:",JSON.stringify([m.left,m.top,m.right-m.left,m.bottom-m.top].map(U=>Math.floor(U*100))))}},_.onerror=()=>{for(const S of C){const E=S.getContext("2d");T(E,S),S.title="Playwright couldn't show canvas contents because the screenshot failed to load."}},_.src=location.href.replace("/snapshot","/closest-screenshot")}},p=()=>c(document);window.addEventListener("load",d),window.addEventListener("DOMContentLoaded",p)}return`
2
+ (${e.toString()})(${ze.toString()}, ${JSON.stringify(n)}${t.map(r=>`, "${r}"`).join("")})`}const Rn=["about:","blob:","data:","file:","ftp:","http:","https:","mailto:","sftp:","ws:","wss:"],kt="http://playwright.bloburl/#";function Qe(n){n.startsWith(kt)&&(n=n.substring(kt.length));try{const t=new URL(n);if(t.protocol==="javascript:"||t.protocol==="vbscript:")return"javascript:void(0)";const e=t.protocol==="blob:",r=t.protocol==="file:";if(!e&&!r&&Rn.includes(t.protocol))return n;const s="pw-"+t.protocol.slice(0,t.protocol.length-1);return r||(t.protocol="https:"),t.hostname=t.hostname?`${s}--${t.hostname}`:s,r&&(t.protocol="https:"),t.toString()}catch{return n}}const qr=/url\(['"]?([\w-]+:)\/\//ig;function Gr(n){return n.replace(qr,(t,e)=>!(e==="blob:")&&!(e==="file:")&&Rn.includes(e)?t:t.replace(e+"//",`https://pw-${e.slice(0,-1)}--`))}function ze(n){const t=new URL(n);return t.pathname.endsWith("/snapshot.html")?t.searchParams.get("r"):n}class Vr{constructor(t,e){N(this,"_snapshotStorage");N(this,"_resourceLoader");N(this,"_snapshotIds",new Map);this._snapshotStorage=t,this._resourceLoader=e}serveSnapshot(t,e,r){const s=this._snapshot(t.substring(9),e);if(!s)return new Response(null,{status:404});const i=s.render();return this._snapshotIds.set(r,s),new Response(i.html,{status:200,headers:{"Content-Type":"text/html; charset=utf-8"}})}async serveClosestScreenshot(t,e){const r=this._snapshot(t.substring(19),e),s=r==null?void 0:r.closestScreenshot();return s?new Response(await this._resourceLoader(s)):new Response(null,{status:404})}serveSnapshotInfo(t,e){const r=this._snapshot(t.substring(13),e);return this._respondWithJson(r?{viewport:r.viewport(),url:r.snapshot().frameUrl,timestamp:r.snapshot().timestamp,wallTime:r.snapshot().wallTime}:{error:"No snapshot found"})}_snapshot(t,e){const r=e.get("name");return this._snapshotStorage.snapshotByName(t.slice(1),r)}_respondWithJson(t){return new Response(JSON.stringify(t),{status:200,headers:{"Cache-Control":"public, max-age=31536000","Content-Type":"application/json"}})}async serveResource(t,e,r){let s;const i=this._snapshotIds.get(r);for(const R of t)if(s=i==null?void 0:i.resourceByUrl(Yr(R),e),s)break;if(!s)return new Response(null,{status:404});const a=s.response.content._sha1,o=a?await this._resourceLoader(a)||new Blob([]):new Blob([]);let f=s.response.content.mimeType;/^text\/|^application\/(javascript|json)/.test(f)&&!f.includes("charset")&&(f=`${f}; charset=utf-8`);const u=new Headers;f!=="x-unknown"&&u.set("Content-Type",f);for(const{name:R,value:C}of s.response.headers)u.set(R,C);u.delete("Content-Encoding"),u.delete("Access-Control-Allow-Origin"),u.set("Access-Control-Allow-Origin","*"),u.delete("Content-Length"),u.set("Content-Length",String(o.size)),u.set("Cache-Control","public, max-age=31536000");const{status:y}=s.response,b=y===101||y===204||y===205||y===304;return new Response(b?null:o,{headers:u,status:s.response.status,statusText:s.response.statusText})}}function Yr(n){try{const t=new URL(n);return t.hash="",t.toString()}catch{return n}}function Zr(n){const t=new Map,{files:e,stacks:r}=n;for(const s of r){const[i,a]=s;t.set(`call@${i}`,a.map(o=>({file:e[o[0]],line:o[1],column:o[2],function:o[3]})))}return t}class Kr{constructor(t){N(this,"_maxSize");N(this,"_map");N(this,"_size");this._maxSize=t,this._map=new Map,this._size=0}getOrCompute(t,e){if(this._map.has(t)){const s=this._map.get(t);return this._map.delete(t),this._map.set(t,s),s.value}const r=e();for(;this._map.size&&this._size+r.size>this._maxSize;){const[s,i]=this._map.entries().next().value;this._size-=i.size,this._map.delete(s)}return this._map.set(t,r),this._size+=r.size,r.value}}class Xr{constructor(){N(this,"_resources",[]);N(this,"_frameSnapshots",new Map);N(this,"_cache",new Kr(1e8))}addResource(t){t.request.url=Qe(t.request.url),this._resources.push(t)}addFrameSnapshot(t,e){for(const i of t.resourceOverrides)i.url=Qe(i.url);let r=this._frameSnapshots.get(t.frameId);r||(r={raw:[],renderers:[]},this._frameSnapshots.set(t.frameId,r),t.isMainFrame&&this._frameSnapshots.set(t.pageId,r)),r.raw.push(t);const s=new Wr(this._cache,this._resources,r.raw,e,r.raw.length-1);return r.renderers.push(s),s}snapshotByName(t,e){const r=this._frameSnapshots.get(t);return r==null?void 0:r.renderers.find(s=>s.snapshotName===e)}snapshotsForTest(){return[...this._frameSnapshots.keys()]}finalize(){this._resources.sort((t,e)=>(t._monotonicTime||0)-(e._monotonicTime||0))}}class An extends Error{constructor(t){super(t),this.name="TraceVersionError"}}const Dt=7;class $r{constructor(t,e){N(this,"_contextEntry");N(this,"_snapshotStorage");N(this,"_actionMap",new Map);N(this,"_version");N(this,"_pageEntries",new Map);N(this,"_jsHandles",new Map);N(this,"_consoleObjects",new Map);this._contextEntry=t,this._snapshotStorage=e}appendTrace(t){for(const e of t.split(`
3
+ `))this._appendEvent(e)}actions(){return[...this._actionMap.values()]}_pageEntry(t){let e=this._pageEntries.get(t);return e||(e={pageId:t,screencastFrames:[]},this._pageEntries.set(t,e),this._contextEntry.pages.push(e)),e}_appendEvent(t){if(!t)return;const e=this._modernize(JSON.parse(t));for(const r of e)this._innerAppendEvent(r)}_innerAppendEvent(t){const e=this._contextEntry;switch(t.type){case"context-options":{if(t.version>Dt)throw new An("The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.");this._version=t.version,e.origin=t.origin,e.browserName=t.browserName,e.channel=t.channel,e.title=t.title,e.platform=t.platform,e.wallTime=t.wallTime,e.startTime=t.monotonicTime,e.sdkLanguage=t.sdkLanguage,e.options=t.options,e.testIdAttributeName=t.testIdAttributeName;break}case"screencast-frame":{this._pageEntry(t.pageId).screencastFrames.push(t);break}case"before":{this._actionMap.set(t.callId,{...t,type:"action",endTime:0,log:[]});break}case"input":{const r=this._actionMap.get(t.callId);r.inputSnapshot=t.inputSnapshot,r.point=t.point;break}case"log":{const r=this._actionMap.get(t.callId);if(!r)return;r.log.push({time:t.time,message:t.message});break}case"after":{const r=this._actionMap.get(t.callId);r.afterSnapshot=t.afterSnapshot,r.endTime=t.endTime,r.result=t.result,r.error=t.error,r.attachments=t.attachments,t.point&&(r.point=t.point);break}case"action":{this._actionMap.set(t.callId,{...t,log:[]});break}case"event":{e.events.push(t);break}case"stdout":{e.stdio.push(t);break}case"stderr":{e.stdio.push(t);break}case"error":{e.errors.push(t);break}case"console":{e.events.push(t);break}case"resource-snapshot":this._snapshotStorage.addResource(t.snapshot),e.resources.push(t.snapshot);break;case"frame-snapshot":this._snapshotStorage.addFrameSnapshot(t.snapshot,this._pageEntry(t.snapshot.pageId).screencastFrames);break}"pageId"in t&&t.pageId&&this._pageEntry(t.pageId),(t.type==="action"||t.type==="before")&&(e.startTime=Math.min(e.startTime,t.startTime)),(t.type==="action"||t.type==="after")&&(e.endTime=Math.max(e.endTime,t.endTime)),t.type==="event"&&(e.startTime=Math.min(e.startTime,t.time),e.endTime=Math.max(e.endTime,t.time)),t.type==="screencast-frame"&&(e.startTime=Math.min(e.startTime,t.timestamp),e.endTime=Math.max(e.endTime,t.timestamp))}_processedContextCreatedEvent(){return this._version!==void 0}_modernize(t){let e=this._version||t.version;if(e===void 0)return[t];let r=[t];for(;e<Dt;++e)r=this[`_modernize_${e}_to_${e+1}`].call(this,r);return r}_modernize_0_to_1(t){for(const e of t)e.type==="action"&&typeof e.metadata.error=="string"&&(e.metadata.error={error:{name:"Error",message:e.metadata.error}});return t}_modernize_1_to_2(t){var e;for(const r of t)r.type!=="frame-snapshot"||!r.snapshot.isMainFrame||(r.snapshot.viewport=((e=this._contextEntry.options)==null?void 0:e.viewport)||{width:1280,height:720});return t}_modernize_2_to_3(t){for(const e of t){if(e.type!=="resource-snapshot"||e.snapshot.request)continue;const r=e.snapshot;e.snapshot={_frameref:r.frameId,request:{url:r.url,method:r.method,headers:r.requestHeaders,postData:r.requestSha1?{_sha1:r.requestSha1}:void 0},response:{status:r.status,headers:r.responseHeaders,content:{mimeType:r.contentType,_sha1:r.responseSha1}},_monotonicTime:r.timestamp}}return t}_modernize_3_to_4(t){const e=[];for(const r of t){const s=this._modernize_event_3_to_4(r);s&&e.push(s)}return e}_modernize_event_3_to_4(t){var r,s,i,a;if(t.type!=="action"&&t.type!=="event")return t;const e=t.metadata;return e.internal||e.method.startsWith("tracing")?null:t.type==="event"?e.method==="__create__"&&e.type==="ConsoleMessage"?{type:"object",class:e.type,guid:e.params.guid,initializer:e.params.initializer}:{type:"event",time:e.startTime,class:e.type,method:e.method,params:e.params,pageId:e.pageId}:{type:"action",callId:e.id,startTime:e.startTime,endTime:e.endTime,apiName:e.apiName||e.type+"."+e.method,class:e.type,method:e.method,params:e.params,wallTime:e.wallTime||Date.now(),log:e.log,beforeSnapshot:(r=e.snapshots.find(o=>o.title==="before"))==null?void 0:r.snapshotName,inputSnapshot:(s=e.snapshots.find(o=>o.title==="input"))==null?void 0:s.snapshotName,afterSnapshot:(i=e.snapshots.find(o=>o.title==="after"))==null?void 0:i.snapshotName,error:(a=e.error)==null?void 0:a.error,result:e.result,point:e.point,pageId:e.pageId}}_modernize_4_to_5(t){const e=[];for(const r of t){const s=this._modernize_event_4_to_5(r);s&&e.push(s)}return e}_modernize_event_4_to_5(t){var e,r;if(t.type==="event"&&t.method==="__create__"&&t.class==="JSHandle"&&this._jsHandles.set(t.params.guid,t.params.initializer),t.type==="object"){if(t.class!=="ConsoleMessage")return null;const s=(e=t.initializer.args)==null?void 0:e.map(i=>{if(i.guid){const a=this._jsHandles.get(i.guid);return{preview:(a==null?void 0:a.preview)||"",value:""}}return{preview:i.preview||"",value:i.value||""}});return this._consoleObjects.set(t.guid,{type:t.initializer.type,text:t.initializer.text,location:t.initializer.location,args:s}),null}if(t.type==="event"&&t.method==="console"){const s=this._consoleObjects.get(((r=t.params.message)==null?void 0:r.guid)||"");return s?{type:"console",time:t.time,pageId:t.pageId,messageType:s.type,text:s.text,args:s.args,location:s.location}:null}return t}_modernize_5_to_6(t){const e=[];for(const r of t)if(e.push(r),!(r.type!=="after"||!r.log.length))for(const s of r.log)e.push({type:"log",callId:r.callId,message:s,time:-1});return e}_modernize_6_to_7(t){const e=[];if(!this._processedContextCreatedEvent()&&t[0].type!=="context-options"){const r={type:"context-options",origin:"testRunner",version:7,browserName:"",options:{},platform:process.platform,wallTime:0,monotonicTime:0,sdkLanguage:"javascript"};e.push(r)}for(const r of t){if(r.type==="context-options"){e.push({...r,monotonicTime:0,origin:"library"});continue}!this._contextEntry.wallTime&&r.type==="before"&&(this._contextEntry.wallTime=r.wallTime),!this._contextEntry.startTime&&r.type==="before"&&(this._contextEntry.startTime=r.startTime),e.push(r)}return e}}class Jr{constructor(){N(this,"contextEntries",[]);N(this,"_snapshotStorage");N(this,"_backend");N(this,"_resourceToContentType",new Map)}async load(t,e){var o,f;this._backend=t;const r=[];let s=!1;for(const h of await this._backend.entryNames()){const u=h.match(/(.+)\.trace/);u&&r.push(u[1]||""),h.includes("src@")&&(s=!0)}if(!r.length)throw new Error("Cannot find .trace file");this._snapshotStorage=new Xr;const i=r.length*3;let a=0;for(const h of r){const u=Qr();u.traceUrl=t.traceURL(),u.hasSource=s;const y=new $r(u,this._snapshotStorage),b=await this._backend.readText(h+".trace")||"";y.appendTrace(b),e(++a,i);const R=await this._backend.readText(h+".network")||"";if(y.appendTrace(R),e(++a,i),u.actions=y.actions().sort((l,c)=>l.startTime-c.startTime),!t.isLive()){for(const l of u.actions.slice().reverse())if(!l.endTime&&!l.error)for(const c of u.actions)c.parentId===l.callId&&l.endTime<c.endTime&&(l.endTime=c.endTime)}const C=await this._backend.readText(h+".stacks");if(C){const l=Zr(JSON.parse(C));for(const c of u.actions)c.stack=c.stack||l.get(c.callId)}e(++a,i);for(const l of u.resources)(o=l.request.postData)!=null&&o._sha1&&this._resourceToContentType.set(l.request.postData._sha1,It(l.request.postData.mimeType)),(f=l.response.content)!=null&&f._sha1&&this._resourceToContentType.set(l.response.content._sha1,It(l.response.content.mimeType));this.contextEntries.push(u)}this._snapshotStorage.finalize()}async hasEntry(t){return this._backend.hasEntry(t)}async resourceForSha1(t){const e=await this._backend.readBlob("resources/"+t),r=this._resourceToContentType.get(t);return!e||r===void 0||r==="x-unknown"?e:new Blob([e],{type:r})}storage(){return this._snapshotStorage}}function It(n){const t=n.match(/^(.*);\s*charset=.*$/);return t?t[1]:n}function Qr(){return{origin:"testRunner",traceUrl:"",startTime:Number.MAX_SAFE_INTEGER,wallTime:Number.MAX_SAFE_INTEGER,endTime:0,browserName:"",options:{deviceScaleFactor:1,isMobile:!1,viewport:{width:1280,height:800}},pages:[],resources:[],actions:[],events:[],errors:[],stdio:[],hasSource:!1}}const zr=15,F=0,z=1,es=2,Y=-2,H=-3,Pt=-4,ee=-5,Z=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Cn=1440,ts=0,ns=4,rs=9,ss=5,is=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],as=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],os=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],cs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ls=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],fs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ne=15;function et(){const n=this;let t,e,r,s,i,a;function o(h,u,y,b,R,C,l,c,d,p,w){let g,T,_,S,E,A,x,m,k,O,v,D,I,U,L;O=0,E=y;do r[h[u+O]]++,O++,E--;while(E!==0);if(r[0]==y)return l[0]=-1,c[0]=0,F;for(m=c[0],A=1;A<=ne&&r[A]===0;A++);for(x=A,m<A&&(m=A),E=ne;E!==0&&r[E]===0;E--);for(_=E,m>E&&(m=E),c[0]=m,U=1<<A;A<E;A++,U<<=1)if((U-=r[A])<0)return H;if((U-=r[E])<0)return H;for(r[E]+=U,a[1]=A=0,O=1,I=2;--E!==0;)a[I]=A+=r[O],I++,O++;E=0,O=0;do(A=h[u+O])!==0&&(w[a[A]++]=E),O++;while(++E<y);for(y=a[_],a[0]=E=0,O=0,S=-1,D=-m,i[0]=0,v=0,L=0;x<=_;x++)for(g=r[x];g--!==0;){for(;x>D+m;){if(S++,D+=m,L=_-D,L=L>m?m:L,(T=1<<(A=x-D))>g+1&&(T-=g+1,I=x,A<L))for(;++A<L&&!((T<<=1)<=r[++I]);)T-=r[I];if(L=1<<A,p[0]+L>Cn)return H;i[S]=v=p[0],p[0]+=L,S!==0?(a[S]=E,s[0]=A,s[1]=m,A=E>>>D-m,s[2]=v-i[S-1]-A,d.set(s,(i[S-1]+A)*3)):l[0]=v}for(s[1]=x-D,O>=y?s[0]=192:w[O]<b?(s[0]=w[O]<256?0:96,s[2]=w[O++]):(s[0]=C[w[O]-b]+16+64,s[2]=R[w[O++]-b]),T=1<<x-D,A=E>>>D;A<L;A+=T)d.set(s,(v+A)*3);for(A=1<<x-1;E&A;A>>>=1)E^=A;for(E^=A,k=(1<<D)-1;(E&k)!=a[S];)S--,D-=m,k=(1<<D)-1}return U!==0&&_!=1?ee:F}function f(h){let u;for(t||(t=[],e=[],r=new Int32Array(ne+1),s=[],i=new Int32Array(ne),a=new Int32Array(ne+1)),e.length<h&&(e=[]),u=0;u<h;u++)e[u]=0;for(u=0;u<ne+1;u++)r[u]=0;for(u=0;u<3;u++)s[u]=0;i.set(r.subarray(0,ne),0),a.set(r.subarray(0,ne+1),0)}n.inflate_trees_bits=function(h,u,y,b,R){let C;return f(19),t[0]=0,C=o(h,0,19,19,null,null,y,u,b,t,e),C==H?R.msg="oversubscribed dynamic bit lengths tree":(C==ee||u[0]===0)&&(R.msg="incomplete dynamic bit lengths tree",C=H),C},n.inflate_trees_dynamic=function(h,u,y,b,R,C,l,c,d){let p;return f(288),t[0]=0,p=o(y,0,h,257,os,cs,C,b,c,t,e),p!=F||b[0]===0?(p==H?d.msg="oversubscribed literal/length tree":p!=Pt&&(d.msg="incomplete literal/length tree",p=H),p):(f(288),p=o(y,h,u,0,ls,fs,l,R,c,t,e),p!=F||R[0]===0&&h>257?(p==H?d.msg="oversubscribed distance tree":p==ee?(d.msg="incomplete distance tree",p=H):p!=Pt&&(d.msg="empty distance tree with lengths",p=H),p):F)}}et.inflate_trees_fixed=function(n,t,e,r){return n[0]=rs,t[0]=ss,e[0]=is,r[0]=as,F};const De=0,vt=1,Lt=2,Nt=3,Ft=4,Ut=5,Mt=6,qe=7,Wt=8,Ie=9;function us(){const n=this;let t,e=0,r,s=0,i=0,a=0,o=0,f=0,h=0,u=0,y,b=0,R,C=0;function l(c,d,p,w,g,T,_,S){let E,A,x,m,k,O,v,D,I,U,L,te,P,ue,M,W;v=S.next_in_index,D=S.avail_in,k=_.bitb,O=_.bitk,I=_.write,U=I<_.read?_.read-I-1:_.end-I,L=Z[c],te=Z[d];do{for(;O<20;)D--,k|=(S.read_byte(v++)&255)<<O,O+=8;if(E=k&L,A=p,x=w,W=(x+E)*3,(m=A[W])===0){k>>=A[W+1],O-=A[W+1],_.win[I++]=A[W+2],U--;continue}do{if(k>>=A[W+1],O-=A[W+1],m&16){for(m&=15,P=A[W+2]+(k&Z[m]),k>>=m,O-=m;O<15;)D--,k|=(S.read_byte(v++)&255)<<O,O+=8;E=k&te,A=g,x=T,W=(x+E)*3,m=A[W];do if(k>>=A[W+1],O-=A[W+1],m&16){for(m&=15;O<m;)D--,k|=(S.read_byte(v++)&255)<<O,O+=8;if(ue=A[W+2]+(k&Z[m]),k>>=m,O-=m,U-=P,I>=ue)M=I-ue,I-M>0&&2>I-M?(_.win[I++]=_.win[M++],_.win[I++]=_.win[M++],P-=2):(_.win.set(_.win.subarray(M,M+2),I),I+=2,M+=2,P-=2);else{M=I-ue;do M+=_.end;while(M<0);if(m=_.end-M,P>m){if(P-=m,I-M>0&&m>I-M)do _.win[I++]=_.win[M++];while(--m!==0);else _.win.set(_.win.subarray(M,M+m),I),I+=m,M+=m,m=0;M=0}}if(I-M>0&&P>I-M)do _.win[I++]=_.win[M++];while(--P!==0);else _.win.set(_.win.subarray(M,M+P),I),I+=P,M+=P,P=0;break}else if(!(m&64))E+=A[W+2],E+=k&Z[m],W=(x+E)*3,m=A[W];else return S.msg="invalid distance code",P=S.avail_in-D,P=O>>3<P?O>>3:P,D+=P,v-=P,O-=P<<3,_.bitb=k,_.bitk=O,S.avail_in=D,S.total_in+=v-S.next_in_index,S.next_in_index=v,_.write=I,H;while(!0);break}if(m&64)return m&32?(P=S.avail_in-D,P=O>>3<P?O>>3:P,D+=P,v-=P,O-=P<<3,_.bitb=k,_.bitk=O,S.avail_in=D,S.total_in+=v-S.next_in_index,S.next_in_index=v,_.write=I,z):(S.msg="invalid literal/length code",P=S.avail_in-D,P=O>>3<P?O>>3:P,D+=P,v-=P,O-=P<<3,_.bitb=k,_.bitk=O,S.avail_in=D,S.total_in+=v-S.next_in_index,S.next_in_index=v,_.write=I,H);if(E+=A[W+2],E+=k&Z[m],W=(x+E)*3,(m=A[W])===0){k>>=A[W+1],O-=A[W+1],_.win[I++]=A[W+2],U--;break}}while(!0)}while(U>=258&&D>=10);return P=S.avail_in-D,P=O>>3<P?O>>3:P,D+=P,v-=P,O-=P<<3,_.bitb=k,_.bitk=O,S.avail_in=D,S.total_in+=v-S.next_in_index,S.next_in_index=v,_.write=I,F}n.init=function(c,d,p,w,g,T){t=De,h=c,u=d,y=p,b=w,R=g,C=T,r=null},n.proc=function(c,d,p){let w,g,T,_=0,S=0,E=0,A,x,m,k;for(E=d.next_in_index,A=d.avail_in,_=c.bitb,S=c.bitk,x=c.write,m=x<c.read?c.read-x-1:c.end-x;;)switch(t){case De:if(m>=258&&A>=10&&(c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,p=l(h,u,y,b,R,C,c,d),E=d.next_in_index,A=d.avail_in,_=c.bitb,S=c.bitk,x=c.write,m=x<c.read?c.read-x-1:c.end-x,p!=F)){t=p==z?qe:Ie;break}i=h,r=y,s=b,t=vt;case vt:for(w=i;S<w;){if(A!==0)p=F;else return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);A--,_|=(d.read_byte(E++)&255)<<S,S+=8}if(g=(s+(_&Z[w]))*3,_>>>=r[g+1],S-=r[g+1],T=r[g],T===0){a=r[g+2],t=Mt;break}if(T&16){o=T&15,e=r[g+2],t=Lt;break}if(!(T&64)){i=T,s=g/3+r[g+2];break}if(T&32){t=qe;break}return t=Ie,d.msg="invalid literal/length code",p=H,c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);case Lt:for(w=o;S<w;){if(A!==0)p=F;else return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);A--,_|=(d.read_byte(E++)&255)<<S,S+=8}e+=_&Z[w],_>>=w,S-=w,i=u,r=R,s=C,t=Nt;case Nt:for(w=i;S<w;){if(A!==0)p=F;else return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);A--,_|=(d.read_byte(E++)&255)<<S,S+=8}if(g=(s+(_&Z[w]))*3,_>>=r[g+1],S-=r[g+1],T=r[g],T&16){o=T&15,f=r[g+2],t=Ft;break}if(!(T&64)){i=T,s=g/3+r[g+2];break}return t=Ie,d.msg="invalid distance code",p=H,c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);case Ft:for(w=o;S<w;){if(A!==0)p=F;else return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);A--,_|=(d.read_byte(E++)&255)<<S,S+=8}f+=_&Z[w],_>>=w,S-=w,t=Ut;case Ut:for(k=x-f;k<0;)k+=c.end;for(;e!==0;){if(m===0&&(x==c.end&&c.read!==0&&(x=0,m=x<c.read?c.read-x-1:c.end-x),m===0&&(c.write=x,p=c.inflate_flush(d,p),x=c.write,m=x<c.read?c.read-x-1:c.end-x,x==c.end&&c.read!==0&&(x=0,m=x<c.read?c.read-x-1:c.end-x),m===0)))return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);c.win[x++]=c.win[k++],m--,k==c.end&&(k=0),e--}t=De;break;case Mt:if(m===0&&(x==c.end&&c.read!==0&&(x=0,m=x<c.read?c.read-x-1:c.end-x),m===0&&(c.write=x,p=c.inflate_flush(d,p),x=c.write,m=x<c.read?c.read-x-1:c.end-x,x==c.end&&c.read!==0&&(x=0,m=x<c.read?c.read-x-1:c.end-x),m===0)))return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);p=F,c.win[x++]=a,m--,t=De;break;case qe:if(S>7&&(S-=8,A++,E--),c.write=x,p=c.inflate_flush(d,p),x=c.write,m=x<c.read?c.read-x-1:c.end-x,c.read!=c.write)return c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);t=Wt;case Wt:return p=z,c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);case Ie:return p=H,c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p);default:return p=Y,c.bitb=_,c.bitk=S,d.avail_in=A,d.total_in+=E-d.next_in_index,d.next_in_index=E,c.write=x,c.inflate_flush(d,p)}},n.free=function(){}}const Ht=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pe=0,Ge=1,Bt=2,jt=3,qt=4,Gt=5,Pe=6,ve=7,Vt=8,de=9;function ds(n,t){const e=this;let r=pe,s=0,i=0,a=0,o;const f=[0],h=[0],u=new us;let y=0,b=new Int32Array(Cn*3);const R=0,C=new et;e.bitk=0,e.bitb=0,e.win=new Uint8Array(t),e.end=t,e.read=0,e.write=0,e.reset=function(l,c){c&&(c[0]=R),r==Pe&&u.free(l),r=pe,e.bitk=0,e.bitb=0,e.read=e.write=0},e.reset(n,null),e.inflate_flush=function(l,c){let d,p,w;return p=l.next_out_index,w=e.read,d=(w<=e.write?e.write:e.end)-w,d>l.avail_out&&(d=l.avail_out),d!==0&&c==ee&&(c=F),l.avail_out-=d,l.total_out+=d,l.next_out.set(e.win.subarray(w,w+d),p),p+=d,w+=d,w==e.end&&(w=0,e.write==e.end&&(e.write=0),d=e.write-w,d>l.avail_out&&(d=l.avail_out),d!==0&&c==ee&&(c=F),l.avail_out-=d,l.total_out+=d,l.next_out.set(e.win.subarray(w,w+d),p),p+=d,w+=d),l.next_out_index=p,e.read=w,c},e.proc=function(l,c){let d,p,w,g,T,_,S,E;for(g=l.next_in_index,T=l.avail_in,p=e.bitb,w=e.bitk,_=e.write,S=_<e.read?e.read-_-1:e.end-_;;){let A,x,m,k,O,v,D,I;switch(r){case pe:for(;w<3;){if(T!==0)c=F;else return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);T--,p|=(l.read_byte(g++)&255)<<w,w+=8}switch(d=p&7,y=d&1,d>>>1){case 0:p>>>=3,w-=3,d=w&7,p>>>=d,w-=d,r=Ge;break;case 1:A=[],x=[],m=[[]],k=[[]],et.inflate_trees_fixed(A,x,m,k),u.init(A[0],x[0],m[0],0,k[0],0),p>>>=3,w-=3,r=Pe;break;case 2:p>>>=3,w-=3,r=jt;break;case 3:return p>>>=3,w-=3,r=de,l.msg="invalid block type",c=H,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c)}break;case Ge:for(;w<32;){if(T!==0)c=F;else return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);T--,p|=(l.read_byte(g++)&255)<<w,w+=8}if((~p>>>16&65535)!=(p&65535))return r=de,l.msg="invalid stored block lengths",c=H,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);s=p&65535,p=w=0,r=s!==0?Bt:y!==0?ve:pe;break;case Bt:if(T===0||S===0&&(_==e.end&&e.read!==0&&(_=0,S=_<e.read?e.read-_-1:e.end-_),S===0&&(e.write=_,c=e.inflate_flush(l,c),_=e.write,S=_<e.read?e.read-_-1:e.end-_,_==e.end&&e.read!==0&&(_=0,S=_<e.read?e.read-_-1:e.end-_),S===0)))return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);if(c=F,d=s,d>T&&(d=T),d>S&&(d=S),e.win.set(l.read_buf(g,d),_),g+=d,T-=d,_+=d,S-=d,(s-=d)!==0)break;r=y!==0?ve:pe;break;case jt:for(;w<14;){if(T!==0)c=F;else return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);T--,p|=(l.read_byte(g++)&255)<<w,w+=8}if(i=d=p&16383,(d&31)>29||(d>>5&31)>29)return r=de,l.msg="too many length or distance symbols",c=H,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);if(d=258+(d&31)+(d>>5&31),!o||o.length<d)o=[];else for(E=0;E<d;E++)o[E]=0;p>>>=14,w-=14,a=0,r=qt;case qt:for(;a<4+(i>>>10);){for(;w<3;){if(T!==0)c=F;else return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);T--,p|=(l.read_byte(g++)&255)<<w,w+=8}o[Ht[a++]]=p&7,p>>>=3,w-=3}for(;a<19;)o[Ht[a++]]=0;if(f[0]=7,d=C.inflate_trees_bits(o,f,h,b,l),d!=F)return c=d,c==H&&(o=null,r=de),e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);a=0,r=Gt;case Gt:for(;d=i,!(a>=258+(d&31)+(d>>5&31));){let U,L;for(d=f[0];w<d;){if(T!==0)c=F;else return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);T--,p|=(l.read_byte(g++)&255)<<w,w+=8}if(d=b[(h[0]+(p&Z[d]))*3+1],L=b[(h[0]+(p&Z[d]))*3+2],L<16)p>>>=d,w-=d,o[a++]=L;else{for(E=L==18?7:L-14,U=L==18?11:3;w<d+E;){if(T!==0)c=F;else return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);T--,p|=(l.read_byte(g++)&255)<<w,w+=8}if(p>>>=d,w-=d,U+=p&Z[E],p>>>=E,w-=E,E=a,d=i,E+U>258+(d&31)+(d>>5&31)||L==16&&E<1)return o=null,r=de,l.msg="invalid bit length repeat",c=H,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);L=L==16?o[E-1]:0;do o[E++]=L;while(--U!==0);a=E}}if(h[0]=-1,O=[],v=[],D=[],I=[],O[0]=9,v[0]=6,d=i,d=C.inflate_trees_dynamic(257+(d&31),1+(d>>5&31),o,O,v,D,I,b,l),d!=F)return d==H&&(o=null,r=de),c=d,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);u.init(O[0],v[0],b,D[0],b,I[0]),r=Pe;case Pe:if(e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,(c=u.proc(e,l,c))!=z)return e.inflate_flush(l,c);if(c=F,u.free(l),g=l.next_in_index,T=l.avail_in,p=e.bitb,w=e.bitk,_=e.write,S=_<e.read?e.read-_-1:e.end-_,y===0){r=pe;break}r=ve;case ve:if(e.write=_,c=e.inflate_flush(l,c),_=e.write,S=_<e.read?e.read-_-1:e.end-_,e.read!=e.write)return e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);r=Vt;case Vt:return c=z,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);case de:return c=H,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c);default:return c=Y,e.bitb=p,e.bitk=w,l.avail_in=T,l.total_in+=g-l.next_in_index,l.next_in_index=g,e.write=_,e.inflate_flush(l,c)}}},e.free=function(l){e.reset(l,null),e.win=null,b=null},e.set_dictionary=function(l,c,d){e.win.set(l.subarray(c,c+d),0),e.read=e.write=d},e.sync_point=function(){return r==Ge?1:0}}const hs=32,_s=8,ps=0,Yt=1,Zt=2,Kt=3,Xt=4,$t=5,Ve=6,ye=7,Jt=12,re=13,ms=[0,0,255,255];function ws(){const n=this;n.mode=0,n.method=0,n.was=[0],n.need=0,n.marker=0,n.wbits=0;function t(e){return!e||!e.istate?Y:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=ye,e.istate.blocks.reset(e,null),F)}n.inflateEnd=function(e){return n.blocks&&n.blocks.free(e),n.blocks=null,F},n.inflateInit=function(e,r){return e.msg=null,n.blocks=null,r<8||r>15?(n.inflateEnd(e),Y):(n.wbits=r,e.istate.blocks=new ds(e,1<<r),t(e),F)},n.inflate=function(e,r){let s,i;if(!e||!e.istate||!e.next_in)return Y;const a=e.istate;for(r=r==ns?ee:F,s=ee;;)switch(a.mode){case ps:if(e.avail_in===0)return s;if(s=r,e.avail_in--,e.total_in++,((a.method=e.read_byte(e.next_in_index++))&15)!=_s){a.mode=re,e.msg="unknown compression method",a.marker=5;break}if((a.method>>4)+8>a.wbits){a.mode=re,e.msg="invalid win size",a.marker=5;break}a.mode=Yt;case Yt:if(e.avail_in===0)return s;if(s=r,e.avail_in--,e.total_in++,i=e.read_byte(e.next_in_index++)&255,((a.method<<8)+i)%31!==0){a.mode=re,e.msg="incorrect header check",a.marker=5;break}if(!(i&hs)){a.mode=ye;break}a.mode=Zt;case Zt:if(e.avail_in===0)return s;s=r,e.avail_in--,e.total_in++,a.need=(e.read_byte(e.next_in_index++)&255)<<24&4278190080,a.mode=Kt;case Kt:if(e.avail_in===0)return s;s=r,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<16&16711680,a.mode=Xt;case Xt:if(e.avail_in===0)return s;s=r,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<8&65280,a.mode=$t;case $t:return e.avail_in===0?s:(s=r,e.avail_in--,e.total_in++,a.need+=e.read_byte(e.next_in_index++)&255,a.mode=Ve,es);case Ve:return a.mode=re,e.msg="need dictionary",a.marker=0,Y;case ye:if(s=a.blocks.proc(e,s),s==H){a.mode=re,a.marker=0;break}if(s==F&&(s=r),s!=z)return s;s=r,a.blocks.reset(e,a.was),a.mode=Jt;case Jt:return e.avail_in=0,z;case re:return H;default:return Y}},n.inflateSetDictionary=function(e,r,s){let i=0,a=s;if(!e||!e.istate||e.istate.mode!=Ve)return Y;const o=e.istate;return a>=1<<o.wbits&&(a=(1<<o.wbits)-1,i=s-a),o.blocks.set_dictionary(r,i,a),o.mode=ye,F},n.inflateSync=function(e){let r,s,i,a,o;if(!e||!e.istate)return Y;const f=e.istate;if(f.mode!=re&&(f.mode=re,f.marker=0),(r=e.avail_in)===0)return ee;for(s=e.next_in_index,i=f.marker;r!==0&&i<4;)e.read_byte(s)==ms[i]?i++:e.read_byte(s)!==0?i=0:i=4-i,s++,r--;return e.total_in+=s-e.next_in_index,e.next_in_index=s,e.avail_in=r,f.marker=i,i!=4?H:(a=e.total_in,o=e.total_out,t(e),e.total_in=a,e.total_out=o,f.mode=ye,F)},n.inflateSyncPoint=function(e){return!e||!e.istate||!e.istate.blocks?Y:e.istate.blocks.sync_point()}}function On(){}On.prototype={inflateInit(n){const t=this;return t.istate=new ws,n||(n=zr),t.istate.inflateInit(t,n)},inflate(n){const t=this;return t.istate?t.istate.inflate(t,n):Y},inflateEnd(){const n=this;if(!n.istate)return Y;const t=n.istate.inflateEnd(n);return n.istate=null,t},inflateSync(){const n=this;return n.istate?n.istate.inflateSync(n):Y},inflateSetDictionary(n,t){const e=this;return e.istate?e.istate.inflateSetDictionary(e,n,t):Y},read_byte(n){return this.next_in[n]},read_buf(n,t){return this.next_in.subarray(n,n+t)}};function gs(n){const t=this,e=new On,r=n&&n.chunkSize?Math.floor(n.chunkSize*2):128*1024,s=ts,i=new Uint8Array(r);let a=!1;e.inflateInit(),e.next_out=i,t.append=function(o,f){const h=[];let u,y,b=0,R=0,C=0;if(o.length!==0){e.next_in_index=0,e.next_in=o,e.avail_in=o.length;do{if(e.next_out_index=0,e.avail_out=r,e.avail_in===0&&!a&&(e.next_in_index=0,a=!0),u=e.inflate(s),a&&u===ee){if(e.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==F&&u!==z)throw new Error("inflating: "+e.msg);if((a||u===z)&&e.avail_in===o.length)throw new Error("inflating: bad input");e.next_out_index&&(e.next_out_index===r?h.push(new Uint8Array(i)):h.push(i.subarray(0,e.next_out_index))),C+=e.next_out_index,f&&e.next_in_index>0&&e.next_in_index!=b&&(f(e.next_in_index),b=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return h.length>1?(y=new Uint8Array(C),h.forEach(function(l){y.set(l,R),R+=l.length})):y=h[0]?new Uint8Array(h[0]):new Uint8Array,y}},t.flush=function(){e.inflateEnd()}}const he=4294967295,oe=65535,bs=8,ys=0,xs=99,Es=67324752,Ts=134695760,Qt=33639248,Ss=101010256,zt=101075792,Rs=117853008,me=22,Ye=20,Ze=56,As=1,Cs=39169,Os=10,ks=1,Ds=21589,Is=28789,Ps=25461,vs=6534,en=1,Ls=6,tn=8,nn=2048,rn=16,Ns="/",$=void 0,Fe="undefined",kn="function";class sn{constructor(t){return class extends TransformStream{constructor(e,r){const s=new t(r);super({transform(i,a){a.enqueue(s.append(i))},flush(i){const a=s.flush();a&&i.enqueue(a)}})}}}}const Fs=64;let Dn=2;try{typeof navigator!=Fe&&navigator.hardwareConcurrency&&(Dn=navigator.hardwareConcurrency)}catch{}const Us={chunkSize:512*1024,maxWorkers:Dn,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:$,CompressionStreamNative:typeof CompressionStream!=Fe&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Fe&&DecompressionStream},ce=Object.assign({},Us);function In(){return ce}function Ms(n){return Math.max(n.chunkSize,Fs)}function Pn(n){const{baseURL:t,chunkSize:e,maxWorkers:r,terminateWorkerTimeout:s,useCompressionStream:i,useWebWorkers:a,Deflate:o,Inflate:f,CompressionStream:h,DecompressionStream:u,workerScripts:y}=n;if(se("baseURL",t),se("chunkSize",e),se("maxWorkers",r),se("terminateWorkerTimeout",s),se("useCompressionStream",i),se("useWebWorkers",a),o&&(ce.CompressionStream=new sn(o)),f&&(ce.DecompressionStream=new sn(f)),se("CompressionStream",h),se("DecompressionStream",u),y!==$){const{deflate:b,inflate:R}=y;if((b||R)&&(ce.workerScripts||(ce.workerScripts={})),b){if(!Array.isArray(b))throw new Error("workerScripts.deflate must be an array");ce.workerScripts.deflate=b}if(R){if(!Array.isArray(R))throw new Error("workerScripts.inflate must be an array");ce.workerScripts.inflate=R}}}function se(n,t){t!==$&&(ce[n]=t)}function Ws(){return"application/octet-stream"}const vn=[];for(let n=0;n<256;n++){let t=n;for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t=t>>>1;vn[n]=t}class Ue{constructor(t){this.crc=t||-1}append(t){let e=this.crc|0;for(let r=0,s=t.length|0;r<s;r++)e=e>>>8^vn[(e^t[r])&255];this.crc=e}get(){return~this.crc}}class Ln extends TransformStream{constructor(){let t;const e=new Ue;super({transform(r,s){e.append(r),s.enqueue(r)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function Hs(n){if(typeof TextEncoder>"u"){n=unescape(encodeURIComponent(n));const t=new Uint8Array(n.length);for(let e=0;e<t.length;e++)t[e]=n.charCodeAt(e);return t}else return new TextEncoder().encode(n)}const V={concat(n,t){if(n.length===0||t.length===0)return n.concat(t);const e=n[n.length-1],r=V.getPartial(e);return r===32?n.concat(t):V._shiftRight(t,r,e|0,n.slice(0,n.length-1))},bitLength(n){const t=n.length;if(t===0)return 0;const e=n[t-1];return(t-1)*32+V.getPartial(e)},clamp(n,t){if(n.length*32<t)return n;n=n.slice(0,Math.ceil(t/32));const e=n.length;return t=t&31,e>0&&t&&(n[e-1]=V.partial(t,n[e-1]&2147483648>>t-1,1)),n},partial(n,t,e){return n===32?t:(e?t|0:t<<32-n)+n*1099511627776},getPartial(n){return Math.round(n/1099511627776)||32},_shiftRight(n,t,e,r){for(r===void 0&&(r=[]);t>=32;t-=32)r.push(e),e=0;if(t===0)return r.concat(n);for(let a=0;a<n.length;a++)r.push(e|n[a]>>>t),e=n[a]<<32-t;const s=n.length?n[n.length-1]:0,i=V.getPartial(s);return r.push(V.partial(t+i&31,t+i>32?e:r.pop(),1)),r}},Me={bytes:{fromBits(n){const e=V.bitLength(n)/8,r=new Uint8Array(e);let s;for(let i=0;i<e;i++)i&3||(s=n[i/4]),r[i]=s>>>24,s<<=8;return r},toBits(n){const t=[];let e,r=0;for(e=0;e<n.length;e++)r=r<<8|n[e],(e&3)===3&&(t.push(r),r=0);return e&3&&t.push(V.partial(8*(e&3),r)),t}}},Nn={};Nn.sha1=class{constructor(n){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],n?(t._h=n._h.slice(0),t._buffer=n._buffer.slice(0),t._length=n._length):t.reset()}reset(){const n=this;return n._h=n._init.slice(0),n._buffer=[],n._length=0,n}update(n){const t=this;typeof n=="string"&&(n=Me.utf8String.toBits(n));const e=t._buffer=V.concat(t._buffer,n),r=t._length,s=t._length=r+V.bitLength(n);if(s>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const i=new Uint32Array(e);let a=0;for(let o=t.blockSize+r-(t.blockSize+r&t.blockSize-1);o<=s;o+=t.blockSize)t._block(i.subarray(16*a,16*(a+1))),a+=1;return e.splice(0,16*a),t}finalize(){const n=this;let t=n._buffer;const e=n._h;t=V.concat(t,[V.partial(1,1)]);for(let r=t.length+2;r&15;r++)t.push(0);for(t.push(Math.floor(n._length/4294967296)),t.push(n._length|0);t.length;)n._block(t.splice(0,16));return n.reset(),e}_f(n,t,e,r){if(n<=19)return t&e|~t&r;if(n<=39)return t^e^r;if(n<=59)return t&e|t&r|e&r;if(n<=79)return t^e^r}_S(n,t){return t<<n|t>>>32-n}_block(n){const t=this,e=t._h,r=Array(80);for(let h=0;h<16;h++)r[h]=n[h];let s=e[0],i=e[1],a=e[2],o=e[3],f=e[4];for(let h=0;h<=79;h++){h>=16&&(r[h]=t._S(1,r[h-3]^r[h-8]^r[h-14]^r[h-16]));const u=t._S(5,s)+t._f(h,i,a,o)+f+r[h]+t._key[Math.floor(h/20)]|0;f=o,o=a,a=t._S(30,i),i=s,s=u}e[0]=e[0]+s|0,e[1]=e[1]+i|0,e[2]=e[2]+a|0,e[3]=e[3]+o|0,e[4]=e[4]+f|0}};const Fn={};Fn.aes=class{constructor(n){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const e=t._tables[0][4],r=t._tables[1],s=n.length;let i,a,o,f=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(t._key=[a=n.slice(0),o=[]],i=s;i<4*s+28;i++){let h=a[i-1];(i%s===0||s===8&&i%s===4)&&(h=e[h>>>24]<<24^e[h>>16&255]<<16^e[h>>8&255]<<8^e[h&255],i%s===0&&(h=h<<8^h>>>24^f<<24,f=f<<1^(f>>7)*283)),a[i]=a[i-s]^h}for(let h=0;i;h++,i--){const u=a[h&3?i:i-4];i<=4||h<4?o[h]=u:o[h]=r[0][e[u>>>24]]^r[1][e[u>>16&255]]^r[2][e[u>>8&255]]^r[3][e[u&255]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],t=this._tables[1],e=n[4],r=t[4],s=[],i=[];let a,o,f,h;for(let u=0;u<256;u++)i[(s[u]=u<<1^(u>>7)*283)^u]=u;for(let u=a=0;!e[u];u^=o||1,a=i[a]||1){let y=a^a<<1^a<<2^a<<3^a<<4;y=y>>8^y&255^99,e[u]=y,r[y]=u,h=s[f=s[o=s[u]]];let b=h*16843009^f*65537^o*257^u*16843008,R=s[y]*257^y*16843008;for(let C=0;C<4;C++)n[C][u]=R=R<<24^R>>>8,t[C][y]=b=b<<24^b>>>8}for(let u=0;u<5;u++)n[u]=n[u].slice(0),t[u]=t[u].slice(0)}_crypt(n,t){if(n.length!==4)throw new Error("invalid aes block size");const e=this._key[t],r=e.length/4-2,s=[0,0,0,0],i=this._tables[t],a=i[0],o=i[1],f=i[2],h=i[3],u=i[4];let y=n[0]^e[0],b=n[t?3:1]^e[1],R=n[2]^e[2],C=n[t?1:3]^e[3],l=4,c,d,p;for(let w=0;w<r;w++)c=a[y>>>24]^o[b>>16&255]^f[R>>8&255]^h[C&255]^e[l],d=a[b>>>24]^o[R>>16&255]^f[C>>8&255]^h[y&255]^e[l+1],p=a[R>>>24]^o[C>>16&255]^f[y>>8&255]^h[b&255]^e[l+2],C=a[C>>>24]^o[y>>16&255]^f[b>>8&255]^h[R&255]^e[l+3],l+=4,y=c,b=d,R=p;for(let w=0;w<4;w++)s[t?3&-w:w]=u[y>>>24]<<24^u[b>>16&255]<<16^u[R>>8&255]<<8^u[C&255]^e[l++],c=y,y=b,b=R,R=C,C=c;return s}};const Bs={getRandomValues(n){const t=new Uint32Array(n.buffer),e=r=>{let s=987654321;const i=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&i,r=18e3*(r&65535)+(r>>16)&i,(((s<<16)+r&i)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let r=0,s;r<n.length;r+=4){const i=e((s||Math.random())*4294967296);s=i()*987654071,t[r/4]=i()*4294967296|0}return n}},Un={};Un.ctrGladman=class{constructor(n,t){this._prf=n,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)===255){let t=n>>16&255,e=n>>8&255,r=n&255;t===255?(t=0,e===255?(e=0,r===255?r=0:++r):++e):++t,n=0,n+=t<<16,n+=e<<8,n+=r}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,t,e){let r;if(!(r=t.length))return[];const s=V.bitLength(t);for(let i=0;i<r;i+=4){this.incCounter(e);const a=n.encrypt(e);t[i]^=a[0],t[i+1]^=a[1],t[i+2]^=a[2],t[i+3]^=a[3]}return V.clamp(t,s)}};const _e={importKey(n){return new _e.hmacSha1(Me.bytes.toBits(n))},pbkdf2(n,t,e,r){if(e=e||1e4,r<0||e<0)throw new Error("invalid params to pbkdf2");const s=(r>>5)+1<<2;let i,a,o,f,h;const u=new ArrayBuffer(s),y=new DataView(u);let b=0;const R=V;for(t=Me.bytes.toBits(t),h=1;b<(s||1);h++){for(i=a=n.encrypt(R.concat(t,[h])),o=1;o<e;o++)for(a=n.encrypt(a),f=0;f<a.length;f++)i[f]^=a[f];for(o=0;b<(s||1)&&o<i.length;o++)y.setInt32(b,i[o]),b+=4}return u.slice(0,r/8)}};_e.hmacSha1=class{constructor(n){const t=this,e=t._hash=Nn.sha1,r=[[],[]];t._baseHash=[new e,new e];const s=t._baseHash[0].blockSize/32;n.length>s&&(n=new e().update(n).finalize());for(let i=0;i<s;i++)r[0][i]=n[i]^909522486,r[1][i]=n[i]^1549556828;t._baseHash[0].update(r[0]),t._baseHash[1].update(r[1]),t._resultHash=new e(t._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){const t=this;t._updated=!0,t._resultHash.update(n)}digest(){const n=this,t=n._resultHash.finalize(),e=new n._hash(n._baseHash[1]).update(t).finalize();return n.reset(),e}encrypt(n){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(n),this.digest(n)}};const js=typeof crypto<"u"&&typeof crypto.getRandomValues=="function",dt="Invalid password",ht="Invalid signature",_t="zipjs-abort-check-password";function Mn(n){return js?crypto.getRandomValues(n):Bs.getRandomValues(n)}const we=16,qs="raw",Wn={name:"PBKDF2"},Gs={name:"HMAC"},Vs="SHA-1",Ys=Object.assign({hash:Gs},Wn),tt=Object.assign({iterations:1e3,hash:{name:Vs}},Wn),Zs=["deriveBits"],Te=[8,12,16],xe=[16,24,32],ie=10,Ks=[0,0,0,0],Hn="undefined",Bn="function",He=typeof crypto!=Hn,Oe=He&&crypto.subtle,jn=He&&typeof Oe!=Hn,J=Me.bytes,Xs=Fn.aes,$s=Un.ctrGladman,Js=_e.hmacSha1;let an=He&&jn&&typeof Oe.importKey==Bn,on=He&&jn&&typeof Oe.deriveBits==Bn;class Qs extends TransformStream{constructor({password:t,signed:e,encryptionStrength:r,checkPasswordOnly:s}){super({start(){Object.assign(this,{ready:new Promise(i=>this.resolveReady=i),password:t,signed:e,strength:r-1,pending:new Uint8Array})},async transform(i,a){const o=this,{password:f,strength:h,resolveReady:u,ready:y}=o;f?(await ei(o,h,f,X(i,0,Te[h]+2)),i=X(i,Te[h]+2),s?a.error(new Error(_t)):u()):await y;const b=new Uint8Array(i.length-ie-(i.length-ie)%we);a.enqueue(qn(o,i,b,0,ie,!0))},async flush(i){const{signed:a,ctr:o,hmac:f,pending:h,ready:u}=this;if(f&&o){await u;const y=X(h,0,h.length-ie),b=X(h,h.length-ie);let R=new Uint8Array;if(y.length){const C=Re(J,y);f.update(C);const l=o.update(C);R=Se(J,l)}if(a){const C=X(Se(J,f.digest()),0,ie);for(let l=0;l<ie;l++)if(C[l]!=b[l])throw new Error(ht)}i.enqueue(R)}}})}}class zs extends TransformStream{constructor({password:t,encryptionStrength:e}){let r;super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:t,strength:e-1,pending:new Uint8Array})},async transform(s,i){const a=this,{password:o,strength:f,resolveReady:h,ready:u}=a;let y=new Uint8Array;o?(y=await ti(a,f,o),h()):await u;const b=new Uint8Array(y.length+s.length-s.length%we);b.set(y,0),i.enqueue(qn(a,s,b,y.length,0))},async flush(s){const{ctr:i,hmac:a,pending:o,ready:f}=this;if(a&&i){await f;let h=new Uint8Array;if(o.length){const u=i.update(Re(J,o));a.update(u),h=Se(J,u)}r.signature=Se(J,a.digest()).slice(0,ie),s.enqueue(pt(h,r.signature))}}}),r=this}}function qn(n,t,e,r,s,i){const{ctr:a,hmac:o,pending:f}=n,h=t.length-s;f.length&&(t=pt(f,t),e=si(e,h-h%we));let u;for(u=0;u<=h-we;u+=we){const y=Re(J,X(t,u,u+we));i&&o.update(y);const b=a.update(y);i||o.update(b),e.set(Se(J,b),u+r)}return n.pending=X(t,u),e}async function ei(n,t,e,r){const s=await Gn(n,t,e,X(r,0,Te[t])),i=X(r,Te[t]);if(s[0]!=i[0]||s[1]!=i[1])throw new Error(dt)}async function ti(n,t,e){const r=Mn(new Uint8Array(Te[t])),s=await Gn(n,t,e,r);return pt(r,s)}async function Gn(n,t,e,r){n.password=null;const s=Hs(e),i=await ni(qs,s,Ys,!1,Zs),a=await ri(Object.assign({salt:r},tt),i,8*(xe[t]*2+2)),o=new Uint8Array(a),f=Re(J,X(o,0,xe[t])),h=Re(J,X(o,xe[t],xe[t]*2)),u=X(o,xe[t]*2);return Object.assign(n,{keys:{key:f,authentication:h,passwordVerification:u},ctr:new $s(new Xs(f),Array.from(Ks)),hmac:new Js(h)}),u}async function ni(n,t,e,r,s){if(an)try{return await Oe.importKey(n,t,e,r,s)}catch{return an=!1,_e.importKey(t)}else return _e.importKey(t)}async function ri(n,t,e){if(on)try{return await Oe.deriveBits(n,t,e)}catch{return on=!1,_e.pbkdf2(t,n.salt,tt.iterations,e)}else return _e.pbkdf2(t,n.salt,tt.iterations,e)}function pt(n,t){let e=n;return n.length+t.length&&(e=new Uint8Array(n.length+t.length),e.set(n,0),e.set(t,n.length)),e}function si(n,t){if(t&&t>n.length){const e=n;n=new Uint8Array(t),n.set(e,0)}return n}function X(n,t,e){return n.subarray(t,e)}function Se(n,t){return n.fromBits(t)}function Re(n,t){return n.toBits(t)}const ge=12;class ii extends TransformStream{constructor({password:t,passwordVerification:e,checkPasswordOnly:r}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),Vn(this,t)},transform(s,i){const a=this;if(a.password){const o=cn(a,s.subarray(0,ge));if(a.password=null,o[ge-1]!=a.passwordVerification)throw new Error(dt);s=s.subarray(ge)}r?i.error(new Error(_t)):i.enqueue(cn(a,s))}})}}class ai extends TransformStream{constructor({password:t,passwordVerification:e}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),Vn(this,t)},transform(r,s){const i=this;let a,o;if(i.password){i.password=null;const f=Mn(new Uint8Array(ge));f[ge-1]=i.passwordVerification,a=new Uint8Array(r.length+f.length),a.set(ln(i,f),0),o=ge}else a=new Uint8Array(r.length),o=0;a.set(ln(i,r),o),s.enqueue(a)}})}}function cn(n,t){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=Yn(n)^t[r],mt(n,e[r]);return e}function ln(n,t){const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=Yn(n)^t[r],mt(n,t[r]);return e}function Vn(n,t){const e=[305419896,591751049,878082192];Object.assign(n,{keys:e,crcKey0:new Ue(e[0]),crcKey2:new Ue(e[2])});for(let r=0;r<t.length;r++)mt(n,t.charCodeAt(r))}function mt(n,t){let[e,r,s]=n.keys;n.crcKey0.append([t]),e=~n.crcKey0.get(),r=fn(Math.imul(fn(r+Zn(e)),134775813)+1),n.crcKey2.append([r>>>24]),s=~n.crcKey2.get(),n.keys=[e,r,s]}function Yn(n){const t=n.keys[2]|2;return Zn(Math.imul(t,t^1)>>>8)}function Zn(n){return n&255}function fn(n){return n&4294967295}const un="deflate-raw";class oi extends TransformStream{constructor(t,{chunkSize:e,CompressionStream:r,CompressionStreamNative:s}){super({});const{compressed:i,encrypted:a,useCompressionStream:o,zipCrypto:f,signed:h,level:u}=t,y=this;let b,R,C=Kn(super.readable);(!a||f)&&h&&(b=new Ln,C=Q(C,b)),i&&(C=$n(C,o,{level:u,chunkSize:e},s,r)),a&&(f?C=Q(C,new ai(t)):(R=new zs(t),C=Q(C,R))),Xn(y,C,()=>{let l;a&&!f&&(l=R.signature),(!a||f)&&h&&(l=new DataView(b.value.buffer).getUint32(0)),y.signature=l})}}class ci extends TransformStream{constructor(t,{chunkSize:e,DecompressionStream:r,DecompressionStreamNative:s}){super({});const{zipCrypto:i,encrypted:a,signed:o,signature:f,compressed:h,useCompressionStream:u}=t;let y,b,R=Kn(super.readable);a&&(i?R=Q(R,new ii(t)):(b=new Qs(t),R=Q(R,b))),h&&(R=$n(R,u,{chunkSize:e},s,r)),(!a||i)&&o&&(y=new Ln,R=Q(R,y)),Xn(this,R,()=>{if((!a||i)&&o){const C=new DataView(y.value.buffer);if(f!=C.getUint32(0,!1))throw new Error(ht)}})}}function Kn(n){return Q(n,new TransformStream({transform(t,e){t&&t.length&&e.enqueue(t)}}))}function Xn(n,t,e){t=Q(t,new TransformStream({flush:e})),Object.defineProperty(n,"readable",{get(){return t}})}function $n(n,t,e,r,s){try{const i=t&&r?r:s;n=Q(n,new i(un,e))}catch(i){if(t)n=Q(n,new s(un,e));else throw i}return n}function Q(n,t){return n.pipeThrough(t)}const li="message",fi="start",ui="pull",dn="data",di="ack",hi="close",_i="deflate",Jn="inflate";class pi extends TransformStream{constructor(t,e){super({});const r=this,{codecType:s}=t;let i;s.startsWith(_i)?i=oi:s.startsWith(Jn)&&(i=ci);let a=0;const o=new i(t,e),f=super.readable,h=new TransformStream({transform(u,y){u&&u.length&&(a+=u.length,y.enqueue(u))},flush(){const{signature:u}=o;Object.assign(r,{signature:u,size:a})}});Object.defineProperty(r,"readable",{get(){return f.pipeThrough(o).pipeThrough(h)}})}}const mi=typeof Worker!=Fe;class Ke{constructor(t,{readable:e,writable:r},{options:s,config:i,streamOptions:a,useWebWorkers:o,transferStreams:f,scripts:h},u){const{signal:y}=a;return Object.assign(t,{busy:!0,readable:e.pipeThrough(new wi(e,a,i),{signal:y}),writable:r,options:Object.assign({},s),scripts:h,transferStreams:f,terminate(){const{worker:b,busy:R}=t;b&&!R&&(b.terminate(),t.interface=null)},onTaskFinished(){t.busy=!1,u(t)}}),(o&&mi?bi:gi)(t,i)}}class wi extends TransformStream{constructor(t,{onstart:e,onprogress:r,size:s,onend:i},{chunkSize:a}){let o=0;super({start(){e&&Xe(e,s)},async transform(f,h){o+=f.length,r&&await Xe(r,o,s),h.enqueue(f)},flush(){t.size=o,i&&Xe(i,o)}},{highWaterMark:1,size:()=>a})}}async function Xe(n,...t){try{await n(...t)}catch{}}function gi(n,t){return{run:()=>yi(n,t)}}function bi(n,{baseURL:t,chunkSize:e}){return n.interface||Object.assign(n,{worker:Ti(n.scripts[0],t,n),interface:{run:()=>xi(n,{chunkSize:e})}}),n.interface}async function yi({options:n,readable:t,writable:e,onTaskFinished:r},s){const i=new pi(n,s);try{await t.pipeThrough(i).pipeTo(e,{preventClose:!0,preventAbort:!0});const{signature:a,size:o}=i;return{signature:a,size:o}}finally{r()}}async function xi(n,t){let e,r;const s=new Promise((b,R)=>{e=b,r=R});Object.assign(n,{reader:null,writer:null,resolveResult:e,rejectResult:r,result:s});const{readable:i,options:a,scripts:o}=n,{writable:f,closed:h}=Ei(n.writable);nt({type:fi,scripts:o.slice(1),options:a,config:t,readable:i,writable:f},n)||Object.assign(n,{reader:i.getReader(),writer:f.getWriter()});const y=await s;try{await f.getWriter().close()}catch{}return await h,y}function Ei(n){const t=n.getWriter();let e;const r=new Promise(i=>e=i);return{writable:new WritableStream({async write(i){await t.ready,await t.write(i)},close(){t.releaseLock(),e()},abort(i){return t.abort(i)}}),closed:r}}let hn=!0,_n=!0;function Ti(n,t,e){const r={type:"module"};let s,i;typeof n==kn&&(n=n());try{s=new URL(n,t)}catch{s=n}if(hn)try{i=new Worker(s)}catch{hn=!1,i=new Worker(s,r)}else i=new Worker(s,r);return i.addEventListener(li,a=>Si(a,e)),i}function nt(n,{worker:t,writer:e,onTaskFinished:r,transferStreams:s}){try{let{value:i,readable:a,writable:o}=n;const f=[];if(i&&(i.byteLength<i.buffer.byteLength?n.value=i.buffer.slice(0,i.byteLength):n.value=i.buffer,f.push(n.value)),s&&_n?(a&&f.push(a),o&&f.push(o)):n.readable=n.writable=null,f.length)try{return t.postMessage(n,f),!0}catch{_n=!1,n.readable=n.writable=null,t.postMessage(n)}else t.postMessage(n)}catch(i){throw e&&e.releaseLock(),r(),i}}async function Si({data:n},t){const{type:e,value:r,messageId:s,result:i,error:a}=n,{reader:o,writer:f,resolveResult:h,rejectResult:u,onTaskFinished:y}=t;try{if(a){const{message:R,stack:C,code:l,name:c}=a,d=new Error(R);Object.assign(d,{stack:C,code:l,name:c}),b(d)}else{if(e==ui){const{value:R,done:C}=await o.read();nt({type:dn,value:R,done:C,messageId:s},t)}e==dn&&(await f.ready,await f.write(new Uint8Array(r)),nt({type:di,messageId:s},t)),e==hi&&b(null,i)}}catch(R){b(R)}function b(R,C){R?u(R):h(C),f&&f.releaseLock(),y()}}let ae=[];const $e=[];let pn=0;async function Ri(n,t){const{options:e,config:r}=t,{transferStreams:s,useWebWorkers:i,useCompressionStream:a,codecType:o,compressed:f,signed:h,encrypted:u}=e,{workerScripts:y,maxWorkers:b,terminateWorkerTimeout:R}=r;t.transferStreams=s||s===$;const C=!f&&!h&&!u&&!t.transferStreams;t.useWebWorkers=!C&&(i||i===$&&r.useWebWorkers),t.scripts=t.useWebWorkers&&y?y[o]:[],e.useCompressionStream=a||a===$&&r.useCompressionStream;let l;const c=ae.find(p=>!p.busy);if(c)rt(c),l=new Ke(c,n,t,d);else if(ae.length<b){const p={indexWorker:pn};pn++,ae.push(p),l=new Ke(p,n,t,d)}else l=await new Promise(p=>$e.push({resolve:p,stream:n,workerOptions:t}));return l.run();function d(p){if($e.length){const[{resolve:w,stream:g,workerOptions:T}]=$e.splice(0,1);w(new Ke(p,g,T,d))}else p.worker?(rt(p),Number.isFinite(R)&&R>=0&&(p.terminateTimeout=setTimeout(()=>{ae=ae.filter(w=>w!=p),p.terminate()},R))):ae=ae.filter(w=>w!=p)}}function rt(n){const{terminateTimeout:t}=n;t&&(clearTimeout(t),n.terminateTimeout=null)}function Ai(){ae.forEach(n=>{rt(n),n.terminate()})}const Qn="HTTP error ",ke="HTTP Range not supported",zn="Writer iterator completed too soon",Ci="text/plain",Oi="Content-Length",ki="Content-Range",Di="Accept-Ranges",Ii="Range",Pi="Content-Type",vi="HEAD",wt="GET",er="bytes",Li=64*1024,gt="writable";class Be{constructor(){this.size=0}init(){this.initialized=!0}}class fe extends Be{get readable(){const t=this,{chunkSize:e=Li}=t,r=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:i=0,size:a,diskNumberStart:o}=r,{chunkOffset:f}=this;s.enqueue(await G(t,i+f,Math.min(e,a-f),o)),f+e>a?s.close():this.chunkOffset+=e}});return r}}class bt extends Be{constructor(){super();const t=this,e=new WritableStream({write(r){return t.writeUint8Array(r)}});Object.defineProperty(t,gt,{get(){return e}})}writeUint8Array(){}}class Ni extends fe{constructor(t){super();let e=t.length;for(;t.charAt(e-1)=="=";)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,dataStart:r,size:Math.floor((e-r)*.75)})}readUint8Array(t,e){const{dataStart:r,dataURI:s}=this,i=new Uint8Array(e),a=Math.floor(t/3)*4,o=atob(s.substring(a+r,Math.ceil((t+e)/3)*4+r)),f=t-Math.floor(a/4)*3;for(let h=f;h<f+e;h++)i[h-f]=o.charCodeAt(h);return i}}class Fi extends bt{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let r=0,s=e.pending;const i=e.pending.length;for(e.pending="",r=0;r<Math.floor((i+t.length)/3)*3-i;r++)s+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.pending+=String.fromCharCode(t[r]);s.length>2?e.data+=btoa(s):e.pending=s}getData(){return this.data+btoa(this.pending)}}class yt extends fe{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,e){const r=this,s=t+e;let a=await(t||s<r.size?r.blob.slice(t,s):r.blob).arrayBuffer();return a.byteLength>e&&(a=a.slice(t,s)),new Uint8Array(a)}}class tr extends Be{constructor(t){super();const e=this,r=new TransformStream,s=[];t&&s.push([Pi,t]),Object.defineProperty(e,gt,{get(){return r.writable}}),e.blob=new Response(r.readable,{headers:s}).blob()}getData(){return this.blob}}class Ui extends yt{constructor(t){super(new Blob([t],{type:Ci}))}}class Mi extends tr{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){const{encoding:t,utf8:e}=this,r=await super.getData();if(r.text&&e)return r.text();{const s=new FileReader;return new Promise((i,a)=>{Object.assign(s,{onload:({target:o})=>i(o.result),onerror:()=>a(s.error)}),s.readAsText(r,t)})}}}class Wi extends fe{constructor(t,e){super(),nr(this,t,e)}async init(){await rr(this,st,mn),super.init()}readUint8Array(t,e){return sr(this,t,e,st,mn)}}class Hi extends fe{constructor(t,e){super(),nr(this,t,e)}async init(){await rr(this,it,wn),super.init()}readUint8Array(t,e){return sr(this,t,e,it,wn)}}function nr(n,t,e){const{preventHeadRequest:r,useRangeHeader:s,forceRangeRequests:i}=e;e=Object.assign({},e),delete e.preventHeadRequest,delete e.useRangeHeader,delete e.forceRangeRequests,delete e.useXHR,Object.assign(n,{url:t,options:e,preventHeadRequest:r,useRangeHeader:s,forceRangeRequests:i})}async function rr(n,t,e){const{url:r,useRangeHeader:s,forceRangeRequests:i}=n;if(Gi(r)&&(s||i)){const{headers:a}=await t(wt,n,ir(n));if(!i&&a.get(Di)!=er)throw new Error(ke);{let o;const f=a.get(ki);if(f){const h=f.trim().split(/\s*\/\s*/);if(h.length){const u=h[1];u&&u!="*"&&(o=Number(u))}}o===$?await gn(n,t,e):n.size=o}}else await gn(n,t,e)}async function sr(n,t,e,r,s){const{useRangeHeader:i,forceRangeRequests:a,options:o}=n;if(i||a){const f=await r(wt,n,ir(n,t,e));if(f.status!=206)throw new Error(ke);return new Uint8Array(await f.arrayBuffer())}else{const{data:f}=n;return f||await s(n,o),new Uint8Array(n.data.subarray(t,t+e))}}function ir(n,t=0,e=1){return Object.assign({},xt(n),{[Ii]:er+"="+t+"-"+(t+e-1)})}function xt({options:n}){const{headers:t}=n;if(t)return Symbol.iterator in t?Object.fromEntries(t):t}async function mn(n){await ar(n,st)}async function wn(n){await ar(n,it)}async function ar(n,t){const e=await t(wt,n,xt(n));n.data=new Uint8Array(await e.arrayBuffer()),n.size||(n.size=n.data.length)}async function gn(n,t,e){if(n.preventHeadRequest)await e(n,n.options);else{const s=(await t(vi,n,xt(n))).headers.get(Oi);s?n.size=Number(s):await e(n,n.options)}}async function st(n,{options:t,url:e},r){const s=await fetch(e,Object.assign({},t,{method:n,headers:r}));if(s.status<400)return s;throw s.status==416?new Error(ke):new Error(Qn+(s.statusText||s.status))}function it(n,{url:t},e){return new Promise((r,s)=>{const i=new XMLHttpRequest;if(i.addEventListener("load",()=>{if(i.status<400){const a=[];i.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(o=>{const f=o.trim().split(/\s*:\s*/);f[0]=f[0].trim().replace(/^[a-z]|-[a-z]/g,h=>h.toUpperCase()),a.push(f)}),r({status:i.status,arrayBuffer:()=>i.response,headers:new Map(a)})}else s(i.status==416?new Error(ke):new Error(Qn+(i.statusText||i.status)))},!1),i.addEventListener("error",a=>s(a.detail?a.detail.error:new Error("Network error")),!1),i.open(n,t),e)for(const a of Object.entries(e))i.setRequestHeader(a[0],a[1]);i.responseType="arraybuffer",i.send()})}class or extends fe{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR?new Hi(t,e):new Wi(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Bi extends or{constructor(t,e={}){e.useRangeHeader=!0,super(t,e)}}class ji extends fe{constructor(t){super(),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class qi extends bt{init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t)}),super.init()}writeUint8Array(t){const e=this;if(e.offset+t.length>e.array.length){const r=e.array;e.array=new Uint8Array(r.length+t.length),e.array.set(r)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.array}}class Et extends fe{constructor(t){super(),this.readers=t}async init(){const t=this,{readers:e}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(e.map(async(r,s)=>{await r.init(),s!=e.length-1&&(t.lastDiskOffset+=r.size),t.size+=r.size})),super.init()}async readUint8Array(t,e,r=0){const s=this,{readers:i}=this;let a,o=r;o==-1&&(o=i.length-1);let f=t;for(;f>=i[o].size;)f-=i[o].size,o++;const h=i[o],u=h.size;if(f+e<=u)a=await G(h,f,e);else{const y=u-f;a=new Uint8Array(e),a.set(await G(h,f,y)),a.set(await s.readUint8Array(t+y,e-y,r),y)}return s.lastDiskNumber=Math.max(o,s.lastDiskNumber),a}}class We extends Be{constructor(t,e=4294967295){super();const r=this;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});let s,i,a;const o=new WritableStream({async write(u){const{availableSize:y}=r;if(a)u.length>=y?(await f(u.slice(0,y)),await h(),r.diskOffset+=s.size,r.diskNumber++,a=null,await this.write(u.slice(y))):await f(u);else{const{value:b,done:R}=await t.next();if(R&&!b)throw new Error(zn);s=b,s.size=0,s.maxSize&&(r.maxSize=s.maxSize),r.availableSize=r.maxSize,await Ae(s),i=b.writable,a=i.getWriter(),await this.write(u)}},async close(){await a.ready,await h()}});Object.defineProperty(r,gt,{get(){return o}});async function f(u){const y=u.length;y&&(await a.ready,await a.write(u),s.size+=y,r.size+=y,r.availableSize-=y)}async function h(){i.size=s.size,await a.close()}}}function Gi(n){const{baseURL:t}=In(),{protocol:e}=new URL(n,t);return e=="http:"||e=="https:"}async function Ae(n,t){n.init&&!n.initialized&&await n.init(t)}function cr(n){return Array.isArray(n)&&(n=new Et(n)),n instanceof ReadableStream&&(n={readable:n}),n}function lr(n){n.writable===$&&typeof n.next==kn&&(n=new We(n)),n instanceof WritableStream&&(n={writable:n});const{writable:t}=n;return t.size===$&&(t.size=0),n instanceof We||Object.assign(n,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),n}function G(n,t,e,r){return n.readUint8Array(t,e,r)}const Vi=Et,Yi=We,fr="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Zi=fr.length==256;function Ki(n){if(Zi){let t="";for(let e=0;e<n.length;e++)t+=fr[n[e]];return t}else return new TextDecoder().decode(n)}function at(n,t){return t&&t.trim().toLowerCase()=="cp437"?Ki(n):new TextDecoder(t).decode(n)}const ur="filename",dr="rawFilename",hr="comment",_r="rawComment",pr="uncompressedSize",mr="compressedSize",wr="offset",ot="diskNumberStart",ct="lastModDate",lt="rawLastModDate",gr="lastAccessDate",Xi="rawLastAccessDate",br="creationDate",$i="rawCreationDate",Ji="internalFileAttribute",Qi="externalFileAttribute",zi="msDosCompatible",ea="zip64",ta=[ur,dr,mr,pr,ct,lt,hr,_r,gr,br,wr,ot,ot,Ji,Qi,zi,ea,"directory","bitFlag","encrypted","signature","filenameUTF8","commentUTF8","compressionMethod","version","versionMadeBy","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class bn{constructor(t){ta.forEach(e=>this[e]=t[e])}}const Le="File format is not recognized",yr="End of central directory not found",xr="End of Zip64 central directory not found",Er="End of Zip64 central directory locator not found",Tr="Central directory header not found",Sr="Local file header not found",Rr="Zip64 extra field not found",Ar="File contains encrypted entry",Cr="Encryption method not supported",ft="Compression method not supported",ut="Split zip file",yn="utf-8",xn="cp437",na=[[pr,he],[mr,he],[wr,he],[ot,oe]],ra={[oe]:{getValue:B,bytes:4},[he]:{getValue:Ne,bytes:8}};class sa{constructor(t,e={}){Object.assign(this,{reader:cr(t),options:e,config:In()})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;const{config:s}=e;if(await Ae(r),(r.size===$||!r.readUint8Array)&&(r=new yt(await new Response(r.readable).blob()),await Ae(r)),r.size<me)throw new Error(Le);r.chunkSize=Ms(s);const i=await fa(r,Ss,r.size,me,oe*16);if(!i){const x=await G(r,0,4),m=q(x);throw B(m)==Ts?new Error(ut):new Error(yr)}const a=q(i);let o=B(a,12),f=B(a,16);const h=i.offset,u=j(a,20),y=h+me+u;let b=j(a,4);const R=r.lastDiskNumber||0;let C=j(a,6),l=j(a,8),c=0,d=0;if(f==he||o==he||l==oe||C==oe){const x=await G(r,i.offset-Ye,Ye),m=q(x);if(B(m,0)!=Rs)throw new Error(xr);f=Ne(m,8);let k=await G(r,f,Ze,-1),O=q(k);const v=i.offset-Ye-Ze;if(B(O,0)!=zt&&f!=v){const D=f;f=v,c=f-D,k=await G(r,f,Ze,-1),O=q(k)}if(B(O,0)!=zt)throw new Error(Er);b==oe&&(b=B(O,16)),C==oe&&(C=B(O,20)),l==oe&&(l=Ne(O,32)),o==he&&(o=Ne(O,40)),f-=o}if(f>=r.size&&(c=r.size-f-o-me,f=r.size-o-me),R!=b)throw new Error(ut);if(f<0)throw new Error(Le);let p=0,w=await G(r,f,o,C),g=q(w);if(o){const x=i.offset-o;if(B(g,p)!=Qt&&f!=x){const m=f;f=x,c+=f-m,w=await G(r,f,o,C),g=q(w)}}const T=i.offset-f-(r.lastDiskOffset||0);if(o!=T&&T>=0&&(o=T,w=await G(r,f,o,C),g=q(w)),f<0||f>=r.size)throw new Error(Le);const _=K(e,t,"filenameEncoding"),S=K(e,t,"commentEncoding");for(let x=0;x<l;x++){const m=new ia(r,s,e.options);if(B(g,p)!=Qt)throw new Error(Tr);Or(m,g,p+6);const k=!!m.bitFlag.languageEncodingFlag,O=p+46,v=O+m.filenameLength,D=v+m.extraFieldLength,I=j(g,p+4),U=(I&0)==0,L=w.subarray(O,v),te=j(g,p+32),P=D+te,ue=w.subarray(D,P),M=k,W=k,Tt=U&&(be(g,p+38)&rn)==rn,St=B(g,p+42)+c;Object.assign(m,{versionMadeBy:I,msDosCompatible:U,compressedSize:0,uncompressedSize:0,commentLength:te,directory:Tt,offset:St,diskNumberStart:j(g,p+34),internalFileAttribute:j(g,p+36),externalFileAttribute:B(g,p+38),rawFilename:L,filenameUTF8:M,commentUTF8:W,rawExtraField:w.subarray(v,D)});const[Rt,Ir]=await Promise.all([at(L,M?yn:_||xn),at(ue,W?yn:S||xn)]);Object.assign(m,{rawComment:ue,filename:Rt,comment:Ir,directory:Tt||Rt.endsWith(Ns)}),d=Math.max(St,d),await kr(m,m,g,p+6);const je=new bn(m);je.getData=(Ct,Pr)=>m.getData(Ct,je,Pr),p=P;const{onprogress:At}=t;if(At)try{await At(x+1,l,new bn(m))}catch{}yield je}const E=K(e,t,"extractPrependedData"),A=K(e,t,"extractAppendedData");return E&&(e.prependedData=d>0?await G(r,0,d):new Uint8Array),e.comment=u?await G(r,h+me,u):new Uint8Array,A&&(e.appendedData=y<r.size?await G(r,y,r.size-y):new Uint8Array),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class ia{constructor(t,e,r){Object.assign(this,{reader:t,config:e,options:r})}async getData(t,e,r={}){const s=this,{reader:i,offset:a,diskNumberStart:o,extraFieldAES:f,compressionMethod:h,config:u,bitFlag:y,signature:b,rawLastModDate:R,uncompressedSize:C,compressedSize:l}=s,c=e.localDirectory={},d=await G(i,a,30,o),p=q(d);let w=K(s,r,"password");if(w=w&&w.length&&w,f&&f.originalCompressionMethod!=xs)throw new Error(ft);if(h!=ys&&h!=bs)throw new Error(ft);if(B(p,0)!=Es)throw new Error(Sr);Or(c,p,4),c.rawExtraField=c.extraFieldLength?await G(i,a+30+c.filenameLength,c.extraFieldLength,o):new Uint8Array,await kr(s,c,p,4,!0),Object.assign(e,{lastAccessDate:c.lastAccessDate,creationDate:c.creationDate});const g=s.encrypted&&c.encrypted,T=g&&!f;if(g){if(!T&&f.strength===$)throw new Error(Cr);if(!w)throw new Error(Ar)}const _=a+30+c.filenameLength+c.extraFieldLength,S=l,E=i.readable;Object.assign(E,{diskNumberStart:o,offset:_,size:S});const A=K(s,r,"signal"),x=K(s,r,"checkPasswordOnly");x&&(t=new WritableStream),t=lr(t),await Ae(t,C);const{writable:m}=t,{onstart:k,onprogress:O,onend:v}=r,D={options:{codecType:Jn,password:w,zipCrypto:T,encryptionStrength:f&&f.strength,signed:K(s,r,"checkSignature"),passwordVerification:T&&(y.dataDescriptor?R>>>8&255:b>>>24&255),signature:b,compressed:h!=0,encrypted:g,useWebWorkers:K(s,r,"useWebWorkers"),useCompressionStream:K(s,r,"useCompressionStream"),transferStreams:K(s,r,"transferStreams"),checkPasswordOnly:x},config:u,streamOptions:{signal:A,size:S,onstart:k,onprogress:O,onend:v}};let I=0;try{({outputSize:I}=await Ri({readable:E,writable:m},D))}catch(U){if(!x||U.message!=_t)throw U}finally{const U=K(s,r,"preventClose");m.size+=I,!U&&!m.locked&&await m.getWriter().close()}return x?void 0:t.getData?t.getData():m}}function Or(n,t,e){const r=n.rawBitFlag=j(t,e+2),s=(r&en)==en,i=B(t,e+6);Object.assign(n,{encrypted:s,version:j(t,e),bitFlag:{level:(r&Ls)>>1,dataDescriptor:(r&tn)==tn,languageEncodingFlag:(r&nn)==nn},rawLastModDate:i,lastModDate:ua(i),filenameLength:j(t,e+22),extraFieldLength:j(t,e+24)})}async function kr(n,t,e,r,s){const{rawExtraField:i}=t,a=t.extraField=new Map,o=q(new Uint8Array(i));let f=0;try{for(;f<i.length;){const d=j(o,f),p=j(o,f+2);a.set(d,{type:d,data:i.slice(f+4,f+4+p)}),f+=4+p}}catch{}const h=j(e,r+4);Object.assign(t,{signature:B(e,r+10),uncompressedSize:B(e,r+18),compressedSize:B(e,r+14)});const u=a.get(As);u&&(aa(u,t),t.extraFieldZip64=u);const y=a.get(Is);y&&(await En(y,ur,dr,t,n),t.extraFieldUnicodePath=y);const b=a.get(Ps);b&&(await En(b,hr,_r,t,n),t.extraFieldUnicodeComment=b);const R=a.get(Cs);R?(oa(R,t,h),t.extraFieldAES=R):t.compressionMethod=h;const C=a.get(Os);C&&(ca(C,t),t.extraFieldNTFS=C);const l=a.get(Ds);l&&(la(l,t,s),t.extraFieldExtendedTimestamp=l);const c=a.get(vs);c&&(t.extraFieldUSDZ=c)}function aa(n,t){t.zip64=!0;const e=q(n.data),r=na.filter(([s,i])=>t[s]==i);for(let s=0,i=0;s<r.length;s++){const[a,o]=r[s];if(t[a]==o){const f=ra[o];t[a]=n[a]=f.getValue(e,i),i+=f.bytes}else if(n[a])throw new Error(Rr)}}async function En(n,t,e,r,s){const i=q(n.data),a=new Ue;a.append(s[e]);const o=q(new Uint8Array(4));o.setUint32(0,a.get(),!0);const f=B(i,1);Object.assign(n,{version:be(i,0),[t]:at(n.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&f==B(o,0)}),n.valid&&(r[t]=n[t],r[t+"UTF8"]=!0)}function oa(n,t,e){const r=q(n.data),s=be(r,4);Object.assign(n,{vendorVersion:be(r,0),vendorId:be(r,2),strength:s,originalCompressionMethod:e,compressionMethod:j(r,5)}),t.compressionMethod=n.compressionMethod}function ca(n,t){const e=q(n.data);let r=4,s;try{for(;r<n.data.length&&!s;){const i=j(e,r),a=j(e,r+2);i==ks&&(s=n.data.slice(r+4,r+4+a)),r+=4+a}}catch{}try{if(s&&s.length==24){const i=q(s),a=i.getBigUint64(0,!0),o=i.getBigUint64(8,!0),f=i.getBigUint64(16,!0);Object.assign(n,{rawLastModDate:a,rawLastAccessDate:o,rawCreationDate:f});const h=Je(a),u=Je(o),y=Je(f),b={lastModDate:h,lastAccessDate:u,creationDate:y};Object.assign(n,b),Object.assign(t,b)}}catch{}}function la(n,t,e){const r=q(n.data),s=be(r,0),i=[],a=[];e?((s&1)==1&&(i.push(ct),a.push(lt)),(s&2)==2&&(i.push(gr),a.push(Xi)),(s&4)==4&&(i.push(br),a.push($i))):n.data.length>=5&&(i.push(ct),a.push(lt));let o=1;i.forEach((f,h)=>{if(n.data.length>=o+4){const u=B(r,o);t[f]=n[f]=new Date(u*1e3);const y=a[h];n[y]=u}o+=4})}async function fa(n,t,e,r,s){const i=new Uint8Array(4),a=q(i);da(a,0,t);const o=r+s;return await f(r)||await f(Math.min(o,e));async function f(h){const u=e-h,y=await G(n,u,h);for(let b=y.length-r;b>=0;b--)if(y[b]==i[0]&&y[b+1]==i[1]&&y[b+2]==i[2]&&y[b+3]==i[3])return{offset:u+b,buffer:y.slice(b,b+r).buffer}}}function K(n,t,e){return t[e]===$?n.options[e]:t[e]}function ua(n){const t=(n&4294901760)>>16,e=n&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(e&63488)>>11,(e&2016)>>5,(e&31)*2,0)}catch{}}function Je(n){return new Date(Number(n/BigInt(1e4)-BigInt(116444736e5)))}function be(n,t){return n.getUint8(t)}function j(n,t){return n.getUint16(t,!0)}function B(n,t){return n.getUint32(t,!0)}function Ne(n,t){return Number(n.getBigUint64(t,!0))}function da(n,t,e){n.setUint32(t,e,!0)}function q(n){return new DataView(n.buffer)}Pn({Inflate:gs});const ha=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:yt,BlobWriter:tr,Data64URIReader:Ni,Data64URIWriter:Fi,ERR_BAD_FORMAT:Le,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Tr,ERR_ENCRYPTED:Ar,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Er,ERR_EOCDR_NOT_FOUND:yr,ERR_EOCDR_ZIP64_NOT_FOUND:xr,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Rr,ERR_HTTP_RANGE:ke,ERR_INVALID_PASSWORD:dt,ERR_INVALID_SIGNATURE:ht,ERR_ITERATOR_COMPLETED_TOO_SOON:zn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Sr,ERR_SPLIT_ZIP_FILE:ut,ERR_UNSUPPORTED_COMPRESSION:ft,ERR_UNSUPPORTED_ENCRYPTION:Cr,HttpRangeReader:Bi,HttpReader:or,Reader:fe,SplitDataReader:Et,SplitDataWriter:We,SplitZipReader:Vi,SplitZipWriter:Yi,TextReader:Ui,TextWriter:Mi,Uint8ArrayReader:ji,Uint8ArrayWriter:qi,Writer:bt,ZipReader:sa,configure:Pn,getMimeType:Ws,initReader:cr,initStream:Ae,initWriter:lr,readUint8Array:G,terminateWorkers:Ai},Symbol.toStringTag,{value:"Module"})),Ee=ha;class _a{constructor(t,e,r){N(this,"_zipReader");N(this,"_entriesPromise");N(this,"_traceURL");this._traceURL=t,Ee.configure({baseURL:self.location.href}),this._zipReader=new Ee.ZipReader(new Ee.HttpReader(ma(t,e),{mode:"cors",preventHeadRequest:!0}),{useWebWorkers:!1}),this._entriesPromise=this._zipReader.getEntries({onprogress:r}).then(s=>{const i=new Map;for(const a of s)i.set(a.filename,a);return i})}isLive(){return!1}traceURL(){return this._traceURL}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){var i;const r=(await this._entriesPromise).get(t);if(!r)return;const s=new Ee.TextWriter;return await((i=r.getData)==null?void 0:i.call(r,s)),s.getData()}async readBlob(t){const r=(await this._entriesPromise).get(t);if(!r)return;const s=new Ee.BlobWriter;return await r.getData(s),s.getData()}}class pa{constructor(t,e){N(this,"_entriesPromise");N(this,"_path");N(this,"_server");this._path=t,this._server=e,this._entriesPromise=e.readFile(t).then(async r=>{if(!r)throw new Error("File not found");const s=await r.json(),i=new Map;for(const a of s.entries)i.set(a.name,a.path);return i})}isLive(){return!0}traceURL(){return this._path}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){const e=await this._readEntry(t);return e==null?void 0:e.text()}async readBlob(t){const e=await this._readEntry(t);return(e==null?void 0:e.status)===200?await(e==null?void 0:e.blob()):void 0}async _readEntry(t){const r=(await this._entriesPromise).get(t);if(r)return this._server.readFile(r)}}function ma(n,t){let e=n.startsWith("http")||n.startsWith("blob")?n:t.getFileURL(n).toString();return e.startsWith("https://www.dropbox.com/")&&(e="https://dl.dropboxusercontent.com/"+e.substring(24)),e}class wa{constructor(t){this.baseUrl=t}getFileURL(t){const e=new URL("trace/file",this.baseUrl);return e.searchParams.set("path",t),e}async readFile(t){const e=await fetch(this.getFileURL(t));if(e.status!==404)return e}}self.addEventListener("install",function(n){self.skipWaiting()});self.addEventListener("activate",function(n){n.waitUntil(self.clients.claim())});const ga=new URL(self.registration.scope).pathname,le=new Map,Ce=new Map;async function ba(n,t,e,r,s){var h;await Dr();const i=(e==null?void 0:e.id)??"";let a=Ce.get(i);if(!a){const u=new URL((e==null?void 0:e.url)??self.registration.scope),y=new URL(u.searchParams.get("server")??"../",u);a={limit:r,traceUrls:new Set,traceViewerServer:new wa(y)},Ce.set(i,a)}a.traceUrls.add(n);const o=new Jr;try{const[u,y]=Nr(s,[.5,.4,.1]),b=n.endsWith("json")?new pa(n,a.traceViewerServer):new _a(n,a.traceViewerServer,u);await o.load(b,y)}catch(u){throw console.error(u),(h=u==null?void 0:u.message)!=null&&h.includes("Cannot find .trace file")&&await o.hasEntry("index.html")?new Error("Could not load trace. Did you upload a Playwright HTML report instead? Make sure to extract the archive first and then double-click the index.html file or put it on a web server."):u instanceof An?new Error(`Could not load trace from ${t||n}. ${u.message}`):t?new Error(`Could not load trace from ${t}. Make sure to upload a valid Playwright trace.`):new Error(`Could not load trace from ${n}. Make sure a valid Playwright Trace is accessible over this url.`)}const f=new Vr(o.storage(),u=>o.resourceForSha1(u));return le.set(n,{traceModel:o,snapshotServer:f}),o}async function ya(n){var f;if(n.request.url.startsWith("chrome-extension://"))return fetch(n.request);const t=n.request,e=await self.clients.get(n.clientId),r=self.registration.scope.startsWith("https://");if(t.url.startsWith(self.registration.scope)){const h=new URL(ze(t.url)),u=h.pathname.substring(ga.length-1);if(u==="/ping")return await Dr(),new Response(null,{status:200});const y=h.searchParams.get("trace");if(u==="/contexts")try{const b=h.searchParams.has("limit")?+h.searchParams.get("limit"):void 0,R=await ba(y,h.searchParams.get("traceFileName"),e,b,(C,l)=>{e.postMessage({method:"progress",params:{done:C,total:l}})});return new Response(JSON.stringify(R.contextEntries),{status:200,headers:{"Content-Type":"application/json"}})}catch(b){return new Response(JSON.stringify({error:b==null?void 0:b.message}),{status:500,headers:{"Content-Type":"application/json"}})}if(u.startsWith("/snapshotInfo/")){const{snapshotServer:b}=le.get(y)||{};return b?b.serveSnapshotInfo(u,h.searchParams):new Response(null,{status:404})}if(u.startsWith("/snapshot/")){const{snapshotServer:b}=le.get(y)||{};if(!b)return new Response(null,{status:404});const R=b.serveSnapshot(u,h.searchParams,h.href);return r&&R.headers.set("Content-Security-Policy","upgrade-insecure-requests"),R}if(u.startsWith("/closest-screenshot/")){const{snapshotServer:b}=le.get(y)||{};return b?b.serveClosestScreenshot(u,h.searchParams):new Response(null,{status:404})}if(u.startsWith("/sha1/")){const b=u.slice(6);for(const R of le.values()){const C=await R.traceModel.resourceForSha1(b);if(C)return new Response(C,{status:200,headers:xa(h.searchParams)})}return new Response(null,{status:404})}if(u.startsWith("/file/")){const b=h.searchParams.get("path"),R=(f=Ce.get(n.clientId??""))==null?void 0:f.traceViewerServer;if(!R)throw new Error("client is not initialized");const C=await R.readFile(b);return C||new Response(null,{status:404})}return fetch(n.request)}const s=ze(e.url),i=new URL(s).searchParams.get("trace"),{snapshotServer:a}=le.get(i)||{};if(!a)return new Response(null,{status:404});const o=[t.url];return r&&t.url.startsWith("https://")&&o.push(t.url.replace(/^https/,"http")),a.serveResource(o,t.method,s)}function xa(n){const t=n.get("dn"),e=n.get("dct");if(!t)return;const r=new Headers;return r.set("Content-Disposition",`attachment; filename="attachment"; filename*=UTF-8''${encodeURIComponent(t)}`),e&&r.set("Content-Type",e),r}async function Dr(){const n=await self.clients.matchAll(),t=new Set;for(const[e,r]of Ce){if(!n.find(s=>s.id===e)){Ce.delete(e);continue}if(r.limit!==void 0){const s=[...r.traceUrls];r.traceUrls=new Set(s.slice(s.length-r.limit))}r.traceUrls.forEach(s=>t.add(s))}for(const e of le.keys())t.has(e)||le.delete(e)}self.addEventListener("fetch",function(n){n.respondWith(ya(n))});
@@ -0,0 +1,5 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-BeNbaIVa.js","./xtermModule.DSXBckUd.css"])))=>i.map(i=>d[i]);
2
+ import{u as Lt,r as K,e as Mt,_ as Dt,f as Ft,g as Ot,j as o,R as u,E as Ut,s as vt,h as at,m as Wt,i as Y,T as D,t as At,k as zt,b as Vt,M as Kt,l as $t,a as Ht,W as qt,S as Yt,D as Qt,c as Xt,d as Jt}from"./assets/defaultSettingsView-CxUo6zd3.js";var Zt={};class ot{constructor(t,e={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new Q("","root"),this._options=e,this._reporter=t}reset(){this._rootSuite._entries=[],this._tests.clear()}dispatch(t){const{method:e,params:s}=t;if(e==="onConfigure"){this._onConfigure(s.config);return}if(e==="onProject"){this._onProject(s.project);return}if(e==="onBegin"){this._onBegin();return}if(e==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(e==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(e==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(e==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(e==="onError"){this._onError(s.error);return}if(e==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(e==="onEnd")return this._onEnd(s.result);if(e==="onExit")return this._onExit()}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===t.name):void 0;e||(e=new Q(t.name,"project"),this._rootSuite._addSuite(e)),e._project=this._parseProject(t);for(const s of t.suites)this._mergeSuiteInto(s,e)}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var c,a;const s=this._tests.get(t);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const r=s._createTestResult(e.id);r.retry=e.retry,r.workerIndex=e.workerIndex,r.parallelIndex=e.parallelIndex,r.setStartTimeNumber(e.startTime),(a=(c=this._reporter).onTestBegin)==null||a.call(c,s,r)}_onTestEnd(t,e){var c,a,g;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus,s.annotations=t.annotations;const r=s.results.find(l=>l._id===e.id);r.duration=e.duration,r.status=e.status,r.errors=e.errors,r.error=(c=r.errors)==null?void 0:c[0],r.attachments=this._parseAttachments(e.attachments),(g=(a=this._reporter).onTestEnd)==null||g.call(a,s,r),r._stepMap=new Map}_onStepBegin(t,e,s){var _,n;const r=this._tests.get(t),c=r.results.find(h=>h._id===e),a=s.parentStepId?c._stepMap.get(s.parentStepId):void 0,g=this._absoluteLocation(s.location),l=new te(s,a,g,c);a?a.steps.push(l):c.steps.push(l),c._stepMap.set(s.id,l),(n=(_=this._reporter).onStepBegin)==null||n.call(_,r,c,l)}_onStepEnd(t,e,s){var g,l;const r=this._tests.get(t),c=r.results.find(_=>_._id===e),a=c._stepMap.get(s.id);a._endPayload=s,a.duration=s.duration,a.error=s.error,(l=(g=this._reporter).onStepEnd)==null||l.call(g,r,c,a)}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,r,c){var _,n,h,v;const a=c?globalThis.Buffer?Buffer.from(r,"base64"):atob(r):r,g=e?this._tests.get(e):void 0,l=g&&s?g.results.find(d=>d._id===s):void 0;t==="stdout"?(l==null||l.stdout.push(a),(n=(_=this._reporter).onStdOut)==null||n.call(_,a,g,l)):(l==null||l.stderr.push(a),(v=(h=this._reporter).onStdErr)==null||v.call(h,a,g,l))}async _onEnd(t){var e,s;await((s=(e=this._reporter).onEnd)==null?void 0:s.call(e,{status:t.status,startTime:new Date(t.startTime),duration:t.duration}))}_onExit(){var t,e;return(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...se,...t};return this._options.configOverrides&&(e.configFile=this._options.configOverrides.configFile,e.reportSlowTests=this._options.configOverrides.reportSlowTests,e.quiet=this._options.configOverrides.quiet,e.reporter=[...this._options.configOverrides.reporter]),e}_parseProject(t){return{metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:st(t.testIgnore),testMatch:st(t.testMatch),timeout:t.timeout,grep:st(t.grep),grepInvert:st(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:{}}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuiteInto(t,e){let s=e.suites.find(r=>r.title===t.title);s||(s=new Q(t.title,e.type==="project"?"file":"describe"),e._addSuite(s)),s.location=this._absoluteLocation(t.location),t.entries.forEach(r=>{"testId"in r?this._mergeTestInto(r,s):this._mergeSuiteInto(r,s)})}_mergeTestInto(t,e){let s=this._options.mergeTestCases?e.tests.find(r=>r.title===t.title&&r.repeatEachIndex===t.repeatEachIndex):void 0;s||(s=new Gt(t.testId,t.title,this._absoluteLocation(t.location),t.repeatEachIndex),e._addTest(s),this._tests.set(s.id,s)),this._updateTest(t,s)}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e.tags=t.tags??[],e.annotations=t.annotations??[],e}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){if(t!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,t):this._rootDir+"/"+t}}class Q{constructor(t,e){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=t,this._type=e}get type(){return this._type}get suites(){return this._entries.filter(t=>t.type!=="test")}get tests(){return this._entries.filter(t=>t.type==="test")}entries(){return this._entries}allTests(){const t=[],e=s=>{for(const r of s.entries())r.type==="test"?t.push(r):e(r)};return e(this),t}titlePath(){const t=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&t.push(this.title),t}project(){var t;return this._project??((t=this.parent)==null?void 0:t.project())}_addTest(t){t.parent=this,this._entries.push(t)}_addSuite(t){t.parent=this,this._entries.push(t)}}class Gt{constructor(t,e,s,r){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=t,this.title=e,this.location=s,this.repeatEachIndex=r}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){return ie(this)}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_createTestResult(t){const e=new ee(this.results.length,t);return this.results.push(e),e}}class te{constructor(t,e,s,r){this.duration=-1,this.steps=[],this._startTime=0,this.title=t.title,this.category=t.category,this.location=s,this.parent=e,this._startTime=t.startTime,this._result=r}titlePath(){var e;return[...((e=this.parent)==null?void 0:e.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}get attachments(){var t,e;return((e=(t=this._endPayload)==null?void 0:t.attachments)==null?void 0:e.map(s=>this._result.attachments[s]))??[]}}class ee{constructor(t,e){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=t,this._id=e}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const se={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[Zt.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",updateSourceMethod:"patch",version:"",workers:0,webServer:null};function st(i){return i.map(t=>t.s!==void 0?t.s:new RegExp(t.r.source,t.r.flags))}function ie(i){let t=0,e=0,s=0;for(const r of i.results)r.status==="interrupted"||(r.status==="skipped"&&i.expectedStatus==="skipped"?++t:r.status==="skipped"||(r.status===i.expectedStatus?++e:++s));return e===0&&s===0?"skipped":s===0?"expected":e===0&&t===0?"unexpected":"flaky"}class nt{constructor(t,e,s,r,c){this._treeItemById=new Map,this._treeItemByTestId=new Map;const a=r&&[...r.values()].some(Boolean);this.pathSeparator=c,this.rootItem={kind:"group",subKind:"folder",id:t,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(t,this.rootItem);const g=(l,_,n)=>{for(const h of _.suites){if(!h.title){g(l,h,n);continue}let v=n.children.find(d=>d.kind==="group"&&d.title===h.title);v||(v={kind:"group",subKind:"describe",id:"suite:"+_.titlePath().join("")+""+h.title,title:h.title,location:h.location,duration:0,parent:n,children:[],status:"none",hasLoadErrors:!1},this._addChild(n,v)),g(l,h,v)}for(const h of _.tests){const v=h.title;let d=n.children.find(C=>C.kind!=="group"&&C.title===v);d||(d={kind:"case",id:"test:"+h.titlePath().join(""),title:v,parent:n,children:[],tests:[],location:h.location,duration:0,status:"none",project:void 0,test:void 0,tags:h.tags},this._addChild(n,d));const S=h.results[0];let x="none";(S==null?void 0:S[X])==="scheduled"?x="scheduled":(S==null?void 0:S[X])==="running"?x="running":(S==null?void 0:S.status)==="skipped"?x="skipped":(S==null?void 0:S.status)==="interrupted"?x="none":S&&h.outcome()!=="expected"?x="failed":S&&h.outcome()==="expected"&&(x="passed"),d.tests.push(h);const B={kind:"test",id:h.id,title:l.name,location:h.location,test:h,parent:d,children:[],status:x,duration:h.results.length?Math.max(0,h.results[0].duration):0,project:l};this._addChild(d,B),this._treeItemByTestId.set(h.id,B),d.duration=d.children.reduce((C,j)=>C+j.duration,0)}};for(const l of(e==null?void 0:e.suites)||[])if(!(a&&!r.get(l.title)))for(const _ of l.suites){const n=this._fileItem(_.location.file.split(c),!0);g(l.project(),_,n)}for(const l of s){if(!l.location)continue;const _=this._fileItem(l.location.file.split(c),!0);_.hasLoadErrors=!0}}_addChild(t,e){t.children.push(e),e.parent=t,this._treeItemById.set(e.id,e)}filterTree(t,e,s){const r=t.trim().toLowerCase().split(" "),c=[...e.values()].some(Boolean),a=l=>{const _=[...l.tests[0].titlePath(),...l.tests[0].tags].join(" ").toLowerCase();return!r.every(n=>_.includes(n))&&!l.tests.some(n=>s==null?void 0:s.has(n.id))?!1:(l.children=l.children.filter(n=>!c||(s==null?void 0:s.has(n.test.id))||e.get(n.status)),l.tests=l.children.map(n=>n.test),!!l.children.length)},g=l=>{const _=[];for(const n of l.children)n.kind==="case"?a(n)&&_.push(n):(g(n),(n.children.length||n.hasLoadErrors)&&_.push(n));l.children=_};g(this.rootItem)}_fileItem(t,e){if(t.length===0)return this.rootItem;const s=t.join(this.pathSeparator),r=this._treeItemById.get(s);if(r)return r;const c=this._fileItem(t.slice(0,t.length-1),!1),a={kind:"group",subKind:e?"file":"folder",id:s,title:t[t.length-1],location:{file:s,line:0,column:0},duration:0,parent:c,children:[],status:"none",hasLoadErrors:!1};return this._addChild(c,a),a}sortAndPropagateStatus(){St(this.rootItem)}flattenForSingleProject(){const t=e=>{e.kind==="case"&&e.children.length===1?(e.project=e.children[0].project,e.test=e.children[0].test,e.children=[],this._treeItemByTestId.set(e.test.id,e)):e.children.forEach(t)};t(this.rootItem)}shortenRoot(){let t=this.rootItem;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];t.location=this.rootItem.location,this.rootItem=t}testIds(){const t=new Set,e=s=>{s.kind==="case"&&s.tests.forEach(r=>t.add(r.id)),s.children.forEach(e)};return e(this.rootItem),t}fileNames(){const t=new Set,e=s=>{s.kind==="group"&&s.subKind==="file"?t.add(s.id):s.children.forEach(e)};return e(this.rootItem),[...t]}flatTreeItems(){const t=[],e=s=>{t.push(s),s.children.forEach(e)};return e(this.rootItem),t}treeItemById(t){return this._treeItemById.get(t)}collectTestIds(t){return t?re(t):new Set}}function St(i){for(const a of i.children)St(a);i.kind==="group"&&i.children.sort((a,g)=>a.location.file.localeCompare(g.location.file)||a.location.line-g.location.line);let t=i.children.length>0,e=i.children.length>0,s=!1,r=!1,c=!1;for(const a of i.children)e=e&&a.status==="skipped",t=t&&(a.status==="passed"||a.status==="skipped"),s=s||a.status==="failed",r=r||a.status==="running",c=c||a.status==="scheduled";r?i.status="running":c?i.status="scheduled":s?i.status="failed":e?i.status="skipped":t&&(i.status="passed")}function re(i){const t=new Set,e=s=>{var r;s.kind==="case"?s.tests.map(c=>c.id).forEach(c=>t.add(c)):s.kind==="test"?t.add(s.id):(r=s.children)==null||r.forEach(e)};return e(i),t}const X=Symbol("statusEx");class oe{constructor(t){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new ot(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:(e,s)=>e+t.pathSeparator+s,clearPreviousResultsWhenTestBegins:!0}),this._options=t}_createReporter(){return{version:()=>"v2",onConfigure:t=>{this.config=t,this._lastRunReceiver=new ot({version:()=>"v2",onBegin:e=>{this._lastRunTestCount=e.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(e,s)=>e+this._options.pathSeparator+s})},onBegin:t=>{var e;if(this.rootSuite||(this.rootSuite=t),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((e=this._testResultsSnapshot)==null?void 0:e.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(t,e)=>{e[X]="running",this._options.onUpdate()},onTestEnd:(t,e)=>{t.outcome()==="skipped"?++this.progress.skipped:t.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,e[X]=e.status,this._options.onUpdate()},onError:t=>this._handleOnError(t),printsToStdio:()=>!1}}processGlobalReport(t){const e=new ot({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of t)e.dispatch(s)}processListReport(t){var s;const e=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(e.map(r=>[r.id,r.results])),this._receiver.reset();for(const r of t)this._receiver.dispatch(r)}processTestReportEvent(t){var e,s,r;(s=(e=this._lastRunReceiver)==null?void 0:e.dispatch(t))==null||s.catch(()=>{}),(r=this._receiver.dispatch(t))==null||r.catch(()=>{})}_handleOnError(t){var e,s;this.loadErrors.push(t),(s=(e=this._options).onError)==null||s.call(e,t),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new Q("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}const ne=({source:i})=>{const[t,e]=Lt(),[s,r]=K.useState(Mt()),[c]=K.useState(Dt(()=>import("./assets/xtermModule-BeNbaIVa.js"),__vite__mapDeps([0,1]),import.meta.url).then(g=>g.default)),a=K.useRef(null);return K.useEffect(()=>(Ft(r),()=>Ot(r)),[]),K.useEffect(()=>{const g=i.write,l=i.clear;return(async()=>{const{Terminal:_,FitAddon:n}=await c,h=e.current;if(!h)return;const v=s==="dark-mode"?le:ae;if(a.current&&a.current.terminal.options.theme===v)return;a.current&&(h.textContent="");const d=new _({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:v}),S=new n;d.loadAddon(S);for(const x of i.pending)d.write(x);i.write=x=>{i.pending.push(x),d.write(x)},i.clear=()=>{i.pending=[],d.clear()},d.open(h),S.fit(),a.current={terminal:d,fitAddon:S}})(),()=>{i.clear=l,i.write=g}},[c,a,e,i,s]),K.useEffect(()=>{setTimeout(()=>{a.current&&(a.current.fitAddon.fit(),i.resize(a.current.terminal.cols,a.current.terminal.rows))},250)},[t,i]),o.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},ae={foreground:"#383a42",background:"#fafafa",cursor:"#383a42",black:"#000000",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a0a0",brightBlack:"#000000",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#d19a66",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#383a42",selectionBackground:"#d7d7d7",selectionForeground:"#383a42"},le={foreground:"#f8f8f2",background:"#1e1e1e",cursor:"#f8f8f0",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#bfbfbf",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#e6e6e6",selectionBackground:"#44475a",selectionForeground:"#f8f8f2"},ce=({filterText:i,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:r,setProjectFilters:c,testModel:a,runTests:g})=>{const[l,_]=u.useState(!1),n=u.useRef(null);u.useEffect(()=>{var d;(d=n.current)==null||d.focus()},[]);const h=[...e.entries()].filter(([d,S])=>S).map(([d])=>d).join(" ")||"all",v=[...r.entries()].filter(([d,S])=>S).map(([d])=>d).join(" ")||"all";return o.jsxs("div",{className:"filters",children:[o.jsx(Ut,{expanded:l,setExpanded:_,title:o.jsx("input",{ref:n,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:i,onChange:d=>{t(d.target.value)},onKeyDown:d=>{d.key==="Enter"&&g()}})}),o.jsxs("div",{className:"filter-summary",title:"Status: "+h+`
3
+ Projects: `+v,onClick:()=>_(!l),children:[o.jsx("span",{className:"filter-label",children:"Status:"})," ",h,o.jsx("span",{className:"filter-label",children:"Projects:"})," ",v]}),l&&o.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[o.jsx("div",{className:"filter-list",role:"list","data-testid":"status-filters",children:[...e.entries()].map(([d,S])=>o.jsx("div",{className:"filter-entry",role:"listitem",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:S,onChange:()=>{const x=new Map(e);x.set(d,!x.get(d)),s(x)}}),o.jsx("div",{children:d})]})},d))}),o.jsx("div",{className:"filter-list",role:"list","data-testid":"project-filters",children:[...r.entries()].map(([d,S])=>o.jsx("div",{className:"filter-entry",role:"listitem",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:S,onChange:()=>{var C;const x=new Map(r);x.set(d,!x.get(d)),c(x);const B=(C=a==null?void 0:a.config)==null?void 0:C.configFile;B&&vt.setObject(B+":projects",[...x.entries()].filter(([j,W])=>W).map(([j])=>j))}}),o.jsx("div",{children:d||"untitled"})]})},d))})]})]})},de=({tag:i,style:t,onClick:e})=>o.jsx("span",{className:at("tag",`tag-color-${ue(i)}`),onClick:e,style:{margin:"6px 0 0 6px",...t},title:`Click to filter by tag: ${i}`,children:i});function ue(i){let t=0;for(let e=0;e<i.length;e++)t=i.charCodeAt(e)+((t<<8)-t);return Math.abs(t%6)}const he=zt,fe=({filterText:i,testModel:t,testServerConnection:e,testTree:s,runTests:r,runningState:c,watchAll:a,watchedTreeIds:g,setWatchedTreeIds:l,isLoading:_,onItemSelected:n,requestedCollapseAllCount:h,requestedExpandAllCount:v,setFilterText:d,onRevealSource:S})=>{const[x,B]=u.useState({expandedItems:new Map}),[C,j]=u.useState(),[W,F]=u.useState(h),[$,N]=u.useState(v);u.useEffect(()=>{if(W!==h){x.expandedItems.clear();for(const b of s.flatTreeItems())x.expandedItems.set(b.id,!1);F(h),j(void 0),B({...x});return}if($!==v){x.expandedItems.clear();for(const b of s.flatTreeItems())x.expandedItems.set(b.id,!0);N(v),j(void 0),B({...x});return}if(!c||c.itemSelectedByUser)return;let f;const E=b=>{var L;b.children.forEach(E),!f&&b.status==="failed"&&(b.kind==="test"&&c.testIds.has(b.test.id)||b.kind==="case"&&c.testIds.has((L=b.tests[0])==null?void 0:L.id))&&(f=b)};E(s.rootItem),f&&j(f.id)},[c,j,s,W,F,h,$,N,v,x,B]);const R=u.useMemo(()=>{if(C)return s.treeItemById(C)},[C,s]);u.useEffect(()=>{if(!t)return;const f=pe(R,t);let E;(R==null?void 0:R.kind)==="test"?E=R.test:(R==null?void 0:R.kind)==="case"&&R.tests.length===1&&(E=R.tests[0]),n({treeItem:R,testCase:E,testFile:f})},[t,R,n]),u.useEffect(()=>{if(!_)if(a)e==null||e.watchNoReply({fileNames:s.fileNames()});else{const f=new Set;for(const E of g.value){const b=s.treeItemById(E),L=b==null?void 0:b.location.file;L&&f.add(L)}e==null||e.watchNoReply({fileNames:[...f]})}},[_,s,a,g,e]);const J=f=>{j(f.id),r("bounce-if-busy",s.collectTestIds(f))},H=(f,E)=>{if(f.preventDefault(),f.stopPropagation(),f.metaKey||f.ctrlKey){const b=i.split(" ");b.includes(E)?d(b.filter(L=>L!==E).join(" ").trim()):d((i+" "+E).trim())}else d((i.split(" ").filter(b=>!b.startsWith("@")).join(" ")+" "+E).trim())};return o.jsx(he,{name:"tests",treeState:x,setTreeState:B,rootItem:s.rootItem,dataTestId:"test-tree",render:f=>{const E=f.id.replace(/[^\w\d-_]/g,"-"),b=E+"-label",L=E+"-time";return o.jsxs("div",{className:"hbox ui-mode-tree-item","aria-labelledby":`${b} ${L}`,children:[o.jsxs("div",{id:b,className:"ui-mode-tree-item-title",children:[o.jsx("span",{children:f.title}),f.kind==="case"?f.tags.map(q=>o.jsx(de,{tag:q.slice(1),onClick:Z=>H(Z,q)},q)):null]}),!!f.duration&&f.status!=="skipped"&&o.jsx("div",{id:L,className:"ui-mode-tree-item-time",children:Wt(f.duration)}),o.jsxs(Y,{noMinHeight:!0,noShadow:!0,children:[o.jsx(D,{icon:"play",title:"Run",onClick:()=>J(f),disabled:!!c&&!c.completed}),o.jsx(D,{icon:"go-to-file",title:"Show source",onClick:S,style:f.kind==="group"&&f.subKind==="folder"?{visibility:"hidden"}:{}}),!a&&o.jsx(D,{icon:"eye",title:"Watch",onClick:()=>{g.value.has(f.id)?g.value.delete(f.id):g.value.add(f.id),l({...g})},toggled:g.value.has(f.id)})]})]})},icon:f=>At(f.status),title:f=>f.title,selectedItem:R,onAccepted:J,onSelected:f=>{c&&(c.itemSelectedByUser=!0),j(f.id)},isError:f=>f.kind==="group"?f.hasLoadErrors:!1,autoExpandDepth:i?5:1,noItemsMessage:_?"Loading…":"No tests"})};function pe(i,t){if(!(!i||!t))return{file:i.location.file,line:i.location.line,column:i.location.column,source:{errors:t.loadErrors.filter(e=>{var s;return((s=e.location)==null?void 0:s.file)===i.location.file}).map(e=>({line:e.location.line,message:e.message})),content:void 0}}}function ge(i){return`.playwright-artifacts-${i}`}const me=({item:i,rootDir:t,onOpenExternally:e,revealSource:s,pathSeparator:r})=>{var h,v;const[c,a]=u.useState(),[g,l]=u.useState(0),_=u.useRef(null),{outputDir:n}=u.useMemo(()=>({outputDir:i.testCase?_e(i.testCase):void 0}),[i]);return u.useEffect(()=>{var B,C;_.current&&clearTimeout(_.current);const d=(B=i.testCase)==null?void 0:B.results[0];if(!d){a(void 0);return}const S=d&&d.duration>=0&&d.attachments.find(j=>j.name==="trace");if(S&&S.path){mt(S.path).then(j=>a({model:j,isLive:!1}));return}if(!n){a(void 0);return}const x=[n,ge(d.workerIndex),"traces",`${(C=i.testCase)==null?void 0:C.id}.json`].join(r);return _.current=setTimeout(async()=>{try{const j=await mt(x);a({model:j,isLive:!0})}catch{a(void 0)}finally{l(g+1)}},500),()=>{_.current&&clearTimeout(_.current)}},[n,i,a,g,l,r]),o.jsx(Vt,{model:c==null?void 0:c.model,showSourcesFirst:!0,rootDir:t,fallbackLocation:i.testFile,isLive:c==null?void 0:c.isLive,status:(h=i.treeItem)==null?void 0:h.status,annotations:((v=i.testCase)==null?void 0:v.annotations)||[],onOpenExternally:e,revealSource:s},"workbench")},_e=i=>{var t;for(let e=i.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir};async function mt(i){const t=new URLSearchParams;t.set("trace",i),t.set("limit","1");const s=await(await fetch(`contexts?${t.toString()}`)).json();return new Kt(s)}let _t={cols:80,rows:24};const z={pending:[],clear:()=>{},write:i=>z.pending.push(i),resize:()=>{}},O=new URLSearchParams(window.location.search),we=new URL(O.get("server")??"../",window.location.href),lt=new URL(O.get("ws"),we);lt.protocol=lt.protocol==="https:"?"wss:":"ws:";const I={args:O.getAll("arg"),grep:O.get("grep")||void 0,grepInvert:O.get("grepInvert")||void 0,projects:O.getAll("project"),workers:O.get("workers")||void 0,headed:O.has("headed"),updateSnapshots:O.get("updateSnapshots")||void 0,reporters:O.has("reporter")?O.getAll("reporter"):void 0,pathSeparator:O.get("pathSeparator")||"/"};I.updateSnapshots&&!["all","none","missing"].includes(I.updateSnapshots)&&(I.updateSnapshots=void 0);const wt=navigator.platform==="MacIntel",ve=({})=>{var gt;const[i,t]=u.useState(""),[e,s]=u.useState(!1),[r,c]=u.useState(!1),[a,g]=u.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[l,_]=u.useState(new Map),[n,h]=u.useState(),[v,d]=u.useState(),[S,x]=u.useState({}),[B,C]=u.useState(new Set),[j,W]=u.useState(!1),[F,$]=u.useState(),N=F&&!F.completed,[R,J]=$t("watch-all",!1),[H,f]=u.useState({value:new Set}),E=u.useRef(Promise.resolve()),b=u.useRef(new Set),[L,q]=u.useState(0),[Z,xt]=u.useState(0),[bt,Tt]=u.useState(!1),[ct,dt]=u.useState(!0),[w,kt]=u.useState(),[G,jt]=u.useState(),[tt,Et]=u.useState(!1);u.useState(!1);const[yt,ut]=u.useState(!1),It=u.useCallback(()=>ut(!0),[ut]),Rt=!1,[ht,Se]=u.useState(!1),[ft,xe]=u.useState(!1),[pt,be]=u.useState(!1),Bt=u.useRef(null),et=u.useCallback(()=>{kt(p=>(p==null||p.close(),new Ht(new qt(lt))))},[]);u.useEffect(()=>{var p;(p=Bt.current)==null||p.focus(),W(!0),et()},[et]),u.useEffect(()=>{if(!w)return;const p=[w.onStdio(m=>{if(m.buffer){const T=atob(m.buffer);z.write(T)}else z.write(m.text);m.type==="stderr"&&c(!0)}),w.onClose(()=>Tt(!0))];return z.resize=(m,T)=>{_t={cols:m,rows:T},w.resizeTerminalNoReply({cols:m,rows:T})},()=>{for(const m of p)m.dispose()}},[w]),u.useEffect(()=>{if(!w)return;let p;const m=new oe({onUpdate:T=>{clearTimeout(p),p=void 0,T?h(m.asModel()):p||(p=setTimeout(()=>{h(m.asModel())},250))},onError:T=>{z.write((T.stack||T.value||"")+`
4
+ `),c(!0)},pathSeparator:I.pathSeparator});return jt(m),h(void 0),W(!0),f({value:new Set}),(async()=>{try{await w.initialize({interceptStdio:!0,watchTestDirs:!0});const{status:T,report:y}=await w.runGlobalSetup({});if(m.processGlobalReport(y),T!=="passed")return;const P=await w.listTests({projects:I.projects,locations:I.args,grep:I.grep,grepInvert:I.grepInvert});m.processListReport(P.report),w.onReport(M=>{m.processTestReportEvent(M)});const{hasBrowsers:U}=await w.checkBrowsers({});dt(U)}finally{W(!1)}})(),()=>{clearTimeout(p)}},[w]),u.useEffect(()=>{if(!n)return;const{config:p,rootSuite:m}=n,T=p.configFile?vt.getObject(p.configFile+":projects",void 0):void 0,y=new Map(l);for(const P of y.keys())m.suites.find(U=>U.title===P)||y.delete(P);for(const P of m.suites)y.has(P.title)||y.set(P.title,!!(T!=null&&T.includes(P.title)));!T&&y.size&&![...y.values()].includes(!0)&&y.set(y.entries().next().value[0],!0),(l.size!==y.size||[...l].some(([P,U])=>y.get(P)!==U))&&_(y)},[l,n]),u.useEffect(()=>{N&&(n!=null&&n.progress)?d(n.progress):n||d(void 0)},[n,N]);const{testTree:Ct}=u.useMemo(()=>{if(!n)return{testTree:new nt("",new Q("","root"),[],l,I.pathSeparator)};const p=new nt("",n.rootSuite,n.loadErrors,l,I.pathSeparator);return p.filterTree(i,a,N?F==null?void 0:F.testIds:void 0),p.sortAndPropagateStatus(),p.shortenRoot(),p.flattenForSingleProject(),C(p.testIds()),{testTree:p}},[i,n,a,l,C,F,N]),V=u.useCallback((p,m)=>{!w||!n||p==="bounce-if-busy"&&N||(b.current=new Set([...b.current,...m]),E.current=E.current.then(async()=>{var P,U,M;const T=b.current;if(b.current=new Set,!T.size)return;{for(const k of((P=n.rootSuite)==null?void 0:P.allTests())||[])if(T.has(k.id)){k.results=[];const A=k._createTestResult("pending");A[X]="scheduled"}h({...n})}const y=" ["+new Date().toLocaleTimeString()+"]";z.write("\x1B[2m—".repeat(Math.max(0,_t.cols-y.length))+y+"\x1B[22m"),d({total:0,passed:0,failed:0,skipped:0}),$({testIds:T}),await w.runTests({locations:I.args,grep:I.grep,grepInvert:I.grepInvert,testIds:[...T],projects:[...l].filter(([k,A])=>A).map(([k])=>k),...ht?{workers:"1"}:{},...ft?{headed:!0}:{},...pt?{updateSnapshots:"all"}:{},reporters:I.reporters,trace:"on"});for(const k of((U=n.rootSuite)==null?void 0:U.allTests())||[])((M=k.results[0])==null?void 0:M.duration)===-1&&(k.results=[]);h({...n}),$(k=>k?{...k,completed:!0}:void 0)}))},[l,N,n,w,ht,ft,pt]);u.useEffect(()=>{if(!w||!G)return;const p=w.onTestFilesChanged(async m=>{if(E.current=E.current.then(async()=>{W(!0);try{const M=await w.listTests({projects:I.projects,locations:I.args,grep:I.grep,grepInvert:I.grepInvert});G.processListReport(M.report)}catch(M){console.log(M)}finally{W(!1)}}),await E.current,m.testFiles.length===0)return;const T=G.asModel(),y=new nt("",T.rootSuite,T.loadErrors,l,I.pathSeparator),P=[],U=new Set(m.testFiles);if(R){const M=k=>{const A=k.location.file;A&&U.has(A)&&P.push(...y.collectTestIds(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(M)};M(y.rootItem)}else for(const M of H.value){const k=y.treeItemById(M),A=k==null?void 0:k.location.file;A&&U.has(A)&&P.push(...y.collectTestIds(k))}V("queue-if-busy",new Set(P))});return()=>p.dispose()},[V,w,R,H,G,l]),u.useEffect(()=>{if(!w)return;const p=m=>{m.code==="Backquote"&&m.ctrlKey?(m.preventDefault(),s(!e)):m.code==="F5"&&m.shiftKey?(m.preventDefault(),w==null||w.stopTestsNoReply({})):m.code==="F5"&&(m.preventDefault(),V("bounce-if-busy",B))};return addEventListener("keydown",p),()=>{removeEventListener("keydown",p)}},[V,et,w,B,e]);const it=u.useRef(null),Pt=u.useCallback(p=>{var m;p.preventDefault(),p.stopPropagation(),(m=it.current)==null||m.showModal()},[]),rt=u.useCallback(p=>{var m;p.preventDefault(),p.stopPropagation(),(m=it.current)==null||m.close()},[]),Nt=u.useCallback(p=>{rt(p),s(!0),w==null||w.installBrowsers({}).then(async()=>{s(!1);const{hasBrowsers:m}=await(w==null?void 0:w.checkBrowsers({}));dt(m)})},[rt,w]);return o.jsxs("div",{className:"vbox ui-mode",children:[!ct&&o.jsxs("dialog",{ref:it,children:[o.jsxs("div",{className:"title",children:[o.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),o.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",o.jsx("br",{}),"Would you like to run `playwright install`?",o.jsx("br",{}),o.jsx("button",{className:"button",onClick:Nt,children:"Install"}),o.jsx("button",{className:"button secondary",onClick:rt,children:"Dismiss"})]})]}),bt&&o.jsxs("div",{className:"disconnected",children:[o.jsx("div",{className:"title",children:"UI Mode disconnected"}),o.jsxs("div",{children:[o.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),o.jsx(Yt,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",main:o.jsxs("div",{className:"vbox",children:[o.jsxs("div",{className:at("vbox",!e&&"hidden"),children:[o.jsxs(Y,{children:[o.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),o.jsx(D,{icon:"circle-slash",title:"Clear output",onClick:()=>{z.clear(),c(!1)}}),o.jsx("div",{className:"spacer"}),o.jsx(D,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),o.jsx(ne,{source:z})]}),o.jsx("div",{className:at("vbox",e&&"hidden"),children:o.jsx(me,{pathSeparator:I.pathSeparator,item:S,rootDir:(gt=n==null?void 0:n.config)==null?void 0:gt.rootDir,revealSource:yt,onOpenExternally:p=>w==null?void 0:w.openNoReply({location:{file:p.file,line:p.line,column:p.column}})})})]}),sidebar:o.jsxs("div",{className:"vbox ui-mode-sidebar",children:[o.jsxs(Y,{noShadow:!0,noMinHeight:!0,children:[o.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),o.jsx("div",{className:"section-title",children:"Playwright"}),o.jsx(D,{icon:"refresh",title:"Reload",onClick:()=>et(),disabled:N||j}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx(D,{icon:"terminal",title:"Toggle output — "+(wt?"⌃`":"Ctrl + `"),toggled:e,onClick:()=>{s(!e)}}),r&&o.jsx("div",{title:"Output contains error",style:{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:"50%",backgroundColor:"var(--vscode-notificationsErrorIcon-foreground)"}})]}),!ct&&o.jsx(D,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:Pt})]}),o.jsx(ce,{filterText:i,setFilterText:t,statusFilters:a,setStatusFilters:g,projectFilters:l,setProjectFilters:_,testModel:n,runTests:()=>V("bounce-if-busy",B)}),o.jsxs(Y,{noMinHeight:!0,children:[!N&&!v&&o.jsx("div",{className:"section-title",children:"Tests"}),!N&&v&&o.jsx("div",{"data-testid":"status-line",className:"status-line",children:o.jsxs("div",{children:[v.passed,"/",v.total," passed (",v.passed/v.total*100|0,"%)"]})}),N&&v&&o.jsx("div",{"data-testid":"status-line",className:"status-line",children:o.jsxs("div",{children:["Running ",v.passed,"/",F.testIds.size," passed (",v.passed/F.testIds.size*100|0,"%)"]})}),o.jsx(D,{icon:"play",title:"Run all — F5",onClick:()=>V("bounce-if-busy",B),disabled:N||j}),o.jsx(D,{icon:"debug-stop",title:"Stop — "+(wt?"⇧F5":"Shift + F5"),onClick:()=>w==null?void 0:w.stopTests({}),disabled:!N||j}),o.jsx(D,{icon:"eye",title:"Watch all",toggled:R,onClick:()=>{f({value:new Set}),J(!R)}}),o.jsx(D,{icon:"collapse-all",title:"Collapse all",onClick:()=>{q(L+1)}}),o.jsx(D,{icon:"expand-all",title:"Expand all",onClick:()=>{xt(Z+1)}})]}),o.jsx(fe,{filterText:i,testModel:n,testTree:Ct,testServerConnection:w,runningState:F,runTests:V,onItemSelected:x,watchAll:R,watchedTreeIds:H,setWatchedTreeIds:f,isLoading:j,requestedCollapseAllCount:L,requestedExpandAllCount:Z,setFilterText:t,onRevealSource:It}),Rt,o.jsxs(Y,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>Et(!tt),children:[o.jsx("span",{className:`codicon codicon-${tt?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:tt?"Hide Settings":"Show Settings"}),o.jsx("div",{className:"section-title",children:"Settings"})]}),tt&&o.jsx(Qt,{})]})})]})};(async()=>{if(Xt(),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.
5
+ Make sure to serve the website (${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)}Jt(document.querySelector("#root")).render(o.jsx(ve,{}))})();