6 lines
93 KiB
JavaScript
6 lines
93 KiB
JavaScript
class Xs{constructor(t,e){this._snapshotIds=new Map,this._snapshotStorage=t,this._resourceLoader=e}serveSnapshot(t,e,n){const r=this._snapshot(t,e);if(!r)return new Response(null,{status:404});const i=r.render();return this._snapshotIds.set(n,r),new Response(i.html,{status:200,headers:{"Content-Type":"text/html; charset=utf-8"}})}async serveClosestScreenshot(t,e){const n=this._snapshot(t,e),r=n==null?void 0:n.closestScreenshot();return r?new Response(await this._resourceLoader(r)):new Response(null,{status:404})}serveSnapshotInfo(t,e){const n=this._snapshot(t,e);return this._respondWithJson(n?{viewport:n.viewport(),url:n.snapshot().frameUrl,timestamp:n.snapshot().timestamp,wallTime:n.snapshot().wallTime}:{error:"No snapshot found"})}_snapshot(t,e){const n=e.get("name");return this._snapshotStorage.snapshotByName(t,n)}_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,n){let r;const i=this._snapshotIds.get(n);for(const S of t)if(r=i==null?void 0:i.resourceByUrl($s(S),e),r)break;if(!r)return new Response(null,{status:404});const a=r.response.content._sha1,o=a?await this._resourceLoader(a)||new Blob([]):new Blob([]);let l=r.response.content.mimeType;/^text\/|^application\/(javascript|json)/.test(l)&&!l.includes("charset")&&(l=`${l}; charset=utf-8`);const d=new Headers;l!=="x-unknown"&&d.set("Content-Type",l);for(const{name:S,value:O}of r.response.headers)d.set(S,O);d.delete("Content-Encoding"),d.delete("Access-Control-Allow-Origin"),d.set("Access-Control-Allow-Origin","*"),d.delete("Content-Length"),d.set("Content-Length",String(o.size)),this._snapshotStorage.hasResourceOverride(r.request.url)?d.set("Cache-Control","no-store, no-cache, max-age=0"):d.set("Cache-Control","public, max-age=31536000");const{status:w}=r.response,m=w===101||w===204||w===205||w===304;return new Response(m?null:o,{headers:d,status:r.response.status,statusText:r.response.statusText})}}function $s(s){try{const t=new URL(s);return t.hash="",t.toString()}catch{return s}}function Js(s){const t=new Map,{files:e,stacks:n}=s;for(const r of n){const[i,a]=r;t.set(`call@${i}`,a.map(o=>({file:e[o[0]],line:o[1],column:o[2],function:o[3]})))}return t}const Un={"&":"&","<":"<",">":">",'"':""","'":"'"};function Qs(s){return s.replace(/[&<>"']/ug,t=>Un[t])}function zs(s){return s.replace(/[&<]/ug,t=>Un[t])}function Mt(s,t,e){return s.find((n,r)=>{if(r===s.length-1)return!0;const i=s[r+1];return Math.abs(t(n)-e)<Math.abs(t(i)-e)})}function Wn(s){return Array.isArray(s)&&typeof s[0]=="string"}function er(s){return Array.isArray(s)&&Array.isArray(s[0])}class tr{constructor(t,e,n,r,i){this._htmlCache=t,this._resources=e,this._snapshots=n,this._index=i,this._snapshot=n[i],this._callId=n[i].callId,this._screencastFrames=r,this.snapshotName=n[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(),n=t&&((r=this._screencastFrames[0])!=null&&r.frameSwapWallTime)?Mt(this._screencastFrames,i=>i.frameSwapWallTime,t):Mt(this._screencastFrames,i=>i.timestamp,e);return n==null?void 0:n.sha1}render(){const t=[],e=(i,a,o,l)=>{if(typeof i=="string"){o==="STYLE"||o==="style"?t.push(lr(ar(i))):t.push(zs(i));return}if(er(i)){const _=a-i[0][0];if(_>=0&&_<=a){const d=sr(this._snapshots[_]),w=i[0][1];if(w>=0&&w<d.length)return e(d[w],_,o,l)}}else if(Wn(i)){const[_,d,...w]=i,m=_==="NOSCRIPT"?"X-NOSCRIPT":_,S=Object.entries(d||{});t.push("<",m);const O="__playwright_current_src__",u=m==="IFRAME"||m==="FRAME",c=m==="A",f=m==="IMG",p=f&&S.some(E=>E[0]===O),g=m==="SOURCE"&&o==="PICTURE"&&(l==null?void 0:l.some(E=>E[0]===O));for(const[E,R]of S){let h=E;u&&E.toLowerCase()==="src"&&(h="__playwright_src__"),f&&E===O&&(h="src"),["src","srcset"].includes(E.toLowerCase())&&(p||g)&&(h="_"+h);let x=R;!c&&(E.toLowerCase()==="href"||E.toLowerCase()==="src"||E===O)&&(x=lt(R)),t.push(" ",h,'="',Qs(x),'"')}t.push(">");for(const E of w)e(E,a,m,S);nr.has(m)||t.push("</",m,">");return}else return},n=this._snapshot;return{html:this._htmlCache.getOrCompute(this,()=>{e(n.html,this._index,void 0,void 0);const a=(n.doctype?`<!DOCTYPE ${n.doctype}>`:"")+["<style>*,*::before,*::after { visibility: hidden }</style>",`<script>${rr(this.viewport(),this._callId,this.snapshotName)}<\/script>`].join("")+t.join("");return{value:a,size:a.length}}),pageId:n.pageId,frameId:n.frameId,index:this._index}}resourceByUrl(t,e){const n=this._snapshot;let r,i;for(const o of this._resources){if(typeof o._monotonicTime=="number"&&o._monotonicTime>=n.timestamp)break;o.response.status!==304&&o.request.url===t&&o.request.method===e&&(o._frameref===n.frameId?r=o:i=o)}let a=r??i;if(a&&e.toUpperCase()==="GET"){let o=n.resourceOverrides.find(l=>l.url===t);if(o!=null&&o.ref){const l=this._index-o.ref;l>=0&&l<this._snapshots.length&&(o=this._snapshots[l].resourceOverrides.find(_=>_.url===t))}o!=null&&o.sha1&&(a={...a,response:{...a.response,content:{...a.response.content,_sha1:o.sha1}}})}return a}}const nr=new Set(["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","MENUITEM","META","PARAM","SOURCE","TRACK","WBR"]);function sr(s){if(!s._nodes){const t=[],e=n=>{if(typeof n=="string")t.push(n);else if(Wn(n)){const[,,...r]=n;for(const i of r)e(i);t.push(n)}};e(s.html),s._nodes=t}return s._nodes}function rr(s,...t){function e(n,r,...i){const a=window,o=new URLSearchParams(a.location.search),l=o.has("shouldPopulateCanvasFromScreenshot"),_=o.has("isUnderTest"),d={viewport:r,frames:new WeakMap};a.__playwright_frame_bounding_rects__=d;const w="Recorded click position in absolute coordinates did not match the center of the clicked element. This is either due to the use of provided offset, or due to a difference between the test runner and the trace viewer operating systems.",m=[],S=[],O=[],u=[];let c=a;for(;c!==c.parent&&!c.location.pathname.match(/\/page@[a-z0-9]+$/);)c=c.parent;const f=E=>{for(const R of E.querySelectorAll("[__playwright_scroll_top_]"))m.push(R);for(const R of E.querySelectorAll("[__playwright_scroll_left_]"))S.push(R);for(const R of E.querySelectorAll("[__playwright_value_]")){const h=R;h.type!=="file"&&(h.value=h.getAttribute("__playwright_value_")),R.removeAttribute("__playwright_value_")}for(const R of E.querySelectorAll("[__playwright_checked_]"))R.checked=R.getAttribute("__playwright_checked_")==="true",R.removeAttribute("__playwright_checked_");for(const R of E.querySelectorAll("[__playwright_selected_]"))R.selected=R.getAttribute("__playwright_selected_")==="true",R.removeAttribute("__playwright_selected_");for(const R of E.querySelectorAll("[__playwright_popover_open_]")){try{R.showPopover()}catch{}R.removeAttribute("__playwright_popover_open_")}for(const R of E.querySelectorAll("[__playwright_dialog_open_]")){try{R.getAttribute("__playwright_dialog_open_")==="modal"?R.showModal():R.show()}catch{}R.removeAttribute("__playwright_dialog_open_")}for(const R of i)for(const h of E.querySelectorAll(`[__playwright_target__="${R}"]`)){const x=h.style;x.outline="2px solid #006ab1",x.backgroundColor="#6fa8dc7f",O.push(h)}for(const R of E.querySelectorAll("iframe, frame")){const h=R.getAttribute("__playwright_bounding_rect__");R.removeAttribute("__playwright_bounding_rect__");const x=h?JSON.parse(h):void 0;x&&d.frames.set(R,{boundingRect:x,scrollLeft:0,scrollTop:0});const b=R.getAttribute("__playwright_src__");if(!b)R.setAttribute("src",n);else{const T=new URL(a.location.href),A=T.pathname.lastIndexOf("/snapshot/");A!==-1&&(T.pathname=T.pathname.substring(0,A+1)),T.pathname+=b.substring(1),R.setAttribute("src",T.toString())}}{const R=E.querySelector("body[__playwright_custom_elements__]");if(R&&a.customElements){const h=(R.getAttribute("__playwright_custom_elements__")||"").split(",");for(const x of h)a.customElements.define(x,class extends HTMLElement{})}}for(const R of E.querySelectorAll("template[__playwright_shadow_root_]")){const h=R,x=h.parentElement.attachShadow({mode:"open"});x.appendChild(h.content),h.remove(),f(x)}for(const R of E.querySelectorAll("a"))R.addEventListener("click",h=>{h.preventDefault()});if("adoptedStyleSheets"in E){const R=[...E.adoptedStyleSheets];for(const h of E.querySelectorAll("template[__playwright_style_sheet_]")){const x=h,b=new CSSStyleSheet;b.replaceSync(x.getAttribute("__playwright_style_sheet_")),R.push(b)}E.adoptedStyleSheets=R}u.push(...E.querySelectorAll("canvas"))},p=()=>{a.removeEventListener("load",p);for(const h of m)h.scrollTop=+h.getAttribute("__playwright_scroll_top_"),h.removeAttribute("__playwright_scroll_top_"),d.frames.has(h)&&(d.frames.get(h).scrollTop=h.scrollTop);for(const h of S)h.scrollLeft=+h.getAttribute("__playwright_scroll_left_"),h.removeAttribute("__playwright_scroll_left_"),d.frames.has(h)&&(d.frames.get(h).scrollLeft=h.scrollLeft);a.document.styleSheets[0].disabled=!0;const E=new URL(a.location.href).searchParams;if(a===c&&E.get("pointX")&&E.get("pointY")){const h=+E.get("pointX"),x=+E.get("pointY"),b=a.document.createElement("x-pw-pointer");b.style.position="fixed",b.style.backgroundColor="#f44336",b.style.width="20px",b.style.height="20px",b.style.borderRadius="10px",b.style.margin="-10px 0 0 -10px",b.style.zIndex="2147483646",b.style.display="flex",b.style.alignItems="center",b.style.justifyContent="center";const T=O[0],A=T==null?void 0:T.getBoundingClientRect(),y=T?{x:A.left+A.width/2,y:A.top+A.height/2}:null;if(b.style.left=((y==null?void 0:y.x)??h)+"px",b.style.top=((y==null?void 0:y.y)??x)+"px",!(!y||Math.abs(y.x-h)<=10&&Math.abs(y.y-x)<=10)){const C=a.document.createElement("x-pw-pointer-warning");C.textContent="⚠",C.style.fontSize="19px",C.style.color="white",C.style.marginTop="-3.5px",C.style.userSelect="none",b.appendChild(C),b.setAttribute("title",w)}a.document.documentElement.appendChild(b)}if(u.length>0){let h=function(b,T){function A(){const y=a.document.createElement("canvas");y.width=y.width/Math.floor(y.width/24),y.height=y.height/Math.floor(y.height/24);const I=y.getContext("2d");return I.fillStyle="lightgray",I.fillRect(0,0,y.width,y.height),I.fillStyle="white",I.fillRect(0,0,y.width/2,y.height/2),I.fillRect(y.width/2,y.height/2,y.width,y.height),I.createPattern(y,"repeat")}b.fillStyle=A(),b.fillRect(0,0,T.width,T.height)};const x=new Image;x.onload=()=>{var b;for(const T of u){const A=T.getContext("2d"),y=T.getAttribute("__playwright_bounding_rect__");if(T.removeAttribute("__playwright_bounding_rect__"),!y)continue;let I;try{I=JSON.parse(y)}catch{continue}let C=a;for(;C!==c;){const L=C.frameElement;C=C.parent;const j=(b=C.__playwright_frame_bounding_rects__)==null?void 0:b.frames.get(L);if(!(j!=null&&j.boundingRect))break;const D=j.boundingRect.left-j.scrollLeft,K=j.boundingRect.top-j.scrollTop;I.left+=D,I.top+=K,I.right+=D,I.bottom+=K}const{width:k,height:P}=c.__playwright_frame_bounding_rects__.viewport;I.left=I.left/k,I.top=I.top/P,I.right=I.right/k,I.bottom=I.bottom/P;const N=I.right>1||I.bottom>1;if(I.left>1||I.top>1){T.title="Playwright couldn't capture canvas contents because it's located outside the viewport.";continue}h(A,T),l?(A.drawImage(x,I.left*x.width,I.top*x.height,(I.right-I.left)*x.width,(I.bottom-I.top)*x.height,0,0,T.width,T.height),N?T.title="Playwright couldn't capture full canvas contents because it's located partially outside the viewport.":T.title="Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution."):T.title="Canvas content display is disabled.",_&&console.log("canvas drawn:",JSON.stringify([I.left,I.top,I.right-I.left,I.bottom-I.top].map(L=>Math.floor(L*100))))}},x.onerror=()=>{for(const b of u){const T=b.getContext("2d");h(T,b),b.title="Playwright couldn't show canvas contents because the screenshot failed to load."}},x.src=location.href.replace("/snapshot","/closest-screenshot")}},g=()=>f(a.document);a.addEventListener("load",p),a.addEventListener("DOMContentLoaded",g)}return`
|
|
(${e.toString()})(${JSON.stringify(fr)},${JSON.stringify(s)}${t.map(n=>`, "${n}"`).join("")})`}const Hn=["about:","blob:","data:","file:","ftp:","http:","https:","mailto:","sftp:","ws:","wss:"],Ut="http://playwright.bloburl/#";function lt(s){s.startsWith(Ut)&&(s=s.substring(Ut.length));try{const t=new URL(s);if(t.protocol==="javascript:"||t.protocol==="vbscript:")return"javascript:void(0)";const e=t.protocol==="blob:",n=t.protocol==="file:";if(!e&&!n&&Hn.includes(t.protocol))return s;const r="pw-"+t.protocol.slice(0,t.protocol.length-1);return n||(t.protocol="https:"),t.hostname=t.hostname?`${r}--${t.hostname}`:r,n&&(t.protocol="https:"),t.toString()}catch{return s}}const ir=/url\(['"]?([\w-]+:)\/\//ig;function ar(s){return s.replace(ir,(t,e)=>!(e==="blob:")&&!(e==="file:")&&Hn.includes(e)?t:t.replace(e+"//",`https://pw-${e.slice(0,-1)}--`))}const or=/url\(\s*'([^']*)'\s*\)/ig,cr=/url\(\s*"([^"]*)"\s*\)/ig;function lr(s){const t=(e,n)=>n.includes("</")?e.replace(n,encodeURI(n)):e;return s.replace(or,t).replace(cr,t)}const fr="data:text/html;base64,"+btoa("<body></body><style>body { color-scheme: light dark; background: light-dark(white, #333) }</style>");class ur{constructor(t){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 n=e();for(;this._map.size&&this._size+n.size>this._maxSize;){const[r,i]=this._map.entries().next().value;this._size-=i.size,this._map.delete(r)}return this._map.set(t,n),this._size+=n.size,n.value}}class dr{constructor(){this._frameSnapshots=new Map,this._cache=new ur(1e8),this._contextToResources=new Map,this._resourceUrlsWithOverrides=new Set}addResource(t,e){e.request.url=lt(e.request.url),this._ensureResourcesForContext(t).push(e)}addFrameSnapshot(t,e,n){for(const o of e.resourceOverrides)o.url=lt(o.url);let r=this._frameSnapshots.get(e.frameId);r||(r={raw:[],renderers:[]},this._frameSnapshots.set(e.frameId,r),e.isMainFrame&&this._frameSnapshots.set(e.pageId,r)),r.raw.push(e);const i=this._ensureResourcesForContext(t),a=new tr(this._cache,i,r.raw,n,r.raw.length-1);return r.renderers.push(a),a}snapshotByName(t,e){const n=this._frameSnapshots.get(t);return n==null?void 0:n.renderers.find(r=>r.snapshotName===e)}snapshotsForTest(){return[...this._frameSnapshots.keys()]}finalize(){for(const t of this._contextToResources.values())t.sort((e,n)=>(e._monotonicTime||0)-(n._monotonicTime||0));for(const t of this._frameSnapshots.values())for(const e of t.raw)for(const n of e.resourceOverrides)this._resourceUrlsWithOverrides.add(n.url)}hasResourceOverride(t){return this._resourceUrlsWithOverrides.has(t)}_ensureResourcesForContext(t){let e=this._contextToResources.get(t);return e||(e=[],this._contextToResources.set(t,e)),e}}class Bn extends Error{constructor(t){super(t),this.name="TraceVersionError"}}const Wt=8;class _r{constructor(t,e){this._actionMap=new Map,this._pageEntries=new Map,this._jsHandles=new Map,this._consoleObjects=new Map,this._contextEntry=t,this._snapshotStorage=e}appendTrace(t){for(const e of t.split(`
|
|
`))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 n of e)this._innerAppendEvent(n)}_innerAppendEvent(t){const e=this._contextEntry;switch(t.type){case"context-options":{if(t.version>Wt)throw new Bn("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.playwrightVersion=t.playwrightVersion,e.wallTime=t.wallTime,e.startTime=t.monotonicTime,e.sdkLanguage=t.sdkLanguage,e.options=t.options,e.testIdAttributeName=t.testIdAttributeName,e.contextId=t.contextId??"",e.testTimeout=t.testTimeout;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 n=this._actionMap.get(t.callId);n.inputSnapshot=t.inputSnapshot,n.point=t.point;break}case"log":{const n=this._actionMap.get(t.callId);if(!n)return;n.log.push({time:t.time,message:t.message});break}case"after":{const n=this._actionMap.get(t.callId);n.afterSnapshot=t.afterSnapshot,n.endTime=t.endTime,n.result=t.result,n.error=t.error,n.attachments=t.attachments,n.annotations=t.annotations,t.point&&(n.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(this._contextEntry.contextId,t.snapshot),e.resources.push(t.snapshot);break;case"frame-snapshot":this._snapshotStorage.addFrameSnapshot(this._contextEntry.contextId,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??6,n=[t];for(;e<Wt;++e)n=this[`_modernize_${e}_to_${e+1}`].call(this,n);return n}_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 n of t)n.type!=="frame-snapshot"||!n.snapshot.isMainFrame||(n.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 n=e.snapshot;e.snapshot={_frameref:n.frameId,request:{url:n.url,method:n.method,headers:n.requestHeaders,postData:n.requestSha1?{_sha1:n.requestSha1}:void 0},response:{status:n.status,headers:n.responseHeaders,content:{mimeType:n.contentType,_sha1:n.responseSha1}},_monotonicTime:n.timestamp}}return t}_modernize_3_to_4(t){const e=[];for(const n of t){const r=this._modernize_event_3_to_4(n);r&&e.push(r)}return e}_modernize_event_3_to_4(t){var n,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:(n=e.snapshots.find(o=>o.title==="before"))==null?void 0:n.snapshotName,inputSnapshot:(r=e.snapshots.find(o=>o.title==="input"))==null?void 0:r.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 n of t){const r=this._modernize_event_4_to_5(n);r&&e.push(r)}return e}_modernize_event_4_to_5(t){var e,n;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(((n=t.params.message)==null?void 0:n.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 n of t)if(e.push(n),!(n.type!=="after"||!n.log.length))for(const r of n.log)e.push({type:"log",callId:n.callId,message:r,time:-1});return e}_modernize_6_to_7(t){const e=[];if(!this._processedContextCreatedEvent()&&t[0].type!=="context-options"){const n={type:"context-options",origin:"testRunner",version:6,browserName:"",options:{},platform:"unknown",wallTime:0,monotonicTime:0,sdkLanguage:"javascript",contextId:""};e.push(n)}for(const n of t){if(n.type==="context-options"){e.push({...n,monotonicTime:0,origin:"library",contextId:""});continue}if(n.type==="before"||n.type==="action"){this._contextEntry.wallTime||(this._contextEntry.wallTime=n.wallTime);const r=n,i=n;i.stepId=`${r.apiName}@${r.wallTime}`,e.push(i)}else e.push(n)}return e}_modernize_7_to_8(t){const e=[];for(const n of t)if(n.type==="before"||n.type==="action"){const r=n,i=n;r.apiName&&(i.title=r.apiName,delete i.apiName),i.stepId=r.stepId??r.callId,e.push(i)}else e.push(n);return e}}class hr{constructor(){this.contextEntries=[],this._resourceToContentType=new Map}async load(t,e,n){var _,d,w;this._backend=t;const r=(_=e==null?void 0:e.match(/(.+)\.trace$/))==null?void 0:_[1],i=[];let a=!1;for(const m of await this._backend.entryNames()){const S=m.match(/(.+)\.trace$/);S&&(!r||r===S[1])&&i.push(S[1]||""),m.includes("src@")&&(a=!0)}if(!i.length)throw new Error("Cannot find .trace file");this._snapshotStorage=new dr;const o=i.length*3;let l=0;for(const m of i){const S=pr();S.hasSource=a;const O=new _r(S,this._snapshotStorage),u=await this._backend.readText(m+".trace")||"";O.appendTrace(u),n==null||n(++l,o);const c=await this._backend.readText(m+".network")||"";if(O.appendTrace(c),n==null||n(++l,o),S.actions=O.actions().sort((p,g)=>p.startTime-g.startTime),!t.isLive()){for(const p of S.actions.slice().reverse())if(!p.endTime&&!p.error)for(const g of S.actions)g.parentId===p.callId&&p.endTime<g.endTime&&(p.endTime=g.endTime)}const f=await this._backend.readText(m+".stacks");if(f){const p=Js(JSON.parse(f));for(const g of S.actions)g.stack=g.stack||p.get(g.callId)}n==null||n(++l,o);for(const p of S.resources)(d=p.request.postData)!=null&&d._sha1&&this._resourceToContentType.set(p.request.postData._sha1,Ht(p.request.postData.mimeType)),(w=p.response.content)!=null&&w._sha1&&this._resourceToContentType.set(p.response.content._sha1,Ht(p.response.content.mimeType));this.contextEntries.push(S)}this._snapshotStorage.finalize()}async hasEntry(t){return this._backend.hasEntry(t)}async resourceForSha1(t){const e=await this._backend.readBlob("resources/"+t),n=this._resourceToContentType.get(t);return!e||n===void 0||n==="x-unknown"?e:new Blob([e],{type:n})}storage(){return this._snapshotStorage}}function Ht(s){const t=s.match(/^(.*);\s*charset=.*$/);return t?t[1]:s}function pr(){return{origin:"testRunner",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,contextId:""}}function mr(s,t){const e=new Array(t.length).fill(0);return new Array(t.length).fill(0).map((n,r)=>(i,a)=>{e[r]=i/a*t[r]*1e3,s(e.reduce((o,l)=>o+l,0),1e3)})}const wr=15,v=0,ne=1,gr=2,X=-2,W=-3,Bt=-4,se=-5,$=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],jn=1440,br=0,yr=4,Er=9,xr=5,Tr=[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],Sr=[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],Rr=[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],Ar=[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],Or=[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],Ir=[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],ie=15;function ft(){const s=this;let t,e,n,r,i,a;function o(_,d,w,m,S,O,u,c,f,p,g){let E,R,h,x,b,T,A,y,I,C,k,P,N,H,L;C=0,b=w;do n[_[d+C]]++,C++,b--;while(b!==0);if(n[0]==w)return u[0]=-1,c[0]=0,v;for(y=c[0],T=1;T<=ie&&n[T]===0;T++);for(A=T,y<T&&(y=T),b=ie;b!==0&&n[b]===0;b--);for(h=b,y>b&&(y=b),c[0]=y,H=1<<T;T<b;T++,H<<=1)if((H-=n[T])<0)return W;if((H-=n[b])<0)return W;for(n[b]+=H,a[1]=T=0,C=1,N=2;--b!==0;)a[N]=T+=n[C],N++,C++;b=0,C=0;do(T=_[d+C])!==0&&(g[a[T]++]=b),C++;while(++b<w);for(w=a[h],a[0]=b=0,C=0,x=-1,P=-y,i[0]=0,k=0,L=0;A<=h;A++)for(E=n[A];E--!==0;){for(;A>P+y;){if(x++,P+=y,L=h-P,L=L>y?y:L,(R=1<<(T=A-P))>E+1&&(R-=E+1,N=A,T<L))for(;++T<L&&!((R<<=1)<=n[++N]);)R-=n[N];if(L=1<<T,p[0]+L>jn)return W;i[x]=k=p[0],p[0]+=L,x!==0?(a[x]=b,r[0]=T,r[1]=y,T=b>>>P-y,r[2]=k-i[x-1]-T,f.set(r,(i[x-1]+T)*3)):u[0]=k}for(r[1]=A-P,C>=w?r[0]=192:g[C]<m?(r[0]=g[C]<256?0:96,r[2]=g[C++]):(r[0]=O[g[C]-m]+16+64,r[2]=S[g[C++]-m]),R=1<<A-P,T=b>>>P;T<L;T+=R)f.set(r,(k+T)*3);for(T=1<<A-1;(b&T)!==0;T>>>=1)b^=T;for(b^=T,I=(1<<P)-1;(b&I)!=a[x];)x--,P-=y,I=(1<<P)-1}return H!==0&&h!=1?se:v}function l(_){let d;for(t||(t=[],e=[],n=new Int32Array(ie+1),r=[],i=new Int32Array(ie),a=new Int32Array(ie+1)),e.length<_&&(e=[]),d=0;d<_;d++)e[d]=0;for(d=0;d<ie+1;d++)n[d]=0;for(d=0;d<3;d++)r[d]=0;i.set(n.subarray(0,ie),0),a.set(n.subarray(0,ie+1),0)}s.inflate_trees_bits=function(_,d,w,m,S){let O;return l(19),t[0]=0,O=o(_,0,19,19,null,null,w,d,m,t,e),O==W?S.msg="oversubscribed dynamic bit lengths tree":(O==se||d[0]===0)&&(S.msg="incomplete dynamic bit lengths tree",O=W),O},s.inflate_trees_dynamic=function(_,d,w,m,S,O,u,c,f){let p;return l(288),t[0]=0,p=o(w,0,_,257,Rr,Ar,O,m,c,t,e),p!=v||m[0]===0?(p==W?f.msg="oversubscribed literal/length tree":p!=Bt&&(f.msg="incomplete literal/length tree",p=W),p):(l(288),p=o(w,_,d,0,Or,Ir,u,S,c,t,e),p!=v||S[0]===0&&_>257?(p==W?f.msg="oversubscribed distance tree":p==se?(f.msg="incomplete distance tree",p=W):p!=Bt&&(f.msg="empty distance tree with lengths",p=W),p):v)}}ft.inflate_trees_fixed=function(s,t,e,n){return s[0]=Er,t[0]=xr,e[0]=Tr,n[0]=Sr,v};const We=0,jt=1,Gt=2,Yt=3,qt=4,Vt=5,Zt=6,ze=7,Kt=8,He=9;function Cr(){const s=this;let t,e=0,n,r=0,i=0,a=0,o=0,l=0,_=0,d=0,w,m=0,S,O=0;function u(c,f,p,g,E,R,h,x){let b,T,A,y,I,C,k,P,N,H,L,j,D,K,F,M;k=x.next_in_index,P=x.avail_in,I=h.bitb,C=h.bitk,N=h.write,H=N<h.read?h.read-N-1:h.end-N,L=$[c],j=$[f];do{for(;C<20;)P--,I|=(x.read_byte(k++)&255)<<C,C+=8;if(b=I&L,T=p,A=g,M=(A+b)*3,(y=T[M])===0){I>>=T[M+1],C-=T[M+1],h.win[N++]=T[M+2],H--;continue}do{if(I>>=T[M+1],C-=T[M+1],(y&16)!==0){for(y&=15,D=T[M+2]+(I&$[y]),I>>=y,C-=y;C<15;)P--,I|=(x.read_byte(k++)&255)<<C,C+=8;b=I&j,T=E,A=R,M=(A+b)*3,y=T[M];do if(I>>=T[M+1],C-=T[M+1],(y&16)!==0){for(y&=15;C<y;)P--,I|=(x.read_byte(k++)&255)<<C,C+=8;if(K=T[M+2]+(I&$[y]),I>>=y,C-=y,H-=D,N>=K)F=N-K,N-F>0&&2>N-F?(h.win[N++]=h.win[F++],h.win[N++]=h.win[F++],D-=2):(h.win.set(h.win.subarray(F,F+2),N),N+=2,F+=2,D-=2);else{F=N-K;do F+=h.end;while(F<0);if(y=h.end-F,D>y){if(D-=y,N-F>0&&y>N-F)do h.win[N++]=h.win[F++];while(--y!==0);else h.win.set(h.win.subarray(F,F+y),N),N+=y,F+=y,y=0;F=0}}if(N-F>0&&D>N-F)do h.win[N++]=h.win[F++];while(--D!==0);else h.win.set(h.win.subarray(F,F+D),N),N+=D,F+=D,D=0;break}else if((y&64)===0)b+=T[M+2],b+=I&$[y],M=(A+b)*3,y=T[M];else return x.msg="invalid distance code",D=x.avail_in-P,D=C>>3<D?C>>3:D,P+=D,k-=D,C-=D<<3,h.bitb=I,h.bitk=C,x.avail_in=P,x.total_in+=k-x.next_in_index,x.next_in_index=k,h.write=N,W;while(!0);break}if((y&64)===0){if(b+=T[M+2],b+=I&$[y],M=(A+b)*3,(y=T[M])===0){I>>=T[M+1],C-=T[M+1],h.win[N++]=T[M+2],H--;break}}else return(y&32)!==0?(D=x.avail_in-P,D=C>>3<D?C>>3:D,P+=D,k-=D,C-=D<<3,h.bitb=I,h.bitk=C,x.avail_in=P,x.total_in+=k-x.next_in_index,x.next_in_index=k,h.write=N,ne):(x.msg="invalid literal/length code",D=x.avail_in-P,D=C>>3<D?C>>3:D,P+=D,k-=D,C-=D<<3,h.bitb=I,h.bitk=C,x.avail_in=P,x.total_in+=k-x.next_in_index,x.next_in_index=k,h.write=N,W)}while(!0)}while(H>=258&&P>=10);return D=x.avail_in-P,D=C>>3<D?C>>3:D,P+=D,k-=D,C-=D<<3,h.bitb=I,h.bitk=C,x.avail_in=P,x.total_in+=k-x.next_in_index,x.next_in_index=k,h.write=N,v}s.init=function(c,f,p,g,E,R){t=We,_=c,d=f,w=p,m=g,S=E,O=R,n=null},s.proc=function(c,f,p){let g,E,R,h=0,x=0,b=0,T,A,y,I;for(b=f.next_in_index,T=f.avail_in,h=c.bitb,x=c.bitk,A=c.write,y=A<c.read?c.read-A-1:c.end-A;;)switch(t){case We:if(y>=258&&T>=10&&(c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,p=u(_,d,w,m,S,O,c,f),b=f.next_in_index,T=f.avail_in,h=c.bitb,x=c.bitk,A=c.write,y=A<c.read?c.read-A-1:c.end-A,p!=v)){t=p==ne?ze:He;break}i=_,n=w,r=m,t=jt;case jt:for(g=i;x<g;){if(T!==0)p=v;else return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);T--,h|=(f.read_byte(b++)&255)<<x,x+=8}if(E=(r+(h&$[g]))*3,h>>>=n[E+1],x-=n[E+1],R=n[E],R===0){a=n[E+2],t=Zt;break}if((R&16)!==0){o=R&15,e=n[E+2],t=Gt;break}if((R&64)===0){i=R,r=E/3+n[E+2];break}if((R&32)!==0){t=ze;break}return t=He,f.msg="invalid literal/length code",p=W,c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);case Gt:for(g=o;x<g;){if(T!==0)p=v;else return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);T--,h|=(f.read_byte(b++)&255)<<x,x+=8}e+=h&$[g],h>>=g,x-=g,i=d,n=S,r=O,t=Yt;case Yt:for(g=i;x<g;){if(T!==0)p=v;else return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);T--,h|=(f.read_byte(b++)&255)<<x,x+=8}if(E=(r+(h&$[g]))*3,h>>=n[E+1],x-=n[E+1],R=n[E],(R&16)!==0){o=R&15,l=n[E+2],t=qt;break}if((R&64)===0){i=R,r=E/3+n[E+2];break}return t=He,f.msg="invalid distance code",p=W,c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);case qt:for(g=o;x<g;){if(T!==0)p=v;else return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);T--,h|=(f.read_byte(b++)&255)<<x,x+=8}l+=h&$[g],h>>=g,x-=g,t=Vt;case Vt:for(I=A-l;I<0;)I+=c.end;for(;e!==0;){if(y===0&&(A==c.end&&c.read!==0&&(A=0,y=A<c.read?c.read-A-1:c.end-A),y===0&&(c.write=A,p=c.inflate_flush(f,p),A=c.write,y=A<c.read?c.read-A-1:c.end-A,A==c.end&&c.read!==0&&(A=0,y=A<c.read?c.read-A-1:c.end-A),y===0)))return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);c.win[A++]=c.win[I++],y--,I==c.end&&(I=0),e--}t=We;break;case Zt:if(y===0&&(A==c.end&&c.read!==0&&(A=0,y=A<c.read?c.read-A-1:c.end-A),y===0&&(c.write=A,p=c.inflate_flush(f,p),A=c.write,y=A<c.read?c.read-A-1:c.end-A,A==c.end&&c.read!==0&&(A=0,y=A<c.read?c.read-A-1:c.end-A),y===0)))return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);p=v,c.win[A++]=a,y--,t=We;break;case ze:if(x>7&&(x-=8,T++,b--),c.write=A,p=c.inflate_flush(f,p),A=c.write,y=A<c.read?c.read-A-1:c.end-A,c.read!=c.write)return c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);t=Kt;case Kt:return p=ne,c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);case He:return p=W,c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p);default:return p=X,c.bitb=h,c.bitk=x,f.avail_in=T,f.total_in+=b-f.next_in_index,f.next_in_index=b,c.write=A,c.inflate_flush(f,p)}},s.free=function(){}}const Xt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],we=0,et=1,$t=2,Jt=3,Qt=4,zt=5,Be=6,je=7,en=8,he=9;function Nr(s,t){const e=this;let n=we,r=0,i=0,a=0,o;const l=[0],_=[0],d=new Cr;let w=0,m=new Int32Array(jn*3);const S=0,O=new ft;e.bitk=0,e.bitb=0,e.win=new Uint8Array(t),e.end=t,e.read=0,e.write=0,e.reset=function(u,c){c&&(c[0]=S),n==Be&&d.free(u),n=we,e.bitk=0,e.bitb=0,e.read=e.write=0},e.reset(s,null),e.inflate_flush=function(u,c){let f,p,g;return p=u.next_out_index,g=e.read,f=(g<=e.write?e.write:e.end)-g,f>u.avail_out&&(f=u.avail_out),f!==0&&c==se&&(c=v),u.avail_out-=f,u.total_out+=f,u.next_out.set(e.win.subarray(g,g+f),p),p+=f,g+=f,g==e.end&&(g=0,e.write==e.end&&(e.write=0),f=e.write-g,f>u.avail_out&&(f=u.avail_out),f!==0&&c==se&&(c=v),u.avail_out-=f,u.total_out+=f,u.next_out.set(e.win.subarray(g,g+f),p),p+=f,g+=f),u.next_out_index=p,e.read=g,c},e.proc=function(u,c){let f,p,g,E,R,h,x,b;for(E=u.next_in_index,R=u.avail_in,p=e.bitb,g=e.bitk,h=e.write,x=h<e.read?e.read-h-1:e.end-h;;){let T,A,y,I,C,k,P,N;switch(n){case we:for(;g<3;){if(R!==0)c=v;else return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);R--,p|=(u.read_byte(E++)&255)<<g,g+=8}switch(f=p&7,w=f&1,f>>>1){case 0:p>>>=3,g-=3,f=g&7,p>>>=f,g-=f,n=et;break;case 1:T=[],A=[],y=[[]],I=[[]],ft.inflate_trees_fixed(T,A,y,I),d.init(T[0],A[0],y[0],0,I[0],0),p>>>=3,g-=3,n=Be;break;case 2:p>>>=3,g-=3,n=Jt;break;case 3:return p>>>=3,g-=3,n=he,u.msg="invalid block type",c=W,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c)}break;case et:for(;g<32;){if(R!==0)c=v;else return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);R--,p|=(u.read_byte(E++)&255)<<g,g+=8}if((~p>>>16&65535)!=(p&65535))return n=he,u.msg="invalid stored block lengths",c=W,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);r=p&65535,p=g=0,n=r!==0?$t:w!==0?je:we;break;case $t:if(R===0||x===0&&(h==e.end&&e.read!==0&&(h=0,x=h<e.read?e.read-h-1:e.end-h),x===0&&(e.write=h,c=e.inflate_flush(u,c),h=e.write,x=h<e.read?e.read-h-1:e.end-h,h==e.end&&e.read!==0&&(h=0,x=h<e.read?e.read-h-1:e.end-h),x===0)))return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);if(c=v,f=r,f>R&&(f=R),f>x&&(f=x),e.win.set(u.read_buf(E,f),h),E+=f,R-=f,h+=f,x-=f,(r-=f)!==0)break;n=w!==0?je:we;break;case Jt:for(;g<14;){if(R!==0)c=v;else return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);R--,p|=(u.read_byte(E++)&255)<<g,g+=8}if(i=f=p&16383,(f&31)>29||(f>>5&31)>29)return n=he,u.msg="too many length or distance symbols",c=W,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);if(f=258+(f&31)+(f>>5&31),!o||o.length<f)o=[];else for(b=0;b<f;b++)o[b]=0;p>>>=14,g-=14,a=0,n=Qt;case Qt:for(;a<4+(i>>>10);){for(;g<3;){if(R!==0)c=v;else return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);R--,p|=(u.read_byte(E++)&255)<<g,g+=8}o[Xt[a++]]=p&7,p>>>=3,g-=3}for(;a<19;)o[Xt[a++]]=0;if(l[0]=7,f=O.inflate_trees_bits(o,l,_,m,u),f!=v)return c=f,c==W&&(o=null,n=he),e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);a=0,n=zt;case zt:for(;f=i,!(a>=258+(f&31)+(f>>5&31));){let H,L;for(f=l[0];g<f;){if(R!==0)c=v;else return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);R--,p|=(u.read_byte(E++)&255)<<g,g+=8}if(f=m[(_[0]+(p&$[f]))*3+1],L=m[(_[0]+(p&$[f]))*3+2],L<16)p>>>=f,g-=f,o[a++]=L;else{for(b=L==18?7:L-14,H=L==18?11:3;g<f+b;){if(R!==0)c=v;else return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);R--,p|=(u.read_byte(E++)&255)<<g,g+=8}if(p>>>=f,g-=f,H+=p&$[b],p>>>=b,g-=b,b=a,f=i,b+H>258+(f&31)+(f>>5&31)||L==16&&b<1)return o=null,n=he,u.msg="invalid bit length repeat",c=W,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);L=L==16?o[b-1]:0;do o[b++]=L;while(--H!==0);a=b}}if(_[0]=-1,C=[],k=[],P=[],N=[],C[0]=9,k[0]=6,f=i,f=O.inflate_trees_dynamic(257+(f&31),1+(f>>5&31),o,C,k,P,N,m,u),f!=v)return f==W&&(o=null,n=he),c=f,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);d.init(C[0],k[0],m,P[0],m,N[0]),n=Be;case Be:if(e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,(c=d.proc(e,u,c))!=ne)return e.inflate_flush(u,c);if(c=v,d.free(u),E=u.next_in_index,R=u.avail_in,p=e.bitb,g=e.bitk,h=e.write,x=h<e.read?e.read-h-1:e.end-h,w===0){n=we;break}n=je;case je:if(e.write=h,c=e.inflate_flush(u,c),h=e.write,x=h<e.read?e.read-h-1:e.end-h,e.read!=e.write)return e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);n=en;case en:return c=ne,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);case he:return c=W,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c);default:return c=X,e.bitb=p,e.bitk=g,u.avail_in=R,u.total_in+=E-u.next_in_index,u.next_in_index=E,e.write=h,e.inflate_flush(u,c)}}},e.free=function(u){e.reset(u,null),e.win=null,m=null},e.set_dictionary=function(u,c,f){e.win.set(u.subarray(c,c+f),0),e.read=e.write=f},e.sync_point=function(){return n==et?1:0}}const Dr=32,Pr=8,kr=0,tn=1,nn=2,sn=3,rn=4,an=5,tt=6,Se=7,on=12,ae=13,Lr=[0,0,255,255];function vr(){const s=this;s.mode=0,s.method=0,s.was=[0],s.need=0,s.marker=0,s.wbits=0;function t(e){return!e||!e.istate?X:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=Se,e.istate.blocks.reset(e,null),v)}s.inflateEnd=function(e){return s.blocks&&s.blocks.free(e),s.blocks=null,v},s.inflateInit=function(e,n){return e.msg=null,s.blocks=null,n<8||n>15?(s.inflateEnd(e),X):(s.wbits=n,e.istate.blocks=new Nr(e,1<<n),t(e),v)},s.inflate=function(e,n){let r,i;if(!e||!e.istate||!e.next_in)return X;const a=e.istate;for(n=n==yr?se:v,r=se;;)switch(a.mode){case kr:if(e.avail_in===0)return r;if(r=n,e.avail_in--,e.total_in++,((a.method=e.read_byte(e.next_in_index++))&15)!=Pr){a.mode=ae,e.msg="unknown compression method",a.marker=5;break}if((a.method>>4)+8>a.wbits){a.mode=ae,e.msg="invalid win size",a.marker=5;break}a.mode=tn;case tn:if(e.avail_in===0)return r;if(r=n,e.avail_in--,e.total_in++,i=e.read_byte(e.next_in_index++)&255,((a.method<<8)+i)%31!==0){a.mode=ae,e.msg="incorrect header check",a.marker=5;break}if((i&Dr)===0){a.mode=Se;break}a.mode=nn;case nn:if(e.avail_in===0)return r;r=n,e.avail_in--,e.total_in++,a.need=(e.read_byte(e.next_in_index++)&255)<<24&4278190080,a.mode=sn;case sn:if(e.avail_in===0)return r;r=n,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<16&16711680,a.mode=rn;case rn:if(e.avail_in===0)return r;r=n,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<8&65280,a.mode=an;case an:return e.avail_in===0?r:(r=n,e.avail_in--,e.total_in++,a.need+=e.read_byte(e.next_in_index++)&255,a.mode=tt,gr);case tt:return a.mode=ae,e.msg="need dictionary",a.marker=0,X;case Se:if(r=a.blocks.proc(e,r),r==W){a.mode=ae,a.marker=0;break}if(r==v&&(r=n),r!=ne)return r;r=n,a.blocks.reset(e,a.was),a.mode=on;case on:return e.avail_in=0,ne;case ae:return W;default:return X}},s.inflateSetDictionary=function(e,n,r){let i=0,a=r;if(!e||!e.istate||e.istate.mode!=tt)return X;const o=e.istate;return a>=1<<o.wbits&&(a=(1<<o.wbits)-1,i=r-a),o.blocks.set_dictionary(n,i,a),o.mode=Se,v},s.inflateSync=function(e){let n,r,i,a,o;if(!e||!e.istate)return X;const l=e.istate;if(l.mode!=ae&&(l.mode=ae,l.marker=0),(n=e.avail_in)===0)return se;for(r=e.next_in_index,i=l.marker;n!==0&&i<4;)e.read_byte(r)==Lr[i]?i++:e.read_byte(r)!==0?i=0:i=4-i,r++,n--;return e.total_in+=r-e.next_in_index,e.next_in_index=r,e.avail_in=n,l.marker=i,i!=4?W:(a=e.total_in,o=e.total_out,t(e),e.total_in=a,e.total_out=o,l.mode=Se,v)},s.inflateSyncPoint=function(e){return!e||!e.istate||!e.istate.blocks?X:e.istate.blocks.sync_point()}}function Gn(){}Gn.prototype={inflateInit(s){const t=this;return t.istate=new vr,s||(s=wr),t.istate.inflateInit(t,s)},inflate(s){const t=this;return t.istate?t.istate.inflate(t,s):X},inflateEnd(){const s=this;if(!s.istate)return X;const t=s.istate.inflateEnd(s);return s.istate=null,t},inflateSync(){const s=this;return s.istate?s.istate.inflateSync(s):X},inflateSetDictionary(s,t){const e=this;return e.istate?e.istate.inflateSetDictionary(e,s,t):X},read_byte(s){return this.next_in[s]},read_buf(s,t){return this.next_in.subarray(s,s+t)}};function Fr(s){const t=this,e=new Gn,n=s&&s.chunkSize?Math.floor(s.chunkSize*2):128*1024,r=br,i=new Uint8Array(n);let a=!1;e.inflateInit(),e.next_out=i,t.append=function(o,l){const _=[];let d,w,m=0,S=0,O=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=n,e.avail_in===0&&!a&&(e.next_in_index=0,a=!0),d=e.inflate(r),a&&d===se){if(e.avail_in!==0)throw new Error("inflating: bad input")}else if(d!==v&&d!==ne)throw new Error("inflating: "+e.msg);if((a||d===ne)&&e.avail_in===o.length)throw new Error("inflating: bad input");e.next_out_index&&(e.next_out_index===n?_.push(new Uint8Array(i)):_.push(i.subarray(0,e.next_out_index))),O+=e.next_out_index,l&&e.next_in_index>0&&e.next_in_index!=m&&(l(e.next_in_index),m=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return _.length>1?(w=new Uint8Array(O),_.forEach(function(u){w.set(u,S),S+=u.length})):w=_[0]?new Uint8Array(_[0]):new Uint8Array,w}},t.flush=function(){e.inflateEnd()}}const pe=4294967295,le=65535,Mr=8,Ur=0,Wr=99,Hr=67324752,Yn=134695760,Br=Yn,cn=33639248,jr=101010256,ln=101075792,Gr=117853008,te=22,nt=20,st=56,Yr=12,qr=20,fn=4,Vr=1,Zr=39169,Kr=10,Xr=1,$r=21589,Jr=28789,Qr=25461,zr=6534,un=1,ei=6,dn=8,_n=2048,hn=16,ti=61440,ni=16384,si=73,pn="/",rt=30,ri=10,ii=14,ai=18,G=void 0,de="undefined",Pe="function";class mn{constructor(t){return class extends TransformStream{constructor(e,n){const r=new t(n);super({transform(i,a){a.enqueue(r.append(i))},flush(i){const a=r.flush();a&&i.enqueue(a)}})}}}}const oi=64;let qn=2;try{typeof navigator!=de&&navigator.hardwareConcurrency&&(qn=navigator.hardwareConcurrency)}catch{}const ci={chunkSize:512*1024,maxWorkers:qn,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:G,CompressionStreamNative:typeof CompressionStream!=de&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=de&&DecompressionStream},fe=Object.assign({},ci);function Vn(){return fe}function li(s){return Math.max(s.chunkSize,oi)}function Zn(s){const{baseURL:t,chunkSize:e,maxWorkers:n,terminateWorkerTimeout:r,useCompressionStream:i,useWebWorkers:a,Deflate:o,Inflate:l,CompressionStream:_,DecompressionStream:d,workerScripts:w}=s;if(oe("baseURL",t),oe("chunkSize",e),oe("maxWorkers",n),oe("terminateWorkerTimeout",r),oe("useCompressionStream",i),oe("useWebWorkers",a),o&&(fe.CompressionStream=new mn(o)),l&&(fe.DecompressionStream=new mn(l)),oe("CompressionStream",_),oe("DecompressionStream",d),w!==G){const{deflate:m,inflate:S}=w;if((m||S)&&(fe.workerScripts||(fe.workerScripts={})),m){if(!Array.isArray(m))throw new Error("workerScripts.deflate must be an array");fe.workerScripts.deflate=m}if(S){if(!Array.isArray(S))throw new Error("workerScripts.inflate must be an array");fe.workerScripts.inflate=S}}}function oe(s,t){t!==G&&(fe[s]=t)}function fi(){return"application/octet-stream"}const Kn=[];for(let s=0;s<256;s++){let t=s;for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t=t>>>1;Kn[s]=t}class Ve{constructor(t){this.crc=t||-1}append(t){let e=this.crc|0;for(let n=0,r=t.length|0;n<r;n++)e=e>>>8^Kn[(e^t[n])&255];this.crc=e}get(){return~this.crc}}class Xn extends TransformStream{constructor(){let t;const e=new Ve;super({transform(n,r){e.append(n),r.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function ui(s){if(typeof TextEncoder==de){s=unescape(encodeURIComponent(s));const t=new Uint8Array(s.length);for(let e=0;e<t.length;e++)t[e]=s.charCodeAt(e);return t}else return new TextEncoder().encode(s)}const Z={concat(s,t){if(s.length===0||t.length===0)return s.concat(t);const e=s[s.length-1],n=Z.getPartial(e);return n===32?s.concat(t):Z._shiftRight(t,n,e|0,s.slice(0,s.length-1))},bitLength(s){const t=s.length;if(t===0)return 0;const e=s[t-1];return(t-1)*32+Z.getPartial(e)},clamp(s,t){if(s.length*32<t)return s;s=s.slice(0,Math.ceil(t/32));const e=s.length;return t=t&31,e>0&&t&&(s[e-1]=Z.partial(t,s[e-1]&2147483648>>t-1,1)),s},partial(s,t,e){return s===32?t:(e?t|0:t<<32-s)+s*1099511627776},getPartial(s){return Math.round(s/1099511627776)||32},_shiftRight(s,t,e,n){for(n===void 0&&(n=[]);t>=32;t-=32)n.push(e),e=0;if(t===0)return n.concat(s);for(let a=0;a<s.length;a++)n.push(e|s[a]>>>t),e=s[a]<<32-t;const r=s.length?s[s.length-1]:0,i=Z.getPartial(r);return n.push(Z.partial(t+i&31,t+i>32?e:n.pop(),1)),n}},Ze={bytes:{fromBits(s){const e=Z.bitLength(s)/8,n=new Uint8Array(e);let r;for(let i=0;i<e;i++)(i&3)===0&&(r=s[i/4]),n[i]=r>>>24,r<<=8;return n},toBits(s){const t=[];let e,n=0;for(e=0;e<s.length;e++)n=n<<8|s[e],(e&3)===3&&(t.push(n),n=0);return e&3&&t.push(Z.partial(8*(e&3),n)),t}}},$n={};$n.sha1=class{constructor(s){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],s?(t._h=s._h.slice(0),t._buffer=s._buffer.slice(0),t._length=s._length):t.reset()}reset(){const s=this;return s._h=s._init.slice(0),s._buffer=[],s._length=0,s}update(s){const t=this;typeof s=="string"&&(s=Ze.utf8String.toBits(s));const e=t._buffer=Z.concat(t._buffer,s),n=t._length,r=t._length=n+Z.bitLength(s);if(r>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+n-(t.blockSize+n&t.blockSize-1);o<=r;o+=t.blockSize)t._block(i.subarray(16*a,16*(a+1))),a+=1;return e.splice(0,16*a),t}finalize(){const s=this;let t=s._buffer;const e=s._h;t=Z.concat(t,[Z.partial(1,1)]);for(let n=t.length+2;n&15;n++)t.push(0);for(t.push(Math.floor(s._length/4294967296)),t.push(s._length|0);t.length;)s._block(t.splice(0,16));return s.reset(),e}_f(s,t,e,n){if(s<=19)return t&e|~t&n;if(s<=39)return t^e^n;if(s<=59)return t&e|t&n|e&n;if(s<=79)return t^e^n}_S(s,t){return t<<s|t>>>32-s}_block(s){const t=this,e=t._h,n=Array(80);for(let _=0;_<16;_++)n[_]=s[_];let r=e[0],i=e[1],a=e[2],o=e[3],l=e[4];for(let _=0;_<=79;_++){_>=16&&(n[_]=t._S(1,n[_-3]^n[_-8]^n[_-14]^n[_-16]));const d=t._S(5,r)+t._f(_,i,a,o)+l+n[_]+t._key[Math.floor(_/20)]|0;l=o,o=a,a=t._S(30,i),i=r,r=d}e[0]=e[0]+r|0,e[1]=e[1]+i|0,e[2]=e[2]+a|0,e[3]=e[3]+o|0,e[4]=e[4]+l|0}};const Jn={};Jn.aes=class{constructor(s){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const e=t._tables[0][4],n=t._tables[1],r=s.length;let i,a,o,l=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[a=s.slice(0),o=[]],i=r;i<4*r+28;i++){let _=a[i-1];(i%r===0||r===8&&i%r===4)&&(_=e[_>>>24]<<24^e[_>>16&255]<<16^e[_>>8&255]<<8^e[_&255],i%r===0&&(_=_<<8^_>>>24^l<<24,l=l<<1^(l>>7)*283)),a[i]=a[i-r]^_}for(let _=0;i;_++,i--){const d=a[_&3?i:i-4];i<=4||_<4?o[_]=d:o[_]=n[0][e[d>>>24]]^n[1][e[d>>16&255]]^n[2][e[d>>8&255]]^n[3][e[d&255]]}}encrypt(s){return this._crypt(s,0)}decrypt(s){return this._crypt(s,1)}_precompute(){const s=this._tables[0],t=this._tables[1],e=s[4],n=t[4],r=[],i=[];let a,o,l,_;for(let d=0;d<256;d++)i[(r[d]=d<<1^(d>>7)*283)^d]=d;for(let d=a=0;!e[d];d^=o||1,a=i[a]||1){let w=a^a<<1^a<<2^a<<3^a<<4;w=w>>8^w&255^99,e[d]=w,n[w]=d,_=r[l=r[o=r[d]]];let m=_*16843009^l*65537^o*257^d*16843008,S=r[w]*257^w*16843008;for(let O=0;O<4;O++)s[O][d]=S=S<<24^S>>>8,t[O][w]=m=m<<24^m>>>8}for(let d=0;d<5;d++)s[d]=s[d].slice(0),t[d]=t[d].slice(0)}_crypt(s,t){if(s.length!==4)throw new Error("invalid aes block size");const e=this._key[t],n=e.length/4-2,r=[0,0,0,0],i=this._tables[t],a=i[0],o=i[1],l=i[2],_=i[3],d=i[4];let w=s[0]^e[0],m=s[t?3:1]^e[1],S=s[2]^e[2],O=s[t?1:3]^e[3],u=4,c,f,p;for(let g=0;g<n;g++)c=a[w>>>24]^o[m>>16&255]^l[S>>8&255]^_[O&255]^e[u],f=a[m>>>24]^o[S>>16&255]^l[O>>8&255]^_[w&255]^e[u+1],p=a[S>>>24]^o[O>>16&255]^l[w>>8&255]^_[m&255]^e[u+2],O=a[O>>>24]^o[w>>16&255]^l[m>>8&255]^_[S&255]^e[u+3],u+=4,w=c,m=f,S=p;for(let g=0;g<4;g++)r[t?3&-g:g]=d[w>>>24]<<24^d[m>>16&255]<<16^d[S>>8&255]<<8^d[O&255]^e[u++],c=w,w=m,m=S,S=O,O=c;return r}};const di={getRandomValues(s){const t=new Uint32Array(s.buffer),e=n=>{let r=987654321;const i=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&i,n=18e3*(n&65535)+(n>>16)&i,(((r<<16)+n&i)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,r;n<s.length;n+=4){const i=e((r||Math.random())*4294967296);r=i()*987654071,t[n/4]=i()*4294967296|0}return s}},Qn={};Qn.ctrGladman=class{constructor(s,t){this._prf=s,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(s){return this.calculate(this._prf,s,this._iv)}incWord(s){if((s>>24&255)===255){let t=s>>16&255,e=s>>8&255,n=s&255;t===255?(t=0,e===255?(e=0,n===255?n=0:++n):++e):++t,s=0,s+=t<<16,s+=e<<8,s+=n}else s+=1<<24;return s}incCounter(s){(s[0]=this.incWord(s[0]))===0&&(s[1]=this.incWord(s[1]))}calculate(s,t,e){let n;if(!(n=t.length))return[];const r=Z.bitLength(t);for(let i=0;i<n;i+=4){this.incCounter(e);const a=s.encrypt(e);t[i]^=a[0],t[i+1]^=a[1],t[i+2]^=a[2],t[i+3]^=a[3]}return Z.clamp(t,r)}};const me={importKey(s){return new me.hmacSha1(Ze.bytes.toBits(s))},pbkdf2(s,t,e,n){if(e=e||1e4,n<0||e<0)throw new Error("invalid params to pbkdf2");const r=(n>>5)+1<<2;let i,a,o,l,_;const d=new ArrayBuffer(r),w=new DataView(d);let m=0;const S=Z;for(t=Ze.bytes.toBits(t),_=1;m<(r||1);_++){for(i=a=s.encrypt(S.concat(t,[_])),o=1;o<e;o++)for(a=s.encrypt(a),l=0;l<a.length;l++)i[l]^=a[l];for(o=0;m<(r||1)&&o<i.length;o++)w.setInt32(m,i[o]),m+=4}return d.slice(0,n/8)}};me.hmacSha1=class{constructor(s){const t=this,e=t._hash=$n.sha1,n=[[],[]];t._baseHash=[new e,new e];const r=t._baseHash[0].blockSize/32;s.length>r&&(s=new e().update(s).finalize());for(let i=0;i<r;i++)n[0][i]=s[i]^909522486,n[1][i]=s[i]^1549556828;t._baseHash[0].update(n[0]),t._baseHash[1].update(n[1]),t._resultHash=new e(t._baseHash[0])}reset(){const s=this;s._resultHash=new s._hash(s._baseHash[0]),s._updated=!1}update(s){const t=this;t._updated=!0,t._resultHash.update(s)}digest(){const s=this,t=s._resultHash.finalize(),e=new s._hash(s._baseHash[1]).update(t).finalize();return s.reset(),e}encrypt(s){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(s),this.digest(s)}};const _i=typeof crypto!=de&&typeof crypto.getRandomValues==Pe,yt="Invalid password",Et="Invalid signature",xt="zipjs-abort-check-password";function zn(s){return _i?crypto.getRandomValues(s):di.getRandomValues(s)}const ge=16,hi="raw",es={name:"PBKDF2"},pi={name:"HMAC"},mi="SHA-1",wi=Object.assign({hash:pi},es),ut=Object.assign({iterations:1e3,hash:{name:mi}},es),gi=["deriveBits"],Ie=[8,12,16],Re=[16,24,32],ce=10,bi=[0,0,0,0],$e=typeof crypto!=de,ke=$e&&crypto.subtle,ts=$e&&typeof ke!=de,z=Ze.bytes,yi=Jn.aes,Ei=Qn.ctrGladman,xi=me.hmacSha1;let wn=$e&&ts&&typeof ke.importKey==Pe,gn=$e&&ts&&typeof ke.deriveBits==Pe;class Ti extends TransformStream{constructor({password:t,rawPassword:e,signed:n,encryptionStrength:r,checkPasswordOnly:i}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:rs(t,e),signed:n,strength:r-1,pending:new Uint8Array})},async transform(a,o){const l=this,{password:_,strength:d,resolveReady:w,ready:m}=l;_?(await Ri(l,d,_,J(a,0,Ie[d]+2)),a=J(a,Ie[d]+2),i?o.error(new Error(xt)):w()):await m;const S=new Uint8Array(a.length-ce-(a.length-ce)%ge);o.enqueue(ns(l,a,S,0,ce,!0))},async flush(a){const{signed:o,ctr:l,hmac:_,pending:d,ready:w}=this;if(_&&l){await w;const m=J(d,0,d.length-ce),S=J(d,d.length-ce);let O=new Uint8Array;if(m.length){const u=Ne(z,m);_.update(u);const c=l.update(u);O=Ce(z,c)}if(o){const u=J(Ce(z,_.digest()),0,ce);for(let c=0;c<ce;c++)if(u[c]!=S[c])throw new Error(Et)}a.enqueue(O)}}})}}class Si extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:n}){let r;super({start(){Object.assign(this,{ready:new Promise(i=>this.resolveReady=i),password:rs(t,e),strength:n-1,pending:new Uint8Array})},async transform(i,a){const o=this,{password:l,strength:_,resolveReady:d,ready:w}=o;let m=new Uint8Array;l?(m=await Ai(o,_,l),d()):await w;const S=new Uint8Array(m.length+i.length-i.length%ge);S.set(m,0),a.enqueue(ns(o,i,S,m.length,0))},async flush(i){const{ctr:a,hmac:o,pending:l,ready:_}=this;if(o&&a){await _;let d=new Uint8Array;if(l.length){const w=a.update(Ne(z,l));o.update(w),d=Ce(z,w)}r.signature=Ce(z,o.digest()).slice(0,ce),i.enqueue(Tt(d,r.signature))}}}),r=this}}function ns(s,t,e,n,r,i){const{ctr:a,hmac:o,pending:l}=s,_=t.length-r;l.length&&(t=Tt(l,t),e=Ci(e,_-_%ge));let d;for(d=0;d<=_-ge;d+=ge){const w=Ne(z,J(t,d,d+ge));i&&o.update(w);const m=a.update(w);i||o.update(m),e.set(Ce(z,m),d+n)}return s.pending=J(t,d),e}async function Ri(s,t,e,n){const r=await ss(s,t,e,J(n,0,Ie[t])),i=J(n,Ie[t]);if(r[0]!=i[0]||r[1]!=i[1])throw new Error(yt)}async function Ai(s,t,e){const n=zn(new Uint8Array(Ie[t])),r=await ss(s,t,e,n);return Tt(n,r)}async function ss(s,t,e,n){s.password=null;const r=await Oi(hi,e,wi,!1,gi),i=await Ii(Object.assign({salt:n},ut),r,8*(Re[t]*2+2)),a=new Uint8Array(i),o=Ne(z,J(a,0,Re[t])),l=Ne(z,J(a,Re[t],Re[t]*2)),_=J(a,Re[t]*2);return Object.assign(s,{keys:{key:o,authentication:l,passwordVerification:_},ctr:new Ei(new yi(o),Array.from(bi)),hmac:new xi(l)}),_}async function Oi(s,t,e,n,r){if(wn)try{return await ke.importKey(s,t,e,n,r)}catch{return wn=!1,me.importKey(t)}else return me.importKey(t)}async function Ii(s,t,e){if(gn)try{return await ke.deriveBits(s,t,e)}catch{return gn=!1,me.pbkdf2(t,s.salt,ut.iterations,e)}else return me.pbkdf2(t,s.salt,ut.iterations,e)}function rs(s,t){return t===G?ui(s):t}function Tt(s,t){let e=s;return s.length+t.length&&(e=new Uint8Array(s.length+t.length),e.set(s,0),e.set(t,s.length)),e}function Ci(s,t){if(t&&t>s.length){const e=s;s=new Uint8Array(t),s.set(e,0)}return s}function J(s,t,e){return s.subarray(t,e)}function Ce(s,t){return s.fromBits(t)}function Ne(s,t){return s.toBits(t)}const Oe=12;class Ni extends TransformStream{constructor({password:t,passwordVerification:e,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),is(this,t)},transform(r,i){const a=this;if(a.password){const o=bn(a,r.subarray(0,Oe));if(a.password=null,o.at(-1)!=a.passwordVerification)throw new Error(yt);r=r.subarray(Oe)}n?i.error(new Error(xt)):i.enqueue(bn(a,r))}})}}class Di extends TransformStream{constructor({password:t,passwordVerification:e}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),is(this,t)},transform(n,r){const i=this;let a,o;if(i.password){i.password=null;const l=zn(new Uint8Array(Oe));l[Oe-1]=i.passwordVerification,a=new Uint8Array(n.length+l.length),a.set(yn(i,l),0),o=Oe}else a=new Uint8Array(n.length),o=0;a.set(yn(i,n),o),r.enqueue(a)}})}}function bn(s,t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=as(s)^t[n],St(s,e[n]);return e}function yn(s,t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=as(s)^t[n],St(s,t[n]);return e}function is(s,t){const e=[305419896,591751049,878082192];Object.assign(s,{keys:e,crcKey0:new Ve(e[0]),crcKey2:new Ve(e[2])});for(let n=0;n<t.length;n++)St(s,t.charCodeAt(n))}function St(s,t){let[e,n,r]=s.keys;s.crcKey0.append([t]),e=~s.crcKey0.get(),n=En(Math.imul(En(n+os(e)),134775813)+1),s.crcKey2.append([n>>>24]),r=~s.crcKey2.get(),s.keys=[e,n,r]}function as(s){const t=s.keys[2]|2;return os(Math.imul(t,t^1)>>>8)}function os(s){return s&255}function En(s){return s&4294967295}const Rt="Invalid uncompressed size",xn="deflate-raw";class Pi extends TransformStream{constructor(t,{chunkSize:e,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:i,encrypted:a,useCompressionStream:o,zipCrypto:l,signed:_,level:d}=t,w=this;let m,S,O=super.readable;(!a||l)&&_&&(m=new Xn,O=re(O,m)),i&&(O=ls(O,o,{level:d,chunkSize:e},r,n)),a&&(l?O=re(O,new Di(t)):(S=new Si(t),O=re(O,S))),cs(w,O,()=>{let u;a&&!l&&(u=S.signature),(!a||l)&&_&&(u=new DataView(m.value.buffer).getUint32(0)),w.signature=u})}}class ki extends TransformStream{constructor(t,{chunkSize:e,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:a,signed:o,signature:l,compressed:_,useCompressionStream:d}=t;let w,m,S=super.readable;a&&(i?S=re(S,new Ni(t)):(m=new Ti(t),S=re(S,m))),_&&(S=ls(S,d,{chunkSize:e},r,n)),(!a||i)&&o&&(w=new Xn,S=re(S,w)),cs(this,S,()=>{if((!a||i)&&o){const O=new DataView(w.value.buffer);if(l!=O.getUint32(0,!1))throw new Error(Et)}})}}function cs(s,t,e){t=re(t,new TransformStream({flush:e})),Object.defineProperty(s,"readable",{get(){return t}})}function ls(s,t,e,n,r){try{const i=t&&n?n:r;s=re(s,new i(xn,e))}catch(i){if(t)s=re(s,new r(xn,e));else throw i}return s}function re(s,t){return s.pipeThrough(t)}const Li="message",vi="start",Fi="pull",Tn="data",Mi="ack",Sn="close",Ui="deflate",fs="inflate";class Wi extends TransformStream{constructor(t,e){super({});const n=this,{codecType:r}=t;let i;r.startsWith(Ui)?i=Pi:r.startsWith(fs)&&(i=ki),n.outputSize=0;let a=0;const o=new i(t,e),l=super.readable,_=new TransformStream({transform(w,m){w&&w.length&&(a+=w.length,m.enqueue(w))},flush(){Object.assign(n,{inputSize:a})}}),d=new TransformStream({transform(w,m){if(w&&w.length&&(m.enqueue(w),n.outputSize+=w.length,t.outputSize&&n.outputSize>t.outputSize))throw new Error(Rt)},flush(){const{signature:w}=o;Object.assign(n,{signature:w,inputSize:a})}});Object.defineProperty(n,"readable",{get(){return l.pipeThrough(_).pipeThrough(o).pipeThrough(d)}})}}class Hi extends TransformStream{constructor(t){let e;super({transform:n,flush(r){e&&e.length&&r.enqueue(e)}});function n(r,i){if(e){const a=new Uint8Array(e.length+r.length);a.set(e),a.set(r,e.length),r=a,e=null}r.length>t?(i.enqueue(r.slice(0,t)),n(r.slice(t),i)):e=r}}}let us=typeof Worker!=de;class it{constructor(t,{readable:e,writable:n},{options:r,config:i,streamOptions:a,useWebWorkers:o,transferStreams:l,scripts:_},d){const{signal:w}=a;return Object.assign(t,{busy:!0,readable:e.pipeThrough(new Hi(i.chunkSize)).pipeThrough(new Bi(a),{signal:w}),writable:n,options:Object.assign({},r),scripts:_,transferStreams:l,terminate(){return new Promise(m=>{const{worker:S,busy:O}=t;S?(O?t.resolveTerminated=m:(S.terminate(),m()),t.interface=null):m()})},onTaskFinished(){const{resolveTerminated:m}=t;m&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),m()),t.busy=!1,d(t)}}),(o&&us?ji:ds)(t,i)}}class Bi extends TransformStream{constructor({onstart:t,onprogress:e,size:n,onend:r}){let i=0;super({async start(){t&&await at(t,n)},async transform(a,o){i+=a.length,e&&await at(e,i,n),o.enqueue(a)},async flush(){r&&await at(r,i)}})}}async function at(s,...t){try{await s(...t)}catch{}}function ds(s,t){return{run:()=>Gi(s,t)}}function ji(s,t){const{baseURL:e,chunkSize:n}=t;if(!s.interface){let r;try{r=Vi(s.scripts[0],e,s)}catch{return us=!1,ds(s,t)}Object.assign(s,{worker:r,interface:{run:()=>Yi(s,{chunkSize:n})}})}return s.interface}async function Gi({options:s,readable:t,writable:e,onTaskFinished:n},r){let i;try{i=new Wi(s,r),await t.pipeThrough(i).pipeTo(e,{preventClose:!0,preventAbort:!0});const{signature:a,inputSize:o,outputSize:l}=i;return{signature:a,inputSize:o,outputSize:l}}catch(a){throw i&&(a.outputSize=i.outputSize),a}finally{n()}}async function Yi(s,t){let e,n;const r=new Promise((m,S)=>{e=m,n=S});Object.assign(s,{reader:null,writer:null,resolveResult:e,rejectResult:n,result:r});const{readable:i,options:a,scripts:o}=s,{writable:l,closed:_}=qi(s.writable),d=Ge({type:vi,scripts:o.slice(1),options:a,config:t,readable:i,writable:l},s);d||Object.assign(s,{reader:i.getReader(),writer:l.getWriter()});const w=await r;return d||await l.getWriter().close(),await _,w}function qi(s){let t;const e=new Promise(r=>t=r);return{writable:new WritableStream({async write(r){const i=s.getWriter();await i.ready,await i.write(r),i.releaseLock()},close(){t()},abort(r){return s.getWriter().abort(r)}}),closed:e}}let Rn=!0,An=!0;function Vi(s,t,e){const n={type:"module"};let r,i;typeof s==Pe&&(s=s());try{r=new URL(s,t)}catch{r=s}if(Rn)try{i=new Worker(r)}catch{Rn=!1,i=new Worker(r,n)}else i=new Worker(r,n);return i.addEventListener(Li,a=>Zi(a,e)),i}function Ge(s,{worker:t,writer:e,onTaskFinished:n,transferStreams:r}){try{const{value:i,readable:a,writable:o}=s,l=[];if(i&&(i.byteLength<i.buffer.byteLength?s.value=i.buffer.slice(0,i.byteLength):s.value=i.buffer,l.push(s.value)),r&&An?(a&&l.push(a),o&&l.push(o)):s.readable=s.writable=null,l.length)try{return t.postMessage(s,l),!0}catch{An=!1,s.readable=s.writable=null,t.postMessage(s)}else t.postMessage(s)}catch(i){throw e&&e.releaseLock(),n(),i}}async function Zi({data:s},t){const{type:e,value:n,messageId:r,result:i,error:a}=s,{reader:o,writer:l,resolveResult:_,rejectResult:d,onTaskFinished:w}=t;try{if(a){const{message:S,stack:O,code:u,name:c,outputSize:f}=a,p=new Error(S);Object.assign(p,{stack:O,code:u,name:c,outputSize:f}),m(p)}else{if(e==Fi){const{value:S,done:O}=await o.read();Ge({type:Tn,value:S,done:O,messageId:r},t)}e==Tn&&(await l.ready,await l.write(new Uint8Array(n)),Ge({type:Mi,messageId:r},t)),e==Sn&&m(null,i)}}catch(S){Ge({type:Sn,messageId:r},t),m(S)}function m(S,O){S?d(S):_(O),l&&l.releaseLock(),w()}}let ue=[];const ot=[];let On=0;async function Ki(s,t){const{options:e,config:n}=t,{transferStreams:r,useWebWorkers:i,useCompressionStream:a,codecType:o,compressed:l,signed:_,encrypted:d}=e,{workerScripts:w,maxWorkers:m}=n;t.transferStreams=r||r===G;const S=!l&&!_&&!d&&!t.transferStreams;return t.useWebWorkers=!S&&(i||i===G&&n.useWebWorkers),t.scripts=t.useWebWorkers&&w?w[o]:[],e.useCompressionStream=a||a===G&&n.useCompressionStream,(await O()).run();async function O(){const c=ue.find(f=>!f.busy);if(c)return dt(c),new it(c,s,t,u);if(ue.length<m){const f={indexWorker:On};return On++,ue.push(f),new it(f,s,t,u)}else return new Promise(f=>ot.push({resolve:f,stream:s,workerOptions:t}))}function u(c){if(ot.length){const[{resolve:f,stream:p,workerOptions:g}]=ot.splice(0,1);f(new it(c,p,g,u))}else c.worker?(dt(c),Xi(c,t)):ue=ue.filter(f=>f!=c)}}function Xi(s,t){const{config:e}=t,{terminateWorkerTimeout:n}=e;Number.isFinite(n)&&n>=0&&(s.terminated?s.terminated=!1:s.terminateTimeout=setTimeout(async()=>{ue=ue.filter(r=>r!=s);try{await s.terminate()}catch{}},n))}function dt(s){const{terminateTimeout:t}=s;t&&(clearTimeout(t),s.terminateTimeout=null)}async function $i(){await Promise.allSettled(ue.map(s=>(dt(s),s.terminate())))}const _s="HTTP error ",Le="HTTP Range not supported",hs="Writer iterator completed too soon",ps="Writer not initialized",Ji="text/plain",Qi="Content-Length",zi="Content-Range",ea="Accept-Ranges",ta="Range",na="Content-Type",sa="HEAD",At="GET",ms="bytes",ra=64*1024,Ot="writable";class Je{constructor(){this.size=0}init(){this.initialized=!0}}class _e extends Je{get readable(){const t=this,{chunkSize:e=ra}=t,n=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:i=0,size:a,diskNumberStart:o}=n,{chunkOffset:l}=this,_=a===G?e:Math.min(e,a-l),d=await Y(t,i+l,_,o);r.enqueue(d),l+e>a||a===G&&!d.length&&_?r.close():this.chunkOffset+=e}});return n}}class It extends Je{constructor(){super();const t=this,e=new WritableStream({write(n){if(!t.initialized)throw new Error(ps);return t.writeUint8Array(n)}});Object.defineProperty(t,Ot,{get(){return e}})}writeUint8Array(){}}class ia extends _e{constructor(t){super();let e=t.length;for(;t.charAt(e-1)=="=";)e--;const n=t.indexOf(",")+1;Object.assign(this,{dataURI:t,dataStart:n,size:Math.floor((e-n)*.75)})}readUint8Array(t,e){const{dataStart:n,dataURI:r}=this,i=new Uint8Array(e),a=Math.floor(t/3)*4,o=atob(r.substring(a+n,Math.ceil((t+e)/3)*4+n)),l=t-Math.floor(a/4)*3;let _=0;for(let d=l;d<l+e&&d<o.length;d++)i[d-l]=o.charCodeAt(d),_++;return _<i.length?i.subarray(0,_):i}}class aa extends It{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let n=0,r=e.pending;const i=e.pending.length;for(e.pending="",n=0;n<Math.floor((i+t.length)/3)*3-i;n++)r+=String.fromCharCode(t[n]);for(;n<t.length;n++)e.pending+=String.fromCharCode(t[n]);r.length&&(r.length>2?e.data+=btoa(r):e.pending+=r)}getData(){return this.data+btoa(this.pending)}}class Ct extends _e{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,e){const n=this,r=t+e;let a=await(t||r<n.size?n.blob.slice(t,r):n.blob).arrayBuffer();return a.byteLength>e&&(a=a.slice(t,r)),new Uint8Array(a)}}class ws extends Je{constructor(t){super();const e=this,n=new TransformStream,r=[];t&&r.push([na,t]),Object.defineProperty(e,Ot,{get(){return n.writable}}),e.blob=new Response(n.readable,{headers:r}).blob()}getData(){return this.blob}}class oa extends Ct{constructor(t){super(new Blob([t],{type:Ji}))}}class ca extends ws{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){const{encoding:t,utf8:e}=this,n=await super.getData();if(n.text&&e)return n.text();{const r=new FileReader;return new Promise((i,a)=>{Object.assign(r,{onload:({target:o})=>i(o.result),onerror:()=>a(r.error)}),r.readAsText(n,t)})}}}class la extends _e{constructor(t,e){super(),gs(this,t,e)}async init(){await bs(this,_t,In),super.init()}readUint8Array(t,e){return ys(this,t,e,_t,In)}}class fa extends _e{constructor(t,e){super(),gs(this,t,e)}async init(){await bs(this,ht,Cn),super.init()}readUint8Array(t,e){return ys(this,t,e,ht,Cn)}}function gs(s,t,e){const{preventHeadRequest:n,useRangeHeader:r,forceRangeRequests:i,combineSizeEocd:a}=e;e=Object.assign({},e),delete e.preventHeadRequest,delete e.useRangeHeader,delete e.forceRangeRequests,delete e.combineSizeEocd,delete e.useXHR,Object.assign(s,{url:t,options:e,preventHeadRequest:n,useRangeHeader:r,forceRangeRequests:i,combineSizeEocd:a})}async function bs(s,t,e){const{url:n,preventHeadRequest:r,useRangeHeader:i,forceRangeRequests:a,combineSizeEocd:o}=s;if(ha(n)&&(i||a)&&(typeof r>"u"||r)){const l=await t(At,s,Es(s,o?-te:void 0));if(!a&&l.headers.get(ea)!=ms)throw new Error(Le);{o&&(s.eocdCache=new Uint8Array(await l.arrayBuffer()));let _;const d=l.headers.get(zi);if(d){const w=d.trim().split(/\s*\/\s*/);if(w.length){const m=w[1];m&&m!="*"&&(_=Number(m))}}_===G?await Nn(s,t,e):s.size=_}}else await Nn(s,t,e)}async function ys(s,t,e,n,r){const{useRangeHeader:i,forceRangeRequests:a,eocdCache:o,size:l,options:_}=s;if(i||a){if(o&&t==l-te&&e==te)return o;if(t>=l)return new Uint8Array;{t+e>l&&(e=l-t);const d=await n(At,s,Es(s,t,e));if(d.status!=206)throw new Error(Le);return new Uint8Array(await d.arrayBuffer())}}else{const{data:d}=s;return d||await r(s,_),new Uint8Array(s.data.subarray(t,t+e))}}function Es(s,t=0,e=1){return Object.assign({},Nt(s),{[ta]:ms+"="+(t<0?t:t+"-"+(t+e-1))})}function Nt({options:s}){const{headers:t}=s;if(t)return Symbol.iterator in t?Object.fromEntries(t):t}async function In(s){await xs(s,_t)}async function Cn(s){await xs(s,ht)}async function xs(s,t){const e=await t(At,s,Nt(s));s.data=new Uint8Array(await e.arrayBuffer()),s.size||(s.size=s.data.length)}async function Nn(s,t,e){if(s.preventHeadRequest)await e(s,s.options);else{const r=(await t(sa,s,Nt(s))).headers.get(Qi);r?s.size=Number(r):await e(s,s.options)}}async function _t(s,{options:t,url:e},n){const r=await fetch(e,Object.assign({},t,{method:s,headers:n}));if(r.status<400)return r;throw r.status==416?new Error(Le):new Error(_s+(r.statusText||r.status))}function ht(s,{url:t},e){return new Promise((n,r)=>{const i=new XMLHttpRequest;if(i.addEventListener("load",()=>{if(i.status<400){const a=[];i.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(o=>{const l=o.trim().split(/\s*:\s*/);l[0]=l[0].trim().replace(/^[a-z]|-[a-z]/g,_=>_.toUpperCase()),a.push(l)}),n({status:i.status,arrayBuffer:()=>i.response,headers:new Map(a)})}else r(i.status==416?new Error(Le):new Error(_s+(i.statusText||i.status)))},!1),i.addEventListener("error",a=>r(a.detail?a.detail.error:new Error("Network error")),!1),i.open(s,t),e)for(const a of Object.entries(e))i.setRequestHeader(a[0],a[1]);i.responseType="arraybuffer",i.send()})}class Ts extends _e{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR?new fa(t,e):new la(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 ua extends Ts{constructor(t,e={}){e.useRangeHeader=!0,super(t,e)}}class da extends _e{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class _a extends It{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 n=e.array;e.array=new Uint8Array(n.length+t.length),e.array.set(n)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.array}}class Dt extends _e{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(n,r)=>{await n.init(),r!=e.length-1&&(t.lastDiskOffset+=n.size),t.size+=n.size})),super.init()}async readUint8Array(t,e,n=0){const r=this,{readers:i}=this;let a,o=n;o==-1&&(o=i.length-1);let l=t;for(;i[o]&&l>=i[o].size;)l-=i[o].size,o++;const _=i[o];if(_){const d=_.size;if(l+e<=d)a=await Y(_,l,e);else{const w=d-l;a=new Uint8Array(e);const m=await Y(_,l,w);a.set(m,0);const S=await r.readUint8Array(t+w,e-w,n);a.set(S,w),m.length+S.length<e&&(a=a.subarray(0,m.length+S.length))}}else a=new Uint8Array;return r.lastDiskNumber=Math.max(o,r.lastDiskNumber),a}}class Ke extends Je{constructor(t,e=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});let r,i,a;const o=new WritableStream({async write(d){const{availableSize:w}=n;if(a)d.length>=w?(await l(d.subarray(0,w)),await _(),n.diskOffset+=r.size,n.diskNumber++,a=null,await this.write(d.subarray(w))):await l(d);else{const{value:m,done:S}=await t.next();if(S&&!m)throw new Error(hs);r=m,r.size=0,r.maxSize&&(n.maxSize=r.maxSize),n.availableSize=n.maxSize,await De(r),i=m.writable,a=i.getWriter(),await this.write(d)}},async close(){await a.ready,await _()}});Object.defineProperty(n,Ot,{get(){return o}});async function l(d){const w=d.length;w&&(await a.ready,await a.write(d),r.size+=w,n.size+=w,n.availableSize-=w)}async function _(){await a.close()}}}class Ss{constructor(t){return Array.isArray(t)&&(t=new Dt(t)),t instanceof ReadableStream&&(t={readable:t}),t}}class Rs{constructor(t){return t.writable===G&&typeof t.next==Pe&&(t=new Ke(t)),t instanceof WritableStream&&(t={writable:t}),t.size===G&&(t.size=0),t instanceof Ke||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}}function ha(s){const{baseURL:t}=Vn(),{protocol:e}=new URL(s,t);return e=="http:"||e=="https:"}async function De(s,t){if(s.init&&!s.initialized)await s.init(t);else return Promise.resolve()}function Y(s,t,e,n){return s.readUint8Array(t,e,n)}const pa=Dt,ma=Ke,As="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),wa=As.length==256;function ga(s){if(wa){let t="";for(let e=0;e<s.length;e++)t+=As[s[e]];return t}else return new TextDecoder().decode(s)}function Ye(s,t){return t&&t.trim().toLowerCase()=="cp437"?ga(s):new TextDecoder(t).decode(s)}const Os="filename",Is="rawFilename",Cs="comment",Ns="rawComment",Ds="uncompressedSize",Ps="compressedSize",ks="offset",pt="diskNumberStart",mt="lastModDate",wt="rawLastModDate",Ls="lastAccessDate",ba="rawLastAccessDate",vs="creationDate",ya="rawCreationDate",Ea="internalFileAttribute",xa="internalFileAttributes",Ta="externalFileAttribute",Sa="externalFileAttributes",Ra="msDosCompatible",Aa="zip64",Oa="encrypted",Ia="version",Ca="versionMadeBy",Na="zipCrypto",Da="directory",Pa="executable",ka="compressionMethod",La="signature",va="extraField",Fa=[Os,Is,Ps,Ds,mt,wt,Cs,Ns,Ls,vs,ks,pt,pt,Ea,xa,Ta,Sa,Ra,Aa,Oa,Ia,Ca,Na,Da,Pa,ka,La,va,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Dn{constructor(t){Fa.forEach(e=>this[e]=t[e])}}const Ma="filenameEncoding",Ua="commentEncoding",Wa="decodeText",Ha="extractPrependedData",Ba="extractAppendedData",ja="password",Ga="rawPassword",Ya="passThrough",qa="signal",Va="checkPasswordOnly",Za="checkOverlappingEntryOnly",Ka="checkOverlappingEntry",Xa="checkSignature",$a="useWebWorkers",Ja="useCompressionStream",Qa="transferStreams",za="preventClose",qe="File format is not recognized",Fs="End of central directory not found",Ms="End of Zip64 central directory locator not found",Us="Central directory header not found",Ws="Local file header not found",Hs="Zip64 extra field not found",Bs="File contains encrypted entry",js="Encryption method not supported",gt="Compression method not supported",bt="Split zip file",Gs="Overlapping entry found",Pn="utf-8",kn="cp437",eo=[[Ds,pe],[Ps,pe],[ks,pe],[pt,le]],to={[le]:{getValue:U,bytes:4},[pe]:{getValue:ye,bytes:8}};class Ys{constructor(t,e={}){Object.assign(this,{reader:new Ss(t),options:e,config:Vn(),readRanges:[]})}async*getEntriesGenerator(t={}){const e=this;let{reader:n}=e;const{config:r}=e;if(await De(n),(n.size===G||!n.readUint8Array)&&(n=new Ct(await new Response(n.readable).blob()),await De(n)),n.size<te)throw new Error(qe);n.chunkSize=li(r);const i=await lo(n,jr,n.size,te,le*16);if(!i){const A=await Y(n,0,4),y=B(A);throw U(y)==Yn?new Error(bt):new Error(Fs)}const a=B(i);let o=U(a,12),l=U(a,16);const _=i.offset,d=q(a,20),w=_+te+d;let m=q(a,4);const S=n.lastDiskNumber||0;let O=q(a,6),u=q(a,8),c=0,f=0;if(l==pe||o==pe||u==le||O==le){const A=await Y(n,i.offset-nt,nt),y=B(A);if(U(y,0)==Gr){l=ye(y,8);let I=await Y(n,l,st,-1),C=B(I);const k=i.offset-nt-st;if(U(C,0)!=ln&&l!=k){const P=l;l=k,l>P&&(c=l-P),I=await Y(n,l,st,-1),C=B(I)}if(U(C,0)!=ln)throw new Error(Ms);m==le&&(m=U(C,16)),O==le&&(O=U(C,20)),u==le&&(u=ye(C,32)),o==pe&&(o=ye(C,40)),l-=o}}if(l>=n.size&&(c=n.size-l-o-te,l=n.size-o-te),S!=m)throw new Error(bt);if(l<0)throw new Error(qe);let p=0,g=await Y(n,l,o,O),E=B(g);if(o){const A=i.offset-o;if(U(E,p)!=cn&&l!=A){const y=l;l=A,l>y&&(c+=l-y),g=await Y(n,l,o,O),E=B(g)}}const R=i.offset-l-(n.lastDiskOffset||0);if(o!=R&&R>=0&&(o=R,g=await Y(n,l,o,O),E=B(g)),l<0||l>=n.size)throw new Error(qe);const h=V(e,t,Ma),x=V(e,t,Ua);for(let A=0;A<u;A++){const y=new so(n,r,e.options);if(U(E,p)!=cn)throw new Error(Us);qs(y,E,p+6);const I=!!y.bitFlag.languageEncodingFlag,C=p+46,k=C+y.filenameLength,P=k+y.extraFieldLength,N=q(E,p+4),H=N>>8==0,L=N>>8==3,j=g.subarray(C,k),D=q(E,p+32),K=P+D,F=g.subarray(P,K),M=I,ve=I,xe=U(E,p+38),ee=H&&(be(E,p+38)&hn)==hn||L&&(xe>>16&ti)==ni||j.length&&j.at(-1)==pn.charCodeAt(0),Q=L&&(xe>>16&si)!=0,Pt=U(E,p+42)+c;Object.assign(y,{versionMadeBy:N,msDosCompatible:H,compressedSize:0,uncompressedSize:0,commentLength:D,directory:ee,offset:Pt,diskNumberStart:q(E,p+34),internalFileAttributes:q(E,p+36),externalFileAttributes:xe,rawFilename:j,filenameUTF8:M,commentUTF8:ve,rawExtraField:g.subarray(k,P),executable:Q}),y.internalFileAttribute=y.internalFileAttributes,y.externalFileAttribute=y.externalFileAttributes;const kt=V(e,t,Wa)||Ye,Lt=M?Pn:h||kn,vt=ve?Pn:x||kn;let Fe=kt(j,Lt);Fe===G&&(Fe=Ye(j,Lt));let Qe=kt(F,vt);Qe===G&&(Qe=Ye(F,vt)),Object.assign(y,{rawComment:F,filename:Fe,comment:Qe,directory:ee||Fe.endsWith(pn)}),f=Math.max(Pt,f),Vs(y,y,E,p+6),y.zipCrypto=y.encrypted&&!y.extraFieldAES;const Te=new Dn(y);Te.getData=(Me,Ue)=>y.getData(Me,Te,e.readRanges,Ue),Te.arrayBuffer=async Me=>{const Ue=new TransformStream,[Ks]=await Promise.all([new Response(Ue.readable).arrayBuffer(),y.getData(Ue,Te,e.readRanges,Me)]);return Ks},p=K;const{onprogress:Ft}=t;if(Ft)try{await Ft(A+1,u,new Dn(y))}catch{}yield Te}const b=V(e,t,Ha),T=V(e,t,Ba);return b&&(e.prependedData=f>0?await Y(n,0,f):new Uint8Array),e.comment=d?await Y(n,_+te,d):new Uint8Array,T&&(e.appendedData=w<n.size?await Y(n,w,n.size-w):new Uint8Array),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){}}class no{constructor(t={}){const{readable:e,writable:n}=new TransformStream,r=new Ys(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(i){const{done:a,value:o}=await r.next();if(a)return i.close();const l={...o,readable:(function(){const{readable:_,writable:d}=new TransformStream;if(o.getData)return o.getData(d),_})()};delete l.getData,i.enqueue(l)}}),this.writable=n}}class so{constructor(t,e,n){Object.assign(this,{reader:t,config:e,options:n})}async getData(t,e,n,r={}){const i=this,{reader:a,offset:o,diskNumberStart:l,extraFieldAES:_,extraFieldZip64:d,compressionMethod:w,config:m,bitFlag:S,signature:O,rawLastModDate:u,uncompressedSize:c,compressedSize:f}=i,{dataDescriptor:p}=S,g=e.localDirectory={},E=await Y(a,o,rt,l),R=B(E);let h=V(i,r,ja),x=V(i,r,Ga);const b=V(i,r,Ya);if(h=h&&h.length&&h,x=x&&x.length&&x,_&&_.originalCompressionMethod!=Wr)throw new Error(gt);if(w!=Ur&&w!=Mr&&!b)throw new Error(gt);if(U(R,0)!=Hr)throw new Error(Ws);qs(g,R,4);const{extraFieldLength:T,filenameLength:A,lastAccessDate:y,creationDate:I}=g;g.rawExtraField=T?await Y(a,o+rt+A,T,l):new Uint8Array,Vs(i,g,R,4,!0),Object.assign(e,{lastAccessDate:y,creationDate:I});const C=i.encrypted&&g.encrypted&&!b,k=C&&!_;if(b||(e.zipCrypto=k),C){if(!k&&_.strength===G)throw new Error(js);if(!h&&!x)throw new Error(Bs)}const P=o+rt+A+T,N=f,H=a.readable;Object.assign(H,{diskNumberStart:l,offset:P,size:N});const L=V(i,r,qa),j=V(i,r,Va);let D=V(i,r,Ka);const K=V(i,r,Za);K&&(D=!0);const{onstart:F,onprogress:M,onend:ve}=r,xe={options:{codecType:fs,password:h,rawPassword:x,zipCrypto:k,encryptionStrength:_&&_.strength,signed:V(i,r,Xa)&&!b,passwordVerification:k&&(p?u>>>8&255:O>>>24&255),outputSize:c,signature:O,compressed:w!=0&&!b,encrypted:i.encrypted&&!b,useWebWorkers:V(i,r,$a),useCompressionStream:V(i,r,Ja),transferStreams:V(i,r,Qa),checkPasswordOnly:j},config:m,streamOptions:{signal:L,size:N,onstart:F,onprogress:M,onend:ve}};D&&await co({reader:a,fileEntry:e,offset:o,diskNumberStart:l,signature:O,compressedSize:f,uncompressedSize:c,dataOffset:P,dataDescriptor:p||g.bitFlag.dataDescriptor,extraFieldZip64:d||g.extraFieldZip64,readRanges:n});let ee;try{if(!K){j&&(t=new WritableStream),t=new Rs(t),await De(t,b?f:c),{writable:ee}=t;const{outputSize:Q}=await Ki({readable:H,writable:ee},xe);if(t.size+=Q,Q!=(b?f:c))throw new Error(Rt)}}catch(Q){if(Q.outputSize!==G&&(t.size+=Q.outputSize),!j||Q.message!=xt)throw Q}finally{!V(i,r,za)&&ee&&!ee.locked&&await ee.getWriter().close()}return j||K?G:t.getData?t.getData():ee}}function qs(s,t,e){const n=s.rawBitFlag=q(t,e+2),r=(n&un)==un,i=U(t,e+6);Object.assign(s,{encrypted:r,version:q(t,e),bitFlag:{level:(n&ei)>>1,dataDescriptor:(n&dn)==dn,languageEncodingFlag:(n&_n)==_n},rawLastModDate:i,lastModDate:fo(i),filenameLength:q(t,e+22),extraFieldLength:q(t,e+24)})}function Vs(s,t,e,n,r){const{rawExtraField:i}=t,a=t.extraField=new Map,o=B(new Uint8Array(i));let l=0;try{for(;l<i.length;){const f=q(o,l),p=q(o,l+2);a.set(f,{type:f,data:i.slice(l+4,l+4+p)}),l+=4+p}}catch{}const _=q(e,n+4);Object.assign(t,{signature:U(e,n+ri),compressedSize:U(e,n+ii),uncompressedSize:U(e,n+ai)});const d=a.get(Vr);d&&(ro(d,t),t.extraFieldZip64=d);const w=a.get(Jr);w&&(Ln(w,Os,Is,t,s),t.extraFieldUnicodePath=w);const m=a.get(Qr);m&&(Ln(m,Cs,Ns,t,s),t.extraFieldUnicodeComment=m);const S=a.get(Zr);S?(io(S,t,_),t.extraFieldAES=S):t.compressionMethod=_;const O=a.get(Kr);O&&(ao(O,t),t.extraFieldNTFS=O);const u=a.get($r);u&&(oo(u,t,r),t.extraFieldExtendedTimestamp=u);const c=a.get(zr);c&&(t.extraFieldUSDZ=c)}function ro(s,t){t.zip64=!0;const e=B(s.data),n=eo.filter(([r,i])=>t[r]==i);for(let r=0,i=0;r<n.length;r++){const[a,o]=n[r];if(t[a]==o){const l=to[o];t[a]=s[a]=l.getValue(e,i),i+=l.bytes}else if(s[a])throw new Error(Hs)}}function Ln(s,t,e,n,r){const i=B(s.data),a=new Ve;a.append(r[e]);const o=B(new Uint8Array(4));o.setUint32(0,a.get(),!0);const l=U(i,1);Object.assign(s,{version:be(i,0),[t]:Ye(s.data.subarray(5)),valid:!r.bitFlag.languageEncodingFlag&&l==U(o,0)}),s.valid&&(n[t]=s[t],n[t+"UTF8"]=!0)}function io(s,t,e){const n=B(s.data),r=be(n,4);Object.assign(s,{vendorVersion:be(n,0),vendorId:be(n,2),strength:r,originalCompressionMethod:e,compressionMethod:q(n,5)}),t.compressionMethod=s.compressionMethod}function ao(s,t){const e=B(s.data);let n=4,r;try{for(;n<s.data.length&&!r;){const i=q(e,n),a=q(e,n+2);i==Xr&&(r=s.data.slice(n+4,n+4+a)),n+=4+a}}catch{}try{if(r&&r.length==24){const i=B(r),a=i.getBigUint64(0,!0),o=i.getBigUint64(8,!0),l=i.getBigUint64(16,!0);Object.assign(s,{rawLastModDate:a,rawLastAccessDate:o,rawCreationDate:l});const _=ct(a),d=ct(o),w=ct(l),m={lastModDate:_,lastAccessDate:d,creationDate:w};Object.assign(s,m),Object.assign(t,m)}}catch{}}function oo(s,t,e){const n=B(s.data),r=be(n,0),i=[],a=[];e?((r&1)==1&&(i.push(mt),a.push(wt)),(r&2)==2&&(i.push(Ls),a.push(ba)),(r&4)==4&&(i.push(vs),a.push(ya))):s.data.length>=5&&(i.push(mt),a.push(wt));let o=1;i.forEach((l,_)=>{if(s.data.length>=o+4){const d=U(n,o);t[l]=s[l]=new Date(d*1e3);const w=a[_];s[w]=d}o+=4})}async function co({reader:s,fileEntry:t,offset:e,diskNumberStart:n,signature:r,compressedSize:i,uncompressedSize:a,dataOffset:o,dataDescriptor:l,extraFieldZip64:_,readRanges:d}){let w=0;if(n)for(let O=0;O<n;O++){const u=s.readers[O];w+=u.size}let m=0;if(l&&(_?m=qr:m=Yr),m){const O=await Y(s,o+i,m+fn,n);if(U(B(O),0)==Br){const c=U(B(O),4);let f,p;_?(f=ye(B(O),8),p=ye(B(O),16)):(f=U(B(O),8),p=U(B(O),12)),(t.encrypted&&!t.zipCrypto||c==r)&&f==i&&p==a&&(m+=fn)}}const S={start:w+e,end:w+o+i+m,fileEntry:t};for(const O of d)if(O.fileEntry!=t&&S.start>=O.start&&S.start<O.end){const u=new Error(Gs);throw u.overlappingEntry=O.fileEntry,u}d.push(S)}async function lo(s,t,e,n,r){const i=new Uint8Array(4),a=B(i);uo(a,0,t);const o=n+r;return await l(n)||await l(Math.min(o,e));async function l(_){const d=e-_,w=await Y(s,d,_);for(let m=w.length-n;m>=0;m--)if(w[m]==i[0]&&w[m+1]==i[1]&&w[m+2]==i[2]&&w[m+3]==i[3])return{offset:d+m,buffer:w.slice(m,m+n).buffer}}}function V(s,t,e){return t[e]===G?s.options[e]:t[e]}function fo(s){const t=(s&4294901760)>>16,e=s&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 ct(s){return new Date(Number(s/BigInt(1e4)-BigInt(116444736e5)))}function be(s,t){return s.getUint8(t)}function q(s,t){return s.getUint16(t,!0)}function U(s,t){return s.getUint32(t,!0)}function ye(s,t){return Number(s.getBigUint64(t,!0))}function uo(s,t,e){s.setUint32(t,e,!0)}function B(s){return new DataView(s.buffer)}Zn({Inflate:Fr});const _o=Object.freeze(Object.defineProperty({__proto__:null,BlobReader:Ct,BlobWriter:ws,Data64URIReader:ia,Data64URIWriter:aa,ERR_BAD_FORMAT:qe,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Us,ERR_ENCRYPTED:Bs,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Ms,ERR_EOCDR_NOT_FOUND:Fs,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Hs,ERR_HTTP_RANGE:Le,ERR_INVALID_PASSWORD:yt,ERR_INVALID_SIGNATURE:Et,ERR_INVALID_UNCOMPRESSED_SIZE:Rt,ERR_ITERATOR_COMPLETED_TOO_SOON:hs,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Ws,ERR_OVERLAPPING_ENTRY:Gs,ERR_SPLIT_ZIP_FILE:bt,ERR_UNSUPPORTED_COMPRESSION:gt,ERR_UNSUPPORTED_ENCRYPTION:js,ERR_WRITER_NOT_INITIALIZED:ps,GenericReader:Ss,GenericWriter:Rs,HttpRangeReader:ua,HttpReader:Ts,Reader:_e,SplitDataReader:Dt,SplitDataWriter:Ke,SplitZipReader:pa,SplitZipWriter:ma,TextReader:oa,TextWriter:ca,Uint8ArrayReader:da,Uint8ArrayWriter:_a,Writer:It,ZipReader:Ys,ZipReaderStream:no,configure:Zn,getMimeType:fi,initStream:De,readUint8Array:Y,terminateWorkers:$i},Symbol.toStringTag,{value:"Module"})),Ae=_o;class ho{constructor(t,e){Ae.configure({baseURL:self.location.href}),this._zipReader=new Ae.ZipReader(new Ae.HttpReader(this._resolveTraceURI(t),{mode:"cors",preventHeadRequest:!0}),{useWebWorkers:!1}),this._entriesPromise=this._zipReader.getEntries({onprogress:e}).then(n=>{const r=new Map;for(const i of n)r.set(i.filename,i);return r})}_resolveTraceURI(t){return t.startsWith("https://www.dropbox.com/")?"https://dl.dropboxusercontent.com/"+t.substring(24):t}isLive(){return!1}async entryNames(){return[...(await this._entriesPromise).keys()]}async hasEntry(t){return(await this._entriesPromise).has(t)}async readText(t){var i;const n=(await this._entriesPromise).get(t);if(!n)return;const r=new Ae.TextWriter;return await((i=n.getData)==null?void 0:i.call(n,r)),r.getData()}async readBlob(t){const n=(await this._entriesPromise).get(t);if(!n)return;const r=new Ae.BlobWriter;return await n.getData(r),r.getData()}}class po{constructor(t){this._entriesPromise=this._readFile(t).then(async e=>{if(!e)throw new Error("File not found");const n=await e.json(),r=new Map;for(const i of n.entries)r.set(i.name,i.path);return r})}isLive(){return!0}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 n=(await this._entriesPromise).get(t);if(n)return this._readFile(n)}async _readFile(t){const e=await fetch(t);if(e.status!==404)return e}}self.addEventListener("install",function(s){self.skipWaiting()});self.addEventListener("activate",function(s){s.waitUntil(self.clients.claim())});const mo=new URL(self.registration.scope).pathname,Ee=new Map,Xe=new Map,vn=self.registration.scope.startsWith("https://");function wo(){Ee.clear(),Xe.clear()}async function Fn(s,t,e){try{return{loadedTrace:await Zs(s,t,e)}}catch(n){return{errorResponse:new Response(JSON.stringify({error:n==null?void 0:n.message}),{status:500,headers:{"Content-Type":"application/json"}})}}}function Zs(s,t,e){const n=t.searchParams.get("trace");if(!n)throw new Error("trace parameter is missing");Xe.set(s,n);const r=Ee.get(n);if(r)return r;const i=go(n,e);return Ee.set(n,i),i.catch(()=>Ee.delete(n)),i}async function go(s,t){var r;await Eo();const e=new hr;try{const[i,a]=mr(t,[.5,.4,.1]),o=To(s)||s.endsWith("traces.dir")?new po(s):new ho(s,i);await e.load(o,void 0,a)}catch(i){if(console.error(i),(r=i==null?void 0:i.message)!=null&&r.includes("Cannot find .trace file")&&await e.hasEntry("index.html"))throw 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.");if(i instanceof Bn)throw new Error(`Could not load trace from ${s}. ${i.message}`);let a=`Could not load trace from ${s}. Make sure a valid Playwright Trace is accessible over this url.`;const o=await navigator.permissions.query({name:"local-network-access"}).catch(()=>{});throw o&&o.state!=="granted"&&(a+=`
|
|
|
|
If your trace is in a local or private network, please grant permission for Local Network Access.`),new Error(a)}const n=new Xs(e.storage(),i=>e.resourceForSha1(i));return{traceLoader:e,snapshotServer:n}}async function bo(s){const t=s.request;if(t.url.startsWith("chrome-extension://"))return fetch(t);const e=new URL(t.url);let n;if(t.url.startsWith(self.registration.scope)&&(n=e.pathname.substring(mo.length-1)),n==="/restartServiceWorker")return wo(),new Response(null,{status:200});if(n==="/ping")return new Response(null,{status:200});const r=!!s.resultingClientId,i=s.clientId?await self.clients.get(s.clientId):void 0;if(r&&!(n!=null&&n.startsWith("/sha1/"))){if(n!=null&&n.startsWith("/snapshot/")){const{errorResponse:a,loadedTrace:o}=await Fn(s.resultingClientId,e,xo);if(a)return a;const l=n.substring(10),_=o.snapshotServer.serveSnapshot(l,e.searchParams,e.href);return vn&&_.headers.set("Content-Security-Policy","upgrade-insecure-requests"),_}return fetch(s.request)}if(!n){if(!i)return new Response("Sub-resource without a client",{status:500});const{snapshotServer:a}=await Zs(i.id,new URL(i.url),Mn(i));if(!a)return new Response(null,{status:404});const o=[t.url];return vn&&t.url.startsWith("https://")&&o.push(t.url.replace(/^https/,"http")),a.serveResource(o,t.method,i.url)}if(n==="/contexts"||n.startsWith("/snapshotInfo/")||n.startsWith("/closest-screenshot/")||n.startsWith("/sha1/")){if(!i)return new Response("Sub-resource without a client",{status:500});const{errorResponse:a,loadedTrace:o}=await Fn(i.id,e,Mn(i));if(a)return a;if(n==="/contexts")return new Response(JSON.stringify(o.traceLoader.contextEntries),{status:200,headers:{"Content-Type":"application/json"}});if(n.startsWith("/snapshotInfo/")){const l=n.substring(14);return o.snapshotServer.serveSnapshotInfo(l,e.searchParams)}if(n.startsWith("/closest-screenshot/")){const l=n.substring(20);return o.snapshotServer.serveClosestScreenshot(l,e.searchParams)}if(n.startsWith("/sha1/")){const l=await o.traceLoader.resourceForSha1(n.slice(6));return l?new Response(l,{status:200,headers:yo(e.searchParams)}):new Response(null,{status:404})}}return fetch(s.request)}function yo(s){const t=s.get("dn"),e=s.get("dct");if(!t)return;const n=new Headers;return n.set("Content-Disposition",`attachment; filename="attachment"; filename*=UTF-8''${encodeURIComponent(t)}`),e&&n.set("Content-Type",e),n}async function Eo(){const s=await self.clients.matchAll(),t=new Set;for(const[e,n]of Xe){if(!s.find(r=>r.id===e)){Xe.delete(e);continue}t.add(n)}for(const e of Ee.keys())t.has(e)||Ee.delete(e)}function Mn(s){return(t,e)=>{s.postMessage({method:"progress",params:{done:t,total:e}})}}function xo(s,t){}function To(s){const e=new URL(s,"http://localhost").searchParams.get("path");return!!(e!=null&&e.endsWith(".json"))}self.addEventListener("fetch",function(s){if(s.request.headers.get("x-pw-serviceworker")==="skip")return!1;s.respondWith(bo(s))});
|